diff --git a/.gitignore b/.gitignore index c5e2e91..b2a636b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ /coverage # production -/build /dist # Vite diff --git a/build/OIG e(1).png b/build/OIG e(1).png new file mode 100644 index 0000000..84e4ed0 Binary files /dev/null and b/build/OIG e(1).png differ diff --git a/build/android-chrome-192x192.png b/build/android-chrome-192x192.png new file mode 100644 index 0000000..8686518 Binary files /dev/null and b/build/android-chrome-192x192.png differ diff --git a/build/android-chrome-512x512.png b/build/android-chrome-512x512.png new file mode 100644 index 0000000..e9d92f7 Binary files /dev/null and b/build/android-chrome-512x512.png differ diff --git a/build/apple-touch-icon.png b/build/apple-touch-icon.png new file mode 100644 index 0000000..e5d1d9b Binary files /dev/null and b/build/apple-touch-icon.png differ diff --git a/build/assets/Add--yVWBJhC.js b/build/assets/Add--yVWBJhC.js new file mode 100644 index 0000000..ae9b874 --- /dev/null +++ b/build/assets/Add--yVWBJhC.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,d=o(a()),v=t;u=e.default=(0,d.default)((0,v.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");export{u as d}; diff --git a/build/assets/AddCircleOutline-C8LXM-k8.js b/build/assets/AddCircleOutline-C8LXM-k8.js new file mode 100644 index 0000000..2d0f9a5 --- /dev/null +++ b/build/assets/AddCircleOutline-C8LXM-k8.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},i=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,o=i(a()),v=t;u=e.default=(0,o.default)((0,v.jsx)("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline");export{u as d}; diff --git a/build/assets/AdminHatchings-CjLz-abB.js b/build/assets/AdminHatchings-CjLz-abB.js new file mode 100644 index 0000000..92a58a0 --- /dev/null +++ b/build/assets/AdminHatchings-CjLz-abB.js @@ -0,0 +1,2 @@ +import{j as o,I as v0,d as D0,B as j0,b as y,T as x,aL as $,aM as H,aN as T}from"./mui-vendor-CkIVaoQP.js";import{r as h,j as d0}from"./react-vendor-CmFgShSM.js";import{C as E0}from"./CityManageHatchings-vNwIRT4N.js";import{L as U6,j as X6,h as J6,p as f,_ as K,aE as S0,G as s,O as k0,k as W}from"./index-CeyyVc1v.js";import{a as L0,u as I0}from"./redux-vendor-B7uoacJt.js";import{C as X}from"./ChechClearanceCode-lPasOZZ_.js";import{B as R0}from"./BackButton-Crzr7NMa.js";import{R as Q}from"./ResponsiveTable-w7hk7Uq8.js";import{I as w0}from"./index.esm-C4MeAo59.js";import{a as q0}from"./ProvinceBarDifference-CBv5I_nz.js";import"./CityHatchingInfo-CZPJ_c_O.js";import"./index.esm-Bu7XMDZU.js";import"./iconBase-BEJYyZsk.js";import"./Add--yVWBJhC.js";import"./CityNewKillRequest-C2SXYvKb.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";import"./Done-Dp5awdte.js";import"./aviculture-get-unions-C1NoVg85.js";import"./aviculture-get-hatching-data-DsjDNd82.js";import"./NumberFormatCustom-DwWPj40N.js";import"./DialogAlert-BfXcr-Kr.js";import"./SimpleTable-DBAoNnCU.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./province-get-sell-for-freezing-status-ieuVFEgW.js";import"./province-policy-market-daily-limitation-DueqDboR.js";import"./isValidIndexWeight-C_ik-uYa.js";import"./LabelField-B6eRSoQP.js";import"./CityHatchingsArchiveOperations-DQ9mbEeF.js";import"./Tune-D4M2CAhp.js";import"./FileUploader-DT5gIVb3.js";import"./CloudUpload-BlIgB_r9.js";import"./CheckCircle-zgBvZQ-b.js";import"./index-9Ymn_7Kv.js";import"./Sms-DasNClAG.js";import"./Edit-CqBj1Y2L.js";import"./ShowImage-CqhU2hmk.js";import"./Download-DQ-VVIaV.js";import"./ToggleOffOutlined-Ch26Umk7.js";import"./ToggleOn-pBgb8alR.js";import"./AdvancedTable-BYmmBtmq.js";import"./getProvinceName-BujSmyBy.js";import"./Article-DcCZ1D5y.js";import"./Pageview-TRcW_9jm.js";import"./AddCircleOutline-C8LXM-k8.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./toBase64-BzgTOHsW.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./resizeImage-Csf2MO3w.js";const $0=L0("GET_CITY_HATCHING_SHOW_DETAIL_SERVICE",async(v,{dispatch:l})=>{l(U6());const{data:G,status:z}=await X6.get(`hatching-detail/?key=${v.keyItem}`,{params:{d:v}});return l(J6()),{data:G,status:z}}),H0=({keyItem:v})=>{const[l,G]=h.useState(null),[z,V6]=h.useState([]),[U,Y6]=h.useState([]),[Z6,b6]=h.useState([]),[m6,u0]=h.useState([]),[l0,o0]=h.useState([]),[e0,n0]=h.useState([]),[s0,C0]=h.useState([]),[r0,c0]=h.useState([]),[A0,t0]=h.useState([]),[F0,p0]=h.useState([]),M=I0();return h.useEffect(()=>{M(U6()),M($0({keyItem:v})).then(C=>{G(C.payload.data),M(J6())})},[]),h.useEffect(()=>{var J,V,Y,Z,b,m,uu,lu,ou,eu,nu,su,Cu,ru,cu,Au,tu,Fu,pu,gu,xu,hu,iu,au,fu,yu,vu,Du,ju,du,Eu,Su,ku,Lu,Iu,Ru,wu,qu,$u,Hu,Tu,Wu,Qu,Bu,Ou,Nu,Pu,Ku,Mu,_u,Gu,zu,Uu,Xu,Ju,Vu,Yu,Zu,bu,mu,u6,l6,o6,e6,n6,s6,C6,r6,c6,A6,t6,F6,p6,g6;const C=[{title:"نام فارم",value:((J=l==null?void 0:l.poultry)==null?void 0:J.unitName)||"-"},{title:"مرغدار",value:(V=l==null?void 0:l.poultry)!=null&&V.user?`${(Y=l.poultry)==null?void 0:Y.user.fullname} (${(b=(Z=l.poultry)==null?void 0:Z.user)==null?void 0:b.mobile})`:"-"},{title:"بهره برداری",value:(l==null?void 0:l.InteractTypeName)||"-"},{title:"تاریخ جوجه ریزی",value:f(l==null?void 0:l.date)||"-"},{title:"حجم جوجه ریزی",value:((m=l==null?void 0:l.quantity)==null?void 0:m.toLocaleString())||"-"},{title:"سن",value:(l==null?void 0:l.chickenAge)||"-"},{title:"نژاد",value:(l==null?void 0:l.chickenBreed)||"-"},{title:"وضعیت",value:l!=null&&l.violation?"پیگیری":"عادی"},{title:"شماره مجوز جوجه ریزی",value:(l==null?void 0:l.licenceNumber)||"-"},{title:"شناسه یکتا",value:((uu=l==null?void 0:l.poultry)==null?void 0:uu.breedingUniqueId)||"-"},{title:"مجوز بهداشتی جوجه ریزی",value:(l==null?void 0:l.CertId)||"-"},{title:"ارتباط",value:(l==null?void 0:l.UnionTypeName)||"-"},{title:"استان",value:((eu=(ou=(lu=l==null?void 0:l.poultry)==null?void 0:lu.address)==null?void 0:ou.province)==null?void 0:eu.name)||"-"},{title:"دامپزشک فارم",value:l!=null&&l.vetFarm?`${(nu=l==null?void 0:l.vetFarm)==null?void 0:nu.vetFarmFullName} (${(su=l==null?void 0:l.vetFarm)==null?void 0:su.vetFarmMobile})`:"-"},{title:"سالن",value:(l==null?void 0:l.hall)||"-"},{title:"دوره جوجه ریزی",value:(l==null?void 0:l.period)||"-"},{title:"تاریخ ثبت جوجه ریزی",value:f(l==null?void 0:l.createDate)||"-"},{title:"میانگین سن کشتار",value:((Cu=l==null?void 0:l.killingAveAge)==null?void 0:Cu.toLocaleString())||"-"},{title:"پیش بینی تاریخ کشتار",value:f(l==null?void 0:l.predicateDate)||"-"},{title:"مالکیت",value:(l==null?void 0:l.PersonTypeName)||"-"}],B=[{title:" تایید تخلیه در رصدیار",value:`%${(((l==null?void 0:l.killedQuantity)+(l==null?void 0:l.totalLosses))*100/(l==null?void 0:l.quantity)).toFixed(0)}`},{title:" تایید تخلیه در سماصط",value:l!=null&&l.samasatDischargePercentage?`%${l==null?void 0:l.samasatDischargePercentage}`:"-"},{title:"حجم کشتار شده",value:l!=null&&l.killedQuantity?`${(ru=l==null?void 0:l.killedQuantity)==null?void 0:ru.toLocaleString()} (%${((l==null?void 0:l.killedQuantity)*100/(l==null?void 0:l.quantity)).toFixed(0)})`:"0 (0%)"},{title:"حجم تخصیصات بازگشتی",value:((Au=(cu=l==null?void 0:l.killingInfo)==null?void 0:cu.returnProvinceKillRequestsQuantity)==null?void 0:Au.toLocaleString())||"0"},{title:"وزن تخصیصات بازگشتی",value:((Fu=(tu=l==null?void 0:l.killingInfo)==null?void 0:tu.returnProvinceKillRequestsWeight)==null?void 0:Fu.toLocaleString())||"0"},{title:"حجم بارهای بازگشتی",value:((gu=(pu=l==null?void 0:l.killingInfo)==null?void 0:pu.returnKillHouseQuantity)==null?void 0:gu.toLocaleString())||"0"},{title:"وزن بارهای بازگشتی",value:((hu=(xu=l==null?void 0:l.killingInfo)==null?void 0:xu.returnKillHouseWeight)==null?void 0:hu.toLocaleString())||"0"},{title:"حجم مانده در سالن",value:l!=null&&l.leftOver?`${l==null?void 0:l.leftOver.toLocaleString()} (%${((l==null?void 0:l.leftOver)*100/(l==null?void 0:l.quantity)).toFixed(0)})`:"0 (0%)"},{title:"تلفات کل",value:l!=null&&l.totalLosses?`${l==null?void 0:l.totalLosses.toLocaleString()} (%${((l==null?void 0:l.totalLosses)*100/(l==null?void 0:l.quantity)).toFixed(0)})`:"0 (0%)"},{title:"وزن کل کشتار",value:((iu=l==null?void 0:l.totalKilledWeight)==null?void 0:iu.toLocaleString())||"0"},{title:"تعداد بارها",value:((fu=(au=l==null?void 0:l.killingInfo)==null?void 0:au.killHouseRequests)==null?void 0:fu.toLocaleString())||"0"},{title:"حجم بارها",value:((vu=(yu=l==null?void 0:l.killingInfo)==null?void 0:yu.killHouseRequestsFirstQuantity)==null?void 0:vu.toLocaleString())||"0"},{title:"وزن بارها",value:((ju=(Du=l==null?void 0:l.killingInfo)==null?void 0:Du.killHouseRequestsFirstWeight)==null?void 0:ju.toLocaleString())||"0"},{title:"افت بارها",value:`${(Eu=(du=l==null?void 0:l.killingInfo)==null?void 0:du.wareHouseBarsWeightLose)==null?void 0:Eu.toFixed()}%`||"0"},{title:"حجم فروش به داخل استان",value:((ku=(Su=l==null?void 0:l.killingInfo)==null?void 0:Su.totalSaleInProvinceQuantity)==null?void 0:ku.toLocaleString())||"0"},{title:"وزن فروش به داخل استان",value:((Iu=(Lu=l==null?void 0:l.killingInfo)==null?void 0:Lu.totalSaleInProvinceWeight)==null?void 0:Iu.toLocaleString())||"0"},{title:"حجم فروش به خارج استان",value:((Ru=l==null?void 0:l.outProvinceKilledQuantity)==null?void 0:Ru.toLocaleString())||"0"},{title:"وزن فروش به خارج استان",value:((wu=l==null?void 0:l.outProvinceKilledWeight)==null?void 0:wu.toLocaleString())||"0"},{title:"حجم اختلاف کشتار",value:(l==null?void 0:l.barDifferenceRequestQuantity)||"0"},{title:"وزن اختلاف کشتار",value:(l==null?void 0:l.barDifferenceRequestWeight)||"0"},{title:"تعداد بارهای تحویلی",value:(($u=(qu=l==null?void 0:l.killingInfo)==null?void 0:qu.barCompleteWithKillHouse)==null?void 0:$u.toLocaleString())||"0"},{title:"حجم بارهای تحویلی",value:((Tu=(Hu=l==null?void 0:l.killingInfo)==null?void 0:Hu.acceptedRealQuantityFinal)==null?void 0:Tu.toLocaleString())||"0"},{title:"وزن بارهای تحویلی",value:((Qu=(Wu=l==null?void 0:l.killingInfo)==null?void 0:Wu.acceptedRealWightFinal)==null?void 0:Qu.toLocaleString())||"0"},{title:"بارهای ورودی به انبار",value:((Ou=(Bu=l==null?void 0:l.killingInfo)==null?void 0:Bu.wareHouseBars)==null?void 0:Ou.toLocaleString())||"0"},{title:"حجم لاشه های انبار",value:((Pu=(Nu=l==null?void 0:l.killingInfo)==null?void 0:Nu.wareHouseBarsQuantity)==null?void 0:Pu.toLocaleString())||"0"},{title:"وزن لاشه های انبار",value:((Mu=(Ku=l==null?void 0:l.killingInfo)==null?void 0:Ku.wareHouseBarsWeight)==null?void 0:Mu.toLocaleString())||"0"},{title:"حجم تعهد دولتی",value:((_u=l==null?void 0:l.totalCommitmentQuantity)==null?void 0:_u.toLocaleString())||"0"},{title:"حجم کشتار دولتی",value:((Gu=l==null?void 0:l.governmentalQuantity)==null?void 0:Gu.toLocaleString())||"0"},{title:"حجم تعهد آزاد",value:((zu=l==null?void 0:l.totalFreeCommitmentQuantity)==null?void 0:zu.toLocaleString())||"0"},{title:"حجم کشتار آزاد",value:((Uu=l==null?void 0:l.freeQuantity)==null?void 0:Uu.toLocaleString())||"0"},{title:"تخصیصات بدون بار",value:((Ju=(Xu=l==null?void 0:l.killingInfo)==null?void 0:Xu.provinceKillRequests)==null?void 0:Ju.toLocaleString())||"0"},{title:"حجم تخصیصات بدون بار",value:((Yu=(Vu=l==null?void 0:l.killingInfo)==null?void 0:Vu.provinceKillRequestsQuantity)==null?void 0:Yu.toLocaleString())||"0"},{title:"وزن تخصیصات بدون بار",value:((bu=(Zu=l==null?void 0:l.killingInfo)==null?void 0:Zu.provinceKillRequestsWeight)==null?void 0:bu.toLocaleString())||"0"},{title:"وزن تعهد دولتی",value:((mu=l==null?void 0:l.totalCommitment)==null?void 0:mu.toLocaleString())||"0"},{title:"میانگین وزن کشتار",value:((u6=l==null?void 0:l.totalAverageKilledWeight)==null?void 0:u6.toLocaleString())||"0"},{title:"تعداد کشتار فعال",value:(l6=l==null?void 0:l.activeKill)!=null&&l6.activeKill?"دارد":"ندارد"},{title:"تعداد درخواست کشتار",value:((o6=l==null?void 0:l.activeKill)==null?void 0:o6.countOfRequest)||"0"},{title:"حجم افزایشی",value:((e6=l==null?void 0:l.increaseQuantity)==null?void 0:e6.toLocaleString())||"0"},{title:"تلفات دامپزشک",value:l!=null&&l.losses?`${l==null?void 0:l.losses.toLocaleString()} (%${((l==null?void 0:l.losses)*100/(l==null?void 0:l.quantity)).toFixed(0)})`:"0 (0%)"},{title:"تلفات اتحادیه",value:l!=null&&l.directLosses?`${l==null?void 0:l.directLosses.toLocaleString()} (%${((l==null?void 0:l.directLosses)*100/(l==null?void 0:l.quantity)).toFixed(0)})`:"0 (0%)"},{title:"آخرین تغییر",value:l!=null&&l.latestHatchingChange?`${(n6=l==null?void 0:l.latestHatchingChange)==null?void 0:n6.fullName} در تاریخ ${K((s6=l==null?void 0:l.latestHatchingChange)==null?void 0:s6.date)}`:"-"}],_=(C6=l==null?void 0:l.bars)==null?void 0:C6.map((u,r)=>{var e,n,c,A,t,F,p,g,i,a,D,j,d,E,S,k,L,I,R,w,q,O,N,P;return[r+1,u==null?void 0:u.barCode,(u==null?void 0:u.status)||"-",(e=u==null?void 0:u.poultryRequest)!=null&&e.freeSaleInProvince?"آزاد":"دولتی",f(u==null?void 0:u.date),((n=u==null?void 0:u.buyer)==null?void 0:n.name)||"-",((t=(A=(c=u==null?void 0:u.buyer)==null?void 0:c.killHouseOperator)==null?void 0:A.user)==null?void 0:t.mobile)||"-",u!=null&&u.killerInfo?`${(g=(p=(F=u==null?void 0:u.killerInfo)==null?void 0:F.killHouseOperator)==null?void 0:p.user)==null?void 0:g.fullname}(${(D=(a=(i=u==null?void 0:u.killerInfo)==null?void 0:i.killHouseOperator)==null?void 0:a.user)==null?void 0:D.mobile})`:"-",((j=u==null?void 0:u.poultryRequest)==null?void 0:j.age)||"-",(u==null?void 0:u.product)||"-",`${(k=(S=(E=(d=u==null?void 0:u.buyer)==null?void 0:d.killHouseOperator)==null?void 0:E.address)==null?void 0:S.province)==null?void 0:k.name}(${(w=(R=(I=(L=u==null?void 0:u.buyer)==null?void 0:L.killHouseOperator)==null?void 0:I.address)==null?void 0:R.city)==null?void 0:w.name})`||"-",o.jsx(X,{clearanceCode:(u==null?void 0:u.clearanceCode)||"-"},r),(u==null?void 0:u.quarantineQuantity)||"-",((q=u==null?void 0:u.acceptedRealQuantity)==null?void 0:q.toLocaleString())||"-",((O=u==null?void 0:u.acceptedRealWeight)==null?void 0:O.toLocaleString())||"-",((N=u==null?void 0:u.wareHouseAcceptedRealQuantity)==null?void 0:N.toLocaleString())||"-",((P=u==null?void 0:u.wareHouseAcceptedRealWeight)==null?void 0:P.toLocaleString())||"-"]}),g0=(r6=l==null?void 0:l.outBars)==null?void 0:r6.map((u,r)=>{var e,n;return[r+1,u==null?void 0:u.orderCode,f(u==null?void 0:u.sendDate),(u==null?void 0:u.buyerFullname)||"-",(u==null?void 0:u.buyerMobile)||"-","مرغ گرم",`${u==null?void 0:u.buyerProvince}(${u==null?void 0:u.buyerProvince})`||"-",o.jsx(X,{clearanceCode:(u==null?void 0:u.quarantineCode)||"-"},r),(u==null?void 0:u.quarantinQuantity)||"-",(u==null?void 0:u.killingAge)||"-",((e=u==null?void 0:u.quantity)==null?void 0:e.toLocaleString())||"-",((n=u==null?void 0:u.weight)==null?void 0:n.toLocaleString())||"-"]}),x0=(c6=l==null?void 0:l.differentBars)==null?void 0:c6.map((u,r)=>{var e;return[r+1,(u==null?void 0:u.ResideDatePersian)||"-",((e=u==null?void 0:u.GoodAmount)==null?void 0:e.toLocaleString())||"-",u!=null&&u.Out?"خارج استان":"داخل استان",(u==null?void 0:u.Age)||"-",(u==null?void 0:u.TrackingStatusDescription)||"-",(u==null?void 0:u.DesUnitName)||"-",(u==null?void 0:u.GoodName)||"-",(u==null?void 0:u.City)||"-",(u==null?void 0:u.TrackingCode)||"-"]}),h0=(A6=l==null?void 0:l.returnKillHouseRequest)==null?void 0:A6.map((u,r)=>{var A,t,F,p,g,i,a,D,j,d,E,S,k,L,I,R,w,q,O,N,P,x6,h6,i6,a6,f6,y6,v6,D6,j6,d6,E6,S6,k6,L6,I6,R6,w6,q6,$6,H6,T6,W6,Q6,B6,O6,N6,P6,K6,M6,_6,G6,z6;let e="";u.state==="pending"?e="در انتظار تایید":u.state==="accepted"?e="تایید شده":u.state==="rejected"&&(e="رد شده");let n="";(A=u==null?void 0:u.poultryRequest)!=null&&A.market?n="پنل معاملات":(t=u==null?void 0:u.poultryRequest)!=null&&t.directBuying?n="خرید مستقیم":u!=null&&u.warehouse?n="انبار":n="اتحادیه";let c="";return(F=u==null?void 0:u.poultryRequest)!=null&&F.freezing?c="انجماد":(p=u==null?void 0:u.poultryRequest)!=null&&p.export?c="صادرات":c="عادی",[r+1,(u==null?void 0:u.barCode)||"-",((g=u==null?void 0:u.poultryRequest)==null?void 0:g.orderCode)||"-",n,c,((a=(i=u==null?void 0:u.poultryRequest)==null?void 0:i.poultry)==null?void 0:a.unitName)||"-",`${((d=(j=(D=u==null?void 0:u.poultryRequest)==null?void 0:D.poultry)==null?void 0:j.user)==null?void 0:d.fullname)||"-"} (${((k=(S=(E=u==null?void 0:u.poultryRequest)==null?void 0:E.poultry)==null?void 0:S.user)==null?void 0:k.mobile)||"-"})`,(L=u==null?void 0:u.poultryRequest)==null?void 0:L.age,((q=(w=(R=(I=u==null?void 0:u.poultryRequest)==null?void 0:I.poultry)==null?void 0:R.address)==null?void 0:w.city)==null?void 0:q.name)||"-",K((O=u==null?void 0:u.killRequest)==null?void 0:O.reciveDate)||f(u==null?void 0:u.date)||"-",((N=u==null?void 0:u.quantity)==null?void 0:N.toLocaleString())||"-",K(u==null?void 0:u.createDate)||"-",((P=u==null?void 0:u.killhouseUser)==null?void 0:P.name)||((x6=u==null?void 0:u.killer)==null?void 0:x6.name)||((h6=u==null?void 0:u.buyer)==null?void 0:h6.name)||"-",((y6=(f6=(a6=(i6=u==null?void 0:u.killhouseUser)==null?void 0:i6.killHouseOperator)==null?void 0:a6.user)==null?void 0:f6.city)==null?void 0:y6.name)||((d6=(j6=(D6=(v6=u==null?void 0:u.killer)==null?void 0:v6.killHouseOperator)==null?void 0:D6.user)==null?void 0:j6.city)==null?void 0:d6.name)||`${((L6=(k6=(S6=(E6=u==null?void 0:u.buyer)==null?void 0:E6.killHouseOperator)==null?void 0:S6.address)==null?void 0:k6.province)==null?void 0:L6.name)||""}(${((q6=(w6=(R6=(I6=u==null?void 0:u.buyer)==null?void 0:I6.killHouseOperator)==null?void 0:R6.address)==null?void 0:w6.city)==null?void 0:q6.name)||""})`||"-",((H6=($6=u==null?void 0:u.weightInfo)==null?void 0:$6.weight)==null?void 0:H6.toLocaleString())||"-",((W6=(T6=u==null?void 0:u.weightInfo)==null?void 0:T6.indexWeight)==null?void 0:W6.toLocaleString())||"-",((Q6=u==null?void 0:u.acceptedRealQuantity)==null?void 0:Q6.toLocaleString())||"-",((B6=u==null?void 0:u.acceptedRealWeight)==null?void 0:B6.toLocaleString())||"-",((N6=(O6=u==null?void 0:u.poultryRequest)==null?void 0:O6.amount)==null?void 0:N6.toLocaleString())+" ﷼"||"-",((K6=(P6=u==null?void 0:u.weightInfo)==null?void 0:P6.killHousePrice)==null?void 0:K6.toLocaleString())+" ﷼"||"-",e||"-",((M6=u==null?void 0:u.car)==null?void 0:M6.pelak)||"-",((_6=u==null?void 0:u.car)==null?void 0:_6.driverName)||((z6=(G6=u==null?void 0:u.addCar)==null?void 0:G6.driver)==null?void 0:z6.driverName)||"-",o.jsx(X,{clearanceCode:(u==null?void 0:u.clearanceCode)||"-"},r),(u==null?void 0:u.quarantineQuantity)||"-",K(u==null?void 0:u.modifyDate),(u==null?void 0:u.dataType)==="returned"?(u!=null&&u.nonReceipt&&(u!=null&&u.mainNonReceipt)?"کاربر":"سیستم")+" "+K(u==null?void 0:u.modifyDate):"-"]}),i0=(t6=l==null?void 0:l.chainAllocation)==null?void 0:t6.map((u,r)=>{var e,n,c,A,t,F,p,g;return[r+1,(u==null?void 0:u.state)==="accepted"?"تایید شده":(u==null?void 0:u.state)==="pending"?"در انتظار تایید":"رد شده",f(u==null?void 0:u.date),u!=null&&u.outProvince?"خارج استان":"داخل استان",`${(e=u==null?void 0:u.registerer)==null?void 0:e.fullname} (${(n=u==null?void 0:u.registerer)==null?void 0:n.mobile})`,(A=(c=u==null?void 0:u.killHouse)==null?void 0:c.killHouseOperator)!=null&&A.user.fullname?`${(F=(t=u==null?void 0:u.killHouse)==null?void 0:t.killHouseOperator)==null?void 0:F.user.fullname} (${(g=(p=u==null?void 0:u.killHouse)==null?void 0:p.killHouseOperator)==null?void 0:g.user.mobile})`:`${u==null?void 0:u.buyerName} (${u==null?void 0:u.buyerMobile})`,`${u==null?void 0:u.companyName} (${u==null?void 0:u.companyUserMobile})`,u==null?void 0:u.healthCode,(u==null?void 0:u.quarantineCode)||"-",u!=null&&u.driverName?`${u==null?void 0:u.driverName} (${u==null?void 0:u.driverMobile})`:"-",u==null?void 0:u.typeCar,u==null?void 0:u.pelak,u==null?void 0:u.quantity,u==null?void 0:u.indexWeight,u==null?void 0:u.weight]}),a0=(F6=l==null?void 0:l.returnProvinceRequest)==null?void 0:F6.map((u,r)=>{var c,A,t,F,p,g,i,a;let e="";u.state==="pending"?e="در انتظار تایید":u.state==="accepted"?e="تایید شده":u.state==="rejected"&&(e="رد شده");let n="";return u!=null&&u.market?n="پنل معاملات":u!=null&&u.directBuying?n="خرید مستقیم":u!=null&&u.warehouse?n="انبار":n="اتحادیه",[r+1,(u==null?void 0:u.orderCode)||"-",n,u==null?void 0:u.poultryUnitName,`${u==null?void 0:u.poultryFullname} (${u==null?void 0:u.poultryMobile})`,(c=u==null?void 0:u.poultryRequest)==null?void 0:c.age,u==null?void 0:u.poultryCity,f(u==null?void 0:u.killingDate),(A=u==null?void 0:u.poultryRequestQuantity)==null?void 0:A.toLocaleString(),f(u==null?void 0:u.createDate),((t=u==null?void 0:u.killhouseUser)==null?void 0:t.name)||"-",((F=u==null?void 0:u.killhouseUser)==null?void 0:F.city)||"-",((p=u==null?void 0:u.poultryAmount)==null?void 0:p.toLocaleString())+" ﷼",((g=u==null?void 0:u.killHousePrice)==null?void 0:g.toLocaleString())+" ﷼",(i=u==null?void 0:u.quantity)==null?void 0:i.toLocaleString(),e,(u==null?void 0:u.firstCarAllocatedQuantity)>0?"دارد":"ندارد",((u==null?void 0:u.quantity)-(u==null?void 0:u.totalKilledQuantity)).toLocaleString(),(u!=null&&u.returner?`${u==null?void 0:u.returner.fullname} (${(a=u==null?void 0:u.returner)==null?void 0:a.mobile})`:"سیستم")+" "+S0(u==null?void 0:u.modifyDate)]}),f0=(p6=l==null?void 0:l.barDiffrentRequets)==null?void 0:p6.map((u,r)=>{var e,n,c,A,t,F,p,g,i,a,D,j,d,E,S,k,L,I,R,w,q;return[r+1,u==null?void 0:u.registerFullname,f(u==null?void 0:u.createDate),`${((n=(e=u==null?void 0:u.hatching)==null?void 0:e.poultry)==null?void 0:n.unitName)||""} (${((t=(A=(c=u==null?void 0:u.hatching)==null?void 0:c.poultry)==null?void 0:A.user)==null?void 0:t.mobile)||""})`,`${((F=u==null?void 0:u.killHouse)==null?void 0:F.name)||""} (${((i=(g=(p=u==null?void 0:u.killHouse)==null?void 0:p.killHouseOperator)==null?void 0:g.user)==null?void 0:i.mobile)||""})`,(D=(a=u==null?void 0:u.barInfo)==null?void 0:a.totalQuantity)==null?void 0:D.toLocaleString(),(d=(j=u==null?void 0:u.barInfo)==null?void 0:j.totalWeight)==null?void 0:d.toLocaleString(),(S=(E=u==null?void 0:u.barInfo)==null?void 0:E.firstTotalQuantity)==null?void 0:S.toLocaleString(),(L=(k=u==null?void 0:u.barInfo)==null?void 0:k.differenceQuantity)==null?void 0:L.toLocaleString(),(I=u==null?void 0:u.quantity)==null?void 0:I.toLocaleString(),(R=u==null?void 0:u.weight)==null?void 0:R.toLocaleString(),(w=u==null?void 0:u.acceptorImages)!=null&&w[0]||u!=null&&u.acceptorMessage||u!=null&&u.registerMessage||(q=u==null?void 0:u.violationImage)!=null&&q[0]?o.jsx(s,{container:!0,children:o.jsx(v0,{variant:"contained",onClick:()=>{M(k0({content:o.jsx(q0,{item:u}),title:"پیوست"}))},children:"✉️"})},(u==null?void 0:u.id)+"assign"):"-",u.state==="pending"?"در انتظار تایید":u.state==="rejected"?"رد شده":"تایید شده"]}),y0=(g6=l==null?void 0:l.evacuationReports)==null?void 0:g6.map((u,r)=>{var e;return[r+1,(u==null?void 0:u.MoReportId)||"-",(u==null?void 0:u.ReportTypeString)||"-",(u==null?void 0:u.MoDateShamsi)??"-",((e=u==null?void 0:u.GoodCount)==null?void 0:e.toLocaleString())||"-",(u==null?void 0:u.RegDateShamsiWithTime)??"-"]});V6(C),Y6(B),b6(_),u0(g0),o0(i0),n0(x0),C0(h0),c0(a0),t0(f0),p0(y0)},[l]),o.jsxs(s,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[o.jsx(s,{container:!0,xs:12,children:o.jsx(R0,{})}),o.jsx(s,{container:!0,xs:12,children:o.jsx(D0,{title:"خروجی پی دی اف",children:o.jsx("a",{href:`${X6.defaults.baseURL}poultry_hatching_detail_pdf/?key=${v} + `,rel:"noreferrer",children:o.jsx(j0,{color:"error",children:o.jsx(w0,{size:32})})})})}),o.jsxs(s,{sx:{width:"100%"},children:[o.jsxs(y,{sx:{display:"flex",alignItems:"flex-end",position:"relative"},children:[o.jsx(x,{variant:"subtitle1",color:"#2D5FFF",sx:{bgcolor:"#E0E7FF",px:2,py:1,borderRadius:"4px 0 0 4px",position:"relative",zIndex:2,fontSize:"0.9rem"},children:"اطلاعات واحد گله"}),o.jsx(y,{sx:{flexGrow:1,height:"2px",bgcolor:"#2D5FFF",position:"absolute",bottom:8,left:0,right:0}})]}),o.jsx(y,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:1},children:z.map((C,B)=>o.jsxs(y,{sx:{display:"flex",justifyContent:"start",alignItems:"center",py:1},children:[o.jsxs(x,{variant:"body2",color:"text.secondary",sx:{fontSize:"0.8rem",fontWeight:500},children:[C==null?void 0:C.title,":"]}),o.jsx(x,{variant:"body2",sx:{fontSize:"0.8rem",fontWeight:600},px:1,children:(C==null?void 0:C.value)||"-"})]},B))})]}),o.jsxs(s,{sx:{width:"100%"},children:[o.jsxs(y,{sx:{display:"flex",alignItems:"flex-end",position:"relative"},children:[o.jsx(x,{variant:"subtitle1",color:"#2D5FFF",sx:{bgcolor:"#E0E7FF",px:2,py:1,borderRadius:"4px 0 0 4px",position:"relative",zIndex:2,fontSize:"0.9rem"},children:"اطلاعات کشتار و تلفات"}),o.jsx(y,{sx:{flexGrow:1,height:"2px",bgcolor:"#2D5FFF",position:"absolute",bottom:8,left:0,right:0}})]}),o.jsx(y,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:1},children:U==null?void 0:U.map((C,B)=>{const _=["حجم تخصیصات بازگشتی","وزن تخصیصات بازگشتی","حجم بارهای بازگشتی","وزن بارهای بازگشتی","وزن اختلاف کشتار","حجم اختلاف کشتار"].includes(C==null?void 0:C.title);return o.jsxs(y,{sx:{display:"flex",justifyContent:"start",alignItems:"center",py:1},children:[o.jsxs(x,{variant:"body2",sx:{fontSize:"0.8rem",fontWeight:500,color:_?"red":"text.secondary"},children:[C==null?void 0:C.title,":"]}),o.jsx(x,{variant:"body2",sx:{fontSize:"0.8rem",fontWeight:600,color:_?"red":"inherit"},px:1,children:(C==null?void 0:C.value)||"-"})]},B)})})]}),o.jsx(y,{sx:{width:"100%",height:"2px",bgcolor:"#2D5FFF",mt:2,borderRadius:"2px"}}),o.jsx(s,{item:!0,xs:12,children:o.jsxs($,{sx:{width:"100%"},children:[o.jsx(H,{expandIcon:o.jsx(W,{}),children:o.jsx(x,{children:"اطلاعات بارهای داخل استان"})}),o.jsx(T,{children:o.jsx(s,{sx:{width:"100%",overflowX:"auto"},children:o.jsx(Q,{title:"اطلاعات بار داخل استان",paginated:!0,customWidth:"100%",columns:["ردیف","کدبار","وضعیت","نوع فروش","تاریخ کشتار","خریدار","تلفن","کشتارکن","سن مرغ","محصول","استان/شهر","کدقرنطینه","استعلام قرنطینه","حجم زنده","وزن زنده (کیلوگرم)","حجم وارد شده به انبار","وزن وارد شده به انبار"],data:Z6})})})]})}),o.jsx(s,{children:o.jsxs($,{sx:{width:"100%"},children:[o.jsx(H,{expandIcon:o.jsx(W,{}),children:o.jsx(x,{children:"اطلاعات بارهای قرنطینه"})}),o.jsx(T,{children:o.jsx(s,{sx:{overflowX:"auto"},children:o.jsx(Q,{title:"اطلاعات بارهای قرنطینه",paginated:!0,customWidth:"100%",columns:["ردیف","تاریخ کشتار","حجم","نوع بار","سن مرغ","وضعیت","خریدار","محصول","شهر","کدقرنطینه"],data:e0})})})]})}),o.jsx(s,{children:o.jsxs($,{sx:{width:"100%"},children:[o.jsx(H,{expandIcon:o.jsx(W,{}),children:o.jsx(x,{children:"اطلاعات بارهای بازگشتی"})}),o.jsx(T,{children:o.jsx(s,{sx:{width:"100%",overflowX:"auto"},children:o.jsx(Q,{title:"اطلاعات بارهای بازگشتی",paginated:!0,columns:["ردیف","کد بار","کدسفارش","نوع درخواست","نوع کشتار","نام فارم","نام مرغدار","سن مرغ","شهر مرغدار","تاریخ درخواست کشتار","تعداد بار","تاریخ ثبت بار","نام کشتارگاه","شهر کشتارگاه","وزن","میانگین وزنی","حجم نهایی","وزن نهایی","قیمت مرغدار","قیمت کشتارگاه","وضعیت تایید","پلاک خودرو","نام راننده","کدقرنطینه","استعلام قرنطینه","تاریخ برگشت","نوع برگشت"],data:s0})})})]})}),o.jsx(s,{children:o.jsxs($,{sx:{width:"100%"},children:[o.jsx(H,{expandIcon:o.jsx(W,{}),children:o.jsx(x,{children:"اطلاعات تخصیصات بازگشتی"})}),o.jsx(T,{children:o.jsx(s,{sx:{width:"100%",overflowX:"auto"},children:o.jsx(Q,{title:"اطلاعات تخصیصات بازگشتی",paginated:!0,customWidth:"100%",columns:["ردیف","کدسفارش","نوع درخواست","نام فارم","نام مرغدار","سن مرغ","شهر مرغدار","تاریخ کشتار","تعداد درخواست","تاریخ ثبت تخصیص","نام کشتارگاه","شهر کشتارگاه","قیمت مرغدار","قیمت کشتارگاه","تعداد تخصیص","وضعیت تایید","وضعیت تخصیص ماشین","مانده قابل تخصیص","برگشت دهنده"],data:r0})})})]})}),o.jsx(s,{children:o.jsxs($,{sx:{width:"100%"},children:[o.jsx(H,{expandIcon:o.jsx(W,{}),children:o.jsx(x,{children:"اطلاعات بارهای خارج استان"})}),o.jsx(T,{children:o.jsx(s,{sx:{width:"100%",overflowX:"auto"},children:o.jsx(Q,{title:"اطلاعات بار خارج استان",paginated:!0,customWidth:"100%",columns:["ردیف","کد سفارش","تاریخ","خریدار","تلفن","محصول","استان/شهر","کدقرنطینه","استعلام قرنطینه","سن مرغ","حجم زنده","وزن زنده (کیلوگرم)"],data:m6})})})]})}),o.jsx(s,{children:o.jsxs($,{sx:{width:"100%"},children:[o.jsx(H,{expandIcon:o.jsx(W,{}),children:o.jsx(x,{children:"مدیریت بار زنجیره"})}),o.jsx(T,{children:o.jsx(s,{sx:{width:"100%",overflowX:"auto"},children:o.jsx(Q,{title:"مدیریت بار زنجیره",paginated:!0,customWidth:"100%",columns:["ردیف","وضعیت","تاریخ سفارش","نوع فروش","ثبت کننده سفارش","خریدار","شرکت زنجیره","کد بهداشتی","کد قرنطینه","راننده","نوع خودرو","پلاک","حجم","میانگین وزن","وزن"],data:l0})})})]})}),o.jsx(s,{children:o.jsxs($,{sx:{width:"100%"},children:[o.jsx(H,{expandIcon:o.jsx(W,{}),children:o.jsx(x,{children:"اختلاف کشتار"})}),o.jsx(T,{children:o.jsx(s,{sx:{width:"100%",overflowX:"auto"},children:o.jsx(Q,{data:A0,paginated:!0,customWidth:"100%",columns:["ردیف","ثبت کننده","تاریخ ثبت","مرغدار","کشتارگاه","حجم کم شده از سالن مرغدار","وزن تقریبی کشتار (کیلوگرم)","حجم سفارشات دریافتی توسط کشتارگاه"," اختلاف کشتار(حجم)","اختلاف حجم","اختلاف وزن","پیوست","وضعیت"],title:"اختلاف کشتار"})})})]})}),o.jsx(s,{children:o.jsxs($,{sx:{width:"100%"},children:[o.jsx(H,{expandIcon:o.jsx(W,{}),children:o.jsx(x,{children:"گزارش تلفات"})}),o.jsx(T,{children:o.jsx(s,{sx:{width:"100%",overflowX:"auto"},children:o.jsx(Q,{data:F0,paginated:!0,customWidth:"100%",columns:["ردیف","شماره گزارش","نوع گزارش","تاریخ معدوم سازی","تعداد","تاریخ ثبت"],title:"گزارش تلفات"})})})]})})]})},q2=()=>{const{key:v}=d0();return o.jsx(y,{display:"flex",justifyContent:"center",children:o.jsx(s,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,mt:4,children:v?o.jsx(H0,{keyItem:v}):o.jsx(E0,{})})})};export{q2 as default}; diff --git a/build/assets/AdminRequests-Bx6KBll9.js b/build/assets/AdminRequests-Bx6KBll9.js new file mode 100644 index 0000000..11b3114 --- /dev/null +++ b/build/assets/AdminRequests-Bx6KBll9.js @@ -0,0 +1 @@ +import{j as e,B as h,al as P,ak as _,ag as eu,av as tu,aw as ru,ax as F,aU as au,d as su,I as nu,b as lu,aJ as ou}from"./mui-vendor-CkIVaoQP.js";import{G as s,S as c,k_ as B,k$ as M,l0 as q,l1 as w,l2 as k,l3 as L,j as Q,A as J,u as K,c as Z,a9 as z,b as O,L as m,h as U,N as H,W as Cu,iw as Y,p as D,v as cu,a1 as iu,l4 as du}from"./index-CeyyVc1v.js";import{A as hu}from"./AvicultureNewRequest-C3L5QRVn.js";import{T as Au,A as pu,a as xu}from"./reactour.esm-9QIjTffK.js";import{a as X,u as G,f as Fu}from"./redux-vendor-B7uoacJt.js";import{f as uu,r as l}from"./react-vendor-CmFgShSM.js";import{A as ju}from"./AvicultureArchivedRequests-Bul1i4cq.js";import{R as fu,a as vu}from"./RequestsAwaitingInspections-C8DP5FQL.js";import{N as j}from"./NavLink-D2GD_ItM.js";import{d as gu}from"./Delete-C5MyLelE.js";import{a as Eu}from"./CityNewKillRequest-C2SXYvKb.js";import{N as yu}from"./NumberFormatCustom-DwWPj40N.js";import{A as V}from"./AdvancedTable-BYmmBtmq.js";import"./aviculture-get-hatching-data-DsjDNd82.js";import"./Add--yVWBJhC.js";import"./DialogAlert-BfXcr-Kr.js";import"./Done-Dp5awdte.js";import"./aviculture-get-unions-C1NoVg85.js";import"./SelectCheck-CAe89SYT.js";import"./ResponsiveTable-w7hk7Uq8.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./Plagiarism-BiXORbzo.js";import"./chart-vendor-sE2SUVPW.js";import"./Search-Dek2fED1.js";import"./SimpleTable-DBAoNnCU.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./province-get-sell-for-freezing-status-ieuVFEgW.js";import"./province-policy-market-daily-limitation-DueqDboR.js";import"./isValidIndexWeight-C_ik-uYa.js";import"./LabelField-B6eRSoQP.js";const Du=()=>{const{pathname:t}=uu();return e.jsxs(s,{container:!0,gap:c.SMALL,p:c.SMALL,direction:{xs:"column",md:"row"},children:[e.jsx(j,{to:B,active:t===B?"true":null,children:e.jsx(h,{variant:"text",color:"inherit",children:"ثبت اطلاعات جوجه ریزی"})}),e.jsx(j,{to:M,active:t===M?"true":null,children:e.jsx(h,{variant:"text",color:"inherit",children:"ثبت درخواست کشتار"})}),e.jsx(j,{to:q,active:t===q?"true":null,children:e.jsx(h,{variant:"text",color:"inherit",children:"در انتظار پرداخت"})}),e.jsx(j,{to:w,active:t===w?"true":null,children:e.jsx(h,{variant:"text",color:"inherit",children:"در انتظار بازرسی"})}),e.jsx(j,{to:k,active:t===k?"true":null,children:e.jsx(h,{variant:"text",color:"inherit",children:"سفارشات رد شده"})}),e.jsx(j,{to:L,active:t===L?"true":null,children:e.jsx(h,{variant:"text",color:"inherit",children:"سفارشات بایگانی شده"})})]})},bu=X("VET_FARM_NEW_FARM",async t=>{const{data:o,status:n}=await Q.post("poultry_hatching/",t);return{data:o,status:n}}),Tu=()=>{const t=G(),[o]=l.useContext(J),[n,b]=l.useState(""),[E,T]=l.useState(""),[N,S]=l.useState(!0),[y,I]=l.useState(1),[C,f]=l.useState(null),r=K({initialValues:{quantity:"",hatchingDate:z(Date()).format("YYYY-MM-DD hh:mm:ss"),race:"آرین"},validationSchema:Z({quantity:O().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!")})});return l.useEffect(()=>{r.validateForm(),t(m()),t(Eu()).then(a=>{T(a.payload.data),t(U())})},[]),l.useEffect(()=>{n&&(y===0?(o({vertical:"top",horizontal:"center",msg:"ابتدا برای این مرغداری جوجه ریزی ثبت کنید.",severity:"error"}),t(H({right:!1,bottom:!1,content:null}))):S(!1))},[n]),e.jsxs(s,{container:!0,gap:c.SMALL,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:[e.jsxs(s,{container:!0,direction:"column",gap:c.SMALL,children:[e.jsx(s,{children:e.jsx(P,{disablePortal:!0,id:"hatching",options:E?E.map(a=>({id:a.key,label:a.unitName,halls:a.numberOfHalls})):[],onChange:(a,u)=>{b(u.id),I(u.halls)},renderInput:a=>e.jsx(_,{...a,label:"محل پرورش"})})}),e.jsx(s,{children:e.jsx(P,{disabled:N,disablePortal:!0,options:[...Array(y)].map((a,u)=>({label:"سالن شماره "+(u+1),id:u})),onChange:(a,u)=>{f(u.id+1)},renderInput:a=>e.jsx(_,{...a,label:"سالن را انتخاب کنید"})})}),e.jsx(yu,{allowLeadingZeros:!0,thousandSeparator:",",id:"quantity",value:r.values.quantity,error:r.touched.quantity?!!r.errors.quantity:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.quantity&&r.errors.quantity?r.errors.quantity:null,label:"تعداد",variant:"outlined"}),e.jsx(Cu,{label:"تاریخ جوجه ریزی",id:"hatchingDate",renderInput:a=>e.jsx(_,{...a}),value:r.values.hatchingDate,error:r.touched.hatchingDate?!!r.errors.hatchingDate:null,onChange:a=>{r.setFieldValue("hatchingDate",z(a).format("YYYY-MM-DD hh:mm:ss"))},onBlur:r.handleBlur,helperText:r.touched.hatchingDate&&r.errors.hatchingDate?r.errors.hatchingDate:null}),e.jsxs(eu,{fullWidth:!0,children:[e.jsx(tu,{id:"demo-simple-select-label",children:"نژاد مرغ"}),e.jsxs(ru,{labelId:"demo-simple-select-label",id:"race",label:"نژاد مرغ",value:r.values.race,error:r.touched.race?!!r.errors.race:null,onChange:a=>{r.setFieldValue("race",a.target.value)},onBlur:r.handleBlur,children:[e.jsx(F,{value:"آرین",children:"آرین"}),e.jsx(F,{value:"راس",children:"راس"}),e.jsx(F,{value:"آربراکرز (آپلاس)",children:"آربراکرز (آپلاس)"}),e.jsx(F,{value:"کاب",children:"کاب"}),e.jsx(F,{value:"هوبارد",children:"هوبارد"}),e.jsx(F,{value:"ترکیبی",children:"ترکیبی"}),e.jsx(F,{value:"وارداتی",children:"وارداتی"})]}),e.jsx(au,{children:r.touched.race&&r.errors.race?r.errors.race:null})]})]}),e.jsx(s,{children:e.jsx(h,{disabled:!(r.isValid&&n.length&&C),fullWidth:!0,variant:"contained",onClick:()=>{t(m()),t(bu({key:n,quantity:r.values.quantity,date:r.values.hatchingDate,chicken_breed:r.values.race,hall:C})).then(a=>{a.error?a.error.message.includes("403")?o({vertical:"top",horizontal:"center",msg:"قبلا برای این تاریخ یا این سالن جوجه ریزی ثبت شده است.",severity:"error"}):o({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(t(Y()),t(H({right:!1,bottom:!1,content:null})),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})),t(U())})},children:"ثبت اطلاعات"})})]})},Nu=X("AVICULTURE_DELETE_HATCHING",async t=>{const{data:o,status:n}=await Q.delete("poultry_hatching/0/?key="+t);return{data:o,status:n}}),Su=[{selector:".first-step",content:()=>e.jsx("div",{children:"برای ثبت جوجه ریزی اینجا کلیک کنید!"})},{selector:".second",content:()=>e.jsx("div",{children:"در این قسمت جوجه ریزی های ثبت شده توسط شما نمایش داده می شود."})}],Iu=()=>{const t=G(),[o]=l.useContext(J),{avicultureHatchings:n}=Fu(C=>C.avicultureSlice),[b,E]=l.useState(!1),[T,N]=l.useState([]),[S,y]=l.useState([]);l.useEffect(()=>{t(Y())},[]),l.useEffect(()=>{const C=n==null?void 0:n.filter(u=>u.allowHatching==="pending"),f=n==null?void 0:n.filter(u=>u.allowHatching==="True"),r=C==null?void 0:C.map((u,R)=>{var g;const i=(u==null?void 0:u.quantity)||0,A=(u==null?void 0:u.losses)||0,p=(u==null?void 0:u.leftOver)||0,v=i-A-p,x=i>0?d=>(d*100/i).toFixed(0):()=>"0";return[R+1,((g=u==null?void 0:u.poultry)==null?void 0:g.unitName)||"",(u==null?void 0:u.hall)||"",(u==null?void 0:u.period)||"",D(u==null?void 0:u.createDate),D(u==null?void 0:u.date),(u==null?void 0:u.chickenBreed)||"",(u==null?void 0:u.age)||"",i,`${A} (%${x(A)})`,v+` (%${x(v)})`,`${p} (%${x(p)})`,e.jsx(su,{title:"حذف جوجه ریزی",placement:"left-start",children:e.jsx(nu,{"aria-label":"delete",color:"error",onClick:()=>{t(m()),t(Nu(u==null?void 0:u.key)).then(d=>{var $;if(t(U()),d!=null&&d.error){const W=(($=d.error)==null?void 0:$.message)||"";W.includes("403")?o({vertical:"top",horizontal:"center",msg:"برای این جوجه ریزی درخواست کشتار ثبت شده است!",severity:"error"}):W.includes("400")?o({vertical:"top",horizontal:"center",msg:"برای این جوجه ریزی بازرسی ثبت شده است!",severity:"error"}):o({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"})}else t(Y()),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},children:e.jsx(gu,{})})},u==null?void 0:u.key)]});N(r);const a=f==null?void 0:f.map((u,R)=>{var g;const i=(u==null?void 0:u.quantity)||0,A=(u==null?void 0:u.losses)||0,p=(u==null?void 0:u.leftOver)||0,v=i-A-p,x=i>0?d=>(d*100/i).toFixed(0):()=>"0";return[R+1,((g=u==null?void 0:u.poultry)==null?void 0:g.unitName)||"",(u==null?void 0:u.hall)||"",(u==null?void 0:u.period)||"",D(u==null?void 0:u.createDate),D(u==null?void 0:u.date),(u==null?void 0:u.chickenBreed)||"",(u==null?void 0:u.age)||"",i,`${A} (%${x(A)})`,v+` (%${x(v)})`,`${p} (%${x(p)})`]});y(a)},[n]);const I=K({initialValues:{noChicken:"",slaughterDate:cu(Date()).format("YYYY-MM-DD hh:mm:ss"),race:"آرین",weight:""},validationSchema:Z({noChicken:O().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),weight:O().required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!")})});return l.useEffect(()=>{I.validateForm()},[]),e.jsx(s,{container:!0,gap:c.MEDIUM,direction:"column",xs:12,children:e.jsx(s,{container:!0,gap:c.SMALL,justifyContent:{xs:"center",lg:"space-between"},alignSelf:"center",alignItems:"center",xs:12,direction:{xs:"column",lg:"row"},children:e.jsxs(s,{container:!0,xs:12,alignItems:"start",gap:c.SMALL,direction:"column",children:[e.jsxs(s,{width:"100%",container:!0,alignItems:"center",justifyContent:"space-between",children:[e.jsx(s,{children:e.jsx(h,{className:"first-step",variant:"contained",disabled:!0,onClick:()=>{t(H({title:"ثبت اطلاعات جوجه ریزی",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:e.jsx(Tu,{})}))},children:"ثبت جوجه ریزی جدید"})}),e.jsx(s,{})]}),e.jsx(Au,{steps:Su,isOpen:b,onRequestClose:()=>E(!1),styles:{popover:C=>({...C,borderRadius:"10px","--reactor-accent":"red"})}}),e.jsx(s,{width:"100%",className:"second",children:e.jsx(V,{name:"دوره های فعال جوجه ریزی",data:T,columns:["ردیف","نام فارم","سالن","دوره جوجه ریزی","تاریخ ثبت جوجه ریزی","تاریخ جوجه ریزی","نژاد","سن","تعداد جوجه ریزی","تلفات دوره","کشتار شده","مانده برای کشتار","اقدام"]})}),e.jsx(s,{mt:c.SMALL,width:"100%",className:"second",children:e.jsx(V,{name:"بایگانی جوجه ریزی",data:S,columns:["ردیف","نام فارم","سالن","دوره جوجه ریزی","تاریخ ثبت جوجه ریزی","تاریخ جوجه ریزی","نژاد","سن","تعداد جوجه ریزی","تلفات دوره","کشتار شده","مانده در سالن"]})})]})})})},o6=()=>{const{pathname:t}=uu(),o=G();return l.useEffect(()=>{o(iu())},[]),e.jsx(lu,{display:"flex",justifyContent:"center",children:e.jsxs(s,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[e.jsx(s,{justifyContent:"center",my:c.MEDIUM,children:e.jsx(ou,{children:e.jsx(Du,{})})}),e.jsx(s,{container:!0,justifyContent:"space-between",gap:c.SMALL,children:e.jsxs(s,{xs:12,children:[t===du&&e.jsx(hu,{}),t===B&&e.jsx(Iu,{}),t===M&&e.jsx(pu,{}),t===k&&e.jsx(xu,{}),t===L&&e.jsx(ju,{}),t===q&&e.jsx(fu,{}),t===w&&e.jsx(vu,{})]})})]})})};export{o6 as default}; diff --git a/build/assets/AdminSettlement-QnXM2P7E.js b/build/assets/AdminSettlement-QnXM2P7E.js new file mode 100644 index 0000000..ec40ddc --- /dev/null +++ b/build/assets/AdminSettlement-QnXM2P7E.js @@ -0,0 +1 @@ +import{i as qu,j as e,ak as P,B as au,aJ as zu,b as uu,b1 as nu,a3 as R,aa as ku,I as ou,T as Z,bh as Iu,am as Ou,$ as Vu,b0 as Yu,K as Ku,d as Bu,aX as Wu,b2 as Hu,b3 as Du}from"./mui-vendor-CkIVaoQP.js";import{L as K,j as O,h as T,r as Uu,A as ru,G as m,S as Y,C as Nu,u as Gu,c as Su,cs as Xu,M as Ju,fI as Qu,b as Zu,v as _u,p as z,W as lu,X as tu,N as Ru,O as Tu,a7 as ue,a9 as wu,hF as ee,hG as te,hH as ae,hI as re}from"./index-CeyyVc1v.js";import{r as h,f as se}from"./react-vendor-CmFgShSM.js";import{d as ne}from"./ToggleOffOutlined-Ch26Umk7.js";import{d as oe}from"./ToggleOn-pBgb8alR.js";import{a as su,u as eu,f as le}from"./redux-vendor-B7uoacJt.js";import{R as ce,a as ie}from"./index.esm-Bu7XMDZU.js";import{d as de}from"./DoneOutline-DQzOHpRS.js";import{d as Ce}from"./CloudUpload-BlIgB_r9.js";import{d as he}from"./Tune-D4M2CAhp.js";import{d as pe}from"./DoneAll-BQY85Rt1.js";import{d as Ae}from"./Close-_jAEIgMD.js";import{d as xe}from"./Done-Dp5awdte.js";import{d as fe}from"./DeleteOutline-DlhNLp0A.js";import{f as $u}from"./free-buying-payment-DH20xTKI.js";import{f as ge,I as ye}from"./toBase64-BzgTOHsW.js";import{r as me}from"./resizeImage-Csf2MO3w.js";import{S as je}from"./ShowImage-CqhU2hmk.js";import{R as Fe}from"./ResponsiveTable-w7hk7Uq8.js";import{P as ve}from"./ProvinceSettlementPdfKillRequest-ChEooZGT.js";import{B as be}from"./BackButton-Crzr7NMa.js";import"./iconBase-BEJYyZsk.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./Delete-C5MyLelE.js";import"./Download-DQ-VVIaV.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./PictureAsPdf-oEJEta1d.js";const Ee=su("KILLHOUSE_FREE_BUY_EDIT_PAYMENT",async(r,{dispatch:d})=>{try{d(K());const{data:n,status:c}=await O.put("direct-buying-requests/0/",r);return d(T()),{data:n,status:c}}catch(n){return d(T()),{error:n.response.data.result}}});var cu={},ke=qu;Object.defineProperty(cu,"__esModule",{value:!0});var Lu=cu.default=void 0,Ie=ke(Uu()),De=e;Lu=cu.default=(0,Ie.default)((0,De.jsx)("path",{d:"M21 12V6c0-1.1-.9-2-2-2h-1V2h-2v2H8V2H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h7v-2H5V10h14v2zm-5.36 8c.43 1.45 1.77 2.5 3.36 2.5 1.93 0 3.5-1.57 3.5-3.5s-1.57-3.5-3.5-3.5c-.95 0-1.82.38-2.45 1H18V18h-4v-4h1.5v1.43c.9-.88 2.14-1.43 3.5-1.43 2.76 0 5 2.24 5 5s-2.24 5-5 5c-2.42 0-4.44-1.72-4.9-4z"}),"EventRepeat");const Mu=su("ADMIN_FREE_BUY_EDIT_PAYMENT",async(r,{dispatch:d})=>{try{d(K());const{data:n,status:c}=await O.put("direct-buying-requests/0/",r);return d(T()),{data:n,status:c}}catch(n){return d(T()),{error:n.response.data.result}}}),Se=({updateTable_data:r,item:d,type:n})=>{const c=eu(),[g]=h.useContext(ru),[b,I]=h.useState(""),l=A=>{I(A.target.value)};return e.jsxs(m,{container:!0,direction:"column",gap:Y.TINY,width:"100%",children:[e.jsx(P,{label:n==="reject"?"دلیل رد درخواست":"دلیل بایگانی",variant:"outlined",fullWidth:!0,value:b,onChange:l}),e.jsx(au,{variant:"contained",color:"primary",onClick:()=>{c(Mu({key:d.key,state:n==="reject"?"rejected":"archive",...n!=="reject"&&{archive:!0},payment_deadline_archive_message:b,check:!0})).then(A=>{A.error?g({vertical:"top",horizontal:"center",msg:A.error,severity:"error"}):(r(),g({vertical:"top",horizontal:"center",msg:"درخواست با موفقیت رد شد",severity:"success"}),c(Nu()))})},children:"ثبت رد درخواست"})]})},_e=({updateTable_data:r,item:d})=>{const n=eu(),[c]=h.useContext(ru),[g,b]=h.useState(""),I=l=>{b(l.target.value)};return e.jsxs(m,{container:!0,direction:"column",gap:Y.TINY,width:"100%",children:[e.jsx(P,{type:"number",label:"تعداد روز",variant:"outlined",fullWidth:!0,value:g,onChange:I}),e.jsx(au,{disabled:!g,variant:"contained",color:"primary",onClick:()=>{n(Mu({key:d.key,extension_payment_deadline_days:parseInt(g)})).then(l=>{l.error?c({vertical:"top",horizontal:"center",msg:l.error,severity:"error"}):(r(),c({vertical:"top",horizontal:"center",msg:"درخواست با موفقیت رد شد",severity:"success"}),n(Nu()))})},children:"تمدید مهلت تسویه"})]})},Re=su("ADMIN_SETTLEMENT_DIRECT_BUYING",async(r,{dispatch:d})=>{d(K());try{const{data:n,status:c}=await O.post("direct-buying-payment/",r);return d(T()),{data:n,status:c}}catch(n){return d(T()),{error:n.response.data.result}}}),Te=su("FREE_BUYING_DELETE_PAYMENT",async(r,{dispatch:d})=>{d(K());try{const{data:n,status:c}=await O.delete("direct-buying-payment/0/",{params:r});return d(T()),{data:n,status:c}}catch(n){return d(T()),{error:n.response.data.result}}}),we=({modal_key:r,updateTable_modal:d})=>{const n=eu(),[c,g]=h.useState([]),[b,I]=h.useState([[]]),[l,A]=h.useState([{amount:"",date:"",image:""}]),s=Gu({initialValues:{province_kill_request_key:r,items:l},validationSchema:Su({items:Xu().of(Su().shape({amount:Zu().typeError("مبلغ باید یک عدد معتبر باشد").required("وارد کردن مبلغ الزامی است").positive("مبلغ باید عددی مثبت باشد").integer("مبلغ باید عدد صحیح باشد"),date:Qu().typeError("تاریخ معتبر وارد کنید").required("تاریخ پرداخت الزامی است").max(new Date,"تاریخ نمی‌تواند از امروز بیشتر باشد"),image:Ju().required("بارگزاری سند الزامی است")}))}),onSubmit:()=>{},enableReinitialize:!0}),E=h.useCallback(a=>!!(a.amount||a.date||a.image),[]),B=h.useCallback((a,t)=>{const i=_u(a).toISOString(),C=[...l];C[t]={...C[t],date:i},A(C),s.setFieldValue(`items[${t}].date`,i,!1)},[l,s]),N=h.useCallback((a,t)=>{const i=[...l];i[t]={...i[t],amount:a},A(i),s.setFieldValue(`items[${t}].amount`,a,!1)},[l,s]),W=h.useCallback((a,t)=>{var i;if(I(C=>{const p=[...C];return p[t]=a,p}),a[0]){const C=(i=a[0])==null?void 0:i.file;me(C,p=>{const j=ge(p),y=[...l];y[t]={...y[t],image:j},A(y),s.setFieldValue(`items[${t}].image`,j,!1)})}else{const C=[...l];C[t]={...C[t],image:""},A(C),s.setFieldValue(`items[${t}].image`,"",!1)}},[l,s]),D=h.useCallback(a=>{const t=l.filter((C,p)=>p!==a),i=b.filter((C,p)=>p!==a);A(t.length?t:[{amount:"",date:"",image:""}]),I(i.length?i:[[]]),s.setFieldValue("items",t.length?t:[{amount:"",date:"",image:""}],!1)},[l,b,s]),V=h.useCallback(async a=>{await s.setTouched({items:s.values.items.map((i,C)=>C===a?{amount:!0,date:!0,image:!0}:i)},!1);const t=await s.validateForm();return!(t.items&&t.items[a])},[s]),w=h.useCallback(async a=>{const t=l[a];if(!E(t)){D(a);return}if(!await V(a))return;const C={province_kill_request_key:r,amount:t.amount,date:t.date,image:t.image};n(Re(C)).then(p=>{var j,y;if(((j=p.payload)==null?void 0:j.status)===200||((y=p.payload)==null?void 0:y.status)===201){const x=[...l];x[a]={amount:"",date:"",image:""},A(x),I(k=>{const f=[...k];return f[a]=[],f}),n($u(r)).then(k=>{var S;const f=(S=k.payload)==null?void 0:S.data;f&&Array.isArray(f)&&g(f.map(o=>({...o,date:z(o.date)})))}),d()}})},[l,E,D,V,n,r,d]);h.useEffect(()=>{r&&n($u(r)).then(a=>{var i;const t=(i=a.payload)==null?void 0:i.data;t&&Array.isArray(t)&&g(t.map(C=>({...C,date:z(C.date)})))})},[n,r]);const L=h.useCallback(({children:a,highlight:t=!1})=>e.jsx(zu,{elevation:0,sx:{width:"100%",maxWidth:880,borderRadius:3,border:"1px solid",borderColor:t?"primary.main":"divider",bgcolor:"background.paper"},children:a}),[]);return e.jsxs(uu,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:2,p:2},children:[c.map(a=>{var t;return e.jsx(L,{children:e.jsx(nu,{sx:{p:2},children:e.jsxs(R,{container:!0,spacing:2,alignItems:"center",children:[a.image&&e.jsx(R,{item:!0,children:e.jsx(uu,{sx:{width:64,height:64,borderRadius:2,overflow:"hidden",border:"1px solid",borderColor:"divider"},children:e.jsx(je,{src:a.image})})}),e.jsx(R,{item:!0,xs:!0,sm:5,md:4,children:e.jsx(P,{size:"small",fullWidth:!0,label:"مبلغ",value:((t=a.amount)==null?void 0:t.toLocaleString())||"",InputProps:{readOnly:!0,endAdornment:e.jsx(ku,{position:"end",children:"ریال"})}})}),a.date&&e.jsx(R,{item:!0,xs:!0,sm:5,md:4,children:e.jsx(P,{size:"small",fullWidth:!0,label:"تاریخ پرداخت",value:a.date,InputProps:{readOnly:!0}})}),e.jsx(R,{item:!0,xs:!0,sx:{display:"flex",justifyContent:{xs:"flex-start",sm:"flex-end"}},children:e.jsx(ou,{color:"error","aria-label":"حذف پرداخت",onClick:()=>{n(Te({key:a.key})).then(i=>{var C,p;(((C=i.payload)==null?void 0:C.status)===200||((p=i.payload)==null?void 0:p.status)===201)&&g(j=>j.filter(y=>y.key!==a.key))}),d()},children:e.jsx(fe,{})})})]})})},a.key)}),l==null?void 0:l.map((a,t)=>{var i,C,p,j,y,x,k,f,S,o,u,v,F,M;return e.jsx(L,{highlight:E(a),children:e.jsx(nu,{sx:{p:2},children:e.jsxs(R,{container:!0,spacing:2,alignItems:"center",children:[e.jsxs(R,{item:!0,xs:12,sm:4,md:3,children:[e.jsx(ye,{size:"small",images:b[t]||[],onChange:_=>W(_,t),maxNumber:1,title:"بارگذاری"}),((C=(i=s.touched.items)==null?void 0:i[t])==null?void 0:C.image)&&((j=(p=s.errors.items)==null?void 0:p[t])==null?void 0:j.image)&&e.jsx(Z,{color:"error",variant:"caption",children:s.errors.items[t].image})]}),e.jsx(R,{item:!0,xs:12,sm:4,md:3,children:e.jsx(P,{size:"small",fullWidth:!0,label:"مبلغ",value:a.amount||"",onChange:_=>N(_.target.value,t),onBlur:s.handleBlur,error:((x=(y=s.touched.items)==null?void 0:y[t])==null?void 0:x.amount)&&!!((f=(k=s.errors.items)==null?void 0:k[t])!=null&&f.amount),helperText:((o=(S=s.touched.items)==null?void 0:S[t])==null?void 0:o.amount)&&((v=(u=s.errors.items)==null?void 0:u[t])==null?void 0:v.amount),InputProps:{inputMode:"numeric",endAdornment:e.jsx(ku,{position:"end",children:"ریال"})}})}),e.jsx(R,{item:!0,xs:12,sm:4,md:3,children:e.jsx(lu,{label:"تاریخ پرداخت",value:a.date?_u(a.date):null,onChange:_=>B(_,t),renderInput:_=>{var q,$,H,U,G,X,J,Q;return e.jsx(P,{..._,size:"small",fullWidth:!0,onBlur:s.handleBlur,error:(($=(q=s.touched.items)==null?void 0:q[t])==null?void 0:$.date)&&!!((U=(H=s.errors.items)==null?void 0:H[t])!=null&&U.date),helperText:((X=(G=s.touched.items)==null?void 0:G[t])==null?void 0:X.date)&&((Q=(J=s.errors.items)==null?void 0:J[t])==null?void 0:Q.date)})}})}),e.jsx(R,{item:!0,xs:!0,display:"flex",justifyContent:{xs:"flex-start",sm:"flex-end"},gap:.5,children:e.jsx(Iu,{direction:"row",spacing:.5,children:E(a)&&((M=(F=s.values.items)==null?void 0:F[t])==null?void 0:M.date)&&e.jsx(ou,{"aria-label":"ثبت آیتم",onClick:()=>w(t),disabled:s.isSubmitting,sx:{border:"1px solid",borderColor:E(a)?"primary.main":"warning.main"},children:e.jsx(xe,{color:"primary"})})})})]})})},t)}),((c==null?void 0:c.length)>0||(l==null?void 0:l.length)>0)&&e.jsx(L,{children:e.jsx(nu,{sx:{p:2},children:e.jsxs(Iu,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:2,children:[e.jsx(Z,{variant:"subtitle1",children:"مبلغ کل"}),e.jsx(Ou,{flexItem:!0}),e.jsxs(Z,{variant:"h6",color:"primary",children:[((c==null?void 0:c.reduce((a,t)=>a+((t==null?void 0:t.amount)||0),0))+((l==null?void 0:l.reduce((a,t)=>a+(Number(t.amount)||0),0))||0)).toLocaleString()," ","ریال"]})]})})})]})},$e=({item:r,item_key:d,updateTable_data:n})=>{const c=eu(),[g]=h.useContext(ru),[b,I]=h.useState(null),l=Vu(),A=tu(),s=A==="KillHouse",E=(r==null?void 0:r.finalAccept)===!0,B=!(r!=null&&r.paymentDeadlineState)==="pending",N=s?E:!1,W=E!==!0||s,D=!s&&E,V=!s,w=!s&&E,L=!s,a=({title:x,IconComponent:k,colorKey:f,onClick:S,disabled:o=!1,hidden:u=!1})=>{var q;if(u)return null;const v=((q=l.palette[f])==null?void 0:q.main)??l.palette.primary.main,F=Ku(v,.1),M=()=>{o||S()},_=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),M())};return e.jsx(m,{item:!0,children:e.jsx(Bu,{title:x,placement:"right",children:e.jsx("span",{style:{width:"100%",display:"block"},children:e.jsxs(uu,{role:"button",tabIndex:0,onClick:M,onKeyDown:_,sx:{display:"flex",alignItems:"center",gap:1.5,px:1.5,py:1,borderRadius:1,cursor:o?"not-allowed":"pointer",opacity:o?.4:1,transition:"background-color 0.2s ease","&:hover":{backgroundColor:o?"transparent":F}},children:[e.jsx(k,{sx:{color:v}}),e.jsx(Z,{variant:"body2",sx:{color:v,fontWeight:500},children:x})]})})})})},t=x=>{I(x.currentTarget)},i=()=>{I(null)},C=!!b,p=C?"popover":void 0,j=x=>{var u,v;i();const k=((u=r==null?void 0:r.generalInfo)==null?void 0:u.totalPaidAmount)||0,f=((v=r==null?void 0:r.generalInfo)==null?void 0:v.totalAmount)||0,S=parseInt(f)/100*90,o=parseInt(f)/100*10+parseInt(f);if(ko){g({vertical:"top",horizontal:"center",msg:"مبلغ تسویه با شروط تسویه حساب مطابقت ندارد",severity:"error"});return}c(Ee(x)).then(F=>{F.error?g({vertical:"top",horizontal:"center",msg:F.error,severity:"error"}):(n(),g({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد",severity:"success"}),c(Ru({right:!1,bottom:!1,left:!1,content:null})))})},y=x=>{i(),c(Tu({title:x==="reject"?"برگشت درخواست":"بایگانی درخواست",content:e.jsx(Se,{updateTable_data:n,item:r,type:x})}))};return e.jsxs(m,{container:!0,children:[e.jsx(ou,{"aria-describedby":p,variant:"contained",color:"primary",onClick:t,children:e.jsx(he,{})}),e.jsx(Yu,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:p,open:C,anchorEl:b,onClose:i,children:e.jsx(m,{style:{padding:"10px 6px"},children:e.jsxs(m,{container:!0,direction:"column",spacing:1,children:[a({title:"بارگذاری سند",IconComponent:Ce,colorKey:"success",disabled:N,onClick:()=>{i(),c(Ru({title:"بارگزاری سند",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,size:1e3,content:e.jsx(we,{item:r,modal_key:d,updateTable_modal:n})}))}}),a({title:"تایید نهایی",IconComponent:de,colorKey:"success",disabled:E,hidden:!W,onClick:()=>j({key:r.key,final_accept:!0,role:A})}),a({title:"تایید درخواست",IconComponent:pe,colorKey:"primary",hidden:!D,onClick:()=>j({key:r.key,state:"accepted",role:A,check:!0})}),a({title:"تمدید مهلت تسویه",IconComponent:Lu,colorKey:"primary",hidden:!V,disabled:B,onClick:()=>{i(),c(Tu({title:"تمدید مهلت تسویه",content:e.jsx(_e,{updateTable_data:n,item:r})}))}}),a({title:"رد درخواست",IconComponent:Ae,colorKey:"error",hidden:!w,disabled:B,onClick:()=>y("reject")}),a({title:"بایگانی",IconComponent:ue,colorKey:"error",hidden:!L,disabled:B,onClick:()=>y("archive")})]})})})]})},Pu=()=>{const r=eu(),[,,d,n,c,g]=h.useContext(ru),b=le(o=>o.userSlice.userProfile.key),[I,l]=h.useState([]),[A,s]=h.useState([]),[E,B]=h.useState(0),[N,W]=h.useState(10),[D,V]=h.useState(!1),[w,L]=h.useState(1),[a,t]=h.useState("0"),[i,C]=h.useState(""),p=async o=>{let u;r(K()),u=await O.get(`direct-buying-requests/?role=${tu()}&status=${a==="0"?"active":"archive"}&search=filter&value=${i||""}${D?`&date1=${d}&date2=${c}`:""}&page=${o}&page_size=${N}`),r(T()),s(u.data.results),B(u.data.count)};h.useEffect(()=>{p(1)},[r,d,c,N,a,D]);const j=()=>{p(w!==0?w:1)};h.useEffect(()=>{const o=A==null?void 0:A.map((u,v)=>{var M,_,q,$,H,U,G,X,J,Q,iu,du,Cu,hu,pu,Au,xu,fu,gu,yu,mu,ju,Fu,vu,bu,Eu;let F;switch(u==null?void 0:u.paymentDeadlineState){case"pending":F="بارگزاری سند مالی";break;case"checking":F="بررسی مالی اتحادیه";break;case"accepted":F="تایید شده";break;case"rejected":F="برگشت داده شده";break;case"archive":F="بایگانی شده";break;default:F="وضعیت نامشخص"}return[w===1?v+1:v+N*(w-1)+1,z((M=u==null?void 0:u.killRequest)==null?void 0:M.createDate),z((_=u==null?void 0:u.killRequest)==null?void 0:_.reciveDate),`${($=(q=u==null?void 0:u.killRequest)==null?void 0:q.killHouse)==null?void 0:$.name} (${(U=(H=u==null?void 0:u.killRequest)==null?void 0:H.killHouse)==null?void 0:U.mobile})`,(G=u==null?void 0:u.killRequest)!=null&&G.freeDirectBuying?"آزاد":"دولتی",(X=u==null?void 0:u.killRequest)!=null&&X.killHouse?(Q=(J=u==null?void 0:u.killRequest)==null?void 0:J.killHouse)==null?void 0:Q.name:(iu=u==null?void 0:u.killRequest)==null?void 0:iu.slaughterHouse,`${(Cu=(du=u==null?void 0:u.killRequest)==null?void 0:du.poultry)==null?void 0:Cu.fullname} (${(hu=u==null?void 0:u.killRequest)==null?void 0:hu.poultry.mobile})`,(pu=u==null?void 0:u.generalInfo)==null?void 0:pu.age,`${(Au=u==null?void 0:u.killRequest)!=null&&Au.chickenBreed?(xu=u==null?void 0:u.killRequest)==null?void 0:xu.chickenBreed:"-"}`,(fu=u==null?void 0:u.totalKilledQuantity)==null?void 0:fu.toLocaleString(),(gu=u==null?void 0:u.generalInfo)==null?void 0:gu.IndexWeight,(yu=u==null?void 0:u.totalKilledWeight)==null?void 0:yu.toLocaleString(),(ju=(mu=u==null?void 0:u.killRequest)==null?void 0:mu.amount)==null?void 0:ju.toLocaleString(),(vu=(Fu=u==null?void 0:u.generalInfo)==null?void 0:Fu.totalAmount)==null?void 0:vu.toLocaleString(),z(u==null?void 0:u.paymentDeadlineDate),u!=null&&u.extensionPaymentDeadlineDate?z(u==null?void 0:u.extensionPaymentDeadlineDate):"-",e.jsx(ve,{pdf_key:(bu=u==null?void 0:u.killRequest)==null?void 0:bu.key},v),(Eu=u==null?void 0:u.generalInfo)==null?void 0:Eu.totalPaidAmount.toLocaleString(),F,u==null?void 0:u.paymentDeadlineCheckerFullname,z(u==null?void 0:u.paymentDeadlineCheckDate),u==null?void 0:u.paymentDeadlineArchiveMessage,...a==="0"?[e.jsx($e,{updateTable_data:j,item:u,item_key:u==null?void 0:u.key},`ops-${v}`)]:[]]});l(o)},[A]);const y=o=>{p(o),L(o)},x=o=>{W(o),L(1)},k=(o,u)=>{t(u)},f=o=>{C(o.target.value)},S=async o=>{o.preventDefault(),r(K());try{const u=await O.get(`direct-buying-requests/?role=${tu()}&status=${a==="0"?"active":"archive"}${D?`&date1=${d}&date2=${c}`:""}&search=filter&value=${i||""}`);s(u.data.results),B(u.data.count),r(T())}catch(u){console.error("Error fetching data:",u)}};return e.jsxs(e.Fragment,{children:[e.jsx(m,{container:!0,alignItems:"center",mb:Y.SMALL,gap:Y.SMALL,children:e.jsx("form",{onSubmit:S,children:e.jsxs(m,{container:!0,alignItems:"center",gap:Y.SMALL,children:[e.jsx(P,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:f}),e.jsx(au,{type:"submit",onClick:S,endIcon:e.jsx(ce,{}),children:"جستجو"}),e.jsxs(m,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[e.jsx(Wu,{icon:e.jsx(ne,{}),checkedIcon:e.jsx(oe,{}),checked:D,onChange:()=>V(!D),color:"primary",size:"large"}),e.jsx(m,{children:e.jsx(lu,{disabled:!D,label:"از تاریخ",id:"date",renderInput:o=>e.jsx(P,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...o}),value:d,onChange:o=>{n(wu(o).format("YYYY-MM-DD"))}})}),e.jsx(m,{children:e.jsx(lu,{disabled:!D,label:"تا تاریخ",id:"date",renderInput:o=>e.jsx(P,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...o}),value:c,onChange:o=>{g(wu(o).format("YYYY-MM-DD"))}})})]}),e.jsx(m,{children:e.jsx(Bu,{title:"خروجی اکسل",children:e.jsx("a",{href:`${O.defaults.baseURL}direct_purchase_excel/?date1=${d}&date2=${c}&role=${tu()}&key=${b}`,rel:"noreferrer",children:e.jsx(au,{color:"success",children:e.jsx(ie,{size:32})})})})})]})})}),e.jsx(uu,{sx:{display:"flex",justifyContent:"center"},children:e.jsxs(Hu,{value:a,onChange:k,sx:{justifyContent:"center"},children:[e.jsx(Du,{value:"0",label:"فعال"}),e.jsx(Du,{value:"1",label:"بایگانی"})]})}),e.jsx(Fe,{data:I,columns:["ردیف","تاریخ ثبت درخواست","تاریخ کشتار","خریدار","نوع خرید","محل کشتار","مرغدار (تلفن)","سن","نژاد","تعداد درخواست قطعه","میانگین وزنی (کیلوگرم)","وزن کل (کیلوگرم)","قیمت هر کیلو (ریال)","مبلغ کل خرید (ریال)","حداکثر مهلت تسویه","تمدید مهلت تسویه","توافق نامه","مبلغ تسویه (ریال)","وضعیت","بررسی کننده","تاریخ بررسی","گزارش",...a==="0"?["عملیات"]:[]],handlePageChange:y,totalRows:E,page:w,perPage:N,handlePerRowsChange:x,title:"تسویه حساب"})]})},c0=()=>{const{pathname:r}=se();return e.jsx(uu,{display:"flex",alignItems:"center",justifyContent:"center",direction:"column",children:e.jsx(m,{container:!0,display:"flex",direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:r===ee||r===te||r===ae||r===re?e.jsxs(e.Fragment,{children:[e.jsx(be,{}),e.jsx(m,{justifyContent:"center",alignItems:"center",children:e.jsx(Pu,{})})]}):e.jsxs(e.Fragment,{children:[e.jsx(m,{mt:Y.MEDIUM,children:e.jsx(Z,{variant:"h6",children:"تسویه حساب"})}),e.jsx(m,{justifyContent:"center",alignItems:"center",children:e.jsx(Pu,{})})]})})})};export{c0 as default}; diff --git a/build/assets/AdminStatics-XraSRt5m.js b/build/assets/AdminStatics-XraSRt5m.js new file mode 100644 index 0000000..cc31352 --- /dev/null +++ b/build/assets/AdminStatics-XraSRt5m.js @@ -0,0 +1,2 @@ +import{j as e,aA as A,T as c,B as F,ag as q,aw as T,ax as v,d as R,ak as I,aI as S,av as Q,aU as ee}from"./mui-vendor-CkIVaoQP.js";import{X as C,G as g,Q as Y,p as B,hK as ue,u as V,W as M,L as te,a9 as k,h as z,c as re,M as se,fI as P,S as $,v as ne}from"./index-CeyyVc1v.js";import{r as a}from"./react-vendor-CmFgShSM.js";import{f as y,u as ae}from"./redux-vendor-B7uoacJt.js";import{N,B as L,C as E,M as H,L as U}from"./chart-vendor-sE2SUVPW.js";import"./auto-gcBAg08D.js";import{a as G}from"./index.esm-Bu7XMDZU.js";import{p as oe}from"./chartjs-plugin-datalabels.esm-DvNX1Acq.js";import{h as le}from"./html2canvas.esm-BfYXEYrK.js";import{d as ie}from"./Download-DQ-VVIaV.js";import"./iconBase-BEJYyZsk.js";const ce=({province:r})=>{var d,n,h,t,j;const[u,i]=a.useState([]),[x,l]=a.useState(!1),{authToken:s}=y(_=>_.userSlice);return a.useEffect(()=>{fetch(`${r}total_poultry_hatching_dashboard/?role=${C()}`,{headers:{Authorization:`Bearer ${s}`}}).then(_=>_.json()).then(_=>{i(_),l(!1)}).catch(_=>{console.error("Error fetching data:",_),l(!1)})},[r]),e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(g,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",children:[e.jsx(c,{my:2,fontWeight:"bold",children:"فارم های فعال"}),e.jsxs(g,{container:!0,direction:"column",alignItems:"start",children:[e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["تعداد فارم: ",(d=u==null?void 0:u.poultry_counts)==null?void 0:d.toLocaleString()," واحد"]}),e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["جوجه ریزی:"," ",(n=u==null?void 0:u.total_poultry_hatchings_quantity)==null?void 0:n.toLocaleString()," قطعه"]}),e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["تلفات (10٪): ",(h=u==null?void 0:u.losses)==null?void 0:h.toLocaleString()," قطعه"]}),e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["کشتار شده:"," ",(t=u==null?void 0:u.total_kill_house_request_quantity)==null?void 0:t.toLocaleString()," قطعه"]}),e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["مانده در سالن:"," ",(j=u==null?void 0:u.total_poultry_hatchings_left)==null?void 0:j.toLocaleString()," قطعه"]})]})]})})},de=({province:r})=>{var d,n,h;const[u,i]=a.useState([]),[x,l]=a.useState(!1),{authToken:s}=y(t=>t.userSlice);return a.useEffect(()=>{fetch(`${r}total_system_user_profile_dashboard/?role=${C()}`,{headers:{Authorization:`Bearer ${s}`}}).then(t=>t.json()).then(t=>{i(t),l(!1)}).catch(t=>{console.error("Error fetching data:",t),l(!1)})},[r]),e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(g,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",children:[e.jsx(c,{my:2,fontWeight:"bold",children:"کاربران"}),e.jsxs(g,{container:!0,direction:"column",alignItems:"start",children:[e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["کل: ",(d=u==null?void 0:u.users)==null?void 0:d.toLocaleString()]}),e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["مرغداران: ",(n=u==null?void 0:u.poultries)==null?void 0:n.toLocaleString()]}),e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["اصناف: ",(h=u==null?void 0:u.guilds)==null?void 0:h.toLocaleString()]})]})]})})};L.font.family="iranyekan";console.log(E);const he=({province:r})=>{var h;const[u,i]=a.useState([]),[x,l]=a.useState(!0),{authToken:s}=y(t=>t.userSlice);a.useEffect(()=>{fetch(`${r}hatching_age_range/?role=${C()}`,{headers:{Authorization:`Bearer ${s}`}}).then(t=>t.json()).then(t=>{i(t),l(!1)}).catch(t=>{console.error("Error fetching data:",t),l(!1)})},[r]);const d={labels:u==null?void 0:u.filter(t=>t==null?void 0:t.quantity).map(t=>t.type),datasets:[{label:"تعداد جوجه ریزی",data:(h=u==null?void 0:u.filter(t=>t.quantity))==null?void 0:h.map(t=>t.quantity),backgroundColor:"rgba(75,192,192,0.2)",borderColor:"rgba(75,192,192,1)",borderWidth:1}]},n={scales:{y:{beginAtZero:!0}},plugins:{rtl:!0}};return e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(e.Fragment,{children:[e.jsxs(c,{className:"header-stats",children:["موجودی جوجه ریزی (مانده در سالن) بر اساس بازه سنی",(C()==="ProvinceOperator"||C()==="SuperAdmin")&&e.jsx("a",{href:`${r}hatching_age_range_excel/`,children:e.jsx(F,{children:"دانلود اکسل"})})]}),e.jsx(N,{style:{direction:"ltr"},data:d,options:n})]})})};L.font.family="iranyekan";console.log(E);const xe=({province:r})=>{var h;const[u,i]=a.useState([]),[x,l]=a.useState(!0),{authToken:s}=y(t=>t.userSlice);a.useEffect(()=>{fetch(`${r}single_hatching_age_range/?role=${C()}`,{headers:{Authorization:`Bearer ${s}`}}).then(t=>t.json()).then(t=>{i(t),l(!1)}).catch(t=>{console.error("Error fetching data:",t),l(!1)})},[r]);const d={labels:(h=u==null?void 0:u.filter(t=>t==null?void 0:t.quantity))==null?void 0:h.map(t=>t==null?void 0:t.type),datasets:[{label:"تعداد جوجه ریزی",data:u.filter(t=>t==null?void 0:t.quantity).map(t=>t==null?void 0:t.quantity),backgroundColor:"rgba(9, 132, 227,0.3)",borderColor:"rgba(9, 132, 227,1.0)",borderWidth:1}]},n={scales:{y:{beginAtZero:!0}},plugins:{rtl:!0}};return e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(e.Fragment,{children:[e.jsxs(c,{className:"header-stats",children:["موجودی جوجه ریزی (مانده در سالن) بر اساس سن",(C()==="ProvinceOperator"||C()==="SuperAdmin")&&e.jsx("a",{href:`${r}single_hatching_age_range_excel/`,children:e.jsx(F,{children:"دانلود اکسل"})})]}),e.jsx(N,{style:{direction:"ltr"},data:d,options:n})]})})};L.font.family="iranyekan";console.log(E);const ge=({province:r})=>{const[u,i]=a.useState([]),[x,l]=a.useState(!1),{authToken:s}=y(m=>m.userSlice),d=y(m=>m.userSlice.userProfile.key),n=new Date,h=Y(new Date(n),"M"),[t,j]=a.useState(h),_=m=>{j(m.target.value)},o={labels:u.map(m=>m.city),datasets:[{data:u.map(m=>m.percent),quantity:u.map(m=>m.quantity),backgroundColor:["#FF6384","#36A2EB","#FFCE56","#4CAF50","#9C27B0"]}]};a.useEffect(()=>{fetch(`${r}doughnut_hatching/?month=${t}&role=${C()}`,{headers:{Authorization:`Bearer ${s}`}}).then(m=>m.json()).then(m=>{i(m),l(!1)}).catch(m=>{console.error("Error fetching data:",m),l(!1)})},[t,r]);const p={plugins:{legend:{display:!0,position:"bottom"},tooltip:{callbacks:{label:m=>{const b=m.label||"",D=m.formattedValue,w=m.dataset.quantity[m.dataIndex];return`${b}: %${D} - ${w==null?void 0:w.toLocaleString()} قطعه`}}},datalabels:{color:"#fff",formatter:(m,b)=>`${`${b.chart.data.labels[b.dataIndex]}: ٪${m}`}`}}},f=["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"];return e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(e.Fragment,{children:[e.jsx(c,{className:"header-stats",children:e.jsxs(g,{container:!0,alignItems:"center",gap:2,justifyContent:"center",children:["گزارش کل جوجه ریزی بر اساس شهرستان",e.jsx(q,{style:{width:"120px"},children:e.jsx(T,{value:t,onChange:_,children:f.map((m,b)=>e.jsx(v,{value:b+1,children:m},b))})}),e.jsx(R,{title:"خروجی اکسل",children:e.jsx("a",{href:`${r}doughnut_hatching_excel/?role=${C()}&key=${d}&token=${s}`,rel:"noreferrer",children:e.jsx(F,{color:"success",children:e.jsx(G,{size:32})})})})]})}),e.jsx("div",{style:{height:"400px",width:"600px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:e.jsx(H,{data:o,options:p,style:{direction:"ltr"}})})]})})};E.register(oe);L.font.family="iranyekan";console.log(E);const me=({province:r})=>{const[u,i]=a.useState([]),[x,l]=a.useState(!1),{authToken:s}=y(f=>f.userSlice),d=new Date,n=Y(new Date(d),"M"),[h,t]=a.useState(n),j=f=>{t(f.target.value)},_=["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],o={labels:u.filter(f=>f.percent).map(f=>f.city),datasets:[{label:"جوجه ریزی",data:u.filter(f=>f.percent).map(f=>f.percent),quantity:u.map(f=>f.quantity),backgroundColor:["#FF6384","#36A2EB","#FFCE56","#4CAF50","#9C27B0"]}]};a.useEffect(()=>{fetch(`${r}doughnut_left_hatching/?month=${h}&role=${C()}`,{headers:{Authorization:`Bearer ${s}`}}).then(f=>f.json()).then(f=>{i(f),l(!1)}).catch(f=>{console.error("Error fetching data:",f),l(!1)})},[h,r]);const p={plugins:{legend:{display:!0,position:"bottom"},tooltip:{callbacks:{label:f=>{const m=f.label||"",b=f.formattedValue,D=f.dataset.quantity[f.dataIndex];return`${m}: %${b} - ${D==null?void 0:D.toLocaleString()} قطعه`}}},datalabels:{color:"#fff",formatter:(f,m)=>`${`${m.chart.data.labels[m.dataIndex]}: ٪${f}`}`}}};return e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(e.Fragment,{children:[e.jsx(c,{className:"header-stats",children:e.jsxs(g,{container:!0,alignItems:"center",gap:2,justifyContent:"center",children:["گزارش مانده جوجه ریزی بر اساس شهرستان",e.jsx(q,{style:{width:"120px"},children:e.jsx(T,{value:h,onChange:j,children:_.map((f,m)=>e.jsx(v,{value:m+1,children:f},m))})}),e.jsx(R,{title:"خروجی اکسل",children:e.jsx("a",{href:`${r}doughnut_left_hatching_excel/?month=${h}&token=${s}`,rel:"noreferrer",children:e.jsx(F,{color:"success",children:e.jsx(G,{size:32})})})})]})}),e.jsx("div",{style:{height:"400px",width:"600px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:e.jsx(H,{data:o,options:p,style:{direction:"ltr"}})})]})})},fe=({province:r})=>{var d,n,h,t;const[u,i]=a.useState([]),[x,l]=a.useState(!1),{authToken:s}=y(j=>j.userSlice);return a.useEffect(()=>{fetch(`${r}total_poultry_request_dashboard/?role=${C()}`,{headers:{Authorization:`Bearer ${s}`}}).then(j=>j.json()).then(j=>{i(j),l(!1)}).catch(j=>{console.error("Error fetching data:",j),l(!1)})},[r]),e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(g,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",children:[e.jsx(c,{my:2,fontWeight:"bold",children:"درخواست های کشتار"}),e.jsxs(g,{container:!0,direction:"column",alignItems:"start",children:[e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["کل درخواست ها:"," ",(d=u==null?void 0:u.total_poultry_request_quantity)==null?void 0:d.toLocaleString()," قطعه"]}),e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["تایید شده:"," ",(n=u==null?void 0:u.accepted_poultry_request_quantity)==null?void 0:n.toLocaleString()," قطعه"]}),e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["کل بارها:"," ",(h=u==null?void 0:u.total_kill_house_request_quantity)==null?void 0:h.toLocaleString()," قطعه"]}),e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["تخلیه شده:"," ",(t=u==null?void 0:u.accepted_kill_house_request_quantity)==null?void 0:t.toLocaleString()," ","قطعه"]})]})]})})};L.font.family="iranyekan";console.log(E);const je=({province:r})=>{const[u,i]=a.useState([]),[x,l]=a.useState(!0),{authToken:s}=y(o=>o.userSlice),d=y(o=>o.userSlice.userProfile.key),[n,h]=a.useState(10),t=o=>{h(o.target.value)};a.useEffect(()=>{fetch(`${r}number_of_kills/?day=${n}&role=${C()}`,{headers:{Authorization:`Bearer ${s}`}}).then(o=>o.json()).then(o=>{i(o),l(!1)}).catch(o=>{console.error("Error fetching data:",o),l(!1)})},[n,r]);const j={labels:u.map(o=>B(o.date)),datasets:[{label:"تعداد کشتار",data:u.map(o=>o.quantity),backgroundColor:"rgba(75,192,192,0.2)",borderColor:"rgba(75,192,192,1)",borderWidth:1}]},_={scales:{y:{beginAtZero:!0}},plugins:{rtl:!0}};return e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(e.Fragment,{children:[e.jsxs(g,{container:!0,className:"header-stats",alignItems:"center",justifyContent:"center",gap:1,children:[e.jsx(c,{children:"گزارش تعداد کشتار"}),e.jsx(g,{children:e.jsx(q,{variant:"outlined",children:e.jsxs(T,{value:n,onChange:t,children:[e.jsx(v,{value:"10",children:"10"}),e.jsx(v,{value:"20",children:"20"}),e.jsx(v,{value:"30",children:"30"}),e.jsx(v,{value:"45",children:"45"})]})})}),e.jsx(c,{children:"روز گذشته (براساس بار)"}),e.jsx("a",{href:`${r}number_of_kills_excel/?day=${n}&role=${C()}&key=${d}`,children:e.jsx(F,{children:"دانلود اکسل"})})]}),e.jsx(U,{style:{direction:"ltr"},data:j,options:_})]})})},pe=({province:r})=>{var d;const[u,i]=a.useState([]),[x,l]=a.useState(!1),{authToken:s}=y(n=>n.userSlice);return a.useEffect(()=>{fetch(`${r}total_pricing_dashboard/`,{headers:{Authorization:`Bearer ${s}`}}).then(n=>n.json()).then(n=>{i(n),l(!1)}).catch(n=>{console.error("Error fetching data:",n),l(!1)})},[r]),e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(g,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",children:[e.jsx(c,{my:2,fontWeight:"bold",children:"قیمت روز مرغ"}),e.jsxs(g,{container:!0,direction:"column",alignItems:"start",children:[e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["آخرین قیمت: ",(d=u==null?void 0:u.last_price)==null?void 0:d.toLocaleString()," ﷼"]}),e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["تاریخ بروزرسانی: ",B(u==null?void 0:u.last_change)]})]})]})})};L.font.family="iranyekan";console.log(E);const Ce=({province:r})=>{const[u,i]=a.useState([]),[x,l]=a.useState(!0),{authToken:s}=y(o=>o.userSlice),d=y(o=>o.userSlice.userProfile.key),[n,h]=a.useState(10),t=o=>{h(o.target.value)};a.useEffect(()=>{fetch(`${r}number_of_kills_weight/?day=${n}&role=${C()}`,{headers:{Authorization:`Bearer ${s}`}}).then(o=>o.json()).then(o=>{i(o),l(!1)}).catch(o=>{console.error("Error fetching data:",o),l(!1)})},[n,r]);const j={labels:u.map(o=>B(o.date)),datasets:[{label:"وزن کشتار",data:u.map(o=>o.weight),backgroundColor:"rgba(75,192,192,0.2)",borderColor:"rgba(75,192,192,1)",borderWidth:1}]},_={scales:{y:{beginAtZero:!0}},plugins:{rtl:!0}};return e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(e.Fragment,{children:[e.jsxs(g,{container:!0,alignItems:"center",justifyContent:"center",gap:1,className:"header-stats",children:[e.jsx(c,{children:"گزارش وزن کشتار"}),e.jsx(g,{children:e.jsx(q,{variant:"outlined",children:e.jsxs(T,{value:n,onChange:t,children:[e.jsx(v,{value:"10",children:"10"}),e.jsx(v,{value:"20",children:"20"}),e.jsx(v,{value:"30",children:"30"}),e.jsx(v,{value:"45",children:"45"})]})})}),e.jsx(c,{children:"روز گذشته (براساس بار)"}),e.jsx("a",{href:`${r}number_of_kills_weight_excel/?day=${n}&role=${C()}&key=${d}`,children:e.jsx(F,{children:"دانلود اکسل"})})]}),e.jsx(U,{style:{direction:"ltr"},data:j,options:_})]})})},ye=({province:r})=>{var d,n,h,t;const[u,i]=a.useState([]),[x,l]=a.useState(!1),{authToken:s}=y(j=>j.userSlice);return a.useEffect(()=>{fetch(`${r}total_file_poultry_request_dashboard/?role=${C()}`,{headers:{Authorization:`Bearer ${s}`}}).then(j=>j.json()).then(j=>{i(j),l(!1)}).catch(j=>{console.error("Error fetching data:",j),l(!1)})},[r]),e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(g,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",children:[e.jsx(c,{my:2,fontWeight:"bold",children:"پرونده های کشتار"}),e.jsxs(g,{container:!0,direction:"column",alignItems:"start",children:[e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["کل پرونده ها:"," ",(d=u==null?void 0:u.total_poultry_request_quantity)==null?void 0:d.toLocaleString()]}),e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["تایید شده:"," ",(n=u==null?void 0:u.accepted_poultry_request_quantity)==null?void 0:n.toLocaleString()]}),e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["رد شده:"," ",(h=u==null?void 0:u.rejected_poultry_request_quantity)==null?void 0:h.toLocaleString()]}),e.jsxs(c,{color:"primary",variant:"body2",mb:1,children:["بایگانی شده:"," ",(t=u==null?void 0:u.archive_poultry_request_quantity)==null?void 0:t.toLocaleString()]})]})]})})},_e=({province:r})=>{var d,n,h;const[u,i]=a.useState([]),[x,l]=a.useState(!0),{authToken:s}=y(t=>t.userSlice);return a.useEffect(()=>{fetch(`${r}poultry_request_killing_process/?role=${C()}`,{headers:{Authorization:`Bearer ${s}`}}).then(t=>t.json()).then(t=>{i(t),l(!1)}).catch(t=>{console.error("Error fetching data:",t),l(!1)})},[]),e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(g,{container:!0,direction:"column",className:"stats-wrap",children:[e.jsx(c,{my:2,className:"stats-title",fontWeight:"bold",children:"درخواست کشتار"}),e.jsxs(g,{container:!0,className:"stats-content",direction:"column",alignItems:"start",children:[e.jsxs(c,{children:["تعداد مرغدار: ",(d=u==null?void 0:u.poultry_quantity)==null?void 0:d.toLocaleString()," فارم"]}),e.jsxs(c,{children:["تعداد: ",(n=u==null?void 0:u.poultry_request_quantity)==null?void 0:n.toLocaleString()," قطعه"]}),e.jsxs(c,{children:["وزن : ",(h=u==null?void 0:u.poultry_request_index_weight)==null?void 0:h.toLocaleString()," ","کیلوگرم"]}),e.jsx("a",{href:`${r}total_poultry_request_dashboard_excel/`,target:"_blank",rel:"noreferrer",style:{width:"100%"},children:e.jsx(F,{fullWidth:!0,variant:"outlined",style:{marginTop:"10px"},children:"دانلود اکسل"})})]})]})})},Ae=({province:r})=>{var d,n,h;const[u,i]=a.useState([]),[x,l]=a.useState(!0),{authToken:s}=y(t=>t.userSlice);return a.useEffect(()=>{fetch(`${r}province_kill_request_killing_process/?role=${C()}`,{headers:{Authorization:`Bearer ${s}`}}).then(t=>t.json()).then(t=>{i(t),l(!1)}).catch(t=>{console.error("Error fetching data:",t),l(!1)})},[]),e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(g,{container:!0,direction:"column",className:"stats-wrap",children:[e.jsx(c,{my:2,className:"stats-title",fontWeight:"bold",children:"تخصیصات"}),e.jsxs(g,{container:!0,className:"stats-content",direction:"column",alignItems:"start",children:[e.jsxs(c,{children:["تعداد کشتارگاه: ",(d=u==null?void 0:u.kill_house_quantity)==null?void 0:d.toLocaleString()," واحد"]}),e.jsxs(c,{children:["تعداد: ",(n=u==null?void 0:u.province_kill_request_quantity)==null?void 0:n.toLocaleString()," ","قطعه"]}),e.jsxs(c,{children:["وزن : ",(h=u==null?void 0:u.province_kill_request_index_weight)==null?void 0:h.toLocaleString()," ","کیلوگرم"]}),e.jsx("a",{href:`${r}allocated_excel/`,style:{width:"100%"},children:e.jsx(F,{fullWidth:!0,variant:"outlined",style:{marginTop:"10px"},children:"دانلود اکسل"})})]})]})})},be=({province:r})=>{var d,n,h;const[u,i]=a.useState([]),[x,l]=a.useState(!0),{authToken:s}=y(t=>t.userSlice);return a.useEffect(()=>{fetch(`${r}kill_house__request_vetfarm_killing_process/?role=${C()}`,{headers:{Authorization:`Bearer ${s}`}}).then(t=>t.json()).then(t=>{i(t),l(!1)}).catch(t=>{console.error("Error fetching data:",t),l(!1)})},[]),e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(g,{container:!0,direction:"column",className:"stats-wrap",children:[e.jsx(c,{my:2,className:"stats-title",fontWeight:"bold",children:"مسئول فنی مزرعه"}),e.jsxs(g,{container:!0,className:"stats-content",direction:"column",alignItems:"start",children:[e.jsxs(c,{children:["کد قرنطینه: ",(d=u==null?void 0:u.clearance_code_counter)==null?void 0:d.toLocaleString()," بار"]}),e.jsxs(c,{children:["تعداد: ",(n=u==null?void 0:u.kill_house_quantity)==null?void 0:n.toLocaleString()," قطعه"]}),e.jsxs(c,{children:["وزن : ",(h=u==null?void 0:u.kill_house_request_weight)==null?void 0:h.toLocaleString()," کیلوگرم"]}),e.jsx(F,{fullWidth:!0,variant:"outlined",style:{marginTop:"10px"},children:"دانلود اکسل"})]})]})})},Fe=({province:r})=>{var d,n,h;const[u,i]=a.useState([]),[x,l]=a.useState(!0),{authToken:s}=y(t=>t.userSlice);return a.useEffect(()=>{fetch(`${r}kill_house__request_vet_killing_process/?role=${C()}`,{headers:{Authorization:`Bearer ${s}`}}).then(t=>t.json()).then(t=>{i(t),l(!1)}).catch(t=>{console.error("Error fetching data:",t),l(!1)})},[]),e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(g,{container:!0,direction:"column",className:"stats-wrap",children:[e.jsx(c,{my:2,className:"stats-title",fontWeight:"bold",children:"کشتارگاه"}),e.jsxs(g,{container:!0,className:"stats-content",direction:"column",alignItems:"start",children:[e.jsxs(c,{children:["بار تخلیه شده: ",(d=u==null?void 0:u.vet_check_counter)==null?void 0:d.toLocaleString()," بار"]}),e.jsxs(c,{children:["تعداد: ",(n=u==null?void 0:u.kill_house_quantity)==null?void 0:n.toLocaleString()," قطعه"]}),e.jsxs(c,{children:["وزن : ",(h=u==null?void 0:u.kill_house_request_weight)==null?void 0:h.toLocaleString()," کیلوگرم"]}),e.jsx(F,{fullWidth:!0,variant:"outlined",style:{marginTop:"10px"},children:"دانلود اکسل"})]})]})})},Se=re({startDate:P().required("تاریخ شروع الزامی است"),endDate:P().required("تاریخ پایان الزامی است"),textInput:se().required("سن الزامی است")}),ve=({province:r})=>{const u=ae(),[i,x]=a.useState([]),[l,s]=a.useState(!0),{authToken:d}=y(p=>p.userSlice),n=()=>{u(te()),fetch(`${r}forecast_hatching_left_over/?date1=${k(o.values.startDate).format("YYYY-MM-DD")}&date2=${k(o.values.endDate).format("YYYY-MM-DD")}&age=${o.values.textInput}&role=${C()}`,{headers:{Authorization:`Bearer ${d}`}}).then(p=>p.json()).then(p=>{x(p),s(!1),u(z())}).catch(p=>{console.error("Error fetching data:",p),s(!1),u(z())})};a.useEffect(()=>{n()},[r]);const h={labels:i.map(p=>B(p.date)),datasets:[{label:"تعداد جوجه ریزی",data:i.map(p=>p.hatching_left_over),backgroundColor:"rgba(75,192,192,0.2)",borderColor:"rgba(75,192,192,1)",borderWidth:1}]},t={scales:{y:{beginAtZero:!0}},plugins:{rtl:!0}},j=new Date,_=ue(j,1),o=V({initialValues:{startDate:j,endDate:_,textInput:"45"},validationSchema:Se,onSubmit:p=>{n()}});return e.jsxs(g,{container:!0,direction:"column",children:[e.jsxs(g,{container:!0,justifyContent:"center",alignItems:"center",width:"100%",className:"header-stats",p:1,children:[e.jsx(c,{children:"جوجه ریزی مانده در سالن براساس بازه زمانی و سن (تلفات پیش فرض 10٪)"}),e.jsx("form",{onSubmit:o.handleSubmit,children:e.jsxs(g,{container:!0,direction:"row",alignItems:"center",gap:2,children:[e.jsx(g,{children:e.jsx(M,{label:"از تاریخ",value:o.values.startDate,onChange:p=>o.setFieldValue("startDate",p),renderInput:p=>e.jsx(I,{...p,error:o.touched.startDate&&!!o.errors.startDate,helperText:o.touched.startDate&&o.errors.startDate})})}),e.jsx(g,{children:e.jsx(M,{label:"تا تاریخ",value:o.values.endDate,onChange:p=>o.setFieldValue("endDate",p),renderInput:p=>e.jsx(I,{...p,error:o.touched.endDate&&!!o.errors.endDate,helperText:o.touched.endDate&&o.errors.endDate})})}),e.jsx(g,{children:e.jsx(I,{name:"textInput",label:"سن",type:"number",fullWidth:!0,margin:"normal",value:o.values.textInput,onChange:o.handleChange,onBlur:o.handleBlur,error:o.touched.textInput&&!!o.errors.textInput,helperText:o.touched.textInput&&o.errors.textInput})}),e.jsx(g,{children:e.jsx(F,{type:"submit",size:"large",variant:"contained",color:"primary",children:"ارسال اطلاعات"})})]})})]}),e.jsx(g,{children:l?e.jsx(A,{}):e.jsx(N,{style:{direction:"ltr"},data:h,options:t})})]})};function K(r,u){return De(r)||$e(r,u)||ke(r,u)||Ee()}function De(r){if(Array.isArray(r))return r}function $e(r,u){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var x=[],l=!0,s=!1,d,n;try{for(i=i.call(r);!(l=(d=i.next()).done)&&(x.push(d.value),!(u&&x.length===u));l=!0);}catch(h){s=!0,n=h}finally{try{!l&&i.return!=null&&i.return()}finally{if(s)throw n}}return x}}function ke(r,u){if(r){if(typeof r=="string")return O(r,u);var i=Object.prototype.toString.call(r).slice(8,-1);if(i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set")return Array.from(r);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return O(r,u)}}function O(r,u){(u==null||u>r.length)&&(u=r.length);for(var i=0,x=new Array(u);i0&&arguments[0]!==void 0?arguments[0]:{},i=u.type,x=u.quality,l=a.useState(null),s=K(l,2),d=s[0],n=s[1],h=a.useState(null),t=K(h,2),j=t[0],_=t[1],o=function(f){if(!f)throw new Error("You should provide correct html node.");return le(f).then(function(m){var b=document.createElement("canvas"),D=b.getContext("2d"),w=0,Z=0,X=m.width,J=m.height;b.width=X,b.height=J,D.drawImage(m,Z,w);var W=b.toDataURL(i,x);return n(W),W}).catch(_)};return[d,o,{error:j}]};const we=({province:r})=>{const[u,i]=a.useState(k(new Date).format("YYYY-MM-DD")),[x,l]=a.useState(k(new Date).format("YYYY-MM-DD"));return a.useEffect(()=>{var s=k(u),d=s.add(7,"days").format("YYYY-MM-DD");l(d)},[u]),e.jsxs(g,{container:!0,alignItems:"center",gap:$.SMALL,children:[e.jsxs(g,{container:!0,alignItems:"center",gap:$.TINY,children:[e.jsx(c,{children:"روند کشتار بر اساس بازه"}),e.jsx(M,{label:"از تاریخ",id:"date",renderInput:s=>e.jsx(I,{style:{width:"160px"},...s}),value:u,onChange:s=>{i(k(s).format("YYYY-MM-DD"))}})," ",e.jsx(M,{label:"تا تاریخ",id:"date",disabled:!0,renderInput:s=>e.jsx(I,{style:{width:"160px"},...s}),value:x,onChange:s=>{l(k(s).format("YYYY-MM-DD"))}})]}),e.jsx("a",{href:`${r}killing_process_from_date_excel/?start=${u}&end=${x}`,rel:"noreferrer",children:e.jsx(F,{variant:"outlined",size:"large",children:"دانلود"})})]})},Ie=()=>[{name:"همدان",link:"https://habackend.rasadyar.com/"},{name:"مرکزی",link:"https://mabackend.rasadyar.com/"},{name:"بوشهر",link:"https://bubackend.rasadyar.com/"}],qe=({province:r})=>{var s,d,n;const[u,i]=a.useState([]),[x,l]=a.useState(!0);return a.useEffect(()=>{fetch(`${r}steward_guilds_allocations_for_statistical_profile/?date=${ne(new Date).format("YYYY-MM-DD")}&?role=${C()}`,{}).then(h=>h.json()).then(h=>{i(h),l(!1)}).catch(h=>{console.error("Error fetching data:",h),l(!1)})},[r]),e.jsx(e.Fragment,{children:x?e.jsx(A,{}):e.jsxs(g,{container:!0,direction:"column",className:"stats-wrap",children:[e.jsx(c,{my:2,className:"stats-title",fontWeight:"bold",children:"توزیع لاشه"}),e.jsxs(g,{container:!0,className:"stats-content",direction:"column",alignItems:"start",children:[e.jsxs(c,{children:["تعداد واحد: ",(s=u==null?void 0:u.allocations)==null?void 0:s.toLocaleString()," بار"]}),e.jsxs(c,{children:["حجم لاشه: ",(d=u==null?void 0:u.real_number_of_carcasses)==null?void 0:d.toLocaleString()," قطعه"]}),e.jsxs(c,{children:["وزن لاشه : ",(n=u==null?void 0:u.real_weight_of_carcasses)==null?void 0:n.toLocaleString()," ","کیلوگرم"]}),e.jsx(F,{fullWidth:!0,variant:"outlined",style:{marginTop:"10px"},children:"دانلود اکسل"})]})]})})},Ve=()=>{const r=a.createRef(null),[u,i]=Le(),x=()=>i(r.current),l=y(n=>n.userSlice.userPath);a.useEffect(()=>{if(u){const n=document.createElement("a");n.href=u,n.setAttribute("download","report.png"),n.click()}},[u]);const s=V({initialValues:{province:l}});a.useEffect(()=>{s.validateForm()},[]);const d=window.innerWidth<=600;return e.jsxs(S,{style:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:"10px",flexDirection:"column"},children:[e.jsxs(g,{style:{marginBottom:"10px"},container:!0,xs:10,mt:$.SMALL,justifyContent:"flex-end",children:[e.jsx(g,{xs:6,lg:2,md:4,sm:2,children:(C()==="Observatory"||C()==="AdminX")&&e.jsxs(q,{children:[e.jsx(Q,{id:"demo-simple-select-label",children:"انتخاب استان"}),e.jsx(T,{size:"small",displayEmpty:!0,labelId:"demo-simple-select-label",id:"province",value:s.values.province,error:s.touched.province?!!s.errors.province:null,onChange:n=>{s.setFieldValue("province",n.target.value)},onBlur:s.handleBlur,children:Ie().map(n=>e.jsx(v,{value:n.link,children:n.name},n.link))}),e.jsx(ee,{children:s.touched.province&&s.errors.province?s.errors.province:null})]})}),e.jsx(g,{xs:4,lg:2,md:4,sm:2,children:e.jsx(F,{startIcon:e.jsx(ie,{}),onClick:x,children:"دانلود آمار"})})]}),e.jsxs(S,{ref:r,style:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:"10px",paddingBottom:"50px",flexDirection:"column"},children:[e.jsx(S,{sx:{boxShadow:4,borderRadius:"20px",padding:"20px"},width:"80%",mt:$.SMALL,mb:$.SMALL,children:e.jsxs(g,{container:!0,xs:12,justifyContent:"space-between",children:[e.jsx(g,{xs:12,md:12,sm:12,lg:3,children:e.jsx(fe,{province:s.values.province})}),e.jsx(g,{xs:12,md:12,sm:12,lg:2,children:e.jsx(ye,{province:s.values.province})}),e.jsx(g,{xs:12,md:12,sm:12,lg:3,children:e.jsx(ce,{province:s.values.province})}),e.jsx(g,{xs:12,md:12,sm:12,lg:2,children:e.jsx(de,{province:s.values.province})}),e.jsx(g,{xs:12,md:12,sm:12,lg:2,children:e.jsx(pe,{province:s.values.province})})]})}),e.jsxs(S,{style:{width:"80%",display:"flex",justifyContent:"space-between",marginTop:"40px",flexDirection:"column",alignItems:"start"},children:[e.jsxs(g,{container:!0,width:"100%",justifyContent:"space-between",alignItems:"center",children:[e.jsxs(c,{children:["روند کشتار امروز مورخ ",Y(new Date,"yyyy/MM/dd")]}),e.jsx(we,{province:s.values.province})]}),e.jsxs(S,{mb:$.MEDIUM,gap:$.TINY,style:{display:"flex",justifyContent:"space-between",marginTop:"20px",width:"100%"},children:[e.jsx(_e,{province:s.values.province}),e.jsx(Ae,{province:s.values.province}),e.jsx(be,{province:s.values.province}),e.jsx(Fe,{province:s.values.province}),e.jsx(qe,{province:s.values.province})]})]}),e.jsxs(S,{style:{width:d?"40%":"80%",display:"flex",justifyContent:"space-between",flexDirection:"column",gap:$.MEDIUM},children:[e.jsx(he,{province:s.values.province}),e.jsx("br",{}),e.jsx(xe,{province:s.values.province})]}),e.jsxs(S,{style:{width:"80%",display:"flex",justifyContent:"space-between",marginTop:"40px"},children:[e.jsx(S,{style:{width:"48%"},children:e.jsx(ge,{province:s.values.province})}),e.jsx(S,{style:{width:"48%"},children:e.jsx(me,{province:s.values.province})})]}),e.jsxs(S,{style:{width:"80%",display:"flex",justifyContent:"space-between",marginTop:"40px"},children:[e.jsx(S,{style:{width:"48%"},children:e.jsx(je,{province:s.values.province})}),e.jsx(S,{style:{width:"48%"},children:e.jsx(Ce,{province:s.values.province})})]}),e.jsx(S,{style:{width:"80%",display:"flex",justifyContent:"space-between",marginTop:"40px"},children:e.jsx(ve,{province:s.values.province})})]})]})};export{Ve as default}; diff --git a/build/assets/AdminXDashboard-DfgejEhn.js b/build/assets/AdminXDashboard-DfgejEhn.js new file mode 100644 index 0000000..0c5cb63 --- /dev/null +++ b/build/assets/AdminXDashboard-DfgejEhn.js @@ -0,0 +1 @@ +import{j as r}from"./mui-vendor-CkIVaoQP.js";import"./react-vendor-CmFgShSM.js";const t=()=>r.jsx("div",{children:"AdminXDashboard"});export{t as default}; diff --git a/build/assets/AdminXExcelCheck-Dhsh4oVZ.js b/build/assets/AdminXExcelCheck-Dhsh4oVZ.js new file mode 100644 index 0000000..885db6c --- /dev/null +++ b/build/assets/AdminXExcelCheck-Dhsh4oVZ.js @@ -0,0 +1 @@ +import{j as r,I as B,T as M,ak as m,B as R,b as U}from"./mui-vendor-CkIVaoQP.js";import{r as c}from"./react-vendor-CmFgShSM.js";import{j as L,A as q,v as k,hJ as G,G as C,S,W as P,X as j}from"./index-CeyyVc1v.js";import{R as $}from"./ResponsiveTable-w7hk7Uq8.js";import{a as Z,f as D,u as N}from"./redux-vendor-B7uoacJt.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const W=[{title:"مدیریت بار",url:"bar_excel/?start=2024-08-03&end=2024-08-03&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&role=ProvinceOperator&search=filter&value="},{title:"گزارش جزییات کشتار",url:"detail_of_killing_excel/?date1=2024-08-03&date2=2024-08-03&role=ProvinceOperator&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"گزارش جامع کشتارگاه",url:"comprehensive_report_of_the_slaughterhouse_excel/?date1=2024-08-03&date2=2024-08-03"},{title:"پایش کلی بارها",url:"monitor_loads_excel/?role=ProvinceOperator&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&date1=2024-08-03&date2=2024-08-03"},{title:"مدیریت بارهای تکمیل نشده",url:"bar_excel/?start=2024-05-21&end=2024-08-03&role=ProvinceOperator&state=bar_pending&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&search=filter&value="},{title:"مدیریت بارهای تکمیل شده",url:"bar_excel/?start=2024-07-22&end=2024-08-03&state=completed&role=ProvinceOperator&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&search=filter&value="},{title:"بارهای حذف شده",url:"bar_excel_trash_true/?start=2024-08-03&end=2024-08-03&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&role=ProvinceOperator&search=filter&value="},{title:"فروش خارج از استان",url:"bar_free_excel/?date1=2024-08-03&date2=2024-08-03&state=accepted&role=ProvinceOperator&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"مدیریت بارهای زنجیره",url:"bar_chain_excel/?key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&role=ProvinceOperator&search=filter&value=&state=accepted&date1=2024-08-03&date2=2024-08-03"},{title:"خرید خارج از استان زنده",url:"kill_house_free_bar_excel/?role=ProvinceOperator&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&date1=2024-08-03&date2=2024-08-03&type=live"},{title:"خرید خارج از استان لاشه",url:"kill_house_free_bar_excel/?role=ProvinceOperator&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&date1=2024-08-03&date2=2024-08-03&type=carcass"},{title:"درخواست مرغدار",url:"poultry_kill_request_excel/?start=2024-08-03&end=2024-08-03&role=ProvinceOperator&token=vamptUktoL9b1htBgvjE14XTZg7Bg4"},{title:"درخواست کشتارگاه",url:"kill_house_excel/?start=2024-08-03&end=2024-08-03"},{title:"جوجه ریزی",url:"0/hatching_excel/?role=ProvinceOperator&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&search=filter&value="},{title:"بایگانی جوجه ریزی",url:"archive_hatching_excel/?search=filter&value=&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&role=ProvinceOperator"},{title:"جوجه ریزی در بازه تاریخی",url:"hatching_date_range_excel/?date1=2024-08-03&date2=2024-08-03"},{title:"وضعیت پرونده",url:"poultry_request_report_excel/?start=2024-08-03&end=2024-08-03&role=ProvinceOperator&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"گزارش مغایرت اطلاعات کشتار و عدم فعالیت نقش ها",url:"discrepancy_report_excel/?date1=2024-08-02&date2=2024-08-03&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&role=ProvinceOperator"},{title:"گزارش کلی فارم های فعال مرغ گوشتی دارای مانده در سالن بیشتر از 10 درصد و بازه سنی 55 تا 90 روزه",url:"poultry_hatching_between_50age_70age_excel/"},{title:"گزارش کشتار روزانه",url:"daily_process_klling_proccess_excel/?date=2024-08-03&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"گزارش پخش روزانه",url:"daily_process_excel/?date=2024-08-03&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"تراکنش های موفق",url:"successful_transactions_excel/?date1=2024-08-03&date2=2024-08-03&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"تراکنش های ناموفق",url:"unsuccessful_transactions_excel/?date1=2024-08-03&date2=2024-08-03&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"مدیریت اصناف",url:"guilds_excel/?key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&search=filter&value=&role=ProvinceOperator"},{title:"مدیریت مباشرین",url:"stewards_excel/"},{title:"خودروها",url:"car_province_excel/?key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&role=Province"},{title:"مدیریت کاربران",url:"get_all_user_excel/"},{title:"مدیریت مرغداران",url:"management_poultry/?key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&role=ProvinceOperator"},{title:"مدیریت خریداران",url:"kill_house_user_excel/"},{title:"گزارش پخش لاشه مرغ گرم",url:"all_inventory_excel/?date1=2024-07-22&date2=2024-08-03"},{title:"گزارش پخش لاشه مرغ گرم از مباشر به صنف",url:"steward_ware_house_total_report_daily_excel/?date1=2024-06-21&date2=2024-08-03"},{title:"کارمزد پرداخت شده کشتارگاه",url:"kill_house_total_transactions_wage_payid_excel/?key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&search=filter&value=&role=ProvinceOperator"},{title:"پرداختی زنجیره ها",url:"chain-company-total-transactions_not_payid_excel/?token=vamptUktoL9b1htBgvjE14XTZg7Bg4"},{title:"ریز تراکنش ها",url:"payment_transactions_province_excel/?role=ProvinceOperator&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"اطلاعات تعرفه بارهای روزانه",url:"kill_house_total_wage_excel/?token=vamptUktoL9b1htBgvjE14XTZg7Bg4&date1=2024-08-03&date2=2024-08-03"},{title:"پایش تعرفه برای استان",url:"kill_house_total_transactions_wage_payid_super_admin_excel/?key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&role=AdminX"},{title:"پایش تعرفه برای ادمین ایکس",url:"kill_house_total_transactions_wage_payid_admin_x_excel/?role=AdminX&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"خرید مستقیم",url:"direct_purchase_excel/?date1=2024-08-03&date2=2024-08-03&role=ProvinceOperator&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"بایگانی خرید مستقیم",url:"direct_purchase_archive_excel/?date1=2024-08-03&date2=2024-08-03&role=ProvinceOperator&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"بایگانی صادرات",url:"export_kill_house_excel/?date1=2024-08-03&date2=2024-08-03&role=AdminX&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"گزارش کلی بار خارج از استان",url:"general_free_bar_excel/?date1=2024-08-03&date2=2024-08-03&role=AdminX&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&search=filter&value="},{title:"بار خارج از استان",url:"bar_free_excel/?date1=2024-08-03&date2=2024-08-03&state=pending&role=AdminX&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"بارهای تایید شده خارج از استان",url:"bar_free_excel/?date1=2024-08-03&date2=2024-08-03&state=accepted&role=AdminX&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"بارهای رد شده خارج از استان",url:"bar_free_excel/?date1=2024-08-03&date2=2024-08-03&state=rejected&role=AdminX&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"خریداران خارج از استان",url:"out_province_poultry_request_buyers_excel/?key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&role=AdminX&search=filter&value="},{title:"جوجه ریزی زنجیره",url:"0/hatching_excel/?role=AdminX&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&chain=true"},{title:"مدیریت بار زنجیره ها",url:"bar_chain_excel/?key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&role=AdminX&search=filter&value=&state=accepted&date1=2024-08-03&date2=2024-08-03"},{title:"شرکت زنجیره",url:"chain_company_buyers_excel/?role=AdminX&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904&search=filter&value="},{title:"جوجه ریزی بایگانی شرکت زنجیره",url:"archive_hatching_excel/?chain=true"},{title:"مدیریت تخصیصات",url:"allocated_excel/?start=2024-08-03&end=2024-08-03"},{title:"گزارش کشتار روزانه",url:"daily_process_klling_proccess_excel/?date=2024-08-03&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"گزارش پخش روزانه",url:"daily_process_excel/?date=2024-08-03&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"تراکنش های موفق",url:"successful_transactions_excel/?date1=2024-08-03&date2=2024-08-03&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"},{title:"تراکنش های ناموفق",url:"unsuccessful_transactions_excel/?date1=2024-08-03&date2=2024-08-03&key=fde6fff6-7f4c-4e10-5604-0d45f8b41904"}],O=Z("ADMINX_REPORT_STATUS",async(_,{dispatch:F})=>{const{data:d,status:n}=await L.get("check_excel/",{params:{url:_.url}});return{data:d,status:n}}),J=()=>{const[_,F]=c.useState([]),d=D(e=>{var u,t;return(t=(u=e.userSlice)==null?void 0:u.userProfile)==null?void 0:t.key}),n=D(e=>{var u;return(u=e.userSlice)==null?void 0:u.authToken}),[b,i]=c.useState(null),[s,A]=c.useState([]),[X,w]=c.useState(!1),[,,p,h,y,x]=c.useContext(q),v=N();c.useEffect(()=>{const e=k(new Date).format("YYYY-MM-DD");h(e),x(e)},[h,x]),c.useEffect(()=>{const e=W.map(u=>({...u,status:""}));A(e)},[]);function g(e,u,t,o,a,f){if(!e||typeof e!="string")return e||"";const[Y,E]=e.split("?");if(!E)return e;const l=new URLSearchParams(E);return l.has("date1")&&l.set("date1",u),l.has("date2")&&l.set("date2",t),l.has("start")&&l.set("start",u),l.has("end")&&l.set("end",t),l.has("role")&&l.set("role",o),l.has("token")&&l.set("token",f),l.has("key")&&l.set("key",a),`${Y}?${l.toString()}`}const T=async()=>{var u,t,o;const e=[...s];for(let a=0;a!a)},I=async e=>{var u,t,o;i(e);try{const a=await v(O({url:g((u=s[e])==null?void 0:u.url,p,y,j(),d,n)})),f=[...s];(o=(t=a==null?void 0:a.payload)==null?void 0:t.data)!=null&&o.status&&(f[e].status=a.payload.data.status),A(f)}catch(a){console.error("Error fetching report status:",a)}finally{i(null)}};return c.useEffect(()=>{const e=s.map((u,t)=>[t+1,(u==null?void 0:u.title)||"",u!=null&&u.url?u.url.split("/")[0]:"",r.jsx(B,{color:"primary",onClick:()=>I(t),disabled:b===t,children:r.jsx(G,{})},`button-${t}`),u!=null&&u.status?r.jsxs(M,{style:{color:parseInt(u.status)===200||u.status==="200"?"green":"red",fontWeight:"bold"},children:["(",u.status,")"," ",parseInt(u.status)===200||u.status==="200"?"سالم":"مشکل دارد"]},`status-${t}`):"-"]);F(e)},[s,b,X]),r.jsxs(C,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[r.jsxs(C,{container:!0,gap:S.SMALL,alignItems:"center",children:[r.jsx(C,{children:r.jsx(P,{label:"از تاریخ",id:"date",renderInput:e=>r.jsx(m,{style:{width:"160px"},...e}),value:p,onChange:e=>{h(k(e).format("YYYY-MM-DD"))}})}),r.jsx(C,{children:r.jsx(P,{label:"تا تاریخ",id:"date",renderInput:e=>r.jsx(m,{style:{width:"160px"},...e}),value:y,onChange:e=>{x(k(e).format("YYYY-MM-DD"))}})}),r.jsx(C,{children:r.jsx(R,{variant:"contained",onClick:T,children:"تست همگانی"})})]}),r.jsx($,{title:"بررسی اکسل",noPagination:!0,data:_,columns:["ردیف","عنوان","آدرس","بررسی","وضعیت"]})]})},t0=()=>r.jsx(U,{display:"flex",justifyContent:"center",children:r.jsx(C,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,my:S.MEDIUM,children:r.jsx(J,{})})});export{t0 as default}; diff --git a/build/assets/AdvancedChart-DTCDh5lM.js b/build/assets/AdvancedChart-DTCDh5lM.js new file mode 100644 index 0000000..22b16ba --- /dev/null +++ b/build/assets/AdvancedChart-DTCDh5lM.js @@ -0,0 +1 @@ +import{j as d}from"./mui-vendor-CkIVaoQP.js";import{r as p}from"./react-vendor-CmFgShSM.js";import{J as b,K as v}from"./chart-vendor-sE2SUVPW.js";import{G as w}from"./index-CeyyVc1v.js";const E=({info:e,title:r,seperator:h,type:l,group:y})=>{const[o,m]=p.useState(y),s=p.useRef(null),n=["#1105f5","#f50505","#f5056d","#f505f5","#05a5f5","#05f5bd","#05f57d","#1f4f33","#95DFD3","#AEC7ED","#92BFFF","#B1B1E0","#fdcb6e","#636e72","#d63031","#7f8fa6","#40739e"],a=t=>n[t%n.length],C=(t,u)=>({type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:t},{offset:1,color:u}]}),f=t=>{s.current=t},x=()=>{m(t=>!t),s.current&&s.current.setOption(i())},i=()=>l==="pie"?{title:{text:r,textStyle:{fontWeight:"bold",fontSize:16,fontFamily:"iranyekan"},left:"center",padding:10},tooltip:{trigger:"item",formatter:"{a}
{b}: {c} ({d}%)"},legend:{orient:"vertical",right:10,top:"center",data:e==null?void 0:e.map(t=>t==null?void 0:t.name),textStyle:{fontFamily:"iranyekan",width:100,overflow:"truncate",ellipsis:"..."}},color:e==null?void 0:e.map((t,u)=>a(u)),series:[{name:r,type:"pie",radius:["40%","70%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:10,borderColor:"#fff",borderWidth:2},label:{show:!1,position:"center"},emphasis:{label:{show:!0,fontSize:"18",fontWeight:"bold"}},labelLine:{show:!1},data:e==null?void 0:e.map((t,u)=>({value:t.data[0],name:t.name,itemStyle:{color:a(u)}}))}],textStyle:{fontFamily:"iranyekan"}}:{title:{text:r,textStyle:{fontWeight:"bold",fontSize:16,fontFamily:"iranyekan"},left:"center",padding:10},xAxis:{type:"category",data:h,axisLabel:{rotate:30,interval:0,width:60,overflow:"truncate",fontSize:10}},yAxis:o?[{type:"value",axisLabel:{formatter:function(t){return t=+t,isFinite(t)?v(+t/1e3):""}}}]:{type:"value"},dataZoom:[{show:!1,start:0,end:100},{type:"inside",start:94,end:100}],toolbox:{show:!0,feature:{mark:{show:!0,title:{mark:"علامت گذاری",markUndo:"حذف علامت",markClear:"پاک کردن همه علامت‌ها"}},magicType:{show:!0,type:["line","bar"],title:{line:"خطی",bar:"میله‌ای",pie:"دایره ای"}},saveAsImage:{show:!0,title:"ذخیره به عنوان تصویر"},myCustomButton:{show:!0,title:o?"نمایش گروهی":"نمایش جداگانه",icon:"path://M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",onclick:x}}},grid:{top:"20%",left:"1%",right:"1%",containLabel:!0},textStyle:{fontFamily:"iranyekan"},color:e==null?void 0:e.map((t,u)=>a(u)),series:e==null?void 0:e.map((t,u)=>{const c=a(u),g=a(u+1);return{...t,smooth:!0,type:l,itemStyle:{color:c},areaStyle:{color:C(c,g)},emphasis:{focus:"series"},stack:o?!1:"stack"}}),tooltip:{trigger:"axis",axisPointer:{type:"cross"}},legend:{data:e==null?void 0:e.map(t=>t==null?void 0:t.name),itemGap:10,top:"10%",type:"scroll",padding:[5,50],textStyle:{width:100,overflow:"truncate",ellipsis:"..."}}};return d.jsx(w,{xs:12,style:{height:"100%"},children:d.jsx(b,{option:i(),style:{height:"100%",width:"100%"},onChartReady:f})})};export{E as A}; diff --git a/build/assets/AdvancedTable-BYmmBtmq.js b/build/assets/AdvancedTable-BYmmBtmq.js new file mode 100644 index 0000000..046a142 --- /dev/null +++ b/build/assets/AdvancedTable-BYmmBtmq.js @@ -0,0 +1 @@ +import{j as a,T as c,p as e}from"./mui-vendor-CkIVaoQP.js";import{M as F}from"./index-CIfb_iLp.js";import{r}from"./react-vendor-CmFgShSM.js";const f=({columns:p,data:u,name:n,pagination:l})=>{const[i,C]=r.useState(u);r.useEffect(()=>{C(u)},[u]),r.useEffect(()=>{const s=u==null?void 0:u.map((t,x)=>t==null?void 0:t.map((o,d)=>!o&&o!==0?"":o));C(s)},[u]);const A={viewColumns:!1,filter:!0,print:!1,download:!1,selectableRowsHeader:!1,selectableRowsHideCheckboxes:!0,responsive:"vertical",pagination:l||!0,fixedHeader:!0,tableBodyMaxHeight:"70vh",textLabels:{body:{noMatch:"داده ای جهت نمایش موجود نیست!",toolTip:"مرتب سازی",columnHeaderTooltip:s=>`مرتب سازی بر اساس ${s.label}`},pagination:{next:"صفحه بعد",previous:"صفحه قبل",rowsPerPage:"تعداد سطر در هر صفحه:",displayRows:"تعداد کل نتایج: "},toolbar:{search:"جستجو",downloadCsv:"دانلود CSV",print:"پرینت",viewColumns:"نمایش سطون ها",filterTable:"فیلتر جدول"},filter:{all:"همه",title:"فیلترها",reset:"پاکسازی"},viewColumns:{title:"نمایش ستون ها",titleAria:"نمایش/بستن ستون های جدول"},selectedRows:{text:"سطر انتخاب شده است",delete:"پاک کردن",deleteAria:"پاک کردن سطرهای انتخاب شده"}}};return a.jsx(F,{title:a.jsx(c,{textAlign:"start",children:n}),data:i,columns:p,options:A})};f.propTypes={columns:e.PropTypes.any,data:e.PropTypes.any,name:e.PropTypes.any,expandable:e.PropTypes.bool};export{f as A}; diff --git a/build/assets/ArrowDownward-DdOsPC7b.js b/build/assets/ArrowDownward-DdOsPC7b.js new file mode 100644 index 0000000..0dcf374 --- /dev/null +++ b/build/assets/ArrowDownward-DdOsPC7b.js @@ -0,0 +1 @@ +import{i as e,j as a}from"./mui-vendor-CkIVaoQP.js";import{r as t}from"./index-CeyyVc1v.js";var r={},o=e;Object.defineProperty(r,"__esModule",{value:!0});var u=r.default=void 0,i=o(t()),d=a;u=r.default=(0,i.default)((0,d.jsx)("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z"}),"ArrowDownward");export{u as d}; diff --git a/build/assets/Article-DcCZ1D5y.js b/build/assets/Article-DcCZ1D5y.js new file mode 100644 index 0000000..cada60e --- /dev/null +++ b/build/assets/Article-DcCZ1D5y.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},i=r;Object.defineProperty(e,"__esModule",{value:!0});var o=e.default=void 0,u=i(a()),v=t;o=e.default=(0,u.default)((0,v.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-5 14H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"}),"Article");export{o as d}; diff --git a/build/assets/Auction-CSwFRyO3.js b/build/assets/Auction-CSwFRyO3.js new file mode 100644 index 0000000..b6598b4 --- /dev/null +++ b/build/assets/Auction-CSwFRyO3.js @@ -0,0 +1 @@ +import{j as u,B,ag as O,ah as gu,ai as J,aj as Z,T as v,av as eu,aw as ru,ax as N,aX as Fu,aq as vu,bj as bu,aU as Eu,cp as H,p as k,i as Su,am as Lu,ak as z,aa as Iu,al as m,cn as Tu,aI as Du}from"./mui-vendor-CkIVaoQP.js";import{iB as su,_ as Mu,G as t,g6 as Bu,S as l,Q as nu,iC as U,N as R,L as _,a0 as Pu,h as W,u as tu,c as ou,b as lu,iD as au,iE as cu,iF as iu,iG as Cu,iH as du,r as Ru,j as wu,A as Nu,iI as K,v as Y,X as V,iJ as Au,iK as pu,$ as ku}from"./index-CeyyVc1v.js";import{r as h,u as qu}from"./react-vendor-CmFgShSM.js";import{u as G,f as P,a as Wu}from"./redux-vendor-B7uoacJt.js";import{A as yu}from"./AdvancedTable-BYmmBtmq.js";import{T as hu}from"./Timer-DHCbB9tg.js";import{c as Gu,a as _u}from"./city-get-city-qTSRxslT.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const Hu=()=>{const[e,y]=h.useState([]),p=G(),n=qu(),{auctionSlaughterRequestsData:a}=P(r=>r.auctionSlice);return h.useEffect(()=>{p(su())},[]),h.useEffect(()=>{if(!a||!Array.isArray(a)){y([]);return}y(a.map(r=>{var A,j,g,L,E,S,c,s,d,T,i,f,M,C,o,b,D,I,F,q,w,X;const x=(r==null?void 0:r.state)==="accepted"?"برنده شده اید!":(r==null?void 0:r.state)==="pending"?"در حال انجام مزایده":"درخواست شما پذیرفته نشد.";return[((A=r==null?void 0:r.poultryRequest)==null?void 0:A.id)||"",((j=r==null?void 0:r.poultryRequest)==null?void 0:j.orderCode)||"",((r==null?void 0:r.fee)||0)+" ﷼",(((g=r==null?void 0:r.poultryRequest)==null?void 0:g.quantity)||0)+" قطعه",((E=(L=r==null?void 0:r.poultryRequest)==null?void 0:L.hatching)==null?void 0:E.date)||"",(((S=r==null?void 0:r.poultryRequest)==null?void 0:S.chickenBreed)||"")+((c=r==null?void 0:r.poultryRequest)!=null&&c.chickenBreed&&((T=(d=(s=r==null?void 0:r.poultryRequest)==null?void 0:s.process)==null?void 0:d.poultry)!=null&&T.age)?" - ":"")+(((M=(f=(i=r==null?void 0:r.poultryRequest)==null?void 0:i.process)==null?void 0:f.poultry)==null?void 0:M.age)||""),(((C=r==null?void 0:r.poultryRequest)==null?void 0:C.IndexWeight)||0)+" کیلوگرم",((I=(D=(b=(o=r==null?void 0:r.poultryRequest)==null?void 0:o.poultry)==null?void 0:b.address)==null?void 0:D.province)==null?void 0:I.name)||"",((X=(w=(q=(F=r==null?void 0:r.poultryRequest)==null?void 0:F.poultry)==null?void 0:q.address)==null?void 0:w.city)==null?void 0:X.name)||"",r!=null&&r.date?Mu(r.date):"",x==="برنده شده اید!"?u.jsxs(t,{container:!0,alignItems:"center",justifyContent:"center",children:[x,u.jsx(B,{onClick:()=>{var $;n(Bu+((($=r==null?void 0:r.poultryRequest)==null?void 0:$.id)||""))},children:"ادامه خرید"})]}):x]}))},[a]),u.jsx(u.Fragment,{children:a&&Array.isArray(a)&&a.length>0&&u.jsx(t,{container:!0,gap:l.SMALL,p:l.SMALL,width:"100%",children:u.jsx(yu,{name:"مزایده های شما",columns:["شماره مزایده","کدسفارش","قیمت پیشنهادی شما","تعداد","تاریخ جوجه ریزی","نژاد و سن به روز","وزن","استان","شهرستان","تاریخ ثبت پیشنهاد","وضعیت"],data:e})})})},Yu=()=>{const e=G(),y=48,p=8,{auctions:n}=P(c=>c.auctionSlice||{}),[a,r]=h.useState([]),[x,A]=h.useState([]),[j,g]=h.useState("all"),L=c=>{g(c.target.value)},E=c=>{const{target:{value:s}}=c;r(typeof s=="string"?s.split(","):s)},S={PaperProps:{style:{maxHeight:y*4.5+p,width:250}}};return h.useEffect(()=>{if(n&&Array.isArray(n)){const c=n.filter(s=>s==null?void 0:s.sendDate).map(s=>{try{return nu(new Date(s.sendDate),"yyyy/MM/dd")}catch(d){return console.error("Error formatting date:",d),null}}).filter(s=>s!==null);A(c)}else A([])},[n]),u.jsx(t,{container:!0,p:l.MEDIUM,gap:l.SMALL,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:u.jsxs(t,{container:!0,direction:"column",gap:l.SMALL,children:[u.jsx(t,{children:u.jsx(O,{children:u.jsxs(gu,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:j,onChange:L,children:[u.jsx(J,{value:"all",control:u.jsx(Z,{}),label:"بدون فیلتر"}),u.jsx(J,{value:"filter",control:u.jsx(Z,{}),label:"انتخاب تاریخ"})]})})}),j==="filter"&&u.jsxs(u.Fragment,{children:[u.jsx(t,{children:u.jsx(v,{variant:"body2",children:"تاریخ هایی که مایل به رویت مناقصات آنها هستید را انتخاب کنید."})}),u.jsx(t,{children:u.jsxs(O,{sx:{width:"100%"},children:[u.jsx(eu,{id:"demo-multiple-checkbox-label",children:"تاریخ های انتخاب شده"}),u.jsx(ru,{multiple:!0,labelId:"demo-multiple-checkbox-label",id:"demo-multiple-checkbox",value:a,onChange:E,input:u.jsx(bu,{label:"تاریخ های انتخاب شده"}),renderValue:c=>Array.isArray(c)?c.join(", "):"",MenuProps:S,children:x.map((c,s)=>u.jsxs(N,{value:c||"",children:[u.jsx(Fu,{checked:Array.isArray(a)&&a.indexOf(c)>-1}),u.jsx(vu,{primary:c||""})]},(c||"")+s))})]})})]}),u.jsx(t,{children:u.jsx(B,{fullWidth:!0,variant:"contained",onClick:()=>{e(j==="all"?U(null):U(Array.isArray(a)?a:[])),e(R({right:!1,bottom:!1,content:null}))},children:"ثبت اطلاعات"})})]})})},fu=({minQuantity:e=0,maxQuantity:y=1e3})=>{const p=G(),{avicultureChickenPrice:n}=P(i=>i.avicultureSlice);h.useEffect(()=>{p(_()),p(Pu()),p(W())},[]);const a=tu({initialValues:{age:"",race:"همه"},validationSchema:ou({age:lu().typeError("لطفا سن مرغ را وارد کنید.")})}),[r,x]=h.useState([e||0,y||1e3]),[A,j]=h.useState([1,5]),[g,L]=h.useState([30,70]),[E,S]=h.useState([(n==null?void 0:n.floorPrice)||0,(n==null?void 0:n.ceilingPrice)||1e5]);h.useEffect(()=>{n!=null&&n.floorPrice&&(n!=null&&n.ceilingPrice)&&S([n.floorPrice,n.ceilingPrice])},[n]);const c=(i,f)=>{x(f)},s=(i,f)=>{j(f)},d=(i,f)=>{L(f)},T=(i,f)=>{S(f)};return u.jsxs(t,{container:!0,p:l.MEDIUM,direction:"column",flex:"1",justifyContent:"space-between",gap:l.SMALL,children:[u.jsxs(t,{container:!0,direction:"column",gap:l.SMALL,children:[u.jsx(t,{children:u.jsxs(O,{fullWidth:!0,children:[u.jsx(eu,{id:"demo-simple-select-label",children:"نژاد مرغ"}),u.jsxs(ru,{labelId:"demo-simple-select-label",id:"race",label:"نژاد مرغ",value:a.values.race,error:a.touched.race?!!a.errors.race:null,onChange:i=>{a.setFieldValue("race",i.target.value)},onBlur:a.handleBlur,children:[u.jsx(N,{value:"همه",children:"همه"}),u.jsx(N,{value:"آرین",children:"آرین"}),u.jsx(N,{value:"راس",children:"راس"}),u.jsx(N,{value:"آربراکرز (آپلاس)",children:"آربراکرز (آپلاس)"}),u.jsx(N,{value:"کاب",children:"کاب"}),u.jsx(N,{value:"هوبارد",children:"هوبارد"})]}),u.jsx(Eu,{children:a.touched.race&&a.errors.race?a.errors.race:null})]})}),r&&Array.isArray(r)&&r[0]!==void 0&&r[0]!==1/0&&e!==void 0&&y!==void 0?u.jsxs(t,{display:"flex",gap:l.SMALL,children:["تعداد:",u.jsx(H,{size:"small",getAriaLabel:()=>"تعداد",value:r,min:e||0,max:y||1e3,step:100,onChange:c,valueLabelDisplay:"auto"})]}):"",u.jsxs(t,{display:"flex",gap:l.SMALL,children:["سن:",u.jsx(H,{size:"small",value:g,min:30,max:70,onChange:d,valueLabelDisplay:"auto"})]}),u.jsxs(t,{display:"flex",gap:l.SMALL,children:["وزن:",u.jsx(H,{size:"small",getAriaLabel:()=>"Temperature range",value:A,min:1,max:5,onChange:s,valueLabelDisplay:"auto"})]}),u.jsxs(t,{display:"flex",gap:l.SMALL,children:["قیمت:",u.jsx(H,{size:"small",getAriaLabel:()=>"سقف و کف قیمت امروز",value:E,step:5e3,min:(n==null?void 0:n.floorPrice)||0,max:(n==null?void 0:n.ceilingPrice)||1e5,onChange:T,valueLabelDisplay:"auto"})]})]}),u.jsx(t,{children:u.jsx(B,{fullWidth:!0,variant:"contained",onClick:()=>{p(au(r)),p(cu(g)),p(iu(a.values.race==="همه"?"":a.values.race)),p(Cu(A)),p(du(E)),p(R({right:!1,bottom:!1,content:null}))},children:"ثبت اطلاعات"})})]})};fu.propTypes={minQuantity:k.PropTypes.number,maxQuantity:k.PropTypes.number};var Q={},Ou=Su;Object.defineProperty(Q,"__esModule",{value:!0});var xu=Q.default=void 0,zu=Ou(Ru()),Uu=u;xu=Q.default=(0,zu.default)((0,Uu.jsx)("path",{d:"m5.2494 8.0688 2.83-2.8269 14.1343 14.15-2.83 2.8269zm4.2363-4.2415 2.828-2.8289 5.6577 5.656-2.828 2.8289zM.9989 12.3147l2.8284-2.8285 5.6569 5.6569-2.8285 2.8284zM1 21h12v2H1z"}),"Gavel");const Ku=Wu("AuctionOfferPrice",async e=>{const{data:y,status:p}=await wu.post("kill_house_Request_auction/",e);return{data:y,status:p}}),ju=({data:e,floorPrice:y,ceilingPrice:p,highestBidedPrice:n,auctionRemainedSeconds:a})=>{var j,g,L,E,S,c,s,d,T,i,f,M;const r=G(),[x]=h.useContext(Nu),A=tu({initialValues:{offer:""},validationSchema:ou({offer:lu().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!")})});return u.jsx(t,{container:!0,gap:l.TINY,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:u.jsxs(t,{container:!0,direction:"column",gap:l.TINY,children:[u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:C=>C.palette.grey.A700,children:"مانده تا پایان مناقصه :"}),u.jsx(hu,{seconds:a},"auctiontimer")]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:C=>C.palette.grey.A700,children:"استان :"}),u.jsx(v,{variant:"body2",children:((L=(g=(j=e==null?void 0:e.poultry)==null?void 0:j.address)==null?void 0:g.province)==null?void 0:L.name)||""})]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:C=>C.palette.grey.A700,children:"شهر :"}),u.jsx(v,{variant:"body2",children:((c=(S=(E=e==null?void 0:e.poultry)==null?void 0:E.address)==null?void 0:S.city)==null?void 0:c.name)||""})]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:C=>C.palette.grey.A700,children:"مرغدار :"}),u.jsx(v,{variant:"body2",children:((d=(s=e==null?void 0:e.poultry)==null?void 0:s.userprofile)==null?void 0:d.fullName)||""})]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:C=>C.palette.grey.A700,children:"محل پرورش :"}),u.jsx(v,{variant:"body2",children:((i=(T=e==null?void 0:e.poultry)==null?void 0:T.address)==null?void 0:i.address)||""})]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:C=>C.palette.grey.A700,children:"نژاد :"}),u.jsx(v,{variant:"body2",children:(e==null?void 0:e.chickenBreed)||""})]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:C=>C.palette.grey.A700,children:"تعداد :"}),u.jsx(v,{variant:"body2",mr:l.TINY,children:(e==null?void 0:e.quantity)||0}),"قطعه"]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:C=>C.palette.grey.A700,children:"سن :"}),u.jsxs(v,{variant:"body2",children:[((M=(f=e==null?void 0:e.process)==null?void 0:f.poultry)==null?void 0:M.age)||0," روز"]})]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:l.TINY,color:C=>C.palette.grey.A700,children:"وزن :"}),u.jsxs(v,{variant:"body2",children:[(e==null?void 0:e.IndexWeight)||0," کیلوگرم"]})]}),u.jsx(Lu,{}),u.jsxs(t,{container:!0,gap:l.SMALL,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:[u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body1",mr:l.TINY,color:C=>C.palette.grey.A700,children:"قیمت پایه :"}),u.jsx(v,{mr:l.TINY,fontWeight:"bold",children:y||0}),"ریال"]}),u.jsxs(t,{display:"flex",children:[u.jsx(v,{variant:"body1",mr:l.TINY,color:C=>C.palette.grey.A700,children:"بالاترین قیمت پیشنهادی :"}),u.jsx(v,{mr:l.TINY,fontWeight:"bold",children:n||"پیشنهادی وجود ندارد!"}),n==="پیشنهادی وجود ندارد!"||!n?"":"ریال"]})]}),u.jsx(t,{mt:l.SMALL,children:u.jsx(z,{id:"offer",label:"قیمت پیشنهادی",InputProps:{endAdornment:u.jsx(Iu,{position:"end",children:"ریال"})},variant:"outlined",sx:{width:"100%"},value:A.values.offer,error:A.touched.offer?!!A.errors.offer:null,onChange:A.handleChange,onBlur:A.handleBlur,helperText:A.touched.offer&&A.errors.offer?A.errors.offer:null})}),u.jsx(t,{mt:l.SMALL,children:u.jsx(B,{disabled:!A.isValid,fullWidth:!0,variant:"contained",onClick:()=>{r(_());const C=Number(A.values.offer)||0,o=Number(y)||0,b=Number(p)||0,D=n==="پیشنهادی وجود ندارد!"||!n?0:Number(n)||0;(n==="پیشنهادی وجود ندارد!"||!n||C-D>=1e3&&C>o&&C<=b)&&(e!=null&&e.key)?r(Ku({key:e.key,fee:C})).then(I=>{I!=null&&I.error?x({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(r(K()),r(su()),r(R({right:!1,bottom:!1,content:null})),x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}).catch(I=>{console.error("Error submitting offer:",I),x({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"})}).finally(()=>{r(W())}):(x({vertical:"top",horizontal:"center",msg:"قیمت پیشنهادی باید از بیشترین قیمت پیشنهاد شده بیشتر باشد و از حداکثر قیمت روز کمتر باشد.",severity:"error"}),r(W()))},children:"ثبت اطلاعات"})})]})})};ju.propTypes={data:k.PropTypes.any,floorPrice:k.PropTypes.string,ceilingPrice:k.PropTypes.string,highestBidedPrice:k.PropTypes.string,auctionRemainedSeconds:k.PropTypes.string};function uu(e,y,p){var j,g,L,E,S,c,s,d,T,i,f,M,C;const n=Y(new Date((g=(j=e==null?void 0:e.process)==null?void 0:j.auctionsList[0])==null?void 0:g.date)),a=Y(),r=n.diff(a),x=Y.duration(r).asSeconds(),A=(L=e.process)!=null&&L.killHouseAuctionsList?(S=e==null?void 0:e.process)==null?void 0:S.killHouseAuctionsList[((E=e==null?void 0:e.process)==null?void 0:E.killHouseAuctionsList.length)-1].fee:"پیشنهادی وجود ندارد!";return[e.id,e.orderCode,(s=(c=e==null?void 0:e.process)==null?void 0:c.auctionsList[0])==null?void 0:s.floorPrice,(T=(d=e==null?void 0:e.process)==null?void 0:d.auctionsList[0])==null?void 0:T.ceilingPrice,A,e.quantity,e.sendDate,e.chickenBreed+" - "+((f=(i=e==null?void 0:e.process)==null?void 0:i.poultry)==null?void 0:f.age),e.IndexWeight,(M=e==null?void 0:e.process)==null?void 0:M.city.cityOperatorProvince,(C=e==null?void 0:e.process)==null?void 0:C.city.cityOperatorCity,u.jsx(hu,{seconds:x},"auctiontimer"+y),V()==="KillHouse"&&u.jsx(B,{variant:"outlined",startIcon:u.jsx(xu,{}),onClick:()=>{var o,b,D,I;p(R({right:!0,size:500,title:"ثبت قیمت در مزایده",content:u.jsx(ju,{data:e,floorPrice:(b=(o=e==null?void 0:e.process)==null?void 0:o.auctionsList[0])==null?void 0:b.floorPrice,ceilingPrice:(I=(D=e==null?void 0:e.process)==null?void 0:D.auctionsList[0])==null?void 0:I.ceilingPrice,highestBidedPrice:A,auctionRemainedSeconds:x})}))},children:"ثبت قیمت"},"auctionbidsumbmit"+y)]}const Vu=()=>{const[e,y]=h.useState(),[p,n]=h.useState(),[a,r]=h.useState(),[x,A]=h.useState(),[j,g]=h.useState(),[,L]=h.useState(),[E,S]=h.useState(!0),c=G();return h.useEffect(()=>{var s;c(_()),(s=c(Gu()))==null||s.then(d=>{var T;(T=d==null?void 0:d.payload)!=null&&T.data&&y(d.payload.data)}).catch(d=>{console.error("Error fetching provinces:",d)}).finally(()=>{c(W())})},[]),h.useEffect(()=>{a?(c(_()),c(_u(a)).then(s=>{var d;(d=s==null?void 0:s.payload)!=null&&d.data&&(n(s.payload.data),S(!1))}).catch(s=>{console.error("Error fetching cities:",s)}).finally(()=>{c(W())})):(n([]),S(!0))},[a]),u.jsxs(t,{container:!0,p:l.MEDIUM,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",gap:l.SMALL,children:[u.jsxs(t,{container:!0,direction:"column",gap:l.SMALL,children:[u.jsx(t,{children:u.jsx(m,{disablePortal:!0,id:"province",options:e&&Array.isArray(e)?e.filter(s=>(s==null?void 0:s.key)&&(s==null?void 0:s.name)).map(s=>({id:s.key,label:s.name})):[],onChange:(s,d)=>{d?(r(d.id),A(d.label)):(r(void 0),A(void 0))},renderInput:s=>u.jsx(z,{...s,label:"استان را انتخاب کنید"})})}),u.jsx(t,{children:u.jsx(m,{disabled:E,disablePortal:!0,id:"city",options:p&&Array.isArray(p)?p.filter(s=>(s==null?void 0:s.key)&&(s==null?void 0:s.name)).map(s=>({id:s.key,label:s.name})):[],onChange:(s,d)=>{d?(L(d.id),g(d.label)):(L(void 0),g(void 0))},renderInput:s=>u.jsx(z,{...s,label:"شهر را انتخاب کنید"})})})]}),u.jsx(t,{children:u.jsx(B,{fullWidth:!0,variant:"contained",onClick:()=>{c(Au(j)),c(pu(x)),c(R({right:!1,bottom:!1,content:null}))},children:"ثبت اطلاعات"})})]})},Qu=()=>{const e=G(),{auctions:y}=P(i=>i.auctionSlice||{}),{filterByDate:p}=P(i=>i.auctionSlice||{}),{filterByCity:n}=P(i=>i.auctionSlice||{}),{filterByProvince:a}=P(i=>i.auctionSlice||{}),{filterByQuantity:r,filterByAge:x,filterByRace:A,filterByWeight:j,filterByPrice:g}=P(i=>i.auctionSlice||{}),[L,E]=h.useState([]),[S,c]=h.useState(0),[s,d]=h.useState(0);h.useEffect(()=>{e(K())},[p,n,r,g,j,x,A]),h.useEffect(()=>{if(y&&Array.isArray(y)&&y.length>0){const i=y.map(f=>f==null?void 0:f.quantity).filter(f=>f!=null);i.length>0&&(c(Math.min(...i)),d(Math.max(...i)))}},[y]),h.useEffect(()=>{if(y&&Array.isArray(y)){let i=[];const f=o=>{if(!p||!Array.isArray(p))return!0;if(!(o!=null&&o.sendDate))return!1;try{const b=nu(new Date(o.sendDate),"yyyy/MM/dd");return p.includes(b)}catch(b){return console.error("Error formatting date:",b),!1}},M=o=>{var b,D,I,F;if(n||a){if(n)return((D=(b=o==null?void 0:o.process)==null?void 0:b.city)==null?void 0:D.cityOperatorCity)===n;if(a)return((F=(I=o==null?void 0:o.process)==null?void 0:I.city)==null?void 0:F.cityOperatorProvince)===a}return!0},C=o=>{var b,D,I;if(A)return(o==null?void 0:o.chickenBreed)===A;if(r&&Array.isArray(r)){const F=o==null?void 0:o.quantity;return F==null?!1:F>=(r[0]||0)&&F<=(r[1]||1/0)}if(g&&Array.isArray(g)){if((b=o==null?void 0:o.process)!=null&&b.killHouseAuctionsList){const F=o.process.killHouseAuctionsList;if(Array.isArray(F)&&F.length>0){const q=F[F.length-1],w=q==null?void 0:q.fee;return w==null?!1:w>=(g[0]||0)&&w<=(g[1]||1/0)}}return!1}if(j&&Array.isArray(j)){const F=o==null?void 0:o.IndexWeight;return F==null?!1:F>=(j[0]||0)&&F<=(j[1]||1/0)}if(x!=null){const F=(I=(D=o==null?void 0:o.process)==null?void 0:D.poultry)==null?void 0:I.age;return F==null?!1:F<=x}return!0};p||n||a||r||g||j||x!==void 0||A?i=y.filter(f).filter(M).filter(C).map((o,b)=>uu(o,b,e)):i=y.map((o,b)=>uu(o,b,e)),E(i)}else E([])},[y,p,n,a,r,g,j,x,A,e]);const T=V()==="KillHouse"?["شماره مزایده","کدسفارش","قیمت کف","قیمت سقف","بالاترین قیمت پیشنهادی","تعداد","تاریخ درخواست کشتار","نژاد و سن به روز","وزن","استان","شهرستان","زمان تا پایان","عملیات"]:["شماره مزایده","کدسفارش","قیمت کف","قیمت سقف","بالاترین قیمت پیشنهادی","تعداد","تاریخ درخواست کشتار","نژاد و سن به روز","وزن","استان","شهرستان","زمان تا پایان"];return u.jsxs(t,{container:!0,gap:l.SMALL,p:l.SMALL,width:"100%",children:[u.jsxs(t,{container:!0,alignItems:"center",gap:l.SMALL,children:[u.jsx(t,{children:u.jsx(v,{color:i=>i.palette.grey.A700,children:"فیلتر کردن مزایده ها"})}),u.jsx(t,{children:u.jsxs(Tu,{variant:"text","aria-label":"outlined button group",children:[u.jsx(B,{onClick:()=>{e(R({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Yu,{}),title:" فیلتر تاریخ"}))},children:"فیلتر تاریخ"}),u.jsx(B,{onClick:()=>{e(R({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:" فیلتر بر اساس شهر و استان",content:u.jsx(Vu,{})}))},children:"فیلتر استان و شهرستان"}),u.jsx(B,{onClick:()=>{e(R({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"فیلتر پیشرفته",content:u.jsx(fu,{maxQuantity:s,minQuantity:S})}))},children:"فیلتر پیشرفته"}),u.jsx(B,{onClick:()=>{e(_()),e(U("")),e(Au("")),e(pu("")),e(au("")),e(cu("")),e(iu("")),e(Cu("")),e(du("")),e(K()),e(W())},children:"حذف همه فیلترها"})]})})]}),u.jsx(yu,{name:"مزایده های در حال انجام",columns:T,data:L})]})},o0=()=>{const[e]=ku();return u.jsx(Du,{display:"flex",justifyContent:"center",children:u.jsxs(t,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsx(t,{container:!0,justifyContent:"space-between",gap:l.SMALL,children:u.jsx(Qu,{})}),V()==="KillHouse"&&e.includes("KillHouse")&&u.jsx(t,{justifyContent:"center",my:l.MEDIUM,children:u.jsx(Hu,{})})]})})};export{o0 as default}; diff --git a/build/assets/Auth-CFWkZDlN.js b/build/assets/Auth-CFWkZDlN.js new file mode 100644 index 0000000..9f40c3e --- /dev/null +++ b/build/assets/Auth-CFWkZDlN.js @@ -0,0 +1 @@ +import{i as su,j as u,a3 as d,T as r,aF as iu,am as U,aG as ou,aH as nu,aI as y,ak as _,aa as au,I as lu,B as H}from"./mui-vendor-CkIVaoQP.js";import{r as du,A as cu,u as Au,c as xu,a as pu,b as Fu,d as hu,e as mu,G as t,S as F,m as f,l as yu,L as N,f as K,g as X,h as $,O as Q,i as fu,s as gu,C as bu}from"./index-CeyyVc1v.js";import{C as ju}from"./Captcha-CBxUIUNI.js";import{u as vu}from"./redux-vendor-B7uoacJt.js";import{r as l}from"./react-vendor-CmFgShSM.js";import{d as wu}from"./Visibility-DeyjG-oI.js";import{g as Eu}from"./get-announcement-5NHhejXl.js";var g={},Su=su;Object.defineProperty(g,"__esModule",{value:!0});var J=g.default=void 0,Du=Su(du()),Iu=u;J=g.default=(0,Du.default)((0,Iu.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff");const ku="/assets/login-rasadyar-DKN6yNCU.png",Pu="/assets/login-logo-DUVGAcPT.png",zu=()=>u.jsx(d,{sx:{height:"400px",overflow:"auto",p:3,borderRadius:2,"&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"primary.main",borderRadius:"4px"},"&::-webkit-scrollbar-track":{backgroundColor:"grey.100"}},children:u.jsxs(d,{container:!0,spacing:3,children:[u.jsxs(d,{item:!0,xs:12,children:[u.jsxs(r,{variant:"h5",color:"primary",sx:{display:"flex",alignItems:"center",gap:1},children:[u.jsx(iu,{fontSize:"medium"}),"بيانيه حريم خصوصی"]}),u.jsx(r,{variant:"body1",sx:{mt:2,color:"text.secondary"},children:"اطلاعات مربوط به هر شخص، حریم خصوصی وی محسوب می‌شود. حفاظت و حراست از اطلاعات شخصی در سامانه رصد یار، نه تنها موجب حفظ امنیت کاربران می‌شود، بلکه باعث اعتماد بیشتر و مشارکت آنها در فعالیت‌های جاری می‌گردد. هدف از این بیانیه، آگاه ساختن شما درباره ی نوع و نحوه ی استفاده از اطلاعاتی است که در هنگام استفاده از سامانه رصد یار ، از جانب شما دریافت می‌گردد. شرکت هوشمند سازان خود را ملزم به رعایت حریم خصوصی همه شهروندان و کاربران سامانه دانسته و آن دسته از اطلاعات کاربران را که فقط به منظور ارائه خدمات کفایت می‌کند، دریافت کرده و از انتشار آن یا در اختیار قرار دادن آن به دیگران خودداری مینماید."})]}),u.jsx(d,{item:!0,xs:12,children:u.jsx(U,{sx:{my:2}})}),u.jsxs(d,{item:!0,xs:12,children:[u.jsxs(r,{variant:"h6",color:"primary",sx:{display:"flex",alignItems:"center",gap:1},children:[u.jsx(ou,{fontSize:"medium"}),"چگونگی جمع آوری و استفاده از اطلاعات کاربران:"]}),u.jsxs(r,{variant:"body1",sx:{mt:2,color:"text.secondary"},children:[u.jsx("strong",{children:"الف:"})," اطلاعاتی که شما خود در اختيار این سامانه قرار می‌دهيد، شامل موارد زيرهستند:"]}),u.jsx(r,{variant:"body1",sx:{pl:2,color:"text.secondary"},children:"اقلام اطلاعاتی شامل شماره تلفن همراه، تاریخ تولد، کد پستی و کد ملی کاربران را دریافت مینماییم که از این اقلام، صرفا جهت احراز هویت کاربران استفاده خواهد شد."}),u.jsxs(r,{variant:"body1",sx:{mt:2,color:"text.secondary"},children:[u.jsx("strong",{children:"ب:"})," برخی اطلاعات ديگر که به صورت خودکار از شما دريافت میشود شامل موارد زير می‌باشد:"]}),u.jsxs(r,{variant:"body1",sx:{pl:2,color:"text.secondary"},children:["⦁ دستگاهی که از طریق آن سامانه رصد یار را مشاهده می‌نمایید( تلفن همراه، تبلت، رایانه). ",u.jsx("br",{}),"⦁ نام و نسخه سیستم عامل و browser کامپیوتر شما. ",u.jsx("br",{}),"⦁ اطلاعات صفحات بازدید شده. ",u.jsx("br",{}),"⦁ تعداد بازدیدهای روزانه در درگاه. ",u.jsx("br",{}),"⦁ هدف ما از دریافت این اطلاعات استفاده از آنها در تحلیل عملکرد کاربران درگاه می باشد تا بتوانیم در خدمت رسانی بهتر عمل کنیم."]})]}),u.jsx(d,{item:!0,xs:12,children:u.jsx(U,{sx:{my:2}})}),u.jsxs(d,{item:!0,xs:12,children:[u.jsxs(r,{variant:"h6",color:"primary",sx:{display:"flex",alignItems:"center",gap:1},children:[u.jsx(nu,{fontSize:"medium"}),"امنیت اطلاعات"]}),u.jsx(r,{variant:"body1",sx:{mt:2,color:"text.secondary"},children:"متعهدیم که امنیت اطلاعات شما را تضمین نماییم و برای جلوگیری از هر نوع دسترسی غیرمجاز و افشای اطلاعات شما از همه شیوه‌‌های لازم استفاده می‌کنیم تا امنیت اطلاعاتی را که به صورت آنلاین گردآوری می‌کنیم، حفظ شود. لازم به ذکر است در سامانه ما، ممکن است به سایت های دیگری لینک شوید، وقتی که شما از طریق این لینک‌ها از سامانه ما خارج می‌شوید، توجه داشته باشید که ما بر دیگر سایت ها کنترل نداریم و سازمان تعهدی بر حفظ حریم شخصی آنان در سایت مقصد نخواهد داشت و مراجعه کنندگان میبایست به بیانیه حریم شخصی آن سایت ها مراجعه نمایند."})]})]})}),Ou={backgroundColor:"#ffffff",padding:"20px",borderRadius:"4px",outline:"none",minWidth:"300px",maxWidth:"600px",textAlign:"center"},Mu={marginBottom:"10px"},Vu={marginTop:"10px"},Tu={hidden:{opacity:0,scale:.9},visible:{opacity:1,scale:1,transition:{duration:.5}}},Bu={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{duration:.3}}},Hu=()=>{const[Y,b]=l.useState(0),[c]=l.useContext(cu),[j,Z]=l.useState(!1),C=vu(),[v,w]=l.useState(!1),[E,uu]=l.useState(!1),s=Au({initialValues:{mobile:"",captcha:"",password:""},validationSchema:xu({mobile:Fu().required("این فیلد اجباری است!").typeError("لطفا اعداد انگلیسی وارد کنید!").test("len","شماره تلفن باید 11 رقم باشد!",(i,e)=>e.originalValue&&e.originalValue.length===11),password:pu().required("این فیلد اجباری است!")})});l.useEffect(()=>{s.validateForm(),C(hu()).then(i=>{var n,a;const o=new Date().getHours();o>=20||o<5?b((n=i.payload.data)==null?void 0:n.numberOfActiveUsers):b(((a=i.payload.data)==null?void 0:a.numberOfActiveUsers)+320)})},[]),l.useEffect(()=>{s.values.mobile.length===11&&C(mu({mobile:s.values.mobile,state:""})).then(i=>{if(i.error)s.setFieldValue("mobile",""),c({vertical:"top",horizontal:"center",msg:"لطفا اتصال به اینترنت را چک کنید!",severity:"error"});else{const e=!!i.error;uu(!0),w(!e)}})},[s.values.mobile]);const eu=()=>{C(fu())},[m,tu]=l.useState(!1),ru=()=>{tu(!m)},Cu=i=>{i.preventDefault()},h=i=>{C(gu()),C(Eu(i)).then(e=>{var o,n;(o=e.payload.data)!=null&&o.active&&C(Q({title:"اطلاعیه سیستم",content:u.jsxs(t,{style:Ou,children:[u.jsx(r,{variant:"body1",color:"secondary",style:Mu,children:(n=e.payload.data)==null?void 0:n.description}),u.jsx(t,{container:!0,justifyContent:"center",children:u.jsx(t,{item:!0,xs:12,children:u.jsx(H,{color:"secondary",variant:"outlined",onClick:()=>C(bu()),style:Vu,children:"متوجه شدم"})})})]})}))})},S=i=>{i.preventDefault(),v?(C(N()),C(K({mobile:s.values.mobile,password:s.values.password})).then(e=>{var o,n,a,A,x,p;C(X()),(a=(n=(o=e.payload)==null?void 0:o.data)==null?void 0:n.role)!=null&&a.includes("KillHouse")?h("KillHouse"):(p=(x=(A=e.payload)==null?void 0:A.data)==null?void 0:x.role)!=null&&p.includes("CityOperator")&&h("CityOperator"),e.error&&c({vertical:"top",horizontal:"center",msg:"نام کاربری یا رمز اشتباه است!",severity:"error"}),C($())})):c({vertical:"top",horizontal:"center",msg:"شماره موبایل در سامانه وجود ندارد!",severity:"error"})};return u.jsx(y,{display:"flex",justifyContent:"center",sx:{height:"100vh",backgroundImage:`url(${ku})`,backgroundSize:"cover",backgroundPosition:"center"},children:u.jsx(t,{container:!0,justifyContent:"center",gap:F.SMALL,alignItems:"center",height:"100vh",xs:12,children:u.jsxs(f.div,{initial:"hidden",animate:"visible",variants:Tu,children:[u.jsx(f.div,{variants:Bu,style:{display:"flex",justifyContent:"center"},children:u.jsxs(t,{container:!0,justifyContent:"center",alignItems:"center",xs:12,sx:{maxWidth:"1200px"},children:[u.jsx(t,{container:!0,justifyContent:"center",alignItems:"center",p:6,xs:12,md:6,borderRadius:{xs:"15px",md:"15px 0px 0px 15px"},sx:{backgroundColor:"white",height:"650px",borderStyle:"solid",borderWidth:"1px",borderColor:"#8F8F8F"},children:u.jsxs(t,{container:!0,justifyContent:"center",my:2,children:[u.jsx(t,{container:!0,xs:12,justifyContent:"center",alignItems:"center",spacing:4,children:u.jsx("img",{src:yu,alt:"icon",style:{width:"130px",userSelect:"none"}})}),u.jsx(t,{container:!0,justifyContent:"center",xs:12,alignItems:"center",spacing:6,my:"20px",children:u.jsx(t,{container:!0,children:u.jsx(f.div,{animate:{opacity:[1,.7,1]},transition:{duration:5,repeat:1/0},children:u.jsx(r,{style:{fontSize:"18px",color:"#717171",fontWeight:"700"},children:"سامانه رصدیار"})})})}),u.jsx(t,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsxs("form",{onSubmit:S,children:[u.jsx(t,{children:u.jsx(_,{id:"mobile",label:"شماره تلفن",variant:"outlined",sx:{width:"100%"},value:s.values.mobile,onChange:s.handleChange,onBlur:s.handleBlur})}),u.jsx(t,{mt:"16px",children:u.jsx(_,{type:m?"text":"password",id:"password",label:"رمزعبور",variant:"outlined",onChange:s.handleChange,value:s.values.password,onBlur:s.handleBlur,onKeyDown:i=>{i.key==="Enter"&&j&&E&&(v?(C(N()),C(K({mobile:s.values.mobile,password:s.values.password})).then(e=>{var o,n,a,A,x,p,D,I,k,P,z,O,M,V,T,B,G,L,W,q,R;C(X()),((a=(n=(o=e.payload)==null?void 0:o.data)==null?void 0:n.role)!=null&&a.includes("CityOperator")||(p=(x=(A=e.payload)==null?void 0:A.data)==null?void 0:x.role)!=null&&p.includes("KillHouse")||(k=(I=(D=e.payload)==null?void 0:D.data)==null?void 0:I.role)!=null&&k.includes("CityJahad")||(O=(z=(P=e.payload)==null?void 0:P.data)==null?void 0:z.role)!=null&&O.includes("ProvinceSupervisor")||(T=(V=(M=e.payload)==null?void 0:M.data)==null?void 0:V.role)!=null&&T.includes("ProvinceOperator"))&&eu(),(L=(G=(B=e.payload)==null?void 0:B.data)==null?void 0:G.role)!=null&&L.includes("KillHouse")?h("KillHouse"):(R=(q=(W=e.payload)==null?void 0:W.data)==null?void 0:q.role)!=null&&R.includes("CityOperator")&&h("CityOperator"),e.error&&c({vertical:"top",horizontal:"center",msg:"رمزعبور اشتباه است!",severity:"error"}),C($())})):c({vertical:"top",horizontal:"center",msg:"شماره موبایل در سامانه وجود ندارد!",severity:"error"}))},fullWidth:!0,InputProps:{endAdornment:u.jsx(au,{position:"end",children:u.jsx(lu,{tabIndex:-1,"aria-label":"نمایش رمز عبور",onClick:ru,edge:"end",onMouseDown:Cu,children:m?u.jsx(J,{}):u.jsx(wu,{})})})}})}),u.jsx(t,{container:!0,justifyContent:"space-between",flexWrap:"nowrap",sx:{flexDirection:{xs:"column",sm:"row"}},gap:F.SMALL,mt:F.SMALL,children:u.jsx(ju,{onChange:i=>Z(i)})}),u.jsx(t,{container:!0,justifyContent:"space-between",gap:F.MEDIUM,direction:"row",mt:F.SMALL,children:u.jsx(t,{flexGrow:"2",children:u.jsx(H,{sx:{height:"48px"},variant:"contained",fullWidth:!0,type:"submit",disabled:!(j&&s.isValid)||!E,onSubmit:S,children:"ورود"})})})]})}),u.jsxs(r,{variant:"body2",mt:2,sx:{fontWeight:500,color:"#555"},children:["مطالعه بیانیه"," ",u.jsx(r,{component:"span",sx:{color:"#1976d2",fontWeight:600,cursor:"pointer",position:"relative",transition:"color 0.3s","&::after":{content:'""',position:"absolute",left:0,bottom:-2,width:"100%",height:"2px",backgroundColor:"#1976d2",transform:"scaleX(0)",transition:"transform 0.3s ease-in-out"},"&:hover":{color:"#125699"},"&:hover::after":{transform:"scaleX(1)"}},onClick:()=>C(Q({title:"حریم خصوصی",content:u.jsx(zu,{})})),children:"حریم خصوصی"})]})]})}),u.jsxs(t,{container:!0,justifyContent:"center",alignItems:"center",p:6,display:{xs:"none",md:"flex"},xs:6,sx:{backgroundImage:"linear-gradient(to bottom, #163A5C, #0D2538)",height:"650px",borderRadius:"0px 15px 15px 0px",borderStyle:"solid",borderWidth:"1px",borderColor:"#8F8F8F",flexDirection:"column",textAlign:"center"},children:[u.jsx(y,{component:"img",src:Pu,alt:"سامانه رصد یار",sx:{width:360}}),u.jsx(r,{variant:"body1",color:"white",fontWeight:"bold",sx:{fontSize:"16px"},children:"سامانه رصد و پایش زنجیره تامین، تولید و توزیع کالای اساسی"}),u.jsx(r,{variant:"body1",color:"white",mt:2,sx:{textAlign:"justify"},children:"از اینکه از سامانه برای بررسی و مدیریت کالاهای اساسی استفاده می‌کنید، بسیار خرسندیم. امیدواریم که تجربه‌ی شما با این سامانه، مفید و کارآمد باشد. در صورت نیاز به راهنمایی یا پرسش‌های بیشتر، تیم پشتیبانی ما همواره آماده‌ی پاسخگویی به شماست."}),u.jsxs(r,{variant:"body1",color:"white",fontWeight:"bold",mt:4,children:["با تشکر از همراهی شما",u.jsx("br",{}),"سامانه رصد یار"]}),u.jsx(r,{variant:"body2",color:"white",mt:1,children:"تلفن پشتیبانی : 28421237-021"})]}),u.jsx(t,{container:!0,justifyContent:"center",style:{backgroundColor:"transparent",borderRadius:"10px"},mt:2,xs:12,children:u.jsx("a",{referrerPolicy:"origin",target:"_blank",href:"https://trustseal.enamad.ir/?id=548910&Code=IOzppvkTQHlCeBeP2Gz5VsnXqqra2Gq7",children:u.jsx("img",{id:"IOzppvkTQHlCeBeP2Gz5VsnXqqra2Gq7",referrerPolicy:"origin",src:"https://Trustseal.eNamad.ir/logo.aspx?id=548910&Code=IOzppvkTQHlCeBeP2Gz5VsnXqqra2Gq7",alt:"icon",style:{width:"100px",userSelect:"none",borderStyle:"solid",borderWidth:"1px",borderColor:"#8F8F8F",borderRadius:"16px"}})})})]})}),u.jsx(t,{container:!0,xs:12,mt:2,sx:{justifyContent:"center"},children:u.jsx(y,{sx:{backgroundColor:"white",color:"white",padding:"8px 16px",borderRadius:"8px",display:"inline-flex",alignItems:"center",alignSelf:"center",zIndex:{xs:0,sm:10}},children:u.jsxs(r,{variant:"body1",sx:{fontSize:"16px",color:"#5B5B5B"},children:["کاربران آنلاین: ",Y," نفر"]})})})]})})})};export{Hu as default}; diff --git a/build/assets/AvicultureArchivedRequests-Bul1i4cq.js b/build/assets/AvicultureArchivedRequests-Bul1i4cq.js new file mode 100644 index 0000000..acef1f3 --- /dev/null +++ b/build/assets/AvicultureArchivedRequests-Bul1i4cq.js @@ -0,0 +1 @@ +import{j as l,I as T,aJ as q}from"./mui-vendor-CkIVaoQP.js";import{r as s,u as g}from"./react-vendor-CmFgShSM.js";import{A as G}from"./AdvancedTable-BYmmBtmq.js";import{d as L}from"./Plagiarism-BiXORbzo.js";import{u as _,f as w}from"./redux-vendor-B7uoacJt.js";import{L as B,a1 as J,h as O,p as S}from"./index-CeyyVc1v.js";const k=()=>{const a=_(),{avicultureRequests:o}=w(t=>t.avicultureSlice),[c,r]=s.useState(o);return s.useEffect(()=>{a(B()),a(J()).then(()=>{a(O())})},[]),s.useEffect(()=>{r(o)},[o]),c||[]},K=()=>{const a=g(),[o,c]=s.useState([]),r=k(),t=window.location.pathname.split("/")[1];s.useEffect(()=>{const I="/"+t+"/file/",p=r==null?void 0:r.filter((u,e)=>u.finalState==="archive"),N=p==null?void 0:p.map((u,e)=>{var n,A,d,f,C,y,E,v,F,h,x,D;return[e+1,u.orderCode,S(u==null?void 0:u.createDate),S(u==null?void 0:u.sendDate),(A=(n=u==null?void 0:u.process)==null?void 0:n.poultry)==null?void 0:A.poultryName,(f=(d=u==null?void 0:u.process)==null?void 0:d.poultry)==null?void 0:f.poultryMobile,(y=(C=u==null?void 0:u.process)==null?void 0:C.poultry)==null?void 0:y.poultryCity,(v=(E=u==null?void 0:u.process)==null?void 0:E.poultry)==null?void 0:v.poultryProvince,(h=(F=u==null?void 0:u.process)==null?void 0:F.poultry)==null?void 0:h.age,(D=(x=u==null?void 0:u.process)==null?void 0:x.poultry)==null?void 0:D.poultryQuantity,l.jsx(T,{"aria-label":"delete",color:"primary",onClick:()=>{var b,R;return a(I+((R=(b=u==null?void 0:u.process)==null?void 0:b.poultry)==null?void 0:R.poultryRequestId))},children:l.jsx(L,{})},u==null?void 0:u.orderCode)]});c(N)},[]);const[j]=s.useState(["ردیف","کد سفارش","تاریخ ثبت درخواست","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","استان","سن مرغ","تعداد","مشاهده"]);return l.jsx(q,{children:l.jsx(G,{expandable:!0,name:"درخواست های پایان یافته",columns:j,data:o})})};export{K as A,k as u}; diff --git a/build/assets/AvicultureHallInspects-JeacJRRj.js b/build/assets/AvicultureHallInspects-JeacJRRj.js new file mode 100644 index 0000000..55ef351 --- /dev/null +++ b/build/assets/AvicultureHallInspects-JeacJRRj.js @@ -0,0 +1 @@ +import{j as u,aI as d,I as h,T as n,cl as p,aO as m,aP as j,aQ as f,aR as C,aS as A}from"./mui-vendor-CkIVaoQP.js";import{u as g,j as o,r as y}from"./react-vendor-CmFgShSM.js";import{f as T,u as D}from"./redux-vendor-B7uoacJt.js";import{L as S,iA as I,h as E,G as e,S as i,p as b,q as F}from"./index-CeyyVc1v.js";import{d as G}from"./NavigateNext-ByUC5RGi.js";import{S as L}from"./SimpleTable-DBAoNnCU.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const J=()=>{const{avicultureHallInspects:t}=T(s=>s.avicultureSlice),r=D(),l=g(),{key:c}=o(),{hall:x}=o();return y.useEffect(()=>{r(S()),r(I(c+"&hall="+x)).then(()=>{r(E())})},[]),u.jsx(d,{display:"flex",justifyContent:"center",children:u.jsx(e,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsx(e,{container:!0,justifyContent:"space-between",gap:i.SMALL,children:u.jsx(e,{xs:12,children:u.jsxs(e,{mt:i.MEDIUM,children:[u.jsx(e,{container:!0,alignItems:"center",children:u.jsxs(h,{"aria-label":"delete",color:"primary",onClick:()=>l(-1),children:[u.jsx(G,{}),u.jsx(n,{children:"بازگشت"})]})}),u.jsxs(p,{sx:{gap:i.MEDIUM},children:[t==null?void 0:t.map(s=>u.jsxs(m,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(j,{children:[u.jsx(f,{}),u.jsx(C,{})]}),u.jsxs(e,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsx(e,{container:!0,children:u.jsx(e,{children:u.jsx(A,{children:u.jsxs(n,{variant:"body1",fontWeight:"bold",children:["بازرسی مورخ ",b(s.createDate)," ","ساعت ",F(s.createDate)]})})})}),u.jsx(e,{container:!0,xs:12,children:u.jsx(e,{xs:12,children:u.jsx(L,{columns:["موضوع بازرسی","توضیحات","تلفات","تصویر"],data:[[s.topic,s.description,s.Losses,s.image.length?s.image.map(a=>[u.jsx(e,{display:"inline-flex",children:u.jsx("a",{href:a,alt:"دانلود",children:u.jsx("img",{src:a,width:"80",height:"80",alt:"دانلود",style:{marginRight:"10px",borderRadius:"5px"}})})},a)]):"بدون پیوست"]]})})})]})]},s.id)),!(t!=null&&t.length)&&u.jsx(n,{variant:"body1",component:"span",children:"برای این سالن بازرسی ثبت نشده است."})]})]})})})})})};export{J as default}; diff --git a/build/assets/AvicultureHalls-BI0mP85Q.js b/build/assets/AvicultureHalls-BI0mP85Q.js new file mode 100644 index 0000000..18f7630 --- /dev/null +++ b/build/assets/AvicultureHalls-BI0mP85Q.js @@ -0,0 +1 @@ +import{j as t,I as l,b as C}from"./mui-vendor-CkIVaoQP.js";import{r,u as d}from"./react-vendor-CmFgShSM.js";import{L as p,iL as f,h,Q as x,iM as m,iN as y,G as n,S as j}from"./index-CeyyVc1v.js";import{u as E,f as A}from"./redux-vendor-B7uoacJt.js";import{R as S}from"./ResponsiveTable-w7hk7Uq8.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const g=()=>{const s=E(),{avicultureHallsInfo:a}=A(e=>e.avicultureSlice),[o,c]=r.useState([]),i=d();return r.useEffect(()=>{s(p()),s(f()).then(()=>{s(h())})},[]),r.useEffect(()=>{const e=a==null?void 0:a.map(u=>[u.hall,u.hatchingState==="active"?"دارد":"ندارد",x(new Date(u==null?void 0:u.hatchingDate),"yyyy/MM/dd"),u.inspections,t.jsx(l,{disabled:u.inspections===0,"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>i(y+u.poultryKey+"/"+u.hall),children:t.jsx(m,{})},1)]);c(e)},[a]),t.jsx(C,{display:"flex",justifyContent:"center",children:t.jsx(n,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:t.jsx(n,{justifyContent:"center",my:j.MEDIUM,children:t.jsx(S,{paginated:!0,title:"لیست سالن ها",columns:["شماره سالن","جوجه ریزی فعال","تاریخ آخرین جوجه ریزی","تعداد بازرسی ها","سوابق بازرسی"],data:o})})})})};export{g as default}; diff --git a/build/assets/AvicultureNewRequest-C3L5QRVn.js b/build/assets/AvicultureNewRequest-C3L5QRVn.js new file mode 100644 index 0000000..a91e0d0 --- /dev/null +++ b/build/assets/AvicultureNewRequest-C3L5QRVn.js @@ -0,0 +1,2 @@ +import{j as u,T as o,ao as Iu,ap as wu,aq as Tu,al as H,ak as x,aa as Bu,ag as B,ah as U,am as K,av as qu,aw as _u,ax as p,aU as Mu,I as Z,aX as Vu,bi as $u,ai as Wu,aj as Gu,B as q}from"./mui-vendor-CkIVaoQP.js";import{A as Ou,$ as Ru,c as _,M as v,L as b,a0 as X,fe as Yu,h as m,u as Q,b as S,c2 as zu,v as J,N as M,G as a,S as i,X as Pu,W as Hu,fg as uu,a1 as eu}from"./index-CeyyVc1v.js";import{r as l}from"./react-vendor-CmFgShSM.js";import{u as Uu,f as tu}from"./redux-vendor-B7uoacJt.js";import{a as Ku}from"./aviculture-get-hatching-data-DsjDNd82.js";import{a as Zu}from"./CityNewKillRequest-C2SXYvKb.js";import{d as Xu}from"./Delete-C5MyLelE.js";import{d as Qu}from"./Add--yVWBJhC.js";import{N as V}from"./NumberFormatCustom-DwWPj40N.js";import{D as Ju}from"./DialogAlert-BfXcr-Kr.js";import{d as u6}from"./Done-Dp5awdte.js";import{a as e6}from"./aviculture-get-unions-C1NoVg85.js";import{S as t6}from"./SelectCheck-CAe89SYT.js";const g6=()=>{var z,P;const[g]=l.useContext(Ou),[$,ru]=l.useState(""),[W,su]=l.useState(""),[f,au]=l.useState(""),[j,lu]=l.useState(""),[L,nu]=l.useState(""),[D,ou]=l.useState(""),[G,iu]=l.useState(""),[C,cu]=l.useState(""),[du]=l.useState(!1),[y,Cu]=l.useState(!1),[hu,Au]=l.useState(),[O,pu]=l.useState(""),[gu,mu]=l.useState(""),[Fu,xu]=l.useState([]),[,vu]=Ru(),fu=_().shape({name:v().required("نام اجباری است"),lastname:v().required("نام خانوادگی اجباری است"),mobile:v().required("موبایل اجباری است"),province:v().required("استان اجباری است"),city:v().required("شهرستان اجباری است"),buyerType:v().required("نوع خریدار اجباری است")}),ju=[{type:"text",id:1,value:""}],yu=[{type:"text",id:1,value:""}],[F,N]=l.useState(ju),[I,w]=l.useState(yu),n=Uu(),{avicultureChickenPrice:s}=tu(e=>e.avicultureSlice),{avicultureSlaughters:k}=tu(e=>e.avicultureSlice);l.useEffect(()=>{xu(k==null?void 0:k.map(e=>{var r,c,A,E;return{label:`${e.name} (${(c=(r=e.killHouseOperator)==null?void 0:r.user)==null?void 0:c.fullname})`,value:`${e.name} (${(E=(A=e.killHouseOperator)==null?void 0:A.user)==null?void 0:E.fullname})`}}))},[k]),l.useEffect(()=>{n(b()),n(X()),n(Yu()),n(m())},[]);const[d,bu]=l.useState(),[R,Y]=l.useState();l.useEffect(()=>{n(b()),n(e6()).then(e=>{var r;Y((r=e.payload.data[0])==null?void 0:r.key),bu(e.payload.data)}),n(m())},[]);const Su=()=>{F.length<3&&(N(e=>[...e,{type:"text",value:""}]),w(e=>[...e,{type:"text",value:""}]))},ku=e=>{const r=F.length-1;if(r!==0){const c=F.filter((E,T)=>T!==r),A=I.filter((E,T)=>T!==r);N(c),w(A)}},Eu=e=>{e.preventDefault();const r=e.target.id;N(c=>{const A=c.slice();return A[r].value=e.target.value,A})},h=e=>{e.preventDefault();const r=e.target.id;w(c=>{const A=c.slice();return A[r].value=e.target.dataset.value,A})};l.useEffect(()=>{s&&Au(s==null?void 0:s.key)},[s]);const t=Q({initialValues:{noChicken:"",sellType:{cash:!0,haveTime:!1},price1:"",price2:"",price3:"",slaughterDate:J(Date()).format("YYYY-MM-DD hh:mm:ss"),period1:"4",period2:"4",period3:"4",weight:"",losses:"0",isUnion:du,isStockMarket:y,isAccepted:!1,selectedSlaughters:[]},validationSchema:_({noChicken:v().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!").min(0,"تعداد وارد شده از حداقل ممکن کمتر است").max(gu,"تعداد وارد شده از کل موجودی بیشتر است"),isAccepted:zu().test("req","باید تعهد نامه را بپذیرید!",(e,r)=>r.originalValue&&r.originalValue===!0).required("این فیلد اجباری است!"),price1:S().typeError("لطفا عدد وارد کنید!").min(s==null?void 0:s.floorPrice,"قیمت وارد شده از کف قیمت امروز کمتر است").max(s==null?void 0:s.ceilingPrice,"قیمت وارد شده از سقف قیمت امروز بیشتر است"),price2:S().typeError("لطفا عدد وارد کنید!").min(s==null?void 0:s.floorPrice,"قیمت وارد شده از کف قیمت امروز کمتر است").max(s==null?void 0:s.ceilingPrice,"قیمت وارد شده از سقف قیمت امروز بیشتر است"),price3:S().typeError("لطفا عدد وارد کنید!").min(s==null?void 0:s.floorPrice,"قیمت وارد شده از کف قیمت امروز کمتر است").max(s==null?void 0:s.ceilingPrice,"قیمت وارد شده از سقف قیمت امروز بیشتر است"),weight:S().test("weight","وزن را تا دو رقم اعشار وارد کنید",(e,r)=>r.originalValue&&r.originalValue.toString().length<=4).required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!"),losses:S().required("این فیلد اجباری است!").max(D,"تلفات وارد شده از باقیمانده بیشتر است!").typeError("لطفا تعداد تلفات را وارد کنید!"),sellType:_().test("sellType","نحوه فروش را انتخاب کنید!",(e,r)=>r.originalValue&&Object.values(r.originalValue).some(c=>c===!0)).required("این فیلد اجباری است!")})}),Lu=t.values.noChicken*1e3,Du=u.jsxs(u.Fragment,{children:[u.jsxs(o,{variant:"body1",children:["اینجانب ",vu.fullname," موافقت خود را نسبت به موارد ذکر شده اعلام می نمایم."]}),u.jsxs(Iu,{children:[u.jsx(wu,{children:u.jsx(u6,{})}),u.jsx(Tu,{primary:` بر اساس این توافق نامه در صورت لغو فروش ${t.values.noChicken} قطعه + مرغ ${Lu} ریال جریمه خواهم شد.`})]}),u.jsx(o,{})]});l.useEffect(()=>{n(b()),n(Zu()).then(e=>{lu(e.payload.data),n(m())})},[]),l.useEffect(()=>{let e=t.values.weight;const r=t.values.weight.toString().split(".").join("");t.values.weight&&r.length<=3&&(r.length===2&&(e=r[0]+"."+r[1]),r.length===3&&(e=r[0]+"."+r[1]+r[2])),isNaN(Number.parseFloat(e))?t.setFieldValue("weight",""):t.setFieldValue("weight",Number.parseFloat(e))},[t.values.weight]),l.useEffect(()=>{y&&n(X()).then(e=>{Array.isArray(e.payload.data)?(g({vertical:"top",horizontal:"center",msg:"قیمت روز مرغ در سامانه ثبت نشده است.",severity:"error"}),n(M({right:!1,bottom:!1,content:null}))):n(m())})},[y]),l.useEffect(()=>{t.validateForm(),Nu.validateForm()},[]),l.useEffect(()=>{L&&(n(b()),n(Ku(L)).then(e=>{e.payload.data?(su(e.payload.data),n(m())):g({vertical:"top",horizontal:"center",msg:"اطلاعات جوجه ریزی یافت نشد!",severity:"error"}),n(m())}))},[L]),l.useEffect(()=>{mu(t.values.noChicken<=Number(C)&&Number(t.values.losses)<=Number(C)?Number(C)-Number(t.values.losses):0)},[t.values.losses,C,t.values.noChicken]),l.useEffect(()=>{ou(f.quantity),iu(f.losses),cu(f.leftOver)},[f]);const Nu=Q({initialValues:{name:"",lastname:"",mobile:"",province:"",city:"",buyerType:""},validationSchemaFreeSale:fu,onSubmit:e=>{}});return u.jsxs(a,{container:!0,gap:i.SMALL,direction:"column",display:"flex",children:[u.jsxs(a,{container:!0,gap:i.SMALL,direction:"column",children:[u.jsx(a,{minWidth:210,children:u.jsx(H,{disablePortal:!0,id:"combo-box-demo",options:j?j.map(e=>({id:e.key,label:e.unitName})):[],onChange:(e,r)=>{nu(r.id)},renderInput:e=>u.jsx(x,{...e,label:"محل پرورش"})})}),u.jsx(a,{minWidth:210,children:u.jsx(H,{disablePortal:!0,id:"hatching",options:W?W.map(e=>({id:e.key,race:e.chickenBreed,selected:e,label:`دوره ${e.period} سالن ${e.hall} نژاد ${e.chickenBreed} باقیمانده ${e.leftOver} قطعه`})):[],onChange:(e,r)=>{ru(r.id),au(r.selected);let c=r.race;c.includes("-")&&(c="ترکیبی"),pu(c)},renderInput:e=>u.jsx(x,{...e,label:"دوره جوجه ریزی"})})}),u.jsx(a,{children:u.jsx(x,{disabled:!0,fullWidth:!0,id:"outlined-read-only-input",label:"تعداد جوجه ریزی",value:D||"نامشخص",InputProps:{readOnly:!0}})}),u.jsx(a,{children:u.jsx(x,{disabled:!0,fullWidth:!0,id:"outlined-read-only-input",label:"جمع ثبت شده دامپزشک و مرغدار",value:G||"نامشخص",InputProps:{readOnly:!0}})}),u.jsx(a,{children:u.jsx(x,{disabled:!0,fullWidth:!0,id:"outlined-read-only-input",label:"باقیمانده",value:C||"نامشخص",InputProps:{readOnly:!0}})})]}),f&&u.jsxs(a,{container:!0,gap:i.SMALL,direction:"column",children:[u.jsx(o,{children:"اطلاعات کشتار"}),Pu()!=="Poultry"&&u.jsx(a,{children:u.jsx(a,{children:u.jsx(V,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"losses",label:"تلفات",variant:"outlined",value:t.values.losses,error:t.touched.losses?!!t.errors.losses:null,onChange:t.handleChange,onBlur:t.handleBlur,helperText:t.touched.losses&&t.errors.losses?t.errors.losses:null})})}),u.jsx(a,{children:u.jsx(V,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"noChicken",label:"تعداد مرغ برای کشتار",variant:"outlined",value:t.values.noChicken,error:t.touched.noChicken?!!t.errors.noChicken:null,onChange:t.handleChange,onBlur:t.handleBlur,helperText:t.touched.noChicken&&t.errors.noChicken?t.errors.noChicken:null})}),u.jsxs(a,{container:!0,gap:i.TINY,justifyContent:"space-evenly",alignItems:"start",children:[u.jsxs(a,{container:!0,gap:i.TINY,children:[u.jsx(o,{color:e=>e.palette.grey.A700,variant:"caption",children:"باقیمانده:"}),u.jsx(o,{variant:"button",children:t.values.noChicken?t.values.noChicken<=Number(C)&&Number(t.values.losses)<=Number(C)&&Number(C)-Number(t.values.losses)-Number(t.values.noChicken)>=0?Math.abs(Number(C)-Number(t.values.losses)-Number(t.values.noChicken)):0:Number(C)}),u.jsx(o,{variant:"button",children:"قطعه"})]}),u.jsx(a,{container:!0,children:u.jsxs(a,{container:!0,gap:i.TINY,alignItems:"center",children:[u.jsx(o,{color:e=>e.palette.grey.A700,variant:"caption",children:"سن مرغ:"}),u.jsx(o,{variant:"button",children:f.age}),u.jsx(o,{variant:"button",children:"روزه"})]})})]}),u.jsx(a,{children:u.jsx(Hu,{label:"تاریخ کشتار",id:"slaughterDate",renderInput:e=>u.jsx(x,{...e}),value:t.values.slaughterDate,error:t.touched.slaughterDate?!!t.errors.slaughterDate:null,onChange:e=>{t.setFieldValue("slaughterDate",J(e).format("YYYY-MM-DD hh:mm:ss"))},onBlur:t.handleBlur,helperText:t.touched.slaughterDate&&t.errors.slaughterDate?t.errors.slaughterDate:null})}),u.jsx(a,{children:u.jsx(x,{id:"weight",label:"وزن تقریبی مرغ",variant:"outlined",InputProps:{endAdornment:u.jsx(Bu,{position:"end",children:"کیلوگرم"})},value:t.values.weight,error:t.touched.weight?!!t.errors.weight:null,onChange:t.handleChange,onBlur:t.handleBlur,helperText:t.touched.weight&&t.errors.weight?t.errors.weight:null})}),u.jsx(a,{display:"none",children:u.jsx(B,{children:u.jsx(U,{"aria-labelledby":"demo-radio-buttons-group-label",defaultValue:"فروش اتحادیه",name:"radio-buttons-group",onChange:e=>{Cu(e.currentTarget.value)},children:y==="فروش مزایده ای"&&u.jsxs(a,{container:!0,gap:i.SMALL,children:[u.jsxs(a,{container:!0,gap:i.SMALL,alignItems:"center",children:[u.jsx(o,{color:e=>e.palette.grey.A700,variant:"caption",children:"کف قیمت امروز:"}),u.jsxs(o,{color:"secondary",variant:"button",children:[s!=null&&s.floorPrice?s==null?void 0:s.floorPrice.toLocaleString():"نامشخص"," "," ","ریال"]})]}),u.jsxs(a,{container:!0,gap:i.SMALL,alignItems:"center",children:[u.jsx(o,{color:e=>e.palette.grey.A700,variant:"caption",children:"سقف قیمت امروز:"}),u.jsxs(o,{color:"secondary",variant:"button",children:[s!=null&&s.ceilingPrice?s==null?void 0:s.ceilingPrice.toLocaleString():"نامشخص"," "," ","ریال"]})]}),u.jsx(K,{style:{width:"100%"}}),F.map((e,r)=>u.jsxs(a,{gap:i.SMALL,container:!0,sx:{minWidth:210},children:[u.jsxs(o,{mb:i.SMALL,display:"flex",children:["پیشنهاد ",r+1]}),u.jsx(V,{allowLeadingZeros:!0,thousandSeparator:",",error:!1,fullWidth:!0,label:"قیمت پیشنهادی",variant:"outlined",onChange:Eu,id:r}),u.jsxs(B,{fullWidth:!0,children:[u.jsx(qu,{id:"demo-simple-select-label",children:"بازه زمانی (ساعت)"}),u.jsxs(_u,{id:r,labelId:"demo-simple-select-label",label:"بازه زمانی (ساعت)",children:[u.jsx(p,{onClick:h,id:r,value:"1",children:"1"}),u.jsx(p,{onClick:h,id:r,value:"2",children:"2"}),u.jsx(p,{onClick:h,id:r,value:"3",children:"3"}),u.jsx(p,{onClick:h,id:r,value:"4",children:"4"}),u.jsx(p,{onClick:h,id:r,value:"5",children:"5"}),u.jsx(p,{onClick:h,id:r,value:"6",children:"6"}),u.jsx(p,{onClick:h,id:r,value:"7",children:"7"}),u.jsx(p,{onClick:h,id:r,value:"8",children:"8"}),u.jsx(p,{onClick:h,id:r,value:"9",children:"9"}),u.jsx(p,{onClick:h,id:r,value:"10",children:"10"})]}),u.jsx(Mu,{children:t.touched.period1&&t.errors.period1?t.errors.period1:null})]})]},e==null?void 0:e.id)),u.jsxs(a,{container:!0,children:[F.length>1&&u.jsx(Z,{onClick:ku,"aria-label":"delete",color:"secondary",children:u.jsx(Xu,{})}),F.length<3&&u.jsxs(Z,{xs:12,onClick:Su,"aria-label":"add",color:"primary",children:[u.jsx(Qu,{}),u.jsx(o,{children:"افزودن پیشنهاد جدید"})]})]}),u.jsx(a,{container:!0,sx:{width:"100%"},children:u.jsxs(o,{variant:"body2",children:["در صورت عدم فروش در بورس، از طریق اتحادیه فروش برود",u.jsx(Vu,{id:"isUnion",onChange:t.handleChange})]})})]})})})}),(j==null?void 0:j.length)&&((z=j[0])==null?void 0:z.provinceAllowChooseKillHouse)&&u.jsxs(a,{container:!0,direction:"column",gap:i.SMALL,children:[u.jsx(t6,{label:"انتخاب کشتارگاه پیشنهادی",onChange:e=>t.setFieldValue("selectedSlaughters",e),options:Fu}),u.jsxs(a,{container:!0,gap:i.SMALL,children:[t.values.selectedSlaughters&&u.jsx(o,{variant:"body1",children:"کشتارگاهای انتخابی"}),u.jsx(a,{container:!0,direction:"column",children:t.values.selectedSlaughters.map((e,r)=>u.jsxs(o,{variant:"body2",children:[r+1,"- ",e]},r))})]})]}),u.jsx(K,{}),u.jsx(a,{children:u.jsxs(B,{children:[u.jsx($u,{id:"demo-radio-buttons-group-label",children:"اطلاعات تعاونی"}),u.jsx(U,{"aria-labelledby":"demo-radio-buttons-group-label",defaultValue:d!=null&&d.length?(P=d[0])==null?void 0:P.key:"",name:"radio-buttons-group",onChange:e=>{Y(e.currentTarget.value)},children:d==null?void 0:d.map(e=>u.jsx(Wu,{disabled:!0,value:e.key,label:e.unitName,control:u.jsx(Gu,{})},e.key))})]})}),u.jsx(a,{children:u.jsx(Ju,{title:"تعهد نامه",content:Du,actions:u.jsxs(a,{container:!0,gap:i.TINY,children:[u.jsx(q,{variant:"outlined",color:"error",onClick:()=>{t.setFieldValue("isAccepted",!1)},children:"رد"}),u.jsx(q,{variant:"contained",color:"success",onClick:()=>{t.setFieldValue("isAccepted",!0)},children:"موافقم"})]}),btnTitle:"با تعهد نامه موافق هستم!",isAccepted:t.values.isAccepted})}),u.jsx(a,{mb:i.SMALL,children:u.jsx(q,{fullWidth:!0,disabled:!t.isValid,onClick:()=>{n(b()),y==="فروش مزایده ای"?n(uu({operator_key:(d==null?void 0:d.length)>1?R:"",poultry_hatching_key:$,quantity:t.values.noChicken,send_date:t.values.slaughterDate,chicken_breed:O,Index_weight:t.values.weight,union:t.values.isUnion,losses:t.values.losses!==""?t.values.losses:0,auction:!0,auction_list:F.map((e,r)=>({pricing_key:hu,fee:e.value?e.value:s==null?void 0:s.floorPrice,hour:I[r].value?I[r].value:"4"}))})).then(e=>{n(m()),e.error?e.error.message.includes("403")?g({vertical:"top",horizontal:"center",msg:"قیمت پیشنهادی نباید از حداکثر قیمت روز بیشتر باشد.",severity:"error"}):g({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(n(eu()),g({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),n(M({right:!1,bottom:!1,content:null})))}):n(uu({operator_key:(d==null?void 0:d.length)>1?R:"",poultry_hatching_key:$,quantity:t.values.noChicken,send_date:t.values.slaughterDate,chicken_breed:O,Index_weight:t.values.weight,losses:t.values.losses!==""?t.values.losses:0,auction_list:[],cash:t.values.sellType.cash,credit:t.values.sellType.haveTime,kill_house_list:t.values.selectedSlaughters,buyer:null})).then(e=>{if(n(m()),e.payload.error){g({vertical:"top",horizontal:"center",msg:e.payload.error.response.data.result,severity:"error"});return}e.error?e.error.message.includes("403")?g({vertical:"top",horizontal:"center",msg:"تعداد مرغ برای کشتار از باقیمانده بیشتر است!",severity:"error"}):g({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(g({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),n(eu()),n(M({right:!1,bottom:!1,content:null})))}).catch(e=>console.log(e,"ooooo"))},size:"large",variant:"contained",children:"ثبت درخواست"})})]})]})};export{g6 as A}; diff --git a/build/assets/AvicultureReports-Ca1oaxvj.js b/build/assets/AvicultureReports-Ca1oaxvj.js new file mode 100644 index 0000000..14c6082 --- /dev/null +++ b/build/assets/AvicultureReports-Ca1oaxvj.js @@ -0,0 +1 @@ +import{j as u,aJ as p,cq as x,b1 as d,T as j,p as m,I as F,b as y}from"./mui-vendor-CkIVaoQP.js";import{r as a,u as E}from"./react-vendor-CmFgShSM.js";import{u as v,f as S}from"./redux-vendor-B7uoacJt.js";import{A as R}from"./AdvancedTable-BYmmBtmq.js";import{p as b,G as c,S as i,iO as w,Q as D,iz as L}from"./index-CeyyVc1v.js";import{d as T}from"./Plagiarism-BiXORbzo.js";import{C as B,a as I}from"./ChartLenear-WgLA0J0V.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";import"./chart-vendor-sE2SUVPW.js";import"./auto-gcBAg08D.js";const f=({data:s})=>{const[t,C]=a.useState({datasets:[]}),[l,h]=a.useState({datasets:[]});return a.useEffect(()=>{var o,e,n,g,A;C({labels:(o=s==null?void 0:s.hatchingChart)==null?void 0:o.map(r=>b(r==null?void 0:r.date)),datasets:[{label:"تعداد",backgroundColor:["rgba(33, 72, 214, 0.7)"],data:(e=s==null?void 0:s.hatchingChart)==null?void 0:e.map(r=>r==null?void 0:r.quantity),borderRadius:5},{label:"تلفات",backgroundColor:["rgba(100, 130, 160, 0.7)"],data:(n=s.hatchingChart)==null?void 0:n.map(r=>r==null?void 0:r.losses),borderRadius:5}]}),h({labels:(g=s==null?void 0:s.weightChart)==null?void 0:g.map(r=>b(r==null?void 0:r.date)),datasets:[{label:"قیمت",backgroundColor:["rgba(33, 72, 214, 0.7)"],data:(A=s==null?void 0:s.weightChart)==null?void 0:A.map(r=>r==null?void 0:r.weight),borderRadius:5}]})},[]),u.jsx(c,{mb:i.LARGE,children:u.jsxs(c,{container:!0,mt:i.MEDIUM,gap:i.SMALL,justifyContent:"space-between",children:[u.jsx(p,{sx:{width:"45%"},children:u.jsx(x,{children:u.jsxs(d,{children:[u.jsx(j,{gutterBottom:!0,variant:"body1",children:"نمودار حجم جوجه ریزی و تلفات دوره"}),u.jsx(B,{chartData:t})]})})}),u.jsx(p,{sx:{width:"45%"},children:u.jsx(x,{children:u.jsxs(d,{children:[u.jsx(j,{gutterBottom:!0,variant:"body1",children:"نمودار پایش وزن و بهره وری وزن"}),u.jsx(I,{chartData:l})]})})})]})})};f.propTypes={data:m.PropTypes.any};const z=()=>{const s=v(),{reports:t}=S(o=>o.avicultureSlice),[C,l]=a.useState(),h=E();return a.useEffect(()=>{s(w())},[]),a.useEffect(()=>{const o=t==null?void 0:t.table.map((e,n)=>[n+1,e.hatchingPeriod,D(new Date(e==null?void 0:e.hatchingDate),"yyyy/MM/dd"),e.hatchingChickenBreed,e.age,e.quantity,e.weightOfSuffering,e.averageFee,e.averageWeight,e.salesPrice.toLocaleString(),e.totalAmount.toLocaleString(),e.paidState==="paid"?"پرداخت شده":e.paidState==="pending"?"در انتظار پرداخت":"ندارد",u.jsx(F,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>h(L+(e==null?void 0:e.requestId)),children:u.jsx(T,{})},n)]);l(o)},[t]),u.jsx(y,{display:"flex",justifyContent:"center",children:u.jsx(c,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsxs(c,{xs:12,mt:i.SMALL,children:[u.jsx(c,{width:"100%",className:"avicultureActiveRequestsView",children:u.jsx(p,{children:u.jsx(R,{name:"گزارش مرغدار",columns:["ردیف","دوره جوجه ریزی","تاریخ جوجه ریزی","نژاد","سن","تعداد","رنج وزن","قیمت رنج","میانگین وزن شما","قیمت فروش","جمع مبلغ به تومان","تراکنش مالی","نمایش پرونده"],data:C})})}),u.jsx(f,{data:t})]})})})};export{z as default}; diff --git a/build/assets/AvicultureRequests-BpPrjqVS.js b/build/assets/AvicultureRequests-BpPrjqVS.js new file mode 100644 index 0000000..a360ae8 --- /dev/null +++ b/build/assets/AvicultureRequests-BpPrjqVS.js @@ -0,0 +1 @@ +import{j as u,a3 as E,T as m,ai as I,aX as L,B as D,b as V}from"./mui-vendor-CkIVaoQP.js";import{G as o,S as n,ip as f,iq as g,ir as R,is as y,it as v,iu as T,iv as S,iw as q,p as _,u as P,c as $,v as Q,b as U,L as k,j as N,h as M,ix as z,iy as H}from"./index-CeyyVc1v.js";import{N as l}from"./NavLink-D2GD_ItM.js";import{L as A}from"./LinkItem-DT6qswcs.js";import{r as W,s as Y,t as J,u as b}from"./index.esm-BY9chGNa.js";import{a as X}from"./index.esm-YBNW__9r.js";import{c as K}from"./index.esm-Bu7XMDZU.js";import{f as O,r as C}from"./react-vendor-CmFgShSM.js";import{A as Z}from"./AvicultureNewRequest-C3L5QRVn.js";import{T as uu,A as eu,a as tu}from"./reactour.esm-9QIjTffK.js";import{A as su}from"./AvicultureArchivedRequests-Bul1i4cq.js";import{u as B,f as ou,a as w}from"./redux-vendor-B7uoacJt.js";import{R as ru}from"./ResponsiveTable-w7hk7Uq8.js";import{R as nu,a as iu}from"./RequestsAwaitingInspections-C8DP5FQL.js";import{B as au}from"./BackButton-Crzr7NMa.js";import"./iconBase-BEJYyZsk.js";import"./aviculture-get-hatching-data-DsjDNd82.js";import"./CityNewKillRequest-C2SXYvKb.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";import"./Add--yVWBJhC.js";import"./Done-Dp5awdte.js";import"./aviculture-get-unions-C1NoVg85.js";import"./NumberFormatCustom-DwWPj40N.js";import"./DialogAlert-BfXcr-Kr.js";import"./SimpleTable-DBAoNnCU.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./province-get-sell-for-freezing-status-ieuVFEgW.js";import"./province-policy-market-daily-limitation-DueqDboR.js";import"./isValidIndexWeight-C_ik-uYa.js";import"./LabelField-B6eRSoQP.js";import"./SelectCheck-CAe89SYT.js";import"./AdvancedTable-BYmmBtmq.js";import"./Plagiarism-BiXORbzo.js";import"./chart-vendor-sE2SUVPW.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./FilterAlt-scT0HEUg.js";const cu=()=>{const{pathname:e}=O();return u.jsx(o,{container:!0,gap:n.SMALL,p:n.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",style:{placeContent:"baseline"},children:u.jsx(o,{container:!0,direction:"column",style:{width:"100%"},children:u.jsxs(o,{container:!0,gap:n.SMALL,justifyContent:"center",children:[u.jsx(l,{to:f,active:e===f?"true":null,children:u.jsx(A,{icon:u.jsx(W,{size:30,color:"#244CCC"}),title:"جوجه ریزی",description:"ثبت و مدیریت جوجه ریزی ها"})}),u.jsx(l,{to:g,active:e===g?"true":null,children:u.jsx(A,{icon:u.jsx(Y,{size:30,color:"#244CCC"}),title:"درخواست های کشتار",description:"مدیریت و ثبت درخواست های کشتار"})}),u.jsx(l,{to:R,active:e===R?"true":null,children:u.jsx(A,{icon:u.jsx(J,{size:30,color:"#244CCC"}),title:"در انتظار پرداخت",description:"مشاهده درخواست های در انتظار پرداخت کشتارگاه"})}),u.jsx(l,{to:y,active:e===y?"true":null,children:u.jsx(A,{icon:u.jsx(X,{className:"svg-icon-color",fill:"#244CCC",stroke:"#244CCC",style:{color:"#4285F4"},color:"#244CCC",size:30}),title:"در انتظار بازرسی",description:"درخواست های در انتظار بررسی بازرس"})}),u.jsx(l,{to:v,active:e===v?"true":null,children:u.jsx(A,{icon:u.jsx(K,{className:"svg-icon-color",color:"#244CCC",size:30}),title:"درخواست های رد شده",description:"مشاهده درخواست هایی که به دلایل مختلف توسط اتحادیه رد شده است"})}),u.jsx(l,{to:T,active:e===T?"true":null,children:u.jsx(A,{icon:u.jsx(b,{className:"svg-icon-color",color:"#244CCC",size:30}),title:"بایگانی",description:"درخواست های پایان یافته"})}),u.jsx(l,{to:S,active:e===S?"true":null,children:u.jsx(A,{icon:u.jsx(b,{className:"svg-icon-color",color:"#244CCC",size:30}),title:"وکالت"})})]})})})},Cu=[{selector:".first-step",content:()=>u.jsx("div",{children:"برای ثبت جوجه ریزی اینجا کلیک کنید!"})},{selector:".second",content:()=>u.jsx("div",{children:"در این قسمت جوجه ریزی های ثبت شده توسط شما نمایش داده می شود."})}],lu=()=>{const e=B(),{avicultureHatchings:r}=ou(s=>s.avicultureSlice),[i,a]=C.useState(!1),[p,j]=C.useState([]);C.useEffect(()=>{e(q())},[]),C.useEffect(()=>{const s=r==null?void 0:r.map((t,h)=>{const x=t.quantity-t.losses-t.leftOver;return[h+1,t.allowHatching==="pending"?"فعال":"بایگانی شده",t.poultry.unitName,t.hall,t.period,_(t==null?void 0:t.createDate),_(t==null?void 0:t.date),t.breed.map(c=>{const G=`${c.breed} (${c.mainQuantity} قطعه)`;return u.jsx("p",{children:G},c==null?void 0:c.createDate)}),t.age,t.quantity,`${t.losses} (%${(t.losses*100/t.quantity).toFixed(0)})`,x+` (%${(x*100/t.quantity).toFixed(0)})`,`${t.leftOver} (%${(t.leftOver*100/t.quantity).toFixed(0)})`]});j(s)},[r]);const F=P({initialValues:{noChicken:"",slaughterDate:Q(Date()).format("YYYY-MM-DD hh:mm:ss"),race:"آرین",weight:""},validationSchema:$({noChicken:U().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),weight:U().required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!")})});return C.useEffect(()=>{F.validateForm()},[]),u.jsx(o,{container:!0,gap:n.MEDIUM,direction:"column",xs:12,children:u.jsx(o,{container:!0,gap:n.SMALL,justifyContent:{xs:"center",lg:"space-between"},alignSelf:"center",alignItems:"center",xs:12,direction:{xs:"column",lg:"row"},children:u.jsxs(o,{container:!0,xs:12,alignItems:"start",gap:n.SMALL,direction:"column",children:[u.jsx(o,{width:"100%",container:!0,alignItems:"center",justifyContent:"space-between",children:u.jsx(o,{})}),u.jsx(uu,{steps:Cu,isOpen:i,onRequestClose:()=>a(!1),styles:{popover:s=>({...s,borderRadius:"10px","--reactor-accent":"red"})}}),u.jsx(o,{width:"100%",className:"second",children:u.jsx(ru,{paginated:!0,title:"دوره های جوجه ریزی",data:p,columns:["ردیف","وضعیت","نام فارم","سالن","دوره جوجه ریزی","تاریخ ثبت جوجه ریزی","تاریخ جوجه ریزی","نژاد","سن","تعداد جوجه ریزی","تلفات دوره","کشتار شده","مانده برای کشتار"],customColors:[{name:"وضعیت",color:"green"}]})})]})})})},Au=w("AVICULTURE_GET_GIVE_PERMISSION_SERVICE",async(e,{dispatch:r})=>{r(k());const{data:i,status:a}=await N.get("poultry_allow_city_province/");return r(M()),{data:i,status:a}}),du=w("AVICULTURE_GIVE_PERMISSION_SERVICE",async(e,{dispatch:r})=>{r(k());const{data:i,status:a}=await N.post("poultry_allow_city_province/",e);return r(M()),{data:i,status:a}}),d={root:{padding:20,textAlign:"left",boxShadow:"0px 0px 10px rgba(0, 0, 0, 0.1)",borderRadius:8,backgroundColor:"#fff"},heading:{textAlign:"right",borderBottom:"2px solid #ccc",paddingBottom:n.SMALL,marginBottom:n.SMALL},checkboxContainer:{display:"flex",justifyContent:"flex-start",marginBottom:n.SMALL},checkbox:{marginLeft:n.SMALL},button:{marginTop:n.SMALL}},pu=()=>{const e=B(),[r,i]=C.useState(!1),[a,p]=C.useState(!1),j=s=>{i(s.target.checked)},F=s=>{p(s.target.checked)};return C.useEffect(()=>{e(Au()).then(s=>{var t,h,x,c;(h=(t=s==null?void 0:s.payload)==null?void 0:t.data)!=null&&h.length?(i((x=s.payload.data[0])==null?void 0:x.city),p((c=s.payload.data[0])==null?void 0:c.province)):(i(!1),p(!1))})},[e]),u.jsxs(E,{container:!0,style:d.root,direction:"column",children:[u.jsx(m,{variant:"h6",gutterBottom:!0,style:d.heading,children:"اجازه دسترسی"}),u.jsx(E,{style:d.checkboxContainer,children:u.jsx(I,{control:u.jsx(L,{checked:r,onChange:j,color:"primary"}),label:u.jsx(m,{style:d.checkbox,children:"دادن وکالت به شهرستان جهت ثبت درخواست کشتار"})})}),u.jsx(E,{style:d.checkboxContainer,children:u.jsx(I,{control:u.jsx(L,{checked:a,onChange:F,color:"primary"}),label:u.jsx(m,{style:d.checkbox,children:"دادن وکالت به استان جهت ثبت درخواست کشتار"})})}),u.jsx(E,{style:d.button,children:u.jsx(D,{variant:"contained",color:"primary",onClick:()=>{e(du({city:r,province:a}))},children:"ثبت"})})]})},Zu=()=>{const{pathname:e}=O();return u.jsx(V,{display:"flex",justifyContent:"center",children:u.jsxs(o,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[e===z?u.jsxs(u.Fragment,{children:[u.jsx(o,{mt:n.MEDIUM,children:u.jsx(m,{variant:"h6",children:"صفحه درخواست های مرغدار"})}),u.jsx(o,{justifyContent:"center",alignItems:"center",children:u.jsx(cu,{})})]}):u.jsx(au,{}),u.jsx(o,{container:!0,justifyContent:"space-between",gap:n.SMALL,children:u.jsxs(o,{xs:12,children:[e===H&&u.jsx(Z,{}),e===f&&u.jsx(lu,{}),e===g&&u.jsx(eu,{}),e===v&&u.jsx(tu,{}),e===T&&u.jsx(su,{}),e===R&&u.jsx(nu,{}),e===y&&u.jsx(iu,{}),e===S&&u.jsx(pu,{})]})})]})})};export{Zu as default}; diff --git a/build/assets/B-NAZANIN-oLmczWLB.TTF b/build/assets/B-NAZANIN-oLmczWLB.TTF new file mode 100644 index 0000000..72bbfc3 Binary files /dev/null and b/build/assets/B-NAZANIN-oLmczWLB.TTF differ diff --git a/build/assets/BackButton-Crzr7NMa.js b/build/assets/BackButton-Crzr7NMa.js new file mode 100644 index 0000000..11f4768 --- /dev/null +++ b/build/assets/BackButton-Crzr7NMa.js @@ -0,0 +1 @@ +import{i as o,j as e,I as u,T as i}from"./mui-vendor-CkIVaoQP.js";import{r as s,G as n,S as l}from"./index-CeyyVc1v.js";import{u as c}from"./react-vendor-CmFgShSM.js";var r={},d=o;Object.defineProperty(r,"__esModule",{value:!0});var t=r.default=void 0,p=d(s()),v=e;t=r.default=(0,p.default)((0,v.jsx)("path",{d:"M14.59 7.41 18.17 11H6v2h12.17l-3.59 3.59L16 18l6-6-6-6zM2 6v12h2V6z"}),"Start");const j=()=>{const a=c();return e.jsx(n,{container:!0,alignItems:"center",my:l.SMALL,children:e.jsxs(u,{"aria-label":"delete",color:"primary",onClick:()=>a(-1),children:[e.jsx(t,{}),e.jsx(i,{mx:1,children:"بازگشت"})]})})};export{j as B}; diff --git a/build/assets/Badge-u1S44abW.js b/build/assets/Badge-u1S44abW.js new file mode 100644 index 0000000..526496f --- /dev/null +++ b/build/assets/Badge-u1S44abW.js @@ -0,0 +1 @@ +import{i as r,j as a}from"./mui-vendor-CkIVaoQP.js";import{r as t}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,c=o(t()),i=a;u=e.default=(0,c.default)((0,i.jsx)("path",{d:"M20 7h-5V4c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v3H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2M9 12c.83 0 1.5.67 1.5 1.5S9.83 15 9 15s-1.5-.67-1.5-1.5S8.17 12 9 12m3 6H6v-.75c0-1 2-1.5 3-1.5s3 .5 3 1.5zm1-9h-2V4h2zm5 7.5h-4V15h4zm0-3h-4V12h4z"}),"Badge");export{u as d}; diff --git a/build/assets/BarInfos-BmLW4eH9.js b/build/assets/BarInfos-BmLW4eH9.js new file mode 100644 index 0000000..69e4075 --- /dev/null +++ b/build/assets/BarInfos-BmLW4eH9.js @@ -0,0 +1 @@ +import{j as r,b as n}from"./mui-vendor-CkIVaoQP.js";import{G as t,S as e}from"./index-CeyyVc1v.js";import{A as o}from"./AdvancedTable-BYmmBtmq.js";import"./react-vendor-CmFgShSM.js";import"./redux-vendor-B7uoacJt.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const s=()=>r.jsx(t,{children:r.jsx(o,{})}),f=()=>r.jsx(n,{display:"flex",justifyContent:"center",children:r.jsx(t,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,my:e.MEDIUM,children:r.jsx(t,{container:!0,justifyContent:"space-between",gap:e.SMALL,children:r.jsx(t,{xs:12,children:r.jsx(s,{})})})})});export{f as default}; diff --git a/build/assets/BarSquareTransactions-DgqWT2Jp.js b/build/assets/BarSquareTransactions-DgqWT2Jp.js new file mode 100644 index 0000000..a4801a4 --- /dev/null +++ b/build/assets/BarSquareTransactions-DgqWT2Jp.js @@ -0,0 +1 @@ +import{j as u,b as s,B as a}from"./mui-vendor-CkIVaoQP.js";import"./react-vendor-CmFgShSM.js";import{G as e,S as t}from"./index-CeyyVc1v.js";import{B as i}from"./BackButton-Crzr7NMa.js";import{R as n}from"./ResponsiveTable-w7hk7Uq8.js";import"./redux-vendor-B7uoacJt.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const h=()=>{const r=[["1","1404/2/17","پرداخت شده","1,150,000",u.jsx(a,{href:"https://miran.storage.c2.liara.space/factor/1.pdf",size:"small",variant:"contained",children:"دانلود"},"ee")],["2","1404/2/16","پرداخت شده","830,000",u.jsx(a,{href:"https://miran.storage.c2.liara.space/factor/2.pdf",size:"small",variant:"contained",children:"دانلود"},"ee")],["3","1404/2/16","پرداخت شده","12,000,000",u.jsx(a,{href:"https://miran.storage.c2.liara.space/factor/3.pdf",size:"small",variant:"contained",children:"دانلود"},"ee")],["4","1404/2/15","پرداخت شده","120,000",u.jsx(a,{href:"https://miran.storage.c2.liara.space/factor/4.pdf",size:"small",variant:"contained",children:"دانلود"},"ee")],["5","1404/2/14","پرداخت شده","8,100,000",u.jsx(a,{href:"https://miran.storage.c2.liara.space/factor/5.pdf",size:"small",variant:"contained",children:"دانلود"},"ee")]];return u.jsx(s,{display:"flex",justifyContent:"center",children:u.jsx(e,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,my:t.MEDIUM,children:u.jsxs(e,{container:!0,justifyContent:"space-between",gap:t.SMALL,children:[u.jsx(e,{xs:12,container:!0,children:u.jsx(i,{})}),u.jsx(e,{xs:12,children:u.jsx(n,{paginated:!0,title:"تراکنش ها",data:r,columns:["ردیف","تاریخ","وضعیت","مبلغ تراکنش","جزئیات محصولات"]})})]})})})};export{h as default}; diff --git a/build/assets/BroadcastManagement-RkF4bwmH.js b/build/assets/BroadcastManagement-RkF4bwmH.js new file mode 100644 index 0000000..3dfe7b6 --- /dev/null +++ b/build/assets/BroadcastManagement-RkF4bwmH.js @@ -0,0 +1 @@ +import{j as r,T as o,aI as _}from"./mui-vendor-CkIVaoQP.js";import{G as a,S as u,X as c,ef as E,eg as R,eh as p,ei as T,ej as A,ek as l,el as x,em as d,en as j}from"./index-CeyyVc1v.js";import O from"./SlaughterAgentShare-DjSsZVvD.js";import{c as e}from"./index.esm-BcDC8KuM.js";import{L as n}from"./LinkItem-DT6qswcs.js";import{N as s}from"./NavLink-D2GD_ItM.js";import{f as S}from"./react-vendor-CmFgShSM.js";import"./redux-vendor-B7uoacJt.js";import"./index.esm-Bu7XMDZU.js";import"./iconBase-BEJYyZsk.js";import"./ResponsiveTable-w7hk7Uq8.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./AdvancedTable-BYmmBtmq.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";import"./NumberFormatCustom-DwWPj40N.js";import"./SimpleTable-DBAoNnCU.js";import"./SlaughterManageInventoryAllocationOperations-Bla8JB6Q.js";import"./Tune-D4M2CAhp.js";import"./Edit-CqBj1Y2L.js";import"./CheckCircleOutline-Ci9-hVKX.js";import"./SlaughterAllocateToGuild-Dfz5LRq5.js";import"./slaughter-get-guilds-for-allocate-B6OrhhMj.js";import"./toBase64-BzgTOHsW.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./province-policy-upload-image-CRJ-U4Kc.js";import"./LabelField-B6eRSoQP.js";import"./BackButton-Crzr7NMa.js";const m=t=>{const i=c();return i==="SuperAdmin"?t?E:R:i==="AdminX"?t?p:T:t?A:l},N=()=>r.jsxs(a,{container:!0,gap:u.SMALL,p:u.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",children:[r.jsx(s,{to:m(!0),children:r.jsx(n,{icon:r.jsx(e,{size:30,color:"#244CCC"}),title:r.jsxs(r.Fragment,{children:[r.jsx(o,{children:"گزارش پخش روزانه"}),r.jsx(o,{variant:"caption",children:"کشتارگاه به مباشر/ صنف"})]})})}),r.jsx(s,{to:m(!1),children:r.jsx(n,{icon:r.jsx(e,{size:30,color:"#244CCC"}),title:r.jsxs(r.Fragment,{children:[r.jsx(o,{children:"گزارش پخش روزانه"}),r.jsx(o,{variant:"caption",children:"مباشر به صنف"})]})})})]}),tr=()=>{const{pathname:t}=S();return r.jsx(_,{display:"flex",justifyContent:"center",children:r.jsxs(a,{container:!0,direction:"column",justifyContent:"center",my:u.MEDIUM,xs:12,sm:12,md:10,lg:10,children:[(t===x||t===d||t===j)&&r.jsx(N,{}),(t===A||t===E||t===p)&&r.jsx(O,{})]})})};export{tr as default}; diff --git a/build/assets/Business-J-mGuLnc.js b/build/assets/Business-J-mGuLnc.js new file mode 100644 index 0000000..4cabf4d --- /dev/null +++ b/build/assets/Business-J-mGuLnc.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as h}from"./index-CeyyVc1v.js";var e={},v=r;Object.defineProperty(e,"__esModule",{value:!0});var a=e.default=void 0,m=v(h()),s=t;a=e.default=(0,m.default)((0,s.jsx)("path",{d:"M12 7V3H2v18h20V7zM6 19H4v-2h2zm0-4H4v-2h2zm0-4H4V9h2zm0-4H4V5h2zm4 12H8v-2h2zm0-4H8v-2h2zm0-4H8V9h2zm0-4H8V5h2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8zm-2-8h-2v2h2zm0 4h-2v2h2z"}),"Business");export{a as d}; diff --git a/build/assets/Cake-CkaTUHNX.js b/build/assets/Cake-CkaTUHNX.js new file mode 100644 index 0000000..b1d0c92 --- /dev/null +++ b/build/assets/Cake-CkaTUHNX.js @@ -0,0 +1 @@ +import{i as t,j as r}from"./mui-vendor-CkIVaoQP.js";import{r as v}from"./index-CeyyVc1v.js";var e={},u=t;Object.defineProperty(e,"__esModule",{value:!0});var o=e.default=void 0,h=u(v()),i=r;o=e.default=(0,h.default)((0,i.jsx)("path",{d:"M15 11V5l-3-3-3 3v2H3v14h18V11zm-8 8H5v-2h2zm0-4H5v-2h2zm0-4H5V9h2zm6 8h-2v-2h2zm0-4h-2v-2h2zm0-4h-2V9h2zm0-4h-2V5h2zm6 12h-2v-2h2zm0-4h-2v-2h2z"}),"LocationCity");var a={},c=t;Object.defineProperty(a,"__esModule",{value:!0});var l=a.default=void 0,d=c(v()),m=r;l=a.default=(0,d.default)((0,m.jsx)("path",{d:"M12 6c1.11 0 2-.9 2-2 0-.38-.1-.73-.29-1.03L12 0l-1.71 2.97c-.19.3-.29.65-.29 1.03 0 1.1.9 2 2 2m4.6 9.99-1.07-1.07-1.08 1.07c-1.3 1.3-3.58 1.31-4.89 0l-1.07-1.07-1.09 1.07C6.75 16.64 5.88 17 4.96 17c-.73 0-1.4-.23-1.96-.61V21c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-4.61c-.56.38-1.23.61-1.96.61-.92 0-1.79-.36-2.44-1.01M18 9h-5V7h-2v2H6c-1.66 0-3 1.34-3 3v1.54c0 1.08.88 1.96 1.96 1.96.52 0 1.02-.2 1.38-.57l2.14-2.13 2.13 2.13c.74.74 2.03.74 2.77 0l2.14-2.13 2.13 2.13c.37.37.86.57 1.38.57 1.08 0 1.96-.88 1.96-1.96V12C21 10.34 19.66 9 18 9"}),"Cake");export{o as a,l as d}; diff --git a/build/assets/Captcha-CBxUIUNI.js b/build/assets/Captcha-CBxUIUNI.js new file mode 100644 index 0000000..702804a --- /dev/null +++ b/build/assets/Captcha-CBxUIUNI.js @@ -0,0 +1 @@ +var d=Object.defineProperty;var u=(n,s,e)=>s in n?d(n,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[s]=e;var h=(n,s,e)=>u(n,typeof s!="symbol"?s+"":s,e);import{j as t,ak as p,bs as c}from"./mui-vendor-CkIVaoQP.js";import{r as x}from"./react-vendor-CmFgShSM.js";function o(n,s){return n=Math.ceil(n),s=Math.floor(s),Math.floor(Math.random()*(s-n))+n}class l extends x.Component{constructor(){super(...arguments);h(this,"state",{solution:o(111111,999999),input:""});h(this,"componentDidMount",()=>{this.drawCaptcha()});h(this,"drawCaptcha",()=>{const{solution:e}=this.state,{width:i,height:r}=this.canvas,a=this.canvas.getContext("2d");a.clearRect(0,0,i,r),a.font="40px serif",a.textAlign="center",a.textBaseline="middle",a.fillText(e,i/2,r/2+3),a.strokeStyle="#000000",a.beginPath(),a.moveTo(o(5,20),o(5,20)),a.lineTo(i-o(5,20),r-o(5,20)),a.stroke(),a.moveTo(o(5,20),r-o(5,20)),a.lineTo(i-o(5,20),o(5,20)),a.stroke(),a.closePath(),this.canvas.style.backgroundColor="transparent"});h(this,"refresh",()=>{this.setState({solution:o(111111,999999),input:""},this.drawCaptcha)});h(this,"playAudio",()=>{const{solution:e}=this.state;let i=new SpeechSynthesisUtterance(e.toString().split("").join(" "));i.rate=.25,window.speechSynthesis.speak(i)});h(this,"handleChange",e=>{const{onChange:i}=this.props,{solution:r}=this.state;this.setState({input:e.target.value}),i(e.target.value===r.toString())})}render(){const{input:e}=this.state;return t.jsxs("div",{className:"rnc",children:[t.jsxs("div",{className:"rnc-row",children:[t.jsx("canvas",{ref:i=>this.canvas=i,width:200,height:50,className:"rnc-canvas","data-testid":"captcha-canvas"}),t.jsxs("div",{className:"rnc-column",children:[t.jsx("button",{type:"button","aria-label":"get new captcha",onClick:this.refresh,className:"rnc-button","data-testid":"captcha-refresh",tabIndex:-1,children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:t.jsx("g",{"data-name":"Layer 2",children:t.jsxs("g",{"data-name":"refresh",children:[t.jsx("rect",{width:"24",height:"24",opacity:"0"}),t.jsx("path",{d:"M20.3 13.43a1 1 0 0 0-1.25.65A7.14 7.14 0 0 1 12.18 19 7.1 7.1 0 0 1 5 12a7.1 7.1 0 0 1 7.18-7 7.26 7.26 0 0 1 4.65 1.67l-2.17-.36a1 1 0 0 0-1.15.83 1 1 0 0 0 .83 1.15l4.24.7h.17a1 1 0 0 0 .34-.06.33.33 0 0 0 .1-.06.78.78 0 0 0 .2-.11l.09-.11c0-.05.09-.09.13-.15s0-.1.05-.14a1.34 1.34 0 0 0 .07-.18l.75-4a1 1 0 0 0-2-.38l-.27 1.45A9.21 9.21 0 0 0 12.18 3 9.1 9.1 0 0 0 3 12a9.1 9.1 0 0 0 9.18 9A9.12 9.12 0 0 0 21 14.68a1 1 0 0 0-.7-1.25z"})]})})})}),t.jsx("button",{type:"button","aria-label":"play audio",onClick:this.playAudio,className:"rnc-button","data-testid":"captcha-audio",tabIndex:-1,children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:t.jsx("g",{"data-name":"Layer 2",children:t.jsxs("g",{"data-name":"volume-up",children:[t.jsx("rect",{width:"24",height:"24",opacity:"0"}),t.jsx("path",{d:"M18.28 8.37a1 1 0 1 0-1.56 1.26 4 4 0 0 1 0 4.74A1 1 0 0 0 17.5 16a1 1 0 0 0 .78-.37 6 6 0 0 0 0-7.26z"}),t.jsx("path",{d:"M19.64 5.23a1 1 0 1 0-1.28 1.54A6.8 6.8 0 0 1 21 12a6.8 6.8 0 0 1-2.64 5.23 1 1 0 0 0-.13 1.41A1 1 0 0 0 19 19a1 1 0 0 0 .64-.23A8.75 8.75 0 0 0 23 12a8.75 8.75 0 0 0-3.36-6.77z"}),t.jsx("path",{d:"M15 3.12a1 1 0 0 0-1 0L7.52 7.57h-5a1 1 0 0 0-1 1v6.86a1 1 0 0 0 1 1h5l6.41 4.4a1.06 1.06 0 0 0 .57.17 1 1 0 0 0 1-1V4a1 1 0 0 0-.5-.88zm-1.47 15L8.4 14.6a1 1 0 0 0-.57-.17H3.5V9.57h4.33a1 1 0 0 0 .57-.17l5.1-3.5z"})]})})})})]})]}),t.jsx(p,{id:"captcha",label:"کد امنیتی",variant:"outlined",value:e,onChange:this.handleChange,sx:{width:"100%"}})]})}}l.defaultProps={placeholder:"کد امنیتی را وارد کنید..."};l.propTypes={onChange:c.func.isRequired,placeholder:c.string};export{l as C}; diff --git a/build/assets/CarManagement-Chl2SE7Y.js b/build/assets/CarManagement-Chl2SE7Y.js new file mode 100644 index 0000000..56a1742 --- /dev/null +++ b/build/assets/CarManagement-Chl2SE7Y.js @@ -0,0 +1 @@ +import{j as u,a3 as _,ag as S,ak as P,av as q,aw as G,ax as v,aU as U,aa as au,T as D,ah as lu,ai as X,aj as Y,B as N,al as ou,b5 as nu,d as su,aJ as iu,I as cu,b0 as du,an as hu,b4 as K,ap as H,aq as $,b as Cu}from"./mui-vendor-CkIVaoQP.js";import{L as w,j as I,h as j,A as M,u as Z,X as y,b0 as B,N as k,b1 as pu,c as uu,M as E,b2 as J,G as R,S as O,b3 as mu}from"./index-CeyyVc1v.js";import{r as m}from"./react-vendor-CmFgShSM.js";import{a as L,u as V,f as W}from"./redux-vendor-B7uoacJt.js";import{C as yu}from"./CarPelak-BYFY8OXg.js";import{a as xu}from"./index.esm-Bu7XMDZU.js";import{d as Au}from"./Tune-D4M2CAhp.js";import{d as vu}from"./EditOutlined-n5ie2Fmu.js";import{d as _u}from"./DeleteOutline-DlhNLp0A.js";import{R as Q}from"./ResponsiveTable-w7hk7Uq8.js";import"./iconBase-BEJYyZsk.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const ju=L("PROVINCE_REGISTER_CAR_SERVICE",async(r,{dispatch:l})=>{try{l(w());const{data:t,status:s}=await I.post("kill_house_driver/",r);return l(j()),{data:t,status:s}}catch(t){return l(j()),{error:t.response.data.result}}}),fu=L("PROVINCE_EDIT_CAR_SERVICE",async(r,{dispatch:l})=>{try{l(w());const{data:t,status:s}=await I.put("kill_house_driver/0/",r);return l(j()),{data:t,status:s}}catch(t){return l(j()),{error:t.response.data.result}}}),Fu=uu({driver_mobile:E().required("شماره موبایل راننده الزامی است"),last_name:E().required("نام خانوادگی الزامی است"),first_name:E().required("نام الزامی است"),city_name:E().required("نام شهر الزامی است"),type_car:E().required("نوع خودرو الزامی است"),pelak:E().required("پلاک الزامی است"),capocity:E().required("ظرفیت الزامی است"),health_code:E().required("کد سلامت الزامی است")}),eu=({first_name:r,last_name:l,driver_mobile:t,city_name:s,type_car:h,pelak:x,capocity:i,health_code:A,driverKey:o,type:a})=>{const c=V(),[p]=m.useContext(M),{provinceGetCities:b}=W(n=>n.provinceSlice),e=Z({initialValues:{driver_mobile:t,last_name:l,first_name:r,city_name:s,type_car:h,pelak:"",capocity:i,health_code:A,type:a||"exclusive"},validationSchema:Fu,onSubmit:n=>{d()}}),[f,C]=m.useState([]);m.useEffect(()=>{if(x){const n=x.split(" ");C(n)}},[x]),m.useEffect(()=>{e.setFieldValue("pelak",f.length?f.join(" ").trim():"")},[f]);const d=()=>{const{values:n,errors:T}=e;T!=null&&T.length||(o?c(fu({driver_mobile:n.driver_mobile,last_name:n.last_name,first_name:n.first_name,city_name:n.city_name,type_car:n.type_car,pelak:f.join(" "),capocity:n.capocity,health_code:n.health_code,role:y(),driver_key:o,type:n.type})).then(g=>{g.payload.error?p({vertical:"top",horizontal:"center",msg:g.payload.error,severity:"error"}):(c(B()),c(k({right:!1,bottom:!1,content:null})),p({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}):c(ju({driver_mobile:n.driver_mobile,last_name:n.last_name,first_name:n.first_name,city_name:n.city_name,type_car:n.type_car,pelak:f.join(" "),capocity:n.capocity,health_code:n.health_code,role:y(),type:n.type})).then(g=>{g.payload.error?p({vertical:"top",horizontal:"center",msg:g.payload.error,severity:"error"}):(c(B()),c(k({right:!1,bottom:!1,content:null})),p({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}))},F=(n,T,g,z)=>{C([n,T,g,z])};return m.useEffect(()=>{c(pu()).then(n=>e.setFieldValue("city_name",s))},[]),u.jsx("form",{onSubmit:e.handleSubmit,children:u.jsxs(_,{container:!0,spacing:2,children:[u.jsx(_,{item:!0,xs:12,children:u.jsx(S,{fullWidth:!0,children:u.jsx(P,{id:"first_name",name:"first_name",label:"نام",value:e.values.first_name,onChange:e.handleChange,onBlur:e.handleBlur,error:e.touched.first_name&&!!e.errors.first_name,helperText:e.touched.first_name&&e.errors.first_name})})}),u.jsx(_,{item:!0,xs:12,children:u.jsx(S,{fullWidth:!0,children:u.jsx(P,{id:"last_name",name:"last_name",label:"نام خانوادگی",value:e.values.last_name,onChange:e.handleChange,onBlur:e.handleBlur,error:e.touched.last_name&&!!e.errors.last_name,helperText:e.touched.last_name&&e.errors.last_name})})}),u.jsx(_,{item:!0,xs:12,children:u.jsx(S,{fullWidth:!0,children:u.jsx(P,{id:"driver_mobile",name:"driver_mobile",label:"شماره موبایل راننده",value:e.values.driver_mobile,onChange:e.handleChange,onBlur:e.handleBlur,error:e.touched.driver_mobile&&!!e.errors.driver_mobile,helperText:e.touched.driver_mobile&&e.errors.driver_mobile})})}),(b==null?void 0:b.length)&&u.jsx(_,{item:!0,xs:12,children:u.jsxs(S,{fullWidth:!0,children:[u.jsx(q,{id:"demo-simple-select-label",children:"شهر"}),u.jsxs(G,{id:"city_name",name:"city_name",onChange:e.handleChange,label:"شهر",onBlur:e.handleBlur,value:e.values.city_name,error:e.touched.city_name&&!!e.errors.city_name,renderValue:n=>n||"نام شهر",children:[u.jsx(v,{value:"",disabled:!0,children:"نام شهر"}),b.map(n=>u.jsx(v,{value:n.name,children:n.name},n.id))]}),e.touched.city_name&&e.errors.city_name&&u.jsx(U,{error:!0,children:e.errors.city_name})]})}),u.jsx(_,{item:!0,xs:12,children:u.jsxs(S,{fullWidth:!0,children:[u.jsx(q,{id:"demo-simple-select-label",children:"نوع خودرو"}),u.jsxs(G,{id:"type_car",name:"type_car",label:"نوع خودرو",value:e.values.type_car,onChange:e.handleChange,onBlur:e.handleBlur,error:e.touched.type_car&&!!e.errors.type_car,renderValue:n=>n||"انتخاب نوع خودرو",children:[u.jsx(v,{value:"",disabled:!0,children:"انتخاب نوع خودرو"}),u.jsx(v,{value:"ایسوزو",children:"ایسوزو"}),u.jsx(v,{value:"نیسان",children:"نیسان"}),u.jsx(v,{value:"وانت",children:"وانت"}),u.jsx(v,{value:"اف ام",children:"اف ام"}),u.jsx(v,{value:"کامیون",children:"کامیون"}),u.jsx(v,{value:"هیوندا کروس",children:"هیوندا کروس"}),u.jsx(v,{value:"بادسان",children:"بادسان"}),u.jsx(v,{value:"هیوندا",children:"هیوندا"}),u.jsx(v,{value:"کامیونت ایسوزو",children:"کامیونت ایسوزو"}),u.jsx(v,{value:"خاور بنز",children:"خاور بنز"})]}),e.touched.type_car&&e.errors.type_car&&u.jsx(U,{error:!0,children:e.errors.type_car})]})}),u.jsx(_,{item:!0,xs:12,alignItems:"center",justifyContent:"center",children:u.jsx(yu,{width:"100%",pelakState:f,handleChange:F})}),u.jsx(_,{item:!0,xs:12,children:u.jsx(S,{fullWidth:!0,children:u.jsx(P,{id:"capocity",name:"capocity",label:"ظرفیت",type:"number",InputProps:{endAdornment:u.jsx(au,{position:"start",children:"کیلوگرم"})},value:e.values.capocity,onChange:e.handleChange,onBlur:e.handleBlur,error:e.touched.capocity&&!!e.errors.capocity,helperText:e.touched.capocity&&e.errors.capocity})})}),u.jsx(_,{item:!0,xs:12,children:u.jsx(S,{fullWidth:!0,children:u.jsx(P,{id:"health_code",name:"health_code",label:"کد بهداشتی",value:e.values.health_code,onChange:e.handleChange,onBlur:e.handleBlur,error:e.touched.health_code&&!!e.errors.health_code,helperText:e.touched.health_code&&e.errors.health_code})})}),u.jsxs(_,{item:!0,xs:12,children:[u.jsx(D,{children:"ماهیت خودرو"}),u.jsx(S,{component:"fieldset",disabled:y()==="ProvinceOperator"||y()==="SuperAdmin"||y()==="AdminX"?!1:a?a==="rental":!1,children:u.jsxs(lu,{name:"type",value:e.values.type,onChange:e.handleChange,children:[(y()==="ProvinceOperator"||y()==="SuperAdmin"||y()==="AdminX")&&u.jsx(X,{value:"rental",control:u.jsx(Y,{}),label:u.jsx(_,{container:!0,children:u.jsxs(D,{children:["اجاره ای"," ",u.jsx(D,{variant:"caption",children:"(نمایش برای تمام کشتارگاه ها)"})]})})}),u.jsx(X,{value:"exclusive",control:u.jsx(Y,{}),label:"اختصاصی"})]})})]}),u.jsx(_,{item:!0,xs:12,children:u.jsx(N,{fullWidth:!0,variant:"contained",color:"primary",type:"submit",children:"ارسال"})})]})})},gu=L("PROVINCE_REMOVE_CAR",async r=>{const{data:l,status:t}=await I.delete("kill_house_driver/0/?key="+r);return{data:l,status:t}}),bu=L("PROVINCE_ADD_CAR_TO_KILLHOUSE_SERVICE",async(r,{dispatch:l})=>{try{l(w());const{data:t,status:s}=await I.post("kill_house_add_car/",{...r,role:y()});return l(j()),{data:t,status:s}}catch(t){return l(j()),{error:t.response.data.result}}}),Eu=L("PROVINCE_REMOVE_CAR_FROM_KILLHOUSE_SERVICE",async(r,{dispatch:l})=>{try{l(w());const{data:t,status:s}=await I.delete("kill_house_add_car/0/",{params:r});return l(j()),{data:t,status:s}}catch(t){return l(j()),{error:t.response.data.result}}}),Su=uu().shape({autocompleteField:E().required("This field is required")}),ku=({killHouseList:r,driverKey:l})=>{const[t]=m.useContext(M),s=Z({initialValues:{autocompleteField:""},validationSchema:Su,onSubmit:o=>{if(!(o!=null&&o.autocompleteField)||!l){t({vertical:"top",horizontal:"center",msg:"لطفا تمام فیلدها را پر کنید",severity:"error"});return}h(bu({kill_house_key:o.autocompleteField,driver_key:l})).then(a=>{var c;(c=a==null?void 0:a.payload)!=null&&c.error?t({vertical:"top",horizontal:"center",msg:a.payload.error,severity:"error"}):(h(B()),h(k({right:!1,bottom:!1,content:null})),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}),h=V(),[x,i]=m.useState([]),{provinceGetOnlyKillHouses:A}=W(o=>o.provinceSlice);return m.useEffect(()=>{y()==="KillHouse"?h(J("self_kill_houses")):h(J("role=ProvinceOperator"))},[]),m.useEffect(()=>{if(!A||!Array.isArray(A)){i([]);return}const o=A.map(a=>{if(!a)return null;let c;return a.killer?c="کشتارکن":c="کشتارگاه",{title:`${c} ${(a==null?void 0:a.name)||""}`,value:(a==null?void 0:a.key)||""}}).filter(a=>a!==null&&a.value);i(o||[])},[A]),u.jsxs(R,{children:[u.jsx("form",{onSubmit:s.handleSubmit,children:u.jsxs(R,{container:!0,direction:"column",gap:O.TINY,mb:O.SMALL,children:[u.jsx(ou,{id:"autocompleteField",options:x||[],getOptionLabel:o=>(o==null?void 0:o.title)||"",renderInput:o=>u.jsx(P,{...o,label:"انتخاب کشتارگاه",variant:"outlined",fullWidth:!0,error:s.touched.autocompleteField&&!!s.errors.autocompleteField,helperText:s.touched.autocompleteField&&s.errors.autocompleteField}),onChange:(o,a)=>s.setFieldValue("autocompleteField",(a==null?void 0:a.value)||""),value:x==null?void 0:x.find(o=>o.value===s.values.autocompleteField)}),u.jsx(N,{fullWidth:!0,variant:"contained",type:"submit",children:"ثبت"})]})}),u.jsx(D,{variant:"body1",fontWeight:"bold",children:"کشتارگاه های خودرو"}),r&&Array.isArray(r)&&r.length>0?r.map((o,a)=>o?u.jsxs(R,{container:!0,gap:O.TINY,alignItems:"center",justifyContent:"space-between",style:{borderBottom:"1px solid #DDD"},children:[u.jsxs(D,{children:[a+1,". ",(o==null?void 0:o.killHouseName)||""]}),u.jsx(N,{color:"error",onClick:()=>{if(!(o!=null&&o.killHouseKey)||!l){t({vertical:"top",horizontal:"center",msg:"اطلاعات ناقص است",severity:"error"});return}h(Eu({kill_house_key:o.killHouseKey,driver_key:l})).then(c=>{var p;(p=c==null?void 0:c.payload)!=null&&p.error?t({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(h(B()),h(k({right:!1,bottom:!1,content:null})),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"حذف"})]},o.killHouseKey||a):null):null]})},Ru=L("UPDATE_CAR_STATE_SERVICE",async(r,{dispatch:l})=>{try{l(w());const{data:t,status:s}=await I.put("kill_house_driver/0/",r);return l(j()),{data:t,status:s}}catch(t){return l(j()),{error:t.response.data.result}}}),Iu=({item:r})=>{const[l]=m.useContext(M),t=V(),[s,h]=m.useState(y()==="KillHouse"?r.addCarActiveState:r.driverActiveState),x=A=>{let o;y()==="KillHouse"?o={add_car_key:r.addCarKey,add_car_change_activation:A.target.checked}:o={driver_key:r.key,change_activation:A.target.checked},t(Ru(o)).then(a=>{var c,p;(c=a==null?void 0:a.payload)!=null&&c.error?l({vertical:"top",horizontal:"center",msg:(p=a==null?void 0:a.payload)==null?void 0:p.error,severity:"error"}):(t(B()),l({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}),h(A.target.checked)};let i=!1;return r.driverType==="rental"&&(i=!0),u.jsxs(u.Fragment,{children:[u.jsx(nu,{checked:s,onChange:x,name:"mySwitch",color:"primary",disabled:i}),s?u.jsx("label",{htmlFor:"mySwitch",children:"فعال"}):u.jsx("label",{htmlFor:"mySwitch",children:"غیرفعال"})]})},Tu=L("CARS_DASHBOARD",async(r,{dispatch:l})=>{l(w());const{data:t,status:s}=await I.get("kill_house_driver_total_dashboard",{params:{role:y()}});return l(j()),{data:t,status:s}}),Bu=()=>{var a,c,p,b,e,f;const r=V(),[l,t]=m.useState([]),[s]=m.useContext(M),{provinceCars:h}=W(C=>C.provinceSlice),x=W(C=>C.userSlice.userProfile.key);m.useEffect(()=>{r(B())},[]);const[i,A]=m.useState([]);m.useEffect(()=>{r(Tu()).then(C=>{A(C.payload.data)})},[r,h]),m.useEffect(()=>{const C=h==null?void 0:h.map((d,F)=>{var g;let n="-";d.type==="rental"?n="اجاره ای":d.type==="exclusive"&&(n="اختصاصی");const T=d.type==="rental"?"همه کشتارگاه ها/کشتارکن ها":(g=d==null?void 0:d.killHouseList)==null?void 0:g.map((z,ru)=>{const tu=ru+1===d.killHouseList.length?"":" - ";return(z==null?void 0:z.killHouseName)+tu});return[F+1,d.typeCar,n,d.pelak,d.capocity,parseInt(d.healthCode),d.driverName,d.driverMobile,T,u.jsx(Iu,{item:d},d.key),u.jsx(wu,{item:d,openNotif:s},`car-action-${d.key}`)]});t(C)},[h,r,s]);const[o]=m.useState(["ردیف","مدل خودرو","ماهیت","پلاک","ظرفیت","کد بهداشتی","نام راننده","موبایل راننده","کشتارگاه ها/کشتارکن ها","وضعیت","عملیات"]);return u.jsx(u.Fragment,{children:u.jsxs(R,{container:!0,alignItems:"center",justifyContent:"space-between",gap:O.SMALL,xs:12,children:[u.jsx(N,{variant:"contained",onClick:()=>{r(k({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"افزودن خودرو",content:u.jsx(eu,{})}))},children:"افزودن خودرو"}),u.jsx(su,{title:"خروجی اکسل",children:u.jsx("a",{href:`${I.defaults.baseURL}car_province_excel/?key=${x}&role=${y()}`,rel:"noreferrer",children:u.jsx(N,{color:"success",children:u.jsx(xu,{size:32})})})}),u.jsxs(iu,{sx:{width:"100%"},children:[u.jsx(R,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(Q,{noPagination:!0,isDashboard:!0,columns:["تعداد خودرو ها","اختصاصی","اجاره ای","فعال","غیر فعال","معلق"],data:[[(a=i==null?void 0:i.total)==null?void 0:a.toLocaleString(),(c=i==null?void 0:i.exclusive)==null?void 0:c.toLocaleString(),(p=i==null?void 0:i.rental)==null?void 0:p.toLocaleString(),(b=i==null?void 0:i.active)==null?void 0:b.toLocaleString(),(e=i==null?void 0:i.inactive)==null?void 0:e.toLocaleString(),(f=i==null?void 0:i.suspended)==null?void 0:f.toLocaleString()]],title:"خلاصه اطلاعات"})}),u.jsx(Q,{paginated:!0,title:"خودروها",columns:o,data:l})]})]})})},wu=({item:r,openNotif:l})=>{var d;const t=V(),[s,h]=m.useState(null),x=!(y()==="ProvinceOperator"||y()==="SuperAdmin"||y()==="AdminX"),i=(d=r.killHouseList)==null?void 0:d.some(F=>!F.allowState),A=!x||!i,o=r.type==="rental",a=!!s,c=a?`province-cars-popover-${r.key}`:void 0,p=()=>h(null),b=()=>{p(),t(k({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"تخصیص/حذف کشتارگاه",content:u.jsx(ku,{driverKey:r.key,killHouseList:r.killHouseList})}))},e=()=>{p(),t(k({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ویرایش خودرو",content:u.jsx(eu,{first_name:r.firstName,pelak:r.pelak,city_name:r.city,type_car:r.typeCar,last_name:r.lastName,capocity:r.capocity,health_code:r.healthCode,driver_mobile:r.driverMobile,driverKey:r==null?void 0:r.key,type:r==null?void 0:r.type})}))},f=()=>{p(),t(w()),t(gu(r.key)).then(F=>{F.error?F.error.message.includes("403")?l({vertical:"top",horizontal:"center",msg:"امکان حذف بدلیل تخصیص بار فعال به خودرو وجود ندارد!",severity:"error"}):l({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(t(k({right:!1,bottom:!1,content:null})),t(B()),l({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})),t(j())})},C=!A||x&&o;return u.jsxs("div",{children:[u.jsx(cu,{"aria-describedby":c,color:"primary",size:"small",onClick:F=>h(F.currentTarget),disabled:!A,children:u.jsx(Au,{})}),u.jsx(du,{id:c,anchorEl:s,open:a,onClose:p,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},disableRestoreFocus:!0,PaperProps:{sx:{p:2}},children:u.jsxs(hu,{sx:{py:0},children:[u.jsxs(K,{onClick:b,disabled:C,children:[u.jsx(H,{children:u.jsx(mu,{fontSize:"small",color:C?"disabled":"primary"})}),u.jsx($,{primary:"تخصیص به کشتارگاه",primaryTypographyProps:{variant:"body2",color:C?"text.secondary":"primary"}})]}),u.jsxs(K,{onClick:e,disabled:C,children:[u.jsx(H,{children:u.jsx(vu,{fontSize:"small",color:C?"disabled":"primary"})}),u.jsx($,{primary:"ویرایش",primaryTypographyProps:{variant:"body2",color:C?"text.secondary":"primary"}})]}),u.jsxs(K,{onClick:f,disabled:C,children:[u.jsx(H,{children:u.jsx(_u,{fontSize:"small",color:C?"disabled":"error"})}),u.jsx($,{primary:"حذف",primaryTypographyProps:{variant:"body2",color:C?"text.secondary":"error"}})]})]})})]})},Gu=()=>u.jsx(Cu,{display:"flex",justifyContent:"center",children:u.jsx(R,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,my:O.MEDIUM,children:u.jsx(R,{container:!0,justifyContent:"space-between",gap:O.SMALL,children:u.jsx(R,{xs:12,children:u.jsx(Bu,{})})})})});export{Gu as default}; diff --git a/build/assets/CarPelak-BYFY8OXg.js b/build/assets/CarPelak-BYFY8OXg.js new file mode 100644 index 0000000..82114da --- /dev/null +++ b/build/assets/CarPelak-BYFY8OXg.js @@ -0,0 +1 @@ +import{j as u,ak as t,ag as j,aw as g,ax as e,p as d}from"./mui-vendor-CkIVaoQP.js";import{u as A,c as m,M as a,b as h,G as s,S as y}from"./index-CeyyVc1v.js";import{r as c}from"./react-vendor-CmFgShSM.js";const f="/assets/pelak-B4AqLCaJ.jpg",E=({handleChange:p,pelakState:n,pelakInitial:l})=>{const r=A({initialValues:{driver_name:"",driver_mobile:"",type_car:"ایسوزو",type_weight:"سنگین",capocity:"",pelak1:l!=null&&l.split(" ")[0]?l==null?void 0:l.split(" ")[0]:"",pelak2:l!=null&&l.split(" ")[1]?l==null?void 0:l.split(" ")[1]:"",pelak3:l!=null&&l.split(" ")[2]?l==null?void 0:l.split(" ")[2]:"",pelak4:l!=null&&l.split(" ")[3]?l==null?void 0:l.split(" ")[3]:""},validationSchema:m({driver_name:a().matches(/^[ض‌ص‌ث‌ق‌ف‌غ‌ع‌ه‌خ‌خ‌ح‌ج‌چ‌ش‌س‌ی‌ب‌ل‌ا‌ت‌ن‌ن‌م‌ک‌گ‌ظ‌ط‌ز‌ر‌ذ‌د‌و‌پ‌آ‌ژ ]+$/,"فقط حروف فارسی وارد کنید").required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),driver_mobile:a().test("len","شماره تلفن باید با 0 شروع شود",(o,C)=>C.originalValue&&C.originalValue.startsWith("0")).test("len","شماره تماس 11 رقم باید باشد",(o,C)=>{if(C.originalValue)return C.originalValue.length===11}).required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),type_weight:a().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),capocity:a().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),pelak1:h().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),pelak2:a().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),pelak3:h().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),pelak4:h().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),name:a().typeError("لطفا فیلد را به درستی وارد کنید!")})}),[x,i]=c.useState(!0);return c.useEffect(()=>{if(n!=null&&n.length&&x){i(!1);const[o,C,v,F]=n;r.setFieldValue("pelak1",o),r.setFieldValue("pelak2",C),r.setFieldValue("pelak3",v),r.setFieldValue("pelak4",F)}},[n]),c.useEffect(()=>{p(r.values.pelak1?r.values.pelak1:"",r.values.pelak2?r.values.pelak2:"",r.values.pelak3?r.values.pelak3:"",r.values.pelak4?r.values.pelak4:"")},[r.values.pelak1,r.values.pelak2,r.values.pelak3,r.values.pelak4]),u.jsxs(s,{container:!0,alignItems:"center",px:y.TINY,width:"270px",height:"57px",sx:{background:`url(${f})`,backgroundSize:"cover"},children:[u.jsx(s,{mt:1,children:u.jsx(t,{sx:{width:"40px"},variant:"outlined",id:"pelak1",value:r.values.pelak1,onChange:r.handleChange,inputProps:{maxLength:2,style:{textAlign:"center",fontSize:24,fontWeight:"bold",padding:0}}})}),u.jsxs(s,{container:!0,alignItems:"center",gap:1.5,pl:.5,pt:.5,children:[u.jsx(s,{container:!0,ml:1,children:u.jsx(s,{children:u.jsx(t,{sx:{width:"60px"},variant:"outlined",value:r.values.pelak2,id:"pelak2",onChange:r.handleChange,inputProps:{maxLength:3,style:{textAlign:"center",fontSize:24,fontWeight:"bold",padding:0}}})})}),u.jsx(s,{children:u.jsx(j,{variant:"outlined",children:u.jsxs(g,{SelectDisplayProps:{style:{paddingTop:0,paddingBottom:0,width:"10px"}},sx:{textAlign:"center",fontSize:24,fontWeight:"bold"},labelId:"demo-simple-select-label",id:"pelak3",name:"pelak3",value:r.values.pelak3,onChange:r.handleChange,error:r.touched.pelak3?!!r.errors.pelak3:null,onBlur:r.handleBlur,helperText:r.touched.pelak3&&r.errors.pelak3?r.errors.pelak3:null,children:[u.jsx(e,{value:"الف",children:"الف"}),u.jsx(e,{value:"ب",children:"ب"}),u.jsx(e,{value:"پ",children:"پ"}),u.jsx(e,{value:"ت",children:"ت"}),u.jsx(e,{value:"ث",children:"ث"}),u.jsx(e,{value:"ج",children:"ج"}),u.jsx(e,{value:"چ",children:"چ"}),u.jsx(e,{value:"ح",children:"ح"}),u.jsx(e,{value:"خ",children:"خ"}),u.jsx(e,{value:"د",children:"د"}),u.jsx(e,{value:"ر",children:"ر"}),u.jsx(e,{value:"ز",children:"ز"}),u.jsx(e,{value:"ژ",children:"ژ"}),u.jsx(e,{value:"س",children:"س"}),u.jsx(e,{value:"ش",children:"ش"}),u.jsx(e,{value:"ص",children:"ص"}),u.jsx(e,{value:"ض",children:"ض"}),u.jsx(e,{value:"ط",children:"ط"}),u.jsx(e,{value:"ظ",children:"ظ"}),u.jsx(e,{value:"ع",children:"ع"}),u.jsx(e,{value:"غ",children:"غ"}),u.jsx(e,{value:"ف",children:"ف"}),u.jsx(e,{value:"ق",children:"ق"}),u.jsx(e,{value:"ک",children:"ک"}),u.jsx(e,{value:"گ",children:"گ"}),u.jsx(e,{value:"ل",children:"ل"}),u.jsx(e,{value:"م",children:"م"}),u.jsx(e,{value:"ن",children:"ن"}),u.jsx(e,{value:"و",children:"و"}),u.jsx(e,{value:"ه",children:"ه"}),u.jsx(e,{value:"ی",children:"ی"})]})})}),u.jsx(s,{container:!0,children:u.jsx(s,{children:u.jsx(t,{sx:{width:"40px"},variant:"outlined",id:"pelak4",value:r.values.pelak4,onChange:r.handleChange,inputProps:{maxLength:2,style:{textAlign:"center",fontSize:24,fontWeight:"bold",padding:0}}})})})]})]})};E.propTypes={pelak1:d.PropTypes.number,pelak2:d.PropTypes.number,pelak3:d.PropTypes.number,pelak4:d.PropTypes.number,handleChange:d.PropTypes.any};export{E as C}; diff --git a/build/assets/ChainBarManagement-BxgsJV2X.js b/build/assets/ChainBarManagement-BxgsJV2X.js new file mode 100644 index 0000000..e6bc523 --- /dev/null +++ b/build/assets/ChainBarManagement-BxgsJV2X.js @@ -0,0 +1 @@ +import{j as r,T as g,am as Yu,ak as j,ag as wu,bi as Gu,ah as Ku,ai as $u,aj as Nu,av as Uu,aw as Xu,ax as Qu,B as z,I as xu,b0 as Zu,an as Ju,b4 as mu,ap as u0,aq as e0,a3 as gu,d as Fu,p as fu,b2 as r0,b3 as Su}from"./mui-vendor-CkIVaoQP.js";import{r as C,b as Bu,f as a0}from"./react-vendor-CmFgShSM.js";import{L as V,j as T,X as b,db as Ru,h as k,A as G,u as Iu,c as qu,M as L,b as Du,v as iu,G as y,W as ju,S as vu,N as P,O as Hu,C as Au,p as Mu,Q as l0,E as n0,an as o0,az as s0,fr as t0}from"./index-CeyyVc1v.js";import{a as K,u as U,f as c0}from"./redux-vendor-B7uoacJt.js";import{R as C0,a as Ou}from"./index.esm-Bu7XMDZU.js";import{R as d0}from"./ResponsiveTable-w7hk7Uq8.js";import{d as ku}from"./Edit-CqBj1Y2L.js";import{d as h0}from"./Settings-BckUi175.js";import{d as i0}from"./Tune-D4M2CAhp.js";import{d as v0}from"./Delete-C5MyLelE.js";import{C as p0}from"./CarPelak-BYFY8OXg.js";import{d as y0}from"./Pageview-TRcW_9jm.js";import{d as x0}from"./AddCircleOutline-C8LXM-k8.js";const Tu=K("PROVINCE_CREATE_ALLOCATION",async(e,{dispatch:n})=>{try{n(V());const{data:l,status:o}=await T.post("chain-allocation/",{...e,role:b()});return n(Ru()),n(k()),{data:l,status:o}}catch(l){return n(k()),{error:l.response.data.result}}}),g0=K("PROVINCE_GET_KILLHOUSES_FOR_ALLOCATION",async()=>{const{data:e,status:n}=await T.get("/kill_house/?kill_house=true");return{data:e,status:n}}),_u=K("PROVINCE_EDIT_CHAIN_ALLOCATION",async(e,{dispatch:n})=>{try{n(V());const{data:l,status:o}=await T.put("chain-allocation/0/",e);return n(Ru()),n(k()),{data:l,status:o}}catch(l){return n(k()),{error:l.response.data.result}}}),A0=({item:e,updateTable:n,isEdit:l})=>{var I,q,X,pu,Q,yu;const o=U(),[c]=C.useContext(G),[x,f]=Bu.useState(l?e!=null&&e.outProvince?"out":"native":"out"),[v,F]=Bu.useState();C.useEffect(()=>{x==="native"&&(o(V()),o(g0()).then(t=>{o(k());const _=t==null?void 0:t.payload.data.map(O=>({name:O.name,key:O.key}));A(_),F("")}))},[x]);const[E,A]=C.useState([]),w=t=>{f(t.target.value)},[h,N]=C.useState([]),S=(t,_,O,Z)=>{N([t,_,O,Z])},a=Iu({initialValues:{weight:l?e==null?void 0:e.indexWeight:"",quantity:l?e==null?void 0:e.quantity:"",driverName:l?e==null?void 0:e.driverName:"",driverMobile:l?e==null?void 0:e.driverMobile:"",driverCar:l?e==null?void 0:e.typeCar:"",healthCode:l?e==null?void 0:e.healthCode:""},validationSchema:qu({weight:Du().required("این فیلد اجباری است!"),quantity:Du().required("این فیلد اجباری است!"),driverName:L().required("این فیلد اجباری است!"),healthCode:L().required("این فیلد اجباری است!"),driverMobile:L().required("شماره موبایل کشتارگاه الزامی است").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),driverCar:L().required("این فیلد اجباری است!")})}),[,,d,$,,]=C.useContext(G);C.useEffect(()=>{const t=iu(new Date).format("YYYY-MM-DD");$(t)},[]);const s=Iu({initialValues:{name:l?e==null?void 0:e.buyerName:"",mobile:l?e==null?void 0:e.buyerMobile:"",province:l?e==null?void 0:e.province:"",city:l?e==null?void 0:e.city:""},validationSchema:qu({name:L().required("نام اجباری است"),mobile:L().required("شماره موبایل کشتارگاه الزامی است").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),province:L().required("استان اجباری است"),city:L().required("شهرستان اجباری است")})});C.useEffect(()=>{a.validateForm(),s.validateForm()},[]);const B=()=>x==="native"?a.isValid&&v&&h[1]:a.isValid&&s.isValid&&h[1];return C.useEffect(()=>{let t=a.values.weight;const _=a.values.weight.toString().split(".").join("");a.values.weight&&_.length<=3&&(_.length===2&&(t=_[0]+"."+_[1]),_.length===3&&(t=_[0]+"."+_[1]+_[2])),isNaN(Number.parseFloat(t))?a.setFieldValue("weight",""):a.setFieldValue("weight",Number.parseFloat(t))},[a.values.weight]),r.jsxs(y,{container:!0,xs:12,alignItems:"center",justifyContent:"center",gap:2,children:[!l&&r.jsxs(r.Fragment,{children:[r.jsxs(y,{container:!0,xs:12,children:[r.jsxs(g,{variant:"body2",children:["شرکت زنجیره:","‌‌ ‌"]}),r.jsx(g,{variant:"body2",style:{color:"gray"},children:e==null?void 0:e.companyName})]}),r.jsxs(y,{container:!0,xs:12,children:[r.jsxs(g,{variant:"body2",children:["مرغدار:","‌‌ ‌"]}),r.jsxs(g,{variant:"body2",style:{color:"gray"},children:[e.poultry.userprofile.fullName," (",e.poultry.userprofile.mobile,")"]})]}),r.jsxs(y,{container:!0,xs:12,children:[r.jsxs(g,{variant:"body2",children:["نژاد:","‌‌ ‌"]}),r.jsx(g,{variant:"body2",style:{color:"gray"},children:e.chickenBreed})]}),r.jsxs(y,{container:!0,xs:12,children:[r.jsxs(g,{variant:"body2",children:["سن جوجه:","‌‌ ‌"]}),r.jsx(g,{variant:"body2",style:{color:"gray"},children:e.age})]})]}),l&&r.jsxs(r.Fragment,{children:[r.jsxs(y,{container:!0,xs:12,children:[r.jsxs(g,{variant:"body2",children:["مرغدار:","‌‌ ‌"]}),r.jsxs(g,{variant:"body2",style:{color:"gray"},children:[(q=(I=e==null?void 0:e.poultryHatching)==null?void 0:I.poultry)==null?void 0:q.unitName," (",(Q=(pu=(X=e==null?void 0:e.poultryHatching)==null?void 0:X.poultry)==null?void 0:pu.user)==null?void 0:Q.mobile,")"]})]}),r.jsxs(y,{container:!0,xs:12,children:[r.jsxs(g,{variant:"body2",children:["شرکت زنجیره:","‌‌ ‌"]}),r.jsx(g,{variant:"body2",style:{color:"gray"},children:(yu=e==null?void 0:e.chainCompany)==null?void 0:yu.name})]})]}),r.jsx(Yu,{style:{width:"100%"}}),r.jsx(y,{xs:12,children:r.jsx(ju,{label:" تاریخ",id:"date",renderInput:t=>r.jsx(j,{...t}),value:d,onChange:t=>{$(iu(t).format("YYYY-MM-DD"))}})}),r.jsx(y,{xs:12,children:r.jsx(j,{id:"quantity",fullWidth:!0,label:"حجم (قطعه)",variant:"outlined",sx:{width:"100%"},value:a.values.quantity,error:a.touched.quantity?!!a.errors.quantity:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.quantity&&a.errors.quantity?a.errors.quantity:null})}),r.jsx(y,{xs:12,children:r.jsx(j,{id:"weight",fullWidth:!0,label:"میانگین وزن",variant:"outlined",sx:{width:"100%"},value:a.values.weight,error:a.touched.weight?!!a.errors.weight:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.weight&&a.errors.weight?a.errors.weight:null})}),a.values.weight&&a.values.quantity&&r.jsxs(y,{container:!0,style:{borderStyle:"solid",borderWidth:"2px",borderColor:"gray",borderRadius:"6px"},xs:12,p:1,children:[r.jsxs(g,{variant:"body2",color:"primary",children:["وزن کل: ","‌‌ ‌"]}),r.jsxs(g,{variant:"body2",children:[parseInt(a.values.quantity*a.values.weight)," کیلوگرم"]})]}),r.jsxs(wu,{children:[r.jsx(Gu,{id:"demo-controlled-radio-buttons-group",children:"نوع فروش"}),r.jsxs(Ku,{row:!0,"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:x,onChange:w,children:[r.jsx($u,{value:"out",control:r.jsx(Nu,{disabled:l}),label:"خارج استان"}),r.jsx($u,{value:"native",control:r.jsx(Nu,{disabled:l}),label:"درون استان"})]})]}),x==="out"?r.jsxs(y,{container:!0,xs:12,alignItems:"center",justifyContent:"center",gap:vu.SMALL,children:[r.jsx(g,{variant:"body1",children:"اطلاعات خریدار"}),r.jsx(j,{label:"نام و نام خانوادگی",name:"name",value:s.values.name,onChange:s.handleChange,onBlur:a.handleBlur,error:s.touched.name&&!!s.errors.name,helperText:s.touched.name&&s.errors.name,required:!0,fullWidth:!0}),r.jsx(j,{fullWidth:!0,id:"mobile",value:s.values.mobile,error:s.touched.mobile?!!s.errors.mobile:null,onChange:s.handleChange,onBlur:s.handleBlur,helperText:s.touched.mobile&&s.errors.mobile?s.errors.mobile:null,label:"موبایل",autoComplete:"current-password",variant:"outlined"}),r.jsx(j,{label:"استان",name:"province",value:s.values.province,onChange:s.handleChange,onBlur:a.handleBlur,error:s.touched.province&&!!s.errors.province,helperText:s.touched.province&&s.errors.province,required:!0,fullWidth:!0}),r.jsx(j,{label:"شهرستان",name:"city",value:s.values.city,onBlur:a.handleBlur,onChange:s.handleChange,error:s.touched.city&&!!s.errors.city,helperText:s.touched.city&&s.errors.city,required:!0,fullWidth:!0})]}):r.jsx(y,{xs:12,children:r.jsxs(wu,{fullWidth:!0,error:a.errors.selectedOption&&a.touched.selectedOption,children:[r.jsx(Uu,{children:"کشتارگاه را انتخاب کنید"}),r.jsx(Xu,{fullWidth:!0,label:"کشتارگاه را انتخاب کنید",id:"selectedKillhouse",name:"selectedKillhouse",onChange:t=>{const[_]=t.target.value.split("#");F(_)},onBlur:a.handleBlur,children:E==null?void 0:E.map(t=>r.jsx(Qu,{value:`${t.key+"#"+t.killer}`,children:`کشتارگاه ${t.name}`},t))}),a.errors.selectedKillhouse&&a.touched.selectedKillhouse&&r.jsx("div",{children:a.errors.selectedKillhouse})]})}),r.jsxs(y,{container:!0,xs:12,alignItems:"center",justifyContent:"center",gap:vu.SMALL,children:[r.jsx(g,{variant:"body1",children:"اطلاعات خودرو حمل"}),r.jsx(j,{label:"نام و نام خانوادگی راننده",name:"driverName",value:a.values.driverName,onChange:a.handleChange,onBlur:a.handleBlur,error:a.touched.driverName&&!!a.errors.driverName,helperText:a.touched.driverName&&a.errors.driverName?a.errors.driverName:null,required:!0,fullWidth:!0}),r.jsx(j,{fullWidth:!0,id:"driverMobile",value:a.values.driverMobile,error:a.touched.driverMobile?!!a.errors.driverMobile:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.driverMobile&&a.errors.driverMobile?a.errors.driverMobile:null,label:"موبایل راننده",autoComplete:"current-password",variant:"outlined"}),r.jsx(j,{label:"کد بهداشتی ",name:"healthCode",value:a.values.healthCode,onChange:a.handleChange,onBlur:a.handleBlur,error:a.touched.healthCode&&!!a.errors.healthCode,helperText:a.touched.healthCode&&a.errors.healthCode,type:"tel",required:!0,fullWidth:!0}),r.jsx(j,{label:"مدل خودرو",name:"driverCar",value:a.values.driverCar,onChange:a.handleChange,onBlur:a.handleBlur,error:a.touched.driverCar&&!!a.errors.driverCar,helperText:a.touched.driverCar&&a.errors.driverCar,type:"tel",required:!0,fullWidth:!0}),r.jsx(p0,{width:"100%",handleChange:S,pelakInitial:l?e==null?void 0:e.pelak:""})]}),r.jsx(z,{disabled:!B(),variant:"contained",fullWidth:!0,onClick:()=>{b()!=="SuperAdmin"&&b()!=="AdminX"&&(e.age>40&&a.values.weight<1.9||e.age>40&&a.values.weight>4||e.age<40&&a.values.weight<1.5||e.age<40&&a.values.weight>4||e.age>56&&a.values.weight<2.8||e.age>56&&a.values.weight>4)?c({vertical:"top",horizontal:"center",msg:(e==null?void 0:e.age)>56?"میانگین وزنی باید عددی بین 2.8 تا 4 کیلوگرم باشد!":(e==null?void 0:e.age)>40?"میانگین وزنی باید عددی بین 1.9 تا 4 کیلوگرم باشد!":"میانگین وزنی باید عددی بین 1.5 تا 4 باشد!",severity:"error"}):l?x==="native"?o(_u({chain_allcation_key:e==null?void 0:e.key,quantity:a.values.quantity,weight:parseInt(a.values.quantity*a.values.weight),index_weight:a.values.weight,date:d,out_province:!1,driver_name:a.values.driverName,driver_mobile:a.values.driverMobile,health_code:a.values.healthCode,type_car:a.values.driverCar,pelak:h[0]+" "+h[1]+" "+h[2]+" "+h[3],kill_house_key:v})).then(t=>{o(P({right:!1,bottom:!1,content:null})),t.payload.error?c({vertical:"top",horizontal:"center",msg:t.payload.error,severity:"error"}):(n(1),c({vertical:"top",horizontal:"center",msg:"بار با موفقیت ثبت شد؛ جهت مشاهده به بخش مدیریت بارها در همین صفحه مراجعه کنید",severity:"success"}))}):o(_u({chain_allcation_key:e==null?void 0:e.key,quantity:a.values.quantity,weight:parseInt(a.values.quantity*a.values.weight),index_weight:a.values.weight,date:d,out_province:!0,driver_name:a.values.driverName,driver_mobile:a.values.driverMobile,health_code:a.values.healthCode,type_car:a.values.driverCar,pelak:h[0]+" "+h[1]+" "+h[2]+" "+h[3],buyer_name:s.values.name,buyer_mobile:s.values.mobile,city:s.values.city,province:s.values.name})).then(t=>{o(P({right:!1,bottom:!1,content:null})),t.payload.error?c({vertical:"top",horizontal:"center",msg:t.payload.error,severity:"error"}):(n(1),c({vertical:"top",horizontal:"center",msg:"بار با موفقیت ثبت شد؛ جهت مشاهده به بخش مدیریت بارها در همین صفحه مراجعه کنید",severity:"success"}))}):x==="native"?o(Tu({hatching_key:e==null?void 0:e.key,quantity:a.values.quantity,weight:parseInt(a.values.quantity*a.values.weight),index_weight:a.values.weight,date:d,out_province:!1,driver_name:a.values.driverName,driver_mobile:a.values.driverMobile,health_code:a.values.healthCode,type_car:a.values.driverCar,pelak:h[0]+" "+h[1]+" "+h[2]+" "+h[3],kill_house_key:v})).then(t=>{o(P({right:!1,bottom:!1,content:null})),t.payload.error?c({vertical:"top",horizontal:"center",msg:t.payload.error,severity:"error"}):(n(),c({vertical:"top",horizontal:"center",msg:"بار با موفقیت ثبت شد؛ جهت مشاهده به بخش مدیریت بارها در همین صفحه مراجعه کنید",severity:"success"}))}):o(Tu({hatching_key:e==null?void 0:e.key,quantity:a.values.quantity,weight:parseInt(a.values.quantity*a.values.weight),index_weight:a.values.weight,date:d,out_province:!0,driver_name:a.values.driverName,driver_mobile:a.values.driverMobile,health_code:a.values.healthCode,type_car:a.values.driverCar,pelak:h[0]+" "+h[1]+" "+h[2]+" "+h[3],buyer_name:s.values.name,buyer_mobile:s.values.mobile,city:s.values.city,province:s.values.name})).then(t=>{o(P({right:!1,bottom:!1,content:null})),t.payload.error?c({vertical:"top",horizontal:"center",msg:t.payload.error,severity:"error"}):(n(),c({vertical:"top",horizontal:"center",msg:"بار با موفقیت ثبت شد؛ جهت مشاهده به بخش مدیریت بارها در همین صفحه مراجعه کنید",severity:"success"}))})},children:"ثبت"})]})},b0=({healthCode:e,item:n,updateTable:l})=>{const o=U(),[c]=C.useContext(G),x=()=>{o(Hu({title:"ویرایش کد بهداشتی",size:"auto",content:r.jsx(f0,{initialValue:e||"",onSubmit:f=>{o(_u({chain_allcation_key:n==null?void 0:n.key,health_code:f})).then(v=>{var F;(F=v.payload)!=null&&F.error?c({vertical:"top",horizontal:"center",msg:v.payload.error,severity:"error"}):(c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),l(),o(Au()))})},onCancel:()=>o(Au())})}))};return r.jsxs(y,{container:!0,alignItems:"center",gap:.5,sx:{width:"120px"},justifyContent:"center",children:[r.jsx(g,{variant:"caption",children:e||"-"}),r.jsx(xu,{"aria-label":"edit",size:"small",color:"primary",onClick:x,children:r.jsx(ku,{fontSize:"small"})})]})},f0=({initialValue:e,onSubmit:n,onCancel:l})=>{const[o,c]=C.useState(e);return r.jsxs(y,{container:!0,direction:"column",gap:2,minWidth:260,children:[r.jsx(j,{label:"کد بهداشتی",value:o,onChange:x=>c(x.target.value),fullWidth:!0,size:"small"}),r.jsxs(y,{container:!0,justifyContent:"flex-end",xs:12,gap:1,children:[r.jsx(z,{variant:"contained",color:"primary",onClick:()=>n(o),style:{flex:1},children:"ثبت"}),r.jsx(z,{style:{flex:1},variant:"outlined",color:"primary",onClick:l,children:"لغو"})]})]})},F0=K("PROVINCE_DELETE_CHAIN_ALLOCATION_SERVICE",async(e,{dispatch:n})=>{try{n(V());const{data:l,status:o}=await T.delete("chain-allocation/0/?chain_allcation_key="+e+`&role=${b()}`);return n(k()),{data:l,status:o}}catch(l){return n(k()),{error:l.response.data.result}}}),zu=K("PROVINCE_CHECK_CHAIN_ALLOCATION_SERVICE",async(e,{dispatch:n})=>{try{n(V());const{data:l,status:o}=await T.put("chain-allocation/0/",e);return n(k()),{data:l,status:o}}catch(l){return n(k()),{error:l.response.data.result}}}),j0=({item:e,fetchApiData:n})=>{var v,F,E,A,w,h,N,S,a,d,$,s,B;const l=U(),[o]=C.useContext(G),[c,x]=C.useState(""),f=I=>{x(I.target.value)};return r.jsxs(y,{container:!0,direction:"column",children:[r.jsxs(y,{children:[r.jsx(g,{variant:"h6",gutterBottom:!0,children:"اطلاعات مرغدار"}),r.jsxs(g,{variant:"subtitle1",gutterBottom:!0,children:["نام: ",(F=(v=e==null?void 0:e.poultryHatching)==null?void 0:v.poultry)==null?void 0:F.unitName," (",(w=(A=(E=e==null?void 0:e.poultryHatching)==null?void 0:E.poultry)==null?void 0:A.user)==null?void 0:w.mobile,")"]}),r.jsxs(g,{variant:"subtitle1",gutterBottom:!0,children:["شرکت زنجیره:"," ",`${(h=e==null?void 0:e.chainCompany)==null?void 0:h.name} (${(N=e==null?void 0:e.chainCompany)==null?void 0:N.user.mobile})`]}),r.jsxs(g,{variant:"subtitle1",gutterBottom:!0,children:["نوع تخصیص: ",e!=null&&e.outProvince?"خارج استان":"داخل استان"]}),r.jsxs(g,{variant:"subtitle1",gutterBottom:!0,children:["خریدار:"," ",(a=(S=e==null?void 0:e.killHouse)==null?void 0:S.killHouseOperator)!=null&&a.user.fullname?`${($=(d=e==null?void 0:e.killHouse)==null?void 0:d.killHouseOperator)==null?void 0:$.user.fullname} (${(B=(s=e==null?void 0:e.killHouse)==null?void 0:s.killHouseOperator)==null?void 0:B.user.mobile})`:`${e==null?void 0:e.buyerName} (${e==null?void 0:e.buyerMobile})`]})]}),r.jsxs(y,{container:!0,gap:vu.TINY,mt:vu.SMALL,children:[r.jsx(j,{label:"یادداشت",variant:"outlined",fullWidth:!0,multiline:!0,rows:4,value:c,onChange:f}),r.jsx(z,{style:{flex:.5},variant:"contained",color:"success",onClick:()=>{l(zu({chain_allcation_key:e==null?void 0:e.key,check_allocation:!0,state:"accepted"})).then(I=>{n(1),I.payload.error?o({vertical:"top",horizontal:"center",msg:I.payload.error,severity:"error"}):(l(P({right:!1,bottom:!1,content:null})),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),r.jsx(z,{style:{flex:.5},variant:"contained",color:"error",onClick:()=>{l(zu({chain_allcation_key:e==null?void 0:e.key,check_allocation:!0,state:"rejected"})).then(I=>{n(1),I.payload.error?o({vertical:"top",horizontal:"center",msg:I.payload.error,severity:"error"}):(l(P({right:!1,bottom:!1,content:null})),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"رد"})]})]})},_0=({item:e,fetchApiData:n})=>{const l=U(),[o]=C.useContext(G),[c,x]=C.useState(null),f=d=>{x(d.currentTarget)},v=()=>{x(null)},F=!!c,E=F?"popover":void 0,A=b(),w=()=>{v(),l(P({title:"تایید/ رد درخواست",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:r.jsx(j0,{item:e,fetchApiData:n})}))},h=()=>{v(),l(P({title:"ویرایش بار",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:r.jsx(A0,{item:e,updateTable:n,isEdit:!0})}))},N=()=>{v(),l(F0(e==null?void 0:e.key)).then(d=>{d.payload.error?o({vertical:"top",horizontal:"center",msg:d.payload.error,severity:"error"}):(o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),n(1))})},S=A==="ProvinceOperator"||A==="SuperAdmin"||A==="AdminX",a=[{key:"approve",label:"تایید / رد درخواست",color:"primary.main",icon:r.jsx(h0,{sx:{fontSize:{xs:20,md:18}}}),action:w,disabled:(e==null?void 0:e.state)!=="pending"},{key:"edit",label:"ویرایش بار",color:"info.main",icon:r.jsx(ku,{sx:{fontSize:{xs:20,md:18}}}),action:h,disabled:!S||(e==null?void 0:e.state)==="rejected"||!!(e!=null&&e.quarantineCode)},{key:"delete",label:"حذف بار",color:"error.main",icon:r.jsx(v0,{sx:{fontSize:{xs:20,md:18}}}),action:N,disabled:!S||(e==null?void 0:e.state)==="rejected"||!!(e!=null&&e.quarantineCode)}];return r.jsxs("div",{children:[r.jsx(xu,{"aria-describedby":E,variant:"contained",color:"primary",onClick:f,children:r.jsx(i0,{})}),r.jsx(Zu,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{mt:1}}},id:E,open:F,anchorEl:c,onClose:v,children:r.jsx(Ju,{sx:{p:1},children:a.map(d=>r.jsxs(mu,{onClick:()=>{d.disabled||d.action()},disabled:!!d.disabled,sx:{borderRadius:1,mb:.5,color:d.disabled?"text.disabled":d.color,"&:last-of-type":{mb:0}},children:[r.jsx(u0,{sx:{color:d.disabled?"text.disabled":d.color,minWidth:36},children:d.icon}),r.jsx(e0,{primary:r.jsx(g,{sx:{color:d.disabled?"text.disabled":d.color,fontWeight:600,fontSize:{xs:"13px",md:"14px"}},children:d.label})})]},d.key))})})]})},k0=K("PROVINCE_CHAINS_EDIT_BAR",async(e,{dispatch:n})=>{try{n(V());const{data:l,status:o}=await T.put("chain-allocation/0/",e);return n(k()),{data:l,status:o}}catch(l){return n(k()),{error:l.response.data.result}}}),Lu=({item:e,updateTable:n,isLocked:l})=>{const o=U(),[c]=C.useContext(G),x=()=>{o(Hu({title:"ثبت کد قرنطینه",size:"auto",content:r.jsx(w0,{code:e.quarantineCode||"",isLocked:l,onSubmit:f=>{o(k0({chain_allcation_key:e.key,quarantine_code:f,role:b()})).then(v=>{v.payload.error?c({vertical:"top",horizontal:"center",msg:v.payload.error,severity:"error"}):(c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),n(),o(Au()))})},onCancel:()=>o(Au())})}))};return r.jsxs(gu,{container:!0,alignItems:"center",gap:.5,sx:{width:e.quarantineCode?"160px":"auto",justifyContent:"center"},children:[e.quarantineCode?r.jsx(E0,{clearanceCode:e.quarantineCode}):r.jsx(xu,{"aria-label":"add",size:"small",color:"primary",onClick:x,children:r.jsx(x0,{fontSize:"small"})}),!l&&r.jsx(xu,{"aria-label":"edit",size:"small",color:"primary",onClick:x,sx:{display:e.quarantineCode?"inline-flex":"none"},children:r.jsx(ku,{fontSize:"small"})})]})},E0=({clearanceCode:e})=>{const n=C.useRef(null),l=()=>{n.current&&n.current.submit()};return r.jsxs(gu,{container:!0,alignItems:"center",justifyContent:"center",gap:.5,style:{width:"auto"},children:[r.jsx(Fu,{title:"مشاهده گواهینامه",arrow:!0,children:r.jsxs("form",{action:"https://e.ivo.ir/Rahgiri/Gidprnt.aspx",method:"post",target:"_blank",ref:n,style:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:[r.jsx("input",{name:"gid",type:"hidden",value:e}),r.jsx(y0,{color:"primary",onClick:l})]})}),r.jsx(g,{variant:"caption",color:"primary",children:e})]})},w0=({code:e,isLocked:n,onSubmit:l,onCancel:o})=>{const[c,x]=C.useState(e),[f,v]=C.useState("");C.useEffect(()=>{x(e)},[e]);const F=w=>w?/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]+$/.test(w)?(v(""),!0):(v("باید شامل اعداد و حروف انگلیسی باشد"),!1):(v("این فیلد اجباری است"),!1),E=w=>{const h=w.target.value.toUpperCase();x(h),F(h)},A=()=>{F(c)&&l(c)};return r.jsxs(gu,{container:!0,direction:"column",gap:2,children:[r.jsx(j,{label:"کد قرنطینه",value:c,onChange:E,size:"small",fullWidth:!0,error:!!f,helperText:f,InputProps:{readOnly:n}}),r.jsxs(gu,{container:!0,justifyContent:"flex-end",gap:1,xs:12,children:[r.jsx(z,{variant:"contained",color:"primary",onClick:A,disabled:n,style:{flex:1},children:"ثبت"}),r.jsx(z,{style:{flex:1},variant:"outlined",color:"primary",onClick:o,children:"لغو"})]})]})};Lu.propTypes={item:fu.PropTypes.any,updateTable:fu.PropTypes.any,isLocked:fu.PropTypes.any};const L0=({province:e})=>{const[n,,l,o,c,x]=C.useContext(G),f=U();C.useEffect(()=>{const p=iu(new Date).format("YYYY-MM-DD");o(p),x(p)},[]);const{pathname:v}=a0(),F=c0(p=>{var D,u;return(u=(D=p.userSlice)==null?void 0:D.userProfile)==null?void 0:u.key}),E=p=>{I(p.target.value)},[A,w]=C.useState(0),h=(p,D)=>{w(D)},[N,S]=C.useState([]),[a,d]=C.useState(0),[$,s]=C.useState(10),[B,I]=C.useState(""),[q,X]=C.useState(1),[pu,Q]=C.useState([]),[yu,t]=C.useState([]),[_,O]=C.useState(!1),Z=async p=>{var D,u,M;if(!_){f(V());try{const i=await T.get(`${e?e+"parent-company-":""}chain-allocation/?search=filter&value=${B}&page=${p}&page_size=${$}&role=${b()}&date1=${l}&date2=${c}${A===1?"&state=rejected":""}`);O(!1),S(((D=i.data)==null?void 0:D.results)||[]),d(((u=i.data)==null?void 0:u.count)||0)}catch(i){console.error("Error fetching data:",i);const R=(i==null?void 0:i.message)||"",H=(M=i==null?void 0:i.response)==null?void 0:M.status;R.includes("500")||H===500?(O(!0),n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),S([]),d(0)}finally{f(k())}}},Pu=p=>{Z(p),X(p)},Vu=p=>{s(p),X(1)},bu=()=>{Z(q!==0?q:1)};C.useEffect(()=>{if(!N||!Array.isArray(N)){Q([]),t([]);return}const p=N.map((u,M)=>{var i,R,H,W,J,m,uu,eu,ru,au,lu,nu,ou,su,tu,cu,Cu;return[q===1?M+1:M+$*(q-1)+1,r.jsx(_0,{fetchApiData:bu,item:u},M),(u==null?void 0:u.state)==="accepted"?"تایید شده":(u==null?void 0:u.state)==="pending"?"در انتظار تایید":"رد شده",u!=null&&u.date?Mu(u.date):"-",u!=null&&u.outProvince?"خارج استان":"داخل استان",`${((i=u==null?void 0:u.registerer)==null?void 0:i.fullname)||""} (${((R=u==null?void 0:u.registerer)==null?void 0:R.mobile)||""})`,(J=(W=(H=u==null?void 0:u.killHouse)==null?void 0:H.killHouseOperator)==null?void 0:W.user)!=null&&J.fullname?`${u.killHouse.killHouseOperator.user.fullname} (${((eu=(uu=(m=u==null?void 0:u.killHouse)==null?void 0:m.killHouseOperator)==null?void 0:uu.user)==null?void 0:eu.mobile)||""})`:`${(u==null?void 0:u.buyerName)||""} (${(u==null?void 0:u.buyerMobile)||""})`,`${((au=(ru=u==null?void 0:u.poultryHatching)==null?void 0:ru.poultry)==null?void 0:au.unitName)||""} (${((ou=(nu=(lu=u==null?void 0:u.poultryHatching)==null?void 0:lu.poultry)==null?void 0:nu.user)==null?void 0:ou.mobile)||""})`,`${((su=u==null?void 0:u.chainCompany)==null?void 0:su.name)||""} (${((cu=(tu=u==null?void 0:u.chainCompany)==null?void 0:tu.user)==null?void 0:cu.mobile)||""})`,r.jsxs(r.Fragment,{children:[" ",b()==="ParentCompany"?(u==null?void 0:u.healthCode)||"":r.jsx(b0,{healthCode:u==null?void 0:u.healthCode,item:u,updateTable:bu})]}),r.jsx(r.Fragment,{children:b()==="VetFarm"||b()==="ProvinceOperator"||b()==="SuperAdmin"||b()==="Supporter"||b()==="AdminX"||b()==="CityVet"||b()==="VetSupervisor"?r.jsxs(r.Fragment,{children:[r.jsx(Lu,{isLocked:b()==="ProvinceOperator"||b()==="VetSupervisor"?!1:!!((u==null?void 0:u.trash)===!0||u!=null&&u.quarantineQuantity),item:u,updateTable:bu}),(Cu=u==null?void 0:u.quarantineCodeRegisterar)!=null&&Cu.date?(()=>{var du,hu;try{const Y=new Date((du=u==null?void 0:u.registerar)==null?void 0:du.date);return isNaN(Y.getTime())?"":`${l0(Y,"yyyy/MM/dd")} ${((hu=u==null?void 0:u.quarantineCodeRegisterar)==null?void 0:hu.name)||""}`}catch(Y){return console.error("Error formatting quarantineCodeRegisterar date:",Y),""}})():""]}):u!=null&&u.quarantineCode?u.quarantineCode:"-"}),u!=null&&u.driverName?`${u.driverName} (${(u==null?void 0:u.driverMobile)||""})`:"-",(u==null?void 0:u.typeCar)||"",(u==null?void 0:u.pelak)||"",(u==null?void 0:u.quantity)||0,(u==null?void 0:u.indexWeight)||0,(u==null?void 0:u.weight)||0]});Q(p);const D=N.map((u,M)=>{var i,R,H,W,J,m,uu,eu,ru,au,lu,nu,ou,su,tu,cu,Cu,du,hu,Y;return[q===1?M+1:M+$*(q-1)+1,(u==null?void 0:u.state)==="rejected"?"رد شده":(u==null?void 0:u.state)==="deleted"?"حذف شده":"در انتظار تایید",u!=null&&u.remover?`${((i=u.remover)==null?void 0:i.fullname)||""} (${((R=u.remover)==null?void 0:R.mobile)||""})`:`${((H=u==null?void 0:u.registerer)==null?void 0:H.fullname)||""} (${((W=u==null?void 0:u.registerer)==null?void 0:W.mobile)||""})`,u!=null&&u.date?Mu(u.date):"-",u!=null&&u.outProvince?"خارج استان":"داخل استان",(J=u==null?void 0:u.registerer)!=null&&J.fullname?`${u.registerer.fullname} (${((m=u==null?void 0:u.registerer)==null?void 0:m.mobile)||""})`:"-",(ru=(eu=(uu=u==null?void 0:u.killHouse)==null?void 0:uu.killHouseOperator)==null?void 0:eu.user)!=null&&ru.fullname?`${u.killHouse.killHouseOperator.user.fullname} (${((nu=(lu=(au=u==null?void 0:u.killHouse)==null?void 0:au.killHouseOperator)==null?void 0:lu.user)==null?void 0:nu.mobile)||""})`:`${(u==null?void 0:u.buyerName)||""} (${(u==null?void 0:u.buyerMobile)||""})`,`${((su=(ou=u==null?void 0:u.poultryHatching)==null?void 0:ou.poultry)==null?void 0:su.unitName)||""} (${((Cu=(cu=(tu=u==null?void 0:u.poultryHatching)==null?void 0:tu.poultry)==null?void 0:cu.user)==null?void 0:Cu.mobile)||""})`,`${((du=u==null?void 0:u.chainCompany)==null?void 0:du.name)||""} (${((Y=(hu=u==null?void 0:u.chainCompany)==null?void 0:hu.user)==null?void 0:Y.mobile)||""})`,(u==null?void 0:u.healthCode)||"",(u==null?void 0:u.quarantineCode)||"",u!=null&&u.driverName?`${u.driverName} (${(u==null?void 0:u.driverMobile)||""})`:"-",(u==null?void 0:u.typeCar)||"",(u==null?void 0:u.pelak)||"",(u==null?void 0:u.quantity)||0,(u==null?void 0:u.indexWeight)||0,(u==null?void 0:u.weight)||0]});t(D)},[N,q,$]),C.useEffect(()=>{Z(1)},[f,l,c,$,A]),C.useEffect(()=>{O(!1)},[l,c,B,A]);const Eu=async p=>{var D,u,M;p.preventDefault(),O(!1),f(V());try{const i=await T.get(`${e?e+"parent-company-":""}chain-allocation/?search=filter&value=${B}&page=${q}&page_size=${$}&role=${b()}&date1=${l}&date2=${c}${A===1?"&state=rejected":""}`);O(!1),S(((D=i.data)==null?void 0:D.results)||[]),d(((u=i.data)==null?void 0:u.count)||0),f(k())}catch(i){console.error("Error fetching data:",i);const R=(i==null?void 0:i.message)||"",H=(M=i==null?void 0:i.response)==null?void 0:M.status;R.includes("500")||H===500?(O(!0),n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),S([]),d(0),f(k())}},Wu=r.jsx(y,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,xs:12,children:r.jsxs(y,{container:!0,alignItems:"center",gap:vu.SMALL,children:[r.jsx(y,{style:{width:"150px"},children:r.jsx(ju,{label:"از تاریخ",id:"date",renderInput:p=>r.jsx(j,{...p}),value:l,onChange:p=>{o(iu(p).format("YYYY-MM-DD"))}})}),r.jsx(y,{style:{width:"150px"},children:r.jsx(ju,{label:"تا تاریخ",id:"date",renderInput:p=>r.jsx(j,{...p}),value:c,onChange:p=>{x(iu(p).format("YYYY-MM-DD"))}})}),r.jsxs("form",{onSubmit:Eu,children:[r.jsx(j,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:E}),r.jsx(z,{type:"submit",onClick:Eu,endIcon:r.jsx(C0,{}),children:"جستجو"}),A===0?r.jsx(Fu,{title:"خروجی اکسل",children:r.jsx("a",{href:`${e||T.defaults.baseURL}bar_chain_excel/?key=${F||""}&role=${b()}&search=filter&value=${B||""}&state=accepted&date1=${l||""}&date2=${c||""}&search=filter&value=${B||""}`,rel:"noreferrer",children:r.jsx(z,{color:"success",children:r.jsx(Ou,{size:32})})})}):r.jsx(Fu,{title:"خروجی اکسل",children:r.jsx("a",{href:`${e||T.defaults.baseURL}bar_chain_excel/?key=${F||""}&role=${b()}&search=filter&value=${B||""}&state=rejected&date1=${l||""}&date2=${c||""}&search=filter&value=${B||""}`,rel:"noreferrer",children:r.jsx(z,{color:"success",children:r.jsx(Ou,{size:32})})})})]})]})});return r.jsxs(y,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[r.jsx(y,{xs:12,container:!0,justifyContent:"center",alignItems:"center",children:(v===n0||v===o0||v===s0||v===t0)&&r.jsxs(r0,{value:A,onChange:h,"aria-label":"simple tabs example",children:[r.jsx(Su,{label:"درخواست های تایید شده"}),r.jsx(Su,{label:"درخواست های رد شده"})]})}),Wu,r.jsx(d0,{data:A===0?pu:yu,columns:A===0?["ردیف","عملیات","وضعیت","تاریخ سفارش","نوع فروش","ثبت کننده سفارش","خریدار","مرغداری","شرکت زنجیره","کد بهداشتی","کد قرنطینه","راننده","نوع خودرو","پلاک","حجم","میانگین وزن","وزن"]:["ردیف","وضعیت","حذف/رد کننده","تاریخ سفارش","نوع فروش","خریدار","مرغداری","شرکت زنجیره","کد بهداشتی","کد قرنطینه","راننده","نوع خودرو","پلاک","حجم","میانگین وزن","وزن"],handlePageChange:Pu,totalRows:a,page:q,perPage:$,handlePerRowsChange:Vu,title:A===0?"بارهای تایید شده":"بارهای رد شده"})]})};export{A0 as C,L0 as a}; diff --git a/build/assets/ChainCompany-B42vuLDw.js b/build/assets/ChainCompany-B42vuLDw.js new file mode 100644 index 0000000..52471cd --- /dev/null +++ b/build/assets/ChainCompany-B42vuLDw.js @@ -0,0 +1 @@ +import{j as t,T as x,ak as W,B as w,d as S,ag as _,av as L,aw as E,ax as R,b as G}from"./mui-vendor-CkIVaoQP.js";import{r as s,f as V}from"./react-vendor-CmFgShSM.js";import{A as Y,j as a,X as c,G as l,S as f,_ as A,V as P,lm as X,ln as J}from"./index-CeyyVc1v.js";import{f as Z}from"./redux-vendor-B7uoacJt.js";import{R as uu,a as T}from"./index.esm-Bu7XMDZU.js";import{P as eu}from"./PageTable-C16Ol94B.js";import{a as tu}from"./ChainBarManagement-BxgsJV2X.js";import"./iconBase-BEJYyZsk.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./ResponsiveTable-w7hk7Uq8.js";import"./FilterAlt-scT0HEUg.js";import"./Edit-CqBj1Y2L.js";import"./Settings-BckUi175.js";import"./Tune-D4M2CAhp.js";import"./Delete-C5MyLelE.js";import"./CarPelak-BYFY8OXg.js";import"./Pageview-TRcW_9jm.js";import"./AddCircleOutline-C8LXM-k8.js";const ru=()=>{const[o,v]=s.useState(0),[C,F]=s.useState(0),[k,p]=s.useState([]),[M,n]=s.useState(!1),[N,h]=s.useState(0),[g,m]=s.useState(10),[d,z]=s.useState(""),I=Z(u=>u.userSlice.userProfile.key),K=u=>{z(u.target.value)};s.useEffect(()=>{$(1)},[]);const[b]=s.useContext(Y),y=u=>{let e="";return e=u.quantity-u.losses-u.leftOver,e},$=async(u,e)=>{n(!0);let r;e?r=await a.get(`poultry_hatching?search=filter&value=${e}&role=${c()}&page=${u}&page_size=${g}&chain=true`):o&&C?r=await a.get(`poultry_hatching?role=${c()}&age1=${o}&age2=${C}&page=${u}&page_size=${g}&chain=true`):r=await a.get(`poultry_hatching/?role=${c()}&page=${u}&page_size=${g}&chain=true`),p(r.data.results),h(r.data.count),n(!1)},D=u=>{$(u,d)},H=async(u,e)=>{n(!0);let r;d?r=await a.get(`poultry_hatching?search=filter&value=${d}&page=${e}&page_size=${u}&search=filter&value=${d}&chain=true`):o&&C?r=await a.get(`poultry_hatching?role=${c()}&age1=${o}&age2=${C}&page=${e}&page_size=${g}&chain=true`):r=await a.get(`poultry_hatching/?role=${c()}&page=${e}&page_size=${u}&chain=true`),p(r.data.results),h(r.data.count),m(u),n(!1)},j=async u=>{u.preventDefault(),n(!0);try{const e=await a.get(`poultry_hatching/?role=${c()}&search=filter&value=${d}&chain=true`);p(e.data.results),h(e.data.count)}catch(e){console.error("Error fetching data:",e)}finally{n(!1)}},B=async u=>{u.preventDefault(),v(null),F(null),n(!0);try{const e=await a.get(`poultry_hatching/?role=${c()}&chain=true&search=filter&value=`);p(e.data.results),h(e.data.count)}catch(e){console.error("Error fetching data:",e)}finally{n(!1)}},Q=async u=>{u.preventDefault(),n(!0);try{const e=await a.get(`poultry_hatching?role=${c()}&age1=${o}&age2=${C}&chain=true`);p(e.data.results),h(e.data.count)}catch(e){console.error("Error fetching data:",e)}finally{n(!1)}};let U=[{name:"ردیف",selector:(u,e)=>e+1,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"30px"},{name:"شرکت زنجیره",selector:(u,e)=>{var r,i;return`${(r=u==null?void 0:u.chainCompany)==null?void 0:r.name} (${(i=u==null?void 0:u.chainCompany)==null?void 0:i.user.mobile})`},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"وضعیت",selector:(u,e)=>t.jsx(x,{variant:"body2",color:u.violation?"error":"black",children:u.violation?"متخلف":"عادی"}),sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"60px"},{name:"نام فارم",selector:u=>u.poultry.unitName,sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"مرغدار",selector:u=>`${u.poultry.userprofile.fullName} (${u.poultry.userprofile.mobile})`,sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"شهر/تعاونی",selector:u=>{var e,r,i;return`${(e=u==null?void 0:u.poultry)==null?void 0:e.address.city.name}/${(r=u==null?void 0:u.poultry)!=null&&r.cityOperator?(i=u==null?void 0:u.poultry)==null?void 0:i.cityOperator:"بدون تعاونی"}`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"دامپزشک فارم",selector:u=>{var e,r,i;return(e=u==null?void 0:u.vetFarm)!=null&&e.vetFarmMobile?`${(r=u==null?void 0:u.vetFarm)==null?void 0:r.vetFarmFullName} (${(i=u==null?void 0:u.vetFarm)==null?void 0:i.vetFarmMobile})`:"-"},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"سالن",selector:u=>u.hall,sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"60px"},{name:"دوره جوجه ریزی",selector:u=>u.period,sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"تاریخ ثبت جوجه ریزی",selector:u=>A(u==null?void 0:u.createDate),sortable:!1,wrap:!1,allowOverflow:!0,center:!0,width:"100px"},{name:"تاریخ جوجه ریزی",selector:u=>A(u==null?void 0:u.date),sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"100px"},{name:"نژاد",selector:u=>u.chickenBreed,sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"سن",selector:u=>u.age,sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"60px"},{name:"تعداد جوجه ریزی",selector:u=>{var e;return(e=u==null?void 0:u.quantity)==null?void 0:e.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"تلفات دوره (قطعه)",selector:u=>`${u.losses} (%${(u.losses*100/u.quantity).toFixed(0)})`,sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"تعداد کل تعهد دولتی (قطعه)",selector:u=>{var e;return`${(e=u==null?void 0:u.totalCommitmentQuantity)==null?void 0:e.toLocaleString()}`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"تعداد کشتار شده دولتی (قطعه)",selector:u=>{var e;return`${(e=u==null?void 0:u.governmentalQuantity)==null?void 0:e.toLocaleString()}`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"وزن کشتار شده دولتی",selector:u=>{var e;return`${(e=u==null?void 0:u.governmentalKilledQuantity)==null?void 0:e.toLocaleString()}`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"تعداد کشتار شده آزاد (قطعه)",selector:u=>{var e;return`${(e=u==null?void 0:u.freeQuantity)==null?void 0:e.toLocaleString()}`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"وزن کشتار شده آزاد ",selector:u=>{var e;return`${(e=u==null?void 0:u.freeKilledQuantity)==null?void 0:e.toLocaleString()}`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"حجم خارج از استان",selector:u=>{var e;return`${(e=u==null?void 0:u.outProvinceKilledQuantity)==null?void 0:e.toLocaleString()}`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"وزن خارج از استان",selector:u=>{var e;return`${(e=u==null?void 0:u.outProvinceKilledWeight)==null?void 0:e.toLocaleString()}`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"کشتار شده (قطعه)",selector:u=>{var e;return((e=y(u))==null?void 0:e.toLocaleString())+` (%${(y(u)*100/u.quantity).toFixed(0)})`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"مانده در سالن (قطعه)",selector:u=>{var e;return`${(e=u==null?void 0:u.leftOver)==null?void 0:e.toLocaleString()} (%${(u.leftOver*100/u.quantity).toFixed(0)})`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"وزن تعهد دولتی",selector:u=>{var e;return((e=u==null?void 0:u.totalCommitment)==null?void 0:e.toLocaleString())+" کیلوگرم "},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"وزن کشتار دولتی",selector:u=>{var e;return((e=u==null?void 0:u.governmentalKilledQuantity)==null?void 0:e.toLocaleString())+" کیلوگرم "},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"وزن کشتار آزاد",selector:u=>{var e;return((e=u==null?void 0:u.freeKilledQuantity)==null?void 0:e.toLocaleString())+" کیلوگرم "},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"میانگین وزن کشتار",selector:u=>{var e;return((e=u==null?void 0:u.totalAverageKilledWeight)==null?void 0:e.toLocaleString())+" کیلوگرم "},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"وزن کل کشتار شده",selector:u=>{var e;return((e=u==null?void 0:u.totalKilledWeight)==null?void 0:e.toLocaleString())+" کیلوگرم "},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"کشتار فعال",selector:u=>{var e;return(e=u==null?void 0:u.activeKill)!=null&&e.activeKill?"دارد":"ندارد"},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"تعداد درخواست کشتار",selector:u=>{var e;return(e=u==null?void 0:u.activeKill)!=null&&e.countOfRequest?u.activeKill.countOfRequest:"-"},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"آخرین تغییر",selector:u=>{const e=u.lastChange&&u.lastChange.date&&`${u.lastChange.fullName} (${P(u.lastChange.role)}) در تاریخ ${A(u.lastChange.date)}`;return u.lastChange?e:"-"},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"سازنده جوجه ریزی",selector:u=>{const e=u.latestHatchingChange&&u.latestHatchingChange.date&&`${u.latestHatchingChange.fullName} (${P(u.latestHatchingChange.role)}) در تاریخ ${A(u.latestHatchingChange.date)}`;return u.latestHatchingChange?e:"-"},sortable:!0,wrap:!0,allowOverflow:!0,center:!0}];const O=Array.from({length:75},(u,e)=>e+1),q=t.jsxs(l,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,width:"100%",mt:2,children:[t.jsxs(l,{container:!0,alignItems:"center",gap:f.SMALL,style:{padding:"10px",border:"1px solid #bbb",borderRadius:"10px"},children:[t.jsx(x,{children:"زنجیره های زیرمجموعه"}),t.jsxs("form",{onSubmit:j,children:[t.jsx(W,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:K}),t.jsx(w,{type:"submit",onClick:j,endIcon:t.jsx(uu,{}),children:"جستجو"}),t.jsx(S,{title:"خروجی اکسل",children:t.jsx(w,{color:"success",onClick:()=>{b({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const u=`${a.defaults.baseURL}0/hatching_excel/?role=${c()}&key=${I}&chain=true`;window.location.href=u},children:t.jsx(T,{size:32})})})]})]}),t.jsxs(l,{container:!0,alignItems:"center",gap:f.SMALL,style:{padding:"10px",border:"1px solid #bbb",borderRadius:"10px"},children:[t.jsx(l,{children:t.jsx(x,{variant:"caption",children:"جستجو براساس سن:"})}),t.jsx(l,{style:{width:"80px"},children:t.jsxs(_,{fullWidth:!0,children:[t.jsx(L,{id:"demo-simple-select-label",children:"از سن"}),t.jsx(E,{MenuProps:{PaperProps:{style:{maxHeight:200,width:80}}},labelId:"demo-simple-select-label",id:"demo-simple-select",value:o,label:"از سن",size:"small",onChange:u=>v(u.target.value),children:O.map(u=>t.jsx(R,{value:u,children:u},u))})]})}),t.jsx(l,{style:{width:"80px"},children:t.jsxs(_,{fullWidth:!0,children:[t.jsx(L,{id:"demo-simple-select-label",children:"تا سن"}),t.jsx(E,{MenuProps:{PaperProps:{style:{maxHeight:200,width:80}}},labelId:"demo-simple-select-label",id:"demo-simple-select",value:C,label:"تا سن",size:"small",onChange:u=>F(u.target.value),children:O.map(u=>t.jsx(R,{value:u,children:u},u))})]})}),t.jsx(w,{onClick:Q,children:"جستجو"}),t.jsx(S,{title:"خروجی اکسل",children:t.jsx(w,{color:"success",onClick:()=>{b({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const u=`${a.defaults.baseURL}hatching_report_from_age_excel/?age1=${o}&age2=${C}&chain=true`;window.location.href=u},children:t.jsx(T,{size:32})})})]}),t.jsx(w,{onClick:B,color:"error",children:"حذف فیلتر"})]});return t.jsx(l,{container:!0,xs:12,children:t.jsx(l,{container:!0,xs:12,justifyContent:"center",mt:2,children:t.jsx(eu,{title:q,columns:U,data:k,progressPending:M,pagination:!0,paginationServer:!0,paginationTotalRows:N,onChangeRowsPerPage:H,onChangePage:D})})})},bu=()=>{const{pathname:o}=V();return t.jsx(t.Fragment,{children:t.jsx(G,{display:"flex",justifyContent:"center",children:t.jsx(l,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,my:f.MEDIUM,children:t.jsx(l,{container:!0,justifyContent:"space-between",gap:f.SMALL,children:t.jsxs(l,{xs:12,children:[o===X&&t.jsx(ru,{}),o===J&&t.jsx(tu,{})]})})})})})};export{bu as default}; diff --git a/build/assets/ChartLenear-WgLA0J0V.js b/build/assets/ChartLenear-WgLA0J0V.js new file mode 100644 index 0000000..7a05ea6 --- /dev/null +++ b/build/assets/ChartLenear-WgLA0J0V.js @@ -0,0 +1 @@ +import{j as t,p as r}from"./mui-vendor-CkIVaoQP.js";import"./react-vendor-CmFgShSM.js";import{C as o,N as n,B as s,L as e}from"./chart-vendor-sE2SUVPW.js";import"./auto-gcBAg08D.js";s.font.family="iranyekan";const i=({chartData:a,options:p})=>(console.log(o),t.jsx(n,{data:a,options:p,maintainAspectRatio:"true"}));i.propTypes={chartData:r.PropTypes.any,options:r.PropTypes.any};console.log(o);s.font.family="iranyekan";const y=({chartData:a})=>t.jsx(e,{data:a});y.propTypes={chartData:r.PropTypes.any};export{i as C,y as a}; diff --git a/build/assets/ChechClearanceCode-lPasOZZ_.js b/build/assets/ChechClearanceCode-lPasOZZ_.js new file mode 100644 index 0000000..5dc6a77 --- /dev/null +++ b/build/assets/ChechClearanceCode-lPasOZZ_.js @@ -0,0 +1 @@ +import{j as e,a3 as f,d as x,I as v,ab as _,br as E,ad as k,ak as b,a4 as B,B as h,T as I,p as t}from"./mui-vendor-CkIVaoQP.js";import{b as R,r as n}from"./react-vendor-CmFgShSM.js";import{d as D}from"./Pageview-TRcW_9jm.js";import{d as S}from"./Edit-CqBj1Y2L.js";import{d as z}from"./AddCircleOutline-C8LXM-k8.js";import{a as P,u as w}from"./redux-vendor-B7uoacJt.js";import{L as N,j as G,h as y,A as L,u as O,c as $,M}from"./index-CeyyVc1v.js";const V=P("EDIT_BAR_CLEARANCE_BAR",async(s,{dispatch:r})=>{r(N());try{const{data:a,status:l}=await G.put("kill_house_free_bar/0/",s);return r(y()),{data:a,status:l}}catch(a){return r(y()),{error:a.response.data.result}}}),q=({clearanceCode:s,onSave:r,bar_key:a,register_type:l})=>{const A=w(),{openNotif:c}=R.useContext(L),[C,o]=n.useState(!1),[j,p]=n.useState(!1),F=n.useRef(null),u=O({initialValues:{clearanceCode:s||""},validationSchema:$({clearanceCode:M().required("این فیلد اجباری است!").matches(/^[A-Z0-9]+$/,"فقط حروف بزرگ و عدد مجاز است!")}),onSubmit:async m=>{p(!0);try{const i=await A(V({key:a,bar_clearance_code:m.clearanceCode}));i.error?c({vertical:"top",horizontal:"center",msg:i.error.message||"خطا در ذخیره سازی",severity:"error"}):(c({vertical:"top",horizontal:"center",msg:"کد با موفقیت ذخیره شد",severity:"success"}),r&&r(m.clearanceCode),o(!1))}catch{c({vertical:"top",horizontal:"center",msg:"خطا در ارتباط با سرور",severity:"error"})}finally{p(!1)}}}),T=()=>{o(!0)},d=l==="manual";return e.jsxs(f,{container:!0,alignItems:"center",justifyContent:"center",gap:.5,style:{width:d?"160px":"auto"},children:[u.values.clearanceCode?e.jsx(g,{clearanceCode:u.values.clearanceCode}):null,d&&e.jsx(x,{title:u.values.clearanceCode?"ویرایش کد گواهی":"ثبت کد گواهی",placement:"top",children:e.jsx(v,{size:"small",color:"primary",onClick:T,children:u.values.clearanceCode?e.jsx(S,{fontSize:"small"}):e.jsx(z,{fontSize:"small"})})}),C&&e.jsxs(_,{open:C,onClose:()=>{u.resetForm(),o(!1)},children:[e.jsx(E,{children:"ویرایش کد گواهی"}),e.jsx(k,{children:e.jsx(b,{inputRef:F,name:"clearanceCode",value:u.values.clearanceCode,onChange:u.handleChange,onBlur:u.handleBlur,error:u.touched.clearanceCode&&!!u.errors.clearanceCode,helperText:u.touched.clearanceCode&&u.errors.clearanceCode,size:"small",fullWidth:!0,autoFocus:!0})}),e.jsxs(B,{children:[e.jsx(h,{onClick:()=>{u.resetForm(),o(!1)},color:"primary",children:"لغو"}),e.jsx(h,{onClick:()=>{u.handleSubmit(),o(!1)},color:"primary",disabled:j||!u.dirty,children:"ذخیره"})]})]})]})},g=({clearanceCode:s})=>{const r=n.useRef(null),a=()=>{r.current&&r.current.submit()};return e.jsxs(f,{container:!0,style:{width:"auto"},alignItems:"center",justifyContent:"center",gap:.5,children:[e.jsx(x,{title:"مشاهده گواهینامه",arrow:!0,children:e.jsxs("form",{action:"https://e.ivo.ir/Rahgiri/Gidprnt.aspx",method:"post",target:"_blank",ref:r,style:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx("input",{name:"gid",type:"hidden",value:s}),e.jsx(D,{color:"primary",onClick:a})]})}),e.jsx(I,{variant:"caption",color:"primary",children:s})]})};q.propTypes={clearanceCode:t.PropTypes.any,onSave:t.PropTypes.func,bar_key:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.number]),register_type:t.PropTypes.string};g.propTypes={clearanceCode:t.PropTypes.any};export{q as C}; diff --git a/build/assets/Check-CRb6laYC.js b/build/assets/Check-CRb6laYC.js new file mode 100644 index 0000000..82846b5 --- /dev/null +++ b/build/assets/Check-CRb6laYC.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(a()),l=t;u=e.default=(0,i.default)((0,l.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check");export{u as d}; diff --git a/build/assets/CheckCircle-zgBvZQ-b.js b/build/assets/CheckCircle-zgBvZQ-b.js new file mode 100644 index 0000000..5723e8f --- /dev/null +++ b/build/assets/CheckCircle-zgBvZQ-b.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},i=r;Object.defineProperty(e,"__esModule",{value:!0});var o=e.default=void 0,u=i(a()),l=t;o=e.default=(0,u.default)((0,l.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle");export{o as d}; diff --git a/build/assets/CheckCircleOutline-Ci9-hVKX.js b/build/assets/CheckCircleOutline-Ci9-hVKX.js new file mode 100644 index 0000000..484c220 --- /dev/null +++ b/build/assets/CheckCircleOutline-Ci9-hVKX.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},i=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,l=i(a()),o=t;u=e.default=(0,l.default)((0,o.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");export{u as d}; diff --git a/build/assets/ChickenLogo-BK6_Z2uq.js b/build/assets/ChickenLogo-BK6_Z2uq.js new file mode 100644 index 0000000..50f17c5 --- /dev/null +++ b/build/assets/ChickenLogo-BK6_Z2uq.js @@ -0,0 +1 @@ +const o="/assets/ChickenLogo-BRWPnweI.png";export{o as l}; diff --git a/build/assets/ChickenLogo-BRWPnweI.png b/build/assets/ChickenLogo-BRWPnweI.png new file mode 100644 index 0000000..2fdd234 Binary files /dev/null and b/build/assets/ChickenLogo-BRWPnweI.png differ diff --git a/build/assets/CityAvicultureManagement-BOhjmwTw.js b/build/assets/CityAvicultureManagement-BOhjmwTw.js new file mode 100644 index 0000000..de3619a --- /dev/null +++ b/build/assets/CityAvicultureManagement-BOhjmwTw.js @@ -0,0 +1 @@ +import{j as e,ak as t,al as M,am as g,ar as X,ag as Z,av as Q,aw as uu,ax as r,B as eu,p as R,an as w,ao as f,aq as x,i as W,a3 as z,aJ as au,I as ru,b0 as lu,b4 as N,ap as T,b as nu}from"./mui-vendor-CkIVaoQP.js";import{L as U,j as ou,h as B,A as su,u as tu,c as du,b as h,M as b,G as l,S as v,iY as G,N as _,r as $,O as cu,a1 as iu,iZ as Cu}from"./index-CeyyVc1v.js";import{a as hu,u as I,f as pu}from"./redux-vendor-B7uoacJt.js";import{r as d,f as xu}from"./react-vendor-CmFgShSM.js";import{A as vu}from"./AdvancedTable-BYmmBtmq.js";import{C as Au}from"./CitySubmitTenantForm-BnB_IQ2s.js";import{c as ju,a as yu}from"./city-get-city-qTSRxslT.js";import{d as bu}from"./Tune-D4M2CAhp.js";import{d as Fu}from"./EditOutlined-n5ie2Fmu.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const fu=hu("CITY_EDIT_AVICULTURE_INFO",async(a,{dispatch:n})=>{n(U());const{data:c,status:i}=await ou.put("/edit_poultry/0/",a);return n(B()),{data:c,status:i}}),Y=({item:a})=>{var L,O,m,q,D;const n=I(),[c]=d.useContext(su),[i,A]=d.useState(),[p,s]=d.useState(),[C,k]=d.useState(),[F,E]=d.useState(),[j,J]=d.useState(!0),u=tu({initialValues:{avicultureName:a!=null&&a.unitName?a==null?void 0:a.unitName:"",postal:a!=null&&a.address.postalCode?a==null?void 0:a.address.postalCode:"",address:a!=null&&a.address.address?a==null?void 0:a.address.address:"",bankUser:(L=a==null?void 0:a.userBankInfo)!=null&&L.nameOfBankUser?(O=a==null?void 0:a.userBankInfo)==null?void 0:O.nameOfBankUser:"",card:(m=a==null?void 0:a.userBankInfo)!=null&&m.card?a==null?void 0:a.userBankInfo.card:"",account:(q=a==null?void 0:a.userBankInfo)!=null&&q.account?a==null?void 0:a.userBankInfo.account:"",bankName:"",shaba:(D=a==null?void 0:a.userBankInfo)!=null&&D.shaba?a==null?void 0:a.userBankInfo.shaba:"",hall:a!=null&&a.numberOfHalls?a==null?void 0:a.numberOfHalls:"",breedingUniqueId:a!=null&&a.breedingUniqueId?a==null?void 0:a.breedingUniqueId:"",systemCode:a!=null&&a.systemCode?a==null?void 0:a.systemCode:"",epidemiologicalCode:a!=null&&a.epidemiologicalCode?a==null?void 0:a.epidemiologicalCode:"",totalCapacity:a!=null&&a.totalCapacity?a==null?void 0:a.totalCapacity:"",healthCertificateNumber:a!=null&&a.healthCertificateNumber?a==null?void 0:a.healthCertificateNumber:""},validationSchema:du({avicultureName:b().typeError("لطفا فیلد را به درستی وارد کنید!"),address:b().typeError("لطفا فیلد را به درستی وارد کنید!"),card:h().typeError("لطفا فیلد را به درستی وارد کنید!"),bankUser:b().typeError("لطفا فیلد را به درستی وارد کنید!"),postal:h().typeError("لطفا فیلد را به درستی وارد کنید!"),account:h().typeError("لطفا فیلد را به درستی وارد کنید!"),bankName:b().typeError("لطفا فیلد را به درستی وارد کنید!"),shaba:b().typeError("لطفا فیلد را به درستی وارد کنید!"),hall:h().typeError("لطفا فیلد را به درستی وارد کنید!"),breedingUniqueId:h().typeError("لطفا فیلد را به درستی وارد کنید!"),systemCode:h().typeError("لطفا فیلد را به درستی وارد کنید!"),epidemiologicalCode:h().typeError("لطفا فیلد را به درستی وارد کنید!"),totalCapacity:h().typeError("لطفا فیلد را به درستی وارد کنید!"),healthCertificateNumber:h().typeError("لطفا فیلد را به درستی وارد کنید!")})});return d.useEffect(()=>{u.validateForm()},[]),d.useEffect(()=>{var o;n(U()),(o=n(ju()))==null||o.then(y=>{n(B()),A(y.payload.data)})},[]),d.useEffect(()=>{C&&(n(U()),n(yu(C)).then(o=>{s(o.payload.data),J(!1),n(B())}))},[C]),e.jsx(l,{container:!0,gap:v.SMALL,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",display:"block",children:e.jsxs(l,{container:!0,direction:"column",gap:v.SMALL,children:[e.jsx(l,{children:e.jsx(t,{id:"breedingUniqueId",label:"شناسه یکتا",variant:"outlined",sx:{width:"100%"},value:u.values.breedingUniqueId,error:u.touched.breedingUniqueId?!!u.errors.breedingUniqueId:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.breedingUniqueId&&u.errors.breedingUniqueId?u.errors.breedingUniqueId:null})}),e.jsx(l,{children:e.jsx(t,{id:"systemCode",label:"کد سیستمی",variant:"outlined",sx:{width:"100%"},value:u.values.systemCode,error:u.touched.systemCode?!!u.errors.systemCode:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.systemCode&&u.errors.systemCode?u.errors.systemCode:null})}),e.jsx(l,{children:e.jsx(t,{id:"epidemiologicalCode",label:"کد اپیدمیولوژیک",variant:"outlined",sx:{width:"100%"},value:u.values.epidemiologicalCode,error:u.touched.epidemiologicalCode?!!u.errors.epidemiologicalCode:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.epidemiologicalCode&&u.errors.epidemiologicalCode?u.errors.epidemiologicalCode:null})}),e.jsx(l,{children:e.jsx(t,{id:"avicultureName",label:"نام مرغداری",variant:"outlined",sx:{width:"100%"},value:u.values.avicultureName,error:u.touched.avicultureName?!!u.errors.avicultureName:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.avicultureName&&u.errors.avicultureName?u.errors.avicultureName:null})}),e.jsx(l,{children:e.jsx(M,{disablePortal:!0,id:"province",options:i?i==null?void 0:i.map(o=>({id:o.key,label:o.name})):[],onChange:(o,y)=>{k(y.id)},renderInput:o=>e.jsx(t,{...o,label:"استان را انتخاب کنید"})})}),e.jsx(l,{children:e.jsx(M,{disabled:j,disablePortal:!0,id:"city",options:p?p.map(o=>({id:o.key,label:o.name})):[],onChange:(o,y)=>{E(y.id)},renderInput:o=>e.jsx(t,{...o,label:"شهر را انتخاب کنید"})})}),e.jsx(l,{children:e.jsx(t,{id:"address",label:"آدرس",variant:"outlined",sx:{width:"100%"},value:u.values.address,error:u.touched.address?!!u.errors.address:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.address&&u.errors.address?u.errors.address:null})}),e.jsx(l,{children:e.jsx(t,{id:"postal",label:"کد پستی",variant:"outlined",sx:{width:"100%"},value:u.values.postal,error:u.touched.postal?!!u.errors.postal:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.postal&&u.errors.postal?u.errors.postal:null})}),e.jsx(l,{children:e.jsx(t,{id:"hall",label:"تعداد سالن",variant:"outlined",sx:{width:"100%"},value:u.values.hall,error:u.touched.postal?!!u.errors.hall:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.hall&&u.errors.hall?u.errors.hall:null})}),e.jsx(l,{children:e.jsx(t,{id:"totalCapacity",label:"ظرفیت کل",variant:"outlined",sx:{width:"100%"},value:u.values.totalCapacity,error:u.touched.totalCapacity?!!u.errors.totalCapacity:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.totalCapacity&&u.errors.totalCapacity?u.errors.totalCapacity:null})}),e.jsx(l,{children:e.jsx(t,{id:"healthCertificateNumber",label:"شماره گواهی بهداشتی",variant:"outlined",sx:{width:"100%"},value:u.values.healthCertificateNumber,error:u.touched.healthCertificateNumber?!!u.errors.healthCertificateNumber:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.healthCertificateNumber&&u.errors.healthCertificateNumber?u.errors.healthCertificateNumber:null})}),e.jsx(g,{children:e.jsx(X,{label:"اطلاعات بانکی"})}),e.jsx(l,{children:e.jsx(t,{id:"bankUser",label:"نام صاحب حساب",variant:"outlined",sx:{width:"100%"},value:u.values.bankUser,error:u.touched.bankUser?!!u.errors.bankUser:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.bankUser&&u.errors.bankUser?u.errors.bankUser:null})}),e.jsx(l,{children:e.jsxs(Z,{fullWidth:!0,children:[e.jsx(Q,{id:"demo-simple-select-label",children:"بانک"}),e.jsxs(uu,{id:"bankName",label:"نام بانک",value:u.values.bankName,error:u.touched.bankName?!!u.errors.bankName:null,onChange:o=>{u.setFieldValue("bankName",o.target.value)},onBlur:u.handleBlur,children:[e.jsx(r,{value:"موسسه افضل توس",children:"موسسه افضل توس"}),e.jsx(r,{value:"انصار",children:"انصار"}),e.jsx(r,{value:"سپه",children:"سپه"}),e.jsx(r,{value:"دی",children:"دی"}),e.jsx(r,{value:"کاب",children:"اقتصاد نوین"}),e.jsx(r,{value:"گردشگری",children:"گردشگری"}),e.jsx(r,{value:"حکمت ایرانیان",children:"حکمت ایرانیان"}),e.jsx(r,{value:"ایران زمین",children:"ایران زمین"}),e.jsx(r,{value:"کشاورزی",children:"کشاورزی"}),e.jsx(r,{value:"مسکن",children:"مسکن"}),e.jsx(r,{value:"مهر ایران",children:"مهر ایران"}),e.jsx(r,{value:"مهر اقتصاد",children:"مهر اقتصاد"}),e.jsx(r,{value:"ملت",children:"ملت"}),e.jsx(r,{value:"ملی",children:"ملی"}),e.jsx(r,{value:"پارسیان",children:"پارسیان"}),e.jsx(r,{value:"پاسارگاد",children:"پاسارگاد"}),e.jsx(r,{value:"پست بانک ایران",children:"پست بانک ایران"}),e.jsx(r,{value:"صادرات",children:"صادرات"}),e.jsx(r,{value:"سامان",children:"سامان"}),e.jsx(r,{value:"صنعت و معدن",children:"صنعت و معدن"}),e.jsx(r,{value:"سرمایه",children:"سرمایه"}),e.jsx(r,{value:"شهر",children:"شهر"}),e.jsx(r,{value:"سینا",children:"سینا"}),e.jsx(r,{value:"تجارت",children:"تجارت"}),e.jsx(r,{value:"موسسه اعتباری توسعه",children:"موسسه اعتباری توسعه"}),e.jsx(r,{value:"خاورمیانه",children:"خاورمیانه"})]})]})}),e.jsx(l,{children:e.jsx(t,{id:"card",label:"شماره کارت",variant:"outlined",sx:{width:"100%"},value:u.values.card,error:u.touched.card?!!u.errors.card:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.card&&u.errors.card?u.errors.card:null})}),e.jsx(l,{children:e.jsx(t,{id:"account",label:"شماره حساب",variant:"outlined",sx:{width:"100%"},value:u.values.account,error:u.touched.account?!!u.errors.account:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.account&&u.errors.account?u.errors.account:null})}),e.jsx(l,{children:e.jsx(t,{id:"shaba",label:"شماره شبا",variant:"outlined",sx:{width:"100%"},value:u.values.shaba,error:u.touched.shaba?!!u.errors.shaba:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.shaba&&u.errors.shaba?u.errors.shaba:null})}),e.jsx(l,{mb:v.SMALL,children:e.jsx(eu,{fullWidth:!0,variant:"contained",disabled:!u.validateForm,onClick:()=>{n(fu({poultry_key:a.key,breedingUniqueId:u.values.breedingUniqueId?u.values.breedingUniqueId:null,systemCode:u.values.systemCode?u.values.systemCode:null,epidemiologicalCode:u.values.epidemiologicalCode?u.values.epidemiologicalCode:null,totalCapacity:u.values.totalCapacity?u.values.totalCapacity:null,healthCertificateNumber:u.values.healthCertificateNumber?u.values.healthCertificateNumber:null,address:{province:C||null,city:F||null,address:u.values.address?u.values.address:null,postal_code:u.values.postal?u.values.postal:null},user_bank_info:{name_of_bank_user:u.values.bankUser?u.values.bankUser:null,bank_name:u.values.bankName?u.values.bankName:null,card:u.values.card?u.values.card:null,shaba:u.values.shaba?u.values.shaba:null,account:u.values.account?u.values.account:null},unit_name:u.values.avicultureName?u.values.avicultureName:null,hall:u.values.hall?u.values.hall:null})).then(o=>{o.error?(c({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است.",severity:"error"}),n(B())):c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),n(G()),n(_({right:!1,bottom:!1,content:null}))})},children:"ثبت اطلاعات"})})]})})};Y.propTypes={item:R.PropTypes.any};const K=({item:a})=>e.jsxs(e.Fragment,{children:[e.jsx(g,{}),e.jsxs(l,{container:!0,direction:"row",flexWrap:"nowrap",flex:"1",children:[e.jsx(l,{children:e.jsxs(w,{sx:{width:"100%",maxWidth:360,bgcolor:"background.paper"},children:[e.jsx(f,{children:e.jsx(x,{primary:"نام",secondary:a==null?void 0:a.poultryTenant.fullName})})," ",e.jsx(g,{}),e.jsx(f,{children:e.jsx(x,{primary:"شناسه یکتا",secondary:a==null?void 0:a.poultryTenant.breedingUniqueId})})," "]})}),e.jsx(l,{children:e.jsxs(w,{sx:{width:"100%",maxWidth:360,bgcolor:"background.paper"},children:[e.jsx(f,{children:e.jsx(x,{primary:"موبایل",secondary:a==null?void 0:a.poultryTenant.mobile})})," ",e.jsx(g,{}),e.jsx(f,{children:e.jsx(x,{primary:"کد ملی",secondary:a==null?void 0:a.poultryTenant.nationalId})})]})})]})]});K.propTypes={item:R.PropTypes.object};var S={},gu=W;Object.defineProperty(S,"__esModule",{value:!0});var V=S.default=void 0,Bu=gu($()),Iu=e;V=S.default=(0,Bu.default)((0,Iu.jsx)("path",{d:"M13 8c0-2.21-1.79-4-4-4S5 5.79 5 8s1.79 4 4 4 4-1.79 4-4m-2 0c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2M1 18v2h16v-2c0-2.66-5.33-4-8-4s-8 1.34-8 4m2 0c.2-.71 3.3-2 6-2 2.69 0 5.78 1.28 6 2zm17-3v-3h3v-2h-3V7h-2v3h-3v2h3v3z"}),"PersonAddAlt");var P={},ku=W;Object.defineProperty(P,"__esModule",{value:!0});var H=P.default=void 0,Eu=ku($()),Nu=e;H=P.default=(0,Eu.default)((0,Nu.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined");const Tu=({item:a})=>{const n=I(),[c,i]=d.useState(null),A=Object.keys(a.poultryTenant).length!==0,p=E=>{const j=E.currentTarget.getBoundingClientRect();i({top:j.bottom+window.scrollY,left:j.left+j.width/2+window.scrollX})},s=()=>{i(null)},C=()=>{n(_({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ایجاد مستاجر جدید",content:e.jsx(Au,{id:a.key})})),s()},k=()=>{n(cu({title:"اطلاعات مستاجر",content:e.jsx(K,{item:a})})),s()},F=()=>{n(_({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ویرایش اطلاعات مرغدار",content:e.jsx(Y,{item:a})})),s()};return e.jsxs(z,{container:!0,justifyContent:"center",children:[e.jsx(ru,{color:"primary",size:"small",onClick:p,children:e.jsx(bu,{})}),e.jsx(lu,{anchorReference:"anchorPosition",anchorPosition:c||void 0,open:!!c,onClose:s,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:e.jsxs(w,{sx:{p:0},children:[A?e.jsxs(N,{onClick:k,children:[e.jsx(T,{sx:{minWidth:36,color:"info.main"},children:e.jsx(H,{fontSize:"small"})}),e.jsx(x,{primary:"اطلاعات مستاجر",primaryTypographyProps:{variant:"body2",color:"info"}})]}):e.jsxs(N,{onClick:C,children:[e.jsx(T,{sx:{minWidth:36,color:"success.main"},children:e.jsx(V,{fontSize:"small"})}),e.jsx(x,{primary:"افزودن مستاجر",primaryTypographyProps:{variant:"body2",color:"success"}})]}),e.jsxs(N,{onClick:F,children:[e.jsx(T,{sx:{minWidth:36,color:"warning.main"},children:e.jsx(Fu,{fontSize:"small"})}),e.jsx(x,{primary:"ویرایش اطلاعات",primaryTypographyProps:{variant:"body2",color:"warning"}})]})]})})]})},wu=()=>{const[a,n]=d.useState([]),{poultryFarms:c}=pu(p=>p.citySlice),i=I();d.useEffect(()=>{i(G())},[]),d.useEffect(()=>{const p=c==null?void 0:c.filter(s=>Object.keys(s.poultryOwner).length===0).map((s,C)=>[C+1,s.unitName,s.userprofile.fullName,s.userprofile.breedingUniqueId,s.address.province.name,s.address.city.name,s.userprofile.mobile,e.jsx(Tu,{item:s},`operation-${s.key}`)]);n(p)},[c]);const[A]=d.useState(["ردیف","نام مرغداری","نام صاحب","شناسه یکتا","استان","شهر","تلفن همراه","عملیات"]);return e.jsx(z,{container:!0,alignItems:"center",justifyContent:"space-between",gap:v.SMALL,mt:v.MEDIUM,children:e.jsx(au,{sx:{width:"100%"},children:e.jsx(vu,{name:"مرغداران زیرمجموعه",columns:A,data:a})})})},Gu=()=>{const{pathname:a}=xu(),n=I();return d.useEffect(()=>{n(iu())},[]),e.jsx(e.Fragment,{children:e.jsx(nu,{display:"flex",justifyContent:"center",children:e.jsx(l,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:e.jsx(l,{container:!0,justifyContent:"space-between",gap:v.SMALL,children:e.jsx(l,{xs:12,children:a===Cu&&e.jsx(wu,{})})})})})})};export{Gu as default}; diff --git a/build/assets/CityHatchingInfo-CZPJ_c_O.js b/build/assets/CityHatchingInfo-CZPJ_c_O.js new file mode 100644 index 0000000..40132b1 --- /dev/null +++ b/build/assets/CityHatchingInfo-CZPJ_c_O.js @@ -0,0 +1,2 @@ +import{i as P6,j as r,ak as k,B as N,a3 as Y,a9 as m6,b as H6,T as _,I as au,b0 as u0,an as a0,d as f,b4 as P,ap as B,aq as W,aX as b0,am as q6,ar as K6}from"./mui-vendor-CkIVaoQP.js";import{r as B6,A as V,dn as E0,c as r0,dp as D0,fT as k0,fU as _0,C as Q6,b as R0,L as K,j as R,h as w,u as o0,M as R6,N as M6,O as U,X as d,a7 as n0,fj as H0,_ as q,p as Z,V as T6,c5 as s0,fJ as l0,fK as e0,fL as C0,fM as t0,fN as c0,fO as d0,fP as T0,G as p,S as N0,fQ as m,v as uu,fV as P0,W as N6,fW as B0}from"./index-CeyyVc1v.js";import{r as c,u as A0}from"./react-vendor-CmFgShSM.js";import{a as E6,R as g0}from"./index.esm-Bu7XMDZU.js";import{u as G,a as p0,f as I}from"./redux-vendor-B7uoacJt.js";import{d as W0}from"./Add--yVWBJhC.js";import{C as w0}from"./CityNewKillRequest-C2SXYvKb.js";import{b as h0,c as z0,C as y0,d as q0,V as K0,e as Q0,a as M0}from"./CityHatchingsArchiveOperations-DQ9mbEeF.js";import{d as x0}from"./Tune-D4M2CAhp.js";import{d as O0}from"./Sms-DasNClAG.js";import{d as v0}from"./Edit-CqBj1Y2L.js";import{d as Y0}from"./Delete-C5MyLelE.js";import{R as ru}from"./ResponsiveTable-w7hk7Uq8.js";import{S as i0}from"./SimpleTable-DBAoNnCU.js";import{S as F0}from"./ShowImage-CqhU2hmk.js";import{d as U0}from"./ToggleOffOutlined-Ch26Umk7.js";import{d as I0}from"./ToggleOn-pBgb8alR.js";var O6={},V0=P6;Object.defineProperty(O6,"__esModule",{value:!0});var j0=O6.default=void 0,G0=V0(B6()),X0=r;j0=O6.default=(0,G0.default)((0,X0.jsx)("path",{d:"M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m0 15-5-5h3V9h4v4h3z"}),"AssignmentReturned");const J0=r0().shape({looses_amount:R0().required("این فیلد اجباری است!").min(0,"عدد مثبت وارد کنید!")}),Z0=({updateTable:o,item:n})=>{const h=G(),[C]=c.useContext(V),F=(t,{resetForm:s})=>{h(h0({key:n==null?void 0:n.key,direct_losses:t.looses_amount})).then(l=>{l.payload.error?C({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(C({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(),h(Q6()))}),s()};return r.jsx("div",{children:r.jsx(E0,{initialValues:{looses_amount:""},validationSchema:J0,onSubmit:F,children:({handleChange:t,handleBlur:s})=>r.jsxs(D0,{children:[r.jsx(k0,{as:k,name:"looses_amount",label:"حجم تلفات",type:"number",onChange:t,onBlur:s,fullWidth:!0,variant:"outlined",margin:"normal",helperText:r.jsx(_0,{name:"looses_amount"})}),r.jsx(N,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,children:"ثبت"})]})})})};var Y6={},m0=P6;Object.defineProperty(Y6,"__esModule",{value:!0});var S0=Y6.default=void 0,u2=m0(B6()),a2=r;S0=Y6.default=(0,u2.default)((0,a2.jsx)("path",{d:"M14 10H3v2h11zm0-4H3v2h11zM3 16h7v-2H3zm11.41 6L17 19.41 19.59 22 21 20.59 18.41 18 21 15.41 19.59 14 17 16.59 14.41 14 13 15.41 15.59 18 13 20.59z"}),"PlaylistRemove");const r2=p0("CITY_SUBMIT_MANAGE_HATCHING_RENTER_SERVICE",async(o,{dispatch:n})=>{n(K());const{data:h,status:C}=await R.put("/poultry_hatching/0/",o);return n(w()),{data:h,status:C}}),o2=p0("CITY_HATCHING_DELETE_RENTER_SERVICE",async(o,{dispatch:n})=>{n(K());try{const{data:h,status:C}=await R.put("poultry_hatching/0/",o);return n(w()),{data:h,status:C}}catch(h){return n(w()),{error:h.response.data.result}}}),n2=({item:o,updateTable:n,readOnly:h})=>{const[C,F]=c.useState(!1),t=G(),[s]=c.useContext(V),l=o0({initialValues:{fullName:(o==null?void 0:o.tenantFullname)||"",nationalCode:(o==null?void 0:o.tenantNationalCode)||"",phoneNumber:(o==null?void 0:o.tenantMobile)||"",city:(o==null?void 0:o.tenantCity)||""},validationSchema:r0({fullName:R6().required("نام و نام خانوادگی الزامی است"),nationalCode:R6().required("کد ملی الزامی است").matches(/^[0-9]{10}$/,"کد ملی باید 10 رقم باشد"),phoneNumber:R6().required("شماره تلفن الزامی است").matches(/^[0-9]{11}$/,"شماره تلفن باید 11 رقم باشد"),city:R6().required("شهر الزامی است")}),onSubmit:x=>{t(K()),t(r2({key:o==null?void 0:o.key,tenant_fullname:x.fullName,tenant_national_code:x.nationalCode,tenant_mobile:x.phoneNumber,tenant_city:x.city,has_tenant:!0})).then($=>{t(Q6()),$.payload.error?s({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),l.resetForm(),n(),F(!1)),t(w())})},enableReinitialize:!0}),i=()=>{F(!0)},H=()=>{t(K()),t(o2({delete_tenant:!0,key:o==null?void 0:o.key})).then(x=>{t(Q6()),x.payload.error||(s({vertical:"top",horizontal:"center",msg:"مستاجر با موفقیت حذف شد.",severity:"success"}),l.resetForm(),n())})},y=(o==null?void 0:o.hasTenant)&&(o==null?void 0:o.tenantFullname);return r.jsx(Y,{container:!0,spacing:3,direction:"column",children:y&&!C?r.jsx(Y,{item:!0,children:r.jsx(m6,{elevation:3,children:r.jsxs(H6,{p:2,display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsxs("div",{children:[r.jsxs(_,{variant:"subtitle1",children:[r.jsx("strong",{children:"نام مستاجر:"})," ",o.tenantFullname]}),r.jsxs(_,{variant:"body2",children:[r.jsx("strong",{children:"کد ملی:"})," ",o.tenantNationalCode]}),r.jsxs(_,{variant:"body2",children:[r.jsx("strong",{children:"شماره تلفن:"})," ",o.tenantMobile]}),r.jsxs(_,{variant:"body2",children:[r.jsx("strong",{children:"شهر:"})," ",o.tenantCity]})]}),!h&&r.jsxs("div",{children:[r.jsx(au,{onClick:i,color:"primary",children:r.jsx(v0,{})}),r.jsx(au,{onClick:H,color:"error",children:r.jsx(Y0,{})})]})]})})}):r.jsx(Y,{item:!0,children:r.jsx(m6,{elevation:3,children:r.jsxs(H6,{p:2,component:"form",onSubmit:l.handleSubmit,children:[r.jsxs(Y,{container:!0,spacing:2,children:[r.jsx(Y,{item:!0,xs:12,md:4,children:r.jsx(k,{fullWidth:!0,label:"نام و نام خانوادگی",name:"fullName",value:l.values.fullName,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.fullName&&!!l.errors.fullName,helperText:l.touched.fullName&&l.errors.fullName,disabled:h})}),r.jsx(Y,{item:!0,xs:12,md:4,children:r.jsx(k,{fullWidth:!0,label:"کد ملی",name:"nationalCode",value:l.values.nationalCode,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.nationalCode&&!!l.errors.nationalCode,helperText:l.touched.nationalCode&&l.errors.nationalCode,disabled:h})}),r.jsx(Y,{item:!0,xs:12,md:4,children:r.jsx(k,{fullWidth:!0,label:"شماره تلفن",name:"phoneNumber",value:l.values.phoneNumber,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.phoneNumber&&!!l.errors.phoneNumber,helperText:l.touched.phoneNumber&&l.errors.phoneNumber,disabled:h})}),r.jsx(Y,{item:!0,xs:12,md:4,children:r.jsx(k,{fullWidth:!0,label:"شهر",name:"city",value:l.values.city,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.city&&!!l.errors.city,helperText:l.touched.city&&l.errors.city,disabled:h})})]}),!h&&r.jsx(H6,{mt:2,children:r.jsx(N,{type:"submit",variant:"contained",color:"primary",disabled:l.isSubmitting,children:y?"ذخیره تغییرات":"ثبت اطلاعات"})})]})})})})};var U6={},s2=P6;Object.defineProperty(U6,"__esModule",{value:!0});var f0=U6.default=void 0,l2=s2(B6()),e2=r;f0=U6.default=(0,l2.default)((0,e2.jsx)("path",{d:"M13 8c0-2.21-1.79-4-4-4S5 5.79 5 8s1.79 4 4 4 4-1.79 4-4m2 2v2h3v3h2v-3h3v-2h-3V7h-2v3zM1 18v2h16v-2c0-2.66-5.33-4-8-4s-8 1.34-8 4"}),"PersonAddAlt1");var I6={},C2=P6;Object.defineProperty(I6,"__esModule",{value:!0});var $0=I6.default=void 0,t2=C2(B6()),c2=r;$0=I6.default=(0,t2.default)((0,c2.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow");const d2=({item:o,selectedAge1:n,selectedAge2:h,updateTable:C,readOnly:F})=>{const{userProfile:t}=I(S=>S.userSlice),s=G(),[l,i]=c.useState(null),H=S=>{i(S.currentTarget)},y=()=>{i(null)},x=!!l,$=x?"popover":void 0,[j]=c.useContext(V);return r.jsxs("div",{children:[r.jsx(au,{"aria-describedby":$,variant:"contained",color:"primary",onClick:H,children:r.jsx(x0,{})}),r.jsx(u0,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:$,open:x,anchorEl:l,onClose:y,children:r.jsxs(a0,{sx:{py:1,minWidth:200},children:[!F&&r.jsxs(r.Fragment,{children:[r.jsx(f,{title:"ثبت درخواست کشتار",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(M6({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت درخواست کشتار جدید",content:r.jsx(w0,{selectedAge1:n,selectedAge2:h,userCheck:o.poultry.userprofile.baseOrder,updateTable:C})}))},children:[r.jsx(B,{sx:{minWidth:36,color:"secondary.main"},children:r.jsx(W0,{fontSize:"small"})}),r.jsx(W,{primary:"ثبت درخواست کشتار",primaryTypographyProps:{variant:"body2"}})]})}),(o==null?void 0:o.InteractTypeName)==="مستاجر"&&r.jsx(f,{title:"ثبت مستاجر",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(U({title:"ثبت مستاجر ",content:r.jsx(n2,{item:o,updateTable:C})}))},children:[r.jsx(B,{sx:{minWidth:36,color:"primary.main"},children:r.jsx(f0,{fontSize:"small"})}),r.jsx(W,{primary:"ثبت مستاجر",primaryTypographyProps:{variant:"body2"}})]})}),(d()==="ProvinceOperator"||d()==="CityOperator"||d()==="CityPoultry"||d()==="CityJahad"||d()==="CityCommerce"||d()==="AdminX"||d()==="SuperAdmin")&&r.jsx(f,{title:o!=null&&o.violationReport?"ویرایش گزارش":"ثبت گزارش",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(U({title:o!=null&&o.violationReport?"ویرایش گزارش":"ثبت گزارش",content:r.jsx(z0,{updateTable:C,item:o})}))},children:[r.jsx(B,{sx:{minWidth:36,color:"primary.main"},children:r.jsx(v0,{fontSize:"small"})}),r.jsx(W,{primary:o!=null&&o.violationReport?"ویرایش گزارش":"ثبت گزارش",primaryTypographyProps:{variant:"body2"}})]})}),r.jsx(f,{title:"انتقال به بایگانی",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(M6({title:"انتقال به آرشیو",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:r.jsx(y0,{selectedAge1:n,selectedAge2:h,item:o,updateTable:C})}))},children:[r.jsx(B,{sx:{minWidth:36,color:"primary.main"},children:r.jsx(n0,{fontSize:"small"})}),r.jsx(W,{primary:"انتقال به بایگانی",primaryTypographyProps:{variant:"body2"}})]})}),(d()==="ProvinceOperator"||d()==="CityOperator"||d()==="AdminX"||d()==="SuperAdmin")&&r.jsx(f,{title:"ثبت تلفات",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(U({title:"ثبت تلفات",content:r.jsx(Z0,{updateTable:C,item:o})}))},children:[r.jsx(B,{sx:{minWidth:36,color:"error.main"},children:r.jsx(S0,{fontSize:"small"})}),r.jsx(W,{primary:"ثبت تلفات",primaryTypographyProps:{variant:"body2"}})]})}),r.jsx(f,{title:o!=null&&o.violation?"بازگشت از تخلف":"جوجه ریزی متخلف",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(h0({key:o==null?void 0:o.key,violation:!(o!=null&&o.violation)})).then(S=>{S.payload.error?j({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(C(),j({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:[r.jsx(B,{sx:{minWidth:36,color:o!=null&&o.violation?"primary.main":"error.main"},children:o!=null&&o.violation?r.jsx(H0,{fontSize:"small"}):r.jsx(j0,{fontSize:"small"})}),r.jsx(W,{primary:o!=null&&o.violation?"بازگشت از تخلف":"جوجه ریزی متخلف",primaryTypographyProps:{variant:"body2"}})]})})]}),(d()==="VetFarm"||d()==="CityVet"||d()==="VetSupervisor")&&r.jsx(f,{title:"ثبت تلفات پایان دوره",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(U({title:"ثبت تلفات پایان دوره",content:r.jsx(K0,{item:o,updateTable:C})}))},children:[r.jsx(B,{sx:{minWidth:36,color:"error.main"},children:r.jsx(q0,{fontSize:"small"})}),r.jsx(W,{primary:"ثبت تلفات پایان دوره",primaryTypographyProps:{variant:"body2"}})]})}),r.jsx(f,{title:"خروجی اکسل",placement:"left-start",children:r.jsxs(P,{component:"a",href:`${R.defaults.baseURL}process-for-each-hatching/?key=${o.key}`,rel:"noreferrer",children:[r.jsx(B,{sx:{minWidth:36,color:"success.main"},children:r.jsx(E6,{size:18})}),r.jsx(W,{primary:"خروجی اکسل",primaryTypographyProps:{variant:"body2"}})]})}),r.jsx(f,{title:"تیکت گزارش کشتار جوجه ریزی",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(Q0({licence_number:o==null?void 0:o.licenceNumber,mobile:t==null?void 0:t.mobile})).then(S=>{S.payload.error?j({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(C(),j({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:[r.jsx(B,{sx:{minWidth:36,color:"error.main"},children:r.jsx(O0,{fontSize:"small"})}),r.jsx(W,{primary:"تیکت گزارش کشتار",primaryTypographyProps:{variant:"body2"}})]})})]})})]})},k2=({item:o,selectedAge1:n,selectedAge2:h,updateTable:C,readOnly:F})=>{const t=G(),[s]=c.useContext(V),[l,i]=c.useState(null),H=!!l,y=H?"archive-activate-popover":void 0,x=L=>{F||i(L.currentTarget)},$=()=>{i(null)},j=()=>{F||($(),t(M6({title:"انتقال به آرشیو",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:r.jsx(y0,{selectedAge1:n,selectedAge2:h,item:o,updateTable:C})})))},S=async()=>{var L,b,Q,T;if(!F){t(K());try{const{data:v}=await R.put("poultry_hatching/0/",{key:o==null?void 0:o.key,unknown:!1});if(t(w()),v!=null&&v.error){s({vertical:"top",horizontal:"center",msg:(v==null?void 0:v.error)||"فعال‌سازی ناموفق بود.",severity:"error"});return}C(),$(),s({vertical:"top",horizontal:"center",msg:"فعال‌سازی با موفقیت انجام شد.",severity:"success"})}catch(v){t(w());const M=((b=(L=v==null?void 0:v.response)==null?void 0:L.data)==null?void 0:b.result)||((T=(Q=v==null?void 0:v.response)==null?void 0:Q.data)==null?void 0:T.error)||(v==null?void 0:v.message)||"فعال‌سازی ناموفق بود.";s({vertical:"top",horizontal:"center",msg:M,severity:"error"}),$()}}};return r.jsxs(r.Fragment,{children:[r.jsx(au,{"aria-describedby":y,color:"primary",onClick:x,size:"small",disabled:F,children:r.jsx(x0,{})}),r.jsx(u0,{id:y,open:H,anchorEl:l,onClose:$,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:r.jsxs(a0,{sx:{py:1,minWidth:160},children:[r.jsxs(P,{onClick:j,disabled:F,children:[r.jsx(B,{sx:{minWidth:36,color:"primary.main"},children:r.jsx(n0,{fontSize:"small"})}),r.jsx(W,{primary:"بایگانی",primaryTypographyProps:{variant:"body2"}})]}),r.jsxs(P,{onClick:S,disabled:F,children:[r.jsx(B,{sx:{minWidth:36,color:"success.main"},children:r.jsx($0,{fontSize:"small"})}),r.jsx(W,{primary:"فعال سازی",primaryTypographyProps:{variant:"body2"}})]})]})})]})},_2=({readOnly:o})=>{var su,lu,eu,Cu,tu,cu,du,Au,gu,g,a,z,pu,hu;const n=G(),h=o||!1,[C,F]=c.useState(0),[t,s]=c.useState(0),[l,i]=c.useState([]),[H,y]=c.useState(0),[x,$]=c.useState(10),[j,S]=c.useState(""),[L,b]=c.useState(1),[Q,T]=c.useState([]),v=I(A=>A.userSlice.userProfile.key),M=A0(),[X]=c.useContext(V),E=A=>{S(A.target.value)},D=I(A=>A.citySlice.hatchingAdded);c.useEffect(()=>{O(1)},[D]);const O=async A=>{n(K());const u=await R.get(`poultry_hatching?search=filter&value=${j}&role=${d()}&page=${A}&page_size=${x}&age1=${C||0}&age2=${t||0}&search=filter&value=${j}`);n(w()),i(u.data.results),y(u.data.count)},W6=A=>{O(A),b(A)},w6=A=>{$(A),b(1)};c.useEffect(()=>{O(1)},[n,x]);const z6=()=>{O(L!==0?L:1)};c.useEffect(()=>{const A=l==null?void 0:l.map((u,J)=>{var yu,xu,vu,iu,Fu,ju,Su,fu,$u,Lu,bu,Eu,Du,ku,_u,Ru,Hu,Tu,Nu,Pu,Bu,Wu,wu,zu,qu,Ku,Qu,Mu,Ou,Yu,Uu,Iu,Vu,Gu,Xu,Ju,Zu,mu,u6,a6,r6,o6,n6,s6,l6,e6,C6,t6,c6,d6,A6,g6,p6,h6,y6,x6,v6,i6,F6,j6,S6,f6,$6,L6,b6,V6,G6,X6,J6;return[r.jsx(d2,{selectedAge1:null,selectedAge2:null,updateTable:z6,item:u,readOnly:h},"4"),r.jsx(f,{placement:"left",title:"جزئیات جوجه ریزی",children:r.jsx(au,{color:"primary",onClick:()=>{M(d()==="AdminX"?`${l0}/${u.key}`:d()==="Supporter"?`${e0}/${u.key}`:d()==="SuperAdmin"?`${C0}/${u.key}`:d()==="CityPoultry"?`${t0}/${u.key}`:d()==="ProvinceSupervisor"?`${c0}/${u.key}`:d()==="ProvinceOperator"?`${d0}/${u.key}`:d()==="CityJahad"?`${T0}/${u.key}`:"")},children:r.jsx(s0,{})})},u==null?void 0:u.key),L===1?J+1:J+x*(L-1)+1,r.jsx(f,{disableHoverListener:!((yu=u==null?void 0:u.killingInfo)!=null&&yu.violationMessage&&(u!=null&&u.violation)),title:u!=null&&u.violation?`متن گزارش تخلف: ${(xu=u==null?void 0:u.killingInfo)==null?void 0:xu.violationMessage}`:null,sx:{"&:hover":{cursor:u!=null&&u.violation?"pointer":"default"}},placement:"top",children:r.jsx(_,{variant:"body2",color:u!=null&&u.violation?"error":"primary",children:u!=null&&u.violation?"پیگیری":"عادی"})},u==null?void 0:u.key),u==null?void 0:u.licenceNumber,(vu=u==null?void 0:u.poultry)==null?void 0:vu.breedingUniqueId,u==null?void 0:u.CertId,((iu=u==null?void 0:u.poultry)==null?void 0:iu.unitName)||"-",`${((ju=(Fu=u==null?void 0:u.poultry)==null?void 0:Fu.userprofile)==null?void 0:ju.fullName)??"-"} (${((fu=(Su=u==null?void 0:u.poultry)==null?void 0:Su.userprofile)==null?void 0:fu.mobile)??"-"}) ${u!=null&&u.violationReport?"✉️":""}`,u!=null&&u.InteractTypeName?r.jsx(_,{variant:"body2",color:u!=null&&u.hasTenant?"success.main":"",fontWeight:u!=null&&u.hasTenant?"bold":"normal",children:u==null?void 0:u.InteractTypeName}):"-",u==null?void 0:u.PersonTypeName,u==null?void 0:u.UnionTypeName,`${((bu=(Lu=($u=u==null?void 0:u.poultry)==null?void 0:$u.address)==null?void 0:Lu.city)==null?void 0:bu.name)??"-"}/${(Eu=u==null?void 0:u.poultry)!=null&&Eu.cityOperator?(Du=u==null?void 0:u.poultry)==null?void 0:Du.cityOperator:"بدون تعاونی"}`,(ku=u==null?void 0:u.vetFarm)!=null&&ku.vetFarmMobile?`${(_u=u==null?void 0:u.vetFarm)==null?void 0:_u.vetFarmFullName} (${(Ru=u==null?void 0:u.vetFarm)==null?void 0:Ru.vetFarmMobile})`:"-",u.hall,u.period,q(u==null?void 0:u.createDate),q(u==null?void 0:u.date),(Tu=(Hu=u==null?void 0:u.poultry)==null?void 0:Hu.killingAveAge)==null?void 0:Tu.toLocaleString(),u!=null&&u.predicateDate?Z(u==null?void 0:u.predicateDate):"-",u.chickenBreed,u.age,(Nu=u==null?void 0:u.quantity)==null?void 0:Nu.toLocaleString(),(Pu=u==null?void 0:u.increaseQuantity)==null?void 0:Pu.toLocaleString(),`${u.losses} (%${(u.losses*100/u.quantity).toFixed(0)})`,r.jsx(f,{placement:"top",title:"جهت مشاهده ثبت کننده تلفات کلیک کنید",children:r.jsx(N,{style:{color:"rgba(0,0,0,0.87)"},onClick:()=>{n(U({title:"ویرایش تعداد جوجه ریزی",content:r.jsx(p,{container:!0,xs:12,children:!(u!=null&&u.directLossesInputer)&&!(u!=null&&u.directLossesInputer)?r.jsx(_,{variant:"body1",children:"برای این جوجه ریزی تلفاتی ثبت نشده است."}):r.jsxs(p,{xs:12,children:[r.jsxs(_,{variant:"body1",children:["ثبت کننده تلفات اتحادیه:"," ",u!=null&&u.directLossesInputer?`${u==null?void 0:u.directLossesInputer} در تاریخ ${Z(u==null?void 0:u.directLossesDate)}`:" - "]}),r.jsxs(_,{variant:"body1",children:["ویرایش کننده تلفات اتحادیه:",u!=null&&u.directLossesEditor?`${u==null?void 0:u.directLossesEditor} در تاریخ ${Z(u==null?void 0:u.directLossesLastEditDate)}`:" - "]})]})})}))},children:`${(Bu=u==null?void 0:u.directLosses)==null?void 0:Bu.toLocaleString()} (%${(u.directLosses*100/u.quantity).toFixed(0)})`})},u==null?void 0:u.key),`${(Wu=u==null?void 0:u.totalLosses)==null?void 0:Wu.toLocaleString()} (%${(u.totalLosses*100/u.quantity).toFixed(0)})`,`${(wu=u==null?void 0:u.totalCommitmentQuantity)==null?void 0:wu.toLocaleString()}`,`${(zu=u==null?void 0:u.totalFreeCommitmentQuantity)==null?void 0:zu.toLocaleString()}`,`${(qu=u==null?void 0:u.governmentalQuantity)==null?void 0:qu.toLocaleString()}`,`${(Ku=u==null?void 0:u.governmentalKilledQuantity)==null?void 0:Ku.toLocaleString()}`,`${(Qu=u==null?void 0:u.freeQuantity)==null?void 0:Qu.toLocaleString()}`,`${(Mu=u==null?void 0:u.freeKilledQuantity)==null?void 0:Mu.toLocaleString()}`,`${(Ou=u==null?void 0:u.outProvinceKilledQuantity)==null?void 0:Ou.toLocaleString()}`,`${(Yu=u==null?void 0:u.outProvinceKilledWeight)==null?void 0:Yu.toLocaleString()}`,`${(Uu=u==null?void 0:u.barDifferenceRequestQuantity)==null?void 0:Uu.toLocaleString()}`,`${(Iu=u==null?void 0:u.barDifferenceRequestWeight)==null?void 0:Iu.toLocaleString()}`,`${(Gu=(Vu=u==null?void 0:u.killingInfo)==null?void 0:Vu.provinceKillRequests)==null?void 0:Gu.toLocaleString()}`,`${(Ju=(Xu=u==null?void 0:u.killingInfo)==null?void 0:Xu.provinceKillRequestsQuantity)==null?void 0:Ju.toLocaleString()}`,`${(mu=(Zu=u==null?void 0:u.killingInfo)==null?void 0:Zu.provinceKillRequestsWeight)==null?void 0:mu.toLocaleString()}`,((u6=u==null?void 0:u.killedQuantity)==null?void 0:u6.toLocaleString())+` (%${((u==null?void 0:u.killedQuantity)*100/u.quantity).toFixed(0)})`,(a6=u==null?void 0:u.leftOver)==null?void 0:a6.toLocaleString(),`%${((u==null?void 0:u.leftOver)*100/(u==null?void 0:u.quantity)).toFixed(0)}`,`%${(u.totalLosses*100/u.quantity).toFixed(0)}`,`%${((u==null?void 0:u.killedQuantity)*100/u.quantity).toFixed(0)}`,`%${((u==null?void 0:u.leftOver)*100/(u==null?void 0:u.quantity)).toFixed(0)}`,`%${(((u==null?void 0:u.killedQuantity)+(u==null?void 0:u.totalLosses))*100/(u==null?void 0:u.quantity)).toFixed(0)}`,u!=null&&u.samasatDischargePercentage?`%${u==null?void 0:u.samasatDischargePercentage}`:"-",(r6=u==null?void 0:u.totalCommitment)==null?void 0:r6.toLocaleString(),(o6=u==null?void 0:u.governmentalKilledQuantity)==null?void 0:o6.toLocaleString(),(n6=u==null?void 0:u.freeKilledQuantity)==null?void 0:n6.toLocaleString(),(s6=u==null?void 0:u.totalAverageKilledWeight)==null?void 0:s6.toLocaleString(),(l6=u==null?void 0:u.totalKilledWeight)==null?void 0:l6.toLocaleString(),(e6=u==null?void 0:u.activeKill)!=null&&e6.activeKill?"دارد":"ندارد",(C6=u==null?void 0:u.activeKill)!=null&&C6.countOfRequest?u.activeKill.countOfRequest:"-",(c6=(t6=u==null?void 0:u.killingInfo)==null?void 0:t6.killHouseRequests)==null?void 0:c6.toLocaleString(),(A6=(d6=u==null?void 0:u.killingInfo)==null?void 0:d6.killHouseRequestsFirstQuantity)==null?void 0:A6.toLocaleString(),(p6=(g6=u==null?void 0:u.killingInfo)==null?void 0:g6.killHouseRequestsFirstWeight)==null?void 0:p6.toLocaleString(),(y6=(h6=u==null?void 0:u.killingInfo)==null?void 0:h6.barCompleteWithKillHouse)==null?void 0:y6.toLocaleString(),(v6=(x6=u==null?void 0:u.killingInfo)==null?void 0:x6.acceptedRealWightFinal)==null?void 0:v6.toLocaleString(),(i6=u==null?void 0:u.chainKilledQuantity)==null?void 0:i6.toLocaleString(),(F6=u==null?void 0:u.chainKilledWeight)==null?void 0:F6.toLocaleString(),(j6=u==null?void 0:u.exportKilledQuantity)==null?void 0:j6.toLocaleString(),(S6=u==null?void 0:u.exportKilledWeight)==null?void 0:S6.toLocaleString(),($6=(f6=u==null?void 0:u.killingInfo)==null?void 0:f6.wareHouseBars)==null?void 0:$6.toLocaleString(),(b6=(L6=u==null?void 0:u.killingInfo)==null?void 0:L6.wareHouseBarsQuantity)==null?void 0:b6.toLocaleString(),(G6=(V6=u==null?void 0:u.killingInfo)==null?void 0:V6.wareHouseBarsWeight)==null?void 0:G6.toLocaleString(),(J6=(X6=u==null?void 0:u.killingInfo)==null?void 0:X6.wareHouseBarsWeightLose)==null?void 0:J6.toFixed(2),u.lastChange?`${u.lastChange.fullName} (${T6(u.lastChange.role)}) در تاریخ ${q(u.lastChange.date)}`:"-",u.latestHatchingChange?`${u.latestHatchingChange.fullName} (${T6(u.latestHatchingChange.role)}) در تاریخ ${q(u.latestHatchingChange.date)}`:"-",u!=null&&u.violationReport?r.jsx(N,{onClick:()=>{var Z6;n(U({title:"گزارش ",content:r.jsx(i0,{columns:["ثبت کننده","تاریخ ثبت","تخلف","متن گزارش","سند"],data:[[u==null?void 0:u.violationReporter,Z(u==null?void 0:u.violationReportDate),u!=null&&u.violation?"دارد":"ندارد",u==null?void 0:u.violationReport,r.jsx(p,{container:!0,xs:12,justifyContent:"center",gap:1,children:(Z6=u==null?void 0:u.violationImage)==null?void 0:Z6.map(L0=>r.jsx(F0,{src:L0},J))},u==null?void 0:u.key)]]})}))},children:"مشاهده گزارش"},u==null?void 0:u.key):"بدون گزارش"]});T(A)},[l]);const ou=async A=>{A.preventDefault(),n(K()),n(m({age1:C,age2:t,tab:"active",textValue:j}));try{const u=await R.get(`poultry_hatching/?role=${d()}&age1=${C||0}&age2=${t||0}&search=filter&value=${j}&page=1&page_size=${x}`);i(u.data.results),y(u.data.count),n(w())}catch(u){console.error("Error fetching data:",u)}},D6=async A=>{A.preventDefault(),F(0),s(0),n(K()),S(""),n(m({age1:0,age2:0,tab:"active",textValue:j}));try{const u=await R.get(`poultry_hatching?role=${d()}&page=${L}&page_size=${x}&search=filter&value=${j}`);i(u.data.results),y(u.data.count)}catch(u){console.error("Error fetching data:",u)}finally{n(w())}},[nu,k6]=c.useState();c.useEffect(()=>{async function A(){try{const u=await R.get("last_update/?type=poultry_hatching");k6(u.data)}catch(u){console.error("Error fetching data:",u)}}A()},[]);const _6=r.jsxs(p,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,xs:12,mt:2,children:[r.jsx("form",{onSubmit:ou,style:{flex:1},children:r.jsxs(p,{container:!0,alignItems:"center",gap:N0.SMALL,xs:12,children:[r.jsx(p,{sx:{width:{xs:"72px",sm:"80px"}},children:r.jsx(k,{fullWidth:!0,size:"small",label:"از سن",id:"outlined-controlled",value:C,onChange:A=>{F(A.target.value)}})}),r.jsx(p,{sx:{width:{xs:"72px",sm:"80px"}},children:r.jsx(k,{fullWidth:!0,size:"small",label:"تا سن",id:"outlined-controlled",value:t,onChange:A=>{s(A.target.value)}})}),r.jsx(k,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",value:j,sx:{maxWidth:{xs:"100%",sm:250}},onChange:E,onKeyDown:A=>{A.key==="Enter"&&ou(A)}}),r.jsx(N,{type:"submit",endIcon:r.jsx(g0,{}),children:"جستجو"}),r.jsx(f,{title:"خروجی اکسل",px:0,children:r.jsx(N,{color:"success",onClick:()=>{X({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const A=`${R.defaults.baseURL}0/hatching_excel/?role=${d()}&key=${v}&age1=${C||0}&age2=${t||0}&search=filter&value=${j}`;window.location.href=A},children:r.jsx(E6,{size:32})})})]})}),r.jsx(N,{onClick:D6,color:"error",children:"حذف فیلتر"})]}),{hatchingInfoFull:e}=I(A=>A.citySlice);return c.useEffect(()=>{n(m({age1:C,age2:t,tab:"active",textValue:j}))},[]),r.jsxs(p,{alignItems:"center",justifyContent:"center",mt:2,children:[r.jsx(p,{alignItems:"center",justifyContent:"center",isDashboard:!0,children:r.jsx(ru,{noPagination:!0,isDashboard:!0,title:nu&&`آخرین بروزرسانی : ${q(nu)} ‌ ‌`,columns:["تعداد فارم","تعداد جوجه ریزی","حجم کل جوجه ریزی","حجم باقی مانده در سالن","حجم کشتار شده","وزن کشتار شده","حجم کل تلفات","حجم تلفات اتحادیه","حجم تلفات دامپزشک","مانده سالن ( 20 تا 30 روزه)","مانده سالن ( 30 تا 40 روزه)","مانده سالن ( 40 تا 50 روزه)","مانده سالن ( 50 تا 60 روزه)","بیشتر از 60 روزه"],data:[[(su=e==null?void 0:e.poultries)==null?void 0:su.toLocaleString(),(lu=e==null?void 0:e.hatchings)==null?void 0:lu.toLocaleString(),(eu=e==null?void 0:e.totalHatchingQuantity)==null?void 0:eu.toLocaleString(),(Cu=e==null?void 0:e.totalHatchingLeftOverQuantity)==null?void 0:Cu.toLocaleString(),(tu=e==null?void 0:e.totalHatchingKilledQuantity)==null?void 0:tu.toLocaleString(),(cu=e==null?void 0:e.totalHatchingKilledWeight)==null?void 0:cu.toLocaleString(),(du=e==null?void 0:e.totalHatchingAllLosses)==null?void 0:du.toLocaleString(),(Au=e==null?void 0:e.totalHatchingUnionLosses)==null?void 0:Au.toLocaleString(),(gu=e==null?void 0:e.totalHatchingVetLosses)==null?void 0:gu.toLocaleString(),(g=e==null?void 0:e.age2030)==null?void 0:g.toLocaleString(),(a=e==null?void 0:e.age3040)==null?void 0:a.toLocaleString(),(z=e==null?void 0:e.age4050)==null?void 0:z.toLocaleString(),(pu=e==null?void 0:e.age5060)==null?void 0:pu.toLocaleString(),(hu=e==null?void 0:e.ageMoreThan60)==null?void 0:hu.toLocaleString()]]})}),_6,r.jsx(ru,{data:Q,columns:["عملیات","جزئیات","ردیف","وضعیت","شماره مجوز جوجه ریزی","شناسه یکتا","مجوز بهداشتی جوجه ریزی","نام فارم","مرغدار","بهره برداری","مالکیت","ارتباط","شهر/تعاونی","دامپزشک فارم","سالن","دوره جوجه ریزی","تاریخ ثبت جوجه ریزی","تاریخ جوجه ریزی","میانگین سن کشتار","پیش بینی تاریخ کشتار","نژاد","سن","حجم جوجه ریزی","حجم افزایشی","تلفات دامپزشک","تلفات اتحادیه","تلفات کل","حجم تعهد دولتی","حجم تعهد آزاد","حجم کشتار دولتی","وزن کشتار دولتی","حجم کشتار آزاد","وزن کشتار شده آزاد","حجم فروش به خارج استان","وزن فروش به خارج استان","حجم اختلاف کشتار","وزن اختلاف کشتار","تخصیصات بدون بار","حجم تخصیصات بدون بار","وزن تخصیصات بدون بار","حجم کشتار شده","حجم مانده در سالن","درصد مانده در سالن"," تلفات"," کشتار شده"," باقی مانده در سالن","تایید تخلیه رصدیار"," تایید تخلیه در سماصط","وزن تعهد دولتی","وزن کشتار دولتی","وزن کشتار آزاد","میانگین وزن کشتار","وزن کل کشتار شده","تعداد کشتار فعال","تعداد درخواست کشتار","تعداد بارها","حجم بارها","وزن بارها","حجم بارهای تحویلی","وزن بارهای تحویلی","حجم زنجیره","وزن زنجیره","حجم صادرات","وزن صادرات","بارهای ورودی به انبار","حجم لاشه های انبار","وزن لاشه های انبار","درصد افت بارها","آخرین تغییر","سازنده جوجه ریزی","گزارش"],handlePageChange:W6,totalRows:H,page:L,perPage:x,handlePerRowsChange:w6,title:"جوجه ریزی های فعال"})]})},R2=({readOnly:o})=>{var D6,nu,k6,_6,e,su,lu,eu,Cu,tu,cu,du,Au,gu;const[,,n,h,C,F]=c.useContext(V),t=I(g=>g.userSlice.userProfile.key),{hatchingInfoFull:s}=I(g=>g.citySlice),l=A0(),i=G();c.useEffect(()=>{const g=uu(new Date).format("YYYY-MM-DD");h(g),F(g)},[]);const H=g=>{Q(g.target.value)},[y,x]=c.useState([]),[$,j]=c.useState(0),[S,L]=c.useState(10),[b,Q]=c.useState(""),[T,v]=c.useState(1),[M,X]=c.useState([]),[E,D]=c.useState(!1),O=async g=>{i(K());const a=await R.get(`poultry_hatching/?archive=true&search=filter&value=${b}&role=${d()} + &key=${t}&page=${g}&page_size=${S}${E?`&date1=${n}&date2=${C}`:""}`);i(w()),x(a.data.results),j(a.data.count)},W6=g=>{O(g),v(g)},w6=g=>{L(g),v(1)},z6=()=>{O(T!==0?T:1)};c.useEffect(()=>{const g=y==null?void 0:y.map((a,z)=>{var pu,hu,A,u,J,yu,xu,vu,iu,Fu,ju,Su,fu,$u,Lu,bu,Eu,Du,ku,_u,Ru,Hu,Tu,Nu,Pu,Bu,Wu,wu,zu,qu,Ku,Qu,Mu,Ou,Yu,Uu,Iu,Vu,Gu,Xu,Ju,Zu,mu,u6,a6,r6,o6,n6,s6,l6,e6,C6,t6,c6,d6,A6,g6,p6,h6,y6,x6,v6,i6,F6,j6,S6,f6,$6,L6,b6;return[r.jsx(M0,{item:a,updateArchive:z6,readOnly:o},z),r.jsx(f,{placement:"left",title:" جزئیات",children:r.jsx(au,{color:"primary",onClick:()=>{l(d()==="AdminX"?`${l0}/${a.key}`:d()==="Supporter"?`${e0}/${a.key}`:d()==="SuperAdmin"?`${C0}/${a.key}`:d()==="CityPoultry"?`${t0}/${a.key}`:d()==="ProvinceSupervisor"?`${c0}/${a.key}`:d()==="province"?`${d0}/${a.key}`:d()==="CityJahad"?`${P0}/${a.key}`:"")},children:r.jsx(s0,{})})},z),T===1?z+1:z+S*(T-1)+1,r.jsx(f,{disableHoverListener:!((pu=a==null?void 0:a.killingInfo)!=null&&pu.violationMessage&&(a!=null&&a.violation)),title:a!=null&&a.violation?`متن گزارش تخلف: ${(hu=a==null?void 0:a.killingInfo)==null?void 0:hu.violationMessage}`:null,sx:{"&:hover":{cursor:a!=null&&a.violation?"pointer":"default"}},placement:"top",children:r.jsx(_,{variant:"body2",color:a!=null&&a.violation?"error":"primary",children:a!=null&&a.violation?"متخلف":"عادی"})},z),a==null?void 0:a.licenceNumber,(A=a==null?void 0:a.poultry)==null?void 0:A.breedingUniqueId,(a==null?void 0:a.CertId)||"-",((u=a==null?void 0:a.poultry)==null?void 0:u.unitName)||"-",`${((yu=(J=a==null?void 0:a.poultry)==null?void 0:J.userprofile)==null?void 0:yu.fullName)??"-"} (${((vu=(xu=a==null?void 0:a.poultry)==null?void 0:xu.userprofile)==null?void 0:vu.mobile)??"-"})`,a==null?void 0:a.InteractTypeName,a==null?void 0:a.PersonTypeName,a==null?void 0:a.UnionTypeName,`${((ju=(Fu=(iu=a==null?void 0:a.poultry)==null?void 0:iu.address)==null?void 0:Fu.city)==null?void 0:ju.name)??"-"}/${(Su=a==null?void 0:a.poultry)!=null&&Su.cityOperator?(fu=a==null?void 0:a.poultry)==null?void 0:fu.cityOperator:"بدون تعاونی"}`,($u=a==null?void 0:a.vetFarm)!=null&&$u.vetFarmMobile?`${(Lu=a==null?void 0:a.vetFarm)==null?void 0:Lu.vetFarmFullName} (${(bu=a==null?void 0:a.vetFarm)==null?void 0:bu.vetFarmMobile})`:"-",(a==null?void 0:a.hall)||"-",(a==null?void 0:a.period)||"-",q(a==null?void 0:a.createDate),q(a==null?void 0:a.date),(Du=(Eu=a==null?void 0:a.poultry)==null?void 0:Eu.killingAveAge)==null?void 0:Du.toLocaleString(),a!=null&&a.predicateDate?Z(a==null?void 0:a.predicateDate):"-",a.chickenBreed||"-",(a==null?void 0:a.age)||"-",a!=null&&a.archiveDate?q(a==null?void 0:a.archiveDate):"-",a.nowAge||"-",(ku=a==null?void 0:a.quantity)==null?void 0:ku.toLocaleString(),((_u=a==null?void 0:a.increaseQuantity)==null?void 0:_u.toLocaleString())||"-",`${a.losses} (%${(a.losses*100/a.quantity).toFixed(0)})`,`${(Ru=a==null?void 0:a.directLosses)==null?void 0:Ru.toLocaleString()} (%${(a.directLosses*100/a.quantity).toFixed(0)})`,`${(Hu=a==null?void 0:a.totalLosses)==null?void 0:Hu.toLocaleString()} (%${(a.totalLosses*100/a.quantity).toFixed(0)})`,`${(Tu=a==null?void 0:a.totalCommitmentQuantity)==null?void 0:Tu.toLocaleString()}`,`${(Nu=a==null?void 0:a.totalFreeCommitmentQuantity)==null?void 0:Nu.toLocaleString()}`,`${(Pu=a==null?void 0:a.governmentalQuantity)==null?void 0:Pu.toLocaleString()}`,`${(Bu=a==null?void 0:a.governmentalKilledQuantity)==null?void 0:Bu.toLocaleString()}`,`${(Wu=a==null?void 0:a.freeQuantity)==null?void 0:Wu.toLocaleString()}`,`${(wu=a==null?void 0:a.freeKilledQuantity)==null?void 0:wu.toLocaleString()}`,`${(zu=a==null?void 0:a.outProvinceKilledQuantity)==null?void 0:zu.toLocaleString()}`,`${(qu=a==null?void 0:a.outProvinceKilledWeight)==null?void 0:qu.toLocaleString()}`,`${(Ku=a==null?void 0:a.barDifferenceRequestQuantity)==null?void 0:Ku.toLocaleString()}`,`${(Qu=a==null?void 0:a.barDifferenceRequestWeight)==null?void 0:Qu.toLocaleString()}`,`${(Ou=(Mu=a==null?void 0:a.killingInfo)==null?void 0:Mu.provinceKillRequests)==null?void 0:Ou.toLocaleString()}`,`${(Uu=(Yu=a==null?void 0:a.killingInfo)==null?void 0:Yu.provinceKillRequestsQuantity)==null?void 0:Uu.toLocaleString()}`,`${(Vu=(Iu=a==null?void 0:a.killingInfo)==null?void 0:Iu.provinceKillRequestsWeight)==null?void 0:Vu.toLocaleString()}`,((Gu=a==null?void 0:a.killedQuantity)==null?void 0:Gu.toLocaleString())+` (%${((a==null?void 0:a.killedQuantity)*100/a.quantity).toFixed(0)})`,`${(Xu=a==null?void 0:a.leftOver)==null?void 0:Xu.toLocaleString()} (%${(a.leftOver*100/a.quantity).toFixed(0)})`,`${(Ju=a==null?void 0:a.quantity)==null?void 0:Ju.toLocaleString()}`,`%${(a.totalLosses*100/a.quantity).toFixed(0)}`,`%${((a==null?void 0:a.killedQuantity)*100/a.quantity).toFixed(0)}`,`%${(((a==null?void 0:a.killedQuantity)+(a==null?void 0:a.totalLosses))*100/(a==null?void 0:a.quantity)).toFixed(0)}`,a!=null&&a.samasatDischargePercentage?`%${a==null?void 0:a.samasatDischargePercentage}`:"-",(Zu=a==null?void 0:a.totalCommitment)==null?void 0:Zu.toLocaleString(),(mu=a==null?void 0:a.governmentalKilledQuantity)==null?void 0:mu.toLocaleString(),(u6=a==null?void 0:a.freeKilledQuantity)==null?void 0:u6.toLocaleString(),(a6=a==null?void 0:a.totalAverageKilledWeight)==null?void 0:a6.toLocaleString(),(r6=a==null?void 0:a.totalKilledWeight)==null?void 0:r6.toLocaleString(),(o6=a==null?void 0:a.activeKill)!=null&&o6.activeKill?"دارد":"ندارد",(n6=a==null?void 0:a.activeKill)!=null&&n6.countOfRequest?a.activeKill.countOfRequest:"-",(l6=(s6=a==null?void 0:a.killingInfo)==null?void 0:s6.killHouseRequests)==null?void 0:l6.toLocaleString(),(C6=(e6=a==null?void 0:a.killingInfo)==null?void 0:e6.killHouseRequestsFirstQuantity)==null?void 0:C6.toLocaleString(),(c6=(t6=a==null?void 0:a.killingInfo)==null?void 0:t6.killHouseRequestsFirstWeight)==null?void 0:c6.toLocaleString(),(A6=(d6=a==null?void 0:a.killingInfo)==null?void 0:d6.barCompleteWithKillHouse)==null?void 0:A6.toLocaleString(),(p6=(g6=a==null?void 0:a.killingInfo)==null?void 0:g6.acceptedRealWightFinal)==null?void 0:p6.toLocaleString(),(h6=a==null?void 0:a.chainKilledQuantity)==null?void 0:h6.toLocaleString(),(y6=a==null?void 0:a.chainKilledWeight)==null?void 0:y6.toLocaleString(),(x6=a==null?void 0:a.exportKilledQuantity)==null?void 0:x6.toLocaleString(),(v6=a==null?void 0:a.exportKilledWeight)==null?void 0:v6.toLocaleString(),(F6=(i6=a==null?void 0:a.killingInfo)==null?void 0:i6.wareHouseBars)==null?void 0:F6.toLocaleString(),(S6=(j6=a==null?void 0:a.killingInfo)==null?void 0:j6.wareHouseBarsQuantity)==null?void 0:S6.toLocaleString(),($6=(f6=a==null?void 0:a.killingInfo)==null?void 0:f6.wareHouseBarsWeight)==null?void 0:$6.toLocaleString(),(b6=(L6=a==null?void 0:a.killingInfo)==null?void 0:L6.wareHouseBarsWeightLose)==null?void 0:b6.toFixed(2),a.lastChange?`${a.lastChange.fullName} (${T6(a.lastChange.role)}) در تاریخ ${q(a.lastChange.date)}`:"-",a.latestHatchingChange?`${a.latestHatchingChange.fullName} (${T6(a.latestHatchingChange.role)}) در تاریخ ${q(a.latestHatchingChange.date)}`:"-",a!=null&&a.violationReport?r.jsx(N,{onClick:()=>{i(U({title:"گزارش ",content:r.jsx(i0,{columns:["ثبت کننده","تاریخ ثبت","تخلف","متن گزارش","سند"],data:[[a==null?void 0:a.violationReporter,Z(a==null?void 0:a.violationReportDate),a!=null&&a.violation?"دارد":"ندارد",a==null?void 0:a.violationReport,r.jsx(F0,{src:a==null?void 0:a.violationImage},z)]]})}))},children:"نمایش"},z):"بدون گزارش"]});X(g)},[y]),c.useEffect(()=>{O(1)},[n,C,S,E]),c.useEffect(()=>{i(m(E?{tab:"archive",date1:n,date2:C,textValue:b}:{tab:"archive",textValue:b}))},[i,E,n,C]);const ou=async g=>{g.preventDefault(),i(K());try{const a=await R.get(`poultry_hatching/?archive=true&search=filter&value=${b}&role=${d()}&key=${t}&page=1&page_size=${S}${E?`&date1=${n}&date2=${C}`:""}`);i(m(E?{tab:"archive",date1:n,date2:C,textValue:b}:{tab:"archive",textValue:b})),x(a.data.results),j(a.data.count),i(w())}catch(a){console.error("Error fetching data:",a)}};return r.jsxs(p,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[r.jsx(p,{alignItems:"center",justifyContent:"center",isDashboard:!0,children:r.jsx(ru,{noPagination:!0,isDashboard:!0,title:null,columns:["تعداد فارم","تعداد جوجه ریزی","حجم کل جوجه ریزی","حجم باقی مانده در سالن","حجم کشتار شده","وزن کشتار شده","حجم کل تلفات","حجم تلفات اتحادیه","حجم تلفات دامپزشک","مانده سالن ( 20 تا 30 روزه)","مانده سالن ( 30 تا 40 روزه)","مانده سالن ( 40 تا 50 روزه)","مانده سالن ( 50 تا 60 روزه)","بیشتر از 60 روزه"],data:[[(D6=s==null?void 0:s.poultries)==null?void 0:D6.toLocaleString(),(nu=s==null?void 0:s.hatchings)==null?void 0:nu.toLocaleString(),(k6=s==null?void 0:s.totalHatchingQuantity)==null?void 0:k6.toLocaleString(),(_6=s==null?void 0:s.totalHatchingLeftOverQuantity)==null?void 0:_6.toLocaleString(),(e=s==null?void 0:s.totalHatchingKilledQuantity)==null?void 0:e.toLocaleString(),(su=s==null?void 0:s.totalHatchingKilledWeight)==null?void 0:su.toLocaleString(),(lu=s==null?void 0:s.totalHatchingAllLosses)==null?void 0:lu.toLocaleString(),(eu=s==null?void 0:s.totalHatchingUnionLosses)==null?void 0:eu.toLocaleString(),(Cu=s==null?void 0:s.totalHatchingVetLosses)==null?void 0:Cu.toLocaleString(),(tu=s==null?void 0:s.age2030)==null?void 0:tu.toLocaleString(),(cu=s==null?void 0:s.age3040)==null?void 0:cu.toLocaleString(),(du=s==null?void 0:s.age4050)==null?void 0:du.toLocaleString(),(Au=s==null?void 0:s.age5060)==null?void 0:Au.toLocaleString(),(gu=s==null?void 0:s.ageMoreThan60)==null?void 0:gu.toLocaleString()]]})}),r.jsxs(p,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[r.jsxs(p,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[r.jsx(b0,{icon:r.jsx(U0,{}),checkedIcon:r.jsx(I0,{}),checked:E,onChange:()=>D(!E),color:"primary",size:"large"}),r.jsx(p,{children:r.jsx(N6,{disabled:!E,label:"از تاریخ",id:"date",renderInput:g=>r.jsx(k,{size:"small",style:{width:"160px"},...g}),value:n,onChange:g=>{h(uu(g).format("YYYY-MM-DD"))}})}),r.jsx(p,{children:r.jsx(N6,{disabled:!E,label:"تا تاریخ",id:"date",renderInput:g=>r.jsx(k,{size:"small",style:{width:"160px"},...g}),value:C,onChange:g=>{F(uu(g).format("YYYY-MM-DD"))}})})]}),r.jsx(p,{children:r.jsxs("form",{onSubmit:ou,children:[r.jsx(k,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:H}),r.jsx(N,{type:"submit",onClick:ou,endIcon:r.jsx(g0,{}),children:"جستجو"})]})}),r.jsx(f,{title:"خروجی اکسل",children:r.jsx("a",{href:`${R.defaults.baseURL}archive_hatching_excel/?search=filter&value=${b}&role=${d()}&key=${t}${E?`&date1=${n}&date2=${C}`:""}`,rel:"noreferrer",children:r.jsx(N,{color:"success",children:r.jsx(E6,{size:32})})})})]}),r.jsx(ru,{data:M,columns:["عملیات","جزئیات","ردیف","وضعیت","شماره مجوز جوجه ریزی","شناسه یکتا","مجوز بهداشتی جوجه ریزی","نام فارم","مرغدار","بهره برداری","مالکیت","ارتباط","شهر/تعاونی","دامپزشک فارم","سالن","دوره جوجه ریزی","تاریخ ثبت جوجه ریزی","تاریخ جوجه ریزی","میانگین سن کشتار","پیش بینی تاریخ کشتار","نژاد","سن ورود به بایگانی","تاریخ ورود به بایگانی","سن فعلی","حجم جوجه ریزی","حجم افزایشی","تلفات دامپزشک","تلفات اتحادیه","تلفات کل","حجم تعهد دولتی","حجم تعهد آزاد","حجم کشتار دولتی","وزن کشتار دولتی","حجم کشتار آزاد","وزن کشتار شده آزاد","حجم فروش به خارج استان","وزن فروش به خارج استان","حجم اختلاف کشتار","وزن اختلاف کشتار","تخصیصات بدون بار","حجم تخصیصات بدون بار","وزن تخصیصات بدون بار","حجم کشتار شده"," حجم مانده در سالن"," درصد مانده در سالن"," تلفات"," کشتار شده","تایید تخلیه رصدیار"," تایید تخلیه در سماصط","وزن تعهد دولتی","وزن کشتار دولتی","وزن کشتار آزاد","میانگین وزن کشتار","وزن کل کشتار شده","تعداد کشتار فعال","تعداد درخواست کشتار","تعداد بارها","حجم بارها","وزن بارها","حجم بارهای تحویلی","وزن بارهای تحویلی","حجم زنجیره","وزن زنجیره","حجم صادرات","وزن صادرات","بارهای ورودی به انبار","حجم لاشه های انبار","وزن لاشه های انبار","درصد افت بارها","آخرین تغییر","سازنده جوجه ریزی","گزارش"],handlePageChange:W6,totalRows:$,page:T,perPage:S,handlePerRowsChange:w6,title:"بایگانی جوجه ریزی"})]})},H2=()=>{var i,H,y,x,$,j,S,L,b,Q,T,v,M,X,E;const{hatchingInfoWithDate:o,hatchingInfoFull:n}=I(D=>D.citySlice),h=G(),[,,C,F,t,s]=c.useContext(V);c.useEffect(()=>{const D=uu(new Date).format("YYYY-MM-DD");F(D),s(D)},[]),c.useEffect(()=>{h(m())},[]),c.useEffect(()=>{h(B0({selectedDate1:C,selectedDate2:t}))},[C,t]);const l=o0({initialValues:{minAge:"",maxAge:""}});return r.jsxs(H6,{bgcolor:"#f9f9f9",borderRadius:2,boxShadow:3,children:[r.jsx(q6,{style:{width:"100%"},children:r.jsx(K6,{label:r.jsx(_,{variant:"body1",gutterBottom:!0,color:"primary",fontWeight:"bold",children:"اطلاعات جوجه ریزی"})})}),r.jsxs(p,{container:!0,spacing:3,m:0,pb:2,children:[r.jsx(p,{item:!0,xs:12,children:r.jsx(ru,{noPagination:!0,title:"آمار جوجه ریزی",columns:["تعداد فارم","تعداد کل جوجه ریزی","تعداد باقی مانده در سالن","تعداد کشتار شده","وزن کشتار شده","مانده سالن (20 تا 30 روزه)","مانده سالن (30 تا 40 روزه)","مانده سالن (40 تا 50 روزه)","مانده سالن (50 تا 60 روزه)","بیشتر از 60 روزه"],data:[[(i=n==null?void 0:n.poultries)==null?void 0:i.toLocaleString(),(H=n==null?void 0:n.totalHatchingQuantity)==null?void 0:H.toLocaleString(),(y=n==null?void 0:n.totalHatchingLeftOverQuantity)==null?void 0:y.toLocaleString(),(x=n==null?void 0:n.totalHatchingKilledQuantity)==null?void 0:x.toLocaleString(),($=n==null?void 0:n.totalHatchingKilledWeight)==null?void 0:$.toLocaleString(),(j=n==null?void 0:n.age2030)==null?void 0:j.toLocaleString(),(S=n==null?void 0:n.age3040)==null?void 0:S.toLocaleString(),(L=n==null?void 0:n.age4050)==null?void 0:L.toLocaleString(),(b=n==null?void 0:n.age5060)==null?void 0:b.toLocaleString(),(Q=n==null?void 0:n.ageMoreThan60)==null?void 0:Q.toLocaleString()]]})}),r.jsx(q6,{style:{width:"100%",marginTop:8},children:r.jsx(K6,{label:r.jsx(_,{variant:"body1",color:"primary",gutterBottom:!0,fontWeight:"medium",children:"بر اساس بازه"})})}),r.jsx(p,{item:!0,xs:12,mt:2,children:r.jsxs(p,{container:!0,alignItems:"center",spacing:2,children:[r.jsx(p,{item:!0,children:r.jsx(N6,{label:"از تاریخ",renderInput:D=>r.jsx(k,{...D,size:"small",fullWidth:!0}),value:C,onChange:D=>F(uu(D).format("YYYY-MM-DD"))})}),r.jsx(p,{item:!0,children:r.jsx(N6,{label:"تا تاریخ",renderInput:D=>r.jsx(k,{...D,size:"small",fullWidth:!0}),value:t,onChange:D=>s(uu(D).format("YYYY-MM-DD"))})}),r.jsx(p,{item:!0,children:r.jsx(f,{title:"خروجی اکسل",children:r.jsx("a",{href:`${R.defaults.baseURL}hatching_date_range_excel/?date1=${C}&date2=${t}`,rel:"noreferrer",children:r.jsx(N,{variant:"contained",color:"success",children:r.jsx(E6,{size:24})})})})})]})}),r.jsx(p,{item:!0,xs:12,children:r.jsx(ru,{noPagination:!0,title:"خلاصه آمار",columns:["تعداد فارم های فعال","تعداد کل جوجه ریزی","تعداد باقی مانده در سالن","تعداد کشتار شده","وزن کشتار شده"],data:[[(T=o==null?void 0:o.poultries)==null?void 0:T.toLocaleString(),(v=o==null?void 0:o.totalHatchingQuantity)==null?void 0:v.toLocaleString(),(M=o==null?void 0:o.totalHatchingLeftOverQuantity)==null?void 0:M.toLocaleString(),(X=o==null?void 0:o.totalHatchingKilledQuantity)==null?void 0:X.toLocaleString(),(E=o==null?void 0:o.totalHatchingKilledWeight)==null?void 0:E.toLocaleString()]]})}),r.jsx(q6,{style:{width:"100%",marginTop:8},sx:{display:{xs:"none",sm:"block"}},children:r.jsx(K6,{label:r.jsx(_,{variant:"body1",color:"primary",gutterBottom:!0,fontWeight:"medium",mx:"auto",children:"گزارش مانده سالن فارم های بیشتر از 10 درصد"})})}),r.jsx(_,{variant:"body1",backgroundColor:"rgba(0, 0, 0, 0.08)",color:"primary",gutterBottom:!0,fontWeight:"medium",mt:4,mx:"auto",sx:{display:{xs:"block",sm:"none"},borderRadius:2},width:{xs:"80%",sm:"auto"},children:"گزارش مانده سالن فارم های بیشتر از 10 درصد"}),r.jsx(p,{item:!0,xs:12,container:!0,justifyContent:"center",gap:2,alignItems:"center",mt:4,px:1,children:r.jsxs(p,{container:!0,sx:{gap:2},alignItems:"center",children:[r.jsx(p,{item:!0,sx:{maxWidth:{xs:"46%",sm:"100px"}},children:r.jsx(k,{id:"minAge",label:"از سن",variant:"outlined",size:"small",value:l.values.minAge,onChange:l.handleChange,onBlur:l.handleBlur})}),r.jsx(p,{item:!0,sx:{maxWidth:{xs:"46%",sm:"100px"}},children:r.jsx(k,{id:"maxAge",label:"تا سن",variant:"outlined",size:"small",value:l.values.maxAge,onChange:l.handleChange,onBlur:l.handleBlur})}),r.jsx(p,{item:!0,children:r.jsx(f,{title:"خروجی اکسل",children:r.jsx("a",{href:`${R.defaults.baseURL}hatching_by_age_range/?min_age=${l.values.minAge}&max_age=${l.values.maxAge}`,rel:"noreferrer",children:r.jsx(N,{variant:"contained",color:"success",children:r.jsx(E6,{size:24})})})})})]})})]})]})};export{d2 as C,k2 as a,_2 as b,H2 as c,R2 as d}; diff --git a/build/assets/CityHatchingsArchiveOperations-DQ9mbEeF.js b/build/assets/CityHatchingsArchiveOperations-DQ9mbEeF.js new file mode 100644 index 0000000..ea3a7e5 --- /dev/null +++ b/build/assets/CityHatchingsArchiveOperations-DQ9mbEeF.js @@ -0,0 +1 @@ +import{j as u,ak as z,B as R,ai as E,b5 as L,T as V,i as P,ag as U,ah as Y,aj as N,I as Q,b0 as X,an as K,b4 as J,ap as Z,aq as uu}from"./mui-vendor-CkIVaoQP.js";import{r as d}from"./react-vendor-CmFgShSM.js";import{L as _,j as F,h,A as S,u as D,c as H,X as G,N as eu,fA as ru,M as T,cs as tu,G as A,C as W,r as ou,fj as au,O as w}from"./index-CeyyVc1v.js";import{a as k,u as I,f as su}from"./redux-vendor-B7uoacJt.js";import{d as nu}from"./Tune-D4M2CAhp.js";import{a as lu}from"./index.esm-Bu7XMDZU.js";import{F as iu}from"./FileUploader-DT5gIVb3.js";import{d as cu}from"./Add--yVWBJhC.js";import{d as du}from"./Sms-DasNClAG.js";const $=k("ARCHIVE_HATCHING_SERVICE",async(e,{dispatch:t})=>{t(_());try{const{data:o,status:s}=await F.put("poultry_hatching/0/",e);return t(h()),{data:o,status:s}}catch(o){return t(h()),{error:o.response.data.result}}}),Cu=H({name:T()}),Iu=({item:e,selectedAge1:t,selectedAge2:o,updateTable:s})=>{const[r]=d.useContext(S),c=I(),n=D({initialValues:{name:""},validationSchema:Cu,onSubmit:m=>{c($({key:e.key,archive_state:"",message:m.name,role:G()})).then(p=>{p.payload.error?r({vertical:"top",horizontal:"center",msg:p.payload.error,severity:"error"}):(c(eu({right:!1,bottom:!1,content:null})),t&&c(ru({selectedAge1:t,selectedAge2:o})),s(),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}});return u.jsxs("form",{onSubmit:n.handleSubmit,children:[u.jsx(z,{id:"name",name:"name",label:"توضیحات",variant:"outlined",multiline:!0,rows:4,fullWidth:!0,margin:"normal",value:n.values.name,onChange:n.handleChange,onBlur:n.handleBlur,helperText:n.touched.name&&n.errors.name,error:n.touched.name&&!!n.errors.name}),u.jsx(R,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,children:"ثبت"})]})},hu=k("HATCHING_UNDO_ARCHIVE_SERVICE",async(e,{dispatch:t})=>{try{t(_());const{data:o,status:s}=await F.put("poultry_hatching/0/",e);return t(h()),{data:o,status:s}}catch(o){return t(h()),{error:o.response.data.result}}}),pu=({item:e,updateTable:t,isArchive:o})=>{const[s,r]=d.useState(e==null?void 0:e.violation),[c,n]=d.useState(!1),m=I(),p=i=>{r(i.target.checked)},x=i=>{n(i.target.checked)},[y]=d.useContext(S),[b,C]=d.useState([]),B=i=>{C(i)},l=D({initialValues:{reportText:e==null?void 0:e.violationReport,bar_image:""},validationSchema:H({reportText:T().required("این فیلد اجباری است!").typeError("لطفا گزارش خود را بیان کنید."),bar_image:tu()})});return d.useEffect(()=>{l.validateForm()},[]),u.jsxs(A,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(E,{control:u.jsx(L,{checked:s,onChange:p,color:"primary"}),label:s?"متخلف":"بدون تخلف",style:{justifyContent:"center",alignItems:"center",display:"flex"}}),!o&&u.jsx(E,{control:u.jsx(L,{checked:c,onChange:x,color:"primary"}),label:"انتقال به بایگانی",style:{justifyContent:"center",alignItems:"center",display:"flex"}}),u.jsx(z,{multiline:!0,rows:4,fullWidth:!0,id:"reportText",label:"متن گزارش",variant:"outlined",value:l.values.reportText,error:l.touched.reportText?!!l.errors.reportText:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.reportText&&l.errors.reportText?l.errors.reportText:null}),u.jsx(V,{color:"error",children:"در صورت آپلود فایل جدید، سندهای پیشین حذف میشوند!"}),u.jsx(iu,{onChange:B}),u.jsx(R,{mt:2,disabled:!l.isValid||l.isSubmitting,fullWidth:!0,variant:"contained",onClick:async()=>{try{const i={key:e==null?void 0:e.key,violation_check:!0,violation:s,violation_report:l.values.reportText,archive:c},v=new FormData;Object.entries(i).forEach(([f,g])=>{v.append(f,g)}),b.forEach((f,g)=>{v.append(`violation_image_${g}`,f)});const j=await m($(b.length?v:i));if(j.error)throw new Error(j.error);t(1),m(W()),y({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})}catch(i){y({vertical:"top",horizontal:"center",msg:i.message||"خطا در ارسال اطلاعات",severity:"error"})}},children:l.isSubmitting?"در حال ثبت...":"ثبت"})]})};var O={},mu=P;Object.defineProperty(O,"__esModule",{value:!0});var M=O.default=void 0,xu=mu(ou()),Au=u;M=O.default=(0,xu.default)((0,Au.jsx)("path",{d:"M4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2v-3H4zM20 8l-6-6H6c-1.1 0-1.99.9-1.99 2v7H20zm-7 1V3.5L18.5 9zm-4 4h6v2H9zm8 0h6v2h-6zM1 13h6v2H1z"}),"InsertPageBreak");const yu=k("CITY_EDIT_HATCHING_QUANTITY_SERVICE",async(e,{dispatch:t})=>{try{t(_());const{data:o,status:s}=await F.put("poultry_hatching/0/",e);return t(h()),{data:o,status:s}}catch(o){return t(h()),{error:o.response.data.result}}}),vu=({item:e,updateTable:t})=>{const o=I(),[s]=d.useContext(S),r=D({initialValues:{lossType:"aggregate",lossVolume:""},validationSchema:H({lossType:T().required("لطفاً نوع خسارت را انتخاب کنید."),lossVolume:T().required("لطفاً حجم تلفات را وارد کنید.").matches(/^\d+$/,"حجم تلفات باید عدد باشد.")}),onSubmit:c=>{o(yu({key:e==null?void 0:e.key,end_period_losses:!0,type:c.lossType,losses:parseInt(c.lossVolume)})).then(n=>{n.payload.error?s({vertical:"top",horizontal:"center",msg:n.payload.error,severity:"error"}):(s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(),o(W()))})}});return u.jsx("form",{onSubmit:r.handleSubmit,children:u.jsxs(A,{container:!0,xs:12,alignItems:"center",spacing:2,children:[u.jsx(A,{item:!0,xs:12,children:u.jsxs(U,{component:"fieldset",fullWidth:!0,children:[u.jsxs(Y,{row:!0,name:"lossType",value:r.values.lossType,onChange:r.handleChange,children:[u.jsx(E,{value:"aggregate",control:u.jsx(N,{}),label:"کل تلفات دوره (پایان کار)"}),u.jsx(E,{value:"add",control:u.jsx(N,{}),label:"افزودن به تلفات دامپزشک فارم"})]}),r.touched.lossType&&r.errors.lossType&&u.jsx("div",{style:{color:"red",fontSize:"0.8em"},children:r.errors.lossType})]})}),u.jsx(A,{container:!0,item:!0,xs:12,children:u.jsx(z,{fullWidth:!0,name:"lossVolume",label:"حجم تلفات",value:r.values.lossVolume,onChange:r.handleChange,onBlur:r.handleBlur,error:r.touched.lossVolume&&!!r.errors.lossVolume,helperText:r.touched.lossVolume&&r.errors.lossVolume})}),r.values.lossType==="aggregate"&&u.jsx(V,{variant:"body2",color:"error",mx:2,mt:1,children:"اخطار: تلفات وارد شده جایگزین کل تلفات خواهد شد!"}),u.jsx(A,{item:!0,xs:12,children:u.jsx(R,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,children:"ثبت اطلاعات"})})]})})},fu=k("CITY_GET_TICKET_DIFFRENT_CLEARANCE_CODE",async({licence_number:e,mobile:t},{dispatch:o})=>{o(_());try{const{data:s,status:r}=await F.get("ticket_different_clearance_code_from_rsi/",{params:{licence_number:e,mobile:t}});return o(h()),{data:s,status:r}}catch{o(h())}}),Bu=({item:e,updateArchive:t,readOnly:o})=>{const{userProfile:s}=su(a=>a.userSlice),r=I(),[c,n]=d.useState(!1),[m,p]=d.useState(null),[x]=d.useContext(S),y=G(),b=a=>{n(!0),p(a.currentTarget)},C=()=>{n(!1),p(null)},B=()=>{C(),r(hu({key:e.key,type:"return_archive"})).then(a=>{a.payload.error?x({vertical:"top",horizontal:"center",msg:a.payload.error,severity:"error"}):(t(1),x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},l=()=>{C(),r(w({title:"ثبت گزارش",content:u.jsx(pu,{updateTable:t,item:e,isArchive:!0})}))},i=()=>{C(),r(w({title:"ثبت تلفات پایان دوره",content:u.jsx(vu,{item:e,updateTable:t})}))},v=()=>{C();const a=`${F.defaults.baseURL}process-for-each-hatching/?key=${e.key}`;window.open(a,"_blank")},j=()=>{C(),r(fu({licence_number:e==null?void 0:e.licenceNumber,mobile:s==null?void 0:s.mobile})).then(a=>{a.payload.error?x({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(t(1),x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},f=["ProvinceOperator","CityOperator","AdminX","SuperAdmin"],g=["VetFarm","CityVet","VetSupervisor"],q=[!o&&{key:"undo",label:"بازگشت جوجه ریزی",color:"primary.main",icon:u.jsx(au,{sx:{fontSize:{xs:20,md:18}}}),action:B},f.includes(y)&&{key:"report",label:"ثبت گزارش",color:"secondary.main",icon:u.jsx(cu,{sx:{fontSize:{xs:20,md:18}}}),action:l},g.includes(y)&&{key:"losses",label:"ثبت تلفات پایان دوره",color:"error.main",icon:u.jsx(M,{sx:{fontSize:{xs:20,md:18}}}),action:i},{key:"excel",label:"خروجی اکسل",color:"success.main",icon:u.jsx(lu,{size:18,style:{color:"inherit"}}),action:v},{key:"ticket",label:"تیکت گزارش کشتار جوجه ریزی",color:"error.main",icon:u.jsx(du,{sx:{fontSize:{xs:20,md:18}}}),action:j}].filter(Boolean);return u.jsxs(A,{children:[u.jsx(Q,{variant:"contained",color:"primary",onClick:b,children:u.jsx(nu,{})}),u.jsx(X,{open:c,anchorEl:m,onClose:C,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsx(K,{sx:{width:200,p:1},children:q.map(a=>u.jsxs(J,{onClick:()=>{a.disabled||a.action()},disabled:!!a.disabled,sx:{borderRadius:1,mb:.5,color:a.disabled?"text.disabled":a.color,"&:last-of-type":{mb:0}},children:[u.jsx(Z,{sx:{color:a.disabled?"text.disabled":a.color,minWidth:36},children:a.icon}),u.jsx(uu,{primary:u.jsx(V,{sx:{color:a.disabled?"text.disabled":a.color,fontWeight:600,fontSize:{xs:"13px",md:"14px"}},children:a.label})})]},a.key))})})]})};export{Iu as C,vu as V,Bu as a,$ as b,pu as c,M as d,fu as e}; diff --git a/build/assets/CityManageHatchings-vNwIRT4N.js b/build/assets/CityManageHatchings-vNwIRT4N.js new file mode 100644 index 0000000..264646c --- /dev/null +++ b/build/assets/CityManageHatchings-vNwIRT4N.js @@ -0,0 +1 @@ +import{j as a,T as $,ag as o0,ak as N,aU as n0,B as D,s as s0,d as b,I as f6,b2 as r0,b3 as v6,b as C0}from"./mui-vendor-CkIVaoQP.js";import{r as C,u as W6}from"./react-vendor-CmFgShSM.js";import{a as O,u as I,f as w}from"./redux-vendor-B7uoacJt.js";import{L as E,j as S,h as v,A as P,c as l0,b as c0,u as M6,G as A,S as R,X as F,C as e0,c5 as Q6,N as t0,_ as k,p as _,V as j6,fJ as z6,fK as G6,fL as V6,fM as Y6,fN as J6,fO as X6,fP as Z6,O as L6,fQ as K,fR as A0}from"./index-CeyyVc1v.js";import{C as d0,a as g0,b as p0,c as F0,d as y0}from"./CityHatchingInfo-CZPJ_c_O.js";import{d as B6}from"./CloudUpload-BlIgB_r9.js";import{S as q6}from"./SimpleTable-DBAoNnCU.js";import{P as h0}from"./ProvinceBarDifference-CBv5I_nz.js";import{R as $6}from"./ResponsiveTable-w7hk7Uq8.js";import{A as x0}from"./AdvancedTable-BYmmBtmq.js";import{u as S0}from"./getProvinceName-BujSmyBy.js";import{R as i6,a as m6}from"./index.esm-Bu7XMDZU.js";import{S as u0}from"./ShowImage-CqhU2hmk.js";import{d as a0}from"./Article-DcCZ1D5y.js";const v0=O("ARCHIVE_OLD_HATCHINGS_SERVICE",async(p,{dispatch:r})=>{try{r(E());const{data:t,status:e}=await S.post("archive_hatching/",p);return r(v()),{data:t,status:e}}catch(t){return r(v()),{error:t.response.data.result}}}),f0=()=>{const p=I(),[r]=C.useContext(P),t=l0().shape({numberField:c0().typeError("عدد وارد کنید").required("اجباری است")}),l=M6({initialValues:{numberField:""},onSubmit:h=>{p(v0({age:h.numberField,role:F()})).then(y=>{p(e0()),y.payload.error?r({vertical:"top",horizontal:"center",msg:y.payload.error,severity:"error"}):r({vertical:"top",horizontal:"center",msg:y.payload.data.msg,severity:"success"})})},validationSchema:t});return a.jsx("form",{onSubmit:l.handleSubmit,children:a.jsxs(A,{container:!0,gap:R.TINY,children:[a.jsx($,{variant:"caption",color:"error",children:"توجه : تمام جوجه ریزی های فعالی که بیشتر از سن وارده شده در کادر زیر باشند به بایگانی منتقل میشوند."}),a.jsxs(o0,{fullWidth:!0,error:l.touched.numberField&&l.errors.numberField,children:[a.jsx(N,{name:"numberField",label:"بایگانی کردن جوجه ریزی ها از سن",type:"number",value:l.values.numberField,onChange:l.handleChange,onBlur:l.handleBlur}),l.touched.numberField&&l.errors.numberField&&a.jsx(n0,{children:l.errors.numberField})]}),a.jsx(D,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,children:"ثبت"})]})})},L0=O("CITY_UPDATE_HATCHING",async(p,{dispatch:r})=>{try{r(E());const{data:t,status:e}=await S.post("hatching_excel/",p);return r(v()),{data:t,status:e}}catch(t){return r(v()),{error:t}}}),$0=O("CITY_UPDATE_CHICKEN_BREED",async(p,{dispatch:r})=>{try{r(E());const{data:t,status:e}=await S.post("update_chicken_breed_from_excel/",p);return r(v()),{data:t,status:e}}catch(t){return r(v()),{error:t}}}),U6=s0("input")({clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:1,overflow:"hidden",position:"absolute",bottom:0,left:0,whiteSpace:"nowrap",width:1}),j0=()=>{const p=I(),[r]=C.useContext(P),[t,e]=C.useState(),[f,l]=C.useState(),h=async g=>{const c=g.target.files[0];if(!c)return;const n=new FormData;n.append("file",c),p(L0(n)).unwrap().then(d=>{e(d.data),d.status===201?r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}):r({vertical:"top",horizontal:"center",msg:"فایل اکسل به درستی ارسال نشده است!",severity:"error"})})},y=async g=>{const c=g.target.files[0];if(!c)return;const n=new FormData;n.append("file",c),p($0(n)).unwrap().then(d=>{d.status===201?r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}):r({vertical:"top",horizontal:"center",msg:"فایل اکسل به درستی ارسال نشده است!",severity:"error"})})};return C.useEffect(()=>{const g=t==null?void 0:t.map((c,n)=>[n+1,c]);l(g)},[t]),a.jsxs(A,{container:!0,alignItems:"center",justifyContent:"space-between",spacing:2,mb:1,style:{width:"80vw"},children:[a.jsxs(A,{xs:12,md:6,sm:6,container:!0,alignItems:"center",mt:6,spacing:2,justifyContent:"center",style:window.innerWidth>=800&&{borderStyle:"solid",borderWidth:"0px 0px 0px 1px",borderColor:"gray"},children:[a.jsx(A,{children:a.jsx($,{variant:"body1",style:{color:"gray"},children:"آپدیت جوجه ریزی"})}),a.jsxs(A,{children:[a.jsxs(D,{component:"label",role:void 0,variant:"contained",tabIndex:-1,startIcon:a.jsx(B6,{}),children:["آپلود فایل اکسل",a.jsx(U6,{type:"file",onChange:h})]}),t!=null&&t.length?a.jsx(A,{container:!0,xs:12,justifyContent:"start",children:a.jsx(q6,{columns:["ردیف","شناسه یکتا"],name:"مرغداران ناموجود در سامانه",data:f})}):a.jsx(a.Fragment,{})]})]}),a.jsxs(A,{xs:12,md:6,sm:6,container:!0,alignItems:"center",mt:6,spacing:2,justifyContent:"center",children:[a.jsx(A,{children:a.jsx($,{variant:"body1",style:{color:"gray"},children:"آپدیت نژاد"})}),a.jsx(A,{children:a.jsxs(D,{component:"label",role:void 0,variant:"contained",tabIndex:-1,startIcon:a.jsx(B6,{}),children:["آپلود فایل اکسل",a.jsx(U6,{type:"file",onChange:y})]})})]})]})},D0=O("FETCH_SAMASAT_CHICKENS",async(p,{dispatch:r})=>{r(E());const{data:t,status:e}=await S.post("https://pay.rasadyar.net/transporting-chickens/",p);return r(v()),{data:t,status:e}}),E0=O("FETCH_SAMASAT_CHICKENS_DETAILS",async(p,{dispatch:r})=>{r(E());const{data:t,status:e}=await S.post("https://pay.rasadyar.net/transporting-chickens-details/",p);return r(v()),{data:t,status:e}}),b0=O("VISORS_GET_COOKIE",async(p,{dispatch:r})=>{r(E());const{data:t,status:e}=await S.get("cookie-samasat");return r(v()),{data:t,status:e}}),k0=({code:p,cookie:r})=>{const t=I(),[e]=C.useContext(P),[f,l]=C.useState([]);return C.useEffect(()=>{t(E0({cookie:r,certId:p})).then(h=>{var y;if(h.error)e({vertical:"top",horizontal:"center",msg:"کوکی معتبر نیست!",severity:"error"});else{const g=(y=h.payload.data)==null?void 0:y.map((c,n)=>{var d;return[n+1,c==null?void 0:c.TrackingCode,c==null?void 0:c.ResideDatePersian,(d=c==null?void 0:c.GoodAmount)==null?void 0:d.toLocaleString(),c==null?void 0:c.TrackingStatusDescription,c==null?void 0:c.GoodName,c==null?void 0:c.DesPartIdCode,c==null?void 0:c.DesUnitName,c==null?void 0:c.IssueDatePersian]});l(g)}})},[]),a.jsx(A,{container:!0,xs:12,children:a.jsx(x0,{columns:["ردیف","کد رهگیری","تاریخ ثبت","تعداد","وضعیت","نام کالا","شناسه یکتا کشتارگاه مقصد","نام کشتارگاه","تاریخ ثبت وضعیت"],data:f,name:"جزئیات حمل مرغ زنده"})})},H0=()=>{const[p,r]=C.useState([]),[t]=C.useContext(P),[e,f]=C.useState([]),l=I(),h=S0(),[y,g]=C.useState();return C.useEffect(()=>{l(b0()).then(c=>{g(c.payload.data.cookie),l(D0({cookie:c.payload.data.cookie,province:h==="hamedan"?"65550":h==="bushehr"?"65527":"65548"})).then(n=>{l(v()),n.error?t({vertical:"top",horizontal:"center",msg:"کوکی معتبر نیست!",severity:"error"}):f(n.payload.data)})})},[]),C.useEffect(()=>{const c=e==null?void 0:e.map((n,d)=>{var T;return[d+1,n==null?void 0:n.LocationNameProvince,n==null?void 0:n.LocationNameCity,n==null?void 0:n.PersonFullName,n==null?void 0:n.PartIdCode,n==null?void 0:n.UnitName,n==null?void 0:n.EpidemiologicCode,n==null?void 0:n.PostalCode,n==null?void 0:n.CapacityFemale.toLocaleString(),n==null?void 0:n.RequestCode,n==null?void 0:n.SourceCertId,n==null?void 0:n.HatchingDatePersian,(T=n==null?void 0:n.HatchingCount)==null?void 0:T.toLocaleString(),n==null?void 0:n.RemoveCount,n==null?void 0:n.RemoveCountTakhlie,n==null?void 0:n.RemovePartyCount,a.jsx(b,{placement:"right",title:"جزئیات",children:a.jsx(f6,{size:"small",color:"primary",onClick:()=>{l(t0({right:!1,top:!0,content:a.jsx(k0,{code:n==null?void 0:n.SourceCertId,cookie:y}),title:"جزئیات حمل مرغ زنده"}))},children:a.jsx(Q6,{})})},d)]});r(c)},[e]),a.jsx(A,{container:!0,xs:12,mt:2,justifyContent:"center",children:a.jsx(A,{container:!0,xs:12,mt:2,justifyContent:"center",children:a.jsx($6,{paginated:!0,data:p,columns:["ردیف","استان","شهر","نام مالک","شناسه یکتا واحد","نام واحد","کد اپیدمیولوژیک واحد","کد پستی","ظرفیت","شماره مجوز","شماره گواهی بهداشتی","تاریخ جوجه ریزی","تعداد جوجه ریزی","مجموع حمل مرغ (تخلیه/ بارگیری)","مجموع حمل مرغ (تایید تخلیه)","تعداد ماشین حمل","جزئیات"],title:"گزارش حمل مرغ زنده گله ها بر اساس حمل "})})})},T0=({readOnly:p})=>{var W,M,z,G,V,Y,J,X,Z,i,m,uu,au,ou;const r=I(),t=p||!1,[e,f]=C.useState(0),[l,h]=C.useState(0),[y,g]=C.useState([]),[c,n]=C.useState(0),[d,T]=C.useState(10),[x,Q]=C.useState(""),[j,q]=C.useState(1),[D6,E6]=C.useState([]),b6=w(s=>s.userSlice.userProfile.key),k6=W6(),[H6]=C.useContext(P),T6=s=>{Q(s.target.value)},R6=w(s=>s.citySlice.hatchingAdded);C.useEffect(()=>{H(1)},[R6]);const H=async s=>{r(E());const u=await S.get(`poultry_hatching?search=filter&value=${x}&role=${F()}&page=${s}&page_size=${d}&age1=${e||0}&age2=${l||0}&all_active_and_archive`);r(v()),g(u.data.results),n(u.data.count)},_6=s=>{H(s),q(s)},w6=s=>{T(s),q(1)};C.useEffect(()=>{H(1)},[r,d]);const N6=()=>{H(j!==0?j:1)};C.useEffect(()=>{const s=y==null?void 0:y.map((u,L)=>{var nu,su,ru,Cu,lu,cu,eu,tu,Au,du,gu,pu,Fu,yu,hu,xu,Su,vu,fu,Lu,$u,ju,Du,Eu,bu,ku,Hu,Tu,Ru,_u,wu,Nu,Iu,Pu,Ku,Ou,Qu,qu,Bu,Uu,Wu,Mu,zu,Gu,Vu,Yu,Ju,Xu,Zu,iu,mu,u6,a6,o6,n6,s6,r6,C6,l6,c6,e6,t6,A6,d6,g6,p6,F6,y6,h6;return[a.jsx(d0,{selectedAge1:null,selectedAge2:null,updateTable:N6,item:u,readOnly:t},"4"),a.jsx(b,{placement:"left",title:"جزئیات جوجه ریزی",children:a.jsx(f6,{color:"primary",onClick:()=>{k6(F()==="AdminX"?`${z6}/${u.key}`:F()==="Supporter"?`${G6}/${u.key}`:F()==="SuperAdmin"?`${V6}/${u.key}`:F()==="CityPoultry"?`${Y6}/${u.key}`:F()==="ProvinceSupervisor"?`${J6}/${u.key}`:F()==="ProvinceOperator"?`${X6}/${u.key}`:F()==="CityJahad"?`${Z6}/${u.key}`:"")},children:a.jsx(Q6,{})})},L),j===1?L+1:L+d*(j-1)+1,a.jsx(b,{disableHoverListener:!((nu=u==null?void 0:u.killingInfo)!=null&&nu.violationMessage&&(u!=null&&u.violation)),title:u!=null&&u.violation?`متن گزارش تخلف: ${(su=u==null?void 0:u.killingInfo)==null?void 0:su.violationMessage}`:null,sx:{"&:hover":{cursor:u!=null&&u.violation?"pointer":"default"}},placement:"top",children:a.jsx($,{variant:"body2",color:u!=null&&u.violation?"error":"primary",children:u!=null&&u.violation?"پیگیری":"عادی"})},L),u==null?void 0:u.licenceNumber,(ru=u==null?void 0:u.poultry)==null?void 0:ru.breedingUniqueId,u==null?void 0:u.CertId,((Cu=u==null?void 0:u.poultry)==null?void 0:Cu.unitName)||"-",`${((cu=(lu=u==null?void 0:u.poultry)==null?void 0:lu.userprofile)==null?void 0:cu.fullName)??"-"} (${((tu=(eu=u==null?void 0:u.poultry)==null?void 0:eu.userprofile)==null?void 0:tu.mobile)??"-"}) ${u!=null&&u.violationReport?"✉️":""}`,u!=null&&u.InteractTypeName?a.jsx($,{variant:"body2",color:u!=null&&u.hasTenant?"success.main":"",fontWeight:u!=null&&u.hasTenant?"bold":"normal",children:u==null?void 0:u.InteractTypeName}):"-",u==null?void 0:u.PersonTypeName,u==null?void 0:u.UnionTypeName,`${((gu=(du=(Au=u==null?void 0:u.poultry)==null?void 0:Au.address)==null?void 0:du.city)==null?void 0:gu.name)??"-"}/${(pu=u==null?void 0:u.poultry)!=null&&pu.cityOperator?(Fu=u==null?void 0:u.poultry)==null?void 0:Fu.cityOperator:"بدون تعاونی"}`,(yu=u==null?void 0:u.vetFarm)!=null&&yu.vetFarmMobile?`${(hu=u==null?void 0:u.vetFarm)==null?void 0:hu.vetFarmFullName} (${(xu=u==null?void 0:u.vetFarm)==null?void 0:xu.vetFarmMobile})`:"-",u.hall,u.period,k(u==null?void 0:u.createDate),k(u==null?void 0:u.date),(vu=(Su=u==null?void 0:u.poultry)==null?void 0:Su.killingAveAge)==null?void 0:vu.toLocaleString(),u!=null&&u.predicateDate?_(u==null?void 0:u.predicateDate):"-",u.chickenBreed,u.age,(fu=u==null?void 0:u.quantity)==null?void 0:fu.toLocaleString(),(Lu=u==null?void 0:u.increaseQuantity)==null?void 0:Lu.toLocaleString(),`${u.losses} (%${(u.losses*100/u.quantity).toFixed(0)})`,a.jsx(b,{placement:"top",title:"جهت مشاهده ثبت کننده تلفات کلیک کنید",children:a.jsx(D,{style:{color:"rgba(0,0,0,0.87)"},onClick:()=>{r(L6({title:"ویرایش تعداد جوجه ریزی",content:a.jsx(A,{container:!0,xs:12,children:!(u!=null&&u.directLossesInputer)&&!(u!=null&&u.directLossesInputer)?a.jsx($,{variant:"body1",children:"برای این جوجه ریزی تلفاتی ثبت نشده است."}):a.jsxs(A,{xs:12,children:[a.jsxs($,{variant:"body1",children:["ثبت کننده تلفات اتحادیه:"," ",u!=null&&u.directLossesInputer?`${u==null?void 0:u.directLossesInputer} در تاریخ ${_(u==null?void 0:u.directLossesDate)}`:" - "]}),a.jsxs($,{variant:"body1",children:["ویرایش کننده تلفات اتحادیه:",u!=null&&u.directLossesEditor?`${u==null?void 0:u.directLossesEditor} در تاریخ ${_(u==null?void 0:u.directLossesLastEditDate)}`:" - "]})]})})}))},children:`${($u=u==null?void 0:u.directLosses)==null?void 0:$u.toLocaleString()} (%${(u.directLosses*100/u.quantity).toFixed(0)})`})},L),`${(ju=u==null?void 0:u.totalLosses)==null?void 0:ju.toLocaleString()} (%${(u.totalLosses*100/u.quantity).toFixed(0)})`,`${(Du=u==null?void 0:u.totalCommitmentQuantity)==null?void 0:Du.toLocaleString()}`,`${(Eu=u==null?void 0:u.totalFreeCommitmentQuantity)==null?void 0:Eu.toLocaleString()}`,`${(bu=u==null?void 0:u.governmentalQuantity)==null?void 0:bu.toLocaleString()}`,`${(ku=u==null?void 0:u.governmentalKilledQuantity)==null?void 0:ku.toLocaleString()}`,`${(Hu=u==null?void 0:u.freeQuantity)==null?void 0:Hu.toLocaleString()}`,`${(Tu=u==null?void 0:u.freeKilledQuantity)==null?void 0:Tu.toLocaleString()}`,`${(Ru=u==null?void 0:u.outProvinceKilledQuantity)==null?void 0:Ru.toLocaleString()}`,`${(_u=u==null?void 0:u.outProvinceKilledWeight)==null?void 0:_u.toLocaleString()}`,`${(wu=u==null?void 0:u.barDifferenceRequestQuantity)==null?void 0:wu.toLocaleString()}`,`${(Nu=u==null?void 0:u.barDifferenceRequestWeight)==null?void 0:Nu.toLocaleString()}`,`${(Pu=(Iu=u==null?void 0:u.killingInfo)==null?void 0:Iu.provinceKillRequests)==null?void 0:Pu.toLocaleString()}`,`${(Ou=(Ku=u==null?void 0:u.killingInfo)==null?void 0:Ku.provinceKillRequestsQuantity)==null?void 0:Ou.toLocaleString()}`,`${(qu=(Qu=u==null?void 0:u.killingInfo)==null?void 0:Qu.provinceKillRequestsWeight)==null?void 0:qu.toLocaleString()}`,((Bu=u==null?void 0:u.killedQuantity)==null?void 0:Bu.toLocaleString())+` (%${((u==null?void 0:u.killedQuantity)*100/u.quantity).toFixed(0)})`,(Uu=u==null?void 0:u.leftOver)==null?void 0:Uu.toLocaleString(),`%${((u==null?void 0:u.leftOver)*100/(u==null?void 0:u.quantity)).toFixed(0)}`,`%${(u.totalLosses*100/u.quantity).toFixed(0)}`,`%${((u==null?void 0:u.killedQuantity)*100/u.quantity).toFixed(0)}`,`%${((u==null?void 0:u.leftOver)*100/(u==null?void 0:u.quantity)).toFixed(0)}`,`%${(((u==null?void 0:u.killedQuantity)+(u==null?void 0:u.totalLosses))*100/(u==null?void 0:u.quantity)).toFixed(0)}`,u!=null&&u.samasatDischargePercentage?`%${u==null?void 0:u.samasatDischargePercentage}`:"-",(Wu=u==null?void 0:u.totalCommitment)==null?void 0:Wu.toLocaleString(),(Mu=u==null?void 0:u.governmentalKilledQuantity)==null?void 0:Mu.toLocaleString(),(zu=u==null?void 0:u.freeKilledQuantity)==null?void 0:zu.toLocaleString(),(Gu=u==null?void 0:u.totalAverageKilledWeight)==null?void 0:Gu.toLocaleString(),(Vu=u==null?void 0:u.totalKilledWeight)==null?void 0:Vu.toLocaleString(),(Yu=u==null?void 0:u.activeKill)!=null&&Yu.activeKill?"دارد":"ندارد",(Ju=u==null?void 0:u.activeKill)!=null&&Ju.countOfRequest?u.activeKill.countOfRequest:"-",(Zu=(Xu=u==null?void 0:u.killingInfo)==null?void 0:Xu.killHouseRequests)==null?void 0:Zu.toLocaleString(),(mu=(iu=u==null?void 0:u.killingInfo)==null?void 0:iu.killHouseRequestsFirstQuantity)==null?void 0:mu.toLocaleString(),(a6=(u6=u==null?void 0:u.killingInfo)==null?void 0:u6.killHouseRequestsFirstWeight)==null?void 0:a6.toLocaleString(),(n6=(o6=u==null?void 0:u.killingInfo)==null?void 0:o6.barCompleteWithKillHouse)==null?void 0:n6.toLocaleString(),(r6=(s6=u==null?void 0:u.killingInfo)==null?void 0:s6.acceptedRealWightFinal)==null?void 0:r6.toLocaleString(),(C6=u==null?void 0:u.chainKilledQuantity)==null?void 0:C6.toLocaleString(),(l6=u==null?void 0:u.chainKilledWeight)==null?void 0:l6.toLocaleString(),(c6=u==null?void 0:u.exportKilledQuantity)==null?void 0:c6.toLocaleString(),(e6=u==null?void 0:u.exportKilledWeight)==null?void 0:e6.toLocaleString(),(A6=(t6=u==null?void 0:u.killingInfo)==null?void 0:t6.wareHouseBars)==null?void 0:A6.toLocaleString(),(g6=(d6=u==null?void 0:u.killingInfo)==null?void 0:d6.wareHouseBarsQuantity)==null?void 0:g6.toLocaleString(),(F6=(p6=u==null?void 0:u.killingInfo)==null?void 0:p6.wareHouseBarsWeight)==null?void 0:F6.toLocaleString(),(h6=(y6=u==null?void 0:u.killingInfo)==null?void 0:y6.wareHouseBarsWeightLose)==null?void 0:h6.toFixed(2),u.lastChange?`${u.lastChange.fullName} (${j6(u.lastChange.role)}) در تاریخ ${k(u.lastChange.date)}`:"-",u.latestHatchingChange?`${u.latestHatchingChange.fullName} (${j6(u.latestHatchingChange.role)}) در تاریخ ${k(u.latestHatchingChange.date)}`:"-",u!=null&&u.violationReport?a.jsx(b,{title:"مشاهده گزارش",placement:"top",children:a.jsx(f6,{color:"primary",onClick:()=>{var x6;r(L6({title:"گزارش ",content:a.jsx(q6,{columns:["ثبت کننده","تاریخ ثبت","تخلف","متن گزارش","سند"],data:[[u==null?void 0:u.violationReporter,_(u==null?void 0:u.violationReportDate),u!=null&&u.violation?"دارد":"ندارد",u==null?void 0:u.violationReport,a.jsx(A,{container:!0,xs:12,justifyContent:"center",gap:1,children:(x6=u==null?void 0:u.violationImage)==null?void 0:x6.map((S6,O6)=>a.jsx(u0,{src:S6},`${S6}-${O6}`))},L)]]})}))},children:a.jsx(a0,{})})},L):"-"]});E6(s)},[y]);const B=async s=>{s.preventDefault(),r(E()),r(K({age1:e,age2:l,tab:"all",textValue:x}));try{const u=await S.get(`poultry_hatching/?role=${F()}&age1=${e||0}&age2=${l||0}&search=filter&value=${x}&page=1&page_size=${d}&all_active_and_archive`);g(u.data.results),n(u.data.count),r(v())}catch(u){console.error("Error fetching data:",u)}},I6=async s=>{s.preventDefault(),f(0),h(0),r(E()),Q(""),r(K({age1:0,age2:0,tab:"all",textValue:x}));try{const u=await S.get(`poultry_hatching?role=${F()}&page=${j}&page_size=${d}&all_active_and_archive&search=filter&value=${x}`);g(u.data.results),n(u.data.count)}catch(u){console.error("Error fetching data:",u)}finally{r(v())}},[U,P6]=C.useState();C.useEffect(()=>{async function s(){try{const u=await S.get("last_update/?type=poultry_hatching");P6(u.data)}catch(u){console.error("Error fetching data:",u)}}s()},[]);const K6=a.jsxs(A,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,mt:2,xs:12,children:[a.jsx("form",{onSubmit:B,style:{flex:1},children:a.jsxs(A,{container:!0,alignItems:"center",gap:R.SMALL,xs:12,children:[a.jsx(A,{sx:{width:{xs:"72px",sm:"80px"}},children:a.jsx(N,{fullWidth:!0,size:"small",label:"از سن",id:"outlined-controlled",value:e,onChange:s=>{f(s.target.value)}})}),a.jsx(A,{sx:{width:{xs:"72px",sm:"80px"}},children:a.jsx(N,{fullWidth:!0,size:"small",label:"تا سن",id:"outlined-controlled",value:l,onChange:s=>{h(s.target.value)}})}),a.jsx(N,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",value:x,sx:{maxWidth:{xs:"100%",sm:250}},onChange:T6,onKeyDown:s=>{s.key==="Enter"&&B(s)}}),a.jsx(D,{type:"submit",endIcon:a.jsx(i6,{}),children:"جستجو"}),a.jsx(b,{title:"خروجی اکسل",px:0,children:a.jsx(D,{color:"success",onClick:()=>{H6({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const s=`${S.defaults.baseURL}0/hatching_excel/?role=${F()}&key=${b6}&age1=${e||0}&age2=${l||0}&search=filter&value=${x}&all_active_and_archive`;window.location.href=s},children:a.jsx(m6,{size:32})})})]})}),a.jsx(D,{onClick:I6,color:"error",children:"حذف فیلتر"})]}),{hatchingInfoFull:o}=w(s=>s.citySlice);return C.useEffect(()=>{r(K({age1:e,age2:l,tab:"all",textValue:x}))},[]),a.jsxs(A,{alignItems:"center",justifyContent:"center",mt:2,children:[a.jsx(A,{alignItems:"center",justifyContent:"center",isDashboard:!0,children:a.jsx($6,{noPagination:!0,isDashboard:!0,title:U&&`آخرین بروزرسانی : ${k(U)} ‌ ‌`,columns:["تعداد فارم","تعداد جوجه ریزی","حجم کل جوجه ریزی","حجم باقی مانده در سالن","حجم کشتار شده","وزن کشتار شده","حجم کل تلفات","حجم تلفات اتحادیه","حجم تلفات دامپزشک","مانده سالن ( 20 تا 30 روزه)","مانده سالن ( 30 تا 40 روزه)","مانده سالن ( 40 تا 50 روزه)","مانده سالن ( 50 تا 60 روزه)","بیشتر از 60 روزه"],data:[[(W=o==null?void 0:o.poultries)==null?void 0:W.toLocaleString(),(M=o==null?void 0:o.hatchings)==null?void 0:M.toLocaleString(),(z=o==null?void 0:o.totalHatchingQuantity)==null?void 0:z.toLocaleString(),(G=o==null?void 0:o.totalHatchingLeftOverQuantity)==null?void 0:G.toLocaleString(),(V=o==null?void 0:o.totalHatchingKilledQuantity)==null?void 0:V.toLocaleString(),(Y=o==null?void 0:o.totalHatchingKilledWeight)==null?void 0:Y.toLocaleString(),(J=o==null?void 0:o.totalHatchingAllLosses)==null?void 0:J.toLocaleString(),(X=o==null?void 0:o.totalHatchingUnionLosses)==null?void 0:X.toLocaleString(),(Z=o==null?void 0:o.totalHatchingVetLosses)==null?void 0:Z.toLocaleString(),(i=o==null?void 0:o.age2030)==null?void 0:i.toLocaleString(),(m=o==null?void 0:o.age3040)==null?void 0:m.toLocaleString(),(uu=o==null?void 0:o.age4050)==null?void 0:uu.toLocaleString(),(au=o==null?void 0:o.age5060)==null?void 0:au.toLocaleString(),(ou=o==null?void 0:o.ageMoreThan60)==null?void 0:ou.toLocaleString()]]})}),K6,a.jsx($6,{data:D6,columns:["عملیات","جزئیات","ردیف","وضعیت","شماره مجوز جوجه ریزی","شناسه یکتا","مجوز بهداشتی جوجه ریزی","نام فارم","مرغدار","بهره برداری","مالکیت","ارتباط","شهر/تعاونی","دامپزشک فارم","سالن","دوره جوجه ریزی","تاریخ ثبت جوجه ریزی","تاریخ جوجه ریزی","میانگین سن کشتار","پیش بینی تاریخ کشتار","نژاد","سن","حجم جوجه ریزی","حجم افزایشی","تلفات دامپزشک","تلفات اتحادیه","تلفات کل","حجم تعهد دولتی","حجم تعهد آزاد","حجم کشتار دولتی","وزن کشتار دولتی","حجم کشتار آزاد","وزن کشتار شده آزاد","حجم فروش به خارج استان","وزن فروش به خارج استان","حجم اختلاف کشتار","وزن اختلاف کشتار","تخصیصات بدون بار","حجم تخصیصات بدون بار","وزن تخصیصات بدون بار","حجم کشتار شده","حجم مانده در سالن"," درصد مانده در سالن"," تلفات"," کشتار شده"," باقی مانده در سالن","تایید تخلیه رصدیار"," تایید تخلیه در سماصط","وزن تعهد دولتی","وزن کشتار دولتی","وزن کشتار آزاد","میانگین وزن کشتار","وزن کل کشتار شده","تعداد کشتار فعال","تعداد درخواست کشتار","تعداد بارها","حجم بارها","وزن بارها","حجم بارهای تحویلی","وزن بارهای تحویلی","حجم زنجیره","وزن زنجیره","حجم صادرات","وزن صادرات","بارهای ورودی به انبار","حجم لاشه های انبار","وزن لاشه های انبار","درصد افت بارها","آخرین تغییر","سازنده جوجه ریزی","گزارش"],handlePageChange:_6,totalRows:c,page:j,perPage:d,handlePerRowsChange:w6,title:"کل جوجه ریزی ها (فعال و بایگانی شده)"})]})},R0=({readOnly:p})=>{var W,M,z,G,V,Y,J,X,Z,i,m,uu,au,ou;const r=I(),t=p||!1,[e,f]=C.useState(0),[l,h]=C.useState(0),[y,g]=C.useState([]),[c,n]=C.useState(0),[d,T]=C.useState(10),[x,Q]=C.useState(""),[j,q]=C.useState(1),[D6,E6]=C.useState([]),b6=w(s=>s.userSlice.userProfile.key),k6=W6(),[H6]=C.useContext(P),T6=s=>{Q(s.target.value)},R6=w(s=>s.citySlice.hatchingAdded);C.useEffect(()=>{H()},[R6]);const H=async(s=j,u=d)=>{r(E());const L=await S.get("poultry_hatching/",{params:{unknown:!0,search:"filter",value:x,role:F(),page:s,page_size:u,age1:e||0,age2:l||0}});r(v()),g(L.data.results),n(L.data.count)},_6=s=>{q(s),H(s,d)},w6=s=>{T(s),q(1)};C.useEffect(()=>{H()},[d]);const N6=()=>{H()};C.useEffect(()=>{const s=y==null?void 0:y.map((u,L)=>{var nu,su,ru,Cu,lu,cu,eu,tu,Au,du,gu,pu,Fu,yu,hu,xu,Su,vu,fu,Lu,$u,ju,Du,Eu,bu,ku,Hu,Tu,Ru,_u,wu,Nu,Iu,Pu,Ku,Ou,Qu,qu,Bu,Uu,Wu,Mu,zu,Gu,Vu,Yu,Ju,Xu,Zu,iu,mu,u6,a6,o6,n6,s6,r6,C6,l6,c6,e6,t6,A6,d6,g6,p6,F6,y6,h6;return[a.jsx(g0,{selectedAge1:null,selectedAge2:null,updateTable:N6,item:u,readOnly:t},"archive-actions"),a.jsx(b,{placement:"left",title:"جزئیات جوجه ریزی",children:a.jsx(f6,{color:"primary",onClick:()=>{k6(F()==="AdminX"?`${z6}/${u.key}`:F()==="Supporter"?`${G6}/${u.key}`:F()==="SuperAdmin"?`${V6}/${u.key}`:F()==="CityPoultry"?`${Y6}/${u.key}`:F()==="ProvinceSupervisor"?`${J6}/${u.key}`:F()==="ProvinceOperator"?`${X6}/${u.key}`:F()==="CityJahad"?`${Z6}/${u.key}`:"")},children:a.jsx(Q6,{})})},u==null?void 0:u.key),j===1?L+1:L+d*(j-1)+1,a.jsx(b,{disableHoverListener:!((nu=u==null?void 0:u.killingInfo)!=null&&nu.violationMessage&&(u!=null&&u.violation)),title:u!=null&&u.violation?`متن گزارش تخلف: ${(su=u==null?void 0:u.killingInfo)==null?void 0:su.violationMessage}`:null,sx:{"&:hover":{cursor:u!=null&&u.violation?"pointer":"default"}},placement:"top",children:a.jsx($,{variant:"body2",color:u!=null&&u.violation?"error":"primary",children:u!=null&&u.violation?"پیگیری":"عادی"})},u==null?void 0:u.key),u==null?void 0:u.licenceNumber,(ru=u==null?void 0:u.poultry)==null?void 0:ru.breedingUniqueId,u==null?void 0:u.CertId,((Cu=u==null?void 0:u.poultry)==null?void 0:Cu.unitName)||"-",`${((cu=(lu=u==null?void 0:u.poultry)==null?void 0:lu.userprofile)==null?void 0:cu.fullName)??"-"} (${((tu=(eu=u==null?void 0:u.poultry)==null?void 0:eu.userprofile)==null?void 0:tu.mobile)??"-"}) ${u!=null&&u.violationReport?"✉️":""}`,u!=null&&u.InteractTypeName?a.jsx($,{variant:"body2",color:u!=null&&u.hasTenant?"success.main":"",fontWeight:u!=null&&u.hasTenant?"bold":"normal",children:u==null?void 0:u.InteractTypeName}):"-",u==null?void 0:u.PersonTypeName,u==null?void 0:u.UnionTypeName,`${((gu=(du=(Au=u==null?void 0:u.poultry)==null?void 0:Au.address)==null?void 0:du.city)==null?void 0:gu.name)??"-"}/${(pu=u==null?void 0:u.poultry)!=null&&pu.cityOperator?(Fu=u==null?void 0:u.poultry)==null?void 0:Fu.cityOperator:"بدون تعاونی"}`,(yu=u==null?void 0:u.vetFarm)!=null&&yu.vetFarmMobile?`${(hu=u==null?void 0:u.vetFarm)==null?void 0:hu.vetFarmFullName} (${(xu=u==null?void 0:u.vetFarm)==null?void 0:xu.vetFarmMobile})`:"-",u.hall,u.period,k(u==null?void 0:u.createDate),k(u==null?void 0:u.date),(vu=(Su=u==null?void 0:u.poultry)==null?void 0:Su.killingAveAge)==null?void 0:vu.toLocaleString(),u!=null&&u.predicateDate?_(u==null?void 0:u.predicateDate):"-",u.chickenBreed,u.age,(fu=u==null?void 0:u.quantity)==null?void 0:fu.toLocaleString(),(Lu=u==null?void 0:u.increaseQuantity)==null?void 0:Lu.toLocaleString(),`${u.losses} (%${(u.losses*100/u.quantity).toFixed(0)})`,a.jsx(b,{placement:"top",title:"جهت مشاهده ثبت کننده تلفات کلیک کنید",children:a.jsx(D,{style:{color:"rgba(0,0,0,0.87)"},onClick:()=>{r(L6({title:"ویرایش تعداد جوجه ریزی",content:a.jsx(A,{container:!0,xs:12,children:!(u!=null&&u.directLossesInputer)&&!(u!=null&&u.directLossesInputer)?a.jsx($,{variant:"body1",children:"برای این جوجه ریزی تلفاتی ثبت نشده است."}):a.jsxs(A,{xs:12,children:[a.jsxs($,{variant:"body1",children:["ثبت کننده تلفات اتحادیه:"," ",u!=null&&u.directLossesInputer?`${u==null?void 0:u.directLossesInputer} در تاریخ ${_(u==null?void 0:u.directLossesDate)}`:" - "]}),a.jsxs($,{variant:"body1",children:["ویرایش کننده تلفات اتحادیه:",u!=null&&u.directLossesEditor?`${u==null?void 0:u.directLossesEditor} در تاریخ ${_(u==null?void 0:u.directLossesLastEditDate)}`:" - "]})]})})}))},children:`${($u=u==null?void 0:u.directLosses)==null?void 0:$u.toLocaleString()} (%${(u.directLosses*100/u.quantity).toFixed(0)})`})},u==null?void 0:u.key),`${(ju=u==null?void 0:u.totalLosses)==null?void 0:ju.toLocaleString()} (%${(u.totalLosses*100/u.quantity).toFixed(0)})`,`${(Du=u==null?void 0:u.totalCommitmentQuantity)==null?void 0:Du.toLocaleString()}`,`${(Eu=u==null?void 0:u.totalFreeCommitmentQuantity)==null?void 0:Eu.toLocaleString()}`,`${(bu=u==null?void 0:u.governmentalQuantity)==null?void 0:bu.toLocaleString()}`,`${(ku=u==null?void 0:u.governmentalKilledQuantity)==null?void 0:ku.toLocaleString()}`,`${(Hu=u==null?void 0:u.freeQuantity)==null?void 0:Hu.toLocaleString()}`,`${(Tu=u==null?void 0:u.freeKilledQuantity)==null?void 0:Tu.toLocaleString()}`,`${(Ru=u==null?void 0:u.outProvinceKilledQuantity)==null?void 0:Ru.toLocaleString()}`,`${(_u=u==null?void 0:u.outProvinceKilledWeight)==null?void 0:_u.toLocaleString()}`,`${(wu=u==null?void 0:u.barDifferenceRequestQuantity)==null?void 0:wu.toLocaleString()}`,`${(Nu=u==null?void 0:u.barDifferenceRequestWeight)==null?void 0:Nu.toLocaleString()}`,`${(Pu=(Iu=u==null?void 0:u.killingInfo)==null?void 0:Iu.provinceKillRequests)==null?void 0:Pu.toLocaleString()}`,`${(Ou=(Ku=u==null?void 0:u.killingInfo)==null?void 0:Ku.provinceKillRequestsQuantity)==null?void 0:Ou.toLocaleString()}`,`${(qu=(Qu=u==null?void 0:u.killingInfo)==null?void 0:Qu.provinceKillRequestsWeight)==null?void 0:qu.toLocaleString()}`,((Bu=u==null?void 0:u.killedQuantity)==null?void 0:Bu.toLocaleString())+` (%${((u==null?void 0:u.killedQuantity)*100/u.quantity).toFixed(0)})`,(Uu=u==null?void 0:u.leftOver)==null?void 0:Uu.toLocaleString(),`%${((u==null?void 0:u.leftOver)*100/(u==null?void 0:u.quantity)).toFixed(0)}`,`%${(u.totalLosses*100/u.quantity).toFixed(0)}`,`%${((u==null?void 0:u.killedQuantity)*100/u.quantity).toFixed(0)}`,`%${((u==null?void 0:u.leftOver)*100/(u==null?void 0:u.quantity)).toFixed(0)}`,`%${(((u==null?void 0:u.killedQuantity)+(u==null?void 0:u.totalLosses))*100/(u==null?void 0:u.quantity)).toFixed(0)}`,u!=null&&u.samasatDischargePercentage?`%${u==null?void 0:u.samasatDischargePercentage}`:"-",(Wu=u==null?void 0:u.totalCommitment)==null?void 0:Wu.toLocaleString(),(Mu=u==null?void 0:u.governmentalKilledQuantity)==null?void 0:Mu.toLocaleString(),(zu=u==null?void 0:u.freeKilledQuantity)==null?void 0:zu.toLocaleString(),(Gu=u==null?void 0:u.totalAverageKilledWeight)==null?void 0:Gu.toLocaleString(),(Vu=u==null?void 0:u.totalKilledWeight)==null?void 0:Vu.toLocaleString(),(Yu=u==null?void 0:u.activeKill)!=null&&Yu.activeKill?"دارد":"ندارد",(Ju=u==null?void 0:u.activeKill)!=null&&Ju.countOfRequest?u.activeKill.countOfRequest:"-",(Zu=(Xu=u==null?void 0:u.killingInfo)==null?void 0:Xu.killHouseRequests)==null?void 0:Zu.toLocaleString(),(mu=(iu=u==null?void 0:u.killingInfo)==null?void 0:iu.killHouseRequestsFirstQuantity)==null?void 0:mu.toLocaleString(),(a6=(u6=u==null?void 0:u.killingInfo)==null?void 0:u6.killHouseRequestsFirstWeight)==null?void 0:a6.toLocaleString(),(n6=(o6=u==null?void 0:u.killingInfo)==null?void 0:o6.barCompleteWithKillHouse)==null?void 0:n6.toLocaleString(),(r6=(s6=u==null?void 0:u.killingInfo)==null?void 0:s6.acceptedRealWightFinal)==null?void 0:r6.toLocaleString(),(C6=u==null?void 0:u.chainKilledQuantity)==null?void 0:C6.toLocaleString(),(l6=u==null?void 0:u.chainKilledWeight)==null?void 0:l6.toLocaleString(),(c6=u==null?void 0:u.exportKilledQuantity)==null?void 0:c6.toLocaleString(),(e6=u==null?void 0:u.exportKilledWeight)==null?void 0:e6.toLocaleString(),(A6=(t6=u==null?void 0:u.killingInfo)==null?void 0:t6.wareHouseBars)==null?void 0:A6.toLocaleString(),(g6=(d6=u==null?void 0:u.killingInfo)==null?void 0:d6.wareHouseBarsQuantity)==null?void 0:g6.toLocaleString(),(F6=(p6=u==null?void 0:u.killingInfo)==null?void 0:p6.wareHouseBarsWeight)==null?void 0:F6.toLocaleString(),(h6=(y6=u==null?void 0:u.killingInfo)==null?void 0:y6.wareHouseBarsWeightLose)==null?void 0:h6.toFixed(2),u.lastChange?`${u.lastChange.fullName} (${j6(u.lastChange.role)}) در تاریخ ${k(u.lastChange.date)}`:"-",u.latestHatchingChange?`${u.latestHatchingChange.fullName} (${j6(u.latestHatchingChange.role)}) در تاریخ ${k(u.latestHatchingChange.date)}`:"-",u!=null&&u.violationReport?a.jsx(b,{title:"مشاهده گزارش",placement:"top",children:a.jsx(f6,{color:"primary",onClick:()=>{var x6;r(L6({title:"گزارش ",content:a.jsx(q6,{columns:["ثبت کننده","تاریخ ثبت","تخلف","متن گزارش","سند"],data:[[u==null?void 0:u.violationReporter,_(u==null?void 0:u.violationReportDate),u!=null&&u.violation?"دارد":"ندارد",u==null?void 0:u.violationReport,a.jsx(A,{container:!0,xs:12,justifyContent:"center",gap:1,children:(x6=u==null?void 0:u.violationImage)==null?void 0:x6.map((S6,O6)=>a.jsx(u0,{src:S6},`${S6}-${O6}`))},u==null?void 0:u.key)]]})}))},children:a.jsx(a0,{})})},u==null?void 0:u.key):"-"]});E6(s)},[y]);const B=async s=>{s.preventDefault(),r(E()),r(K({age1:e,age2:l,tab:"unknown",textValue:x}));try{const u=await S.get(`poultry_hatching/?role=${F()}&age1=${e||0}&age2=${l||0}&search=filter&value=${x}&page=1&page_size=${d}&unknown=true`);g(u.data.results),n(u.data.count),r(v())}catch(u){console.error("Error fetching data:",u)}},I6=async s=>{s.preventDefault(),f(0),h(0),r(E()),Q(""),r(K({age1:0,age2:0,tab:"unknown",textValue:x}));try{const u=await S.get(`poultry_hatching?role=${F()}&page=${j}&page_size=${d}&search=filter&value=${x}&unknown=true`);g(u.data.results),n(u.data.count)}catch(u){console.error("Error fetching data:",u)}finally{r(v())}},[U,P6]=C.useState();C.useEffect(()=>{async function s(){try{const u=await S.get("last_update/?type=poultry_hatching");P6(u.data)}catch(u){console.error("Error fetching data:",u)}}s()},[]);const K6=a.jsxs(A,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,xs:12,mt:2,children:[a.jsx("form",{onSubmit:B,style:{flex:1},children:a.jsxs(A,{container:!0,alignItems:"center",gap:R.SMALL,children:[a.jsx(A,{sx:{width:{xs:"72px",sm:"80px"}},children:a.jsx(N,{size:"small",label:"از سن",id:"outlined-controlled",value:e,onChange:s=>{f(s.target.value)}})}),a.jsx(A,{sx:{width:{xs:"72px",sm:"80px"}},children:a.jsx(N,{size:"small",label:"تا سن",id:"outlined-controlled",value:l,onChange:s=>{h(s.target.value)}})}),a.jsx(N,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",sx:{maxWidth:{xs:"100%",sm:250}},value:x,onChange:T6,onKeyDown:s=>{s.key==="Enter"&&B(s)}}),a.jsx(D,{type:"submit",endIcon:a.jsx(i6,{}),children:"جستجو"}),a.jsx(b,{title:"خروجی اکسل",px:0,children:a.jsx(D,{color:"success",onClick:()=>{H6({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const s=`${S.defaults.baseURL}0/hatching_excel/?unknown=true&role=${F()}&key=${b6}&age1=${e||0}&age2=${l||0}&search=filter&value=${x}`;window.location.href=s},children:a.jsx(m6,{size:32})})})]})}),a.jsx(D,{onClick:I6,color:"error",children:"حذف فیلتر"})]}),{hatchingInfoFull:o}=w(s=>s.citySlice);return C.useEffect(()=>{r(K({age1:e,age2:l,tab:"unknown",textValue:x}))},[]),a.jsxs(A,{alignItems:"center",justifyContent:"center",mt:2,xs:12,children:[a.jsx(A,{alignItems:"center",justifyContent:"center",isDashboard:!0,children:a.jsx($6,{noPagination:!0,isDashboard:!0,title:U&&`آخرین بروزرسانی : ${k(U)} ‌ ‌`,columns:["تعداد فارم","تعداد جوجه ریزی","حجم کل جوجه ریزی","حجم باقی مانده در سالن","حجم کشتار شده","وزن کشتار شده","حجم کل تلفات","حجم تلفات اتحادیه","حجم تلفات دامپزشک","مانده سالن ( 20 تا 30 روزه)","مانده سالن ( 30 تا 40 روزه)","مانده سالن ( 40 تا 50 روزه)","مانده سالن ( 50 تا 60 روزه)","بیشتر از 60 روزه"],data:[[(W=o==null?void 0:o.poultries)==null?void 0:W.toLocaleString(),(M=o==null?void 0:o.hatchings)==null?void 0:M.toLocaleString(),(z=o==null?void 0:o.totalHatchingQuantity)==null?void 0:z.toLocaleString(),(G=o==null?void 0:o.totalHatchingLeftOverQuantity)==null?void 0:G.toLocaleString(),(V=o==null?void 0:o.totalHatchingKilledQuantity)==null?void 0:V.toLocaleString(),(Y=o==null?void 0:o.totalHatchingKilledWeight)==null?void 0:Y.toLocaleString(),(J=o==null?void 0:o.totalHatchingAllLosses)==null?void 0:J.toLocaleString(),(X=o==null?void 0:o.totalHatchingUnionLosses)==null?void 0:X.toLocaleString(),(Z=o==null?void 0:o.totalHatchingVetLosses)==null?void 0:Z.toLocaleString(),(i=o==null?void 0:o.age2030)==null?void 0:i.toLocaleString(),(m=o==null?void 0:o.age3040)==null?void 0:m.toLocaleString(),(uu=o==null?void 0:o.age4050)==null?void 0:uu.toLocaleString(),(au=o==null?void 0:o.age5060)==null?void 0:au.toLocaleString(),(ou=o==null?void 0:o.ageMoreThan60)==null?void 0:ou.toLocaleString()]]})}),K6,a.jsx($6,{data:D6,columns:["عملیات","جزئیات","ردیف","وضعیت","شماره مجوز جوجه ریزی","شناسه یکتا","مجوز بهداشتی جوجه ریزی","نام فارم","مرغدار","بهره برداری","مالکیت","ارتباط","شهر/تعاونی","دامپزشک فارم","سالن","دوره جوجه ریزی","تاریخ ثبت جوجه ریزی","تاریخ جوجه ریزی","میانگین سن کشتار","پیش بینی تاریخ کشتار","نژاد","سن","حجم جوجه ریزی","حجم افزایشی","تلفات دامپزشک","تلفات اتحادیه","تلفات کل","حجم تعهد دولتی","حجم تعهد آزاد","حجم کشتار دولتی","وزن کشتار دولتی","حجم کشتار آزاد","وزن کشتار شده آزاد","حجم فروش به خارج استان","وزن فروش به خارج استان","حجم اختلاف کشتار","وزن اختلاف کشتار","تخصیصات بدون بار","حجم تخصیصات بدون بار","وزن تخصیصات بدون بار","حجم کشتار شده","حجم مانده در سالن"," درصد مانده در سالن"," تلفات"," کشتار شده"," باقی مانده در سالن","تایید تخلیه رصدیار"," تایید تخلیه در سماصط","وزن تعهد دولتی","وزن کشتار دولتی","وزن کشتار آزاد","میانگین وزن کشتار","وزن کل کشتار شده","تعداد کشتار فعال","تعداد درخواست کشتار","تعداد بارها","حجم بارها","وزن بارها","حجم بارهای تحویلی","وزن بارهای تحویلی","حجم زنجیره","وزن زنجیره","حجم صادرات","وزن صادرات","بارهای ورودی به انبار","حجم لاشه های انبار","وزن لاشه های انبار","درصد افت بارها","آخرین تغییر","سازنده جوجه ریزی","گزارش"],handlePageChange:_6,totalRows:c,page:j,perPage:d,handlePerRowsChange:w6,title:"تعیین تکلیف نشده‌ها"})]})},G0=()=>{const p=I(),[,,r,,t]=C.useContext(P),e=M6({initialValues:{numberInput:0}}),{hatchings:f,poultryRequestsTotalQuantity:l,cityGetArchiveHatchings:h}=w(d=>d.citySlice),{getSlaughtersKillRequest:y}=w(d=>d.citySlice);C.useEffect(()=>{l&&e.setFieldValue("numberInput",l==null?void 0:l.quantity)},[l]),C.useEffect(()=>{},[f,y,h]);const[g,c]=C.useState("active"),n=(d,T)=>{c(T)};return C.useEffect(()=>{p(A0({selectedDate1:r,selectedDate2:t}))},[r,t]),a.jsxs(A,{container:!0,gap:R.SMALL,alignSelf:"center",alignItems:"center",style:{display:"block"},children:[a.jsx(A,{container:!0,alignItems:"center",justifyContent:"center",children:a.jsxs(r0,{value:g,onChange:n,centered:!0,"aria-label":"hatching tabs",scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,sx:{width:"100%",overflow:"hidden",borderBottom:"1px solid #E0E0E0"},children:[a.jsx(v6,{label:"جوجه ریزی های فعال",value:"active"}),a.jsx(v6,{label:"تعیین تکلیف نشده‌ها",value:"pending"}),a.jsx(v6,{label:"بایگانی جوجه ریزی ها",value:"archive"}),a.jsx(v6,{label:"کل جوجه ریزی‌ها",value:"total"}),F()!=="CityPoultry"&&a.jsx(v6,{label:"گزارش فارم ها",value:"info"})]})}),g==="hatchingUpdate"&&a.jsx(j0,{}),g==="transport-chickens"&&a.jsx(H0,{}),g==="active"&&a.jsx(C0,{container:!0,alignItems:"center",justifyContent:"space-between",style:{width:"100%"},pt:2,children:a.jsx(A,{container:!0,gap:R.SMALL,justifyContent:"space-between",mt:R.TINY,px:{xs:2,sm:0},children:F()!=="CityOperator"&&a.jsx(D,{className:"first-step",variant:"contained",onClick:()=>{p(L6({title:"انتقال به بایگانی",content:a.jsx(f0,{})}))},children:"انتقال به بایگانی"})})}),a.jsx(A,{alignItems:"center",gap:R.SMALL,direction:"column",px:1,children:a.jsxs(A,{container:!0,mt:R.SMALL,children:[g==="active"&&a.jsx(p0,{}),g==="info"&&a.jsx(F0,{}),g==="bar-difference"&&a.jsx(h0,{}),g==="total"&&a.jsx(T0,{}),g==="pending"&&a.jsx(R0,{}),g==="archive"&&a.jsx(y0,{})]})})]})};export{G0 as C}; diff --git a/build/assets/CityNewKillRequest-C2SXYvKb.js b/build/assets/CityNewKillRequest-C2SXYvKb.js new file mode 100644 index 0000000..8a2158e --- /dev/null +++ b/build/assets/CityNewKillRequest-C2SXYvKb.js @@ -0,0 +1,2 @@ +import{j as u,T as c,ao as t0,ap as s0,aq as n0,B as O,aA as a6,al as J,ak as v,I as uu,aU as xu,aa as i6,ag as yu,ah as eu,am as c6,av as o0,aw as a0,ax as B,aX as $,ai as Y,aj as R,d as C6,bi as i0}from"./mui-vendor-CkIVaoQP.js";import{d as d6}from"./Search-Dek2fED1.js";import{r as a}from"./react-vendor-CmFgShSM.js";import{a as su,f as ru,u as c0}from"./redux-vendor-B7uoacJt.js";import{L as tu,j as nu,h as H,X as L,A as h6,$ as C0,di as d0,u as lu,du as h0,a0 as p6,fS as p0,c as z,v as A6,cs as g6,b as _,c2 as A0,M as I,fe as g0,N as U,p as v0,O as F0,G as s,S as A,C as v6,W as x0,fg as fu,cm as F6,a1 as x6,fA as y6}from"./index-CeyyVc1v.js";import{d as y0}from"./Delete-C5MyLelE.js";import{d as f0}from"./Add--yVWBJhC.js";import{d as j0}from"./Done-Dp5awdte.js";import{a as m0}from"./aviculture-get-unions-C1NoVg85.js";import{a as S0}from"./aviculture-get-hatching-data-DsjDNd82.js";import{N as f6}from"./NumberFormatCustom-DwWPj40N.js";import{D as b0}from"./DialogAlert-BfXcr-Kr.js";import{S as E0}from"./SimpleTable-DBAoNnCU.js";import{b as k0,a as B0}from"./province-get-sell-for-freezing-status-ieuVFEgW.js";import{p as T0,a as P0}from"./province-policy-market-daily-limitation-DueqDboR.js";import{i as w0}from"./isValidIndexWeight-C_ik-uYa.js";import{L as _0}from"./LabelField-B6eRSoQP.js";const j6=su("CITY_GET_POULTRY_DATA",async(b,{dispatch:S})=>{S(tu());const{data:P,status:N}=await nu.get("Poultry/?type=filter&value="+b);return S(H()),{data:P,status:N}}),I0=su("CITY_GET_BUYER",async b=>{const{data:S,status:P}=await nu.get("https://artasystemback.rasadyaar.ir/api/find/?data="+b);return{data:S,status:P}}),W0=su("AVICULTURE_GET_POULTRY",async()=>{const{data:b,status:S}=await nu.get("Poultry/",{params:{role:L()}});return{data:b,status:S}}),L0=su("AVICULTURE_GET_DIRECT_BUYS",async(b,{dispatch:S})=>{S(tu());const{data:P,status:N}=await nu.get("kill_request/?poultry_key="+b);return S(H()),{data:P,status:N}}),J0=({userCheck:b,selectedAge1:S,selectedAge2:P,isAviculture:N,updateTable:Q})=>{var Lu,Nu,qu,Du,Vu,Mu,Gu,Ou,$u,Yu,Ru,zu,Uu,Hu,Qu,Ku,Xu,Zu,Ju;const[j]=a.useContext(h6),[K,m6]=a.useState(""),[ju,S6]=a.useState(""),[F,b6]=a.useState(""),[f,ou]=a.useState(""),[q,E6]=a.useState(""),[au,k6]=a.useState(""),[mu,B6]=a.useState(""),[D,T6]=a.useState(""),[P6]=a.useState(!1),[V,w6]=a.useState(!1),[_6,I6]=a.useState(),[iu,W6]=a.useState(""),[X,L6]=a.useState(""),[W,N6]=a.useState(!1),[m,Su]=a.useState(!1),[cu,q6]=a.useState(!1),[i,D6]=a.useState(null),[n,bu]=a.useState(),[,,Cu,,du]=a.useContext(h6),[Eu,ku]=a.useState(!1),[,hu]=C0(),[Bu,Tu]=a.useState(!1),{weightRange:V6}=ru(e=>e.provinceSlice),[M6,G6]=a.useState([]),{avicultureSlaughters:Z}=ru(e=>e.avicultureSlice),{cityGetPoultries:O6}=ru(e=>e.citySlice),[Pu,$6]=a.useState(!1),Y6=()=>{C(B0()).then(e=>{$6(e.payload.data.poultryStatus)})};a.useEffect(()=>{G6(Z==null?void 0:Z.map(e=>{var p;let t="";return e.killer?t=`کشتارکن ${e==null?void 0:e.name}`:t=`کشتارگاه ${e==null?void 0:e.name}`,{label:`${t} / ${(p=e==null?void 0:e.quantitySum)==null?void 0:p.toLocaleString()} قطعه`,value:`${e==null?void 0:e.name} (${e==null?void 0:e.fullname})`,quantity:e==null?void 0:e.quantitySum,killhouseKey:e==null?void 0:e.killReqKey,item:e}}))},[Z]);const[r,R6]=a.useState(),[pu,Au]=a.useState();a.useEffect(()=>{C(d0()).then(e=>{var t,p,g,h,w,G;R6(e.payload.data),((t=e.payload.data)==null?void 0:t.approved)===!1&&l.setFieldValue("avicultureSellType","freePrice"),((p=e.payload.data)==null?void 0:p.approved)===!0&&((g=e.payload.data)==null?void 0:g.lowestPrice)===0&&((h=e.payload.data)==null?void 0:h.highestPrice)===0&&((w=e.payload.data)==null?void 0:w.lowestWeight)===0&&((G=e.payload.data)==null?void 0:G.highestWeight)===0&&l.setFieldValue("avicultureSellType","goverment")}),C(h0())},[]),a.useEffect(()=>{b&&(Tu(!0),C(j6(b)).then(e=>{ou(e.payload.data),Tu(!1)}))},[b]),a.useEffect(()=>{N&&(C(tu()),C(W0()).then(e=>{ou(e.payload.data),C(H())})),Y6()},[]);const z6=[{type:"text",id:1,value:""}],U6=[{type:"text",id:1,value:""}],[T,gu]=a.useState(z6),[M,vu]=a.useState(U6),C=c0(),{avicultureChickenPrice:d}=ru(e=>e.avicultureSlice),[wu]=a.useState("insideProvince");a.useEffect(()=>{C(p6())},[]);const[y,H6]=a.useState(),[Fu,_u]=a.useState(),[Iu,Wu]=a.useState(null);a.useEffect(()=>{var e;f&&C(m0({breeding_uniq_id:(e=f[0])==null?void 0:e.breedingUniqueId})).then(t=>{var p;_u((p=t.payload.data[0])==null?void 0:p.key),H6(t.payload.data)})},[f]),a.useEffect(()=>{ku(!0),C(p0()).then(()=>{ku(!1)})},[]);const Q6=()=>{T.length<3&&(gu(e=>[...e,{type:"text",value:""}]),vu(e=>[...e,{type:"text",value:""}]))},K6=()=>{const e=T.length-1;if(e!==0){const t=T==null?void 0:T.filter((g,h)=>h!==e),p=M==null?void 0:M.filter((g,h)=>h!==e);gu(t),vu(p)}},X6=e=>{e.preventDefault();const t=e.target.id;gu(p=>{const g=p.slice();return g[t].value=e.target.value,g})},k=e=>{e.preventDefault();const t=e.target.id;vu(p=>{const g=p.slice();return g[t].value=e.target.dataset.value,g})};a.useEffect(()=>{d&&I6(d==null?void 0:d.key)},[d]);const l=lu({initialValues:{noChicken:"",sellType:{cash:!0,haveTime:!1},price1:"",price2:"",price3:"",slaughterDate:A6(Date()).format("YYYY-MM-DD"),period1:"4",period2:"4",period3:"4",weight:"",losses:"0",isUnion:P6,isStockMarket:V,isAccepted:L()!=="Poultry",selectedSlaughters:[],financialOperation:"outside-system",avicultureSellType:"goverment",poultryPrice:""},validationSchema:z({noChicken:I().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!").min(0,"تعداد وارد شده از حداقل ممکن کمتر است").max(Number(X),"تعداد وارد شده قابل تخصیص نیست"),isAccepted:A0().test("req","باید تعهد نامه را بپذیرید!",(e,t)=>t.originalValue&&t.originalValue===!0).required("این فیلد اجباری است!"),price1:_().typeError("لطفا عدد وارد کنید!").min(d==null?void 0:d.floorPrice,"قیمت وارد شده از کف قیمت امروز کمتر است").max(d==null?void 0:d.ceilingPrice,"قیمت وارد شده از سقف قیمت امروز بیشتر است"),price2:_().typeError("لطفا عدد وارد کنید!").min(d==null?void 0:d.floorPrice,"قیمت وارد شده از کف قیمت امروز کمتر است").max(d==null?void 0:d.ceilingPrice,"قیمت وارد شده از سقف قیمت امروز بیشتر است"),price3:_().typeError("لطفا عدد وارد کنید!").min(d==null?void 0:d.floorPrice,"قیمت وارد شده از کف قیمت امروز کمتر است").max(d==null?void 0:d.ceilingPrice,"قیمت وارد شده از سقف قیمت امروز بیشتر است"),weight:_().test("weight","وزن را تا دو رقم اعشار وارد کنید",(e,t)=>t.originalValue&&t.originalValue.toString().length<=4).required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!"),losses:_().required("این فیلد اجباری است!").max(au,"تلفات وارد شده از باقیمانده بیشتر است!").typeError("لطفا تعداد تلفات را وارد کنید!"),poultryPrice:_().typeError("لطفا فیلد را به درستی وارد کنید!"),sellType:z().test("sellType","نحوه فروش را انتخاب کنید!",(e,t)=>t.originalValue&&Object.values(t.originalValue).some(p=>p===!0)).required("این فیلد اجباری است!"),selectedSlaughters:(Nu=(Lu=f[0])==null?void 0:Lu.provinceAllowChooseKillHouse)!=null&&Nu.mandatory?g6().of(I().required("At least one item is required.")).min(1,"At least one item is required."):g6()})});a.useEffect(()=>{if(r!=null&&r.approved&&!((r==null?void 0:r.lowestPrice)===0&&(r==null?void 0:r.highestPrice)===0&&(r==null?void 0:r.lowestWeight)===0&&(r==null?void 0:r.highestWeight)===0))if(l.values.weight*1e3<=(r==null?void 0:r.lowestWeight))Au(r==null?void 0:r.lowestPrice);else if(l.values.weight*1e3>=(r==null?void 0:r.highestWeight))Au(r==null?void 0:r.highestPrice);else{const e=(r==null?void 0:r.highestWeight)-(r==null?void 0:r.lowestWeight),p=((r==null?void 0:r.highestPrice)-(r==null?void 0:r.lowestPrice))/e,g=l.values.weight*1e3-(r==null?void 0:r.lowestWeight);Au(g*p+(r==null?void 0:r.lowestPrice)),l.setFieldValue("poultryPrice",g*p+(r==null?void 0:r.lowestPrice))}},[l.values.weight]);const x=lu({initialValues:{userInfoCheck:""},validationSchema:z({userInfoCheck:I().min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد")})}),E=lu({initialValues:{userInfoCheck:""},validationSchema:z({userInfoCheck:_().typeError("لطفا فیلد را به درستی وارد کنید!")})}),o=lu({initialValues:{mobile:"",fname:"",lname:"",nationalCode:"",province:"",city:""},validationSchema:z({mobile:I().test("len","شماره تلفن باید با 0 شروع شود",(e,t)=>t.originalValue&&t.originalValue.startsWith("0")).test("len","شماره تماس 11 رقم باید باشد",(e,t)=>{if(t.originalValue)return t.originalValue.length===11}).required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),fname:I().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),lname:I().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),nationalCode:_().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),province:I().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),city:I().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!")})});a.useEffect(()=>{l.validateForm(),x.validateForm(),E.validateForm(),o.validateForm()},[]),a.useEffect(()=>{C(g0({date:l.values.slaughterDate}))},[l.values.slaughterDate]);const Z6=l.values.noChicken*1e3,J6=u.jsxs(u.Fragment,{children:[u.jsxs(c,{variant:"body1",children:["اینجانب ",hu==null?void 0:hu.fullname," به وکالت از"," ",(Du=(qu=f[0])==null?void 0:qu.userprofile)==null?void 0:Du.fullName," موافقت خود را نسبت به موارد ذکر شده اعلام می نمایم."]}),u.jsxs(t0,{children:[u.jsx(s0,{children:u.jsx(j0,{})}),u.jsx(n0,{primary:` بر اساس این توافق نامه در صورت لغو فروش ${l.values.noChicken} قطعه + مرغ ${Z6} ریال جریمه خواهم شد.`})]}),u.jsx(c,{})]});a.useEffect(()=>{let e=l.values.weight;const t=l.values.weight.toString().split(".").join("");l.values.weight&&t.length<=3&&(t.length===2&&(e=t[0]+"."+t[1]),t.length===3&&(e=t[0]+"."+t[1]+t[2])),isNaN(Number.parseFloat(e))?l.setFieldValue("weight",""):l.setFieldValue("weight",Number.parseFloat(e))},[l.values.weight]),a.useEffect(()=>{V&&C(p6()).then(e=>{Array.isArray(e.payload.data)&&(j({vertical:"top",horizontal:"center",msg:"قیمت روز مرغ در سامانه ثبت نشده است.",severity:"error"}),C(U({right:!1,bottom:!1,content:null})))})},[V]),a.useEffect(()=>{l.validateForm(),x.validateForm()},[]),a.useEffect(()=>{l.setFieldValue("selectedSlaughters",[]),Wu(null)},[l.values.noChicken]),a.useEffect(()=>{q&&(C(L0(q)).then(e=>{var p;const t=(p=e==null?void 0:e.payload)==null?void 0:p.data;if(t!=null&&t.length){const g=t==null?void 0:t.map(h=>{var G,u6,e6,r6,l6,t6,s6,n6,o6;let w="";return h.directBuyingState==="pending"?w="در انتظار تایید استان":h.directBuyingState==="rejected"?w="رد شده":h.directBuyingState==="accepted"?w="تایید شده":h.directBuyingState==="deleted"&&(w="حذف شده"),[(G=h==null?void 0:h.killHouse)!=null&&G.killer?"کشتارکن":"کشتارگاه",`${(u6=h==null?void 0:h.killHouse)==null?void 0:u6.name} (${(l6=(r6=(e6=h==null?void 0:h.killHouse)==null?void 0:e6.killHouseOperator)==null?void 0:r6.user)==null?void 0:l6.fullname}) ${(n6=(s6=(t6=h==null?void 0:h.killHouse)==null?void 0:t6.killHouseOperator)==null?void 0:s6.user)==null?void 0:n6.mobile}`,(o6=h==null?void 0:h.killCapacity)==null?void 0:o6.toLocaleString(),v0(h==null?void 0:h.reciveDate),h.inputDirectBuyingCode?"دارد":"ندارد",w]});C(F0({title:"هشدار!",content:u.jsxs(u.Fragment,{children:[u.jsx(c,{children:"مرغدار انتخاب شده برای تاریخ امروز درخواست فعال خرید مستقیم دارد."}),u.jsx(E0,{columns:["ماهیت خریدار","خریدار","تعداد (قطعه)","تاریخ کشتار","تاییدیه مرغدار","وضعیت"],data:g}),u.jsxs(s,{container:!0,gap:A.SMALL,children:[u.jsx(O,{variant:"contained",color:"error",onClick:()=>{C(v6()),C(U({right:!1,bottom:!1,content:null}))},children:"انصراف از عملیات"}),u.jsx(O,{variant:"contained",onClick:()=>{C(v6())},children:"ادامه عملیات"})]})]})}))}}),C(S0(q)).then(e=>{e.payload.data?S6(e.payload.data):j({vertical:"top",horizontal:"center",msg:"اطلاعات جوجه ریزی یافت نشد!",severity:"error"})}))},[q]),a.useEffect(()=>{var t,p,g;let e=l.values.noChicken<=Number(D)&&Number(l.values.losses)<=Number(D)?l.values.avicultureSellType==="freePrice"?parseInt((t=F==null?void 0:F.freeGovernmentalInfo)==null?void 0:t.leftTotalFreeCommitmentQuantity):Number(D)-Number(l.values.losses):0;if(m&&(i!=null&&i.active)&&((p=i==null?void 0:i.market)==null?void 0:p.remainQuantity)!==void 0&&((g=i==null?void 0:i.market)==null?void 0:g.maxLimitationQuantity)!==void 0){const h=i.market.remainQuantity;e=Math.min(e,h)}L6(e),l.validateForm()},[l.values.losses,D,l.values.noChicken,l.values.avicultureSellType,m,i]);const[u0,e0]=a.useState(!1),[r0,l0]=a.useState(!1);return a.useEffect(()=>{k6(F.quantity),B6(F.losses),T6(F.leftOver),C(k0()).then(e=>{e0(e.payload.data.permission)}),C(T0()).then(e=>{l0(e.payload.data.allow)})},[F]),a.useEffect(()=>{m&&C(P0()).then(e=>{var t;(t=e.payload)!=null&&t.data&&D6(e.payload.data)})},[m]),u.jsx(u.Fragment,{children:!f&&!N?u.jsxs(u.Fragment,{children:[u.jsx(s,{container:!0,alignItems:"center",justifyContent:"center",children:Bu&&u.jsx(a6,{})}),!Bu&&u.jsxs(s,{children:[u.jsx(c,{children:"جستجو کاربر"}),u.jsxs(s,{mt:A.SMALL,display:"flex",width:1,children:[u.jsx(J,{fullWidth:!0,id:"userInfoCheck",getOptionDisabled:e=>e.disabled<=0,loading:Eu,options:O6||[],getOptionLabel:e=>e.label,onChange:(e,t)=>{x.setFieldValue("userInfoCheck",t.value)},onBlur:x.handleBlur,renderInput:e=>u.jsx(v,{...e,label:"مرغداری/مانده جوجه ریزی",variant:"outlined",slotProps:{input:{...e.InputProps,endAdornment:u.jsxs(u.Fragment,{children:[Eu?u.jsx(a6,{color:"inherit",size:20}):null,e.InputProps.endAdornment]})}}})}),u.jsx(uu,{disabled:!x.isValid,"aria-label":"delete",color:"primary",onClick:()=>{C(j6(x.values.userInfoCheck)).then(e=>{e.error&&j({vertical:"top",horizontal:"center",msg:"کاربر یافت نشد",severity:"error"}),ou(e.payload.data)})},children:u.jsx(d6,{})})]}),u.jsx(xu,{children:"شماره موبایل با صفر شروع می‌شود!"}),u.jsx(c,{mt:A.SMALL,variant:"body2",color:"secondary",children:"پس از ثبت درخواست، میتوانید آن را در بخش درخواست ها مدیریت کنید."})]})]}):u.jsxs(s,{container:!0,gap:A.SMALL,direction:"column",display:"flex",children:[u.jsxs(s,{container:!0,gap:A.SMALL,direction:"column",children:[u.jsx(s,{minWidth:210,children:u.jsx(J,{disablePortal:!0,id:"combo-box-demo",options:Array.isArray(f)?f.map(e=>({id:e.key,label:e.unitName})):[],onChange:(e,t)=>{E6(t.id)},renderInput:e=>u.jsx(v,{...e,label:"محل پرورش"})})}),q&&u.jsx(s,{minWidth:210,children:u.jsx(J,{disablePortal:!0,id:"hatching",options:ju?ju.map(e=>({id:e.key,race:e.chickenBreed,selected:e,label:`دوره ${e.period} سالن ${e.hall} نژاد ${e.chickenBreed} باقیمانده ${e.leftOver} قطعه`})):[],onChange:(e,t)=>{m6(t.id),b6(t.selected),W6(t.race)},renderInput:e=>u.jsx(v,{...e,label:"دوره جوجه ریزی"})})}),K&&u.jsxs(u.Fragment,{children:[u.jsx(s,{children:u.jsx(v,{disabled:!0,fullWidth:!0,id:"outlined-read-only-input",label:"تعداد جوجه ریزی",value:au||"نامشخص",InputProps:{readOnly:!0}})}),u.jsx(s,{children:u.jsx(v,{disabled:!0,fullWidth:!0,id:"outlined-read-only-input",label:"جمع تلفات ثبت شده دامپزشک و مرغدار",value:mu||"نامشخص",InputProps:{readOnly:!0}})}),u.jsx(s,{children:u.jsx(v,{disabled:!0,fullWidth:!0,id:"outlined-read-only-input",label:"باقیمانده",value:D||"نامشخص",InputProps:{readOnly:!0}})})]})]}),F&&u.jsxs(s,{container:!0,gap:A.SMALL,direction:"column",children:[u.jsx(s,{children:u.jsx(c,{children:"اطلاعات کشتار"})}),u.jsx(s,{children:u.jsx(f6,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"noChicken",label:"تعداد مرغ برای کشتار",variant:"outlined",value:l.values.noChicken,error:l.values.noChicken>X?(()=>{var e,t,p;return m&&(i!=null&&i.active)&&l.values.noChicken>((e=i==null?void 0:i.market)==null?void 0:e.remainQuantity)?`حداکثر ظرفیت پنل معاملات ${(p=(t=i==null?void 0:i.market)==null?void 0:t.remainQuantity)==null?void 0:p.toLocaleString()} قطعه است!`:"این حجم قابل تخصیص نیست!"})():l.touched.noChicken?!!l.errors.noChicken:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.values.noChicken>X?(()=>{var e,t,p;return m&&(i!=null&&i.active)&&l.values.noChicken>((e=i==null?void 0:i.market)==null?void 0:e.remainQuantity)?`حداکثر ظرفیت پنل معاملات ${(p=(t=i==null?void 0:i.market)==null?void 0:t.remainQuantity)==null?void 0:p.toLocaleString()} قطعه است!`:"این حجم قابل تخصیص نیست!"})():l.touched.noChicken&&l.errors.noChicken?l.errors.noChicken:null})}),(r==null?void 0:r.approved)&&u.jsxs(s,{container:!0,gap:A.TINY,justifyContent:"start",alignItems:"start",children:[u.jsxs(s,{container:!0,gap:A.TINY,children:[u.jsx(c,{color:e=>e.palette.grey.A700,variant:"caption",children:"مجوز فروش آزاد:"}),u.jsx(c,{variant:"button",children:(Mu=parseInt((Vu=F==null?void 0:F.freeGovernmentalInfo)==null?void 0:Vu.totalFreeCommitmentQuantity))==null?void 0:Mu.toLocaleString()}),u.jsx(c,{variant:"button",children:"قطعه"})]}),u.jsxs(s,{container:!0,gap:A.TINY,children:[u.jsx(c,{color:"error",variant:"caption",children:"مانده فروش آزاد:"}),u.jsxs(c,{variant:"button",color:"error",children:[parseInt((Gu=F==null?void 0:F.freeGovernmentalInfo)==null?void 0:Gu.leftTotalFreeCommitmentQuantity).toLocaleString(),"‌‌","قطعه"]})]})]}),u.jsx(s,{children:u.jsx(x0,{label:"تاریخ کشتار",id:"slaughterDate",renderInput:e=>u.jsx(v,{...e}),value:l.values.slaughterDate,error:l.touched.slaughterDate?!!l.errors.slaughterDate:null,onChange:e=>{l.setFieldValue("slaughterDate",A6(e).format("YYYY-MM-DD"))},onBlur:l.handleBlur,helperText:l.touched.slaughterDate&&l.errors.slaughterDate?l.errors.slaughterDate:null})}),u.jsx(s,{children:u.jsx(v,{id:"weight",label:"وزن تقریبی مرغ",variant:"outlined",InputProps:{endAdornment:u.jsx(i6,{position:"end",children:"کیلوگرم"})},value:l.values.weight,error:l.touched.weight?!!l.errors.weight:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.weight&&l.errors.weight?l.errors.weight:null})}),wu==="insideProvince"?u.jsxs(u.Fragment,{children:[u.jsx(s,{display:"none",children:u.jsx(yu,{children:u.jsx(eu,{"aria-labelledby":"demo-radio-buttons-group-label",defaultValue:"فروش اتحادیه",name:"radio-buttons-group",onChange:e=>{w6(e.currentTarget.value)},children:V==="فروش مزایده ای"&&u.jsxs(s,{container:!0,gap:A.SMALL,children:[u.jsxs(s,{container:!0,gap:A.SMALL,alignItems:"center",children:[u.jsx(c,{color:e=>e.palette.grey.A700,variant:"caption",children:"کف قیمت امروز:"}),u.jsxs(c,{color:"secondary",variant:"button",children:[d!=null&&d.floorPrice?d==null?void 0:d.floorPrice.toLocaleString():"نامشخص"," "," ","ریال"]})]}),u.jsxs(s,{container:!0,gap:A.SMALL,alignItems:"center",children:[u.jsx(c,{color:e=>e.palette.grey.A700,variant:"caption",children:"سقف قیمت امروز:"}),u.jsxs(c,{color:"secondary",variant:"button",children:[d!=null&&d.ceilingPrice?d==null?void 0:d.ceilingPrice.toLocaleString():"نامشخص","ریال"]})]}),u.jsx(c6,{style:{width:"100%"}}),T.map((e,t)=>u.jsxs(s,{gap:A.SMALL,container:!0,sx:{minWidth:210},children:[u.jsxs(c,{mb:A.SMALL,display:"flex",children:["پیشنهاد ",t+1]}),u.jsx(f6,{allowLeadingZeros:!0,thousandSeparator:",",error:!1,fullWidth:!0,label:"قیمت پیشنهادی",variant:"outlined",onChange:X6,id:t}),u.jsxs(yu,{fullWidth:!0,children:[u.jsx(o0,{id:"demo-simple-select-label",children:"بازه زمانی (ساعت)"}),u.jsxs(a0,{id:t,labelId:"demo-simple-select-label",label:"بازه زمانی (ساعت)",children:[u.jsx(B,{onClick:k,id:t,value:"1",children:"1"}),u.jsx(B,{onClick:k,id:t,value:"2",children:"2"}),u.jsx(B,{onClick:k,id:t,value:"3",children:"3"}),u.jsx(B,{onClick:k,id:t,value:"4",children:"4"}),u.jsx(B,{onClick:k,id:t,value:"5",children:"5"}),u.jsx(B,{onClick:k,id:t,value:"6",children:"6"}),u.jsx(B,{onClick:k,id:t,value:"7",children:"7"}),u.jsx(B,{onClick:k,id:t,value:"8",children:"8"}),u.jsx(B,{onClick:k,id:t,value:"9",children:"9"}),u.jsx(B,{onClick:k,id:t,value:"10",children:"10"})]}),u.jsx(xu,{children:l.touched.period1&&l.errors.period1?l.errors.period1:null})]})]},t)),u.jsxs(s,{container:!0,children:[T.length>1&&u.jsx(uu,{onClick:K6,"aria-label":"delete",color:"secondary",children:u.jsx(y0,{})}),T.length<3&&u.jsxs(uu,{xs:12,onClick:Q6,"aria-label":"add",color:"primary",children:[u.jsx(f0,{}),u.jsx(c,{children:"افزودن پیشنهاد جدید"})]})]}),u.jsx(s,{container:!0,sx:{width:"100%"},children:u.jsxs(c,{variant:"body2",children:["در صورت عدم فروش در بورس، از طریق اتحادیه فروش برود",u.jsx($,{id:"isUnion",onChange:l.handleChange})]})})]})})})}),(r==null?void 0:r.approved)&&!((r==null?void 0:r.lowestPrice)===0&&(r==null?void 0:r.highestPrice)===0&&(r==null?void 0:r.lowestWeight)===0&&(r==null?void 0:r.highestWeight)===0)&&u.jsxs(s,{children:[u.jsx(c,{children:"نوع فروش"}),u.jsxs(eu,{"aria-label":"avicultureSellType",name:"avicultureSellType",value:l.values.avicultureSellType,onChange:l.handleChange,children:[u.jsx(Y,{value:"goverment",control:u.jsx(R,{}),label:"دولتی"}),u.jsx(Y,{value:"freePrice",control:u.jsx(R,{}),label:"آزاد"})]})]}),(r==null?void 0:r.approved)&&l.values.avicultureSellType==="goverment"&&!((r==null?void 0:r.lowestPrice)===0&&(r==null?void 0:r.highestPrice)===0&&(r==null?void 0:r.lowestWeight)===0&&(r==null?void 0:r.highestWeight)===0)&&u.jsxs(s,{gap:1,container:!0,p:1,style:{borderStyle:"solid",borderWidth:"1px",borderColor:"red",borderRadius:"5px"},children:[u.jsx(C6,{title:`قیمت مصوب بر اساس قیمت مصوب کف ${r==null?void 0:r.lowestPrice.toLocaleString()} هزار ریال و سقف ${(Ou=r==null?void 0:r.highestPrice)==null?void 0:Ou.toLocaleString()} هزار ریال محاسبه شده است.`,children:u.jsx(c,{variant:"body1",color:"secondary",children:"قیمت مصوب:"})}),u.jsxs(c,{variant:"body1",color:"primary",children:[pu?($u=Math.round(pu))==null?void 0:$u.toLocaleString():0,"ریال"]})]}),u.jsx(c6,{}),u.jsxs(s,{style:{display:"none"},children:[u.jsx(c,{children:"نحوه تسویه حساب"}),u.jsxs(eu,{name:"financialOperation",value:l.values.financialOperation,onChange:l.handleChange,children:[u.jsx(C6,{title:"تسویه با مرغدار توسط خریدار بصورت مستقیم صورت میگیرد",arrow:!0,children:u.jsx(Y,{value:"outside-system",control:u.jsx(R,{}),label:"خارج از سامانه"})}),u.jsx(Y,{value:"inside-system",control:u.jsx(R,{}),label:"درون سامانه",disabled:!0})]})]}),(f==null?void 0:f.length)&&((Ru=(Yu=f[0])==null?void 0:Yu.provinceAllowChooseKillHouse)==null?void 0:Ru.allowState)&&u.jsxs(s,{container:!0,direction:"column",gap:A.SMALL,children:[u.jsx(J,{disablePortal:!0,value:(zu=l.values.selectedSlaughters)!=null&&zu.length?l.values.selectedSlaughters[0]:null,onChange:(e,t)=>{l.setFieldValue("selectedSlaughters",[t.value]),Wu(t.killhouseKey)},id:"combo-box-demo",options:M6,sx:{width:"100%"},getOptionDisabled:e=>{const t=Number(l.values.noChicken);return e.item.quantitySumu.jsx(v,{...e,label:"خریدار/ظرفیت باقیمانده"})}),u.jsxs(s,{container:!0,gap:A.SMALL,children:[l.values.selectedSlaughters&&u.jsx(c,{variant:"body1",children:"کشتارگاهای انتخابی"}),u.jsx(s,{container:!0,direction:"column",children:l.values.selectedSlaughters.map((e,t)=>u.jsxs(c,{variant:"body2",children:[t+1,"- ",e]},t))})]})]}),u.jsx(s,{style:{display:"none"},children:u.jsxs(yu,{children:[u.jsx(i0,{id:"demo-radio-buttons-group-label",children:"اطلاعات تعاونی"}),u.jsx(eu,{defaultValue:y!=null&&y.length?(Uu=y[0])==null?void 0:Uu.key:"",name:"radio-buttons-group",onChange:e=>{_u(e.currentTarget.value)},children:y==null?void 0:y.map(e=>u.jsx(u.Fragment,{children:u.jsx(Y,{disabled:!0,value:e.key,control:u.jsx(R,{}),label:e.unitName})}))})]})})]}):u.jsxs(u.Fragment,{children:[u.jsxs(s,{children:[u.jsx(c,{variant:"body2",children:"اطلاعات کاربر را وارد یا جستجو کنید."}),u.jsxs(s,{mt:A.SMALL,display:"flex",width:1,children:[u.jsx(v,{fullWidth:!0,id:"userInfoCheck",label:"شماره موبایل یا کد ملی ",variant:"outlined",value:E.values.userInfoCheck,error:E.touched.userInfoCheck?!!E.errors.userInfoCheck:null,onChange:E.handleChange,onBlur:E.handleBlur,helperText:E.touched.userInfoCheck&&E.errors.userInfoCheck?E.errors.userInfoCheck:null}),u.jsx(uu,{disabled:!E.isValid,"aria-label":"delete",color:"primary",onClick:()=>{C(I0(E.values.userInfoCheck)).then(e=>{e.error?(j({vertical:"top",horizontal:"center",msg:"کاربر یافت نشد",severity:"error"}),bu("")):bu(e.payload.data)})},children:u.jsx(d6,{})})]}),u.jsx(xu,{children:"شماره موبایل با صفر شروع می‌شود!"})]}),n?u.jsxs(s,{children:[u.jsxs(s,{display:"flex",children:[u.jsx(c,{variant:"body1",mr:A.TINY,color:e=>e.palette.grey.A700,children:"نام کامل:"}),u.jsx(c,{mr:A.TINY,fontWeight:"bold",children:(n!=null&&n.firstname?n==null?void 0:n.firstname:"")+" "+(n!=null&&n.lastname?n==null?void 0:n.lastname:"")})]}),u.jsxs(s,{display:"flex",children:[u.jsx(c,{variant:"body1",mr:A.TINY,color:e=>e.palette.grey.A700,children:"نقش:"}),u.jsx(c,{mr:A.TINY,fontWeight:"bold",children:"اپراتور استان"})]}),u.jsxs(s,{display:"flex",children:[u.jsx(c,{variant:"body1",mr:A.TINY,color:e=>e.palette.grey.A700,children:"استان:"}),u.jsx(c,{mr:A.TINY,fontWeight:"bold",children:n==null?void 0:n.province})]}),u.jsxs(s,{display:"flex",children:[u.jsx(c,{variant:"body1",mr:A.TINY,color:e=>e.palette.grey.A700,children:"شهر:"}),u.jsx(c,{mr:A.TINY,fontWeight:"bold",children:n==null?void 0:n.city})]})]}):u.jsxs(s,{container:!0,gap:A.SMALL,children:[u.jsx(c,{variant:"body2",children:"اطلاعات کاربر را وارد کنید"}),u.jsx(v,{fullWidth:!0,id:"mobile",label:"شماره موبایل ",variant:"outlined",value:o.values.mobile,error:o.touched.mobile?!!o.errors.mobile:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.mobile&&o.errors.mobile?o.errors.mobile:null}),u.jsx(v,{fullWidth:!0,id:"fname",label:"نام",variant:"outlined",value:o.values.fname,error:o.touched.fname?!!o.errors.fname:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.fname&&o.errors.fname?o.errors.fname:null}),u.jsx(v,{fullWidth:!0,id:"lname",label:"نام خانوادگی",variant:"outlined",value:o.values.lname,error:o.touched.lname?!!o.errors.lname:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.lname&&o.errors.lname?o.errors.lname:null}),u.jsx(v,{fullWidth:!0,id:"nationalCode",label:"کد ملی",variant:"outlined",value:o.values.nationalCode,error:o.touched.nationalCode?!!o.errors.nationalCode:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.nationalCode&&o.errors.nationalCode?o.errors.nationalCode:null}),u.jsx(v,{fullWidth:!0,id:"province",label:"استان",variant:"outlined",value:o.values.province,error:o.touched.province?!!o.errors.province:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.province&&o.errors.province?o.errors.province:null}),u.jsx(v,{fullWidth:!0,id:"city",label:"شهر",variant:"outlined",value:o.values.city,error:o.touched.city?!!o.errors.city:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.city&&o.errors.city?o.errors.city:null})]})]}),u.jsxs(s,{container:!0,xs:12,gap:1,justifyContent:"start",children:[u0&&u.jsx(s,{xs:12,children:u.jsxs(s,{container:!0,alignItems:"center",children:[u.jsx($,{checked:W,onChange:()=>{N6(!W)},inputProps:{"aria-label":"controlled"}}),u.jsx(c,{variant:"body1",children:"کشتار برای انجماد"})]})}),i!=null&&i.active?u.jsx(_0,{label:"جزییات پنل",children:u.jsxs(s,{container:!0,direction:"column",gap:1,children:[u.jsxs(s,{container:!0,alignItems:"center",children:[u.jsx($,{checked:m,onChange:()=>{Su(!m)},inputProps:{"aria-label":"controlled"}}),u.jsx(c,{variant:"body1",children:"نمایش در پنل معاملات"})]}),m&&u.jsxs(s,{container:!0,direction:"column",gap:1,pr:2,children:[u.jsx(s,{container:!0,gap:A.TINY,justifyContent:"space-between",alignItems:"start"}),u.jsxs(s,{container:!0,gap:1,alignItems:"center",children:[u.jsx(c,{variant:"caption",color:e=>e.palette.grey.A700,children:"باقیمانده مجاز:"}),u.jsxs(c,{variant:"button",color:"primary",children:[(Qu=(Hu=i==null?void 0:i.market)==null?void 0:Hu.remainQuantity)==null?void 0:Qu.toLocaleString()," ","قطعه"]})]}),u.jsxs(s,{container:!0,gap:1,alignItems:"center",children:[u.jsx(c,{variant:"caption",color:e=>e.palette.grey.A700,children:"حداکثر قطعه مجاز:"}),u.jsxs(c,{variant:"button",children:[(Xu=(Ku=i==null?void 0:i.market)==null?void 0:Ku.maxLimitationQuantity)==null?void 0:Xu.toLocaleString()," ","قطعه"]})]})]})]})}):u.jsxs(s,{container:!0,alignItems:"center",children:[u.jsx($,{checked:m,onChange:()=>{Su(!m)},inputProps:{"aria-label":"controlled"}}),u.jsx(c,{variant:"body1",children:"نمایش در پنل معاملات"})]})]}),(l.values.avicultureSellType!=="goverment"||(r==null?void 0:r.approved)&&(r==null?void 0:r.lowestPrice)===0&&(r==null?void 0:r.highestPrice)===0&&(r==null?void 0:r.lowestWeight)===0&&(r==null?void 0:r.highestWeight)===0)&&u.jsxs(s,{children:[u.jsx(v,{id:"poultryPrice",label:"قیمت پیشنهادی مرغدار",variant:"outlined",InputProps:{endAdornment:u.jsx(i6,{position:"end",children:"ریال"})},value:l.values.poultryPrice,error:l.touched.poultryPrice?!!l.errors.poultryPrice:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.poultryPrice&&l.errors.poultryPrice?l.errors.poultryPrice:null,sx:{"& .Mui-disabled":{backgroundColor:"#f0f0f0",color:"#666","& .MuiOutlinedInput-notchedOutline":{borderColor:"#ccc"}}},disabled:W}),!(r!=null&&r.approved)&&l.values.avicultureSellType!=="goverment"&&u.jsx(c,{variant:"caption",color:"error",children:"نوع فروش: آزاد"})]}),r0&&u.jsxs(s,{container:!0,alignItems:"center",children:[u.jsx($,{checked:cu,onChange:()=>{q6(!cu)},inputProps:{"aria-label":"controlled"}}),u.jsx(c,{variant:"body1",children:"کشتار برای صادرات"})]}),L()==="Poultry"&&u.jsx(s,{children:u.jsx(b0,{title:"تعهد نامه",content:J6,actions:u.jsxs(s,{container:!0,gap:A.TINY,children:[u.jsx(O,{variant:"outlined",color:"error",onClick:()=>{l.setFieldValue("isAccepted",!1)},children:"رد"}),u.jsx(O,{variant:"contained",color:"success",onClick:()=>{l.setFieldValue("isAccepted",!0)},children:"موافقم"})]}),btnTitle:"متن تعهد نامه تایید شد!",isAccepted:l.values.isAccepted})}),Pu&&u.jsx(v,{fullWidth:!0,id:"userInfoCheck",label:"ویرایش تلفن مرغدار",variant:"outlined",value:x.values.userInfoCheck,error:x.touched.city?!!x.errors.userInfoCheck:null,onChange:x.handleChange,onBlur:x.handleBlur,helperText:x.touched.userInfoCheck&&x.errors.userInfoCheck?x.errors.userInfoCheck:null}),Pu&&u.jsx(c,{variant:"caption",color:"error",children:"احراز پیامکی قیمت مرغدار در استان فعال است. در صورت ویرایش، تلفن مرغدار در سراسر سامانه با تلفن جدید جایگزین میگردد!"}),u.jsx(s,{mb:A.SMALL,children:u.jsx(O,{fullWidth:!0,disabled:!l.isValid||!x.isValid||l.values.avicultureSellType==="freePrice"&&(W?!1:!l.values.poultryPrice)||m&&(i==null?void 0:i.active)&&(l.values.noChicken>((Zu=i==null?void 0:i.market)==null?void 0:Zu.remainQuantity)||l.values.noChicken>((Ju=i==null?void 0:i.market)==null?void 0:Ju.maxLimitationQuantity)),onClick:()=>{L()!=="SuperAdmin"&&L()!=="AdminX"&&!w0(V6,F==null?void 0:F.age,l.values.weight)?j({vertical:"top",horizontal:"center",msg:"میانگین وزنی با احراز سنی مطابقت ندارد. لطفا با اتحادیه تماس بگیرید.",severity:"error"}):l.values.noChicken>X?j({vertical:"top",horizontal:"center",msg:"تعداد وارد شده از حجم قابل تخصیص بزرگتر است!",severity:"error"}):(C(tu()),wu==="insideProvince"?V==="فروش مزایده ای"?C(fu({role:L(),poultry_key:f==null?void 0:f.key,operator_key:(y==null?void 0:y.length)>1?Fu:"",poultry_hatching_key:K,quantity:l.values.noChicken,send_date:l.values.slaughterDate,chicken_breed:iu,Index_weight:l.values.weight,freezing:W,union:l.values.isUnion,losses:l.values.losses!==""?l.values.losses:0,auction:!0,auction_list:T.map((e,t)=>({pricing_key:_6,fee:e.value?e.value:d==null?void 0:d.floorPrice,hour:M[t].value?M[t].value:"4"}))})).then(e=>{e.error?e.error.message.includes("403")?j({vertical:"top",horizontal:"center",msg:"قیمت پیشنهادی نباید از حداکثر قیمت روز بیشتر باشد.",severity:"error"}):j({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(j({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),C(U({right:!1,bottom:!1,content:null})))}):C(fu({approved_price:r==null?void 0:r.approved,market:m,kill_req_key:Iu,operator_key:(y==null?void 0:y.length)>1?Fu:"",poultry_hatching_key:K,quantity:l.values.noChicken,send_date:l.values.slaughterDate,chicken_breed:iu,Index_weight:l.values.weight,losses:l.values.losses!==""?l.values.losses:0,auction_list:[],freezing:W,export:cu,cash:l.values.sellType.cash,credit:l.values.sellType.haveTime,kill_house_list:l.values.selectedSlaughters,role:L(),poultry_key:q,amount:r!=null&&r.approved&&!((r==null?void 0:r.lowestPrice)===0&&(r==null?void 0:r.highestPrice)===0&&(r==null?void 0:r.lowestWeight)===0&&(r==null?void 0:r.highestWeight)===0)?Math.round(pu):Number(l.values.poultryPrice),financial_operation:l.values.financialOperation,free_sale_in_province:l.values.avicultureSellType!=="goverment",confirm_poultry_mobile:x.values.userInfoCheck})).then(e=>{C(H()),e.payload.error?j({vertical:"top",horizontal:"center",msg:e.payload.error,severity:"error"}):(Q&&Q(),C(F6({selectedDate1:Cu,selectedDate2:du})),C(x6({selectedDate1:Cu,selectedDate2:du})),C(y6({selectedAge1:S,selectedAge2:P})),j({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),C(U({right:!1,bottom:!1,content:null})))}):C(fu({approved_price:r==null?void 0:r.approved,kill_req_key:Iu,buyer:{firstname:n!=null&&n.firstname?n==null?void 0:n.firstname:o.values.fname,lastname:n!=null&&n.lastname?n==null?void 0:n.lastname:o.values.lname,mobile:n!=null&&n.mobile?n==null?void 0:n.mobile:o.values.mobile,national_id:n!=null&&n.national_id?n==null?void 0:n.national_id:o.values.nationalCode,province:n!=null&&n.province?n==null?void 0:n.province:o.values.province,city:n!=null&&n.city?n==null?void 0:n.city:o.values.city},freezing:W,operator_key:(y==null?void 0:y.length)>1?Fu:"",poultry_hatching_key:K,quantity:l.values.noChicken,send_date:l.values.slaughterDate,chicken_breed:iu,Index_weight:l.values.weight,losses:l.values.losses!==""?l.values.losses:0,auction_list:[],cash:l.values.sellType.cash,credit:l.values.sellType.haveTime,kill_house_list:l.values.selectedSlaughters,confirm_poultry_mobile:x.values.userInfoCheck})).then(e=>{C(H()),e.error?e.error.message.includes("403")?j({vertical:"top",horizontal:"center",msg:"تعداد مرغ برای کشتار از باقیمانده بیشتر است!",severity:"error"}):j({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(Q&&Q(),C(F6({selectedDate1:Cu,selectedDate2:du})),C(x6()),C(y6({selectedAge1:S,selectedAge2:P})),j({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),C(U({right:!1,bottom:!1,content:null})))}))},size:"large",variant:"contained",children:"ثبت درخواست"})})]})]})})};export{J0 as C,W0 as a}; diff --git a/build/assets/CityRequests-IZEUUx3s.js b/build/assets/CityRequests-IZEUUx3s.js new file mode 100644 index 0000000..efe7890 --- /dev/null +++ b/build/assets/CityRequests-IZEUUx3s.js @@ -0,0 +1 @@ +import{j as e,T as M,ak as $,B as eu,I as U,aJ as ou,b as nu}from"./mui-vendor-CkIVaoQP.js";import{G as n,S as j,iP as z,iQ as k,iR as W,iS as B,iT as Q,iU as V,iV as m,A as tu,a9 as Y,p as y,W as N,j as P,X as q,N as lu,iW as G,iX as cu}from"./index-CeyyVc1v.js";import{N as D}from"./NavLink-D2GD_ItM.js";import{L as I}from"./LinkItem-DT6qswcs.js";import{V as Cu,a as uu}from"./index.esm-CjWvmHks.js";import{a as pu}from"./index.esm-BVxcT1y_.js";import{a as du}from"./index.esm-YBNW__9r.js";import{c as iu,R as ru}from"./index.esm-Bu7XMDZU.js";import{u as wu}from"./index.esm-BY9chGNa.js";import{f as au,u as J,r as l}from"./react-vendor-CmFgShSM.js";import{d as H}from"./Plagiarism-BiXORbzo.js";import{d as Au,C as fu,P as xu}from"./ProvinceFreeSales-oCkrGhR8.js";import{P as su}from"./PageTable-C16Ol94B.js";import{u as hu}from"./redux-vendor-B7uoacJt.js";import{u as gu,A as ju}from"./AvicultureArchivedRequests-Bul1i4cq.js";import{A as Fu}from"./AdvancedTable-BYmmBtmq.js";import{F as Eu}from"./FileInformation-BQPmtbts.js";import{R as yu,a as vu}from"./RequestsAwaitingInspections-C8DP5FQL.js";import{B as bu}from"./BackButton-Crzr7NMa.js";import"./iconBase-BEJYyZsk.js";import"./useRequestFile-FPqBpZfN.js";import"./index-9Ymn_7Kv.js";import"./LabelField-B6eRSoQP.js";import"./aviculture-get-hatching-data-DsjDNd82.js";import"./Delete-C5MyLelE.js";import"./Add--yVWBJhC.js";import"./NumberFormatCustom-DwWPj40N.js";import"./DialogAlert-BfXcr-Kr.js";import"./Done-Dp5awdte.js";import"./aviculture-get-unions-C1NoVg85.js";import"./CarPelak-BYFY8OXg.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./isValidIndexWeight-C_ik-uYa.js";import"./ResponsiveTable-w7hk7Uq8.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./Tune-D4M2CAhp.js";import"./Edit-CqBj1Y2L.js";import"./VetFarmSubmitClearanceCode-B4m3TtXY.js";import"./Pageview-TRcW_9jm.js";import"./ToggleOn-pBgb8alR.js";import"./ToggleOff-D4LkiR4X.js";import"./Check-CRb6laYC.js";import"./Sms-DasNClAG.js";import"./SimpleTable-DBAoNnCU.js";const Su=()=>{const{pathname:o}=au();return e.jsx(n,{container:!0,gap:j.SMALL,p:j.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",style:{placeContent:"baseline"},children:e.jsx(n,{container:!0,direction:"column",style:{width:"100%"},children:e.jsxs(n,{container:!0,gap:j.SMALL,justifyContent:"center",children:[e.jsx(D,{to:z,active:o===z?"true":null,children:e.jsx(I,{icon:e.jsx(Cu,{size:30,color:"#244CCC"}),title:"درخواست های جدید",description:"درخواست های در انتظار بررسی"})}),e.jsx(D,{to:k,active:o===k?"true":null,children:e.jsx(I,{icon:e.jsx(uu,{size:30,color:"#244CCC"}),title:"درخواست های فعال",description:"مشاهده درخواست های در جریان"})}),e.jsx(D,{to:W,active:o===W?"true":null,children:e.jsx(I,{icon:e.jsx(pu,{size:30,color:"#244CCC"}),title:"در انتظار پرداخت",description:"مشاهده درخواست های در انتظار پرداخت کشتارگاه"})}),e.jsx(D,{to:B,active:o===B?"true":null,children:e.jsx(I,{icon:e.jsx(du,{className:"svg-icon-color",color:"#244CCC",size:30}),title:"در انتظار بازرسی",description:"درخواست های در انتظار بررسی بازرس"})}),e.jsx(D,{to:Q,active:o===Q?"true":null,children:e.jsx(I,{icon:e.jsx(iu,{className:"svg-icon-color",color:"#244CCC",size:30}),title:"درخواست های رد شده",description:"مشاهده درخواست هایی که به دلایل مختلف توسط اتحادیه رد شده است"})}),e.jsx(D,{to:V,active:o===V?"true":null,children:e.jsx(I,{icon:e.jsx(uu,{size:30,color:"#244CCC"}),title:"فروش خارج از استان"})}),e.jsx(D,{to:m,active:o===m?"true":null,children:e.jsx(I,{icon:e.jsx(wu,{className:"svg-icon-color",color:"#244CCC",size:30}),title:"بایگانی",description:"درخواست های پایان یافته"})})]})})})},Ru=()=>{const o=hu(),h=J(),[,,i,C,w,A]=l.useContext(tu);l.useEffect(()=>{const u=Y(new Date).format("YYYY-MM-DD");C(u),A(u)},[]);const[v,r]=l.useState([]),[p,d]=l.useState(!1),[F,g]=l.useState(0),[b,f]=l.useState(10),[x,O]=l.useState(""),S=u=>{O(u.target.value)},E=async(u,a)=>{d(!0);let c=await P.get(`Poultry_Request/?state=pending&date1=${i}&date2=${w}&search=filter&value=${a||""}&role=${q()}&page=${u}&page_size=${b}`);r(c.data.results),g(c.data.count),d(!1)},_=u=>{E(u,x)},R=async(u,a)=>{d(!0);let c=await P.get(`Poultry_Request/?state=pending&date1=${i}&date2=${w}&search=filter&value=${x||""}&page=${a}&page_size=${u}`);r(c.data.results),g(c.data.count),f(u),d(!1)};l.useEffect(()=>{E(1)},[i,w,b]);const T=async u=>{u.preventDefault(),d(!0);try{const a=await P.get(`Poultry_Request/?state=pending&date1=${i}&date2=${w}&role=${q()}&search=filter&value=${x||""}`);r(a.data.results),g(a.data.count)}catch(a){console.error("Error fetching data:",a)}finally{d(!1)}},t=()=>{E(1)},s=[{name:"کدسفارش",selector:u=>u==null?void 0:u.orderCode,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"تاریخ ثبت درخواست",selector:u=>y(u==null?void 0:u.createDate),sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"نوع کشتار",selector:u=>u!=null&&u.freezing?"انجماد":u!=null&&u.export?"صادرات":"عادی",sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"تاریخ کشتار",selector:u=>y(u==null?void 0:u.sendDate),sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"مرغداری",selector:u=>{var a,c,L;return`${(a=u==null?void 0:u.poultry)==null?void 0:a.unitName} (${(L=(c=u==null?void 0:u.poultry)==null?void 0:c.user)==null?void 0:L.mobile})`},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"دامپزشک فارم",selector:u=>{var a,c;return`${(a=u==null?void 0:u.vetFarm)==null?void 0:a.vetFarmFullname} (${(c=u==null?void 0:u.vetFarm)==null?void 0:c.vetFarmMobile})`},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"استان/شهر",selector:u=>{var a,c,L,X,K,Z;return`${(L=(c=(a=u==null?void 0:u.poultry)==null?void 0:a.address)==null?void 0:c.province)==null?void 0:L.name}/${(Z=(K=(X=u==null?void 0:u.poultry)==null?void 0:X.address)==null?void 0:K.city)==null?void 0:Z.name}`},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"تعاونی",selector:u=>{var a;return(a=u==null?void 0:u.poultry)==null?void 0:a.cityOperator},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"تاریخ جوجه ریزی",selector:u=>{var a;return y((a=u==null?void 0:u.hatching)==null?void 0:a.hatchingDate)},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"سن",selector:u=>{var a;return(a=u==null?void 0:u.hatching)==null?void 0:a.age},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"میانگین وزن (کیلوگرم)",selector:u=>u==null?void 0:u.IndexWeight,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"تعداد (قطعه)",selector:u=>u==null?void 0:u.quantity,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"وزن بار (کیلوگرم)",selector:u=>((u==null?void 0:u.quantity)*(u==null?void 0:u.IndexWeight)).toLocaleString(),sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"عملیات",selector:u=>e.jsx(U,{color:"primary",onClick:()=>o(lu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:e.jsx(fu,{updateTable:t,id:u.id,file:u}),title:"انجام عملیات شهرستان"})),children:e.jsx(Au,{})}),sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"مشاهده",selector:u=>e.jsx(U,{"aria-label":"delete",color:"primary",onClick:()=>h(G+(u==null?void 0:u.id)),children:e.jsx(H,{})}),sortable:!1,wrap:!0,allowOverflow:!0,center:!0}];return e.jsx(e.Fragment,{children:e.jsx(n,{alignItems:"center",justifyContent:"center",mt:4,children:e.jsx(su,{title:e.jsx(n,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,children:e.jsxs(n,{container:!0,alignItems:"center",gap:j.SMALL,children:[e.jsx(M,{children:"درخواست های جدید فروش اتحادیه"}),e.jsxs(n,{container:!0,gap:j.SMALL,children:[e.jsx(n,{children:e.jsx(N,{label:"از تاریخ",id:"date",renderInput:u=>e.jsx($,{style:{width:"160px"},...u}),value:i,onChange:u=>{C(Y(u).format("YYYY-MM-DD"))}})}),e.jsx(n,{children:e.jsx(N,{label:"تا تاریخ",id:"date",renderInput:u=>e.jsx($,{style:{width:"160px"},...u}),value:w,onChange:u=>{A(Y(u).format("YYYY-MM-DD"))}})})]}),e.jsxs("form",{onSubmit:T,children:[e.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:S}),e.jsx(eu,{type:"submit",onClick:T,endIcon:e.jsx(ru,{}),children:"جستجو"})]})]})}),columns:s,data:v,progressPending:p,pagination:!0,paginationServer:!0,paginationTotalRows:F,onChangeRowsPerPage:R,onChangePage:_})})})},Tu=()=>{const o=J(),[,,h,i,C,w]=l.useContext(tu);l.useEffect(()=>{const t=Y(new Date).format("YYYY-MM-DD");i(t),w(t)},[]);const[A,v]=l.useState([]),[r,p]=l.useState(!1),[d,F]=l.useState(0),[g,b]=l.useState(10),[f,x]=l.useState(""),O=t=>{x(t.target.value)},S=async(t,s)=>{p(!0);let u=await P.get(`Poultry_Request/?state=accepted&date1=${h}&date2=${C}&search=filter&value=${s||""}&role=${q()}&page=${t}&page_size=${g}`);v(u.data.results),F(u.data.count),p(!1)},E=t=>{S(t,f)},_=async(t,s)=>{p(!0);let u=await P.get(`Poultry_Request/?state=accepted&date1=${h}&date2=${C}&search=filter&value=${f||""}&page=${s}&page_size=${t}`);v(u.data.results),F(u.data.count),b(t),p(!1)};l.useEffect(()=>{S(1)},[h,C,g]);const R=async t=>{t.preventDefault(),p(!0);try{const s=await P.get(`Poultry_Request/?state=accepted&date1=${h}&date2=${C}&role=${q()}&search=filter&value=${f||""}`);v(s.data.results),F(s.data.count)}catch(s){console.error("Error fetching data:",s)}finally{p(!1)}},T=[{name:"ردیف",selector:(t,s)=>s+1,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"40px"},{name:"وضعیت",selector:t=>e.jsx(M,{variant:"body2",color:t.provinceState==="rejected"?"error":"promary",children:t.provinceState==="pending"?"درانتظار تایید استان":t.provinceState==="accepted"?"تایید شده توسط استان":"رد شده"}),sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"کدسفارش",selector:t=>t.orderCode,sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"تاریخ ثبت درخواست",selector:t=>y(t.createDate),sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"نوع کشتار",selector:t=>t!=null&&t.freezing?"انجماد":t!=null&&t.export?"صادرات":"عادی",sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"تاریخ کشتار",selector:t=>y(t.sendDate),sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"مرغداری",selector:t=>{var s,u,a;return`${(s=t==null?void 0:t.poultry)==null?void 0:s.unitName} (${(a=(u=t==null?void 0:t.poultry)==null?void 0:u.user)==null?void 0:a.mobile})`},sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"شهر",selector:t=>{var s,u,a;return(a=(u=(s=t==null?void 0:t.poultry)==null?void 0:s.address)==null?void 0:u.city)==null?void 0:a.name},sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"استان",selector:t=>{var s,u,a;return(a=(u=(s=t==null?void 0:t.poultry)==null?void 0:s.address)==null?void 0:u.province)==null?void 0:a.name},sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"تاریخ جوجه ریزی",selector:t=>y(t.hatching.hatchingDate),sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"سن",selector:t=>t.hatching.age,sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"تعداد (قطعه)",selector:t=>t==null?void 0:t.quantity,sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"مشاهده",selector:t=>e.jsx(U,{"aria-label":"delete",color:"primary",onClick:()=>o(G+(t==null?void 0:t.id)),children:e.jsx(H,{})}),sortable:!1,wrap:!0,allowOverflow:!0,center:!0}];return e.jsx(e.Fragment,{children:e.jsx(n,{alignItems:"center",justifyContent:"center",mt:4,children:e.jsx(su,{title:e.jsx(n,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,children:e.jsxs(n,{container:!0,alignItems:"center",gap:j.SMALL,children:[e.jsx(M,{children:"درخواست های فعال"}),e.jsxs(n,{container:!0,gap:j.SMALL,children:[e.jsx(n,{children:e.jsx(N,{label:"از تاریخ",id:"date",renderInput:t=>e.jsx($,{style:{width:"160px"},...t}),value:h,onChange:t=>{i(Y(t).format("YYYY-MM-DD"))}})}),e.jsx(n,{children:e.jsx(N,{label:"تا تاریخ",id:"date",renderInput:t=>e.jsx($,{style:{width:"160px"},...t}),value:C,onChange:t=>{w(Y(t).format("YYYY-MM-DD"))}})})]}),e.jsxs("form",{onSubmit:R,children:[e.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:O}),e.jsx(eu,{type:"submit",onClick:R,endIcon:e.jsx(ru,{}),children:"جستجو"})]})]})}),columns:T,data:A,progressPending:r,pagination:!0,paginationServer:!0,paginationTotalRows:d,onChangeRowsPerPage:_,onChangePage:E})})})},Du=()=>{const o=J(),[h,i]=l.useState([]),C=gu();l.useEffect(()=>{const A=C==null?void 0:C.filter((r,p)=>r.stateProcess==="rejected"),v=A==null?void 0:A.map((r,p)=>{var d,F,g,b,f,x,O,S,E,_,R,T;return[p+1,r.orderCode,y(r==null?void 0:r.createDate),y(r==null?void 0:r.sendDate),(F=(d=r==null?void 0:r.process)==null?void 0:d.poultry)==null?void 0:F.poultryName,(b=(g=r==null?void 0:r.process)==null?void 0:g.poultry)==null?void 0:b.poultryMobile,(x=(f=r==null?void 0:r.process)==null?void 0:f.poultry)==null?void 0:x.poultryCity,(S=(O=r==null?void 0:r.process)==null?void 0:O.poultry)==null?void 0:S.poultryProvince,(_=(E=r==null?void 0:r.process)==null?void 0:E.poultry)==null?void 0:_.age,(T=(R=r==null?void 0:r.process)==null?void 0:R.poultry)==null?void 0:T.poultryQuantity,e.jsx(U,{"aria-label":"delete",color:"primary",onClick:()=>{var t,s;return o(G+((s=(t=r==null?void 0:r.process)==null?void 0:t.poultry)==null?void 0:s.poultryRequestId))},children:e.jsx(H,{})},p)]});i(v)},[]);const[w]=l.useState(["ردیف","کد سفارش","تاریخ ثبت درخواست","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","استان","سن مرغ","تعداد","مشاهده"]);return e.jsx(ou,{children:e.jsx(Fu,{expandable:!0,name:"درخواست های رد شده",columns:w,expandedComponentHandler:A=>e.jsx(Eu,{id:A[0]}),data:h})})},y0=()=>{const{pathname:o}=au();return e.jsx(e.Fragment,{children:e.jsx(nu,{display:"flex",justifyContent:"center",children:e.jsxs(n,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[o===cu?e.jsxs(n,{justifyContent:"center",my:j.MEDIUM,children:[e.jsx(n,{children:e.jsx(M,{variant:"h6",children:"صفحه مدیریت درخواست ها (شهرستان)"})}),e.jsx(Su,{})]}):e.jsx(bu,{}),e.jsx(n,{container:!0,justifyContent:"space-between",gap:j.SMALL,children:e.jsxs(n,{xs:12,children:[o===z&&e.jsx(Ru,{}),o===k&&e.jsx(Tu,{}),o===Q&&e.jsx(Du,{}),o===m&&e.jsx(ju,{}),o===W&&e.jsx(yu,{}),o===B&&e.jsx(vu,{}),o===V&&e.jsx(xu,{})]})})]})})})};export{y0 as default}; diff --git a/build/assets/CitySubmitTenantForm-BnB_IQ2s.js b/build/assets/CitySubmitTenantForm-BnB_IQ2s.js new file mode 100644 index 0000000..801cb7f --- /dev/null +++ b/build/assets/CitySubmitTenantForm-BnB_IQ2s.js @@ -0,0 +1 @@ +import{j as e,al as x,ak as o,B as D,p as y}from"./mui-vendor-CkIVaoQP.js";import{L as A,j as T,h as i,A as q,u as I,c as S,M as h,b as p,G as n,S as F,e4 as P,N as _}from"./index-CeyyVc1v.js";import{r as s}from"./react-vendor-CmFgShSM.js";import{a as k,u as N}from"./redux-vendor-B7uoacJt.js";import{c as L,a as G}from"./city-get-city-qTSRxslT.js";const V=k("CITY_NEW_TENANT",async(m,{dispatch:d})=>{d(A());const{data:t,status:l}=await T.post("api/newregister/",m);return d(i()),{data:t,status:l}}),K=({id:m,userid:d})=>{const[t]=s.useContext(q),l=N(),[C,f]=s.useState(),[v,g]=s.useState(),[c,B]=s.useState(),[b,j]=s.useState(),[E,w]=s.useState(!0),u=I({initialValues:{mobile:"",fname:"",lname:"",nationalcode:"",address:"",postal:"",password:"",uniqueID:""},validationSchema:S({mobile:p().required("این فیلد اجباری است!").typeError("لطفا فیلد را به صورت عددی وارد کنید!").test("len","شماره تلفن باید با 0 شروع شود",(r,a)=>a.originalValue&&a.originalValue.startsWith("0")).test("len","شماره تماس 11 رقم باید باشد",(r,a)=>{if(a.originalValue)return a.originalValue.length===11}),fname:h().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!"),lname:h().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!"),nationalcode:p().required("این فیلد اجباری است!").test("len","کد ملی میبایست ده رقم باشد.",(r,a)=>{if(a.originalValue)return a.originalValue.length===10}),address:h().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!"),postal:p().required("این فیلد اجباری است!").typeError("لطفا فیلد را به صورت عددی وارد کنید!"),uniqueID:p().required("این فیلد اجباری است!").typeError("لطفا فیلد را به صورت عددی وارد کنید!"),password:h().required("این فیلد اجباری است!").typeError("لطفا مقادیر را به درستی وارد کنید!").test("len","لطفا حداقل 5 حرف و حداکثر 12 حرف وارد کنید",r=>r.toString().length>=5&&r.toString().length<=12)})});return s.useEffect(()=>{u.validateForm()},[]),s.useEffect(()=>{var r;l(A()),(r=l(L()))==null||r.then(a=>{l(i()),f(a.payload.data)})},[]),s.useEffect(()=>{u.validateForm()},[]),s.useEffect(()=>{c&&(l(A()),l(G(c)).then(r=>{g(r.payload.data),w(!1),l(i())}))},[c]),e.jsx(n,{container:!0,display:"block",gap:F.SMALL,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:e.jsxs(n,{container:!0,direction:"column",gap:F.SMALL,children:[e.jsx(n,{children:e.jsx(x,{disablePortal:!0,id:"province",options:C?C==null?void 0:C.map(r=>({id:r.key,label:r.name})):[],onChange:(r,a)=>{B(a.id)},renderInput:r=>e.jsx(o,{...r,label:"استان را انتخاب کنید"})})}),e.jsx(n,{children:e.jsx(x,{disabled:E,disablePortal:!0,id:"city",options:v?v.map(r=>({id:r.key,label:r.name})):[],onChange:(r,a)=>{j(a.id)},renderInput:r=>e.jsx(o,{...r,label:"شهر را انتخاب کنید"})})}),e.jsx(n,{children:e.jsx(o,{id:"uniqueID",label:"شناسه یکتا مرغدار",variant:"outlined",sx:{width:"100%"},value:u.values.uniqueID,error:u.touched.uniqueID?!!u.errors.uniqueID:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.uniqueID&&u.errors.uniqueID?u.errors.uniqueID:null})}),e.jsx(n,{children:e.jsx(o,{id:"fname",label:"نام",variant:"outlined",sx:{width:"100%"},value:u.values.fname,error:u.touched.fname?!!u.errors.fname:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.fname&&u.errors.fname?u.errors.fname:null})}),e.jsx(n,{children:e.jsx(o,{id:"lname",label:"نام خانوادگی ",variant:"outlined",sx:{width:"100%"},value:u.values.lname,error:u.touched.lname?!!u.errors.lname:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.lname&&u.errors.lname?u.errors.lname:null})}),e.jsx(n,{children:e.jsx(o,{id:"password",label:"رمز عبور",type:"password",variant:"outlined",sx:{width:"100%"},value:u.values.password,error:u.touched.password?!!u.errors.password:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.password&&u.errors.password?u.errors.password:null})}),e.jsx(n,{children:e.jsx(o,{id:"mobile",label:"موبایل",variant:"outlined",sx:{width:"100%"},value:u.values.mobile,error:u.touched.mobile?!!u.errors.mobile:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.mobile&&u.errors.mobile?u.errors.mobile:null})}),e.jsx(n,{children:e.jsx(o,{id:"nationalcode",label:"کد ملی",variant:"outlined",sx:{width:"100%"},value:u.values.nationalcode,error:u.touched.nationalcode?!!u.errors.nationalcode:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.nationalcode&&u.errors.nationalcode?u.errors.nationalcode:null})}),e.jsx(n,{children:e.jsx(o,{id:"address",label:"آدرس",variant:"outlined",sx:{width:"100%"},value:u.values.address,error:u.touched.address?!!u.errors.address:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.address&&u.errors.address?u.errors.address:null})}),e.jsx(n,{children:e.jsx(o,{id:"postal",label:"کد پستی",variant:"outlined",sx:{width:"100%"},value:u.values.postal,error:u.touched.postal?!!u.errors.postal:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.postal&&u.errors.postal?u.errors.postal:null})}),e.jsx(n,{mb:F.SMALL,children:e.jsx(D,{fullWidth:!0,variant:"contained",disabled:!u.isValid,onClick:()=>{l(V({username:u.values.mobile,password:u.values.password,api_key:"11d89a11-bd11-2111-a02f-2cc1cbf4e1d4",role:"Poultry",tenant:{poultry_key:m,unique_id:u.values.uniqueID,province:c,city:b,first_name:u.values.fname,last_name:u.values.lname,national_code:u.values.nationalcode,address:u.values.address,postal_code:u.values.postal}})).then(r=>{l(i()),l(P(d)),r.error?(l(i()),r.error.message.includes("403")?t({vertical:"top",horizontal:"center",msg:"این مستاجر موجود است!",severity:"error"}):t({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"})):(t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),l(_({right:!1,bottom:!1,content:null})))})},children:"ثبت اطلاعات"})})]})})};K.propTypes={id:y.PropTypes.any,userid:y.PropTypes.any};export{K as C}; diff --git a/build/assets/CityUserFile-DzU1_wlZ.js b/build/assets/CityUserFile-DzU1_wlZ.js new file mode 100644 index 0000000..ab538e6 --- /dev/null +++ b/build/assets/CityUserFile-DzU1_wlZ.js @@ -0,0 +1 @@ +import{j as t,T as B,I as T,d as K,ai as X,b5 as Z,B as I,b as v}from"./mui-vendor-CkIVaoQP.js";import{L as V,e4 as U,h as $,Q as uu,N as S,G as r,S as d,i$ as au}from"./index-CeyyVc1v.js";import{j as tu,u as eu,r as D,f as lu}from"./react-vendor-CmFgShSM.js";import{d as ru}from"./NavigateNext-ByUC5RGi.js";import{u as su,f as ou}from"./redux-vendor-B7uoacJt.js";import{d as Y}from"./Edit-CqBj1Y2L.js";import{d as nu}from"./Info-CZK82--l.js";import{I as du,b as iu,a as Cu}from"./InspectorEditAviculture-MsTqlKJp.js";import{S as N}from"./SimpleTable-DBAoNnCU.js";import{C as cu}from"./CitySubmitTenantForm-BnB_IQ2s.js";import"./city-get-city-qTSRxslT.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const yu=()=>{var L;const{userid:E}=tu(),l=su(),Q=eu(),[z,J]=D.useState([]),{provinceUserInfo:u}=ou(a=>a.provinceSlice);return D.useEffect(()=>{l(V()),l(U(E)).then(()=>{l($())})},[]),D.useEffect(()=>{var C,c,y,A,m,h,b,x,p,P,j;const a=(C=u==null?void 0:u.profile.role)==null?void 0:C.map((o,n)=>{let e="";switch(o){case"ProvinceOperator":e="اپراتور تخصیص استان";break;case"CityOperator":e="اپراتور شهرستان";break;case"KillHouseVet":e="دامپزشک کشتارگاه";break;case"VetFarm":e="دامپزشک";break;case"Poultry":e="مرغدار";break;case"KillHouse":e="کشتارگاه";break;case"Vet":e="دامپزشک";break;case"ProvinceInspector":e="بازرس استان";break;case"ProvinceFinancial":e="اپراتور مالی";break;case"Driver":e="راننده";break;case"Admin":e="ادمین";break;default:e="کاربر پایه";break}return t.jsx("div",{children:e},n)}),s=((c=u==null?void 0:u.profile)==null?void 0:c.image)>5?t.jsx("a",{href:u==null?void 0:u.profile.image,children:t.jsx("img",{width:"80",height:"80",alt:"img",src:u==null?void 0:u.profile.image})}):"موجود نیست",w=[[(y=u==null?void 0:u.profile)!=null&&y.fullname?(A=u==null?void 0:u.profile)==null?void 0:A.fullname:((m=u==null?void 0:u.profile)==null?void 0:m.firstName)+" "+((h=u==null?void 0:u.profile)==null?void 0:h.lastName),a,(b=u==null?void 0:u.profile)==null?void 0:b.mobile,(x=u==null?void 0:u.profile)!=null&&x.birthday?uu(new Date((p=u==null?void 0:u.profile)==null?void 0:p.birthday),"yyyy/MM/dd"):"نامشخص",(P=u==null?void 0:u.profile)==null?void 0:P.city,t.jsx(B,{variant:"caption",children:(j=u==null?void 0:u.profile)==null?void 0:j.password},"password"),s,t.jsx(T,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>{var o,n,e,F,k,f,i,g;l(S({title:"ویرایش پروفایل کاربر",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:t.jsx(du,{id:(o=u==null?void 0:u.profile)==null?void 0:o.key,birthday:(n=u==null?void 0:u.profile)==null?void 0:n.birthday,nationalCode:(e=u==null?void 0:u.profile)==null?void 0:e.nationalCode,nationalId:(F=u==null?void 0:u.profile)==null?void 0:F.nationalId,firstName:(k=u==null?void 0:u.profile)==null?void 0:k.firstName,lastName:(f=u==null?void 0:u.profile)==null?void 0:f.lastName,password:(i=u==null?void 0:u.profile)==null?void 0:i.password,phone:(g=u==null?void 0:u.profile)==null?void 0:g.mobile})}))},children:t.jsx(Y,{})},u)]];J(w)},[u]),t.jsxs(t.Fragment,{children:[t.jsx(r,{container:!0,alignItems:"center",mt:d.SMALL,children:t.jsxs(T,{"aria-label":"delete",color:"primary",onClick:()=>Q(-1),children:[t.jsx(ru,{}),t.jsx(B,{children:"بازگشت"})]})}),t.jsx(r,{container:!0,xs:12,alignItems:"start",gap:d.SMALL,direction:"column",children:t.jsx(r,{width:"100%",container:!0,alignItems:"center",justifyContent:"space-between",children:t.jsxs(r,{width:"100%",className:"second",children:[t.jsx(N,{name:"اطلاعات پایه کاربر",columns:["نام کامل","نوع کاربری","شمار تلفن","تاریخ تولد","شهر","کلمه عبور","تصویر پروفایل","ویرایش"],data:z}),(L=u==null?void 0:u.rolesData)==null?void 0:L.map((a,s)=>{var w,C,c,y,A,m,h,b,x,p,P,j,o,n,e,F,k,f;return Object.keys(a).includes("Poultry")?t.jsxs(t.Fragment,{children:[t.jsx(N,{name:"اطلاعات مرغدار",columns:["نام فارم","آدرس","استان","شهر","کد پستی","موبایل","شناسه یکتا","کد اقتصادی","کد اپیدمیولوژیک","تعداد سالن","ویرایش","وضعیت"],data:[[(w=a.Poultry)==null?void 0:w.unitName,(C=a.Poultry.address)==null?void 0:C.address,(y=(c=a.Poultry.address)==null?void 0:c.province)==null?void 0:y.name,(m=(A=a.Poultry.address)==null?void 0:A.city)==null?void 0:m.name,Number((h=a.Poultry.address)==null?void 0:h.postalCode),(b=a.Poultry.address)==null?void 0:b.phone,a.Poultry.breedingUniqueId,a.Poultry.economicCode,a.Poultry.epidemiologicalCode,a.Poultry.numberOfHalls,t.jsx(K,{title:"ویرایش کاربر",placement:"bottom-start",children:t.jsx(T,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>{var i,g,_,O,M,R,W,q,G,H;l(S({title:"ویرایش اطلاعات مرغدار",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:t.jsx(iu,{farmName:(i=a.Poultry)==null?void 0:i.unitName,id:u==null?void 0:u.profile.key,type:"Poultry",uniqueId:(g=a.Poultry)==null?void 0:g.breedingUniqueId,address:(_=a.Poultry.address)==null?void 0:_.address,poultry:(O=a.Poultry)==null?void 0:O.key,halls:a.Poultry.numberOfHalls,postal:Number((M=a.Poultry.address)==null?void 0:M.postalCode),accountHolder:(R=a.Poultry.userBankInfo)==null?void 0:R.nameOfBankUser,card:(W=a.Poultry.userBankInfo)==null?void 0:W.card,shaba:(q=a.Poultry.userBankInfo)==null?void 0:q.shaba,account:(G=a.Poultry.userBankInfo)==null?void 0:G.account,name_of_bank_user:(H=a.Poultry.userBankInfo)==null?void 0:H.bankName})}))},children:t.jsx(Y,{})})},s),t.jsx(K,{title:a.Poultry.trash===!0?"فعالسازی کاربر":"غیر فعال کردن کاربر",placement:"bottom-start",children:t.jsx(X,{label:a.Poultry.trash===!0?"غیرفعال":" فعال",control:t.jsx(Z,{checked:!a.Poultry.trash,onClick:()=>{l(V()),l(Cu({type:a.Poultry.trash===!0?"Activate":"Deactivate",role_data_key:a.Poultry.key,role:"Poultry"})).then(i=>{l($()),window.location.reload(!1)})}})})},s)]]},s),t.jsx(N,{name:"اطلاعات بانکی مرغدار",expandable:!0,columns:["نام صاحب حساب","نام بانک","شماره حساب","شماره کارت","شماره شبا"],data:[[(x=a.Poultry.userBankInfo)==null?void 0:x.nameOfBankUser,(p=a.Poultry.userBankInfo)==null?void 0:p.bankName,Number((P=a.Poultry.userBankInfo)==null?void 0:P.account),Number((j=a.Poultry.userBankInfo)==null?void 0:j.card),(o=a.Poultry.userBankInfo)==null?void 0:o.shaba]]},s),Object.keys((n=a.Poultry)==null?void 0:n.poultryTenant).length>0?t.jsx(N,{name:"اطلاعات مستاجر مرغدار",expandable:!0,columns:["شناسه یکتا","نام کامل","تلفن همراه","کد ملی"],data:[[(e=a.Poultry.poultryTenant)==null?void 0:e.breedingUniqueId,(F=a.Poultry.poultryTenant)==null?void 0:F.fullName,(k=a.Poultry.poultryTenant)==null?void 0:k.mobile,(f=a.Poultry.poultryTenant)==null?void 0:f.nationalId]]},s):!a.Poultry.poultryOwner.length>0&&t.jsxs(r,{display:"flex",mt:d.MEDIUM,gap:d.SMALL,alignItems:"center",mb:d.MEDIUM,children:[t.jsxs(r,{display:"flex",gap:d.TINY,children:[t.jsx(nu,{color:"primary"}),t.jsx(B,{children:"مرغدار مستاجر ندارد"})]}),t.jsx(I,{variant:"outlined",onClick:()=>{l(S({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ایجاد مستاجر جدید",content:t.jsx(cu,{id:a.Poultry.key,userid:E})}))},children:"افزودن مستاجر"})]})]}):null})]})})})]})},Bu=()=>{const{pathname:E}=lu();return t.jsx(t.Fragment,{children:t.jsx(v,{display:"flex",justifyContent:"center",children:t.jsx(r,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:t.jsx(r,{container:!0,justifyContent:"space-between",gap:d.SMALL,children:t.jsx(r,{xs:12,children:E.includes(au)&&t.jsx(yu,{})})})})})})};export{Bu as default}; diff --git a/build/assets/CityUserManagement-CRqW-IWG.js b/build/assets/CityUserManagement-CRqW-IWG.js new file mode 100644 index 0000000..a776808 --- /dev/null +++ b/build/assets/CityUserManagement-CRqW-IWG.js @@ -0,0 +1 @@ +import{j as u,T as m,ak as C,I as U,aU as iu,al as D,am as H,ai as au,aX as lu,ar as X,ag as cu,av as du,aw as Cu,ax as d,B as nu,d as hu,b as pu}from"./mui-vendor-CkIVaoQP.js";import{A as Au,u as Q,c as Z,v as uu,M as R,b as G,L as T,h as I,G as l,S as h,N as O,p as mu,W as xu,b4 as bu,i_ as fu,i$ as ju,j0 as vu}from"./index-CeyyVc1v.js";import{r as A,b as yu,u as gu,f as Fu}from"./react-vendor-CmFgShSM.js";import{u as tu,f as Nu}from"./redux-vendor-B7uoacJt.js";import{p as ku,a as eu,d as Eu}from"./province-register-user-DVseE2hL.js";import{A as Iu}from"./AdvancedTable-BYmmBtmq.js";import{d as wu}from"./Delete-C5MyLelE.js";import{d as Su}from"./Add--yVWBJhC.js";import{d as Pu}from"./Check-CRb6laYC.js";import{d as _u}from"./Search-Dek2fED1.js";import{c as Bu,a as ru}from"./city-get-city-qTSRxslT.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";const Tu=()=>{var z,$,J;const[x]=A.useContext(Au),[g,V]=A.useState([]),[F,v]=A.useState([]),[y,q]=A.useState(),[K,w]=A.useState(),[N,k]=A.useState(),[s,j]=A.useState(),[S,E]=A.useState(!1),[M,W]=A.useState(!0),[c,Y]=A.useState(),p=tu(),r=Q({initialValues:{mobile:"",fname:"",lname:"",nationalcode:"",password:"",birthday:uu(Date()).format("YYYY-MM-DD hh:mm:ss")},validationSchema:Z({mobile:G().required("این فیلد اجباری است!").typeError("لطفا فیلد را به صورت عددی وارد کنید!").test("len","شماره تلفن باید با 0 شروع شود",(e,a)=>a.originalValue&&a.originalValue.startsWith("0")).test("len","شماره تماس 11 رقم باید باشد",(e,a)=>{if(a.originalValue)return a.originalValue.length===11}),fname:R().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!"),lname:R().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!"),nationalcode:G().required("این فیلد اجباری است!").test("len","کد ملی میبایست ده رقم باشد.",(e,a)=>{if(a.originalValue)return a.originalValue.length===10}),password:R().required("این فیلد اجباری است!").typeError("لطفا مقادیر را به درستی وارد کنید!")})});A.useEffect(()=>{r.validateForm(),b.validateForm()},[]);const b=Q({initialValues:{userInfoCheck:""},validationSchema:Z({userInfoCheck:G().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!")})}),[P,L]=yu.useState(),_=()=>{L(P==="Poultry"?"":"Poultry")};A.useEffect(()=>{var e;p(T()),(e=p(Bu()))==null||e.then(a=>{p(I()),V(a.payload.data)})},[]),A.useEffect(()=>{N?(p(T()),p(ru(N)).then(e=>{v(e.payload.data),W(!1),p(I())})):y&&(p(T()),p(ru(y)).then(e=>{v(e.payload.data),W(!1),p(I())}))},[y,N]);const[B,i]=A.useState([{id:0,uniqueID:"",poultryAddress:"",halls:"",systemCode:"",epidemiologicalCode:"",unitName:"",capacity:"",licenseNumber:"",postal:"",bankName:"",cardNumber:"",accountNumber:"",shabaNumber:"",accountHolder:""}]),su=()=>{i(e=>[...e,{id:e.length,uniqueID:"",poultryAddress:"",halls:"",systemCode:"",epidemiologicalCode:"",unitName:"",capacity:"",licenseNumber:"",postal:"",bankName:"",cardNumber:"",accountNumber:"",shabaNumber:"",accountHolder:""}])},ou=()=>{const e=B.length-1;if(e!==0){const a=B.filter((t,o)=>o{const[a,t]=e.target.name.split("-");a==="uniqueID"?i(o=>{const n=o;return n[t].uniqueID=e.target.value,n}):a==="poultryAddress"?i(o=>{const n=o;return n[t].poultryAddress=e.target.value,n}):a==="halls"?i(o=>{const n=o;return n[t].halls=Number(e.target.value),n}):a==="systemCode"?i(o=>{const n=o;return n[t].systemCode=Number(e.target.value),n}):a==="epidemiologicalCode"?i(o=>{const n=o;return n[t].epidemiologicalCode=Number(e.target.value),n}):a==="ownerName"?i(o=>{const n=o;return n[t].ownerName=e.target.value,n}):a==="unitName"?i(o=>{const n=o;return n[t].unitName=e.target.value,n}):a==="capacity"?i(o=>{const n=o;return n[t].capacity=Number(e.target.value),n}):a==="licenseNumber"?i(o=>{const n=o;return n[t].licenseNumber=Number(e.target.value),n}):a==="postal"?i(o=>{const n=o;return n[t].postal=Number(e.target.value),n}):a==="bankName"?i(o=>{const n=o;return n[t].bankName=e.target.value,n}):a==="cardNumber"?i(o=>{const n=o;return n[t].cardNumber=Number(e.target.value),n}):a==="accountNumber"?i(o=>{const n=o;return n[t].accountNumber=Number(e.target.value),n}):a==="shabaNumber"?i(o=>{const n=o;return n[t].shabaNumber=Number(e.target.value),n}):a==="accountHolder"&&i(o=>{const n=o;return n[t].accountHolder=e.target.value,n})};return u.jsx(l,{container:!0,display:"block",gap:h.SMALL,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:u.jsxs(l,{container:!0,direction:"column",gap:h.SMALL,children:[!S&&u.jsxs(u.Fragment,{children:[u.jsx(m,{children:"بررسی کاربر"}),u.jsxs(l,{display:"flex",width:1,children:[u.jsx(C,{fullWidth:!0,id:"userInfoCheck",label:"شماره موبایل یا کد ملی",variant:"outlined",value:b.values.userInfoCheck,error:b.touched.userInfoCheck?!!b.errors.userInfoCheck:null,onChange:b.handleChange,onBlur:b.handleBlur,helperText:b.touched.userInfoCheck&&b.errors.userInfoCheck?b.errors.userInfoCheck:null}),u.jsx(U,{disabled:!b.isValid,"aria-label":"delete",color:"primary",onClick:()=>{p(T()),p(ku({type:"check_user",value:b.values.userInfoCheck})).then(e=>{p(I()),e.error?e.error.message.includes("409")&&x({vertical:"top",horizontal:"center",msg:"کاربر پیدا نشد، یک کاربر جدید بسازید!",severity:"error"}):e.payload.data?Y(e.payload.data.profile):(x({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}),p(O({right:!1,bottom:!1,content:null})))}),E(!0)},children:u.jsx(_u,{})})]}),u.jsx(iu,{children:"شماره موبایل با صفر شروع می‌شود!"})]}),S&&u.jsxs(u.Fragment,{children:[c?u.jsx(u.Fragment,{children:u.jsxs(l,{container:!0,gap:h.SMALL,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:[u.jsxs(l,{display:"flex",children:[u.jsx(m,{variant:"body1",mr:h.TINY,color:e=>e.palette.grey.A700,children:"نام کامل:"}),u.jsx(m,{mr:h.TINY,fontWeight:"bold",children:c.fullname})," "]}),u.jsxs(l,{display:"flex",children:[u.jsx(m,{variant:"body1",mr:h.TINY,color:e=>e.palette.grey.A700,children:"موبایل:"}),u.jsx(m,{mr:h.TINY,fontWeight:"bold",children:c.mobile})]}),u.jsxs(l,{display:"flex",children:[u.jsx(m,{variant:"body1",mr:h.TINY,color:e=>e.palette.grey.A700,children:"استان:"}),u.jsx(m,{mr:h.TINY,fontWeight:"bold",children:c.province})," "]}),u.jsxs(l,{display:"flex",children:[u.jsx(m,{variant:"body1",mr:h.TINY,color:e=>e.palette.grey.A700,children:"شهر:"}),u.jsx(m,{mr:h.TINY,fontWeight:"bold",children:c.city})]}),u.jsxs(l,{display:"flex",children:[u.jsx(m,{variant:"body1",mr:h.TINY,color:e=>e.palette.grey.A700,children:"تاریخ تولد:"}),u.jsx(m,{mr:h.TINY,fontWeight:"bold",children:mu(c.birthday)})]}),(c==null?void 0:c.role.length)>0&&u.jsxs(l,{display:"flex",children:[u.jsx(m,{variant:"body1",mr:h.TINY,color:e=>e.palette.grey.A700,children:((z=c==null?void 0:c.role)==null?void 0:z.length)>1?"نقش ها:":"نقش:"}),u.jsx(m,{mr:h.TINY,fontWeight:"bold",children:($=c==null?void 0:c.role)==null?void 0:$.map((e,a)=>{let t="";switch(e){case"ProvinceOperator":t="اپراتور تخصیص استان";break;case"CityOperator":t="اپراتور شهرستان";break;case"KillHouseVet":t="دامپزشک کشتارگاه";break;case"Poultry":t="مرغدار";break;case"KillHouse":t="کشتارگاه";break;case"VetFarm":t="دامپزشک";break;case"Vet":t="دامپزشک";break;case"ProvinceInspector":t="بازرس استان";break;case"ProvinceFinancial":t="اپراتور مالی";break;case"Driver":t="راننده";break;case"Admin":t="ادمین کل";break}return[u.jsxs(l,{display:"flex",gap:h.TINY,children:[u.jsx(Pu,{color:"primary"}),u.jsx(m,{children:t})]},a)]})})]}),((J=c==null?void 0:c.image)==null?void 0:J.length)>5&&u.jsx(u.Fragment,{children:u.jsxs(l,{display:"flex",children:[u.jsx(m,{variant:"body1",mr:h.TINY,color:e=>e.palette.grey.A700,children:"پروفایل:"}),u.jsx(l,{mr:h.TINY,children:u.jsx("a",{href:c.image,children:u.jsx("img",{width:"100",height:"100",alt:"img",src:c.image})})})]})})]})}):u.jsxs(u.Fragment,{children:[u.jsx(l,{children:u.jsx(C,{id:"fname",label:"نام",variant:"outlined",sx:{width:"100%"},value:r.values.fname,error:r.touched.fname?!!r.errors.fname:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.fname&&r.errors.fname?r.errors.fname:null})}),u.jsx(l,{children:u.jsx(C,{id:"lname",label:"نام خانوادگی ",variant:"outlined",sx:{width:"100%"},value:r.values.lname,error:r.touched.lname?!!r.errors.lname:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.lname&&r.errors.lname?r.errors.lname:null})}),u.jsx(l,{children:u.jsx(C,{id:"mobile",label:"موبایل",variant:"outlined",sx:{width:"100%"},value:r.values.mobile,error:r.touched.mobile?!!r.errors.mobile:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.mobile&&r.errors.mobile?r.errors.mobile:null})}),u.jsx(l,{children:u.jsx(xu,{fullWidth:!0,label:"تاریخ تولد",id:"birthday",renderInput:e=>u.jsx(C,{...e}),value:r.values.birthday,error:r.touched.birthday?!!r.errors.birthday:null,onChange:e=>{r.setFieldValue("birthday",uu(e).format("YYYY-MM-DD hh:mm:ss"))},onBlur:r.handleBlur,helperText:r.touched.birthday&&r.errors.birthday?r.errors.birthday:null})}),u.jsx(l,{children:u.jsx(D,{disablePortal:!0,id:"province",options:g==null?void 0:g.map(e=>({id:e.key,label:e.name})),onChange:(e,a)=>{q(a.id)},renderInput:e=>u.jsx(C,{...e,label:"استان را انتخاب کنید"})})}),u.jsx(l,{children:u.jsx(D,{disabled:M,disablePortal:!0,id:"city",options:F==null?void 0:F.map(e=>({id:e.key,label:e.name})),onChange:(e,a)=>{w(a.id)},renderInput:e=>u.jsx(C,{...e,label:"شهر را انتخاب کنید"})})}),u.jsx(l,{children:u.jsx(C,{id:"password",label:"رمز عبور",type:"password",userData:!0,variant:"outlined",sx:{width:"100%"},value:r.values.password,error:r.touched.password?!!r.errors.password:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.password&&r.errors.password?r.errors.password:null})}),u.jsx(l,{children:u.jsx(C,{id:"nationalcode",label:"کد ملی",variant:"outlined",sx:{width:"100%"},value:r.values.nationalcode,error:r.touched.nationalcode?!!r.errors.nationalcode:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.nationalcode&&r.errors.nationalcode?r.errors.nationalcode:null})})]}),u.jsx(H,{}),c&&u.jsx(l,{children:!c.role.includes("Poultry")&&u.jsx(au,{control:u.jsx(lu,{}),label:"ثبت مرغداری برای این کاربر",onChange:_})}),B.map((e,a)=>u.jsx(u.Fragment,{children:P==="Poultry"&&u.jsxs(u.Fragment,{children:[u.jsx(H,{children:u.jsx(X,{label:"اطلاعات مرغدار "+(a+1)})}),u.jsx(l,{children:u.jsx(C,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"شناسه یکتا مرغدار",variant:"outlined",onChange:f,name:"uniqueID-"+a})}),u.jsx(l,{children:u.jsx(D,{disablePortal:!0,id:"province",options:g==null?void 0:g.map(t=>({id:t.key,label:t.name})),onChange:(t,o)=>{k(o.id)},renderInput:t=>u.jsx(C,{...t,label:"استان "})})}),u.jsx(l,{children:u.jsx(D,{disabled:M,disablePortal:!0,id:"city",options:F==null?void 0:F.map(t=>({id:t.key,label:t.name})),onChange:(t,o)=>{j(o.id)},renderInput:t=>u.jsx(C,{...t,label:"شهر "})})}),u.jsx(l,{children:u.jsx(C,{error:!1,fullWidth:!0,label:"آدرس مرغداری",variant:"outlined",onChange:f,name:"poultryAddress-"+a})}),u.jsx(l,{children:u.jsx(C,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"تعداد سالن",variant:"outlined",onChange:f,name:"halls-"+a})}),u.jsx(l,{children:u.jsx(C,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"کد سیستمی",variant:"outlined",onChange:f,name:"systemCode-"+a})}),u.jsx(l,{children:u.jsx(C,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"کد اپیدمیولوژیک",variant:"outlined",onChange:f,name:"epidemiologicalCode-"+a})}),u.jsx(l,{children:u.jsx(C,{error:!1,fullWidth:!0,label:"نام واحد",variant:"outlined",onChange:f,name:"unitName-"+a})}),u.jsx(l,{children:u.jsx(C,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"ظرفیت",variant:"outlined",onChange:f,name:"capacity-"+a})}),u.jsx(l,{children:u.jsx(C,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"شماره گواهی بهداشتی",variant:"outlined",onChange:f,name:"licenseNumber-"+a})}),u.jsx(l,{children:u.jsx(C,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"کد پستی",variant:"outlined",onChange:f,name:"postal-"+a})}),u.jsx(H,{children:u.jsx(X,{label:"اطلاعات بانکی مرغدار "+(a+1)})}),u.jsx(l,{children:u.jsxs(cu,{fullWidth:!0,children:[u.jsx(du,{id:"demo-simple-select-label",children:"بانک"}),u.jsxs(Cu,{fullWidth:!0,id:"bankName",label:"بانک",onChange:f,name:"bankName-"+a,children:[u.jsx(d,{value:"موسسه افضل توس",children:"موسسه افضل توس"}),u.jsx(d,{value:"انصار",children:"انصار"}),u.jsx(d,{value:"سپه",children:"سپه"}),u.jsx(d,{value:"دی",children:"دی"}),u.jsx(d,{value:"کاب",children:"اقتصاد نوین"}),u.jsx(d,{value:"گردشگری",children:"گردشگری"}),u.jsx(d,{value:"حکمت ایرانیان",children:"حکمت ایرانیان"}),u.jsx(d,{value:"ایران زمین",children:"ایران زمین"}),u.jsx(d,{value:"کشاورزی",children:"کشاورزی"}),u.jsx(d,{value:"مسکن",children:"مسکن"}),u.jsx(d,{value:"مهر ایران",children:"مهر ایران"}),u.jsx(d,{value:"مهر اقتصاد",children:"مهر اقتصاد"}),u.jsx(d,{value:"ملت",children:"ملت"}),u.jsx(d,{value:"ملی",children:"ملی"}),u.jsx(d,{value:"پارسیان",children:"پارسیان"}),u.jsx(d,{value:"پاسارگاد",children:"پاسارگاد"}),u.jsx(d,{value:"پست بانک ایران",children:"پست بانک ایران"}),u.jsx(d,{value:"صادرات",children:"صادرات"}),u.jsx(d,{value:"سامان",children:"سامان"}),u.jsx(d,{value:"صنعت و معدن",children:"صنعت و معدن"}),u.jsx(d,{value:"سرمایه",children:"سرمایه"}),u.jsx(d,{value:"شهر",children:"شهر"}),u.jsx(d,{value:"سینا",children:"سینا"}),u.jsx(d,{value:"تجارت",children:"تجارت"}),u.jsx(d,{value:"موسسه اعتباری توسعه",children:"موسسه اعتباری توسعه"}),u.jsx(d,{value:"خاورمیانه",children:"خاورمیانه"})]})]})}),u.jsx(l,{children:u.jsx(C,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"شماره کارت",variant:"outlined",onChange:f,name:"cardNumber-"+a})}),u.jsx(l,{children:u.jsx(C,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"شماره حساب",variant:"outlined",onChange:f,name:"accountNumber-"+a})}),u.jsx(l,{children:u.jsx(C,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"شماره شبا",variant:"outlined",onChange:f,name:"shabaNumber-"+a})}),u.jsx(l,{children:u.jsx(C,{error:!1,fullWidth:!0,label:"نام صاحب حساب",variant:"outlined",onChange:f,name:"accountHolder-"+a})}),u.jsxs(l,{container:!0,direction:"row",children:[u.jsx(U,{"aria-label":"delete",color:"success",children:u.jsx(Su,{onClick:su})}),u.jsx(U,{"aria-label":"delete",color:"secondary",children:u.jsx(wu,{onClick:ou})})]})]})})),u.jsx(l,{mb:h.SMALL,children:u.jsx(nu,{disabled:!(y||N),fullWidth:!0,variant:"contained",onClick:()=>{p(T()),c?P==="Poultry"&&p(eu({type:"Poultry",owner_key:c.key,poultry_list:B.map(e=>({address:{province_key:N,city_key:s,address:e.poultryAddress,postal_code:e.postal},user_bank_info:{name_of_bank_user:e.accountHolder,bank_name:e.bankName,card:e.cardNumber,shaba:e.shabaNumber,account:e.accountNumber},epidemiological_code:e.epidemiologicalCode,system_code:e.systemCode,number_of_halls:e.halls,breeding_unique_id:e.uniqueID,unit_name:e.unitName,licence_number:e.licenseNumber,total_capacity:e.capacity,health_certificate_number:e.licenseNumber}))})).then(e=>{p(I()),p(O({right:!1,bottom:!1,content:null})),e.error?e.error.message.includes("403")?x({vertical:"top",horizontal:"center",msg:"مرغداری با این مشخصات از قبل موجود است!",severity:"error"}):x({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})}):(p(eu({type:"profile",fullname:r.values.fname+" "+r.values.lname,first_name:r.values.fname,last_name:r.values.lname,national_code:r.values.nationalcode,national_id:r.values.national_id,birthday:r.values.birthday,mobile:r.values.mobile,password:r.values.password,city:K,province:y,image:""})).then(e=>{p(I()),e.payload.error?x({vertical:"top",horizontal:"center",msg:e.payload.error,severity:"error"}):(x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),Y(e.payload.data))}),p(bu()))},children:"ثبت اطلاعات"})})]})]})})},Mu=()=>{const x=tu(),[g,V]=A.useState([]),F=gu(),{cityUsers:v}=Nu(k=>k.citySlice);A.useEffect(()=>{x(T()),x(fu()).then(k=>{x(I())})},[]);const[y,q]=A.useState(!1),K=k=>{q(!y)},[w,N]=A.useState(v);return A.useEffect(()=>{if(y){const s=v==null?void 0:v.filter((j,S)=>{var E;return((E=j==null?void 0:j.profile)==null?void 0:E.role.length)===0});N(s)}else N(v);const k=w==null?void 0:w.map((s,j)=>{var S,E,M,W,c,Y,p,r,b,P,L;return[j+1,(S=s==null?void 0:s.profile)!=null&&S.fullname?(E=s==null?void 0:s.profile)==null?void 0:E.fullname:((M=s==null?void 0:s.profile)==null?void 0:M.firstName)+" "+((W=s==null?void 0:s.profile)==null?void 0:W.lastName),u.jsxs(l,{children:[!(((c=s==null?void 0:s.profile)==null?void 0:c.role.length)>0)&&"کاربر پایه",(p=(Y=s==null?void 0:s.profile)==null?void 0:Y.role)==null?void 0:p.map((_,B)=>{var i="";switch(_){case"ProvinceOperator":i="اپراتور تخصیص استان";break;case"CityOperator":i="اپراتور شهرستان";break;case"KillHouseVet":i="دامپزشک کشتارگاه";break;case"VetFarm":i="دامپزشک";break;case"Poultry":i="مرغدار";break;case"KillHouse":i="کشتارگاه";break;case"Vet":i="دامپزشک";break;case"ProvinceInspector":i="بازرس استان";break;case"ProvinceFinancial":i="اپراتور مالی";break;case"Driver":i="راننده";break;case"Admin":i="ادمین";break}return[u.jsx(l,{children:i},B)]})]},j),(r=s==null?void 0:s.profile)==null?void 0:r.mobile,(b=s==null?void 0:s.profile)==null?void 0:b.baseOrder,(P=s==null?void 0:s.profile)==null?void 0:P.city,u.jsx(m,{variant:"caption",children:(L=s==null?void 0:s.profile)==null?void 0:L.password},"s"),u.jsx(l,{children:u.jsx(hu,{title:"پرونده کاربر",placement:"right-start",children:u.jsx(U,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>{var _;F(ju+((_=s==null?void 0:s.profile)==null?void 0:_.key))},children:u.jsx(Eu,{})})},j)},j)]});V(k)},[v,y,w]),u.jsx(l,{container:!0,xs:12,alignItems:"start",gap:h.SMALL,direction:"column",children:u.jsxs(l,{width:"100%",container:!0,alignItems:"center",justifyContent:"space-between",children:[u.jsxs(l,{alignItems:"center",flexDirection:"inherit",container:!0,mt:h.MEDIUM,gap:h.SMALL,children:[u.jsx(nu,{className:"first-step",variant:"contained",onClick:()=>{x(O({title:"ثبت کاربر جدید",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Tu,{})}))},children:"ثبت کاربر جدید"}),u.jsx(au,{mt:h.SMALL,control:u.jsx(lu,{}),label:"فقط نمایش کاربران پایه",onChange:K})]}),u.jsx(l,{width:"100%",className:"second",children:u.jsx(Iu,{expandable:!0,columns:["ردیف","نام کامل","نوع کاربری","شمار تلفن","کد کاربری","شهر","کلمه عبور","پرونده"],data:g})})]})})},$u=()=>{const{pathname:x}=Fu();return u.jsx(u.Fragment,{children:u.jsx(pu,{display:"flex",justifyContent:"center",children:u.jsx(l,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsx(l,{container:!0,justifyContent:"space-between",gap:h.SMALL,children:u.jsx(l,{xs:12,children:x===vu&&u.jsx(Mu,{})})})})})})};export{$u as default}; diff --git a/build/assets/Close-_jAEIgMD.js b/build/assets/Close-_jAEIgMD.js new file mode 100644 index 0000000..66a9e51 --- /dev/null +++ b/build/assets/Close-_jAEIgMD.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,s=o(a()),i=t;u=e.default=(0,s.default)((0,i.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");export{e as C,u as d}; diff --git a/build/assets/CloudUpload-BlIgB_r9.js b/build/assets/CloudUpload-BlIgB_r9.js new file mode 100644 index 0000000..98616d6 --- /dev/null +++ b/build/assets/CloudUpload-BlIgB_r9.js @@ -0,0 +1 @@ +import{i as r,j as a}from"./mui-vendor-CkIVaoQP.js";import{r as t}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,d=o(t()),l=a;u=e.default=(0,d.default)((0,l.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload");export{u as d}; diff --git a/build/assets/Commerce-DWYrSvnH.js b/build/assets/Commerce-DWYrSvnH.js new file mode 100644 index 0000000..7564299 --- /dev/null +++ b/build/assets/Commerce-DWYrSvnH.js @@ -0,0 +1 @@ +import{j as u,b as s,T as r}from"./mui-vendor-CkIVaoQP.js";import{G as t,S as e,O as o,P as i,l7 as c,l8 as a}from"./index-CeyyVc1v.js";import{B as m}from"./BackButton-Crzr7NMa.js";import{N as l}from"./NavLink-D2GD_ItM.js";import{L as p}from"./LinkItem-DT6qswcs.js";import{c as j}from"./index.esm-BY9chGNa.js";import{u as x}from"./redux-vendor-B7uoacJt.js";import{f as d}from"./react-vendor-CmFgShSM.js";import"./iconBase-BEJYyZsk.js";const C=()=>{const n=x();return u.jsx(t,{container:!0,gap:e.SMALL,p:e.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",style:{placeContent:"baseline"},children:u.jsx(t,{container:!0,direction:"column",style:{width:"100%"},children:u.jsx(t,{container:!0,gap:e.SMALL,justifyContent:"center",children:u.jsx(l,{onClick:()=>n(o({title:"اطلاعات گزارش",content:u.jsx(i,{})})),children:u.jsx(p,{icon:u.jsx(j,{className:"svg-icon-color",color:"#244CCC",size:30}),title:"گزارش روزانه",description:"گزارش روزانه"})})})})})},F=()=>{const{pathname:n}=d();return u.jsx(u.Fragment,{children:u.jsx(s,{display:"flex",justifyContent:"center",children:u.jsxs(t,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[n===c||n===a?u.jsxs(t,{justifyContent:"center",my:e.MEDIUM,children:[u.jsx(t,{children:u.jsx(r,{variant:"h6",children:"صفحه مدیریت درخواست ها (معاونت بازرگانی)"})}),u.jsx(C,{})]}):u.jsx(m,{}),u.jsx(t,{container:!0,justifyContent:"space-between",gap:e.SMALL,children:u.jsx(t,{xs:12})})]})})})};export{F as default}; diff --git a/build/assets/ComponentsCatalog-RdvMiEfN.js b/build/assets/ComponentsCatalog-RdvMiEfN.js new file mode 100644 index 0000000..b137dd8 --- /dev/null +++ b/build/assets/ComponentsCatalog-RdvMiEfN.js @@ -0,0 +1 @@ +import{j as u,a9 as c,T as t,p as l,b as C,am as y,ak as $,ar as s,aJ as N,b1 as O,B as n}from"./mui-vendor-CkIVaoQP.js";import{G as a,S as v,A as z,fD as G,O as j}from"./index-CeyyVc1v.js";import{B as H}from"./BackButton-Crzr7NMa.js";import{T as D}from"./Timer-DHCbB9tg.js";import{L as g}from"./LineWithText-BpnpjRWf.js";import{C as d}from"./CustomCard-B-6dDbAN.js";import{C as U}from"./Captcha-CBxUIUNI.js";import{D as q}from"./DialogAlert-BfXcr-Kr.js";import{S as V}from"./SimpleTable-DBAoNnCU.js";import{R as J}from"./ResponsiveTable-w7hk7Uq8.js";import{C as X,a as K}from"./ChartLenear-WgLA0J0V.js";import{r as b}from"./react-vendor-CmFgShSM.js";import{C as k,M as Y,B,I as Z}from"./chart-vendor-sE2SUVPW.js";import"./auto-gcBAg08D.js";import{d as u0}from"./Add--yVWBJhC.js";import{d as T}from"./Search-Dek2fED1.js";import{d as t0}from"./Delete-C5MyLelE.js";import{d as e0}from"./Edit-CqBj1Y2L.js";import{d as C0}from"./Save-nlxmeU5w.js";import{d as a0}from"./Settings-BckUi175.js";import{d as o0}from"./Person-Q1IHBezR.js";import{u as n0}from"./redux-vendor-B7uoacJt.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const r=({Icon:o,onClick:m,title:F})=>u.jsx(a,{container:!0,sx:{cursor:"pointer",width:{xs:"100%",sm:"auto"}},onClick:m,children:u.jsx(c,{elevation:3,sx:{flexGrow:1,justifyContent:"center",alignItems:"center",display:"flex"},children:u.jsxs(a,{container:!0,p:v.SMALL,gap:v.SMALL,children:[u.jsx(o,{color:"primary"}),u.jsx(t,{variant:"body1",color:"primary",children:F})]})})});r.propTypes={Icon:l.PropTypes.any,onClick:l.PropTypes.func,title:l.PropTypes.string};B.font.family="iranyekan";const R=({chartData:o})=>(console.log(k),u.jsx(Y,{data:o}));R.propTypes={chartData:l.PropTypes.any};B.font.family="iranyekan";const S=({chartData:o})=>(console.log(k),u.jsx(Z,{data:o}));S.propTypes={chartData:l.PropTypes.any};const I0=()=>{const[o,m]=b.useState(""),[F,w]=b.useState(!1),[p]=b.useContext(z),h=n0(),I={labels:["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور"],datasets:[{label:"فروش",backgroundColor:["rgba(33, 72, 214, 0.7)"],data:[65,59,80,81,56,55],borderRadius:5},{label:"خرید",backgroundColor:["rgba(100, 130, 160, 0.7)"],data:[45,49,60,71,46,35],borderRadius:5}]},f={labels:["فعال","غیرفعال","در حال بررسی","رد شده"],datasets:[{label:"تعداد",data:[300,50,100,40],backgroundColor:["rgba(75, 192, 192, 0.7)","rgba(255, 99, 132, 0.7)","rgba(255, 205, 86, 0.7)","rgba(201, 203, 207, 0.7)"]}]},P={labels:["هفته 1","هفته 2","هفته 3","هفته 4"],datasets:[{label:"روند رشد",fill:!1,borderColor:"rgb(75, 192, 192)",tension:.1,data:[12,19,13,25]}]},L=["ردیف","نام","نام خانوادگی","شهر","وضعیت"],W=[[1,"احمد","محمدی","تهران","فعال"],[2,"فاطمه","رضایی","اصفهان","فعال"],[3,"حسین","کریمی","مشهد","غیرفعال"],[4,"مریم","احمدی","شیراز","فعال"],[5,"علی","حسینی","تبریز","در حال بررسی"]],M=["ردیف","کد درخواست","نام متقاضی","تاریخ ثبت","مقدار (کیلوگرم)","قیمت کل (ریال)","وضعیت"],Q=[[1,"REQ-1001","احمد محمدی","1402/09/15","1,250","62,500,000","تایید شده"],[2,"REQ-1002","فاطمه رضایی","1402/09/16","2,100","105,000,000","در انتظار"],[3,"REQ-1003","حسین کریمی","1402/09/17","850","42,500,000","رد شده"],[4,"REQ-1004","مریم احمدی","1402/09/18","3,200","160,000,000","تایید شده"],[5,"REQ-1005","علی حسینی","1402/09/19","1,750","87,500,000","در انتظار"],[6,"REQ-1006","زهرا کاظمی","1402/09/20","950","47,500,000","تایید شده"],[7,"REQ-1007","محمد تقی‌زاده","1402/09/21","2,450","122,500,000","تایید شده"],[8,"REQ-1008","سارا موسوی","1402/09/22","1,100","55,000,000","در انتظار"],[9,"REQ-1009","رضا نوری","1402/09/23","3,800","190,000,000","تایید شده"],[10,"REQ-1010","نرگس احمدی","1402/09/24","1,450","72,500,000","رد شده"],[11,"REQ-1011","امیر حسینی","1402/09/25","2,650","132,500,000","تایید شده"],[12,"REQ-1012","لیلا کریمی","1402/09/26","890","44,500,000","در انتظار"]],x=[{category:"🧭 Navigation",items:[{name:"BackButton",description:"دکمه بازگشت با آیکون",path:"components/back-button/BackButton.js",component:u.jsx(H,{})}]},{category:"🔘 Buttons & Actions",items:[{name:"ButtonWithIcon",description:"دکمه با آیکون - انواع مختلف",path:"components/button-with-icon/ButtonWithIcon.js",component:u.jsxs(a,{container:!0,gap:2,flexWrap:"wrap",children:[u.jsx(r,{Icon:G,title:"صفحه اصلی",onClick:()=>alert("کلیک روی صفحه اصلی")}),u.jsx(r,{Icon:u0,title:"افزودن",onClick:()=>alert("کلیک روی افزودن")}),u.jsx(r,{Icon:T,title:"جستجو",onClick:()=>alert("کلیک روی جستجو")}),u.jsx(r,{Icon:t0,title:"حذف",onClick:()=>alert("کلیک روی حذف")}),u.jsx(r,{Icon:e0,title:"ویرایش",onClick:()=>alert("کلیک روی ویرایش")}),u.jsx(r,{Icon:C0,title:"ذخیره",onClick:()=>alert("کلیک روی ذخیره")}),u.jsx(r,{Icon:a0,title:"تنظیمات",onClick:()=>alert("کلیک روی تنظیمات")}),u.jsx(r,{Icon:o0,title:"پروفایل",onClick:()=>alert("کلیک روی پروفایل")})]})}]},{category:"🎴 Cards & Display",items:[{name:"CustomCard",description:"کارت سفارشی با گرادیانت و تصویر پس‌زمینه",path:"components/custom-card/CustomCard.js",component:u.jsxs(a,{container:!0,gap:2,flexWrap:"wrap",children:[u.jsx(d,{title:"آمار کل درخواست‌ها",value:"۱,۲۳۴"}),u.jsx(d,{title:"کاربران فعال",value:"۵۶۷"}),u.jsx(d,{title:"پرونده‌های باز",value:"۸۹"}),u.jsx(d,{title:"تراکنش‌های امروز",value:"۱۲۳"})]})}]},{category:"📐 Layout & Structure",items:[{name:"LineWithText",description:"خط تقسیم کننده با متن و گرادیانت رنگی",path:"components/line-with-text/LineWithText.js",component:u.jsxs(C,{children:[u.jsx(g,{text:"بخش اطلاعات کاربری"}),u.jsx(t,{variant:"body2",mb:2,children:"محتوای بخش اول"}),u.jsx(g,{text:"بخش تنظیمات"}),u.jsx(t,{variant:"body2",mb:2,children:"محتوای بخش دوم"}),u.jsx(g,{text:"بخش گزارش‌ها"})]})}]},{category:"⏱️ Time & Counters",items:[{name:"Timer",description:"تایمر شمارش معکوس با فرمت‌های مختلف",path:"components/timer/Timer.js",component:u.jsxs(a,{container:!0,gap:3,direction:"column",children:[u.jsxs(C,{children:[u.jsx(t,{variant:"subtitle2",mb:1,children:"تایمر ساعتی (HH:MM:SS):"}),u.jsx(c,{sx:{p:2,display:"inline-block"},children:u.jsx(D,{seconds:3665})})]}),u.jsxs(C,{children:[u.jsx(t,{variant:"subtitle2",mb:1,children:"تایمر روزانه (DD:HH:MM:SS):"}),u.jsx(c,{sx:{p:2,display:"inline-block"},children:u.jsx(D,{seconds:186400,isFilePaymentTime:!0})})]})]})}]},{category:"📝 Forms & Inputs",items:[{name:"Captcha",description:"کد امنیتی (کپچا) با قابلیت تولید مجدد و پخش صوتی",path:"components/captcha/Captcha.js",component:u.jsxs(C,{children:[u.jsx(U,{onChange:e=>w(e)}),u.jsxs(t,{variant:"caption",color:"text.secondary",mt:1,children:["وضعیت: ",F?"✅ معتبر":"❌ نامعتبر"]})]})}]},{category:"🔔 Modals & Dialogs",items:[{name:"Modal (Global)",description:"سیستم مودال سراسری با Redux",path:"components/modal/Modal.js",component:u.jsxs(C,{children:[u.jsxs(a,{container:!0,gap:2,direction:"column",children:[u.jsx(n,{variant:"contained",onClick:()=>h(j({title:"عنوان مودال",content:u.jsx(C,{p:2,children:u.jsx(t,{children:"این یک مودال سراسری است که از Redux استفاده می‌کند"})})})),children:"باز کردن مودال معمولی"}),u.jsx(n,{variant:"contained",color:"success",onClick:()=>h(j({title:"success",content:null})),children:"مودال موفقیت"}),u.jsx(n,{variant:"contained",color:"error",onClick:()=>h(j({title:"error",content:null})),children:"مودال خطا"})]}),u.jsx(t,{variant:"caption",color:"text.secondary",mt:2,children:"این کامپوننت از Redux (appSlice) استفاده می‌کند"})]})},{name:"DialogAlert",description:"دیالوگ با دکمه تریگر داخلی",path:"components/dialog-alert/DialogAlert.js",component:u.jsxs(C,{children:[u.jsx(q,{btnTitle:"مشاهده قوانین و مقررات",title:"قوانین و مقررات سیستم",content:"لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است. چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است.",isAccepted:!1,actions:[u.jsx(n,{variant:"contained",color:"primary",children:"پذیرفتم"},"accept"),u.jsx(n,{variant:"outlined",children:"نمی‌پذیرم"},"reject")]}),u.jsx(t,{variant:"caption",color:"text.secondary",mt:2,children:"این کامپوننت دکمه تریگر خود را دارد (چک‌باکس + متن)"})]})}]},{category:"📢 Notifications",items:[{name:"Notif (Global)",description:"سیستم نوتیفیکیشن سراسری",path:"components/notif/Notif.js",component:u.jsxs(a,{container:!0,gap:2,direction:"column",children:[u.jsx(n,{variant:"contained",color:"success",onClick:()=>p({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد!",severity:"success"}),children:"نوتیفیکیشن موفقیت"}),u.jsx(n,{variant:"contained",color:"error",onClick:()=>p({vertical:"top",horizontal:"center",msg:"خطایی رخ داده است!",severity:"error"}),children:"نوتیفیکیشن خطا"}),u.jsx(n,{variant:"contained",color:"warning",onClick:()=>p({vertical:"top",horizontal:"center",msg:"توجه: این یک هشدار است",severity:"warning"}),children:"نوتیفیکیشن هشدار"}),u.jsx(n,{variant:"contained",color:"info",onClick:()=>p({vertical:"top",horizontal:"center",msg:"این یک پیام اطلاعاتی است",severity:"info"}),children:"نوتیفیکیشن اطلاعات"}),u.jsx(t,{variant:"caption",color:"text.secondary",children:"این کامپوننت از AppContext استفاده می‌کند"})]})}]},{category:"📊 Charts",items:[{name:"ChartBar",description:"نمودار میله‌ای با داده‌های واقعی",path:"components/chart-bar/ChartBar.js",component:u.jsx(C,{sx:{height:300,width:"100%"},children:u.jsx(X,{chartData:I,options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"top"},title:{display:!0,text:"نمودار فروش و خرید ماهانه"}}}})})},{name:"ChartPie",description:"نمودار دایره‌ای",path:"components/chart-pie/ChartPie.js",component:u.jsx(C,{sx:{height:300,width:"100%"},children:u.jsx(R,{chartData:f,options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"top"},title:{display:!0,text:"توزیع وضعیت درخواست‌ها"}}}})})},{name:"ChartLinear",description:"نمودار خطی",path:"components/chart-linear/ChartLinear.js",component:u.jsx(C,{sx:{height:300,width:"100%"},children:u.jsx(K,{chartData:P,options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"top"},title:{display:!0,text:"روند رشد هفتگی"}}}})})},{name:"ChartDoughnut",description:"نمودار دونات",path:"components/chart-doughnut/ChartDoughnut.js",component:u.jsx(C,{sx:{height:300,width:"100%"},children:u.jsx(S,{chartData:f,options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"top"},title:{display:!0,text:"نمودار دونات وضعیت‌ها"}}}})})},{name:"Other Charts",description:"سایر نمودارهای موجود",path:"components/chart-*/",component:u.jsxs(C,{children:[u.jsx(t,{variant:"body2",mb:2,children:"نمودارهای دیگر موجود:"}),u.jsx(a,{container:!0,gap:1,flexWrap:"wrap",children:["ChartRadar","ChartPolarArea","ChartBubble","ChartScatter","AdvancedChart"].map(e=>u.jsx(s,{label:e,variant:"outlined",color:"primary"},e))})]})}]},{category:"📋 Tables",items:[{name:"SimpleTable",description:"جدول ساده با داده‌های واقعی",path:"components/simple-table/SimpleTable.js",component:u.jsx(C,{sx:{width:"100%"},children:u.jsx(V,{name:"لیست کاربران",columns:L,data:W})})},{name:"ResponsiveTable",description:"جدول پیشرفته با فیلتر، مرتب‌سازی و صفحه‌بندی",path:"components/responsive-table/ResponsiveTable.js",component:u.jsxs(C,{sx:{width:"100%",overflowX:"auto"},children:[u.jsx(J,{title:"لیست درخواست‌های خرید",columns:M,data:Q,paginated:!0,customColors:[{name:"ردیف",color:"#e8f4f8"},{name:"کد درخواست",color:"#e1f5e1"},{name:"وضعیت",color:"#fff4e6"},{rest:!0,color:"#f5f5f5"}]}),u.jsx(t,{variant:"caption",color:"text.secondary",mt:2,children:"قابلیت‌ها: مرتب‌سازی کلیک روی هدر، فیلتر ستون‌ها، جستجو، صفحه‌بندی، و محاسبه مجموع"})]})},{name:"Other Tables",description:"سایر جداول موجود در سیستم",path:"components/table-*/",component:u.jsxs(C,{children:[u.jsx(t,{variant:"body2",mb:2,children:"کامپوننت‌های جدول موجود:"}),u.jsx(a,{container:!0,gap:1,flexWrap:"wrap",children:["ModernTable","AdvancedTable","ResponsiveTable","MuiTable","MyTable","FlexTable","PageTable","PageTableApi","AdvancedTablePage"].map(e=>u.jsx(s,{label:e,variant:"outlined",color:"secondary"},e))}),u.jsx(t,{variant:"caption",color:"text.secondary",mt:2,children:"این کامپوننت‌ها نیاز به داده‌های جدولی دارند"})]})}]},{category:"📤 File Upload (Documentation Only)",items:[{name:"Upload Components",description:"کامپوننت‌های آپلود فایل",path:"components/file-uploader/",component:u.jsxs(C,{children:[u.jsx(t,{variant:"body2",mb:2,children:"کامپوننت‌های آپلود موجود:"}),u.jsx(a,{container:!0,gap:1,flexWrap:"wrap",children:["FileUploader","ImageUpload","ImgUploader","ExcelUploadButton"].map(e=>u.jsx(s,{label:e,variant:"outlined",color:"info"},e))}),u.jsx(t,{variant:"caption",color:"text.secondary",mt:2,children:"این کامپوننت‌ها برای آپلود فایل‌های مختلف استفاده می‌شوند"})]})}]},{category:"🎯 Specialized (Documentation Only)",items:[{name:"Other Components",description:"سایر کامپوننت‌های تخصصی سیستم",path:"components/",component:u.jsxs(C,{children:[u.jsx(t,{variant:"body2",mb:2,children:"کامپوننت‌های تخصصی:"}),u.jsx(a,{container:!0,gap:1,flexWrap:"wrap",children:["StateStepper","ChatSystem","TicketSummary","Dashboard","Map","ShowImage","ExcelLink","CheckClearanceCode","BoxList","LinkItem","BankCard","CarPelak","DatePicker","SelectCheck","AutocompleteSelect","TextInput","NumberFormatCustom","RequestsAwaitingPayment","RequestsAwaitingInspections","Drawer","Backdrop","ErrorFallback","TimeToLogout"].map(e=>u.jsx(s,{label:e,variant:"outlined",size:"small"},e))}),u.jsx(t,{variant:"caption",color:"text.secondary",mt:2,children:"این کامپوننت‌ها برای موارد خاص سیستم طراحی شده‌اند"})]})}]}],E=x.map(e=>({...e,items:e.items.filter(i=>i.name.toLowerCase().includes(o.toLowerCase())||i.description.includes(o))})).filter(e=>e.items.length>0);return u.jsx(C,{sx:{minHeight:"100vh",backgroundColor:"#f5f5f5",py:4},children:u.jsx(a,{container:!0,justifyContent:"center",children:u.jsxs(a,{xs:11,md:10,lg:9,children:[u.jsxs(c,{elevation:3,sx:{p:3,mb:3},children:[u.jsx(t,{variant:"h4",gutterBottom:!0,sx:{fontWeight:700,color:"primary.main"},children:"📚 کاتالوگ کامپوننت‌های سیستم رصدیار"}),u.jsx(t,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:"نمایش زنده و تعاملی تمامی کامپوننت‌های قابل استفاده در پروژه"}),u.jsx(y,{sx:{my:2}}),u.jsx($,{fullWidth:!0,placeholder:"جستجوی کامپوننت...",value:o,onChange:e=>m(e.target.value),InputProps:{startAdornment:u.jsx(T,{sx:{mr:1,color:"text.secondary"}})}}),u.jsxs(a,{container:!0,gap:2,mt:2,children:[u.jsx(s,{label:`تعداد کل: ${x.reduce((e,i)=>e+i.items.length,0)} کامپوننت`,color:"primary",variant:"outlined"}),u.jsx(s,{label:`${x.length} دسته‌بندی`,color:"secondary",variant:"outlined"})]})]}),E.map((e,i)=>u.jsxs(c,{elevation:2,sx:{p:3,mb:3},children:[u.jsx(t,{variant:"h5",gutterBottom:!0,sx:{fontWeight:600,color:"secondary.main",mb:3},children:e.category}),e.items.map((A,_)=>u.jsx(N,{sx:{mb:3,border:"1px solid #e0e0e0"},children:u.jsx(O,{children:u.jsxs(a,{container:!0,spacing:2,children:[u.jsxs(a,{xs:12,children:[u.jsx(t,{variant:"h6",sx:{fontWeight:600,color:"primary.main"},children:A.name}),u.jsx(t,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:A.description}),u.jsxs(t,{variant:"caption",sx:{color:"text.disabled",fontFamily:"monospace"},children:["📁 ",A.path]})]}),u.jsxs(a,{xs:12,children:[u.jsx(y,{sx:{my:2}}),u.jsx(t,{variant:"subtitle2",sx:{mb:2,fontWeight:600},children:"🎨 نمایش زنده:"}),u.jsx(C,{sx:{p:3,backgroundColor:"#ffffff",borderRadius:2,border:"2px dashed #1976d2",minHeight:"80px",display:"flex",alignItems:"center",justifyContent:"center"},children:A.component})]})]})})},_))]},i)),E.length===0&&u.jsx(c,{elevation:2,sx:{p:5,textAlign:"center"},children:u.jsx(t,{variant:"h6",color:"text.secondary",children:"کامپوننتی با این عبارت جستجو پیدا نشد"})})]})})})};export{I0 as default}; diff --git a/build/assets/CreateGuilds-CCT3R9v5.js b/build/assets/CreateGuilds-CCT3R9v5.js new file mode 100644 index 0000000..92f7df1 --- /dev/null +++ b/build/assets/CreateGuilds-CCT3R9v5.js @@ -0,0 +1 @@ +import{j as u,ak as b,B as R,i as G,c5 as nu,T as w,ag as P,ah as Q,ai as I,aj as g,av as Fe,aw as Ae,ax as J,ao as ru,ap as su,aq as lu,aX as Ee,b as Ne}from"./mui-vendor-CkIVaoQP.js";import{r as y}from"./react-vendor-CmFgShSM.js";import{L as z,j as Y,h as S,A as Be,u as Te,c as $e,X as q,C as Ce,G as c,M as m,r as O,db as iu,b1 as ou,fB as cu,bS as du,S as E,O as Cu,c2 as hu,aE as Ve,W as Pe,v as Z,bT as Ie,fC as vu,fD as _u,fE as ee}from"./index-CeyyVc1v.js";import{a as U,u as Le}from"./redux-vendor-B7uoacJt.js";import{d as le}from"./Person-Q1IHBezR.js";import{d as ce}from"./Phone-Dv2y8iMM.js";import{d as de}from"./Badge-u1S44abW.js";import{d as pu,a as Me}from"./Cake-CkaTUHNX.js";import{d as Se}from"./Business-J-mGuLnc.js";import{d as De}from"./CheckCircle-zgBvZQ-b.js";import{d as xu}from"./Done-Dp5awdte.js";import{D as mu}from"./DialogAlert-BfXcr-Kr.js";import{L as k}from"./LabelField-B6eRSoQP.js";const bu=U("CHECK_KILLHOUSE_REQUEST_GUILD_SERVICE",async(e,{dispatch:t})=>{try{t(z());const{data:n,status:a}=await Y.post("check_guilds/",e);return t(S()),{data:n,status:a}}catch(n){return t(S()),{error:n.response.data.result}}}),ju=$e({verificationCode:m().required("کد احراز الزامی است").matches(/^\d+$/,"کد احراز باید فقط شامل اعداد باشد").min(4,"کد احراز باید حداقل ۴ رقم باشد").max(6,"کد احراز حداکثر ۶ رقم می‌باشد")}),yu=({item:e,updateTable:t})=>{const n=Le(),[a]=y.useContext(Be),r=Te({initialValues:{verificationCode:""},validationSchema:ju,onSubmit:i=>{n(bu({guilds_key:e.key,state:"accepted",code:i.verificationCode,role:q()})).then(l=>{l.payload.error?a({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(t(),n(Ce()),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}});return u.jsxs(c,{component:"form",onSubmit:r.handleSubmit,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsx(b,{fullWidth:!0,id:"verificationCode",name:"verificationCode",label:"کد احراز",value:r.values.verificationCode,onChange:r.handleChange,onBlur:r.handleBlur,error:r.touched.verificationCode&&!!r.errors.verificationCode,helperText:r.touched.verificationCode&&r.errors.verificationCode,variant:"outlined",inputProps:{maxLength:6,inputMode:"numeric",pattern:"[0-9]*"},placeholder:"کد احراز را وارد کنید"}),u.jsx(R,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,sx:{mt:1},children:"ثبت کد"})]})},fu=U("PROVINCE_GET_REGISTER_CODE_SERVICE",async(e,{dispatch:t})=>{t(z());const{data:n,status:a}=await Y.get("allow_register_code_for_guilds");return t(S()),{data:n,status:a}}),ja=U("PROVINCE_RESEND_REGISTER_CODE_SERVICE",async(e,{dispatch:t})=>{t(z());try{const{data:n,status:a}=await Y.post("send_again_sms_for_register_code_guild/",e);return t(S()),{data:n,status:a}}catch(n){return t(S()),{error:n.response.data.result}}});var he={},Fu=G;Object.defineProperty(he,"__esModule",{value:!0});var we=he.default=void 0,Au=Fu(O()),Eu=u;we=he.default=(0,Au.default)((0,Eu.jsx)("path",{d:"M9 11H7v2h2zm4 0h-2v2h2zm4 0h-2v2h2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 16H5V9h14z"}),"DateRange");var ve={},Nu=G;Object.defineProperty(ve,"__esModule",{value:!0});var Ge=ve.default=void 0,Iu=Nu(O()),Su=u;Ge=ve.default=(0,Iu.default)((0,Su.jsx)("path",{d:"M22 10V6c0-1.11-.9-2-2-2H4c-1.1 0-1.99.89-1.99 2v4c1.1 0 1.99.9 1.99 2s-.89 2-2 2v4c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-4c-1.1 0-2-.9-2-2s.9-2 2-2m-9 7.5h-2v-2h2zm0-4.5h-2v-2h2zm0-4.5h-2v-2h2z"}),"ConfirmationNumber");var _e={},Du=G;Object.defineProperty(_e,"__esModule",{value:!0});var Oe=_e.default=void 0,gu=Du(O()),Ru=u;Oe=_e.default=(0,gu.default)((0,Ru.jsx)("path",{d:"M4 10h3v7H4zm6.5 0h3v7h-3zM2 19h20v3H2zm15-9h3v7h-3zm-5-9L2 6v2h20V6z"}),"AccountBalance");var pe={},Bu=G;Object.defineProperty(pe,"__esModule",{value:!0});var We=pe.default=void 0,Tu=Bu(O()),$u=u;We=pe.default=(0,Tu.default)((0,$u.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4-8 5-8-5V6l8 5 8-5z"}),"LocalPostOffice");var xe={},Vu=G;Object.defineProperty(xe,"__esModule",{value:!0});var ze=xe.default=void 0,Pu=Vu(O()),Lu=u;ze=xe.default=(0,Pu.default)((0,Lu.jsx)("path",{d:"M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25m6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8"}),"Face");var me={},Mu=G;Object.defineProperty(me,"__esModule",{value:!0});var Ye=me.default=void 0,wu=Mu(O()),Gu=u;Ye=me.default=(0,wu.default)((0,Gu.jsx)("path",{d:"m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54z"}),"Favorite");const Ou=U("PROVINCE_CREATE_GUILD_SERVICE",async(e,{dispatch:t})=>{try{t(z());const{data:n,status:a}=await Y.post("update_guild_by_national_id/?role="+q(),e);return t(iu()),t(S()),{data:n,status:a}}catch(n){return t(S()),{error:n.response.data.result}}}),ge=U("PROVINCE_GET_GUILDS_FOR_UPDATE_OR_CREATE_SERVICE",async(e,{dispatch:t})=>{var n,a,r,i,l,o,C,s,x;t(z());try{const{data:d,status:j}=await Y.get("get_guilds_for_update_or_create/",{params:{national_code:e.national_code,update:e.update||!1,role:q()}});return t(S()),{data:d,status:j}}catch(d){return t(S()),((n=d.response)==null?void 0:n.status)===403?{error:((r=(a=d.response)==null?void 0:a.data)==null?void 0:r.result)||((l=(i=d.response)==null?void 0:i.data)==null?void 0:l.message)||"دسترسی غیرمجاز",status:403}:{error:((C=(o=d.response)==null?void 0:o.data)==null?void 0:C.result)||((x=(s=d.response)==null?void 0:s.data)==null?void 0:x.message)||"خطا در دریافت اطلاعات"}}});var N={};Object.defineProperty(N,"__esModule",{value:!0});N.toJalali=zu;var Wu=N.toGregorian=Yu;N.isValidJalaliDate=qu;N.isLeapJalaliYear=qe;N.jalaliMonthLength=Ue;N.jalCal=be;N.j2d=He;N.d2j=Je;N.g2d=ue;N.d2g=je;var L=[-61,9,38,199,426,686,756,818,1111,1181,1210,1635,2060,2097,2192,2262,2324,2394,2456,3178];function zu(e,t,n){return Je(ue(e,t,n))}function Yu(e,t,n){return je(He(e,t,n))}function qu(e,t,n){return e>=-61&&e<=3177&&t>=1&&t<=12&&n>=1&&n<=Ue(e,t)}function qe(e){return Uu(e)===0}function Ue(e,t){return t<=6?31:t<=11||qe(e)?30:29}function Uu(e){var t=L.length,n=L[0],a,r=0,i,l,o;for(o=1;o=0){if(o<=185)return l=1+_(o,31),i=f(o,31)+1,{jy:n,jm:l,jd:i};o-=186}else n-=1,o+=179,a.leap===1&&(o+=1);return l=7+_(o,30),i=f(o,30)+1,{jy:n,jm:l,jd:i}}function ue(e,t,n){var a=_((e+_(t-8,6)+100100)*1461,4)+_(153*f(t+9,12)+2,5)+n-34840408;return a=a-_(_(e+100100+_(t-8,6),100)*3,4)+752,a}function je(e){if(isNaN(e))return{gy:NaN,gm:NaN,gd:NaN};var t,n,a,r,i;return t=4*e+139361631,t=t+_(_(4*e+183187720,146097)*3,4)*4-3908,n=_(f(t,1461),4)*5+308,a=_(f(n,153),5)+1,r=f(_(n,153),12)+1,i=_(t,1461)-100100+_(8-r,6),{gy:i,gm:r,gd:a}}function _(e,t){return~~(e/t)}function f(e,t){return e-~~(e/t)*t}const Xe=(e,t,n)=>{const a=t>=1&&t<=12?t:t+1,r=Wu(e,a,n);return new Date(r.gy,r.gm-1,r.gd)},X={YES:"بلی",NO:"خیر"},Re={MALE:"مرد",FEMALE:"زن"},K={YES:"بلی",NO:"خیر"},Ke=e=>{if(!e||typeof e!="string")return"";if(/^\d{4}\/\d{2}\/\d{2}$/.test(e)&&parseInt(e.split("/")[0])<1500)return e;try{return Ve(e)}catch(n){return console.error("Error converting Gregorian date to Persian:",n),e}},Qe=e=>{if(!e||typeof e!="string")return"";const t=ee(e);if(/^\d{4}[-/]\d{2}[-/]\d{2}$/.test(t)&&parseInt(t.split(/[-/]/)[0])>1500)return t.replace(/\//g,"-");const a=t.split("/");if(a.length!==3)return e;const r=parseInt(a[0]),i=parseInt(a[1]),l=parseInt(a[2]);if(isNaN(r)||isNaN(i)||isNaN(l))return e;try{const o=Xe(r,i,l),C=o.getFullYear(),s=String(o.getMonth()+1).padStart(2,"0"),x=String(o.getDate()).padStart(2,"0");return`${C}-${s}-${x}`}catch(o){return console.error("Error converting Persian date to Gregorian:",o),e}},ie=e=>!e||typeof e!="string"?"":ee(e),M=e=>{if(!e||typeof e!="string")return"";const n=e.substring(0,10).replace(/-/g,"/");return Ve(n)},Hu=e=>!e||typeof e!="string"?"":ee(e),Ju=e=>{if(!e||typeof e!="string")return"";const t=ee(e);if(/^\d{4}\/\d{2}\/\d{2}$/.test(t)&&parseInt(t.split("/")[0])<1500){const i=t.split("/"),l=parseInt(i[0]),o=parseInt(i[1]),C=parseInt(i[2]);if(!isNaN(l)&&!isNaN(o)&&!isNaN(C))try{const s=Xe(l,o,C),x=s.getFullYear(),d=String(s.getMonth()+1).padStart(2,"0"),j=String(s.getDate()).padStart(2,"0");return`${x}/${d}/${j}`}catch(s){console.error("Error converting Persian to Gregorian:",s)}}if(/^\d{4}[-/]\d{2}[-/]\d{2}$/.test(t)&&parseInt(t.split(/[-/]/)[0])>1900)return t.replace(/-/g,"/");try{const r=new Date(t);if(!isNaN(r.getTime())){const i=r.getFullYear(),l=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${i}/${l}/${o}`}}catch(r){console.error("Error formatting database date:",r)}return t.replace(/-/g,"/")},Xu=e=>$e({national_id:m().required("کد ملی الزامی است").matches(/^[0-9]{10}$/,"کد ملی باید 10 رقم باشد"),mobile:e?m().nullable().test("mobile-format","شماره تلفن باید 11 رقم باشد",t=>!t||/^[0-9]{11}$/.test(t)):m().required("شماره تلفن الزامی است").matches(/^[0-9]{11}$/,"شماره تلفن باید 11 رقم باشد"),first_name:m(),last_name:m(),guild_name:m(),guild_category:m(),state:m(),city:m(),address:m(),license_expire_date:m(),license_status:m(),union_name:m(),postal_code:m(),guild_national_id:m(),is_foreigner:m(),national_code:m(),has_steward:m(),has_partner:m(),license_number:m(),isAccepted:hu().test("req","باید تعهد نامه را بپذیرید!",t=>t===!0).required("این فیلد اجباری است!")}),Ku=e=>{var t,n,a,r,i,l,o,C,s,x,d,j,F,B,T,$;return{first_name:((t=e==null?void 0:e.user)==null?void 0:t.firstName)||"",last_name:((n=e==null?void 0:e.user)==null?void 0:n.lastName)||"",corporation_name:(e==null?void 0:e.companyName)||"",national_id:((a=e==null?void 0:e.user)==null?void 0:a.nationalId)||"",national_code:((r=e==null?void 0:e.user)==null?void 0:r.nationalCode)||"",birth_date:M(((i=e==null?void 0:e.user)==null?void 0:i.birthday)||""),father_name:((l=e==null?void 0:e.user)==null?void 0:l.fatherName)||"",gender:((o=e==null?void 0:e.user)==null?void 0:o.gender)||"",person_city:((C=e==null?void 0:e.user)==null?void 0:C.city)||"",is_alive:((s=e==null?void 0:e.user)==null?void 0:s.isAlive)||"",guild_name:(e==null?void 0:e.guildsName)||"",area_activity:(e==null?void 0:e.areaActivity)||"",state:((d=(x=e==null?void 0:e.address)==null?void 0:x.province)==null?void 0:d.name)||"",city:((F=(j=e==null?void 0:e.address)==null?void 0:j.city)==null?void 0:F.name)||"",address:((B=e==null?void 0:e.address)==null?void 0:B.address)||"",license_expire_date:M((e==null?void 0:e.licenseExpireDate)||""),license_status:(e==null?void 0:e.licenseStatus)||"",license_type:(e==null?void 0:e.licenseType)||"",union_name:(e==null?void 0:e.unionName)||"",postal_code:((T=e==null?void 0:e.address)==null?void 0:T.postalCode)||"",phone_number:(e==null?void 0:e.phoneNumber)||"",mobile:(($=e==null?void 0:e.user)==null?void 0:$.mobile)||"",is_foreigner:(e==null?void 0:e.is_foreign_national)||"",has_steward:(e==null?void 0:e.hasSteward)||"",has_partner:(e==null?void 0:e.hasPartner)||"",license_number:(e==null?void 0:e.licenseNumber)||"",isAccepted:(e==null?void 0:e.provinceAcceptState)==="accepted"||!1,steward:(e==null?void 0:e.steward)||!1,verify_mobile:(e==null?void 0:e.verifyMobile)||!1,guild_national_id:(e==null?void 0:e.nationalId)||"",license_issue_date:M((e==null?void 0:e.licenseIssueDate)||""),company_name:(e==null?void 0:e.companyName)||"",company_identifier:(e==null?void 0:e.companyIdentifier)||"",type_activity_name:(e==null?void 0:e.typeActivityName)||"",active:(e==null?void 0:e.active)??null}},oe=(e,t=!1)=>!e||typeof e!="string"?"":t?Hu(e):Ju(e),Qu=(e,t,n,a)=>{const r={national_id:e.national_id,mobile:e.mobile,mobilenumber:e.mobile,steward:!!e.steward,active_register_code:!!e.verify_mobile,firstName:e.first_name||"",lastName:e.last_name||"",fatherName:e.father_name||"",gender:e.gender||"",identityNo:e.national_code||"",isLive:e.is_alive==="بلی"||e.is_alive===!0,birthDate:oe(e.birth_date||"",a===!0),city:e.city||"",address:e.address||"",postalcode:e.postal_code||"",licenseNumber:e.license_number||"",licenseExpireDate:oe(e.license_expire_date||"",a===!0),licenseIssueDate:oe(e.license_issue_date||"",a===!0),licenseType:e.license_type||"",licenseStatus:e.license_status||"",isicname:e.area_activity||"",corporationName:e.corporation_name||"",nationalId:e.guild_national_id||"",unionName:e.union_name||"",phonenumber:e.phone_number||"",hasPartner:e.has_partner===!0||e.has_partner==="بلی",isForeigner:e.is_foreigner===!0||e.is_foreigner==="بلی",title:e.guild_name||"",role:q(),has_inquiry:a!==null?a:!1,...e.active!==null&&{active:e.active}};return t&&(r.guilds_key=t.key,e.mobile!==n&&(r.mobile=e.mobile,r.mobilenumber=e.mobile)),r},Zu=(e,t,n)=>{const a=e.dbRegister===!1,r=e.user||{},i=e.guild||{},l=i.layerTwo||{},o=e.address||{},C=o.province||{},s=o.city||{},x=a?String(l.nationalcode||r.nationalCode||t).trim():String(r.nationalId||t).trim(),d=a?ie(r.birthDate||""):M(r.birthday||""),j=a?ie(i.licenseExpireDate||""):M(e.licenseExpireDate||""),F=a?ie(l.licenseIssueDate||""):M(e.licenseIssueDate||""),B=a?r.gender===!0?"True":r.gender===!1?"False":"":r.gender||"",T=a?r.isLive===!0?"بلی":r.isLive===!1?"خیر":"":r.isAlive===!1?"خیر":r.isAlive===!0?"بلی":"",$=a?l.isForeigner==="خیر"?!1:l.isForeigner==="بلی"?!0:"":e.isForeignNational===!1?!1:e.isForeignNational===!0?!0:"",ae=a?l.hasSteward==="خیر"?!1:l.hasSteward==="بلی"?!0:"":e.steward===!1?!1:e.steward===!0?!0:"",te=a?l.hasPartner==="خیر"?!1:l.hasPartner==="بلی"?!0:"":e.hasPartner===!1?!1:e.hasPartner===!0?!0:"",ne={first_name:r.firstName||"",last_name:r.lastName||"",national_id:x,national_code:a?r.identityNo||"":r.nationalCode||"",birth_date:d,father_name:r.fatherName||"",gender:B,person_city:r.city||"",is_alive:T,guild_name:a?i.title||"":e.guildsName||"",area_activity:a?i.isicname||"":e.areaActivity||"",state:a?i.state||"":C.name||"",city:a?i.city||"":s.name||"",address:a?i.address||"":o.address||"",license_expire_date:j,license_status:a?i.licenseStatus||"":e.licenseStatus||"",license_type:a?i.licenseType||"":e.licenseType||"",license_number:a?i.licenseNumber||"":e.licenseNumber||"",union_name:a?l.unionName||"":e.unionName||"",postal_code:a?l.postalcode||"":o.postalCode||"",phone_number:a?l.phonenumber||"":e.phoneNumber||"",mobile:a?l.mobilenumber||"":r.mobile||"",guild_national_id:a?l.nationalId||"":e.nationalCode||"",is_foreigner:$,corporation_name:a?l.corporationName||"":e.companyName||"",has_steward:ae,has_partner:te,steward:a?!1:e.steward||!1,license_issue_date:F,...a?{}:{company_name:e.companyName||"",company_identifier:e.companyIdentifier||"",type_activity_name:e.typeActivity||""}};n.setValues({...n.values,...ne})},ku=(e,t,n,a,r)=>{n(),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),e(Ce()),a.verify_mobile&&r&&e(Cu({title:"ثبت کد احراز",content:u.jsx(yu,{item:r,updateTable:n})}))},ea=(e,t)=>{e({vertical:"top",horizontal:"center",msg:t,severity:"error"})},v=({icon:e,label:t,value:n,iconSx:a})=>u.jsxs(Ne,{display:"flex",alignItems:a?"flex-start":"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[u.jsx(e,{color:"action",sx:a}),u.jsxs(Ne,{children:[u.jsx(w,{variant:"caption",color:"text.secondary",children:t}),u.jsx(w,{variant:"body1",children:n||"-"})]})]}),ua=({formik:e,guild:t,hasInquiry:n,isAdmin:a,isSuperAdmin:r,isKillHouse:i})=>{const l=s=>s==="True"||s===!0?Re.MALE:s==="False"||s===!1?Re.FEMALE:"-",o=s=>s===K.YES||s===!0?K.YES:s===K.NO||s===!1?K.NO:"-",C=()=>e.values.birth_date||"-";return u.jsx(c,{item:!0,xs:12,lg:6,pl:{xs:0,md:2},pr:{xs:0,md:3},mb:2,children:u.jsxs(c,{container:!0,direction:"column",gap:E.SMALL,children:[u.jsx(c,{item:!0,xs:12,children:u.jsx(w,{variant:"h6",gutterBottom:!0,children:"اطلاعات شخصی"})}),u.jsxs(c,{container:!0,xs:12,children:[u.jsxs(c,{container:!0,xs:12,md:6,gap:E.TINY,px:E.TINY,children:[u.jsx(c,{item:!0,xs:12,children:t||a?u.jsx(b,{label:"کد ملی",variant:"outlined",fullWidth:!0,id:"national_id",name:"national_id",value:e.values.national_id,onChange:e.handleChange,onBlur:e.handleBlur,error:!!e.errors.national_id,helperText:e.errors.national_id,inputProps:{maxLength:10},disabled:!a||i}):u.jsx(v,{icon:de,label:"کد ملی",value:e.values.national_id})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(b,{label:"نام",variant:"outlined",fullWidth:!0,id:"first_name",name:"first_name",value:e.values.first_name,onChange:e.handleChange,onBlur:e.handleBlur}):u.jsx(v,{icon:le,label:"نام",value:e.values.first_name})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(b,{label:"نام خانوادگی",variant:"outlined",fullWidth:!0,id:"last_name",name:"last_name",value:e.values.last_name,onChange:e.handleChange,onBlur:e.handleBlur}):u.jsx(v,{icon:le,label:"نام خانوادگی",value:e.values.last_name})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(b,{label:"شماره شناسنامه",variant:"outlined",fullWidth:!0,id:"national_code",name:"national_code",value:e.values.national_code,onChange:e.handleChange,onBlur:e.handleBlur}):u.jsx(v,{icon:de,label:"شماره شناسنامه",value:e.values.national_code})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(k,{label:"در قید حیات",children:u.jsx(P,{fullWidth:!0,children:u.jsxs(Q,{row:!0,name:"is_alive",value:e.values.is_alive==="بلی"||e.values.is_alive===!0?"بلی":e.values.is_alive==="خیر"||e.values.is_alive===!1?"خیر":"",onChange:s=>{e.setFieldValue("is_alive",s.target.value==="بلی"?"بلی":"خیر")},sx:{justifyContent:"space-around"},children:[u.jsx(I,{value:"بلی",control:u.jsx(g,{}),label:"بلی"}),u.jsx(I,{value:"خیر",control:u.jsx(g,{}),label:"خیر"})]})})}):u.jsx(v,{icon:Ye,label:"در قید حیات",value:o(e.values.is_alive)})})]}),u.jsxs(c,{container:!0,xs:12,md:6,gap:E.TINY,px:E.TINY,mt:{xs:1,md:0},children:[u.jsx(c,{item:!0,xs:12,children:a?u.jsx(Pe,{label:"تاریخ تولد",value:e.values.birth_date?Z(Qe(e.values.birth_date)):null,onChange:s=>{if(s){const x=Z(s).format("YYYY-MM-DD"),d=Ke(x);e.setFieldValue("birth_date",d)}else e.setFieldValue("birth_date","")},renderInput:s=>u.jsx(b,{...s,fullWidth:!0,variant:"outlined"})}):u.jsx(v,{icon:pu,label:"تاریخ تولد",value:C()})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(b,{label:"نام پدر",variant:"outlined",fullWidth:!0,id:"father_name",name:"father_name",value:e.values.father_name,onChange:e.handleChange,onBlur:e.handleBlur}):u.jsx(v,{icon:le,label:"نام پدر",value:e.values.father_name})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(k,{label:"جنسیت",children:u.jsx(P,{fullWidth:!0,children:u.jsxs(Q,{row:!0,name:"gender",value:e.values.gender==="True"||e.values.gender===!0?"True":e.values.gender==="False"||e.values.gender===!1?"False":"",onChange:s=>{e.setFieldValue("gender",s.target.value)},sx:{justifyContent:"space-around"},children:[u.jsx(I,{value:"True",control:u.jsx(g,{}),label:"مرد"}),u.jsx(I,{value:"False",control:u.jsx(g,{}),label:"زن"})]})})}):u.jsx(v,{icon:ze,label:"جنسیت",value:l(e.values.gender)})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(b,{label:"شهر",variant:"outlined",fullWidth:!0,id:"person_city",name:"person_city",value:e.values.person_city,onChange:e.handleChange,onBlur:e.handleBlur}):u.jsx(v,{icon:Me,label:"شهر",value:e.values.person_city})}),u.jsx(c,{item:!0,xs:12,mt:{xs:1,md:0},children:!t&&n&&!a&&!r&&!i?u.jsx(v,{icon:ce,label:"شماره همراه",value:e.values.mobile}):i&&e.values.mobile&&/^[0-9]{11}$/.test(e.values.mobile)?u.jsx(v,{icon:ce,label:"شماره همراه",value:e.values.mobile}):u.jsx(b,{label:"شماره همراه",variant:"outlined",fullWidth:!0,id:"mobile",name:"mobile",value:e.values.mobile,onChange:e.handleChange,error:e.touched.mobile&&!!e.errors.mobile,helperText:e.touched.mobile&&e.errors.mobile,disabled:i&&e.values.mobile&&/^[0-9]{11}$/.test(e.values.mobile)})})]})]})]})})},aa=({formik:e,guild:t,guildActive:n,isAdmin:a,cities:r,typeActivities:i})=>{const l=s=>s===X.NO||s===!1?X.NO:s===X.YES||s===!0?X.YES:"-",o=()=>e.values.license_expire_date||"-",C=()=>(e.values.active!==null?e.values.active:(t==null?void 0:t.active)===!0||n===!0)===!0?"فعال":"غیر فعال";return u.jsx(c,{item:!0,xs:12,lg:6,pr:{xs:0,md:2},pl:{xs:0,md:3},children:u.jsxs(c,{container:!0,gap:E.TINY,direction:"column",children:[u.jsx(c,{item:!0,xs:12,children:u.jsx(w,{variant:"h6",gutterBottom:!0,children:"اطلاعات صنفی"})}),u.jsxs(c,{container:!0,xs:12,children:[u.jsxs(c,{container:!0,direction:"column",xs:12,md:6,px:E.TINY,gap:E.TINY,children:[u.jsx(c,{item:!0,xs:12,children:a?u.jsx(b,{label:"نام واحد",variant:"outlined",fullWidth:!0,id:"guild_name",name:"guild_name",value:e.values.guild_name,onChange:e.handleChange,onBlur:e.handleBlur}):u.jsx(v,{icon:Se,label:"نام واحد",value:e.values.guild_name})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsxs(P,{fullWidth:!0,children:[u.jsx(Fe,{id:"area-activity-select-label",children:"رسته واحد صنفی"}),u.jsxs(Ae,{labelId:"area-activity-select-label",id:"area_activity",name:"area_activity",value:e.values.area_activity||"",label:"رسته واحد صنفی",onChange:s=>{e.setFieldValue("area_activity",s.target.value)},onBlur:e.handleBlur,children:[i.map(s=>u.jsx(J,{value:s.title,children:s.title},s.key)),e.values.area_activity&&!i.some(s=>s.title===e.values.area_activity)&&u.jsx(J,{value:e.values.area_activity,children:e.values.area_activity},"current-value")]})]}):u.jsx(v,{icon:Se,label:"رسته واحد صنفی",value:e.values.area_activity})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(b,{label:"استان",variant:"outlined",fullWidth:!0,id:"state",name:"state",value:e.values.state,onChange:e.handleChange,onBlur:e.handleBlur}):u.jsx(v,{icon:Ie,label:"استان",value:e.values.state})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsxs(P,{fullWidth:!0,children:[u.jsx(Fe,{id:"city-select-label",children:"شهرستان"}),u.jsxs(Ae,{labelId:"city-select-label",id:"city",name:"city",value:e.values.city||"",label:"شهرستان",onChange:s=>{e.setFieldValue("city",s.target.value)},onBlur:e.handleBlur,children:[r.map(s=>u.jsx(J,{value:s.name,children:s.name},s.key)),e.values.city&&!r.some(s=>s.name===e.values.city)&&u.jsx(J,{value:e.values.city,children:e.values.city},"current-value")]})]}):u.jsx(v,{icon:Me,label:"شهرستان",value:e.values.city})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(Pe,{label:"تاریخ انقضا مجوز",value:e.values.license_expire_date?Z(Qe(e.values.license_expire_date)):null,onChange:s=>{if(s){const x=Z(s).format("YYYY-MM-DD"),d=Ke(x);e.setFieldValue("license_expire_date",d)}else e.setFieldValue("license_expire_date","")},renderInput:s=>u.jsx(b,{...s,fullWidth:!0,variant:"outlined"})}):u.jsx(v,{icon:we,label:"تاریخ انقضا مجوز",value:o()})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(b,{label:"شماره مجوز",variant:"outlined",fullWidth:!0,id:"license_number",name:"license_number",value:e.values.license_number,onChange:e.handleChange,onBlur:e.handleBlur}):u.jsx(v,{icon:Ge,label:"شماره مجوز",value:e.values.license_number})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(b,{label:"نام اتحادیه",variant:"outlined",fullWidth:!0,id:"union_name",name:"union_name",value:e.values.union_name,onChange:e.handleChange,onBlur:e.handleBlur}):u.jsx(v,{icon:Oe,label:"نام اتحادیه",value:e.values.union_name})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(k,{label:"وضعیت",children:u.jsx(P,{fullWidth:!0,children:u.jsxs(Q,{row:!0,name:"active",value:e.values.active===!0?"true":e.values.active===!1?"false":"",onChange:s=>{e.setFieldValue("active",s.target.value==="true")},sx:{justifyContent:"space-around"},children:[u.jsx(I,{value:"true",control:u.jsx(g,{}),label:"فعال"}),u.jsx(I,{value:"false",control:u.jsx(g,{}),label:"غیر فعال"})]})})}):u.jsx(v,{icon:De,label:"وضعیت",value:C()})})]}),u.jsxs(c,{container:!0,xs:12,md:6,px:E.TINY,direction:"column",gap:E.TINY,children:[u.jsx(c,{item:!0,xs:12,children:a?u.jsx(b,{label:"کد پستی",variant:"outlined",fullWidth:!0,id:"postal_code",name:"postal_code",value:e.values.postal_code,onChange:e.handleChange,onBlur:e.handleBlur}):u.jsx(v,{icon:We,label:"کد پستی",value:e.values.postal_code})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(b,{label:"شماره تلفن",variant:"outlined",fullWidth:!0,id:"phone_number",name:"phone_number",value:e.values.phone_number,onChange:e.handleChange,onBlur:e.handleBlur}):u.jsx(v,{icon:ce,label:"شماره تلفن",value:e.values.phone_number})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(k,{label:"آیا اتباع است؟",children:u.jsx(P,{fullWidth:!0,children:u.jsxs(Q,{row:!0,name:"is_foreigner",value:e.values.is_foreigner==="بلی"||e.values.is_foreigner===!0?"بلی":e.values.is_foreigner==="خیر"||e.values.is_foreigner===!1?"خیر":"",onChange:s=>{e.setFieldValue("is_foreigner",s.target.value==="بلی"?"بلی":"خیر")},sx:{justifyContent:"space-around"},children:[u.jsx(I,{value:"بلی",control:u.jsx(g,{}),label:"بلی"}),u.jsx(I,{value:"خیر",control:u.jsx(g,{}),label:"خیر"})]})})}):u.jsx(v,{icon:Ie,label:"آیا اتباع است؟",value:l(e.values.is_foreigner)})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(b,{label:"نام شرکت",variant:"outlined",fullWidth:!0,id:"corporation_name",name:"corporation_name",value:e.values.corporation_name,onChange:e.handleChange,onBlur:e.handleBlur}):u.jsx(v,{icon:vu,label:"نام شرکت",value:e.values.corporation_name})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(b,{label:"شناسه ملی شرکت",variant:"outlined",fullWidth:!0,id:"guild_national_id",name:"guild_national_id",value:e.values.guild_national_id,onChange:e.handleChange,onBlur:e.handleBlur}):u.jsx(v,{icon:de,label:"شناسه ملی شرکت",value:e.values.guild_national_id})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(b,{label:"وضعیت مجوز",variant:"outlined",fullWidth:!0,id:"license_status",name:"license_status",value:e.values.license_status,onChange:e.handleChange,onBlur:e.handleBlur}):u.jsx(v,{icon:De,label:"وضعیت مجوز",value:e.values.license_status})}),u.jsx(c,{item:!0,xs:12,children:a?u.jsx(b,{label:"آدرس",variant:"outlined",fullWidth:!0,multiline:!0,rows:3,id:"address",name:"address",value:e.values.address,onChange:e.handleChange,onBlur:e.handleBlur}):u.jsx(v,{icon:_u,label:"آدرس",value:e.values.address,iconSx:{mt:.5}})})]})]})]})})},ta=({inquiryNationalCode:e,setInquiryNationalCode:t,onInquiry:n,isAdmin:a})=>u.jsxs(u.Fragment,{children:[u.jsx(b,{label:"کد ملی برای استعلام",variant:"outlined",fullWidth:!0,value:e,onChange:r=>t(r.target.value),placeholder:a?"کد ملی را وارد کنید":"کد ملی 10 رقمی را وارد کنید",inputProps:a?{}:{maxLength:10}}),u.jsx(R,{color:"primary",fullWidth:!0,variant:"contained",onClick:n,disabled:!a&&e.length!==10,children:"استعلام"})]}),na=({onUpdate:e,disabled:t})=>u.jsx(c,{container:!0,xs:12,justifyContent:"flex-end",children:u.jsxs(R,{onClick:e,disabled:t,color:"primary",size:"small",children:["بروزرسانی از سامانه واحد ",u.jsx(nu,{})]})}),ra=({isAccepted:e,onAccept:t,onReject:n})=>u.jsx(c,{item:!0,xs:12,pb:2,mt:2,children:u.jsx(mu,{title:"تعهد نامه",content:u.jsxs(u.Fragment,{children:[u.jsxs(ru,{children:[u.jsx(su,{children:u.jsx(xu,{})}),u.jsx(lu,{primary:"لطفا صحت اطلاعات وارد شده را بررسی نمایید. پس از تکمیل و ثبت درخواست، یک کد احراز هویت از طریق پیامک برای صنف یا مباشر به شماره تلفن اعلامی ارسال میگردد."})]}),u.jsx(w,{})]}),actions:u.jsxs(c,{container:!0,gap:E.TINY,children:[u.jsx(R,{variant:"outlined",color:"error",onClick:n,children:"رد"}),u.jsx(R,{variant:"contained",color:"success",onClick:t,children:"موافقم"})]}),btnTitle:"تایید صحت اطلاعات",isAccepted:e})}),sa=({formik:e,onClose:t,showCloseButton:n,isKillHouse:a})=>{if(n)return u.jsx(c,{item:!0,xs:12,mt:4,children:u.jsx(R,{color:"primary",fullWidth:!0,variant:"contained",onClick:t,children:"متوجه شدم"})});const r=a?e.values.area_activity&&e.values.area_activity.includes("مرغ"):!0;return u.jsxs(u.Fragment,{children:[u.jsx(c,{item:!0,xs:12,children:u.jsxs(c,{container:!0,direction:"row",spacing:2,children:[u.jsx(c,{item:!0,children:u.jsx(I,{control:u.jsx(Ee,{checked:e.values.steward,onChange:e.handleChange,name:"steward",color:"primary"}),label:"مباشر"})}),u.jsx(c,{item:!0,children:u.jsx(I,{control:u.jsx(Ee,{checked:e.values.verify_mobile,onChange:e.handleChange,name:"verify_mobile",color:"primary"}),label:"احراز شماره موبایل"})})]})}),u.jsxs(c,{item:!0,xs:12,children:[u.jsx(R,{disabled:e.errors.isAccepted||!!e.errors.national_id||!r,color:"primary",fullWidth:!0,variant:"contained",type:"submit",children:"ثبت"}),a&&!r&&u.jsx(w,{variant:"caption",color:"error",sx:{mt:1,display:"block"},children:'رسته واحد صنفی باید شامل کلمه "مرغ" باشد'})]})]})},ya=({guild:e,updateTable:t})=>{var ye;const n=Le(),[a]=y.useContext(Be),[r,i]=y.useState(),[l,o]=y.useState(""),[C,s]=y.useState(!1),[x,d]=y.useState(null),[j,F]=y.useState(null),[B,T]=y.useState(null),[$,ae]=y.useState([]),[te,ne]=y.useState([]),Ze=(e==null?void 0:e.phoneNumber)||null,re=q(),A=re==="AdminX",se=re==="SuperAdmin",W=re==="KillHouse",p=Te({initialValues:Ku(e),validationSchema:Xu(!!e),validateOnMount:!0,onSubmit:h=>{const D=Qu(h,e,Ze,j);n(Ou(D)).then(V=>{V.payload.error?ea(a,V.payload.error):ku(n,a,t,h,V.payload.data)})}});y.useEffect(()=>{n(fu()).then(h=>{var V,fe;const D=(fe=(V=h.payload.data)==null?void 0:V[0])==null?void 0:fe.active;i(D),D===!1&&p.setFieldValue("isAccepted",!0)}),n(ou()).then(h=>{ae(h.payload.data||[])}),n(cu()),n(du()).then(h=>{ne(h.payload.data||[])})},[]),y.useEffect(()=>{p.validateForm()},[]);const H=y.useCallback(h=>{Zu(h,l,p),h.dbRegister===!1?(d(!1),F(null)):(F(h.hasInquiry??null),T(h.active??null),p.setFieldValue("active",h.active??null),d(!0)),setTimeout(()=>{p.validateField("mobile"),p.validateField("national_id")},0)},[p,l]),ke=y.useCallback(()=>{if(!l){a({vertical:"top",horizontal:"center",msg:"لطفا کد ملی را وارد کنید",severity:"error"});return}if(!A&&l.length!==10){a({vertical:"top",horizontal:"center",msg:"لطفا کد ملی 10 رقمی معتبر وارد کنید",severity:"error"});return}n(ge({national_code:l,update:!1})).then(h=>{if(!(h.payload.error&&(F(!1),A&&(s(!0),p.setFieldValue("national_id",l)),a({vertical:"top",horizontal:"center",msg:h.payload.error,severity:"error"}),!A)))if(h.payload.data){H(h.payload.data),s(!0),h.payload.data.dbRegister===!1&&F(!0);const D=h.payload.data.dbRegister===!1?"اطلاعات از سامانه خارجی دریافت شد":"اطلاعات از پایگاه داده دریافت شد";a({vertical:"top",horizontal:"center",msg:D,severity:"success"})}else F(!1),s(!0),A&&p.setFieldValue("national_id",l)})},[n,l,a,H,A,p]),eu=y.useCallback(()=>{if(!p.values.national_id||p.values.national_id.length!==10){a({vertical:"top",horizontal:"center",msg:"لطفا کد ملی 10 رقمی معتبر وارد کنید",severity:"error"});return}n(ge({national_code:p.values.national_id,update:!0})).then(h=>{if(h.payload.error){F(!1),a({vertical:"top",horizontal:"center",msg:h.payload.error,severity:"error"});return}if(h.payload.data){const D={...h.payload.data,dbRegister:!1};H(D),F(!0),a({vertical:"top",horizontal:"center",msg:"اطلاعات از سامانه خارجی بروزرسانی شد",severity:"success"})}else F(!1)})},[n,p.values.national_id,a,H]),uu=((ye=p==null?void 0:p.values)==null?void 0:ye.national_id)&&(A||x!==!1&&(e||!e&&(x===!0&&j===!1||A&&C))),au=!e&&!C,tu=e||C;return u.jsx("form",{onSubmit:p.handleSubmit,children:u.jsxs(c,{container:!0,gap:E.TINY,maxHeight:"80vh",minWidth:!e&&!C?"auto":{xs:"96vw",md:"90vw",nlg:"1280px"},overflow:"auto",p:2,children:[uu&&u.jsx(na,{onUpdate:eu,disabled:!!p.errors.national_id}),au&&u.jsx(ta,{inquiryNationalCode:l,setInquiryNationalCode:o,onInquiry:ke,isAdmin:A}),tu&&u.jsxs(c,{container:!0,xs:12,children:[u.jsx(ua,{formik:p,guild:e,hasInquiry:j,isAdmin:A,isSuperAdmin:se,isKillHouse:W}),u.jsx(aa,{formik:p,guild:e,guildActive:B,isAdmin:A,cities:$,typeActivities:te,isKillHouse:W}),r&&(!(!e&&j===!0)||A||se||W)&&u.jsx(ra,{isAccepted:p.values.isAccepted,onAccept:()=>p.setFieldValue("isAccepted",!0),onReject:()=>p.setFieldValue("isAccepted",!1)}),u.jsx(sa,{formik:p,onClose:()=>n(Ce()),showCloseButton:!e&&j===!0&&!A&&!se&&!W,isKillHouse:W})]})]})})};export{ya as C,yu as P,ze as a,we as b,bu as c,Ye as d,Ge as e,Oe as f,We as g,ja as p}; diff --git a/build/assets/CustomCard-B-6dDbAN.js b/build/assets/CustomCard-B-6dDbAN.js new file mode 100644 index 0000000..d515ce7 --- /dev/null +++ b/build/assets/CustomCard-B-6dDbAN.js @@ -0,0 +1 @@ +import{j as e,aJ as a,T as t}from"./mui-vendor-CkIVaoQP.js";import"./react-vendor-CmFgShSM.js";function g(r){const{title:o,value:i,imageUrl:n}=r;return e.jsxs(a,{style:{backgroundImage:`linear-gradient(to bottom right, #0000ff, #00ffff), url(${n})`,backgroundSize:"cover",color:"#FFFFFF",position:"relative",paddingTop:10,paddingBottom:10,paddingLeft:10,paddingRight:10},children:[e.jsx(t,{variant:"h5",textAlign:"center",fontWeight:"bold",component:"h2",sx:{fontSize:{xs:"1rem",lg:"1.5rem"},fontWeight:"bold",color:"white",textAlign:"center",textTransform:"uppercase"},children:o}),e.jsx(t,{color:"white",textAlign:"center",style:{border:"1px dashed #ddd",marginTop:"10px",padding:"4px",borderRadius:"4px"},sx:{fontSize:{xs:"0.8rem",lg:"1rem"}},children:i})]})}export{g as C}; diff --git a/build/assets/DashboardPage-CBj16f8q.js b/build/assets/DashboardPage-CBj16f8q.js new file mode 100644 index 0000000..8892456 --- /dev/null +++ b/build/assets/DashboardPage-CBj16f8q.js @@ -0,0 +1,9 @@ +import{j as u,b as C,T as i,i as o0,ar as wu,e as x0,A as s0,d as tu,B as au,ba as p0,ce as y0,cf as f0,cg as F0,bd as j0,aJ as m0,ch as v0,b1 as D0,aX as w0,ak as lu,a3 as $,bt as _u,b2 as E0,b3 as ju}from"./mui-vendor-CkIVaoQP.js";import{G as s,S as W,p as Du,r as t0,L as uu,j as ru,h as eu,X as Eu,hA as b0,m as k0,A as Fu,v as X,W as iu,hB as I0,hC as L0,hD as R0,hE as W0}from"./index-CeyyVc1v.js";import{r as E,u as B0,f as H0}from"./react-vendor-CmFgShSM.js";import{a as su,u as cu,f as M0}from"./redux-vendor-B7uoacJt.js";import{M as Ru,L as a0,N as Q0,C as c0,F as d0,d as C0,e as g0,G as K0,a as Y0,b as O0,c as z0,P as G0,J as ku}from"./chart-vendor-sE2SUVPW.js";import{p as h0}from"./chartjs-plugin-datalabels.esm-DvNX1Acq.js";import{R as bu}from"./ResponsiveTable-w7hk7Uq8.js";import{a as Mu,R as P0}from"./index.esm-Bu7XMDZU.js";import{a as U0}from"./province-get-dispenser-killhouses-BecKvYyt.js";import{d as q0}from"./ToggleOffOutlined-Ch26Umk7.js";import{d as T0}from"./ToggleOn-pBgb8alR.js";import{I as A0}from"./index.esm-C4MeAo59.js";import{S as u0}from"./SimpleTable-DBAoNnCU.js";import{A as e0}from"./AdvancedChart-DTCDh5lM.js";import{d as r0}from"./Info-CZK82--l.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./iconBase-BEJYyZsk.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const fu=({title:r,value:o,unit:A="",color:h="text",small:y=!1,rightAlign:n=!1,colon:j=!1,bgGreen:d=!1,bgPurple:F=!1})=>{var H;let w="background.paper",B=`${h}.main`;return d?(w="rgba(0,128,0,0.1)",B="success.main"):F&&(w="#9370db",B="primary.main"),u.jsx(s,{item:!0,xs:12,sx:{mb:1},children:u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",py:.5,px:1,borderRadius:1,backgroundColor:w,color:B,direction:n?"rtl":"ltr",fontWeight:d?"bold":"normal",height:"48px"},children:[u.jsx(i,{variant:y?"caption":"body1",color:B,children:j?`${r} :`:r}),u.jsxs(i,{variant:y?"caption":"body1",fontWeight:"bold",color:B,children:[((H=o==null?void 0:o.toLocaleString)==null?void 0:H.call(o))||o," ",A]})]})})},N0=({boxStats:r})=>{var y,n,j,d,F,w,B,H,v,I,M,K,m,L,G,g,p,P,U;const o=(((y=r==null?void 0:r.yesterdayKilling)==null?void 0:y.quantityKillHouseFreeBarCarcass)||0)+(((n=r==null?void 0:r.yesterdayKilling)==null?void 0:n.weightKillHouseFreeBarCarcass)||0)+(((j=r==null?void 0:r.yesterdayKilling)==null?void 0:j.provinceKillRequestQuantity)||0)+(((d=r==null?void 0:r.yesterdayKilling)==null?void 0:d.provinceKillRequestWeight)||0)+(((F=r==null?void 0:r.yesterdayKilling)==null?void 0:F.quantityKillHouseFreeBarLive)||0)+(((w=r==null?void 0:r.yesterdayKilling)==null?void 0:w.weightOfCarcass)||0)+(((B=r==null?void 0:r.yesterdayKilling)==null?void 0:B.losses)||0),A={labels:["حجم خرید خارج استان","وزن خرید خارج استان","حجم کشتار داخل استان","وزن کشتار داخل استان","حجم فروش به خارج استان (زنده)","وزن لاشه تولیدی","درصد افت دیروز"],datasets:[{data:[((H=r==null?void 0:r.yesterdayKilling)==null?void 0:H.quantityKillHouseFreeBarCarcass)||0,((v=r==null?void 0:r.yesterdayKilling)==null?void 0:v.weightKillHouseFreeBarCarcass)||0,((I=r==null?void 0:r.yesterdayKilling)==null?void 0:I.provinceKillRequestQuantity)||0,((M=r==null?void 0:r.yesterdayKilling)==null?void 0:M.provinceKillRequestWeight)||0,((K=r==null?void 0:r.yesterdayKilling)==null?void 0:K.outQuantity)||0,((m=r==null?void 0:r.yesterdayKilling)==null?void 0:m.weightOfCarcass)||0,((L=r==null?void 0:r.yesterdayKilling)==null?void 0:L.losses)||0],backgroundColor:["#FF6384","#36A2EB","#FFCE56","#4BC0C0","#9966FF","#FF9F40","#C9CBCF"],hoverBackgroundColor:["#FF6384","#36A2EB","#FFCE56","#4BC0C0","#9966FF","#FF9F40","#C9CBCF"],borderWidth:1}]},h={responsive:!0,maintainAspectRatio:!1,plugins:{datalabels:{display:!1},tooltip:{enabled:!0,callbacks:{label:Y=>{const O=Y.raw,z=Y.dataset.data.reduce((e,l)=>e+l,0);if(z===0)return"0";const q=(O/z*100).toFixed(2);return`${O.toLocaleString()} (${q}%)`}}},legend:{display:!1}}};return u.jsxs(C,{sx:{flex:"1 1 20%",minWidth:"300px",maxWidth:"100%",borderRadius:2,border:"1px solid",borderColor:"divider",p:W.MEDIUM,boxSizing:"border-box",display:"flex",flexDirection:"column",justifyContent:"flex-start"},children:[u.jsx(i,{textAlign:"start",variant:"h6",color:"primary.main",sx:{mb:2},children:"آمار روز گذشته کشتار مرغ گوشتی استان"}),u.jsx(C,{sx:{height:"240px",width:"100%",mb:2},children:o>0?u.jsx(Ru,{data:A,options:h,style:{height:"100%",width:"100%"}}):u.jsx(C,{sx:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",fontSize:"0.9rem",color:"text.primary",textAlign:"center"},children:"داده‌ای برای نمایش چارت موجود نیست."})}),u.jsxs(s,{container:!0,spacing:1,sx:{fontSize:"1.5rem",position:"relative"},children:[u.jsx(C,{sx:{position:"absolute",left:"50%",top:0,bottom:0,width:"1px",backgroundColor:"divider",zIndex:1}}),u.jsx(s,{item:!0,xs:6,children:u.jsx(fu,{title:"وزن خرید خارج استان",value:((G=r==null?void 0:r.yesterdayKilling)==null?void 0:G.weightKillHouseFreeBarLive)||0,unit:"کیلو گرم",color:"primary",small:!0})}),u.jsx(s,{item:!0,xs:6,children:u.jsx(fu,{title:"وزن کشتار داخل استان",value:((g=r==null?void 0:r.yesterdayKilling)==null?void 0:g.provinceKillRequestWeight)||0,unit:"کیلو گرم",color:"primary",small:!0})}),u.jsx(s,{item:!0,xs:6,children:u.jsx(fu,{title:"حجم فروش به خارج استان (زنده)",value:((p=r==null?void 0:r.yesterdayKilling)==null?void 0:p.quantityKillHouseFreeBarLive)||0,color:"primary",small:!0})}),u.jsx(s,{item:!0,xs:6,children:u.jsx(fu,{title:"وزن لاشه تولیدی",value:((P=r==null?void 0:r.yesterdayKilling)==null?void 0:P.weightOfCarcass)||0,unit:"کیلو گرم",color:"primary",small:!0})}),u.jsx(s,{item:!0,xs:6,children:u.jsx(fu,{title:"درصد افت دیروز",value:(U=r==null?void 0:r.yesterdayKilling)!=null&&U.losses?`${r.yesterdayKilling.losses}%`:"0%",color:"primary",small:!0})})]})]})},V0=({boxStats:r})=>{var o,A,h,y,n,j,d,F;return u.jsxs(C,{sx:{flex:"1 1 30%",minWidth:{xs:"100%",sm:"340px"},maxWidth:{xs:"100%",md:"16%"},borderRadius:2,border:"1px solid",borderColor:"divider",p:W.MEDIUM,pt:4,display:"flex",flexDirection:"column",boxSizing:"border-box",backgroundColor:"rgba(0, 128, 0, 0.05)",textAlign:"left"},children:[u.jsx(i,{variant:"h6",color:"primary.main",sx:{mb:2,fontSize:{xs:"1rem",lg:"1rem"}},children:"موجودی"}),u.jsx(i,{variant:"body2",mt:3,bgGreen:!0,children:"حجم آماده کشتار بزرگتر از 40 روز (قطعه) :"}),u.jsx(i,{variant:"h6",mt:2,color:"success.main",children:((A=(o=r==null?void 0:r.inventory)==null?void 0:o.leftOverBetweenFortySeventyFive)==null?void 0:A.toLocaleString())||0}),u.jsx(i,{variant:"body2",mt:3,bgGreen:!0,children:"وزن تقریبی کشتار بزرگتر از 40 روز (کیلوگرم) :"}),u.jsx(i,{variant:"h6",mt:2,color:"success.main",children:((y=(h=r==null?void 0:r.inventory)==null?void 0:h.weightBetweenFortySeventyFive)==null?void 0:y.toLocaleString())||0}),u.jsx(i,{variant:"body2",mt:3,bgGreen:!0,children:"میانگین وزن مرغداری‌های آماده کشتار:"}),u.jsxs(i,{variant:"h6",mt:2,color:"success.main",children:[((j=(n=r==null?void 0:r.inventory)==null?void 0:n.aveWeight)==null?void 0:j.toLocaleString())||0," کیلوگرم"]}),u.jsx(i,{variant:"body2",mt:3,bgGreen:!0,children:"وزن گوشت قابل تولید:"}),u.jsxs(i,{variant:"h6",mt:2,color:"success.main",children:[((F=(d=r==null?void 0:r.inventory)==null?void 0:d.carcassWeight)==null?void 0:F.toLocaleString())||0," کیلوگرم"]})]})},J0=({boxStats:r})=>{var o,A,h,y,n,j,d,F;return u.jsxs(C,{sx:{flex:{xs:"1 1 100%",md:"1 1 30%"},minWidth:{xs:"100%",sm:"340px"},borderRadius:2,border:"1px solid",borderColor:"divider",p:"16px",boxSizing:"border-box",display:"flex",flexDirection:"column",gap:2},children:[u.jsx(i,{variant:"h6",color:"primary.main",sx:{fontSize:{xs:"1rem",lg:"1rem"}},textAlign:"left",children:"اطلاعات انبار و توزیع امروز"}),u.jsxs(C,{sx:{display:"flex",flexDirection:"column",gap:1,overflowY:"auto",flex:1,pr:1},children:[u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"}},children:"وزن ورودی به انبار:"}),u.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((A=(o=r==null?void 0:r.warehouseInformation)==null?void 0:o.enterWarehouseWeight)==null?void 0:A.toLocaleString())||0}),u.jsx(i,{variant:"caption",children:"کیلوگرم"})]})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"}},children:"وزن فروش به خارج استان:"}),u.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((y=(h=r==null?void 0:r.warehouseInformation)==null?void 0:h.outSellWeight)==null?void 0:y.toLocaleString())||0}),u.jsx(i,{variant:"caption",children:"کیلوگرم"})]})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"}},children:"وزن توزیع به داخل استان:"}),u.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((j=(n=r==null?void 0:r.warehouseInformation)==null?void 0:n.allocationWeight)==null?void 0:j.toLocaleString())||0}),u.jsx(i,{variant:"caption",children:"کیلوگرم"})]})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"}},children:"وزن مانده در انبار کشتارگاه:"}),u.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((F=(d=r==null?void 0:r.warehouseInformation)==null?void 0:d.leftOverWarehouseWeight)==null?void 0:F.toLocaleString())||0}),u.jsx(i,{variant:"caption",children:"کیلوگرم"})]})]})]})]})},Z0=({boxStats:r})=>{var o;return u.jsxs(s,{container:!0,spacing:2,sx:{width:"100%",borderRadius:"16px",border:"1px solid",borderColor:"divider",p:2,mt:3},children:[u.jsx(i,{sx:{width:"100%",textAlign:"start",fontWeight:"400",mb:1},color:"primary.main",children:"نمودار قیمت مرغ در هفته گذشته (میانگین قیمت)"}),u.jsx(C,{sx:{height:"400px",width:"100%"},children:((o=r==null?void 0:r.chickenPrice)==null?void 0:o.length)>0?u.jsx(a0,{data:{labels:r.chickenPrice.map(A=>Du(A.date)),datasets:[{label:"میانگین قیمت مرغ (ریال)",data:r.chickenPrice.map(A=>A.chickenAveragePrice),fill:{target:"origin",above:"rgba(75, 192, 192, 0.2)",below:"rgba(75, 192, 192, 0.2)"},backgroundColor:"rgba(75, 192, 192, 0.2)",borderColor:"rgba(75, 192, 192, 1)",borderWidth:4,tension:.4,pointRadius:5,pointHoverRadius:7,pointBackgroundColor:"rgba(75, 192, 192, 1)",pointBorderColor:"#fff",pointBorderWidth:2}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"top",rtl:!0,labels:{font:{family:"iranyekan",size:12},padding:20,usePointStyle:!0}},tooltip:{callbacks:{label:A=>`${A.dataset.label}: ${A.parsed.y.toLocaleString()} ریال`},displayColors:!1,backgroundColor:"rgba(0, 0, 0, 0.7)",titleFont:{size:14,family:"iranyekan"},bodyFont:{size:12,family:"iranyekan"}}},scales:{x:{grid:{display:!1,drawBorder:!1},ticks:{color:"#6B7280",font:{family:"iranyekan"}}},y:{beginAtZero:!1,grid:{display:!1,drawBorder:!1},ticks:{color:"#6B7280",font:{family:"iranyekan"},callback:function(A){return A.toLocaleString()+" ریال"}}}},elements:{line:{tension:.4},point:{radius:5,hoverRadius:7}}}}):u.jsx(i,{sx:{textAlign:"center",py:4},children:"داده‌ای برای نمایش موجود نیست"})})]})};var Qu={},X0=o0;Object.defineProperty(Qu,"__esModule",{value:!0});var Wu=Qu.default=void 0,S0=X0(t0()),$0=u;Wu=Qu.default=(0,S0.default)((0,$0.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-7 9h-2V5h2zm0 4h-2v-2h2z"}),"Announcement");var Ku={},_0=o0;Object.defineProperty(Ku,"__esModule",{value:!0});var Bu=Ku.default=void 0,u6=_0(t0()),e6=u;Bu=Ku.default=(0,u6.default)((0,e6.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 16.5c-.83 0-1.5-.67-1.5-1.5h3c0 .83-.67 1.5-1.5 1.5m5-2.5H7v-1l1-1v-2.61C8 9.27 9.03 7.47 11 7v-.5c0-.57.43-1 1-1s1 .43 1 1V7c1.97.47 3 2.28 3 4.39V14l1 1z"}),"CircleNotifications");const r6=({boxStats:r})=>{var o,A,h,y,n,j,d,F,w,B,H,v,I,M,K,m,L,G,g,p,P,U,Y,O,z,q,e,l;return u.jsxs(C,{sx:{flex:"1 1 20%",minWidth:{md:"500px"},maxWidth:{md:"25%"},borderRadius:2,border:"1px solid",borderColor:"divider",p:W.SMALL,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:2,height:"700px"},children:[u.jsx(i,{textAlign:"start",variant:"h6",color:"primary.main",children:"گزارش کشتار دیروز مرغ گوشتی استان"}),u.jsxs(C,{sx:{display:"flex",flexDirection:"column",gap:1,overflowY:"auto",flex:1},children:[u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"حجم درخواست کشتار مرغدار:"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((A=(o=r==null?void 0:r.killingYesterday)==null?void 0:o.quantityYesterday)==null?void 0:A.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"وزن درخواست کشتار مرغدار:"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((y=(h=r==null?void 0:r.killingYesterday)==null?void 0:h.totalWeightYesterday)==null?void 0:y.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"حجم خرید های مستقیم :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((j=(n=r==null?void 0:r.killingYesterday)==null?void 0:n.killRequestQuantityYesterday)==null?void 0:j.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"وزن خرید های مستقیم :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((F=(d=r==null?void 0:r.killingYesterday)==null?void 0:d.killRequestWeightYesterday)==null?void 0:F.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"حجم خرید های خارج از استان (زنده) :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((B=(w=r==null?void 0:r.killingYesterday)==null?void 0:w.quantityKillHouseFreeBarLiveYesterday)==null?void 0:B.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"وزن خرید های خارج از استان (زنده) :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((v=(H=r==null?void 0:r.killingYesterday)==null?void 0:H.WeightKillHouseFreeBarLiveYesterday)==null?void 0:v.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"وزن خرید های خارج از استان (لاشه) :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((M=(I=r==null?void 0:r.killingYesterday)==null?void 0:I.WeightKillHouseFreeBarCarcassYesterday)==null?void 0:M.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"حجم کل تخصیصات (خرید مستقیم/ مرغدار ):"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((m=(K=r==null?void 0:r.killingYesterday)==null?void 0:K.provinceKillRequestQuantityYesterday)==null?void 0:m.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"وزن کل تخصیصات (خرید مستقیم/ مرغدار ):"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((G=(L=r==null?void 0:r.killingYesterday)==null?void 0:L.provinceKillRequestWeightCarcassYesterday)==null?void 0:G.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"حجم فروش به خارج استان:"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((p=(g=r==null?void 0:r.killingYesterday)==null?void 0:g.poultryOutProvinceQuantityYesterday)==null?void 0:p.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"وزن فروش به خارج استان:"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((U=(P=r==null?void 0:r.killingYesterday)==null?void 0:P.poultryOutProvinceWeightYesterday)==null?void 0:U.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"حجم بارها:"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((O=(Y=r==null?void 0:r.killingYesterday)==null?void 0:Y.KillHouseRequestQuantityYesterday)==null?void 0:O.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"وزن بارها:"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((q=(z=r==null?void 0:r.killingYesterday)==null?void 0:z.KillHouseRequestWeightYesterday)==null?void 0:q.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"لاشه تولیدی با احتساب 25درصد افت کشتار :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((l=(e=r==null?void 0:r.killingYesterday)==null?void 0:e.totalLossWeightYesterday)==null?void 0:l.toLocaleString())||0})]})]})]})},n6=({boxStats:r})=>{var j,d,F,w;const o=E.useRef(null),[A,h]=E.useState([]);E.useEffect(()=>{if(!o.current)return;const H=o.current.ctx,v=[],I=[["#FF6384","#FF9FA8"],["#36A2EB","#7BC1FF"],["#FFCE56","#FFE39F"],["#4BC0C0","#8CDFDF"]];for(let M=0;M<4;M++){const K=H.createLinearGradient(0,0,0,300);K.addColorStop(0,I[M][0]),K.addColorStop(1,I[M][1]),v.push(K)}h(v)},[]);const y={labels:["مانده انبار گوشت","مانده انبار سردخانه","کل وزن فروش به خارج استان","کل وزن توزیع داخل استان"],datasets:[{label:"وزن (کیلوگرم)",data:[((j=r==null?void 0:r.warehouseKillHouse)==null?void 0:j.remainingChickenStock)||0,((d=r==null?void 0:r.warehouseKillHouse)==null?void 0:d.remainingFreezingWeight)||0,((F=r==null?void 0:r.warehouseKillHouse)==null?void 0:F.outProvinceAllocatedWeight)||0,((w=r==null?void 0:r.warehouseKillHouse)==null?void 0:w.allocationWeight)||0],backgroundColor:A.length?A:["rgba(255, 99, 132, 0.7)","rgba(54, 162, 235, 0.7)","rgba(255, 206, 86, 0.7)","rgba(75, 192, 192, 0.7)"],borderRadius:12,borderSkipped:!1}]},n={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:B=>`${B.raw.toLocaleString()} کیلوگرم`}},datalabels:{display:!1}},scales:{y:{beginAtZero:!0,ticks:{display:!1},grid:{display:!1}},x:{grid:{display:!1}}}};return u.jsxs(C,{sx:{flex:{xs:"1 1 100%",md:"1 1 25%"},minWidth:{xs:"100%",sm:300},borderRadius:2,border:"1px solid",borderColor:"divider",justifyContent:"center",p:W.MEDIUM,display:"flex",flexDirection:"column",boxSizing:"border-box",overflow:"hidden"},children:[u.jsx(i,{variant:"h6",color:"primary.main",sx:{mb:2},textAlign:"left",children:"گزارش انبار کشتارگاه"}),u.jsx(C,{sx:{height:300,width:"100%",mb:2,position:"relative",display:"flex",justifyContent:"center",alignItems:"center"},children:u.jsx(Q0,{ref:o,data:y,options:n,style:{height:"100%",width:"100%"}})})]})},l6=({boxStats:r})=>{var o,A,h,y,n,j,d,F,w,B,H,v,I,M,K,m,L,G,g,p,P,U,Y,O,z,q,e,l;return u.jsxs(C,{sx:{flex:"1 1 30%",minWidth:{md:"620px"},maxWidth:{md:"32%"},borderRadius:2,border:"1px solid",borderColor:"divider",p:W.SMALL,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:2,height:"600px"},children:[u.jsx(i,{textAlign:"start",variant:"h6",sx:{fontSize:{xs:"1rem",lg:"1rem"}},color:"primary.main",children:"گزارش کشتار امروز مرغ گوشتی استان"}),u.jsxs(C,{sx:{display:"flex",flexDirection:"column",gap:1,overflowY:"auto",flex:1},children:[u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:{xs:"inherit",md:48},px:2,py:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"},textAlign:"left"},children:"حجم درخواست کشتار مرغدار:"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",sx:{fontSize:{xs:"0.825rem",sm:"1rem"}},children:((A=(o=r==null?void 0:r.killing)==null?void 0:o.quantity)==null?void 0:A.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:{xs:"inherit",md:48},px:2,py:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"},textAlign:"left"},children:"وزن درخواست کشتار مرغدار:"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",sx:{fontSize:{xs:"0.825rem",sm:"1rem"}},children:((y=(h=r==null?void 0:r.killing)==null?void 0:h.totalWeight)==null?void 0:y.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:{xs:"inherit",md:48},px:2,py:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"},textAlign:"left"},children:"حجم خرید های مستقیم :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",sx:{fontSize:{xs:"0.825rem",sm:"1rem"}},children:((j=(n=r==null?void 0:r.killing)==null?void 0:n.killRequestQuantity)==null?void 0:j.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:{xs:"inherit",md:48},px:2,py:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"},textAlign:"left"},children:"وزن خرید های مستقیم :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",sx:{fontSize:{xs:"0.825rem",sm:"1rem"}},children:((F=(d=r==null?void 0:r.killing)==null?void 0:d.killRequestWeight)==null?void 0:F.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:{xs:"inherit",md:48},px:2,py:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"},textAlign:"left"},children:"حجم خرید های خارج از استان (زنده) :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",sx:{fontSize:{xs:"0.825rem",sm:"1rem"}},children:((B=(w=r==null?void 0:r.killing)==null?void 0:w.quantityKillHouseFreeBarLive)==null?void 0:B.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:{xs:"inherit",md:48},px:2,py:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"},textAlign:"left"},children:"وزن خرید های خارج از استان (زنده) :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",sx:{fontSize:{xs:"0.825rem",sm:"1rem"}},children:((v=(H=r==null?void 0:r.killing)==null?void 0:H.WeightKillHouseFreeBarLive)==null?void 0:v.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:{xs:"inherit",md:48},px:2,py:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"},textAlign:"left"},children:"وزن خرید های خارج از استان (لاشه) :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",sx:{fontSize:{xs:"0.825rem",sm:"1rem"}},children:((M=(I=r==null?void 0:r.killing)==null?void 0:I.WeightKillHouseFreeBarCarcass)==null?void 0:M.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:{xs:"inherit",md:48},px:2,py:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"},textAlign:"left"},children:"حجم کل تخصیصات (خرید مستقیم/ مرغدار ):"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",sx:{fontSize:{xs:"0.825rem",sm:"1rem"}},children:((m=(K=r==null?void 0:r.killing)==null?void 0:K.provinceKillRequestQuantity)==null?void 0:m.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:{xs:"inherit",md:48},px:2,py:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"},textAlign:"left"},children:"وزن کل تخصیصات (خرید مستقیم/ مرغدار ):"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",sx:{fontSize:{xs:"0.825rem",sm:"1rem"}},children:((G=(L=r==null?void 0:r.killing)==null?void 0:L.provinceKillRequestWeightCarcass)==null?void 0:G.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:{xs:"inherit",md:48},px:2,py:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"},textAlign:"left"},children:"حجم فروش به خارج استان:"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",sx:{fontSize:{xs:"0.825rem",sm:"1rem"}},children:((p=(g=r==null?void 0:r.killing)==null?void 0:g.poultryOutProvinceQuantity)==null?void 0:p.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:{xs:"inherit",md:48},px:2,py:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"},textAlign:"left"},children:"وزن فروش به خارج استان:"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",sx:{fontSize:{xs:"0.825rem",sm:"1rem"}},children:((U=(P=r==null?void 0:r.killing)==null?void 0:P.poultryOutProvinceWeight)==null?void 0:U.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:{xs:"inherit",md:48},px:2,py:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"},textAlign:"left"},children:"حجم بارها:"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",sx:{fontSize:{xs:"0.825rem",sm:"1rem"}},children:((O=(Y=r==null?void 0:r.killing)==null?void 0:Y.KillHouseRequestQuantity)==null?void 0:O.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:{xs:"inherit",md:48},px:2,py:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"},textAlign:"left"},children:"وزن بارها:"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",sx:{fontSize:{xs:"0.825rem",sm:"1rem"}},children:((q=(z=r==null?void 0:r.killing)==null?void 0:z.KillHouseRequestWeight)==null?void 0:q.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:{xs:"inherit",md:48},px:2,py:1,borderRadius:1,backgroundColor:"rgba(147, 112, 219, 0.1)"},children:[u.jsx(i,{color:"primary.main",sx:{fontSize:{xs:"0.875rem",lg:"1rem"},textAlign:"left"},children:"لاشه تولیدی امروز با احتساب 25درصد افت کشتار :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",sx:{fontSize:{xs:"0.825rem",sm:"1rem"}},children:((l=(e=r==null?void 0:r.killing)==null?void 0:e.totalLossWeight)==null?void 0:l.toLocaleString())||0})]})]})]})},Hu=({title:r,value:o,textColor:A,color:h="primary",unit:y})=>u.jsxs(C,{sx:{width:"100%",backgroundColor:h==="primary"?"#EAEFFF":"#E6FAF5",padding:W.SMALL,maxWidth:{md:"880px"},margin:{xs:"6px",lg:"10px"},borderRadius:"16px",textAlign:"center",border:"1px solid",borderColor:"divider",boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.1)","&:hover":{boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.15)"}},children:[u.jsx(i,{fullWidth:!0,variant:"body1",sx:{fontWeight:"bold"},children:r}),u.jsx(i,{variant:"body2",sx:{marginTop:W.SMALL,fontWeight:"bold",color:A||"primary"},children:o.toLocaleString()}),y&&u.jsx(i,{variant:"body2",sx:{marginTop:W.SMALL,fontWeight:"bold",color:A||"primary"},children:y})]}),i6=su("DASHBOARD_GET_MONITORING_SERVICE",async(r,{dispatch:o})=>{o(uu());const{data:A,status:h}=await ru.get("dashboard_monitoring_view/",{params:{...r}});return o(eu()),{data:A,status:h}}),o6=su("DASHBOARD_GET_MONITORING_BAR_SERVICE",async(r,{dispatch:o})=>{o(uu());const{data:A,status:h}=await ru.get("dashboard_monitoring_bar_and_killing",{params:{date1:r.date1,date2:r.date2,...r}});return o(eu()),{data:A,status:h}}),s6=su("DASHBOARD__GET_TICKET_SERVICE",async(r,{dispatch:o})=>{o(uu());const{data:A,status:h}=await ru.get("get_unread_ticket_for_dashboard/",{params:{...r}});return o(eu()),{data:A,status:h}}),t6=su("DASHBOARD_GET_NEWS_SERVICE",async(r,{dispatch:o})=>{o(uu());const{data:A,status:h}=await ru.get("dashboard_notification/",{params:{role:Eu(),...r}});return o(eu()),{data:A,status:h}});c0.register(d0,C0,g0,h0,K0,Y0,O0,z0,G0);const a6=()=>{var v,I,M,K,m,L,G,g,p,P,U,Y,O,z,q,e,l,x,t,f,T,N,J;const r=cu(),[o,A]=E.useState({hatching:{},yesterdayKilling:{},Killing:{},inventory:{},warehouseKillHouse:{},warehouseInformation:{},chickenPrice:[]}),[h,y]=E.useState([]),[n,j]=E.useState([]),[d,F]=E.useState({state:!1,num:0}),w=B0();E.useEffect(()=>{r(uu()),r(i6()).then(c=>{var b;(b=c.payload)!=null&&b.data&&A(c.payload.data),r(eu())})},[r]),E.useEffect(()=>{r(uu()),r(t6()).then(c=>{var b;if((b=c.payload)!=null&&b.data){const Z=c.payload.data.map(V=>({id:V.id,title:V.title,date:V.created_at,type:V.status||"تازه",message:V.text,isNew:!0}));y(Z)}else y([]);r(eu())})},[r]),E.useEffect(()=>{r(uu()),r(s6()).then(c=>{var b;if((b=c.payload)!=null&&b.data){const Z=Array.isArray(c.payload.data)?c.payload.data:[c.payload.data];j(Z)}else j([]);r(eu())})},[r]),E.useEffect(()=>{r(b0()).then(c=>{F(c.payload.data)})},[window.location.pathname]);const B=c=>{w(`/ticket/${c}/false`)},H=[{title:"حجم جوجه ریزی فعال (قطعه)",value:((v=o==null?void 0:o.hatching)==null?void 0:v.quantity)||0},{title:"حجم کشتار شده (قطعه)",value:((I=o==null?void 0:o.hatching)==null?void 0:I.killedQuantity)||0},{title:"حجم مانده در سالن (قطعه)",value:((M=o==null?void 0:o.hatching)==null?void 0:M.leftOver)||0},{title:"حجم مانده در سالن بزرگتر از 40 روز(قطعه) ",value:((K=o==null?void 0:o.hatching)==null?void 0:K.leftOverBetweenFortySeventyFive)||0},{title:"میانگین سن کشتار فارم های فعال",value:((m=o==null?void 0:o.hatching)==null?void 0:m.killingAveAge)||0}];return u.jsxs(s,{container:!0,direction:"column",alignItems:"center",justifyContent:"flex-start",gap:W.SMALL,sx:{padding:W.SMALL},children:[u.jsx(C,{sx:{width:"100%",mb:2},children:u.jsxs(C,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:2,width:"100%",mb:2},children:[u.jsxs(C,{sx:{width:{xs:"100%",md:"60%"},border:"1px solid",borderColor:"divider",borderRadius:"16px",overflow:"hidden",height:250,display:"flex",flexDirection:"column"},children:[u.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1,color:"white",p:2,backgroundColor:"#00cc99"},children:[u.jsx(Wu,{}),u.jsx(i,{variant:"body1",fontWeight:"bold",textAlign:"left",children:"آخرین اطلاعیه و اخبار"})]}),h.length>0?u.jsx(C,{sx:{p:2,overflowY:"auto",flexGrow:1,scrollBehavior:"smooth",scrollbarWidth:"thin","&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc",borderRadius:"8px"},"&:hover::-webkit-scrollbar-thumb":{backgroundColor:"#999"}},children:h.map(c=>u.jsxs(C,{sx:{mb:2,p:1,borderRadius:1,bgcolor:c.isNew?"action.selected":"background.paper",boxShadow:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[u.jsxs(C,{children:[u.jsx(i,{variant:"body1",textAlign:"left",children:c.title}),u.jsx(i,{variant:"caption",textAlign:"left",children:c.message})]}),u.jsx(C,{children:u.jsx(i,{variant:"body1",textAlign:"left",children:c.date})}),u.jsx(wu,{label:c.type,size:"medium",sx:{bgcolor:c.type==="فوری"?"#B0E4DD":c.type==="داغ ترین"?"#FFCFCF":"#D0DCFF",color:c.type==="فوری"?"#004736":c.type==="داغ ترین"?"#EB5757":"#2D5FFF",minWidth:80,textAlign:"center"}})]},c.id))}):u.jsx(C,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flexGrow:1},children:u.jsx(i,{variant:"body1",color:"text.secondary",children:"اخبار جدیدی وجود ندارد"})})]}),u.jsxs(C,{sx:{width:{xs:"100%",md:"40%"},border:"1px solid",borderColor:"divider",borderRadius:"16px",overflow:"hidden",height:250,display:"flex",flexDirection:"column"},children:[u.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1,color:"white",p:2,backgroundColor:"primary.main"},children:[u.jsx(Wu,{}),u.jsx(i,{variant:"body1",fontWeight:"bold",textAlign:"left",children:"تیکت های خوانده نشده"}),d!=null&&d.state?u.jsx(k0.div,{initial:{y:0},animate:{y:[0,-2,0]},transition:{duration:.5,repeat:1/0,repeatType:"loop"},children:u.jsx(x0,{badgeContent:d==null?void 0:d.num,color:"error",anchorOrigin:{vertical:"top",horizontal:"left"},children:u.jsx(Bu,{})})}):u.jsx(Bu,{})]}),n.length>0?u.jsx(C,{sx:{p:2,overflowY:"auto",flexGrow:1,scrollBehavior:"smooth",scrollbarWidth:"thin","&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc",borderRadius:"8px"},"&:hover::-webkit-scrollbar-thumb":{backgroundColor:"#999"}},children:n.map(c=>{var b,Z,V;return u.jsxs(C,{sx:{mb:2,p:2,borderRadius:1,bgcolor:c.unread_message?"action.selected":"background.paper",boxShadow:1},children:[u.jsxs(C,{sx:{display:"flex",alignItems:"center",mb:1,cursor:"pointer"},onClick:()=>{B(c==null?void 0:c.ticketId)},children:[u.jsx(s0,{sx:{bgcolor:"primary.main",color:"white",width:24,height:24,mr:1},children:((Z=(b=c.user)==null?void 0:b.fullname)==null?void 0:Z.charAt(0))||""}),u.jsx(i,{variant:"subtitle2",fontWeight:"bold",children:((V=c.user)==null?void 0:V.fullname)||"نامشخص"}),c.unread_message&&u.jsx(wu,{label:"جدید",size:"small",color:"error",sx:{ml:"auto"}})]}),u.jsx(i,{variant:"body2",color:"text.secondary",textAlign:"left",children:c.title})]},c.id)})}):u.jsx(C,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flexGrow:1},children:u.jsx(i,{variant:"body1",color:"primary.main",children:"تیکتی جهت نمایش وجود ندارد"})})]})]})}),u.jsxs(s,{container:!0,sx:{width:"100%",borderRadius:"16px",border:"1px solid",borderColor:"divider",p:2,overflow:"hidden"},children:[u.jsx(i,{sx:{width:"100%",textAlign:"start",fontWeight:"400",mb:2,px:1},color:"primary.main",children:"آمار جوجه ریزی استان"}),u.jsx(s,{container:!0,sx:{width:"100%",margin:0},children:H.map((c,b)=>u.jsx(s,{item:!0,xs:12,sm:6,md:4,lg:2.4,sx:{display:"flex",justifyContent:"center",minHeight:"20%",pb:{xs:1,lg:2}},children:u.jsx(Hu,{title:c.title,value:c.value,color:b%2===0?"primary":"secondary"})},b))})]}),u.jsx(bu,{isDashboard:!0,noPagination:!0,operation:u.jsx(tu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${ru.defaults.baseURL}hatching_for_every_age_range/`,rel:"noreferrer",children:u.jsx(au,{color:"success",children:u.jsx(Mu,{size:24})})})}),data:[[((G=(L=o==null?void 0:o.hatching)==null?void 0:L.totalLeftOverLt35)==null?void 0:G.toLocaleString())||"0",((p=(g=o==null?void 0:o.hatching)==null?void 0:g.totalLeftOverBetween3540)==null?void 0:p.toLocaleString())||"0",((U=(P=o==null?void 0:o.hatching)==null?void 0:P.totalLeftOverBetween4045)==null?void 0:U.toLocaleString())||"0",((O=(Y=o==null?void 0:o.hatching)==null?void 0:Y.totalLeftOverBetween4550)==null?void 0:O.toLocaleString())||"0",((q=(z=o==null?void 0:o.hatching)==null?void 0:z.totalLeftOverBetween5055)==null?void 0:q.toLocaleString())||"0",((l=(e=o==null?void 0:o.hatching)==null?void 0:e.totalLeftOverBetween5560)==null?void 0:l.toLocaleString())||"0",((t=(x=o==null?void 0:o.hatching)==null?void 0:x.totalLeftOverBetween6065)==null?void 0:t.toLocaleString())||"0",((T=(f=o==null?void 0:o.hatching)==null?void 0:f.totalLeftOverBetween6570)==null?void 0:T.toLocaleString())||"0",((J=(N=o==null?void 0:o.hatching)==null?void 0:N.totalLeftOverGt70)==null?void 0:J.toLocaleString())||"0"]],allColors:{color:"#244CCC",text:"#fff"},columns:["کمتر از 35 روز","بین 35 تا 40 روز","بین 40 تا 45 روز","بین 45 تا 50 روز","بین 50 تا 55 روز","بین 55 تا 60 روز","بین 60 تا 65 روز","بین 65 تا 70 روز","بیش از 70 روز"],title:"مانده در سالن (قطعه)"}),u.jsxs(s,{container:!0,spacing:2,sx:{width:"100%",display:"flex",flexWrap:"wrap",gap:W.SMALL,justifyContent:"center",alignItems:"stretch",mt:2},children:[u.jsx(l6,{boxStats:o}),u.jsx(J0,{boxStats:o}),u.jsx(V0,{boxStats:o})]}),u.jsxs(s,{container:!0,spacing:4,sx:{width:"100%",display:"flex",flexWrap:"wrap",gap:"20px",justifyContent:"center",alignItems:"stretch",mt:2},children:[u.jsx(n6,{boxStats:o}),u.jsx(N0,{boxStats:o}),u.jsx(r6,{boxStats:o})]}),u.jsx(Z0,{boxStats:o})]})},c6=({boxStats:r})=>{var o,A,h,y,n,j,d,F;return u.jsxs(C,{sx:{flex:"1 1 20%",minWidth:{mnd:"500px"},maxWidth:{md:"41%"},borderRadius:2,border:"1px solid",borderColor:"divider",p:W.SMALL,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:2,height:"300px"},children:[u.jsx(i,{textAlign:"start",variant:"h6",color:"primary.main",children:"اطلاعات کشتار داخل استان و خرید زنده خارج از استان"}),u.jsxs(C,{sx:{display:"flex",flexDirection:"column",gap:1,overflowY:"auto",flex:1},children:[u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:" تعداد سفارشات:"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((A=(o=r==null?void 0:r.killingInfo)==null?void 0:o.count)==null?void 0:A.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"حجم کل کشتار (قطعه):"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((y=(h=r==null?void 0:r.killingInfo)==null?void 0:h.quantity)==null?void 0:y.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:"وزن کل کشتار(کیلوگرم) :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((j=(n=r==null?void 0:r.killingInfo)==null?void 0:n.weight)==null?void 0:j.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"rgba(86, 156, 221, 0.1)"},children:[u.jsx(i,{color:"primary.main",children:" میانگین وزن (کیلوگرم):"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((F=(d=r==null?void 0:r.killingInfo)==null?void 0:d.avgWeight)==null?void 0:F.toLocaleString())||0})]})]})]})},d6=({boxStats:r})=>{var o,A,h,y,n,j;return u.jsxs(C,{sx:{flex:"1 1 15%",minWidth:{xs:"100%",sm:"15%"},maxWidth:{xs:"100%",md:"16%"},borderRadius:2,border:"1px solid",borderColor:"divider",p:W.MEDIUM,pt:4,display:"flex",flexDirection:"column",boxSizing:"border-box",backgroundColor:"rgba(0, 128, 0, 0.05)",textAlign:"left"},children:[u.jsx(i,{variant:"h6",color:"primary.main",sx:{mb:2},children:"تخصیصات بدون بار"}),u.jsx(i,{variant:"body2",mt:3,bgGreen:!0,children:"تعداد تخصیصات"}),u.jsx(i,{variant:"h6",mt:2,color:"success.main",children:((A=(o=r==null?void 0:r.provinceKillRequestWithoutBar)==null?void 0:o.count)==null?void 0:A.toLocaleString())||0}),u.jsx(i,{variant:"body2",mt:3,bgGreen:!0,children:"حجم تخصیصات(قطعه)"}),u.jsx(i,{variant:"h6",mt:2,color:"success.main",children:((y=(h=r==null?void 0:r.provinceKillRequestWithoutBar)==null?void 0:h.quantity)==null?void 0:y.toLocaleString())||0}),u.jsx(i,{variant:"body2",mt:3,bgGreen:!0,children:"وزن تخصیصات(کیلوگرم)"}),u.jsxs(i,{variant:"h6",mt:2,color:"success.main",children:[((j=(n=r==null?void 0:r.provinceKillRequestWithoutBar)==null?void 0:n.indexWeight)==null?void 0:j.toLocaleString())||0," ","کیلوگرم"]})]})},C6=({boxStats:r})=>{var A,h,y,n,j,d,F,w,B,H;const o=[{title:"تعداد بار زنده",value:((h=(A=r==null?void 0:r.freeLiveBar)==null?void 0:A.count)==null?void 0:h.toLocaleString())||"0",icon:u.jsx(p0,{color:"inherit",fontSize:"small"})},{title:"حجم بار زنده",value:`${((n=(y=r==null?void 0:r.freeLiveBar)==null?void 0:y.quantity)==null?void 0:n.toLocaleString())||"0"} قطعه`,icon:u.jsx(y0,{color:"inherit",fontSize:"small"})},{title:"وزن بار زنده",value:`${((d=(j=r==null?void 0:r.freeLiveBar)==null?void 0:j.weight)==null?void 0:d.toLocaleString())||"0"} کیلوگرم`,icon:u.jsx(f0,{color:"inherit",fontSize:"small"})},{title:"وزن لاشه بار",value:`${((w=(F=r==null?void 0:r.freeLiveBar)==null?void 0:F.weightCarcass)==null?void 0:w.toLocaleString())||"0"} کیلوگرم`,icon:u.jsx(F0,{color:"inherit",fontSize:"small"})},{title:"میانگین وزن",value:`${((H=(B=r==null?void 0:r.freeLiveBar)==null?void 0:B.avgWeight)==null?void 0:H.toLocaleString())||"0"} کیلوگرم`,icon:u.jsx(j0,{color:"inherit",fontSize:"small"})}];return u.jsxs(C,{sx:{flex:"1 1 79%",minWidth:{xs:"100%",sm:"79%"},maxWidth:{xs:"100%",md:"79%"},borderRadius:2,border:"1px solid",borderColor:"divider",p:W.MEDIUM,pt:4,display:"flex",flexDirection:"column",boxSizing:"border-box",textAlign:"left"},children:[u.jsx(i,{variant:"h6",color:"text.primary",sx:{mb:2,display:"flex",alignItems:"center"},children:"خرید زنده خارج از استان"}),u.jsx(s,{container:!0,spacing:2,sx:{flex:1,pr:1,alignContent:"center"},children:o.map((v,I)=>u.jsx(s,{item:!0,xs:12,sm:6,md:12,lg:6,xl:4,mt:2,sx:{display:"flex",minHeight:"120px"},children:u.jsxs(m0,{sx:{flex:1,borderTop:`4px solid ${v.color}`,position:"relative",overflow:"visible",display:"flex",flexDirection:"column"},children:[u.jsx(C,{sx:{display:"flex",justifyContent:"center",width:"100%"},children:u.jsx(s0,{sx:{bgcolor:v.color,position:"absolute",top:-20,width:40,height:40,boxShadow:2},children:v.icon})}),u.jsx(v0,{sx:{pt:4,pb:0}}),u.jsxs(D0,{sx:{flexGrow:1,display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[u.jsx(i,{variant:"subtitle2",color:"text.secondary",children:v.title}),u.jsx(i,{variant:"h6",sx:{mt:1},children:v.value})]})]})},I))})]})},g6=({boxStats:r})=>{var o,A,h,y,n,j;return u.jsxs(C,{sx:{flex:"1 1 46%",minWidth:{xs:"100%",sm:"48%"},maxWidth:{xs:"100%",md:"48%"},borderRadius:2,border:"1px solid",borderColor:"divider",p:W.MEDIUM,pt:4,display:"flex",flexDirection:"column",boxSizing:"border-box",backgroundColor:"rgba(191, 182, 223, 0.69)",textAlign:"left"},children:[u.jsx(i,{textAlign:"start",variant:"h6",color:"primary.main",children:"خرید لاشه خارج استان"}),u.jsxs(C,{mt:2,sx:{display:"flex",flexDirection:"column",gap:1,overflowY:"auto",flex:1},children:[u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"#fff"},children:[u.jsx(i,{color:"primary.main",children:" تعداد بار :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((A=(o=r==null?void 0:r.buyFreeCarcasses)==null?void 0:o.count)==null?void 0:A.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"#fff"},children:[u.jsx(i,{color:"primary.main",children:"حجم لاشه(قطعه) :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((y=(h=r==null?void 0:r.buyFreeCarcasses)==null?void 0:h.quantity)==null?void 0:y.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"#fff"},children:[u.jsx(i,{color:"primary.main",children:"وزن لاشه(کیلوگرم) :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((j=(n=r==null?void 0:r.buyFreeCarcasses)==null?void 0:n.weight)==null?void 0:j.toLocaleString())||0})]})]})]})},h6=({boxStats:r})=>{var o,A,h,y,n,j,d,F;return u.jsxs(C,{sx:{flex:"1 1 49%",minWidth:{xs:"100%",sm:"47%"},maxWidth:{xs:"100%",md:"47%"},borderRadius:2,border:"1px solid",borderColor:"divider",p:W.MEDIUM,pt:4,display:"flex",flexDirection:"column",boxSizing:"border-box",backgroundColor:"rgba(0, 128, 0, 0.05)",textAlign:"left"},children:[u.jsx(i,{textAlign:"start",variant:"h6",color:"primary.main",children:"فروش زنده به خارج استان"}),u.jsxs(C,{mt:2,sx:{display:"flex",flexDirection:"column",gap:1,overflowY:"auto",flex:1},children:[u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"#fff"},children:[u.jsx(i,{color:"primary.main",children:" تعداد بار :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((A=(o=r==null?void 0:r.outLiveBar)==null?void 0:o.count)==null?void 0:A.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"#fff"},children:[u.jsx(i,{color:"primary.main",children:"حجم بار(قطعه) :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((y=(h=r==null?void 0:r.outLiveBar)==null?void 0:h.quantity)==null?void 0:y.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"#fff"},children:[u.jsx(i,{color:"primary.main",children:"وزن(کیلوگرم) :"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((j=(n=r==null?void 0:r.outLiveBar)==null?void 0:n.weight)==null?void 0:j.toLocaleString())||0})]}),u.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",height:48,px:2,borderRadius:1,backgroundColor:"#fff"},children:[u.jsx(i,{color:"primary.main",children:"میانگین وزن(کیلوگرم):"}),u.jsx(i,{color:"primary.main",fontWeight:"bold",children:((F=(d=r==null?void 0:r.outLiveBar)==null?void 0:d.avgWeight)==null?void 0:F.toLocaleString())||0})]})]})]})},A6=su("DASHBOARD_GET_SLAUGHTER_INFORMATION_SERVICE",async(r,{dispatch:o})=>{o(uu());const{data:A,status:h}=await ru.get("kill-house-performance-dashboard",{params:{date1:r.date1,date2:r.date2,...r}});return o(eu()),{data:A,status:h}}),x6=()=>{const[r,,o,,A]=E.useContext(Fu),[h,y]=E.useState([]),[n,j]=E.useState([]),[d,F]=E.useState(!0),[w,B]=E.useState(X().format("YYYY-MM-DD")),[H,v]=E.useState(X().format("YYYY-MM-DD")),I=cu();E.useEffect(()=>{K(),M()},[o,A,w,H,d]);const M=()=>{I(A6({date1:o,date2:A})).then(m=>{var L;if((L=m.payload)!=null&&L.data){const G=m.payload.data.map((g,p)=>{var P,U,Y,O,z,q,e,l,x,t,f,T,N,J,c,b,Z,V,nu,ou,a,D,R,Q,k,_,S,du,Cu,gu,hu,Au,xu,pu,yu;return[p+1,g!=null&&g.killer?"کشتارکن":"کشتارگاه",(g==null?void 0:g.name)||"",`${(U=(P=g==null?void 0:g.killHouseOperator)==null?void 0:P.user)==null?void 0:U.fullname} (${(O=(Y=g==null?void 0:g.killHouseOperator)==null?void 0:Y.user)==null?void 0:O.mobile})`||"-",((e=(q=(z=g==null?void 0:g.killHouseOperator)==null?void 0:z.user)==null?void 0:q.city)==null?void 0:e.toLocaleString())||"-",((x=(l=g==null?void 0:g.killingInfo)==null?void 0:l.killHouseRequestsCount)==null?void 0:x.toLocaleString())||"0",((f=(t=g==null?void 0:g.killingInfo)==null?void 0:t.killHouseRequestsQuantity)==null?void 0:f.toLocaleString())||"0",((N=(T=g==null?void 0:g.killingInfo)==null?void 0:T.killHouseRequestsWeight)==null?void 0:N.toLocaleString())||"0",((c=(J=g==null?void 0:g.killingInfo)==null?void 0:J.killHouseFreeBarCount)==null?void 0:c.toLocaleString())||"0",((Z=(b=g==null?void 0:g.killingInfo)==null?void 0:b.killHouseFreeBarQuantity)==null?void 0:Z.toLocaleString())||"0",((nu=(V=g==null?void 0:g.killingInfo)==null?void 0:V.killHouseFreeBarWeight)==null?void 0:nu.toLocaleString())||"0",((a=(ou=g==null?void 0:g.killingInfo)==null?void 0:ou.provinceKillRequestsQuantity)==null?void 0:a.toLocaleString())||"0",((R=(D=g==null?void 0:g.killingInfo)==null?void 0:D.totalQuantity)==null?void 0:R.toLocaleString())||"0",((k=(Q=g==null?void 0:g.killingInfo)==null?void 0:Q.totalWeight)==null?void 0:k.toLocaleString())||"0",((S=(_=g==null?void 0:g.killingInfo)==null?void 0:_.totalAvgWeight)==null?void 0:S.toLocaleString())||"0",((Cu=(du=g==null?void 0:g.killingInfo)==null?void 0:du.killHouseRequestsWareHouseTrueQuantity)==null?void 0:Cu.toLocaleString())||"0",((hu=(gu=g==null?void 0:g.killingInfo)==null?void 0:gu.killHouseRequestsWareHouseTrueWeight)==null?void 0:hu.toLocaleString())||"0",((xu=(Au=g==null?void 0:g.killingInfo)==null?void 0:Au.killHouseRequestsWareHouseFalseQuantity)==null?void 0:xu.toLocaleString())||"0",((yu=(pu=g==null?void 0:g.killingInfo)==null?void 0:pu.killHouseRequestsWareHouseFalseWeight)==null?void 0:yu.toLocaleString())||"0"]});y(G)}}).catch(m=>{r({vertical:"top",horizontal:"center",msg:"خطا در دریافت اطلاعات کشتارگاه",severity:"error"}),console.error("Error fetching dashboard data:",m)})},K=()=>{I(U0(d?{selectedDate1:w,selectedDate2:H}:{})).then(m=>{var G,g;const L=(g=(G=m.payload)==null?void 0:G.data)==null?void 0:g.map((p,P)=>{var U,Y,O,z,q,e,l,x,t,f,T,N,J,c,b;return[P+1,`${(Y=(U=p==null?void 0:p.killHouseOperator)==null?void 0:U.user)==null?void 0:Y.fullname} (${(z=(O=p==null?void 0:p.killHouseOperator)==null?void 0:O.user)==null?void 0:z.mobile})`,`${p!=null&&p.killer?"کشتارکن":"کشتارگاه"} (${p==null?void 0:p.name})`,(l=(e=(q=p==null?void 0:p.killHouseOperator)==null?void 0:q.user)==null?void 0:e.city)==null?void 0:l.name,(t=(x=p==null?void 0:p.wareHouseInfo)==null?void 0:x.productRemainWeight)==null?void 0:t.toLocaleString(),(T=(f=p==null?void 0:p.wareHouseInfo)==null?void 0:f.totalSell)==null?void 0:T.toLocaleString(),(J=(N=p==null?void 0:p.wareHouseInfo)==null?void 0:N.totalKillHouseAllocationsWeight)==null?void 0:J.toLocaleString(),(b=(c=p==null?void 0:p.wareHouseInfo)==null?void 0:c.totalKillHouseFreeSale_barCarcassesWeight)==null?void 0:b.toLocaleString(),u.jsx(tu,{title:"خروجی اکسل",children:u.jsx(au,{color:"success",size:"small",onClick:()=>{var V,nu;r({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const Z=`${ru.defaults.baseURL}kill_house_inventory_data/?&role=KillHouse&key=${(nu=(V=p==null?void 0:p.killHouseOperator)==null?void 0:V.user)==null?void 0:nu.key}${d?`&date1=${w}&date2=${H}`:""}`;window.location.href=Z},children:u.jsx(Mu,{size:24})})},P)]});j(L)}).catch(m=>{r({vertical:"top",horizontal:"center",msg:"خطا در دریافت اطلاعات توزیع",severity:"error"}),console.error("Error fetching table data:",m)})};return u.jsxs(s,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(bu,{title:"اطلاعات کشتار زنده کشتارگاه",noPagination:!0,columns:["ردیف","ماهیت","کشتارگاه / کشتارکن","مالک","شهر","تعداد بارهای داخل استان","حجم بارهای داخل استان","وزن بارهای داخل استان","تعداد بارهای خارج استان","حجم بارهای خارج استان","وزن بارهای خارج استان","حجم تخصیصات بدون بار","حجم کل بارها","وزن کل بارها","میانگین وزن","حجم وارد شده به انبار","وزن وارد شده به انبار","حجم وارد نشده به انبار","وزن وارد نشده به انبار"],data:h}),u.jsxs(s,{container:!0,mt:2,mb:2,style:{display:"flex",alignItems:"center",borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray"},sx:{justifyContent:{xs:"start",sm:"center"}},gap:1,children:[u.jsx(s,{container:!0,justifyContent:"center",alignItems:"center",children:u.jsx(w0,{icon:u.jsx(q0,{}),checkedIcon:u.jsx(T0,{}),checked:d,onChange:()=>F(!d),color:"primary",size:"large"})}),u.jsx(s,{children:u.jsx(iu,{disabled:!d,label:"از تاریخ",id:"date3",renderInput:m=>u.jsx(lu,{size:"small",sx:{width:{xs:"32vw",sm:"160px"}},...m}),value:X(w),onChange:m=>{B(X(m).format("YYYY-MM-DD"))}})}),u.jsx(s,{children:u.jsx(iu,{disabled:!d,label:"تا تاریخ ",id:"date4",renderInput:m=>u.jsx(lu,{size:"small",sx:{width:{xs:"32vw",sm:"160px"}},...m}),value:X(H),onChange:m=>{v(X(m).format("YYYY-MM-DD"))},minDate:X(w)})})]}),u.jsx(bu,{title:"اطلاعات توزیع گوشت مرغ کشتارگاه",noPagination:!0,columns:["ردیف","خریدار","ماهیت","شهر","مانده انبار فعلی","وزن کل فروش (لاشه)","وزن فروش داخل استان(لاشه)","وزن فروش خارج استان(لاشه)","خروجی اکسل"],data:n,sx:{"& .MuiTableCell-root":{fontSize:"0.75rem",padding:"8px"},"& .MuiTableHead-root":{"& .MuiTableCell-root":{fontWeight:600}}}})]})},p6=()=>{var B,H,v,I,M,K,m,L,G,g,p,P,U,Y,O,z,q,e,l,x,t,f,T,N,J;const r=cu(),[o,A]=E.useState({killingInfo:{},bar:{},freeLiveBar:{},provinceKillRequestWithoutBar:{},outLiveBar:{},buyFreeCarcasses:{}}),[,,h,y,n,j]=E.useContext(Fu),d=M0(c=>c.userSlice.userProfile.key);E.useEffect(()=>{r(o6({date1:h||"null",date2:n||"null"})).then(c=>{var b;(b=c.payload)!=null&&b.data&&A(c.payload.data)})},[r,h,n]);const F=[{title:"تعداد بارها",value:((H=(B=o==null?void 0:o.bar)==null?void 0:B.count)==null?void 0:H.toLocaleString())||0},{title:"حجم بارها",value:((I=(v=o==null?void 0:o.bar)==null?void 0:v.quantity)==null?void 0:I.toLocaleString())||0,unit:"قطعه"},{title:"وزن بارها",value:((K=(M=o==null?void 0:o.bar)==null?void 0:M.weight)==null?void 0:K.toLocaleString())||0,unit:"کیلوگرم"},{title:"میانگین سن",value:((L=(m=o==null?void 0:o.bar)==null?void 0:m.avgAge)==null?void 0:L.toLocaleString())||0,unit:"روز"},{title:"میانگین وزن",value:((g=(G=o==null?void 0:o.bar)==null?void 0:G.avgWeight)==null?void 0:g.toLocaleString())||0,unit:"کیلوگرم"}],w=[{title:"تعداد بارها",value:((P=(p=o==null?void 0:o.bar)==null?void 0:p.countHasQuarantine)==null?void 0:P.toLocaleString())||0},{title:"حجم بارهای رصدیار",value:((Y=(U=o==null?void 0:o.bar)==null?void 0:U.quantityHasQuarantine)==null?void 0:Y.toLocaleString())||0,unit:"قطعه"},{title:"حجم بارهای قرنطینه",value:((z=(O=o==null?void 0:o.bar)==null?void 0:O.totalQuarantineQuantity)==null?void 0:z.toLocaleString())||0,unit:"قطعه"},{title:"اختلاف قطعه",value:`${(l=((q=o==null?void 0:o.bar)==null?void 0:q.quantityHasQuarantine)-((e=o==null?void 0:o.bar)==null?void 0:e.totalQuarantineQuantity)||0)==null?void 0:l.toLocaleString()} (${(x=o==null?void 0:o.bar)!=null&&x.quantityHasQuarantine?((((t=o==null?void 0:o.bar)==null?void 0:t.quantityHasQuarantine)-((f=o==null?void 0:o.bar)==null?void 0:f.totalQuarantineQuantity))/((T=o==null?void 0:o.bar)==null?void 0:T.quantityHasQuarantine)*100).toFixed(0)+"%)":"0%)"}`,isNegative:((N=o==null?void 0:o.bar)==null?void 0:N.quantityHasQuarantine)-((J=o==null?void 0:o.bar)==null?void 0:J.totalQuarantineQuantity)<0}];return u.jsxs($,{container:!0,direction:"column",alignItems:"center",justifyContent:"flex-start",children:[u.jsxs($,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,sx:{padding:"12px"},children:[u.jsxs($,{container:!0,gap:1,sx:{borderStyle:"solid",borderWidth:"1px",padding:"8px",borderRadius:"15px",borderColor:"gray",alignItems:"center",width:"auto",flexWrap:"nowrap"},children:[u.jsx($,{children:u.jsx(iu,{label:"از تاریخ",renderInput:c=>u.jsx(lu,{...c,style:{width:{xs:"45%",sm:"160px"}},size:"small"}),value:h,onChange:c=>{y(X(c).format("YYYY-MM-DD"))}})}),u.jsx($,{children:u.jsx(iu,{label:"تا تاریخ",renderInput:c=>u.jsx(lu,{...c,style:{width:{xs:"45%",sm:"160px"}},size:"small"}),value:n,onChange:c=>{j(X(c).format("YYYY-MM-DD"))}})})]}),u.jsx(tu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${ru.defaults.baseURL}dashboard_monitoring_bar_and_killing_excel/?&role=${Eu()}&key=${d}&date1=${h}&date2=${n} + `,rel:"noreferrer",children:u.jsx(au,{color:"success",children:u.jsx(Mu,{size:32})})})}),u.jsx(tu,{title:"خروجی پی دی اف",children:u.jsx("a",{href:`${ru.defaults.baseURL}management_all_poultry_and_warehouse_pdf/?date1=${h}&date2=${n} + `,rel:"noreferrer",children:u.jsx(au,{color:"error",children:u.jsx(A0,{size:32})})})})]}),u.jsxs($,{container:!0,xs:12,sx:{width:"100%",display:"flex",flexWrap:"wrap",gap:W.SMALL,justifyContent:"center",alignItems:"stretch",mt:2},children:[u.jsx(c6,{boxStats:o}),u.jsx($,{item:!0,sx:{width:{xs:"100%",md:"52%"},display:"flex",flexDirection:"column",gap:W.SMALL},children:u.jsxs(C,{sx:{width:{xs:"100%"},borderRadius:"16px",border:"1px solid",borderColor:"divider",p:{md:"10px"}},children:[u.jsx(i,{sx:{padding:"10px"},textAlign:"start",variant:"h6",color:"primary.main",children:"اطلاعات بار"}),u.jsx($,{container:!0,justifyContent:"space-between",sx:{mb:W.SMALL},children:F.map((c,b)=>u.jsx($,{item:!0,minWidth:{sm:"150px",xs:"100%"},sx:{display:"flex",justifyContent:"center",minHeight:"100px"},children:u.jsx(Hu,{title:c==null?void 0:c.title,value:`${c==null?void 0:c.value}`,unit:c==null?void 0:c.unit,color:b%2===0?"primary":"secondary",textColor:(c==null?void 0:c.value)<0?"red":"primary"})},b))}),u.jsx(i,{sx:{padding:"10px"},textAlign:"start",variant:"h6",color:"primary.main",children:"اطلاعات بارهای دارای استعلام قرنطینه"}),u.jsx($,{container:!0,spacing:W.SMALL,sx:{mb:W.SMALL,padding:"10px"},children:w.map((c,b)=>u.jsx($,{item:!0,xs:12,sm:2.3,sx:{display:"flex",justifyContent:"center",minHeight:"100px"},children:u.jsx(Hu,{title:c==null?void 0:c.title,value:`${c==null?void 0:c.value} ${(c==null?void 0:c.unit)||""}`,color:b%2===0?"primary":"secondary",textColor:(c==null?void 0:c.value)<0?"red":"primary"})},b))})]})}),u.jsxs($,{container:!0,sx:{width:"100%",display:"flex",flexWrap:"wrap",gap:W.SMALL,justifyContent:"center",alignItems:"stretch",mt:2},children:[u.jsx(d6,{boxStats:o}),u.jsx(C6,{boxStats:o})]}),u.jsxs($,{container:!0,sx:{width:"100%",display:"flex",flexWrap:"wrap",gap:W.SMALL,justifyContent:"center",alignItems:"stretch",mt:2},children:[u.jsx(g6,{boxStats:o}),u.jsx(h6,{boxStats:o})]}),u.jsx($,{container:!0,sx:{width:"95%",display:"flex",flexWrap:"wrap",gap:W.SMALL,justifyContent:"center",alignItems:"stretch",mt:2},children:u.jsx(x6,{})})]})]})},y6=su("PERIODIC_PERFORMANCE_REPORT_DASHBOARD",async(r,{dispatch:o})=>{o(uu());const{data:A,status:h}=await ru.get("periodic_performance_report_dashboard",{params:r});return o(eu()),{data:A,status:h}}),f6="/assets/farmIcon1-DhvNG8hJ.png",F6="/assets/farmIcon2-CmGqZYKG.png",j6="/assets/farmIcon4-elV-CAva.png",m6="/assets/farmIcon6-imt3OpUd.png",mu="/assets/farmIcon7-Bdy1Kjio.png",v6="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAT9SURBVHgBzZrPbxtFFMe/u3acFqWwKAiUSFXWQgSBiJIoAalccC6cQHHgVC5xJKDKKelfEOcvID5VFUhxTpwgqeiJS9wLPZAorlKBGoTiCETUioCrVmlqx7vMd9Z2HP/eWdv4I1lr746T9+Z938ybGWtoBTurBqyTMOAfhW2Z4s6YeBn5V4EUoKWgaUnR5g6yVhJX5lPwiAZVaPTpswg0/zRgh6CEcMbKxZBDQtUZ9w7I3j5dEL24iPM97A1NiyOTW3briDsHtr9earnh5Wh6FBNfLDfdvKlWd2+Y6PGtC6mMoTOkRI5MNRMNvVEDbH0zix59p4PGE1P+z62b4UYN6ztAySAXRzslUxv+z3XHhtrUlpCj9yi6gTp5Ud0BJ3Tr6Cp8EUx+vlZ+t9IBmbDU/P8im3qkRWKPlyd2ZQ706JvoPuOJ4YyE5znvgJMwJroWMRL+fCNaeudMQo509tH9pOELBDE+l+aHswj0+JbQJgx/AGbvJbQIUYOdLBY+OBFoY++vDoUQeWW4+Dnx5BBrRw8QP9qDB4pRcCIQQAgtIHRpEF9dfh+rZkh+jvQPS+Njj+5jLpWQV7O3Tz7fH7kq3ysiopCJ8I3jgK0vwAM0fHP4I/mK9L8BM+DIZdoIIpV5gsU/fpI9zmtw91vpDNkc/ljdCU2blhev8ll4dQQrl69IQ2MPd4WhvyGde140kEzt/VDxPTq58/YnSD1/ivFfv4MSvsDLujBeuUgrGL+RTmH8l++xIiRSML4RdHjm9x8x9kK/lJoS2ZOwrrqaYuhpPJOShjRreCn8Ll+z/W9CCV0bEw7oo1BgaWBS9mJBz6rcO/5b5NAAlLBhMgImXMLeZ9gpHTpRi3Qu0zBJk8+O5HVIZZ7QtVGOQiZcEn4pKK+xh/frtmPvMlmp81qM5p89PnUvQREBww8FPhDDJnu3Xu+TlUe7mBXzwM5bn0qtl2MG+uQMHZPJn4ECag4YvgCSx0cN29GoqQe3sfjaCEYvVkYh8fQQdw63Pc3KdIBFkevy2fD3NNWuMJG1C+ZAGi45EEaZgRfhFZYUG69/CGU0pHS5O+YSyocyUh7+8oSNIfyrpn0H26YD1gFcEhfVJAn1DUIVDsOGr1dWph64p0OzXUeAybkmEm9pcEKpGOP6gN9lflQbnZrHSujQL2xAASYmyweVipJrBM4PHKE8kdWSurM00xJwiRwi927LXGjWCfY8S+6wYWJZDJ+N5pEGyO35/Hrg9BYUYDLTCbL/zmdyVKnmiJTMwIRoc1XOytf/vIvoX9vwhGXFeHGWlNwyz2W4JlDaTqEcokLTs/mymNJKHv+Tf9ZXXA9T7yz+PPa8Q9YKMgJnuxLcrtB0Twt7OsKhlaVGYVVGY1kTbTw+EIuXFhhOeJYw8eWcfFu86TEKHSXf+3x7tq3CZLYdXXU1tnXuFKdyb3TrJvdFO3kW4IYUJq8FS29U7o1mrRko1EcdIC1PbcqodIDhsazr6D7mqh05VT+heW8+LrXWLdCWyWtVK4b6h3wtGFo9Q+PfnY/Wetz4lNI5rVlF54fXtJQy1VAHF8es8uDDREcQa5RsbqaZY1Z3B93tl5QzF9WRTDnuf2rAaPgQha7PonU4hvsvrBQOLppF/ccedITb8s7OtuLEZyeE4bfgvxh3a3gBdQdKcXJkLL/Pyq1KU/xps6SFMM6mgVz9HchVIBdSikaX8h+glPr8qD4/dgAAAABJRU5ErkJggg==",n0="/assets/killedInProvinceIcon1-B9sbsEGz.png",D6="/assets/killedInProvinceIcon2-Swe8GaJ9.png",w6="/assets/killedInProvinceIcon3-yCrbkLto.png",vu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIUAAACFCAYAAAB12js8AAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZNSURBVHgB7Z1NTxtHGMeftc2Lioo4tjGp6Dcgh0qYXuBc9YVPAEhtKMol+QQlnyDpoUJOKwGfwJGaSu2p9FBAyiH5CEjBbY4oaQ+AvduZtVPtrnb8rO3Z3Znx/3cBBvkCfz3zzG93ZogAAIDDqzeaAQEgEEE49wN/vUIA9LiUgXh9tnteIwAknc766+f3zuW3qBRA8qD9/N7Ldz94BCaCD1b2l6pe5Xfx7VJ03Av8hxdnu3vRMVSKCaFaqbYoQyAkCMUEcGv1yQEFwXJsMPCP0gIhwfThOLdWf/xOVIS92KDnvWyf3L2j+gxWHw6TFojQRfjdjUGfQ6VwlPqnP22S3z2Mjr2TU9JFDPosQuEg9U9+WKZa7UVi+LIb+He4QEgwfTiGXHpSb+kZJyKnOLD6cIiIi1hI/CompzgQCkdYWDtYUMmp9unOYxoChMIR5q5vMtnKLCAUDjCsnOLA6sNyRpFTHFh9WMyocooDlcJSxpFTHAiFhYwrpzgwfViGSk6JaWRDRyAkWH1YxCA5JVYax6QJhMISdMopDoTCEnTKKQ6EwgJ0yykOhMJwei4i2IoNCjn17+zsfcoJhMJgVHKqK+TU5fH2JeUEPIWh5CmnOBAKA8lbTnFAXhlGX061kuM65RQHegqDUO3iIs1yigOhMIQi5RQHQmEIRcopDoTCAOqN5qMi5RQHQlEy0kWIL3ERlbOc4kAoSqQsOcUBT1ESZcopDoSiBMqWUxyQVwVjgpziQE9RIKbIKQ6EoiBMklMcCEVBmCSnOBCKAkiTU6LDf2piICQIRc6o5NQ/M9PbZCgIRY6YKqc44ClywmQ5xYFQ5EBfTiU37RgjpzggrzQTkVOxXVw+0bYNgZCgp9DIIDn19+nOU7IEhEITNskpDoRCE3NXN5kPRDcdNJoaCOVUwkWEcup0Z6wTZcoClWJMbJRTHAjFGNgqpzgwfYyIzXKKA6EYAdvlFAfk1ZC4IKc40FMMgStyigOhyIhLcooDochImpwSreX3NsopDoQiAz05FaxFx6Scap9+W9ourjxBKBhclFMcCMUAXJVTHPAUClyWUxwIRQoqOSUvZxvmLi5bwfSRRm1KPvVMnH8dHE1CICQIRQrdoCubyETP4G2GFWQCQChSkD2D3PCbGF4QU0or1NyOg1Ao6G/4fZAYDjW368FAKAYg9bXU2InhpWql2pLamxwFoWCQGtsTOjs2GATLc9c3j8hRqgRY3lw8+3X+9hdrFH/2sfz+R1/S21c//0GOgUqRkamZqQ0pr6Jj0nb2NbhTQF4NgWwwK6LR9JJPSyvVrfafXx+RIyAUQ9J/0UYeYuas7cT0MSST4DAQihEY5DBcWKoiFCOichjybCvbg4FQjEH4Kl7gxxtMBxwGQjEm7bPdLdGvH8cGg2DL5qUqQqEBlcP4sNG08h1OLEk14ZLDQCg04sobWwiFZhZX9teC3qahKOddi97tRE+hGRccBkKRA4McBlkAQpETKodRX31yQIaDniJn6o2mfHgWe+FX9Bx7f51885AMBZUiZ6ZmptdtcxioFAWgchg+0YaJ51ogFAVhk8PA9FEQ8h8v/tjJnepGvoeBUBTIq95UYbzDQCgKxgaHgVCUgOkOA41miZjqMFApSsRUh4FKUTIqhyHCsV7WrcaoFCUTbhnodOSWgdh5GGIaaZV1HgZCYQChvAr85FK1NIeBUBhC+2z3kAxxGAiFQSgdRu+038JAo2kg9ZX9Q/Iqm7FBzztsn9wt5EBXVAoDmZqdlUvS+EOyAveSoFIYypLoI66vrl+kPG6X10jkemsAQmEwZTkMhMJwyriaCj2F4agcRp5HNyIUFiAdRurRjTk5DITCEsKjGwtyGDgy0SLeXPxyPL/42cfCWUSfiSzN3/584e3Fs99IE6gUlpHqMIju63QYWH1YyIAtA1ocBkJhKXk6DITCYvJyGOgpLCYvh4FQWI7SYYxx/QRC4QDK6ydGdBjwFI4QXj+hyWGgUjiELoeB1Ydj6Di6EaFwEMX1E5kdBqYPBwkdRaezTil7SbIsVREKRxnHYSAUDjOqw0AoHEflMN67ulYee4BGc0JYbDRbAdFXieHH7dOd5BSDSjEp1Gam5UaiTA7DqzeaAYHJJuEwUCkAkd89jB57gFCAHrXa/0vV/wCfCr0Rb+sf5wAAAABJRU5ErkJggg==",Iu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIYAAACFCAYAAACe7YA/AAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYZSURBVHgB7d1NUttIGAbgT1IKZnYcwUcwOLMA10zhG8ABJqATTOYEmBOEnMCYOYBzA6dqBrMYDD4CR2A5qSl1pz8XSklCMrIttbpb77NJpU2y4a3+ea0fIgCAsrzkX7p3o44v/aka7BC0mpcd4HAEwn9Un+wRtJafHVgchk8+iQFBq/l5g//2w4WUIiRoLW/Vh+9vR0Pp+ReZ4UX0TQwWg/CZwFn+qg/v++GQpPicGe4Gu8GIwGlemR/qzW4mRPIk/Q+9q/ujD38SOMkv80PRt4j3G4vkmCT58eDurwsCJ5WaMVhhx+HR+fzwbEzglNLBYAUdx7MvxYBPMgTOKLWUxLjj8IQ4zQzvCc+fdqejDoEz1goGu/81/JrTcewFuwiHS9YOBnvoh9eeFJeZ4Y4Kx0SFA1W6AzYKBivsOHaCTwTWW2vzmad3dzMlKY/T/yk6DtttPGPEov8i3oyi43DM1jMGQ8fhnkqCwdBxuGXrpSS2ouOY4Bhrn8qCwZYdB4nsprODjsM+lQaDPRyFV+g47Fd5MBg6DvtVtvnMk9dxSM8fPhz+fklgtFpmjBh3HJLoKTmmlpkhOg7z1TpjMHQcdqo9GAwdh31qXUpi6DjsoyUY7I2OA8dYw2gLBlvRcSAchtEaDLbsOARlN53oOAyjZfOZBx2H2bTPGLHCjmM2+kjQuMZmDIaOw1yNBoP9cjvqCvKn6DjM0thSEuNfPjoO8zQeDIaOwzxGBIOt6jgItDMmGKyo4+jd3uB5HJo1vvnM05uNH9Uf3eQYOg69jJoxYvwoJ3QczTJyxmDFzxwVp/Oj8AtBrYwNBkPH0Rwjl5LY8pcfvX7kAjqO+hkdDDb/LfyCjkM/44PB0HHoZ0UwGDoOvYzefOZBx6GHNTNGDB2HHtbNGKyo4/AiMeAv5Ai2Zt2Mwfh2hECqr+olpR50LwN/wt0HwdasDAZbvjrj9TEWHUdFrFxKknhv4ZGfvcL8Se1F9vHqjM1ZO2PECjuOn4IJwcasnzFivX/G1yrmZ6lB6V3P+x/wpqYNWD9jxKL/BR9X01+sefIcj1zYjDMzBuPvTvxd/zF7jOVNKi85BKU5FQyGjqMazgWDFV3H8XJSeSJ4kzN7jKSijgOPlSzPyWCwFa/OwHUcJTgbDMZf1aPj2IzTwWC513FIefx+doPncazgfDBYXseBV2es5uSpJE/RMRYdR77WBIOh4yivVcFg6DjKacUeI+ml48heVLynTiq4qDjhHbWM6jC6Hvmpb2GlpGchI7zcL6FVMwa3nvzelMwyQoHagC5wy2NKa4LxEgq+QamTHPckXarl5ZogpRXB4Ar8Hc8UOaG4758NCV5pRTCC3WAkMzcpqQLjM0JRzPnj6oGqvj3VcqZH5df50fmAoJDTM8bB3fgiGwq+iy36WZ4SrOTscbU3G/+hUjBMjnEohCcGi33cVvAWJ5eS3mx0oibD1FfrP0JxiHazDPeu+eRj6U76NVvLAotUKNBVlObUHuNHV4ECa2vOBAMFVrWcCAYKrOo5EQwUWNWzPhjcVagUnKRHVYHVP8MTdrZgdY+xLLDyugoUWFuzNhgosOplZY+BAqt+1gUDBZYeVm0+UWDpY00wUGDpZUUwUGDpZ0UwUGDpZ/zmM6+rUBbzo7N9gtoY3WMUF1gCl+XVzNhgoMBqlpFLSffv0XEQpF9SgwJLL+OCkVdgsUiKfXQV+hh1KikqsHwpQoRCL2OCgQLLLEYEAwWWeYwIhr8TfEKBZZbGN58osMzUaI+BAstcjQUDBZbZGllKUGCZT3swUGDZQeupBAWWPbQFAwWWXbQEAwWWfbQEI7fAEjRGKMxV++YTBZadau0xUGDZq7ZgoMCyWy1LSW6BxXeL+aqrQIFlhcqDgQLLDZWeSlBguaOyYKDAcktlwUCB5ZZKgnFwezNCgeWWrTefKLDctFWPgQLLXRsHAwWW2zZaSviFc+oE8pgcQ4HllrU3ny8F1jQ7vnwGFkLhjLWCgQKrPUoHAwVWu5QOBgqsdikVDBRY7fPmqQQFVjut7DEKCyxP4CHujiucMZYFFtEVQSvlBiOvwIJ2ebX5LCqwoF2+A3WGqSx20mocAAAAAElFTkSuQmCC",Lu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1ESURBVHgB7Z1vbBTXEcDn7Rn7SsCYtFIxPpeLBEklUmEgrTBVivOhSQpEEDVQ9RN2oAJKJP5EqlS1KraUSnwCW0pFoY4wHzFNYkShIVLLuagxVdrgtOFDQqOciw2olOawTWQbbl/e7N2a3b313q5v73b27v0k8O39gfXNvJl58+bNY1CGLFpzNM6Y0qSo6Tgoc5YA43XAIc6Bx/F1BhC3+xwHSDLGUuJBSrw3xUBJgnp/KM3YYDqtpm6/v2cQygwGIaeu5URddGJic4RVrRAibMr8gTooDinxlQ3iHxXUfs7VwVuXdychxIRSAcQIbxEC38RB3TzTaC4ZwjoAZ4k0f3BGKEMCQkZoFEATuhLZBpxvhuKN8EJJCYXoS6vpk2FRBtIKgOZ97tSDvYyr+4Cu0GciKZQhIZShg7KbIKkAGRMfOSj8eQuUASK47FO52kXRKpBSgHITvA1J4GrHyOXdPUAEEgpQAYK3kkxztY2CRQhUAXC+LgR/ooIEb4axnqBjhEAUwBDctYNEzCKV9hvv/aQDAqDkCpAx94oY9QHP3+mRFAOibbjEbqFkCoCj/pHJKeHnYR9InOgcGdi5H0pESRQg4+uViyBHvVswSHymFLGBAkWm4bvd24Twr4AUvhdwwFypbz5WdGsZgSLS0HzsiEjdHhIPoyDxSlSY5+fnf2MTjF0/2w9FoiguAP39vMmpEyIDthkkBYOZxC9qqttSibYU+IzvCqD5eyXythj5TSDxk6LEBb4qgAz2io7vSuCbAkjhlwxflcAXBZDCLzm+KUHBCiCFHxi+KEFBeQCM9qXwA0MLtlEGUAAFKQBO9UAKPzjETGtuRgazZtYKsHjt7w7KeX7wCB++WUu4zf7z3ok1H9/LgXeChA5KpHXkrztOgkc8K0A26MPcftiKNMudlAgKV3oNCj27gGzQJ4VPDy0g9xoUelKArK+Jg4Qq8WzNhWtcu4BsJc9FkJCHifyA28oi1xYgW8YlCQFcyMqtK3ClADjlA2n6w0R87sSEq2KSvC4gG/V/BpLQIWYFj+WbFeS1ABGIeAoqJHTI7LlwxtECyMAv/OQLCB0tgAz8wg9nzhZ8RgvQsOZoK4REAWL182H5sq9C46J5UDu/RrsuBsM3x2B0bBKu3xrXHl+9dgfCgJMVqJr5UwpZ3187vxq2/uBxeO57cU3wKPQgQGW4+u//Q++5j2Hgyg2hFONAkawVSNi9ZmsBqPr+5lWL4cDLq7SfFOk9/wkcfuPvJBVhJitguy+grnETpny/CUTAEf/z3d+BQz97GhqLZN79AK3Rjh99C2rnVcMHV/8Lk1NpIANT4mPDZ3NWC3MsALV5f6x+Hvz+9Rcc/bruj9E3az5aXBcDVD50N8uXinhD3Fe+e3rplbOkrMG9muqF1r0FOTFAZt7PgQJOwh+4chMu9H8G71wa0r7sIMD7al5Zr416HP3W1/DeKSkBZgeF9NuNz+VYALHih6M/DgGDZv/dnh/mCB+Fvf+1fi3oosRzTy+Bjn1rbe/32W1vwuj4FBAgNTKwc6HxCVMMgMGfwhiJ7dvo81vWNJqe6+79CH568M/w6ZDvO6QK5tP/3NXuD/3/qie/Pv08uoya6ggk/jYMBIguiG3oHx0+l9SfMCWChPnfBgRA049m1Qh+ue2d72k+njLtXQNwWkwLjeDvgq6CAlwxy9icCWScRJHnq9ufMl2jGUXhh4WDQgmsccmBHU8BCbhZxtMKgOYfCJR64ejfsv5x03P7X0tAmEB/b71ntADoHghQF8vIWmNaASKMkRj9zSvNSZ6r1/6nRfxhA+954APzfW/d8ARQgBtkbXABbB0QYOt685fUfeojCCsX/pI0XWPqmgZsk/5IUwBM/ogfJPbzL1/2qOk6jKNf551LSdO1NVcQIHG9ZExTgDlMISJ888IOBlJBJXn8QF891MEYIEYklf3IxITmBjQFUIl06oyJ5VwjmNoNOwNXbpmuly99FEjAmDboszGAsgII0Fhfa7oOy3q7E9dvjpquGxfXAg0yMs8qAI1+Ppj+NUI96eMGawqYyFQQdJkrDWuPF/OMHU/Y5dHDjnVlkkoMIKirX9u9REmrabnPr1J5MLWyKoLt3EJ/dpi/YMWRNRupgya9+9Q/yZZ/eSISiVeBosRBMg2mok+/vtHxPThd3bLnLIQdBXhcYaAsAck0WO2TDyorewXDlAUKl3v9TWDmsRyCT1dwNS6mgVwqgAH08c+2vqWt65c/LK5wXjkW4MD21XD5zR9D+95mx/fVzpsDO7Y+CZVAFWOVse37yC9bpiN7rNDBkX74jX/kvM9NFXIZES/6gREUMApfB61BbiWvvfBPn/8EypWyVwA74escFq/pOAkfq3uMxR1YpFIuVEEZ4yR8BC0AWoLe8x87Ch/Z/+vEdKFq96l/QblQtgpgJ3yc3mFu3ri3EBVgq3ifk/D1z4apMNUtZakAMwn/pVf+oK0w4kzAWHiST/jlDE4Dk1BGOAlfq9Cxqdg1UknCFyTLKgjMJ3ydC5eGcgo2kQoTPu4ATSmMsSSUAZjccSN8HRS08flKEz7CgKeqVJ4eUlj4DYF1K5mT8BF0Bfg6BoAYGJbzXH8mhAW4WyVMAL2dlrMA5+nNqzKrdPmEr4Ov22UDKwUmYoAqUNUkKEU9QLQkWOfpFbOiVwAqsGSVokSSKoSfcp2nF5MIVweV++IvkFQkk2k1pWR7yZKIA4bpVtDOmka6lc6p2+/vGcyG/4yEFRgds9TQB9T/z0+s+wCItIoRcE3mWQVQPwQC5OyiqZ8HYWf5sq+Zrq/fGAUiaDLPKADnJCwAdt004qZAkzrW3c7DRPY7qmk1gT8zu4Oj0T4ggHU3LcYAYY4DsMbA6MbQ/FPZ78gV9tAFJBNtKSqLQlevma3A82SaKngnt9sJEeEDDOoHSUzngBnjZ4AAdLtqeOfV7atN172W7mFBIdYA+vXHDxWAcxJuAKtzjOAmjDBuxEDFtbovKt1OjLKeVoBsJ+nA8wHoJ63NlXCZl8626vzgNvcOS+k5dhInkgNIGbuGm5YBVa6ScAPYct0IjqSOPLX8lDjw8uqc0U9m0Ykxk6W3dAqFHiAAmkpr4eWWDU/k3dARNDjy0VrZdTmlkgFkatrUMt6uWfTnQGC/IJr8d0/aN4s+KBZ9sKqHElhoeuQX6+ybRbe+RaLbiYj+kzcGdj5mfC5nHXh+bMNXGGMtEDB42AK2gsdpoHEujY83fX+pFmThe0bHJwNLr6KwsaAEG1tjdbE1da3XJdy+8wVQQMi1b+z6WZObz7EA8ZYTdfcnpz4HImT67m90TAjpZ/fgPLsUB0bg4VRa61eHtQq3RSmlxO4gSdveIA3Nxy8CkdZxCLoDHGFW30oV9PkY9FFqcsWBn7kxsCunHbBtKdCC2PohYS9agQho6rHfPk6lFuCRLXQ6bpq4cCkJe371J62+kNR5QaDV/+82nhOgM/O5gcSsgBH9qBbsK4yLLUEfG4dH1/T+8RrZtnZ2wZ/OjAqALcV5SI6NRYsQWzRfWz4uycGRN8eF4O+Ep+6Qq20jl3f32L3k2B+MshWQuMNp9COOGwIYT3eAJNQoYvQ7vu70YiZnzBIgCSeM9TidHI7k3RKU5uk2kISStJrfgudVAEwccK5KVxAymJCZNeljh6tNgdXRaCcGEyAJBSgrYfrb3bzXlQJgyVi+YEJCBy+ycr0tGIMJBrwLJMThXfkCPyOe9oVX1dS0S1dAF5TNyMAuT0f/elIAdAUqV58BIlvJJCZ02XjCc2cILbLk6n6QUMNV1G9lVo0BxobPDS5o3LhQTDbWgCRwcMo3cnnXIZgFBZ0VEms+9rbwOySOnK1UhAD7hgd2vgizpKDmQFU11TjdkP0FAgKDvvGMDGZNQQqAQWGaqy/KmUHpwe8cg76UkAEUgC/HReHZwwpTLop/LA6SoqMLfzZBnxXfzguTSlAa/BQ+4uuBcVIJiovfwkd87RCJN4Y3KGOCIsDYoN/CR3xvEYo3WF1TvRKnJyDxBfwu71XP8V342X+7eMTWHG3nTDkIkgLgXV7z+14oaovQ0eFzidrGF+6Kh5gxjILEC7gEv1us7M0qw+eWkpwaLINDbxQj2JuJkh4bHWv+bScHthckDvCue2LZvdAEj1tKfm44bjhRmXJCWgMzOOqxksdLMYcflFwBdGSA+BBczRuPRjtLNepN/zcECMYGIgptB6Zsg4qEJ9Kct5XC189EoAqgU3lugScY5x2lNvd2kFAAnYY1R1vRLZSvItARvA4pBdBBiyBSn3vFjKFMik3oCV6HpALo6DGCsArrQmgVUiK46woquHMLaQUwovUrAGgVAeMmINDFbAZSIqTvYyo/SXG02xEaBTCSaV6B7oGtE5dNECAceFJ8iWew/WpYhG4klApgBN3EHKY0qZlGFivEr4QKUSwLkcqetPEhnrFwLxrto2ze3RB6BbCj4du/aWIRpY5z3gSKEhe/5BKuKQWrEyO2jgGL230ORzP+xPP0xF9J8cRdPFYPT1bDE7aSAc7Xi8WXG8brJjLSPAQAAAAASUVORK5CYII=",l0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAdmSURBVHgB7Z1dThtJEMerxx8g7a7ESiHZPK25ATdY5wRrpMS28hI4AXAC7BNgTgB5A5IozgnwniC+wXqfooRE8UobyQTP9FaNPQpCM3aP7emZ6a7fC2h6QLb73/XR7akCYBiGYRiGYRiGYRiGYRiGYRiGYRiGYRiGYRiGYRiGYXKPAEv4u1bb+KlUqjmO84eUclsIUZEAGzSGH8IQf+/jz4E7Hr979OZNFyzBeAF8aDYrRc/bxwnfDSZ8HiQI/NG9FaL9+Px8AAZjrABoxf9cLtPEH6hOfChStjYvL9tgKEYK4FOzuetIebzUxN+BXIPnee2Hr16dgWEYJYDrp0+rUCgc4a9VSIb+WIgdk9yCEQIgP1+S8ghX/C5oAD+0M1Pig1wLYEE/3xVSvrx1nH4wgZ+eP992xuOKB1DD//VC5Z+QW8Bs4izv8UFuBUDmXhQKpzjxFcU/6aH53pu3asmaFDyvFUcIeY4PcieABfx8D9Bcb56f9yAGn+v1mifEsVAXWBcFdpg3t5AbAfjmfm2NJv5A8U8ol29vXlx0YAkoo8BU8EhVCHmLD3IhgOt6/SiWn8cJ+G806mx1u0NYASa7hUwLICk/vyjTXcVjFFhN5X4SAlqPwweXl5ndWs6kAPwPWspTUPTzKJABrs69uH5+UUxyC5kSQJDW4QprKf7JEO89wYlXvX+lXDebLUwFXygHiritXPz+/eTXFbmmVZAZAXxpNPZxJbdU/Tzed/Lt5qa1lfKHmff4IHUB6ErrksYXgpRXMdzCAN3Ck7TdQmoCiJvWycnO2+GjDAdURNz4AOlgqnoIKZGKAKZ791eK0b3v51eZ1umA4gMSgsq9aVoD7QKIM/l5P3SJEx+kJQKtAiCz/8va2nuFyc+kn1+UT8+ebYPjvJ3rFqTsY5bwRGeW4IBGyOfPmfyh9Lw99IlPTJl8AiP+/sOLiy2JexUUy0TeKMT2eBIXaUObBZhG+1dR41lJ65JGxS2MJ66gBxoogi4c5zhqCE/d2o9S2szRzdTH72KQOIgKEouT6z3QgBYLMGv108pH86h6wrcyggOm6Ws4SyMVw5TxTOBOYtiYLiugJQbAA53QN0n+kMw+aOa60aADHX/XcbrzePCxXm+BZkqjEQkw1OUVXFfpwGlZdAWB1dCruCWaks/fvX/BEWIfNONH+1KehI05jvMnaCBxAXzF1C8q8ncLhR6kw4bitcTBtC/0Cyv0mdFnBwmTuADGxeJ2xFDf9KduVCArICJSw2+lUgUSJnEBCMcJVbEH8A8wPnjG0Q+7vi5EBRImcQF4EQJA1X8FxgfN/b9h1z0p8+8CmGzDArAcFoDlsAAshwVgOSwAy2EBWA4LwHJYAJbDArAcFoDlsAAshwVgOSwAy2EBWA4LwHJYAJZjqwCGiteMx04BhHwVWwK8BAuxUgCbl5ctAUAiGMKk/kA7jaeTsoC+ZwMzxoPJhFs56XfhINByWACWwwKwHBaA5VgtgA+1WsWv32MxVmYBH+v1WkGI06Aq6edGY+DmoAZhElhnAWjyHSHe3i1JS49i07UPzWYVUkAI8XvYdbdQGEDCJP908Hg8CL0OkIrpnVUIoqhY2HHlaHgINAod9QEGEUPbOgoghFBdcCwRqGoYlYcLG1sfjfqQMIkLgIpARBVA+F4uW78TV4gWXV9HwUgtMYAH8C7sOpnjFKxAb8GxlUOr34lwO7hoEl/9hJ4qYUJERdcbuitj0sFP1JAXUbApKabNLithY7czXucq0SKAadnXXsTwAdXsA03QaxFS7twr2TrEyd/RmQZ+wfc8o9NpT1f9JH2lYinFkvJqxi2d4s1NW2ehZOoY6nreUGexqmnB7OMZk09FIreMEwCBGy4dfOP7M16MsV26CZW2OLorp2oVAAV8t2tr7+eVTc9KO5VVodoWh9wSVRUHjaTSMEK1t44JDSMw0CNzP7fsK02+a3rDiICYDZaonGonT12643Y1pzqBruPsWNEyJsB3B+Vyx7R2rNQ0ypmR3t0n7T4JqbeNU26n8oNE28MuSl7b36UugIC8tmNVSevuQW1xDrlxZAjToOlgVqp4F3ILYzShvy3ZIn4R4vp5yGj7u0wJICDr7Viz1tV8GTIpgICsuQXaORSuS72Pqir3U3QvHOcwyx3QMi2AgOtGw3cLcdqx4oo7WZUQ4ra5hckTR+3NFFxTXHIhACItt5DXruaq5EYAASSEopSnoGiG/W1l1917/Pp1D2Lgp3XU6i7i2zohZNbPzyJ3AghIKj6IKzDawkWrtJfXTqe5FUDAtEs3pY1KJpqE4I7H7zA4G1BLV7pGzwcUSqUqdepS2befksuu5vfJvQCIuPHBsuTNz8/CCAEExDxkWgSjupoTRgkgIG58MA/y89LQJ4eMFABBp43j9fUDWO5hDyP8/CyMFUDAnfiAWrGqfgXd+IkPMF4AAf6pXblc9TDKnz6LR/l9IAj60gmZ+b/wSLf/bTTqmj7xDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwjEH8D87UuES0IJO2AAAAAElFTkSuQmCC",E6=()=>{var I,M,K,m,L,G,g,p,P,U,Y,O,z,q;const r=cu(),[,,o,A,h,y]=E.useContext(Fu),[n,j]=E.useState({});E.useEffect(()=>{r(y6({date1:o,date2:h})).then(e=>{var l;(l=e.payload)!=null&&l.data&&j(e.payload.data)})},[r,o,h]);const d=[{title:"تعداد ",key:e=>{var l;return`${((l=e==null?void 0:e.poultryHatchingGt60)==null?void 0:l.toLocaleString())||"0"} فارم`}},{title:"حجم ",key:e=>{var l;return`${((l=e==null?void 0:e.poultryHatchingGt60Quantity)==null?void 0:l.toLocaleString())||"0"} قطعه`}},{title:"مانده در سالن",key:e=>{var l;return`${((l=e==null?void 0:e.poultryHatchingGt60LeftOver)==null?void 0:l.toLocaleString())||"0"} قطعه (${((e==null?void 0:e.poultryHatchingGt60LeftOver)/(e==null?void 0:e.poultryHatchingGt60Quantity)*100||0).toFixed(0)||0}%)`}}],F=[{title:"تعداد بارها",icon:n0,key:e=>{var l;return`${((l=e==null?void 0:e.killHouseRequestCount)==null?void 0:l.toLocaleString())||0} بار`}},{title:"حجم کشتار",icon:D6,key:e=>{var l;return`${((l=e==null?void 0:e.killHouseRequestQuantity)==null?void 0:l.toLocaleString())||0} قطعه`}},{title:"وزن کشتار",icon:n0,key:e=>{var l;return`${((l=e==null?void 0:e.killHouseRequestWeight)==null?void 0:l.toLocaleString())||0} کیلوگرم`}},{title:"میانگین وزن",icon:w6,key:e=>{var l;return`${((l=e==null?void 0:e.killHouseRequestAverageWeight)==null?void 0:l.toLocaleString())||0} کیلوگرم`}}];console.log(n);const w=[{title:"تعداد بارها",icon:vu,key:e=>{var l;return`${((l=e==null?void 0:e.freeBarsCount)==null?void 0:l.toLocaleString())||0} بار`}},{title:"حجم کشتار",icon:Iu,key:e=>{var l;return`${((l=e==null?void 0:e.freeBarsQuantity)==null?void 0:l.toLocaleString())||0} قطعه`}},{title:`بیشترین خرید : ${n==null?void 0:n.killHouseName}`,icon:vu,key:e=>{var l;return`${((l=e==null?void 0:e.transactionCount)==null?void 0:l.toLocaleString())||0} بار`}}],B=[{title:"بیشترین خرید داخل استان",key:e=>{var l;return`${((l=e==null?void 0:e.killHouseNameReq)==null?void 0:l.toLocaleString())||0} `}},{title:"بیشترین خرید خارج از استان",key:e=>{var l;return`${((l=e==null?void 0:e.killHouseName)==null?void 0:l.toLocaleString())||0}`}},{title:"بیشترین بار ارسالی مرغدار داخل استان",key:e=>{var l;return`${((l=e==null?void 0:e.poultryReqNameReq)==null?void 0:l.toLocaleString())||0} با ${e==null?void 0:e.topPoultryReqStatsTotalQuantity} قطعه در شهرستان ${e==null?void 0:e.poultryCityReqNameReq}`}},{title:"بیشترین بار ارسالی مرغدار خارج استان",key:e=>{var l;return`${((l=e==null?void 0:e.outPoultryReqNameReq)==null?void 0:l.toLocaleString())||0} با ${e==null?void 0:e.outTopPoultryReqStatsTotalQuantity} قطعه در شهرستان ${e==null?void 0:e.outPoultryCityReqNameReq}`}}],H=[{title:"بیشترین درصد توزیع",key:e=>{var l;return`${((l=e==null?void 0:e.managementKillHouseDict)==null?void 0:l.maxPercent)||"-"} `}},{title:"بیشترین درصد توزیع به خارج استان",key:e=>{var l;return`${((l=e==null?void 0:e.managementKillHouseDict)==null?void 0:l.maxOutProvince)||"-"} `}},{title:"بیشترین درصد توزیع به داخل استان",key:e=>{var l;return`${((l=e==null?void 0:e.managementKillHouseDict)==null?void 0:l.maxInProvince)||"-"} `}},{title:"کمترین درصد توزیع به خارج استان",key:e=>{var l;return`${((l=e==null?void 0:e.managementKillHouseDict)==null?void 0:l.minOutProvince)||"-"} `}},{title:"کمترین درصد توزیع به داخل استان",key:e=>{var l;return`${((l=e==null?void 0:e.managementKillHouseDict)==null?void 0:l.minInProvince)||"-"} `}},{title:"بیشترین وزن مانده در انبار",key:e=>{var l;return`${((l=e==null?void 0:e.managementKillHouseDict)==null?void 0:l.maxProduct)||"-"} `}}],v=[{title:"بیشترین سند ثبت شده نسبت به تعداد بارها",key:e=>{var l;return`${((l=e==null?void 0:e.maxAndMinAssigment)==null?void 0:l.maxDucName)||"-"} `}},{title:"کمترین سند ثبت شده نسبت به تعداد بارها",key:e=>{var l;return`${((l=e==null?void 0:e.maxAndMinAssigment)==null?void 0:l.minDucName)||"-"} `}},{title:"بیشترین سند تایید شده نسبت به تعداد بارها",key:e=>{var l;return`${((l=e==null?void 0:e.maxAndMinAssigment)==null?void 0:l.maxDucAcceptedName)||"-"} `}},{title:"کمترین سند تایید شده نسبت به تعداد بارها",key:e=>{var l;return`${((l=e==null?void 0:e.maxAndMinAssigment)==null?void 0:l.minDucAcceptedName)||"-"} `}},{title:"بیشترین مغایرت نسبت به کل بارها",key:e=>{var l;return`${((l=e==null?void 0:e.maxAndMinAssigment)==null?void 0:l.maxDucRejectedName)||"-"} `}},{title:"کمترین مغایرت نسبت به کل بارها",key:e=>{var l;return`${((l=e==null?void 0:e.maxAndMinAssigment)==null?void 0:l.minDucRejectedName)||"-"} `}}];return u.jsxs(s,{container:!0,direction:"column",xs:12,md:12,sx:{paddingBottom:"30px"},children:[u.jsxs(s,{container:!0,xs:12,gap:1,sx:{margin:{xs:"10px 0 "},justifyContent:{xs:"center",md:"start"},width:"100%",alignItems:{xs:"center"}},children:[u.jsx(s,{children:u.jsx(iu,{label:"از تاریخ",renderInput:e=>u.jsx(lu,{...e,style:{width:"160px"},size:"small"}),value:o,onChange:e=>{A(X(e).format("YYYY-MM-DD"))}})}),u.jsx(s,{children:u.jsx(iu,{label:"تا تاریخ",renderInput:e=>u.jsx(lu,{...e,style:{width:"160px"},size:"small"}),value:h,onChange:e=>{y(X(e).format("YYYY-MM-DD"))}})}),u.jsx(tu,{title:"خروجی پی دی اف",children:u.jsx("a",{href:`${ru.defaults.baseURL}management_all_poultry_and_warehouse_pdf/?date1=${o}&date2=${h} + `,rel:"noreferrer",children:u.jsx(au,{color:"error",children:u.jsx(A0,{size:32})})})})]}),u.jsxs(s,{md:11.8,lg:11.9,container:!0,sx:{borderRadius:"8px",border:"1px solid rgba(0, 0, 0, 0.18)",backgroundColor:"rgba(249, 249, 250, 1)"},children:[u.jsx(i,{align:"left",sx:{color:"#2D5FFF",padding:"20px"},variant:"body1",children:"وضعیت فارم های فعال"}),u.jsx(s,{container:!0,gap:2,sx:{justifyContent:"center",padding:"20px"},children:[{label:"تعداد فارم‌ها",value:(n==null?void 0:n.poultryCount)??0,unit:"فارم",icon:f6},{label:"حجم جوجه‌ریزی",value:(n==null?void 0:n.poultryHatchingQuantity)??0,unit:"قطعه",icon:F6},{label:"حجم تلفات",value:(n==null?void 0:n.poultryHatchingTotalLosses)??0,unit:`قطعه (${(((n==null?void 0:n.poultryHatchingTotalLosses)??0)/((n==null?void 0:n.poultryHatchingQuantity)??1)*100).toFixed(1)}%)`,icon:j6},{label:"حجم کشتار",value:(n==null?void 0:n.poultryHatchingKilledQuantity)??0,unit:"قطعه",icon:m6},{label:" وزن کشتار",value:(n==null?void 0:n.poultryHatchingTotalKilledWeight)??0,unit:"کیلوگرم",icon:mu},{label:"حجم مانده در سالن",value:(n==null?void 0:n.poultryHatchingLeftOver)??0,unit:`قطعه (${(((n==null?void 0:n.poultryHatchingLeftOver)??0)/((n==null?void 0:n.poultryHatchingQuantity)??1)*100).toFixed(0)}%)`,icon:v6},{label:"میانگین تلفات",value:((I=n==null?void 0:n.avgLosses)==null?void 0:I.toLocaleString())||0,unit:"قطعه",icon:mu},{label:"میانگین سن کشتار",value:((M=n==null?void 0:n.totalKillingAveAge)==null?void 0:M.toLocaleString())||0,unit:"روز",icon:mu},{label:"میانگین وزن کشتار",value:((K=n==null?void 0:n.avgTotalKilledWeight)==null?void 0:K.toLocaleString())||0,unit:"کیلوگرم",icon:mu}].map((e,l)=>{var x,t;return u.jsxs(s,{item:!0,xs:12,md:3.82,xl:3.9,sx:{backgroundColor:"rgba(255, 255, 255, 1)",color:"#717171",border:"1px solid rgba(151, 151, 151, 1)",borderRadius:"8px",justifyContent:"space-between",alignItems:"center",display:"flex",padding:"10px"},children:[u.jsxs(s,{sx:{display:"flex",alignItems:"center"},children:[u.jsx("img",{src:e.icon,alt:"icon",width:"32",height:"32"}),u.jsxs(i,{sx:{marginLeft:"10px"},children:[e.label," "]})]}),u.jsxs(i,{sx:{color:parseInt(e.value)>0||e.value===0?"rgba(53, 53, 53, 1)":"red",display:"flex",alignItems:"center"},children:[u.jsx("span",{style:{fontWeight:"bold",marginLeft:"4px",direction:"ltr",display:"inline-block"},children:((t=(x=e.value)==null?void 0:x.toLocaleString)==null?void 0:t.call(x))||e.value}),u.jsx("span",{children:e.unit})]})]},l)})})]}),u.jsxs(s,{container:!0,gap:2,sx:{width:"100%"},children:[u.jsxs(s,{md:5.8,lg:5.9,xs:12,item:!0,mt:W.SMALL,sx:{justifyContent:"center",border:"1px solid #CCCCCD",backgroundColor:"#F9F9FA",borderRadius:"8px"},children:[u.jsx(i,{align:"left",sx:{color:"#2D5FFF",padding:"20px"},variant:"body1",children:"فارم‌های با سن بیشتر از ۶۰ روز"}),u.jsx(s,{container:!0,justifyContent:"center",xs:12,gap:4,sx:{padding:"15px"},children:d.map((e,l)=>u.jsxs(s,{item:!0,md:3,xs:12,sx:{width:"100%",backgroundColor:l%2===0?"rgba(45, 95, 255, 0.11)":"rgba(230, 250, 245, 1)",border:"1px solid #ccc",borderRadius:"8px",padding:"0"},children:[u.jsx(s,{style:{borderRadius:"8px",backgroundColor:l%2===0?"rgba(27, 57, 153, 1)":"rgba(0, 204, 153, 1)"},children:u.jsx(i,{style:{color:"#fff",padding:"10px"},children:e.title})}),u.jsx(s,{sx:{padding:"15px"},gap:3,children:u.jsx(i,{style:{color:"#353535"},children:e.key(n)})})]},l))})]}),u.jsxs(s,{item:!0,md:5.8,lg:5.9,xs:12,mt:W.SMALL,sx:{justifyContent:"center",border:"1px solid #CCCCCD",backgroundColor:"#F9F9FA",borderRadius:"8px",padding:"17px"},children:[u.jsxs(s,{container:!0,sx:{alignItems:"center",justifyContent:"space-between"},children:[u.jsxs(i,{sx:{color:"#2D5FFF"},variant:"body1",children:["بیشترین سن کشتار :",n==null?void 0:n.maxAgePoultry," روز"]}),((n==null?void 0:n.maxAgePoultryName)!=="-"||(n==null?void 0:n.maxAgePoultryCity)!=="-")&&u.jsx(s,{children:u.jsxs(i,{sx:{marginLeft:"20px",color:"rgba(0, 163, 122, 1)"},children:[n==null?void 0:n.maxAgePoultryName," - ",n==null?void 0:n.maxAgePoultryCity]})}),u.jsx(tu,{title:`${((n==null?void 0:n.maxAgePoultryLeftOver)*100/(n==null?void 0:n.maxAgePoultryQuantity)||0).toFixed(2)}%`,children:u.jsx(_u,{variant:"determinate",value:(n==null?void 0:n.maxAgePoultryLeftOver)/(n==null?void 0:n.maxAgePoultryQuantity)*100,sx:{marginTop:{xs:"10px"},width:"200px",height:"10px",borderRadius:5,backgroundColor:"rgba(217, , 217, 1)","& .MuiLinearProgress-bar":{backgroundColor:(()=>{const e=(n==null?void 0:n.maxAgePoultryLeftOver)*100/(n==null?void 0:n.maxAgePoultryQuantity);return e>0&&e<25?"red":e>=25&&e<50?"orange":e>=50&&e<75?"yellow":"green"})()}}})})]}),u.jsxs(s,{container:!0,xs:12,mt:W.SMALL,sx:{padding:"7px",justifyContent:"space-between",backgroundColor:" rgba(227, 232, 251, 1);"},children:[u.jsxs(i,{children:["حجم جوجه ریزی:",(m=n==null?void 0:n.maxAgePoultryQuantity)==null?void 0:m.toLocaleString()]}),u.jsxs(i,{children:["کشتار شده : ",(L=n==null?void 0:n.maxAgePoultryKilledQuantity)==null?void 0:L.toLocaleString()]}),u.jsxs(i,{children:["مانده در سالن : ",(G=n==null?void 0:n.maxAgePoultryLeftOver)==null?void 0:G.toLocaleString()]})]}),u.jsxs(s,{container:!0,mt:W.SMALL,sx:{alignItems:"center",justifyContent:"space-between"},children:[u.jsxs(i,{sx:{color:"#2D5FFF"},variant:"body1",children:["کمترین سن کشتار: ",n==null?void 0:n.minAgePoultry," روز"]}),((n==null?void 0:n.minAgePoultryName)!=="-"||(n==null?void 0:n.minAgePoultryCity)!=="-")&&u.jsx(s,{children:u.jsxs(i,{sx:{marginLeft:"20px",color:"rgba(0, 163, 122, 1)"},children:[n==null?void 0:n.minAgePoultryName," - ",n==null?void 0:n.minAgePoultryCity]})}),u.jsx(tu,{title:`${((n==null?void 0:n.minAgePoultryLeftOver)/(n==null?void 0:n.minAgePoultryQuantity)*100||0).toFixed(2)}%`,children:u.jsx(_u,{variant:"determinate",value:(n==null?void 0:n.minAgePoultryLeftOver)/(n==null?void 0:n.minAgePoultryQuantity)*100,sx:{marginTop:{xs:"10px"},width:"200px",height:"10px",borderRadius:5,backgroundColor:"rgba(217, 217, 217, 1)","& .MuiLinearProgress-bar":{backgroundColor:(()=>{const e=(n==null?void 0:n.minAgePoultryLeftOver)/(n==null?void 0:n.minAgePoultryQuantity)*100;return e>0&&e<25?"red":e>=25&&e<50?"orange":e>=50&&e<75?"yellow":"green"})()}}})}),u.jsxs(s,{item:!0,xs:12,mt:W.SMALL,sx:{display:"flex",justifyContent:"space-between",backgroundColor:" rgba(255, 219, 197, 1)",padding:"7px"},children:[u.jsxs(i,{children:["حجم جوجه ریزی:",((g=n==null?void 0:n.minAgePoultryQuantity)==null?void 0:g.toLocaleString())||0]}),u.jsxs(i,{children:["کشتار شده :",((p=n==null?void 0:n.minAgePoultryKilledQuantity)==null?void 0:p.toLocaleString())||0]}),u.jsxs(i,{children:["مانده در سالن :",((P=n==null?void 0:n.minAgePoultryLeftOver)==null?void 0:P.toLocaleString())||0]})]})]})]})]}),u.jsxs(s,{container:!0,gap:2,sx:{width:"100%"},children:[u.jsxs(s,{md:5.8,lg:5.9,xs:12,item:!0,mt:W.SMALL,sx:{justifyContent:"center",border:"1px solid #CCCCCD",backgroundColor:"#F9F9FA",borderRadius:"8px"},children:[u.jsx(i,{align:"left",sx:{color:"#2D5FFF",padding:"20px"},variant:"body1",children:"کشتار داخل استان (زنده)"}),u.jsx(s,{container:!0,gap:2,justifyContent:"center",xs:12,sx:{padding:"20px"},children:F==null?void 0:F.map((e,l)=>u.jsxs(s,{md:11.8,xs:12,sx:{alignItems:"center",width:"100%",display:"flex",boxShadow:"0px 8px 8px 0px #0000001A",border:"1px solid rgba(255, 252, 252, 1)",borderRadius:"50px"},children:[u.jsx("img",{src:e.icon,alt:"icon",width:"64",height:"43"},e.icon),u.jsxs(s,{xs:12,sx:{alignItems:"center",justifyContent:"space-between",display:"flex"},children:[u.jsx(i,{style:{color:"#535353"},children:e.title}),u.jsx(i,{style:{color:"#353535",padding:"10px"},children:e.key(n)})]})]},l))})]}),u.jsxs(s,{item:!0,xs:12,md:5.8,lg:5.9,mt:W.SMALL,sx:{justifyContent:"center",border:"1px solid #CCCCCD",backgroundColor:"#F9F9FA",borderRadius:"8px"},children:[u.jsx(i,{align:"left",sx:{color:"#2D5FFF",padding:"20px"},variant:"body1",children:"کشتار خارج استان (زنده)"}),u.jsxs(s,{container:!0,xs:12,gap:3,justifyContent:"center",sx:{padding:"20px"},children:[w.map((e,l)=>u.jsxs(s,{item:!0,xs:12,md:12,sx:{display:"flex",alignItems:"center",justifyContent:l%2===0?"end":"start"},children:[e.icon===vu&&u.jsx("img",{src:vu,alt:"icon-left",width:"32",height:"32",style:{marginLeft:"-2px"}}),u.jsxs(s,{sx:{display:"flex",alignItems:"center",width:{md:"579px",xs:"100%"},border:l%2===0?"2px solid #00CC99":"2px solid #1B3999",backgroundColor:l%2===0?"rgba(235, 255, 250, 1)":"rgba(237, 241, 255, 1)",borderRadius:"8px",padding:"7px",zIndex:"10",justifyContent:e!=null&&e.title?"space-between":"start"},children:[u.jsx(i,{sx:{color:"#535353"},children:e==null?void 0:e.title}),u.jsx(i,{sx:{color:"#353535"},children:e.key(n)})]}),e.icon===Iu&&u.jsx("img",{src:Iu,alt:"icon-right",width:"32",height:"32",style:{marginRight:"-2px"}})]},l)),u.jsxs(i,{align:"left",sx:{color:"#EB5757",width:"100%",marginTop:"10px"},variant:"body1",children:["* بیشترین حجم کشتار در ",n==null?void 0:n.persianDate," با"," ",((U=n==null?void 0:n.freeBarsQuantity)==null?void 0:U.toLocaleString())||"0"," قطعه رخ داده است"]})]})]})]}),u.jsxs(s,{container:!0,xs:12,md:11.8,lg:11.9,mt:2,sx:{width:"100%",justifyContent:"center",border:"1px solid #CCCCCD",backgroundColor:"#F9F9FA",borderRadius:"8px",padding:"6px"},children:[u.jsx(i,{align:"left",sx:{color:"#2D5FFF",padding:"20px",width:"100%"},variant:"body1",children:"عملکرد خریداران"}),((Y=n==null?void 0:n.killHousesData)==null?void 0:Y.length)>0&&u.jsxs(s,{container:!0,justifyContent:"center",sx:{width:"100%"},spacing:2,children:[u.jsx(s,{item:!0,xs:12,md:2.3,children:u.jsxs(s,{container:!0,direction:"column",sx:{marginTop:"32px"},children:[u.jsx(s,{container:!0,sx:{borderRadius:"8px",margin:"2px",padding:"5px",border:"1px solid #D9D9D9",alignItems:"center",justifyContent:"center"},children:u.jsx(s,{item:!0,xs:12,children:u.jsx(i,{textAlign:"center",fontWeight:"400",sx:{color:"#444444"},children:"نام کشتارگاه"})})}),n.killHousesData.map((e,l)=>u.jsx(s,{container:!0,sx:{borderRadius:"8px",margin:"2px",padding:"5px",border:"1px solid rgba(217, 217, 217, 1)",backgroundColor:l%2===0?"#ebfffa":"#fff"},children:u.jsx(s,{item:!0,xs:12,children:u.jsx(i,{textAlign:"center",children:(e==null?void 0:e.name)||"-"})})},l))]})}),u.jsxs(s,{item:!0,xs:12,md:3.2,children:[u.jsx(i,{textAlign:"center",sx:{color:"#444444",fontWeight:"400"},fontWeight:"600",children:"داخل استان"}),u.jsxs(s,{container:!0,direction:"column",sx:{marginTop:"10px"},children:[u.jsxs(s,{container:!0,sx:{borderRadius:"8px",margin:"2px",padding:"5px",border:"1px solid #D9D9D9",alignItems:"center",justifyContent:"space-around"},children:[u.jsx(i,{textAlign:"center",fontWeight:"400",sx:{color:"#444444"},children:"تعداد بار"}),u.jsx(i,{textAlign:"center",fontWeight:"400",sx:{color:"#444444"},children:"حجم بار"}),u.jsx(i,{textAlign:"center",fontWeight:"400",sx:{color:"#444444"},children:"وزن بار"})]}),n.killHousesData.map((e,l)=>{var x,t,f;return u.jsxs(s,{container:!0,sx:{margin:"2px",padding:"5px",borderRadius:"8px",border:"1px solid rgba(217, 217, 217, 1)",backgroundColor:l%2===0?"#E3E8FB":"#fff"},children:[u.jsx(s,{item:!0,xs:4,children:u.jsx(i,{textAlign:"center",children:((x=e==null?void 0:e.loadCountInProvince)==null?void 0:x.toLocaleString())||0})}),u.jsx(s,{item:!0,xs:4,children:u.jsx(i,{textAlign:"center",children:((t=e==null?void 0:e.inProvinceQuantity)==null?void 0:t.toLocaleString())||0})}),u.jsx(s,{item:!0,xs:4,children:u.jsx(i,{textAlign:"center",children:((f=e==null?void 0:e.inProvinceWight)==null?void 0:f.toLocaleString())||0})})]},l)})]})]}),u.jsxs(s,{item:!0,xs:12,md:3.2,children:[u.jsx(i,{textAlign:"center",sx:{color:"#444444",fontWeight:"400"},fontWeight:"600",children:"خارج استان"}),u.jsxs(s,{container:!0,direction:"column",sx:{marginTop:"10px"},children:[u.jsxs(s,{container:!0,sx:{borderRadius:"8px",margin:"2px",padding:"5px",border:"1px solid #D9D9D9",alignItems:"center",justifyContent:"space-around"},children:[u.jsx(i,{textAlign:"center",fontWeight:"400",sx:{color:"#444444"},children:"تعداد بار"}),u.jsx(i,{textAlign:"center",fontWeight:"400",sx:{color:"#444444"},children:"حجم بار"}),u.jsx(i,{textAlign:"center",fontWeight:"400",sx:{color:"#444444"},children:"وزن بار"})]}),n.killHousesData.map((e,l)=>{var x,t,f;return u.jsxs(s,{container:!0,sx:{borderRadius:"8px",margin:"2px",padding:"5px",border:"1px solid rgba(217, 217, 217, 1)",backgroundColor:l%2===0?"#EDEDED":"#fff"},children:[u.jsx(s,{item:!0,xs:4,children:u.jsx(i,{textAlign:"center",children:((x=e==null?void 0:e.loadCountOutProvince)==null?void 0:x.toLocaleString())||0})}),u.jsx(s,{item:!0,xs:4,children:u.jsx(i,{textAlign:"center",children:((t=e==null?void 0:e.outProvinceQuantity)==null?void 0:t.toLocaleString())||0})}),u.jsx(s,{item:!0,xs:4,children:u.jsx(i,{textAlign:"center",children:((f=e==null?void 0:e.outProvinceWeight)==null?void 0:f.toLocaleString())||0})})]},l)})]})]}),u.jsxs(s,{item:!0,xs:12,md:3.2,children:[u.jsx(i,{textAlign:"center",sx:{color:"#444444",fontWeight:"400"},fontWeight:"600",children:"کل بارها"}),u.jsxs(s,{container:!0,direction:"column",sx:{marginTop:"10px"},children:[u.jsxs(s,{container:!0,sx:{borderRadius:"8px",margin:"2px",padding:"5px",border:"1px solid #D9D9D9",alignItems:"center",justifyContent:"space-around"},children:[u.jsx(i,{textAlign:"center",fontWeight:"400",sx:{color:"#444444"},children:"تعداد بار"}),u.jsx(i,{textAlign:"center",fontWeight:"400",sx:{color:"#444444"},children:"حجم بار"}),u.jsx(i,{textAlign:"center",fontWeight:"400",sx:{color:"#444444"},children:"وزن بار"})]}),n.killHousesData.map((e,l)=>{var x,t,f;return u.jsxs(s,{container:!0,sx:{borderRadius:"8px",margin:"2px",padding:"5px",border:"1px solid rgba(217, 217, 217, 1)",backgroundColor:l%2===0?"#F9F0EB":"#fff"},children:[u.jsx(s,{item:!0,xs:4,children:u.jsx(i,{textAlign:"center",children:((x=e==null?void 0:e.loadCount)==null?void 0:x.toLocaleString())||0})}),u.jsx(s,{item:!0,xs:4,children:u.jsx(i,{textAlign:"center",children:((t=e==null?void 0:e.totalQuantity)==null?void 0:t.toLocaleString())||0})}),u.jsx(s,{item:!0,xs:4,children:u.jsx(i,{textAlign:"center",children:((f=e==null?void 0:e.totalWeight)==null?void 0:f.toLocaleString())||0})})]},l)})]})]})]}),u.jsx(s,{container:!0,sx:{marginTop:"10px"},children:B.map((e,l)=>u.jsx(s,{item:!0,xs:12,md:6,children:u.jsx(s,{container:!0,sx:{padding:"10px"},children:u.jsxs(s,{item:!0,alignItems:"center",sx:{display:"flex"},children:[u.jsx("img",{src:Lu,alt:"icon",width:"32",height:"32"}),u.jsxs(i,{sx:{marginLeft:1,fontSize:{xs:"13px",md:"16px"}},children:[e.title," : ",e.key(n)]})]})})},l))})]}),u.jsxs(s,{container:!0,xs:12,mt:W.SMALL,sx:{width:" 100%",justifyContent:"center",padding:"6px"},children:[u.jsx(i,{align:"left",sx:{color:"#2D5FFF",padding:"20px",width:"100%"},variant:"body1",children:"عملکرد کشتار و توزیع لاشه"}),u.jsx(s,{xs:12,sx:{padding:"10px"},children:u.jsx(u0,{columns:["ردیف","نام","وزن بار زنده","وزن وارد شده به انبار","وزن توزیع داخل استان","وزن توزیع خارج استان","وزن کل توزیع شده","وزن مانده در انبار فعلی","درصد توزیع"],data:(O=n==null?void 0:n.managementKillHouseData)==null?void 0:O.map((e,l)=>[l+1,(e==null?void 0:e.name)||" -",(e==null?void 0:e.inProvinceQuantity.toLocaleString())||0,(e==null?void 0:e.inWareHouseQuantity.toLocaleString())||0,(e==null?void 0:e.stewardAllocationQuantity.toLocaleString())||0,(e==null?void 0:e.killHouseFreeBarQuantity.toLocaleString())||0,(e==null?void 0:e.allQuantity.toLocaleString())||0,(e==null?void 0:e.product.toLocaleString())||0,(e==null?void 0:e.percent.toLocaleString())||0]),rowColors:["#FFF","#F2F5FF"],headerColor:"#E0E7FF"})}),u.jsx(s,{xs:12,sx:{display:"flex",alignItems:"center"},children:u.jsx(i,{align:"left",sx:{color:"#EB5757",width:"100%"},variant:"body1",children:"* وزن ها بر حسب کیلوگرم میباشد."})}),u.jsx(s,{container:!0,sx:{marginTop:"10px"},children:H.map((e,l)=>u.jsx(s,{item:!0,xs:12,md:6,children:u.jsx(s,{container:!0,sx:{padding:"10px"},children:u.jsxs(s,{item:!0,alignItems:"center",sx:{display:"flex"},children:[u.jsx("img",{src:Lu,alt:"icon",width:"32",height:"32"}),u.jsxs(i,{sx:{marginLeft:1,fontSize:{xs:"13px",md:"16px"}},children:[e.title," : ",e.key(n)]})]})})},l))})]}),u.jsxs(s,{container:!0,xs:12,mt:W.SMALL,sx:{width:" 100%",justifyContent:"center",padding:"6px",border:"1px solid #CCCCCD",backgroundColor:"#F9F9FA",borderRadius:"8px"},children:[u.jsx(i,{align:"left",sx:{color:"#2D5FFF",padding:"20px",width:"100%"},variant:"body1",children:"گزارش اسناد و قبوض باسکول"}),u.jsx(s,{xs:12,sx:{padding:"10px"},children:u.jsx(u0,{columns:["ردیف","نام"," کل بارها"," بارهای دارای سند"," بارهای بدون سند","تعداد تایید شده","تعداد دارای مغایرت","درصد تایید شده","درصد دارای مغایرت"],data:(z=n==null?void 0:n.ducKillHouseData)==null?void 0:z.map((e,l)=>[l+1,(e==null?void 0:e.name)||" -",(e==null?void 0:e.killHouseRequest1Count.toLocaleString())||0,(e==null?void 0:e.barAssigmentTrueCount.toLocaleString())||0,(e==null?void 0:e.barAssigmentPendingCount.toLocaleString())||0,(e==null?void 0:e.barDocumentStatusAccepted.toLocaleString())||0,(e==null?void 0:e.barDocumentStatusRejected.toLocaleString())||0,(e==null?void 0:e.percentBarDocumentStatusAccepted.toLocaleString())||0,(e==null?void 0:e.percentBarDocumentStatusRejected.toLocaleString())||0]),headerColor:"#B0EFDF",rowColors:["#FFF","#E6FAF5"]})}),u.jsxs(s,{xs:12,sx:{display:"flex",alignItems:"center"},children:[u.jsx("img",{src:l0,alt:"icon",width:"32",height:"32"}),u.jsx(i,{align:"left",sx:{color:"#EB5757",width:"100%"},variant:"body1",children:"هشدار: بیش از ۵۰٪ بارها دارای سند مشکوک یا دست‌نویس هستند."})]}),u.jsxs(s,{xs:12,sx:{display:"flex",alignItems:"center"},children:[u.jsx("img",{src:l0,alt:"icon",width:"32",height:"32"}),u.jsxs(i,{align:"left",sx:{color:"#EB5757",width:"100%"},variant:"body1",children:["هشدار: تعداد اسناد مشکوک و دارای مغایرت"," ",((q=n==null?void 0:n.barAssigmentPendingCount1)==null?void 0:q.toLocaleString())||0," بار می‌باشد."]})]}),u.jsx(s,{container:!0,sx:{marginTop:"10px"},children:v.map((e,l)=>u.jsx(s,{item:!0,xs:12,md:6,children:u.jsx(s,{container:!0,sx:{padding:"10px"},children:u.jsxs(s,{item:!0,alignItems:"center",sx:{display:"flex"},children:[u.jsx("img",{src:Lu,alt:"icon",width:"32",height:"32"}),u.jsxs(i,{sx:{marginLeft:1,fontSize:{xs:"13px",md:"16px"}},children:[e.title," : ",e.key(n)]})]})})},l))})]})]})},b6=su("MANAGEMENT_KILLHOUSE_DASHBOARD",async(r,{dispatch:o})=>{o(uu());const{data:A,status:h}=await ru.get("management_kill_house_dashboard",{params:r});return o(eu()),{data:A,status:h}});c0.register(d0,C0,g0,h0);const k6=()=>{var m,L,G,g,p,P,U,Y,O,z,q,e,l,x,t,f,T,N,J,c,b,Z,V,nu,ou;const r=cu(),[,,o,A,h,y]=E.useContext(Fu),[n,j]=E.useState({});E.useEffect(()=>{r(b6({date1:o,date2:h})).then(a=>{var D;(D=a.payload)!=null&&D.data&&j(a.payload.data)})},[r,o,h]);const d={responsive:!0,maintainAspectRatio:!1,plugins:{datalabels:{color:"#fff",font:{size:10,family:"iranyekan"},formatter:(a,D)=>{const R=D.dataset.data[D.dataIndex];return R>10?`${R}%`:""},clamp:!0,anchor:"center",align:"center",offset:0,clip:!0},legend:{labels:{color:"#333",font:{size:12}}}}},F={scales:{y:{beginAtZero:!0}},plugins:{rtl:!0}},w=[((m=n==null?void 0:n.allManagementKillHouseData)==null?void 0:m.stewardAllocations)||0,((L=n==null?void 0:n.allManagementKillHouseData)==null?void 0:L.freeBars)||0,((G=n==null?void 0:n.allManagementKillHouseData)==null?void 0:G.inWarehouse)||0],B={labels:["وزن توزیع شده داخل استان","وزن توزیع شده خارج استان","وزن وارد شده به انبار"],datasets:[{label:"",data:w==null?void 0:w.map(a=>(a/w.reduce((D,R)=>D+R,0)*100).toFixed(0)),backgroundColor:["#2D5FFF","#00CC99","#dada95"]}]},H=[((g=n==null?void 0:n.allManagementKillHouseData)==null?void 0:g.inWarehouse)||0,(n==null?void 0:n.totalWeightHasntWarehouse)||0,(n==null?void 0:n.poultryHatchingTotalKilledWeight)||0],v={labels:["وزن وارد شده به انبار","وزن کل کشتار شده","وزن وارد نشده به انبار"],datasets:[{label:"",data:H.map(a=>(a/H.reduce((D,R)=>D+R,0)*100).toFixed(1)),backgroundColor:["#2D5FFF","#00CC99","#dada95"]}]},I=()=>{var a,D,R,Q;return[{name:"درصد توزیع به خارج استان",data:(a=n==null?void 0:n.managementKillHouseData)==null?void 0:a.map(k=>{const _=parseFloat((k==null?void 0:k.killHouseFreeBarQuantity)||0),S=parseFloat((k==null?void 0:k.allQuantity)||0);return S?parseFloat((_/S*100).toFixed(0)):0})},{name:"درصد توزیع به داخل استان",data:(D=n==null?void 0:n.managementKillHouseData)==null?void 0:D.map(k=>{const _=parseFloat((k==null?void 0:k.inProvinceQuantity)||0),S=parseFloat((k==null?void 0:k.allQuantity)||0);return S?parseFloat((_/S*100).toFixed(0)):0})},{name:"درصد مانده در انبار",data:(R=n==null?void 0:n.managementKillHouseData)==null?void 0:R.map(k=>{const _=parseFloat((k==null?void 0:k.product)||0),S=parseFloat((k==null?void 0:k.allQuantity)||0);return S?parseFloat((_/S*100).toFixed(0)):0})},{name:"درصد توزیع",data:(Q=n==null?void 0:n.managementKillHouseData)==null?void 0:Q.map(k=>(k==null?void 0:k.inProvinceQuantity)+(k==null?void 0:k.killHouseFreeBarQuantity)||0)}]},M=()=>{var a,D,R;return[{name:"وزن کل تخصیصات",data:(a=n==null?void 0:n.killHousesData)==null?void 0:a.map(Q=>(Q==null?void 0:Q.wightOfSteward)+(Q==null?void 0:Q.wightOfGuild)||0)},{name:"وزن تخصیصات به مباشرین",data:(D=n==null?void 0:n.killHousesData)==null?void 0:D.map(Q=>(Q==null?void 0:Q.wightOfSteward)||0)},{name:"وزن تخصیصات به صنوف",data:(R=n==null?void 0:n.killHousesData)==null?void 0:R.map(Q=>(Q==null?void 0:Q.wightOfGuild)||0)}]},K={labels:(p=n==null?void 0:n.killHousesData)==null?void 0:p.map(a=>a==null?void 0:a.name),datasets:[{label:"وزن توزیع خارج استان",data:(P=n==null?void 0:n.killHousesData)==null?void 0:P.map(a=>(a==null?void 0:a.outProvinceWeight)||0),backgroundColor:"rgba(255, 99, 132, 0.2)",borderColor:"rgba(255, 99, 132, 1)",borderWidth:1},{label:"وزن توزیع داخل استان",data:(U=n==null?void 0:n.killHousesData)==null?void 0:U.map(a=>(a==null?void 0:a.inProvinceWight)||0),backgroundColor:"rgba(54, 162, 235, 0.2)",borderColor:"rgba(54, 162, 235, 1)",borderWidth:1},{label:"کل وزن مانده به انبار",data:(Y=n==null?void 0:n.killHousesData)==null?void 0:Y.map(a=>a==null?void 0:a.totalWeight),backgroundColor:"rgba(75, 192, 192, 0.2)",borderColor:"rgba(75, 192, 192, 1)",borderWidth:1}]};return u.jsxs(s,{container:!0,xs:12,md:12,children:[u.jsxs(s,{container:!0,gap:1,sx:{padding:"8px",alignItems:"center"},children:[u.jsx(s,{children:u.jsx(iu,{label:"از تاریخ",renderInput:a=>u.jsx(lu,{...a,style:{width:"160px"},size:"small"}),value:o,onChange:a=>{A(X(a).format("YYYY-MM-DD"))}})}),u.jsx(s,{children:u.jsx(iu,{label:"تا تاریخ",renderInput:a=>u.jsx(lu,{...a,style:{width:"160px"},size:"small"}),value:h,onChange:a=>{y(X(a).format("YYYY-MM-DD"))}})})]}),u.jsxs(s,{container:!0,gap:1,justifyContent:"center",alignItems:"center",sx:{width:"100%",mt:W.SMALL},children:[u.jsxs(s,{item:!0,xs:12,md:5.9,sx:{display:"flex",border:"1px solid #CCCCCD",backgroundColor:"#F9F9FA",borderRadius:"20px",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"20px"},children:[u.jsx(i,{align:"right",sx:{color:"#2D5FFF"},variant:"body1",children:"عملکرد کشتارگاه ها در بخش توزیع"}),u.jsx(s,{sx:{height:"400px",width:"400px"},children:u.jsx(Ru,{data:B,options:d})}),u.jsx(s,{container:!0,sx:{display:"flex",flexWrap:"wrap",gap:"16px",padding:"10px"},children:[{label:"وزن وارد شده به انبار",value:(O=n==null?void 0:n.allManagementKillHouseData)==null?void 0:O.inWarehouse},{label:"وزن توزیع شده خارج استان",value:(z=n==null?void 0:n.allManagementKillHouseData)==null?void 0:z.freeBars},{label:"وزن توزیع شده داخل استان",value:(q=n==null?void 0:n.allManagementKillHouseData)==null?void 0:q.stewardAllocations},{label:"مانده انبار",value:(e=n==null?void 0:n.allManagementKillHouseData)==null?void 0:e.products}].map((a,D)=>{var R;return u.jsx(s,{item:!0,sx:{display:"flex",justifyContent:"center",flex:"1 1 calc(50% - 8px)",backgroundColor:"#E0E7FF",color:"#717171",borderRadius:"8px",p:2,boxSizing:"border-box"},children:u.jsxs(i,{sx:{display:"flex"},children:[a.label," : ",(R=a.value)==null?void 0:R.toLocaleString()]})},D)})})]}),u.jsxs(s,{item:!0,xs:12,md:5.9,sx:{display:"flex",border:"1px solid #CCCCCD",backgroundColor:"#F9F9FA",borderRadius:"20px",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"20px"},children:[u.jsx(i,{align:"left",sx:{color:"#2D5FFF"},variant:"body1",children:"عملکرد کشتارگاه ها در بخش ورود و خروج بارها به انبار"}),u.jsx(s,{sx:{height:"400px",width:"400px"},children:u.jsx(Ru,{data:v,options:d})}),u.jsx(s,{container:!0,sx:{display:"flex",flexWrap:"wrap",gap:"24px",padding:"10px"},children:[{label:"وزن وارد شده به انبار",value:(l=n==null?void 0:n.allManagementKillHouseData)==null?void 0:l.inWarehouse},{label:"وزن توزیع شده خارج استان",value:(x=n==null?void 0:n.allManagementKillHouseData)==null?void 0:x.freeBars},{label:"وزن توزیع شده داخل استان",value:(t=n==null?void 0:n.allManagementKillHouseData)==null?void 0:t.stewardAllocations},{label:"مانده انبار",value:(f=n==null?void 0:n.allManagementKillHouseData)==null?void 0:f.products}].map((a,D)=>{var R;return u.jsx(s,{item:!0,sx:{display:"flex",justifyContent:"center",flex:"1 1 calc(50% - 12px)",backgroundColor:"#E0E7FF",color:"#717171",borderRadius:"8px",p:2,boxSizing:"border-box"},children:u.jsxs(i,{sx:{display:"flex"},children:[a.label," : ",(R=a.value)==null?void 0:R.toLocaleString()]})},D)})})]})]}),((T=n==null?void 0:n.killHousesData)==null?void 0:T.length)>0&&u.jsx(s,{md:12,xs:12,container:!0,spacing:W.SMALL,sx:{justifyContent:"center",border:"1px solid #CCCCCD",backgroundColor:"#F9F9FA",borderRadius:"20px",marginTop:"9px",padding:"5px"},children:u.jsxs(s,{sx:{width:"100%",padding:"24px"},children:[u.jsx(i,{align:"left",sx:{color:"#2D5FFF",padding:"10px"},variant:"body1",children:"گزارش درصد خرید کشتارگاه های استان (بر اساس حجم)"}),u.jsx(s,{sx:{display:"flex",gap:"22px"},children:(N=n==null?void 0:n.killHousesData)==null?void 0:N.map((a,D)=>u.jsxs(s,{md:4,xs:12,spacing:4,style:{backgroundColor:D%2===0?"#2D5FFF1C":"#E6FAF5",border:"1px solid #ccc",borderRadius:"8px",margin:"10px",maxHeight:"250px",padding:"0"},children:[u.jsx(s,{style:{borderRadius:"8px",backgroundColor:D%2===0?"#6C8FFF":"#00CC99"},children:u.jsx(i,{variant:"caption",style:{color:"#fff"},children:a==null?void 0:a.name})}),u.jsxs(s,{style:{marginTop:"5px"},children:[u.jsx(i,{variant:"body2",style:{color:"#535353"},children:"درصد خرید داخل استان:"}),u.jsx(i,{style:{color:"#353535",fontSize:"24px",fontWeight:"400"},children:`${Math.floor(((a==null?void 0:a.inProvinceQuantity)||0)/((a==null?void 0:a.totalQuantity)||0)*100)||0}% `}),u.jsx(i,{variant:"body2",style:{color:"#535353"},children:"درصد خرید خارج استان:"}),u.jsx(i,{style:{color:"#353535",fontSize:"24px",fontWeight:"400"},children:`${Math.floor(((a==null?void 0:a.outProvinceQuantity)||0)/((a==null?void 0:a.totalQuantity)||0)*100)||0}% `})]})]},D))})]})}),((J=n==null?void 0:n.managementKillHouseData)==null?void 0:J.length)>0&&u.jsxs(s,{mt:2,xs:12,md:12,justifyContent:"center",alignItems:"center",height:"400px",sx:{border:"1px solid #CCCCCD",backgroundColor:"#F9F9FA",borderRadius:"20px"},children:[u.jsx(i,{align:"left",sx:{color:"#2D5FFF",padding:"20px"},variant:"body1",children:"گزارش عملکرد انبار و توزیع کشتارگاه های استان (بر اساس درصد)"}),u.jsx(e0,{type:"bar",group:!0,seperator:(c=n==null?void 0:n.managementKillHouseData)==null?void 0:c.map(a=>a==null?void 0:a.name),info:I()})]}),((b=n==null?void 0:n.killHousesData)==null?void 0:b.length)>0&&u.jsxs(s,{container:!0,gap:1,justifyContent:"center",alignItems:"center",sx:{width:"100%",marginTop:"9px"},children:[u.jsx(s,{item:!0,mt:2,md:5.9,xs:12,sx:{justifyContent:"center",border:"1px solid #CCCCCD",backgroundColor:"#F9F9FA",borderRadius:"20px",padding:"5px"},children:u.jsxs(s,{sx:{width:"100%",padding:"10px"},children:[u.jsx(i,{align:"left",sx:{color:"#2D5FFF"},variant:"body1",children:"گزارش درصد خرید کشتارگاه های استان (بر اساس وزن)"}),u.jsxs(s,{sx:{display:"flex",flexDirection:"column",gap:"2px"},children:[u.jsxs(s,{sx:{display:"flex",justifyContent:"space-around",color:"#717171"},children:[u.jsx(i,{children:"نام کشتارگاه"}),u.jsx(i,{children:"درصد خرید از استان"}),u.jsx(i,{children:"درصد خرید از خارج استان"})]}),n.killHousesData.map((a,D)=>u.jsxs(s,{item:!0,md:12,xs:12,spacing:6,style:{backgroundColor:D%2===0?"#E0E7FF":"#FFFFFF",border:"1px solid #ccc",borderRadius:"8px",height:"48px",display:"flex",justifyContent:"space-around",alignItems:"center"},children:[u.jsx(i,{children:a==null?void 0:a.name}),u.jsx(i,{children:(()=>{const R=parseFloat(a==null?void 0:a.totalWeight)||0,Q=parseFloat(a==null?void 0:a.inProvinceWight)||0;return R>0?`${(Q/R*100).toFixed(0)}%`:"0%"})()}),u.jsx(i,{children:(()=>{const R=parseFloat(a==null?void 0:a.totalWeight)||0,Q=parseFloat(a==null?void 0:a.outProvinceWeight)||0;return R>0?`${(Q/R*100).toFixed(0)}%`:"0%"})()})]},D))]})]})}),u.jsx(s,{item:!0,mt:2,md:5.9,xs:12,sx:{justifyContent:"center",border:"1px solid #CCCCCD",backgroundColor:"#F9F9FA",borderRadius:"20px",padding:"5px"},children:((Z=n==null?void 0:n.killHousesData)==null?void 0:Z.length)>0&&u.jsxs(s,{sx:{width:"100%",padding:"10px"},children:[u.jsx(i,{align:"left",sx:{color:"#2D5FFF"},variant:"body1",children:"گزارش کلی عملکرد توزیع به مباشرین و صنوف استان"}),u.jsxs(s,{sx:{display:"flex",flexDirection:"column",gap:"2px"},children:[u.jsxs(s,{sx:{display:"flex",justifyContent:"space-around",color:"#717171"},children:[u.jsx(i,{children:"نام کشتارگاه"}),u.jsx(i,{children:"تعداد تخصیصات به مباشرین"}),u.jsx(i,{children:"تعداد تخصیصات به صنوف"})]}),n.killHousesData.map((a,D)=>u.jsxs(s,{md:12,xs:12,spacing:6,style:{backgroundColor:D%2===0?"#E0E7FF":"#FFFFFF",border:"1px solid #ccc",borderRadius:"8px",height:"48px",display:"flex",justifyContent:"space-around",alignItems:"center"},children:[u.jsx(i,{children:a==null?void 0:a.name}),u.jsx(i,{children:a==null?void 0:a.lenOfSteward}),u.jsx(i,{children:a==null?void 0:a.lenOfGuild})]},D))]})]})})]}),((V=n==null?void 0:n.managementKillHouseData)==null?void 0:V.length)>0&&u.jsx(s,{container:!0,md:12,xs:12,children:u.jsxs(s,{item:!0,mt:2,xs:12,md:12,justifyContent:"center",alignItems:"center",sx:{border:"1px solid #CCCCCD",backgroundColor:"#F9F9FA",borderRadius:"20px"},children:[u.jsx(i,{align:"left",sx:{color:"#2D5FFF",padding:"10px"},variant:"body1",children:"گزارش کلی عملکرد توزیع به مباشرین و صنوف استان (بر اساس وزن)"}),u.jsx(s,{container:!0,justifyContent:"center",sx:{maxHeight:"400px"},children:u.jsx(a0,{data:K,options:F})})]})}),u.jsxs(s,{container:!0,gap:1,justifyContent:"center",alignItems:"center",sx:{width:"100%"},children:[u.jsx(s,{item:!0,mt:2,md:5.9,xs:12,sx:{justifyContent:"center",border:"1px solid #CCCCCD",backgroundColor:"#F9F9FA",borderRadius:"20px",padding:"5px"},children:u.jsxs(s,{sx:{width:"100%",padding:"10px"},children:[u.jsx(i,{align:"left",sx:{color:"#2D5FFF",padding:"10px"},variant:"body1",children:"گزارش درصد خرید کشتارگاه های استان (بر اساس وزن)"}),u.jsx(s,{sx:{height:"400px"},children:u.jsx(e0,{type:"bar",group:!0,seperator:(nu=n==null?void 0:n.killHousesData)==null?void 0:nu.map(a=>a==null?void 0:a.name),info:M()})})]})}),u.jsx(s,{item:!0,mt:2,md:5.9,xs:12,sx:{justifyContent:"center",border:"1px solid #CCCCCD",backgroundColor:"#F9F9FA",borderRadius:"20px",padding:"5px",height:"472px"},children:u.jsxs(s,{sx:{width:"100%",padding:"10px"},children:[u.jsx(i,{align:"left",sx:{color:"#2D5FFF",padding:"10px"},variant:"body1",children:"گزارش کلی عملکرد توزیع به مباشرین و صنوف استان (درصد)"}),u.jsxs(s,{sx:{display:"flex",flexDirection:"column",gap:"2px"},children:[u.jsxs(s,{sx:{display:"flex",justifyContent:"space-around",color:"#717171"},children:[u.jsx(i,{children:"نام کشتارگاه"}),u.jsx(i,{children:"تعداد تخصیصات به مباشرین"}),u.jsx(i,{children:"تعداد تخصیصات به صنوف"})]}),(ou=n==null?void 0:n.killHousesData)==null?void 0:ou.map((a,D)=>u.jsxs(s,{md:12,xs:12,spacing:6,style:{backgroundColor:D%2===0?"#E0E7FF":"#FFFFFF",border:"1px solid #ccc",borderRadius:"8px",height:"48px",display:"flex",justifyContent:"space-around",alignItems:"center"},children:[u.jsx(i,{children:a==null?void 0:a.name}),u.jsx(i,{children:(()=>{const R=parseFloat(a==null?void 0:a.wightOfSteward)||0,Q=parseFloat(a==null?void 0:a.wightOfGuild)||0,k=R+Q,_=parseFloat(a==null?void 0:a.lenOfSteward)||0;return k>0?`${(_/k*100).toFixed(0)}%`:"0%"})()}),u.jsx(i,{children:(()=>{const R=parseFloat((a==null?void 0:a.wightOfSteward)+(a==null?void 0:a.wightOfGuild))||0,Q=parseFloat(a==null?void 0:a.lenOfGuild)||0;return R>0?`${(Q/R*100).toFixed(0)}%`:"0%"})()})]},D))]})]})})]})]})},i0=su("DASHBOARD_GET_EQUIVALENT_INFO_SERVICE",async(r,{dispatch:o})=>{o(uu());const{data:A,status:h}=await ru.get("kill-house-comparative-info",{params:r});return o(eu()),{data:A,status:h}}),I6=()=>{var O,z,q;const[r,,o,A,h,y]=E.useContext(Fu),[n,j]=E.useState(""),[d,F]=E.useState([]),[w,B]=E.useState([]),[H,v]=E.useState(!1),I=cu(),M={rasad:"#5b5b9d",quarantine:"#bf5757"};function K(e){if(!e)return"";try{const l=new Date(e);if(isNaN(l.getTime()))return"";l.setDate(l.getDate()-1);const x=l.getFullYear(),t=String(l.getMonth()+1).padStart(2,"0"),f=String(l.getDate()).padStart(2,"0");return`${x}-${t}-${f}`}catch(l){return console.error("Error subtracting one day:",l),""}}const m={data:d&&Array.isArray(d)?d.map(e=>(e==null?void 0:e.name)||"").filter(e=>e):[],series:[{name:"رصدیار",type:"line",data:d&&Array.isArray(d)?d.map(e=>{var x;const l=parseInt((x=e==null?void 0:e.info)==null?void 0:x.totalLiveBarsQuantity);return isNaN(l)?0:l}):[],itemStyle:{color:"#5470c6"}},{name:"قرنطینه",type:"line",data:d&&Array.isArray(d)?d.map(e=>{var x,t,f;const l=parseInt((f=(t=(x=e==null?void 0:e.info)==null?void 0:x.killHouseRsiInfo)==null?void 0:t.info)==null?void 0:f.totalWareHouse);return isNaN(l)?0:l}):[],itemStyle:{color:"#fac858"}}]},L={data:d&&Array.isArray(d)?d.map(e=>(e==null?void 0:e.name)||"").filter(e=>e):[],series:[{name:"رصدیار",type:"line",data:d&&Array.isArray(d)?d.map(e=>{var x;const l=parseInt((x=e==null?void 0:e.info)==null?void 0:x.totalKillHouseWarehouseCacassesEnteredWeight);return isNaN(l)?0:l}):[],itemStyle:{color:"#5470c6"}},{name:"قرنطینه",type:"line",data:d&&Array.isArray(d)?d.map(e=>{var x,t,f;const l=parseInt((f=(t=(x=e==null?void 0:e.info)==null?void 0:x.killHouseRsiInfo)==null?void 0:t.info)==null?void 0:f.totalBarsWight);return isNaN(l)?0:l}):[],itemStyle:{color:"#fac858"}}]},G=()=>{if(!o)return"";if(o===h)return Du(K(o))||"";{const e=Du(K(o))||"",l=h&&Du(K(h))||"";return`${e} تا ${l}`}},g={title:{text:"گزارش کل توزیع لاشه رصدیار و قرنطینه ",textStyle:{fontFamily:"iranyekan",fontSize:16},right:"center"},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},textStyle:{fontFamily:"iranyekan",fontSize:12},backgroundColor:"rgba(255, 255, 255, 0.95)",borderColor:"#ddd",borderWidth:1,formatter:function(e){var x;if(!e||!Array.isArray(e)||e.length===0)return"";let l=`
${((x=e[0])==null?void 0:x.name)||""}
`;return e.forEach(t=>{if(t){const f=t.value!==void 0&&t.value!==null?t.value.toLocaleString():"0";l+=` +
+ + ${t.seriesName||""}: ${f} +
+ `}}),l}},grid:{left:"3%",right:"4%",bottom:"15%",top:"15%",containLabel:!0},xAxis:{type:"category",data:d&&Array.isArray(d)?d.map(e=>(e==null?void 0:e.name)||"").filter(e=>e):[],axisLabel:{fontFamily:"iranyekan"},name:"کشتارگاه"},yAxis:{type:"value",axisLabel:{fontFamily:"iranyekan",formatter:"{value}"},name:"وزن"},series:[{name:"توزیع داخل استان (R)",type:"bar",data:d&&Array.isArray(d)?d.map(e=>{var l;return((l=e==null?void 0:e.info)==null?void 0:l.totalKillHouseAllocationsWeight)||0}):[],itemStyle:{color:"#fac858"},emphasis:{focus:"series"}},{name:"توزیع خارج استان (R)",type:"bar",data:d&&Array.isArray(d)?d.map(e=>{var l;return((l=e==null?void 0:e.info)==null?void 0:l.totalKillHouseFreeSaleBarWeight)||0}):[],itemStyle:{color:"#c4a051"},emphasis:{focus:"series"}},{name:"توزیع داخل استان (G)",type:"bar",data:d&&Array.isArray(d)?d.map(e=>{var x,t,f;const l=parseInt((f=(t=(x=e==null?void 0:e.info)==null?void 0:x.killHouseRsiInfo)==null?void 0:t.info)==null?void 0:f.totalInputBarsWight);return isNaN(l)?0:l}):[],itemStyle:{color:"#5470c6"},emphasis:{focus:"series"}},{name:"توزیع خارج استان (G)",type:"bar",data:d&&Array.isArray(d)?d.map(e=>{var x,t,f;const l=parseInt((f=(t=(x=e==null?void 0:e.info)==null?void 0:x.killHouseRsiInfo)==null?void 0:t.info)==null?void 0:f.totalOutputBarsWight);return isNaN(l)?0:l}):[],itemStyle:{color:"#364982"},emphasis:{focus:"series"}}]},p={title:{text:`گزارش حجم کشتار زنده قرنطینه و رصدیار ${G()}`,textStyle:{fontFamily:"iranyekan",fontSize:16},right:"center"},tooltip:{trigger:"axis",textStyle:{fontFamily:"iranyekan"}},grid:{left:"3%",right:"4%",bottom:"15%",top:"15%",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:m.data,axisLabel:{fontFamily:"iranyekan"},name:"کشتارگاه"},yAxis:{type:"value",axisLabel:{fontFamily:"iranyekan",formatter:"{value}"},name:"حجم"},series:m!=null&&m.series&&Array.isArray(m.series)?m.series.map(e=>({...e,smooth:!0,lineStyle:{width:3},symbolSize:8})):[]},P={title:{text:"گزارش کل توزیع لاشه رصدیار و قرنطینه",textStyle:{fontFamily:"iranyekan",fontSize:16},right:"center"},tooltip:{trigger:"axis",textStyle:{fontFamily:"iranyekan"}},grid:{left:"3%",right:"4%",bottom:"15%",top:"15%",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:L.data,axisLabel:{fontFamily:"iranyekan"},name:"کشتارگاه"},yAxis:{type:"value",axisLabel:{fontFamily:"iranyekan",formatter:"{value}"},name:"وزن"},series:L!=null&&L.series&&Array.isArray(L.series)?L.series.map(e=>({...e,smooth:!0,lineStyle:{width:3},symbolSize:8})):[]};E.useEffect(()=>{const e=X(new Date).format("YYYY-MM-DD");A(e),y(e)},[]);const U=e=>{j(e.target.value)};E.useEffect(()=>{if(!d||!Array.isArray(d)){B([]);return}const e=t=>{const f=parseInt(t);return isNaN(f)?0:f},l=t=>e(t).toLocaleString(),x=d.map((t,f)=>{var ou,a,D,R,Q,k,_,S,du,Cu,gu,hu,Au,xu,pu,yu,Yu,Ou,zu,Gu,Pu,Uu,qu,Tu,Nu,Vu,Ju,Zu,Xu,Su,$u;const T=e((D=(a=(ou=t==null?void 0:t.info)==null?void 0:ou.killHouseRsiInfo)==null?void 0:a.info)==null?void 0:D.totalBarsWight),N=e((k=(Q=(R=t==null?void 0:t.info)==null?void 0:R.killHouseRsiInfo)==null?void 0:Q.info)==null?void 0:k.totalWareHouse),J=e((du=(S=(_=t==null?void 0:t.info)==null?void 0:_.killHouseRsiInfo)==null?void 0:S.info)==null?void 0:du.totalInputBarsWight),c=e((hu=(gu=(Cu=t==null?void 0:t.info)==null?void 0:Cu.killHouseRsiInfo)==null?void 0:gu.info)==null?void 0:hu.totalOutputBarsWight),b=e((Au=t==null?void 0:t.info)==null?void 0:Au.totalLiveBarsQuantity),Z=e((xu=t==null?void 0:t.info)==null?void 0:xu.totalEnteredWarehouseBarsQuantity),V=e((pu=t==null?void 0:t.info)==null?void 0:pu.totalKillHouseWarehouseCacassesEnteredWeight),nu=e((yu=t==null?void 0:t.info)==null?void 0:yu.totalOutputWeight);return[f+1,(t==null?void 0:t.name)||"",l(N),l(Math.floor(N*2.6)),l(T),T&&N?"%"+Math.floor(T*100/(N*2.6*.75)):0,l(J),J&&T?"%"+(J*100/T).toFixed(1):0,l(c),c&&T?"%"+(c*100/T).toFixed(1):0,l(b),l((Yu=t==null?void 0:t.info)==null?void 0:Yu.totalKillHouseRequestGovernmentalQuantity),l((Ou=t==null?void 0:t.info)==null?void 0:Ou.totalKillHouseRequestFreeQuantity),l((zu=t==null?void 0:t.info)==null?void 0:zu.totalKillHouseFreeBarLiveTotalQuantity),l(Z),Z&&b?"%"+Math.floor(Z*100/b):0,l((Gu=t==null?void 0:t.info)==null?void 0:Gu.totalEnteredWarehouseBarsWeight),l(V),l((Pu=t==null?void 0:t.info)==null?void 0:Pu.totalKillHouseWarehouseGovermentalCacassesEnteredWeight),l((Uu=t==null?void 0:t.info)==null?void 0:Uu.totalKillHouseWarehouseFreeCacassesEnteredWeight),l(nu),nu&&V?"%"+Math.floor(nu*100/V):0,l((qu=t==null?void 0:t.info)==null?void 0:qu.totalKillHouseAllocationsWeight),l((Tu=t==null?void 0:t.info)==null?void 0:Tu.totalKillHouseFreeSaleBarWeight),l((Nu=t==null?void 0:t.info)==null?void 0:Nu.totalOtherOutputWeight),l((Vu=t==null?void 0:t.info)==null?void 0:Vu.totalRemainWeight),l((Ju=t==null?void 0:t.info)==null?void 0:Ju.totalRemainFreeWeight),l((Zu=t==null?void 0:t.info)==null?void 0:Zu.totalRemainGovernmentalWeight),l((Xu=t==null?void 0:t.info)==null?void 0:Xu.lastTotalRemainWeight),l((Su=t==null?void 0:t.info)==null?void 0:Su.lastTotalRemainGovernmentalWeight),l(($u=t==null?void 0:t.info)==null?void 0:$u.lastTotalRemainFreeWeight)]});B(x)},[d]),E.useEffect(()=>{H||(I(uu()),I(i0({date1:o,date2:h,filter:"search",value:n||null,role:Eu()})).then(e=>{var l,x,t,f;e!=null&&e.error?((((l=e.error)==null?void 0:l.message)||"").includes("500")||((x=e.error)==null?void 0:x.status)===500||((t=e.error)==null?void 0:t.statusCode)===500?(v(!0),r({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):r({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),F([])):(f=e==null?void 0:e.payload)!=null&&f.data?(v(!1),F(Array.isArray(e.payload.data)?e.payload.data:[])):F([])}).catch(e=>{console.error("Error fetching equivalent info:",e),((e==null?void 0:e.message)||"").includes("500")||(e==null?void 0:e.status)===500||(e==null?void 0:e.statusCode)===500?(v(!0),r({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):r({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),F([])}).finally(()=>{I(eu())}))},[I,o,h,r]),E.useEffect(()=>{v(!1)},[o,h]);const Y=async e=>{e.preventDefault(),v(!1),I(uu()),I(i0({date1:o,date2:h,filter:"search",value:n||null,role:Eu()})).then(l=>{var x,t,f,T;l!=null&&l.error?((((x=l.error)==null?void 0:x.message)||"").includes("500")||((t=l.error)==null?void 0:t.status)===500||((f=l.error)==null?void 0:f.statusCode)===500?(v(!0),r({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):r({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),F([])):(T=l==null?void 0:l.payload)!=null&&T.data?(v(!1),F(Array.isArray(l.payload.data)?l.payload.data:[])):F([])}).catch(l=>{console.error("Error fetching equivalent info:",l),((l==null?void 0:l.message)||"").includes("500")||(l==null?void 0:l.status)===500||(l==null?void 0:l.statusCode)===500?(v(!0),r({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):r({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),F([])}).finally(()=>{I(eu())})};return u.jsxs(s,{container:!0,justifyContent:"center",alignItems:"center",xs:12,direction:"column",mt:2,children:[u.jsxs(s,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(s,{children:u.jsx(iu,{label:"از تاریخ",id:"date",renderInput:e=>u.jsx(lu,{size:"small",style:{width:"160px"},...e}),value:o,onChange:e=>{A(X(e).format("YYYY-MM-DD"))}})}),u.jsx(s,{children:u.jsx(iu,{label:"تا تاریخ",id:"date",renderInput:e=>u.jsx(lu,{size:"small",style:{width:"160px"},...e}),value:h,onChange:e=>{y(X(e).format("YYYY-MM-DD"))}})}),u.jsx(s,{children:u.jsxs("form",{onSubmit:Y,children:[u.jsx(lu,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:U}),u.jsx(au,{type:"submit",onClick:Y,endIcon:u.jsx(P0,{}),children:"جستجو"})]})})]}),u.jsxs(s,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:1,children:[u.jsxs(s,{container:!0,xs:12,spacing:1,mt:2,children:[u.jsx(s,{item:!0,children:u.jsx(wu,{label:"رصدیار (R)",size:"small",sx:{backgroundColor:M.rasad,color:"white",fontSize:"0.75rem"}})}),u.jsx(s,{item:!0,children:u.jsx(wu,{label:"قرنطینه (G)",size:"small",sx:{backgroundColor:M.quarantine,color:"white",fontSize:"0.75rem"}})})]}),u.jsxs(s,{container:!0,alignItems:"center",justifyContent:"start",xs:12,gap:1,sx:{color:"red"},children:[u.jsx(r0,{size:24}),u.jsx(i,{variant:"caption",children:"ملاک حجم، قطعه و ملاک وزن، کیلوگرم میباشد."})]}),u.jsxs(s,{container:!0,alignItems:"start",justifyContent:"start",xs:12,gap:1,sx:{color:"red",display:"flex"},children:[u.jsx(r0,{size:24}),u.jsxs(i,{variant:"caption",textAlign:"left",sx:{maxWidth:{xs:"80%",sm:"90%"}},children:["اطلاعات کشتار زنده مربوط به یک روز قبل (",G(),") می باشد."]})]}),u.jsx(bu,{title:"مقایسه اطلاعات کشتار رصدیار با قرنطینه",paginated:!0,columns:["ردیف","کشتارگاه","حجم بارهای زنده (G)","وزن تقریبی بار زنده (G)","کل وزن توزیع لاشه (G)","درصد توزیع کل لاشه (G)","وزن توزیع لاشه داخل استان (G)","درصد توزیع داخل استان (G)","وزن توزیع لاشه خارج استان (G)","درصد توزیع خارج استان (G)","کل حجم بارهای زنده (R)","حجم بار زنده دولتی (R)","حجم بار زنده آزاد (R)","حجم بار خرید خارج استان (R)","حجم بارهای ورودی به انبار (R)","درصد ورودی به انبار (R)","وزن بارهای ورودی به انبار (R)","وزن لاشه (R)","وزن لاشه دولتی (R)","وزن لاشه آزاد (R)","کل وزن توزیع لاشه (R)","درصد توزیع لاشه (R)","وزن توزیع لاشه داخل استان (R)","وزن توزیع لاشه خارج استان (R)","وزن سایر توزیع (R)","مانده لاشه (R)","مانده لاشه آزاد (R)","مانده لاشه دولتی (R)","انبار گذشته (R)","انبار دولتی گذشته (R)","انبار آزاد گذشته (R)"],data:w,CustomColumnsColor:[{key:"(G)",color:M.quarantine,text:"white"},{key:"(R)",color:M.rasad,text:"white"},{key:"",color:"gray",text:"white"}],hasSum:!0,hasSumColumn:"کشتارگاه"})]}),u.jsxs(s,{item:!0,xs:12,style:{height:"400px"},children:[u.jsx(ku,{option:g,style:{height:"100%",width:"100%"},opts:{renderer:"svg"}}),u.jsx(s,{xs:12,container:!0,justifyContent:"center",gap:2,alignItems:"center",children:(O=g==null?void 0:g.series)==null?void 0:O.map((e,l)=>{var x;return u.jsxs(s,{container:!0,gap:1,alignItems:"center",children:[u.jsx(s,{children:u.jsx(i,{variant:"caption",children:e==null?void 0:e.name})}),u.jsx(s,{sx:{width:"20px",height:"20px",background:(x=e==null?void 0:e.itemStyle)==null?void 0:x.color}})]},l)})})]}),u.jsxs(s,{container:!0,xs:12,spacing:3,mt:6,children:[u.jsxs(s,{container:!0,gap:1,xs:12,md:6,style:{height:"400px"},justifyContent:"center",alignItems:"center",children:[u.jsx(ku,{option:p,style:{height:"100%",width:"100%"},opts:{renderer:"svg"}}),(z=m==null?void 0:m.series)==null?void 0:z.map((e,l)=>{var x;return u.jsxs(s,{container:!0,gap:1,alignItems:"center",children:[u.jsx(s,{children:u.jsx(i,{variant:"caption",children:e==null?void 0:e.name})}),u.jsx(s,{sx:{width:"20px",height:"20px",background:(x=e==null?void 0:e.itemStyle)==null?void 0:x.color}})]},l)})]}),u.jsxs(s,{container:!0,gap:1,xs:12,md:6,style:{height:"400px"},justifyContent:"center",alignItems:"center",children:[u.jsx(ku,{option:P,style:{height:"100%",width:"100%"},opts:{renderer:"svg"}}),(q=L==null?void 0:L.series)==null?void 0:q.map((e,l)=>{var x;return u.jsxs(s,{container:!0,gap:1,alignItems:"center",children:[u.jsx(s,{children:u.jsx(i,{variant:"caption",children:e==null?void 0:e.name})}),u.jsx(s,{sx:{width:"20px",height:"20px",background:(x=e==null?void 0:e.itemStyle)==null?void 0:x.color}})]},l)})]})]}),u.jsx(s,{mt:4,children:"‌‌‌ ‌"})]})},L6=()=>{const[r,o]=E.useState(0),A=(h,y)=>{o(y)};return u.jsx(s,{container:!0,justifyContent:"center",alignItems:"center",children:u.jsxs(s,{item:!0,xs:12,sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[u.jsxs(E0,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:r,onChange:A,sx:{maxWidth:"100vw",overflowX:"auto",borderBottom:{xs:"1px solid #E0E0E0",sm:"none"}},children:[u.jsx(ju,{label:"اطلاعات جامع",value:0}),u.jsx(ju,{label:"مقایسه",value:4}),u.jsx(ju,{label:"اطلاعات کشتار",value:1}),u.jsx(ju,{label:"پایش کشتار",value:2})]}),u.jsxs(s,{container:!0,xs:12,justifyContent:"center",alignItems:"center",p:1,children:[r===0&&u.jsx(a6,{}),r===1&&u.jsx(p6,{}),r===2&&u.jsx(E6,{}),r===3&&u.jsx(k6,{}),r===4&&u.jsx(I6,{})]})]})})},_6=()=>{const{pathname:r}=H0();return u.jsx(u.Fragment,{children:u.jsx(C,{display:"flex",justifyContent:"center",mt:4,children:u.jsx(s,{container:!0,direction:"column",xs:12,sm:12,md:10,lg:10,children:(r.includes(I0)||r.includes(L0)||r.includes(R0)||r.includes(W0))&&u.jsx(L6,{})})})})};export{_6 as default}; diff --git a/build/assets/Delete-C5MyLelE.js b/build/assets/Delete-C5MyLelE.js new file mode 100644 index 0000000..636f1f6 --- /dev/null +++ b/build/assets/Delete-C5MyLelE.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(a()),l=t;u=e.default=(0,i.default)((0,l.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete");export{e as D,u as d}; diff --git a/build/assets/DeleteOutline-DlhNLp0A.js b/build/assets/DeleteOutline-DlhNLp0A.js new file mode 100644 index 0000000..a9be0a6 --- /dev/null +++ b/build/assets/DeleteOutline-DlhNLp0A.js @@ -0,0 +1 @@ +import{i as t,j as r}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},u=t;Object.defineProperty(e,"__esModule",{value:!0});var i=e.default=void 0,o=u(a()),l=r;i=e.default=(0,o.default)((0,l.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline");export{i as d}; diff --git a/build/assets/DeleteOutlineOutlined-G071NcE9.js b/build/assets/DeleteOutlineOutlined-G071NcE9.js new file mode 100644 index 0000000..b795e0e --- /dev/null +++ b/build/assets/DeleteOutlineOutlined-G071NcE9.js @@ -0,0 +1 @@ +import{i as t,j as r}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},u=t;Object.defineProperty(e,"__esModule",{value:!0});var i=e.default=void 0,l=u(a()),o=r;i=e.default=(0,l.default)((0,o.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutlineOutlined");export{i as d}; diff --git a/build/assets/DialogAlert-BfXcr-Kr.js b/build/assets/DialogAlert-BfXcr-Kr.js new file mode 100644 index 0000000..11ec63d --- /dev/null +++ b/build/assets/DialogAlert-BfXcr-Kr.js @@ -0,0 +1 @@ +import{j as e,aX as T,T as g,ab as h,br as y,ad as j,c3 as u,a4 as m,c4 as f,p as s}from"./mui-vendor-CkIVaoQP.js";import{r as l}from"./react-vendor-CmFgShSM.js";import{G as a,S as C}from"./index-CeyyVc1v.js";const b=l.forwardRef(function(o,r){return e.jsx(f,{direction:"up",ref:r,...o})});function D({title:i,content:o,actions:r,btnTitle:p,isAccepted:c}){const[d,t]=l.useState(!1),x=()=>{t(!0)},n=()=>{t(!1)};return e.jsxs("div",{children:[e.jsx(a,{container:!0,onClick:x,children:e.jsxs(a,{display:"flex",alignItems:"center",gap:C.TINY,children:[e.jsx(T,{sx:{padding:"0px"},checked:c,color:"success"}),e.jsx(g,{style:{cursor:"pointer"},borderBottom:"1px solid",color:"primary",children:p})]})}),e.jsxs(h,{open:d,TransitionComponent:b,keepMounted:!0,onClose:n,"aria-describedby":"alert-dialog-slide-description",children:[e.jsx(y,{children:i}),e.jsx(j,{children:e.jsx(u,{id:"alert-dialog-slide-description",children:o})}),e.jsx(m,{onClick:n,children:r})]})]})}D.propTypes={title:s.PropTypes.string,content:s.PropTypes.string,btnTitle:s.PropTypes.string,isAccepted:s.PropTypes.bool,actions:s.PropTypes.array};export{D}; diff --git a/build/assets/DiffrenceKillerPage-KlaL3_Gy.js b/build/assets/DiffrenceKillerPage-KlaL3_Gy.js new file mode 100644 index 0000000..27a51a1 --- /dev/null +++ b/build/assets/DiffrenceKillerPage-KlaL3_Gy.js @@ -0,0 +1 @@ +import{j as u,I as X,b0 as Cu,d as hu,B as v,bh as du,al as Q,ak as T,a9 as pu,T as y,b as gu}from"./mui-vendor-CkIVaoQP.js";import{G as i,S as q,ho as eu,hp as ru,hq as au,hr as tu,X as d,hs as su,ht as nu,hu as ou,hv as cu,L as b,j as L,h as _,A as lu,O as Au,C as J,fn as Eu,c as xu,M as w,b as yu,u as _u,N as iu,_ as ju,hw as Ru,hx as Su,hy as Iu,hz as Lu}from"./index-CeyyVc1v.js";import{N as Z}from"./NavLink-D2GD_ItM.js";import{L as uu}from"./LinkItem-DT6qswcs.js";import{m as fu}from"./index.esm-CjWvmHks.js";import{a as Fu}from"./index.esm-fCjAhNPc.js";import{P as Tu}from"./ProvinceBarDifference-CBv5I_nz.js";import{B as vu}from"./BackButton-Crzr7NMa.js";import{r as h,f as bu}from"./react-vendor-CmFgShSM.js";import{a as U,u as B,f as Du}from"./redux-vendor-B7uoacJt.js";import{R as Nu}from"./index.esm-Bu7XMDZU.js";import{R as ku}from"./ResponsiveTable-w7hk7Uq8.js";import{d as Ou}from"./Tune-D4M2CAhp.js";import{d as Hu}from"./Delete-C5MyLelE.js";import{b as qu}from"./aviculture-get-hatching-data-DsjDNd82.js";import"./iconBase-BEJYyZsk.js";import"./toBase64-BzgTOHsW.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./resizeImage-Csf2MO3w.js";import"./Edit-CqBj1Y2L.js";import"./ShowImage-CqhU2hmk.js";import"./Download-DQ-VVIaV.js";import"./Close-_jAEIgMD.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const Uu=()=>u.jsxs(i,{container:!0,gap:q.SMALL,p:q.SMALL,direction:{xs:"row",md:"row"},justifyContent:"center",children:[u.jsx(Z,{to:d()==="AdminX"?eu:d()==="SuperAdmin"?ru:d()==="ProvinceOperator"?au:d()==="CityOperator"?tu:"",children:u.jsx(uu,{icon:u.jsx(fu,{size:30,color:"#244CCC"}),title:"اختلاف کشتار در کشتارگاه"})}),u.jsx(Z,{to:d()==="AdminX"?su:d()==="SuperAdmin"?nu:d()==="ProvinceOperator"?ou:d()==="CityOperator"?cu:"",children:u.jsx(uu,{icon:u.jsx(Fu,{size:30,color:"#244CCC"}),title:"افزایش حجم جوجه ریزی"})})]}),wu=U("CITY_INCREASE_HATCHING_SERVICE",async(n,{dispatch:o})=>{try{o(b());const{data:a,status:l}=await L.post("hatching-increase-request/",n);return o(_()),{data:a,status:l}}catch(a){return o(_()),{error:a.response.data.result}}}),Bu=U("CITY_EDIT_INCREASE_HATCHING_SERVICE",async(n,{dispatch:o})=>{try{o(b());const{data:a,status:l}=await L.put("hatching-increase-request/0/",n);return o(_()),{data:a,status:l}}catch(a){return o(_()),{error:a.response.data.result}}}),Gu=U("CITY_DELETE_INCREASE_HATCHING_SERVICE",async(n,{dispatch:o})=>{o(b());try{const{data:a,status:l}=await L.delete(`/hatching-increase-request/0/?key=${n}`);return o(_()),{data:a,status:l}}catch(a){return o(_()),{error:a.response.data.result}}});U("CITY_INCREASE_GET_HATCHING_SERVICE",async n=>{const{data:o,status:a}=await L.get("hatching-increase-request/",{params:n});return{data:o,status:a}});const $u=({item:n,updateTable:o})=>{const a=B(),[l,j]=h.useState(null),[s]=h.useContext(lu),S=E=>{j(E.currentTarget)},p=()=>{j(null)},g=!!l,A=g?"popover":void 0;return u.jsxs("div",{children:[u.jsx(X,{"aria-describedby":A,variant:"contained",color:"primary",onClick:S,children:u.jsx(Ou,{})}),u.jsx(Cu,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:A,open:g,anchorEl:l,onClose:p,children:u.jsx("div",{style:{padding:"20px"},children:u.jsx(i,{container:!0,direction:"column",children:u.jsx(hu,{title:"حذف",placement:"left-start",children:u.jsx(X,{"aria-label":"delete",color:"error",onClick:()=>{p(),a(Au({title:"آیا مطمئن هستید؟",content:u.jsxs(i,{container:!0,spacing:2,children:[u.jsx(i,{item:!0,children:u.jsx(v,{variant:"contained",color:"error",onClick:()=>{a(Gu(n==null?void 0:n.key)).then(E=>{E.payload.error?s({vertical:"top",horizontal:"center",msg:E.payload.error,severity:"error"}):(o(),a(J()),s({vertical:"top",horizontal:"center",msg:E.payload.data.result,severity:"success"}))})},children:"تایید"})}),u.jsx(i,{item:!0,children:u.jsx(v,{onClick:()=>{a(J())},children:"لغو"})})]})}))},children:u.jsx(Hu,{})})})})})})]})},Mu=({updateTable:n,isEdit:o,item:a})=>{var D,N,I,k,O,f,F,C,e;const[l,j]=h.useState([]),[s,S]=h.useState(null),[p]=h.useContext(lu),g=B(),{slaughterGetPoultries:A}=Du(t=>t.slaughterSlice);h.useEffect(()=>{g(Eu())},[]);const E={poultry:(a==null?void 0:a.poultrykey)||null,hatching_key:(a==null?void 0:a.hatchingkey)||null,quantity:(a==null?void 0:a.quantity)||null,message:(a==null?void 0:a.message)||null},R=xu().shape({poultry:w().required("انتخاب مرغدار الزامی است"),hatching_key:w().required("انتخاب محل پرورش الزامی است"),quantity:yu().typeError("عدد وارد کنید").required("حجم الزامی است"),message:w().typeError("پر کردن این فیلد الزامی است").required("پیام الزامی است")}),r=_u({initialValues:E,validationSchema:R});return h.useEffect(()=>{r.values.poultry&&g(qu(r.values.poultry,{increase:!0})).then(t=>{j(t.payload.data||[])})},[r.values.poultry]),u.jsxs(du,{spacing:2,children:[u.jsx(Q,{id:"poultry",disableClearable:!0,options:A==null?void 0:A.map(t=>{var c,x;return{label:`${t.unitName} (${(c=t.user)==null?void 0:c.fullname})(${(x=t.user)==null?void 0:x.mobile})`,value:t.key}}),getOptionLabel:t=>t.label,onChange:(t,c)=>{r.setFieldValue("poultry",c.value),r.setFieldValue("hatching_key",null)},renderInput:t=>u.jsx(T,{...t,label:"انتخاب مرغدار",error:r.touched.poultry&&!!r.errors.poultry,helperText:r.touched.poultry&&r.errors.poultry})}),u.jsx(Q,{id:"hatching_key",disableClearable:!0,disabled:!r.values.poultry,options:l==null?void 0:l.map(t=>{var c;return{label:((c=t==null?void 0:t.poultry)==null?void 0:c.unitName)||"-",value:t==null?void 0:t.key}}),getOptionLabel:t=>t.label,onChange:(t,c)=>{r.setFieldValue("hatching_key",c==null?void 0:c.value);const x=l.find(H=>H.key===(c==null?void 0:c.value));S(x)},renderInput:t=>u.jsx(T,{...t,label:"انتخاب محل پرورش",error:r.touched.hatching_key&&!!r.errors.hatching_key,helperText:r.touched.hatching_key&&r.errors.hatching_key})}),s&&u.jsxs(pu,{variant:"outlined",sx:{p:2,borderRadius:2},children:[u.jsxs(y,{children:["شماره مجوز جوجه ریزی:"," ",(D=s==null?void 0:s.licenceNumber)==null?void 0:D.toLocaleString()]}),u.jsxs(y,{children:["شناسه یکتا مرغدار :"," ",(I=(N=s==null?void 0:s.poultry)==null?void 0:N.breedingUniqueId)==null?void 0:I.toLocaleString()]}),u.jsxs(y,{children:["حجم جوجه ریزی:",(k=s==null?void 0:s.quantity)==null?void 0:k.toLocaleString(),"قطعه"]}),u.jsxs(y,{children:["سن جوجه: ",(O=s==null?void 0:s.chickenAge)==null?void 0:O.toLocaleString()," روز"]}),u.jsxs(y,{children:["مانده در سالن: ",(f=s==null?void 0:s.leftOver)==null?void 0:f.toLocaleString(),"قطعه"]}),u.jsxs(y,{children:["حجم کشتار شده:",(F=s==null?void 0:s.killedQuantity)==null?void 0:F.toLocaleString()," قطعه"]}),u.jsxs(y,{children:["نژاد: ",(C=s==null?void 0:s.chickenBreed)==null?void 0:C.toLocaleString()]}),u.jsxs(y,{children:["تلفات: ",(e=s==null?void 0:s.totalLosses)==null?void 0:e.toLocaleString("fa-IR"),"قطعه"]})]}),u.jsx(T,{label:"تعداد (قطعه)",name:"quantity",value:r.values.quantity,onChange:r.handleChange,onBlur:r.handleBlur,error:r.touched.quantity&&!!r.errors.quantity,helperText:r.touched.quantity&&r.errors.quantity,fullWidth:!0}),u.jsx(T,{label:"دلیل افزایش حجم",name:"message",multiline:!0,rows:3,value:r.values.message,onChange:r.handleChange,onBlur:r.handleBlur,error:r.touched.message&&!!r.errors.message,helperText:r.touched.message&&r.errors.message,fullWidth:!0}),u.jsx(v,{variant:"contained",fullWidth:!0,disabled:!(r.isValid&&r.values.poultry&&r.values.hatching_key&&r.values.quantity&&r.values.message),onClick:()=>{const t={hatching_key:r.values.hatching_key,quantity:parseInt(r.values.quantity),message:r.values.message,registerer_role:d()},c=o?Bu({...t,key:a==null?void 0:a.key}):wu(t);g(c).then(x=>{x.payload.error?p({msg:"مشکلی پیش آمده است!",severity:"error",vertical:"top",horizontal:"center"}):(p({msg:"عملیات با موفقیت انجام شد.",severity:"success",vertical:"top",horizontal:"center"}),n(),g(iu({right:!1,bottom:!1,content:null})))})},children:o?"ویرایش":"ثبت"})]})},Vu=({state:n})=>{const o=B(),a=C=>{E(C.target.value)},[l,j]=h.useState([]),[s,S]=h.useState(0),[p,g]=h.useState(10),[A,E]=h.useState(""),[R,r]=h.useState(1),[D,N]=h.useState([]),I=async C=>{let e;o(b()),e=await L.get(`hatching-increase-request/?search=filter&value=${A}&role=${d()}&page=${C}&page_size=${p}`),o(_()),j(e.data.results),S(e.data.count)},k=C=>{I(C),r(C)},O=C=>{g(C),r(1)},f=()=>{I(R!==0?R:1)};h.useEffect(()=>{const C=l==null?void 0:l.map((e,t)=>{var c,x,H,G,$,M,V,m,z,K,P,W,Y;return[R===1?t+1:t+p*(R-1)+1,`${(x=(c=e==null?void 0:e.hatching)==null?void 0:c.poultry)==null?void 0:x.unitName} (${($=(G=(H=e==null?void 0:e.hatching)==null?void 0:H.poultry)==null?void 0:G.user)==null?void 0:$.mobile})`,(M=e==null?void 0:e.hatching)==null?void 0:M.licenceNumber,(m=(V=e==null?void 0:e.hatching)==null?void 0:V.poultry)==null?void 0:m.breedingUniqueId,(z=e==null?void 0:e.hatchingQuantity)==null?void 0:z.toLocaleString(),(K=e==null?void 0:e.hatchingKillQuantity)==null?void 0:K.toLocaleString(),(P=e==null?void 0:e.hatchingLosses)==null?void 0:P.toLocaleString(),(W=e==null?void 0:e.hatchingLeftOver)==null?void 0:W.toLocaleString(),(Y=e==null?void 0:e.quantity)==null?void 0:Y.toLocaleString(),`${e==null?void 0:e.registererName} (${e==null?void 0:e.registererMobile})`,ju(e==null?void 0:e.date),e==null?void 0:e.message,u.jsx($u,{updateTable:f,item:e},t)]});N(C)},[l,n]),h.useEffect(()=>{I(1)},[o,p,n]);const F=async C=>{C.preventDefault(),o(b());try{const e=await L.get(`hatching-increase-request/?role=${d()}&search=filter&value=${A}&page=1&page_size=${p}`);j(e.data.results),S(e.data.count),o(_())}catch(e){console.error("Error fetching data:",e)}};return u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[d()!=="KillHouse"&&u.jsx(i,{children:u.jsx(v,{variant:"contained",onClick:()=>{o(iu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Mu,{updateTable:f}),title:"افزایش جوجه ریزی"}))},children:"افزایش جوجه ریزی"})}),u.jsx(i,{children:u.jsxs("form",{onSubmit:F,children:[u.jsx(T,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:a}),u.jsx(v,{type:"submit",onClick:F,endIcon:u.jsx(Nu,{}),children:"جستجو"})]})})]}),u.jsx(ku,{data:D,columns:["ردیف","مرغدار","شماره مجوز جوجه ریزی","شناسه یکتا فارم","حجم جوجه ریزی","حجم کشتار","حجم تلفات","مانده در سالن","حجم افزایشی","ثبت کننده","تاریخ ثبت","پیغام","عملیات"],handlePageChange:k,totalRows:s,page:R,perPage:p,handlePerRowsChange:O,title:"افزایش حجم جوجه ریزی"})]})},g6=()=>{const{pathname:n}=bu();return u.jsx(u.Fragment,{children:u.jsxs(gu,{display:"flex",justifyContent:"center",mt:4,xs:12,children:[u.jsxs(i,{container:!0,direction:"column",xs:12,sm:12,md:10,lg:10,children:[u.jsx(i,{container:!0,justifyContent:"space-between",gap:q.SMALL,children:u.jsx(i,{xs:12,children:n===Ru||n===Su||n===Iu||n===Lu?u.jsxs(u.Fragment,{children:[" ",u.jsx(i,{item:!0,xs:12,mb:2,children:u.jsx(y,{variant:"h5",fontWeight:"bold",textAlign:"center",children:"اختلاف کشتار"})}),u.jsx(Uu,{})]}):u.jsx(vu,{})})}),u.jsxs(i,{xs:12,sm:12,px:2,children:[(n.includes(eu)||n.includes(ru)||n.includes(au)||n.includes(tu))&&u.jsx(Tu,{}),(n.includes(ou)||n.includes(su)||n.includes(cu)||n.includes(nu))&&u.jsx(Vu,{})]})]}),u.jsx(i,{container:!0,justifyContent:"space-between",gap:q.SMALL,children:u.jsx(i,{xs:12})})]})})};export{g6 as default}; diff --git a/build/assets/DispenserDashboard-B53mNsdU.js b/build/assets/DispenserDashboard-B53mNsdU.js new file mode 100644 index 0000000..8f75217 --- /dev/null +++ b/build/assets/DispenserDashboard-B53mNsdU.js @@ -0,0 +1 @@ +import{j as r}from"./mui-vendor-CkIVaoQP.js";import"./react-vendor-CmFgShSM.js";const o=()=>r.jsx("div",{children:"DispenserDashboard"});export{o as default}; diff --git a/build/assets/Done-Dp5awdte.js b/build/assets/Done-Dp5awdte.js new file mode 100644 index 0000000..8f62ef2 --- /dev/null +++ b/build/assets/Done-Dp5awdte.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(a()),l=t;u=e.default=(0,i.default)((0,l.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done");export{u as d}; diff --git a/build/assets/DoneAll-BQY85Rt1.js b/build/assets/DoneAll-BQY85Rt1.js new file mode 100644 index 0000000..2c26a05 --- /dev/null +++ b/build/assets/DoneAll-BQY85Rt1.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var l=e.default=void 0,u=o(a()),i=t;l=e.default=(0,u.default)((0,i.jsx)("path",{d:"m18 7-1.41-1.41-6.34 6.34 1.41 1.41zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12zM.41 13.41 6 19l1.41-1.41L1.83 12z"}),"DoneAll");export{l as d}; diff --git a/build/assets/DoneOutline-DQzOHpRS.js b/build/assets/DoneOutline-DQzOHpRS.js new file mode 100644 index 0000000..7aa96ce --- /dev/null +++ b/build/assets/DoneOutline-DQzOHpRS.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(a()),l=t;u=e.default=(0,i.default)((0,l.jsx)("path",{d:"m19.77 5.03 1.4 1.4L8.43 19.17l-5.6-5.6 1.4-1.4 4.2 4.2zm0-2.83L8.43 13.54l-4.2-4.2L0 13.57 8.43 22 24 6.43z"}),"DoneOutline");export{u as d}; diff --git a/build/assets/Download-DQ-VVIaV.js b/build/assets/Download-DQ-VVIaV.js new file mode 100644 index 0000000..6da2686 --- /dev/null +++ b/build/assets/Download-DQ-VVIaV.js @@ -0,0 +1 @@ +import{i as r,j as a}from"./mui-vendor-CkIVaoQP.js";import{r as t}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(t()),d=a;u=e.default=(0,i.default)((0,d.jsx)("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}),"Download");export{u as d}; diff --git a/build/assets/DownloadReport-Kp5MocZr.js b/build/assets/DownloadReport-Kp5MocZr.js new file mode 100644 index 0000000..a83fce5 --- /dev/null +++ b/build/assets/DownloadReport-Kp5MocZr.js @@ -0,0 +1 @@ +import{j as u,p as O,b as z,T as s,am as P}from"./mui-vendor-CkIVaoQP.js";import{r as L,j as _}from"./react-vendor-CmFgShSM.js";import{n as G,o as J,p as E,q as Q,j as $,t as V,G as I,v as N}from"./index-CeyyVc1v.js";import{a as U,u as X}from"./redux-vendor-B7uoacJt.js";import{l as K}from"./ChickenLogo-BK6_Z2uq.js";const l={page:{width:"210mm",height:"297mm",display:"flex",margin:"0 auto",flexDirection:"column",position:"relative",direction:"rtl",fontFamily:"nazanin",fontWeight:"bold"},container:{width:"95%",alignSelf:"center",pageBreakInside:"avoid"},invoiceTable:{width:"100%",borderCollapse:"collapse",alignSelf:"center"},tableCell:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:12},tableHeader:{pageBreakAfter:"auto"},headerRow:{color:"black",pageBreakInside:"avoid",pageBreakAfter:"auto"},tableRowEven:{backgroundColor:"rgba(170, 183, 255, 0.3)"},logo:{width:"60px",height:"auto",marginBottom:"10px"},contentContainer:{display:"flex",justifyContent:"space-between",marginTop:"20px",marginLeft:"100px",marginRight:"30px"},contentInLine:{display:"flex",flexDirection:"column",alignItems:"center"},mainTitle:{fontFamily:"nazanin",fontSize:11,pAlign:"center",fontWeight:"bolder"},signature:{display:"flex",flexDirection:"column",alignItems:"flex-end",marginLeft:"20px"},watermarkContainer:{position:"fixed",top:450,left:0,right:30,bottom:0,justifyContent:"center",alignItems:"center",opacity:.2,zIndex:-1},watermarkp:{fontSize:100,fontWeight:"bolder",color:"grey",transform:"rotate(-45deg)",left:"50%"},title:{fontSize:12,fontWeight:"bolder",pAlign:"center"},titleTopic:{marginTop:"10px",fontSize:12,fontWeight:"bolder",pAlign:"center"},firsttitle:{fontSize:14,fontWeight:"bolder",marginLeft:"40px",pAlign:"center"},options:{padding:"10px",marginTop:"15px",display:"flex",flexDirection:"column",alignItems:"flex-start"},divider:{width:"100%",height:"2px",backgroundColor:"red",marginBottom:5},pTitleContainer:{pAlign:"right",margin:"15px",textAlign:"justify",textJustify:"inter-word"},tableHeaderCell:{backgroundColor:"rgba(255, 229, 153, 0.5)",fontSize:12,border:"1px solid #000",padding:"4px",textAlign:"center",fontWeight:"bold"}},W=L.forwardRef((o,D)=>{const{sDate:F}=o,{date:r}=o,{fnumber:H}=o,{receiver:B}=o,{item:v}=o,{itemOutProvince:w}=o,f=G(),S=J();return u.jsxs("div",{ref:D,children:[u.jsxs("div",{style:l.page,children:[u.jsxs("div",{style:l.contentContainer,children:[u.jsxs("div",{style:l.contentInLine,children:[u.jsx("img",{alt:"logo",src:K,style:l.logo}),u.jsx("span",{style:l.mainTitle,children:"اتحادیه سراسری تعاونی‌های کشاورزی پرورش دهندگان مرغ گوشتی ایران"}),u.jsxs("span",{style:l.title,children:["اتحادیه شرکت های تعاونی کشاورزی مرغداران "," ‌"," ",f]})]}),u.jsx("div",{children:u.jsx("span",{style:l.firsttitle,children:"بسمه تعالی"})}),u.jsxs("div",{style:l.options,children:[u.jsxs("span",{style:l.title,children:["شماره: ",H]}),u.jsxs("span",{style:l.titleTopic,children:["تاریخ: ",E(r)]}),u.jsx("span",{style:l.titleTopic,children:"پیوست: -"})]})]}),u.jsx("hr",{style:l.divider}),u.jsxs("p",{style:l.pTitleContainer,children:[u.jsxs("strong",{style:{fontSize:"20px"},children:[B,u.jsx("br",{}),"با سلام",u.jsx("br",{})]}),"احتراماً گزارش تخصیص مورخ ",E(F),"، مرغ گوشتی استان جهت استحضار بحضورتان ارسال میگردد."]}),u.jsx("div",{style:l.container,children:u.jsxs("table",{style:l.invoiceTable,children:[u.jsx("thead",{style:l.tableHeader,children:u.jsxs("tr",{style:l.headerRow,children:[u.jsx("th",{style:l.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:l.tableHeaderCell,children:"نام خریدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"تلفن"}),u.jsx("th",{style:l.tableHeaderCell,children:"شهر"}),u.jsx("th",{style:l.tableHeaderCell,children:"مرغدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"تلفن"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:l.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:l.tableHeaderCell,children:"جمع کل"})]})}),u.jsx("tbody",{children:v==null?void 0:v.map((e,d)=>{var c;return(c=e==null?void 0:e.provinceKillRequest)==null?void 0:c.map((t,i)=>{var C,h,x,n,y,j,p,A,b,g;return u.jsxs("tr",{style:d%2===0?l.tableRowEven:{},children:[i===0&&u.jsxs(u.Fragment,{children:[u.jsx("td",{style:l.tableCell,rowSpan:(C=e==null?void 0:e.provinceKillRequest)==null?void 0:C.length,children:d+1}),u.jsx("td",{style:l.tableCell,rowSpan:(h=e==null?void 0:e.provinceKillRequest)==null?void 0:h.length,children:e==null?void 0:e.name}),u.jsx("td",{style:l.tableCell,rowSpan:(x=e==null?void 0:e.provinceKillRequest)==null?void 0:x.length,children:(y=(n=e==null?void 0:e.killHouseOperator)==null?void 0:n.user)==null?void 0:y.mobile}),u.jsx("td",{style:l.tableCell,rowSpan:(j=e==null?void 0:e.provinceKillRequest)==null?void 0:j.length,children:(b=(A=(p=e==null?void 0:e.killHouseOperator)==null?void 0:p.user)==null?void 0:A.city)==null?void 0:b.cityName})]}),u.jsx("td",{style:l.tableCell,children:t==null?void 0:t.poultry}),u.jsx("td",{style:l.tableCell,children:t==null?void 0:t.poultryMobile}),u.jsx("td",{style:l.tableCell,children:t==null?void 0:t.quantity}),u.jsx("td",{style:l.tableCell,children:t==null?void 0:t.IndexWeight}),i===0&&u.jsx("td",{style:l.tableCell,rowSpan:(g=e==null?void 0:e.provinceKillRequest)==null?void 0:g.length,children:e==null?void 0:e.totalQuantity})]},`${d}-${i}`)})})})]})})]}),u.jsxs("div",{style:l.page,children:[u.jsxs("div",{style:l.contentContainer,children:[u.jsxs("div",{style:l.contentInLine,children:[u.jsx("img",{alt:"logo",src:K,style:l.logo}),u.jsx("span",{style:l.mainTitle,children:"اتحادیه سراسری تعاونی‌های کشاورزی پرورش دهندگان مرغ گوشتی ایران"}),u.jsxs("span",{style:l.title,children:["اتحادیه شرکت های تعاونی کشاورزی مرغداران "," ‌"," ",f]})]}),u.jsx("div",{children:u.jsx("span",{style:l.firsttitle,children:"بسمه تعالی"})}),u.jsxs("div",{style:l.options,children:[u.jsxs("span",{style:l.title,children:["شماره: ",H]}),u.jsxs("span",{style:l.titleTopic,children:["تاریخ: ",E(r)]}),u.jsx("span",{style:l.titleTopic,children:"پیوست: -"})]})]}),u.jsx("hr",{style:l.divider}),u.jsx("p",{style:l.pTitleContainer,children:u.jsxs("strong",{style:{fontSize:"20px"},children:["گزارش فروش خارج از استان مورخ ",E(F)]})}),u.jsx("div",{style:l.container,children:u.jsxs("table",{style:l.invoiceTable,children:[u.jsx("thead",{style:l.tableHeader,children:u.jsxs("tr",{style:l.headerRow,children:[u.jsx("th",{style:l.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:l.tableHeaderCell,children:"نام مرغدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"نام خریدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"تلفن"}),u.jsx("th",{style:l.tableHeaderCell,children:"شهر"}),u.jsx("th",{style:l.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعداد کل"}),u.jsx("th",{style:l.tableHeaderCell,children:"نوع"})]})}),u.jsx("tbody",{children:w==null?void 0:w.map((e,d)=>{var c,t,i,C,h,x,n;return u.jsxs("tr",{style:d%2===0?l.tableRowEven:{},children:[u.jsx("td",{style:l.tableCell,children:d+1}),u.jsxs("td",{style:l.tableCell,children:[(c=e==null?void 0:e.poultry)==null?void 0:c.unitName," (",(i=(t=e==null?void 0:e.poultry)==null?void 0:t.user)==null?void 0:i.mobile,")"]}),u.jsxs("td",{style:l.tableCell,children:[(C=e==null?void 0:e.buyer)==null?void 0:C.firstName," ",(h=e==null?void 0:e.buyer)==null?void 0:h.lastName]}),u.jsx("td",{style:l.tableCell,children:(x=e==null?void 0:e.buyer)==null?void 0:x.mobile}),u.jsx("td",{style:l.tableCell,children:(n=e==null?void 0:e.buyer)==null?void 0:n.city}),u.jsx("td",{style:l.tableCell,children:e==null?void 0:e.IndexWeight}),u.jsx("td",{style:l.tableCell,children:e==null?void 0:e.quantity}),u.jsx("td",{style:l.tableCell,children:e!=null&&e.freezing?"انجماد":"معمولی"})]},d)})})]})}),u.jsx("div",{style:l.container,children:u.jsxs("span",{style:{color:"gray",fontSize:"12px"},children:["این گزارش در تاریخ ",E(r)," و ساعت"," ",Q(r)," صادر شده است."]})}),u.jsxs("div",{style:{flexDirection:"row",marginTop:"20px"},children:[u.jsx("div",{style:l.signature,children:u.jsxs("div",{style:l.contentInLine,children:[u.jsx("span",{style:l.title,children:S}),u.jsxs("span",{style:l.title,children:["مدیرعامل اتحادیه مرغداران"," ‌",f]})]})}),u.jsx("div",{style:l.watermarkContainer,children:u.jsx("p",{style:l.watermarkp,children:"سامانه رصدیار "})})]})]})]})});W.displayName="ProvinceSendLetterFactorReport";W.propTypes={item:O.PropTypes.any};const Z=U("PROVINCE_GET_ALLOCATION_LETTER",async(o,{dispatch:D})=>{const{data:F,status:r}=await $.get("province_request_letter/?date="+o);return{data:F,status:r}}),lu=()=>{var f,S,e,d,c,t,i,C,h,x;const o={box:{border:"1px solid #ccc",borderRadius:"4px",padding:"10px",marginBottom:"20px"},innerBox:{border:"1px solid #eee",borderRadius:"4px",padding:"5px",marginBottom:"5px",backgroundColor:"#fbfbea"}},{name:D}=_(),F=L.useRef(),[r,H]=L.useState(null),B=X(),v=()=>{try{const n=B(Z(N(new Date).format("YYYY-MM-DD")));H(n)}catch(n){console.error(n)}},w=V.useReactToPrint({content:()=>F.current,documentTitle:"گزارش کشتار روزانه"});return L.useEffect(()=>{D==="ds"&&v()},[]),u.jsx(z,{children:u.jsxs("div",{style:{marginTop:"10px"},children:[u.jsx("h4",{style:{textDecoration:"underline",color:"blue",cursor:"pointer"},onClick:()=>{w()},children:"جهت دانلود گزارش بصورت فایل پی دی اف کلیک کنید."}),u.jsx(I,{container:!0,xs:12,justifyContent:"center",children:u.jsxs(I,{container:!0,xs:10,spacing:2,justifyContent:"start",children:[(e=(S=(f=r==null?void 0:r.payload)==null?void 0:f.data)==null?void 0:S.allocation)==null?void 0:e.map((n,y)=>{var j,p,A,b,g,T;return u.jsx(I,{xs:12,sm:3,lg:2,children:u.jsxs(z,{style:o.box,children:[u.jsxs(s,{color:"primary",variant:"h6",children:["ردیف: ",y+1]}),u.jsxs(s,{children:["نام خریدار: ",n==null?void 0:n.name]}),u.jsxs(s,{children:["تلفن: ",(p=(j=n==null?void 0:n.killHouseOperator)==null?void 0:j.user)==null?void 0:p.mobile]}),u.jsxs(s,{children:["شهر: ",(g=(b=(A=n==null?void 0:n.killHouseOperator)==null?void 0:A.user)==null?void 0:b.city)==null?void 0:g.cityName]}),u.jsxs(s,{children:["تعداد کل: ",n==null?void 0:n.totalQuantity]}),u.jsx(P,{}),u.jsx(s,{color:"error",variant:"subtitle1",children:"جزئیات سفارش"}),(T=n==null?void 0:n.provinceKillRequest)==null?void 0:T.map((a,Y)=>u.jsxs(z,{style:o.innerBox,children:[u.jsxs(s,{children:["مرغدار: ",a==null?void 0:a.poultry]}),u.jsxs(s,{children:["تلفن مرغدار: ",a==null?void 0:a.poultryMobile]}),u.jsxs(s,{children:["تعداد: ",a==null?void 0:a.quantity]}),u.jsxs(s,{children:["میانگین وزن: ",a==null?void 0:a.IndexWeight]})]},Y))]})},y)}),(t=(c=(d=r==null?void 0:r.payload)==null?void 0:d.data)==null?void 0:c.outProvince)==null?void 0:t.map((n,y)=>{var j,p,A,b,g,T,a,Y,M;return u.jsx(I,{xs:12,sm:3,lg:2,children:u.jsxs(z,{style:o.box,children:[u.jsxs(s,{color:"primary",variant:"h6",children:["ردیف: ",((p=(j=r==null?void 0:r.payload)==null?void 0:j.data)==null?void 0:p.allocation.length)+y+1]}),u.jsx(s,{color:"error",variant:"subtitle1",children:"فروش خارج از استان"}),u.jsx(P,{}),u.jsxs(s,{children:["نام مرغدار: ",(A=n==null?void 0:n.poultry)==null?void 0:A.unitName," (",(g=(b=n==null?void 0:n.poultry)==null?void 0:b.user)==null?void 0:g.mobile,")"]}),u.jsxs(s,{children:["نام خریدار: ",(T=n==null?void 0:n.buyer)==null?void 0:T.firstName," ",(a=n==null?void 0:n.buyer)==null?void 0:a.lastName]}),u.jsxs(s,{children:["تلفن: ",(Y=n==null?void 0:n.buyer)==null?void 0:Y.mobile]}),u.jsxs(s,{children:["شهر: ",(M=n==null?void 0:n.buyer)==null?void 0:M.city]}),u.jsxs(s,{children:["میانگین وزن: ",n==null?void 0:n.IndexWeight]}),u.jsxs(s,{children:["تعداد کل: ",n==null?void 0:n.quantity]}),u.jsxs(s,{children:["نوع: ",n!=null&&n.freezing?"انجماد":"معمولی"]})]})},y)})]})}),u.jsx("div",{style:{visibility:"hidden",position:"absolute",overflow:"hidden",width:0,height:0},children:u.jsx("div",{style:{width:"100%"},children:u.jsx(W,{ref:F,sDate:N(new Date).format("YYYY-MM-DD"),date:N(new Date).format("YYYY-MM-DD hh:mm:ss"),fnumber:N(new Date).format("YYYYMMDD"),receiver:"معاونت محترم بهبود تولیدات دامی سازمان جهاد کشاورزی استان ",item:(C=(i=r==null?void 0:r.payload)==null?void 0:i.data)==null?void 0:C.allocation,itemOutProvince:(x=(h=r==null?void 0:r.payload)==null?void 0:h.data)==null?void 0:x.outProvince})})})]})})};export{lu as default}; diff --git a/build/assets/Driver-CHyVUqPi.js b/build/assets/Driver-CHyVUqPi.js new file mode 100644 index 0000000..e0ac1a0 --- /dev/null +++ b/build/assets/Driver-CHyVUqPi.js @@ -0,0 +1 @@ +import{j as e,B as k,ak as Y,p as V,a3 as I,aJ as T,b as W}from"./mui-vendor-CkIVaoQP.js";import{G as c,S as l,kJ as S,kK as b,j as P,A as Q,u as g,c as L,M as R,L as $,h as z,N,kL as H,Q as _,v as q,b as m,kM as J}from"./index-CeyyVc1v.js";import{N as U}from"./NavLink-D2GD_ItM.js";import{f as B,r as s}from"./react-vendor-CmFgShSM.js";import{A as M}from"./AdvancedTable-BYmmBtmq.js";import{a as K,u as w,f as G}from"./redux-vendor-B7uoacJt.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const X=()=>{const{pathname:t}=B();return e.jsxs(c,{container:!0,gap:l.SMALL,p:l.SMALL,direction:{xs:"column",md:"row"},children:[e.jsx(U,{to:S,active:t===S?"true":null,children:e.jsx(k,{variant:"text",color:"inherit",children:"درخواست های شما"})}),e.jsx(U,{to:b,active:t===b?"true":null,children:e.jsx(k,{variant:"text",color:"inherit",children:"ماشین های شما"})})]})},Z=K("DRIVER_CANCELLATION_REQUEST",async t=>{const{data:i,status:n}=await P.post("driver_cancel/",t);return{data:i,status:n}}),O=({item:t})=>{const[i]=s.useContext(Q),n=w(),r=g({initialValues:{description:""},validationSchema:L({description:R().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!")})});return s.useEffect(()=>{r.validateForm()},[]),e.jsx(c,{container:!0,p:l.MEDIUM,gap:l.SMALL,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:e.jsxs(c,{container:!0,direction:"column",gap:l.SMALL,children:[e.jsx(c,{children:e.jsx(Y,{id:"description",label:"توضیحات",multiline:!0,rows:5,variant:"outlined",sx:{width:"100%",height:"100%"},value:r.values.description,error:r.touched.description?!!r.errors.description:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.description&&r.errors.description?r.errors.description:null})}),e.jsx(c,{children:e.jsx(k,{fullWidth:!0,variant:"contained",disabled:!r.isValid,onClick:()=>{n($()),n(Z({kill_house_request_key:t.key,Kill_house_add_car_key:t.car.key,message:r.values.description})).then(a=>{a.error&&(a.error.message.includes("403")?i({vertical:"top",horizontal:"center",msg:"قبلا درخواست انصراف ثبت کرده اید!",severity:"error"}):i({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}))}),n(z()),n(N({right:!1,bottom:!1,content:null}))},children:"ثبت اطلاعات"})})]})})};O.propTypes={item:V.PropTypes.any};const uu=()=>{const[t,i]=s.useState([]),[n,r]=s.useState([]),{driverRequests:a}=G(o=>o.driverSlice),j=w();s.useEffect(()=>{j(H())},[]),s.useEffect(()=>{const o=a==null?void 0:a.filter(u=>u.vetState==="pending").map((u,D)=>{var d,p,A,h,y,F,x,v,f,E;return[D+1,u.barCode,u.car.typeCar,u.car.pelak,(d=u==null?void 0:u.poultry)==null?void 0:d.poultryName,(p=u==null?void 0:u.poultry)==null?void 0:p.poultryMobile,((A=u==null?void 0:u.poultry)==null?void 0:A.poultryProvince)+" - "+((h=u==null?void 0:u.poultry)==null?void 0:h.poultryCity)+" - "+((y=u==null?void 0:u.poultry)==null?void 0:y.poultryAddress),u.killhouseUser.name,(v=(x=(F=u.killhouseUser)==null?void 0:F.killHouseOperator)==null?void 0:x.user)==null?void 0:v.mobile,(E=(f=u.killhouseUser)==null?void 0:f.address)==null?void 0:E.address,_(new Date(u.killRequest.reciveDate),"yyyy/MM/dd"),u.killRequest.reciveTime,e.jsx(k,{disabled:u.assignmentStateArchive==="True",color:"secondary",variant:"outlined",onClick:()=>{j(N({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"درخواست انصراف از دریافت بار",content:e.jsx(O,{item:u})}))},children:"انصراف"},D)]});i(o)},[a]),s.useEffect(()=>{const o=a==null?void 0:a.filter(u=>u.vetState!=="pending").map((u,D)=>{var d,p,A,h,y,F,x,v,f,E;return[D+1,u.barCode,u.car.typeCar,u.car.pelak,(d=u==null?void 0:u.poultry)==null?void 0:d.poultryName,(p=u==null?void 0:u.poultry)==null?void 0:p.poultryMobile,((A=u==null?void 0:u.poultry)==null?void 0:A.poultryProvince)+" - "+((h=u==null?void 0:u.poultry)==null?void 0:h.poultryCity)+" - "+((y=u==null?void 0:u.poultry)==null?void 0:y.poultryAddress),u.killhouseUser.name,(v=(x=(F=u.killhouseUser)==null?void 0:F.killHouseOperator)==null?void 0:x.user)==null?void 0:v.mobile,(E=(f=u.killhouseUser)==null?void 0:f.address)==null?void 0:E.address,_(new Date(u.killRequest.reciveDate),"yyyy/MM/dd"),u.killRequest.reciveTime]});r(o)},[a]);const C=g({initialValues:{capacity:"",recieveTime:"",recieveDate:q(Date()).format("YYYY-MM-DD hh:mm:ss")},validationSchema:L({capacity:m().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),recieveTime:R().required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!")})});return s.useEffect(()=>{C.validateForm()},[]),e.jsx(I,{container:!0,alignItems:"center",justifyContent:"space-between",gap:l.SMALL,mt:l.MEDIUM,children:e.jsxs(T,{sx:{width:"100%"},children:[e.jsx(M,{name:"درخواست های فعال",columns:["ردیف","کد بار","نوع خودرو","پلاک خودرو","نام مرغدار","تلفن مرغدار","آدرس مرغدار","نام کشتارگاه","تلفن کشتارگاه","آدرس کشتارگاه","تاریخ دریافت","ساعت","عملیات"],data:t}),e.jsx(M,{name:"بایگانی",columns:["ردیف","کد بار","نوع خودرو","پلاک خودرو","نام مرغدار","تلفن مرغدار","آدرس مرغدار","نام کشتارگاه","تلفن کشتارگاه","آدرس کشتارگاه","تاریخ دریافت","ساعت"],data:n})]})})},eu=()=>{const[t,i]=s.useState([]),{driverCars:n}=G(C=>C.driverSlice),r=w();s.useEffect(()=>{r(J())},[]),s.useEffect(()=>{const C=n.map((o,u)=>[u+1,o.name,o.typeCar,o.pelak,o.capocity,o.healthCode,o.typeWeight]);i(C)},[n]);const[a]=s.useState(["ردیف","نام","نوع خودرو","پلاک","ظرفیت","کد بهداشتی","وزن"]),j=g({initialValues:{capacity:"",recieveTime:"",recieveDate:q(Date()).format("YYYY-MM-DD hh:mm:ss")},validationSchema:L({capacity:m().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),recieveTime:R().required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!")})});return s.useEffect(()=>{j.validateForm()},[]),e.jsx(I,{container:!0,alignItems:"center",justifyContent:"space-between",gap:l.SMALL,mt:l.MEDIUM,children:e.jsx(T,{sx:{width:"100%"},children:e.jsx(M,{name:"ماشین های شما",columns:a,data:t})})})},du=()=>{const{pathname:t}=B();return e.jsx(e.Fragment,{children:e.jsx(W,{display:"flex",justifyContent:"center",children:e.jsxs(c,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[e.jsx(c,{justifyContent:"center",my:l.MEDIUM,children:e.jsx(T,{children:e.jsx(X,{})})}),e.jsx(c,{container:!0,justifyContent:"space-between",gap:l.SMALL,children:e.jsxs(c,{xs:12,children:[t===S&&e.jsx(uu,{}),t===b&&e.jsx(eu,{})]})})]})})})};export{du as default}; diff --git a/build/assets/Edit-CqBj1Y2L.js b/build/assets/Edit-CqBj1Y2L.js new file mode 100644 index 0000000..cb1e5c2 --- /dev/null +++ b/build/assets/Edit-CqBj1Y2L.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},i=r;Object.defineProperty(e,"__esModule",{value:!0});var o=e.default=void 0,u=i(a()),d=t;o=e.default=(0,u.default)((0,d.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit");export{o as d}; diff --git a/build/assets/EditOutlined-n5ie2Fmu.js b/build/assets/EditOutlined-n5ie2Fmu.js new file mode 100644 index 0000000..b3a8467 --- /dev/null +++ b/build/assets/EditOutlined-n5ie2Fmu.js @@ -0,0 +1 @@ +import{i as t,j as r}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},i=t;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,o=i(a()),d=r;u=e.default=(0,o.default)((0,d.jsx)("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"}),"EditOutlined");export{u as d}; diff --git a/build/assets/EnterAuthCodeDirectBuy-zD0YV5ZE.js b/build/assets/EnterAuthCodeDirectBuy-zD0YV5ZE.js new file mode 100644 index 0000000..a029cbb --- /dev/null +++ b/build/assets/EnterAuthCodeDirectBuy-zD0YV5ZE.js @@ -0,0 +1 @@ +import{j as u,a3 as Mu,ak as D,B as T,I as $u,b0 as o6,d as su,T as k,b2 as h6,b3 as r6,ai as Vu,aX as s6,al as Wu,aA as A6,aa as qu,ag as p6,bi as F6,ah as y6,aj as t6,an as g6,b4 as x6,ap as f6,aq as v6}from"./mui-vendor-CkIVaoQP.js";import{L as O,j as q,X as E,h as I,A as tu,u as Pu,c as Tu,fh as S6,fi as ju,C as _u,b as xu,G as h,S as L,O as zu,fj as j6,v as Nu,fk as n6,p as ku,W as vu,a9 as Eu,_ as a6,fl as E6,fm as _6,fn as Yu,af as k6,du as b6,M as fu,di as D6,N as wu}from"./index-CeyyVc1v.js";import{r as d}from"./react-vendor-CmFgShSM.js";import{R as Hu,a as Ou}from"./index.esm-Bu7XMDZU.js";import{a as U,u as nu,f as Su}from"./redux-vendor-B7uoacJt.js";import{d as c6}from"./Tune-D4M2CAhp.js";import{d as i6}from"./Delete-C5MyLelE.js";import{d as Ku}from"./Edit-CqBj1Y2L.js";import{R as bu}from"./ResponsiveTable-w7hk7Uq8.js";import{d as B6}from"./DoneOutline-DQzOHpRS.js";import{d as L6,a as I6}from"./ThumbUpAlt-HKYD-o6a.js";import{d as R6}from"./Close-_jAEIgMD.js";import{N as P6}from"./NumberFormatCustom-DwWPj40N.js";import{a as T6}from"./aviculture-get-hatching-data-DsjDNd82.js";import{b as w6,a as W6}from"./province-get-sell-for-freezing-status-ieuVFEgW.js";import{d as q6}from"./FilterAlt-scT0HEUg.js";import{i as z6}from"./isValidIndexWeight-C_ik-uYa.js";import{d as M6}from"./Sms-DasNClAG.js";import{P as $6}from"./ProvinceSettlementPdfKillRequest-ChEooZGT.js";const N6=U("PROVINCE_ALLOCATED_DELETE_SERVICE",async(r,{dispatch:s})=>{try{s(O());const{data:o,status:a}=await q.delete("province_kill_request/0/?delete_allocation",{params:{province_kill_request_key:r.province_kill_request_key,message:"به دلیل انقضای کد سفارش",role:E()}});return s(I()),{data:o,status:a}}catch(o){return s(I()),{error:o.response.data.result}}}),Y6=U("PROVINCE_ALLOCATED_RETURN_QUANTITY_SERVICE",async(r,{dispatch:s})=>{try{s(O());const{data:o,status:a}=await q.delete("province_kill_request/0/?return_allocation_quantity",{params:{province_kill_request_key:r.province_kill_request_key}});return s(I()),{data:o,status:a}}catch(o){return s(I()),{error:o.response.data.result}}}),V6=({selectedDate1:r,selectedDate2:s,item:o,fetchDashboard:a})=>{const[F]=d.useContext(tu),g=nu(),f=Pu({initialValues:{amount:o.allocatedQuantity?o.allocatedQuantity:""},validationSchema:Tu({amount:xu().required("وارد کردن حجم الزامی است").min(1,"حجم باید بزرگتر از صفر باشد")}),onSubmit:C=>{g(S6({edit_allocation_quantity:!0,province_kill_request_key:o==null?void 0:o.provinceKillRequestKey,quantity:parseInt(C==null?void 0:C.amount),role:E()})).then(S=>{S.payload.error?F({vertical:"top",horizontal:"center",msg:S.payload.error,severity:"error"}):(F({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),g(ju({selectedDate1:r,selectedDate2:s})),a(),g(_u()))})}});return u.jsx(Mu,{container:!0,spacing:2,direction:"column",alignItems:"center",justifyContent:"center",children:u.jsx(Mu,{item:!0,xs:12,children:u.jsxs("form",{onSubmit:f.handleSubmit,children:[u.jsx(D,{fullWidth:!0,id:"amount",name:"amount",label:"حجم",value:f.values.amount,onChange:f.handleChange,onBlur:f.handleBlur,error:f.touched.amount&&!!f.errors.amount,helperText:f.touched.amount&&f.errors.amount,variant:"outlined"}),u.jsx(T,{fullWidth:!0,type:"submit",variant:"contained",color:"primary",style:{marginTop:"16px"},children:"ارسال"})]})})})},H6=({item:r,fetchDashboard:s})=>{const[o,a]=d.useState(null),F=nu(),[g,,f,,C]=d.useContext(tu),S=c=>{a(c.currentTarget)},R=()=>{a(null)},B=!!o,w=B?"simple-popover":void 0,Y=r.allocatedState==="rejected"||r.allocatedCarState&&r.allocatedRemainQuantity===0;return u.jsxs("div",{children:[u.jsx($u,{"aria-describedby":w,variant:"contained",color:"primary",disabled:Y,onClick:S,children:u.jsx(c6,{})}),u.jsx(o6,{id:w,open:B,anchorEl:o,onClose:R,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsx("div",{style:{padding:10},children:u.jsxs(h,{container:!0,direction:"column",gap:L.TINY,alignItems:"flex-start",style:{width:180},children:[E()!=="KillHouse"&&u.jsx(su,{placement:"left",title:"ویرایش",children:u.jsx(T,{size:"small",disabled:r==null?void 0:r.directBuying,startIcon:u.jsx(Ku,{fontSize:"small"}),sx:{"&.Mui-disabled":{backgroundColor:"transparent",color:"text.disabled"}},onClick:()=>{R(),F(zu({title:"ویرایش تخصیص",content:u.jsx(V6,{item:r,selectedDate1:f,selectedDate2:C,fetchDashboard:s})}))},children:u.jsx(k,{variant:"body2",textAlign:"left",fontWeight:600,children:"ویرایش تخصیص"})})}),E()!=="KillHouse"&&u.jsx(su,{placement:"left",title:"تخصیص مانده برگشت",children:u.jsx(T,{size:"small",startIcon:u.jsx(j6,{fontSize:"small"}),sx:{"&.Mui-disabled":{backgroundColor:"transparent",color:"text.disabled"}},onClick:()=>{F(Y6({province_kill_request_key:r.provinceKillRequestKey})).then(c=>{c.payload.error?g({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(R(),F(ju({selectedDate1:f,selectedDate2:C})),g({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:u.jsx(k,{variant:"body2",textAlign:"left",fontWeight:600,children:"تخصیص مانده برگشت"})})}),u.jsx(su,{placement:"left",title:"حذف",children:u.jsx(T,{size:"small",disabled:E()!=="AdminX"&&r.allocatedCarState,color:"error",startIcon:u.jsx(i6,{fontSize:"small"}),sx:{"&.Mui-disabled":{backgroundColor:"transparent",color:"text.disabled"}},onClick:()=>{F(N6({province_kill_request_key:r.provinceKillRequestKey})).then(c=>{c.payload.error?g({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(R(),F(ju({selectedDate1:f,selectedDate2:C})),g({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:u.jsx(k,{variant:"body2",textAlign:"left",fontWeight:600,children:"حذف"})})})]})})})]})},O6=U("KILL_REQUEST_PROVINCE",async(r,{dispatch:s})=>{s(O());const o={date1:r.selectedDate1,date2:r.selectedDate2,role:E(),filter:"search",value:r.textValue};r.hasDocumentState&&(o.allocated_car_state=!0);const{data:a,status:F}=await q.get("dahsnoard_province_kill_request",{params:o});return s(I()),{data:a,status:F}}),l6=U("DELETED_KILL_REQUEST_PROVINCE",async(r,{dispatch:s})=>{s(O());const{data:o,status:a}=await q.get("dahsnoard_province_kill_request",{params:{date1:r.selectedDate1,date2:r.selectedDate2,role:E(),deleted_object:!0,filter:"search",value:r.textValue}});return s(I()),{data:o,status:a}}),K6=()=>{var N,K,Q,i,v,P,V,G,au,p,lu,M,cu,m,iu,ou,W,uu;const r=nu(),[s,o]=d.useState(),[,,a,F,g,f]=d.useContext(tu),C=Su(_=>_.userSlice.userProfile.key);d.useEffect(()=>{const _=Nu(new Date).format("YYYY-MM-DD");F(_),f(_)},[]);const[S,R]=d.useState(""),B=_=>{R(_.target.value)},{provinceGetDeletedAllocatedRequests:w}=Su(_=>_.provinceSlice);d.useEffect(()=>{r(n6({selectedDate1:a,selectedDate2:g,textValue:S}))},[a,g]);const Y=()=>{r(n6({selectedDate1:a,selectedDate2:g,textValue:S})),r(l6({selectedDate1:a,selectedDate2:g,textValue:S})).then(_=>{z(_.payload.data)})};d.useEffect(()=>{const _=w==null?void 0:w.map((A,Cu)=>{var l,b;let X="";return A.allocatedState==="pending"?X="در انتظار تایید":A.allocatedState==="accepted"?X="تایید شده":A.allocatedState==="rejected"&&(X="رد شده"),[Cu+1,A==null?void 0:A.orderCode,A!=null&&A.freezing?"انجماد":A!=null&&A.export?"صادرات":"عادی",A==null?void 0:A.poultryUnitName,`${A==null?void 0:A.poultryFullName} (${A==null?void 0:A.poultryMobile})`,A==null?void 0:A.poultryCity,ku(A==null?void 0:A.sendDate),A.poultryQuantity,ku(A==null?void 0:A.dateOfAllocate),A==null?void 0:A.killHouseName,A==null?void 0:A.killHouseCity,((l=A==null?void 0:A.amount)==null?void 0:l.toLocaleString())+" ﷼",((b=A==null?void 0:A.killHousePrice)==null?void 0:b.toLocaleString())+" ﷼",A==null?void 0:A.allocatedQuantity,X,A!=null&&A.allocatedCarState?"دارد":"ندارد",A==null?void 0:A.allocatedRemainQuantity]});o(_)},[w]);const[c,z]=d.useState([]);return d.useEffect(()=>{r(l6({selectedDate1:a,selectedDate2:g,textValue:S})).then(_=>{z(_.payload.data)})},[a,g]),u.jsx(h,{children:u.jsxs(h,{container:!0,justifyContent:"center",alignItems:"center",mb:L.MEDIUM,mt:L.SMALL,children:[u.jsxs(h,{container:!0,alignItems:"center",gap:L.SMALL,children:[u.jsx(h,{style:{width:160},children:u.jsx(vu,{label:"از تاریخ",renderInput:_=>u.jsx(D,{..._}),value:a,onChange:_=>{F(Nu(_).format("YYYY-MM-DD"))}})}),u.jsx(h,{style:{width:160},children:u.jsx(vu,{label:"تا تاریخ",renderInput:_=>u.jsx(D,{..._}),value:g,onChange:_=>{f(Nu(_).format("YYYY-MM-DD"))}})}),u.jsxs(h,{container:!0,alignItems:"center",gap:L.SMALL,children:[u.jsx(D,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:B}),u.jsx(T,{type:"submit",onClick:Y,endIcon:u.jsx(Hu,{}),children:"جستجو"})]}),u.jsx(su,{title:"خروجی اکسل",children:u.jsx("a",{href:`${q.defaults.baseURL}allocated_excel/?start=${a}&end=${g}&type=deleted&role=${E()}&key=${C}&filter=search&value=${S}`,rel:"noreferrer",children:u.jsx(T,{color:"success",children:u.jsx(Ou,{size:32})})})})]}),u.jsx(h,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(bu,{noPagination:!0,isDashboard:!0,columns:["تعداد تخصیصات","حجم تخصیصات","وزن تخصیصات","تعداد تخصیصات تایید شده","حجم تخصیصات تایید شده","تعداد تخصیصات در انتظار تایید","حجم تخصیصات در انتظار تایید","تعداد تخصیصات رد شده","حجم تخصیصات رد شده","تعداد تخصیصات دارای ماشین","حجم تخصیصات دارای ماشین","وزن تخصیصات دارای ماشین","تعداد بارها","حجم بارها","وزن بارها","تعداد تخصیصات فاقد ماشین","حجم تخصیصات فاقد ماشین","وزن تخصیصات فاقد ماشین"],data:[[(N=c==null?void 0:c.lenProvinceRequest)==null?void 0:N.toLocaleString(),(K=c==null?void 0:c.quantity)==null?void 0:K.toLocaleString(),(Q=c==null?void 0:c.weight)==null?void 0:Q.toLocaleString(),(i=c==null?void 0:c.acceptedProvinceKillRequests)==null?void 0:i.toLocaleString(),(v=c==null?void 0:c.acceptedProvinceKillRequestsQuantity)==null?void 0:v.toLocaleString(),(P=c==null?void 0:c.pendingProvinceKillRequests)==null?void 0:P.toLocaleString(),(V=c==null?void 0:c.pendingProvinceKillRequestsQuantity)==null?void 0:V.toLocaleString(),(G=c==null?void 0:c.rejectedProvinceKillRequests)==null?void 0:G.toLocaleString(),(au=c==null?void 0:c.rejectedProvinceKillRequestsQuantity)==null?void 0:au.toLocaleString(),(p=c==null?void 0:c.lenHasCar)==null?void 0:p.toLocaleString(),(lu=c==null?void 0:c.hasCarQuantity)==null?void 0:lu.toLocaleString(),(M=c==null?void 0:c.hasCarWeight)==null?void 0:M.toLocaleString(),(cu=c==null?void 0:c.lenKillRequests)==null?void 0:cu.toLocaleString(),(m=c==null?void 0:c.realQuantity)==null?void 0:m.toLocaleString(),(iu=c==null?void 0:c.realWeight)==null?void 0:iu.toLocaleString(),(ou=c==null?void 0:c.lenHasntCar)==null?void 0:ou.toLocaleString(),(W=c==null?void 0:c.hasntCarQuantity)==null?void 0:W.toLocaleString(),(uu=c==null?void 0:c.hasntCarWeight)==null?void 0:uu.toLocaleString()]],title:"خلاصه اطلاعات"})}),u.jsx(bu,{paginated:!0,title:"تخصیص های حذف شده",columns:["ردیف","کدسفارش","نوع کشتار","نام فارم","نام مرغدار","شهر","تاریخ کشتار","تعداد کشتار","تاریخ تخصیص","خریدار","شهر خریدار","قیمت مرغدار","قیمت کشتارگاه","تعداد تخصیص","وضعیت تایید خریدار","وضعیت تخصیص ماشین","مانده قابل تخصیص"],data:s})]})})},j0=()=>{var G,au,p,lu,M,cu,m,iu,ou,W,uu,_,A,Cu,X,l,b,y;const r=nu(),[s,o]=d.useState(),[a,F]=d.useState(!1),[g,f]=d.useState(0),C=Su(t=>t.userSlice.userProfile.key),[S,R]=d.useState(""),B=t=>{R(t.target.value)},w=t=>{const e=t.target.checked;F(e),r(ju({selectedDate1:c,selectedDate2:N,textValue:S,hasDocumentState:e})),P(e)},Y=(t,e)=>{f(e)},[,,c,z,N,K]=d.useContext(tu);d.useEffect(()=>{const t=Eu(new Date).format("YYYY-MM-DD");z(t),K(t)},[]);const{provinceGetAllocatedRequests:Q}=Su(t=>t.provinceSlice),[i,v]=d.useState([]),P=(t=a)=>{r(O6({selectedDate1:c,selectedDate2:N,textValue:S,hasDocumentState:t})).then(J=>{v(J.payload.data)})};d.useEffect(()=>{g===0&&(r(ju({selectedDate1:c,selectedDate2:N,textValue:S,hasDocumentState:a})),P())},[c,N,g]);const V=()=>{g===0&&(r(ju({selectedDate1:c,selectedDate2:N,textValue:S,hasDocumentState:a})),P(a))};return d.useEffect(()=>{const t=Q==null?void 0:Q.slice().sort((e,J)=>J.allocatedRemainQuantity-e.allocatedRemainQuantity).map((e,J)=>{var du,hu,Au,pu,Fu,yu,Du,Bu,Lu,Iu,Ru;let eu="";e.allocatedState==="pending"?eu="در انتظار تایید":e.allocatedState==="accepted"?eu="تایید شده":e.allocatedState==="rejected"&&(eu="رد شده");let Z="";return e!=null&&e.market?Z="پنل معاملات":e!=null&&e.directBuying?Z="خرید مستقیم":e!=null&&e.union?Z="خرید خارج از استان":Z="اتحادیه",[J+1,e==null?void 0:e.orderCode,Z,(e==null?void 0:e.freeSaleInProvince)===!1?"دولتی":"آزاد",e!=null&&e.freezing?"انجماد":e!=null&&e.export?"صادرات":"عادی",e==null?void 0:e.poultryUnitName,`${e==null?void 0:e.poultryFullName} (${e==null?void 0:e.poultryMobile})`,e==null?void 0:e.poultryCity,ku(e==null?void 0:e.sendDate),(du=e==null?void 0:e.poultryQuantity)==null?void 0:du.toLocaleString(),a6(e==null?void 0:e.dateOfAllocate),e==null?void 0:e.killHouseName,e==null?void 0:e.killHouseCity,(hu=e==null?void 0:e.allocatedQuantity)==null?void 0:hu.toLocaleString(),(Au=e==null?void 0:e.indexWeight)==null?void 0:Au.toLocaleString(),(pu=e==null?void 0:e.totalWeight)==null?void 0:pu.toLocaleString(),((Fu=e==null?void 0:e.amount)==null?void 0:Fu.toLocaleString())+" ﷼",((yu=e==null?void 0:e.killHousePrice)==null?void 0:yu.toLocaleString())+" ﷼",eu,e!=null&&e.allocatedCarState?"دارد":"ندارد",(Du=e==null?void 0:e.allocatedRemainQuantity)==null?void 0:Du.toLocaleString(),(e==null?void 0:e.returnToProvince)===!1?u.jsx(H6,{item:e,fetchDashboard:P},J):u.jsx(su,{disableHoverListener:!(e!=null&&e.returner),title:u.jsx(u.Fragment,{children:(e==null?void 0:e.returner)&&u.jsxs(h,{container:!0,direction:"column",justifyContent:"center",xs:12,children:[u.jsxs(k,{variant:"body2",children:[((Bu=e==null?void 0:e.returner)==null?void 0:Bu.fullname)||"-"," (",((Lu=e==null?void 0:e.returner)==null?void 0:Lu.mobile)||"-",")"]}),u.jsx(k,{variant:"body2",children:(Iu=e==null?void 0:e.returner)!=null&&Iu.date?ku((Ru=e==null?void 0:e.returner)==null?void 0:Ru.date):"-"})]})}),children:u.jsx(k,{variant:"body2",sx:{cursor:e!=null&&e.returner?"pointer":"default"},children:"تخصیص برگشت داده شده"})},J)]});o(t)},[Q]),u.jsxs(h,{children:[u.jsx(h,{container:!0,justifyContent:"center",alignItems:"center",mb:L.MEDIUM,mt:L.SMALL,children:u.jsxs(h6,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:g,onChange:Y,children:[u.jsx(r6,{label:"تخصیص ها"}),u.jsx(r6,{label:"تخصیص های حذف شده"})]})}),g===0&&u.jsxs(h,{container:!0,alignItems:"center",justifyContent:"center",children:[u.jsxs(h,{container:!0,alignItems:"center",gap:L.SMALL,children:[u.jsx(h,{style:{width:160},children:u.jsx(vu,{label:"از تاریخ",renderInput:t=>u.jsx(D,{...t}),value:c,onChange:t=>{z(Eu(t).format("YYYY-MM-DD"))}})}),u.jsx(h,{style:{width:160},children:u.jsx(vu,{label:"تا تاریخ",renderInput:t=>u.jsx(D,{...t}),value:N,onChange:t=>{K(Eu(t).format("YYYY-MM-DD"))}})}),u.jsxs(h,{container:!0,alignItems:"center",gap:L.SMALL,children:[u.jsx(D,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:B}),u.jsx(T,{type:"submit",onClick:V,endIcon:u.jsx(Hu,{}),children:"جستجو"})]}),u.jsx(su,{title:"خروجی اکسل",children:u.jsx("a",{href:`${q.defaults.baseURL}allocated_excel/?start=${c}&end=${N}&role=${E()}&key=${C}&filter=search&value=${S}`,rel:"noreferrer",children:u.jsx(T,{color:"success",children:u.jsx(Ou,{size:32})})})}),u.jsx(Vu,{control:u.jsx(s6,{checked:a,onChange:w,name:"hasDocumentState"}),label:"نمایش تخصیصات بدون بار"})]}),u.jsx(h,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(bu,{noPagination:!0,isDashboard:!0,columns:["تعداد تخصیصات","حجم تخصیصات","وزن تخصیصات","تعداد تخصیصات تایید شده","حجم تخصیصات تایید شده","تعداد تخصیصات در انتظار تایید","حجم تخصیصات در انتظار تایید","تعداد تخصیصات رد شده","حجم تخصیصات رد شده","تعداد تخصیصات دارای ماشین","حجم تخصیصات دارای ماشین","وزن تخصیصات دارای ماشین","تعداد بارها","حجم بارها","وزن بارها","تعداد تخصیصات فاقد ماشین","حجم تخصیصات فاقد ماشین","وزن تخصیصات فاقد ماشین"],data:[[(G=i==null?void 0:i.lenProvinceRequest)==null?void 0:G.toLocaleString(),(au=i==null?void 0:i.quantity)==null?void 0:au.toLocaleString(),(p=i==null?void 0:i.weight)==null?void 0:p.toLocaleString(),(lu=i==null?void 0:i.acceptedProvinceKillRequests)==null?void 0:lu.toLocaleString(),(M=i==null?void 0:i.acceptedProvinceKillRequestsQuantity)==null?void 0:M.toLocaleString(),(cu=i==null?void 0:i.pendingProvinceKillRequests)==null?void 0:cu.toLocaleString(),(m=i==null?void 0:i.pendingProvinceKillRequestsQuantity)==null?void 0:m.toLocaleString(),(iu=i==null?void 0:i.rejectedProvinceKillRequests)==null?void 0:iu.toLocaleString(),(ou=i==null?void 0:i.rejectedProvinceKillRequestsQuantity)==null?void 0:ou.toLocaleString(),(W=i==null?void 0:i.lenHasCar)==null?void 0:W.toLocaleString(),(uu=i==null?void 0:i.hasCarQuantity)==null?void 0:uu.toLocaleString(),(_=i==null?void 0:i.hasCarWeight)==null?void 0:_.toLocaleString(),(A=i==null?void 0:i.lenKillRequests)==null?void 0:A.toLocaleString(),(Cu=i==null?void 0:i.realQuantity)==null?void 0:Cu.toLocaleString(),(X=i==null?void 0:i.realWeight)==null?void 0:X.toLocaleString(),(l=i==null?void 0:i.lenHasntCar)==null?void 0:l.toLocaleString(),(b=i==null?void 0:i.hasntCarQuantity)==null?void 0:b.toLocaleString(),(y=i==null?void 0:i.hasntCarWeight)==null?void 0:y.toLocaleString()]],title:"خلاصه اطلاعات"})}),u.jsx(bu,{title:"تخصیص های انجام شده",paginated:!0,noSearch:!0,columns:["ردیف","کدسفارش","درخواست","فروش","کشتار","نام فارم","نام مرغدار","شهر","تاریخ کشتار","تعداد کشتار","تاریخ تخصیص","خریدار","شهر خریدار","تعداد تخصیص","میانگین وزنی","وزن تقریبی","قیمت مرغدار","قیمت کشتارگاه","وضعیت تایید خریدار","وضعیت تخصیص ماشین","مانده قابل تخصیص","عملیات"],data:s})]}),g===1&&u.jsx(K6,{})]})},Qu=U("SLAUGHTER_EDIT_FREE_BUY_SERVICE",async(r,{dispatch:s})=>{s(O());try{const{data:o,status:a}=await q.put("kill_request/0/",r);return s(I()),{data:o,status:a}}catch(o){return s(I()),{error:o.response.data.result}}}),Q6=U("SLAUGHTER_SUBMIT_FREE_BUY_POST_SERVICE",async(r,{dispatch:s})=>{s(O());try{const{data:o,status:a}=await q.post("kill_request/",r);return s(I()),{data:o,status:a}}catch(o){return s(I()),{error:o.response.data.result}}}),C6=U("PAYMENT_GET_DEADLINES",async()=>{const{data:r,status:s}=await q.get("direct-buying-verification/");return{data:r,status:s}}),d6=({edit:r,updateTable:s})=>{var du,hu,Au,pu,Fu,yu,Du,Bu,Lu,Iu,Ru,Uu,Gu,Xu,Ju,Zu,mu,u6,e6;const o=nu(),[a]=d.useContext(tu),[F,g]=d.useState(!1),[f,C]=d.useState(!1),[S,R]=d.useState(1),[B,w]=d.useState(1),[Y,c]=d.useState(!1),[z,N]=d.useState(!1),[K,Q]=d.useState(!1),{slaughterGetPoultries:i,slaughterGetKillerKillhouses:v,slaughterGetKillhouses:P}=Su(n=>n.slaughterSlice),{weightRange:V}=Su(n=>n.provinceSlice),[G,au]=d.useState(""),[p,lu]=d.useState(""),[M,cu]=d.useState(null),[m,iu]=d.useState(!1),ou=()=>{o(W6()).then(n=>{iu(n.payload.data.poultryStatus)})};d.useEffect(()=>{o(E6()),o(_6()),o(Yu()),o(k6()),o(b6()),o(w6()).then(n=>{Q(n.payload.data.permission)}),ou()},[]);const[W,uu]=d.useState(r?r==null?void 0:r.freeDirectBuying:!0),_=n=>{uu(n.target.value==="true")},A={killhouse:r?r.killHouse.key:null,killerPlace:((du=r==null?void 0:r.slaughterHouse)==null?void 0:du.key)||null,poultry:r?r.poultry.key:null,killDate:r?new Date(r.reciveDate):new Date,numberForBuy:r?r.killCapacity:null,indexWeight:r?r.IndexWeight:"",avicultureSellType:"goverment",poultryPrice:r?r.amount:0,hatching_key:((hu=r==null?void 0:r.poultryHatching)==null?void 0:hu.key)||null,paymentDeadlineDays:(Au=r==null?void 0:r.paymentDeadlineDays)==null?void 0:Au.key,freezing:!1},Cu=n=>{var x;!M&&n.paymentDeadlineDays===0||(E()!=="SuperAdmin"&&E()!=="AdminX"&&!z6(V,p==null?void 0:p.age,n.indexWeight)?a({vertical:"top",horizontal:"center",msg:"میانگین وزنی با احراز سنی مطابقت ندارد. لطفا با اتحادیه تماس بگیرید.",severity:"error"}):o(Q6({kill_capacity:n.numberForBuy,...z?{direct_buying_intermediary_mobile:b.values.intermediaryMobile}:{},recive_time:"12 - 14",recive_date:n.killDate,low_weight:!1,high_weight:!1,Index_weight:n.indexWeight,chicken_breed:p==null?void 0:p.chickenBreed,cash:!0,credit:!1,sms_payment:!1,kill_house_key:n.killhouse,killer_kill_house_key:n.killerPlace?n.killerPlace:null,role:E(),freezing:n.freezing,poultry_key:l.values.poultry,free_direct_buying:W,amount:e!=null&&e.approved&&!W&&!((e==null?void 0:e.lowestPrice)===0&&(e==null?void 0:e.highestPrice)===0&&(e==null?void 0:e.lowestWeight)===0&&(e==null?void 0:e.highestWeight)===0)?Math.round(eu):Number(n.poultryPrice),hatching_key:l.values.hatching_key,payment_deadline_days:(x=l==null?void 0:l.values)==null?void 0:x.paymentDeadlineDays,confirm_poultry_mobile:b.values.userInfoCheck})).then(j=>{j.payload.error?a({vertical:"top",horizontal:"center",msg:j.payload.error,severity:"error"}):(s(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(wu({right:!1,bottom:!1,left:!1,content:null})))}))},X=Tu().shape({killhouse:fu().typeError("این فیلد الزامی است").required("این فیلد الزامی است"),poultry:fu().typeError("این فیلد الزامی است").required("این فیلد الزامی است"),numberForBuy:xu().typeError("لطفا عدد وارد کنید").max(r?1/0:F,"تعداد بیش از حد مجاز است").required("لطفا عدد وارد کنید").positive("لطفا عدد وارد کنید").integer("لطفا عدد وارد کنید"),indexWeight:xu().typeError("لطفا عدد وارد کنید").required("لطفا عدد وارد کنید").positive("لطفا عدد وارد کنید"),poultryPrice:xu().typeError("لطفا فیلد را به درستی وارد کنید!").min(W?4e5:0,"حداقل قیمت پایه ۴۰۰,۰۰۰ ریال ").required("این فیلد اجباری است"),hatching_key:fu().required("این فیلد الزامی است"),paymentDeadlineDays:xu().when([],{is:()=>M!==null,then:xu().required("این فیلد الزامی است").min(1,"حداقل مقدار باید 1 باشد").max(M,`حداکثر مقدار باید ${M} باشد`),otherwise:xu().notRequired()})}),l=Pu({initialValues:A,validationSchema:X,onSubmit:Cu}),b=Pu({initialValues:{userInfoCheck:"",intermediaryMobile:""},validationSchema:Tu({userInfoCheck:fu().min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^0\d{10}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),intermediaryMobile:fu().min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^0\d{10}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد")})});d.useEffect(()=>{l.values.poultry&&o(T6(l.values.poultry)).then(n=>{au(n.payload.data)})},[l.values.poultry]),d.useEffect(()=>{var j,$,H,ru;let n=l.values.indexWeight;const x=(ru=(H=($=(j=l.values)==null?void 0:j.indexWeight)==null?void 0:$.toString())==null?void 0:H.split("."))==null?void 0:ru.join("");l.values.indexWeight&&x.length<=3&&(x.length===2&&(n=x[0]+"."+x[1]),x.length===3&&(n=x[0]+"."+x[1]+x[2])),isNaN(Number.parseFloat(n))?l.setFieldValue("indexWeight",""):l.setFieldValue("indexWeight",Number.parseFloat(n))},[l.values.indexWeight]);const y=async n=>{n.preventDefault(),o(Yu({min_age:S||1,max_age:B||1}))},t=async n=>{n.preventDefault(),R(1),w(1),o(Yu())};d.useEffect(()=>{var n;g(W===!0?(n=p.freeGovernmentalInfo)==null?void 0:n.leftTotalFreeCommitmentQuantity:p.leftOver),setTimeout(()=>{l.validateField("numberForBuy")},1)},[W]);const[e,J]=d.useState(),[eu,Z]=d.useState();return d.useEffect(()=>{o(D6()).then(n=>{var x,j,$,H,ru,gu;J(n.payload.data),((x=n.payload.data)==null?void 0:x.approved)===!1&&l.setFieldValue("avicultureSellType","freePrice"),((j=n.payload.data)==null?void 0:j.approved)===!0&&(($=n.payload.data)==null?void 0:$.lowestPrice)===0&&((H=n.payload.data)==null?void 0:H.highestPrice)===0&&((ru=n.payload.data)==null?void 0:ru.lowestWeight)===0&&((gu=n.payload.data)==null?void 0:gu.highestWeight)===0&&uu(!1)})},[]),d.useEffect(()=>{o(C6()).then(n=>{var $,H,ru,gu;const x=(H=($=n==null?void 0:n.payload)==null?void 0:$.data)==null?void 0:H.paymentDeadline,j=(gu=(ru=n==null?void 0:n.payload)==null?void 0:ru.data)==null?void 0:gu.paymentDeadlineDays;x===!0&&j>0&&cu(j)})},[o]),d.useEffect(()=>{if(e!=null&&e.approved&&!((e==null?void 0:e.lowestPrice)===0&&(e==null?void 0:e.highestPrice)===0&&(e==null?void 0:e.lowestWeight)===0&&(e==null?void 0:e.highestWeight)===0))if(l.values.indexWeight*1e3<=(e==null?void 0:e.lowestWeight))Z(e==null?void 0:e.lowestPrice);else if(l.values.indexWeight*1e3>=(e==null?void 0:e.highestWeight))Z(e==null?void 0:e.highestPrice);else{const n=(e==null?void 0:e.highestWeight)-(e==null?void 0:e.lowestWeight),j=((e==null?void 0:e.highestPrice)-(e==null?void 0:e.lowestPrice))/n,$=l.values.indexWeight*1e3-(e==null?void 0:e.lowestWeight);Z($*j+(e==null?void 0:e.lowestPrice)),l.setFieldValue("poultryPrice",$*j+(e==null?void 0:e.lowestPrice))}},[l.values.indexWeight]),u.jsx("form",{onSubmit:l.handleSubmit,children:u.jsx(h,{container:!0,direction:"column",gap:L.TINY,children:u.jsxs(u.Fragment,{children:[r?null:P!=null&&P.length?u.jsx(Wu,{id:"killhouse",disableClearable:!0,options:P==null?void 0:P.map(n=>({label:(n!=null&&n.killer?"کشتارکن":"کشتارگاه")+" "+n.name,value:n.key,killer:n.killer,item:n,disabled:n.allowDirectBuying})),getOptionDisabled:n=>!n.disabled,getOptionLabel:n=>n.label,onChange:(n,x)=>{C(x.killer),l.setFieldValue("killhouse",x.value)},onBlur:l.handleBlur,renderInput:n=>u.jsx(D,{...n,label:"انتخاب کشتارگاه/کشتارکن",variant:"outlined",error:l.touched.killhouse&&!!l.errors.killhouse,helperText:l.touched.killhouse&&l.errors.killhouse})}):u.jsx(A6,{}),f&&u.jsx(Wu,{id:"killerPlace",disableClearable:!0,options:v==null?void 0:v.map(n=>({label:"کشتارگاه "+n.name,value:n.key})),getOptionLabel:n=>n.label,onChange:(n,x)=>l.setFieldValue("killerPlace",x.value),onBlur:l.handleBlur,renderInput:n=>u.jsx(D,{...n,label:"انتخاب محل کشتار",variant:"outlined",error:l.touched.killerPlace&&!!l.errors.killerPlace,helperText:l.touched.killerPlace&&l.errors.killerPlace})}),(l.values.killhouse||l.values.killerPlace)&&u.jsxs(u.Fragment,{children:[u.jsxs(h,{container:!0,alignItems:"center",spacing:2,children:[!r&&u.jsx(h,{item:!0,xs:8,sm:9,children:u.jsx(Wu,{id:"poultry",disableClearable:!0,options:(i==null?void 0:i.map(n=>{var x;return{label:`${n.unitName} (${(x=n.user)==null?void 0:x.fullname})`,value:n.key,item:n}}))||[],getOptionLabel:n=>n.label,onChange:(n,x)=>{l.setFieldValue("poultry",x.item.key),g(x.item.lastHatchingRemainQuantity)},onBlur:l.handleBlur,renderOption:(n,x)=>{var $,H,ru,gu;const j=x.item;return d.createElement("li",{...n,key:x.value},u.jsxs(h,{container:!0,direction:"column",children:[u.jsxs(k,{variant:"body2",sx:{fontSize:"0.75rem"},children:[j==null?void 0:j.unitName," (",($=j==null?void 0:j.user)==null?void 0:$.fullname,")"]}),u.jsxs(k,{variant:"caption",color:"text.secondary",sx:{fontSize:"0.7rem"},children:[((H=j==null?void 0:j.user)==null?void 0:H.mobile)||"-"," |"," ",((gu=(ru=j==null?void 0:j.address)==null?void 0:ru.city)==null?void 0:gu.name)||"-"]})]}))},renderInput:n=>u.jsx(D,{...n,label:"انتخاب مرغداری",variant:"outlined",fullWidth:!0,error:l.touched.poultry&&!!l.errors.poultry,helperText:l.touched.poultry&&l.errors.poultry})})}),!r&&u.jsx(h,{item:!0,xs:2,sm:1,children:u.jsx(su,{title:"جستجوی پیشرفته",children:u.jsx($u,{onClick:()=>c(!Y),color:Y?"error":"primary",size:"large",children:Y?u.jsx(R6,{}):u.jsx(q6,{})})})})]}),Y&&u.jsxs(h,{container:!0,spacing:2,sm:12,children:[u.jsx(h,{item:!0,xs:6,sm:6,children:u.jsx(D,{size:"small",label:"از سن",type:"number",value:S,onChange:n=>R(n.target.value)})}),u.jsx(h,{item:!0,xs:6,sm:6,children:u.jsx(D,{size:"small",label:"تا سن",type:"number",value:B,onChange:n=>w(n.target.value)})}),u.jsx(h,{item:!0,xs:12,sm:12,children:u.jsxs(h,{container:!0,justifyContent:"center",alignItems:"center",spacing:1,children:[u.jsx(h,{item:!0,sm:6,children:u.jsx(T,{variant:"contained",disabled:S>B||S<1||B<1,onClick:y,children:"اعمال فیلتر"})}),u.jsx(h,{item:!0,sm:6,children:u.jsx(T,{variant:"outlined",color:"error",onClick:t,children:"حذف فیلتر"})})]})})]}),G&&u.jsxs(h,{minWidth:210,children:[!r&&u.jsx(Wu,{disablePortal:!0,disabled:!l.values.poultry,id:"combo-box-demo",options:G==null?void 0:G.map(n=>({label:`${n==null?void 0:n.poultry.unitName}`,value:n.key,item:n})),onChange:(n,x)=>{var j,$,H;lu(x.item),b.setFieldValue("userInfoCheck",(H=($=(j=x.item)==null?void 0:j.poultry)==null?void 0:$.userprofile)==null?void 0:H.mobile),l.setFieldValue("hatching_key",x.value)},renderInput:n=>u.jsx(D,{...n,label:"محل پرورش"})}),l.values.hatching_key&&u.jsxs(h,{container:!0,direction:"column",gap:L.SMALL,mt:2,children:[p&&u.jsxs(h,{container:!0,direction:"column",justifyContent:"space-between",children:[u.jsxs(h,{container:!0,gap:L.TINY,mt:1,children:[u.jsx(k,{children:"نام و نام خانوادگی:"}),u.jsx(k,{children:(Fu=(pu=p==null?void 0:p.poultry)==null?void 0:pu.userprofile)==null?void 0:Fu.fullName})]}),u.jsxs(h,{container:!0,gap:1,mt:1,p:1,sx:{borderStyle:"solid",borderRadius:"10px",borderColor:"red",borderWidth:"1px"},children:[u.jsx(su,{title:"ورود تلفن واقعی مرغدار جهت دریافت کد احراز",children:u.jsxs(h,{container:!0,gap:L.TINY,alignItems:"center",children:[u.jsx(k,{children:"تلفن مرغدار:"}),u.jsx(k,{children:(Du=(yu=p==null?void 0:p.poultry)==null?void 0:yu.userprofile)==null?void 0:Du.mobile})]})}),u.jsxs(h,{alignItems:"center",xs:12,container:!0,justifyContent:"start",children:[u.jsx(s6,{sx:{marginLeft:"-12px"},color:"primary",checked:z,onChange:()=>N(!z)}),u.jsx(k,{variant:"caption",color:"primary",children:"تلفن واسطه جهت دریافت کد احراز"})]}),z&&u.jsx(D,{mt:2,size:"small",fullWidth:!0,id:"intermediaryMobile",label:"تلفن واسطه",variant:"outlined",value:b.values.intermediaryMobile,onChange:b.handleChange,onBlur:b.handleBlur,error:!!b.errors.intermediaryMobile,helperText:b.touched.intermediaryMobile&&b.errors.intermediaryMobile?b.errors.intermediaryMobile:null})]}),u.jsxs(h,{container:!0,gap:L.TINY,mt:1,children:[u.jsx(k,{children:"آدرس:"}),u.jsx(k,{children:`شهر ${(Iu=(Lu=(Bu=p.poultry)==null?void 0:Bu.address)==null?void 0:Lu.city)==null?void 0:Iu.name} ${(Uu=(Ru=p==null?void 0:p.poultry)==null?void 0:Ru.address)!=null&&Uu.address?"-"+((Xu=(Gu=p==null?void 0:p.poultry)==null?void 0:Gu.address)==null?void 0:Xu.address):""}`})]}),u.jsxs(h,{container:!0,gap:L.TINY,mt:1,children:[u.jsx(k,{children:"سن جوجه:"}),u.jsxs(k,{children:[p==null?void 0:p.chickenAge," روز"]})]}),u.jsxs(h,{container:!0,gap:L.TINY,mt:1,children:[u.jsx(k,{children:"مانده در سالن:"}),u.jsxs(k,{children:[(Ju=p==null?void 0:p.leftOver)==null?void 0:Ju.toLocaleString(),"قطعه"]})]}),u.jsxs(h,{container:!0,gap:L.TINY,mt:1,children:[u.jsx(k,{color:"error",children:"مانده فروش آزاد:"}),u.jsxs(k,{color:"error",children:[(mu=(Zu=p==null?void 0:p.freeGovernmentalInfo)==null?void 0:Zu.leftTotalFreeCommitmentQuantity)==null?void 0:mu.toLocaleString()," ","قطعه"]})]}),u.jsxs(h,{container:!0,gap:L.TINY,mt:1,children:[u.jsx(k,{children:"نژاد:"}),u.jsx(k,{children:p==null?void 0:p.chickenBreed})]})]}),m&&p&&E()!=="KillHouse"&&u.jsx(D,{fullWidth:!0,id:"userInfoCheck",label:"ویرایش تلفن مرغدار",variant:"outlined",value:b.values.userInfoCheck,error:b.touched.city?!!b.errors.userInfoCheck:null,onChange:b.handleChange,onBlur:b.handleBlur,helperText:b.touched.userInfoCheck&&b.errors.userInfoCheck?b.errors.userInfoCheck:null}),m&&p&&E()!=="KillHouse"&&u.jsx(k,{variant:"caption",color:"error",children:"احراز پیامکی قیمت مرغدار در استان فعال است. در صورت ویرایش، تلفن مرغدار در سراسر سامانه با تلفن جدید جایگزین میگردد!"}),!r&&u.jsx(h,{children:u.jsx(vu,{fullWidth:!0,label:"تاریخ کشتار",id:"killDate",renderInput:n=>u.jsx(D,{...n}),value:l.values.killDate instanceof Date?l.values.killDate:l.values.killDate?new Date(l.values.killDate):null,error:l.touched.killDate?!!l.errors.killDate:null,onChange:n=>{l.setFieldValue("killDate",n)},onBlur:l.handleBlur,helperText:l.touched.killDate&&l.errors.killDate?l.errors.killDate:null})}),u.jsx(h,{children:u.jsx(P6,{allowLeadingZeros:!0,thousandSeparator:",",id:"numberForBuy",name:"numberForBuy",label:"حجم",variant:"outlined",value:l.values.numberForBuy,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.numberForBuy&&!!l.errors.numberForBuy,helperText:l.touched.numberForBuy&&l.errors.numberForBuy})}),u.jsx(h,{children:u.jsx(D,{id:"indexWeight",name:"indexWeight",label:"میانگین وزنی",variant:"outlined",value:l.values.indexWeight,onChange:l.handleChange,onBlur:l.handleBlur,InputProps:{endAdornment:u.jsx(qu,{position:"end",children:"کیلوگرم"})},error:l.touched.indexWeight&&!!l.errors.indexWeight,helperText:l.touched.indexWeight&&l.errors.indexWeight})}),(e==null?void 0:e.approved)&&!r&&!((e==null?void 0:e.lowestPrice)===0&&(e==null?void 0:e.highestPrice)===0&&(e==null?void 0:e.lowestWeight)===0&&(e==null?void 0:e.highestWeight)===0)&&u.jsx(h,{children:u.jsxs(p6,{children:[u.jsx(F6,{id:"demo-controlled-radio-buttons-group",children:"قیمت خرید"}),u.jsxs(y6,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:W,onChange:_,children:[u.jsx(Vu,{value:!0,control:u.jsx(t6,{}),label:"آزاد"}),u.jsx(Vu,{value:!1,control:u.jsx(t6,{}),label:"دولتی"})]})]})}),(e==null?void 0:e.approved)&&W===!1&&!r&&!((e==null?void 0:e.lowestPrice)===0&&(e==null?void 0:e.highestPrice)===0&&(e==null?void 0:e.lowestWeight)===0&&(e==null?void 0:e.highestWeight)===0)&&u.jsx(h,{children:u.jsxs(h,{gap:1,container:!0,p:1,style:{borderStyle:"solid",borderWidth:"1px",borderColor:"red",borderRadius:"5px"},children:[u.jsx(su,{title:`قیمت مصوب بر اساس قیمت مصوب کف ${e==null?void 0:e.lowestPrice.toLocaleString()} هزار ریال و سقف ${(u6=e==null?void 0:e.highestPrice)==null?void 0:u6.toLocaleString()} هزار ریال محاسبه شده است.`,children:u.jsx(k,{variant:"body1",color:"secondary",children:"قیمت مصوب:"})}),u.jsxs(k,{variant:"body1",color:"primary",children:[eu?(e6=Math.round(eu))==null?void 0:e6.toLocaleString():0," ","ریال"]})]})}),(W||W===!1&&(e==null?void 0:e.approved)&&(e==null?void 0:e.lowestPrice)===0&&(e==null?void 0:e.highestPrice)===0&&(e==null?void 0:e.lowestWeight)===0&&(e==null?void 0:e.highestWeight)===0)&&!r&&u.jsx(h,{children:u.jsx(D,{id:"poultryPrice",label:"قیمت فروش مرغدار",variant:"outlined",InputProps:{endAdornment:u.jsx(qu,{position:"end",children:"ریال"})},value:l.values.poultryPrice,error:l.touched.poultryPrice?!!l.errors.poultryPrice:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.poultryPrice&&l.errors.poultryPrice?l.errors.poultryPrice:null})}),M&&!r&&u.jsx(h,{children:u.jsx(D,{id:"poultryPrice",label:"حداکثر زمان تسویه",variant:"outlined",InputProps:{endAdornment:u.jsx(qu,{position:"end",children:"روز"}),inputProps:{min:1,max:M}},value:l.values.paymentDeadlineDays,onChange:n=>{const x=Number(n.target.value);x<=M&&l.setFieldValue("paymentDeadlineDays",x)},onBlur:l.handleBlur,error:l.errors.paymentDeadlineDays,helperText:l.touched.paymentDeadlineDays&&l.errors.paymentDeadlineDays?l.errors.paymentDeadlineDays:M?`حداکثر زمان مجاز ${M} روز است`:""})}),!r&&u.jsx(T,{onClick:()=>{l.validateForm().then(()=>{})},type:"submit",variant:"contained",color:"primary",fullWidth:!0,disabled:!p||!b.isValid,children:E()==="KillHouse"?"ثبت اولیه":"ثبت"}),r&&u.jsx(T,{disabled:!l.values.numberForBuy||!l.values.killDate||!l.values.indexWeight,variant:"contained",color:"primary",fullWidth:!0,onClick:()=>{o(Qu({role:E(),kill_capacity:l.values.numberForBuy,recive_date:l.values.killDate,Index_weight:l.values.indexWeight,kill_request_key:r.key,remain_quantity:l.values.numberForBuy,free_direct_buying:W})).then(n=>{var x,j;(x=n==null?void 0:n.payload)!=null&&x.error?a({vertical:"top",horizontal:"center",msg:(j=n==null?void 0:n.payload)==null?void 0:j.error,severity:"error"}):(s(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(wu({right:!1,bottom:!1,left:!1,content:null})))})},children:"ثبت ویرایش"})]})]})]})]})})})},U6=U("SLAUGHTER_DELETE_FREE_BUY_SERVICE",async(r,{dispatch:s})=>{s(O());try{const{data:o,status:a}=await q.delete(`kill_request/0/?role=${E()}&kill_request_key=${r}`);return s(I()),{data:o,status:a}}catch(o){return s(I()),{error:o.response.data.result}}}),G6=U("PROVINCE_REJECT_SLAUGHTER_FREE_BUY_SERVICE",async(r,{dispatch:s})=>{s(O());try{const{data:o,status:a}=await q.post("check_direct_buying/",r);return s(I()),{data:o,status:a}}catch(o){return s(I()),{error:o.response.data.result}}}),X6=({item:r,updateTable:s})=>{const o=nu(),[a]=d.useContext(tu),[F,g]=d.useState(""),f=C=>{g(C.target.value)};return u.jsxs(h,{container:!0,direction:"column",gap:L.TINY,width:"100%",children:[u.jsx(D,{label:"دلیل رد درخواست",variant:"outlined",fullWidth:!0,value:F,onChange:f}),u.jsx(T,{variant:"contained",color:"primary",onClick:()=>{o(G6({state:"rejected",kill_request_key:r.key,direct_buying_message:F})).then(C=>{C.error?a({vertical:"top",horizontal:"center",msg:C.error,severity:"error"}):(s(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(_u()))})},children:"ثبت رد درخواست"})]})},J6=U("PROVINCE_ACCEPT_SLAUGHTER_FREE_BUY_SERVICE",async(r,{dispatch:s})=>{s(O());try{const{data:o,status:a}=await q.post("check_direct_buying/",r);return s(I()),{data:o,status:a}}catch(o){return s(I()),{error:o.response.data.result}}}),Z6=({item:r,updateTable:s})=>{var C,S,R;const[o]=d.useContext(tu),a=nu(),[F,g]=d.useState(r.killCapacity),f=B=>{g(B.target.value)};return u.jsxs(h,{container:!0,direction:"column",gap:L.TINY,width:"100%",children:[u.jsxs(k,{variant:"body1",color:"error",children:["مانده در سالن مرغدار:","‌ ",(S=(C=r==null?void 0:r.poultry)==null?void 0:C.leftOverOwnHatching)==null?void 0:S.toLocaleString()]}),u.jsx(D,{label:"تعداد تایید شده",variant:"outlined",type:"number",fullWidth:!0,value:F,onChange:f}),u.jsx(T,{variant:"contained",disabled:parseInt(F)>((R=r==null?void 0:r.poultry)==null?void 0:R.leftOverOwnHatching)||!F,fullWidth:!0,onClick:()=>{a(J6({state:"accepted",kill_request_key:r.key,quantity:F,role:E()})).then(B=>{B.payload.error?o({vertical:"top",horizontal:"center",msg:B.payload.error,severity:"error"}):(s(),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),a(_u()))})},children:"ثبت"})]})},m6=U("SLAUGHTER_RESEND_DIRECT_BUYING_SMS_SERVICE",async(r,{dispatch:s})=>{s(O());try{const{data:o,status:a}=await q.post("send_again_sms_direct_buying_code/",r);return s(I()),{data:o,status:a}}catch(o){return s(I()),{error:o.response.data.result}}}),u0=({item:r,updateTable:s,poultryCodeMandatory:o})=>{const a=nu(),[F]=d.useContext(tu),[g,f]=d.useState(null),C=v=>{f(v.currentTarget)},S=()=>{f(null)},R=!!g,B=R?"popover":void 0,w=o&&!(r!=null&&r.inputDirectBuyingCode),Y=()=>{a(zu({title:"تایید فروش مستقیم",content:u.jsx(Z6,{item:r,updateTable:s})}))},c=()=>{a(zu({title:"رد درخواست فروش آزاد",content:u.jsx(X6,{item:r,updateTable:s})}))},z=()=>{a(zu({title:"آیا مطمئن هستید؟",content:u.jsxs(h,{container:!0,children:[u.jsx(T,{variant:"contained",onClick:()=>{a(Qu({role:E(),kill_request_key:r==null?void 0:r.key,final_accept:!0})).then(v=>{var P,V;(P=v==null?void 0:v.payload)!=null&&P.error?F({vertical:"top",horizontal:"center",msg:(V=v==null?void 0:v.payload)==null?void 0:V.error,severity:"error"}):(a(_u()),s(),F({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),u.jsx(T,{onClick:()=>{a(_u())},children:"لغو"})]})}))},N=()=>{a(wu({title:"ویرایش خرید مستقیم",content:u.jsx(d6,{edit:r,updateTable:s}),right:!(window.innerWidth<=600),bottom:window.innerWidth<=600}))},K=()=>{a(m6({key:r==null?void 0:r.key})).then(v=>{var P,V;(P=v==null?void 0:v.payload)!=null&&P.error?F({vertical:"top",horizontal:"center",msg:(V=v==null?void 0:v.payload)==null?void 0:V.error,severity:"error"}):F({vertical:"top",horizontal:"center",msg:"پیامک با موفقیت ارسال شد.",severity:"success"})})},Q=()=>{a(U6(r.key)).then(v=>{v.error?F({vertical:"top",horizontal:"center",msg:v.error,severity:"error"}):(s(),F({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),a(wu({right:!1,bottom:!1,left:!1,content:null})))})},i=[];return!w&&(E()==="ProvinceOperator"||E()==="SuperAdmin"||E()==="AdminX")&&(i.push({key:"approve",label:"تایید درخواست",color:"success.main",icon:u.jsx(B6,{fontSize:"small"}),action:Y}),i.push({key:"reject",label:"رد درخواست",color:"warning.main",icon:u.jsx(L6,{fontSize:"small"}),action:c})),E()==="KillHouse"&&!(r!=null&&r.finalAccept)&&(i.push({key:"finalAccept",label:"تایید نهایی",color:"primary.main",icon:u.jsx(I6,{fontSize:"small"}),action:z}),i.push({key:"edit",label:"ویرایش",color:"info.main",icon:u.jsx(Ku,{fontSize:"small"}),action:N})),w&&(r!=null&&r.finalAccept)&&i.push({key:"resendSms",label:"ارسال مجدد پیامک",color:"info.main",icon:u.jsx(M6,{fontSize:"small"}),action:K}),i.push({key:"delete",label:"حذف",color:"error.main",icon:u.jsx(i6,{fontSize:"small"}),action:Q}),u.jsxs(h,{container:!0,children:[u.jsx($u,{size:"small",disabled:(r==null?void 0:r.directBuyingState)==="accepted"||!w&&(E()==="KillHouse"&&(r!=null&&r.finalAccept)?!0:(r==null?void 0:r.directBuyingState)!=="pending"),"aria-describedby":B,variant:"contained",color:"primary",onClick:C,children:u.jsx(c6,{})}),u.jsx(o6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:B,open:R,anchorEl:g,onClose:S,children:u.jsx(g6,{sx:{width:130,p:.5},children:i.map(v=>u.jsxs(x6,{onClick:()=>{S(),v.action()},sx:{borderRadius:1,mb:.25,py:.5,color:v.color,"&:last-of-type":{mb:0}},children:[u.jsx(f6,{sx:{color:v.color,minWidth:32},children:v.icon}),u.jsx(v6,{primary:v.label,primaryTypographyProps:{sx:{color:v.color,fontSize:"0.82rem",fontWeight:600}}})]},v.key))})})]})},e0=U("VERFICATION_DIRECT_BUYING_CODE",async(r,{dispatch:s})=>{s(O());try{const{data:o,status:a}=await q.put("kill_request/0/",r);return s(I()),{data:o,status:a}}catch(o){return s(I()),{error:o.response.data.result}}});function r0({inputDirectBuyingCode:r,kill_request_key:s,updateTable:o}){const a=nu(),[F]=d.useContext(tu),[g,f]=d.useState(!1),C=Pu({initialValues:{input_direct_buying_code:r},validationSchema:Tu({input_direct_buying_code:fu().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!").matches(/^[0-9]+$/,"فقط عدد وارد کنید")}),onSubmit:S=>{a(e0({kill_request_key:s,input_direct_buying_code:S.input_direct_buying_code,role:"KillHouse"})).then(R=>{R.payload.error?F({vertical:"top",horizontal:"center",msg:R.payload.error,severity:"error"}):(F({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o()),f(!1)})}});return d.useEffect(()=>{C.setValues({input_direct_buying_code:r}),f(!1)},[r]),g?u.jsx(Mu,{container:!0,minWidth:"130px",children:u.jsx("form",{onSubmit:C.handleSubmit,children:u.jsx(D,{variant:"standard",name:"input_direct_buying_code",value:C.values.input_direct_buying_code,size:"small",onChange:C.handleChange,onBlur:C.handleBlur,error:C.touched.input_direct_buying_code&&!!C.errors.input_direct_buying_code,helperText:C.touched.input_direct_buying_code&&C.errors.input_direct_buying_code,InputProps:{endAdornment:u.jsx(qu,{position:"end",children:u.jsx(k,{style:{cursor:"pointer"},color:"primary",fontWeight:"bold",variant:"caption",onClick:C.handleSubmit,children:"ثبت"})})}})})}):u.jsxs(Mu,{container:!0,alignItems:"center",children:[u.jsx(k,{variant:"caption",children:r}),u.jsx($u,{"aria-label":"delete",size:"small",color:"primary",onClick:()=>{f(!g)},children:u.jsx(Ku,{})})]})}const t0=U("SLAUGHTER_GET_FREE_BUY_DASHBOARD",async(r,{dispatch:s})=>{s(O());const{data:o,status:a}=await q.get("dashboard_kill_request/?operator=KillHouse",{params:r});return s(I()),{data:o,status:a}}),E0=()=>{var ou,W,uu,_,A,Cu,X,l,b;const r=nu(),[,,s,o,a,F]=d.useContext(tu),[g,f]=d.useState(!1),[C,S]=d.useState([]),R=Su(y=>y.userSlice.userProfile.key);d.useEffect(()=>{const y=Eu(new Date).format("YYYY-MM-DD");o(y),F(y)},[]),d.useEffect(()=>{r(C6()).then(y=>{var t;f((t=y.payload.data)==null?void 0:t.poultryCodeMandatory)})},[r]);const[B,w]=d.useState([]),[Y,c]=d.useState(0),[z,N]=d.useState(10),[K,Q]=d.useState(""),[i,v]=d.useState(1),[P,V]=d.useState([]),G=y=>{Q(y.target.value)},au=()=>{r(t0({direct_buying:!0,date1:s,date2:a,role:E(),search:"filter",value:K})).then(y=>{S(y.payload.data)})},p=d.useCallback(async(y=i)=>{r(O());try{const t=await q.get(`kill_request/?direct_buying=true&role=${E()}&date1=${s}&date2=${a}&search=filter&value=${K||""}&page=${y}&page_size=${z}`);r(I()),au(),w(t.data.results),c(t.data.count)}catch{r(I())}},[s,a,z,i,r]),lu=d.useCallback(()=>{p(1)},[p]);d.useEffect(()=>{p(1)},[p]);const M=y=>{N(y),v(1)},cu=y=>{p(y,K)},m=async y=>{y.preventDefault(),r(O());try{const t=await q.get(`kill_request/?direct_buying=true&role=${E()}&date1=${s}&date2=${a}&search=filter&value=${K||""}`);w(t.data.results),c(t.data.count),r(I())}catch(t){console.error("Error fetching data:",t)}},iu=y=>{let t="";return y.finalAccept===!1?t="در انتظار ارسال به استان":g&&!(y!=null&&y.inputDirectBuyingCode)?t="در انتظار ورود کد احراز":(y==null?void 0:y.directBuyingState)==="rejected"?t="رد شده":(y==null?void 0:y.directBuyingState)==="accepted"?t="تایید شده":(y==null?void 0:y.directBuyingState)==="deleted"?t="حذف شده":t="در انتظار تایید استان",t};return d.useEffect(()=>{const y=B==null?void 0:B.map((t,e)=>{var J,eu,Z,du,hu,Au,pu,Fu,yu;return[i===1?e+1:e+z*(i-1)+1,t!=null&&t.createDate?a6(t==null?void 0:t.createDate):"-",t!=null&&t.reciveDate?ku(t==null?void 0:t.reciveDate):"-",`${t.killHouse.name} (${t.killHouse.killHouseOperator.user.mobile})`,t!=null&&t.freeDirectBuying?"آزاد":"دولتی",t!=null&&t.slaughterHouse?(J=t==null?void 0:t.slaughterHouse)==null?void 0:J.name:(eu=t==null?void 0:t.killHouse)==null?void 0:eu.name,`${(du=(Z=t==null?void 0:t.poultry)==null?void 0:Z.userprofile)==null?void 0:du.fullName} (${(Au=(hu=t==null?void 0:t.poultry)==null?void 0:hu.userprofile)==null?void 0:Au.mobile})`,((pu=t.poultryHatching)==null?void 0:pu.chickenAge)||"-",`${t.chickenBreed?t.chickenBreed:"-"}`,(Fu=t.killCapacity)==null?void 0:Fu.toLocaleString(),t.IndexWeight,(t.IndexWeight*t.killCapacity).toLocaleString(),(yu=t==null?void 0:t.amount)==null?void 0:yu.toLocaleString(),u.jsx(h,{children:(t==null?void 0:t.directBuyingState)==="pending"&&(t==null?void 0:t.finalAccept)===!0&&(E()==="KillHouse"||E()==="AdminX"||E()==="SuperAdmin"||E()==="ProvinceOperator")&&g?u.jsx(r0,{updateTable:p,kill_request_key:t==null?void 0:t.key,inputDirectBuyingCode:t==null?void 0:t.inputDirectBuyingCode}):u.jsx(k,{variant:"body2",children:(t==null?void 0:t.inputDirectBuyingCode)||"-"})},e),t!=null&&t.paymentDeadlineDate?ku(t==null?void 0:t.paymentDeadlineDate):"-",iu(t),(t==null?void 0:t.directBuyingState)==="pending"?"-":t!=null&&t.automaticAccept?"سیستم":"اپراتور",t!=null&&t.inputDirectBuyingCode||!(t!=null&&t.freeDirectBuying)&&(t==null?void 0:t.directBuyingState)==="accepted"?u.jsx($6,{pdf_key:t==null?void 0:t.key}):"-",u.jsx(u0,{item:t,updateTable:lu,poultryCodeMandatory:g},`ops-${e}`)]});V(y)},[B]),u.jsx(h,{container:!0,direction:"column",gap:L.SMALL,alignItems:"center",children:u.jsxs(h,{container:!0,xs:12,px:1,gap:2,children:[u.jsx(h,{container:!0,alignSelf:"start",children:u.jsx(T,{variant:"contained",onClick:()=>{r(wu({title:"ثبت خرید مستقیم",content:u.jsx(d6,{updateTable:lu,fetchApiData:p}),right:!(window.innerWidth<=600),bottom:window.innerWidth<=600}))},children:"ثبت خرید مستقیم"})}),u.jsxs(h,{container:!0,xs:12,justifyContent:"start",alignItems:"center",children:[u.jsx(h,{container:!0,alignItems:"center",mb:L.SMALL,gap:L.SMALL,children:u.jsx("form",{onSubmit:m,children:u.jsxs(h,{container:!0,alignItems:"center",gap:L.SMALL,children:[u.jsx(D,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:G}),u.jsx(T,{type:"submit",onClick:m,endIcon:u.jsx(Hu,{}),children:"جستجو"}),u.jsxs(h,{container:!0,gap:2,children:[u.jsx(vu,{label:"از تاریخ",id:"date",renderInput:y=>u.jsx(D,{style:{width:"160px"},...y}),value:s,onChange:y=>{o(Eu(y).format("YYYY-MM-DD"))}}),u.jsx(vu,{label:"تا تاریخ",id:"date",renderInput:y=>u.jsx(D,{style:{width:"160px"},...y}),value:a,onChange:y=>{F(Eu(y).format("YYYY-MM-DD"))}})]}),u.jsx(h,{children:u.jsx(su,{title:"خروجی اکسل",children:u.jsx("a",{href:`${q.defaults.baseURL}direct_purchase_excel/?date1=${s}&date2=${a}&role=${E()}&key=${R}`,rel:"noreferrer",children:u.jsx(T,{color:"success",children:u.jsx(Ou,{size:32})})})})})]})})}),u.jsx(h,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(bu,{noPagination:!0,isDashboard:!0,columns:["تعداد بارها","تعداد درخواست دولتی","تعداد درخواست آزاد","تعداد بارهای دولتی","تعداد بارهای آزاد","تعداد درخواست (قطعه)","میانگین وزنی","وزن کل (کیلوگرم)","میانگین قیمت فروش مرغدار"],data:[[(ou=C==null?void 0:C.lenKillRequest)==null?void 0:ou.toLocaleString(),(W=C==null?void 0:C.freeDirectBuyingFalseQuantity)==null?void 0:W.toLocaleString(),(uu=C==null?void 0:C.freeDirectBuyingTrueQuantity)==null?void 0:uu.toLocaleString(),(_=C==null?void 0:C.lenKillRequestHasntFreeDirectBuying)==null?void 0:_.toLocaleString(),(A=C==null?void 0:C.lenKillRequestHasFreeDirectBuying)==null?void 0:A.toLocaleString(),(Cu=C==null?void 0:C.quantity)==null?void 0:Cu.toLocaleString(),(X=C==null?void 0:C.indexWight)==null?void 0:X.toFixed(1),(l=Math.round((C==null?void 0:C.quantity)*(C==null?void 0:C.indexWight)))==null?void 0:l.toLocaleString(),(b=Math.round(C==null?void 0:C.amount))==null?void 0:b.toLocaleString()]],title:"خلاصه اطلاعات"})}),u.jsx(bu,{data:P,columns:["ردیف","تاریخ ثبت درخواست","تاریخ کشتار","خریدار","نوع خرید","محل کشتار","مرغدار (تلفن)","سن","نژاد","تعداد درخواست (قطعه)","میانگین وزنی (کیلوگرم)","وزن کل (کیلوگرم)","قیمت فروش مرغدار (ریال)","کداحراز","حداکثر مهلت تسویه","وضعیت","تایید کننده","توافق نامه","عملیات"],handlePageChange:cu,totalRows:Y,page:i,perPage:z,handlePerRowsChange:M,title:"خرید مستقیم"})]})]})})},_0=({item:r,updateTable:s})=>{const[o]=d.useContext(tu),a=nu(),F=Pu({initialValues:{textFieldValue:""},validationSchema:Tu({textFieldValue:fu().required("این فیلد الزامی است")}),onSubmit:g=>{a(Qu({role:E(),kill_request_key:r.key,input_direct_buying_code:g.textFieldValue})).then(f=>{var C,S;(C=f==null?void 0:f.payload)!=null&&C.error?o({vertical:"top",horizontal:"center",msg:(S=f==null?void 0:f.payload)==null?void 0:S.error,severity:"error"}):(s(),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),a(_u()))})}});return u.jsx("form",{onSubmit:F.handleSubmit,children:u.jsxs(h,{container:!0,gap:L.TINY,children:[u.jsx(D,{fullWidth:!0,id:"textFieldValue",name:"textFieldValue",label:"کداحراز",variant:"outlined",onChange:F.handleChange,onBlur:F.handleBlur,value:F.values.textFieldValue,error:F.touched.textFieldValue&&!!F.errors.textFieldValue,helperText:F.touched.textFieldValue&&F.errors.textFieldValue}),u.jsx(T,{fullWidth:!0,type:"submit",variant:"contained",color:"primary",children:"ثبت"})]})})};export{_0 as E,j0 as P,u0 as S,E0 as a,Q6 as b,U6 as c,Qu as s}; diff --git a/build/assets/Factor-CqUlgaYq.js b/build/assets/Factor-CqUlgaYq.js new file mode 100644 index 0000000..14c18e1 --- /dev/null +++ b/build/assets/Factor-CqUlgaYq.js @@ -0,0 +1 @@ +import{j as a,aO as p6,aP as g6,aQ as f6,aR as j6,aS as A6,aT as v6,T as r,bl as D6,bm as y6,cn as B6,B as f,ak as eu,p as S,i as I6,I as B}from"./mui-vendor-CkIVaoQP.js";import{r as b,b as E6}from"./react-vendor-CmFgShSM.js";import{L as X,j as F6,h as Z,A as S6,a0 as k6,u as tu,c as lu,M as E,b as nu,G as n,S as l,p as T6,m as L6,N as ou,hZ as m6,r as P6,h_ as R6,C as N6,X as I,O as z,_ as w6}from"./index-CeyyVc1v.js";import{a as b6,u as cu,f as _6}from"./redux-vendor-B7uoacJt.js";import{N as ru}from"./NumberFormatCustom-DwWPj40N.js";import{S as iu}from"./SimpleTable-DBAoNnCU.js";import{A as M6}from"./index-9Ymn_7Kv.js";import{I as O6,f as U6}from"./toBase64-BzgTOHsW.js";import{u as q6}from"./useRequestFile-FPqBpZfN.js";const x6=b6("PROVINCE_CHECK_REQUEST",async(u,{dispatch:c})=>{c(X());try{const{data:d,status:g}=await F6.post("province_check_info/",u);return c(Z()),{data:d,status:g}}catch(d){return c(Z()),{error:d.response.data.result}}}),W6=({item:u})=>{var k,T,L,P,R,N,w,_,M,O,U,q,W,K,H,V,G;const[c,,d,,g]=b.useContext(S6),h=cu();b.useEffect(()=>{h(k6()),C.validateForm(),e.validateForm()},[]);const{avicultureChickenPrice:s}=_6(y=>y.avicultureSlice),i=s==null?void 0:s.liveChickenPrice;parseFloat((u.barInfo.killHouseNetWeight/u.barInfo.realQuantity).toFixed(2));const C=tu({initialValues:{rejectText:""},validationSchema:lu({rejectText:E().required("این فیلد اجباری است!").typeError("لطفا دلیل خود را بیان کنید.")})}),[m,D]=b.useState(!1),p=y=>{D(y),m||(e.setFieldValue("reason",""),e.setFieldValue("amount",""))},e=tu({initialValues:{fee:"",paymentType:"together",wage:0,amount:"",reason:""},validationSchema:lu({fee:nu().required("این فیلد اجباری است!"),amount:nu(),paymentType:E().required("این فیلد اجباری است!"),reason:m?E().required("این فیلد اجباری است!"):E(),wage:nu().required("این فیلد اجباری است!")})});let x=(e.values.fee+e.values.wage)*u.killHouseNetWeight;m==="plus"?x+=Number(e.values.amount):m==="decrease"&&(x-=Number(e.values.amount));let j=x-u.killRequestPaymentRemainAmount;u.smsPayment&&(j+=5e4);const[uu,Q]=b.useState(!1),au=!e.isValid,[A,$]=E6.useState("union"),J=(y,Y)=>{Y&&$(Y)};return a.jsxs(p6,{sx:{alignSelf:"flex-start",width:"100%"},children:[a.jsxs(g6,{children:[a.jsx(f6,{color:"secondary"}),a.jsx(j6,{})]}),a.jsx(n,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:a.jsxs(a.Fragment,{children:[a.jsxs(n,{container:!0,justifyContent:"space-between",children:[a.jsxs(n,{container:!0,children:[a.jsx(n,{children:a.jsx(A6,{variant:"body1",fontWeight:"bold",color:"secondary",children:"انجام عملیات"})}),a.jsx(n,{children:a.jsx(v6,{color:"textSecondary",children:a.jsx(r,{variant:"body2",children:"درخواست را بررسی و سپس تایید یا رد کنید."})})})]}),a.jsx(n,{container:!0,gap:l.SMALL,mb:l.TINY,justifyContent:"space-between",children:a.jsxs(n,{container:!0,mt:l.TINY,gap:l.TINY,alignItems:"center",children:[a.jsx(r,{color:y=>y.palette.grey.A700,variant:"caption",children:"موجودی کیف پول کشتارگاه:"}),a.jsx(r,{variant:"button",color:"primary",children:`${(k=u.killHouseWalletAmount)==null?void 0:k.toLocaleString()} ﷼`})]})})]}),a.jsx(n,{container:!0,width:"100%",children:a.jsxs(n,{container:!0,alignItems:"start",direction:"row-reverse",justifyContent:"start",children:[a.jsxs(n,{container:!0,gap:l.TINY,mt:l.TINY,alignItems:"center",ml:l.LARGE,children:[a.jsx(r,{variant:"caption",color:"error",children:"صدور فاکتور بنام:"}),a.jsxs(D6,{color:"primary",value:A,orientation:"vertical",exclusive:!0,onChange:J,"aria-label":"Platform",children:[a.jsx(y6,{value:"union",children:"اتحادیه"}),a.jsx(y6,{value:"poultry",children:"مرغدار"})]}),a.jsxs(n,{ml:l.MEDIUM,children:[A==="union"&&a.jsxs(n,{container:!0,alignItems:"center",gap:l.SMALL,children:[a.jsx(n,{children:a.jsx(r,{children:"اطلاعات حساب اتحادیه"})}),a.jsxs(n,{style:{border:"1px solid #ccc",padding:"10px",borderRadius:"4px"},children:[a.jsxs(r,{children:["شماره کارت: ",(T=u==null?void 0:u.provinceBank)==null?void 0:T.card]}),a.jsxs(r,{children:["شماره شبا: ",(L=u==null?void 0:u.provinceBank)==null?void 0:L.shaba]}),a.jsxs(r,{children:["شماره حساب: ",(P=u==null?void 0:u.provinceBank)==null?void 0:P.account]}),a.jsxs(r,{children:["بانک ",(R=u==null?void 0:u.provinceBank)==null?void 0:R.bankName," - بنام"," ",(N=u.provinceBank)==null?void 0:N.nameOfBankUser]})]})]}),A==="poultry"&&a.jsxs(n,{container:!0,alignItems:"center",gap:l.SMALL,children:[a.jsx(n,{children:a.jsx(r,{children:"اطلاعات حساب مرغدار"})}),a.jsxs(n,{style:{border:"1px solid #ccc",padding:"10px",borderRadius:"4px"},children:[a.jsxs(r,{children:["شماره کارت:"," ",(w=u==null?void 0:u.poultryBank)!=null&&w.card?(_=u==null?void 0:u.poultryBank)==null?void 0:_.card:"ندارد"]}),a.jsxs(r,{children:["شماره شبا:"," ",(M=u==null?void 0:u.poultryBank)!=null&&M.shaba?(O=u==null?void 0:u.poultryBank)==null?void 0:O.shaba:"ندارد"]}),a.jsxs(r,{children:["شماره حساب:"," ",(U=u==null?void 0:u.poultryBank)!=null&&U.account?(q=u==null?void 0:u.poultryBank)==null?void 0:q.account:"ندارد"]}),a.jsxs(r,{children:["بانک"," ",(W=u==null?void 0:u.poultryBank)!=null&&W.bankName?(K=u==null?void 0:u.poultryBank)==null?void 0:K.bankName:"نامشخص"," ","- بنام"," ",(H=u.poultryBank)!=null&&H.nameOfBankUser?(V=u.poultryBank)==null?void 0:V.nameOfBankUser:"نامشخص"]})]})]})]})]}),a.jsxs(n,{container:!0,direction:"column",gap:l.SMALL,mt:l.TINY,alignItems:"start",children:[a.jsxs(n,{container:!0,gap:l.SMALL,children:[a.jsx(n,{children:a.jsx(ru,{allowLeadingZeros:!0,thousandSeparator:",",id:"fee",label:"قیمت (﷼)",variant:"outlined",error:e.touched.fee?!!e.errors.fee:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.fee&&e.errors.fee?e.errors.fee:null})}),a.jsx(n,{children:a.jsx(ru,{allowLeadingZeros:!0,thousandSeparator:",",id:"wage",label:"تعرفه استان (﷼)",variant:"outlined",value:e.values.wage,error:e.touched.wage?!!e.errors.wage:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.wage&&e.errors.wage?e.errors.wage:null})})]}),a.jsx(n,{children:a.jsxs(n,{container:!0,gap:l.SMALL,children:[a.jsxs(n,{container:!0,direction:"column",gap:l.SMALL,alignItems:"start",children:[a.jsx(r,{children:"اضافه یا کسر از فاکتور"}),a.jsxs(B6,{color:"primary","aria-label":"outlined primary button group",children:[a.jsx(f,{onClick:()=>p("plus"),variant:m==="plus"?"contained":"outlined",color:"primary",children:"+"}),a.jsx(f,{onClick:()=>p("decrease"),variant:m==="decrease"?"contained":"outlined",color:"primary",children:"-"}),a.jsx(f,{onClick:()=>p(!1),color:"error",children:"حذف"})]})]}),a.jsx(n,{children:!!m&&a.jsxs(n,{container:!0,gap:l.SMALL,children:[a.jsx(n,{children:a.jsx(eu,{id:"amount",label:"مبلغ اضافه/کسر از فاکتور",variant:"outlined",error:e.touched.amount?!!e.errors.amount:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.amount&&e.errors.amount?e.errors.amount:null})}),a.jsx(n,{children:a.jsx(eu,{id:"reason",label:"شرح موضوع",variant:"outlined",error:e.touched.reason?!!e.errors.reason:null,multiline:!0,rows:2,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.reason&&e.errors.reason?e.errors.reason:null})})]})})]})})]}),a.jsxs(n,{width:"100%",children:[a.jsxs(n,{container:!0,gap:l.TINY,my:l.TINY,children:[a.jsxs(n,{container:!0,gap:l.TINY,alignItems:"center",children:[a.jsx(r,{color:"green",variant:"caption",children:"قیمت مرغ:"}),a.jsxs(r,{variant:"button",children:[i==null?void 0:i.toLocaleString()," ﷼"]})]}),a.jsxs(n,{container:!0,gap:l.TINY,alignItems:"center",children:[a.jsx(r,{variant:"caption",color:"green",children:"آخرین تاریخ قیمت گذاری:"}),a.jsx(r,{variant:"button",children:(s==null?void 0:s.createDate)&&T6(s==null?void 0:s.createDate)})]})]}),a.jsx(iu,{columns:["قیمت کل","هزینه پیامک اطلاع رسانی","مبلغ خالص بار","مبلغ کل فاکتور","سهم مرغدار","سهم استان","مانده واریزی اولیه","مبلغ فاکتور نهایی"],data:[[(e.values.fee+e.values.wage).toLocaleString()+" ﷼",u.smsPayment?"دارد : 50,000 ﷼":"ندارد",((e.values.fee+e.values.wage)*u.killHouseNetWeight).toLocaleString()+" ﷼",(x==null?void 0:x.toLocaleString())+" ﷼",(e.values.fee*u.killHouseNetWeight).toLocaleString()+" ﷼",(e.values.wage*u.killHouseNetWeight).toLocaleString()+" ﷼",((G=u.killRequestPaymentRemainAmount)==null?void 0:G.toLocaleString())+" ﷼",j<0?0:(j==null?void 0:j.toLocaleString())+" ﷼"]]})]}),a.jsx(n,{xs:12,children:a.jsx(n,{container:!0,gap:l.SMALL,padding:l.SMALL,children:a.jsx(M6,{children:uu?a.jsx(L6.div,{animate:{x:-10,opacity:1},transition:{duration:.3},initial:{opacity:0},exit:{opacity:0},children:a.jsxs(n,{flexDirection:"column",container:!0,gap:l.SMALL,children:[a.jsx(n,{children:a.jsx(eu,{multiline:!0,rows:4,fullWidth:!0,id:"rejectText",label:"پیام خود را وارد کنید",variant:"outlined",value:C.values.rejectText,error:C.touched.rejectText?!!C.errors.rejectText:null,onChange:C.handleChange,onBlur:C.handleBlur,helperText:C.touched.rejectText&&C.errors.rejectText?C.errors.rejectText:null})}),a.jsxs(n,{container:!0,gap:l.SMALL,children:[a.jsx(n,{children:a.jsx(f,{variant:"outlined",color:"secondary",onClick:()=>{Q(!1)},children:"لغو"})}),a.jsx(n,{children:a.jsx(f,{variant:"outlined",onClick:()=>{h(X()),h(x6({message:C.values.rejectText,kill_house_info_key:u.barInfo.killHouseAssignmentKey,state:"rejected"})).then(y=>{y.error?c({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(h(ou({right:!1,bottom:!1,content:null})),h(m6({selectedDate1:d,selectedDate2:g})),c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})),h(Z())})},children:"رد درخواست"})})]})]})}):a.jsxs(n,{container:!0,gap:l.SMALL,children:[a.jsx(f,{variant:"outlined",color:"secondary",onClick:()=>{Q(!0)},children:"رد درخواست"}),a.jsx(f,{disabled:au,variant:"outlined",onClick:()=>{if(x<0){e.setFieldError("amount","مبلغ کسر نمی تواند بزرگتر از مبلغ کل فاکتور باشد!");return}h(X()),h(x6({kill_house_info_key:u.barInfo.killHouseAssignmentKey,pay:e.values.paymentType,fee:e.values.fee,real_weight:u.barInfo.killHouseNetWeight/u.quantity,province_input_wage:e.values.wage,province_input_amount:e.values.amount?e.values.amount:null,province_input_amount_state:m,state:"accepted",reason:e.values.reason,bank:A})).then(y=>{y.payload.error?c({vertical:"top",horizontal:"center",msg:y.payload.error,severity:"error"}):(h(m6({selectedDate1:d,selectedDate2:g})),h(ou({right:!1,bottom:!1,top:!1,content:null})),c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})),h(Z())})},children:"صدور فاکتور"})]})})})})]})})]})})]})};W6.propTypes={item:S.PropTypes.object,file:S.PropTypes.object};var su={},K6=I6;Object.defineProperty(su,"__esModule",{value:!0});var v=su.default=void 0,H6=K6(P6()),V6=a;v=su.default=(0,H6.default)((0,V6.jsx)("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 14h-3v3h-2v-3H8v-2h3v-3h2v3h3zm-3-7V3.5L18.5 9z"}),"NoteAdd");const G6=b6("DEPOSITE_ALLOCATION",async u=>{const{data:c,status:d}=await F6.put("deposit_allocation/0/",u);return{data:c,status:d}}),F=({share:u,allocationKey:c,paymentPrice:d,fileId:g})=>{const[h]=b.useContext(S6),s=cu(),i=tu({initialValues:{factorImg:"",payment:d},validationSchema:lu({factorImg:E().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),payment:E().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!")})}),[C,m]=b.useState([]),D=(p,e)=>{var x;p[0]?i.setFieldValue("factorImg",U6((x=p[0])==null?void 0:x.data_url)):i.setFieldValue("factorImg",""),m(p)};return b.useEffect(()=>{i.validateForm()},[]),a.jsxs(n,{container:!0,gap:l.SMALL,justifyContent:"center",children:[a.jsx(ru,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,label:"مبلغ پرداختی",name:"payment",id:"payment",variant:"outlined",InputProps:{readOnly:!0},value:i.values.payment,error:i.touched.payment?!!i.errors.payment:null,onChange:i.handleChange,onBlur:i.handleBlur,helperText:i.touched.payment&&i.errors.payment?i.errors.payment:null}),a.jsx(n,{children:a.jsx(O6,{onChange:D,images:C,maxNumber:1,title:"بارگذاری سند"})}),a.jsx(f,{fullWidth:!0,variant:"contained",disabled:!i.isValid,onClick:()=>{s(X()),s(G6({key:c,type:u,image:i.values.factorImg,payment:i.values.payment})).then(p=>{p.error?h({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(s(R6()),s(N6()),s(Z()),h({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت"})]})};F.propTypes={share:S.PropTypes.string,allocationKey:S.PropTypes.string,paymentPrice:S.PropTypes.any,fileId:S.PropTypes.any};const Y6=({process:u,id:c})=>{var A,$,J,k,T,L,P,R,N,w,_,M,O,U,q,W,K,H,V,G,y,Y,du,hu,Cu,yu,mu,xu,pu,gu,fu,ju,Au,vu,Fu,Su,bu,Du,Bu,Iu,Eu,ku,Tu,Lu,Pu,Ru,Nu,wu,_u,Mu,Ou,Uu,qu,Wu,Ku,Hu,Vu,Gu,Yu,zu,Zu,Qu,$u,Ju,Xu,u6,a6,e6,n6,t6,l6,o6,r6,i6,c6,s6,d6,h6,C6;const d=cu(),g=q6(c);u=u||((A=g==null?void 0:g.file)==null?void 0:A.process);let h,s,i,C,m,D;const p=I()==="ProvinceFinancial"&&!((J=($=u.allocation)==null?void 0:$.provincePaymentDocuments)!=null&&J.length)&&!!((k=u.allocation)!=null&&k.provinceShareRemaining),e=I()==="ProvinceFinancial"&&!((L=(T=u.allocation)==null?void 0:T.fanavaPaymentDocuments)!=null&&L.length)&&!!((P=u.allocation)!=null&&P.fanavaShareRemaining),x=I()==="ProvinceFinancial"&&!((N=(R=u.allocation)==null?void 0:R.cityPaymentDocuments)!=null&&N.length)&&!!((w=u.allocation)!=null&&w.cityShareRemaining),j=I()==="ProvinceFinancial"&&!((M=(_=u.allocation)==null?void 0:_.companyPaymentDocuments)!=null&&M.length)&&!!((O=u.allocation)!=null&&O.companyShareRemaining),uu=I()==="ProvinceFinancial"&&!((q=(U=u.allocation)==null?void 0:U.centralUnionPaymentDocuments)!=null&&q.length)&&!!((W=u.allocation)!=null&&W.centralUnionShareRemaining),Q=I()==="ProvinceFinancial"&&!((H=(K=u.allocation)==null?void 0:K.poultryPaymentDocuments)!=null&&H.length)&&!!((V=u.allocation)!=null&&V.poultryRemaining);(G=u.allocation)!=null&&G.provinceShareDigit&&(h=["سهم اتحادیه",(y=u.allocation)==null?void 0:y.provinceCardNumber,(Y=u.allocation)==null?void 0:Y.provinceShaba,(du=u.allocation)==null?void 0:du.provinceBankInfo,((hu=u.allocation)==null?void 0:hu.provinceShareDigit)+" ریال",((Cu=u.allocation)==null?void 0:Cu.provinceSharePayment)+" ریال",((yu=u.allocation)==null?void 0:yu.provinceShareRemaining)+" ریال",(xu=(mu=u.allocation)==null?void 0:mu.provincePaymentDocuments)==null?void 0:xu.map((t,o)=>a.jsx("a",{href:t.image,children:a.jsx("img",{alt:"document",width:"40",height:"40",src:t.image,style:{borderRadius:"5px"}})},"document"+o)),a.jsx(B,{color:"primary",component:"label",disabled:!p,onClick:()=>{var t,o;d(z({title:"ثبت سند مالی",content:a.jsx(F,{fileId:c,allocationKey:(t=u.allocation)==null?void 0:t.allocationKey,paymentPrice:(o=u.allocation)==null?void 0:o.provinceShareRemaining,share:"ProvinceOperator"})}))},children:a.jsx(v,{})},"fff")]),(pu=u.allocation)!=null&&pu.fanavaShareDigit&&(i=["سهم فن آوا",(gu=u.allocation)==null?void 0:gu.fanavaCardNumber,(fu=u.allocation)==null?void 0:fu.fanavaShaba,(ju=u.allocation)==null?void 0:ju.fanavaBankInfo,((Au=u.allocation)==null?void 0:Au.fanavaShareDigit)+" ریال",((vu=u.allocation)==null?void 0:vu.fanavaSharePayment)+" ریال",((Fu=u.allocation)==null?void 0:Fu.fanavaShareRemaining)+" ریال",(bu=(Su=u.allocation)==null?void 0:Su.fanavaPaymentDocuments)==null?void 0:bu.map((t,o)=>a.jsx("a",{href:t.image,children:a.jsx("img",{alt:"document",width:"40",height:"40",src:t.image,style:{borderRadius:"5px"}})},"fanavaPaymentDocuments"+o)),a.jsx(B,{color:"primary",component:"label",disabled:!e,onClick:()=>{var t,o;d(ou({right:!0,title:"ثبت سند مالی",content:a.jsx(F,{share:"fanava",fileId:c,paymentPrice:(t=u.allocation)==null?void 0:t.fanavaShareRemaining,allocationKey:(o=u.allocation)==null?void 0:o.allocationKey})}))},children:a.jsx(v,{})},"fff")]),(Du=u.allocation)!=null&&Du.cityShareDigit&&(s=["سهم شهرستان",(Bu=u.allocation)==null?void 0:Bu.cityCardNumber,(Iu=u.allocation)==null?void 0:Iu.cityShaba,(Eu=u.allocation)==null?void 0:Eu.cityBankInfo,((ku=u.allocation)==null?void 0:ku.cityShareDigit)+" ریال",((Tu=u.allocation)==null?void 0:Tu.citySharePayment)+" ریال",((Lu=u.allocation)==null?void 0:Lu.cityShareRemaining)+" ریال",(Ru=(Pu=u.allocation)==null?void 0:Pu.cityPaymentDocuments)==null?void 0:Ru.map((t,o)=>a.jsx("a",{href:t.image,children:a.jsx("img",{alt:"document",width:"40",height:"40",src:t.image,style:{borderRadius:"5px"}})},"cityPaymentDocuments"+o)),a.jsx(B,{color:"primary",component:"label",disabled:!x,onClick:()=>{var t,o;d(z({title:"ثبت سند مالی",content:a.jsx(F,{share:"CityOperator",fileId:c,paymentPrice:(t=u.allocation)==null?void 0:t.cityShareRemaining,allocationKey:(o=u.allocation)==null?void 0:o.allocationKey})}))},children:a.jsx(v,{})},"fff")]),(Nu=u.allocation)!=null&&Nu.companyShareDigit&&(C=["سهم شرکت",(wu=u.allocation)==null?void 0:wu.companyCardNumber,(_u=u.allocation)==null?void 0:_u.companyShaba,(Mu=u.allocation)==null?void 0:Mu.companyBankInfo,((Ou=u.allocation)==null?void 0:Ou.companyShareDigit)+" ریال",((Uu=u.allocation)==null?void 0:Uu.companySharePayment)+" ریال",((qu=u.allocation)==null?void 0:qu.companyShareRemaining)+" ریال",(Ku=(Wu=u.allocation)==null?void 0:Wu.companyPaymentDocuments)==null?void 0:Ku.map((t,o)=>a.jsx("a",{href:t.image,children:a.jsx("img",{alt:"document",width:"40",height:"40",src:t.image,style:{borderRadius:"5px"}})},"companyPaymentDocuments"+o)),a.jsx(B,{color:"primary",component:"label",disabled:!j,onClick:()=>{var t,o;d(z({right:!0,title:"ثبت سند مالی",content:a.jsx(F,{share:"company",fileId:c,paymentPrice:(t=u.allocation)==null?void 0:t.companyShareRemaining,allocationKey:(o=u.allocation)==null?void 0:o.allocationKey})}))},children:a.jsx(v,{})},"fff")]),(Hu=u.allocation)!=null&&Hu.centralUnionShareDigit&&(m=["سهم اتحادیه مرکزی",(Vu=u.allocation)==null?void 0:Vu.centralUnionCardNumber,(Gu=u.allocation)==null?void 0:Gu.centralUnionShaba,(Yu=u.allocation)==null?void 0:Yu.centralUnionBankInfo,((zu=u.allocation)==null?void 0:zu.centralUnionShareDigit)+" ریال",((Zu=u.allocation)==null?void 0:Zu.centralUnionSharePayment)+" ریال",((Qu=u.allocation)==null?void 0:Qu.centralUnionShareRemaining)+" ریال",(Ju=($u=u.allocation)==null?void 0:$u.centralUnionPaymentDocuments)==null?void 0:Ju.map((t,o)=>a.jsx("a",{href:t.image,children:a.jsx("img",{alt:"document",width:"40",height:"40",src:t.image,style:{borderRadius:"5px"}})},"centralUnionPaymentDocuments"+o)),a.jsx(B,{color:"primary",component:"label",disabled:!uu,onClick:()=>{var t,o;d(z({title:"ثبت سند مالی",content:a.jsx(F,{share:"central",fileId:c,paymentPrice:(t=u.allocation)==null?void 0:t.centralUnionShareRemaining,allocationKey:(o=u.allocation)==null?void 0:o.allocationKey})}))},children:a.jsx(v,{})},"fff")]),(Xu=u.allocation)!=null&&Xu.poultryShareDigit&&(D=["سهم مرغدار",(u6=u.allocation)==null?void 0:u6.poultryCardNumber,(a6=u.allocation)==null?void 0:a6.poultryShaba,(e6=u.allocation)==null?void 0:e6.poultryBankInfo,((n6=u.allocation)==null?void 0:n6.poultryShareDigit)+" ریال",((t6=u.allocation)==null?void 0:t6.poultrySharePayment)+" ریال",((l6=u.allocation)==null?void 0:l6.poultryRemaining)+" ریال",(r6=(o6=u.allocation)==null?void 0:o6.poultryPaymentDocuments)==null?void 0:r6.map((t,o)=>a.jsx("a",{href:t.image,children:a.jsx("img",{alt:"document",width:"40",height:"40",src:t.image,style:{borderRadius:"5px"}})},"poultryPaymentDocuments"+o)),a.jsx(B,{color:"primary",component:"label",disabled:!Q,onClick:()=>{var t,o;d(z({title:"ثبت سند مالی",content:a.jsx(F,{share:"Poultry",fileId:c,paymentPrice:(t=u.allocation)==null?void 0:t.poultryRemaining,allocationKey:(o=u.allocation)==null?void 0:o.allocationKey})}))},children:a.jsx(v,{})},"fff")]);const au=[h,s,i,C,m,D].filter(t=>!!t);return a.jsx(a.Fragment,{children:a.jsxs(p6,{sx:{alignSelf:"flex-start",width:"100%"},children:[a.jsxs(g6,{children:[a.jsx(f6,{}),a.jsx(j6,{})]}),a.jsxs(n,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[a.jsxs(n,{container:!0,alignItems:"flex-start",children:[a.jsx(n,{children:a.jsx(A6,{children:a.jsx(r,{variant:"body1",fontWeight:"bold",children:"فاکتور نهایی"})})}),a.jsx(n,{children:a.jsx(v6,{color:"textSecondary",children:a.jsxs(n,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",gap:l.SMALL,children:[a.jsx(r,{variant:"body2",display:"flex",gap:l.SMALL,children:"ﺷﻤﺎﺭﻩ ﻓﺎﮐﺘﻮﺭ:"}),a.jsx(r,{variant:"body2",fontWeight:"bold",children:(i6=u==null?void 0:u.poultry)==null?void 0:i6.poultryOrderCode}),a.jsx(r,{variant:"body2",display:"flex",gap:l.SMALL,children:"تاریخ:"}),a.jsx(r,{variant:"body2",fontWeight:"bold",children:w6((c6=u==null?void 0:u.poultry)==null?void 0:c6.poultrySendDate)})]})})})]}),a.jsx(n,{container:!0,mt:l.SMALL,spacing:l.TINY,children:a.jsx(n,{width:"100%",children:a.jsxs(n,{children:[a.jsx(iu,{columns:["اطلاعات مالی","شماره کارت","شبا","صاحب حساب","جمع کل","جمع پرداختی","مانده","اسناد","ثبت"],data:au}),((s6=u.allocation)==null?void 0:s6.totalMoney)&&a.jsx(iu,{columns:["مبلغ کل به عدد","مبلغ کل به حروف"],data:[[((h6=(d6=u.allocation)==null?void 0:d6.totalMoney)==null?void 0:h6.toLocaleString())+" ریال",(C6=u.allocation)==null?void 0:C6.totalMoneyChar]]})]})})})]})]})})};Y6.propTypes={process:S.PropTypes.any};export{W6 as F,Y6 as a}; diff --git a/build/assets/FileDownload-Br429XFy.js b/build/assets/FileDownload-Br429XFy.js new file mode 100644 index 0000000..395a5f1 --- /dev/null +++ b/build/assets/FileDownload-Br429XFy.js @@ -0,0 +1 @@ +import{i as r,j as a}from"./mui-vendor-CkIVaoQP.js";import{r as t}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var i=e.default=void 0,u=o(t()),l=a;i=e.default=(0,u.default)((0,l.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"FileDownload");export{i as d}; diff --git a/build/assets/FileInformation-BQPmtbts.js b/build/assets/FileInformation-BQPmtbts.js new file mode 100644 index 0000000..310ab13 --- /dev/null +++ b/build/assets/FileInformation-BQPmtbts.js @@ -0,0 +1 @@ +import{j as a,p as n}from"./mui-vendor-CkIVaoQP.js";import"./react-vendor-CmFgShSM.js";import{S as d}from"./SimpleTable-DBAoNnCU.js";import{Q as y}from"./index-CeyyVc1v.js";const A=({file:u})=>{var t,r,o,p;const e=(r=(t=u.poultry)==null?void 0:t.sellType)!=null&&r.cash?"نقدی":null,l=(p=(o=u.poultry)==null?void 0:o.sellType)!=null&&p.credit?"زمان دار":null,s=[e,l].filter(C=>C).join(" یا ");return a.jsx(d,{columns:["کدسفارش","نام مرغدار","تلفن","تاریخ درخواست کشتار","استان","شهرستان","تاریخ جوجه ریزی","تعداد","جمع تلفات","وزن تقریبی هر مرغ","سن مرغ","نژاد","نحوه فروش"],data:[[u.poultry.poultryOrderCode,u.poultry.poultryName,u.poultry.poultryMobile,y(new Date(u.poultry.poultrySendDate),"yyyy/MM/dd"),u.poultry.poultryProvince,u.poultry.poultryCity,y(new Date(u.poultryHatching.date),"yyyy/MM/dd"),u.poultry.poultryQuantity,u.poultryHatching.losses,u.poultry.poultryIndexWeight,u.poultry.age,u.poultry.poultryChickenBreed,s]]})};A.propTypes={file:n.PropTypes.any};export{A as F}; diff --git a/build/assets/FileUploader-DT5gIVb3.js b/build/assets/FileUploader-DT5gIVb3.js new file mode 100644 index 0000000..fbf5deb --- /dev/null +++ b/build/assets/FileUploader-DT5gIVb3.js @@ -0,0 +1 @@ +import{j as e,b as n,B as y,s as c,bt as j,T as C,ar as b,I as z}from"./mui-vendor-CkIVaoQP.js";import{r}from"./react-vendor-CmFgShSM.js";import{d as S}from"./CloudUpload-BlIgB_r9.js";import{d as w}from"./Close-_jAEIgMD.js";import{d as F}from"./CheckCircle-zgBvZQ-b.js";import{A as I,m as x}from"./index-CeyyVc1v.js";import{A}from"./index-9Ymn_7Kv.js";const B=c("input")({clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:1,overflow:"hidden",position:"absolute",bottom:0,left:0,whiteSpace:"nowrap",width:1}),R=c(x.div)(({theme:s})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:s.spacing(.5),margin:s.spacing(.25,0),borderRadius:s.shape.borderRadius,"&:hover":{backgroundColor:s.palette.action.hover}})),$=({onChange:s})=>{const[o,l]=r.useState([]),[f,u]=r.useState(!1),[h,d]=r.useState(0),[m]=r.useContext(I),g=t=>{const i=t.target.files[0];if(!i)return;if(i.size>5e6){m({vertical:"top",horizontal:"center",msg:"حجم فایل بیش از حد مجاز است!",severity:"error"});return}u(!0),d(0);const p=setInterval(()=>{d(a=>a>=100?(clearInterval(p),u(!1),100):a+10)},100);l(a=>[...a,i])},v=t=>{l(i=>i.filter((p,a)=>a!==t))};return r.useEffect(()=>{s&&s(o)},[o,s]),e.jsxs(n,{sx:{width:"100%"},children:[e.jsxs(y,{disabled:o.length>=4,component:"label",variant:"contained",color:"primary",size:"small",startIcon:e.jsx(S,{fontSize:"small"}),sx:{borderRadius:"12px",padding:"4px 12px",fontSize:"0.8125rem",minWidth:"auto","&:hover":{transform:"none"}},children:[o.length>=4?"حداکثر 4 فایل":"آپلود فایل",e.jsx(B,{type:"file",onChange:g})]}),e.jsx(A,{children:!!o.length&&e.jsx(x.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2},style:{marginTop:8},children:e.jsxs(n,{sx:{maxHeight:150,overflowY:"auto",pr:1},children:[f&&e.jsx(j,{variant:"determinate",value:h,color:"secondary",sx:{height:4,borderRadius:2,mb:.5}}),o.map((t,i)=>e.jsxs(R,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[e.jsxs(n,{sx:{display:"flex",alignItems:"center",gap:1,overflow:"hidden"},children:[e.jsx(F,{color:"success",fontSize:"small",sx:{fontSize:"16px"}}),e.jsx(C,{variant:"body2",sx:{fontSize:"0.8125rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:120},children:t.name}),e.jsx(b,{label:`${(t.size/1e6).toFixed(2)}MB`,size:"small",sx:{height:20,fontSize:"0.6875rem"}})]}),e.jsx(z,{color:"error",onClick:()=>v(i),size:"small",sx:{p:.5},children:e.jsx(w,{fontSize:"small",sx:{fontSize:"16px"}})})]},t==null?void 0:t.name))]})})})]})};export{$ as F}; diff --git a/build/assets/FilesState-B1ZVhsGy.css b/build/assets/FilesState-B1ZVhsGy.css new file mode 100644 index 0000000..c2de3ac --- /dev/null +++ b/build/assets/FilesState-B1ZVhsGy.css @@ -0,0 +1 @@ +.cell:hover{color:#fff!important} diff --git a/build/assets/FilesState-DMM_jfCL.js b/build/assets/FilesState-DMM_jfCL.js new file mode 100644 index 0000000..7afcf5d --- /dev/null +++ b/build/assets/FilesState-DMM_jfCL.js @@ -0,0 +1 @@ +import{j as u,ak as ju,aZ as Ke,a$ as Oe,aV as Ee,aW as eu,T as p,p as Pe,B as c6,d as Au,I as $e,aL as Me,aM as Qe,aN as Ge,bl as Ye,bm as n6,b as ze}from"./mui-vendor-CkIVaoQP.js";import{a9 as ke,dT as Ue,G as y,W as yu,L as a6,j as gu,X as Cu,h as s6,p as G,v as M,l as Ve,dU as Xe,A as Fu,t as Je,S as z,k as Ze,dV as De,n as Te,dW as me}from"./index-CeyyVc1v.js";import{r as P}from"./react-vendor-CmFgShSM.js";import{u as h6,f as pu,a as ul}from"./redux-vendor-B7uoacJt.js";import{B as el,P as ll}from"./ProvinceCases-0uMkWb0x.js";import{R as tl,a as o6}from"./index.esm-Bu7XMDZU.js";import"./iconBase-BEJYyZsk.js";import"./ResponsiveTable-w7hk7Uq8.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const rl=()=>{const n=h6(),{provinceGetCaseStatus:a}=pu(e=>e.provinceSlice),[s,o]=P.useState(ke(new Date).format("YYYY-MM-DD")),l=e=>{o(e)};return P.useEffect(()=>{n(Ue(s))},[s]),u.jsxs(y,{container:!0,direction:"column",alignItems:"start",width:"1300px",overflowX:"scroll",style:{overflowX:"scroll"},children:[u.jsx(y,{children:u.jsx(yu,{label:"تاریخ",id:"date",renderInput:e=>u.jsx(ju,{...e}),value:s,onChange:e=>{l(ke(e).format("YYYY-MM-DD"))}})}),u.jsx(y,{children:u.jsx(y,{children:a==null?void 0:a.map((e,C)=>{var N,f,S,F,H,b,A,g,x,w,v,R,E,k,q,W,I,B,_;let i;((N=e==null?void 0:e.cityState)==null?void 0:N.state)==="pending"&&(i="#ff7410"),((f=e==null?void 0:e.cityState)==null?void 0:f.state)==="accept"&&(i="green"),((S=e==null?void 0:e.cityState)==null?void 0:S.state)==="reject"&&(i="red");let h;return((F=e==null?void 0:e.provinceState)==null?void 0:F.state)==="pending"&&(h="#ff7410"),((H=e==null?void 0:e.provinceState)==null?void 0:H.state)==="accept"&&(h="green"),((b=e==null?void 0:e.provinceState)==null?void 0:b.state)==="reject"&&(h="red"),u.jsx(Ke,{className:"my-table",style:{borderTop:"1px solid",marginTop:"10px"},children:u.jsx(Oe,{children:u.jsxs(Ee,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[u.jsxs(eu,{component:"th",scope:"row",className:"no-border-flex-table",children:[u.jsx(y,{style:{marginBottom:"2px"},children:u.jsx(p,{variant:"button",textAlign:"center",style:{borderBottom:"1px solid gray",paddingBottom:"2px"},children:"مرغدار"})}),u.jsxs(y,{container:!0,direction:"column",children:[u.jsxs(p,{variant:"caption",children:[(A=e==null?void 0:e.poultry)==null?void 0:A.poultryName," (",(g=e==null?void 0:e.poultry)==null?void 0:g.userFullname,")"]}),u.jsxs(p,{variant:"caption",children:["تلفن: ",(x=e==null?void 0:e.poultry)==null?void 0:x.userMobile]}),u.jsxs(p,{variant:"caption",children:[(w=e==null?void 0:e.poultry)==null?void 0:w.poultryRequestQuantity.toLocaleString()," ","قطعه"]}),u.jsxs(p,{variant:"caption",color:"blue",children:["دامپزشک فارم: ",(v=e==null?void 0:e.poultry)==null?void 0:v.vetFarmName]}),u.jsxs(p,{variant:"caption",color:"blue",children:["تلفن دامپزشک: ",(R=e==null?void 0:e.poultry)==null?void 0:R.vetFarmMobile]})]})]}),u.jsxs(eu,{component:"th",scope:"row",className:"no-border-flex-table",children:[u.jsx(y,{style:{marginBottom:"2px"},children:u.jsx(p,{variant:"button",textAlign:"center",style:{borderBottom:"1px solid gray",paddingBottom:"2px"},children:"شهرستان"})}),u.jsxs(y,{container:!0,direction:"column",children:[u.jsxs(p,{variant:"caption",color:i,children:[(E=e==null?void 0:e.cityState)==null?void 0:E.operatorCity," (",(k=e==null?void 0:e.cityState)==null?void 0:k.operatorName,")"]}),u.jsxs(p,{variant:"caption",color:i,children:["تلفن: ",(q=e==null?void 0:e.cityState)==null?void 0:q.operatorMobile]})]})]}),u.jsxs(eu,{component:"th",scope:"row",className:"no-border-flex-table",children:[u.jsx(y,{style:{marginBottom:"2px"},children:u.jsx(p,{variant:"button",textAlign:"center",style:{borderBottom:"1px solid gray",paddingBottom:"2px"},children:"استان"})}),u.jsxs(y,{container:!0,direction:"column",children:[u.jsxs(p,{variant:"caption",color:h,children:[(W=e==null?void 0:e.provinceState)==null?void 0:W.provinceOperatorProvinc," (",(I=e==null?void 0:e.provinceState)==null?void 0:I.provinceOperatorName,")"]}),u.jsxs(p,{variant:"caption",color:h,children:["تلفن: ",(B=e==null?void 0:e.provinceState)==null?void 0:B.provinceOperatorMobile]})]})]}),u.jsx(eu,{component:"th",scope:"row",className:"loop-kill-request no-border-flex-table",children:(_=e==null?void 0:e.provinceKillRequests)==null?void 0:_.map((L,xu)=>{var lu,tu,ru,nu,su,cu;let Y;return(L==null?void 0:L.state)==="pending"&&(Y="#ff7410"),(L==null?void 0:L.state)==="accepted"&&(Y="green"),(L==null?void 0:L.state)==="rejected"&&(Y="red"),u.jsxs(Ee,{className:"row-kill-request",sx:{"&:last-child td, &:last-child th":{border:0}},children:[u.jsxs(eu,{component:"th",scope:"row",children:[u.jsx(y,{style:{marginBottom:"2px"},children:u.jsx(p,{variant:"button",textAlign:"center",style:{borderBottom:"1px solid gray",paddingBottom:"2px"},children:"خریدار"})}),u.jsxs(y,{container:!0,direction:"column",children:[u.jsx(p,{variant:"caption",color:Y,children:L==null?void 0:L.buyerName}),u.jsxs(p,{variant:"caption",color:Y,children:[L==null?void 0:L.quantity," قطعه"]}),u.jsxs(p,{variant:"caption",color:Y,children:["تلفن: ",L==null?void 0:L.buyerMobile]})]})]}),u.jsxs(eu,{component:"th",scope:"row",children:[u.jsx(y,{style:{marginBottom:"2px"},children:u.jsx(p,{variant:"button",textAlign:"center",style:{borderBottom:"1px solid gray",paddingBottom:"2px"},children:"راننده"})}),(lu=L==null?void 0:L.killHouseRequests)==null?void 0:lu.map((c,Q)=>{let K="";return c!=null&&c.clearanceCode?K="green":K="red",u.jsx(y,{container:!0,direction:"column",style:{whiteSpace:"nowrap"},children:u.jsxs(p,{variant:"caption",color:K,children:[c==null?void 0:c.driverName," / تعداد"," ",c==null?void 0:c.quantity.toLocaleString()," / کدبهداشتی ",c==null?void 0:c.trafficCode," / کدترخیص"," ",c!=null&&c.clearanceCode?c==null?void 0:c.clearanceCode:"در انتظار"]})},Q)})]}),u.jsxs(eu,{component:"th",scope:"row",children:[u.jsx(y,{style:{marginBottom:"2px"},children:u.jsx(p,{variant:"button",textAlign:"center",style:{borderBottom:"1px solid gray",paddingBottom:"2px"},children:"دامپزشک کشتارگاه"})}),(tu=L==null?void 0:L.killHouseRequests)==null?void 0:tu.map((c,Q)=>{let K="";return(c==null?void 0:c.vetState)==="pending"?K="#ff7410":(c==null?void 0:c.vetState)==="accepted"?K="green":K="red",u.jsx(y,{container:!0,direction:"column",style:{whiteSpace:"nowrap"},children:u.jsxs(p,{variant:"caption",color:K,children:[c!=null&&c.killHouseVetName?c==null?void 0:c.killHouseVetName:"ندارد"," ","/"," ",c!=null&&c.killHouseVetMobile?c.killHouseVetMobile:"ندارد"]})},Q)})]}),u.jsxs(eu,{component:"th",scope:"row",children:[u.jsx(y,{style:{marginBottom:"2px"},children:u.jsx(p,{variant:"button",textAlign:"center",style:{borderBottom:"1px solid gray",paddingBottom:"2px"},children:"اطلاعات بار"})}),(nu=(ru=L==null?void 0:L.killHouseRequests)==null?void 0:ru.filter(c=>c.bar))==null?void 0:nu.map((c,Q)=>{var U,V,X,J,Z,D,T,m,uu,du,au,ou,hu;let K;return((U=c==null?void 0:c.bar)==null?void 0:U.state)==="pending"&&(K="#ff7410"),((V=c==null?void 0:c.bar)==null?void 0:V.state)==="accepted"&&(K="green"),((X=c==null?void 0:c.bar)==null?void 0:X.state)==="rejected"&&(K="red"),u.jsx(y,{container:!0,direction:"column",style:{whiteSpace:"nowrap"},children:u.jsx(p,{variant:"caption",color:K,children:u.jsxs(y,{container:!0,gap:1,style:{flexFlow:"nowrap"},children:[u.jsx("a",{href:(J=c==null?void 0:c.bar)==null?void 0:J.carWeightWithLoadImage,children:u.jsx("img",{src:(Z=c==null?void 0:c.bar)==null?void 0:Z.carWeightWithLoadImage,width:"20",height:"20",alt:"",style:{borderRadius:"4px"}})}),"وزن با بار:"," ",(T=(D=c==null?void 0:c.bar)==null?void 0:D.carWeightWithLoad)==null?void 0:T.toLocaleString()," ","/",u.jsx("a",{href:(m=c==null?void 0:c.bar)==null?void 0:m.carWeightWithoutLoadImage,children:u.jsx("img",{src:(uu=c==null?void 0:c.bar)==null?void 0:uu.carWeightWithoutLoadImage,width:"20",height:"20",alt:"",style:{borderRadius:"4px"}})}),"وزن بدون بار:"," ",(au=(du=c==null?void 0:c.bar)==null?void 0:du.carWeightWithoutLoad)==null?void 0:au.toLocaleString()," ","/ وزن خالص:",(ou=c==null?void 0:c.bar)==null?void 0:ou.netWeight.toLocaleString()," ","/ تعداد واقعی:",(hu=c==null?void 0:c.bar)==null?void 0:hu.realQuantity.toLocaleString()]})})},Q)})]}),u.jsxs(eu,{component:"th",scope:"row",children:[u.jsx(y,{style:{marginBottom:"2px"},children:u.jsx(p,{variant:"button",textAlign:"center",style:{borderBottom:"1px solid gray",paddingBottom:"2px"},children:"فاکتور استان"})}),(cu=(su=L==null?void 0:L.killHouseRequests)==null?void 0:su.filter(c=>c.provinceFactor))==null?void 0:cu.map((c,Q)=>{var U,V,X,J,Z,D,T,m,uu;let K;return((U=c==null?void 0:c.killHouseFactor)==null?void 0:U.state)==="pending"&&(K="#ff7410"),((V=c==null?void 0:c.killHouseFactor)==null?void 0:V.state)==="accepted"&&(K="green"),((X=c==null?void 0:c.killHouseFactor)==null?void 0:X.state)==="rejected"&&(K="red"),u.jsx(y,{container:!0,direction:"column",style:{whiteSpace:"nowrap"},children:u.jsxs(p,{variant:"caption",color:K,children:["فی:"," ",(J=c==null?void 0:c.provinceFactor)==null?void 0:J.factorFee.toLocaleString()," / ","وزن:"," ",(Z=c==null?void 0:c.provinceFactor)==null?void 0:Z.totalWeight.toLocaleString()," / ","مبلغ کل:"," ",(D=c==null?void 0:c.provinceFactor)==null?void 0:D.totalPrice.toLocaleString(),u.jsx("a",{href:(T=c==null?void 0:c.killHouseFactor)==null?void 0:T.factorImage,children:u.jsx("img",{src:(m=c==null?void 0:c.killHouseFactor)==null?void 0:m.factorImage,width:"20",height:"20",alt:"",style:{borderRadius:"4px"}})}),"شناسه پرداخت:",(uu=c==null?void 0:c.killHouseFactor)==null?void 0:uu.paymentCode]})},Q)})]})]},xu)})})]})})},C)})})})]})},C6=ul("PROVINCE_GET_CONTRADICTIONS_DATA",async(n,{dispatch:a})=>{a(a6());try{const{data:s,status:o}=await gu.get(`/killing_info_discrepancy_report/?date1=${n.selectedDate1}&date2=${n.selectedDate2}&role=${Cu()}`);return a(s6()),{data:s,status:o}}catch(s){throw a(s6()),s}}),t={invoiceTable:{width:"100%",borderCollapse:"collapse",alignSelf:"center",marginBottom:"2px",fontFamily:"titr"},tableCell:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:9,fontWeight:"bolder"},tableCellGreen:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:9,color:"white",fontWeight:"bolder",backgroundColor:"rgba(26, 188, 156, 0.7)"},tableHeader:{backgroundColor:"rgba(211, 211, 211, 0.3)",pageBreakAfter:"auto"},headerRow:{backgroundColor:"rgba(211, 211, 211, 0.3)",color:"black",pageBreakInside:"avoid",pageBreakAfter:"auto"},tableHeaderCell:{backgroundColor:"rgba(211, 211, 211, 0.3)",fontSize:10,border:"1px solid #000",padding:"4px",textAlign:"center",fontWeight:"bolder"},tableHeaderCellGreen:{backgroundColor:"rgba(26, 188, 156, 0.7)",fontSize:10,border:"1px solid #000",padding:"4px",textAlign:"center",fontWeight:"bolder",color:"white"},tableRowEven:{backgroundColor:"rgba(170, 183, 255, 0.3)"}},x6=({clearanceCode:n})=>{const a=P.useRef(null),s=()=>{a.current&&a.current.submit()};return u.jsxs("form",{action:"https://e.ivo.ir/Rahgiri/Gidprnt.aspx",method:"post",target:"_blank",ref:a,style:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:[u.jsx("input",{name:"gid",type:"hidden",value:n}),u.jsx("a",{color:"primary",onClick:s,children:n})]})},nl=({item:n})=>u.jsxs("table",{style:t.invoiceTable,children:[u.jsx("thead",{style:t.tableHeader,children:u.jsxs("tr",{style:t.headerRow,children:[u.jsx("th",{style:t.tableHeaderCell,children:"تعداد درخواست"}),u.jsx("th",{style:t.tableHeaderCell,children:"مجموع درخواست کشتار (قطعه)"}),u.jsx("th",{style:t.tableHeaderCell,children:"مجموع درخواست کشتار (وزن)"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعداد تخصیص به خریدار"}),u.jsx("th",{style:t.tableHeaderCell,children:"وزن تخصیص به خریدار "}),u.jsx("th",{style:t.tableHeaderCellGreen,children:"مانده قطعه قابل تخصیص"}),u.jsx("th",{style:t.tableHeaderCellGreen,children:"وزن قابل تخصیص"}),u.jsx("th",{style:t.tableHeaderCell,children:"اپراتور"})]})}),u.jsx("tbody",{children:u.jsxs("tr",{style:t.tableRowEven,children:[u.jsx("td",{style:t.tableCell,children:n==null?void 0:n.totalRequests.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:n==null?void 0:n.poultryRequestTotalQuantity.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:Math.round(n==null?void 0:n.poultryRequestTotalWeight).toLocaleString()}),u.jsx("td",{style:t.tableCell,children:n==null?void 0:n.provinceKillRequestsTotalQuantity.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:n==null?void 0:n.provinceKillRequestsTotalWeight.toLocaleString()}),u.jsx("td",{style:t.tableCellGreen,children:n==null?void 0:n.poultryRequestTotalRemainQuantity.toLocaleString()}),u.jsx("td",{style:t.tableCellGreen,children:Math.round(n==null?void 0:n.poultryRequestRemainWeight).toLocaleString()}),u.jsxs("td",{style:t.tableCell,children:[n==null?void 0:n.operatorFullname," ",u.jsx("br",{})," ",n==null?void 0:n.operatorMobile]})]})})]}),qe=({items:n,start:a,end:s})=>{const o=n==null?void 0:n.slice(a-1,s);return u.jsxs("table",{style:t.invoiceTable,children:[u.jsx("thead",{style:t.tableHeader,children:u.jsxs("tr",{style:t.headerRow,children:[u.jsx("th",{style:t.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:t.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:t.tableHeaderCell,children:"سهم کشتار (قطعه)"}),u.jsx("th",{style:t.tableHeaderCell,children:"سهم کشتار (وزن)"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعداد ماشین ها"}),u.jsx("th",{style:t.tableHeaderCell,children:"تخصیص به ماشین (قطعه)"}),u.jsx("th",{style:t.tableHeaderCell,children:"تخصیص به ماشین (وزن)"}),u.jsx("th",{style:t.tableHeaderCellGreen,children:"مانده قطعه قابل تخصیص"}),u.jsx("th",{style:t.tableHeaderCellGreen,children:"مانده وزن قابل تخصیص"}),u.jsx("th",{style:t.tableHeaderCell,children:"اپراتور"})]})}),u.jsx("tbody",{children:o==null?void 0:o.map((l,e)=>{var C,i,h,N,f,S,F,H,b,A,g,x;return u.jsxs("tr",{style:e%2===0?t.tableRowEven:{},children:[u.jsx("td",{style:t.tableCell,children:e+a}),u.jsxs("td",{style:t.tableCell,children:[(C=l==null?void 0:l.killhouseUser)==null?void 0:C.name," ",u.jsx("br",{})," (",(h=(i=l==null?void 0:l.killhouseUser)==null?void 0:i.killHouseOperator)==null?void 0:h.user.mobile,")"]}),u.jsx("td",{style:t.tableCell,children:(N=l==null?void 0:l.totalInfo)==null?void 0:N.provinceKillRequestQuantity.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(f=l==null?void 0:l.totalInfo)==null?void 0:f.provinceKillRequestWeight.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(S=l==null?void 0:l.totalInfo)==null?void 0:S.killHouseRequestsCount.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(F=l==null?void 0:l.totalInfo)==null?void 0:F.killHouseRequestQuantity.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(H=l==null?void 0:l.totalInfo)==null?void 0:H.killHouseRequestWeight.toLocaleString()}),u.jsx("td",{style:t.tableCellGreen,children:(b=l==null?void 0:l.totalInfo)==null?void 0:b.provinceKillRequestRemainQuantity.toLocaleString()}),u.jsx("td",{style:t.tableCellGreen,children:(A=l==null?void 0:l.totalInfo)==null?void 0:A.provinceKillRequestRemainWeight.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:u.jsxs(u.Fragment,{children:[(g=l==null?void 0:l.totalInfo)==null?void 0:g.operatorFullname,u.jsx("br",{}),(x=l==null?void 0:l.totalInfo)==null?void 0:x.operatorMobile]})})]},e)})})]})},d6=({items:n,start:a,end:s})=>{const o=n==null?void 0:n.slice(a-1,s);return u.jsxs("table",{style:t.invoiceTable,children:[u.jsx("thead",{style:t.tableHeader,children:u.jsxs("tr",{style:t.headerRow,children:[u.jsx("th",{style:t.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:t.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:t.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:t.tableHeaderCell,children:"تاریخ کشتار"}),u.jsx("th",{style:t.tableHeaderCell,children:"فروشنده"}),u.jsx("th",{style:t.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:t.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:t.tableHeaderCell,children:"نژاد"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:t.tableHeaderCell,children:"وزن بار"}),u.jsx("th",{style:t.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:t.tableHeaderCell,children:"محل کشتار"}),u.jsx("th",{style:t.tableHeaderCell,children:"دامپزشک"})]})}),u.jsx("tbody",{children:o==null?void 0:o.map((l,e)=>{var C,i,h,N,f,S,F,H,b,A,g,x,w,v,R,E,k,q,W,I,B,_;return u.jsxs("tr",{style:e%2===0?t.tableRowEven:{},children:[u.jsx("td",{style:t.tableCell,children:e+a}),u.jsx("td",{style:t.tableCell,children:l==null?void 0:l.barCode}),u.jsxs("td",{style:t.tableCell,children:[(C=l==null?void 0:l.killhouseUser)==null?void 0:C.name," ",u.jsx("br",{})," (",(h=(i=l==null?void 0:l.killhouseUser)==null?void 0:i.killHouseOperator)==null?void 0:h.user.mobile,")"]}),u.jsx("td",{style:t.tableCell,children:G((N=l==null?void 0:l.killRequest)==null?void 0:N.reciveDate)}),u.jsxs("td",{style:t.tableCell,children:[(S=(f=l==null?void 0:l.poultryRequest)==null?void 0:f.poultry)==null?void 0:S.unitName," ",u.jsx("br",{}),"(",(b=(H=(F=l==null?void 0:l.poultryRequest)==null?void 0:F.poultry)==null?void 0:H.user)==null?void 0:b.mobile,")"]}),u.jsx("td",{style:t.tableCell,children:(A=l==null?void 0:l.car)==null?void 0:A.typeCar}),u.jsx("td",{style:t.tableCell,children:(g=l==null?void 0:l.car)==null?void 0:g.driverName}),u.jsx("td",{style:t.tableCell,children:(x=l==null?void 0:l.poultryRequest)==null?void 0:x.chickenBreed}),u.jsx("td",{style:t.tableCell,children:(w=l==null?void 0:l.quantity)==null?void 0:w.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(R=(v=l==null?void 0:l.weightInfo)==null?void 0:v.weight)==null?void 0:R.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(E=l==null?void 0:l.weightInfo)==null?void 0:E.indexWeight}),u.jsx("td",{style:t.tableCell,children:l==null?void 0:l.killPlace}),u.jsx("td",{style:t.tableCell,children:l!=null&&l.vetFarm?u.jsxs(u.Fragment,{children:[(W=(q=(k=l==null?void 0:l.vetFarm)==null?void 0:k.vet)==null?void 0:q.user)==null?void 0:W.fullname,u.jsx("br",{}),(_=(B=(I=l==null?void 0:l.vetFarm)==null?void 0:I.vet)==null?void 0:B.user)==null?void 0:_.mobile]}):"ندارد"})]},e)})})]})},We=({items:n,start:a,end:s})=>{const o=n==null?void 0:n.slice(a-1,s);return u.jsxs("table",{style:t.invoiceTable,children:[u.jsx("thead",{style:t.tableHeader,children:u.jsxs("tr",{style:t.headerRow,children:[u.jsx("th",{style:t.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:t.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:t.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:t.tableHeaderCell,children:"فروشنده"}),u.jsx("th",{style:t.tableHeaderCell,children:"تاریخ کشتار"}),u.jsx("th",{style:t.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:t.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:t.tableHeaderCell,children:"نژاد"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:t.tableHeaderCell,children:"وزن بار"}),u.jsx("th",{style:t.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:t.tableHeaderCell,children:"کد قرنطینه"}),u.jsx("th",{style:t.tableHeaderCell,children:"دامپزشک"})]})}),u.jsx("tbody",{children:o==null?void 0:o.map((l,e)=>{var C,i,h,N,f,S,F,H,b,A,g,x,w,v,R,E,k,q,W,I,B,_;return u.jsxs("tr",{style:e%2===0?t.tableRowEven:{},children:[u.jsx("td",{style:t.tableCell,children:e+a}),u.jsx("td",{style:t.tableCell,children:l==null?void 0:l.barCode}),u.jsxs("td",{style:t.tableCell,children:[(C=l==null?void 0:l.killhouseUser)==null?void 0:C.name," ",u.jsx("br",{})," (",(h=(i=l==null?void 0:l.killhouseUser)==null?void 0:i.killHouseOperator)==null?void 0:h.user.mobile,")"]}),u.jsxs("td",{style:t.tableCell,children:[(f=(N=l==null?void 0:l.poultryRequest)==null?void 0:N.poultry)==null?void 0:f.unitName," ",u.jsx("br",{}),"(",(H=(F=(S=l==null?void 0:l.poultryRequest)==null?void 0:S.poultry)==null?void 0:F.user)==null?void 0:H.mobile,")"]}),u.jsx("td",{style:t.tableCell,children:G((b=l==null?void 0:l.killRequest)==null?void 0:b.reciveDate)}),u.jsx("td",{style:t.tableCell,children:(A=l==null?void 0:l.car)==null?void 0:A.typeCar}),u.jsx("td",{style:t.tableCell,children:(g=l==null?void 0:l.car)==null?void 0:g.driverName}),u.jsx("td",{style:t.tableCell,children:(x=l==null?void 0:l.poultryRequest)==null?void 0:x.chickenBreed}),u.jsx("td",{style:t.tableCell,children:(w=l==null?void 0:l.quantity)==null?void 0:w.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(R=(v=l==null?void 0:l.weightInfo)==null?void 0:v.weight)==null?void 0:R.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(E=l==null?void 0:l.weightInfo)==null?void 0:E.indexWeight}),u.jsx("td",{style:t.tableCell,children:u.jsx(x6,{clearanceCode:l==null?void 0:l.clearanceCode})}),u.jsx("td",{style:t.tableCell,children:l!=null&&l.vetFarm?u.jsxs(u.Fragment,{children:[(W=(q=(k=l==null?void 0:l.vetFarm)==null?void 0:k.vet)==null?void 0:q.user)==null?void 0:W.fullname,u.jsx("br",{}),(_=(B=(I=l==null?void 0:l.vetFarm)==null?void 0:I.vet)==null?void 0:B.user)==null?void 0:_.mobile]}):"ندارد"})]},e)})})]})},Ie=({items:n,start:a,end:s})=>{const o=n==null?void 0:n.slice(a-1,s);return u.jsxs("table",{style:t.invoiceTable,children:[u.jsx("thead",{style:t.tableHeader,children:u.jsxs("tr",{style:t.headerRow,children:[u.jsx("th",{style:t.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:t.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:t.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:t.tableHeaderCell,children:"فروشنده"}),u.jsx("th",{style:t.tableHeaderCell,children:"تاریخ کشتار"}),u.jsx("th",{style:t.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:t.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:t.tableHeaderCell,children:"نژاد"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:t.tableHeaderCell,children:"وزن بار"}),u.jsx("th",{style:t.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:t.tableHeaderCell,children:"کد قرنطینه"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعداد تخلیه شده (دامپزشک)"}),u.jsx("th",{style:t.tableHeaderCell,children:"وزن تخلیه شده (دامپزشک)"}),u.jsx("th",{style:t.tableHeaderCell,children:"کاربر"})]})}),u.jsx("tbody",{children:o==null?void 0:o.map((l,e)=>{var C,i,h,N,f,S,F,H,b,A,g,x,w,v,R,E,k,q,W,I,B,_;return u.jsxs("tr",{style:e%2===0?t.tableRowEven:{},children:[u.jsx("td",{style:t.tableCell,children:e+a}),u.jsx("td",{style:t.tableCell,children:l==null?void 0:l.barCode}),u.jsxs("td",{style:t.tableCell,children:[(C=l==null?void 0:l.killhouseUser)==null?void 0:C.name," ",u.jsx("br",{})," (",(h=(i=l==null?void 0:l.killhouseUser)==null?void 0:i.killHouseOperator)==null?void 0:h.user.mobile,")"]}),u.jsxs("td",{style:t.tableCell,children:[(f=(N=l==null?void 0:l.poultryRequest)==null?void 0:N.poultry)==null?void 0:f.unitName," ",u.jsx("br",{}),"(",(H=(F=(S=l==null?void 0:l.poultryRequest)==null?void 0:S.poultry)==null?void 0:F.user)==null?void 0:H.mobile,")"]}),u.jsx("td",{style:t.tableCell,children:G((b=l==null?void 0:l.killRequest)==null?void 0:b.reciveDate)}),u.jsx("td",{style:t.tableCell,children:(A=l==null?void 0:l.car)==null?void 0:A.typeCar}),u.jsx("td",{style:t.tableCell,children:(g=l==null?void 0:l.car)==null?void 0:g.driverName}),u.jsx("td",{style:t.tableCell,children:(x=l==null?void 0:l.poultryRequest)==null?void 0:x.chickenBreed}),u.jsx("td",{style:t.tableCell,children:(w=l==null?void 0:l.quantity)==null?void 0:w.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(R=(v=l==null?void 0:l.weightInfo)==null?void 0:v.weight)==null?void 0:R.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(E=l==null?void 0:l.weightInfo)==null?void 0:E.indexWeight}),u.jsx("td",{style:t.tableCell,children:u.jsx(x6,{clearanceCode:l==null?void 0:l.clearanceCode})}),u.jsx("td",{style:t.tableCell,children:l==null?void 0:l.vetAcceptedRealQuantity.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:l==null?void 0:l.vetAcceptedRealWeight.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:l!=null&&l.vetFarm?u.jsxs(u.Fragment,{children:[(W=(q=(k=l==null?void 0:l.vetFarm)==null?void 0:k.vet)==null?void 0:q.user)==null?void 0:W.fullname,u.jsx("br",{}),(_=(B=(I=l==null?void 0:l.vetFarm)==null?void 0:I.vet)==null?void 0:B.user)==null?void 0:_.mobile]}):"ندارد"})]},e)})})]})},Be=({items:n,start:a,end:s})=>{const o=n==null?void 0:n.slice(a-1,s);return u.jsxs("table",{style:t.invoiceTable,children:[u.jsx("thead",{style:t.tableHeader,children:u.jsxs("tr",{style:t.headerRow,children:[u.jsx("th",{style:t.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:t.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:t.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:t.tableHeaderCell,children:"تاریخ کشتار"}),u.jsx("th",{style:t.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:t.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:t.tableHeaderCell,children:"کد قرنطینه"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:t.tableHeaderCell,children:"وزن بار"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعداد تخلیه شده (دامپزشک)"}),u.jsx("th",{style:t.tableHeaderCell,children:"وزن تخلیه شده (دامپزشک)"}),u.jsx("th",{style:t.tableHeaderCell,children:"اطلاعات بار کشتارگاه (تعداد)"}),u.jsx("th",{style:t.tableHeaderCell,children:"اطلاعات بار کشتارگاه (وزن)"})]})}),u.jsx("tbody",{children:o==null?void 0:o.map((l,e)=>{var C,i,h,N,f,S,F,H,b,A,g,x;return u.jsxs("tr",{style:e%2===0?t.tableRowEven:{},children:[u.jsx("td",{style:t.tableCell,children:e+a}),u.jsx("td",{style:t.tableCell,children:l==null?void 0:l.barCode}),u.jsxs("td",{style:t.tableCell,children:[(C=l==null?void 0:l.killhouseUser)==null?void 0:C.name," ",u.jsx("br",{})," (",(h=(i=l==null?void 0:l.killhouseUser)==null?void 0:i.killHouseOperator)==null?void 0:h.user.mobile,")"]}),u.jsx("td",{style:t.tableCell,children:G((N=l==null?void 0:l.killRequest)==null?void 0:N.reciveDate)}),u.jsx("td",{style:t.tableCell,children:(f=l==null?void 0:l.car)==null?void 0:f.typeCar}),u.jsx("td",{style:t.tableCell,children:(S=l==null?void 0:l.car)==null?void 0:S.driverName}),u.jsx("td",{style:t.tableCell,children:u.jsx(x6,{clearanceCode:l==null?void 0:l.clearanceCode})}),u.jsx("td",{style:t.tableCell,children:(F=l==null?void 0:l.weightInfo)==null?void 0:F.quantity.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(H=l==null?void 0:l.weightInfo)==null?void 0:H.weight.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(b=l==null?void 0:l.weightInfo)==null?void 0:b.killHouseVetQuantity.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(A=l==null?void 0:l.weightInfo)==null?void 0:A.killHouseVetWeight.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(g=l==null?void 0:l.weightInfo)==null?void 0:g.assingmentQuantity.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(x=l==null?void 0:l.weightInfo)==null?void 0:x.assingmentWeight.toLocaleString()})]},e)})})]})},j={page:{width:"210mm",height:"297mm",display:"flex",margin:"0 auto",flexDirection:"column",position:"relative",direction:"rtl",fontFamily:"titr",fontWeight:"bold"},pageData:{position:"relative",display:"flex",direction:"rtl",flexDirection:"column"},tableInNewPage:{pageBreakAfter:"always",paddingLeft:"20px",paddingRight:"20px",direction:"rtl",fontFamily:"titr",fontWeight:"bold"},container:{width:"95%",alignSelf:"center",pageBreakInside:"avoid"},logo:{marginTop:"15px",width:"100px",height:"auto",zIndex:10},logoFooter:{width:"100px",height:"auto"},contentContainer:{alignItems:"center",display:"flex",justifyContent:"space-between",marginRight:"20px",marginLeft:"20px"},contentInLine:{display:"flex",flexDirection:"column",alignItems:"center"},watermarkContainer:{position:"fixed",top:250,left:30,right:0,bottom:0,justifyContent:"center",alignItems:"center",opacity:.15,zIndex:-1,userSelect:"none"},watermarkp:{fontFamily:"nazanin",fontSize:100,fontWeight:"bolder",color:"grey",transform:"rotate(-45deg)",left:"50%",userSelect:"none"},firsttitle:{pAlign:"center",color:"#00008b",fontWeight:"800"},divider:{alignSelf:"center",width:"120mm",height:"1px",backgroundColor:"black",margin:"0em"},divider2:{alignSelf:"center",width:"100%",height:"1px",backgroundColor:"black",margin:"0em"},footer:{left:0,bottom:0,width:"100%",position:"absolute"},footerContainer:{alignItems:"center",display:"flex"},circle:{borderRadius:"50%",width:"20px",height:"20px",padding:"10px",background:"#ecf0f1",border:" 1px solid #000",color:"#000",textAlign:"center",marginRight:"300px"},titleOfTable:{marginRight:"20px",fontSize:"15px"},titleOfTable2:{fontSize:"15px"}},i6=P.forwardRef((n,a)=>{const{item:s}=n,{inDate1:o}=n,{inDate2:l}=n,e=()=>u.jsx(u.Fragment,{children:u.jsxs("div",{style:j.contentContainer,children:[u.jsx("div",{style:j.contentInLine}),u.jsxs("div",{style:{...j.contentInLine,marginRight:"100px"},children:[u.jsxs("span",{style:{...j.firsttitle,fontSize:14,zIndex:1},children:["گزارش مغایرت اطلاعات کشتار و عدم فعالیت نقش ها"," "]}),o===l?u.jsxs("span",{style:{fontSize:"15px",color:"#485460"},children:["مورخ ",G(M(o))]}):u.jsxs("span",{style:{fontSize:"15px",color:"#485460"},children:["از تاریخ ",G(M(o))," ","‌ ‌‌ "," تا تاریخ"," ","‌ ",G(M(l))]}),u.jsx("hr",{style:j.divider}),"سامانه رصدیار"]}),u.jsx("div",{style:j.contentInLine,children:u.jsx("img",{alt:"logo",src:Ve,style:j.logo})})]})});let C=0;const i=()=>(C++,u.jsx(u.Fragment,{children:u.jsxs("div",{style:j.footer,children:[u.jsx("div",{style:j.divider2}),u.jsxs("div",{style:j.footerContainer,children:[u.jsx("img",{alt:"logo",src:Xe,style:j.logoFooter}),u.jsxs("p",{style:{fontSize:15,marginRight:"10px"},children:["گزارش مغایرت درخواست کشتار و عدم فعالیت نقش ها",u.jsx("br",{}),"www.rasadyaar.ir"]}),u.jsx("div",{style:j.circle,children:C})]})]})})),h=15,N=Math.ceil(Math.max(0,((s==null?void 0:s.partFour.length)-h)/h)),f=[];for(let x=0;xv-h&&f.push(u.jsxs("div",{style:j.page,children:[u.jsx(e,{}),u.jsxs("div",{style:j.tableInNewPage,children:[u.jsx("h3",{style:j.titleOfTable2,children:"مغایرت در ثبت ماشین و ایجاد بار"}),u.jsx(qe,{items:s==null?void 0:s.partTwo,start:w,end:v})]}),u.jsx(i,{})]},x))}const S=Math.ceil(Math.max(0,((s==null?void 0:s.partFour.length)-h)/h)),F=[];for(let x=0;xv-h&&F.push(u.jsxs("div",{style:j.page,children:[u.jsx(e,{}),u.jsxs("div",{style:j.tableInNewPage,children:[u.jsx("h3",{style:j.titleOfTable2,children:"بارهای تخلیه نشده"}),u.jsx(We,{items:s==null?void 0:s.partFour,start:w,end:v})]}),u.jsx(i,{})]},x))}const H=Math.ceil(Math.max(0,((s==null?void 0:s.partFive.length)-h)/h)),b=[];for(let x=0;xv-h&&b.push(u.jsxs("div",{style:j.page,children:[u.jsx(e,{}),u.jsxs("div",{style:j.tableInNewPage,children:[u.jsx("h3",{style:j.titleOfTable2,children:"بارهاي تکمیل نشده (بارگزاري سند باسکول و مستندات وزنی)"}),u.jsx(Ie,{items:s==null?void 0:s.partFive,start:w,end:v})]}),u.jsx(i,{})]},x))}const A=Math.ceil(Math.max(0,((s==null?void 0:s.partSix.length)-h)/h)),g=[];for(let x=0;xv-h&&g.push(u.jsxs("div",{style:j.page,children:[u.jsx(e,{}),u.jsxs("div",{style:j.tableInNewPage,children:[u.jsx("h3",{style:j.titleOfTable2,children:"مغایرت در اطلاعات بار"}),u.jsx(Be,{items:s==null?void 0:s.partSix,start:w,end:v})]}),u.jsx(i,{})]},x))}return u.jsxs("div",{ref:a,children:[u.jsx("div",{style:j.watermarkContainer,children:u.jsx("p",{style:j.watermarkp,children:"سامانه رصدیار "})}),u.jsxs("div",{style:j.page,children:[u.jsx(e,{}),u.jsxs("div",{style:j.pageData,children:[u.jsx("h3",{style:j.titleOfTable,children:" درخواست کشتار و تخصیص"}),u.jsx("div",{style:j.container,children:u.jsx(nl,{item:s==null?void 0:s.partOne})}),u.jsx("h3",{style:j.titleOfTable,children:"مغایرت در ثبت ماشین و ایجاد بار"}),u.jsx("div",{style:j.container,children:u.jsx(qe,{items:s==null?void 0:s.partTwo,start:1,end:h})})]}),u.jsx(i,{})]}),f,u.jsxs("div",{style:j.page,children:[u.jsx(e,{}),u.jsxs("div",{style:j.pageData,children:[u.jsx("h3",{style:j.titleOfTable,children:"بارهای فاقد کد قرنطینه"}),u.jsx("div",{style:j.container,children:u.jsx(d6,{items:s==null?void 0:s.partThree,start:1,end:15})})]}),u.jsx(i,{})]}),(s==null?void 0:s.partThree.length)>15&&u.jsxs("div",{style:j.page,children:[u.jsx(e,{}),u.jsxs("div",{style:j.tableInNewPage,children:[u.jsx("h3",{style:j.titleOfTable2,children:"بارهای فاقد کد قرنطینه"}),u.jsx(d6,{items:s==null?void 0:s.partThree,start:16,end:30})]}),u.jsx(i,{})]}),(s==null?void 0:s.partThree.length)>30&&u.jsxs("div",{style:j.page,children:[u.jsx(e,{}),u.jsxs("div",{style:j.tableInNewPage,children:[u.jsx("h3",{style:j.titleOfTable2,children:"بارهای فاقد کد قرنطینه"}),u.jsx(d6,{items:s==null?void 0:s.partThree,start:31,end:45})]}),u.jsx(i,{})]}),(s==null?void 0:s.partThree.length)>45&&u.jsxs("div",{style:j.page,children:[u.jsx(e,{}),u.jsxs("div",{style:j.tableInNewPage,children:[u.jsx("h3",{style:j.titleOfTable2,children:"بارهای فاقد کد قرنطینه"}),u.jsx(d6,{items:s==null?void 0:s.partThree,start:46,end:75})]}),u.jsx(i,{})]}),u.jsxs("div",{style:j.page,children:[u.jsx(e,{}),u.jsxs("div",{style:j.pageData,children:[u.jsx("h3",{style:j.titleOfTable,children:"بارهای تخلیه نشده"}),u.jsx("div",{style:j.container,children:u.jsx(We,{items:s==null?void 0:s.partFour,start:1,end:h})})]}),u.jsx(i,{})]}),F,u.jsxs("div",{style:j.page,children:[u.jsx(e,{}),u.jsxs("div",{style:j.pageData,children:[u.jsx("h3",{style:j.titleOfTable,children:"بارهاي تکمیل نشده (بارگزاري سند باسکول و مستندات وزنی)"}),u.jsx("div",{style:j.container,children:u.jsx(Ie,{items:s==null?void 0:s.partFive,start:1,end:h})})]}),u.jsx(i,{})]}),b,u.jsxs("div",{style:j.page,children:[u.jsx(e,{}),u.jsxs("div",{style:j.pageData,children:[u.jsx("h3",{style:j.titleOfTable,children:"مغایرت در اطلاعات بار"}),u.jsx("div",{style:j.container,children:u.jsx(Be,{items:s==null?void 0:s.partSix,start:1,end:h})})]}),u.jsx(i,{})]}),g]})});i6.displayName="ProvinceGetContradictionsFile";i6.propTypes={item:Pe.PropTypes.any};const r={invoiceTable:{width:"100%",borderCollapse:"collapse",alignSelf:"center",fontFamily:"titr",marginBottom:"15px"},tableCell:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:12,fontWeight:"bolder"},tableCellGreen:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:12,color:"white",fontWeight:"bolder",backgroundColor:"rgba(26, 188, 156, 0.7)"},tableHeader:{backgroundColor:"rgba(211, 211, 211, 0.3)",pageBreakAfter:"auto"},headerRow:{backgroundColor:"rgba(211, 211, 211, 0.3)",color:"black",pageBreakInside:"avoid",pageBreakAfter:"auto"},tableHeaderCell:{backgroundColor:"rgba(211, 211, 211, 0.3)",fontSize:12,border:"1px solid #000",padding:"4px",textAlign:"center",fontWeight:"bolder"},tableHeaderCellGreen:{backgroundColor:"rgba(26, 188, 156, 0.7)",fontSize:12,border:"1px solid #000",padding:"4px",textAlign:"center",fontWeight:"bolder",color:"white"},tableRowEven:{backgroundColor:"rgba(170, 183, 255, 0.3)"}},j6=({clearanceCode:n})=>{const a=P.useRef(null),s=()=>{a.current&&a.current.submit()};return u.jsxs("form",{action:"https://e.ivo.ir/Rahgiri/Gidprnt.aspx",method:"post",target:"_blank",ref:a,style:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:[u.jsx("input",{name:"gid",type:"hidden",value:n}),u.jsx("a",{color:"primary",onClick:s,children:n})]})},sl=({item:n})=>u.jsxs("table",{style:r.invoiceTable,children:[u.jsx("thead",{style:r.tableHeader,children:u.jsxs("tr",{style:r.headerRow,children:[u.jsx("th",{style:r.tableHeaderCell,children:"تعداد درخواست"}),u.jsx("th",{style:r.tableHeaderCell,children:"مجموع درخواست کشتار (قطعه)"}),u.jsx("th",{style:r.tableHeaderCell,children:"مجموع درخواست کشتار (وزن)"}),u.jsx("th",{style:r.tableHeaderCell,children:"تعداد تخصیص به خریدار"}),u.jsx("th",{style:r.tableHeaderCell,children:"وزن تخصیص به خریدار "}),u.jsx("th",{style:r.tableHeaderCellGreen,children:"مانده قطعه قابل تخصیص"}),u.jsx("th",{style:r.tableHeaderCellGreen,children:"وزن قابل تخصیص"}),u.jsx("th",{style:r.tableHeaderCell,children:"اپراتور"})]})}),u.jsx("tbody",{children:u.jsxs("tr",{style:r.tableRowEven,children:[u.jsx("td",{style:r.tableCell,children:n==null?void 0:n.totalRequests.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:n==null?void 0:n.poultryRequestTotalQuantity.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:Math.round(n==null?void 0:n.poultryRequestTotalWeight).toLocaleString()}),u.jsx("td",{style:r.tableCell,children:n==null?void 0:n.provinceKillRequestsTotalQuantity.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:n==null?void 0:n.provinceKillRequestsTotalWeight.toLocaleString()}),u.jsx("td",{style:r.tableCellGreen,children:n==null?void 0:n.poultryRequestTotalRemainQuantity.toLocaleString()}),u.jsx("td",{style:r.tableCellGreen,children:Math.round(n==null?void 0:n.poultryRequestRemainWeight).toLocaleString()}),u.jsxs("td",{style:r.tableCell,children:[n==null?void 0:n.operatorFullname," ",u.jsx("br",{})," ",n==null?void 0:n.operatorMobile]})]})})]}),cl=({items:n,start:a,end:s})=>{const o=n==null?void 0:n.slice(a-1,s);return u.jsxs("table",{style:r.invoiceTable,children:[u.jsx("thead",{style:r.tableHeader,children:u.jsxs("tr",{style:r.headerRow,children:[u.jsx("th",{style:r.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:r.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:r.tableHeaderCell,children:"سهم کشتار (قطعه)"}),u.jsx("th",{style:r.tableHeaderCell,children:"سهم کشتار (وزن)"}),u.jsx("th",{style:r.tableHeaderCell,children:"تعداد ماشین ها"}),u.jsx("th",{style:r.tableHeaderCell,children:"تخصیص به ماشین (قطعه)"}),u.jsx("th",{style:r.tableHeaderCell,children:"تخصیص به ماشین (وزن)"}),u.jsx("th",{style:r.tableHeaderCellGreen,children:"مانده قطعه قابل تخصیص"}),u.jsx("th",{style:r.tableHeaderCellGreen,children:"مانده وزن قابل تخصیص"}),u.jsx("th",{style:r.tableHeaderCell,children:"اپراتور"})]})}),u.jsx("tbody",{children:o==null?void 0:o.map((l,e)=>{var C,i,h,N,f,S,F,H,b,A,g,x;return u.jsxs("tr",{style:e%2===0?r.tableRowEven:{},children:[u.jsx("td",{style:r.tableCell,children:e+a}),u.jsxs("td",{style:r.tableCell,children:[(C=l==null?void 0:l.killhouseUser)==null?void 0:C.name," ",u.jsx("br",{})," (",(h=(i=l==null?void 0:l.killhouseUser)==null?void 0:i.killHouseOperator)==null?void 0:h.user.mobile,")"]}),u.jsx("td",{style:r.tableCell,children:(N=l==null?void 0:l.totalInfo)==null?void 0:N.provinceKillRequestQuantity.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:(f=l==null?void 0:l.totalInfo)==null?void 0:f.provinceKillRequestWeight.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:(S=l==null?void 0:l.totalInfo)==null?void 0:S.killHouseRequestsCount.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:(F=l==null?void 0:l.totalInfo)==null?void 0:F.killHouseRequestQuantity.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:(H=l==null?void 0:l.totalInfo)==null?void 0:H.killHouseRequestWeight.toLocaleString()}),u.jsx("td",{style:r.tableCellGreen,children:(b=l==null?void 0:l.totalInfo)==null?void 0:b.provinceKillRequestRemainQuantity.toLocaleString()}),u.jsx("td",{style:r.tableCellGreen,children:(A=l==null?void 0:l.totalInfo)==null?void 0:A.provinceKillRequestRemainWeight.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:u.jsxs(u.Fragment,{children:[(g=l==null?void 0:l.totalInfo)==null?void 0:g.operatorFullname,u.jsx("br",{}),(x=l==null?void 0:l.totalInfo)==null?void 0:x.operatorMobile]})})]},e)})})]})},_e=({items:n,start:a,end:s})=>{const o=n==null?void 0:n.slice(a-1,s);return u.jsxs("table",{style:r.invoiceTable,children:[u.jsx("thead",{style:r.tableHeader,children:u.jsxs("tr",{style:r.headerRow,children:[u.jsx("th",{style:r.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:r.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:r.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:r.tableHeaderCell,children:"تاریخ کشتار"}),u.jsx("th",{style:r.tableHeaderCell,children:"فروشنده"}),u.jsx("th",{style:r.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:r.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:r.tableHeaderCell,children:"نژاد"}),u.jsx("th",{style:r.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:r.tableHeaderCell,children:"وزن بار"}),u.jsx("th",{style:r.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:r.tableHeaderCell,children:"محل کشتار"}),u.jsx("th",{style:r.tableHeaderCell,children:"دامپزشک"})]})}),u.jsx("tbody",{children:o==null?void 0:o.map((l,e)=>{var C,i,h,N,f,S,F,H,b,A,g,x,w,v,R,E,k,q,W,I,B,_;return u.jsxs("tr",{style:e%2===0?r.tableRowEven:{},children:[u.jsx("td",{style:r.tableCell,children:e+a}),u.jsx("td",{style:r.tableCell,children:l==null?void 0:l.barCode}),u.jsxs("td",{style:r.tableCell,children:[(C=l==null?void 0:l.killhouseUser)==null?void 0:C.name," ",u.jsx("br",{})," (",(h=(i=l==null?void 0:l.killhouseUser)==null?void 0:i.killHouseOperator)==null?void 0:h.user.mobile,")"]}),u.jsx("td",{style:r.tableCell,children:G((N=l==null?void 0:l.killRequest)==null?void 0:N.reciveDate)}),u.jsxs("td",{style:r.tableCell,children:[(S=(f=l==null?void 0:l.poultryRequest)==null?void 0:f.poultry)==null?void 0:S.unitName," ",u.jsx("br",{}),"(",(b=(H=(F=l==null?void 0:l.poultryRequest)==null?void 0:F.poultry)==null?void 0:H.user)==null?void 0:b.mobile,")"]}),u.jsx("td",{style:r.tableCell,children:(A=l==null?void 0:l.car)==null?void 0:A.typeCar}),u.jsx("td",{style:r.tableCell,children:(g=l==null?void 0:l.car)==null?void 0:g.driverName}),u.jsx("td",{style:r.tableCell,children:(x=l==null?void 0:l.poultryRequest)==null?void 0:x.chickenBreed}),u.jsx("td",{style:r.tableCell,children:(w=l==null?void 0:l.quantity)==null?void 0:w.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:(R=(v=l==null?void 0:l.weightInfo)==null?void 0:v.weight)==null?void 0:R.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:(E=l==null?void 0:l.weightInfo)==null?void 0:E.indexWeight}),u.jsx("td",{style:r.tableCell,children:l==null?void 0:l.killPlace}),u.jsx("td",{style:r.tableCell,children:l!=null&&l.vetFarm?u.jsxs(u.Fragment,{children:[(W=(q=(k=l==null?void 0:l.vetFarm)==null?void 0:k.vet)==null?void 0:q.user)==null?void 0:W.fullname,u.jsx("br",{}),(_=(B=(I=l==null?void 0:l.vetFarm)==null?void 0:I.vet)==null?void 0:B.user)==null?void 0:_.mobile]}):"ندارد"})]},e)})})]})},dl=({items:n,start:a,end:s})=>{const o=n==null?void 0:n.slice(a-1,s);return u.jsxs("table",{style:r.invoiceTable,children:[u.jsx("thead",{style:r.tableHeader,children:u.jsxs("tr",{style:r.headerRow,children:[u.jsx("th",{style:r.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:r.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:r.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:r.tableHeaderCell,children:"فروشنده"}),u.jsx("th",{style:r.tableHeaderCell,children:"تاریخ کشتار"}),u.jsx("th",{style:r.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:r.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:r.tableHeaderCell,children:"نژاد"}),u.jsx("th",{style:r.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:r.tableHeaderCell,children:"وزن بار"}),u.jsx("th",{style:r.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:r.tableHeaderCell,children:"کد قرنطینه"}),u.jsx("th",{style:r.tableHeaderCell,children:"دامپزشک"})]})}),u.jsx("tbody",{children:o==null?void 0:o.map((l,e)=>{var C,i,h,N,f,S,F,H,b,A,g,x,w,v,R,E,k,q,W,I,B,_;return u.jsxs("tr",{style:e%2===0?r.tableRowEven:{},children:[u.jsx("td",{style:r.tableCell,children:e+a}),u.jsx("td",{style:r.tableCell,children:l==null?void 0:l.barCode}),u.jsxs("td",{style:r.tableCell,children:[(C=l==null?void 0:l.killhouseUser)==null?void 0:C.name," ",u.jsx("br",{})," (",(h=(i=l==null?void 0:l.killhouseUser)==null?void 0:i.killHouseOperator)==null?void 0:h.user.mobile,")"]}),u.jsxs("td",{style:r.tableCell,children:[(f=(N=l==null?void 0:l.poultryRequest)==null?void 0:N.poultry)==null?void 0:f.unitName," ",u.jsx("br",{}),"(",(H=(F=(S=l==null?void 0:l.poultryRequest)==null?void 0:S.poultry)==null?void 0:F.user)==null?void 0:H.mobile,")"]}),u.jsx("td",{style:r.tableCell,children:G((b=l==null?void 0:l.killRequest)==null?void 0:b.reciveDate)}),u.jsx("td",{style:r.tableCell,children:(A=l==null?void 0:l.car)==null?void 0:A.typeCar}),u.jsx("td",{style:r.tableCell,children:(g=l==null?void 0:l.car)==null?void 0:g.driverName}),u.jsx("td",{style:r.tableCell,children:(x=l==null?void 0:l.poultryRequest)==null?void 0:x.chickenBreed}),u.jsx("td",{style:r.tableCell,children:(w=l==null?void 0:l.quantity)==null?void 0:w.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:(R=(v=l==null?void 0:l.weightInfo)==null?void 0:v.weight)==null?void 0:R.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:(E=l==null?void 0:l.weightInfo)==null?void 0:E.indexWeight}),u.jsx("td",{style:r.tableCell,children:u.jsx(j6,{clearanceCode:l==null?void 0:l.clearanceCode})}),u.jsx("td",{style:r.tableCell,children:l!=null&&l.vetFarm?u.jsxs(u.Fragment,{children:[(W=(q=(k=l==null?void 0:l.vetFarm)==null?void 0:k.vet)==null?void 0:q.user)==null?void 0:W.fullname,u.jsx("br",{}),(_=(B=(I=l==null?void 0:l.vetFarm)==null?void 0:I.vet)==null?void 0:B.user)==null?void 0:_.mobile]}):"ندارد"})]},e)})})]})},al=({items:n,start:a,end:s})=>{const o=n==null?void 0:n.slice(a-1,s);return u.jsxs("table",{style:r.invoiceTable,children:[u.jsx("thead",{style:r.tableHeader,children:u.jsxs("tr",{style:r.headerRow,children:[u.jsx("th",{style:r.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:r.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:r.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:r.tableHeaderCell,children:"فروشنده"}),u.jsx("th",{style:r.tableHeaderCell,children:"تاریخ کشتار"}),u.jsx("th",{style:r.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:r.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:r.tableHeaderCell,children:"نژاد"}),u.jsx("th",{style:r.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:r.tableHeaderCell,children:"وزن بار"}),u.jsx("th",{style:r.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:r.tableHeaderCell,children:"کد قرنطینه"}),u.jsx("th",{style:r.tableHeaderCell,children:"تعداد تخلیه شده (دامپزشک)"}),u.jsx("th",{style:r.tableHeaderCell,children:"وزن تخلیه شده (دامپزشک)"}),u.jsx("th",{style:r.tableHeaderCell,children:"کاربر"})]})}),u.jsx("tbody",{children:o==null?void 0:o.map((l,e)=>{var C,i,h,N,f,S,F,H,b,A,g,x,w,v,R,E,k,q,W,I,B,_;return u.jsxs("tr",{style:e%2===0?r.tableRowEven:{},children:[u.jsx("td",{style:r.tableCell,children:e+a}),u.jsx("td",{style:r.tableCell,children:l==null?void 0:l.barCode}),u.jsxs("td",{style:r.tableCell,children:[(C=l==null?void 0:l.killhouseUser)==null?void 0:C.name," ",u.jsx("br",{})," (",(h=(i=l==null?void 0:l.killhouseUser)==null?void 0:i.killHouseOperator)==null?void 0:h.user.mobile,")"]}),u.jsxs("td",{style:r.tableCell,children:[(f=(N=l==null?void 0:l.poultryRequest)==null?void 0:N.poultry)==null?void 0:f.unitName," ",u.jsx("br",{}),"(",(H=(F=(S=l==null?void 0:l.poultryRequest)==null?void 0:S.poultry)==null?void 0:F.user)==null?void 0:H.mobile,")"]}),u.jsx("td",{style:r.tableCell,children:G((b=l==null?void 0:l.killRequest)==null?void 0:b.reciveDate)}),u.jsx("td",{style:r.tableCell,children:(A=l==null?void 0:l.car)==null?void 0:A.typeCar}),u.jsx("td",{style:r.tableCell,children:(g=l==null?void 0:l.car)==null?void 0:g.driverName}),u.jsx("td",{style:r.tableCell,children:(x=l==null?void 0:l.poultryRequest)==null?void 0:x.chickenBreed}),u.jsx("td",{style:r.tableCell,children:(w=l==null?void 0:l.quantity)==null?void 0:w.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:(R=(v=l==null?void 0:l.weightInfo)==null?void 0:v.weight)==null?void 0:R.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:(E=l==null?void 0:l.weightInfo)==null?void 0:E.indexWeight}),u.jsx("td",{style:r.tableCell,children:u.jsx(j6,{clearanceCode:l==null?void 0:l.clearanceCode})}),u.jsx("td",{style:r.tableCell,children:l==null?void 0:l.vetAcceptedRealQuantity.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:l==null?void 0:l.vetAcceptedRealWeight.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:l!=null&&l.vetFarm?u.jsxs(u.Fragment,{children:[(W=(q=(k=l==null?void 0:l.vetFarm)==null?void 0:k.vet)==null?void 0:q.user)==null?void 0:W.fullname,u.jsx("br",{}),(_=(B=(I=l==null?void 0:l.vetFarm)==null?void 0:I.vet)==null?void 0:B.user)==null?void 0:_.mobile]}):"ندارد"})]},e)})})]})},ol=({items:n,start:a,end:s})=>{const o=n==null?void 0:n.slice(a-1,s);return u.jsxs("table",{style:r.invoiceTable,children:[u.jsx("thead",{style:r.tableHeader,children:u.jsxs("tr",{style:r.headerRow,children:[u.jsx("th",{style:r.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:r.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:r.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:r.tableHeaderCell,children:"تاریخ کشتار"}),u.jsx("th",{style:r.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:r.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:r.tableHeaderCell,children:"کد قرنطینه"}),u.jsx("th",{style:r.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:r.tableHeaderCell,children:"وزن بار"}),u.jsx("th",{style:r.tableHeaderCell,children:"تعداد تخلیه شده (دامپزشک)"}),u.jsx("th",{style:r.tableHeaderCell,children:"وزن تخلیه شده (دامپزشک)"}),u.jsx("th",{style:r.tableHeaderCell,children:"اطلاعات بار کشتارگاه (تعداد)"}),u.jsx("th",{style:r.tableHeaderCell,children:"اطلاعات بار کشتارگاه (وزن)"})]})}),u.jsx("tbody",{children:o==null?void 0:o.map((l,e)=>{var C,i,h,N,f,S,F,H,b,A,g,x;return u.jsxs("tr",{style:e%2===0?r.tableRowEven:{},children:[u.jsx("td",{style:r.tableCell,children:e+a}),u.jsx("td",{style:r.tableCell,children:l==null?void 0:l.barCode}),u.jsxs("td",{style:r.tableCell,children:[(C=l==null?void 0:l.killhouseUser)==null?void 0:C.name," ",u.jsx("br",{})," (",(h=(i=l==null?void 0:l.killhouseUser)==null?void 0:i.killHouseOperator)==null?void 0:h.user.mobile,")"]}),u.jsx("td",{style:r.tableCell,children:G((N=l==null?void 0:l.killRequest)==null?void 0:N.reciveDate)}),u.jsx("td",{style:r.tableCell,children:(f=l==null?void 0:l.car)==null?void 0:f.typeCar}),u.jsx("td",{style:r.tableCell,children:(S=l==null?void 0:l.car)==null?void 0:S.driverName}),u.jsx("td",{style:r.tableCell,children:u.jsx(j6,{clearanceCode:l==null?void 0:l.clearanceCode})}),u.jsx("td",{style:r.tableCell,children:(F=l==null?void 0:l.weightInfo)==null?void 0:F.quantity.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:(H=l==null?void 0:l.weightInfo)==null?void 0:H.weight.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:(b=l==null?void 0:l.weightInfo)==null?void 0:b.killHouseVetQuantity.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:(A=l==null?void 0:l.weightInfo)==null?void 0:A.killHouseVetWeight.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:(g=l==null?void 0:l.weightInfo)==null?void 0:g.assingmentQuantity.toLocaleString()}),u.jsx("td",{style:r.tableCell,children:(x=l==null?void 0:l.weightInfo)==null?void 0:x.assingmentWeight.toLocaleString()})]},e)})})]})},hl=()=>{var b;const[,,n,a,s,o]=P.useContext(Fu),[l,e]=P.useState(),[C,i]=P.useState(),h=h6(),N=P.useRef(),f=Je.useReactToPrint({content:()=>N.current,documentTitle:"گزارش مغایرت درخواست کشتار و عدم فعالیت نقش ها "}),S=()=>{h(a6()),h(C6({selectedDate1:n,selectedDate2:s})).then(A=>{i(A.payload.data),h(s6())})},F=pu(A=>A.userSlice),H=A=>{h(a6()),h(C6({selectedDate1:n,selectedDate2:s})).then(g=>{e(g.payload.data),h(s6())})};return P.useEffect(()=>{(()=>{const g=M(new Date).format("YYYY-MM-DD"),x=M(g).subtract(1,"days").format("YYYY-MM-DD"),w=g;a(x),o(w),h(a6());try{const v=h(C6({selectedDate1:x,selectedDate2:w}));i(v.payload.data)}catch{h(s6())}})()},[]),P.useEffect(()=>{l&&f()},[l]),u.jsxs(y,{container:!0,p:z.TINY,xs:12,children:[u.jsxs(y,{container:!0,alignItems:"center",gap:z.SMALL,children:[u.jsx("div",{style:{visibility:"hidden",position:"absolute"},children:u.jsx(i6,{ref:N,item:l,inDate1:n,inDate2:s})}),u.jsx(p,{variant:"body2",children:"دریافت لیست مغایرت ها (حداکثر بازه 7 روزه)"}),u.jsx(y,{style:{width:"150px"},children:u.jsx(yu,{label:"از تاریخ",id:"date",renderInput:A=>u.jsx(ju,{...A}),value:n,onChange:A=>{a(M(A).format("YYYY-MM-DD"))}})}),u.jsx(y,{style:{width:"150px"},children:u.jsx(yu,{label:"تا تاریخ",id:"date",renderInput:A=>u.jsx(ju,{style:{width:"160px"},...A}),value:s,onChange:A=>{o(M(A).format("YYYY-MM-DD"))}})}),u.jsx(c6,{disabled:M(s).diff(M(n),"days")>7,type:"submit",onClick:S,endIcon:u.jsx(tl,{}),children:"جستجو"}),u.jsx(Au,{title:"خروجی PDF",children:u.jsx($e,{disabled:M(s).diff(M(n),"days")>7,"aria-label":"delete",color:"success",onClick:()=>{H()},children:u.jsx(el,{size:28})})}),u.jsx(Au,{title:"خروجی اکسل",children:u.jsx("a",{href:`${gu.defaults.baseURL}discrepancy_report_excel/?date1=${n}&date2=${s}&key=${(b=F==null?void 0:F.userProfile)==null?void 0:b.key}&role=${Cu()}`,rel:"noreferrer",children:u.jsx(c6,{color:"success",children:u.jsx(o6,{size:32})})})})]}),C&&u.jsx(y,{width:"100%",mt:z.SMALL,children:C&&u.jsxs(y,{width:"100%",mt:z.SMALL,children:[iu("درخواست کشتار و تخصیص",u.jsx(sl,{item:C==null?void 0:C.partOne})),iu("مغایرت در ثبت ماشین و ایجاد بار",u.jsx(cl,{items:C==null?void 0:C.partTwo,start:1,end:1e3})),iu("بارهای دارای مغایرت تعداد",u.jsx(_e,{items:C==null?void 0:C.partSeven,start:1,end:1e3})),iu("بارهای فاقد کد قرنطینه",u.jsx(_e,{items:C==null?void 0:C.partThree,start:1,end:1e3})),iu("بارهای تخلیه نشده",u.jsx(dl,{items:C==null?void 0:C.partFour,start:1,end:1e3})),iu("بارهاي تکمیل نشده (بارگزاري سند باسکول و مستندات وزنی)",u.jsx(al,{items:C==null?void 0:C.partFive,start:1,end:1e3})),iu("مغایرت در اطلاعات بار",u.jsx(ol,{items:C==null?void 0:C.partSix,start:1,end:1e3}))]})})]})},iu=(n,a)=>u.jsxs(Me,{children:[u.jsx(Qe,{expandIcon:u.jsx(Ze,{}),"aria-controls":"panel-content",id:"panel-header",children:u.jsx(p,{variant:"subtitle1",children:n})}),u.jsx(Ge,{children:a})]}),O=({link:n,text:a,fontSize:s,role:o,token:l,fColor:e})=>{const C=pu(h=>h.userSlice.authToken),[i]=P.useContext(Fu);return u.jsxs(u.Fragment,{children:[" ",Cu()==="ProvinceOperator"||Cu()==="SuperAdmin"?u.jsx(Au,{title:"جهت دانلود کلید کنید ",placement:"top",children:u.jsx("a",{onClick:()=>{i({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"})},className:"cell",style:{textDecoration:"none",fontSize:s||"12px",color:e||"white"},href:n?`${gu.defaults.baseURL}${n}${o?`&role=${Cu()}`:""}${l?`&token=${C}`:""}`:"#",children:a})}):u.jsx("span",{style:{textDecoration:"none",fontSize:s||"12px",color:e||"white"},children:a})]})},Cl=()=>{var h,N,f,S,F,H,b,A,g,x,w,v,R,E,k,q,W,I,B,_,L,xu,Y,lu,tu,ru,nu,su,cu,c,Q,K,U,V,X,J,Z,D,T,m,uu,du,au,ou,hu,bu,Nu,fu,Su,Hu,vu,wu,Lu,Ru,Eu,ku,qu,d,Wu,Iu,Bu,_u,Ku,Ou,Pu,$u,Mu,Qu,Gu,Yu,zu,Uu,Vu,Xu,Ju,Zu,Du,Tu,mu,u6,e6,l6,t6,r6,y6,A6,g6,F6,p6,b6,N6,f6,S6,H6,v6,w6,L6,R6,E6,k6,q6,W6,I6,B6,_6,K6,O6,P6,$6,M6,Q6,G6,Y6,z6,U6,V6,X6,J6,Z6,D6,T6,m6,u0,e0,l0,t0,r0,n0,s0,c0,d0,a0,o0,h0,C0,x0,i0,j0,y0,A0,g0,F0,p0,b0,N0,f0,S0,H0,v0,w0,L0,R0,E0,k0,q0,W0,I0,B0,_0,K0,O0,P0,$0,M0,Q0,G0,Y0,z0,U0,V0,X0,J0,Z0,D0,T0,m0,ue,ee,le,te,re,ne,se,ce,de,ae,oe,he,Ce,xe,ie,je,ye,Ae,ge,Fe,pe,be,Ne,fe,Se,He,ve,we,Le,Re;const n=h6(),[,,a,s,o,l]=P.useContext(Fu),{casesTableDetails:e}=pu($=>$.provinceSlice),[C]=P.useContext(Fu),i=pu($=>$.userSlice.userProfile.key);return P.useEffect(()=>{const $=M(new Date).format("YYYY-MM-DD");s($),l($)},[]),P.useEffect(()=>{n(De({selectedDate1:a,selectedDate2:o}))},[a,o]),u.jsxs(y,{container:!0,p:z.TINY,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsx(p,{m:2,variant:"body1",children:"گزارش کلی فارم های فعال مرغ گوشتی دارای مانده در سالن بیشتر از 10 درصد و بازه سنی 55 تا 90 روزه"}),(Cu()==="ProvinceOperator"||Cu()==="SuperAdmin")&&u.jsx(Au,{title:"خروجی اکسل گزارش جامع",children:u.jsx(c6,{color:"success",onClick:()=>{C({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const $=`${gu.defaults.baseURL}poultry_hatching_between_50age_70age_excel`;window.location.href=$},children:u.jsx(o6,{size:32})})}),u.jsx("div",{children:u.jsxs("table",{className:"table-styles",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"green-header",children:[u.jsx("th",{children:"تعداد فارم"}),u.jsx("th",{children:"مجموع جوجه ریزی کل"}),u.jsx("th",{children:"تعداد فارم بایگانی"}),u.jsx("th",{children:"مجموع جوجه ریزی بایگانی"}),u.jsx("th",{children:"تعداد فارم فعال"}),u.jsx("th",{children:"مجموع جوجه ریزی فعال"}),u.jsx("th",{children:"مجموع قطعه کشتار شده"}),u.jsx("th",{children:"مجموع وزن کشتار شده"}),u.jsx("th",{children:"جمع کل مانده در سالن "}),u.jsx("th",{children:"مانده در سالن از 90 درصد جوجه ریزی"}),u.jsx("th",{children:"کمترین سن"}),u.jsx("th",{children:"بیشترین سن"}),u.jsx("th",{children:"مجموع وزن تعهد دولتی"}),u.jsx("th",{children:"مجموع قطعه کشتار دولتی"}),u.jsx("th",{children:"مجموع وزن کشتار دولتی"}),u.jsx("th",{children:"مجموع قطعه کشتار آزاد"}),u.jsx("th",{children:"مجموع وزن کشتار آزاد"}),u.jsx("th",{children:"مجموع تعداد کشتار خارج از استان"}),u.jsx("th",{children:"مجموع وزن کشتار خارج از استان"})]})}),u.jsx("tbody",{children:u.jsxs("tr",{children:[u.jsx("td",{className:"centered-cell",children:(N=(h=e==null?void 0:e.age55Age90)==null?void 0:h.poultry)==null?void 0:N.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(S=(f=e==null?void 0:e.age55Age90)==null?void 0:f.hatchingQuantity)==null?void 0:S.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(H=(F=e==null?void 0:e.age55Age90)==null?void 0:F.lenArchiveHatching)==null?void 0:H.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(A=(b=e==null?void 0:e.age55Age90)==null?void 0:b.archiveHatchingQuantity)==null?void 0:A.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(x=(g=e==null?void 0:e.age55Age90)==null?void 0:g.lenActiveHatching)==null?void 0:x.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(v=(w=e==null?void 0:e.age55Age90)==null?void 0:w.activeHatchingQuantity)==null?void 0:v.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(E=(R=e==null?void 0:e.age55Age90)==null?void 0:R.hatchingKilledQuantity)==null?void 0:E.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(q=(k=e==null?void 0:e.age55Age90)==null?void 0:k.hatchingKilledWeight)==null?void 0:q.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(I=(W=e==null?void 0:e.age55Age90)==null?void 0:W.hatchingLeftOver)==null?void 0:I.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(_=(B=e==null?void 0:e.age55Age90)==null?void 0:B.hatchingLeftOverNintyPercent)==null?void 0:_.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(xu=(L=e==null?void 0:e.age55Age90)==null?void 0:L.minAge)==null?void 0:xu.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(lu=(Y=e==null?void 0:e.age55Age90)==null?void 0:Y.maxAge)==null?void 0:lu.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(ru=(tu=e==null?void 0:e.age55Age90)==null?void 0:tu.totalCommitment)==null?void 0:ru.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(su=(nu=e==null?void 0:e.age55Age90)==null?void 0:nu.governmentalQuantity)==null?void 0:su.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(c=(cu=e==null?void 0:e.age55Age90)==null?void 0:cu.governmentalWeight)==null?void 0:c.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(K=(Q=e==null?void 0:e.age55Age90)==null?void 0:Q.freeQuantity)==null?void 0:K.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(V=(U=e==null?void 0:e.age55Age90)==null?void 0:U.freeWeight)==null?void 0:V.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(J=(X=e==null?void 0:e.age55Age90)==null?void 0:X.outProvinceKilledQuantity)==null?void 0:J.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(D=(Z=e==null?void 0:e.age55Age90)==null?void 0:Z.outProvinceKilledWeight)==null?void 0:D.toLocaleString()})]})})]})}),u.jsxs(y,{container:!0,gap:z.SMALL,xs:12,mt:4,alignItems:"center",children:[u.jsx(y,{children:u.jsx(yu,{label:"از تاریخ",id:"date",renderInput:$=>u.jsx(ju,{size:"small",style:{width:"160px"},...$}),value:a,onChange:$=>{s(M($).format("YYYY-MM-DD"))}})}),u.jsx(y,{children:u.jsx(yu,{label:"تا تاریخ",id:"date",renderInput:$=>u.jsx(ju,{size:"small",style:{width:"160px"},...$}),value:o,onChange:$=>{l(M($).format("YYYY-MM-DD"))}})}),u.jsx(y,{children:u.jsx(Au,{title:"خروجی اکسل گزارش جامع",children:u.jsx(c6,{color:"warning",onClick:()=>{C({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const $=`${gu.defaults.baseURL}detail_of_killing_excel/?date1=${a}&date2=${o}&key=${i}&role=${Cu()}`;window.location.href=$},children:u.jsx(o6,{size:32})})})})]}),u.jsx(p,{m:2,variant:"body1",children:"گزارش بارهای ایجاد شده در فرآیند کشتار مرغ گوشتی"}),u.jsx(y,{container:!0,alignItems:"center",justifyContent:"center",xs:12,m:1,children:u.jsx(p,{variant:"body2",color:"primary",children:"اطلاعات کلی بارها"})}),u.jsx("div",{children:u.jsxs("table",{className:"table-styles",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsxs("th",{className:"green-cell",children:[" ",u.jsx(O,{text:"درخواست مرغداران",role:!0,token:!0,link:`poultry_kill_request_excel/?start=${a}&end=${o}`})," "]}),u.jsxs("th",{className:"green-cell",children:[u.jsx(O,{text:"مجموع حجم درخواست مرغداران",role:!0,token:!0,link:`poultry_kill_request_excel/?start=${a}&end=${o}`})," "]}),u.jsx("th",{className:"green-cell",children:u.jsx(O,{text:"مجموع وزن قطعه درخواست مرغداران",role:!0,token:!0,link:`poultry_kill_request_excel/?start=${a}&end=${o}`})}),u.jsx("th",{className:"green-cell",children:u.jsx(O,{text:"کمترین سن کشتار",role:!0,token:!0,link:`poultry_kill_request_excel/?start=${a}&end=${o}`})}),u.jsx("th",{className:"green-cell",children:u.jsx(O,{text:"بیشترین سن کشتار",role:!0,token:!0,link:`poultry_kill_request_excel/?start=${a}&end=${o}`})}),u.jsx("th",{className:"green-cell",children:u.jsx(O,{text:"میانگین سنی کشتار",role:!0,token:!0,link:`poultry_kill_request_excel/?start=${a}&end=${o}`})}),u.jsx("th",{className:"blue-cell",children:u.jsx(O,{text:"تعداد بارهای ایجاد شده",link:`bar_excel/?start=${a}&end=${o}`})}),u.jsx("th",{className:"blue-cell",children:u.jsx(O,{text:"مجموع حجم بارها",link:`bar_excel/?start=${a}&end=${o}`})}),u.jsx("th",{className:"blue-cell",children:u.jsx(O,{text:"مجموع وزن بارهای ایجاد شده",link:`bar_excel/?start=${a}&end=${o}`})}),u.jsx("th",{className:"blue-cell",children:u.jsx(O,{text:"میانگین وزن",link:`bar_excel/?start=${a}&end=${o}`})}),u.jsx("th",{className:"light-green-cell",children:u.jsx(O,{fColor:"rgb(99, 97, 97)",text:"تعداد بارهای دارای کد قرنطینه",link:`number_of_times_with_quarantine_code_excel/?date1=${a}&date2=${o}`})}),u.jsx("th",{className:"light-green-cell",children:u.jsx(O,{fColor:"rgb(99, 97, 97)",text:" مجموع قطعه بارهای دارای کد قرنطینه",link:`number_of_times_with_quarantine_code_excel/?date1=${a}&date2=${o}`})}),u.jsx("th",{className:"light-blue-cell",children:u.jsx(O,{text:"تعداد بار احراز شده از قرنطینه",link:`the_burden_of_quarantine_excel/?date1=${a}&date2=${o}`})}),u.jsx("th",{className:"light-blue-cell",children:u.jsx(O,{text:"مجموع حجم احراز شده از قرنطینه",link:`the_burden_of_quarantine_excel/?date1=${a}&date2=${o}`})}),u.jsx("th",{className:"light-yellow-cell",children:u.jsx(O,{text:"تعداد بارهای فاقد کد قرنطینه",link:`bar_without_quarantine_code_excel/?date1=${a}&date2=${o}`})}),u.jsx("th",{className:"light-yellow-cell",children:u.jsx(O,{text:"مجموع قطعه بارهای فاقد کد قرنطینه",link:`bar_without_quarantine_code_excel/?date1=${a}&date2=${o}`})}),u.jsx("th",{className:"light-yellow-cell",children:u.jsx(O,{text:"تعداد بارهایی که در قرنطینه و رصدیار اختلاف دارند",link:`bar_without_quarantine_code_excel/?date1=${a}&date2=${o}`})})]})}),u.jsx("tbody",{children:u.jsxs("tr",{children:[u.jsx("td",{className:"centered-cell",children:(m=(T=e==null?void 0:e.killRequest)==null?void 0:T.poultryRequest)==null?void 0:m.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(du=(uu=e==null?void 0:e.killRequest)==null?void 0:uu.poultryRequestQuantity)==null?void 0:du.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(ou=(au=e==null?void 0:e.killRequest)==null?void 0:au.poultryRequestWeight)==null?void 0:ou.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(bu=(hu=e==null?void 0:e.killRequest)==null?void 0:hu.minAge)==null?void 0:bu.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(fu=(Nu=e==null?void 0:e.killRequest)==null?void 0:Nu.maxAge)==null?void 0:fu.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(Hu=(Su=e==null?void 0:e.killRequest)==null?void 0:Su.avgAge)==null?void 0:Hu.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(wu=(vu=e==null?void 0:e.killRequest)==null?void 0:vu.lenKillRequest)==null?void 0:wu.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(Ru=(Lu=e==null?void 0:e.killRequest)==null?void 0:Lu.killRequestQuantity)==null?void 0:Ru.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(ku=(Eu=e==null?void 0:e.killRequest)==null?void 0:Eu.killRequestWeight)==null?void 0:ku.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(qu=e==null?void 0:e.killRequest)==null?void 0:qu.avgWeight}),u.jsx("td",{className:"centered-cell",children:(Wu=(d=e==null?void 0:e.killRequest)==null?void 0:d.lenKillRequestHasCode)==null?void 0:Wu.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(Bu=(Iu=e==null?void 0:e.killRequest)==null?void 0:Iu.quantityOfKillRequestHasCode)==null?void 0:Bu.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(Ku=(_u=e==null?void 0:e.killRequest)==null?void 0:_u.lenKillRequestHasQuarantine)==null?void 0:Ku.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(Pu=(Ou=e==null?void 0:e.killRequest)==null?void 0:Ou.quantityOfKillRequestHasQuarantine)==null?void 0:Pu.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(Mu=($u=e==null?void 0:e.killRequest)==null?void 0:$u.lenKillRequestHasNotCode)==null?void 0:Mu.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(Gu=(Qu=e==null?void 0:e.killRequest)==null?void 0:Qu.quantityOfKillRequestHasNotCode)==null?void 0:Gu.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(zu=(Yu=e==null?void 0:e.killRequest)==null?void 0:Yu.differenceBar)==null?void 0:zu.toLocaleString()})]})})]})}),u.jsx(y,{container:!0,alignItems:"center",justifyContent:"center",xs:12,m:1,children:u.jsx(p,{variant:"body2",color:"primary",children:"تفکیک بارهای دولتی، آزاد و خارج از استان"})}),u.jsx("div",{style:{overflowX:"auto"},children:u.jsxs("table",{className:"table-styles",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"blue-cell",children:u.jsx(O,{text:"تعداد بار دولتی",link:`government_burden_excel/?date1=${a}&date2=${o}`})}),u.jsx("th",{className:"blue-cell",children:u.jsx(O,{text:"مجموع قطعه بارهای دولتی",link:`government_burden_excel/?date1=${a}&date2=${o}`})}),u.jsx("th",{className:"blue-cell",children:u.jsx(O,{text:"مجموع وزن بارهای دولتی",link:`government_burden_excel/?date1=${a}&date2=${o}`})}),u.jsxs("th",{className:"blue-cell",children:[" ",u.jsx(O,{text:"بارهای دولتی دارای کد قرنطینه احراز شده",link:`government_burden_excel/?date1=${a}&date2=${o}`})]}),u.jsx("th",{className:"blue-cell",children:u.jsx(O,{text:"حجم دولتی احراز شده از قرنطینه",link:`goverment_bar_state_with_a_certified_quarantine_code_excel/?date1=${a}&date2=${o}`})}),u.jsx("th",{className:"light-green-cell",children:u.jsx(O,{text:" تعداد بارهای آزاد",link:`free_loads_excel/?date1=${a}&date2=${o}`})}),u.jsx("th",{className:"light-green-cell",children:u.jsx(O,{text:" مجموع قطعه بارهای بارهای آزاد",link:`free_loads_excel/?date1=${a}&date2=${o}`})}),u.jsx("th",{className:"light-blue-cell",children:"مجموع وزن بارهای آزاد"}),u.jsx("th",{className:"light-blue-cell",children:"بارهای آزاد احراز شده از قرنطینه"}),u.jsx("th",{className:"light-blue-cell",children:"مجموع حجم بارهای آزاد احراز شده از قرنطینه"}),u.jsx("th",{className:"light-blue-cell",children:"کل بارهای آزاد دارای کد قرنطینه"}),u.jsx("th",{className:"sky-blue-cell",children:"تعداد بارهای خارج از استان"}),u.jsx("th",{className:"sky-blue-cell",children:"مجموع قطعه بارهای خارج از استان"})]})}),u.jsx("tbody",{children:u.jsxs("tr",{children:[u.jsx("td",{className:"centered-cell",children:(Vu=(Uu=e==null?void 0:e.freeAndGovernmentKillRequest)==null?void 0:Uu.lenGovernment)==null?void 0:Vu.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(Ju=(Xu=e==null?void 0:e.freeAndGovernmentKillRequest)==null?void 0:Xu.quantityGovernment)==null?void 0:Ju.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(Du=(Zu=e==null?void 0:e.freeAndGovernmentKillRequest)==null?void 0:Zu.weightGovernment)==null?void 0:Du.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(mu=(Tu=e==null?void 0:e.freeAndGovernmentKillRequest)==null?void 0:Tu.lenGovernmentQuarantineQuantity)==null?void 0:mu.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(e6=(u6=e==null?void 0:e.freeAndGovernmentKillRequest)==null?void 0:u6.realQuantityBarGovernmentQuarantineQuantity)==null?void 0:e6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(t6=(l6=e==null?void 0:e.freeAndGovernmentKillRequest)==null?void 0:l6.lenFree)==null?void 0:t6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(y6=(r6=e==null?void 0:e.freeAndGovernmentKillRequest)==null?void 0:r6.quantityFree)==null?void 0:y6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(g6=(A6=e==null?void 0:e.freeAndGovernmentKillRequest)==null?void 0:A6.weightFree)==null?void 0:g6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(p6=(F6=e==null?void 0:e.freeAndGovernmentKillRequest)==null?void 0:F6.lenFreeQuarantineQuantity)==null?void 0:p6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(N6=(b6=e==null?void 0:e.freeAndGovernmentKillRequest)==null?void 0:b6.realQuantityBarFreeQuarantineQuantity)==null?void 0:N6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(S6=(f6=e==null?void 0:e.freeAndGovernmentKillRequest)==null?void 0:f6.lenFreeHasCode)==null?void 0:S6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(v6=(H6=e==null?void 0:e.freeAndGovernmentKillRequest)==null?void 0:H6.lenOutKillRequest)==null?void 0:v6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(L6=(w6=e==null?void 0:e.freeAndGovernmentKillRequest)==null?void 0:w6.quantityOutKillRequest)==null?void 0:L6.toLocaleString()})]})})]})}),u.jsx(y,{container:!0,alignItems:"center",justifyContent:"center",xs:12,m:1,children:u.jsx(p,{variant:"body2",color:"primary",children:"اطلاعات بارهای تخلیه شده و تکمیل شده توسط کشتارگاه"})}),u.jsx("div",{children:u.jsxs("table",{className:"table-styles",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"sky-blue-cell",children:"تعداد بارهای ورودی به کشتارگاه"}),u.jsx("th",{className:"sky-blue-cell",children:"مجموعه قطعه بارهای ورودی به کشتارگاه"}),u.jsx("th",{className:"sky-blue-cell",children:"وزن بارهای ورودی به کشتارگاه"}),u.jsx("th",{className:"sky-blue-cell",children:"میانگین وزن"}),u.jsx("th",{className:"brown-cell",children:"وزن لاشه مرغ بعد از کسر 25% افت"}),u.jsx("th",{className:"light-blue-cell",children:"تعداد بار تخلیه شده دامپزشک"}),u.jsx("th",{className:"light-blue-cell",children:"مجموع حجم تخلیه شده دامپزشک"}),u.jsx("th",{className:"light-blue-cell",children:"مجموع وزن تخلیه شده دامپزشک"}),u.jsx("th",{className:"blue-cell",children:"تعداد بارهای تکمیل شده کشتارگاه"}),u.jsx("th",{className:"blue-cell",children:"مجموع حجم نهایی در کشتارگاه"}),u.jsx("th",{className:"blue-cell",children:"مجموع وزن نهایی در کشتارگاه"}),u.jsx("th",{className:"blue-cell",children:"بارهای تخلیه شده فاقد کد قرنطینه"}),u.jsx("th",{className:"blue-cell",children:"قطعه بارهای تخلیه شده فاقد کد قرنطینه"}),u.jsx("th",{className:"blue-cell",children:"وزن بارهای تخلیه شده فاقد کد قرنطینه"})]})}),u.jsx("tbody",{children:u.jsxs("tr",{children:[u.jsx("td",{className:"centered-cell",children:(E6=(R6=e==null?void 0:e.completeKillRequest)==null?void 0:R6.lenCompleteWithKillHouseAndVet)==null?void 0:E6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(q6=(k6=e==null?void 0:e.completeKillRequest)==null?void 0:k6.quantityWithKillHouseAndVet)==null?void 0:q6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(I6=(W6=e==null?void 0:e.completeKillRequest)==null?void 0:W6.weightWithKillHouseAndVet)==null?void 0:I6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(B6=e==null?void 0:e.completeKillRequest)==null?void 0:B6.avgWeight}),u.jsx("td",{className:"centered-cell",children:(K6=(_6=e==null?void 0:e.completeKillRequest)==null?void 0:_6.less25)==null?void 0:K6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(P6=(O6=e==null?void 0:e.completeKillRequest)==null?void 0:O6.lenCompleteWithVet)==null?void 0:P6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(M6=($6=e==null?void 0:e.completeKillRequest)==null?void 0:$6.quantityCompleteWithVet)==null?void 0:M6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(G6=(Q6=e==null?void 0:e.completeKillRequest)==null?void 0:Q6.weightCompleteWithVet)==null?void 0:G6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(z6=(Y6=e==null?void 0:e.completeKillRequest)==null?void 0:Y6.lenCompleteWithKillHouse)==null?void 0:z6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(V6=(U6=e==null?void 0:e.completeKillRequest)==null?void 0:U6.quantityFinalKillHouse)==null?void 0:V6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(J6=(X6=e==null?void 0:e.completeKillRequest)==null?void 0:X6.weightFinalKillHouse)==null?void 0:J6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(D6=(Z6=e==null?void 0:e.completeKillRequest)==null?void 0:Z6.lenKillReqsHasNotCode)==null?void 0:D6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(m6=(T6=e==null?void 0:e.completeKillRequest)==null?void 0:T6.quantityKillReqsHasNotCode)==null?void 0:m6.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(e0=(u0=e==null?void 0:e.completeKillRequest)==null?void 0:u0.weightKillReqsHasNotCode)==null?void 0:e0.toLocaleString()})]})})]})}),u.jsx(y,{container:!0,alignItems:"center",justifyContent:"center",xs:12,m:1,children:u.jsx(p,{variant:"body2",color:"primary",children:"اطلاعات بارهای تخلیه نشده و تخلیه نشده توسط کشتارگاه"})}),u.jsx("div",{children:u.jsxs("table",{className:"table-styles",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"red-cell",children:"تعداد بار تخلیه نشده"}),u.jsx("th",{className:"red-cell",children:"مجموع بارهای تخلیه نشده"}),u.jsx("th",{className:"red-cell",children:"وزن بارهای تخلیه نشده"}),u.jsx("th",{className:"light-green-cell",children:"بارهای تخلیه شده و عدم تکمیل توسط کشتارگاه"}),u.jsx("th",{className:"light-green-cell",children:"قطعه بارهای تخلیه شده و عدم تکمیل توسط کشتارگاه"}),u.jsx("th",{className:"light-green-cell",children:"وزن بارهای تخلیه شده و عدم تکمیل توسط کشتارگاه"})]})}),u.jsx("tbody",{children:u.jsxs("tr",{children:[u.jsx("td",{className:"centered-cell",children:(t0=(l0=e==null?void 0:e.killRequestHasNotAssigment)==null?void 0:l0.lenKillReqsNotAssigment)==null?void 0:t0.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(n0=(r0=e==null?void 0:e.killRequestHasNotAssigment)==null?void 0:r0.quantityKillReqsNotAssigment)==null?void 0:n0.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(c0=(s0=e==null?void 0:e.killRequestHasNotAssigment)==null?void 0:s0.weightKillReqsNotAssigment)==null?void 0:c0.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(a0=(d0=e==null?void 0:e.killRequestHasNotAssigment)==null?void 0:d0.lenKillRequestHasNotComplete)==null?void 0:a0.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(h0=(o0=e==null?void 0:e.killRequestHasNotAssigment)==null?void 0:o0.quantityKillRequestHasNotComplete)==null?void 0:h0.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(x0=(C0=e==null?void 0:e.killRequestHasNotAssigment)==null?void 0:C0.weightKillRequestHasNotComplete)==null?void 0:x0.toLocaleString()})]})})]})}),u.jsx(y,{container:!0,alignItems:"center",justifyContent:"center",xs:12,m:1,children:u.jsx(p,{variant:"body2",color:"primary",children:"حجم نهایی کم شده از سالن مرغدار (ملاک کشتار)"})}),u.jsx("div",{className:"table-container",children:u.jsxs("table",{className:"table-styles",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"blue-cell",children:"ملاک قطعه کشتار شده"}),u.jsx("th",{className:"blue-cell",children:"ملاک وزن کشتار شده"})]})}),u.jsx("tbody",{children:u.jsxs("tr",{children:[u.jsx("td",{className:"centered-cell",children:(j0=(i0=e==null?void 0:e.finalQuantityAndWeight)==null?void 0:i0.finalQuantity)==null?void 0:j0.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(A0=(y0=e==null?void 0:e.finalQuantityAndWeight)==null?void 0:y0.finalWeight)==null?void 0:A0.toLocaleString()})]})})]})}),u.jsx(y,{xs:12,mt:2,children:u.jsx(p,{variant:"body2",color:"primary",children:"توزیع از کشتارگاه به مباشر و صنف"})}),u.jsxs(y,{container:!0,justifyContent:"space-between",xs:12,mt:1,children:[u.jsxs(p,{variant:"body2",children:["تعداد خریداران:"," ",(F0=(g0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:g0.buyers)==null?void 0:F0.toLocaleString()]}),u.jsxs(p,{variant:"body2",children:["تعداد مباشر تخصیص داده شده:"," ",(b0=(p0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:p0.numberOfSteward)==null?void 0:b0.toLocaleString()]}),u.jsxs(p,{variant:"body2",children:["تعداد صنف تخصیص داده شده:"," ",(f0=(N0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:N0.numberOfGuild)==null?void 0:f0.toLocaleString()]})]}),u.jsx("div",{className:"table-container",children:u.jsxs("table",{className:"table-styles",style:{width:"100%"},children:[u.jsxs("thead",{children:[u.jsxs("tr",{children:[u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"ورودی از سردخانه"}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"خرید خارج از استان"}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"بارهای روزانه"}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"جمع کل انبار"}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"توزیع شده"}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"توزیع/تحویل شده"}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"مانده انبار"})]}),u.jsxs("tr",{children:[u.jsx("th",{className:"centered-cell yellow-cell",children:"تعداد"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"تعداد"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"تعداد"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"تعداد"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"تعداد"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"تعداد"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"تعداد"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"})]})]}),u.jsx("tbody",{children:u.jsxs("tr",{children:[u.jsx("td",{className:"centered-cell detail-cell",children:(H0=(S0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:S0.incomingQuantityOfColdHouse)==null?void 0:H0.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(w0=(v0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:v0.incomingWeightOfColdHouse)==null?void 0:w0.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(R0=(L0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:L0.totalNumberOfFreeCarcasses)==null?void 0:R0.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(k0=(E0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:E0.totalFreeWeightOfCarcasses)==null?void 0:k0.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(W0=(q0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:q0.totalNumberOfCarcasses)==null?void 0:W0.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(B0=(I0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:I0.totalWeightOfCarcasses)==null?void 0:B0.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(K0=(_0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:_0.finalTotalNumberOfCarcasses)==null?void 0:K0.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(P0=(O0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:O0.finalTotalWeightOfCarcasses)==null?void 0:P0.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(M0=($0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:$0.totalAllocatedQuantity)==null?void 0:M0.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(G0=(Q0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:Q0.totalAllocatedWeight)==null?void 0:G0.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(z0=(Y0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:Y0.totalAcceptedAllocatedQuantity)==null?void 0:z0.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(V0=(U0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:U0.totalAcceptedAllocatedWeight)==null?void 0:V0.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(J0=(X0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:X0.totalRemainQuantity)==null?void 0:J0.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(D0=(Z0=e==null?void 0:e.killHouseWareHouseTotalReportDailyBroadCast)==null?void 0:Z0.totalRemainWeight)==null?void 0:D0.toLocaleString()})]})})]})}),u.jsx(y,{xs:12,mt:2,children:u.jsx(p,{variant:"body2",color:"primary",children:"توزیع از مباشر به صنف"})}),u.jsxs(y,{container:!0,justifyContent:"space-between",xs:12,mt:1,children:[u.jsxs(p,{variant:"body2",children:["تعداد خریداران:"," ",(m0=(T0=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:T0.buyers)==null?void 0:m0.toLocaleString()]}),u.jsxs(p,{variant:"body2",children:["تعداد صنف تخصیص داده شده:"," ",(ee=(ue=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:ue.numberOfGuild)==null?void 0:ee.toLocaleString()]})]}),u.jsx("div",{className:"table-container",children:u.jsxs("table",{className:"table-styles",style:{width:"100%"},children:[u.jsxs("thead",{children:[u.jsxs("tr",{children:[u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"ورودی از سردخانه"}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"خرید خارج از استان"}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"بارهای روزانه"}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"جمع کل انبار"}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"توزیع شده"}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"توزیع/تحویل شده"}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"مانده انبار"})]}),u.jsxs("tr",{children:[u.jsx("th",{className:"centered-cell yellow-cell",children:"تعداد"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"تعداد"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"تعداد"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"تعداد"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"تعداد"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"تعداد"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"تعداد"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"})]})]}),u.jsx("tbody",{children:u.jsxs("tr",{children:[u.jsx("td",{className:"centered-cell detail-cell",children:(te=(le=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:le.incomingQuantityOfColdHouse)==null?void 0:te.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(ne=(re=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:re.incomingWeightOfColdHouse)==null?void 0:ne.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(ce=(se=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:se.totalNumberOfFreeCarcasses)==null?void 0:ce.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(ae=(de=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:de.totalFreeWeightOfCarcasses)==null?void 0:ae.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(he=(oe=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:oe.totalNumberOfCarcasses)==null?void 0:he.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(xe=(Ce=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:Ce.totalWeightOfCarcasses)==null?void 0:xe.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(je=(ie=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:ie.finalTotalNumberOfCarcasses)==null?void 0:je.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(Ae=(ye=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:ye.finalTotalWeightOfCarcasses)==null?void 0:Ae.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(Fe=(ge=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:ge.totalAllocatedQuantity)==null?void 0:Fe.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(be=(pe=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:pe.totalAllocatedWeight)==null?void 0:be.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(fe=(Ne=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:Ne.totalAcceptedAllocatedQuantity)==null?void 0:fe.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(He=(Se=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:Se.totalAcceptedAllocatedWeight)==null?void 0:He.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(we=(ve=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:ve.totalRemainQuantity)==null?void 0:we.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(Re=(Le=e==null?void 0:e.stewardWareHouseTotalReportDailyBroadCast)==null?void 0:Le.totalRemainWeight)==null?void 0:Re.toLocaleString()})]})})]})})]})},xl=()=>{var h,N,f,S,F,H,b,A,g,x,w,v,R,E,k,q,W,I,B,_,L,xu,Y,lu,tu,ru,nu,su,cu,c,Q,K,U,V,X,J,Z,D,T,m,uu,du,au,ou,hu,bu,Nu,fu,Su,Hu,vu,wu,Lu,Ru,Eu,ku,qu;const n=h6(),[,,a,s,o,l]=P.useContext(Fu),{slaughterSurveillance:e}=pu(d=>d.provinceSlice),[C]=P.useContext(Fu),i=Te();return P.useEffect(()=>{const d=M(new Date).format("YYYY-MM-DD");s(d),l(d)},[]),P.useEffect(()=>{n(me({selectedDate1:a,selectedDate2:o}))},[a,o]),u.jsxs(y,{container:!0,p:z.TINY,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsxs(y,{container:!0,gap:z.SMALL,xs:12,mt:4,children:[u.jsx(y,{children:u.jsx(yu,{label:"از تاریخ",id:"date",renderInput:d=>u.jsx(ju,{size:"small",style:{width:"160px"},...d}),value:a,onChange:d=>{s(M(d).format("YYYY-MM-DD"))}})}),u.jsx(y,{children:u.jsx(yu,{label:"تا تاریخ",id:"date",renderInput:d=>u.jsx(ju,{size:"small",style:{width:"160px"},...d}),value:o,onChange:d=>{l(M(d).format("YYYY-MM-DD"))}})}),u.jsx(Au,{title:"خروجی اکسل گزارش پایش کشتارگاه",children:u.jsx(c6,{color:"primary",onClick:()=>{C({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const d=`${gu.defaults.baseURL}comprehensive_report_of_the_slaughterhouse_excel/?date1=${a}&date2=${o}`;window.location.href=d},children:u.jsx(o6,{size:32})})})]}),u.jsxs(p,{m:2,variant:"body1",children:["گزارش جامع خریداران در فرآیند کشتار مرغ گوشتی ",i]}),u.jsx("div",{children:u.jsxs("table",{className:"table-styles",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"green-header",children:[u.jsx("th",{children:"تعداد کل بارهای ایجاد شده (زنده)"}),u.jsx("th",{children:"وزن کل بارهای ایجاد شده (زنده)"}),u.jsx("th",{children:"حجم کل بارهای تحویلی کشتارگاه (زنده)"}),u.jsx("th",{children:"وزن کل بارهای تحویلی کشتارگاه (زنده)"}),u.jsx("th",{children:"وزن تحویلی با افت 25 درصد"}),u.jsx("th",{children:"تعداد ورودی به انبار کشتارگاه (لاشه)"}),u.jsx("th",{children:"وزن ورودی به انبار کشتارگاه (لاشه)"}),u.jsx("th",{children:"درصد لاشه ورودی به انبار کشتارگاه نسبت به بار تحویلی کشتارگاه"}),u.jsx("th",{children:"درصد وزن لاشه ورودی به انبار کشتارگاه نسبت به بار تحویلی کشتارگاه"}),u.jsx("th",{children:"درصد تعداد بار تحویلی نسبت به بار ایحاد شده"}),u.jsx("th",{children:"درصد وزن بار تحویلی نسبت به بار ایحاد شده"})]})}),u.jsx("tbody",{children:u.jsxs("tr",{children:[u.jsx("td",{className:"centered-cell",children:(N=(h=e==null?void 0:e.allKillRequest)==null?void 0:h.quantityOfCreateBar)==null?void 0:N.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(S=(f=e==null?void 0:e.allKillRequest)==null?void 0:f.weightOfCreateBar)==null?void 0:S.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(H=(F=e==null?void 0:e.allKillRequest)==null?void 0:F.quantityOfReceiveBar)==null?void 0:H.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(A=(b=e==null?void 0:e.allKillRequest)==null?void 0:b.weightOfReceiveBar)==null?void 0:A.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(x=(g=e==null?void 0:e.allKillRequest)==null?void 0:g.weightWithTwentyFivePercentReceive)==null?void 0:x.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(v=(w=e==null?void 0:e.allKillRequest)==null?void 0:w.quantityWarehouse)==null?void 0:v.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(E=(R=e==null?void 0:e.allKillRequest)==null?void 0:R.weightWarehouse)==null?void 0:E.toLocaleString()}),u.jsxs("td",{className:"centered-cell",children:[(q=(k=e==null?void 0:e.allKillRequest)==null?void 0:k.quantityPercentWarehouse)==null?void 0:q.toLocaleString(),"%"]}),u.jsxs("td",{className:"centered-cell",children:[(I=(W=e==null?void 0:e.allKillRequest)==null?void 0:W.weightPercentWarehouse)==null?void 0:I.toLocaleString(),"%"]}),u.jsxs("td",{className:"centered-cell",children:[(_=(B=e==null?void 0:e.allKillRequest)==null?void 0:B.quantityPercentReceive)==null?void 0:_.toLocaleString(),"%"]}),u.jsxs("td",{className:"centered-cell",children:[(xu=(L=e==null?void 0:e.allKillRequest)==null?void 0:L.weightPercentReceive)==null?void 0:xu.toLocaleString(),"%"]})]})})]})}),u.jsx(y,{xs:12,children:u.jsxs(p,{m:2,variant:"body1",color:"secondary",children:["اطلاعات کلی توزیع و پخش مرغ گرم از تاریخ"," ",G((Y=e==null?void 0:e.generalBroadcastInformations)==null?void 0:Y.date1)," ","تا تاریخ"," ",G((lu=e==null?void 0:e.generalBroadcastInformations)==null?void 0:lu.date2)]})}),u.jsx("div",{children:u.jsxs("table",{className:"table-styles",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"green-header",children:[u.jsx("th",{children:"تعداد خریداران"}),u.jsx("th",{children:"تعداد کشتار داخل استان"}),u.jsx("th",{children:"وزن کشتار داخل استان"}),u.jsx("th",{children:"تعداد خرید خارج استان"}),u.jsx("th",{children:"وزن خرید خارج استان"}),u.jsx("th",{children:"تعداد جمع کل انبار"}),u.jsx("th",{children:"وزن جمع کل انبار"}),u.jsx("th",{children:"تعداد توزیع شده"}),u.jsx("th",{children:"وزن توزیع شده"}),u.jsx("th",{children:"تعداد توزیع / تحویل شده"}),u.jsx("th",{children:"وزن توزیع / تحویل شده"}),u.jsx("th",{children:"تعداد مانده انبار"}),u.jsx("th",{children:"وزن مانده انبار"}),u.jsx("th",{children:"درصد توزیع نسبت به ورودی به انبار"}),u.jsx("th",{children:"تعداد مباشر تخصیص داده شده"}),u.jsx("th",{children:"تعداد صنف تخصیص داده شده"})]})}),u.jsx("tbody",{children:u.jsxs("tr",{children:[u.jsx("td",{className:"centered-cell",children:(ru=(tu=e==null?void 0:e.generalBroadcastInformations)==null?void 0:tu.numberOfBuyer)==null?void 0:ru.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(su=(nu=e==null?void 0:e.generalBroadcastInformations)==null?void 0:nu.quantityOfKillRequestInProvince)==null?void 0:su.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(c=(cu=e==null?void 0:e.generalBroadcastInformations)==null?void 0:cu.weightOfKillRequestInProvince)==null?void 0:c.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(K=(Q=e==null?void 0:e.generalBroadcastInformations)==null?void 0:Q.quantityOfKillRequestOutProvince)==null?void 0:K.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(V=(U=e==null?void 0:e.generalBroadcastInformations)==null?void 0:U.weightOfKillRequestOutProvince)==null?void 0:V.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(J=(X=e==null?void 0:e.generalBroadcastInformations)==null?void 0:X.quantityCarcasses)==null?void 0:J.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(D=(Z=e==null?void 0:e.generalBroadcastInformations)==null?void 0:Z.weightCarcasses)==null?void 0:D.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(m=(T=e==null?void 0:e.generalBroadcastInformations)==null?void 0:T.allocatedQuantity)==null?void 0:m.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(du=(uu=e==null?void 0:e.generalBroadcastInformations)==null?void 0:uu.allocatedWeight)==null?void 0:du.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(ou=(au=e==null?void 0:e.generalBroadcastInformations)==null?void 0:au.acceptedAllocatedQuantity)==null?void 0:ou.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(bu=(hu=e==null?void 0:e.generalBroadcastInformations)==null?void 0:hu.acceptedAllocatedWeight)==null?void 0:bu.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(fu=(Nu=e==null?void 0:e.generalBroadcastInformations)==null?void 0:Nu.remainQuantity)==null?void 0:fu.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(Hu=(Su=e==null?void 0:e.generalBroadcastInformations)==null?void 0:Su.remainWeight)==null?void 0:Hu.toLocaleString()}),u.jsxs("td",{className:"centered-cell",children:["%",(wu=(vu=e==null?void 0:e.generalBroadcastInformations)==null?void 0:vu.percentWarehouse)==null?void 0:wu.toLocaleString()]}),u.jsx("td",{className:"centered-cell",children:(Ru=(Lu=e==null?void 0:e.generalBroadcastInformations)==null?void 0:Lu.numberOfStewards)==null?void 0:Ru.toLocaleString()}),u.jsx("td",{className:"centered-cell",children:(ku=(Eu=e==null?void 0:e.generalBroadcastInformations)==null?void 0:Eu.numberOfGiulds)==null?void 0:ku.toLocaleString()})]})})]})}),u.jsxs(y,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsx(y,{xs:4}),u.jsx(y,{xs:4,children:u.jsx(p,{m:2,variant:"body1",color:"secondary",children:"اطلاعات کلی بارها و توزیع خریداران"})}),u.jsx(y,{xs:4,justifyContent:"end",container:!0,children:u.jsx(p,{sx:{fontSize:"10px",color:"red"},children:"*وزن (کیلوگرام)، حجم (قطعه)"})})]}),u.jsx("div",{className:"last-table-container",children:u.jsxs("table",{className:"table-styles",style:{width:"100%"},children:[u.jsxs("thead",{children:[u.jsxs("tr",{children:[u.jsx("th",{className:"strong-blue-cell",colSpan:1,rowSpan:2,children:"ردیف"})," ",u.jsx("th",{className:"strong-blue-cell",colSpan:1,rowSpan:2,children:"خریدار"})," ",u.jsx("th",{className:"strong-blue-cell",colSpan:1,rowSpan:2,children:"شهرستان"}),u.jsx("th",{className:"green-cell",colSpan:2,children:"حجم کل بارهای ایجاد شده توسط کشتارگاه ( زنده)"}),u.jsx("th",{className:"green-cell",colSpan:2,children:"حجم کل بارهای تحویلی توسط کشتارگاه( زنده)"}),u.jsx("th",{className:"strong-blue-cell",rowSpan:2,colSpan:1,children:"وزن تحویلی با افت 25%"}),u.jsxs("th",{className:"strong-blue-cell",rowSpan:2,colSpan:1,children:["درصد حجم بار ایجاد شده به تحویلی"," "]}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"ورودی به انبار کشتارگاه(لاشه)"}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"درصد لاشه ورودی به انبار کشتارگاه نسبت به بارتحویلی کشتارگاه (با افت 25 %)"}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"خرید خارج از استان"}),u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"جمع کل انبار"})," ",u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"توزیع شده"})," ",u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"توزیع/تحویل شده"})," ",u.jsx("th",{className:"strong-blue-cell",colSpan:2,children:"مانده انبار"}),u.jsx("th",{className:"strong-blue-cell",colSpan:1,rowSpan:2,children:"درصد وزن مانده در انبار به ورودی انبار"}),u.jsx("th",{className:"strong-blue-cell",colSpan:1,rowSpan:2,children:"تعداد مباشر/ صنف"}),u.jsx("th",{className:"strong-blue-cell",colSpan:3,children:"بارهای تخلیه شده و عدم تکمیل(تحویل)"})," "]}),u.jsxs("tr",{children:[u.jsx("th",{className:"centered-cell yellow-cell",children:"حجم"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"حجم"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"حجم"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"حجم"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"حجم"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"حجم"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"حجم"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"حجم"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"حجم"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"تعداد بار"}),u.jsx("th",{className:"centered-cell yellow-cell",children:"حجم بار "}),u.jsx("th",{className:"centered-cell yellow-cell",children:"وزن بار "})]})]}),u.jsx("tbody",{children:(qu=e==null?void 0:e.killRequestAndBroadcast)==null?void 0:qu.map((d,Wu)=>{var Iu,Bu,_u,Ku,Ou,Pu,$u,Mu,Qu,Gu,Yu,zu,Uu,Vu,Xu,Ju,Zu,Du,Tu,mu,u6,e6,l6,t6,r6;return u.jsxs("tr",{className:"row-of-table",children:[u.jsx("td",{className:"centered-cell detail-cell",children:Wu+1}),u.jsx("td",{className:"centered-cell detail-cell",children:d==null?void 0:d.name}),u.jsx("td",{className:"centered-cell detail-cell",children:d==null?void 0:d.city}),u.jsx("td",{className:"centered-cell detail-cell",children:(Iu=d==null?void 0:d.killReqQuantity)==null?void 0:Iu.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(Bu=d==null?void 0:d.killReqWeight)==null?void 0:Bu.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(_u=d==null?void 0:d.quantityReceiver)==null?void 0:_u.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(Ku=d==null?void 0:d.weightReceiver)==null?void 0:Ku.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(Ou=d==null?void 0:d.twentyFivePercentWeight)==null?void 0:Ou.toLocaleString()}),u.jsxs("td",{className:"centered-cell detail-cell",children:["%",parseInt((Pu=d==null?void 0:d.receiverPercent)==null?void 0:Pu.toLocaleString())]}),u.jsx("td",{className:"centered-cell detail-cell",children:($u=d==null?void 0:d.quantityOfCarcasses)==null?void 0:$u.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(Mu=d==null?void 0:d.weightOfCarcasses)==null?void 0:Mu.toLocaleString()}),u.jsxs("td",{className:"centered-cell detail-cell",children:["%",parseInt((Qu=d==null?void 0:d.quantityOfLashePercent)==null?void 0:Qu.toLocaleString())]}),u.jsxs("td",{className:"centered-cell detail-cell",children:["%",parseInt((Gu=d==null?void 0:d.weightOfLashePercent)==null?void 0:Gu.toLocaleString())]}),u.jsx("td",{className:"centered-cell detail-cell",children:(Yu=d==null?void 0:d.quantityOutProvince)==null?void 0:Yu.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(zu=d==null?void 0:d.weightOutProvince)==null?void 0:zu.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(Uu=d==null?void 0:d.totalNumberOfCarcasses)==null?void 0:Uu.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(Vu=d==null?void 0:d.totalWeightOfCarcasses)==null?void 0:Vu.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(Xu=d==null?void 0:d.allocatedQuantity)==null?void 0:Xu.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(Ju=d==null?void 0:d.allocatedWeight)==null?void 0:Ju.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(Zu=d==null?void 0:d.acceptedAllocatedQuantity)==null?void 0:Zu.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(Du=d==null?void 0:d.acceptedAllocatedWeight)==null?void 0:Du.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(Tu=d==null?void 0:d.remainQuantity)==null?void 0:Tu.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(mu=d==null?void 0:d.remainWeight)==null?void 0:mu.toLocaleString()}),u.jsxs("td",{className:"centered-cell detail-cell",children:["%",parseInt((u6=d==null?void 0:d.remainPercent)==null?void 0:u6.toLocaleString())]}),u.jsx("td",{className:"centered-cell detail-cell",children:(e6=d==null?void 0:d.stewardAndGuild)==null?void 0:e6.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(l6=d==null?void 0:d.lenKillReqNotComplete)==null?void 0:l6.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(t6=d==null?void 0:d.quantityKillReqNotComplete)==null?void 0:t6.toLocaleString()}),u.jsx("td",{className:"centered-cell detail-cell",children:(r6=d==null?void 0:d.weightKillReqNotComplete)==null?void 0:r6.toLocaleString()})]},Wu)})})]})})]})},il=()=>{const[n,a]=P.useState("new"),s=(o,l)=>{l&&a(l)};return u.jsxs(y,{container:!0,direction:"column",mt:z.MEDIUM,xs:12,justifyContent:"center",children:[u.jsx(y,{contaienr:!0,justifyContent:"end",mb:z.SMALL,children:u.jsxs(y,{container:!0,alignItems:"center",gap:z.SMALL,children:[u.jsx(p,{children:"نمایش بصورت: "}),u.jsxs(Ye,{color:"primary",value:n,exclusive:!0,onChange:s,children:[u.jsx(n6,{value:"new",children:"پرونده ای"}),u.jsx(n6,{value:"contradictions",children:"گزارش مغایرت"}),u.jsx(n6,{value:"atlas",children:"با جزئیات"}),u.jsx(n6,{value:"killdetail",children:"جزئیات کشتار و پخش"}),u.jsx(n6,{value:"killhouseSurveillance",children:"جزئیات پایش کشتارگاه"})]})]})}),u.jsxs(y,{container:!0,xs:12,children:[n==="atlas"&&u.jsx(rl,{}),n==="new"&&u.jsx(ll,{}),n==="contradictions"&&u.jsx(hl,{}),n==="killdetail"&&u.jsx(Cl,{}),n==="killhouseSurveillance"&&u.jsx(xl,{})]})]})},Hl=()=>u.jsx(u.Fragment,{children:u.jsx(ze,{display:"flex",justifyContent:"center",children:u.jsx(y,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsx(y,{container:!0,justifyContent:"space-between",gap:z.SMALL,children:u.jsx(y,{xs:12,children:u.jsx(il,{})})})})})});export{Hl as default}; diff --git a/build/assets/FilterAlt-scT0HEUg.js b/build/assets/FilterAlt-scT0HEUg.js new file mode 100644 index 0000000..3395d51 --- /dev/null +++ b/build/assets/FilterAlt-scT0HEUg.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},i=r;Object.defineProperty(e,"__esModule",{value:!0});var o=e.default=void 0,u=i(a()),l=t;o=e.default=(0,u.default)((0,l.jsx)("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61"}),"FilterAlt");export{o as d}; diff --git a/build/assets/GeneralDashboard-C-xEqVw5.js b/build/assets/GeneralDashboard-C-xEqVw5.js new file mode 100644 index 0000000..7ec3f1e --- /dev/null +++ b/build/assets/GeneralDashboard-C-xEqVw5.js @@ -0,0 +1,17 @@ +import{i as b0,j as u,ak as y,B as G,p as Mu,$ as v0,b as v,a9 as y0,T as N,I as su,a3 as g,am as Q,al as _u,ar as ou,b6 as Ku,cr as Eu,cs as au,ct as f0,cu as Pu,cv as F0,cw as E0,ag as w0,av as S0,aw as k0,ax as b,aa as L0,aI as B,aJ as W,d as wu,cx as I0,cy as zu}from"./mui-vendor-CkIVaoQP.js";import{r as _0,j as q,A as du,u as ju,c as gu,b as lu,M as R,G as a,S as C,W as R0,v as N0,L as I,g as xu,h as F,N as $,k6 as B0,p as O0,m as Ru,$ as Ju,k7 as cu,k8 as Yu,k9 as Zu,ka as Qu,kb as Xu,kc as u0,kd as e0,ke as n0,kf as r0,kg as t0,kh as a0,ki as s0,kj as o0,kk as l0,kl as D0,km as Nu,fl as Bu,kn as pu,ko as Ou,kp as Du,kq as Tu,Q as T0,kr as M0,ks as H0,kt as P0,ku as z0,kv as U0,kw as V0,kx as W0,ky as G0,fC as $0,kz as q0,kA as K0,kB as J0,kC as Su,kD as ku,V as hu,kE as Y0,hL as Lu,kF as P,kG as z,kH as Uu}from"./index-CeyyVc1v.js";import{b as Z,r as m,f as i0,u as Z0}from"./react-vendor-CmFgShSM.js";import{d as iu}from"./Edit-CqBj1Y2L.js";import{d as Iu}from"./Person-Q1IHBezR.js";import{d as Q0}from"./Phone-Dv2y8iMM.js";import{d as Vu}from"./Badge-u1S44abW.js";import{d as X0,a as Wu}from"./Cake-CkaTUHNX.js";import{a as X,u as E,f as L}from"./redux-vendor-B7uoacJt.js";import{I as u6,f as e6}from"./toBase64-BzgTOHsW.js";import{d as mu}from"./Save-nlxmeU5w.js";import{s as n6,a as r6}from"./slaughter-get-provinces-CSWL-EuK.js";import{N as Gu}from"./NavLink-D2GD_ItM.js";import{S as O}from"./SimpleTable-DBAoNnCU.js";import{B as t6}from"./BackButton-Crzr7NMa.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./Delete-C5MyLelE.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";var Hu={},a6=b0;Object.defineProperty(Hu,"__esModule",{value:!0});var c0=Hu.default=void 0,s6=a6(_0()),o6=u;c0=Hu.default=(0,s6.default)((0,o6.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1z"}),"Lock");const l6=X("CHANGE_PROFILE_INFO",async e=>{const{data:n,status:t}=await q.put("system_user_profile/0/",e);return{data:n,status:t}}),i6=X("CHANGE_PROFILE_FACTOR_INFO",async e=>{const{data:n,status:t}=await q.put("system_user_profile-for-factor/0/",e);return{data:n,status:t}}),d0=({user:e})=>{const[n,t]=Z.useState([]),[r,c]=Z.useState(),[h]=m.useContext(du),p=j=>{var i;j[0]&&c(e6((i=j[0])==null?void 0:i.data_url)),t(j)},o=E(),l=ju({initialValues:{firstname:e.firstName?e.firstName:"",lastname:e.lastName?e.lastName:"",natioanlId:e.nationalId?e.nationalId:"",natioanlCode:e.nationalCode?e.nationalCode:"",birthday:e.birthday?new Date(e.birthday):Date()},validationSchema:gu({firstname:R().typeError("لطفا فیلد را به درستی وارد کنید.!"),lastname:R().typeError("لطفا فیلد را به درستی وارد کنید.!"),natioanlId:lu().typeError("لطفا فیلد را به صورت عددی وارد کنید!"),natioanlCode:lu().typeError("لطفا فیلد را به صورت عددی وارد کنید!")})});return m.useEffect(()=>{l.validateForm()},[]),u.jsxs(a,{container:!0,gap:C.SMALL,direction:"column",justifyContent:"space-between",children:[u.jsxs(a,{container:!0,direction:"column",gap:C.SMALL,children:[u.jsx(a,{children:u.jsx(y,{id:"firstname",label:"نام",variant:"outlined",sx:{width:"100%",height:"100%"},value:l.values.firstname,error:l.touched.firstname?!!l.errors.firstname:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.firstname&&l.errors.firstname?l.errors.firstname:null})}),u.jsx(a,{children:u.jsx(y,{id:"lastname",label:"نام خانوادگی",variant:"outlined",sx:{width:"100%",height:"100%"},value:l.values.lastname,error:l.touched.lastname?!!l.errors.lastname:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.lastname&&l.errors.lastname?l.errors.lastname:null})}),u.jsx(a,{children:u.jsx(y,{id:"natioanlId",label:"کد ملی",variant:"outlined",sx:{width:"100%",height:"100%"},value:l.values.natioanlId,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.natioanlId?!!l.errors.natioanlId:null,helperText:l.touched.natioanlId&&l.errors.natioanlId?l.errors.natioanlId:null})}),u.jsx(a,{children:u.jsx(y,{id:"natioanlCode",label:"شماره شناسنامه",variant:"outlined",sx:{width:"100%",height:"100%"},value:l.values.natioanlCode,error:l.touched.natioanlCode?!!l.errors.natioanlCode:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.natioanlCode&&l.errors.natioanlCode?l.errors.natioanlCode:null})}),u.jsx(a,{display:"contents",children:u.jsx(R0,{fullWidth:!0,label:"تاریخ تولد",id:"birthday",renderInput:j=>u.jsx(y,{...j}),value:l.values.birthday,error:l.touched.birthday?!!l.errors.birthday:null,onChange:j=>{const i=new Date(j);l.setFieldValue("birthday",i)},onBlur:l.handleBlur,helperText:l.touched.birthday&&l.errors.birthday?l.errors.birthday:null})}),u.jsx(a,{children:u.jsx(u6,{onChange:p,images:n,maxNumber:1,title:"عکس پروفایل"})})]}),u.jsx(a,{children:u.jsx(G,{fullWidth:!0,variant:"contained",disabled:!l.isValid,onClick:()=>{const j=N0(new Date(l.values.birthday)).format("YYYY-MM-DD hh:mm:ss");l.values.firstname||l.values.lastname||l.values.natioanlCode||l.values.natioanlId||r?(o(I()),o(l6({type:"self_profile",fullname:l.values.firstname+" "+l.values.lastname,first_name:l.values.firstname?l.values.firstname:null,last_name:l.values.lastname?l.values.lastname:null,national_code:l.values.natioanlCode?l.values.natioanlCode:null,national_id:l.values.natioanlId?l.values.natioanlId:null,birthday:j,image:r||"",person_type:"self"})).then(i=>{i.error?h({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(o(xu()),o(F()),o($({right:!1,bottom:!1,content:null})),h({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})),o(F())})):h({vertical:"top",horizontal:"center",msg:"لطفا حداقل یکی از موارد را تغییر دهید.",severity:"error"})},children:"ثبت اطلاعات"})})]})};d0.propTypes={user:Mu.PropTypes.any};const c6=()=>{const[e]=m.useContext(du),{userProfile:n}=L(c=>c.userSlice),t=E(),r=ju({initialValues:{lastPassword:"",newPassword:"",renewPassword:""},validationSchema:gu({lastPassword:R().required("این فیلد اجباری است!").typeError("لطفا رمز را وارد کنید!"),newPassword:R().required("این فیلد اجباری است!").typeError("لطفا رمز را وارد کنید!"),renewPassword:R().required("این فیلد اجباری است!").typeError("لطفا رمز را وارد کنید!")})});return u.jsx(a,{container:!0,direction:"column",flex:"1",justifyContent:"space-between",gap:C.SMALL,children:u.jsxs(a,{container:!0,direction:"column",gap:C.SMALL,children:[u.jsx(a,{children:u.jsx(y,{fullWidth:!0,id:"lastPassword",value:r.values.lastPassword,error:r.touched.lastPassword?!!r.errors.lastPassword:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.lastPassword&&r.errors.lastPassword?r.errors.lastPassword:null,label:"رمز قبلی",type:"password",autoComplete:"current-password",variant:"outlined"})}),u.jsx(a,{children:u.jsx(y,{fullWidth:!0,id:"newPassword",value:r.values.newPassword,error:r.touched.newPassword?!!r.errors.newPassword:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.newPassword&&r.errors.newPassword?r.errors.newPassword:null,label:"رمز جدید",type:"password",autoComplete:"current-password",variant:"outlined"})}),u.jsx(a,{children:u.jsx(y,{fullWidth:!0,id:"renewPassword",value:r.values.renewPassword,error:r.touched.renewPassword?!!r.errors.renewPassword:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.renewPassword&&r.errors.renewPassword?r.errors.renewPassword:null,label:"تکرار رمز جدید",type:"password",autoComplete:"current-password",variant:"outlined"})}),u.jsx(a,{children:u.jsx(G,{fullWidth:!0,size:"large",variant:"contained",startIcon:u.jsx(mu,{}),onClick:()=>{t(B0({username:n.mobile,password:r.values.newPassword})).then(c=>{c.error?e({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(e({vertical:"top",horizontal:"center",msg:"رمزعبور با موفقیت تغییر یافت!",severity:"success"}),t($({right:!1,bottom:!1,content:null})))})},children:"ذخیره تغییرات"})})]})})},d6={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{duration:.5}}},C6=()=>{var D,V;const{userProfile:e}=L(x=>x.userSlice),n=E(),t=v0(),[r,c]=m.useState([]),[h,p]=m.useState([]),[o]=m.useContext(du),l=()=>{n(xu())};m.useEffect(()=>{l()},[n]);const j=gu({nationalId:R().required("شناسه ملی الزامی است"),registrationNumber:R().required("شماره ثبت الزامی است"),economicalCode:R().required("کد اقتصادی الزامی است"),address:R().required("نشانی الزامی است"),unitName:R().required("نام واحد الزامی است"),postalCode:R().matches(/^[0-9]{10}$/,"کد پستی باید 10 رقم باشد").required("کد پستی الزامی است"),province:R().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),city:R().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!")}),i=ju({initialValues:{nationalId:(e==null?void 0:e.unitNationalId)||"",registrationNumber:(e==null?void 0:e.unitRegistrationNumber)||"",address:(e==null?void 0:e.unitAddress)||"",postalCode:(e==null?void 0:e.unitPostalCode)||"",economicalCode:(e==null?void 0:e.unitEconomicalNumber)||"",unitName:(e==null?void 0:e.unitName)||"",province:(e==null?void 0:e.unitProvince)||"",city:(e==null?void 0:e.unitCity)||""},validationSchema:j,onSubmit:x=>{n(I()),n(i6({userprofile_key:e==null?void 0:e.key,unit_name:x.unitName,unit_national_id:x.nationalId,unit_registration_number:x.registrationNumber,unit_province:x.province,unit_city:x.city,unit_postal_code:x.postalCode,unit_address:x.address,unit_economical_number:x.economicalCode})).then(S=>{S.error?o({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(n(xu()),n(F()),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})),n(F())})}});m.useEffect(()=>{n(n6()).then(x=>{c(x.payload.data)})},[]),m.useEffect(()=>{i.values.province&&p([],n(r6(i.values.province)).then(x=>{p(x.payload.data)}))},[i.values.province]),m.useEffect(()=>{i.validateForm()},[n,e]);const H=[{icon:u.jsx(Iu,{color:"primary"}),label:"نام و نام خانوادگی",value:(e==null?void 0:e.fullname)||"نامشخص"},{icon:u.jsx(Q0,{color:"secondary"}),label:"موبایل",value:(e==null?void 0:e.mobile)||"نامشخص"},{icon:u.jsx(Vu,{color:"error"}),label:"کدملی",value:(e==null?void 0:e.nationalId)||"نامشخص"},{icon:u.jsx(Vu,{color:"info"}),label:"شماره شناسنامه",value:(e==null?void 0:e.nationalCode)||"نامشخص"},{icon:u.jsx(X0,{color:"success"}),label:"تاریخ تولد",value:e!=null&&e.birthday?O0(e==null?void 0:e.birthday):"نامشخص"},{icon:u.jsx(Wu,{color:"warning"}),label:"استان",value:(e==null?void 0:e.province)||"نامشخص"},{icon:u.jsx(Wu,{color:"warning"}),label:"شهر",value:(e==null?void 0:e.city)||"نامشخص"}];return u.jsx(v,{display:"flex",flexDirection:"column",gap:1,sx:{width:"100%",padding:1},children:u.jsx(Ru.div,{initial:"hidden",animate:"visible",variants:d6,style:{width:"100%"},children:u.jsxs(y0,{elevation:4,sx:{padding:2,borderRadius:3,bgcolor:t.palette.background.paper},children:[u.jsxs(v,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1,children:[u.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[u.jsx(Iu,{color:"primary"}),u.jsx(N,{variant:"subtitle2",fontWeight:"bold",color:"primary",children:"اطلاعات کاربری"})]}),u.jsx(su,{color:"primary",size:"small",onClick:()=>{n($({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(d0,{user:e}),title:"ویرایش اطلاعات کاربری"}))},children:u.jsx(iu,{})})]}),u.jsx(g,{container:!0,spacing:1,children:H.map((x,S)=>u.jsx(g,{item:!0,xs:12,sm:4,md:3,children:u.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[x.icon,u.jsxs(v,{children:[u.jsx(N,{variant:"body2",fontWeight:"500",color:"text.secondary",children:x.label}),u.jsx(N,{variant:"body2",fontWeight:"600",color:"text.primary",children:x.value})]})]})},S))}),u.jsx(Q,{sx:{marginY:2}}),(((D=e==null?void 0:e.role)==null?void 0:D.includes("ProvinceOperator"))||((V=e==null?void 0:e.role)==null?void 0:V.includes("KillHouse")))&&u.jsxs(u.Fragment,{children:[u.jsx(v,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,children:u.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[u.jsx(Iu,{color:"primary"}),u.jsx(N,{variant:"subtitle2",fontWeight:"bold",color:"primary",children:"اطلاعات صدور فاکتور"})]})}),u.jsx("form",{onSubmit:i.handleSubmit,children:u.jsxs(g,{container:!0,spacing:2,alignItems:"center",children:[u.jsx(g,{item:!0,xs:12,sm:4,children:u.jsx(y,{size:"small",fullWidth:!0,label:"نام واحد",name:"unitName",value:i.values.unitName,onChange:i.handleChange,onBlur:i.handleBlur,error:i.touched.unitName&&!!i.errors.unitName,helperText:i.touched.unitName&&i.errors.unitName})}),u.jsx(g,{item:!0,xs:12,sm:4,children:u.jsx(y,{size:"small",fullWidth:!0,label:"شناسه ملی",name:"nationalId",value:i.values.nationalId,onChange:i.handleChange,onBlur:i.handleBlur,error:i.touched.nationalId&&!!i.errors.nationalId,helperText:i.touched.nationalId&&i.errors.nationalId})}),u.jsx(g,{item:!0,xs:12,sm:4,children:u.jsx(y,{size:"small",fullWidth:!0,label:"شماره ثبت",name:"registrationNumber",value:i.values.registrationNumber,onChange:i.handleChange,onBlur:i.handleBlur,error:i.touched.registrationNumber&&!!i.errors.registrationNumber,helperText:i.touched.registrationNumber&&i.errors.registrationNumber})}),u.jsx(g,{item:!0,xs:12,sm:4,children:u.jsx(y,{size:"small",fullWidth:!0,label:"کد اقتصادی",name:"economicalCode",value:i.values.economicalCode,onChange:i.handleChange,onBlur:i.handleBlur,error:i.touched.economicalCode&&!!i.errors.economicalCode,helperText:i.touched.economicalCode&&i.errors.economicalCode})}),u.jsx(g,{item:!0,xs:12,sm:4,children:u.jsx(y,{size:"small",fullWidth:!0,label:"کد پستی",name:"postalCode",value:i.values.postalCode,onChange:i.handleChange,onBlur:i.handleBlur,error:i.touched.postalCode&&!!i.errors.postalCode,helperText:i.touched.postalCode&&i.errors.postalCode})}),u.jsx(g,{item:!0,xs:12,sm:4,children:u.jsx(y,{size:"small",fullWidth:!0,label:"نشانی",name:"address",value:i.values.address,onChange:i.handleChange,onBlur:i.handleBlur,error:i.touched.address&&!!i.errors.address,helperText:i.touched.address&&i.errors.address})}),u.jsx(g,{item:!0,xs:12,sm:4,children:u.jsx(_u,{size:"small",style:{width:"100%"},disablePortal:!0,id:"province",options:r?r.map(x=>({id:x.name,label:x.name})):[],onChange:(x,S)=>{i.setFieldValue("province",S?S.id:""),i.setFieldValue("city","")},renderInput:x=>u.jsx(y,{...x,label:e!=null&&e.unitProvince?`استان ${e==null?void 0:e.unitProvince}`:"استان را انتخاب کنید"})})}),u.jsx(g,{item:!0,xs:12,sm:4,children:u.jsx(_u,{size:"small",minWidth:210,style:{width:"100%"},disabled:!i.values.province,disablePortal:!0,id:"city",options:h?h.map(x=>({id:x.name,label:x.name})):[],onChange:(x,S)=>{i.setFieldValue("city",S?S.id:"")},renderInput:x=>u.jsx(y,{...x,label:e!=null&&e.unitCity?`شهر ${e==null?void 0:e.unitCity}`:"شهر را انتخاب کنید"})})}),u.jsx(g,{item:!0,container:!0,xs:12,sm:4,children:u.jsx(G,{disabled:!i.isValid,type:"submit",variant:"contained",color:"primary",children:"ثبت"})})]})})]}),u.jsxs(v,{display:"flex",justifyContent:"space-between",alignItems:"center",mt:2,children:[u.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[u.jsx(c0,{color:"secondary"}),u.jsx(N,{variant:"subtitle2",fontWeight:"bold",color:"secondary",children:"تغییر رمز عبور"})]}),u.jsx(su,{color:"secondary",size:"small",onClick:()=>{n($({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"تغییر رمز عبور",content:u.jsx(c6,{})}))},children:u.jsx(iu,{})})]})]})})})},h6={General:{path:cu,label:"کاربری",icon:u.jsx(Ku,{})},CityOperator:{path:l0,label:"شهرستان",icon:u.jsx(Eu,{})},Poultry:{path:o0,label:"مرغداری",icon:u.jsx(E0,{})},ProvinceOperator:{path:s0,label:"تخصیص استان",icon:u.jsx(Pu,{})},KillHouse:{path:a0,label:"کشتارگاه",icon:u.jsx(au,{})},VetFarm:{path:t0,label:"دامپزشک فارم",icon:u.jsx(au,{})},KillHouseVet:{path:r0,label:"دامپزشک کشتارگاه",icon:u.jsx(au,{})},Driver:{path:n0,label:"راننده",icon:u.jsx(F0,{})},ProvinceFinancial:{path:e0,label:"مالی",icon:u.jsx(Pu,{})},ProvinceInspector:{path:u0,label:"بازرس",icon:u.jsx(f0,{})},Guilds:{path:Xu,label:"صنف",icon:u.jsx(Eu,{})},CityVet:{path:Qu,label:"دامپزشک شهرستان",icon:u.jsx(au,{})},LiveStockSupport:{path:Zu,label:"پشتیبانی امور دام",icon:u.jsx(au,{})},ChainCompany:{path:Yu,label:"شرکت زنجیره",icon:u.jsx(Eu,{})}},x6=()=>{const{pathname:e}=i0(),[n]=Ju();return u.jsx(v,{p:C.SMALL,display:"flex",flexDirection:"column",children:u.jsxs(a,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:1,direction:{xs:"column",md:"row"},children:[u.jsx(Q,{sx:{width:"100%"},children:u.jsx(ou,{label:u.jsx(N,{variant:"h6",sx:{fontSize:"18px",color:"darkcyan"},children:"نقش ها"})})}),u.jsx(Ru.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.2},children:u.jsx(Gu,{to:cu,active:e===cu||e==="/"?"true":null,style:{textDecoration:"none"},children:u.jsx(G,{variant:"outlined",color:"primary",fullWidth:!0,startIcon:u.jsx(Ku,{}),sx:{borderRadius:3,padding:"4px 8px"},children:"حساب کاربری"})})}),n.map((t,r)=>{const c=h6[t];return c?u.jsx(Ru.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,delay:r*.1},children:u.jsx(Gu,{to:c.path,active:e===c.path?"true":null,style:{textDecoration:"none"},children:u.jsx(G,{variant:"outlined",fullWidth:!0,size:"small",startIcon:c.icon,sx:{borderRadius:3,padding:"4px 8px",color:"gray"},children:c.label})})},t+r):null})]})})},p6=X("CHANGE_BANK_FORM",async e=>{const n=window.location.pathname.split("/")[3],{data:t,status:r}=await q.post(`user-bank_card/?role=${D0(n)}`,e);return{data:t,status:r}}),m6=X("UPDATE_BANK_FORM",async e=>{const{data:n,status:t}=await q.put("user-bank_card/0/",e);return{data:n,status:t}}),C0=({item:e})=>{var c,h,p,o,l;const[n]=m.useContext(du),t=E(),r=ju({initialValues:{bankName:(c=e==null?void 0:e.userBankInfo)==null?void 0:c.bankName,cardNumber:(h=e==null?void 0:e.userBankInfo)==null?void 0:h.card,accountNumber:(p=e==null?void 0:e.userBankInfo)==null?void 0:p.account,shabaNumber:(o=e==null?void 0:e.userBankInfo)==null?void 0:o.shaba,accountHolder:(l=e==null?void 0:e.userBankInfo)==null?void 0:l.nameOfBankUser},validationSchema:gu({cardNumber:lu().required("این فیلد اجباری است!").typeError("لطفا شماره کارتتان را وارد کنید!"),accountNumber:lu().required("این فیلد اجباری است!").typeError("لطفا شماره حسابتان را وارد کنید!"),shabaNumber:lu().required("این فیلد اجباری است!").typeError("لطفا شماره شبا را وارد کنید!"),accountHolder:R().required("این فیلد اجباری است!").typeError("لطفا نام صاحب حساب را وارد کنید!")})});return u.jsx(a,{container:!0,gap:C.SMALL,direction:"column",display:"flex",children:u.jsxs(a,{container:!0,gap:C.SMALL,direction:"column",children:[u.jsx(a,{children:u.jsxs(w0,{fullWidth:!0,children:[u.jsx(S0,{id:"demo-simple-select-label",children:"بانک"}),u.jsxs(k0,{fullWidth:!0,value:r.values.bankName,id:"bankName",label:"بانک",onChange:j=>{r.setFieldValue("bankName",j.target.value)},children:[u.jsx(b,{value:"موسسه افضل توس",children:"موسسه افضل توس"}),u.jsx(b,{value:"انصار",children:"انصار"}),u.jsx(b,{value:"سپه",children:"سپه"}),u.jsx(b,{value:"دی",children:"دی"}),u.jsx(b,{value:"کاب",children:"اقتصاد نوین"}),u.jsx(b,{value:"گردشگری",children:"گردشگری"}),u.jsx(b,{value:"حکمت ایرانیان",children:"حکمت ایرانیان"}),u.jsx(b,{value:"ایران زمین",children:"ایران زمین"}),u.jsx(b,{value:"کشاورزی",children:"کشاورزی"}),u.jsx(b,{value:"مسکن",children:"مسکن"}),u.jsx(b,{value:"مهر ایران",children:"مهر ایران"}),u.jsx(b,{value:"مهر اقتصاد",children:"مهر اقتصاد"}),u.jsx(b,{value:"ملت",children:"ملت"}),u.jsx(b,{value:"ملی",children:"ملی"}),u.jsx(b,{value:"پارسیان",children:"پارسیان"}),u.jsx(b,{value:"پاسارگاد",children:"پاسارگاد"}),u.jsx(b,{value:"پست بانک ایران",children:"پست بانک ایران"}),u.jsx(b,{value:"صادرات",children:"صادرات"}),u.jsx(b,{value:"سامان",children:"سامان"}),u.jsx(b,{value:"صنعت و معدن",children:"صنعت و معدن"}),u.jsx(b,{value:"سرمایه",children:"سرمایه"}),u.jsx(b,{value:"شهر",children:"شهر"}),u.jsx(b,{value:"سینا",children:"سینا"}),u.jsx(b,{value:"تجارت",children:"تجارت"}),u.jsx(b,{value:"موسسه اعتباری توسعه",children:"موسسه اعتباری توسعه"}),u.jsx(b,{value:"خاورمیانه",children:"خاورمیانه"})]})]})}),u.jsx(a,{children:u.jsx(y,{fullWidth:!0,id:"cardNumber",label:"شماره کارت",value:r.values.cardNumber,error:r.touched.cardNumber?!!r.errors.cardNumber:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.cardNumber&&r.errors.cardNumber?r.errors.cardNumber:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(a,{children:u.jsx(y,{fullWidth:!0,id:"accountNumber",label:"شماره حساب",value:r.values.accountNumber,error:r.touched.accountNumber?!!r.errors.accountNumber:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.accountNumber&&r.errors.accountNumber?r.errors.accountNumber:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(a,{children:u.jsx(y,{fullWidth:!0,id:"shabaNumber",label:"شماره شبا",value:r.values.shabaNumber,error:r.touched.shabaNumber?!!r.errors.shabaNumber:null,InputProps:{endAdornment:u.jsx(L0,{position:"end",children:"IR"})},onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.shabaNumber&&r.errors.shabaNumber?r.errors.shabaNumber:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(a,{children:u.jsx(y,{fullWidth:!0,id:"accountHolder",label:"نام صاحب حساب",value:r.values.accountHolder,error:r.touched.accountHolder?!!r.errors.accountHolder:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.accountHolder&&r.errors.accountHolder?r.errors.accountHolder:null,variant:"outlined"})}),u.jsx(a,{children:u.jsx(G,{onClick:()=>{t(I()),e.userBankInfo?t(m6({name_of_bank_user:r.values.accountHolder,bank_name:r.values.bankName,card:r.values.cardNumber,shaba:r.values.shabaNumber,account:r.values.accountNumber,key:e.userBankInfo.key})).then(j=>{t(F()),j.error?n({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(t(Nu()),t(Bu()),t(pu()),t(Ou()),t(Du()),t(Tu()),t($({right:!1,bottom:!1,content:null})),n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}):t(p6({name_of_bank_user:r.values.accountHolder,bank_name:r.values.bankName,card:r.values.cardNumber,shaba:r.values.shabaNumber,account:r.values.accountNumber,key:e.key?e.key:null})).then(j=>{t(F()),j.error?n({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(t(Nu()),t(Bu()),t(pu()),t(Ou()),t(Du()),t(Tu()),t($({right:!1,bottom:!1,content:null})),n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},fullWidth:!0,size:"large",variant:"contained",startIcon:u.jsx(mu,{}),children:"ذخیره تغییرات"})})]})})};C0.propTypes={item:Mu.PropTypes.object};const U=({item:e})=>{var t,r,c,h,p;const n=E();return u.jsxs(a,{container:!0,direction:"column",gap:C.SMALL,children:[u.jsx(a,{textAlign:"start",children:u.jsx(Q,{textAlign:"left",children:u.jsx(ou,{label:u.jsxs(a,{display:"flex",alignItems:"center",children:[u.jsx(N,{variant:"body2",children:"اطلاعات بانکی"}),u.jsx(G,{variant:"text",onClick:()=>{n($({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"تغییر اطلاعات بانکی",content:u.jsx(C0,{item:e})}))},children:"(ویرایش)"})]})})})}),u.jsx(a,{children:u.jsx(O,{columns:["نام بانک","نام صاحب حساب","شماره کارت","شماره حساب","شماره شبا"],data:[[(t=e==null?void 0:e.userBankInfo)==null?void 0:t.bankName,(r=e==null?void 0:e.userBankInfo)==null?void 0:r.nameOfBankUser,(c=e==null?void 0:e.userBankInfo)==null?void 0:c.card,Number((h=e==null?void 0:e.userBankInfo)==null?void 0:h.account),(p=e==null?void 0:e.userBankInfo)==null?void 0:p.shaba]]})})]})};U.propTypes={item:Mu.PropTypes.object};const j6=()=>{const{profile:e}=L(t=>t.citySlice),n=E();return m.useEffect(()=>{n(I()),n(Ou()).then(t=>{n(F())})},[]),u.jsx(B,{children:u.jsx(a,{container:!0,gap:C.LARGE,children:u.jsx(a,{container:!0,direction:"column",xs:12,children:u.jsx(a,{container:!0,direction:"column",justifyContent:"space-between",gap:C.SMALL,children:u.jsxs(u.Fragment,{children:[u.jsx(a,{children:u.jsx(O,{name:`اطلاعات شهرستان ${e==null?void 0:e.user.fullname}`,columns:["نام کامل","تلفن","آدرس","کد پستی"],data:[[e==null?void 0:e.user.fullname,e==null?void 0:e.user.mobile,e==null?void 0:e.address.address,e==null?void 0:e.address.postalCode]]})}),u.jsx(a,{children:u.jsx(U,{item:e})})]})})})})})},g6=()=>{const e=E(),{profile:n}=L(t=>t.provinceSlice);return m.useEffect(()=>{e(I()),e(pu()).then(t=>{e(F())})},[]),u.jsx(B,{children:u.jsx(a,{container:!0,gap:C.LARGE,children:u.jsx(a,{container:!0,direction:"column",xs:12,children:u.jsx(a,{container:!0,direction:"column",justifyContent:"space-between",gap:C.SMALL,children:u.jsx(u.Fragment,{children:u.jsx(a,{children:u.jsx(O,{name:`اطلاعات استان ${n==null?void 0:n.user.fullname}`,columns:["نام کامل","تلفن","آدرس","کد پستی"],data:[[n==null?void 0:n.user.fullname,n==null?void 0:n.user.mobile,n==null?void 0:n.address.address,n==null?void 0:n.address.postalCode]]})})})})})})})},A6=()=>{const{profile:e}=L(t=>t.vetFarmSlice),n=E();return m.useEffect(()=>{n(I()),n(Tu()).then(t=>{n(F())})},[]),u.jsx(B,{children:u.jsx(a,{container:!0,gap:C.LARGE,children:u.jsx(a,{container:!0,direction:"column",xs:12,children:u.jsx(a,{container:!0,direction:"column",justifyContent:"space-between",gap:C.SMALL,children:u.jsx(u.Fragment,{children:u.jsx(a,{children:u.jsx(U,{item:e==null?void 0:e.vet})})})})})})})},b6=()=>{const{profile:e}=L(r=>r.avicultureSlice),n=E();m.useEffect(()=>{n(I()),n(Nu()).then(r=>{n(F())})},[]);const t=e==null?void 0:e.aviculture;return u.jsx(B,{children:u.jsx(a,{container:!0,gap:C.LARGE,children:u.jsx(a,{container:!0,direction:"column",xs:12,children:u.jsx(a,{container:!0,direction:"column",justifyContent:"space-between",gap:C.SMALL,children:t==null?void 0:t.map((r,c)=>u.jsxs(u.Fragment,{children:[u.jsx(a,{children:u.jsx(O,{name:`اطلاعات مرغداری ${r.unitName}`,columns:["شناسه پرورش دهنده","آدرس","تعداد سالن ها","تعداد پارتی","تاریخ آخرین پارتی","کد سیستمی","کد اپیدمیولوژیک"],data:[[r.breedingUniqueId?r.breedingUniqueId:"نامشخص",`${r.address.province.name} - ${r.address.city.name} ${r.address.address?" - "+r.address.address:""}`,r.numberOfHalls,r.numberOfParty,T0(new Date(r==null?void 0:r.lastPartyDate),"yyyy/MM/dd"),r.systemCode,r.epidemiologicalCode]]},"avicultures"+c)}),u.jsx(a,{children:u.jsx(U,{item:r})})]}))})})})})},v6=()=>{var t,r,c,h;const{profile:e}=L(p=>p.driverSlice),n=E();return m.useEffect(()=>{n(I()),n(M0()).then(p=>{n(F())})},[]),u.jsx(B,{children:u.jsx(a,{container:!0,gap:C.LARGE,children:u.jsx(a,{container:!0,direction:"column",xs:12,children:u.jsx(a,{container:!0,direction:"column",justifyContent:"space-between",gap:C.SMALL,children:u.jsxs(u.Fragment,{children:[u.jsx(a,{children:u.jsx(O,{name:`اطلاعات شهرستان ${(t=e==null?void 0:e.user)==null?void 0:t.fullname}`,columns:["نام کامل","تلفن","کد ملی"],data:[[(r=e==null?void 0:e.user)==null?void 0:r.fullname,(c=e==null?void 0:e.user)==null?void 0:c.mobile,(h=e==null?void 0:e.address)==null?void 0:h.nationalId]]})}),u.jsx(a,{children:u.jsx(U,{item:e})})]})})})})})},y6=()=>{const{profile:e}=L(t=>t.inspectorSlice),n=E();return m.useEffect(()=>{n(I()),n(H0()).then(t=>{n(F())})},[]),u.jsx(B,{children:u.jsx(g,{container:!0,gap:C.LARGE,children:u.jsx(g,{container:!0,direction:"column",xs:12,children:u.jsx(g,{container:!0,direction:"column",justifyContent:"space-between",gap:C.SMALL,children:u.jsxs(u.Fragment,{children:[u.jsx(g,{children:u.jsx(O,{name:`اطلاعات بازرس ${e==null?void 0:e.inspector.user.fullname}`,columns:["نام کامل","تلفن","آدرس","کد پستی"],data:[[e==null?void 0:e.inspector.user.fullname,e==null?void 0:e.inspector.user.mobile,e==null?void 0:e.inspector.address.address,e==null?void 0:e.inspector.address.postalCode]]})}),u.jsx(g,{})]})})})})})},f6=()=>{var t;const{profile:e}=L(r=>r.slaughterSlice),n=E();return m.useEffect(()=>{n(I()),n(Bu()).then(r=>{n(F())})},[]),u.jsx(B,{children:u.jsx(a,{container:!0,gap:C.LARGE,children:u.jsx(a,{container:!0,direction:"column",xs:12,children:u.jsx(a,{container:!0,direction:"column",justifyContent:"space-between",gap:C.SMALL,children:u.jsxs(u.Fragment,{children:[(t=e==null?void 0:e.killHouse)==null?void 0:t.map(r=>u.jsx(a,{children:u.jsx(O,{name:`اطلاعات کشتارگاه ${r.name}`,columns:["نام کامل","تلفن","آدرس","ظرفیت","آدرس سیستمی"],data:[[r.name,r.phone,r.address,r.capacity,r.systemAddress.address]]})},r.name)),u.jsx(a,{children:u.jsx(U,{item:e==null?void 0:e.killHouseOperator})})]})})})})})},F6=()=>{var t,r,c,h,p;const e=E(),{profile:n}=L(o=>o.provinceSlice);return m.useEffect(()=>{e(I()),e(pu()).then(o=>{e(F())})},[]),u.jsx(B,{children:u.jsx(a,{container:!0,gap:C.LARGE,children:u.jsx(a,{container:!0,direction:"column",xs:12,children:u.jsx(a,{container:!0,direction:"column",justifyContent:"space-between",gap:C.SMALL,children:u.jsxs(u.Fragment,{children:[u.jsx(a,{children:u.jsx(O,{name:`اطلاعات مالی ${(t=n==null?void 0:n.user)==null?void 0:t.fullname}`,columns:["نام کامل","تلفن","آدرس","کد پستی"],data:[[(r=n==null?void 0:n.user)==null?void 0:r.fullname,(c=n==null?void 0:n.user)==null?void 0:c.mobile,(h=n==null?void 0:n.address)==null?void 0:h.address,(p=n==null?void 0:n.address)==null?void 0:p.postalCode]]})}),u.jsx(a,{children:u.jsx(U,{item:n})})]})})})})})},E6=()=>{var t,r,c,h,p,o,l,j,i,H,D,V,x,S;const e=E(),{profile:n}=L(Cu=>Cu.slaughterHouseVetSlice);return m.useEffect(()=>{e(I()),e(Du()).then(Cu=>{e(F())})},[]),u.jsx(B,{children:u.jsx(a,{container:!0,gap:C.LARGE,children:u.jsx(a,{container:!0,direction:"column",xs:12,children:u.jsx(a,{container:!0,direction:"column",justifyContent:"space-between",gap:C.SMALL,children:u.jsxs(u.Fragment,{children:[u.jsx(a,{children:u.jsx(O,{name:"اطلاعات کشتارگاه",columns:["نام کشتارگاه","استان","شهر","مالک کشتارگاه","شماره تماس"],data:[[(r=(t=n==null?void 0:n.killHouseVet)==null?void 0:t.killHouse)==null?void 0:r.name,(p=(h=(c=n==null?void 0:n.killHouseVet)==null?void 0:c.killHouse)==null?void 0:h.killHouseOperator)==null?void 0:p.address.province.name,(j=(l=(o=n==null?void 0:n.killHouseVet)==null?void 0:o.killHouse)==null?void 0:l.killHouseOperator)==null?void 0:j.address.city.name,(D=(H=(i=n==null?void 0:n.killHouseVet)==null?void 0:i.killHouse)==null?void 0:H.killHouseOperator)==null?void 0:D.user.fullname,(S=(x=(V=n==null?void 0:n.killHouseVet)==null?void 0:V.killHouse)==null?void 0:x.killHouseOperator)==null?void 0:S.user.mobile]]})}),u.jsx(a,{children:u.jsx(U,{item:n==null?void 0:n.vet})})]})})})})})},w6=()=>{var t,r;const{guildProfile:e}=L(c=>c.generalSlice),n=E();return m.useEffect(()=>{n(I()),n(P0()).then(c=>{n(F())})},[]),u.jsx(B,{children:u.jsx(a,{container:!0,gap:C.LARGE,children:u.jsx(a,{container:!0,direction:"column",xs:12,children:u.jsx(a,{container:!0,direction:"column",justifyContent:"space-between",gap:C.SMALL,children:u.jsx(u.Fragment,{children:u.jsx(a,{children:u.jsx(O,{name:"اطلاعات صنف",columns:["نام صنف","شناسه صنف","شماره مجوز","حوزه فعالیت","نوع فعالیت","محدودیت مباشر","محدودیت کشتارگاه"],data:[[e==null?void 0:e.guildsName,e==null?void 0:e.guildsId,e==null?void 0:e.licenseNumber,e==null?void 0:e.areaActivity,e==null?void 0:e.typeActivity,(t=e==null?void 0:e.centersAllocation)==null?void 0:t.map(c=>c.label).join(" - "),(r=e==null?void 0:e.killHouseCentersAllocation)==null?void 0:r.map(c=>c.label).join(" - ")]]})})})})})})})},S6=()=>{var t,r,c,h,p,o;const{cityVetGetProfile:e}=L(l=>l.generalSlice),n=E();return m.useEffect(()=>{n(I()),n(z0()).then(l=>{n(F())})},[]),u.jsx(B,{children:u.jsx(a,{container:!0,gap:C.LARGE,children:u.jsx(a,{container:!0,direction:"column",xs:12,children:u.jsx(a,{container:!0,direction:"column",justifyContent:"space-between",gap:C.SMALL,children:u.jsx(u.Fragment,{children:u.jsx(a,{children:u.jsx(O,{name:"اطلاعات دامپزشک فارم",columns:["نام","نام خانوداگی","استان","شهر","آدرس","کدپستی"],data:[[(t=e==null?void 0:e.user)==null?void 0:t.firstName,(r=e==null?void 0:e.user)==null?void 0:r.lastName,(c=e==null?void 0:e.address)==null?void 0:c.province.name,(h=e==null?void 0:e.address)==null?void 0:h.city.name,(p=e==null?void 0:e.address)==null?void 0:p.address,(o=e==null?void 0:e.address)==null?void 0:o.postalCode]]})})})})})})})},k6=X("LIVE_STOCK_PROFILE",async()=>{const{data:e,status:n}=await q.get("live_stock_support/0/?profile");return{data:e,status:n}}),L6=()=>{var r,c,h,p,o,l;const[e,n]=m.useState(),t=E();return m.useEffect(()=>{t(I()),t(k6()).then(j=>{n(j.payload.data),t(F())})},[]),u.jsx(v,{children:u.jsx(a,{container:!0,gap:C.LARGE,children:u.jsx(a,{container:!0,direction:"column",xs:12,children:u.jsx(a,{container:!0,direction:"column",justifyContent:"space-between",gap:C.SMALL,children:u.jsx(u.Fragment,{children:u.jsx(a,{children:u.jsx(O,{name:"اطلاعات پشتیبان امور دام",columns:["نام","نام خانوداگی","استان","شهر","آدرس","کدپستی"],data:[[(r=e==null?void 0:e.user)==null?void 0:r.firstName,(c=e==null?void 0:e.user)==null?void 0:c.lastName,(h=e==null?void 0:e.address)==null?void 0:h.province.name,(p=e==null?void 0:e.address)==null?void 0:p.city.name,(o=e==null?void 0:e.address)==null?void 0:o.address,(l=e==null?void 0:e.address)==null?void 0:l.postalCode]]})})})})})})})},I6=X("CHAIN_GET_PROFILE",async()=>{const{data:e,status:n}=await q.get("chain-company/0/?profile");return{data:e,status:n}}),_6=()=>{var r,c,h,p,o,l;const e=E(),[n,t]=m.useState();return m.useEffect(()=>{e(I()),e(I6()).then(j=>{t(j.payload.data),e(F())})},[]),u.jsx(B,{children:u.jsx(a,{container:!0,gap:C.LARGE,children:u.jsx(a,{container:!0,direction:"column",xs:12,children:u.jsx(a,{container:!0,direction:"column",justifyContent:"space-between",gap:C.SMALL,children:u.jsx(u.Fragment,{children:u.jsx(a,{children:u.jsx(O,{name:"اطلاعات شرکت زنجیره",columns:["نام","نام خانوداگی","استان","شهر","آدرس","کدپستی"],data:[[(r=n==null?void 0:n.user)==null?void 0:r.firstName,(c=n==null?void 0:n.user)==null?void 0:c.lastName,(h=n==null?void 0:n.address)==null?void 0:h.province.name,(p=n==null?void 0:n.address)==null?void 0:p.city.name,(o=n==null?void 0:n.address)==null?void 0:o.address,(l=n==null?void 0:n.address)==null?void 0:l.postalCode]]})})})})})})})},$u=e=>{switch(e){case"BarSquareProvinceJahad":return[{text:"دسترسی ها",icon:u.jsx($0,{}),route:U0,disabled:!0},{text:"بنک دارها",icon:u.jsx(q0,{}),route:V0,disabled:!0},{text:"تراکنش ها",icon:u.jsx(K0,{}),route:W0},{text:"صنوف",icon:u.jsx(J0,{}),route:G0,disabled:!0}];default:return[]}},h0="dashboard_usage_stats",R6=()=>{try{const e=localStorage.getItem(h0);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading usage stats:",e),{}}},N6=e=>{try{localStorage.setItem(h0,JSON.stringify(e))}catch(n){console.error("Error saving usage stats:",n)}},qu=(e,n)=>{const t=R6();t[e]||(t[e]={}),t[e][n]=(t[e][n]||0)+1,N6(t)},x0="dashboard_custom_order",p0=()=>{try{const e=localStorage.getItem(x0);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading custom orders:",e),{}}},B6=e=>{try{localStorage.setItem(x0,JSON.stringify(e))}catch(n){console.error("Error saving custom orders:",n)}},O6=e=>p0()[e]||null,D6=(e,n)=>{const t=p0(),r=n.map(c=>c.route);t[e]=r,B6(t)},T6=(e,n)=>{if(!e||!Array.isArray(e))return e;const t=O6(n);if(!t||t.length===0)return e;const r=[],c=[...e];for(const h of t){const p=c.findIndex(o=>o.route===h);p!==-1&&(r.push(c[p]),c.splice(p,1))}return r.push(...c),r},M6=(e,n,t)=>{const r=Array.from(e),[c]=r.splice(n,1);return r.splice(t,0,c),r},H6=async()=>{const{data:e}=await q.get("kill-house-lock-info/");return e},P6="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_9445_66010)'%3e%3cpath%20d='M7.99921%205.39452C9.08338%205.39452%209.9992%205.94413%209.9992%206.59452H10.7992C10.7992%205.5705%209.77244%204.75117%208.39921%204.61601V3.39453H7.59921V4.61601C6.22617%204.75117%205.19922%205.5705%205.19922%206.59452C5.19922%207.71444%206.42929%208.59451%207.99921%208.59451C9.08338%208.59451%209.9992%209.14412%209.9992%209.79451C9.9992%2010.4449%209.08338%2010.9945%207.99921%2010.9945C6.91523%2010.9945%205.99922%2010.4449%205.99922%209.79451H5.19922C5.19922%2010.8183%206.22617%2011.6377%207.59921%2011.7728V12.9945H8.39921V11.7728C9.77244%2011.6377%2010.7992%2010.8183%2010.7992%209.79451C10.7992%208.67439%209.56932%207.79451%207.99921%207.79451C6.91523%207.79451%205.99922%207.24491%205.99922%206.59452C5.99922%205.94413%206.91523%205.39452%207.99921%205.39452Z'%20fill='%23353535'/%3e%3cpath%20d='M22.4007%2011.0346V8.99477C22.4052%207.21196%2021.4936%205.55181%2019.987%204.5985C18.4806%203.64518%2016.5901%203.53229%2014.9808%204.29948C13.0818%200.897731%209.00794%20-0.64074%205.33432%200.656911C1.6609%201.95437%20-0.542999%205.71041%200.115983%209.55004C0.774965%2013.3899%204.10484%2016.1961%208.00072%2016.1947C8.81536%2016.1942%209.62493%2016.0676%2010.4007%2015.8199V21.7947C10.4021%2022.8986%2011.2968%2023.7933%2012.4007%2023.7947H22.0007C23.1048%2023.7933%2023.9995%2022.8986%2024.0007%2021.7947V12.9948C23.9995%2012.0446%2023.3313%2011.226%2022.4007%2011.0346ZM21.6007%208.99477V10.9948H20.8007V8.99477C20.8007%207.0065%2019.189%205.39478%2017.2007%205.39478C15.2126%205.39478%2013.6007%207.0065%2013.6007%208.99477V10.9948H12.8007V8.99477C12.8007%206.5647%2014.7708%204.59479%2017.2007%204.59479C19.6308%204.59479%2021.6007%206.5647%2021.6007%208.99477ZM15.1185%207.12954C15.1724%207.48208%2015.1999%207.83813%2015.2007%208.19477C15.2013%209.15785%2015.0036%2010.111%2014.6204%2010.9948H14.4007V8.99477C14.4011%208.30551%2014.6567%207.64106%2015.1185%207.12954ZM15.8272%206.55747C16.6935%206.06705%2017.7552%206.07408%2018.6147%206.57603C19.4743%207.07798%2020.0022%207.99927%2020.0007%208.99477V10.9948H15.4903C16.0261%209.57856%2016.1431%208.03813%2015.8272%206.55747ZM8.00072%2015.3947C4.49175%2015.3981%201.49117%2012.8713%200.897425%209.41274C0.303873%205.95416%202.29%202.57155%205.59936%201.40456C8.90872%200.237577%2012.5775%201.62644%2014.2845%204.69225C14.062%204.84537%2013.8521%205.01549%2013.656%205.20103C12.0435%202.14792%208.30052%200.923121%205.19506%202.43229C2.08961%203.94166%200.740004%207.64145%202.14429%2010.7957C3.54878%2013.9502%207.20111%2015.4229%2010.4007%2014.125V14.9746C9.63098%2015.2518%208.81907%2015.3938%208.00072%2015.3947ZM10.4007%2012.9948V13.2455C9.65208%2013.6059%208.83177%2013.7936%208.00072%2013.7948C5.21967%2013.7961%202.85894%2011.7563%202.45679%209.00453C2.05465%206.25259%203.73296%203.62252%206.39818%202.828C9.06341%202.03366%2011.9077%203.31549%2013.078%205.83834C12.38%206.74243%2012.0013%207.85239%2012.0007%208.99477V11.0346C11.0702%2011.226%2010.4021%2012.0446%2010.4007%2012.9948ZM23.2007%2021.7947C23.2007%2022.4574%2022.6635%2022.9947%2022.0007%2022.9947H12.4007C11.738%2022.9947%2011.2007%2022.4574%2011.2007%2021.7947V12.9948C11.2007%2012.3319%2011.738%2011.7948%2012.4007%2011.7948H22.0007C22.6635%2011.7948%2023.2007%2012.3319%2023.2007%2012.9948V21.7947Z'%20fill='%23353535'/%3e%3cpath%20d='M17.6851%2013.8512C17.0834%2013.7034%2016.4472%2013.8405%2015.9599%2014.2231C15.4726%2014.6078%2015.1916%2015.1971%2015.1994%2015.8178C15.207%2016.4387%2015.5027%2017.0207%2015.9994%2017.3932V19.7932C15.9994%2020.4559%2016.5367%2020.9932%2017.1994%2020.9932C17.8623%2020.9932%2018.3994%2020.4559%2018.3994%2019.7932V17.3932C19.0468%2016.9076%2019.3384%2016.0805%2019.139%2015.2963C18.9615%2014.5813%2018.4011%2014.0243%2017.6851%2013.8512ZM17.8003%2016.8303C17.6763%2016.9018%2017.6001%2017.034%2017.6003%2017.1772V19.7932C17.6003%2020.0141%2017.4212%2020.1932%2017.2003%2020.1932C16.9793%2020.1932%2016.8003%2020.0141%2016.8003%2019.7932V17.1772C16.8003%2017.034%2016.7242%2016.9018%2016.6003%2016.8303C16.2566%2016.6311%2016.0337%2016.2746%2016.0052%2015.8785C15.9765%2015.4823%2016.1461%2015.0977%2016.4574%2014.8512C16.6673%2014.6834%2016.9281%2014.5924%2017.1966%2014.5932C17.299%2014.5934%2017.4007%2014.6055%2017.5003%2014.6295C17.9224%2014.735%2018.2529%2015.0629%2018.3615%2015.4844C18.4972%2016.0082%2018.2673%2016.5584%2017.7994%2016.8303H17.8003Z'%20fill='%23353535'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_9445_66010'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",z6="/assets/lock-anbar-DjAoyX-H.svg",U6=()=>{const e=L(c=>c.userSlice.role),[n,t]=m.useState(null),r=e&&e.includes("KillHouse");return m.useEffect(()=>{r&&(async()=>{try{const h=await H6();t(h)}catch(h){console.error("Error fetching lock info:",h),t(null)}})()},[r,e]),u.jsxs(v,{sx:{width:{xs:"fit-content"},display:"flex",alignItems:"center",gap:.25,px:{xs:1,md:2},height:{xs:"36px",md:"46px"},borderRadius:{xs:"8px",md:"12px"},cursor:"pointer",transition:"all 0.3s ease",border:"0.25px solid rgba(151, 151, 151, 0.3)","&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}},style:{background:"linear-gradient(90deg, #FFFFFF 0%, #FFF4F4 78.85%, #FFE2E2 100%)"},children:[(n==null?void 0:n.wageLock)&&u.jsx(v,{component:"img",src:P6,alt:"dollar",sx:{width:{xs:"22px",md:"30px"},height:{xs:"22px",md:"30px"},marginLeft:{xs:"8px",md:"12px"}},title:"به علت بدهی"}),(n==null?void 0:n.wareHouseLock)&&u.jsx(v,{component:"img",src:z6,alt:"anbar",sx:{width:{xs:"22px",md:"30px"},height:{xs:"22px",md:"30px"},marginLeft:{xs:"12px",md:"20px"}},title:"به علت پر بودن انبار"}),u.jsx(N,{variant:"h6",sx:{color:(n==null?void 0:n.wageLock)===!0?"rgba(235, 87, 87, 1)":"rgba(0, 0, 0, 1)",fontWeight:"medium",fontSize:{xs:"14px",md:"18px"},marginLeft:{xs:"auto",sm:0}},children:((n==null?void 0:n.wage)||0).toLocaleString()}),u.jsx(N,{variant:"h6",sx:{color:(n==null?void 0:n.wageLock)===!0?"rgba(235, 87, 87, 1)":"rgba(0, 0, 0, 1)",fontWeight:"medium",fontSize:{xs:"10px",md:"12px"},marginLeft:"2px",marginTop:{xs:"1px",md:"2px"}},children:"ریال"})]})},V6=()=>{const[e]=m.useContext(du),n=Z0(),t=L(d=>d.userSlice.role),{typeActivitySelected:r}=L(d=>d.userSlice),c=E(),[h,p]=Z.useState(null),[o,l]=m.useState({}),[j,i]=m.useState({}),[H,D]=m.useState(null);m.useEffect(()=>{c(xu())},[]);const V=()=>r||(Y0(t)==="LiveStock"?"Livestock":"Poultry"),[x]=m.useState(V()),S=[];if(t)for(const d of t)Su(d).forEach(_=>{S.push({..._,role:d})}),ku(d).forEach(_=>{S.push({..._,role:d})});const Cu=(d,s)=>{p(null),s!=null&&s.route&&(qu(s.role,s.route),setTimeout(()=>n(s.route),0))},Au=(d,s)=>{o[s]||(d!=null&&d.disabled?e({vertical:"top",horizontal:"center",msg:d.disabledText||"این بخش در دست توسعه است !",severity:"error"}):(qu(s,d.route),n(d.route)))},bu=(d,s)=>{!o[d]?(l({...o,[d]:!0}),i({...j,[d]:s})):(D6(d,j[d]),l({...o,[d]:!1}),e({vertical:"top",horizontal:"center",msg:"ترتیب کارت‌ها ذخیره شد",severity:"success"}))},K=d=>{D(d)},J=()=>{D(null)},vu=(d,s)=>{d.dataTransfer.effectAllowed="move",d.dataTransfer.setData("text/html",s),D(s)},yu=d=>{d.preventDefault(),d.dataTransfer.dropEffect="move"},fu=(d,s,T)=>{d.preventDefault();const _=parseInt(d.dataTransfer.getData("text/html"));if(_===T)return;const M=j[s]||[],k=M6(M,_,T);i({...j,[s]:k})},Fu=()=>{D(null)},Y=(d,s)=>o[s]&&j[s]?j[s]:T6(d,s),m0=()=>x==="Poultry"?j0():x==="Livestock"?g0():A0();return u.jsxs(u.Fragment,{children:[u.jsx("style",{children:` + @keyframes wiggle { + 0% { transform: rotate(0deg); } + 25% { transform: rotate(-1deg); } + 50% { transform: rotate(1.5deg); } + 75% { transform: rotate(-1.5deg); } + 100% { transform: rotate(0deg); } + } + + .wiggle-animation { + animation: wiggle 0.25s ease-in-out infinite; + } + + .no-wiggle { + animation: none !important; + } + `}),u.jsxs(v,{sx:{backgroundColor:"#f9f9f9",minHeight:"auto",p:{xs:2,sm:3},borderRadius:"20px",width:"100%",maxWidth:{xs:"100%",sm:"100%"},overflowX:"hidden",position:"relative"},children:[u.jsxs(g,{container:!0,xs:12,justifyContent:"space-between",alignItems:"center",mb:2,mt:2,gap:1,px:1,children:[u.jsx(_u,{sx:{width:{xs:180,sm:260},"& .MuiOutlinedInput-root":{height:{xs:"38px",lg:"48px"}}},size:"small",options:S.map((d,s)=>({label:d.text,route:d.route,role:d.role,disabled:d.disabled||!1,index:s})),groupBy:d=>(t==null?void 0:t.length)!==1?hu(d.role):!1,getOptionDisabled:d=>d.disabled,getOptionLabel:d=>d.label||"",value:h,onChange:Cu,onClose:()=>p(null),renderInput:d=>u.jsx(y,{...d,placeholder:"جستجو ..."}),renderOption:(d,s)=>u.jsx(N,{color:"primary",...d,sx:{fontSize:14,fontWeight:"700"},children:s.label}),style:{backgroundColor:"white",borderRadius:4}}),t&&t.includes("KillHouse")&&u.jsx(U6,{})]}),u.jsx(g,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:m0()})]})]});function j0(){var d;return u.jsx(g,{container:!0,spacing:{xs:1,sm:3},justifyContent:"center",xs:12,children:(d=Lu(P(t)))==null?void 0:d.map((s,T)=>{var _,M;return u.jsx(g,{item:!0,xs:12,sm:12,lg:((_=P(t))==null?void 0:_.length)===1?12:6,children:u.jsxs(W,{elevation:2,sx:{p:{xs:1,sm:2},borderRadius:"12px",backgroundColor:"#fff",boxShadow:"0 2px 6px rgba(0,0,0,0.1)",position:"relative"},children:[u.jsx(v,{sx:{position:"relative"},children:u.jsx(wu,{title:o[s]?"ذخیره ترتیب":"ویرایش و تغییر ترتیب کارت‌ها",children:u.jsx(su,{onClick:()=>bu(s,Y(Su(s),s)),sx:{position:"absolute",top:2,right:0,zIndex:10,backgroundColor:o[s]?"success.main":"primary.main",color:"white","&:hover":{backgroundColor:o[s]?"success.dark":"primary.dark"},width:24,height:24},size:"small",children:o[s]?u.jsx(I0,{sx:{fontSize:"14px"}}):u.jsx(iu,{sx:{fontSize:"14px"}})})})}),u.jsx(Q,{sx:{mb:1.5},children:u.jsx(ou,{label:hu(s),color:"primary",sx:{fontSize:"0.85rem",fontWeight:"bold",backgroundColor:"primary"}})}),u.jsx(g,{container:!0,spacing:{xs:2,sm:2},justifyContent:"center",pt:1,children:(M=Y(Su(s),s))==null?void 0:M.map((k,f)=>{var w,uu,eu,nu,ru,tu;return u.jsx(g,{item:!0,xs:4,sm:3,md:3,lg:((w=P(t))==null?void 0:w.length)===1?1.7:4,nlg:((uu=P(t))==null?void 0:uu.length)===1?1.3:3,xl:((eu=P(t))==null?void 0:eu.length)===1?1.2:3,nxl:((nu=P(t))==null?void 0:nu.length)===1?1:2.3,xxl:((ru=P(t))==null?void 0:ru.length)===1?1.15:2.3,xxxl:((tu=P(t))==null?void 0:tu.length)===1?1:2.3,sx:{display:"flex",justifyContent:"center"},gap:5,children:u.jsxs(W,{elevation:2,draggable:o[s],className:o[s]&&H!==f?"wiggle-animation":"",onDragStart:A=>o[s]&&vu(A,f),onDragEnd:Fu,onDragOver:A=>o[s]&&yu(A),onDrop:A=>o[s]&&fu(A,s,f),onMouseDown:()=>o[s]&&K(f),onMouseUp:J,onTouchStart:()=>o[s]&&K(f),onTouchEnd:J,sx:{width:"100%",aspectRatio:"1/1",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",cursor:o[s]?"move":"pointer",transition:"transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out",position:"relative",backgroundSize:"cover",backgroundPosition:"center",color:A=>A.palette.primary.main,borderStyle:"solid",borderWidth:"1px",borderColor:A=>A.palette.primary.main,opacity:o[s]?.9:1,"&:hover":{transform:o[s]?"scale(1.02)":"scale(1.05)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",backgroundColor:A=>A.palette.primary.light}},onClick:()=>Au(k,s),children:[o[s]&&u.jsx(v,{sx:{position:"absolute",top:2,right:2,backgroundColor:"rgba(0, 0, 0, 0.5)",borderRadius:"50%",width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1},children:u.jsx(zu,{sx:{fontSize:12,color:"white"}})}),u.jsxs(v,{children:[k.icon&&u.jsx(v,{sx:{mb:.5},children:Z.cloneElement(k.icon,{sx:{fontSize:{xs:"2rem",sm:"2.5rem",xxl:"2.8rem",xxxl:"3.2rem"}}})}),u.jsx(N,{variant:"caption",fontWeight:"bold",sx:{fontSize:{xs:"0.55rem",sm:"0.65rem",xxl:"0.80rem",xxxl:"0.95rem"},color:A=>A.palette.primary.dark},children:k.text})]})]})},f)})})]})},T)})})}function g0(){var d;return u.jsx(g,{container:!0,spacing:{xs:1,sm:3},justifyContent:"center",xs:12,children:(d=Lu(z(t)))==null?void 0:d.map((s,T)=>{var _,M;return u.jsx(g,{item:!0,xs:12,sm:12,lg:((_=z(t))==null?void 0:_.length)===1?12:6,children:u.jsxs(W,{elevation:2,sx:{p:{xs:1,sm:2},borderRadius:"12px",backgroundColor:"#fff",boxShadow:"0 2px 6px rgba(0,0,0,0.1)",position:"relative"},children:[u.jsx(v,{sx:{position:"relative"},children:u.jsx(wu,{title:o[s]?"ذخیره ترتیب":"ویرایش و تغییر ترتیب کارت‌ها",children:u.jsx(su,{onClick:()=>bu(s,Y(ku(s),s)),sx:{position:"absolute",top:-8,right:8,zIndex:10,backgroundColor:o[s]?"success.main":"primary.main",color:"white","&:hover":{backgroundColor:o[s]?"success.dark":"primary.dark"},width:32,height:32},size:"small",children:o[s]?u.jsx(mu,{fontSize:"small"}):u.jsx(iu,{fontSize:"small"})})})}),u.jsx(Q,{sx:{mb:1.5},children:u.jsx(ou,{label:hu(s),color:"primary",sx:{fontSize:"0.85rem",fontWeight:"bold",backgroundColor:"primary"}})}),u.jsx(g,{container:!0,spacing:{xs:2,sm:2},justifyContent:"center",pt:1,children:(M=Y(ku(s),s))==null?void 0:M.map((k,f)=>{var w,uu,eu,nu,ru,tu;return u.jsx(g,{item:!0,xs:4,sm:3,md:3,lg:((w=z(t))==null?void 0:w.length)===1?1.7:4,nlg:((uu=z(t))==null?void 0:uu.length)===1?1.3:3,xl:((eu=z(t))==null?void 0:eu.length)===1?1.2:3,nxl:((nu=z(t))==null?void 0:nu.length)===1?1:2.3,xxl:((ru=z(t))==null?void 0:ru.length)===1?1.15:2.3,xxxl:((tu=z(t))==null?void 0:tu.length)===1?1:2.3,sx:{display:"flex",justifyContent:"center"},gap:5,children:u.jsxs(W,{elevation:2,draggable:o[s],className:o[s]&&H!==f?"wiggle-animation":"",onDragStart:A=>o[s]&&vu(A,f),onDragEnd:Fu,onDragOver:A=>o[s]&&yu(A),onDrop:A=>o[s]&&fu(A,s,f),onMouseDown:()=>o[s]&&K(f),onMouseUp:J,onTouchStart:()=>o[s]&&K(f),onTouchEnd:J,sx:{width:"100%",aspectRatio:"1/1",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",cursor:o[s]?"move":"pointer",transition:"transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out",position:"relative",backgroundSize:"cover",backgroundPosition:"center",color:A=>A.palette.info.main,borderStyle:"solid",borderWidth:"1px",borderColor:A=>A.palette.primary.main,opacity:o[s]?.9:1,"&:hover":{transform:o[s]?"scale(1.02)":"scale(1.05)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",backgroundColor:A=>A.palette.primary.light}},onClick:()=>Au(k,s),children:[o[s]&&u.jsx(v,{sx:{position:"absolute",top:2,right:2,backgroundColor:"rgba(0, 0, 0, 0.5)",borderRadius:"50%",width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1},children:u.jsx(zu,{sx:{fontSize:12,color:"white"}})}),u.jsxs(v,{children:[k.icon&&u.jsx(v,{sx:{mb:.5},children:Z.cloneElement(k.icon,{sx:{fontSize:{xs:"2rem",sm:"2.5rem"}}})}),u.jsx(N,{variant:"caption",fontWeight:"bold",sx:{fontSize:{xs:"0.65rem",sm:"0.65rem",lg:"0.75rem"},color:A=>A.palette.primary.dark},children:k.text})]})]})},f)})})]})},T)})})}function A0(){var d;return u.jsx(g,{container:!0,spacing:{xs:1,sm:3},justifyContent:"center",xs:12,children:(d=Lu(Uu(["BarSquareProvinceJahad"])))==null?void 0:d.map((s,T)=>{var _,M;return u.jsx(g,{item:!0,xs:12,sm:12,lg:((_=Uu(["BarSquareProvinceJahad"]))==null?void 0:_.length)===1?12:6,children:u.jsxs(W,{elevation:2,sx:{p:{xs:1,sm:2},borderRadius:"12px",backgroundColor:"#fff",boxShadow:"0 2px 6px rgba(238, 25, 25, 0.1)",position:"relative"},children:[u.jsx(v,{sx:{position:"relative"},children:u.jsx(wu,{title:o[s]?"ذخیره ترتیب":"ویرایش و تغییر ترتیب کارت‌ها",children:u.jsx(su,{onClick:()=>bu(s,Y($u(s),s)),sx:{position:"absolute",top:-8,right:8,zIndex:10,backgroundColor:o[s]?"success.main":"primary.main",color:"white","&:hover":{backgroundColor:o[s]?"success.dark":"primary.dark"},width:32,height:32},size:"small",children:o[s]?u.jsx(mu,{fontSize:"small"}):u.jsx(iu,{fontSize:"small"})})})}),u.jsx(Q,{sx:{mb:1.5},children:u.jsx(ou,{label:hu(s),color:"primary",sx:{fontSize:"0.85rem",fontWeight:"bold",backgroundColor:"primary"}})}),u.jsx(g,{container:!0,spacing:{xs:2,sm:2},justifyContent:"center",pt:1,children:(M=Y($u(s),s))==null?void 0:M.map((k,f)=>u.jsx(g,{item:!0,xs:4,sm:3,md:3,lg:2,xl:1.4,xxxl:1,sx:{display:"flex",justifyContent:"center"},gap:5,children:u.jsx(W,{elevation:2,draggable:o[s],className:o[s]&&H!==f?"wiggle-animation":"",onDragStart:w=>o[s]&&vu(w,f),onDragEnd:Fu,onDragOver:w=>o[s]&&yu(w),onDrop:w=>o[s]&&fu(w,s,f),onMouseDown:()=>o[s]&&K(f),onMouseUp:J,onTouchStart:()=>o[s]&&K(f),onTouchEnd:J,onClick:()=>Au(k,s),sx:{width:"100%",aspectRatio:"1/1",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",cursor:o[s]?"move":"pointer",transition:"transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out",position:"relative",backgroundSize:"cover",backgroundPosition:"center",color:"orange",borderStyle:"solid",borderWidth:"1px",borderColor:w=>w.palette.primary.main,opacity:o[s]?.9:1,"&:hover":{transform:o[s]?"scale(1.02)":"scale(1.05)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",backgroundColor:w=>w.palette.primary.light}},children:u.jsxs(v,{children:[k.icon&&u.jsx(v,{sx:{mb:.5},children:Z.cloneElement(k.icon,{sx:{fontSize:{xs:"2rem",sm:"2.5rem",lg:"3rem"}}})}),u.jsx(N,{variant:"caption",fontWeight:"bold",sx:{fontSize:{xs:"0.65rem",sm:"0.65rem",lg:"0.75rem"},color:w=>w.palette.primary.dark},children:k.text})]})})},f))})]})},T)})})}},ce=()=>{const{pathname:e}=i0(),[n]=Ju();return u.jsx(u.Fragment,{children:u.jsx(B,{display:"flex",justifyContent:"center",children:u.jsxs(a,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[e===cu&&u.jsx(a,{my:C.MEDIUM,children:u.jsx(W,{children:u.jsx(x6,{})})}),e===cu&&u.jsx(a,{container:!0,justifyContent:"space-between",gap:C.SMALL,pb:C.MEDIUM,children:u.jsx(a,{xs:12,mb:C.MEDIUM,children:u.jsx(C6,{})})}),e==="/"?u.jsx(a,{container:!0,my:C.MEDIUM,children:u.jsx(V6,{})}):u.jsxs(a,{xs:12,children:[window.location.pathname!=="/dashboard/profile"&&u.jsx(t6,{}),u.jsx(a,{xs:12,mt:2,children:n.map((t,r)=>{switch(t){case"CityOperator":return e===l0&&u.jsx(a,{container:!0,justifyContent:"space-between",gap:C.SMALL,children:u.jsx(a,{xs:12,md:12,children:u.jsx(j6,{})})},t+r);case"Poultry":return e===o0&&u.jsx(a,{container:!0,justifyContent:"space-between",gap:C.SMALL,children:u.jsx(a,{xs:12,md:12,children:u.jsx(b6,{})})},t+r);case"ProvinceOperator":return e===s0&&u.jsx(a,{container:!0,justifyContent:"space-between",gap:C.SMALL,children:u.jsx(a,{xs:12,md:12,children:u.jsx(g6,{})})},t+r);case"ProvinceFinancial":return e===e0&&u.jsx(a,{container:!0,justifyContent:"space-between",gap:C.SMALL,children:u.jsx(a,{xs:12,md:12,children:u.jsx(F6,{})})},t+r);case"ProvinceInspector":return e===u0&&u.jsx(a,{container:!0,justifyContent:"space-between",gap:C.SMALL,children:u.jsx(a,{xs:12,md:12,children:u.jsx(y6,{})})},t+r);case"KillHouse":return e===a0&&u.jsx(a,{container:!0,justifyContent:"space-between",gap:C.SMALL,children:u.jsx(a,{xs:12,md:12,children:u.jsx(f6,{})})},t+r);case"KillHouseVet":return e===r0&&u.jsx(a,{container:!0,justifyContent:"space-between",gap:C.SMALL,children:u.jsx(a,{xs:12,md:12,children:u.jsx(E6,{})})},t+r);case"VetFarm":return e===t0&&u.jsx(a,{container:!0,justifyContent:"space-between",gap:C.SMALL,children:u.jsx(a,{xs:12,md:12,children:u.jsx(A6,{})})},t+r);case"Driver":return e===n0&&u.jsx(a,{container:!0,justifyContent:"space-between",gap:C.SMALL,children:u.jsx(a,{xs:12,md:12,children:u.jsx(v6,{})})},t+r);case"Guilds":return e===Xu&&u.jsx(a,{container:!0,justifyContent:"space-between",gap:C.SMALL,children:u.jsx(a,{xs:12,md:12,children:u.jsx(w6,{})})},t+r);case"CityVet":return e===Qu&&u.jsx(a,{container:!0,justifyContent:"space-between",gap:C.SMALL,children:u.jsx(a,{xs:12,md:12,children:u.jsx(S6,{})})},t+r);case"ChainCompany":return e===Yu&&u.jsx(a,{container:!0,justifyContent:"space-between",gap:C.SMALL,children:u.jsx(a,{xs:12,md:12,children:u.jsx(_6,{})})},t+r);case"LiveStockSupport":return e===Zu&&u.jsx(a,{container:!0,justifyContent:"space-between",gap:C.SMALL,children:u.jsx(a,{xs:12,md:12,children:u.jsx(L6,{})})},t+r);default:return null}})})]})]})})})};export{ce as default}; diff --git a/build/assets/GuildManageGuildsPage-D2fbeDME.js b/build/assets/GuildManageGuildsPage-D2fbeDME.js new file mode 100644 index 0000000..8549c31 --- /dev/null +++ b/build/assets/GuildManageGuildsPage-D2fbeDME.js @@ -0,0 +1 @@ +import{j as r,T as L,b as V,bq as q,bs as S,ak as uu,B as M,d as eu}from"./mui-vendor-CkIVaoQP.js";import{G as s,S as i,X as P,O as ru,j as $,L as au,h as su,lQ as nu}from"./index-CeyyVc1v.js";import{r as n,f as tu}from"./react-vendor-CmFgShSM.js";import{R as lu,a as ou}from"./index.esm-Bu7XMDZU.js";import{u as cu,f as du}from"./redux-vendor-B7uoacJt.js";import{M as J}from"./ManageGuildsOperations-DTKLlkN3.js";import{C as pu}from"./CreateGuilds-CCT3R9v5.js";import{P as Cu}from"./PageTable-C16Ol94B.js";import"./iconBase-BEJYyZsk.js";import"./Edit-CqBj1Y2L.js";import"./Visibility-DeyjG-oI.js";import"./CheckCircle-zgBvZQ-b.js";import"./Send-CA1iNvJP.js";import"./Person-Q1IHBezR.js";import"./Business-J-mGuLnc.js";import"./Phone-Dv2y8iMM.js";import"./Badge-u1S44abW.js";import"./Cake-CkaTUHNX.js";import"./Tune-D4M2CAhp.js";import"./Done-Dp5awdte.js";import"./DialogAlert-BfXcr-Kr.js";import"./LabelField-B6eRSoQP.js";import"./styled-components.browser.esm-gS9mh05b.js";const K=({columns:o,data:t,ignore:h,paginated:j,name:c})=>{const O=Math.ceil((t==null?void 0:t.length)/2),[l,b]=n.useState(1);function w(p){return h==null?void 0:h.includes(p)}const F=(l-1)*2,I=F+2,d=j?t.slice(F,I):t;return r.jsxs(r.Fragment,{children:[r.jsxs(s,{container:!0,xs:12,mb:i.SMALL,spacing:1,justifyContent:"space-between",children:[c&&r.jsx(L,{m:2,xs:12,variant:"body2",children:c}),!t.length&&r.jsx(s,{xs:12,display:"grid",justifyContent:"center",mt:4,children:r.jsx(L,{xs:12,variant:"body1",color:"error",children:"موردی وجود ندارد!"})}),d.map((p,x)=>{let C=0;return r.jsx(s,{xs:t.length===1?12:6,children:r.jsx(V,{display:"flex",flexDirection:"column",border:1,borderRadius:3,children:p.map((T,f)=>{var y;return!w(f)&&r.jsxs(s,{alignItems:"center",justifyContent:"space-between",display:"flex",xs:12,sx:{backgroundColor:C++%2===0?"rgba(148,148,148,0.1)":"ffff"},children:[r.jsx(s,{item:!0,xs:5,children:r.jsx(L,{sx:{fontSize:((y=o[f])==null?void 0:y.length)<=15?13:10},children:`${o[f]}`})}),r.jsx(s,{item:!0,xs:7,style:{fontSize:12,width:"100%"},children:T})]},f)})})},x)})]}),j&&r.jsx(s,{container:!0,mb:i.SMALL,justifyContent:"center",children:r.jsx(q,{count:O,page:l,variant:"outlined",onChange:(p,x)=>b(x)})})]})};K.propTypes={columns:S.any,data:S.any,ignore:S.array,paginated:S.any};const fu=()=>{const o=cu(),[t,h]=n.useState([]),j=du(u=>u.userSlice.userProfile.key),[c,A]=n.useState([]),[O,l]=n.useState(!1),[b,w]=n.useState(0),[F,I]=n.useState(10),[d,p]=n.useState(""),x=u=>{p(u.target.value)},C=async(u,e)=>{l(!0);let a=await $.get(`total_guilds/?role=Guilds&steward=true&search=filter&value=${e}&page=${u}&page_size=${F}`);A(a.data.results),w(a.data.count),l(!1)},T=u=>{C(u,d)},f=async(u,e)=>{l(!0);let a=await $.get(`total_guilds/?role=Guilds&steward=true&search=filter&value=${d}&page=${e}&page_size=${u}`);A(a.data.results),w(a.data.count),I(u),l(!1),o(su())},[y,Q]=n.useState(0),X=(u,e)=>{o(au()),Q(e),C(e+1,d)};n.useEffect(()=>{C(1)},[]);const E=()=>{C(1)},D=[{name:"شناسه صنف",selector:u=>u.guildsId,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"نام واحد صنفی",selector:u=>u==null?void 0:u.guildsName,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"نام شخص/شرکت",selector:u=>{var e,a;return`${(e=u==null?void 0:u.user)==null?void 0:e.fullname} (${(a=u==null?void 0:u.user)==null?void 0:a.mobile})`},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"100px"},{name:"کدملی",selector:u=>{var e;return(e=u==null?void 0:u.user)==null?void 0:e.nationalId},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"100px"},{name:"نوع فعالیت",selector:u=>u==null?void 0:u.typeActivity,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"حوزه فعالیت",selector:u=>u==null?void 0:u.areaActivity,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"کدپستی",selector:u=>{var e;return(e=u==null?void 0:u.address)==null?void 0:e.postalCode},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"استان/شهر/آدرس",selector:u=>{var e,a,g;return`${(e=u==null?void 0:u.address)==null?void 0:e.province.name}/${(a=u==null?void 0:u.address)==null?void 0:a.city.name}/${(g=u==null?void 0:u.address)==null?void 0:g.address}`},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"مباشر",selector:u=>u!=null&&u.steward?"می باشد":"نمی باشد",sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"محدودیت تخصیص",selector:u=>u!=null&&u.limitationAllocation?"دارد":"ندارد",sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"حداکثر تخصیص",selector:u=>u==null?void 0:u.allocationLimit,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"مباشر",selector:u=>{var e;return(e=u==null?void 0:u.centersAllocation)==null?void 0:e.map(a=>a.label).join(" - ")},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"کشتارگاه",selector:u=>{var e;return(e=u==null?void 0:u.killHouseInfo)==null?void 0:e.map(a=>`${a.name} (${a.mobile})`).join(" - ")},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"وضعیت",selector:u=>{let e="";return(u==null?void 0:u.provinceAcceptState)==="accepted"?e="تایید شده":(u==null?void 0:u.provinceAcceptState)==="rejected"?e="رد شده":(u==null?void 0:u.provinceAcceptState)==="pending"&&(e="در انتظار تایید"),e},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"عملیات",selector:(u,e)=>r.jsx(J,{guild:u,updateTable:E},e+(u==null?void 0:u.guildsId)),sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"110px"}],G=async u=>{u.preventDefault(),l(!0);try{const e=await $.get(`total_guilds/?role=${P()}&search=filter&value=${d}&steward=true`);A(e.data.results),w(e.data.count)}catch(e){console.error("Error fetching data:",e)}finally{l(!1)}};P()==="CityJahad"&&D.pop();const Y=u=>{let e="";return(u==null?void 0:u.provinceAcceptState)==="accepted"?e="تایید شده":(u==null?void 0:u.provinceAcceptState)==="rejected"?e="رد شده":(u==null?void 0:u.provinceAcceptState)==="pending"&&(e="در انتظار تایید"),e};n.useEffect(()=>{const u=c==null?void 0:c.map((e,a)=>{var g,_,N,k,z,B,W,U,H;return[e.guildsId,e==null?void 0:e.guildsName,`${(g=e==null?void 0:e.user)==null?void 0:g.fullname} (${(_=e==null?void 0:e.user)==null?void 0:_.mobile})`,(N=e==null?void 0:e.user)==null?void 0:N.nationalId,e==null?void 0:e.typeActivity,e==null?void 0:e.areaActivity,(k=e==null?void 0:e.address)==null?void 0:k.postalCode,`${(z=e==null?void 0:e.address)==null?void 0:z.province.name}/${(B=e==null?void 0:e.address)==null?void 0:B.city.name}/${(W=e==null?void 0:e.address)==null?void 0:W.address}`,e!=null&&e.steward?"می باشد":"نمی باشد",e!=null&&e.limitationAllocation?"دارد":"ندارد",e==null?void 0:e.allocationLimit,(U=e==null?void 0:e.centersAllocation)==null?void 0:U.map(v=>v.label).join(" - "),(H=e==null?void 0:e.killHouseInfo)==null?void 0:H.map(v=>`${v.name} (${v.mobile})`).join(" - "),Y(e),r.jsx(J,{guild:e},a+(e==null?void 0:e.guildsId))]});h(u)},[c]);const Z=D.map(u=>u.name),m=window.innerWidth<=600,R=r.jsx(s,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,width:"100%",children:r.jsxs(s,{container:!0,width:"100%",alignItems:"center",justifyContent:"space-between",gap:i.SMALL,children:[r.jsx("form",{onSubmit:G,children:r.jsxs(s,{container:!0,alignItems:"center",gap:i.SMALL,children:[r.jsx(L,{children:"مدیریت اصناف"}),r.jsx(uu,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:x}),r.jsx(M,{type:"submit",onClick:G,endIcon:r.jsx(lu,{}),children:"جستجو"})]})}),r.jsxs(s,{children:[P()!=="CityJahad"&&r.jsx(M,{variant:"contained",onClick:()=>{o(ru({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,size:window.innerWidth<=600?"small":"auto",title:"ثبت واحد جدید",content:r.jsx(pu,{updateTable:E})}))},children:"ثبت واحد جدید"}),r.jsx(eu,{title:"خروجی اکسل",children:r.jsx("a",{href:`${$.defaults.baseURL}guilds_excel/?key=${j}&role=${P()}&search=filter&value=${d}`,rel:"noreferrer",children:r.jsx(M,{color:"success",children:r.jsx(ou,{size:32})})})})]})]})});return r.jsx(s,{children:m?r.jsxs(s,{container:!0,justifyContent:"center",gap:i.SMALL,children:[R,r.jsx(K,{columns:Z,data:t}),r.jsx(q,{count:Math.ceil(b/10),page:y+1,variant:"outlined",onChange:(u,e)=>{X(u,e-1)}})]}):r.jsx(Cu,{title:R,columns:D,data:c,progressPending:O,pagination:!0,paginationServer:!0,paginationTotalRows:b,onChangeRowsPerPage:f,onChangePage:T})})},_u=()=>{const{pathname:o}=tu();return r.jsx(r.Fragment,{children:r.jsx(V,{display:"flex",justifyContent:"center",children:r.jsx(s,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:r.jsx(s,{container:!0,justifyContent:"space-between",gap:i.SMALL,children:r.jsx(s,{xs:12,children:o===nu&&r.jsx(fu,{})})})})})})};export{_u as default}; diff --git a/build/assets/Guilds-CrGG7yyR.js b/build/assets/Guilds-CrGG7yyR.js new file mode 100644 index 0000000..67d1690 --- /dev/null +++ b/build/assets/Guilds-CrGG7yyR.js @@ -0,0 +1 @@ +import{j as u,ai as ou,aX as m,ak as N,aa as e0,al as n0,T as tu,B as T,d as Tu,I as su,b0 as Mu,b5 as Pu,ax as uu,b2 as s0,b3 as s6,b as Eu,ag as t6,av as r6,aw as a6}from"./mui-vendor-CkIVaoQP.js";import{b9 as xu,ba as Au,bb as vu,bc as gu,bd as Su,be as ju,G as C,bf as Vu,bg as Bu,bh as $u,S as b,X as v,bi as _6,bj as p6,bk as h6,bl as x6,bm as A6,bn as v6,bo as g6,bp as S6,bq as j6,br as E6,bs as F6,bt as y6,bu as f6,bv as Gu,bw as I6,bx as R6,by as O6,bz as T6,bA as P6,bB as U6,bC as b6,L as Q,j as H,bD as ku,h as M,A as lu,u as Wu,c as Hu,N as D6,ab as t0,bE as r0,bF as L6,bG as N6,bH as G6,bI as w6,bJ as z6,bK as M6,O as K,C as nu,bL as V6,bM as B6,bN as $6,bO as k6,bP as W6,bQ as wu,bR as zu,b as Du,b1 as a0,bS as o0,M as W,bT as l0,W as o6,v as Iu,bU as H6,bV as Y6,bW as X6,bX as q6,bY as K6,bZ as c0,b_ as i0,b$ as C0,c0 as d0,c1 as _0}from"./index-CeyyVc1v.js";import{B as Q6}from"./BackButton-Crzr7NMa.js";import{N as V}from"./NavLink-D2GD_ItM.js";import{L as B}from"./LinkItem-DT6qswcs.js";import{c as Z}from"./index.esm-BcDC8KuM.js";import{I as Fu}from"./index.esm-fCjAhNPc.js";import{b as p0}from"./index.esm-CjWvmHks.js";import{f as Yu,r as i}from"./react-vendor-CmFgShSM.js";import{a as J6,R as cu}from"./index.esm-Bu7XMDZU.js";import{a as iu,f as yu,u as $}from"./redux-vendor-B7uoacJt.js";import{d as au}from"./Edit-CqBj1Y2L.js";import{d as Xu}from"./Tune-D4M2CAhp.js";import{R as eu}from"./ResponsiveTable-w7hk7Uq8.js";import{d as h0}from"./Visibility-DeyjG-oI.js";import{d as x0}from"./Check-CRb6laYC.js";import{d as A0}from"./Close-_jAEIgMD.js";import{d as v0}from"./CheckCircle-zgBvZQ-b.js";import{d as g0}from"./Send-CA1iNvJP.js";import{c as Z6,P as S0,p as j0,C as m6}from"./CreateGuilds-CCT3R9v5.js";import{V as E0,M as F0}from"./ManageGuildsOperations-DTKLlkN3.js";import{S as l6}from"./SimpleTable-DBAoNnCU.js";import{P as y0}from"./PspActiveSession-DQjcq8bm.js";import{p as pu,a as hu,P as c6,b as f0}from"./ProvinceManageDistributionsSubmitCommitmentPercent-BeA64jYA.js";import{d as i6}from"./Business-J-mGuLnc.js";import{d as C6}from"./Person-Q1IHBezR.js";import{d as I0}from"./Badge-u1S44abW.js";import{d as R0}from"./Delete-C5MyLelE.js";import"./iconBase-BEJYyZsk.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./Phone-Dv2y8iMM.js";import"./Cake-CkaTUHNX.js";import"./Done-Dp5awdte.js";import"./DialogAlert-BfXcr-Kr.js";import"./LabelField-B6eRSoQP.js";import"./index-CIfb_iLp.js";import"./Search-Dek2fED1.js";const O0=()=>{const{pathname:n}=Yu();return u.jsxs(u.Fragment,{children:[[xu,Au,vu,gu,Su,ju].includes(n)&&u.jsx(Q6,{}),u.jsxs(C,{container:!0,gap:b.SMALL,p:b.SMALL,direction:"row",justifyContent:"center",xs:12,children:[[Vu,Bu,$u].includes(n)&&u.jsxs(u.Fragment,{children:[u.jsx(V,{to:v()==="SuperAdmin"?xu:v()==="AdminX"?Au:vu,children:u.jsx(B,{icon:u.jsx(Z,{size:30,color:"#244CCC"}),title:"اصناف داخل استان"})}),u.jsx(V,{to:v()==="SuperAdmin"?gu:v()==="AdminX"?Su:ju,children:u.jsx(B,{icon:u.jsx(Z,{size:30,color:"#244CCC"}),title:"اصناف خارج استان"})})]}),[xu,Au,vu].includes(n)&&u.jsxs(u.Fragment,{children:[u.jsx(V,{to:v()==="SuperAdmin"?_6:v()==="AdminX"?p6:h6,children:u.jsx(B,{icon:u.jsx(Z,{size:30,color:"#244CCC"}),title:"درخواست های ثبت صنف"})}),u.jsx(V,{to:v()==="SuperAdmin"?x6:v()==="AdminX"?A6:v6,children:u.jsx(B,{icon:u.jsx(Z,{size:30,color:"#244CCC"}),title:"اصناف حقیقی"})}),u.jsx(V,{to:v()==="SuperAdmin"?g6:v()==="AdminX"?S6:j6,children:u.jsx(B,{icon:u.jsx(Z,{size:30,color:"#244CCC"}),title:"اصناف حقوقی"})}),u.jsx(V,{to:v()==="SuperAdmin"?E6:v()==="AdminX"?F6:y6,active:n===f6?"true":null,children:u.jsx(B,{icon:u.jsx(Fu,{size:30,color:"#244CCC"}),title:"مباشرین"})}),(v()==="AdminX"||v()==="SuperAdmin")&&u.jsx(V,{to:v()==="SuperAdmin"?Gu:I6,active:n===Gu?"true":null,children:u.jsx(B,{icon:u.jsx(p0,{size:30,color:"#244CCC"}),title:"مدیریت مباشرین"})})]}),[gu,Su,ju].includes(n)&&u.jsxs(u.Fragment,{children:[u.jsx(V,{to:v()==="SuperAdmin"?R6:v()==="AdminX"?O6:T6,children:u.jsx(B,{icon:u.jsx(Z,{size:30,color:"#244CCC"}),title:"اصناف حقیقی"})}),u.jsx(V,{to:v()==="SuperAdmin"?P6:v()==="AdminX"?U6:b6,children:u.jsx(B,{icon:u.jsx(Z,{size:30,color:"#244CCC"}),title:"اصناف حقوقی"})})]})]})]})},T0=iu("PROVINCE_CHANGE_ACTIVE_STEWARD_SERVICE",async(n,{dispatch:t})=>{try{t(Q());const{data:s,status:l}=await H.put("steward/0/",n);return t(ku()),t(M()),{data:s,status:l}}catch(s){return t(M()),{error:s.response.data.result}}}),P0=iu("PROVINCE_EDIT_STEWARD_SERVICE",async(n,{dispatch:t})=>{try{t(Q());const{data:s,status:l}=await H.put("steward/0/",n);return t(ku()),t(M()),{data:s,status:l}}catch(s){return t(M()),{error:s.response.data.result}}}),U0=Hu().shape({}),b0=({guild:n})=>{const{provinceGetBuyersOptions:t}=yu(r=>r.provinceSlice),[s,l]=i.useState(n.centersAllocation?n.centersAllocation:[]),h=$(),[x]=i.useContext(lu),d=Wu({initialValues:{allocation_limit:n.allocationLimit,centers_allocation:"",limitation_allocation:n.limitationAllocation},validationSchema:U0,onSubmit:r=>{h(P0({allocation_limit:r.allocation_limit,limitation_allocation:r.limitation_allocation,centers_allocation:s,steward_key:n.key})).then(g=>{g.payload.error?x({vertical:"top",horizontal:"center",msg:g.payload.error,severity:"error"}):(h(D6({right:!1,bottom:!1,content:null})),x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}});return i.useEffect(()=>{h(t0())},[]),u.jsx("form",{onSubmit:d.handleSubmit,style:{width:"100%"},children:u.jsxs(C,{container:!0,direction:"column",width:"100%",gap:b.SMALL,children:[u.jsx(ou,{control:u.jsx(m,{name:"limitation_allocation",checked:d.values.limitation_allocation,onChange:d.handleChange}),label:"محدودیت تخصیص"}),d.errors.limitation_allocation&&u.jsx("div",{children:d.errors.limitation_allocation}),d.values.limitation_allocation&&u.jsxs(u.Fragment,{children:[u.jsx(N,{label:"حداکثر تخصیص",variant:"outlined",fullWidth:!0,id:"allocation_limit",name:"allocation_limit",InputProps:{endAdornment:u.jsx(e0,{position:"start",children:"کیلوگرم"})},value:d.values.allocation_limit,onChange:d.handleChange,error:d.touched.allocation_limit&&!!d.errors.allocation_limit,helperText:d.touched.allocation_limit&&d.errors.allocation_limit}),u.jsx(n0,{style:{width:"100%"},options:t,value:d.values.guild,onChange:(r,g)=>{l([...s,g])},error:d.touched.guild&&!!d.errors.guild,helperText:d.touched.guild&&d.errors.guild,getOptionLabel:r=>r.label,renderInput:r=>u.jsx(N,{...r,label:"انتخاب انبار",variant:"outlined"})}),u.jsx(tu,{children:"محدودیت انبار های انتخاب شده"}),!s.length&&u.jsx(tu,{variant:"caption",children:"محدودیتی وجود ندارد"}),s==null?void 0:s.map((r,g)=>u.jsxs(C,{container:!0,gap:b.SMALL,alignItems:"center",children:[u.jsx(T,{variant:"text",onClick:()=>{l(s.filter(F=>F.value!==r.value))},children:"حذف"}),u.jsx(tu,{children:r.label},r.label)]},r.value))]}),u.jsx(T,{color:"primary",fullWidth:!0,variant:"contained",type:"submit",children:"ثبت"})]})})},D0=({guild:n})=>{const t=$(),[s,l]=i.useState(n.active),[h,x]=i.useState(!1),[d,r]=i.useState(null),g=E=>{x(!0),r(E.currentTarget)},F=()=>{x(!1),r(null)},a=E=>{l(E.target.checked),t(T0({steward_key:n==null?void 0:n.key,active:E.target.checked}))};return u.jsxs(C,{children:[u.jsx(Tu,{title:"مدیریت متصدی",placement:"left",children:u.jsx(su,{color:"primary",onClick:g,children:u.jsx(Xu,{})})}),u.jsx(Mu,{open:h,anchorEl:d,onClose:F,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsx("div",{style:{padding:10},children:u.jsxs(C,{container:!0,direction:"column",alignItems:"flex-start",justifyContent:"center",gap:1,children:[u.jsx(ou,{control:u.jsx(Pu,{checked:s,onChange:a,color:"primary"}),label:s?"فعال":"غیرفعال",style:{justifyContent:"center",alignItems:"center",display:"flex"}}),u.jsx(T,{size:"small",color:"primary",startIcon:u.jsx(au,{}),sx:{fontSize:{xs:12,md:15}},onClick:()=>{F(),t(D6({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"اعمال محدودیت",content:u.jsx(b0,{guild:n})}))},children:"اعمال محدودیت"})]})})})]})},L0=()=>{const n=$(),[t,s]=i.useState([]),[l,h]=i.useState("همه"),{provinceGetStewards:x}=yu(g=>g.provinceSlice),d=yu(g=>g.userSlice.userProfile.key);i.useEffect(()=>{n(ku())},[]),i.useEffect(()=>{const g=l==="همه"?x:x==null?void 0:x.filter(a=>l==="فعال"?a==null?void 0:a.active:!(a!=null&&a.active)),F=g==null?void 0:g.map((a,E)=>{var U,O,p,D,w,j,c,_,I,R,G,f,o,e,S,y,L,A,z,k,Y,X,Cu;const P=[E+1,(U=a==null?void 0:a.guilds)==null?void 0:U.guildsId,(O=a==null?void 0:a.guilds)==null?void 0:O.guildsName,`${(D=(p=a==null?void 0:a.guilds)==null?void 0:p.user)==null?void 0:D.fullname} (${(j=(w=a==null?void 0:a.guilds)==null?void 0:w.user)==null?void 0:j.mobile})`,(_=(c=a==null?void 0:a.guilds)==null?void 0:c.user)==null?void 0:_.nationalId,(I=a==null?void 0:a.guilds)==null?void 0:I.typeActivity,(R=a==null?void 0:a.guilds)==null?void 0:R.areaActivity,(G=a==null?void 0:a.guilds)==null?void 0:G.licenseNumber,`${(o=(f=a==null?void 0:a.guilds)==null?void 0:f.address)==null?void 0:o.province.name}/${(S=(e=a==null?void 0:a.guilds)==null?void 0:e.address)==null?void 0:S.city.name}`,(L=(y=a==null?void 0:a.guilds)==null?void 0:y.address)==null?void 0:L.address,a!=null&&a.limitationAllocation?"دارد":"ندارد",(A=a==null?void 0:a.allocationLimit)==null?void 0:A.toLocaleString(),(z=a==null?void 0:a.centersAllocation)==null?void 0:z.map(fu=>fu.label).join(" - "),(Y=(k=a==null?void 0:a.productInfo)==null?void 0:k.totalCarcassesWeight)==null?void 0:Y.toLocaleString(),(Cu=(X=a==null?void 0:a.productInfo)==null?void 0:X.realAllocatedWeight)==null?void 0:Cu.toLocaleString(),u.jsx(D0,{guild:a},E)];return v()==="CityJahad"&&P.pop(),P});s(F)},[x,l]);const r=["ردیف","شناسه صنف","نام واحد صنفی","نام شخص/شرکت","کدملی","نوع فعالیت","حوزه فعالیت","شماره مجوز","استان/شهرستان","آدرس واحد صنفی","محدودیت تخصیص","حداکثر تخصیص","مراکز تخصیص","وزن خرید (کیلوگرم)","وزن فروش (کیلوگرم)","عملیات"];return v()==="CityJahad"&&r.pop(),u.jsxs(C,{container:!0,children:[u.jsxs(C,{container:!0,alignItems:"center",gap:b.SMALL,children:[u.jsx(Tu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${H.defaults.baseURL}stewards_excel/?role=${v()}&key=${d}`,rel:"noreferrer",children:u.jsx(T,{color:"success",children:u.jsx(J6,{size:32})})})}),u.jsxs(N,{select:!0,label:"وضعیت",value:l,onChange:g=>h(g.target.value),size:"small",sx:{width:150},children:[u.jsx(uu,{value:"همه",children:"همه"}),u.jsx(uu,{value:"فعال",children:"فعال"}),u.jsx(uu,{value:"غیرفعال",children:"غیرفعال"})]})]}),u.jsx(eu,{title:"مباشرین",paginated:!0,columns:r,data:t})]})},u0=iu("UPDATE_GUILDS_SETTINGS_SERVICE",async n=>{const{data:t,status:s}=await H.put("kill_house_choose_steward_guilds/0/",n);return{data:t,status:s}}),N0=({guildState:n,choose_steward_guilds_key:t})=>{const s=$(),[l,h]=i.useState(n),x=()=>{h(d=>(s(u0({choose_steward_guilds_key:t,guilds:!d})),!d))};return u.jsx(C,{container:!0,alignItems:"center",justifyContent:"center",children:u.jsx(ou,{control:u.jsx(Pu,{checked:l,onChange:x,name:"switchState",color:"primary"})})})},G0=({stewardState:n,choose_steward_guilds_key:t})=>{const s=$(),[l,h]=i.useState(n),x=()=>{h(d=>(s(u0({choose_steward_guilds_key:t,steward:!d})),!d))};return u.jsx(C,{container:!0,alignItems:"center",justifyContent:"center",children:u.jsx(ou,{control:u.jsx(Pu,{checked:l,onChange:x,name:"switchState",color:"primary"})})})},w0=()=>{const n=$(),[t,s]=i.useState([]),{getGuildsSettings:l}=yu(h=>h.provinceSlice);return i.useEffect(()=>{n(Q()),n(r0({kill_house_key:null})).then(()=>{n(M())})},[]),i.useEffect(()=>{if(Array.isArray(l)){const h=l==null?void 0:l.map((x,d)=>[d+1,x.killHouse.name,u.jsx(N0,{guildState:x.guilds,choose_steward_guilds_key:x.key},d),u.jsx(G0,{stewardState:x.steward,choose_steward_guilds_key:x.key},d)]);s(h)}},[l]),u.jsx(C,{children:u.jsx(eu,{paginated:!0,title:"مجوزهای توزیع",columns:["ردیف","نام کشتارگاه","اجازه فروش آزاد به صنف","اجازه فروش آزاد به مباشرین"],data:t})})},z0=()=>u.jsxs(C,{container:!0,gap:b.SMALL,p:b.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",children:[u.jsx(V,{to:v()==="Commerce"?L6:N6,children:u.jsx(B,{icon:u.jsx(Z,{size:30,color:"#244CCC"}),title:"اصناف"})}),u.jsx(V,{to:v()==="Commerce"?G6:w6,children:u.jsx(B,{icon:u.jsx(Fu,{size:30,color:"#244CCC"}),title:"مباشرین"})}),u.jsx(V,{to:v()==="Commerce"?z6:M6,children:u.jsx(B,{icon:u.jsx(Fu,{size:30,color:"#244CCC"}),title:"مدیریت فرآیند"})})]}),M0=({guild:n,updateTable:t})=>{const[s,l]=i.useState(!1),[h,x]=i.useState(null),d=$(),[r]=i.useContext(lu),g=a=>{l(!0),x(a.currentTarget)},F=()=>{l(!1),x(null)};return u.jsxs(C,{children:[u.jsx(su,{variant:"contained",color:"primary",onClick:g,children:u.jsx(Xu,{})}),u.jsx(Mu,{open:s,anchorEl:h,onClose:F,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsx("div",{style:{padding:10},children:u.jsxs(C,{container:!0,direction:"column",alignItems:"flex-start",justifyContent:"center",gap:1,children:[["SuperAdmin","AdminX","GuildRoom"].includes(v())&&u.jsx(T,{size:"small",color:"info",startIcon:u.jsx(h0,{}),sx:{fontSize:{xs:12,md:15}},onClick:()=>{F(),d(K({title:"مشاهده جزییات صنف",content:u.jsx(E0,{guild:n}),size:window.innerWidth<=600?"small":"auto"}))},children:"جزییات"}),n!=null&&n.activeRegisterCode&&(n!=null&&n.loggedRegisterCode)||!(n!=null&&n.activeRegisterCode)?u.jsxs(C,{container:!0,alignItems:"flex-start",justifyContent:"flex-start",gap:b.TINY,direction:"column",children:[u.jsx(T,{size:"small",color:"success",startIcon:u.jsx(x0,{}),sx:{fontSize:{xs:12,md:15}},onClick:()=>{F(),d(Z6({guilds_key:n.key,state:"accepted",role:v()})).then(a=>{a.payload.error?r({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(t(),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),u.jsx(T,{size:"small",color:"error",startIcon:u.jsx(A0,{}),sx:{fontSize:{xs:12,md:15}},onClick:()=>{F(),d(K({title:"رد درخواست ثبت صنف",content:u.jsx(V0,{guild:n,updateTable:t})}))},children:"رد"})]}):u.jsxs(C,{container:!0,alignItems:"flex-start",justifyContent:"flex-start",gap:b.TINY,direction:"column",children:[u.jsx(T,{size:"small",color:"success",startIcon:u.jsx(v0,{}),sx:{fontSize:{xs:12,md:15}},onClick:()=>{F(),d(K({title:"ثبت کد احراز",content:u.jsx(S0,{item:n,updateTable:t})}))},children:"ثبت کد احراز"}),u.jsx(T,{size:"small",color:"secondary",startIcon:u.jsx(g0,{}),sx:{fontSize:{xs:12,md:15}},onClick:()=>{F(),d(j0({key:n.key})).then(a=>{a.payload.error?r({vertical:"top",horizontal:"center",msg:a.payload.error,severity:"error"}):(t(),r({vertical:"top",horizontal:"center",msg:"کد با موفقیت ارسال شد.",severity:"success"}))})},children:"ارسال مجدد کد"})]})]})})})]})},V0=({guild:n,updateTable:t})=>{const[s]=i.useContext(lu),[l,h]=i.useState(""),x=$();return u.jsxs(C,{container:!0,gap:b.TINY,children:[u.jsx(N,{placeholder:"دلیل رد درخواست...",value:l,onChange:d=>h(d.target.value)}),u.jsx(T,{fullWidth:!0,variant:"contained",color:"primary",disabled:!l,onClick:()=>{x(Z6({guilds_key:n.key,state:"rejected",message:l,role:v()})).then(d=>{d.payload.error?s({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(),x(nu()))})},children:"ثبت"})]})},B0=()=>{const n=$(),t=c=>{F(c.target.value)},[s,l]=i.useState([]),[h,x]=i.useState(0),[d,r]=i.useState(10),[g,F]=i.useState(""),[a,E]=i.useState(1),[P,U]=i.useState([]),O=async c=>{var I,R;n(Q());const _=await H.get(`total_guilds/?search=filter&value=${g}&role=${v()}&page=${c}&page_size=${d}&check=true&state=pending`);n(M()),l(((I=_.data)==null?void 0:I.results)||[]),x(((R=_.data)==null?void 0:R.count)||0)},p=c=>{O(c),E(c)},D=c=>{r(c),E(1)},w=()=>{O(a!==0?a:1)};i.useEffect(()=>{const c=s==null?void 0:s.map((_,I)=>{var R,G,f,o,e,S,y,L,A;return[a===1?I+1:I+d*(a-1)+1,`${(_==null?void 0:_.registerarFullname)||""} ${_!=null&&_.registerarMobile?"("+(_==null?void 0:_.registerarMobile)+" )":" "}`,(_==null?void 0:_.licenseNumber)||"-",(_==null?void 0:_.guildsName)||"-",`${((R=_==null?void 0:_.user)==null?void 0:R.fullname)||"-"} (${((G=_==null?void 0:_.user)==null?void 0:G.mobile)||"-"})`,((f=_==null?void 0:_.user)==null?void 0:f.nationalId)||"-",(_==null?void 0:_.typeActivity)||"-",(_==null?void 0:_.areaActivity)||"-",((o=_==null?void 0:_.address)==null?void 0:o.postalCode)||"-",`${((S=(e=_==null?void 0:_.address)==null?void 0:e.province)==null?void 0:S.name)||"-"}/${((L=(y=_==null?void 0:_.address)==null?void 0:y.city)==null?void 0:L.name)||"-"}/${((A=_==null?void 0:_.address)==null?void 0:A.address)||"-"}`,_!=null&&_.steward?"می باشد":"نمی باشد",_!=null&&_.hasInquiry?"استعلامی":"دستی",_!=null&&_.activeRegisterCode?"انجام شده":"انجام نشده",u.jsx(M0,{updateTable:w,guild:_},_==null?void 0:_.guildsName)]});U(c)},[s]),i.useEffect(()=>{O(1)},[n,d]);const j=async c=>{var _,I;c.preventDefault(),n(Q());try{const R=await H.get(`total_guilds/?role=${v()}&search=filter&value=${g}&page=1&page_size=${d}&check=true&state=pending`);l(((_=R.data)==null?void 0:_.results)||[]),x(((I=R.data)==null?void 0:I.count)||0),n(M())}catch(R){console.error("Error fetching data:",R),n(M())}};return u.jsxs(C,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(C,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[["AdminX","SuperAdmin"].includes(v())&&u.jsx(T,{variant:"contained",onClick:()=>{n(K({title:"ثبت واحد جدید",size:window.innerWidth<=600?"small":"auto",content:u.jsx(m6,{updateTable:w})}))},children:"ثبت واحد جدید"}),u.jsx(C,{children:u.jsxs("form",{onSubmit:j,children:[u.jsx(N,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:t}),u.jsx(T,{type:"submit",onClick:j,endIcon:u.jsx(cu,{}),children:"جستجو"})]})})]}),u.jsx(eu,{data:P,columns:["ردیف","ثبت کننده","شناسه صنف","نام واحد صنفی","نام شخص/شرکت","کدملی","نوع فعالیت","حوزه فعالیت","کدپستی","استان/شهر/آدرس","مباشر","نوع ثبت","احراز شماره موبایل","عملیات"],handlePageChange:p,totalRows:h,page:a,perPage:d,handlePerRowsChange:D,title:"درخواست های ثبت صنف"})]})},$0=()=>u.jsxs(C,{container:!0,gap:b.SMALL,p:b.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",children:[u.jsx(V,{to:v()==="CityJahad"?V6:B6,children:u.jsx(B,{icon:u.jsx(Z,{size:30,color:"#244CCC"}),title:"اصناف"})}),u.jsx(V,{to:v()==="CityJahad"?$6:k6,children:u.jsx(B,{icon:u.jsx(Fu,{size:30,color:"#244CCC"}),title:"مباشرین"})})]}),k0=()=>{const{pathname:n}=Yu();return u.jsxs(C,{container:!0,gap:b.SMALL,p:b.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",children:[u.jsx(V,{to:W6,children:u.jsx(B,{icon:u.jsx(Z,{size:30,color:"#244CCC"}),title:"درخواست های ثبت صنف"})}),u.jsx(V,{to:wu,active:n===wu?"true":null,children:u.jsx(B,{icon:u.jsx(Z,{size:30,color:"#244CCC"}),title:"اصناف"})}),u.jsx(V,{to:zu,active:n===zu?"true":null,children:u.jsx(B,{icon:u.jsx(Fu,{size:30,color:"#244CCC"}),title:"مباشرین"})})]})},Ou=iu("PROVINCE_GET_TOTAL_GUILDS_SERVICE",async({search:n="filter",value:t="",page:s=1,page_size:l=10,steward:h=!1,active_state:x="active",is_real_person:d=!0},{dispatch:r})=>{var g,F,a;try{r(Q());const{data:E,status:P}=await H.get("total_guilds/",{params:{search:n,value:t,role:v(),page:s,page_size:l,steward:h,active_state:x,is_real_person:d}});return r(M()),{data:E,status:P}}catch(E){return r(M()),{error:((F=(g=E.response)==null?void 0:g.data)==null?void 0:F.result)||((a=E.response)==null?void 0:a.data)||"خطا در دریافت اطلاعات"}}}),W0=()=>{const n=yu(o=>{var e,S;return(S=(e=o.userSlice)==null?void 0:e.userProfile)==null?void 0:S.key}),t=$(),[s,l]=i.useState([]),[h,x]=i.useState(0),[d,r]=i.useState(10),[g,F]=i.useState(""),[a,E]=i.useState(1),[P,U]=i.useState([]),[O,p]=i.useState(!1),[D,w]=i.useState("active"),j=o=>F(o.target.value),c=()=>p(!O),_=async o=>{var S,y;const e=await t(Ou({search:"filter",value:g,page:o,page_size:d,steward:O,active_state:D,is_real_person:!0}));e.payload.error?(console.error("Error fetching data:",e.payload.error),l([]),x(0)):(l(((S=e.payload.data)==null?void 0:S.results)||[]),x(((y=e.payload.data)==null?void 0:y.count)||0))},I=o=>{_(o),E(o)},R=o=>{r(o),E(1)},G=()=>{_(a!==0?a:1)};i.useEffect(()=>{_(1)},[t,O,D]),i.useEffect(()=>{if(!s||!Array.isArray(s)){U([]);return}const o=s.map((e,S)=>{var L,A,z,k,Y,X,Cu,fu,Ku,Qu,Ju,Zu,mu,u6,e6;const y=[a===1?S+1:S+d*(a-1)+1,(e==null?void 0:e.licenseNumber)||"-",(e==null?void 0:e.guildsName)||"-",`${((L=e==null?void 0:e.user)==null?void 0:L.fullname)||"-"} (${((A=e==null?void 0:e.user)==null?void 0:A.mobile)||"-"})`,(z=e==null?void 0:e.user)!=null&&z.nationalId?(k=e==null?void 0:e.user)==null?void 0:k.nationalId:"-",(e==null?void 0:e.typeActivity)||"-",(e==null?void 0:e.areaActivity)||"-",((Y=e==null?void 0:e.address)==null?void 0:Y.postalCode)||"-",`${((Cu=(X=e==null?void 0:e.address)==null?void 0:X.province)==null?void 0:Cu.name)||"-"}/${((Ku=(fu=e==null?void 0:e.address)==null?void 0:fu.city)==null?void 0:Ku.name)||"-"}/${((Qu=e==null?void 0:e.address)==null?void 0:Qu.address)||"-"}`,e!=null&&e.steward?"می باشد":"نمی باشد",e!=null&&e.limitationAllocation?"دارد":"ندارد",e!=null&&e.allocationLimit?e==null?void 0:e.allocationLimit:"-",(Ju=e==null?void 0:e.getPosStatus)!=null&&Ju.hasActivePons?"دارد":"ندارد",((Zu=e==null?void 0:e.getPosStatus)==null?void 0:Zu.lenActiveSessions)||"-"];return v()!=="KillHouse"&&(y.push(u.jsxs(T,{onClick:()=>{var du;const Uu=(du=e==null?void 0:e.stewards)==null?void 0:du.map((q,bu)=>{var _u;return[bu+1,(q==null?void 0:q.guildsName)||"-",((_u=q==null?void 0:q.user)==null?void 0:_u.mobile)||"-"]});t(K({title:"مباشرین",content:u.jsx(l6,{paginated:!0,title:"مباشرین",columns:["ردیف","نام و نام خانوادگی","تلفن"],data:Uu})}))},children:["نمایش (",((mu=e==null?void 0:e.stewards)==null?void 0:mu.length)||0,")"]},`stewards-${S}`)),y.push(u.jsxs(T,{onClick:()=>{var du;const Uu=(du=e==null?void 0:e.killHouse)==null?void 0:du.map((q,bu)=>{var _u,n6;return[bu+1,(q==null?void 0:q.name)||"-",((n6=(_u=q==null?void 0:q.killHouseOperator)==null?void 0:_u.user)==null?void 0:n6.mobile)||"-"]});t(K({title:"کشتارگاه ها",content:u.jsx(l6,{paginated:!0,title:"کشتارگاه ها",columns:["ردیف","نام و نام خانوادگی","تلفن"],data:Uu})}))},children:["نمایش (",((u6=e==null?void 0:e.killHouse)==null?void 0:u6.length)||0,")"]},`killHouse-${S}`))),["CityJahad","CityPoultry","KillHouse"].includes(v())||(y.splice(14,0,(e6=e==null?void 0:e.productInfo)!=null&&e6.totalCarcassesWeight?e.productInfo.totalCarcassesWeight.toLocaleString():"-"),y.splice(10,0,e!=null&&e.hasInquiry?"استعلامی":"دستی"),y.splice(11,0,e!=null&&e.activeRegisterCode?"انجام شده":"انجام نشده")),y==null||y.push(e!=null&&e.active?"فعال":"غیر فعال"),y.push(!(e!=null&&e.isRegistered)&&(e!=null&&e.registerCode)&&!(e!=null&&e.loggedRegistrationCode)?"در انتظار ورود کد احراز":e!=null&&e.isRegistered&&(e==null?void 0:e.provinceAcceptState)==="pending"?"در انتظار تایید استان":e!=null&&e.isRegistered?"احراز شده":"احراز نشده"),v()!=="KillHouse"&&y.push(u.jsx(F0,{guild:e,updateTable:G,isModal:!0})),y});U(o)},[s]),i.useEffect(()=>{_(1)},[d]);const f=async o=>{var S,y;o.preventDefault();const e=await t(Ou({search:"filter",value:g,page:a,page_size:d,steward:O,active_state:D,is_real_person:!0}));e.payload.error?(console.error("Error fetching data:",e.payload.error),l([]),x(0)):(l(((S=e.payload.data)==null?void 0:S.results)||[]),x(((y=e.payload.data)==null?void 0:y.count)||0))};return u.jsxs(C,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,mt:2,children:[u.jsxs(C,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx("form",{onSubmit:f,children:u.jsxs(C,{container:!0,alignItems:"center",gap:b.SMALL,children:[["GuildRoom","KillHouse"].includes(v())&&u.jsx(T,{variant:"contained",onClick:()=>{t(K({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,size:window.innerWidth<=600?"small":"auto",title:"ثبت واحد جدید",content:u.jsx(m6,{updateTable:G})}))},children:"ثبت واحد جدید"}),u.jsx(N,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:200},onChange:j}),u.jsx(ou,{style:{marginRight:4},control:u.jsx(m,{checked:O,onChange:c,name:"checkboxName",color:"primary"}),label:"نمایش مباشرین"}),v()!=="KillHouse"&&u.jsxs(N,{select:!0,size:"small",label:"وضعیت",value:D,onChange:o=>w(o.target.value),sx:{width:150},children:[u.jsx(uu,{value:"all",children:"همه"}),u.jsx(uu,{value:"active",children:"فعال"}),u.jsx(uu,{value:"deactive",children:"غیرفعال"})]}),u.jsx(T,{type:"submit",onClick:f,endIcon:u.jsx(cu,{}),children:"جستجو"})]})}),v()!=="KillHouse"&&u.jsx(C,{children:u.jsx(Tu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${H.defaults.baseURL}guilds_excel/?key=${n}&search=filter&value=${g}&role=${v()}&active_state=${D}`,rel:"noreferrer",children:u.jsx(T,{color:"success",children:u.jsx(J6,{size:32})})})})})]}),u.jsx(eu,{data:P,columns:v()==="CityJahad"||v()==="CityPoultry"?["ردیف","شناسه صنف","نام واحد صنفی","نام شخص/شرکت","کدملی","نوع فعالیت","حوزه فعالیت","کدپستی","استان/شهر/آدرس","مباشر","محدودیت تخصیص","حداکثر تخصیص","وضعیت کارتخوان","تعداد کارتخوان ","مباشرین","وضعیت فعالیت","وضعیت","کشتارگاه ها"]:v()==="KillHouse"?["ردیف","شناسه صنف","نام واحد صنفی","نام شخص/شرکت","کدملی","نوع فعالیت","حوزه فعالیت","کدپستی","استان/شهر/آدرس","مباشر","محدودیت تخصیص","حداکثر تخصیص","وضعیت کارتخوان","تعداد کارتخوان ","وضعیت فعالیت","وضعیت"]:["ردیف","شناسه صنف","نام واحد صنفی","نام شخص/شرکت","کدملی","نوع فعالیت","حوزه فعالیت","کدپستی","استان/شهر/آدرس","مباشر","نوع ثبت","احراز شماره موبایل","محدودیت تخصیص","حداکثر تخصیص","وضعیت کارتخوان","تعداد کارتخوان ","وزن خرید (کیلوگرم)","مباشرین","کشتارگاه ها","وضعیت فعالیت","وضعیت","عملیات"],handlePageChange:I,totalRows:h,page:a,perPage:d,handlePerRowsChange:R,title:"مدیریت اصناف"})]})},H0=()=>{const[n,t]=i.useState(0),s=(l,h)=>{t(h)};return u.jsxs(C,{container:!0,alignItems:"center",justifyContent:"center",children:[u.jsx(C,{xs:12,container:!0,alignItems:"center",justifyContent:"center",children:u.jsxs(s0,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:n,onChange:s,mt:2,children:[u.jsx(s6,{label:"اصناف",value:0}),v()!=="KillHouse"&&u.jsx(s6,{label:"نشست ها",value:1})]})}),n===0&&u.jsx(W0,{readOnly:!0}),n===1&&u.jsx(y0,{readOnly:!0})]})},Y0=Hu({percentInsideProvince:Du().typeError("باید عدد وارد کنید").min(0,"نمی‌تواند کمتر از 0 باشد").max(100,"نمی‌تواند بیشتر از 100 باشد").required("الزامی"),percentOutsideProvince:Du().typeError("باید عدد وارد کنید").min(0,"نمی‌تواند کمتر از 0 باشد").max(100,"نمی‌تواند بیشتر از 100 باشد").required("الزامی"),percentSegmentation:Du().typeError("باید عدد وارد کنید").min(0,"نمی‌تواند کمتر از 0 باشد").max(100,"نمی‌تواند بیشتر از 100 باشد").required("الزامی")}).test("total-percentage","مجموع درصدها نمی‌تواند بیشتر از 100 باشد",function(n){const{percentInsideProvince:t,percentOutsideProvince:s,percentSegmentation:l}=n;return(t||0)+(s||0)+(l||0)<=100}),d6=({item:n,updateTable:t,type:s,isDashboard:l})=>{const[h]=i.useContext(lu),x=$(),d=l?pu:hu,r=Wu({initialValues:{percentInsideProvince:s==="gov"?n==null?void 0:n.inProvinceGovernmentalSellingPercent:(n==null?void 0:n.inProvinceFreeSellingPercent)||0,percentOutsideProvince:s==="gov"?n==null?void 0:n.outProvinceGovernmentalSellingPercent:(n==null?void 0:n.outProvinceFreeSellingPercent)||0,percentSegmentation:s==="gov"?n==null?void 0:n.segmentationGovernmentalPercent:(n==null?void 0:n.segmentationFreeSellingPercent)||0},validationSchema:Y0,onSubmit:a=>{x(d({...l?{}:{key:n==null?void 0:n.key},...s==="gov"?{governmental_selling_permission:!0,in_province_governmental_selling_percent:a.percentInsideProvince,segmentation_governmental_percent:a.percentSegmentation,out_province_governmental_selling_percent:a.percentOutsideProvince}:{free_selling_permission:!0,in_province_free_selling_percent:a.percentInsideProvince,out_province_free_selling_percent:a.percentOutsideProvince,segmentation_free_selling_percent:a.percentSegmentation}})).then(E=>{E.payload.error?h({vertical:"top",horizontal:"center",msg:E.payload.error,severity:"error"}):h({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),x(nu()),t()})}}),F=(()=>{const{percentInsideProvince:a,percentOutsideProvince:E,percentSegmentation:P}=r.values;return(a||0)+(E||0)+(P||0)})();return u.jsx(Eu,{component:"form",onSubmit:r.handleSubmit,sx:{width:"100%"},children:u.jsxs(C,{container:!0,spacing:2,alignItems:"flex-start",children:[u.jsx(C,{item:!0,xs:12,sm:4,children:u.jsx(N,{fullWidth:!0,id:"percentInsideProvince",name:"percentInsideProvince",label:"حداقل توزیع داخل استان",type:"number",value:r.values.percentInsideProvince,onChange:r.handleChange,onBlur:r.handleBlur,error:r.touched.percentInsideProvince&&!!r.errors.percentInsideProvince,helperText:r.touched.percentInsideProvince&&r.errors.percentInsideProvince,inputProps:{min:0,max:100,step:.1},size:"small"})}),u.jsx(C,{item:!0,xs:12,sm:4,children:u.jsx(N,{fullWidth:!0,id:"percentOutsideProvince",name:"percentOutsideProvince",label:"حداکثر فروش خارج استان",type:"number",value:r.values.percentOutsideProvince,onChange:r.handleChange,onBlur:r.handleBlur,error:r.touched.percentOutsideProvince&&!!r.errors.percentOutsideProvince,helperText:r.touched.percentOutsideProvince&&r.errors.percentOutsideProvince,inputProps:{min:0,max:100,step:.1},size:"small"})}),u.jsx(C,{item:!0,xs:12,sm:4,children:u.jsx(N,{fullWidth:!0,id:"percentSegmentation",name:"percentSegmentation",label:"حداکثر قطعه بندی",type:"number",value:r.values.percentSegmentation,onChange:r.handleChange,onBlur:r.handleBlur,error:r.touched.percentSegmentation&&!!r.errors.percentSegmentation,helperText:r.touched.percentSegmentation&&r.errors.percentSegmentation,inputProps:{min:0,max:100,step:.1},size:"small"})}),u.jsxs(C,{container:!0,xs:12,justifyContent:"center",spacing:1,children:[u.jsx(C,{xs:6,children:u.jsx(T,{onClick:r.handleSubmit,variant:"contained",color:"primary",disabled:!r.isValid||F>100,fullWidth:!0,children:"ثبت"})}),u.jsx(C,{xs:6,children:u.jsx(T,{onClick:()=>x(nu()),variant:"contained",color:"error",fullWidth:!0,children:"انصراف"})})]})]})})},X0=()=>{const n=o=>{a(o.target.value)},[t]=i.useContext(lu),s=$(),[l,h]=i.useState([]),[x,d]=i.useState(0),[r,g]=i.useState(10),[F,a]=i.useState(""),[E,P]=i.useState(1),[U,O]=i.useState([]),[p,D]=i.useState([]),w=()=>{s(f0()).then(o=>{D(o.payload.data)})},j=async o=>{let e;s(Q()),e=await H.get(`guilds-for-configs/?search=filter&value=${F}&role=${v()}&page=${o}&page_size=${r}`),w(),s(M()),h(e.data.results),d(e.data.count)},c=o=>{j(o),P(o)},_=o=>{g(o),P(1)},I=()=>{j(E!==0?E:1)},R=(o,e)=>{s(K({title:"فروش دولتی",content:u.jsx(d6,{item:o,updateTable:I,type:"gov",isDashboard:e})}))},G=(o,e)=>{s(K({title:"فروش آزاد",content:u.jsx(d6,{item:o,updateTable:I,type:"free",isDashboard:e})}))};i.useEffect(()=>{const o=l==null?void 0:l.map((e,S)=>{var y,L;return[E===1?S+1:S+r*(E-1)+1,`${(y=e==null?void 0:e.user)==null?void 0:y.fullname} (${(L=e==null?void 0:e.user)==null?void 0:L.mobile})`,u.jsx(c6,{amount:e==null?void 0:e.outProvinceFreeBuyingCommitmentPercent,updateTable:I,item:e,isGuild:!0},S),u.jsx(m,{checked:e==null?void 0:e.freeSaleFromFreeQuotaInProvince,onClick:()=>{s(hu({key:e==null?void 0:e.key,free_sale_from_free_quota_in_province:!(e!=null&&e.freeSaleFromFreeQuotaInProvince)})).then(A=>{A.payload.error?t({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"}):(I(),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}},S),u.jsx(m,{checked:e==null?void 0:e.freeSaleFormGovernmentalQuota,onClick:()=>{s(hu({key:e==null?void 0:e.key,free_sale_form_governmental_quota:!(e!=null&&e.freeSaleFormGovernmentalQuota)})).then(A=>{A.payload.error?t({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"}):(I(),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}},S),u.jsxs(C,{container:!0,alignItems:"center",xs:12,justifyContent:"start",direction:"row",children:[u.jsx(C,{xs:6,children:u.jsx(m,{checked:e==null?void 0:e.governmentalSellingPermission,onChange:()=>{const A=!(e!=null&&e.governmentalSellingPermission);s(hu({key:e==null?void 0:e.key,governmental_selling_permission:A,...A===!1?{in_province_governmental_selling_percent:0,segmentation_governmental_percent:0,out_province_governmental_selling_percent:0}:{}})).then(()=>{A===!0?R(e):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),I()})}})}),(e==null?void 0:e.governmentalSellingPermission)&&u.jsx(C,{xs:6,children:u.jsx(su,{size:"small",onClick:()=>R(e),color:"primary",children:u.jsx(au,{})})})]},S),u.jsxs(C,{container:!0,alignItems:"center",xs:12,justifyContent:"center",direction:"row",children:[u.jsx(C,{xs:6,children:u.jsx(m,{checked:e==null?void 0:e.freeSellingPermission,onChange:()=>{const A=!(e!=null&&e.freeSellingPermission);s(hu({key:e==null?void 0:e.key,free_selling_permission:A,...A===!1?{in_province_free_selling_percent:0,out_province_free_selling_percent:0,segmentation_free_selling_percent:0}:{}})).then(()=>{A===!0?G(e):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),I()})}})}),u.jsxs(C,{xs:6,children:[(e==null?void 0:e.freeSellingPermission)&&u.jsx(su,{size:"small",onClick:()=>G(e),color:"primary",children:u.jsx(au,{})})," "]})]},S),e==null?void 0:e.inProvinceGovernmentalSellingPercent,e==null?void 0:e.outProvinceGovernmentalSellingPercent,e==null?void 0:e.segmentationGovernmentalPercent,e==null?void 0:e.inProvinceFreeSellingPercent,e==null?void 0:e.outProvinceFreeSellingPercent,e==null?void 0:e.segmentationFreeSellingPercent]});O(o)},[l]),i.useEffect(()=>{j(1)},[s,r]);const f=async o=>{o.preventDefault(),s(Q());try{const e=await H.get(`guilds-for-configs/?role=${v()}&search=filter&value=${F}&page=1&page_size=${r}`);h(e.data.results),d(e.data.count),s(M())}catch(e){console.error("Error fetching data:",e)}};return u.jsxs(C,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(C,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(eu,{noPagination:!0,isDashboard:!0,columns:["درصد تحویل خرید خارج استان","فروش آزاد به داخل استان","فروش آزاد از سهمیه دولتی","فروش دولتی","فروش آزاد","درصد فروش دولتی داخل استان","درصد فروش دولتی خارج استان","درصد فروش دولتی قطعه بندی","درصد فروش آزاد داخل استان","درصد فروش آزاد خارج استان","درصد فروش آزاد قطعه بندی"],data:[[u.jsx(c6,{amount:p==null?void 0:p.outProvinceFreeBuyingCommitmentPercent,updateTable:I,item:p,isGuild:!0,isDashboard:!0},p),u.jsx(m,{checked:p==null?void 0:p.freeSaleFromFreeQuotaInProvince,onClick:()=>{s(pu({free_sale_from_free_quota_in_province:!(p!=null&&p.freeSaleFromFreeQuotaInProvince)})).then(o=>{o.payload.error?t({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(I(),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}},p),u.jsx(m,{checked:p==null?void 0:p.freeSaleFormGovernmentalQuota,onClick:()=>{s(pu({free_sale_form_governmental_quota:!(p!=null&&p.freeSaleFormGovernmentalQuota)})).then(o=>{o.payload.error?t({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(I(),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}},p),u.jsxs(C,{container:!0,alignItems:"center",xs:12,justifyContent:"start",direction:"row",children:[u.jsx(C,{xs:6,children:u.jsx(m,{checked:p==null?void 0:p.governmentalSellingPermission,onChange:()=>{const o=!(p!=null&&p.governmentalSellingPermission);s(pu({governmental_selling_permission:o,...o===!1?{in_province_governmental_selling_percent:0,segmentation_governmental_percent:0,out_province_governmental_selling_percent:0}:{}})).then(()=>{o===!0?R(p,!0):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),I()})}})}),(p==null?void 0:p.governmentalSellingPermission)&&u.jsx(C,{xs:6,children:u.jsx(su,{size:"small",onClick:()=>R(p,!0),color:"primary",children:u.jsx(au,{})})})]},p),u.jsxs(C,{container:!0,alignItems:"center",xs:12,justifyContent:"center",direction:"row",children:[u.jsx(C,{xs:6,children:u.jsx(m,{checked:p==null?void 0:p.freeSellingPermission,onChange:()=>{const o=!(p!=null&&p.freeSellingPermission);s(pu({free_selling_permission:o,...o===!1?{in_province_free_selling_percent:0,out_province_free_selling_percent:0,segmentation_free_selling_percent:0}:{}})).then(()=>{o===!0?G(p,!0):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),I()})}})}),u.jsxs(C,{xs:6,children:[(p==null?void 0:p.freeSellingPermission)&&u.jsx(su,{size:"small",onClick:()=>G(p,!0),color:"primary",children:u.jsx(au,{})})," "]})]},p),p==null?void 0:p.inProvinceGovernmentalSellingPercent,p==null?void 0:p.outProvinceGovernmentalSellingPercent,p==null?void 0:p.segmentationGovernmentalPercent,p==null?void 0:p.inProvinceFreeSellingPercent,p==null?void 0:p.outProvinceFreeSellingPercent,p==null?void 0:p.segmentationFreeSellingPercent]],title:"تنظیمات کلی"})}),u.jsx(C,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:u.jsx(C,{children:u.jsxs("form",{onSubmit:f,children:[u.jsx(N,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:n}),u.jsx(T,{type:"submit",onClick:f,endIcon:u.jsx(cu,{}),children:"جستجو"})]})})}),u.jsx(eu,{data:U,columns:["ردیف","نام مباشر","درصد تحویل خرید خارج استان","فروش آزاد به داخل استان","فروش آزاد از سهمیه دولتی","فروش دولتی","فروش آزاد","درصد فروش دولتی داخل استان","درصد فروش دولتی خارج استان","درصد فروش دولتی قطعه بندی","درصد فروش آزاد داخل استان","درصد فروش آزاد خارج استان","درصد فروش آزاد قطعه بندی"],handlePageChange:c,totalRows:x,page:E,perPage:r,handlePerRowsChange:_,title:"مباشرین"})]})},q0=async({role:n,page:t,pageSize:s,searchValue:l=""})=>await H.get(`out-province-carcasses-buyer/?search=filter&value=${l}&role=${n}&page=${t}&page_size=${s}&state=buyer-list&type=real`),K0=async({role:n,page:t,pageSize:s,searchValue:l=""})=>await H.get(`out-province-carcasses-buyer/?search=filter&value=${l}&role=${n}&page=${t}&page_size=${s}&state=buyer-list&type=legal`),Q0=()=>{const n=j=>{F(j.target.value)},t=$(),[s,l]=i.useState([]),[h,x]=i.useState(0),[d,r]=i.useState(10),[g,F]=i.useState(""),[a,E]=i.useState(1),[P,U]=i.useState([]),O=async j=>{t(Q());try{const c=await q0({role:v(),page:j,pageSize:d,searchValue:g});l(c.data.results),x(c.data.count)}catch(c){console.error("Error fetching data:",c)}finally{t(M())}},p=j=>{O(j),E(j)},D=j=>{r(j),E(1)};i.useEffect(()=>{const j=s==null?void 0:s.map((c,_)=>{var f,o,e,S,y,L,A,z,k,Y;const I=((f=c==null?void 0:c.KillHouse)==null?void 0:f.name)||"-",R=((S=(e=(o=c==null?void 0:c.KillHouse)==null?void 0:o.killHouseOperator)==null?void 0:e.user)==null?void 0:S.fullname)||"",G=R?`${I} (${R})`:I;return[a===1?_+1:_+d*(a-1)+1,`${c==null?void 0:c.fullname} (${c==null?void 0:c.mobile})`,(c==null?void 0:c.unitName)||"-",G,(c==null?void 0:c.province)||"-",(c==null?void 0:c.city)||"-",((L=(y=c==null?void 0:c.requestsInfo)==null?void 0:y.numberOfRequests)==null?void 0:L.toLocaleString())||"0",((z=(A=c==null?void 0:c.requestsInfo)==null?void 0:A.totalQuantity)==null?void 0:z.toLocaleString())||"0",((Y=(k=c==null?void 0:c.requestsInfo)==null?void 0:k.totalWeight)==null?void 0:Y.toLocaleString())||"0"]});U(j)},[s,a,d]),i.useEffect(()=>{O(1)},[t,d]);const w=async j=>{j.preventDefault(),O(1),E(1)};return u.jsxs(C,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(C,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:u.jsx(C,{children:u.jsxs("form",{onSubmit:w,children:[u.jsx(N,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},value:g,onChange:n}),u.jsx(T,{type:"submit",onClick:w,endIcon:u.jsx(cu,{}),children:"جستجو"})]})})}),u.jsx(eu,{data:P,columns:["ردیف","مشخصات خریدار","نام واحد","کشتارگاه","استان","شهر","تعداد درخواست ها","حجم تقریبی (قطعه)","وزن (کیلوگرم)"],handlePageChange:p,totalRows:h,page:a,perPage:d,handlePerRowsChange:D,title:"اصناف حقیقی خارج استان"})]})},J0=iu("PROVINCE_GET_LEGAL_PERSON_UNIT_INFO_SERVICE",async(n,{dispatch:t})=>{var s,l,h;try{t(Q());const{data:x,status:d}=await H.get(`get_legal_person_unit_info/?national_code=${n}`);return t(M()),{data:x,status:d}}catch(x){return t(M()),{error:((l=(s=x.response)==null?void 0:s.data)==null?void 0:l.result)||((h=x.response)==null?void 0:h.data)||"خطا در دریافت اطلاعات"}}}),Z0=iu("PROVINCE_CREATE_LEGAL_GUILD_SERVICE",async(n,{dispatch:t})=>{var s,l,h;try{t(Q());const{data:x,status:d}=await H.post("register_legal_guild/",n);return t(M()),{data:x,status:d}}catch(x){return t(M()),{error:((l=(s=x.response)==null?void 0:s.data)==null?void 0:l.result)||((h=x.response)==null?void 0:h.data)||"خطا در ثبت اطلاعات"}}});let Ru=null,Lu=!1,Nu="";const m0=n=>{if(!n||typeof n!="string")return"";const t=n.match(/شهرستان\s+([^\s]+(?:\s+[^\s]+)?)/);if(t&&t[1])return t[1].trim();const s=n.split(/\s+/);for(let l=0;lu.jsxs(Eu,{display:"flex",alignItems:l?"flex-start":"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[u.jsx(n,{color:"action",sx:l}),u.jsxs(Eu,{children:[u.jsx(tu,{variant:"caption",color:"text.secondary",children:t}),u.jsx(tu,{variant:"body1",children:s||"-"})]})]}),ue=(n,t)=>Hu({national_id:W().required("شناسه حقوقی الزامی است").matches(/^[0-9]{11}$/,"شناسه حقوقی باید 11 رقم باشد"),first_name:n||!t?W():W(),last_name:n||!t?W():W(),unit_name:n||!t?W():W(),province:n||!t?W():W(),city:W(),mobile:n||!t?W().nullable().test("mobile-format","شماره تلفن باید 11 رقم باشد",s=>!s||/^[0-9]{11}$/.test(s)):W(),type_activity:n||!t?W():W()}),ee=({formik:n,isAdmin:t,cities:s,typeActivities:l})=>u.jsx("form",{onSubmit:n.handleSubmit,children:u.jsxs(C,{container:!0,gap:b.SMALL,p:2,children:[u.jsx(C,{item:!0,xs:12,children:u.jsx(tu,{variant:"h6",style:{fontSize:"16px"},gutterBottom:!0,children:"اطلاعات واحد حقوقی"})}),u.jsxs(C,{container:!0,spacing:2,xs:12,children:[u.jsx(C,{item:!0,xs:12,md:6,children:u.jsxs(C,{container:!0,direction:"column",gap:b.TINY,children:[u.jsx(C,{item:!0,xs:12,children:t?u.jsx(N,{label:"شناسه حقوقی",variant:"outlined",fullWidth:!0,id:"national_id",name:"national_id",value:n.values.national_id,onChange:n.handleChange,onBlur:n.handleBlur,error:!!n.errors.national_id,helperText:n.errors.national_id,inputProps:{maxLength:11},disabled:!0}):u.jsx(ru,{icon:I0,label:"شناسه حقوقی",value:n.values.national_id})}),u.jsx(C,{item:!0,xs:12,children:t?u.jsx(N,{label:"نام",variant:"outlined",fullWidth:!0,id:"first_name",name:"first_name",value:n.values.first_name,onChange:n.handleChange,onBlur:n.handleBlur,error:!!n.errors.first_name,helperText:n.errors.first_name}):u.jsx(ru,{icon:C6,label:"نام",value:n.values.first_name})}),u.jsx(C,{item:!0,xs:12,children:t?u.jsx(N,{label:"نام خانوادگی",variant:"outlined",fullWidth:!0,id:"last_name",name:"last_name",value:n.values.last_name,onChange:n.handleChange,onBlur:n.handleBlur,error:!!n.errors.last_name,helperText:n.errors.last_name}):u.jsx(ru,{icon:C6,label:"نام خانوادگی",value:n.values.last_name})}),u.jsx(C,{item:!0,xs:12,children:t?u.jsx(N,{label:"نام واحد",variant:"outlined",fullWidth:!0,id:"unit_name",name:"unit_name",value:n.values.unit_name,onChange:n.handleChange,onBlur:n.handleBlur,error:!!n.errors.unit_name,helperText:n.errors.unit_name}):u.jsx(ru,{icon:i6,label:"نام واحد",value:n.values.unit_name})})]})}),u.jsx(C,{item:!0,xs:12,md:6,children:u.jsxs(C,{container:!0,direction:"column",gap:b.TINY,children:[u.jsx(C,{item:!0,xs:12,children:t?u.jsx(N,{label:"استان",variant:"outlined",fullWidth:!0,id:"province",name:"province",value:n.values.province,onChange:n.handleChange,onBlur:n.handleBlur,error:!!n.errors.province,helperText:n.errors.province}):u.jsx(ru,{icon:l0,label:"استان",value:n.values.province})}),u.jsx(C,{item:!0,xs:12,children:u.jsxs(t6,{fullWidth:!0,children:[u.jsx(r6,{id:"city-select-label",children:"شهرستان"}),u.jsxs(a6,{labelId:"city-select-label",id:"city",name:"city",value:n.values.city||"",label:"شهرستان",onChange:h=>{n.setFieldValue("city",h.target.value)},onBlur:n.handleBlur,disabled:!1,children:[s.map(h=>u.jsx(uu,{value:h.name,children:h.name},h.key)),n.values.city&&!s.some(h=>h.name===n.values.city)&&u.jsx(uu,{value:n.values.city,children:n.values.city},"current-value")]})]})}),u.jsx(C,{item:!0,xs:12,children:u.jsx(N,{label:"شماره همراه",variant:"outlined",fullWidth:!0,id:"mobile",name:"mobile",value:n.values.mobile,onChange:n.handleChange,onBlur:n.handleBlur,error:!!n.errors.mobile,helperText:n.errors.mobile,inputProps:{maxLength:11}})}),u.jsx(C,{item:!0,xs:12,children:t?u.jsxs(t6,{fullWidth:!0,children:[u.jsx(r6,{id:"type-activity-select-label",children:"نوع فعالیت"}),u.jsxs(a6,{labelId:"type-activity-select-label",id:"type_activity",name:"type_activity",value:n.values.type_activity||"",label:"نوع فعالیت",onChange:h=>{n.setFieldValue("type_activity",h.target.value)},onBlur:n.handleBlur,children:[l.map(h=>u.jsx(uu,{value:h.title,children:h.title},h.key)),n.values.type_activity&&!l.some(h=>h.title===n.values.type_activity)&&u.jsx(uu,{value:n.values.type_activity,children:n.values.type_activity},"current-value")]})]}):u.jsx(ru,{icon:i6,label:"نوع فعالیت",value:n.values.type_activity})})]})})]}),u.jsx(C,{item:!0,xs:12,mt:2,children:u.jsx(T,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,disabled:!n.isValid,children:"ثبت"})})]})}),ne=({onInquiry:n,nationalCode:t,setNationalCode:s})=>u.jsxs(C,{container:!0,gap:b.SMALL,p:2,children:[u.jsx(C,{item:!0,xs:12,children:u.jsx(N,{label:"شناسه حقوقی",variant:"outlined",fullWidth:!0,value:t,onChange:l=>s(l.target.value),placeholder:"شناسه حقوقی 11 رقمی را وارد کنید",inputProps:{maxLength:11}})}),u.jsx(C,{item:!0,xs:12,children:u.jsx(T,{color:"primary",fullWidth:!0,variant:"contained",onClick:n,disabled:!t||t.length!==11,children:"استعلام"})})]}),qu=({onClose:n,updateTable:t,guild:s})=>{var _,I,R,G,f,o,e,S,y,L;const l=$(),[h]=i.useContext(lu),[x,d]=i.useState(((_=s==null?void 0:s.user)==null?void 0:_.national_id)||(s==null?void 0:s.national_code)||Nu||""),[r,g]=i.useState(s?{national_id:((I=s==null?void 0:s.user)==null?void 0:I.national_id)||(s==null?void 0:s.national_code)||"",first_name:((R=s==null?void 0:s.user)==null?void 0:R.first_name)||"",last_name:((G=s==null?void 0:s.user)==null?void 0:G.last_name)||"",unit_name:(s==null?void 0:s.guilds_name)||"",province:((o=(f=s==null?void 0:s.address)==null?void 0:f.province)==null?void 0:o.name)||"",city:((S=(e=s==null?void 0:s.address)==null?void 0:e.city)==null?void 0:S.name)||"",address:((y=s==null?void 0:s.address)==null?void 0:y.address)||"",mobile:((L=s==null?void 0:s.user)==null?void 0:L.mobile)||"",type_activity:(s==null?void 0:s.type_activity)||""}:Ru),[F,a]=i.useState(s?!0:Lu),[E,P]=i.useState([]),[U,O]=i.useState([]),D=v()==="AdminX";i.useEffect(()=>{l(a0()).then(A=>{P(A.payload.data||[])}),l(o0()).then(A=>{O(A.payload.data||[])})},[l]),i.useEffect(()=>{Ru&&(g(Ru),a(Lu),d(Nu))},[]);const w=i.useRef(!1);i.useEffect(()=>{r&&!w.current&&(w.current=!0,Ru=r,Lu=F,Nu=x,l(K({title:"ثبت واحد حقوقی",content:u.jsx(qu,{onClose:n,updateTable:t}),size:{xs:"96vw",md:"90vw",lg:"600px"}})))},[r,l,n,t,F,x]);const j=i.useCallback(()=>{if(!x||x.length!==11){h({vertical:"top",horizontal:"center",msg:"لطفا شناسه حقوقی 11 رقمی معتبر وارد کنید",severity:"error"});return}l(J0(x)).then(A=>{if(A.payload.error)a(!1),D?g({is_real_person:!1,first_name:"",last_name:"",national_id:x,province:"",unit_name:"",mobile:"",type_activity:""}):h({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"});else if(A.payload.data){a(!0);const z=m0(A.payload.data.address||"");g({...A.payload.data,city:z}),h({vertical:"top",horizontal:"center",msg:"اطلاعات با موفقیت دریافت شد",severity:"success"})}})},[l,x,h,D]),c=Wu({initialValues:{national_id:(r==null?void 0:r.national_id)||(r==null?void 0:r.nationalId)||"",first_name:(r==null?void 0:r.first_name)||(r==null?void 0:r.firstName)||"",last_name:(r==null?void 0:r.last_name)||(r==null?void 0:r.lastName)||"",unit_name:(r==null?void 0:r.unit_name)||(r==null?void 0:r.unitName)||"",province:(r==null?void 0:r.province)||"",city:(r==null?void 0:r.city)||"",address:(r==null?void 0:r.address)||"",mobile:(r==null?void 0:r.mobile)||"",type_activity:(r==null?void 0:r.type_activity)||""},validationSchema:ue(D,F),enableReinitialize:!0,onSubmit:A=>{const z=U.find(X=>X.title===A.type_activity),k=(z==null?void 0:z.key)||"",Y={first_name:A.first_name,last_name:A.last_name,national_id:A.national_id,province:A.province,address:A.address||"",unit_name:A.unit_name,mobile:A.mobile||"",city:A.city,type_activity:k,...(s==null?void 0:s.key)&&{guilds_key:s.key}};l(Z0(Y)).then(X=>{X.payload.error?h({vertical:"top",horizontal:"center",msg:X.payload.error,severity:"error"}):(h({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t&&t(),l(nu()))})}});return!r&&!s?u.jsx(ne,{onInquiry:j,nationalCode:x,setNationalCode:d}):u.jsx(ee,{formik:c,isAdmin:D,cities:E,typeActivities:U})},se=({guild:n,updateTable:t})=>{const s=$(),[l,h]=i.useState(n==null?void 0:n.active),[x,d]=i.useState(!1),[r,g]=i.useState(null),F=O=>{d(!0),g(O.currentTarget)},a=()=>{d(!1),g(null)},E=O=>{const p=O.target.checked;h(p)},P=()=>{a(),s(K({title:"تایید حذف",size:"auto",content:u.jsxs(Eu,{sx:{p:2,minWidth:300},children:[u.jsx(tu,{sx:{mb:3},children:"آیا از حذف این واحد حقوقی اطمینان دارید؟"}),u.jsxs(C,{container:!0,direction:"row",justifyContent:"space-between",children:[u.jsx(T,{variant:"outlined",onClick:()=>s(nu()),sx:{width:"48%"},children:"انصراف"}),u.jsx(T,{variant:"contained",color:"error",onClick:()=>{s(nu())},sx:{width:"48%"},children:"حذف"})]})]})}))},U=()=>{a(),s(K({title:"ویرایش واحد حقوقی",content:u.jsx(qu,{guild:n,onClose:()=>s(nu()),updateTable:t}),size:window.innerWidth<=600?"small":"auto"}))};return u.jsxs(C,{children:[u.jsx(Tu,{title:"عملیات",placement:"left",children:u.jsx(su,{color:"primary",onClick:F,children:u.jsx(Xu,{})})}),u.jsx(Mu,{open:x,anchorEl:r,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsx("div",{style:{padding:10},children:u.jsxs(C,{container:!0,direction:"column",alignItems:"flex-start",justifyContent:"center",gap:1,children:[u.jsx(ou,{control:u.jsx(Pu,{checked:l,onChange:E,color:"primary"}),label:l?"فعال":"غیرفعال",style:{justifyContent:"center",alignItems:"center",display:"flex"}}),u.jsx(T,{color:"primary",size:"small",startIcon:u.jsx(au,{}),sx:{fontSize:{xs:12,md:15}},onClick:U,children:"ویرایش"}),u.jsx(T,{size:"small",color:"error",startIcon:u.jsx(R0,{}),sx:{fontSize:{xs:12,md:15}},onClick:P,children:"حذف"})]})})})]})},te=()=>{const n=$(),[t,s]=i.useState([]),[l,h]=i.useState(0),[x,d]=i.useState(10),[r,g]=i.useState(""),[F,a]=i.useState(1),[E,P]=i.useState([]),[U,O]=i.useState(null),[p,D]=i.useState(null),w=f=>g(f.target.value),j=async f=>{var e,S;const o=await n(Ou({search:"filter",value:r,page:f,page_size:x,steward:!1,active_state:"all",is_real_person:!1,...U&&{date_from:Iu(U).format("YYYY-MM-DD")},...p&&{date_to:Iu(p).format("YYYY-MM-DD")}}));if(o.payload.error)console.error("Error fetching data:",o.payload.error),s([]),h(0);else{s(((e=o.payload.data)==null?void 0:e.results)||[]);const y=Number((S=o.payload.data)==null?void 0:S.count)||0;h(y)}},c=f=>{j(f),a(f)},_=f=>{d(Number(f)),a(1)},I=()=>{j(F!==0?F:1)};i.useEffect(()=>{if(!t||!Array.isArray(t)){P([]);return}const f=t.map((o,e)=>{var S,y,L,A,z,k;return[F===1?e+1:e+x*(F-1)+1,(o==null?void 0:o.nationalId)||"-",(o==null?void 0:o.guildsName)||"-",`${((S=o==null?void 0:o.user)==null?void 0:S.fullname)||"-"}`,((y=o==null?void 0:o.user)==null?void 0:y.mobile)||"-",((A=(L=o==null?void 0:o.address)==null?void 0:L.province)==null?void 0:A.name)||"-",((k=(z=o==null?void 0:o.address)==null?void 0:z.city)==null?void 0:k.name)||"-",(o==null?void 0:o.typeActivity)||"-",o!=null&&o.active?"فعال":"غیر فعال",u.jsx(se,{guild:o,updateTable:I},`operations-${(o==null?void 0:o.key)||e}`)]});P(f)},[t,F,x]),i.useEffect(()=>{j(1),a(1)},[x]),i.useEffect(()=>{j(1)},[]);const R=async f=>{var e,S;f.preventDefault(),a(1);const o=await n(Ou({search:"filter",value:r,page:1,page_size:x,steward:!1,active_state:"all",is_real_person:!1,...U&&{date_from:Iu(U).format("YYYY-MM-DD")},...p&&{date_to:Iu(p).format("YYYY-MM-DD")}}));if(o.payload.error)console.error("Error fetching data:",o.payload.error),s([]),h(0);else{s(((e=o.payload.data)==null?void 0:e.results)||[]);const y=Number((S=o.payload.data)==null?void 0:S.count)||0;h(y)}},G=()=>{n(K({title:"ثبت واحد حقوقی",content:u.jsx(qu,{onClose:()=>n(nu()),updateTable:I}),size:400}))};return u.jsxs(C,{container:!0,gap:b.SMALL,p:2,children:[u.jsxs(C,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:b.SMALL,children:[u.jsx(T,{variant:"contained",color:"primary",onClick:G,children:"ثبت واحد حقوقی"}),u.jsx("form",{onSubmit:R,children:u.jsxs(C,{container:!0,alignItems:"center",gap:b.SMALL,children:[u.jsx(N,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:200},value:r,onChange:w}),u.jsx(o6,{label:"از تاریخ",value:U,onChange:f=>{O(f)},renderInput:f=>u.jsx(N,{...f,size:"small",style:{width:160}})}),u.jsx(o6,{label:"تا تاریخ",value:p,onChange:f=>{D(f)},renderInput:f=>u.jsx(N,{...f,size:"small",style:{width:160}})}),u.jsx(T,{type:"submit",onClick:R,endIcon:u.jsx(cu,{}),children:"جستجو"})]})})]}),u.jsx(C,{item:!0,xs:12,children:u.jsx(eu,{title:"واحدهای حقوقی",columns:["ردیف","شناسه حقوقی","نام واحد","نام و نام خانوادگی","شماره همراه","استان","شهر","نوع فعالیت","وضعیت","عملیات"],data:E,handlePageChange:c,totalRows:l,page:F,perPage:x,handlePerRowsChange:_})})]})},re=()=>{const n=j=>{F(j.target.value)},t=$(),[s,l]=i.useState([]),[h,x]=i.useState(0),[d,r]=i.useState(10),[g,F]=i.useState(""),[a,E]=i.useState(1),[P,U]=i.useState([]),O=async j=>{t(Q());try{const c=await K0({role:v(),page:j,pageSize:d,searchValue:g});l(c.data.results),x(c.data.count)}catch(c){console.error("Error fetching data:",c)}finally{t(M())}},p=j=>{O(j),E(j)},D=j=>{r(j),E(1)};i.useEffect(()=>{const j=s==null?void 0:s.map((c,_)=>{var f,o,e,S,y,L,A,z,k,Y,X;const I=((f=c==null?void 0:c.KillHouse)==null?void 0:f.name)||"-",R=((S=(e=(o=c==null?void 0:c.KillHouse)==null?void 0:o.killHouseOperator)==null?void 0:e.user)==null?void 0:S.fullname)||"",G=R?`${I} (${R})`:I;return console.log(c),[a===1?_+1:_+d*(a-1)+1,(c==null?void 0:c.unitName)||"-",((y=c==null?void 0:c.buyer)==null?void 0:y.parentLegalPersonNationalCode)||"-",G,(c==null?void 0:c.province)||"-",(c==null?void 0:c.city)||"-",((A=(L=c==null?void 0:c.requestsInfo)==null?void 0:L.numberOfRequests)==null?void 0:A.toLocaleString())||"0",((k=(z=c==null?void 0:c.requestsInfo)==null?void 0:z.totalQuantity)==null?void 0:k.toLocaleString())||"0",((X=(Y=c==null?void 0:c.requestsInfo)==null?void 0:Y.totalWeight)==null?void 0:X.toLocaleString())||"0"]});U(j)},[s,a,d]),i.useEffect(()=>{O(1)},[t,d]);const w=async j=>{j.preventDefault(),O(1),E(1)};return u.jsxs(C,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(C,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:u.jsx(C,{children:u.jsxs("form",{onSubmit:w,children:[u.jsx(N,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},value:g,onChange:n}),u.jsx(T,{type:"submit",onClick:w,endIcon:u.jsx(cu,{}),children:"جستجو"})]})})}),u.jsx(eu,{data:P,columns:["ردیف","نام واحد","شناسه حقوقی","کشتارگاه","استان","شهر","تعداد درخواست ها","حجم تقریبی (قطعه)","وزن (کیلوگرم)"],handlePageChange:p,totalRows:h,page:a,perPage:d,handlePerRowsChange:D,title:"اصناف حقوقی خارج استان"})]})},ae=[$u,H6,Y6,X6,q6,K6,Vu,Bu,xu,Au,vu,gu,Su,ju],oe=[$u,Vu,Bu,xu,Au,vu,gu,Su,ju],le=[H6,Y6],ce=[q6,K6],ie=[f6,c0,i0,L6,wu,N6,V6,B6,v6,A6,x6],Ce=[y6,E6,F6,G6,zu,w6,k6,$6],de=[C0,d0,_0,M6,z6],_e=[h6,_6,p6,W6],pe=[Gu,I6],he=[R6,O6,T6],xe=[g6,S6,j6],Ae=[P6,U6,b6],J=(n,t)=>t.includes(n),ve=(n,t)=>t.some(s=>n.includes(s)),sn=()=>{const{pathname:n}=Yu(),s=v()==="KillHouse";return u.jsx(u.Fragment,{children:u.jsx(Eu,{display:"flex",justifyContent:"center",children:u.jsxs(C,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[J(n,ae)?u.jsxs(C,{justifyContent:"center",my:b.MEDIUM,children:[J(n,oe)&&u.jsx(O0,{}),J(n,le)&&u.jsx(z0,{}),J(n,ce)&&u.jsx($0,{}),n===X6&&u.jsx(k0,{})]}):u.jsx(Q6,{}),u.jsx(C,{container:!0,justifyContent:"space-between",gap:b.SMALL,children:u.jsxs(C,{xs:12,children:[(J(n,ie)||s)&&u.jsx(H0,{}),ve(n,Ce)&&u.jsx(L0,{}),J(n,de)&&u.jsx(w0,{}),J(n,_e)&&u.jsx(B0,{}),J(n,pe)&&u.jsx(X0,{}),J(n,he)&&u.jsx(Q0,{}),J(n,xe)&&u.jsx(te,{}),J(n,Ae)&&u.jsx(re,{})]})})]})})})};export{sn as default}; diff --git a/build/assets/Hatching-CKVP0ju2.js b/build/assets/Hatching-CKVP0ju2.js new file mode 100644 index 0000000..5a95861 --- /dev/null +++ b/build/assets/Hatching-CKVP0ju2.js @@ -0,0 +1 @@ +import{j as t,b2 as u,b3 as e,b as a}from"./mui-vendor-CkIVaoQP.js";import{G as r,S as m}from"./index-CeyyVc1v.js";import{B as p}from"./BackButton-Crzr7NMa.js";import{r as l}from"./react-vendor-CmFgShSM.js";import{b as c,d as C,c as x}from"./CityHatchingInfo-CZPJ_c_O.js";import"./redux-vendor-B7uoacJt.js";import"./index.esm-Bu7XMDZU.js";import"./iconBase-BEJYyZsk.js";import"./Add--yVWBJhC.js";import"./CityNewKillRequest-C2SXYvKb.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";import"./Done-Dp5awdte.js";import"./aviculture-get-unions-C1NoVg85.js";import"./aviculture-get-hatching-data-DsjDNd82.js";import"./NumberFormatCustom-DwWPj40N.js";import"./DialogAlert-BfXcr-Kr.js";import"./SimpleTable-DBAoNnCU.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./province-get-sell-for-freezing-status-ieuVFEgW.js";import"./province-policy-market-daily-limitation-DueqDboR.js";import"./isValidIndexWeight-C_ik-uYa.js";import"./LabelField-B6eRSoQP.js";import"./CityHatchingsArchiveOperations-DQ9mbEeF.js";import"./Tune-D4M2CAhp.js";import"./FileUploader-DT5gIVb3.js";import"./CloudUpload-BlIgB_r9.js";import"./CheckCircle-zgBvZQ-b.js";import"./index-9Ymn_7Kv.js";import"./Sms-DasNClAG.js";import"./Edit-CqBj1Y2L.js";import"./ResponsiveTable-w7hk7Uq8.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./ShowImage-CqhU2hmk.js";import"./Download-DQ-VVIaV.js";import"./ToggleOffOutlined-Ch26Umk7.js";import"./ToggleOn-pBgb8alR.js";const j=()=>{const[i,o]=l.useState(0),n=(d,s)=>{o(s)};return t.jsxs(r,{container:!0,alignItems:"center",justifyContent:"center",children:[t.jsx(r,{xs:12,container:!0,alignItems:"center",justifyContent:"center",children:t.jsxs(u,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:i,onChange:n,children:[t.jsx(e,{label:"جوجه ریزی",value:0}),t.jsx(e,{label:"بایگانی",value:1}),t.jsx(e,{label:"آمار جوجه ریزی",value:2})]})}),i===0&&t.jsx(c,{readOnly:!0}),i===1&&t.jsx(C,{readOnly:!0}),i===2&&t.jsx(x,{})]})},it=()=>t.jsx(t.Fragment,{children:t.jsx(a,{display:"flex",justifyContent:"center",children:t.jsxs(r,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[t.jsx(p,{}),t.jsx(r,{container:!0,justifyContent:"space-between",gap:m.SMALL,children:t.jsx(r,{xs:12,children:t.jsx(j,{})})})]})})});export{it as default}; diff --git a/build/assets/Info-CZK82--l.js b/build/assets/Info-CZK82--l.js new file mode 100644 index 0000000..210d792 --- /dev/null +++ b/build/assets/Info-CZK82--l.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(a()),f=t;u=e.default=(0,i.default)((0,f.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info");export{u as d}; diff --git a/build/assets/Inspection-BSxrKtLr.js b/build/assets/Inspection-BSxrKtLr.js new file mode 100644 index 0000000..9703d64 --- /dev/null +++ b/build/assets/Inspection-BSxrKtLr.js @@ -0,0 +1 @@ +import{j as u,b as j,T as h,am as Y,I as u6,b2 as l6,b3 as t6,ak as K,B as c6,d as i6}from"./mui-vendor-CkIVaoQP.js";import{r as b}from"./react-vendor-CmFgShSM.js";import{u as d6}from"./redux-vendor-B7uoacJt.js";import{j as o6,X as x6,G as A,S as O,A as a6,v as Z,p as C6,W as n6,O as A6,L as F6,h as h6}from"./index-CeyyVc1v.js";import{R as b6,a as j6}from"./index.esm-Bu7XMDZU.js";import{R as p6}from"./ResponsiveTable-w7hk7Uq8.js";import{B as m6}from"./BackButton-Crzr7NMa.js";import{L as f}from"./LabelField-B6eRSoQP.js";import{d as g6}from"./Close-_jAEIgMD.js";import{d as v6}from"./Visibility-DeyjG-oI.js";import"./iconBase-BEJYyZsk.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const D6=async(l,L)=>(await o6.get(`poultry_science_report/?role=${x6()}&page=${l}&page_size=${L}`)).data,y6=({item:l})=>{var S,T,I,N,k,E,M,R,W,P;const[L,z]=b.useState(0),[m,w]=b.useState(null),v=C=>{z(C)},U=C=>{w(C)},D=()=>{w(null)},H=C=>{if(!C)return"---";try{return new Date(C).toLocaleDateString("fa-IR")}catch{return C}},q=C=>{if(!C)return"---";try{const F=new Date(C);return`${F.toLocaleDateString("fa-IR")} (${F.toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit"})})`}catch{return C}},s=((S=l==null?void 0:l.hatching)==null?void 0:S.poultry)||{},e=(l==null?void 0:l.hatching)||{},n=(l==null?void 0:l.reportInformation)||{},$={"نام واحد مرغداری":(s==null?void 0:s.unitName)||"---","کد یکتا / شناسه واحد":(s==null?void 0:s.breedingUniqueId)||"---","پروانه بهداشتی":(s==null?void 0:s.healthCertificateNumber)||"---","مجوز جوجه ریزی":(e==null?void 0:e.licenceNumber)||"---","کد اپیدمیولوژیک":(s==null?void 0:s.epidemiologicalCode)||"---","اعتبار پروانه بهره برداری":s!=null&&s.operatingLicenceCapacity?`${s.operatingLicenceCapacity}`:"---","وضعیت مستاجر":e!=null&&e.hasTenant?(e==null?void 0:e.InteractTypeName)||"دارد":"ندارد","نام مالک / بهره بردار":((T=s==null?void 0:s.user)==null?void 0:T.fullname)||"---","نوع مالکیت":(e==null?void 0:e.InteractTypeName)||"---","کد ملی بهره بردار":((I=s==null?void 0:s.user)==null?void 0:I.nationalId)||((N=s==null?void 0:s.user)==null?void 0:N.nationalCode)||"---",استان:((E=(k=s==null?void 0:s.address)==null?void 0:k.province)==null?void 0:E.name)||(s==null?void 0:s.provinceName)||"---",شهر:((R=(M=s==null?void 0:s.address)==null?void 0:M.city)==null?void 0:R.name)||(s==null?void 0:s.cityName)||"---","مختصات جغرافیایی":s!=null&&s.Lat&&(s!=null&&s.Long)?`${s.Lat}, ${s.Long}`:l!=null&&l.lat&&(l!=null&&l.log)?`${l.lat}, ${l.log}`:"---","شماره تماس بهره بردار":((W=s==null?void 0:s.user)==null?void 0:W.mobile)||"---","ظرفیت اسمی واحدها":s!=null&&s.totalCapacity?`${s.totalCapacity.toLocaleString()}`:"---","تاریخ جوجه ریزی":q(e==null?void 0:e.date),"تاریخ بازدید":q(l==null?void 0:l.date),"تعداد جوجه ریزی اولیه":e!=null&&e.quantity?`${e.quantity.toLocaleString()}`:"---","تعداد جوجه ریزی توسط دامپزشکی":e!=null&&e.quantity?`${e.quantity.toLocaleString()}`:"---","تعداد جوجه طبق خود اظهاری مرغدار":e!=null&&e.quantity?`${e.quantity.toLocaleString()}`:"---","منبع تهیه جوجه":((P=n==null?void 0:n.casualties)==null?void 0:P.sourceOfHatching)||"---","سن جوجه در زمان بازدید":e!=null&&e.chickenAge?`${e.chickenAge} روز`:e!=null&&e.nowAge?`${e.nowAge} روز`:"---","نوع نژاد":(e==null?void 0:e.chickenBreed)||"---"},i=(n==null?void 0:n.generalConditionHall)||{},r=(n==null?void 0:n.casualties)||{},p=(n==null?void 0:n.technicalOfficer)||{},V={"وضعیت بهداشتی سالن":(i==null?void 0:i.healthStatus)||"---","وضعیت تهویه":(i==null?void 0:i.ventilationStatus)||"---","وضعیت بستر":(i==null?void 0:i.bedCondition)||"---","دما و رطوبت سالن با توجه به سن جوجه":i!=null&&i.temperature?`${i.temperature} درجه`:"---","کیفیت آب مصرفی":(i==null?void 0:i.drinkingWaterQuality)||"---","منبع آب مصرفی":(i==null?void 0:i.drinkingWaterSource)||"---","تعداد تلفات عادی دوره":r!=null&&r.normalLosses?`${r.normalLosses}`:"---","تلفات غیر عادی":r!=null&&r.abnormalLosses?`${r.abnormalLosses}`:"---","علت تلفات غیر عادی":(r==null?void 0:r.causeAbnormalLosses)||"---","نوع بیماری تشخیصی":(r==null?void 0:r.typeDisease)||"---","نمونه برداری انجام شده":r!=null&&r.samplingDone?"بله":"خیر","نوع نمونه":(r==null?void 0:r.typeSampling)||"---","نام مسئول فنی بهداشتی":(p==null?void 0:p.technicalHealthOfficer)||"---","نام مسئول فنی نظام مهندسی":(p==null?void 0:p.technicalEngineeringOfficer)||"---"},c=(n==null?void 0:n.inputStatus)||{},t=(n==null?void 0:n.infrastructureEnergy)||{},d=(n==null?void 0:n.facilities)||{},x=(n==null?void 0:n.hr)||{},G={"وضعیت نهاده":(c==null?void 0:c.inputStatus)||"---","نوع دان":(c==null?void 0:c.typeOfGrain)||"---","کیفیت دانه":(c==null?void 0:c.gradeGrain)||"---","موجودی تا روز بازدید":(c==null?void 0:c.inventoryUntilVisit)||"---","موجودی در انبار":(c==null?void 0:c.inventoryInWarehouse)||"---","کد رهگیری":(c==null?void 0:c.trackingCode)||"---","نام شرکت":(c==null?void 0:c.companyName)||"---","نوع ژنراتور":(t==null?void 0:t.generatorType)||"---","مدل ژنراتور":(t==null?void 0:t.generatorModel)||"---","تعداد ژنراتور":(t==null?void 0:t.generatorCount)||"---","نوع سوخت":(t==null?void 0:t.fuelType)||"---","ظرفیت ژنراتور":t!=null&&t.generatorCapacity?`${t.generatorCapacity.toLocaleString()}`:"---","میزان موجودی سوخت اضطراری (لیتر)":t!=null&&t.emergencyFuelInventory?`${t.emergencyFuelInventory.toLocaleString()}`:"---","سابقه قطعی برق دوره جاری":t!=null&&t.hasPowerCutHistory?"بله":"خیر","مدت زمان قطعی":t!=null&&t.powerCutDuration?`${t.powerCutDuration} ساعت`:"---","ساعت قطعی":(t==null?void 0:t.powerCutHour)||"---","عملکرد ژنراتور":(t==null?void 0:t.generatorPerformance)||"---","توضیحات تکمیلی":(t==null?void 0:t.additionalNotes)||"---","تعداد افراد شاغل":x!=null&&x.numberEmployed?`${x.numberEmployed}`:"---","تعداد افراد بومی":x!=null&&x.numberIndigenous?`${x.numberIndigenous}`:"---","تعداد افراد غیر بومی":x!=null&&x.numberNonIndigenous?`${x.numberNonIndigenous}`:"---","وضعیت قرارداد کارگران":(x==null?void 0:x.contractStatus)||"---","آموزش دیده در حوزه بهداشت و امنیت زیستی":x!=null&&x.trained?"بله":"خیر","تسهیلات دریافتی فعال":d!=null&&d.hasFacilities?"بله":"خیر","نوع تسهیلات":(d==null?void 0:d.typeOfFacility)||"---","مبلغ تسهیلات":d!=null&&d.amount?`${d.amount.toLocaleString()}`:"---","وضعیت بازپرداخت":(d==null?void 0:d.repaymentStatus)||"---","درخواست جدید بهره بردار":(d==null?void 0:d.requestFacilities)||"---","تاریخ تسهیلات":H(d==null?void 0:d.date)},J=()=>u.jsx(A,{container:!0,item:!0,sx:{width:"100%",display:"flex",flexWrap:"wrap"},xs:12,children:Object.entries($).map(([C,F])=>u.jsx(A,{xs:2.4,lg:3,nxl:2.4,p:1,children:u.jsx(f,{label:C,children:u.jsx(h,{variant:"body2",sx:{py:1},children:F||"---"})})},C))}),Q=()=>u.jsx(A,{container:!0,item:!0,sx:{width:"100%",display:"flex",flexWrap:"wrap"},xs:12,children:Object.entries(V).map(([C,F])=>u.jsx(A,{xs:2.4,lg:3,nxl:2.4,p:1,children:u.jsx(f,{label:C,children:u.jsx(h,{variant:"body2",sx:{py:1},children:F||"---"})})},C))}),a=()=>u.jsx(A,{container:!0,item:!0,sx:{width:"100%",display:"flex",flexWrap:"wrap"},xs:12,children:Object.entries(G).map(([C,F])=>u.jsx(A,{xs:4,p:1,children:u.jsx(f,{label:C,children:u.jsx(h,{variant:"body2",sx:{py:1},children:F||"---"})})},C))}),o=({src:C,onClick:F})=>{const y=C==null?void 0:C.toLowerCase().match(/\.(mp4|webm|ogg|mov)$/i);return u.jsx(j,{onClick:()=>F&&F(C),sx:{position:"relative",width:"70px",height:"70px",borderRadius:1.5,overflow:"hidden",border:"1px solid #e0e0e0",cursor:"pointer","&:hover":{opacity:.8}},children:y?u.jsx(j,{component:"video",src:C,sx:{width:"100%",height:"100%",objectFit:"cover"}}):u.jsx(j,{component:"img",src:C,alt:"thumbnail",sx:{width:"100%",height:"100%",objectFit:"cover"}})})},g=({title:C,description:F,images:y=[]})=>u.jsxs(A,{container:!0,direction:"column",gap:1,sx:{mb:2},children:[u.jsx(h,{variant:"h6",sx:{fontWeight:"bold",fontSize:18},children:C}),F&&u.jsx(h,{variant:"body2",sx:{mb:1,color:"text.secondary"},children:F}),y&&y.length>0?u.jsx(A,{container:!0,gap:O.SMALL,children:y.map((X,B)=>u.jsx(o,{src:X,onClick:U},B))}):u.jsx(h,{variant:"body2",sx:{color:"text.secondary",fontStyle:"italic"},children:"تصویری موجود نیست"})]}),_=()=>{var B,e6,s6;const C=(i==null?void 0:i.images)||[],F=(c==null?void 0:c.images)||[],y=(r==null?void 0:r.images)||[],X=(e==null?void 0:e.violationImage)||[];return u.jsxs(A,{direction:"column",xs:12,children:[u.jsx(g,{title:"وضعیت کلی سالن",images:C}),u.jsx(g,{title:"انبار نهاده ها",images:F}),u.jsx(g,{title:"تلفات",images:y}),u.jsx(g,{title:"تصاویر تخلف",images:X}),u.jsx(j,{sx:{mb:3},children:u.jsxs(l6,{value:L,onChange:(f6,r6)=>v(r6),sx:{"& .MuiTabs-indicator":{display:"none"},"& .MuiTab-root":{minHeight:"auto",px:3,py:1,borderRadius:2,fontWeight:"bold",textTransform:"none","&.Mui-selected":{bgcolor:"#4caf50",color:"white"},"&:not(.Mui-selected)":{bgcolor:"#f5f5f5",color:"text.primary"}}},children:[u.jsx(t6,{label:"وضعیت کلی واحد"}),u.jsx(t6,{label:(n==null?void 0:n.inspectionStatus)||"---"})]})}),u.jsx(f,{label:"توصیه ها / اخطارها / اقدامات اصلاحی :",children:u.jsx(h,{variant:"body2",color:"text.secondary",sx:{fontSize:13,py:1},children:(n==null?void 0:n.inspectionNotes)||"---"})}),u.jsx(Y,{sx:{my:2,visibility:"hidden"}}),u.jsx(h,{variant:"h6",sx:{fontWeight:"bold",fontSize:16,mb:2},children:"احراز مسئول سالن"}),u.jsxs(A,{container:!0,xs:12,children:[u.jsx(A,{xs:12,lg:3,p:1,children:u.jsx(f,{label:"مسئول سالن حضور دارد؟",children:u.jsx(h,{variant:"body2",sx:{py:1},children:(B=e==null?void 0:e.vetFarm)!=null&&B.vetFarmFullName?"بله":"خیر"})})}),u.jsx(A,{xs:12,lg:3,p:1,children:u.jsx(f,{label:"نام مسئول سالن در زمان بازدید",children:u.jsx(h,{variant:"body2",sx:{py:1},children:((e6=e==null?void 0:e.vetFarm)==null?void 0:e6.vetFarmFullName)||"---"})})}),u.jsx(A,{xs:12,lg:3,p:1,children:u.jsx(f,{label:"تلفن مسئول سالن",children:u.jsx(h,{variant:"body2",sx:{py:1},children:((s6=e==null?void 0:e.vetFarm)==null?void 0:s6.vetFarmMobile)||"---"})})})]})]})};return u.jsxs(j,{sx:{maxHeight:"80vh",overflowY:"auto",width:"100%",p:2},children:[u.jsx(h,{variant:"h5",sx:{fontWeight:"bold",mb:2},children:"اطلاعات"}),u.jsx(Y,{sx:{mb:3}}),J(),u.jsx(h,{variant:"h5",sx:{fontWeight:"bold",mb:2,mt:4},children:"پایش سلامت"}),u.jsx(Y,{sx:{mb:3}}),Q(),u.jsx(h,{variant:"h5",sx:{fontWeight:"bold",mb:2,mt:4},children:"زیرساخت"}),u.jsx(Y,{sx:{mb:3}}),a(),u.jsx(h,{variant:"h5",sx:{fontWeight:"bold",mb:2,mt:4},children:"مستندات"}),u.jsx(Y,{sx:{mb:3}}),_(),m&&u.jsxs(j,{onClick:D,sx:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.9)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:[u.jsx(u6,{onClick:C=>{C.stopPropagation(),D()},sx:{position:"absolute",top:16,right:16,backgroundColor:"rgba(255, 255, 255, 0.2)",color:"white","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.3)"},zIndex:1e4},children:u.jsx(g6,{})}),u.jsx(j,{onClick:C=>C.stopPropagation(),sx:{maxWidth:"90vw",maxHeight:"90vh",display:"flex",alignItems:"center",justifyContent:"center"},children:m!=null&&m.toLowerCase().match(/\.(mp4|webm|ogg|mov)$/i)?u.jsx(j,{component:"video",src:m,controls:!0,autoPlay:!0,sx:{maxWidth:"100%",maxHeight:"90vh",objectFit:"contain"}}):u.jsx(j,{component:"img",src:m,alt:"fullscreen",sx:{maxWidth:"100%",maxHeight:"90vh",objectFit:"contain"}})})]})]})},Y6=()=>{const l=d6(),[L,z]=b.useState(""),[m,w]=b.useState(0),[v,U]=b.useState(10),[D,H]=b.useState([]),[q,s]=b.useState([]),[e,n]=b.useState(1),[,,$,i,r,p]=b.useContext(a6),[V]=b.useContext(a6);b.useEffect(()=>{const a=Z(new Date).format("YYYY-MM-DD");i(a),p(a)},[]);const c=a=>{z(a.target.value)},t=async a=>{l(F6());try{const o=await D6(a,v);H(o.results||[]),w(o.count||0)}catch(o){console.error("Error fetching inspection data:",o),H([]),w(0)}l(h6())},d=a=>{t(a),n(a)},x=a=>{U(a),n(1),t(1)},G=async a=>{a.preventDefault(),n(1),t(1)},J=a=>{l(A6({title:"جزئیات",size:1280,content:u.jsx(y6,{item:a})}))},Q=a=>{if((a==null?void 0:a.state)==="pending")return"در انتظار تایید";if((a==null?void 0:a.state)==="accepted")return"تایید شده";if((a==null?void 0:a.state)==="rejected")return"رد شده"};return b.useEffect(()=>{const a=D==null?void 0:D.map((o,g)=>{var _,S,T,I,N,k,E,M,R,W,P,C;return[e===1?g+1:g+v*(e-1)+1,C6(o==null?void 0:o.date)||"-",(o==null?void 0:o.reportId)||"-",((S=(_=o==null?void 0:o.hatching)==null?void 0:_.poultry)==null?void 0:S.unitName)||"-",((I=(T=o==null?void 0:o.hatching)==null?void 0:T.poultry)==null?void 0:I.breedingUniqueId)||"-",((N=o==null?void 0:o.hatching)==null?void 0:N.licenceNumber)||"-",((R=(M=(E=(k=o==null?void 0:o.hatching)==null?void 0:k.poultry)==null?void 0:E.user)==null?void 0:M.city)==null?void 0:R.name)||"-",C6((W=o==null?void 0:o.hatching)==null?void 0:W.date)||"-",((C=(P=o==null?void 0:o.hatching)==null?void 0:P.quantity)==null?void 0:C.toLocaleString())||"-",Q(o)||"-",u.jsx(j,{display:"flex",justifyContent:"center",children:u.jsx(u6,{color:"primary",onClick:()=>J(o),size:"small",children:u.jsx(v6,{})})},`details-${g}`)]});s(a||[])},[D,e,v]),b.useEffect(()=>{t(1)},[$,r,v]),u.jsx(j,{display:"flex",justifyContent:"center",children:u.jsxs(A,{container:!0,direction:"column",flexWrap:"nowrap",xs:12,sm:12,md:10,lg:10,children:[u.jsx(m6,{}),u.jsx(A,{xs:12,container:!0,alignItems:"center",gap:O.SMALL,justifyContent:"flex-start",mb:O.SMALL,mt:O.SMALL,children:u.jsx("form",{onSubmit:G,children:u.jsxs(A,{container:!0,alignItems:"center",gap:O.SMALL,children:[u.jsx(A,{style:{width:"150px"},children:u.jsx(n6,{label:"از تاریخ",id:"date",renderInput:a=>u.jsx(K,{...a}),value:$,onChange:a=>{i(Z(a).format("YYYY-MM-DD"))}})}),u.jsx(A,{style:{width:"150px"},children:u.jsx(n6,{label:"تا تاریخ",id:"date",renderInput:a=>u.jsx(K,{...a}),value:r,onChange:a=>{p(Z(a).format("YYYY-MM-DD"))}})}),u.jsx(K,{autoComplete:"off",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:c,value:L}),u.jsx(c6,{type:"submit",onClick:G,endIcon:u.jsx(b6,{}),children:"جستجو"}),u.jsx(i6,{title:"خروجی اکسل",children:u.jsx(u6,{color:"success",onClick:()=>{V({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این عملیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const a=`${o6.defaults.baseURL}inspection_excel/?date1=${$}&date2=${r}&search=filter&value=${L}`;window.location.href=a},children:u.jsx(j6,{size:32})})})]})})}),u.jsx(p6,{data:q,columns:["ردیف","تاریخ بازرسی","شناسه بازرسی","نام فارم","شناسه یکتا","شناسه جوجه ریزی","شهرستان","تاریخ جوجه ریزی","تعداد جوجه ریزی","وضعیت بازرسی","مشاهده جزییات"],handlePageChange:d,totalRows:m,page:e,perPage:v,handlePerRowsChange:x,paginated:!0,title:"بازرسی"})]})})};export{Y6 as default}; diff --git a/build/assets/Inspector-DMOgCEzJ.js b/build/assets/Inspector-DMOgCEzJ.js new file mode 100644 index 0000000..5b04df0 --- /dev/null +++ b/build/assets/Inspector-DMOgCEzJ.js @@ -0,0 +1 @@ +import{j as r,aO as m,aP as uu,aQ as ru,aR as eu,aS as su,aT as ou,T as Y,ak as tu,B as D,p as nu,I as O,a3 as G,b as au}from"./mui-vendor-CkIVaoQP.js";import{j as cu,A as lu,u as Cu,c as pu,M as iu,$ as du,G as o,S as p,m as Au,L as K,h as k,N as M,kN as b,p as L,kO as W,kP as U,kQ as B,kR as w,kS as Q,kT as q,kU as xu}from"./index-CeyyVc1v.js";import{d as z}from"./Plagiarism-BiXORbzo.js";import{a as ju,u as P,f as V}from"./redux-vendor-B7uoacJt.js";import{r as a,j as Fu,u as $,f as X}from"./react-vendor-CmFgShSM.js";import{S as J}from"./SimpleTable-DBAoNnCU.js";import{g as yu}from"./useRequestFile-FPqBpZfN.js";import{A as Eu}from"./index-9Ymn_7Kv.js";import{d as hu}from"./Edit-CqBj1Y2L.js";import{N}from"./NavLink-D2GD_ItM.js";import{V as fu}from"./index.esm-CjWvmHks.js";import{L as _}from"./LinkItem-DT6qswcs.js";import{a as Tu}from"./index.esm-BVxcT1y_.js";import{a as Su}from"./index.esm-YBNW__9r.js";import{c as Ru}from"./index.esm-Bu7XMDZU.js";import{u as gu}from"./index.esm-BY9chGNa.js";import{R as vu,a as Iu}from"./RequestsAwaitingInspections-C8DP5FQL.js";import{B as Lu}from"./BackButton-Crzr7NMa.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";import"./iconBase-BEJYyZsk.js";import"./AdvancedTable-BYmmBtmq.js";const H=ju("INSPECTOR_REQUEST_OPERATIONS",async e=>{const{data:c,status:t}=await cu.post("inspector/",e);return{data:c,status:t}}),Z=({process:e})=>{const[c]=a.useContext(lu),[t,v]=a.useState(!1);a.useEffect(()=>{e===null&&v(!0)},[]);const n=Cu({initialValues:{rejectText:""},validationSchema:pu({rejectText:iu().required("این فیلد اجباری است!").typeError("لطفا دلیل خود را بیان کنید.")})}),[I,l]=a.useState(!1),s=P(),[u]=du(),{id:d}=Fu();return r.jsx(r.Fragment,{children:!t&&r.jsxs(m,{sx:{alignSelf:"flex-start",width:"100%"},children:[r.jsxs(uu,{children:[r.jsx(ru,{color:"secondary"}),r.jsx(eu,{})]}),r.jsxs(o,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[r.jsxs(o,{container:!0,children:[r.jsx(o,{children:r.jsx(su,{variant:"body1",fontWeight:"bold",color:"secondary",children:"انجام عملیات بازرسی"})}),r.jsx(o,{children:r.jsx(ou,{color:"textSecondary",children:r.jsx(Y,{variant:"body2",children:"در این مرحله درخواست را تایید یا رد کنید."})})})]}),r.jsx(o,{children:r.jsx(o,{xs:12,children:r.jsx(o,{container:!0,gap:p.SMALL,padding:p.SMALL,children:r.jsx(Eu,{children:I?r.jsx(Au.div,{animate:{x:-10,opacity:1},transition:{duration:.3},initial:{opacity:0},exit:{opacity:0},children:r.jsxs(o,{flexDirection:"column",container:!0,gap:p.SMALL,children:[r.jsx(o,{children:r.jsx(tu,{multiline:!0,rows:4,fullWidth:!0,id:"rejectText",label:"پیام خود را وارد کنید",variant:"outlined",value:n.values.rejectText,error:n.touched.rejectText?!!n.errors.rejectText:null,onChange:n.handleChange,onBlur:n.handleBlur,helperText:n.touched.rejectText&&n.errors.rejectText?n.errors.rejectText:null})}),r.jsxs(o,{container:!0,gap:p.SMALL,children:[r.jsx(o,{children:r.jsx(D,{variant:"outlined",color:"secondary",onClick:()=>{l(!1)},children:"لغو"})}),r.jsx(o,{children:r.jsx(D,{color:"secondary",variant:"outlined",disabled:!n.isValid,onClick:()=>{var C;s(K()),s(H({message:n.values.rejectText,key:(C=e==null?void 0:e.poultry)==null?void 0:C.poultryRequestKey,state:"rejected"})).then(i=>{i.error?(s(k()),c({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"})):(s(M({right:!1,bottom:!1,top:!1,content:null})),s(b()),c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}),s(k())},children:"رد درخواست"})})]})]})}):r.jsxs(o,{container:!0,gap:p.SMALL,children:[r.jsx(D,{variant:"outlined",color:"secondary",onClick:()=>{l(!0)},children:"رد اطلاعات و پیام به استان"}),r.jsx(D,{variant:"outlined",onClick:()=>{var C;s(K()),s(H({key:(C=e==null?void 0:e.poultry)==null?void 0:C.poultryRequestKey,state:"accepted"})).then(i=>{i.error?(s(k()),c({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"})):(s(M({right:!1,bottom:!1,top:!1,content:null})),s(b()),yu(u,d,s),c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}),s(k())},children:"تایید نهایی درخواست"})]})})})})})]})]})})};Z.propTypes={process:nu.PropTypes.any};const Nu=()=>{const e=$(),{inspectorNewRequests:c}=V(l=>l.inspectorSlice),t=P();a.useEffect(()=>{t(b())},[]);const[v,n]=a.useState([]);a.useEffect(()=>{var s;const l=(s=c==null?void 0:c.filter(u=>!u.inspector||u.inspector==="pending"))==null?void 0:s.map((u,d)=>{var C,i,A,x,j,F,y,E,h,f,T,S;return[d+1,u.orderCode,L(u==null?void 0:u.createDate),L(u==null?void 0:u.sendDate),(i=(C=u==null?void 0:u.process)==null?void 0:C.poultry)==null?void 0:i.poultryName,(x=(A=u==null?void 0:u.process)==null?void 0:A.poultry)==null?void 0:x.poultryMobile,(F=(j=u==null?void 0:u.process)==null?void 0:j.poultry)==null?void 0:F.poultryCity,(E=(y=u==null?void 0:u.process)==null?void 0:y.poultry)==null?void 0:E.poultryProvince,(f=(h=u==null?void 0:u.process)==null?void 0:h.poultry)==null?void 0:f.age,(S=(T=u==null?void 0:u.process)==null?void 0:T.poultry)==null?void 0:S.poultryQuantity,r.jsx(O,{color:"primary",onClick:()=>{t(M({title:"عملیات تایید / رد بازرس",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:r.jsx(Z,{process:u.process})}))},children:r.jsx(hu,{})},d),r.jsx(O,{"aria-label":"delete",color:"primary",onClick:()=>{var R,g;return e(W+((g=(R=u==null?void 0:u.process)==null?void 0:R.poultry)==null?void 0:g.poultryRequestId))},children:r.jsx(z,{})},d)]});n(l)},[c]);const[I]=a.useState(["ردیف","کد سفارش","تاریخ ثبت درخواست","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","استان","سن مرغ","تعداد","عملیات","مشاهده"]);return r.jsx(r.Fragment,{children:r.jsx(G,{xs:12,mt:p.SMALL,children:r.jsx(J,{name:"درخواست های جدید در انتظار برای بررسی",columns:I,data:v})})})},_u=()=>{const{pathname:e}=X();return r.jsx(o,{container:!0,gap:p.SMALL,p:p.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",style:{placeContent:"baseline"},children:r.jsx(o,{container:!0,direction:"column",style:{width:"100%"},children:r.jsxs(o,{container:!0,gap:p.SMALL,justifyContent:"center",children:[r.jsx(N,{to:U,active:e===U?"true":null,children:r.jsx(_,{icon:r.jsx(fu,{size:30,color:"#244CCC"}),title:"درخواست های جدید",description:"درخواست های در انتظار بررسی"})}),r.jsx(N,{to:B,active:e===B?"true":null,children:r.jsx(_,{icon:r.jsx(Tu,{size:30,color:"#244CCC"}),title:"در انتظار پرداخت",description:"مشاهده درخواست های در انتظار پرداخت کشتارگاه"})}),r.jsx(N,{to:w,active:e===w?"true":null,children:r.jsx(_,{icon:r.jsx(Su,{className:"svg-icon-color",color:"#244CCC",size:30}),title:"در انتظار بازرسی",description:"درخواست های در انتظار بررسی بازرس"})}),r.jsx(N,{to:Q,active:e===Q?"true":null,children:r.jsx(_,{icon:r.jsx(Ru,{className:"svg-icon-color",color:"#244CCC",size:30}),title:"درخواست های رد شده",description:"مشاهده درخواست هایی که به دلایل مختلف توسط اتحادیه رد شده است"})}),r.jsx(N,{to:q,active:e===q?"true":null,children:r.jsx(_,{icon:r.jsx(gu,{className:"svg-icon-color",color:"#244CCC",size:30}),title:"بایگانی",description:"درخواست های پایان یافته"})})]})})})},bu=()=>{const e=$(),c=P(),{inspectorNewRequests:t}=V(l=>l.inspectorSlice);a.useEffect(()=>{c(b())},[]);const[v,n]=a.useState([]);a.useEffect(()=>{var s;const l=(s=t==null?void 0:t.filter(u=>u.inspector==="rejected"))==null?void 0:s.map((u,d)=>{var C,i,A,x,j,F,y,E,h,f,T,S;return[d+1,u.orderCode,L(u==null?void 0:u.createDate),L(u==null?void 0:u.sendDate),(i=(C=u==null?void 0:u.process)==null?void 0:C.poultry)==null?void 0:i.poultryName,(x=(A=u==null?void 0:u.process)==null?void 0:A.poultry)==null?void 0:x.poultryMobile,(F=(j=u==null?void 0:u.process)==null?void 0:j.poultry)==null?void 0:F.poultryCity,(E=(y=u==null?void 0:u.process)==null?void 0:y.poultry)==null?void 0:E.poultryProvince,(f=(h=u==null?void 0:u.process)==null?void 0:h.poultry)==null?void 0:f.age,(S=(T=u==null?void 0:u.process)==null?void 0:T.poultry)==null?void 0:S.poultryQuantity,r.jsx(O,{"aria-label":"delete",color:"primary",onClick:()=>{var R,g;return e(W+((g=(R=u==null?void 0:u.process)==null?void 0:R.poultry)==null?void 0:g.poultryRequestId))},children:r.jsx(z,{})},d)]});n(l)},[t]);const[I]=a.useState(["ردیف","کد سفارش","تاریخ ثبت درخواست","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","استان","سن مرغ","تعداد","مشاهده"]);return r.jsx(G,{xs:12,mt:p.SMALL,children:r.jsx(J,{name:"درخواست های رد شده",columns:I,data:v})})},Du=()=>{const e=$(),c=P(),{inspectorNewRequests:t}=V(l=>l.inspectorSlice);a.useEffect(()=>{c(b())},[]);const[v,n]=a.useState([]);a.useEffect(()=>{var s;const l=(s=t==null?void 0:t.filter(u=>u.inspector==="accepted"))==null?void 0:s.map((u,d)=>{var C,i,A,x,j,F,y,E,h,f,T,S;return[d+1,u.orderCode,L(u==null?void 0:u.createDate),L(u==null?void 0:u.sendDate),(i=(C=u==null?void 0:u.process)==null?void 0:C.poultry)==null?void 0:i.poultryName,(x=(A=u==null?void 0:u.process)==null?void 0:A.poultry)==null?void 0:x.poultryMobile,(F=(j=u==null?void 0:u.process)==null?void 0:j.poultry)==null?void 0:F.poultryCity,(E=(y=u==null?void 0:u.process)==null?void 0:y.poultry)==null?void 0:E.poultryProvince,(f=(h=u==null?void 0:u.process)==null?void 0:h.poultry)==null?void 0:f.age,(S=(T=u==null?void 0:u.process)==null?void 0:T.poultry)==null?void 0:S.poultryQuantity,r.jsx(O,{"aria-label":"delete",color:"primary",onClick:()=>{var R,g;return e(W+((g=(R=u==null?void 0:u.process)==null?void 0:R.poultry)==null?void 0:g.poultryRequestId))},children:r.jsx(z,{})},d)]});n(l)},[t]);const[I]=a.useState(["ردیف","کد سفارش","تاریخ ثبت درخواست","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","استان","سن مرغ","تعداد","مشاهده"]);return r.jsx(r.Fragment,{children:r.jsx(G,{xs:12,mt:p.SMALL,children:r.jsx(J,{name:"درخواست های بایگانی شده",columns:I,data:v})})})},s6=()=>{const{pathname:e}=X();return r.jsx(r.Fragment,{children:r.jsx(au,{display:"flex",justifyContent:"center",children:r.jsxs(o,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[e===xu?r.jsxs(o,{justifyContent:"center",my:p.MEDIUM,children:[r.jsx(o,{children:r.jsx(Y,{variant:"h6",children:"صفحه مدیریت درخواست ها (بازرس)"})}),r.jsx(_u,{})]}):r.jsx(Lu,{}),r.jsx(o,{container:!0,justifyContent:"space-between",gap:p.SMALL,children:r.jsxs(o,{xs:12,children:[e===U&&r.jsx(Nu,{}),e===Q&&r.jsx(bu,{}),e===q&&r.jsx(Du,{}),e===B&&r.jsx(vu,{}),e===w&&r.jsx(Iu,{})]})})]})})})};export{s6 as default}; diff --git a/build/assets/InspectorEditAviculture-MsTqlKJp.js b/build/assets/InspectorEditAviculture-MsTqlKJp.js new file mode 100644 index 0000000..537a469 --- /dev/null +++ b/build/assets/InspectorEditAviculture-MsTqlKJp.js @@ -0,0 +1 @@ +import{a as k,u as S}from"./redux-vendor-B7uoacJt.js";import{j as W,A as q,u as H,c as O,M as y,b as x,v as w,L as E,h as N,G as l,S as G,W as Z,e4 as L,N as R}from"./index-CeyyVc1v.js";import{j as e,ak as s,B as M,p as o,al as D,ag as uu,av as eu,aw as ru,ax as a}from"./mui-vendor-CkIVaoQP.js";import{r as t}from"./react-vendor-CmFgShSM.js";import{c as U,a as Y}from"./city-get-city-qTSRxslT.js";const iu=k("INSPECTOR_CHANGE_USER_STATE",async C=>{const{data:p,status:m}=await W.delete("system_user_profile/0/",{params:C});return{data:p,status:m}}),z=k("INSPECTOR_UPDATE_USER_PROFILE",async C=>{const{data:p,status:m}=await W.put("system_user_profile/0/",C);return{data:p,status:m}}),au=({id:C,birthday:p,nationalCode:m,nationalId:b,firstName:F,lastName:f,password:j,phone:B})=>{const[d]=t.useContext(q),[,_]=t.useState([]),[,T]=t.useState([]),[A]=t.useState(),[,P]=t.useState(!0),i=S(),r=H({initialValues:{fname:F||"",lname:f||"",nationalcode:b||"",nationalId:m||"",password:j||"",phone:B||"",birthday:p||w(Date()).format("YYYY-MM-DD hh:mm:ss")},validationSchema:O({fname:y().typeError("لطفا فیلد را پر کنید!"),lname:y().typeError("لطفا فیلد را پر کنید!"),nationalcode:y().typeError("لطفا مقادیر را به درستی وارد کنید!"),nationalId:x().test("len","کد ملی میبایست ده رقم باشد.",(c,v)=>{if(v.originalValue)return v.originalValue.length===10}),password:y().typeError("لطفا مقادیر را به درستی وارد کنید!")})});return t.useEffect(()=>{r.validateForm()},[]),t.useEffect(()=>{var c;(c=i(U()))==null||c.then(v=>{_(v.payload.data)})},[]),t.useEffect(()=>{A&&(i(E()),i(Y(A)).then(c=>{T(c.payload.data),P(!1),i(N())}))},[A]),e.jsx(e.Fragment,{children:e.jsx(l,{children:e.jsxs(l,{container:!0,gap:G.SMALL,direction:"column",children:[e.jsx(l,{children:e.jsx(s,{id:"fname",label:"نام",variant:"outlined",sx:{width:"100%"},value:r.values.fname,error:r.touched.fname?!!r.errors.fname:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.fname&&r.errors.fname?r.errors.fname:null})}),e.jsx(l,{children:e.jsx(s,{id:"lname",label:"نام خانوادگی ",variant:"outlined",sx:{width:"100%"},value:r.values.lname,error:r.touched.lname?!!r.errors.lname:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.lname&&r.errors.lname?r.errors.lname:null})}),e.jsx(l,{children:e.jsx(Z,{fullWidth:!0,label:"تاریخ تولد",id:"birthday",renderInput:c=>e.jsx(s,{...c}),value:r.values.birthday,error:r.touched.birthday?!!r.errors.birthday:null,onChange:c=>{r.setFieldValue("birthday",w(c).format("YYYY-MM-DD hh:mm:ss"))},onBlur:r.handleBlur,helperText:r.touched.birthday&&r.errors.birthday?r.errors.birthday:null})}),e.jsx(l,{children:e.jsx(s,{id:"nationalcode",label:"شماره شناسنامه",variant:"outlined",sx:{width:"100%"},value:r.values.nationalcode,error:r.touched.nationalcode?!!r.errors.nationalcode:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.nationalcode&&r.errors.nationalcode?r.errors.nationalcode:null})}),e.jsx(l,{children:e.jsx(s,{id:"nationalId",label:"کد ملی",type:"nationalId",variant:"outlined",sx:{width:"100%"},value:r.values.nationalId,error:r.touched.nationalId?!!r.errors.nationalId:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.nationalId&&r.errors.nationalId?r.errors.nationalId:null})}),e.jsx(l,{children:e.jsx(s,{id:"phone",label:"تلفن",variant:"outlined",sx:{width:"100%"},value:r.values.phone,error:r.touched.phone?!!r.errors.phone:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.phone&&r.errors.phone?r.errors.phone:null})}),e.jsx(l,{children:e.jsx(s,{id:"password",label:"کلمه عبور",variant:"outlined",sx:{width:"100%"},value:r.values.password,error:r.touched.password?!!r.errors.password:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.password&&r.errors.password?r.errors.password:null})}),e.jsx(M,{fullWidth:!0,color:"primary",variant:"contained",onClick:()=>{i(E()),i(z({type:"self_profile",person_type:"operator",userprofile_key:C,fullname:r.values.fname+" "+r.values.lname,first_name:r.values.fname,last_name:r.values.lname,national_code:r.values.nationalcode,national_id:r.values.nationalId,birthday:r.values.birthday,password:r.values.password,image:"",second_mobile_number:r.values.phone})).then(c=>{c.error?c.error.message.includes("403")?d({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):d({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):d({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),i(N()),i(L(C)),i(R({right:!1,bottom:!1,content:null}))})},children:"ارسال اطلاعات"})]})})})};au.propTypes={id:o.PropTypes.any,firstName:o.PropTypes.any,lastName:o.PropTypes.any,birthday:o.PropTypes.any,nationalCode:o.PropTypes.any,nationalId:o.PropTypes.any,password:o.PropTypes.any};const lu=({id:C,address:p,postal:m,name_of_bank_user:b,card:F,shaba:f,account:j,accountHolder:B,type:d,poultry:_,halls:T,uniqueId:A,farmName:P})=>{const[i]=t.useContext(q),[r,c]=t.useState(),[v,K]=t.useState(),[I,V]=t.useState(),[$,J]=t.useState(),[Q,X]=t.useState(!0);t.useEffect(()=>{var n;h(E()),(n=h(U()))==null||n.then(g=>{h(N()),c(g.payload.data)})},[]),t.useEffect(()=>{I&&(h(E()),h(Y(I)).then(n=>{K(n.payload.data),X(!1),h(N())}))},[I]);const h=S(),u=H({initialValues:{address:p||"",postal:m||"",bankName:b||"",cardNumber:F||"",accountNumber:j||"",shabaNumber:f||"",accountHolder:B||"",halls:T||"",uniqueId:A||"",farmName:P||""},validationSchema:O({cardNumber:x().typeError("لطفا شماره کارتتان را وارد کنید!"),accountNumber:x().typeError("لطفا شماره حسابتان را وارد کنید!"),shabaNumber:x().typeError("لطفا شماره شبا را وارد کنید!"),accountHolder:y().typeError("لطفا نام صاحب حساب را وارد کنید!"),address:y().typeError("لطفا آدرس را وارد کنید!"),postal:x().typeError("لطفا عدد وارد کنید!"),halls:x().typeError("لطفا عدد وارد کنید!"),uniqueId:x().typeError("لطفا عدد وارد کنید!")})});return t.useEffect(()=>{u.validateForm()},[]),e.jsx(e.Fragment,{children:e.jsx(l,{children:e.jsxs(l,{container:!0,gap:G.SMALL,direction:"column",children:[e.jsx(l,{children:e.jsx(s,{fullWidth:!0,id:"farmName",label:"نام فارم",value:u.values.farmName,error:u.touched.farmName?!!u.errors.farmName:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.farmName&&u.errors.farmName?u.errors.farmName:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(l,{children:e.jsx(s,{fullWidth:!0,id:"uniqueId",label:"شناسه یکتا",value:u.values.uniqueId,error:u.touched.uniqueId?!!u.errors.uniqueId:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.uniqueId&&u.errors.uniqueId?u.errors.uniqueId:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(l,{children:e.jsx(s,{fullWidth:!0,id:"address",label:"آدرس",value:u.values.address,error:u.touched.address?!!u.errors.address:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.address&&u.errors.address?u.errors.address:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(l,{children:e.jsx(s,{fullWidth:!0,id:"postal",label:"کد پستی",value:u.values.postal,error:u.touched.postal?!!u.errors.postal:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.postal&&u.errors.postal?u.errors.postal:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(l,{children:e.jsx(s,{fullWidth:!0,id:"halls",label:"تعداد سالن",value:u.values.halls,error:u.touched.halls?!!u.errors.halls:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.halls&&u.errors.halls?u.errors.halls:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(l,{children:e.jsx(D,{disablePortal:!0,id:"province",options:r?r==null?void 0:r.map(n=>({id:n.key,label:n.name})):[],onChange:(n,g)=>{V(g.id)},renderInput:n=>e.jsx(s,{...n,label:"استان را انتخاب کنید"})})}),e.jsx(l,{children:e.jsx(D,{disabled:Q,disablePortal:!0,id:"city",options:v?v.map(n=>({id:n.key,label:n.name})):[],onChange:(n,g)=>{J(g.id)},renderInput:n=>e.jsx(s,{...n,label:"شهر را انتخاب کنید"})})}),e.jsx(l,{children:e.jsxs(uu,{fullWidth:!0,disabled:d==="ProvinceOperator"||d==="ProvinceInspector",children:[e.jsx(eu,{id:"demo-simple-select-label",children:"بانک"}),e.jsxs(ru,{fullWidth:!0,value:u.values.bankName,id:"bankName",label:"بانک",onChange:n=>{u.setFieldValue("bankName",n.target.value)},children:[e.jsx(a,{value:"موسسه افضل توس",children:"موسسه افضل توس"}),e.jsx(a,{value:"انصار",children:"انصار"}),e.jsx(a,{value:"سپه",children:"سپه"}),e.jsx(a,{value:"دی",children:"دی"}),e.jsx(a,{value:"کاب",children:"اقتصاد نوین"}),e.jsx(a,{value:"گردشگری",children:"گردشگری"}),e.jsx(a,{value:"حکمت ایرانیان",children:"حکمت ایرانیان"}),e.jsx(a,{value:"ایران زمین",children:"ایران زمین"}),e.jsx(a,{value:"کشاورزی",children:"کشاورزی"}),e.jsx(a,{value:"مسکن",children:"مسکن"}),e.jsx(a,{value:"مهر ایران",children:"مهر ایران"}),e.jsx(a,{value:"مهر اقتصاد",children:"مهر اقتصاد"}),e.jsx(a,{value:"ملت",children:"ملت"}),e.jsx(a,{value:"ملی",children:"ملی"}),e.jsx(a,{value:"پارسیان",children:"پارسیان"}),e.jsx(a,{value:"پاسارگاد",children:"پاسارگاد"}),e.jsx(a,{value:"پست بانک ایران",children:"پست بانک ایران"}),e.jsx(a,{value:"صادرات",children:"صادرات"}),e.jsx(a,{value:"سامان",children:"سامان"}),e.jsx(a,{value:"صنعت و معدن",children:"صنعت و معدن"}),e.jsx(a,{value:"سرمایه",children:"سرمایه"}),e.jsx(a,{value:"شهر",children:"شهر"}),e.jsx(a,{value:"سینا",children:"سینا"}),e.jsx(a,{value:"تجارت",children:"تجارت"}),e.jsx(a,{value:"موسسه اعتباری توسعه",children:"موسسه اعتباری توسعه"}),e.jsx(a,{value:"خاورمیانه",children:"خاورمیانه"})]})]})}),e.jsx(l,{children:e.jsx(s,{disabled:d==="ProvinceOperator"||d==="ProvinceInspector",fullWidth:!0,id:"cardNumber",label:"شماره کارت",value:u.values.cardNumber,error:u.touched.cardNumber?!!u.errors.cardNumber:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.cardNumber&&u.errors.cardNumber?u.errors.cardNumber:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(l,{children:e.jsx(s,{disabled:d==="ProvinceOperator"||d==="ProvinceInspector",fullWidth:!0,id:"accountNumber",label:"شماره حساب",value:u.values.accountNumber,error:u.touched.accountNumber?!!u.errors.accountNumber:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.accountNumber&&u.errors.accountNumber?u.errors.accountNumber:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(l,{children:e.jsx(s,{disabled:d==="ProvinceOperator"||d==="ProvinceInspector",fullWidth:!0,id:"shabaNumber",label:"شماره شبا",value:u.values.shabaNumber,error:u.touched.shabaNumber?!!u.errors.shabaNumber:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.shabaNumber&&u.errors.shabaNumber?u.errors.shabaNumber:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(l,{children:e.jsx(s,{disabled:d==="ProvinceOperator"||d==="ProvinceInspector",fullWidth:!0,id:"accountHolder",label:"نام صاحب حساب",value:u.values.accountHolder,error:u.touched.accountHolder?!!u.errors.accountHolder:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.accountHolder&&u.errors.accountHolder?u.errors.accountHolder:null,variant:"outlined"})}),e.jsx(M,{fullWidth:!0,color:"primary",variant:"contained",onClick:()=>{h(E()),h(z({user_bank_info:{name_of_bank_user:u.values.accountHolder,bank_name:u.values.bankName,card:u.values.cardNumber,shaba:u.values.shabaNumber,account:u.values.accountNumber},address:{address:u.values.address,postal_code:u.values.postal,city:$,province:I},poultry_key:_,type:d,person_type:"operator",userprofile_key:C,halls:u.values.halls,breeding_unique_id:u.values.uniqueId,unit_name:u.values.farmName})).then(n=>{n.error?n.error.message.includes("403")?i({vertical:"top",horizontal:"center",msg:"مرغداری از قبل موجود است!",severity:"error"}):n.error.message.includes("400")?i({vertical:"top",horizontal:"center",msg:"شناسه یکتا تکراریست!",severity:"error"}):i({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):i({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),h(N()),h(L(C)),h(R({right:!1,bottom:!1,content:null}))})},children:"ارسال اطلاعات"})]})})})};lu.propTypes={id:o.PropTypes.any,address:o.PropTypes.any,postal:o.PropTypes.any,name_of_bank_user:o.PropTypes.any,bank_name:o.PropTypes.any,card:o.PropTypes.any,shaba:o.PropTypes.any,account:o.PropTypes.any,accountHolder:o.PropTypes.any,type:o.PropTypes.any,poultry:o.PropTypes.any,halls:o.PropTypes.any,uniqueId:o.PropTypes.any};export{au as I,iu as a,lu as b,z as i}; diff --git a/build/assets/InspectorReporting-Cw7P2uCF.js b/build/assets/InspectorReporting-Cw7P2uCF.js new file mode 100644 index 0000000..d9c4a23 --- /dev/null +++ b/build/assets/InspectorReporting-Cw7P2uCF.js @@ -0,0 +1 @@ +import{j as e,b as L,aL as _,aM as O,T as V,aN as G,ak as o,ag as R,av as Y,aw as P,ax as d,aU as $,am as U,B as f}from"./mui-vendor-CkIVaoQP.js";import{j as W,A as H,u as y,c as D,b as t,M as i,Q as q,G as r,S as m,k as Q,W as T,v as E,L as J,h as K}from"./index-CeyyVc1v.js";import{r as C}from"./react-vendor-CmFgShSM.js";import{a as X,u as Z}from"./redux-vendor-B7uoacJt.js";import{d as uu}from"./Add--yVWBJhC.js";import{b as eu}from"./index-CIfb_iLp.js";import{d as ru}from"./Search-Dek2fED1.js";import{A as au}from"./AdvancedTable-BYmmBtmq.js";import"./Close-_jAEIgMD.js";import"./Delete-C5MyLelE.js";const lu=X("INSPECTOR_GET_REPORTING",async h=>{const{data:p,status:F}=await W.get("reporting-all-poultry/?type=filter&value="+h);return{data:p,status:F}}),pu=()=>{const[h,p]=C.useState(),[F,N]=C.useState(),x=Z(),[I]=C.useContext(H),u=y({initialValues:{mobile:"",fname:"",lname:"",nationalCode:"",nationalId:"",address:"",unitName:"",gisCode:"",operationNumber:"",halls:"",economicCode:"",systemCode:"",epidemiologicalCode:"",capacity:"",licenseNumber:"",healthCode:"",orderCode:"",race:""},validationSchema:D({mobile:t().typeError("لطفا عدد وارد کنید!"),fname:i().typeError("فیلد را به درستی وارد کنید!"),lname:i().typeError("فیلد را به درستی وارد کنید!"),nationalCode:t().typeError("لطفا عدد وارد کنید!"),nationalId:t().typeError("لطفا عدد وارد کنید!"),address:i().typeError("فیلد را به درستی وارد کنید!"),unitName:i().typeError("فیلد را به درستی وارد کنید!"),race:i().typeError("فیلد را به درستی وارد کنید!"),gisCode:t().typeError("لطفا عدد وارد کنید!"),operationNumber:t().typeError("لطفا عدد وارد کنید!"),halls:t().typeError("لطفا عدد وارد کنید!"),economicCode:t().typeError("لطفا عدد وارد کنید!"),systemCode:t().typeError("لطفا عدد وارد کنید!"),epidemiologicalCode:t().typeError("لطفا عدد وارد کنید!"),capacity:t().typeError("لطفا عدد وارد کنید!"),licenseNumber:t().typeError("لطفا عدد وارد کنید!"),healthCode:t().typeError("لطفا عدد وارد کنید!"),orderCode:t().typeError("لطفا عدد وارد کنید!")})}),l=y({initialValues:{hatchingDateFrom:"",hatchingDateTo:""},validationSchema:D({hatchingDateFrom:i().typeError("فیلد را به درستی وارد کنید!"),hatchingDateTo:i().typeError("فیلد را به درستی وارد کنید!")})});C.useEffect(()=>{u.validateForm(),l.validateForm()},[]);const z=()=>u.isValid&&l.isValid?Object.values(u.values).filter(n=>n.length>0).length===0&&Object.values(l.values).filter(n=>n.length>0).length!==2:!0,[g,w]=C.useState(!0),S=()=>{w(!g)},M=()=>{let n=Object.values(u.values).filter(s=>s.length>0),a="";for(let s=0;s{x(K()),s.error?I({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):p(s==null?void 0:s.payload.data)})};C.useEffect(()=>{if(h){const n=h.map((a,s)=>{var A,v,j,B,b;return[s+1,a.unitName,(A=a.userprofile)==null?void 0:A.fullName,a.breedingUniqueId,a.numberOfHalls,a.totalCapacity,(v=a.userprofile)==null?void 0:v.mobile,(j=a.userprofile)==null?void 0:j.province,(B=a.userprofile)==null?void 0:B.city,(b=a.hatching)==null?void 0:b.length,a.numberOfParty,q(new Date(a==null?void 0:a.lastPartyDate),"yyyy/MM/dd"),a.gisCode,a.economicCode,a.samasatUserCode,a.unitStatus]});N(n)}},[h]);const[c,k]=C.useState(!1);return e.jsx(e.Fragment,{children:e.jsx(L,{display:"flex",justifyContent:"center",children:e.jsxs(r,{container:!0,direction:"column",xs:12,sm:12,md:10,lg:10,mt:m.MEDIUM,children:[e.jsxs(_,{xs:12,expanded:g,onChange:S,children:[e.jsx(O,{expandIcon:e.jsx(Q,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:e.jsx(V,{children:"جستجو"})}),e.jsx(G,{children:e.jsxs(r,{container:!0,justifyContent:"center",gap:m.SMALL,children:[e.jsxs(r,{justifyContent:"start",container:!0,gap:m.SMALL,children:[e.jsx(r,{children:e.jsx(o,{size:"small",id:"mobile",label:"موبایل",value:u.values.mobile,error:u.touched.mobile?!!u.errors.mobile:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.mobile&&u.errors.mobile?u.errors.mobile:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{children:e.jsx(o,{size:"small",id:"fname",label:"نام",value:u.values.fname,error:u.touched.fname?!!u.errors.fname:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.fname&&u.errors.fname?u.errors.fname:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{children:e.jsx(o,{size:"small",id:"lname",label:"نام خانوادگی",value:u.values.lname,error:u.touched.lname?!!u.errors.lname:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.lname&&u.errors.lname?u.errors.lname:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{children:e.jsx(o,{size:"small",id:"nationalCode",label:"کد ملی",value:u.values.nationalCode,error:u.touched.nationalCode?!!u.errors.nationalCode:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.nationalCode&&u.errors.nationalCode?u.errors.nationalCode:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{children:e.jsx(o,{size:"small",id:"nationalId",label:"شماره شناسنامه",value:u.values.nationalId,error:u.touched.nationalId?!!u.errors.nationalId:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.nationalId&&u.errors.nationalId?u.errors.nationalId:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{children:e.jsx(o,{size:"small",id:"address",label:"آدرس",value:u.values.address,error:u.touched.address?!!u.errors.address:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.address&&u.errors.address?u.errors.address:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{children:e.jsx(o,{size:"small",id:"unitName",label:"نام واحد",value:u.values.unitName,error:u.touched.unitName?!!u.errors.unitName:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.unitName&&u.errors.unitName?u.errors.unitName:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{minWidth:230,children:e.jsxs(R,{size:"small",children:[e.jsx(Y,{id:"demo-simple-select-label",children:"نژاد مرغ"}),e.jsxs(P,{labelId:"demo-simple-select-label",id:"race",label:"نژاد مرغ",value:u.values.race,error:u.touched.race?!!u.errors.race:null,onChange:n=>{u.setFieldValue("race",n.target.value)},onBlur:u.handleBlur,children:[e.jsx(d,{value:"",children:"همه"}),e.jsx(d,{value:"آرین",children:"آرین"}),e.jsx(d,{value:"راس",children:"راس"}),e.jsx(d,{value:"آربراکرز (آپلاس)",children:"آربراکرز (آپلاس)"}),e.jsx(d,{value:"کاب",children:"کاب"}),e.jsx(d,{value:"هوبارد",children:"هوبارد"}),e.jsx(d,{value:"ترکیبی",children:"ترکیبی"}),e.jsx(d,{value:"وارداتی",children:"وارداتی"})]}),e.jsx($,{children:u.touched.race&&u.errors.race?u.errors.race:null})]})}),c&&e.jsxs(e.Fragment,{children:[e.jsx(r,{children:e.jsx(o,{size:"small",id:"gisCode",label:"کد gis",value:u.values.gisCode,error:u.touched.gisCode?!!u.errors.gisCode:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.gisCode&&u.errors.gisCode?u.errors.gisCode:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{children:e.jsx(o,{size:"small",id:"operationNumber",label:"شماره گواهی عملیاتی",value:u.values.operationNumber,error:u.touched.operationNumber?!!u.errors.operationNumber:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.operationNumber&&u.errors.operationNumber?u.errors.operationNumber:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{children:e.jsx(o,{size:"small",id:"halls",label:"تعداد سالن",value:u.values.halls,error:u.touched.halls?!!u.errors.halls:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.halls&&u.errors.halls?u.errors.halls:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{children:e.jsx(o,{size:"small",id:"economicCode",label:"کد اکونومی",value:u.values.economicCode,error:u.touched.economicCode?!!u.errors.economicCode:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.economicCode&&u.errors.economicCode?u.errors.economicCode:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{children:e.jsx(o,{size:"small",id:"systemCode",label:"کد سیستمی",value:u.values.systemCode,error:u.touched.systemCode?!!u.errors.systemCode:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.systemCode&&u.errors.systemCode?u.errors.systemCode:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{children:e.jsx(o,{size:"small",id:"epidemiologicalCode",label:"کد اپیدمیولوژیک",value:u.values.epidemiologicalCode,error:u.touched.epidemiologicalCode?!!u.errors.epidemiologicalCode:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.epidemiologicalCode&&u.errors.epidemiologicalCode?u.errors.epidemiologicalCode:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{children:e.jsx(o,{size:"small",id:"capacity",label:"ظرفیت کل",value:u.values.capacity,error:u.touched.capacity?!!u.errors.capacity:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.capacity&&u.errors.capacity?u.errors.capacity:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{children:e.jsx(o,{size:"small",id:"licenseNumber",label:"شماره مجوز",value:u.values.licenseNumber,error:u.touched.licenseNumber?!!u.errors.licenseNumber:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.licenseNumber&&u.errors.licenseNumber?u.errors.licenseNumber:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{children:e.jsx(o,{size:"small",id:"healthCode",label:"کد بهداشتی",value:u.values.healthCode,error:u.touched.healthCode?!!u.errors.healthCode:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.healthCode&&u.errors.healthCode?u.errors.healthCode:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{children:e.jsx(o,{size:"small",id:"orderCode",label:"کد سفارش",value:u.values.orderCode,error:u.touched.orderCode?!!u.errors.orderCode:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.orderCode&&u.errors.orderCode?u.errors.orderCode:null,autoComplete:"current-password",variant:"outlined"})}),e.jsx(r,{maxWidth:230,children:e.jsx(T,{label:"جوجه ریزی از",id:"hatchingDateFrom",renderInput:n=>e.jsx(o,{size:"small",...n,error:!1}),value:l.values.hatchingDateFrom,error:l.touched.hatchingDateFrom?!!l.errors.hatchingDateFrom:null,onChange:n=>{l.setFieldValue("hatchingDateFrom",E(n).format("YYYY-MM-DD"))},onBlur:l.handleBlur,helperText:l.touched.hatchingDateFrom&&l.errors.hatchingDateFrom?l.errors.hatchingDateFrom:null})}),e.jsx(r,{maxWidth:230,children:e.jsx(T,{label:"تا",id:"hatchingDateTo",renderInput:n=>e.jsx(o,{size:"small",...n,error:!1}),value:l.values.hatchingDateTo,error:l.touched.hatchingDateTo?!!l.errors.hatchingDateTo:null,onChange:n=>{l.setFieldValue("hatchingDateTo",E(n).format("YYYY-MM-DD"))},onBlur:l.handleBlur,helperText:l.touched.hatchingDateTo&&l.errors.hatchingDateTo?l.errors.hatchingDateTo:null})})]})]}),e.jsx(U,{sx:{width:"100%"}}),e.jsx(r,{children:e.jsx(f,{size:"small",endIcon:e.jsx(ru,{}),variant:"contained",disabled:z(),onClick:M,children:"جستجو"})}),e.jsx(r,{children:e.jsx(f,{variant:"contained",endIcon:c?e.jsx(eu,{}):e.jsx(uu,{}),onClick:()=>{k(!c)},size:"small",children:c?e.jsx(e.Fragment,{children:"کاهش فیلتر"}):e.jsx(e.Fragment,{children:"افزودن فیلتر"})})})]})})]}),e.jsx(r,{container:!0,justifyContent:"space-between",gap:m.SMALL,children:e.jsx(r,{xs:12,children:e.jsx(au,{name:"گزارشات",columns:["ردیف","نام واحد","نام مرغدار","شناسه یکتا","تعداد سالن","ظرفیت","موبایل","استان","شهرستان","تعداد جوجه ریزی","تعداد پارتی","تاریخ آخرین پارتی","کد gis","کد اکونومی","کد سماصط","وضعیت واحد"],data:F})})})]})})})};export{pu as default}; diff --git a/build/assets/IranOutlined-CUL7OBR7.png b/build/assets/IranOutlined-CUL7OBR7.png new file mode 100644 index 0000000..cd8bab8 Binary files /dev/null and b/build/assets/IranOutlined-CUL7OBR7.png differ diff --git a/build/assets/JahadIllegalKilling-BZcreoc1.js b/build/assets/JahadIllegalKilling-BZcreoc1.js new file mode 100644 index 0000000..b2839fe --- /dev/null +++ b/build/assets/JahadIllegalKilling-BZcreoc1.js @@ -0,0 +1 @@ +import{j as e,b as p}from"./mui-vendor-CkIVaoQP.js";import{l6 as f,p as n,G as s,S as i}from"./index-CeyyVc1v.js";import{r as t}from"./react-vendor-CmFgShSM.js";import{u as A,f as x}from"./redux-vendor-B7uoacJt.js";import{A as j}from"./AdvancedTable-BYmmBtmq.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const F=()=>{const l=A(),{jahadIllegalKilling:r}=x(a=>a.jahadSlice),[C,c]=t.useState([]);return t.useEffect(()=>{l(f())},[]),t.useEffect(()=>{const a=r==null?void 0:r.map((u,d)=>{const o=u.quantity-u.losses-u.leftOver;return[d+1,u.poultry.unitName,u.poultry.userprofile.baseOrder,u.poultry.userprofile.mobile,u.hall,u.period,n(u==null?void 0:u.createDate),n(u==null?void 0:u.date),u.chickenBreed,u.age,u.quantity,`${u.losses} (%${(u.losses*100/u.quantity).toFixed(0)})`,o+` (%${(o*100/u.quantity).toFixed(0)})`,`${u.leftOver} (%${(u.leftOver*100/u.quantity).toFixed(0)})`,u.message]});c(a)},[r]),e.jsx(s,{container:!0,children:e.jsx(j,{name:"کشتارهای غیرمجاز",columns:["ردیف","نام فارم","کدکاربری","تلفن","سالن","دوره جوجه ریزی","تاریخ ثبت جوجه ریزی","تاریخ جوجه ریزی","نژاد","سن","تعداد جوجه ریزی","تلفات دوره","کشتار شده","مانده در سالن","توضیحات"],data:C})})},$=()=>e.jsx(e.Fragment,{children:e.jsx(p,{display:"flex",justifyContent:"center",children:e.jsx(s,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:e.jsx(s,{container:!0,justifyContent:"space-between",gap:i.SMALL,children:e.jsx(s,{xs:12,children:e.jsx(F,{})})})})})});export{$ as default}; diff --git a/build/assets/JahadKillStats-BePuGWF-.js b/build/assets/JahadKillStats-BePuGWF-.js new file mode 100644 index 0000000..21de774 --- /dev/null +++ b/build/assets/JahadKillStats-BePuGWF-.js @@ -0,0 +1 @@ +import{j as t,I as m,b as f}from"./mui-vendor-CkIVaoQP.js";import{Q as s,l5 as p,G as r,S as o}from"./index-CeyyVc1v.js";import{r as n}from"./react-vendor-CmFgShSM.js";import{N as x,L as h,B as A,C as j}from"./chart-vendor-sE2SUVPW.js";import{A as b}from"./AdvancedTable-BYmmBtmq.js";import"./auto-gcBAg08D.js";import{d as y}from"./PictureAsPdf-oEJEta1d.js";import{u as S,f as g}from"./redux-vendor-B7uoacJt.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";A.font.family="iranyekan";console.log(j);const F=()=>{const d=S(),{killsDailyReport:u}=g(e=>e.jahadSlice),[i,c]=n.useState([]),[C]=n.useState({labels:u==null?void 0:u.map(e=>s(new Date(e.date),"yyyy/MM/dd")),datasets:[{label:"درخواست کشتار",data:u==null?void 0:u.map(e=>e.totalPoultryRequestQuantity),backgroundColor:"#ff6384"},{label:"تایید شده",data:u==null?void 0:u.map(e=>e.acceptedRequestQuantity),backgroundColor:"#36a2eb"}],options:{title:{display:!0,text:"Monthly Sales and Expenses Report",fontSize:18},legend:{position:"bottom"},scales:{yAxes:[{ticks:{beginAtZero:!0}}]}}}),[l]=n.useState({labels:u==null?void 0:u.map(e=>s(new Date(e.date),"yyyy/MM/dd")),datasets:[{label:"میانگین وزن",data:u==null?void 0:u.map(e=>e.indexWeight),borderColor:"#ff6384",fill:!1}],options:{title:{display:!0,text:"Monthly Sales Report",fontSize:18},legend:{position:"bottom"},tooltips:{mode:"index",intersect:!1}}});return n.useEffect(()=>{d(p())},[]),n.useEffect(()=>{const e=u==null?void 0:u.map((a,M)=>[a.province,a.date,a.indexWeight,a.remainQuantity,a.provinceQuantity,a.countryQuantity,t.jsx("a",{target:"_blank",href:`https://core-inventory.iran.liara.run/pdf/kills-daily-report?date=${a.date}&which=${window.location.origin}`,rel:"noreferrer",children:t.jsx(m,{color:"primary",children:t.jsx(y,{})},"rrr")},"rrr")]);c(e)},[u]),t.jsxs(r,{mt:o.SMALL,children:[t.jsxs(r,{container:!0,children:[t.jsx(r,{xs:12,sm:6,children:t.jsx(x,{data:C})}),t.jsx(r,{xs:12,sm:6,children:t.jsx(h,{data:l})})]}),t.jsx(b,{name:"آمار روزانه کشتار استان",columns:["استان","درخواست کشتار","وزن اعلامی","مرغ باقی مانده","تایید نهایی استان","تایید نهایی کشوری","دریافت سند"],data:i})]})},N=()=>t.jsx(t.Fragment,{children:t.jsx(f,{display:"flex",justifyContent:"center",children:t.jsx(r,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:t.jsx(r,{container:!0,justifyContent:"space-between",gap:o.SMALL,children:t.jsx(r,{xs:12,children:t.jsx(F,{})})})})})});export{N as default}; diff --git a/build/assets/LabelField-B6eRSoQP.js b/build/assets/LabelField-B6eRSoQP.js new file mode 100644 index 0000000..4bd22d5 --- /dev/null +++ b/build/assets/LabelField-B6eRSoQP.js @@ -0,0 +1 @@ +import{j as r,a3 as t,b as e,T as i}from"./mui-vendor-CkIVaoQP.js";import{S as p}from"./index-CeyyVc1v.js";const n=({label:o,children:s})=>r.jsx(t,{container:!0,xs:12,children:r.jsxs(e,{style:{borderRadius:8,border:"1px solid #e6e6e6",position:"relative",width:"100%"},p:{xs:"8px 4px 6px",sm:"10px 8px 8px"},children:[o&&r.jsx(i,{variant:"body2",style:{position:"absolute",top:0,transform:"translateY(-50%)",right:8,backgroundColor:"white",padding:p.SMALL,fontSize:{xs:"12px",sm:"14px"},color:"#797979"},children:o}),s]})});export{n as L}; diff --git a/build/assets/LineWithText-BpnpjRWf.js b/build/assets/LineWithText-BpnpjRWf.js new file mode 100644 index 0000000..6681ebd --- /dev/null +++ b/build/assets/LineWithText-BpnpjRWf.js @@ -0,0 +1 @@ +import{j as r,am as i,T as e}from"./mui-vendor-CkIVaoQP.js";import"./react-vendor-CmFgShSM.js";const x=({text:a})=>r.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:"15px",marginTop:"15px"},children:[r.jsx(i,{sx:{flex:1,height:"2px",background:"linear-gradient(90deg, rgba(255,0,150,0.5), rgba(0,204,255,0.5))",borderRadius:3,opacity:.7}}),r.jsx(e,{variant:"body1",sx:{fontWeight:500,color:"text.primary",padding:"0 15px",fontSize:"14px"},children:a}),r.jsx(i,{sx:{flex:1,height:"2px",background:"linear-gradient(90deg, rgba(0,204,255,0.5), rgba(255,0,150,0.5))",borderRadius:3,opacity:.7}})]});export{x as L}; diff --git a/build/assets/LinkItem-DT6qswcs.js b/build/assets/LinkItem-DT6qswcs.js new file mode 100644 index 0000000..d927e58 --- /dev/null +++ b/build/assets/LinkItem-DT6qswcs.js @@ -0,0 +1 @@ +import{$ as p,j as a,c1 as d,e as c,b as f,T as x}from"./mui-vendor-CkIVaoQP.js";import{f as l,r as m}from"./react-vendor-CmFgShSM.js";import{fo as h,G as u,fp as g,m as b}from"./index-CeyyVc1v.js";import{u as y}from"./redux-vendor-B7uoacJt.js";const T=d(b.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"10px",width:window.innerWidth<=600?"40vw":"180px",height:window.innerWidth<=600?"40vw":"180px",borderRadius:"16px",background:e.palette.mode==="dark"?"#1e272e":"#ffffff",borderStyle:"solid",borderWidth:"1px",borderColor:e.palette.primary.main,boxShadow:e.palette.mode==="dark"?"5px 5px 15px rgba(0, 0, 0, 0.5)":"5px 5px 15px rgba(0, 0, 0, 0.1)",transition:"transform 0.2s ease, background 0.4s ease","&:hover":{transform:"translateY(-10px)",background:e.palette.mode==="dark"?"#2f3640":"#f5f6fa"},padding:2})),S=({icon:e,title:o,badgeContent:i,...s})=>{const t=p(),r=y(),{pathname:n}=l();return m.useEffect(()=>{r(h(n))},[r]),a.jsx(u,{onClick:()=>{r(g(o))},children:a.jsxs(T,{...s,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.6},theme:t,children:[a.jsx(c,{badgeContent:i,color:"primary",children:a.jsx(f,{sx:{fontSize:"20px",color:"#00a8ff"},children:e})}),a.jsx(x,{sx:{fontSize:"14px",fontWeight:600,textAlign:"center",color:t.palette.mode==="dark"?"#f5f6fa":"#2f3640"},children:o})]})})};export{S as L}; diff --git a/build/assets/LiveStockColdHouse-BgWIbVgg.js b/build/assets/LiveStockColdHouse-BgWIbVgg.js new file mode 100644 index 0000000..ccf6204 --- /dev/null +++ b/build/assets/LiveStockColdHouse-BgWIbVgg.js @@ -0,0 +1 @@ +import{j as e,T as I,ak as g,b as M}from"./mui-vendor-CkIVaoQP.js";import{r as o}from"./react-vendor-CmFgShSM.js";import{fG as b,A as m,v as i,p as H,G as a,S as c,W as F,ll as R,X as q}from"./index-CeyyVc1v.js";import{f as k,u as T}from"./redux-vendor-B7uoacJt.js";import{S as D}from"./SimpleTable-DBAoNnCU.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const G=()=>{const{inventoryData:s}=k(t=>t.liveStockSlice),[Y,d]=o.useState([]),p=T();o.useEffect(()=>{p(b())},[]);const{freezingRequests:r}=k(t=>t.liveStockSlice),[,,n,x,l,C]=o.useContext(m);o.useEffect(()=>{const t=i(new Date).format("YYYY-MM-DD");x(t),C(t)},[]);const y=()=>{!n||!l||p(R({role:q(),date1:n,date2:l}))};o.useEffect(()=>{y()},[n,l]),o.useEffect(()=>{if(!r||!Array.isArray(r)){d([]);return}const t=r.filter(u=>(u==null?void 0:u.state)==="accepted").map((u,L)=>{var f,A,j,h,S;return[L+1,((f=u==null?void 0:u.coldHouse)==null?void 0:f.name)||"-",((j=(A=u==null?void 0:u.killHouseRequest)==null?void 0:A.killHouseRequestInfo)==null?void 0:j.poultryName)||"-",((S=(h=u==null?void 0:u.killHouseRequest)==null?void 0:h.killHouseRequestInfo)==null?void 0:S.killHouseFullname)||"-",(u==null?void 0:u.quantity)||"-",(u==null?void 0:u.weight)||"-",H(u==null?void 0:u.createDate)||"-","در انتظار تایید"]});d(t||[])},[r]);const E=e.jsxs(a,{container:!0,alignItems:"center",gap:c.SMALL,children:[e.jsx(a,{container:!0,gap:c.TINY,children:e.jsx(I,{children:"تخصیص برای انجماد"})}),e.jsxs(a,{container:!0,gap:c.SMALL,children:[e.jsx(a,{children:e.jsx(F,{label:"از تاریخ",id:"date",renderInput:t=>e.jsx(g,{size:"small",style:{width:"160px"},...t}),value:n,onChange:t=>{x(i(t).format("YYYY-MM-DD"))}})}),e.jsx(a,{children:e.jsx(F,{label:"تا تاریخ",id:"date",renderInput:t=>e.jsx(g,{size:"small",style:{width:"160px"},...t}),value:l,onChange:t=>{C(i(t).format("YYYY-MM-DD"))}})})]})]});return e.jsxs(a,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mt:2,children:[e.jsx(D,{name:`موجودی انبار ${(s==null?void 0:s.name)||""}`,columns:["تعداد کل","وزن کل"],data:[[s!=null&&s.totalQuantity?s.totalQuantity.toLocaleString():"-",s!=null&&s.totalWeight?s.totalWeight.toLocaleString():"-"]]}),e.jsx(a,{container:!0,mt:4,xs:12,children:e.jsx(D,{name:E,columns:["ردیف","سردخانه","مرغدار","کشتارگاه","تعداد","وزن","تاریخ ثبت","وضعیت"],data:Y})})]})},U=()=>e.jsx(M,{display:"flex",justifyContent:"center",children:e.jsx(a,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:e.jsx(a,{container:!0,justifyContent:"space-between",gap:c.SMALL,mt:2,children:e.jsx(a,{xs:12,children:e.jsx(G,{})})})})});export{U as default}; diff --git a/build/assets/LiveStockFreezingRequests-DG4F8ICf.js b/build/assets/LiveStockFreezingRequests-DG4F8ICf.js new file mode 100644 index 0000000..f5eadec --- /dev/null +++ b/build/assets/LiveStockFreezingRequests-DG4F8ICf.js @@ -0,0 +1 @@ +import{j as e,ak as S,B as uu,i as eu,I as tu,b2 as au,b3 as B,b0 as nu,an as su,b4 as H,ap as Y,aq as N,b as ou}from"./mui-vendor-CkIVaoQP.js";import{r as o,b as ru}from"./react-vendor-CmFgShSM.js";import{L as lu,j as cu,h as G,A as R,c as iu,b as W,u as Cu,X as w,C as du,G as r,r as hu,v as D,p as V,S as E,W as $,ll as pu,O as Au}from"./index-CeyyVc1v.js";import{a as fu,u as J,f as xu}from"./redux-vendor-B7uoacJt.js";import{R as X}from"./ResponsiveTable-w7hk7Uq8.js";import{d as Fu}from"./Tune-D4M2CAhp.js";import{d as gu}from"./CheckCircleOutline-Ci9-hVKX.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const K=fu("LIVE_STOCK_CHANGE_FREEZING_STATE",async(n,{dispatch:s})=>{s(lu());try{const{data:l,status:i}=await cu.put("check-cold-house-allocations/0/",n);return s(G()),{data:l,status:i}}catch(l){return s(G()),{error:l.response.data.result}}}),yu=({item:n,fetchApi:s})=>{const l=J(),[i]=o.useContext(R),b=iu({quantity:W().required("مقدار اجباری است").positive("عدد مثبت وارد کنید"),weight:W().required("وزن اجباری است").positive("عدد مثبت وارد کنید")}),a=Cu({initialValues:{quantity:n.quantity?n==null?void 0:n.quantity:"",weight:n.weight?n==null?void 0:n.weight:""},validationSchema:b,onSubmit:L=>{l(K({allocation_key:n==null?void 0:n.key,role:w(),state:"accepted",accepted_quantity:parseInt(a.values.quantity),accepted_weight:parseInt(a.values.weight)})).then(C=>{C.payload.error?i({vertical:"top",horizontal:"center",msg:C.payload.error,severity:"error"}):(s(),l(du()),i({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}});return e.jsx("form",{onSubmit:a.handleSubmit,children:e.jsxs(r,{container:!0,gap:2,children:[e.jsx(S,{fullWidth:!0,id:"quantity",name:"quantity",label:"مقدار",value:a.values.quantity,onChange:a.handleChange,error:a.touched.quantity&&!!a.errors.quantity,helperText:a.touched.quantity&&a.errors.quantity}),e.jsx(S,{fullWidth:!0,id:"weight",name:"weight",label:"وزن",value:a.values.weight,onChange:a.handleChange,error:a.touched.weight&&!!a.errors.weight,helperText:a.touched.weight&&a.errors.weight}),e.jsx(uu,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,children:"ارسال"})]})})};var I={},ju=eu;Object.defineProperty(I,"__esModule",{value:!0});var Q=I.default=void 0,vu=ju(hu()),qu=e;Q=I.default=(0,vu.default)((0,qu.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined");const Su=()=>{const n=J(),[s,l]=ru.useState("0"),i=(t,c)=>{l(c)},[b,a]=o.useState([]),[L,C]=o.useState([]),[_]=o.useContext(R),{freezingRequests:d}=xu(t=>t.liveStockSlice),[,,F,M,g,T]=o.useContext(R),[y,z]=o.useState({anchorPosition:null,item:null});o.useEffect(()=>{const t=D(new Date).format("YYYY-MM-DD");M(t),T(t)},[]);const k=()=>{!F||!g||n(pu({role:w(),date1:F,date2:g}))};o.useEffect(()=>{k()},[F,g]);const U=(t,c)=>{const u=t.currentTarget.getBoundingClientRect();z({anchorPosition:{top:u.bottom+window.scrollY,left:u.left+u.width/2+window.scrollX},item:c})},j=()=>{z({anchorPosition:null,item:null})},Z=t=>{t&&(n(Au({title:"تایید درخواست",content:e.jsx(yu,{item:t,fetchApi:k})})),j())},m=t=>{t&&(j(),n(K({allocation_key:t==null?void 0:t.key,role:w(),state:"rejected"})).then(c=>{var u;(u=c.payload)!=null&&u.error?_({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(k(),_({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})),j()}))};o.useEffect(()=>{if(!d||!Array.isArray(d)){a([]),C([]);return}const t=d.filter(u=>(u==null?void 0:u.state)==="pending").map((u,v)=>{var h,p,A,f,x;return[v+1,((h=u==null?void 0:u.coldHouse)==null?void 0:h.name)||"-",((A=(p=u==null?void 0:u.killHouseRequest)==null?void 0:p.killHouseRequestInfo)==null?void 0:A.poultryName)||"-",((x=(f=u==null?void 0:u.killHouseRequest)==null?void 0:f.killHouseRequestInfo)==null?void 0:x.killHouseFullname)||"-",(u==null?void 0:u.quantity)||"-",(u==null?void 0:u.weight)||"-",V(u==null?void 0:u.createDate)||"-","در انتظار تایید",e.jsx(r,{container:!0,justifyContent:"center",children:e.jsx(tu,{color:"primary",onClick:q=>U(q,u),children:e.jsx(Fu,{})})},v)]});a(t||[]);const c=d.filter(u=>(u==null?void 0:u.state)!=="pending").map((u,v)=>{var p,A,f,x,q;let h="تایید شده";return(u==null?void 0:u.state)==="rejected"&&(h="رد شده"),[v+1,((p=u==null?void 0:u.coldHouse)==null?void 0:p.name)||"-",((f=(A=u==null?void 0:u.killHouseRequest)==null?void 0:A.killHouseRequestInfo)==null?void 0:f.poultryName)||"-",((q=(x=u==null?void 0:u.killHouseRequest)==null?void 0:x.killHouseRequestInfo)==null?void 0:q.killHouseFullname)||"-",(u==null?void 0:u.quantity)||"-",(u==null?void 0:u.weight)||"-",V(u==null?void 0:u.createDate)||"-",h]});C(c||[])},[d]);const O=s==="0"?"تخصیص برای انجماد":"تخصیص برای انجماد تایید / رد شده",P=e.jsxs(r,{container:!0,gap:E.SMALL,children:[e.jsx(r,{children:e.jsx($,{label:"از تاریخ",id:"date",renderInput:t=>e.jsx(S,{size:"small",style:{width:"160px"},...t}),value:F,onChange:t=>{M(D(t).format("YYYY-MM-DD"))}})}),e.jsx(r,{children:e.jsx($,{label:"تا تاریخ",id:"date",renderInput:t=>e.jsx(S,{size:"small",style:{width:"160px"},...t}),value:g,onChange:t=>{T(D(t).format("YYYY-MM-DD"))}})})]});return e.jsxs(r,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:E.SMALL,children:[e.jsxs(au,{value:s,onChange:i,textColor:"secondary",indicatorColor:"secondary","aria-label":"secondary tabs example",children:[e.jsx(B,{value:"0",label:"درخواست های جدید"}),e.jsx(B,{value:"1",label:"تائید/ رد شده"})]}),s==="0"?e.jsx(X,{title:O,operation:P,columns:["ردیف","سردخانه","مرغدار","کشتارگاه","تعداد","وزن","تاریخ ثبت","وضعیت","عملیات"],data:b,noPagination:!0,paginated:!1}):e.jsx(X,{title:O,operation:P,columns:["ردیف","سردخانه","مرغدار","کشتارگاه","تعداد","وزن","تاریخ ثبت","وضعیت"],data:L,noPagination:!0,paginated:!1}),e.jsx(nu,{anchorReference:"anchorPosition",anchorPosition:y.anchorPosition||{top:0,left:0},open:!!y.anchorPosition,onClose:j,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:e.jsxs(su,{sx:{p:0},children:[e.jsxs(H,{onClick:()=>Z(y.item),children:[e.jsx(Y,{children:e.jsx(gu,{color:"success"})}),e.jsx(N,{primary:"تایید"})]}),e.jsxs(H,{onClick:()=>m(y.item),children:[e.jsx(Y,{children:e.jsx(Q,{color:"error"})}),e.jsx(N,{primary:"رد"})]})]})})]})},Mu=()=>e.jsx(ou,{display:"flex",justifyContent:"center",children:e.jsx(r,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:e.jsx(r,{container:!0,justifyContent:"space-between",gap:E.SMALL,mt:2,children:e.jsx(r,{xs:12,children:e.jsx(Su,{})})})})});export{Mu as default}; diff --git a/build/assets/LiveStockSupportCases-AKSvycFW.js b/build/assets/LiveStockSupportCases-AKSvycFW.js new file mode 100644 index 0000000..28a4a3f --- /dev/null +++ b/build/assets/LiveStockSupportCases-AKSvycFW.js @@ -0,0 +1 @@ +import{j as t,b as e}from"./mui-vendor-CkIVaoQP.js";import"./react-vendor-CmFgShSM.js";import{P as o}from"./ProvinceCases-0uMkWb0x.js";import{G as r,S as i}from"./index-CeyyVc1v.js";import"./index.esm-Bu7XMDZU.js";import"./iconBase-BEJYyZsk.js";import"./redux-vendor-B7uoacJt.js";import"./ResponsiveTable-w7hk7Uq8.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const l=()=>t.jsx(e,{display:"flex",justifyContent:"center",children:t.jsx(r,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:t.jsx(r,{container:!0,justifyContent:"space-between",gap:i.SMALL,mt:2,children:t.jsx(r,{xs:12,children:t.jsx(o,{})})})})});export{l as default}; diff --git a/build/assets/LiveStockSupportManageBars-DPW4OFsD.js b/build/assets/LiveStockSupportManageBars-DPW4OFsD.js new file mode 100644 index 0000000..cdeaa8b --- /dev/null +++ b/build/assets/LiveStockSupportManageBars-DPW4OFsD.js @@ -0,0 +1 @@ +import{j as r}from"./mui-vendor-CkIVaoQP.js";import"./react-vendor-CmFgShSM.js";import{V as t}from"./VetFarmOperation-BbOMvrl-.js";import"./Visibility-DeyjG-oI.js";import"./index-CeyyVc1v.js";import"./redux-vendor-B7uoacJt.js";import"./AddCircleOutline-C8LXM-k8.js";import"./Edit-CqBj1Y2L.js";import"./VetFarmAggregateBars-CA10Fi1e.js";import"./Pageview-TRcW_9jm.js";import"./SimpleTable-DBAoNnCU.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";import"./iconBase-BEJYyZsk.js";import"./index.esm-Bu7XMDZU.js";import"./VetFarmDeletedBars-DqBCKO-S.js";import"./ResponsiveTable-w7hk7Uq8.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./SlaughterManageBars-CW9paHF2.js";import"./toBase64-BzgTOHsW.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./resizeImage-Csf2MO3w.js";import"./ShowImage-CqhU2hmk.js";import"./Download-DQ-VVIaV.js";import"./VetFarmEditTrafficCode-D3hZa5p9.js";import"./isValidIndexWeight-C_ik-uYa.js";import"./SlaughterEnterNoneReciept-Cle0J4bf.js";import"./Tune-D4M2CAhp.js";import"./ReceiptLong-Dxpx4wPx.js";import"./getDocumentStates-BlCrMUIj.js";import"./NumberFormatCustom-DwWPj40N.js";import"./FileUploader-DT5gIVb3.js";import"./CloudUpload-BlIgB_r9.js";import"./CheckCircle-zgBvZQ-b.js";import"./index-9Ymn_7Kv.js";import"./VetFarmSubmitClearanceCode-B4m3TtXY.js";import"./LabelField-B6eRSoQP.js";import"./ChainBarManagement-BxgsJV2X.js";import"./Settings-BckUi175.js";import"./CarPelak-BYFY8OXg.js";import"./SlaughterFreeBuyBars-CobAAajK.js";import"./slaughter-get-provinces-CSWL-EuK.js";import"./EditOutlined-n5ie2Fmu.js";import"./DeleteOutlineOutlined-G071NcE9.js";import"./ChechClearanceCode-lPasOZZ_.js";import"./province-policy-get-aggregate-bar-info-allow-state-CO-Vk47I.js";import"./Refresh-DkAX1rkD.js";import"./free-buying-payment-DH20xTKI.js";import"./ProvinceSettlementPdfKillRequest-ChEooZGT.js";import"./PictureAsPdf-oEJEta1d.js";const tr=()=>r.jsx(t,{});export{tr as default}; diff --git a/build/assets/ManageFarm-BTM56jv5.js b/build/assets/ManageFarm-BTM56jv5.js new file mode 100644 index 0000000..b53bb71 --- /dev/null +++ b/build/assets/ManageFarm-BTM56jv5.js @@ -0,0 +1 @@ +import{j as u,ak as $,I as X,al as hu,ag as fu,av as vu,aw as ju,ax as yu,aq as O,bj as gu,B,T as f,aJ as bu,b1 as Fu,b as Q,bk as Eu,i as Cu,b2 as Su,b3 as U,d as su,b0 as au,an as nu,b4 as Y,ap as J}from"./mui-vendor-CkIVaoQP.js";import{j as L,L as w,h as v,A as Z,u as Iu,c as _u,M as ku,b as Lu,G as s,S as h,N as k,dL as Tu,c3 as Du,X as xu,dM as lu,r as pu}from"./index-CeyyVc1v.js";import{r as a,b as ou}from"./react-vendor-CmFgShSM.js";import{a as z,u as uu,f as Mu}from"./redux-vendor-B7uoacJt.js";import{d as Ru}from"./Search-Dek2fED1.js";import{d as wu}from"./Delete-C5MyLelE.js";import{R as Hu}from"./ResponsiveTable-w7hk7Uq8.js";import{R as Vu}from"./index.esm-Bu7XMDZU.js";import{d as iu}from"./Tune-D4M2CAhp.js";import{d as Pu}from"./FileDownload-Br429XFy.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./iconBase-BEJYyZsk.js";const Nu=z("VET_FARM_NEW_FARM",async i=>{const{data:o,status:r}=await L.post("vet_farm/",i);return{data:o,status:r}}),Bu=z("VET_GET_VET_FARM_DATA",async i=>{const{data:o,status:r}=await L.get("Poultry/?type=filter&value="+i);return{data:o,status:r}}),zu=z("INSPECTOR_DELETE_VET_FARM_SERVICE",async(i,{dispatch:o})=>{o(w());try{const{data:r,status:C}=await L.delete("vet_farm/0/",{params:i});return o(v()),{data:r,status:C}}catch(r){return o(v()),{error:r.response.data.result}}}),qu=({vetFarmKey:i,item:o,updateTable:r})=>{var n;const[C,E]=a.useState(!0),[T,y]=a.useState(""),[g,D]=a.useState(""),[S,l]=a.useState([]),[d,M]=a.useState([]),[I]=a.useContext(Z),K={PaperProps:{style:{maxHeight:48*4.5+8,width:250}}},[H,_]=ou.useState([]),[q,W]=ou.useState([]);a.useEffect(()=>{g&&W(g==null?void 0:g.map(e=>({id:e.key,label:e.unitName,halls:e.numberOfHalls,registerVetHalls:e.registerVetHalls})))},[g]);const G=e=>{const{target:{value:t}}=e;_(typeof t=="string"?t.split(","):t)},c=uu(),x=Iu({initialValues:{uniqueID:"",hatching:""},validationSchema:_u({uniqueID:Lu().required("این فیلد اجباری است!").typeError("لطفا فیلد را به صورت عددی وارد کنید!"),hatching:ku().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!")})});a.useEffect(()=>{x.validateForm()},[]);const V=a.useRef();return a.useEffect(()=>{V.current.querySelector(".MuiAutocomplete-popupIndicator").click()},[q]),u.jsxs(s,{container:!0,gap:h.SMALL,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:[u.jsxs(s,{container:!0,direction:"column",gap:h.SMALL,children:[u.jsxs(s,{display:"flex",width:1,children:[u.jsx($,{id:"uniqueID",label:"جستجو براساس شناسه یکتا یا کدملی فرد",variant:"outlined",sx:{width:"100%"},value:x.values.uniqueID,error:x.touched.uniqueID?!!x.errors.uniqueID:null,onChange:x.handleChange,onBlur:x.handleBlur,helperText:x.touched.uniqueID&&x.errors.uniqueID?x.errors.uniqueID:null}),u.jsx(X,{disabled:!x.values.uniqueID,"aria-label":"delete",color:"primary",onClick:()=>{x.values.uniqueID&&(c(w()),l([]),_([]),c(Bu(x.values.uniqueID)).then(e=>{e.error&&(c(v()),I({vertical:"top",horizontal:"center",msg:"مرغداری با این شناسه یافت نشد!",severity:"error"})),e.payload.data&&(c(v()),E(!1),D(e.payload.data),V.current.focus())}))},children:u.jsx(Ru,{})})]}),u.jsx(s,{children:u.jsx(hu,{ref:V,disabled:C,disablePortal:!0,id:"hatching",options:q,onChange:(e,t)=>{y(t.id),M(t.registerVetHalls),_([]),l(new Array(t.halls).fill("*"))},renderInput:e=>u.jsx($,{...e,label:"مرغداری را انتخاب کنید"})})}),u.jsx(s,{children:u.jsxs(fu,{children:[u.jsx(vu,{id:"demo-multiple-checkbox-label",children:S.length?"انتخاب سالن":"سالنی موجود نیست"}),u.jsx(ju,{maxWidth:"100%",disabled:!S.length,fullWidth:!0,labelId:"demo-multiple-checkbox-label",id:"demo-multiple-checkbox",multiple:!0,onChange:G,value:H,input:u.jsx(gu,{label:"انتخاب سالن"}),renderValue:e=>e.join(", "),MenuProps:K,children:S.map((e,t)=>{const j="سالن شماره "+(t+1),b=t+1;return u.jsx(yu,{value:j,disabled:d.includes(b),children:u.jsx(O,{primary:j})},t)})})]})})]}),u.jsx(s,{mt:h.SMALL,children:u.jsx(B,{fullWidth:!0,variant:"contained",disabled:!H.length,onClick:()=>{c(w()),c(Nu({poultry_key:T,halls:H.map(e=>e.split(" ")[2]),vet_key:i})).then(e=>{e.error?(c(v()),e.error.message.includes("403")?(I({vertical:"top",horizontal:"center",msg:"قبلا این مرغداری و این سالن را ثبت کرده‌اید",severity:"error"}),c(k({right:!1,bottom:!1,content:null}))):I({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"})):(r(),c(Tu()),I({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),c(k({right:!1,bottom:!1,content:null})),c(v()))})},children:"ثبت اطلاعات"})}),u.jsxs(s,{container:!0,direction:"column",gap:h.SMALL,mt:h.SMALL,children:[u.jsx(s,{children:u.jsx(f,{variant:"body1",children:"فارم های ثبت شده"})}),u.jsx(s,{container:!0,direction:"column",gap:h.SMALL,children:(n=o==null?void 0:o.farms)==null?void 0:n.map((e,t)=>u.jsx(bu,{sx:{width:"100%",transition:"all 0.3s ease-in-out","&:hover":{transform:"translateY(-2px)",boxShadow:4},borderLeft:"4px solid",borderLeftColor:"primary.main",borderRadius:2},children:u.jsx(Fu,{sx:{pb:1,"&:last-child":{pb:1}},children:u.jsxs(Q,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:h.SMALL,children:[u.jsx(Q,{display:"flex",alignItems:"center",gap:1.5,flex:1,children:u.jsx(f,{variant:"body1",sx:{fontWeight:500,color:"text.primary",flex:1},children:e.poultryName})}),u.jsx(Eu,{sx:{p:0,m:0},children:u.jsx(B,{color:"error",variant:"contained",size:"small",startIcon:u.jsx(wu,{}),onClick:()=>{c(zu({vet_farm_key:e.vetFarmKey})).then(j=>{j.payload.error?I({vertical:"top",horizontal:"center",msg:j.payload.error,severity:"error"}):(r(),I({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),c(k({right:!1,bottom:!1,content:null})))})},sx:{textTransform:"none",borderRadius:2,px:2},children:"حذف"})})]})})},t))})]})]})},Ou=z("INSPECTOR_SET_KILLHOUSE_VET_SERVICE",async(i,{dispatch:o})=>{o(w());try{const{data:r,status:C}=await L.delete("kill_house_vet/0/",{params:i});return o(v()),{data:r,status:C}}catch(r){return o(v()),{error:r.response.data.result}}}),$u=z("INSPECTOR_SET_KILLHOUSE_VET_SERVICE",async(i,{dispatch:o})=>{o(w());try{const{data:r,status:C}=await L.post("kill_house_vet/",i);return o(v()),{data:r,status:C}}catch(r){return o(v()),{error:r.response.data.result}}}),Ku=({userKey:i,item:o})=>{var S;const r=uu(),[C]=a.useContext(Z),{inspectorGetKillHouses:E}=Mu(l=>l.inspectorSlice),[T,y]=a.useState(null),[g,D]=a.useState([]);return a.useEffect(()=>{r(Du())},[]),a.useEffect(()=>{const l=E==null?void 0:E.filter(d=>d.killer===!1).map(d=>({title:d.name,value:d.key}));D(l)},[E]),u.jsxs(s,{contianer:!0,gap:h.SMALL,children:[u.jsx(s,{children:u.jsx(hu,{options:g,getOptionLabel:l=>l.title,renderInput:l=>u.jsx($,{...l,label:"انتخاب کشتارگاه",variant:"outlined"}),value:T,onChange:(l,d)=>{y(d)}})}),u.jsx(s,{mt:h.TINY,children:u.jsx(B,{variant:"contained",fullWidth:!0,onClick:()=>{r($u({role:xu(),user_key:i,key:T.value})).then(l=>{l.payload.error?C({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(r(lu()),C({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),r(k({right:!1,bottom:!1,content:null})))})},children:"ثبت"})}),u.jsxs(s,{container:!0,direction:"column",gap:h.SMALL,mt:h.SMALL,children:[u.jsx(s,{children:u.jsx(f,{children:"کشتارگاه های ثبت شده"})}),u.jsx(s,{children:(S=o.killHouses)==null?void 0:S.map((l,d)=>u.jsxs(s,{container:!0,alignItems:"center",gap:h.SMALL,children:[u.jsxs(f,{children:[d+1,". ",l.KillHouseName]}),u.jsx(B,{color:"error",variant:"outlined",onClick:()=>{r(Ou({user_key:i,key:l.KillHouseKey})).then(M=>{M.payload.error?C({vertical:"top",horizontal:"center",msg:M.payload.error,severity:"error"}):(r(lu()),C({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),r(k({right:!1,bottom:!1,content:null})))})},children:"حذف"})]},d))})]})]})};var eu={},Wu=Cu;Object.defineProperty(eu,"__esModule",{value:!0});var Au=eu.default=void 0,Gu=Wu(pu()),cu=u;Au=eu.default=(0,Gu.default)([(0,cu.jsx)("path",{d:"M15 17h2v-3h1v-2l-1-5H2l-1 5v2h1v6h9v-6h4zm-6 1H4v-4h5zM2 4h15v2H2z"},"0"),(0,cu.jsx)("path",{d:"M20 18v-3h-2v3h-3v2h3v3h2v-3h3v-2z"},"1")],"AddBusiness");var tu={},Uu=Cu;Object.defineProperty(tu,"__esModule",{value:!0});var mu=tu.default=void 0,Yu=Uu(pu()),du=u;mu=tu.default=(0,Yu.default)([(0,du.jsx)("path",{d:"M15 11.68V11L8 6l-7 5v10h5v-6h4v6h1.68c-.43-.91-.68-1.92-.68-3 0-2.79 1.64-5.19 4-6.32m8 1.43V3H10v1.97l7 5v1.11c.33-.05.66-.08 1-.08 1.96 0 3.73.81 5 2.11M17 7h2v2h-2z"},"0"),(0,du.jsx)("path",{d:"M23 18c0-2.76-2.24-5-5-5s-5 2.24-5 5 2.24 5 5 5 5-2.24 5-5m-5.5 3v-2.5H15v-1h2.5V15h1v2.5H21v1h-2.5V21z"},"1")],"AddHomeWork");const Ju=()=>{const i=uu(),[o]=a.useContext(Z),[r,C]=a.useState([]),[E,T]=a.useState(0),[y,g]=a.useState(10),[D,S]=a.useState(""),[l,d]=a.useState(1),[M,I]=a.useState([]),[p,ru]=a.useState(0),K=(n,e)=>{ru(e)},H=n=>{S(n.target.value)},_=async n=>{i(w());const e=p===0?"&vet_farm=true":p===2?"&vet_farm=false":"";try{const t=await L.get(`vet/?search=filter&value=${D}&role=${xu()}&page=${n}&page_size=${y}${e}`);C(t.data.results),T(t.data.count)}catch(t){console.error("Error fetching users",t)}finally{i(v())}},q=async n=>{n.preventDefault(),d(1),_(1)},W=n=>{_(n),d(n)},G=n=>{g(n),d(1)},c=({vetFarm:n})=>{const[e,t]=a.useState(null),j=!!e,b=m=>{t(m.currentTarget)},F=()=>{t(null)},R=()=>{i(k({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت فارم",content:u.jsx(qu,{item:n,vetFarmKey:n.key,updateTable:x})})),F()},A=()=>{o({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این عملیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const m=`${L.defaults.baseURL}technical_responsible_performance_excel/?key=${n==null?void 0:n.key}`;window.location.href=m,F()};return u.jsxs(s,{children:[u.jsx(su,{title:"تنظیمات",children:u.jsx(X,{color:"primary",className:"avicultureActiveRequestsBtn",onClick:b,children:u.jsx(iu,{})})}),u.jsx(au,{open:j,anchorEl:e,onClose:F,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsxs(nu,{sx:{minWidth:180,p:1},children:[u.jsxs(Y,{onClick:R,sx:{py:1},children:[u.jsx(J,{children:u.jsx(Au,{color:"primary"})}),u.jsx(O,{primary:u.jsx(f,{variant:"body2",color:"textPrimary",children:"ثبت فارم"})})]}),u.jsxs(Y,{onClick:A,sx:{py:1},children:[u.jsx(J,{children:u.jsx(Pu,{color:"success"})}),u.jsx(O,{primary:u.jsx(f,{variant:"body2",color:"textPrimary",children:"خروجی اکسل"})})]})]})})]})},x=()=>{_(l!==0?l:1)},V=({vet:n})=>{const[e,t]=a.useState(null),j=!!e,b=A=>{t(A.currentTarget)},F=()=>{t(null)},R=()=>{i(k({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت کشتارگاه",content:u.jsx(Ku,{item:n,userKey:n.user.key})})),F()};return u.jsxs(s,{children:[u.jsx(su,{title:"تنظیمات",children:u.jsx(X,{color:"primary",className:"avicultureActiveRequestsBtn",onClick:b,children:u.jsx(iu,{})})}),u.jsx(au,{open:j,anchorEl:e,onClose:F,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsx(nu,{sx:{minWidth:180,p:1},children:u.jsxs(Y,{onClick:R,sx:{py:1},children:[u.jsx(J,{children:u.jsx(mu,{color:"primary"})}),u.jsx(O,{primary:u.jsx(f,{variant:"body2",color:"textPrimary",children:"ثبت کشتارگاه"})})]})})})]})};return a.useEffect(()=>{_(1)},[i,y,p]),a.useEffect(()=>{const n=r==null?void 0:r.map((e,t)=>{var F,R;const b=[l===1?t+1:t+y*(l-1)+1,e.user.fullname,e.user.nationalId,e.user.mobile,e.user.province,e.user.city];return p===0?[...b,u.jsx(s,{container:!0,alignItems:"baseline",xs:12,spacing:2,mt:1,mb:1,children:(F=e==null?void 0:e.farms)!=null&&F.length?e==null?void 0:e.farms.map((A,m)=>{var P,N;return u.jsxs(s,{container:!0,direction:"column",alignItems:"center",xs:((P=e==null?void 0:e.farms)==null?void 0:P.length)===1?12:6,mt:"5px",mb:m+1===((N=e==null?void 0:e.farms)==null?void 0:N.length)?1:0,style:{background:m%2===1?"white":"ghostwhite",borderStyle:"solid",borderWidth:"1px",borderColor:"gray",borderRadius:"10px"},children:[u.jsxs(f,{variant:"caption",children:[A.poultryName," (",A.poultryFullName,")"]}),u.jsx(f,{variant:"caption",children:A.poultryMobile})]},m)}):"-"},t),u.jsx(c,{vetFarm:e},`actions-vet-${t}`)]:p===2?[...b,u.jsx(s,{container:!0,alignItems:"baseline",xs:12,spacing:2,mt:1,mb:1,children:(R=e==null?void 0:e.killHouses)!=null&&R.length?e==null?void 0:e.killHouses.map((A,m)=>{var P,N;return u.jsxs(s,{container:!0,direction:"column",alignItems:"center",xs:((P=e==null?void 0:e.killHouses)==null?void 0:P.length)===1?12:6,mt:"5px",mb:m+1===((N=e==null?void 0:e.killHouses)==null?void 0:N.length)?1:0,style:{background:m%2===1?"white":"ghostwhite",borderStyle:"solid",borderWidth:"1px",borderColor:"gray",borderRadius:"10px"},children:[u.jsxs(f,{variant:"caption",children:[A.KillHouseName," (",A.KillHouseUserFullName,")"]}),u.jsx(f,{variant:"caption",children:A.KillHouseUserMobile})]},m)}):"-"},t),u.jsx(V,{vet:e},`actions-killhouse-${t}`)]:[...b,u.jsx(c,{vetFarm:e},`actions-vet-no-farm-${t}`)]});I(n)},[r,l,y,p]),u.jsxs(s,{container:!0,mt:2,justifyContent:"center",xs:12,children:[u.jsx(s,{container:!0,justifyContent:"center",alignItems:"center",mb:h.MEDIUM,mt:h.SMALL,xs:12,children:u.jsxs(Su,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:p,onChange:K,children:[u.jsx(U,{label:"دامپزشکان فارم"}),u.jsx(U,{label:"دامپزشکان بدون فارم"}),u.jsx(U,{label:"دامپزشکان کشتارگاه"})]})}),u.jsx(s,{justifyContent:"start",container:!0,xs:12,children:u.jsxs("form",{onSubmit:q,children:[u.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:H,value:D}),u.jsx(B,{type:"submit",endIcon:u.jsx(Vu,{}),children:"جستجو"})]})}),u.jsx(Hu,{title:p===0?"مدیریت دامپزشکان فارم":p===2?"مدیریت دامپزشکان کشتارگاه":"مدیریت دامپزشکان بدون فارم",handlePageChange:W,totalRows:E,page:l,perPage:y,handlePerRowsChange:G,columns:p===0?["ردیف","نام و نام خانوادگی","کدملی","تلفن","استان","شهرستان","فارم ها","عملیات"]:p===2?["ردیف","نام و نام خانوادگی","کدملی","تلفن","استان","شهرستان","کشتارگاه ها","عملیات"]:["ردیف","نام و نام خانوادگی","کدملی","تلفن","استان","شهرستان","عملیات"],data:M})]})},ce=()=>u.jsx(u.Fragment,{children:u.jsx(Q,{display:"flex",justifyContent:"center",children:u.jsx(s,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsx(s,{container:!0,justifyContent:"space-between",gap:h.SMALL,children:u.jsx(s,{xs:12,children:u.jsx(Ju,{})})})})})});export{ce as default}; diff --git a/build/assets/ManageGuildsOperations-DTKLlkN3.js b/build/assets/ManageGuildsOperations-DTKLlkN3.js new file mode 100644 index 0000000..539987b --- /dev/null +++ b/build/assets/ManageGuildsOperations-DTKLlkN3.js @@ -0,0 +1 @@ +import{j as e,T as t,b as s,ai as V,aX as Z,ak as k,aa as ee,al as M,B as f,i as re,d as te,I as se,b0 as ne,b5 as oe}from"./mui-vendor-CkIVaoQP.js";import{d as ae}from"./Edit-CqBj1Y2L.js";import{r as C}from"./react-vendor-CmFgShSM.js";import{a as ue,f as ie,u as q}from"./redux-vendor-B7uoacJt.js";import{G as n,S as c,bT as P,p as ce,fC as le,fD as xe,L as X,j as J,db as de,h as E,A as U,u as he,c as pe,N as T,bD as je,ab as me,X as N,r as fe,O as w}from"./index-CeyyVc1v.js";import{d as Ce,a as ye,b as ve,e as be,f as Ae,g as Fe,C as Ie,P as _e,p as Se}from"./CreateGuilds-CCT3R9v5.js";import{d as Re}from"./Visibility-DeyjG-oI.js";import{d as K}from"./CheckCircle-zgBvZQ-b.js";import{d as Ne}from"./Send-CA1iNvJP.js";import{d as z}from"./Person-Q1IHBezR.js";import{d as W}from"./Business-J-mGuLnc.js";import{d as Y}from"./Phone-Dv2y8iMM.js";import{d as G}from"./Badge-u1S44abW.js";import{d as De,a as H}from"./Cake-CkaTUHNX.js";import{d as Ee}from"./Tune-D4M2CAhp.js";const ke=({guild:r})=>{var y,p,j,u,o,l,x,F,I,_,S,R,v,D,$,B,O,g;const a=b=>b?typeof b=="object"?b.name||b.title||b.label||JSON.stringify(b):b:"-",i=((p=(y=r==null?void 0:r.address)==null?void 0:y.province)==null?void 0:p.name)||"-",m=((u=(j=r==null?void 0:r.address)==null?void 0:j.city)==null?void 0:u.name)||"-",d=((o=r==null?void 0:r.address)==null?void 0:o.postalCode)||"-",A=((l=r==null?void 0:r.guildAreaActivity)==null?void 0:l.title)||"-",h=(r==null?void 0:r.unionName)||"-";return e.jsx(n,{container:!0,gap:c.TINY,maxHeight:"80vh",minWidth:{xs:"96vw",md:"90vw",lg:"1280px"},overflow:"auto",p:2,children:e.jsxs(n,{container:!0,xs:12,children:[e.jsx(n,{item:!0,xs:12,lg:6,pl:{xs:0,md:2},pr:{xs:0,md:3},mb:2,children:e.jsxs(n,{container:!0,direction:"column",gap:c.SMALL,children:[e.jsx(n,{item:!0,xs:12,children:e.jsx(t,{variant:"h6",gutterBottom:!0,children:"اطلاعات شخصی"})}),e.jsxs(n,{container:!0,xs:12,children:[e.jsxs(n,{container:!0,xs:12,md:6,gap:c.TINY,px:c.TINY,children:[e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(G,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"کد ملی"}),e.jsx(t,{variant:"body1",children:a((x=r==null?void 0:r.user)==null?void 0:x.nationalId)})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(z,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"نام"}),e.jsx(t,{variant:"body1",children:a((F=r==null?void 0:r.user)==null?void 0:F.firstName)})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(z,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"نام خانوادگی"}),e.jsx(t,{variant:"body1",children:a((I=r==null?void 0:r.user)==null?void 0:I.lastName)})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(G,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"شماره شناسنامه"}),e.jsx(t,{variant:"body1",children:a((_=r==null?void 0:r.user)==null?void 0:_.nationalCode)})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(Ce,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"در قید حیات"}),e.jsx(t,{variant:"body1",children:(S=r==null?void 0:r.user)!=null&&S.isAlive?"بلی":"خیر"})]})]})})]}),e.jsxs(n,{container:!0,xs:12,md:6,gap:c.TINY,px:c.TINY,mt:{xs:1,md:0},direction:"column",children:[e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(De,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"تاریخ تولد"}),e.jsx(t,{variant:"body1",children:a((R=r==null?void 0:r.user)==null?void 0:R.birthday)})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(z,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"نام پدر"}),e.jsx(t,{variant:"body1",children:a((v=r==null?void 0:r.user)==null?void 0:v.fatherName)})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(ye,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"جنسیت"}),e.jsx(t,{variant:"body1",children:((D=r==null?void 0:r.user)==null?void 0:D.gender)==="True"?"مرد":(($=r==null?void 0:r.user)==null?void 0:$.gender)==="False"?"زن":"-"})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(Y,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"شماره همراه"}),e.jsx(t,{variant:"body1",children:a((B=r==null?void 0:r.user)==null?void 0:B.mobile)})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(H,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"شهر"}),e.jsx(t,{variant:"body1",children:a((O=r==null?void 0:r.user)==null?void 0:O.city)})]})]})})]})]})]})}),e.jsx(n,{item:!0,xs:12,lg:6,pr:{xs:0,md:2},pl:{xs:0,md:3},children:e.jsxs(n,{container:!0,gap:c.TINY,direction:"column",children:[e.jsx(n,{item:!0,xs:12,children:e.jsx(t,{variant:"h6",gutterBottom:!0,children:"اطلاعات صنفی"})}),e.jsxs(n,{container:!0,xs:12,children:[e.jsxs(n,{container:!0,direction:"column",xs:12,md:6,px:c.TINY,gap:c.TINY,children:[e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(W,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"نام واحد"}),e.jsx(t,{variant:"body1",children:a(r==null?void 0:r.guildsName)})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(W,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"رسته واحد صنفی"}),e.jsx(t,{variant:"body1",children:A})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(P,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"استان"}),e.jsx(t,{variant:"body1",children:i})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(H,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"شهرستان"}),e.jsx(t,{variant:"body1",children:m})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(ve,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"تاریخ انقضا مجوز"}),e.jsx(t,{variant:"body1",children:ce(r==null?void 0:r.licenseExpireDate)})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(be,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"شماره مجوز"}),e.jsx(t,{variant:"body1",children:a(r==null?void 0:r.licenseNumber)})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(Ae,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"نام اتحادیه"}),e.jsx(t,{variant:"body1",children:h})]})]})})]}),e.jsxs(n,{container:!0,xs:12,md:6,px:c.TINY,direction:"column",gap:c.TINY,children:[e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(Fe,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"کد پستی"}),e.jsx(t,{variant:"body1",children:d})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(Y,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"شماره تلفن"}),e.jsx(t,{variant:"body1",children:a(r==null?void 0:r.phone)})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(P,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"آیا اتباع است؟"}),e.jsx(t,{variant:"body1",children:r!=null&&r.isForeignNational?"بلی":"خیر"})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(le,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"نام شرکت"}),e.jsx(t,{variant:"body1",children:a(r==null?void 0:r.companyName)})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(G,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"شناسه ملی شرکت"}),e.jsx(t,{variant:"body1",children:a(r==null?void 0:r.companyIdentifier)})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(K,{color:"action"}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"وضعیت مجوز"}),e.jsx(t,{variant:"body1",children:a(r==null?void 0:r.licenseStatus)})]})]})}),e.jsx(n,{item:!0,xs:12,children:e.jsxs(s,{display:"flex",alignItems:"flex-start",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[e.jsx(xe,{color:"action",sx:{mt:.5}}),e.jsxs(s,{children:[e.jsx(t,{variant:"caption",color:"text.secondary",children:"آدرس"}),e.jsx(t,{variant:"body1",children:a((g=r==null?void 0:r.address)==null?void 0:g.address)})]})]})})]})]})]})})]})})},we=ue("PROVINCE_CHANGE_ACTIVE_GUILD_SERVICE",async(r,{dispatch:a})=>{try{a(X());const{data:i,status:m}=await J.put("provinceCreateGuildService",r);return a(de()),a(E()),{data:i,status:m}}catch(i){return a(E()),{error:i.response.data.result}}}),ze=pe().shape({}),Ge=({guild:r,updateTable:a})=>{const{provinceGetStewardsOptions:i,provinceGetBuyersOptions:m}=ie(o=>o.provinceSlice),[d,A]=C.useState(r.centersAllocation?r.centersAllocation:[]),[h,y]=C.useState(r.killHouseCentersAllocation?r.killHouseCentersAllocation:[]),p=q(),[j]=C.useContext(U),u=he({initialValues:{allocation_limit:r.allocationLimit,centers_allocation:"",limitation_allocation:r.limitationAllocation,currentBuyer:""},validationSchema:ze,onSubmit:o=>{p(we({kill_house_centers_allocation:h,allocation_limit:o.allocation_limit,limitation_allocation:o.limitation_allocation,centers_allocation:d,guilds_key:r.key})).then(l=>{a(),l.payload.error?j({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(p(T({right:!1,bottom:!1,content:null})),j({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}});return C.useEffect(()=>{p(je()),p(me())},[]),e.jsx("form",{onSubmit:u.handleSubmit,style:{width:"100%"},children:e.jsxs(n,{container:!0,direction:"column",width:"100%",gap:c.SMALL,children:[e.jsx(V,{control:e.jsx(Z,{name:"limitation_allocation",checked:u.values.limitation_allocation,onChange:u.handleChange}),label:"محدودیت تخصیص"}),u.errors.limitation_allocation&&e.jsx("div",{children:u.errors.limitation_allocation}),u.values.limitation_allocation&&e.jsxs(e.Fragment,{children:[e.jsx(k,{label:"حداکثر تخصیص",variant:"outlined",fullWidth:!0,id:"allocation_limit",name:"allocation_limit",InputProps:{endAdornment:e.jsx(ee,{position:"start",children:"کیلوگرم"})},value:u.values.allocation_limit,onChange:u.handleChange,error:u.touched.allocation_limit&&!!u.errors.allocation_limit,helperText:u.touched.allocation_limit&&u.errors.allocation_limit}),!(r!=null&&r.steward)&&N()!=="Guilds"&&e.jsxs(e.Fragment,{children:[e.jsx(M,{style:{width:"100%"},options:i,value:u.values.guild,onChange:(o,l)=>{A([...d,l])},error:u.touched.guild&&!!u.errors.guild,helperText:u.touched.guild&&u.errors.guild,getOptionLabel:o=>o.label,renderInput:o=>e.jsx(k,{...o,label:"انتخاب مباشر",variant:"outlined"})}),e.jsx(t,{children:"محدودیت مباشرین انتخاب شده"}),!d.length&&e.jsx(t,{variant:"caption",children:"محدودیتی وجود ندارد"}),d==null?void 0:d.map((o,l)=>e.jsx(e.Fragment,{children:o!==null&&e.jsxs(n,{container:!0,gap:c.SMALL,alignItems:"center",children:[e.jsx(f,{variant:"text",onClick:()=>{A(d.filter(x=>x.value!==o.value))},children:"حذف"}),e.jsx(t,{children:o.label},o.label)]},o.value)}))]})]}),u.values.limitation_allocation&&N()!=="KillHouse"&&N()!=="Guilds"&&e.jsxs(e.Fragment,{children:[e.jsx(M,{style:{width:"100%"},options:m,value:u.values.guild,onChange:(o,l)=>{y([...h,l])},error:u.touched.guild&&!!u.errors.guild,helperText:u.touched.guild&&u.errors.guild,getOptionLabel:o=>o.label,renderInput:o=>e.jsx(k,{...o,label:"انتخاب انبار",variant:"outlined"})}),e.jsx(t,{children:"محدودیت انبار های انتخاب شده"}),!h.length&&e.jsx(t,{variant:"caption",children:"محدودیتی وجود ندارد"}),h==null?void 0:h.map((o,l)=>e.jsx(e.Fragment,{children:o!==null&&e.jsxs(n,{container:!0,gap:c.SMALL,alignItems:"center",children:[e.jsx(f,{variant:"text",onClick:()=>{y(h.filter(x=>x.value!==o.value))},children:"حذف"}),e.jsx(t,{children:o.label},o.label)]},o.value)}))]}),e.jsx(f,{color:"primary",fullWidth:!0,variant:"contained",type:"submit",children:"ثبت"})]})})};var L={},Te=re;Object.defineProperty(L,"__esModule",{value:!0});var Q=L.default=void 0,Le=Te(fe()),$e=e;Q=L.default=(0,Le.default)((0,$e.jsx)("path",{d:"m22.69 18.37 1.14-1-1-1.73-1.45.49c-.32-.27-.68-.48-1.08-.63L20 14h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49-1 1.73 1.14 1c-.08.5-.08.76 0 1.26l-1.14 1 1 1.73 1.45-.49c.32.27.68.48 1.08.63L18 24h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49 1-1.73-1.14-1c.08-.51.08-.77 0-1.27M19 21c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2M11 7v5.41l2.36 2.36 1.04-1.79-1.4-1.39V7zm10 5c0-4.97-4.03-9-9-9-2.83 0-5.35 1.32-7 3.36V4H3v6h6V8H6.26C7.53 6.19 9.63 5 12 5c3.86 0 7 3.14 7 7zm-10.14 6.91c-2.99-.49-5.35-2.9-5.78-5.91H3.06c.5 4.5 4.31 8 8.94 8h.07z"}),"ManageHistory");const Ze=({guild:r,updateTable:a})=>{const i=q(),[m,d]=C.useState(r.active),[A,h]=C.useState(!1),[y,p]=C.useState(null),[j]=C.useContext(U),u=x=>{h(!0),p(x.currentTarget)},o=()=>{h(!1),p(null)},l=async x=>{var I,_,S,R;const F=x.target.checked;d(F),i(X());try{const v=await J.put("guilds/0/",{guilds_key:r==null?void 0:r.key,active:F,role:N()});i(E()),v.status===200&&(a(),i(T({right:!1,bottom:!1,content:null})),j({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}catch(v){i(E());const D=((_=(I=v.response)==null?void 0:I.data)==null?void 0:_.result)||((R=(S=v.response)==null?void 0:S.data)==null?void 0:R.error)||"خطا در انجام عملیات";j({vertical:"top",horizontal:"center",msg:D,severity:"error"}),d(!F)}};return e.jsxs(n,{children:[e.jsx(te,{title:"مدیریت صنف",placement:"left",children:e.jsx(se,{color:"primary",onClick:u,children:e.jsx(Ee,{})})}),e.jsx(ne,{open:A,anchorEl:y,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:e.jsx("div",{style:{padding:10},children:e.jsxs(n,{container:!0,direction:"column",alignItems:"flex-start",justifyContent:"center",gap:1,children:[e.jsx(f,{size:"small",color:"info",startIcon:e.jsx(Re,{}),sx:{fontSize:{xs:12,md:15}},onClick:()=>{o(),i(w({title:"مشاهده جزییات صنف",content:e.jsx(ke,{guild:r}),size:window.innerWidth<=600?"small":"auto"}))},children:"جزییات"}),["AdminX","SuperAdmin","GuildRoom"].includes(N())&&e.jsxs(e.Fragment,{children:[e.jsx(V,{control:e.jsx(oe,{checked:m,onChange:l,color:"primary"}),label:m?"فعال":"غیرفعال",style:{justifyContent:"center",alignItems:"center",display:"flex"}}),e.jsx(f,{color:"primary",size:"small",startIcon:e.jsx(ae,{}),sx:{fontSize:{xs:12,md:15}},onClick:()=>{o(),i(w({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ویرایش واحد",size:window.innerWidth<=600?"small":"auto",content:e.jsx(Ie,{guild:r,updateTable:a})}))},children:"ویرایش"}),e.jsx(f,{size:"small",color:"warning",startIcon:e.jsx(Q,{}),sx:{fontSize:{xs:12,md:15}},onClick:()=>{o(),i(T({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"اعمال محدودیت",content:e.jsx(Ge,{guild:r,updateTable:a})}))},children:"محدودیت"})]}),!(r!=null&&r.isRegistered)&&e.jsxs(n,{container:!0,alignItems:"flex-start",justifyContent:"flex-start",gap:c.TINY,direction:"column",children:[e.jsx(f,{size:"small",color:"success",startIcon:e.jsx(K,{size:30}),sx:{fontSize:{xs:12,md:15}},onClick:()=>{o(),i(w({title:"ثبت کد احراز",content:e.jsx(_e,{item:r,updateTable:a})}))},children:"ثبت کد احراز"}),e.jsx(f,{size:"small",color:"secondary",startIcon:e.jsx(Ne,{}),sx:{fontSize:{xs:12,md:15}},onClick:()=>{o(),i(Se({key:r.key})).then(x=>{x.payload.error?j({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):(a(),j({vertical:"top",horizontal:"center",msg:"کد با موفقیت ارسال شد.",severity:"success"}))})},children:"ارسال مجدد کد"})]})]})})})]})};export{Ze as M,ke as V}; diff --git a/build/assets/ManageProcess-BGlzQVMp.js b/build/assets/ManageProcess-BGlzQVMp.js new file mode 100644 index 0000000..c74b92b --- /dev/null +++ b/build/assets/ManageProcess-BGlzQVMp.js @@ -0,0 +1 @@ +import{j as u,b5 as lu,T as w,ak as S,B as R,ag as Q,ah as Z,ai as v,aj as I,i as Oe,d as ou,I as G,ax as Cu,aX as z,aw as Eu,av as Ku,aa as Le,am as le,a3 as su,bh as e0,aA as t0,bf as r0,b as cu,b2 as Ne,b3 as gu,b0 as Yu,an as Qu,b4 as yu,ap as _u,aq as mu,bi as Du}from"./mui-vendor-CkIVaoQP.js";import{B as n0}from"./BackButton-Crzr7NMa.js";import{L as b,j as _,h as g,G as i,S as q,cT as Fu,A as D,u as H,c as M,b as N,X as V,s as a0,C as K,r as Be,O as Y,N as vu,cU as ze,cV as Ue,cW as zu,cX as Ou,cY as Uu,cZ as Ve,c_ as Vu,c$ as qu,d0 as qe,d1 as ku,d2 as Pu,d3 as Me,d4 as Mu,d5 as He,d6 as Hu,d7 as We,d8 as Wu,d9 as Ge,da as Gu,db as s0,ae as pu,af as xu,b1 as o0,M as $,b2 as $e,dc as l0,dd as i0,de as c0,df as C0,dg as d0,dh as h0,di as p0,Z as ie,dj as x0,dk as g0,dl as A0,dm as y0,V as Lu,m as ce,dn as _0,dp as m0,dq as v0,dr as j0,ds as f0,dt as F0,du as E0,dv as b0,dw as S0,dx as k0,dy as P0,dz as I0,dA as w0,dB as T0,dC as R0,dD as D0,dE as O0,dF as L0,dG as N0,dH as B0,dI as z0,dJ as U0,dK as V0}from"./index-CeyyVc1v.js";import{r as C,f as Ke,u as Ye}from"./react-vendor-CmFgShSM.js";import{a as P,u as k,f as bu}from"./redux-vendor-B7uoacJt.js";import{R as uu}from"./ResponsiveTable-w7hk7Uq8.js";import{d as du}from"./Tune-D4M2CAhp.js";import{d as Qe}from"./Done-Dp5awdte.js";import{p as wu}from"./province-policy-wages-edit-killhouse-Law73imd.js";import{g as q0}from"./getSystemBaseAddress-B3dWKz82.js";import{V as M0,c as H0,d as Ce}from"./index.esm-CjWvmHks.js";import{L as eu}from"./LinkItem-DT6qswcs.js";import{N as tu}from"./NavLink-D2GD_ItM.js";import{b as W0,i as G0,e as $0,j as K0,k as Y0,l as Q0,m as X0}from"./index.esm-BY9chGNa.js";import{P as Z0}from"./ProvinceSelectSlaughterForSlaughter-DoXgfxS6.js";import{d as ru}from"./Edit-CqBj1Y2L.js";import{a as J0,R as Xe}from"./index.esm-Bu7XMDZU.js";import{A as u6}from"./AdvancedTable-BYmmBtmq.js";import{h as e6}from"./hour-limit-get-kill-request-HFzpgBg7.js";import{p as de,a as t6,b as he}from"./province-get-sell-for-freezing-status-ieuVFEgW.js";import{p as r6,a as n6,b as a6}from"./province-policy-market-daily-limitation-DueqDboR.js";import{p as pe,a as s6}from"./province-policy-get-aggregate-bar-info-allow-state-CO-Vk47I.js";import{p as xe,a as o6,b as ge,c as l6}from"./province-policy-get-slaughter-buying-price-status-XGKC4dNm.js";import{p as i6}from"./province-policy-drop-limit-BQ-Lqckd.js";import{p as hu,a as Ru}from"./province-policy-upload-image-CRJ-U4Kc.js";import{p as c6,a as C6,b as Ae}from"./province-policy-edit-trade-time-range-CFotCa7K.js";import{s as d6,g as h6}from"./getDocumentStates-BlCrMUIj.js";import{S as p6}from"./SimpleTable-DBAoNnCU.js";import{d as Xu}from"./Delete-C5MyLelE.js";import{g as x6}from"./getRoleList-CoZzcy9u.js";import{d as g6}from"./Check-CRb6laYC.js";import{d as A6}from"./Save-nlxmeU5w.js";import{G as y6}from"./index.esm-YBNW__9r.js";import{c as Au,P as _6}from"./ProvinceManageDistributionsSubmitCommitmentPercent-BeA64jYA.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./iconBase-BEJYyZsk.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";const Tu=P("MANAGE_PROCESS_BUY_REQ_OPERATION_SERVICE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.put("kill_house_purchase/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),ye=({item:e,getLimitInformation:t,isDebt:r})=>{const a=k(),[n,o]=C.useState(r?e.allowPurchaseRequest.totalLimitation:e.allowPurchaseRequest.allow),l=()=>{r?(o(!n),a(Tu({kill_house_key:e.key,total_limitation:!n})).then(s=>{a(Fu()),t()})):(o(!n),a(Tu({kill_house_key:e.key,allow:!n})).then(s=>{a(Fu()),t()}))};return u.jsx(i,{container:!0,alignItems:"center",justifyContent:"center",gap:q.SMALL,children:u.jsx(i,{container:!0,alignItems:"center",children:u.jsx(lu,{checked:n,onChange:l,color:"primary"})})})},m6=({item:e,getLimitInformation:t,fetchdata:r})=>{var A;const a=k(),[n,o]=C.useState(e.allowPurchaseRequest.limitation),[l,s]=C.useState((A=e==null?void 0:e.allowPurchaseRequest)==null?void 0:A.limitationNumber);C.useEffect(()=>{o(e.allowPurchaseRequest.limitation),s(e.allowPurchaseRequest.limitationNumber)},[e]);const c=Number(l)>0,d=F=>{s(F.target.value)},h=()=>{const F=!n;o(F),a(Tu({kill_house_key:e.key,limitation:F})),a(Fu()),t(),r()},y=()=>{a(Tu({kill_house_key:e.key,limitation:n,limitation_number:Number(l)})),a(Fu()),t(),r()};return u.jsxs(i,{container:!0,direction:"column",gap:q.SMALL,pt:q.TINY,children:[u.jsxs(i,{container:!0,alignItems:"center",spacing:1,children:[u.jsx(i,{item:!0,children:u.jsx(lu,{checked:n,onChange:h,color:"primary"})}),u.jsx(i,{item:!0,children:u.jsx(w,{children:"محدودیت بر اساس بدهی"})})]}),n&&u.jsxs(i,{container:!0,alignItems:"center",spacing:1,children:[u.jsx(i,{item:!0,xs:!0,children:u.jsx(S,{fullWidth:!0,size:"small",label:"مبلغ بدهی",value:l,onChange:d,variant:"outlined"})}),u.jsx(i,{item:!0,children:u.jsx(R,{onClick:y,variant:"contained",color:"primary",disabled:!c,sx:{minWidth:"40px"},children:u.jsx(Qe,{})})})]})]})},v6=({item:e,fetchdata:t})=>{const[r]=C.useContext(D),a=k(),[n,o]=C.useState(e==null?void 0:e.maxKillLimit),[l,s]=C.useState(e==null?void 0:e.totalKillCapacity),[c,d]=C.useState(e==null?void 0:e.extraBarKillPercent),h=()=>{const A=!n;o(A),a(wu({kill_house_key:e==null?void 0:e.key,total_kill_capacity:l,extra_bar_kill_percent:c,max_kill_limit:A})).then(F=>{F.payload.error?r({vertical:"top",horizontal:"center",msg:F.payload.error,severity:"error"}):(t(),r({vertical:"top",horizontal:"center",msg:"وضعیت محدودیت با موفقیت تغییر کرد.",severity:"success"}))})},y=()=>{a(wu({kill_house_key:e==null?void 0:e.key,total_kill_capacity:l,extra_bar_kill_percent:c,max_kill_limit:n})).then(A=>{A.payload.error?r({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"}):(t(),r({vertical:"top",horizontal:"center",msg:"محدودیت با موفقیت ویرایش شد.",severity:"success"}))})};return u.jsxs(i,{container:!0,direction:"column",alignItems:"center",spacing:2,children:[u.jsxs(i,{item:!0,container:!0,alignItems:"center",spacing:1,children:[u.jsx(i,{item:!0,children:u.jsx(lu,{checked:n,onChange:h,inputProps:{"aria-label":"محدودیت کشتار"}})}),u.jsx(i,{children:u.jsx(w,{children:"محدودیت سقف کشتار"})})]}),n&&u.jsxs(i,{item:!0,container:!0,spacing:2,justifyContent:"center",width:"100%",children:[u.jsx(i,{item:!0,children:u.jsx(S,{fullWidth:!0,label:"ظرفیت کشتار",type:"number",value:l,onChange:A=>s(A.target.value),size:"small"})}),u.jsx(i,{item:!0,children:u.jsx(S,{fullWidth:!0,label:"درصد اضافه بار",type:"number",value:c,onChange:A=>d(A.target.value),size:"small"})}),u.jsx(i,{item:!0,children:u.jsx(R,{variant:"outlined",disabled:!c||!l||c>100||c<0,onClick:y,children:"ثبت"})})]})]})},j6=({item:e,fetchdata:t})=>{const r=k(),[a]=C.useContext(D),[n,o]=C.useState({minimumSaleState:(e==null?void 0:e.quota)||!1,quotaOption:e!=null&&e.quotaMaxKillLimit?"max_kill_limit":e!=null&&e.quotaRequest?"request":e!=null&&e.quotaCustom?"custom":"",qoutaCustomQuntity:(e==null?void 0:e.quotaCustomQuantity)||0,percent:(e==null?void 0:e.governmentalQuota)||0}),[l,s]=C.useState({percent:!1,qoutaCustomQuntity:!1});C.useEffect(()=>{n.minimumSaleState||(o(x=>({...x,quotaOption:"",qoutaCustomQuntity:0,percent:0})),s({percent:!1,qoutaCustomQuntity:!1}))},[n.minimumSaleState]);const c=(x,p)=>{o(j=>({...j,[x]:p}))},d=x=>{const p=x.target.value;o(j=>({...j,quotaOption:p,...p!=="custom"&&{qoutaCustomQuntity:0},...p==="custom"&&{percent:0}})),s({percent:!1,qoutaCustomQuntity:!1})},h=(x,p)=>{o(j=>({...j,[x]:p})),s(j=>({...j,[x]:!1}))},y=()=>{const x={percent:!1,qoutaCustomQuntity:!1};return n.minimumSaleState&&((n.quotaOption==="max_kill_limit"||n.quotaOption==="request")&&(!n.percent||n.percent<=0||n.percent>100)&&(x.percent=!0),n.quotaOption==="custom"&&(!n.qoutaCustomQuntity||n.qoutaCustomQuntity<=0)&&(x.qoutaCustomQuntity=!0)),s(x),!Object.values(x).some(p=>p)},A=()=>{if(!y()){a({vertical:"top",horizontal:"center",msg:"لطفاً مقادیر الزامی را به درستی وارد کنید",severity:"error"});return}r(wu({kill_house_key:e==null?void 0:e.key,quota:n.minimumSaleState,quota_max_kill_limit:n.quotaOption==="max_kill_limit",quota_request:n.quotaOption==="request",quota_custom:n.quotaOption==="custom",quota_custom_quantity:n.qoutaCustomQuntity,governmental_quota:n.percent})).then(x=>{var p;(p=x.payload)!=null&&p.error?a({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):(a({vertical:"top",horizontal:"center",msg:"تغییرات با موفقیت ذخیره شد",severity:"success"}),t())})},F=()=>n.minimumSaleState?n.quotaOption==="max_kill_limit"||n.quotaOption==="request"?n.percent>0&&n.percent<=100:n.quotaOption==="custom"?n.qoutaCustomQuntity>0:!1:!0;return u.jsxs(i,{xs:12,container:!0,direction:"column",gap:q.SMALL,children:[u.jsxs(i,{xs:12,container:!0,alignItems:"center",gap:1,children:[u.jsx(i,{item:!0,children:u.jsx(lu,{checked:n.minimumSaleState,onChange:x=>{c("minimumSaleState",x.target.checked),x.target.checked||r(wu({kill_house_key:e==null?void 0:e.key,quota:!1,quota_max_kill_limit:!1,quota_request:!1,quota_custom:!1,quota_custom_quantity:0,governmental_quota:0})).then(p=>{var j;(j=p.payload)!=null&&j.error?a({vertical:"top",horizontal:"center",msg:p.payload.error,severity:"error"}):(a({vertical:"top",horizontal:"center",msg:"تغییرات با موفقیت ذخیره شد",severity:"success"}),t())})},inputProps:{"aria-label":"in-province-selling-limitation-switch"}})}),u.jsx(i,{item:!0,children:u.jsx(w,{children:"الزام به خرید دولتی"})})]}),n.minimumSaleState&&u.jsxs(i,{xs:12,container:!0,direction:"column",gap:1,children:[u.jsx(i,{item:!0,children:u.jsx(Q,{component:"fieldset",fullWidth:!0,children:u.jsxs(Z,{value:n.quotaOption,onChange:d,children:[u.jsx(v,{value:"max_kill_limit",control:u.jsx(I,{}),label:"بر اساس سقف کشتار"}),u.jsx(v,{value:"request",control:u.jsx(I,{}),label:"بر اساس اعلام نیازها"}),u.jsx(v,{value:"custom",control:u.jsx(I,{}),label:"بر اساس حجم از سقف کشتار"})]})})}),(n.quotaOption==="max_kill_limit"||n.quotaOption==="request")&&u.jsx(S,{label:"درصد خرید دولتی",size:"small",fullWidth:!0,type:"number",value:n.percent,onChange:x=>h("percent",Math.max(0,Math.min(100,x.target.value))),inputProps:{min:1,max:100},error:l.percent,helperText:l.percent?"درصد باید بین ۱ تا ۱۰۰ باشد":""}),n.quotaOption==="custom"&&u.jsx(S,{label:"حجم",size:"small",fullWidth:!0,type:"number",value:n.qoutaCustomQuntity,onChange:x=>h("qoutaCustomQuntity",Math.max(0,x.target.value)),inputProps:{min:1},error:l.qoutaCustomQuntity,helperText:l.qoutaCustomQuntity?"حجم باید بزرگتر از صفر باشد":""}),u.jsx(R,{fullWidth:!0,variant:"contained",color:"primary",onClick:A,disabled:!F(),startIcon:u.jsx(Qe,{}),children:"ذخیره تغییرات"})]})]})},Zu=P("PROVINCE_UPDATE_Killer_IDENTITY_SERVICE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.put("/kill_house/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),f6=M({maximumIncrease:N().typeError("لطفا یک عدد وارد کنید").min(0,"عددی بین 0 تا 100 وارد کنید!").max(100,"عددی بین 0 تا 100 وارد کنید!").required("این فیلد اجباری است"),maximumDecrease:N().typeError("لطفا یک عدد وارد کنید").min(0,"عددی بین 0 تا 100 وارد کنید!").max(100,"عددی بین 0 تا 100 وارد کنید!").required("این فیلد اجباری است")}),F6=({item:e,fetchdata:t})=>{const[r]=C.useContext(D),a=k(),n=H({initialValues:{maximumIncrease:(e==null?void 0:e.maximumLoadVolumeIncrease)||0,maximumDecrease:(e==null?void 0:e.maximumLoadVolumeReduction)||0},validationSchema:f6,onSubmit:o=>{a(Zu({kill_house_key:e==null?void 0:e.key,maximum_load_volume_increase:o.maximumIncrease,maximum_load_volume_reduction:o.maximumDecrease})).then(l=>{l.payload.error?r({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(t(),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}});return u.jsxs("form",{onSubmit:n.handleSubmit,children:[u.jsx(w,{variant:"body2",children:"درصد افزایش/کاهش حجم ورود اطلاعات بار"}),u.jsx(S,{size:"small",fullWidth:!0,id:"maximumIncrease",name:"maximumIncrease",label:"حداکثر افزایش حجم بار",type:"number",value:n.values.maximumIncrease,onChange:n.handleChange,onBlur:n.handleBlur,error:n.touched.maximumIncrease&&!!n.errors.maximumIncrease,helperText:n.touched.maximumIncrease&&n.errors.maximumIncrease,margin:"dense"}),u.jsx(S,{size:"small",fullWidth:!0,id:"maximumDecrease",name:"maximumDecrease",label:"حداکثر کاهش حجم بار",type:"number",value:n.values.maximumDecrease,onChange:n.handleChange,onBlur:n.handleBlur,error:n.touched.maximumDecrease&&!!n.errors.maximumDecrease,helperText:n.touched.maximumDecrease&&n.errors.maximumDecrease,margin:"dense"}),u.jsx(R,{type:"submit",variant:"contained",sx:{mt:1},fullWidth:!0,children:"ثبت اطلاعات"})]})},E6=({item:e,fetchdata:t})=>{const[r]=C.useContext(D),a=k(),[n,o]=C.useState((e==null?void 0:e.wareHouseRemainingWeightLimitationStatus)||!1),[l,s]=C.useState((e==null?void 0:e.wareHouseRemainingWeightLimitation)||""),[c,d]=C.useState((e==null?void 0:e.wareHouseRemainingPercentLimitationStatus)||!1),[h,y]=C.useState((e==null?void 0:e.wareHouseRemainingPercentLimitation)||""),A=()=>{o(!n)},F=()=>{d(!c)},x=()=>{a(Zu({kill_house_key:e==null?void 0:e.key,ware_house_remaining_weight_limitation_status:n,ware_house_remaining_weight_limitation:n?l:0,ware_house_remaining_percent_limitation_status:c,ware_house_remaining_percent_limitation:c?h:0})).then(p=>{p.payload.error?r({vertical:"top",horizontal:"center",msg:p.payload.error,severity:"error"}):(t(),r({vertical:"top",horizontal:"center",msg:"محدودیت‌های انبار با موفقیت ویرایش شد.",severity:"success"}))})};return u.jsxs(i,{container:!0,direction:"column",alignItems:"flex-start",width:"100%",sx:{px:{xs:1,sm:0}},children:[u.jsx(i,{item:!0,width:"100%",mb:2,children:u.jsx(w,{variant:"h6",sx:{fontSize:{xs:"1rem",sm:"1rem"},fontWeight:"bold"},children:"محدودیت سقف انبار"})}),u.jsxs(i,{item:!0,container:!0,direction:"column",spacing:{xs:2,sm:2},width:"100%",mb:2,px:1,children:[u.jsxs(i,{item:!0,container:!0,direction:"row",alignItems:"center",flexWrap:"wrap",sx:{gap:2},children:[u.jsx(i,{item:!0,children:u.jsx(lu,{checked:n,onChange:A,inputProps:{"aria-label":"محدودیت وزن انبار"},size:"small"})}),u.jsx(i,{item:!0,xs:!0,children:u.jsx(w,{sx:{fontSize:{xs:"0.625rem",sm:"0.875rem"}},children:"محدودیت مانده انبار"})})]}),n&&u.jsx(i,{item:!0,container:!0,spacing:{xs:1,sm:2},alignItems:"stretch",mb:2,children:u.jsx(i,{item:!0,xs:12,mt:2,children:u.jsx(S,{fullWidth:!0,label:"حداکثر وزن باقی مانده انبار (کیلوگرم)",type:"number",value:l,onChange:p=>s(p.target.value),size:"small",inputProps:{min:0},sx:{"& .MuiInputLabel-root":{fontSize:{xs:"0.875rem",sm:"1rem"}},"& .MuiInputBase-input":{fontSize:{xs:"0.875rem",sm:"1rem"}}}})})})]}),u.jsxs(i,{item:!0,container:!0,direction:"column",spacing:{xs:1.5,sm:2},width:"100%",px:1,children:[u.jsxs(i,{item:!0,container:!0,direction:"row",alignItems:"center",flexWrap:"wrap",sx:{gap:2},children:[u.jsx(i,{item:!0,children:u.jsx(lu,{checked:c,onChange:F,inputProps:{"aria-label":"محدودیت درصد انبار"},size:"small"})}),u.jsx(i,{item:!0,xs:!0,children:u.jsx(w,{sx:{fontSize:{xs:"0.625rem",sm:"0.875rem"}},children:"محدودیت مانده کشتار روزانه"})})]}),c&&u.jsx(i,{item:!0,container:!0,spacing:{xs:1,sm:2},mt:2,alignItems:"stretch",xs:12,children:u.jsx(i,{item:!0,xs:12,children:u.jsx(S,{fullWidth:!0,label:"درصد وزن باقی مانده روزانه انبار",type:"number",value:h,onChange:p=>y(p.target.value),size:"small",inputProps:{min:0,max:100},sx:{"& .MuiInputLabel-root":{fontSize:{xs:"0.875rem",sm:"1rem"}},"& .MuiInputBase-input":{fontSize:{xs:"0.875rem",sm:"1rem"}}}})})})]}),u.jsx(i,{item:!0,width:"100%",mt:4,children:u.jsx(R,{variant:"contained",onClick:x,fullWidth:!0,disabled:n&&(!l||l<=0)||c&&(!h||h<=0||h>100),sx:{fontSize:{xs:"0.875rem"},py:{xs:1.5,sm:1}},children:"ثبت اطلاعات"})})]})},b6=P("PROVINCE_UPDATE_KILLHOUSE_ARCHIVE_PERCENT_SERVICE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.put("kill_house/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),S6=({item:e,fetchdata:t})=>{const[r]=C.useContext(D),a=k(),[n,o]=C.useState((e==null?void 0:e.wareHouseRemainingWeightArchivePercent)!==void 0&&(e==null?void 0:e.wareHouseRemainingWeightArchivePercent)!==null&&(e==null?void 0:e.wareHouseRemainingWeightArchivePercent)>0),[l,s]=C.useState((e==null?void 0:e.wareHouseRemainingWeightArchivePercent)||0);C.useEffect(()=>{const A=(e==null?void 0:e.wareHouseRemainingWeightArchivePercent)!==void 0&&(e==null?void 0:e.wareHouseRemainingWeightArchivePercent)!==null&&(e==null?void 0:e.wareHouseRemainingWeightArchivePercent)>0;o(A),s((e==null?void 0:e.wareHouseRemainingWeightArchivePercent)||0)},[e]);const c=Number(l)>=0&&Number(l)<=100,d=A=>{s(A.target.value)},h=()=>{const A=!n;o(A),A||s(0)},y=()=>{a(b6({kill_house_key:e.key,ware_house_remaining_weight_archive_percent:n?Number(l):0})).then(A=>{A.payload.error?r({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"}):(t(),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})};return u.jsxs(i,{container:!0,direction:"column",gap:q.SMALL,pt:q.TINY,children:[u.jsx(i,{container:!0,alignItems:"center",spacing:1,children:u.jsx(i,{item:!0,children:u.jsx(v,{control:u.jsx(lu,{checked:n,onChange:h,color:"primary"}),label:"حداکثر افت استاندارد لاشه"})})}),n&&u.jsx(i,{container:!0,alignItems:"center",spacing:1,children:u.jsx(i,{item:!0,xs:!0,children:u.jsx(S,{fullWidth:!0,size:"small",label:"درصد",type:"number",value:l,onChange:d,variant:"outlined",inputProps:{min:0,max:100},error:!c,helperText:c?"":"عدد باید بین 0 تا 100 باشد"})})}),u.jsx(i,{item:!0,width:"100%",mt:2,children:u.jsx(R,{variant:"contained",onClick:y,fullWidth:!0,disabled:n&&!c,children:"ثبت اطلاعات"})})]})},k6=({item:e,fetchdata:t})=>{const{role:r}=bu(o=>o.userSlice),a=k(),n=()=>{r.includes("KillHouse")&&a(a0())};return u.jsxs(i,{container:!0,direction:"column",gap:2,alignItems:"flex-start",m:"3",children:[u.jsx(i,{item:!0,container:!0,spacing:2,justifyContent:"center",width:"100%",m:"3"}),u.jsxs(i,{item:!0,container:!0,alignItems:"center",spacing:1,justifyContent:"start",sx:{border:"1px solid #ccc",borderRadius:2,width:"100%",p:1},children:[u.jsx(i,{item:!0,children:u.jsx(ye,{item:e,getLimitInformation:n},e.key)}),u.jsx(i,{item:!0,children:u.jsx(w,{children:"مجوز ثبت درخواست"})})]}),u.jsxs(i,{item:!0,container:!0,alignItems:"center",spacing:1,justifyContent:"start",sx:{border:"1px solid #ccc",borderRadius:2,width:"100%",p:1},children:[u.jsx(i,{item:!0,children:u.jsx(ye,{item:e,isDebt:!0},`${e.key}-isDebt`)}),u.jsx(i,{item:!0,children:u.jsx(w,{children:"محدودیت پنل"})})]}),u.jsx(i,{xs:12,container:!0,alignItems:"center",spacing:1,justifyContent:"start",sx:{border:"1px solid #ccc",borderRadius:2,width:"100%",p:1},children:u.jsx(i,{item:!0,xs:12,children:u.jsx(j6,{item:e,fetchdata:t},e.key)})}),V()==="AdminX"&&u.jsx(i,{item:!0,container:!0,alignItems:"center",spacing:1,justifyContent:"start",sx:{border:"1px solid #ccc",borderRadius:2,width:"100%",p:1},children:u.jsx(i,{item:!0,children:u.jsx(m6,{item:e,getLimitInformation:n,fetchdata:t},`limit-${e.key}`)})}),u.jsx(i,{item:!0,container:!0,alignItems:"center",spacing:1,justifyContent:"start",sx:{border:"1px solid #ccc",borderRadius:2,width:"100%",p:1},children:u.jsx(i,{item:!0,children:u.jsx(v6,{item:e,fetchdata:t},e.key)})}),u.jsx(i,{item:!0,container:!0,alignItems:"center",spacing:1,justifyContent:"start",sx:{border:"1px solid #ccc",borderRadius:2,width:"100%",p:1},children:u.jsx(i,{item:!0,children:u.jsx(F6,{item:e,fetchdata:t})})}),u.jsx(i,{item:!0,container:!0,alignItems:"center",spacing:1,justifyContent:"start",sx:{border:"1px solid #ccc",borderRadius:2,width:"100%",p:1},children:u.jsx(i,{item:!0,xs:12,children:u.jsx(E6,{item:e,fetchdata:t})})}),u.jsx(i,{item:!0,container:!0,alignItems:"center",spacing:1,justifyContent:"start",sx:{border:"1px solid #ccc",borderRadius:2,width:"100%",p:1},children:u.jsx(i,{item:!0,xs:12,children:u.jsx(S6,{item:e,fetchdata:t})})})]})},P6=({item:e})=>{var l;const t=bu(s=>s.userSlice.userPath),r=`${window.location.origin}/pay/${q0(t)}/${(l=e==null?void 0:e.wageInfo)==null?void 0:l.userToken}`,[a]=C.useContext(D),n=k(),o=()=>{navigator.clipboard.writeText(r).then(()=>{a({vertical:"top",horizontal:"center",msg:"لینک پرداخت کپی شد",severity:"success"}),n(K())})};return u.jsx(i,{xs:12,container:!0,spacing:3,alignItems:"center",direction:"column",children:u.jsxs(i,{container:!0,spacing:2,justifyContent:"center",alignItems:"center",children:[u.jsx(i,{children:u.jsx(R,{fullWidth:!0,variant:"contained",sx:{backgroundColor:"blue",color:"white"},onClick:()=>window.open(r,"_blank"),children:"پرداخت بدهی"})}),u.jsx(i,{children:u.jsx(R,{fullWidth:!0,variant:"outlined",sx:{color:"blue",borderColor:"blue"},onClick:o,children:"کپی لینک"})})]})})};var Ju={},I6=Oe;Object.defineProperty(Ju,"__esModule",{value:!0});var Ze=Ju.default=void 0,w6=I6(Be()),T6=u;Ze=Ju.default=(0,w6.default)((0,T6.jsx)("path",{d:"M2 12.5C2 9.46 4.46 7 7.5 7H18c2.21 0 4 1.79 4 4s-1.79 4-4 4H9.5C8.12 15 7 13.88 7 12.5S8.12 10 9.5 10H17v2H9.41c-.55 0-.55 1 0 1H18c1.1 0 2-.9 2-2s-.9-2-2-2H7.5C5.57 9 4 10.57 4 12.5S5.57 16 7.5 16H17v2H7.5C4.46 18 2 15.54 2 12.5"}),"Attachment");const R6=()=>{const e=k(),[t,r]=C.useState([]),[a,n]=C.useState([]),o=()=>{e(Fu()).then(l=>{n(l.payload.data)})};return C.useEffect(()=>{o()},[]),C.useEffect(()=>{const l=a==null?void 0:a.map((s,c)=>{var h,y,A,F,x,p,j,E,T,O,f,B,U;const d=s.killer?`کشتارکن ${(s==null?void 0:s.type)==="public"?"عمومی":"اختصاصی"} (${(h=s==null?void 0:s.killHouseForKiller)==null?void 0:h.killHouseName})`:"کشتارگاه";return[c+1,d,s.name,`${(A=(y=s==null?void 0:s.killHouseOperator)==null?void 0:y.user)==null?void 0:A.fullname} (${(x=(F=s==null?void 0:s.killHouseOperator)==null?void 0:F.user)==null?void 0:x.mobile})`,`${((j=(p=s==null?void 0:s.systemAddress)==null?void 0:p.province)==null?void 0:j.name)||""} - ${((T=(E=s==null?void 0:s.systemAddress)==null?void 0:E.city)==null?void 0:T.name)||""} - ${((O=s==null?void 0:s.systemAddress)==null?void 0:O.address)||""}`,(B=(f=s==null?void 0:s.wageInfo)==null?void 0:f.totalAmount)==null?void 0:B.toLocaleString(),u.jsx(ou,{title:"لینک پرداخت",placement:"left-start",children:u.jsx(G,{color:"primary",onClick:()=>{e(Y({title:"لینک پرداخت بدهی",content:u.jsx(P6,{item:s})}))},children:u.jsx(Ze,{})})},c),(U=s==null?void 0:s.allowPurchaseRequest)!=null&&U.limitation?"فعال":"غیر فعال",u.jsx(u.Fragment,{children:u.jsx(w,{children:s!=null&&s.maxKillLimit?s.totalKillCapacity:"-"})}),u.jsxs(u.Fragment,{children:[u.jsx(w,{children:s!=null&&s.maxKillLimit?`%${s.extraBarKillPercent}`:"-"})," "]}),u.jsxs(u.Fragment,{children:[u.jsx(w,{children:s!=null&&s.inProvinceSellingLimitationPercent?`%${s.inProvinceSellingLimitationPercent}`:"-"})," "]}),u.jsx(u.Fragment,{children:u.jsx(w,{children:s!=null&&s.outProvinceSellingLimitationPercent?`%${s.outProvinceSellingLimitationPercent}`:"-"})}),s!=null&&s.quota?"دارد":"ندارد",s!=null&&s.quota?s!=null&&s.quotaMaxKillLimit?"بر اساس سقف کشتار":s!=null&&s.quotaRequest?"بر اساس اعلام نیازها":"بر اساس حجم از سقف کشتار":"-",s!=null&&s.governmentalQuota?s==null?void 0:s.governmentalQuota:"-",s!=null&&s.quotaCustomQuantity?s==null?void 0:s.quotaCustomQuantity:"-",(s==null?void 0:s.maximumLoadVolumeIncrease)||0,(s==null?void 0:s.maximumLoadVolumeReduction)||0,s!=null&&s.wareHouseRemaininggWeightLimitationStatus?"فعال":"غیر فعال",s!=null&&s.wareHouseRemainingWeightLimitation?`${s==null?void 0:s.wareHouseRemainingWeightLimitation} کیلوگرم`:"-",s!=null&&s.wareHouseRemainingPercentLimitationStatus?"فعال":"غیر فعال",s!=null&&s.wareHouseRemainingPercentLimitation?`%${s==null?void 0:s.wareHouseRemainingPercentLimitation}`:"-",s!=null&&s.wareHouseRemainingWeightArchivePercent?`%${s==null?void 0:s.wareHouseRemainingWeightArchivePercent}`:"-",u.jsx(ou,{title:"محدودیت پنل",placement:"left-start",children:u.jsx(G,{"aria-label":"delete",color:"primary",onClick:()=>{e(vu({right:!(window.innerWidth<=700),bottom:window.innerWidth<=700,title:"محدودیت پنل",content:u.jsx(k6,{item:s,fetchdata:o})}))},children:u.jsx(du,{})})},c)]});r(l)},[a]),u.jsx(i,{children:u.jsx(uu,{paginated:!0,title:"مجوز خرید",columns:["ردیف","ماهیت","نام واحد","نام و نام خانوادگی (تلفن)","آدرس","مبلغ بدهی (ریال)","لینک پرداخت","سقف بدهی","محدودیت سقف کشتار","درصد افزایش بار","حداقل فروش داخل استان","حداکثر فروش خارج استان","الزام به خرید دولتی","نوع الزام","درصد الزام به خرید دولتی","حجم الزام خرید از سقف کشتار","حداکثر افزایش حجم ورود اطلاعات بار","حداکثر کاهش حجم ورود اطلاعات بار","محدودیت مانده انبار","حداکثز وزن باقی مانده انبار","محدودیت مانده روزانه انبار","درصد وزن باقی مانده روزانه انبار","حداکثر افت استاندارد لاشه","عملیات"],data:t,customColors:[{name:"مجوز ثبت درخواست",color:"red"},{name:"محدودیت براساس بدهی",color:"red"},{name:"محدودیت پنل",color:"red"}]})})},D6=()=>{const{pathname:e}=Ke();return u.jsxs(i,{container:!0,gap:q.SMALL,direction:"row",mt:q.MEDIUM,justifyContent:{xs:"center",lg:"flex-start"},xs:12,children:[u.jsx(tu,{to:V()==="SuperAdmin"?ze:V()==="AdminX"?Ue:zu,active:e===zu?"true":null,children:u.jsx(eu,{icon:u.jsx(M0,{size:30,color:"#244CCC"}),title:"شورای سیاست گذاری"})}),V()==="AdminX"&&u.jsx(tu,{to:V()==="AdminX"?Ou:Ou,active:e===Ou?"true":null,children:u.jsx(eu,{icon:u.jsx(H0,{size:30,color:"#244CCC"}),title:"سهم بندی"})}),u.jsx(tu,{to:V()==="SuperAdmin"?Uu:Ve,active:e===Uu?"true":null,children:u.jsx(eu,{icon:u.jsx(W0,{size:30,color:"#244CCC"}),title:"وضعیت اسناد"})}),V()==="AdminX"&&u.jsx(tu,{to:Vu,active:e===Vu?"true":null,children:u.jsx(eu,{icon:u.jsx(G0,{size:30,color:"#244CCC"}),title:"حساب ها"})}),(V()==="AdminX"||V()==="SuperAdmin")&&u.jsx(tu,{to:V()==="AdminX"?qu:qe,active:e===qu?"true":null,children:u.jsx(eu,{icon:u.jsx(Ce,{size:30,color:"#244CCC"}),title:"مدیریت ارسال تیکت"})}),V()==="AdminX"&&u.jsx(tu,{to:V()==="AdminX"?ku:ku,active:e===ku?"true":null,children:u.jsx(eu,{icon:u.jsx(Ce,{size:30,color:"#244CCC"}),title:"کرونجاب"})}),V()==="AdminX"&&u.jsx(tu,{to:V()==="AdminX"?Pu:Pu,active:e===Pu?"true":null,children:u.jsx(eu,{icon:u.jsx($0,{size:30,color:"#244CCC"}),title:"مدیریت ارسال پیامک"})}),u.jsx(tu,{to:V()==="SuperAdmin"?Me:Mu,active:e===Mu?"true":null,children:u.jsx(eu,{icon:u.jsx(K0,{size:30,color:"#244CCC"}),title:"مدیریت بازه وزنی"})}),u.jsx(tu,{to:V()==="SuperAdmin"?He:Hu,active:e===Hu?"true":null,children:u.jsx(eu,{icon:u.jsx(Y0,{size:30,color:"#244CCC"}),title:"دسته بندی وزنی"})}),u.jsx(tu,{to:V()==="SuperAdmin"?We:Wu,active:e===Wu?"true":null,children:u.jsx(eu,{icon:u.jsx(Q0,{size:30,color:"#244CCC"}),title:"جریمه"})}),u.jsx(tu,{to:V()==="SuperAdmin"?Ge:Gu,active:e===Gu?"true":null,children:u.jsx(eu,{icon:u.jsx(X0,{size:30,color:"#244CCC"}),title:"محدودیت توزیع لاشه"})})]})},O6=P("PROVINCE_PURGE_NEEDED_REQUEST_SERVICE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.put("kill_request/0/",{previous_requests:!0});return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),L6=P("PROVINCE_CREATE_KILLHOUSE_SERVICE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.post("kill_house/",e);return t(s0()),t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),N6={city:"",mobile:"",password:"",first_name:"",last_name:"",national_id:"",address:"",name:"",killer:!1},B6=M().shape({city:$().required("City is required"),mobile:$().required("Mobile is required"),password:$().required("Password is required"),first_name:$().required("First Name is required"),last_name:$().required("Last Name is required"),national_id:$().required("National ID is required"),address:$().required("Address is required"),name:$().required("Name is required")}),z6=()=>{const e=k(),[t]=C.useContext(D),{provinceGetCities:r}=bu(n=>n.provinceSlice),a=H({initialValues:N6,validationSchema:B6,onSubmit:n=>{const{first_name:o,last_name:l,mobile:s,city:c,password:d,national_id:h,address:y,name:A,killer:F}=n;e(L6({city:c,mobile:s,password:d,first_name:o,last_name:l,national_id:h,address:y,name:A,killer:F})).then(x=>{x.payload.error?t({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):(e(pu()),e(xu()),e(vu({right:!1,bottom:!1,content:null})),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}});return C.useEffect(()=>{e(o0())},[]),u.jsx("div",{children:u.jsx("form",{onSubmit:a.handleSubmit,children:u.jsxs(i,{container:!0,gap:q.SMALL,direction:"column",children:[u.jsx(S,{fullWidth:!0,id:"first_name",name:"first_name",label:"نام",value:a.values.first_name,onChange:a.handleChange,onBlur:a.handleBlur,error:a.touched.first_name&&!!a.errors.first_name,helperText:a.touched.first_name&&a.errors.first_name}),u.jsx(S,{fullWidth:!0,id:"last_name",name:"last_name",label:"نام خانوادگی",value:a.values.last_name,onChange:a.handleChange,onBlur:a.handleBlur,error:a.touched.last_name&&!!a.errors.last_name,helperText:a.touched.last_name&&a.errors.last_name}),u.jsx(S,{fullWidth:!0,id:"national_id",name:"national_id",label:"کدملی",value:a.values.national_id,onChange:a.handleChange,onBlur:a.handleBlur,error:a.touched.national_id&&!!a.errors.national_id,helperText:a.touched.national_id&&a.errors.national_id}),u.jsx(S,{select:!0,label:"شهر",variant:"outlined",fullWidth:!0,id:"city",name:"city",value:a.values.city,onChange:a.handleChange,error:a.touched.city&&!!a.errors.city,helperText:a.touched.city&&a.errors.city,children:r==null?void 0:r.map(n=>u.jsx(Cu,{value:n.name,children:n.name},n.id))}),u.jsx(S,{fullWidth:!0,id:"mobile",name:"mobile",label:"تلفن",value:a.values.mobile,onChange:a.handleChange,onBlur:a.handleBlur,error:a.touched.mobile&&!!a.errors.mobile,helperText:a.touched.mobile&&a.errors.mobile}),u.jsx(S,{fullWidth:!0,id:"name",name:"name",label:"نام واحد",value:a.values.name,onChange:a.handleChange,onBlur:a.handleBlur,error:a.touched.name&&!!a.errors.name,helperText:a.touched.name&&a.errors.name}),u.jsx(S,{fullWidth:!0,id:"address",name:"address",label:"آدرس",value:a.values.address,onChange:a.handleChange,onBlur:a.handleBlur,error:a.touched.address&&!!a.errors.address,helperText:a.touched.address&&a.errors.address}),u.jsx(S,{fullWidth:!0,id:"password",name:"password",label:"رمزعبور",type:"password",value:a.values.password,onChange:a.handleChange,onBlur:a.handleBlur,error:a.touched.password&&!!a.errors.password,helperText:a.touched.password&&a.errors.password}),u.jsx(v,{control:u.jsx(z,{id:"killer",name:"killer",checked:a.values.killer,onChange:a.handleChange}),label:"کشتارکن می باشد"}),u.jsx(R,{fullWidth:!0,type:"submit",variant:"contained",color:"primary",children:"ثبت"})]})})})},U6=P("PROVINCE_UPDATE_SLAUGHTER_IDENTITY_SERVICE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.put("kill_house_percent/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),V6=({killhouseType:e,slaughterKey:t})=>{const r=k(),[a]=C.useContext(D),[n,o]=C.useState(e),l=s=>{r(U6({percentage_key:t,identity:s.target.value})).then(c=>{c.payload.error?a({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(o(s.target.value),r(pu()),r(xu()),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})};return u.jsxs(Eu,{label:"Select Option",value:n,onChange:l,style:{width:140},size:"small",children:[u.jsx(Cu,{value:"KillHouse",children:"کشتارگاه"}),u.jsx(Cu,{value:"Killer",children:"کشتارکن"})]})},q6=({slaughterKey:e,disableSelect:t,killerType:r})=>{const a=k(),[n]=C.useContext(D),[o,l]=C.useState(r),s=c=>{a(Zu({kill_house_key:e,type:c.target.value})).then(d=>{d.payload.error?n({vertical:"top",horizontal:"center",msg:d.payload.error,severity:"error"}):(l(c.target.value),a(pu()),a(xu()),n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})};return u.jsx(u.Fragment,{children:t?"-":u.jsxs(Eu,{disabled:t,label:"Select Option",value:o,onChange:s,style:{width:140},size:"small",children:[u.jsx(Cu,{value:"public",children:"عمومی"}),u.jsx(Cu,{value:"exclusive",children:"اختصاصی"})]})})},M6=()=>{const e=k(),[t]=C.useContext(D),[r,a]=C.useState(),{provinceGetSlaughterhousesQuota:n}=bu(o=>o.provinceSlice);return C.useEffect(()=>{e(pu()),e(xu())},[]),C.useEffect(()=>{const o=n==null?void 0:n.map((l,s)=>{var d,h,y,A,F,x,p,j,E,T,O,f,B,U,m,X,W,iu,J,ju,fu,Su,L,au,ee,te,re,ne,ae,se;const c=(d=l==null?void 0:l.killHouse)!=null&&d.killer?"Killer":"KillHouse";return[s+1,V()==="ProvinceOperator"?(h=l==null?void 0:l.killHouse)!=null&&h.killer?"کشتارکن":"کشتارگاه":u.jsx(V6,{killhouseType:c,slaughterKey:l.key},s),V()==="ProvinceOperator"?(y=l==null?void 0:l.killHouse)!=null&&y.killer?((A=l==null?void 0:l.killHouse)==null?void 0:A.type)==="public"?"عمومی":"اختصاصی":"-":u.jsx(q6,{killerType:(F=l==null?void 0:l.killHouse)==null?void 0:F.type,disableSelect:c==="KillHouse",slaughterKey:(x=l==null?void 0:l.killHouse)==null?void 0:x.key},s),u.jsxs(i,{alignItems:"center",justifyContent:"center",children:[u.jsx(w,{variant:"caption",children:(p=l.killHouse)==null?void 0:p.name}),u.jsx(G,{size:"small",color:"primary","aria-label":"Delete",onClick:()=>{var oe;e(Y({title:"ویرایش",content:u.jsx(W6,{name:(oe=l.killHouse)==null?void 0:oe.name,item:l},l.key)}))},children:u.jsx(ru,{fontSize:"10px"})})]},l.key),u.jsxs(i,{container:!0,alignItems:"center",justifyContent:"center",children:[u.jsxs(w,{variant:"caption",children:[(T=(E=(j=l.killHouse)==null?void 0:j.killHouseOperator)==null?void 0:E.user)==null?void 0:T.fullname," (",(B=(f=(O=l.killHouse)==null?void 0:O.killHouseOperator)==null?void 0:f.user)==null?void 0:B.mobile,")"]}),u.jsx(G,{size:"small",color:"primary","aria-label":"Delete",onClick:()=>{e(Y({title:"ویرایش",content:u.jsx(G6,{item:l},l.key)}))},children:u.jsx(ru,{fontSize:"10px"})})]},l.key),l.killHouseVet?`${(X=(m=(U=l.killHouseVet)==null?void 0:U.vet)==null?void 0:m.user)==null?void 0:X.fullname} (${(J=(iu=(W=l.killHouseVet)==null?void 0:W.vet)==null?void 0:iu.user)==null?void 0:J.mobile})`:"-",`${(Su=(fu=(ju=l.killHouse)==null?void 0:ju.systemAddress)==null?void 0:fu.province)==null?void 0:Su.name} - ${(ee=(au=(L=l.killHouse)==null?void 0:L.systemAddress)==null?void 0:au.city)==null?void 0:ee.name} - ${(re=(te=l.killHouse)==null?void 0:te.systemAddress)==null?void 0:re.address}`,(ne=l==null?void 0:l.killHouse)!=null&&ne.killer?u.jsx(Z0,{slaughterKey:l.key,killHouseForKiller:l.killHouseForKiller,disabled:!1},((ae=l.killHouse)==null?void 0:ae.name)+s):(se=l.killHouse)==null?void 0:se.name,u.jsx(H6,{item:l},l.key)]});a(o)},[n]),u.jsxs(i,{mt:q.SMALL,children:[u.jsxs(i,{container:!0,justifyContent:"space-between",mb:q.SMALL,children:[u.jsxs(i,{children:[u.jsx(R,{variant:"contained",onClick:()=>{e(vu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ایجاد خریدار",content:u.jsx(z6,{})}))},children:"ایجاد خریدار"}),u.jsx(ou,{title:"خروجی اکسل",children:u.jsx("a",{href:`${_.defaults.baseURL}kill_house_user_excel`,rel:"noreferrer",children:u.jsx(R,{color:"success",children:u.jsx(J0,{size:32})})})})]}),u.jsx(R,{variant:"contained",onClick:()=>{e(O6()).then(o=>{o.payload.error?t({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},children:"پاکسازی اعلام نیاز"})]}),u.jsx(uu,{paginated:!0,title:"کشتارگاه ها",columns:["ردیف","ماهیت","نوع کشتارکن","نام واحد","نام و نام خانوادگی (تلفن)","دامپزشک کشتارگاه (تلفن)","آدرس","محل کشتار","وضعیت"],data:r})]})},H6=({item:e})=>{const t=k(),[r,a]=C.useState(e.killHouse.active),n=o=>{a(o.target.checked);const l=`${_.defaults.baseURL}kill_house/0/`,s={kill_house_key:e.killHouse.key,active:o.target.checked};_.put(l,s).then(()=>{t(pu()),t(xu()),t(K())}).catch(c=>{console.error("Error:",c)})};return u.jsx(v,{control:u.jsx(lu,{checked:r,onChange:n,color:"primary"}),label:r?"فعال":"غیرفعال"})},W6=({name:e,item:t})=>{const r=k(),[a,n]=C.useState(e),o=l=>{n(l.target.value)};return u.jsxs(i,{container:!0,gap:q.TINY,children:[u.jsx(S,{label:"نام واحد",variant:"outlined",fullWidth:!0,value:a,onChange:o}),u.jsx(R,{variant:"contained",fullWidth:!0,onClick:()=>{const l=`${_.defaults.baseURL}kill_house/0/`,s={kill_house_key:t.killHouse.key,name:a};_.put(l,s).then(()=>{r(pu()),r(xu()),r(K())}).catch(c=>{console.error("Error:",c)})},children:"ثبت"})]})},G6=({item:e})=>{var y,A,F,x,p,j,E,T,O;const t=k(),[r,a]=C.useState((F=(A=(y=e.killHouse)==null?void 0:y.killHouseOperator)==null?void 0:A.user)==null?void 0:F.firstName),[n,o]=C.useState((j=(p=(x=e.killHouse)==null?void 0:x.killHouseOperator)==null?void 0:p.user)==null?void 0:j.lastName),[l,s]=C.useState((O=(T=(E=e.killHouse)==null?void 0:E.killHouseOperator)==null?void 0:T.user)==null?void 0:O.mobile),c=f=>{a(f.target.value)},d=f=>{o(f.target.value)},h=f=>{s(f.target.value)};return u.jsxs(i,{container:!0,gap:q.SMALL,children:[u.jsx(S,{label:"نام",variant:"outlined",fullWidth:!0,value:r,onChange:c}),u.jsx(S,{label:"نام خانوادگی",variant:"outlined",fullWidth:!0,value:n,onChange:d}),u.jsx(S,{label:"تلفن",variant:"outlined",fullWidth:!0,value:l,onChange:h}),u.jsx(R,{variant:"contained",fullWidth:!0,onClick:()=>{const f=`${_.defaults.baseURL}kill_house/0/`,B={kill_house_key:e.killHouse.key,first_name:r,last_name:n,mobile:l};_.put(f,B).then(()=>{t(pu()),t(xu()),t(K())}).catch(U=>{console.error("Error:",U)})},children:"ثبت"})]})},$6=P("PROVINCE_CHANGE_SLAUGHTER_CAR_PERMISSION_SERVICE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.post("province_allow_kill_house_register_car/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),K6=({state:e,killHouseKey:t})=>{const r=k(),[a,n]=C.useState(e),o=()=>{n(!a),r($6({allow:!e,kill_house_key:t})).then(l=>{r($e())})};return u.jsx(lu,{checked:a,onChange:o})},Y6=()=>{const e=k(),[t,r]=C.useState([]),{provinceGetOnlyKillHouses:a}=bu(n=>n.provinceSlice);return C.useEffect(()=>{e($e("kill_house"))},[]),C.useEffect(()=>{const n=a==null?void 0:a.map(o=>[o.killer?"کشتارکن":"کشتارگاه",o.name,u.jsx(K6,{killHouseKey:o.key,state:o.allowState},o.key)]);r(n)},[a]),u.jsx(i,{children:u.jsx(u6,{name:"خریداران",columns:["ماهیت","خریدار","دسترسی ثبت خودرو"],data:t})})};var ue={},Q6=Oe;Object.defineProperty(ue,"__esModule",{value:!0});var Je=ue.default=void 0,X6=Q6(Be()),Z6=u;Je=ue.default=(0,X6.default)((0,Z6.jsx)("path",{d:"M19 2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h4l3 3 3-3h4c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-6 16h-2v-2h2zm2.07-7.75-.9.92C13.45 11.9 13 12.5 13 14h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}),"LiveHelp");const J6=P("PROVINCE_GET_POLICY_POULTRY_CHOOSE_KILL_HOUSE_SERVICE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.get("province_allow_poultry_choose_kill_house_total/");return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),ut=P("PROVINCE_POLICY_FREE_SALE_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.post("province_allow_poultry_sell_free_total/",e);return t(g()),{data:r,status:a}}),et=P("PROVINCE_POLICY_GET_FREE_SALE_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.get("province_allow_poultry_sell_free_total/",e);return t(g()),{data:r,status:a}}),_e=P("PROVINCE_POLICY_POULTRY_CHOOSE_KILL_HOUSE_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.post("province_allow_poultry_choose_kill_house_total/",e);return t(g()),{data:r,status:a}}),tt=P("PROVINCE_POLICY_AUTO_ACCEPT_SLAUGHTER_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.put("auto_accept_province_kill_requests/0/",e);return t(g()),{data:r,status:a}}),rt=P("PROVINCE_POLICY_GET_AUTO_ACCEPT_SLAUGHTER_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.get("auto_accept_province_kill_requests/",e);return t(g()),{data:r,status:a}}),nt=P("PROVINCE_POLICY_AUTO_ALLOCATE_CAR_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.put("auto_make_kill_house_requests/0/",e);return t(g()),{data:r,status:a}}),at=P("PROVINCE_POLICY_GET_AUTO_ALLOCATE_CAR_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.get("auto_make_kill_house_requests/",e);return t(g()),{data:r,status:a}}),st=P("GET_LOSSES_PERMISSION_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.get("losses_permission/");return t(g()),{data:r,status:a}}),me=P("UPDATE_LOSSES_PERMISSION_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.put("losses_permission/0/",e);return t(g()),{data:r,status:a}}),ot=()=>{const[e,t]=C.useState(!0),[r,a]=C.useState(""),[n,o]=C.useState(),l=k();C.useEffect(()=>{l(st()).then(d=>{t(d.payload.data.allow),a(d.payload.data.percent),o(d.payload.data)})},[]),C.useEffect(()=>{e||l(me({permission_key:n.key,allow:!1,percent:parseInt(r)}))},[e]);const s=d=>{t(d.target.checked)},c=d=>{const h=d.target.value;(/^\d*$/.test(h)||h==="")&&a(h)};return u.jsxs(i,{container:!0,alignItems:"center",gap:q.TINY,children:[u.jsx(v,{control:u.jsx(z,{checked:e,onChange:s,name:"item4"}),label:"اعمال درصد تلفات پیش فرض:"}),u.jsx(i,{children:u.jsx(S,{disabled:!e,type:"number",label:"درصد تلفات",size:"small",value:r,onChange:c,inputProps:{inputMode:"numeric",pattern:"[0-9]*"}})}),u.jsx(i,{children:u.jsx(R,{variant:"contained",disabled:!e||!r,onClick:()=>{l(me({permission_key:n.key,percent:parseInt(r),allow:e}))},children:"ثبت"})})]})},lt=P("GET_DIRECT_BUY_PERMISSION_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.get("allow_direct_buying_total/");return t(g()),{data:r,status:a}}),it=P("POST_DIRECT_BUY_PERMISSION_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.post("allow_direct_buying_total/",e);return t(g()),{data:r,status:a}}),ct=()=>{const e=Ye(),[t,r]=C.useState(!1),a=k();C.useEffect(()=>{a(lt()).then(o=>{r(o.payload.data.allowState)})},[]);const n=o=>{a(it({allow:o.target.checked})),r(o.target.checked)};return u.jsxs(i,{container:!0,alignItems:"center",gap:q.TINY,children:[u.jsx(v,{control:u.jsx(z,{checked:t,onChange:n,name:"item4"}),label:"دسترسی کشتارگاه/کشتارکن برای ثبت خرید مستقیم"}),u.jsx(ou,{title:"مدیریت",children:u.jsx(G,{disabled:!t,color:"success",onClick:()=>{e(`${V()==="AdminX"?l0:V()==="SuperAdmin"?i0:V()==="ProvinceFinancial"?c0:""}`)},children:u.jsx(du,{})})})]})},Ct=P("GET_HOUR_LIMIT_KILL_REQUEST_KILLHOUSE_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.get("kill_house_hour_limit/");return t(g()),{data:r,status:a}}),ve=P("HOUR_LIMIT_KILL_REQUEST_KILLHOUSE_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.post("kill_house_hour_limit/",e);return t(g()),{data:r,status:a}}),dt=()=>{const e=k(),t=Array.from({length:8},(l,s)=>s+8),[r,a]=C.useState(!1),[n,o]=C.useState("");return C.useEffect(()=>{e(Ct()).then(l=>{a(l.payload.data.active),o(l.payload.data.hour)})},[]),C.useEffect(()=>{r&&n&&e(ve({hour:n,active:r})),!r&&n&&(o(null),e(ve({hour:0,active:r})))},[n,r]),u.jsxs(i,{container:!0,gap:2,children:[u.jsx(v,{control:u.jsx(z,{checked:r,onChange:()=>a(!r)}),label:"محدودیت زمان درخواست کشتار کشتارگاه"}),r&&u.jsxs(Q,{style:{width:200},children:[u.jsx(Ku,{id:"hour-label",children:"ساعت پایان درخواست"}),u.jsx(Eu,{labelId:"hour-label",label:"ساعت پایان درخواست",id:"hour-select",value:n,onChange:l=>o(l.target.value),children:t.map(l=>u.jsxs(Cu,{value:l,children:[l,":00"]},l))})]})]})},ht=P("POLICY_CHANGE_PROVINCE_FEE_SERVICE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.put("share/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),pt=()=>{const e=k(),[t]=C.useContext(D),[r,a]=C.useState(),n=o=>{a(o.target.value)};return C.useEffect(()=>{e(C0()).then(o=>{a(o.payload.data.provinceUnion)})},[]),u.jsxs(i,{container:!0,alignItems:"center",gap:q.SMALL,children:[u.jsx(i,{children:u.jsx(w,{children:"مبلغ تعرفه استان:"})}),u.jsx(i,{children:u.jsx(S,{InputLabelProps:{shrink:!0},size:"small",label:"مبلغ تعرفه ",type:"number",value:r,onChange:n,style:{width:"160px"},InputProps:{endAdornment:u.jsx(Le,{position:"end",children:"﷼"})}})}),u.jsx(i,{children:u.jsx(R,{variant:"contained",onClick:()=>{e(ht({province_union:Number(r)})).then(o=>{o.payload.error?t({vertical:"top",horizontal:"center",msg:o.error,severity:"error"}):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},children:"ثبت"})})]})},je=P("PROVINCE_GET_EVACUATION_PERMIT",async()=>{const{data:e,status:t}=await _.get("evacuation_permit/");return{data:e,status:t}}),xt=P("PROVINCE_EDIT_EVACUATION_PERMIT",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.put("evacuation_permit/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),gt=P("PROVINCE_SET_SELL_FOR_FREEZING_ACCESSS",async e=>{const{data:t,status:r}=await _.put("sell-for-freezing/0/",e);return{data:t,status:r}}),At=P("PROVINCE_GET_LIMITATION",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.get("operation-limitation/");return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}});function yt(e){return e.replace(/[A-Z]/g,function(t){return"_"+t.toLowerCase()})}const _t=P("PROVINCE_POLICY_UPDATE_LIMITATIONS",async(e,{dispatch:t})=>{t(b());try{const{data:r,status:a}=await _.put("operation-limitation/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),mt=()=>{const e=k(),[t,r]=C.useState();C.useEffect(()=>{e(At()).then(o=>{r(o.payload.data)})},[]);const a=o=>{const{name:l,checked:s}=o.target;r(c=>{const d={...c,[l]:s};return n(d),d})},n=o=>{const l={};for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const c=yt(s);l[c]=o[s]}e(_t(l))};return u.jsx(u.Fragment,{children:t&&u.jsxs(i,{display:"grid",xs:12,children:[u.jsx(v,{control:u.jsx(z,{onChange:a,name:"vetFarmLimitation",checked:t==null?void 0:t.vetFarmLimitation}),label:"محدودیت کد قرنطینه برای بار داخل استان"}),u.jsx(v,{control:u.jsx(z,{checked:t==null?void 0:t.vetFarmOutProvinceLimitation,onChange:a,name:"vetFarmOutProvinceLimitation"}),label:"بار خارج از استان"}),u.jsx(v,{control:u.jsx(z,{checked:t==null?void 0:t.provinceAllocationLimitation,onChange:a,name:"provinceAllocationLimitation"}),label:"محدودیت تخصیص استان به کشتارگاه"}),u.jsx(v,{control:u.jsx(z,{checked:t==null?void 0:t.killHouseAllocationLimitation,onChange:a,name:"killHouseAllocationLimitation"}),label:"محدودیت ایجاد بار برای کشتارگاه"}),u.jsx(v,{control:u.jsx(z,{checked:t==null?void 0:t.killHouseVetLimitation,onChange:a,name:"killHouseVetLimitation"}),label:"محدودیت تایید تخلیه برای دامپزشک"}),u.jsx(v,{control:u.jsx(z,{checked:t==null?void 0:t.vetCheckKillHouseAssignmentLimitation,onChange:a,name:"vetCheckKillHouseAssignmentLimitation"}),label:"محدودیت تایید تخلیه ورود اطلاعات بار"}),u.jsx(v,{control:u.jsx(z,{checked:t==null?void 0:t.killHouseAssignmentLimitation,onChange:a,name:"killHouseAssignmentLimitation"}),label:"محدودیت ورود اطلاعات بار کشتارگاه "}),u.jsx(v,{control:u.jsx(z,{checked:t==null?void 0:t.killHouseInputBarLimitation,onChange:a,name:"killHouseInputBarLimitation"}),label:"محدودیت ورود بار به انبار کشتارگاه"}),u.jsx(v,{control:u.jsx(z,{checked:t==null?void 0:t.killHouseStewardGuildAllocationLimitation,onChange:a,name:"killHouseStewardGuildAllocationLimitation"}),label:"محدودیت تخصیص کشتارگاه به مباشر یا صنف"}),u.jsx(v,{control:u.jsx(z,{checked:t==null?void 0:t.killHouseFreezingLimitation,onChange:a,name:"killHouseFreezingLimitation"}),label:"محدودیت انجماد برای کشتارگاه"}),u.jsx(v,{control:u.jsx(z,{checked:t==null?void 0:t.killHouseFreeSaleLimitation,onChange:a,name:"killHouseFreeSaleLimitation"}),label:"محدودیت فروش آزاد برای کشتارگاه"}),u.jsx(v,{control:u.jsx(z,{checked:t==null?void 0:t.killHouseFreeBuyLimitation,onChange:a,name:"killHouseFreeBuyLimitation"}),label:"محدودیت خرید آزاد برای کشتارگاه"})]})})},fe=P("PROVINCE_EDIT_APPROVED_PRICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.put("approved-price/0/",e);return t(g()),{data:r,status:a}}),Nu=P("PROVINCE_EDIT_KILL_APPROVED_PRICE",async(e,{dispatch:t})=>{t(b());try{const{data:r,status:a}=await _.put("broadcast-price/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),Bu=P("PROVINCE_UPDATE_POLICY_AVICULTURE_COMMIT_SERVICE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.put("free_sale_within_province/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),vt=({approvedState:e})=>{const t=k(),[r]=C.useContext(D),[a,n]=C.useState(""),[o,l]=C.useState(!1),[s,c]=C.useState(),[d,h]=C.useState("byWeight");C.useEffect(()=>{t(d0()).then(x=>{l(x.payload.data.allow),c(x.payload.data.key),x.payload.data.type==="weight"?(h("byWeight"),n(x.payload.data.weight)):(h("byPercent"),n(x.payload.data.percent))})},[]);const y=x=>{l(x.target.checked),t(Bu({free_sale_key:s,allow:x.target.checked})).then(p=>{p.payload.error?(r({vertical:"top",horizontal:"center",msg:p.payload.error,severity:"error"}),l(!1)):r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},A=x=>{const p=x.target.value;(/^\d*$/.test(p)||p==="")&&n(p)},F=x=>{h(x.target.value)};return C.useEffect(()=>{!e&&s&&(l(!1),t(Bu({free_sale_key:s,allow:!1})))},[e]),u.jsxs(i,{container:!0,alignItems:"center",gap:q.TINY,children:[u.jsx(i,{children:u.jsx(v,{control:u.jsx(z,{checked:o,onChange:y}),label:"تعهد تحویل مرغ به نرخ دولتی"})}),o&&u.jsxs(i,{container:!0,alignItems:"center",children:[u.jsx(i,{children:u.jsx(Q,{component:"fieldset",disabled:!o,children:u.jsxs(Z,{"aria-label":"options",name:"options",value:d,onChange:F,children:[u.jsx(v,{value:"byPercent",control:u.jsx(I,{}),label:"بر اساس درصد تحویل"}),u.jsx(v,{value:"byWeight",control:u.jsx(I,{}),label:"بر اساس وزن قطعه"})]})})}),d&&u.jsxs(i,{container:!0,gap:q.TINY,children:[u.jsx(i,{children:u.jsx(S,{disabled:!o,type:"number",style:{width:"200px"},InputProps:{endAdornment:u.jsx(Le,{position:"end",children:d==="byWeight"?"کیلوگرم":"درصد"})},size:"small",value:a,onChange:A,inputProps:{inputMode:"numeric",pattern:"[0-9]*"}})}),u.jsx(i,{children:u.jsx(R,{variant:"contained",disabled:!o||!a||Number(a)<1,onClick:()=>{t(Bu({free_sale_key:s,allow:o,weight:d==="byWeight"?Number(a):0,percent:d==="byPercent"?Number(a):0,type:d==="byWeight"?"weight":"percent"})).then(x=>{x.payload.error?r({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},children:"ثبت"})})]})]})]})},jt=({approvedState:e})=>{const t=k(),[r]=C.useContext(D),[a,n]=C.useState(!1),[o,l]=C.useState();C.useEffect(()=>{t(h0()).then(d=>{var h;l(d.payload.data),(h=d.payload.data)!=null&&h.active&&n(!0)})},[]);const s=H({initialValues:{kill_house_price:"",steward_price:"",guild_price:""},validationSchema:M({kill_house_price:N().required("این فیلد اجباری است"),steward_price:N().required("این فیلد اجباری است"),guild_price:N().required("این فیلد اجباری است")})});C.useEffect(()=>{s.validateForm()},[]),C.useEffect(()=>{o!=null&&o.killHousePrice&&a&&(s.setFieldValue("kill_house_price",o==null?void 0:o.killHousePrice),s.setFieldValue("steward_price",o==null?void 0:o.stewardPrice),s.setFieldValue("guild_price",o==null?void 0:o.guildPrice))},[o]);const c=d=>{n(d.target.checked),d.target.checked===!1&&t(Nu({active:!1})).then(h=>{h.payload.error?r({vertical:"top",horizontal:"center",msg:h.payload.error,severity:"error"}):r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})};return C.useEffect(()=>{a&&e&&(n(!1),t(Nu({active:!1})))},[e]),u.jsx(i,{container:!0,xs:12,alignItems:"center",justifyContent:"space-between",direction:"column",children:u.jsxs(i,{container:!0,xs:12,gap:2,alignItems:"center",justifyContent:"start",children:[u.jsx(i,{container:!0,direction:"column",textAlign:"initial",children:u.jsx(i,{children:u.jsx(v,{control:u.jsx(z,{checked:a,onChange:c}),label:"قیمت مصوب کشتارگاه، صنف و مباشر"})})}),a&&u.jsxs(u.Fragment,{children:[u.jsxs(i,{container:!0,xs:12,md:4,lg:4,spacing:1,children:[u.jsx(i,{children:u.jsx(S,{size:"small",label:"قیمت کشتارگاه",name:"kill_house_price",value:s.values.kill_house_price,onChange:s.handleChange,error:s.touched.kill_house_price&&!!s.errors.kill_house_price,helperText:s.touched.kill_house_price&&s.errors.kill_house_price,required:!0})}),u.jsx(i,{children:u.jsx(S,{size:"small",label:"قیمت مباشر",name:"steward_price",value:s.values.steward_price,onChange:s.handleChange,error:s.touched.steward_price&&!!s.errors.steward_price,helperText:s.touched.steward_price&&s.errors.steward_price,required:!0})}),u.jsx(i,{children:u.jsx(S,{size:"small",label:"قیمت صنف",name:"guild_price",value:s.values.guild_price,onChange:s.handleChange,error:s.touched.guild_price&&!!s.errors.guild_price,helperText:s.touched.guild_price&&s.errors.guild_price,required:!0})})]}),u.jsx(i,{container:!0,xs:12,md:2,children:u.jsx(R,{disabled:!s.isValid,variant:"contained",onClick:()=>{t(Nu({active:!0,guild_price:s.values.guild_price,kill_house_price:s.values.kill_house_price,steward_price:s.values.steward_price})).then(d=>{d.payload.error?r({vertical:"top",horizontal:"center",msg:d.payload.error,severity:"error"}):r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},children:"ثبت"})})]})]})})},ft=()=>{const e=k(),[t]=C.useContext(D),[r,a]=C.useState(!1),[n,o]=C.useState(!1),[l,s]=C.useState();C.useEffect(()=>{e(p0()).then(h=>{var y;s(h.payload.data),(y=h.payload.data)!=null&&y.approved&&a(!0)})},[]);const c=H({initialValues:{minWeight:"",maxWeight:"",minPrice:"",maxPrice:""},validationSchema:M({minWeight:N().required("این فیلد اجباری است"),maxWeight:N().required("این فیلد اجباری است"),minPrice:N().required("این فیلد اجباری است"),maxPrice:N().required("این فیلد اجباری است")})});C.useEffect(()=>{c.validateForm()},[]),C.useEffect(()=>{l!=null&&l.highestPrice&&r&&(c.setFieldValue("minWeight",l==null?void 0:l.lowestWeight),c.setFieldValue("maxWeight",l==null?void 0:l.highestWeight),c.setFieldValue("minPrice",l==null?void 0:l.lowestPrice),c.setFieldValue("maxPrice",l==null?void 0:l.highestPrice))},[l]);const d=h=>{a(h.target.checked),h.target.checked===!1&&(o(!0),e(fe({approved:!1})).then(y=>{y.error?t({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})}))};return u.jsxs(i,{container:!0,xs:12,alignItems:"center",justifyContent:"space-between",direction:"column",mt:4,children:[u.jsxs(i,{container:!0,xs:12,gap:2,alignItems:"center",justifyContent:"start",children:[u.jsx(i,{container:!0,direction:"column",textAlign:"initial",children:u.jsx(i,{children:u.jsx(v,{control:u.jsx(z,{checked:r,onChange:d}),label:"قیمت مصوب مرغ زنده"})})}),r&&u.jsxs(u.Fragment,{children:[u.jsxs(i,{container:!0,xs:12,md:4,lg:4,spacing:1,children:[u.jsx(i,{xs:6,children:u.jsx(S,{size:"small",label:"وزن کف (گرم)",name:"minWeight",value:c.values.minWeight,onChange:c.handleChange,error:c.touched.minWeight&&!!c.errors.minWeight,helperText:c.touched.minWeight&&c.errors.minWeight,required:!0})}),u.jsx(i,{xs:6,children:u.jsx(S,{size:"small",label:"وزن سقف (گرم)",name:"maxWeight",value:c.values.maxWeight,onChange:c.handleChange,error:c.touched.maxWeight&&!!c.errors.maxWeight,helperText:c.touched.maxWeight&&c.errors.maxWeight,required:!0})}),u.jsx(i,{xs:6,children:u.jsx(S,{size:"small",label:"قیمت وزن کف (ریال)",name:"minPrice",value:c.values.minPrice,onChange:c.handleChange,error:c.touched.minPrice&&!!c.errors.minPrice,helperText:c.touched.minPrice&&c.errors.minPrice,required:!0})}),u.jsx(i,{xs:6,children:u.jsx(S,{size:"small",label:"قیمت وزن سقف (ریال)",name:"maxPrice",value:c.values.maxPrice,onChange:c.handleChange,error:c.touched.maxPrice&&!!c.errors.maxPrice,helperText:c.touched.maxPrice&&c.errors.maxPrice,required:!0})})]}),u.jsx(i,{container:!0,xs:12,md:2,children:u.jsx(R,{disabled:!c.isValid||c.values.maxPrice{e(fe({approved:!0,lowest_price:c.values.minPrice,highest_price:c.values.maxPrice,lowest_weight:c.values.minWeight,highest_weight:c.values.maxWeight})).then(h=>{h.error?t({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},children:"ارسال"})})]})]}),u.jsxs(i,{container:!0,xs:12,alignItems:"center",justifyContent:"space-between",mt:2,children:[u.jsx(le,{style:{width:"100%",backgroundColor:"black",marginBottom:"20px"}}),u.jsx(vt,{approvedState:r}),u.jsx(le,{style:{width:"100%",backgroundColor:"black",marginBottom:"20px"}}),u.jsx(jt,{approvedState:n})]})]})},Ft=P("GET_MIN_MAX_AGE_STATE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.get("chicken-age-range/");return t(g()),{data:r,status:a}}),Fe=P("PROVINCE_EDIT_MIN_MAX_AGE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.put("chicken-age-range/0/",e);return t(g()),{data:r,status:a}}),Et=()=>{const e=k(),[t]=C.useContext(D),[r,a]=C.useState("inactive"),[n,o]=C.useState();C.useEffect(()=>{e(Ft()).then(c=>{var d;o(c.payload.data),(d=c.payload.data)!=null&&d.active&&a("active")})},[]);const l=H({initialValues:{minAge:"",maxAge:""},validationSchema:M({minAge:N().required("این فیلد اجباری است"),maxAge:N().required("این فیلد اجباری است")})});C.useEffect(()=>{l.validateForm()},[]),C.useEffect(()=>{n!=null&&n.minimum&&(l.setFieldValue("minAge",n==null?void 0:n.minimum),l.setFieldValue("maxAge",n==null?void 0:n.maximum),l.validateForm())},[n]);const s=c=>{a(c.target.value)};return u.jsxs(i,{container:!0,xs:12,gap:2,alignItems:"center",justifyContent:"space-between",isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(w,{variant:"body1",children:"حداقل و حداکثر سن کشتار"}),u.jsx(Q,{children:u.jsxs(Z,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:r,onChange:s,row:!0,children:[u.jsx(v,{value:"active",control:u.jsx(I,{}),label:"فعال"}),u.jsx(v,{onClick:()=>{e(Fe({active:!1})).then(c=>{c.error?t({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},value:"inactive",control:u.jsx(I,{}),label:"غیر فعال"})]})}),r==="active"&&u.jsxs(u.Fragment,{children:[u.jsxs(i,{container:!0,xs:12,children:[u.jsx(i,{xs:6,children:u.jsx(S,{size:"small",label:"حداقل سن کشتار",name:"minAge",value:l.values.minAge,onChange:l.handleChange,error:l.touched.minAge&&!!l.errors.minAge,helperText:l.touched.minAge&&l.errors.minAge,required:!0})}),u.jsx(i,{xs:6,children:u.jsx(S,{size:"small",label:"حداکثر سن کشتار",name:"maxAge",value:l.values.maxAge,onChange:l.handleChange,error:l.touched.maxAge&&!!l.errors.maxAge,helperText:l.touched.maxAge&&l.errors.maxAge,required:!0})})]}),u.jsx(i,{container:!0,xs:12,md:2,children:u.jsx(R,{disabled:!l.isValid,variant:"contained",onClick:()=>{e(Fe({active:!0,maximum:parseInt(l.values.maxAge),minimum:parseInt(l.values.minAge)})).then(c=>{c.error?t({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},children:"ارسال"})})]})]})},bt=P("GET_MIN_MAX_AGE_STATE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.get("time-range/");return t(g()),{data:r,status:a}}),Ee=P("PROVINCE_POLICY_EDIT_TIME_RANGE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.put("time-range/0/",e);return t(g()),{data:r,status:a}}),nu=({value:e="",onChange:t,label:r="زمان",disabled:a=!1,className:n=""})=>{const[o,l]=C.useState(e),[s,c]=C.useState(!1),d=C.useRef(null),h=Array.from({length:24},(f,B)=>B.toString().padStart(2,"0")),y=Array.from({length:12},(f,B)=>(B*5).toString().padStart(2,"0"));C.useEffect(()=>{l(e)},[e]);const[A,F]=o?o.split(":"):"",x=A||"00",p=F||"00";C.useEffect(()=>{const f=B=>{d.current&&!d.current.contains(B.target)&&c(!1)};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[]);const j=f=>{const B=`${f}:${p}:00`;l(B),t(B)},E=f=>{const B=`${x}:${f}:00`;l(B),t(B),c(!1)},T=f=>{const B=f.target.value;if((/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/.test(B)||B==="")&&(l(B),B.includes(":")&&B.length===5)){const U=`${B}:00`;t(U)}},O=()=>{(!o.includes(":")||o.length!==5)&&l(x+":"+p)};return u.jsxs("div",{className:`time-picker ${n}`,ref:d,children:[u.jsx(w,{children:r&&u.jsx("label",{className:"time-picker-label",children:r})}),u.jsxs("div",{className:"time-picker-input-container",children:[u.jsx("input",{type:"text",value:o.slice(0,5),onChange:T,onBlur:O,onFocus:()=>c(!0),placeholder:"hh:mm",className:"time-picker-input",disabled:a,"aria-haspopup":"listbox","aria-expanded":s}),u.jsx("button",{type:"button",className:"time-picker-toggle",onClick:()=>c(!s),disabled:a,"aria-label":"Toggle time picker",children:u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10"}),u.jsx("polyline",{points:"12 6 12 12 16 14"})]})})]}),s&&u.jsxs("div",{className:"time-picker-dropdown",children:[u.jsxs("div",{className:"time-picker-column",children:[u.jsx("div",{className:"time-picker-header",children:"دقیقه"}),u.jsx("div",{className:"time-picker-list",children:y.map(f=>u.jsx("button",{type:"button",className:`time-picker-item ${f===p?"selected":""}`,onClick:()=>E(f),children:f},f))})]}),u.jsxs("div",{className:"time-picker-column",children:[u.jsx("div",{className:"time-picker-header",children:"ساعت"}),u.jsx("div",{className:"time-picker-list",children:h.map(f=>u.jsx("button",{type:"button",className:`time-picker-item ${f===x?"selected":""}`,onClick:()=>j(f),children:f},f))})]})]})]})},St=()=>{const e=k(),[t]=C.useContext(D),[r,a]=C.useState([{start:"01:00:00",end:"24:00:00",name:"poultry_request",active:!0},{start:"01:00:00",end:"24:00:00",name:"kill_request",active:!1},{start:"01:00:00",end:"24:00:00",name:"province_kill_request",active:!1},{start:"01:00:00",end:"24:00:00",name:"kill_house_request",active:!1},{start:"01:00:00",end:"24:00:00",name:"vet_farm_check_request",active:!1}]);C.useEffect(()=>{e(bt()).then(o=>{const l=o.payload.data.timeRange;a(s=>s.map(c=>{const d=l.find(h=>h.name===c.name);return d?{...c,...d}:c}))})},[]);const n=o=>{let l="درخواست کشتار مرغدار";switch(o){case"poultry_request":l="درخواست کشتار مرغدار";break;case"kill_request":l="ثبت اعلام نیاز کشتارگاه";break;case"province_kill_request":l="تخصیص استان به کشتارگاه";break;case"kill_house_request":l="ایجاد بار کشتارگاه";break;case"vet_farm_check_request":l="ثبت کد قرنطینه";break}return l};return u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"start",sx:{background:"#EAEFFF",borderRadius:"15px"},children:u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"start",gap:2,my:2,children:r==null?void 0:r.map((o,l)=>u.jsxs(i,{container:!0,xs:12,alignItems:"center",justifyContent:"start",gap:2,isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(w,{sx:{color:"rgba(0, 0, 0, 0.6)"},children:n(o==null?void 0:o.name)}),u.jsxs(i,{container:!0,xs:12,alignItems:"end",justifyContent:"start",children:[u.jsx(i,{container:!0,direction:"column",children:u.jsx(Q,{children:u.jsxs(Z,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:o.active,onChange:s=>{const c=r.map((d,h)=>h===l?{...d,active:s.target.value==="true"}:d);a(c),s.target.value==="false"&&e(Ee({time_range:c})).then(d=>{d.payload.error?t({vertical:"top",horizontal:"center",msg:d.payload.error,severity:"error"}):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},row:!0,children:[u.jsx(v,{value:!0,control:u.jsx(I,{}),label:"فعال"}),u.jsx(v,{value:!1,control:u.jsx(I,{}),label:"غیر فعال"})]})})}),r[l].active===!0&&u.jsxs(i,{container:!0,justifyContent:"start",alignItems:"start",gap:1,mt:1,children:[u.jsx(i,{children:u.jsx(nu,{value:o==null?void 0:o.start,onChange:s=>{const c=r;c[l].start=s,a(c)},label:"از"})}),u.jsx(i,{children:u.jsx(nu,{value:o==null?void 0:o.end,onChange:s=>{const c=r;c[l].end=s,a(c)},label:"تا"})})]}),r[l].active===!0&&u.jsx(i,{container:!0,mt:1,children:u.jsx(R,{variant:"contained",disabled:(o==null?void 0:o.end)<(o==null?void 0:o.start),onClick:()=>{e(Ee({time_range:r})).then(s=>{s.payload.error?t({vertical:"top",horizontal:"center",msg:s.payload.error,severity:"error"}):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},children:"ارسال"})})]})]},l))})})},kt=P("PROVINCE_POLICY_GET_PAYMENT_FRACTIONS",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.get("payment-gateway-percentage/");return t(g()),{data:r,status:a}}),Pt=P("PROVINCE_POLICY_EDIT_PAYMENT_FRACTIONS",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.put("payment-gateway-percentage/0/",e);return t(g()),{data:r,status:a}}),It=()=>{const e=k(),[t]=C.useContext(D),[r,a]=C.useState(),n=H({initialValues:{website:"",union:"",guilds:"",other:""},validationSchema:M({website:N().required("این فیلد اجباری است!").min(0,"درصدی بیش از 0 وارد کنید!"),union:N().required("این فیلد اجباری است!").min(0,"درصدی بیش از 0 وارد کنید!"),guilds:N().required("این فیلد اجباری است!").min(0,"درصدی بیش از 0 وارد کنید!"),other:N().required("این فیلد اجباری است!").min(0,"درصدی بیش از 0 وارد کنید!")}),onSubmit:o=>{e(Pt({company:o.website,union:o.union,guilds:o.guilds,other:o.other})).then(l=>{l.payload.error?t({vertical:"top",horizontal:"center",msg:l.error,severity:"error"}):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})}});return C.useEffect(()=>{n.validateForm()},[]),C.useEffect(()=>{e(kt()).then(o=>{a(o.payload.data)})},[]),C.useEffect(()=>{(r!=null&&r.company||r!=null&&r.guilds||r!=null&&r.union)&&(n.setFieldValue("website",r.company),n.setFieldValue("union",r.union),n.setFieldValue("guilds",r.guilds),n.setFieldValue("other",r.other))},[r]),u.jsx("form",{onSubmit:n.handleSubmit,children:u.jsxs(su,{container:!0,spacing:2,alignItems:"center",children:[u.jsx(su,{container:!0,item:!0,xs:12,children:u.jsx(w,{variant:"body1",gutterBottom:!0,children:"سهم بندی کارمزدها"})}),u.jsx(su,{item:!0,xs:12,sm:3,md:2,children:u.jsx(S,{fullWidth:!0,id:"website",name:"website",label:"سامانه",value:n.values.website,onChange:n.handleChange,onBlur:n.handleBlur,error:n.touched.website&&!!n.errors.website,helperText:n.touched.website&&n.errors.website})}),u.jsx(su,{item:!0,xs:12,sm:3,md:2,children:u.jsx(S,{fullWidth:!0,id:"union",name:"union",label:"اتحادیه",value:n.values.union,onChange:n.handleChange,onBlur:n.handleBlur,error:n.touched.union&&!!n.errors.union,helperText:n.touched.union&&n.errors.union})}),u.jsx(su,{item:!0,xs:12,sm:3,md:2,children:u.jsx(S,{fullWidth:!0,id:"guilds",name:"guilds",label:"اصناف",value:n.values.guilds,onChange:n.handleChange,onBlur:n.handleBlur,error:n.touched.guilds&&!!n.errors.guilds,helperText:n.touched.guilds&&n.errors.guilds})}),u.jsx(su,{item:!0,xs:12,sm:3,md:2,children:u.jsx(S,{fullWidth:!0,id:"other",name:"other",label:"سایر",value:n.values.other,onChange:n.handleChange,onBlur:n.handleBlur,error:n.touched.other&&!!n.errors.other,helperText:n.touched.other&&n.errors.other})}),u.jsx(su,{item:!0,xs:12,sm:3,md:2,children:u.jsxs(w,{variant:"body1",color:"primary",children:["مجموع:"," ",Number(n.values.guilds)+Number(n.values.union)+Number(n.values.website)+Number(n.values.other)," ","درصد"]})}),u.jsx(su,{item:!0,xs:12,md:3,children:u.jsx(R,{disabled:!n.isValid||Number(n.values.guilds)+Number(n.values.union)+Number(n.values.website)+Number(n.values.other)>100,variant:"contained",color:"primary",type:"submit",fullWidth:!0,children:"ثبت"})})]})})},wt=P("PROVINCE_GET_FREE_SALE_STATUS",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.get("poultry-out-province-request/");return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),be=P("PROVINCE_EDIT_FREE_SALE_STATE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.put("poultry-out-province-request/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),Tt=()=>{const[e,t]=C.useState(!1),[r,a]=C.useState(!1),n=k(),[o]=C.useContext(D),l=H({initialValues:{maxLimit:""},validationSchema:M({maxLimit:N().required("این فیلد اجباری است").max(100,"درصدی بین 1 تا 100 وارد کنید!").min(1,"درصدی بین 1 تا 100 وارد کنید!")})}),s=()=>{n(wt()).then(c=>{t(c.payload.data.allow),c.payload.data.limitationStatus&&a(!0),l.setFieldValue("maxLimit",c.payload.data.limitation)})};return C.useEffect(()=>{s()},[]),C.useEffect(()=>{l.validateForm()},[]),u.jsxs(i,{container:!0,alignItems:"center",gap:2,justifyContent:"space-between",isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(i,{children:u.jsx(w,{variant:"body1",children:"حداکثر فروش به خارج استان"})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"item6",checked:e,onClick:()=>{t(!0)}}),label:"فعال"}),u.jsx(v,{control:u.jsx(I,{checked:!e,onClick:()=>{n(be({allow:!1})).then(c=>{c.payload.error?o({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(s(),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},name:"item6"}),label:"بدون محدودیت"})]}),e&&u.jsxs(u.Fragment,{children:[u.jsx(i,{children:u.jsx(v,{control:u.jsx(z,{checked:r,onChange:()=>a(!r),color:"primary"}),label:"درصد محدودیت جوجه ریزی"})}),r&&u.jsx(i,{children:u.jsx(S,{size:"small",label:"درصد محدودیت",name:"maxLimit",value:l.values.maxLimit,onChange:l.handleChange,error:l.touched.maxLimit&&!!l.errors.maxLimit,helperText:l.touched.maxLimit&&l.errors.maxLimit,required:!0})}),u.jsx(i,{children:u.jsx(R,{disabled:r?!l.isValid:!1,variant:"contained",onClick:()=>{n(be({allow:!0,limitation_status:!!r,limitation:l.values.maxLimit})).then(c=>{c.payload.error?o({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(s(),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت"})})]})]})},Se=P("PROVINCE_EDIT_EXPORT_STATE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.put("poultry-export/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),Rt=()=>{const[e,t]=C.useState(!1),[r,a]=C.useState(!1),n=k(),[o]=C.useContext(D),l=H({initialValues:{maxLimit:""},validationSchema:M({maxLimit:N().required("این فیلد اجباری است").max(100,"درصدی بین 1 تا 100 وارد کنید!").min(1,"درصدی بین 1 تا 100 وارد کنید!")})}),s=()=>{n(r6()).then(c=>{t(c.payload.data.allow),l.setFieldValue("maxLimit",c.payload.data.limitation)})};return C.useEffect(()=>{s()},[]),C.useEffect(()=>{l.validateForm()},[]),u.jsxs(i,{container:!0,alignItems:"center",gap:2,justifyContent:"space-between",isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(i,{children:u.jsx(w,{variant:"body1",children:"مجوز صادرات"})}),u.jsxs(i,{container:!0,xs:12,children:[u.jsx(v,{control:u.jsx(I,{name:"item6",checked:e,onClick:()=>{t(!0)}}),label:"فعال"}),u.jsx(v,{control:u.jsx(I,{checked:!e,onClick:()=>{n(Se({allow:!1})).then(c=>{c.payload.error?o({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(s(),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},name:"item6"}),label:"غیر فعال"})]}),e&&u.jsxs(u.Fragment,{children:[u.jsx(i,{children:u.jsx(v,{control:u.jsx(z,{checked:r,onChange:()=>a(!r),color:"primary"}),label:"درصد محدودیت جوجه ریزی"})}),r&&u.jsx(i,{children:u.jsx(S,{size:"small",label:"درصد محدودیت",name:"maxLimit",value:l.values.maxLimit,onChange:l.handleChange,error:l.touched.maxLimit&&!!l.errors.maxLimit,helperText:l.touched.maxLimit&&l.errors.maxLimit,required:!0})}),u.jsx(i,{children:u.jsx(R,{disabled:r?!l.isValid:!1,variant:"contained",onClick:()=>{n(Se({allow:!0,limitation_status:!!r,limitation:l.values.maxLimit})).then(c=>{c.payload.error?o({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(s(),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت"})})]})]})},Dt=()=>{const[e,t]=C.useState(!1),r=k(),[a]=C.useContext(D),n=H({initialValues:{maxLimit:""},validationSchema:M({maxLimit:N().required("این فیلد اجباری است")})}),o=()=>{r(s6()).then(l=>{t(l.payload.data.allow),n.setFieldValue("maxLimit",l.payload.data.limitation)})};return C.useEffect(()=>{o()},[]),C.useEffect(()=>{n.validateForm()},[]),u.jsxs(i,{container:!0,alignItems:"center",gap:2,justifyContent:"space-between",isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(i,{children:u.jsx(w,{variant:"body1",children:"مجوز ادغام بار (کد قرنطینه) "})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"item6",checked:e,onClick:()=>{t(!0)}}),label:"فعال"}),u.jsx(v,{control:u.jsx(I,{checked:!e,onClick:()=>{r(pe({allow:!1})).then(l=>{l.payload.error?a({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(o(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},name:"item6"}),label:"غیر فعال"})]}),e&&u.jsxs(u.Fragment,{children:[u.jsx(i,{children:u.jsx(S,{size:"small",label:"میزان محدودیت (براساس تعداد)",name:"maxLimit",value:n.values.maxLimit,onChange:n.handleChange,error:n.touched.maxLimit&&!!n.errors.maxLimit,helperText:n.touched.maxLimit&&n.errors.maxLimit,required:!0})}),u.jsx(i,{children:u.jsx(R,{disabled:!n.isValid,variant:"contained",onClick:()=>{r(pe({allow:!0,limitation:n.values.maxLimit})).then(l=>{l.payload.error?a({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(o(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت"})})]})]})},Ot=()=>{const[e,t]=C.useState(!1),r=k(),[a]=C.useContext(D),n=H({initialValues:{maxLimit:""},validationSchema:M({maxLimit:N().required("این فیلد اجباری است")})}),o=()=>{r(o6()).then(l=>{t(l.payload.data.allow),n.setFieldValue("maxLimit",l.payload.data.limitation)})};return C.useEffect(()=>{o()},[]),C.useEffect(()=>{n.validateForm()},[]),u.jsxs(i,{container:!0,alignItems:"center",gap:2,justifyContent:"space-between",isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(i,{children:u.jsx(w,{variant:"body1",children:"حداکثر حجم بار تخصیصی به خودرو"})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"item6",checked:e,onClick:()=>{t(!0)}}),label:"فعال"}),u.jsx(v,{control:u.jsx(I,{checked:!e,onClick:()=>{r(xe({allow:!1})).then(l=>{l.payload.error?a({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(o(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},name:"item6"}),label:"غیر فعال"})]}),e&&u.jsxs(u.Fragment,{children:[u.jsx(i,{children:u.jsx(S,{size:"small",label:"میزان محدودیت (براساس تعداد)",name:"maxLimit",value:n.values.maxLimit,onChange:n.handleChange,error:n.touched.maxLimit&&!!n.errors.maxLimit,helperText:n.touched.maxLimit&&n.errors.maxLimit,required:!0})}),u.jsx(i,{children:u.jsx(R,{fullWidth:!0,disabled:!n.isValid,variant:"contained",onClick:()=>{r(xe({allow:!0,limitation:n.values.maxLimit})).then(l=>{l.payload.error?a({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(o(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت"})})]})]})},Lt=()=>{const[e,t]=C.useState(!1),r=k(),[a]=C.useContext(D),n=()=>{r(l6()).then(o=>{t(o.payload.data.allow)})};return C.useEffect(()=>{n()},[]),u.jsxs(i,{container:!0,alignItems:"center",gap:2,justifyContent:"space-between",isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(i,{children:u.jsx(w,{variant:"body1",children:"ثبت قیمت خرید توسط کشتارگاه"})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"item6",checked:e,onClick:()=>{t(!0),r(ge({allow:!0})).then(o=>{o.payload.error?a({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(n(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}),label:"فعال"}),u.jsx(v,{control:u.jsx(I,{checked:!e,name:"item6",onClick:()=>{t(!1),r(ge({allow:!1})).then(o=>{o.payload.error?a({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(n(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}),label:"غیر فعال"})]})]})},Nt=P("GET_AUTO_DIRECT_BUYING",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.get("automatic-direct-buying-permission/");return t(g()),{data:r,status:a}}),ke=P("PROVINCE_AUTO_DIRECT_BUYING",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.put("automatic-direct-buying-permission/0/",e);return t(g()),{data:r,status:a}}),Bt=()=>{const e=k(),[t]=C.useContext(D),[r,a]=C.useState("inactive"),[n,o]=C.useState();C.useEffect(()=>{e(Nt()).then(c=>{var d;o(c.payload.data),(d=c.payload.data)!=null&&d.allow&&a("active")})},[]);const l=H({initialValues:{hour:"",hour2:"",minute:"",minute2:""},validationSchema:M({hour:$().required("این فیلد اجباری است"),hour2:$().required("این فیلد اجباری است")})});C.useEffect(()=>{l.validateForm()},[]),C.useEffect(()=>{n!=null&&n.allow&&(l.setFieldValue("hour",n==null?void 0:n.startTime),l.setFieldValue("hour2",n==null?void 0:n.endTime),l.validateForm())},[n]);const s=c=>{a(c.target.value)};return u.jsxs(i,{container:!0,xs:12,alignItems:"center",justifyContent:"start",isPolicy:!0,gap:2,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(w,{sx:{color:"rgba(0, 0, 0, 0.6)"},children:"تایید خودکار خرید مستقیم"}),u.jsxs(i,{container:!0,xs:12,alignItems:"end",justifyContent:"start",children:[u.jsx(i,{container:!0,direction:"column",children:u.jsx(Q,{children:u.jsxs(Z,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:r,onChange:s,row:!0,children:[u.jsx(v,{value:"active",control:u.jsx(I,{}),label:"فعال"}),u.jsx(v,{onClick:()=>{e(ke({allow:!1})).then(c=>{c.error?t({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},value:"inactive",control:u.jsx(I,{}),label:"غیر فعال"})]})})}),r==="active"&&u.jsxs(i,{container:!0,justifyContent:"start",alignItems:"start",gap:1,mt:1,children:[u.jsx(i,{children:u.jsx(nu,{value:l.values.hour,onChange:c=>{l.setFieldValue("hour",c)},label:"از"})}),u.jsx(i,{children:u.jsx(nu,{value:l.values.hour2,onChange:c=>{l.setFieldValue("hour2",c)},label:"تا"})})]})]}),r==="active"&&u.jsx(i,{container:!0,children:u.jsx(R,{variant:"contained",disabled:!l.isValid||l.values.hour>l.values.hour2,onClick:()=>{e(ke({allow:!0,start_time:l.values.hour,end_time:l.values.hour2})).then(c=>{c.error?t({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},children:"ارسال"})})]})},zt=()=>{const[e,t]=C.useState(!1),r=k(),[a]=C.useContext(D),n=()=>{r(t6()).then(o=>{t(o.payload.data.poultryStatus)})};return C.useEffect(()=>{n()},[]),u.jsxs(i,{container:!0,alignItems:"center",gap:2,justifyContent:"space-between",isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(i,{children:u.jsx(w,{variant:"body1",children:"احراز پیامکی قیمت مرغ برای مرغدار"})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"item6",checked:e,onClick:()=>{t(!0),r(de({poultry_status:!0})).then(o=>{o.payload.error?a({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(n(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}),label:"فعال"}),u.jsx(v,{control:u.jsx(I,{checked:!e,name:"item6",onClick:()=>{t(!1),r(de({poultry_status:!1})).then(o=>{o.payload.error?a({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(n(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}),label:"غیر فعال"})]})]})},Ut=P("PROVINCE_EDIT_DROP_LIMITED_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.put("/drop-limit/0/",e);return t(g()),{data:r,status:a}}),Vt=()=>{const e=k(),[t]=C.useContext(D),[r,a]=C.useState();C.useEffect(()=>{e(i6()).then(o=>{a(o.payload.data)})},[]);const n=H({initialValues:{limitDown:"",limitUp:""},validationSchema:M({limitDown:N().required("این فیلد اجباری است").min(0,"حداقل مقدار باید 0 باشد").max(100,"حداکثر مقدار باید 100 باشد"),limitUp:N().required("این فیلد اجباری است").min(0,"حداقل مقدار باید 0 باشد").max(100,"حداکثر مقدار باید 100 باشد")})});return C.useEffect(()=>{n.validateForm()},[]),C.useEffect(()=>{r!=null&&r.killHouseLimitPercentDown&&(n.setFieldValue("limitDown",r==null?void 0:r.killHouseLimitPercentDown),n.setFieldValue("limitUp",r==null?void 0:r.killHouseLimitPercentUp),n.validateForm())},[r]),u.jsxs(i,{container:!0,xs:12,gap:2,alignItems:"center",justifyContent:"space-between",sx:{width:"370px"},isPolicy:!0,children:[u.jsx(w,{variant:"body1",children:"حداقل و حداکثرافت برای کشتارگاه"}),u.jsxs(i,{container:!0,xs:12,children:[u.jsx(i,{xs:6,children:u.jsx(S,{size:"small",label:"حداقل افت کشتار (درصد)",name:"limitDown",value:n.values.limitDown,onChange:n.handleChange,error:n.touched.limitDown&&!!n.errors.limitDown,helperText:n.touched.limitDown&&n.errors.limitDown,required:!0,type:"number",inputProps:{min:0,max:100}})}),u.jsx(i,{xs:6,children:u.jsx(S,{size:"small",label:"حداکثر افت کشتار (درصد)",name:"limitUp",value:n.values.limitUp,onChange:n.handleChange,error:n.touched.limitUp&&!!n.errors.limitUp,helperText:n.touched.limitUp&&n.errors.limitUp,required:!0,type:"number",inputProps:{min:0,max:100}})})]}),u.jsx(i,{container:!0,xs:12,md:2,children:u.jsx(R,{disabled:!n.isValid,variant:"contained",onClick:()=>{e(Ut({active:!0,kill_house_limit_percent_up:parseInt(n.values.limitUp),kill_house_limit_percent_down:parseInt(n.values.limitDown)})).then(o=>{o.error?t({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},children:"ارسال"})})]})},qt=()=>{const[e,t]=C.useState(!1),r=k(),[a]=C.useContext(D),n=()=>{r(Ru()).then(o=>{t(o.payload.data.killHouseAllocation)})};return C.useEffect(()=>{n()},[]),u.jsxs(i,{container:!0,alignItems:"center",gap:2,justifyContent:"space-between",isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(i,{children:u.jsx(w,{variant:"body1",children:"سند توزیع داخل استان کشتارگاه"})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"item6",checked:e,onClick:()=>{t(!0),r(hu({kill_house_allocation:!0})).then(o=>{o.payload.error?a({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(n(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}),label:"اجباری"}),u.jsx(v,{control:u.jsx(I,{checked:!e,name:"item6",onClick:()=>{t(!1),r(hu({kill_house_allocation:!1})).then(o=>{o.payload.error?a({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(n(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}),label:"اختیاری"})]})]})},Mt=()=>{const[e,t]=C.useState(!1),r=k(),[a]=C.useContext(D),n=()=>{r(Ru()).then(o=>{t(o.payload.data.killHouseFreeSale)})};return C.useEffect(()=>{n()},[]),u.jsxs(i,{container:!0,alignItems:"center",gap:2,justifyContent:"space-between",isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(i,{children:u.jsx(w,{variant:"body1",children:"سند توزیع خارج استان کشتارگاه"})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"item6",checked:e,onClick:()=>{t(!0),r(hu({kill_house_free_sale:!0})).then(o=>{o.payload.error?a({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(n(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}),label:"اجباری"}),u.jsx(v,{control:u.jsx(I,{checked:!e,name:"item6",onClick:()=>{t(!1),r(hu({kill_house_free_sale:!1})).then(o=>{o.payload.error?a({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(n(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}),label:"اختیاری"})]})]})},Ht=()=>{const[e,t]=C.useState(!1),r=k(),[a]=C.useContext(D),n=()=>{r(Ru()).then(o=>{t(o.payload.data.stewardAllocation)})};return C.useEffect(()=>{n()},[]),u.jsxs(i,{container:!0,alignItems:"center",gap:2,justifyContent:"space-between",isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(i,{children:u.jsx(w,{variant:"body1",children:"سند توزیع داخل استان مباشر"})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"item6",checked:e,onClick:()=>{t(!0),r(hu({steward_allocation:!0})).then(o=>{o.payload.error?a({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(n(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}),label:"اجباری"}),u.jsx(v,{control:u.jsx(I,{checked:!e,name:"item6",onClick:()=>{t(!1),r(hu({steward_allocation:!1})).then(o=>{o.payload.error?a({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(n(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}),label:"اختیاری"})]})]})},Wt=()=>{const[e,t]=C.useState(!1),r=k(),[a]=C.useContext(D),n=()=>{r(Ru()).then(o=>{t(o.payload.data.steward_free_sale)})};return C.useEffect(()=>{n()},[]),u.jsxs(i,{container:!0,alignItems:"center",gap:2,justifyContent:"space-between",isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(i,{children:u.jsx(w,{variant:"body1",children:"سند توزیع خارج استان مباشر"})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"item6",checked:e,onClick:()=>{t(!0),r(hu({steward_free_sale:!0})).then(o=>{o.payload.error?a({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(n(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}),label:"اجباری"}),u.jsx(v,{control:u.jsx(I,{checked:!e,name:"item6",onClick:()=>{t(!1),r(hu({steward_free_sale:!1})).then(o=>{o.payload.error?a({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(n(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}),label:"اختیاری"})]})]})},Gt=P("DIRECT_EDIT_BUYING_VERIFICATION",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.put("direct-buying-verification/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),Pe=P("DIRECT_BUYING_VERIFICATION",async()=>{const{data:e,status:t}=await _.get("direct-buying-verification/");return{data:e,status:t}}),Ie=P("PAYMENT_EDIT_DEADLINES",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.put("direct-buying-verification/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),$t=()=>{const e=k(),[t]=C.useContext(D),[r,a]=C.useState(!1),[n,o]=C.useState(!1),l=H({initialValues:{payment_deadline_days:""},validationSchema:M({payment_deadline_days:N().required("این فیلد اجباری است").min(0,"حداقل مقدار باید 0 باشد").max(100,"حداکثر مقدار باید 100 باشد")})});C.useEffect(()=>{e(Pe()).then(h=>{var A;const y=(A=h.payload.data)==null?void 0:A.poultryCodeMandatory;a(y)}),e(c6()).then(h=>{var A,F,x,p;const y=((F=(A=h.payload)==null?void 0:A.data)==null?void 0:F.paymentDeadline)??!1;o(y),y&&((p=(x=h.payload)==null?void 0:x.data)!=null&&p.paymentDeadlineDays)&&l.setFieldValue("payment_deadline_days",h.payload.data.paymentDeadlineDays)})},[]);const s=h=>{e(Gt({poultry_code_mandatory:h})).then(()=>{e(Pe()).then(y=>{var A,F;a((F=(A=y.payload)==null?void 0:A.data)==null?void 0:F.poultryCodeMandatory)})})},c=h=>{const y=h===!0;y||e(Ie({payment_deadline:!1,payment_deadline_days:0})).then(A=>{A.error?t({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):t({vertical:"top",horizontal:"center",msg:"غیرفعال شد.",severity:"success"})}),o(y)},d=()=>{e(Ie({payment_deadline:!0,payment_deadline_days:parseInt(l.values.payment_deadline_days)})).then(h=>{h.error?t({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):t({vertical:"top",horizontal:"center",msg:"تنظیمات با موفقیت ذخیره شد.",severity:"success"})})};return u.jsxs(u.Fragment,{children:[u.jsxs(i,{container:!0,alignItems:"center",isPolicy:!0,gap:2,sx:{width:{xs:"100%",sm:"48%",lg:"19%"}},children:[u.jsx(w,{variant:"body1",children:"ثبت کداحراز خرید مستقیم مرغدار"}),u.jsxs(i,{xs:12,container:!0,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"item6",checked:r===!0,onClick:()=>{s(!0)}}),label:"اجباری"}),u.jsx(v,{control:u.jsx(I,{checked:r===!1,onClick:()=>{s(!1)},name:"item6"}),label:"اختیاری"})]})]}),u.jsxs(i,{container:!0,alignItems:"center",isPolicy:!0,gap:2,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(w,{variant:"body1",children:"حداکثر مهلت تسویه با مرغدار"}),u.jsxs(i,{xs:12,container:!0,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"item6",checked:n===!0,onClick:()=>c(!0)}),label:"فعال"}),u.jsx(v,{control:u.jsx(I,{checked:n===!1,onClick:()=>c(!1),name:"item6"}),label:"غیر فعال"})]}),n!==!1&&u.jsxs(u.Fragment,{children:[u.jsx(i,{xs:12,children:u.jsx(S,{size:"small",label:"تعداد روز",name:"payment_deadline_days",value:l.values.payment_deadline_days,onChange:l.handleChange,error:l.touched.payment_deadline_days&&!!l.errors.payment_deadline_days,helperText:l.touched.payment_deadline_days&&l.errors.payment_deadline_days,required:!0,type:"number",inputProps:{min:0,max:100}})}),u.jsx(i,{container:!0,xs:12,md:2,children:u.jsx(R,{variant:"contained",disabled:!l.values.payment_deadline_days||l.errors.payment_deadline_days,onClick:d,children:"ارسال"})})]})]})]})},Kt={start_time:"01:00:00",end_time:"24:00:00",allow:!1},Yt=()=>{const e=k(),[t]=C.useContext(D),[r,a]=C.useState(Kt);C.useEffect(()=>{e(C6()).then(l=>{const s=l.payload.data;a({start_time:s.startTime,end_time:s.endTime,allow:s.allow})})},[e]);const n=l=>{const s=l.target.value==="true",c={...r,allow:s};a(c),s||e(Ae({allow:!1})).then(d=>{var h;(h=d.payload)!=null&&h.error?t({vertical:"top",horizontal:"center",msg:d.payload.error,severity:"error"}):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},o=()=>{e(Ae(r)).then(l=>{var s;(s=l.payload)!=null&&s.error?t({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})};return u.jsxs(i,{container:!0,xs:12,alignItems:"center",justifyContent:"start",gap:2,isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(w,{sx:{color:"rgba(0, 0, 0, 0.6)"},children:"بازه نمایش معاملات"}),u.jsxs(i,{container:!0,xs:12,alignItems:"end",justifyContent:"start",children:[u.jsx(i,{container:!0,direction:"column",children:u.jsx(Q,{children:u.jsxs(Z,{"aria-labelledby":"time-range-active",name:"time-range-active",value:String(r.allow),onChange:n,row:!0,children:[u.jsx(v,{value:"true",control:u.jsx(I,{}),label:"فعال"}),u.jsx(v,{value:"false",control:u.jsx(I,{}),label:"غیر فعال"})]})})}),r.allow&&u.jsxs(i,{container:!0,justifyContent:"start",alignItems:"start",gap:1,mt:1,children:[u.jsx(i,{children:u.jsx(nu,{value:r.start_time,onChange:l=>a(s=>({...s,start_time:l})),label:"از"})}),u.jsx(i,{children:u.jsx(nu,{value:r.end_time,onChange:l=>a(s=>({...s,end_time:l})),label:"تا"})})]}),r.allow&&u.jsx(i,{container:!0,mt:1,children:u.jsx(R,{variant:"contained",disabled:r.end_time{const[e,t]=C.useState(!1),[r,a]=C.useState(null),n=k(),[o]=C.useContext(D);C.useEffect(()=>{(async()=>{try{n(b());const c=await _.get("/allow_register_code_for_steward_free_sale_bar_information");c.data&&(t(c.data.active),a(c.data.id)),n(g())}catch(c){console.error("Error fetching data:",c),n(g())}})()},[n]);const l=async s=>{if(r!==null)try{n(b()),await _.put(`/allow_register_code_for_steward_free_sale_bar_information/${r}/`,{active:s}),t(s),o({vertical:"top",horizontal:"center",msg:"تغییرات با موفقیت ثبت شد",severity:"success"}),n(g())}catch(c){console.error("Error updating data:",c),o({vertical:"top",horizontal:"center",msg:"خطا در ثبت تغییرات",severity:"error"}),n(g())}};return u.jsxs(i,{container:!0,alignItems:"center",isPolicy:!0,gap:2,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(w,{variant:"body1",children:"اجباری بودن کد احراز مباشر"}),u.jsxs(i,{xs:12,container:!0,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"supervisor-authentication",checked:e===!0,onClick:()=>l(!0)}),label:"فعال"}),u.jsx(v,{control:u.jsx(I,{name:"supervisor-authentication",checked:e===!1,onClick:()=>l(!1)}),label:"غیر فعال"})]})]})},Xt=()=>{const[e,t]=C.useState(!1),[r,a]=C.useState(null),n=k(),[o]=C.useContext(D);C.useEffect(()=>{(async()=>{try{n(b());const c=await _.get("/allow_register_code_for_kill_house_free_sale_bar_information");c.data&&(t(c.data.active),a(c.data.id)),n(g())}catch(c){console.error("Error fetching data:",c),n(g())}})()},[n]);const l=async s=>{if(r!==null)try{n(b()),await _.put(`/allow_register_code_for_kill_house_free_sale_bar_information/${r}/`,{active:s}),t(s),o({vertical:"top",horizontal:"center",msg:"تغییرات با موفقیت ثبت شد",severity:"success"}),n(g())}catch(c){console.error("Error updating data:",c),o({vertical:"top",horizontal:"center",msg:"خطا در ثبت تغییرات",severity:"error"}),n(g())}};return u.jsxs(i,{container:!0,alignItems:"center",isPolicy:!0,gap:2,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(w,{variant:"body1",children:"اجباری بودن کد احراز کشتارگاه"}),u.jsxs(i,{xs:12,container:!0,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"slaughterhouse-verification",checked:e===!0,onClick:()=>l(!0)}),label:"فعال"}),u.jsx(v,{control:u.jsx(I,{name:"slaughterhouse-verification",checked:e===!1,onClick:()=>l(!1)}),label:"غیر فعال"})]})]})},Zt=P("PROVINCE_POLICY_GET_DIRECT_PURCHASE_BAR_LIMITATION",async(e,{dispatch:t})=>{var r,a;try{t(b());const{data:n,status:o}=await _.get("limitation_for_direct_purchase_and_bar_information/");return t(g()),{data:n,status:o}}catch(n){return t(g()),{error:((a=(r=n.response)==null?void 0:r.data)==null?void 0:a.result)||"خطا در دریافت اطلاعات"}}}),we=P("PROVINCE_POLICY_EDIT_DIRECT_PURCHASE_BAR_LIMITATION",async({id:e,data:t},{dispatch:r})=>{var a,n;try{r(b());const{data:o,status:l}=await _.put(`limitation_for_direct_purchase_and_bar_information/${e}/`,t);return r(g()),{data:o,status:l}}catch(o){return r(g()),{error:((n=(a=o.response)==null?void 0:a.data)==null?void 0:n.result)||"خطا در ویرایش اطلاعات"}}}),Jt={id:null,key:null,active:!1,start_time:"08:00:00",end_time:"18:00:00",allowBuying:null},ur=()=>{const e=k(),[t]=C.useContext(D),[r,a]=C.useState(Jt);C.useEffect(()=>{e(Zt()).then(s=>{var c;if((c=s.payload)!=null&&c.data){const d=s.payload.data;a({id:d.id,key:d.key,active:d.active,start_time:d.startTime,end_time:d.endTime,allowBuying:d.allowBuying??null})}})},[e]);const n=s=>{const c=s.target.value==="true",d={...r,active:c};a(d),c||e(we({id:r.id,data:{active:!1}})).then(h=>{var y,A;if((y=h.payload)!=null&&y.error)t({vertical:"top",horizontal:"center",msg:h.payload.error,severity:"error"});else if((A=h.payload)!=null&&A.data){const F=h.payload.data;a(x=>({...x,id:F.id??x.id,key:F.key??x.key,active:F.active??x.active,start_time:F.startTime??x.start_time,end_time:F.endTime??x.end_time,allowBuying:F.allowBuying??x.allowBuying})),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})}})},o=s=>{const c=s.target.value==="بلی";a(d=>({...d,allowBuying:c}))},l=()=>{e(we({id:r.id,data:{active:r.active,start_time:r.start_time,end_time:r.end_time,allow_buying:r.allowBuying}})).then(s=>{var c,d;if((c=s.payload)!=null&&c.error)t({vertical:"top",horizontal:"center",msg:s.payload.error,severity:"error"});else if((d=s.payload)!=null&&d.data){const h=s.payload.data;a({id:h.id??r.id,key:h.key??r.key,active:h.active??r.active,start_time:h.startTime??r.start_time,end_time:h.endTime??r.end_time,allowBuying:h.allowBuying??r.allowBuying}),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})}})};return u.jsxs(i,{container:!0,xs:12,alignItems:"center",justifyContent:"start",gap:2,isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"19%",nxl:"19%"}},children:[u.jsx(w,{sx:{color:"rgba(0, 0, 0, 0.6)"},children:"بازه‌ی اضطراری خرید و ایجاد بعدی"}),u.jsxs(i,{container:!0,xs:12,alignItems:"end",justifyContent:"start",children:[u.jsx(i,{container:!0,direction:"column",children:u.jsx(Q,{children:u.jsxs(Z,{"aria-labelledby":"limitation-active",name:"limitation-active",value:String(r.active),onChange:n,row:!0,children:[u.jsx(v,{value:"true",control:u.jsx(I,{}),label:"فعال"}),u.jsx(v,{value:"false",control:u.jsx(I,{}),label:"غیر فعال"})]})})}),r.active&&u.jsxs(i,{container:!0,justifyContent:"start",alignItems:"start",gap:1,mt:1,children:[u.jsx(i,{children:u.jsx(nu,{value:r.start_time,onChange:s=>a(c=>({...c,start_time:s})),label:"از"})}),u.jsx(i,{children:u.jsx(nu,{value:r.end_time,onChange:s=>a(c=>({...c,end_time:s})),label:"تا"})})]}),r.active&&u.jsxs(i,{mt:2,xs:12,children:[u.jsx(w,{sx:{color:"rgba(0, 0, 0, 0.6)",mb:1,fontSize:16,width:"fit-content"},justifyContent:"flex-start",children:"اجازه خرید دارد؟"}),u.jsx(Q,{children:u.jsxs(Z,{"aria-labelledby":"allow-buying-radio",name:"allow-buying-radio",value:r.allowBuying===!0?"بلی":r.allowBuying===!1?"خیر":"",onChange:o,row:!0,children:[u.jsx(v,{value:"بلی",control:u.jsx(I,{}),label:"بلی"}),u.jsx(v,{value:"خیر",control:u.jsx(I,{}),label:"خیر"})]})})]}),r.active&&u.jsx(i,{container:!0,mt:1,xs:12,children:u.jsx(R,{variant:"contained",disabled:r.end_time({...e,[t]:!1}),{}),tr=()=>{const[e]=C.useContext(D),t=C.useCallback(({severity:F,msg:x,vertical:p="top",horizontal:j="center"})=>e({severity:F,msg:x,vertical:p,horizontal:j}),[e]),[r,a]=C.useState(er),[n,o]=C.useState(null),[l,s]=C.useState(!0),[c,d]=C.useState(!1);C.useEffect(()=>{(async()=>{var x,p,j,E;s(!0);try{const{data:T}=await _.get("hatching-loss-management/");o((T==null?void 0:T.id)??null),a(O=>Iu.reduce((f,{key:B})=>({...f,[B]:!!(T!=null&&T[B])}),{...O}))}catch(T){const O=((p=(x=T==null?void 0:T.response)==null?void 0:x.data)==null?void 0:p.detail)??((E=(j=T==null?void 0:T.response)==null?void 0:j.data)==null?void 0:E.message)??(T==null?void 0:T.message)??"خطایی در دریافت اطلاعات رخ داده است.";t({severity:"error",msg:O})}finally{s(!1)}})()},[]);const h=F=>x=>{const{checked:p}=x.target;a(j=>({...j,[F]:p}))},y=C.useMemo(()=>Iu.reduce((F,{key:x,apiKey:p})=>(F[p]=!!r[x],F),{}),[r]),A=async F=>{var p,j,E,T;F.preventDefault(),d(!0);const x=n??1;try{await _.patch(`hatching-loss-management/${x}/`,y),t({severity:"success",msg:"اطلاعات با موفقیت به‌روزرسانی شد."})}catch(O){const f=((j=(p=O==null?void 0:O.response)==null?void 0:p.data)==null?void 0:j.detail)??((T=(E=O==null?void 0:O.response)==null?void 0:E.data)==null?void 0:T.message)??(O==null?void 0:O.message)??"خطایی در به‌روزرسانی اطلاعات رخ داده است.";t({severity:"error",msg:f})}finally{d(!1)}};return u.jsx(su,{component:"section",xs:12,style:{padding:"20px",width:"100%"},children:l?u.jsx(e0,{direction:"row",justifyContent:"center",children:u.jsx(t0,{})}):u.jsxs(su,{component:"form",onSubmit:A,xs:12,children:[u.jsx(r0,{children:Iu.map(({key:F,label:x})=>u.jsx(v,{control:u.jsx(z,{checked:!!r[F],onChange:h(F),name:F,disabled:c}),label:x},F))}),u.jsx(cu,{children:u.jsx(R,{type:"submit",variant:"contained",disabled:c,color:"primary",children:c?"در حال ذخیره...":"به‌روزرسانی"})})]})})},rr=()=>{const[e,t]=C.useState(!1),r=k(),[a]=C.useContext(D),n=H({initialValues:{quantity:""},validationSchema:M({quantity:N().required("این فیلد اجباری است").min(1,"حداقل مقدار باید 1 باشد")})}),o=()=>{r(n6()).then(s=>{var c;(c=s.payload)!=null&&c.data&&(t(s.payload.data.active),n.setFieldValue("quantity",s.payload.data.quantity))})};C.useEffect(()=>{o()},[]),C.useEffect(()=>{n.validateForm()},[]);const l=s=>{const c=V();r(a6({quantity:s?parseInt(n.values.quantity):0,active:s,register_role:c})).then(d=>{var h;(h=d.payload)!=null&&h.error?a({vertical:"top",horizontal:"center",msg:d.payload.error,severity:"error"}):(o(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})};return u.jsxs(i,{container:!0,alignItems:"center",gap:2,justifyContent:"space-between",isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(i,{children:u.jsx(w,{variant:"body1",children:"سقف کشتار پنل معاملات"})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"marketDailyLimit",checked:e,onClick:()=>{t(!0)}}),label:"فعال"}),u.jsx(v,{control:u.jsx(I,{checked:!e,onClick:()=>{t(!1),l(!1)},name:"marketDailyLimit"}),label:"غیر فعال"})]}),e&&u.jsxs(u.Fragment,{children:[u.jsx(i,{children:u.jsx(S,{size:"small",label:"میزان محدودیت (براساس تعداد)",name:"quantity",type:"number",value:n.values.quantity,onChange:n.handleChange,error:n.touched.quantity&&!!n.errors.quantity,helperText:n.touched.quantity&&n.errors.quantity,required:!0})}),u.jsx(i,{children:u.jsx(R,{fullWidth:!0,disabled:!n.isValid,variant:"contained",onClick:()=>l(!0),children:"ثبت"})})]})]})},nr=P("PROVINCE_GET_HATCHING_ARCHIVE_PERCENT",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.get("/hatching-archive-percent/");return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),ar=P("PROVINCE_EDIT_HATCHING_ARCHIVE_PERCENT",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.put("/hatching-archive-percent/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),sr=()=>{const[e,t]=C.useState(!1),r=k(),[a]=C.useContext(D),n=H({initialValues:{percent:""},validationSchema:M({percent:N().required("این فیلد اجباری است").min(1,"حداقل مقدار باید 1 باشد").max(100,"حداکثر مقدار باید 100 باشد")})}),o=()=>{r(nr()).then(s=>{var c;(c=s.payload)!=null&&c.data&&(t(s.payload.data.active),n.setFieldValue("percent",s.payload.data.percent))})};C.useEffect(()=>{o()},[]),C.useEffect(()=>{n.validateForm()},[]);const l=s=>{r(ar({percent:s?parseInt(n.values.percent):0,active:s})).then(c=>{var d;(d=c.payload)!=null&&d.error?a({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(o(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})};return u.jsxs(i,{container:!0,alignItems:"center",gap:2,justifyContent:"space-between",isPolicy:!0,sx:{width:{xs:"100%",sm:"48%",lg:"24%",nxl:"19%"}},children:[u.jsx(i,{children:u.jsx(w,{variant:"body1",children:"بایگانی خودکار جوجه‌ریزی"})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"hatchingArchivePercent",checked:e,onClick:()=>{t(!0)}}),label:"فعال"}),u.jsx(v,{control:u.jsx(I,{checked:!e,onClick:()=>{t(!1),l(!1)},name:"hatchingArchivePercent"}),label:"غیر فعال"})]}),e&&u.jsxs(u.Fragment,{children:[u.jsx(i,{children:u.jsx(S,{size:"small",label:"درصد بایگانی",name:"percent",type:"number",value:n.values.percent,onChange:n.handleChange,error:n.touched.percent&&!!n.errors.percent,helperText:n.touched.percent&&n.errors.percent,required:!0})}),u.jsx(i,{children:u.jsx(R,{fullWidth:!0,disabled:!n.isValid,variant:"contained",onClick:()=>l(!0),children:"ثبت"})})]})]})},or=()=>{const[e,t]=C.useState(!0),[r,a]=C.useState("0"),[n,o]=C.useState(!1),[l,s]=C.useState(!1),[c,d]=C.useState(!1),[h,y]=C.useState(!1),A=k(),F=Ye(),x=Array.from({length:8},(L,au)=>au+8),[p,j]=C.useState(!1),[E,T]=C.useState(""),[O,f]=C.useState("optional"),[B,U]=C.useState(!1),[m,X]=C.useState(!1),[W,iu]=C.useState(!1),J=L=>{L.target.name==="item1"&&(o(L.target.checked),A(ut({allow:L.target.checked}))),L.target.name==="item6"&&(s(L.target.checked),A(_e({allow:L.target.checked,mandatory:W}))),L.target.name==="autoAcceptSlaughter"&&(d(L.target.checked),A(tt({allow:L.target.checked}))),L.target.name==="autoCarAllocateSlaughter"&&(y(L.target.checked),A(nt({allow:L.target.checked})))};C.useEffect(()=>{A(et()).then(L=>{o(L.payload.data)}),A(J6()).then(L=>{s(L.payload.data.allowState),iu(L.payload.data.mandatory)}),A(rt()).then(L=>{d(L.payload.data)}),A(at()).then(L=>{y(L.payload.data)}),A(je()).then(L=>{f(L.payload.data.type)}),A(he()).then(L=>{U(L.payload.data.permission)})},[]),C.useEffect(()=>{t(!1),e||A(_e({allow:l,mandatory:W}))},[W]),C.useEffect(()=>{p&&E&&A(ie({hour:E,active:p})),!p&&E&&(T(null),A(ie({hour:0,active:p})))},[E,p]),C.useEffect(()=>{A(e6()).then(L=>{j(L.payload.data.active),T(L.payload.data.hour)})},[]);const ju=L=>{A(xt({type:L})).then(()=>{A(je()).then(au=>{f(au.payload.data.type)})})},fu=L=>{A(gt({permission:L})).then(()=>{A(he()).then(au=>{U(au.payload.data.permission)})})},Su=(L,au)=>{a(au)};return u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mb:4,sx:{background:"#F9F9F9",borderRadius:"15px"},children:[u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mb:4,mt:2,children:u.jsx(w,{xs:12,children:"مدیریت فرآیند"})}),u.jsxs(Ne,{value:r,onChange:Su,textColor:"secondary",indicatorColor:"secondary","aria-label":"secondary tabs example",children:[u.jsx(gu,{value:"0",label:"صدور مجوز"}),u.jsx(gu,{value:"1",label:"محدودیت و اولویت"}),u.jsx(gu,{value:"3",label:"قیمت مصوب"}),u.jsx(gu,{value:"4",label:"مدیریت تلفات"})]}),r==="0"&&u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mt:2,children:u.jsxs(i,{container:!0,xs:12,gap:2,alignItems:"start",className:"manage-process",direction:"column",children:[u.jsxs(i,{xs:12,container:!0,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(i,{isPolicy:!0,container:!0,justifyContent:"center",isLocked:!0,sx:{height:"60px",width:{xs:"100%",sm:"48%",lg:"19%"}},xs:12,children:u.jsx(v,{control:u.jsx(z,{checked:!0,onChange:J,name:"item4"}),label:"مدیر اجرایی (اتحادیه)"})}),u.jsxs(i,{isPolicy:!0,container:!0,justifyContent:"center",sx:{height:"60px",width:"340px"},children:[u.jsx(v,{control:u.jsx(z,{checked:n,onChange:J,name:"item1"}),label:"مجوز فروش به خارج استان (زنده)"}),u.jsx(ou,{title:"مدیریت",children:u.jsx(G,{disabled:!n,color:"success",onClick:()=>{F(V()==="ProvinceOperator"?x0:V()==="SuperAdmin"?g0:A0)},children:u.jsx(du,{})})})]})]}),u.jsxs(i,{xs:12,container:!0,justifyContent:"center",alignItems:"start",gap:2,px:2,children:[u.jsx($t,{}),u.jsxs(i,{container:!0,alignItems:"center",isPolicy:!0,gap:2,sx:{width:{xs:"100%",sm:"48%",lg:"19%"}},children:[u.jsx(w,{variant:"body1",children:"تخلیه با کد قرنطینه"}),u.jsxs(i,{xs:12,container:!0,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"item6",checked:O!=="optional",onClick:()=>{ju("force")}}),label:"اجباری"}),u.jsx(v,{control:u.jsx(I,{checked:O==="optional",onClick:()=>{ju("optional")},name:"item6"}),label:"اختیاری"})]})]}),u.jsxs(i,{container:!0,alignItems:"center",isPolicy:!0,gap:2,sx:{width:{xs:"100%",sm:"48%",lg:"19%"}},children:[u.jsx(w,{variant:"body1",children:"مجوز فروش مرغ برای انجماد"}),u.jsxs(i,{xs:12,container:!0,justifyContent:"space-between",children:[u.jsx(v,{control:u.jsx(I,{name:"item6",checked:B,onClick:()=>{fu(!0)}}),label:"فعال"}),u.jsx(v,{control:u.jsx(I,{checked:!B,onClick:()=>{fu(!1)},name:"item6"}),label:"غیر فعال"})]})]}),u.jsx(Dt,{}),u.jsx(Tt,{}),u.jsx(Rt,{}),u.jsx(Lt,{}),u.jsx(zt,{}),u.jsx(Ot,{}),u.jsx(Et,{}),u.jsx(Bt,{}),u.jsx(qt,{}),u.jsx(Mt,{}),u.jsx(Ht,{}),u.jsx(Wt,{}),u.jsx(Yt,{}),u.jsx(Qt,{}),u.jsx(Xt,{}),u.jsx(ur,{}),u.jsx(rr,{}),u.jsx(sr,{}),u.jsx(Vt,{})]}),u.jsx(St,{})]})}),r==="1"&&u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"start",direction:"column",mt:2,children:[u.jsx(mt,{}),u.jsxs(i,{container:!0,children:[u.jsx(v,{control:u.jsx(z,{checked:l,onChange:J,name:"item6"}),label:"اولویت بندی کشتارگاه توسط مرغدار"}),u.jsx(ou,{title:"مدیریت","aria-label":"choose-slaughter",children:u.jsx(G,{disabled:!l,color:"success",onClick:()=>{F(y0)},children:u.jsx(du,{})})}),l&&u.jsxs(u.Fragment,{children:[u.jsx(v,{control:u.jsx(I,{value:!0,name:"item6",checked:W===!0,onChange:()=>iu(!0)}),label:"اجباری"}),u.jsx(v,{control:u.jsx(I,{checked:W===!1,onChange:()=>iu(!1),value:!1,name:"item6"}),label:"اختیاری"})]})]}),u.jsx(v,{control:u.jsx(z,{checked:"",onChange:J,name:"item2"}),label:"فروش خارج از شبکه"}),u.jsx(v,{control:u.jsx(z,{checked:"",onChange:J,name:"item3"}),label:"فعال سازی پنل بورس"}),u.jsxs(i,{container:!0,children:[u.jsx(v,{control:u.jsx(z,{checked:"",onChange:J,name:"item5"}),label:"تسویه حساب مالی"}),u.jsx(ou,{title:"در صورت فعال بودن این فیلتر امکان تخصیص حجم بار به کشتارگاه یا کشتارکن که بدهی از قبل دارد وجود ندارد.",open:m,placement:"bottom",children:u.jsx(G,{"aria-label":"help",onMouseOver:()=>X(!0),onMouseLeave:()=>X(!1),children:u.jsx(Je,{})})})]}),(V()==="ProvinceOperator"||V()==="SuperAdmin")&&u.jsx(dt,{}),(V()==="ProvinceOperator"||V()==="SuperAdmin")&&u.jsxs(i,{container:!0,gap:2,children:[u.jsx(v,{control:u.jsx(z,{checked:p,onChange:()=>j(!p)}),label:"محدودیت زمان درخواست کشتار مرغدار"}),p&&u.jsxs(Q,{style:{width:200},children:[u.jsx(Ku,{id:"hour-label",children:"ساعت پایان درخواست"}),u.jsx(Eu,{labelId:"hour-label",label:"ساعت پایان درخواست",id:"hour-select",value:E,onChange:L=>T(L.target.value),children:x.map(L=>u.jsxs(Cu,{value:L,children:[L,":00"]},L))})]})]}),u.jsx(v,{control:u.jsx(z,{name:"autoAcceptSlaughter",checked:c,onChange:J}),label:"تایید خودکار حجم تخصیصی به کشتارگاه"}),u.jsx(v,{control:u.jsx(z,{checked:h,onChange:J,name:"autoCarAllocateSlaughter",disabled:"true"}),label:"ایجاد خودروی حمل بار برای کشتارگاه"}),u.jsx(v,{control:u.jsx(z,{checked:"",onChange:J,name:"item2"}),label:"عدم امکان وارد کردن اطلاعات بار در صورت تایید نکردن تخلیه دامپزشک کشتارگاه"}),u.jsx(ot,{}),u.jsx(ct,{}),u.jsx(pt,{})]}),r==="2"&&u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsx(It,{})}),r==="3"&&u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:u.jsx(ft,{})}),r==="4"&&u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsx(tr,{})})]})},lr=P("PROVINCE_POLICY_SUBMIT_DOCUMENT_STATE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.post("bar-documents-status/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),ir=P("PROVINCE_POLICY_SUBMIT_DOCUMENT_STATE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.put("bar-documents-status/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),cr=P("PROVINCE_POLICY_DELETE_DOCUMENT_STATE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.delete("bar-documents-status/"+e+"/");return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),Cr=()=>{const e=k(),[t,r]=C.useState([]),[a,n]=C.useState(!1),[o,l]=C.useState([]),[s,c]=C.useState([]),d=(F,x)=>{const p=[...o];p[x]={...p[x],value:parseInt(F.target.value)},l(p)},[h]=C.useContext(D),y=()=>{e(h6()).then(F=>{var p;c(F.payload.data);const x=(p=F.payload.data)==null?void 0:p.map(j=>({key:j==null?void 0:j.key,value:j==null?void 0:j.priorityId}));l(x)})};C.useEffect(()=>{const F=s==null?void 0:s.map((x,p)=>{var j;return[a?u.jsx(S,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:100},value:((j=o[p])==null?void 0:j.value)||(x==null?void 0:x.priorityId),onChange:E=>d(E,p)},p):x==null?void 0:x.priorityId,x==null?void 0:x.title,x!=null&&x.sms?"دارد":"ندارد",x!=null&&x.isError?u.jsx(w,{color:"error",variant:"body2",children:"ندارد"},p):u.jsx(w,{color:"primary",variant:"body2",children:"دارد"},p),u.jsx(i,{container:!0,justifyContent:"center",children:u.jsx(A,{onEdit:()=>{e(Y({title:"ویرایش وضعیت",content:u.jsx(Te,{fetchData:y,isEdit:!0,item:x})}))},onDelete:()=>{e(cr(x==null?void 0:x.id)).then(E=>{E.payload.error?h({vertical:"top",horizontal:"center",msg:E.payload.error,severity:"error"}):(y(),h({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}})},p)]});r(F)},[s,o,a]),C.useEffect(()=>{y()},[]);const A=({onEdit:F,onDelete:x})=>{const[p,j]=C.useState(null),E=!!p,T=U=>{j(U.currentTarget)},O=()=>{j(null)},f=()=>{F(),O()},B=()=>{x(),O()};return u.jsxs(i,{children:[u.jsx(ou,{title:"تنظیمات",children:u.jsx(G,{color:"primary",onClick:T,children:u.jsx(du,{})})}),u.jsx(Yu,{open:E,anchorEl:p,onClose:O,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsxs(Qu,{sx:{minWidth:140,p:1},children:[u.jsxs(yu,{onClick:f,sx:{py:1},children:[u.jsx(_u,{children:u.jsx(ru,{color:"primary"})}),u.jsx(mu,{primary:u.jsx(w,{variant:"body2",color:"textPrimary",children:"ویرایش"})})]}),u.jsxs(yu,{onClick:B,sx:{py:1},children:[u.jsx(_u,{children:u.jsx(Xu,{color:"error"})}),u.jsx(mu,{primary:u.jsx(w,{variant:"body2",color:"textPrimary",children:"حذف"})})]})]})})]})};return u.jsx(i,{container:!0,xs:12,alignItems:"center",justifyContent:"space-between",children:u.jsxs(i,{container:!0,style:{width:"100%"},mt:2,alignItems:"center",gap:2,children:[u.jsx(w,{variant:"body1",children:"وضعیت اسناد"}),u.jsxs(i,{container:!0,alignItems:"center",gap:1,children:[u.jsx(R,{variant:"contained",onClick:()=>{e(Y({title:"ایجاد وضعیت جدید",content:u.jsx(Te,{fetchData:y})}))},children:"ساخت وضعیت جدید"}),a?u.jsxs(i,{container:!0,alignItems:"center",gap:1,children:[u.jsx(R,{variant:"contained",onClick:()=>{e(d6({priority_list:o})).then(F=>{F.payload.error?h({vertical:"top",horizontal:"center",msg:F.payload.error,severity:"error"}):(y(),a(!1),h({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ذخیره تغییرات"}),u.jsx(R,{variant:"contained",onClick:()=>{n(!1)},color:"error",children:"لغو"})]}):u.jsx(R,{variant:"contained",onClick:()=>{n(!0)},children:"ویرایش اولویت ها"})]}),u.jsx(p6,{style:{width:"100%"},columns:["اولویت","عنوان","ارسال پیامک","مجوز ویرایش سند","عملیات"],data:t})]})})},Te=({fetchData:e,isEdit:t,item:r})=>{const[a,n]=C.useState(!!(r!=null&&r.sms)),[o,l]=C.useState(!!(r!=null&&r.isError)),s=k(),c=A=>{n(A.target.checked)},d=A=>{l(A.target.checked)},h=H({initialValues:{stateTitle:r!=null&&r.title?r==null?void 0:r.title:"",priority:r!=null&&r.priorityId?r==null?void 0:r.priorityId:1},validationSchema:M({stateTitle:$().required("این فیلد اجباری است!").typeError("لطفا عنوان وضعیت را وارد کنید!"),priority:N().required("این فیلد اجباری است!").typeError("لطفا عنوان وضعیت را وارد کنید!").min(1,"عدد مثبت وارد کنید!")})});C.useEffect(()=>{h.validateForm()},[]);const[y]=C.useContext(D);return u.jsxs(i,{container:!0,xs:12,alignItems:"center",justifyContent:"center",gap:1,children:[u.jsx(S,{fullWidth:!0,id:"stateTitle",label:"عنوان وضعیت",value:h.values.stateTitle,error:h.touched.stateTitle?!!h.errors.stateTitle:null,onChange:h.handleChange,onBlur:h.handleBlur,helperText:h.touched.stateTitle&&h.errors.stateTitle?h.errors.stateTitle:null,autoComplete:"current-password",variant:"outlined"}),t&&u.jsx(S,{fullWidth:!0,id:"priority",label:"اولویت",value:h.values.priority,error:h.touched.priority?!!h.errors.priority:null,onChange:h.handleChange,onBlur:h.handleBlur,helperText:h.touched.priority&&h.errors.priority?h.errors.priority:null,autoComplete:"current-password",variant:"outlined"}),u.jsxs(i,{container:!0,children:[u.jsx(v,{control:u.jsx(z,{checked:a,onChange:c,inputProps:{"aria-label":"controlled"}}),label:"ارسال پیامک"}),u.jsx(v,{control:u.jsx(z,{checked:o,onChange:d,inputProps:{"aria-label":"controlled"}}),label:"محدود کننده"})]}),u.jsx(R,{disabled:!h.isValid,variant:"contained",fullWidth:!0,onClick:()=>{t?s(ir({title:h.values.stateTitle,sms:a,is_error:o,bar_documents_status_key:r==null?void 0:r.key,priority_id:h.values.priority})).then(A=>{A.payload.error?y({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"}):(e(),s(K()),y({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}):s(lr({title:h.values.stateTitle,sms:a,is_error:o})).then(A=>{A.payload.error?y({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"}):(e(),s(K()),y({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت"})]})},dr=P("PROVINCE_POLICY_GET_ACCOUNTS_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.get("zarinpal-accounts/");return t(g()),{data:r,status:a}}),hr=P("PROVINCE_POLICY_EDIT_ACCOUNTS_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.put("zarinpal-accounts/0/",e);return t(g()),{data:r,status:a}}),pr=P("PROVINCE_POLICY_GET_BENEFICIARY_ACCOUNTS_SERVICE",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.get("beneficiary-accounts/");return t(g()),{data:r,status:a}}),xr=P("PROVINCE_POLICY_SUBMIT_BENEFICIARY_ACCOUNTS_SERVICE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.post("beneficiary-accounts/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),$u=P("PROVINCE_POLICY_EDIT_BENEFICIARY_ACCOUNTS_SERVICE",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.put("beneficiary-accounts/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),gr=P("PROVINCE_POLICY_DELETE_BENEFICIARY_ACCOUNTS_SERVICE",async(e,{dispatch:t})=>{t(b());try{const{data:r,status:a}=await _.delete("beneficiary-accounts/0/?account_key="+e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),Ar=({fetchData:e,item:t})=>{const[r]=C.useContext(D),a=k(),n=H({initialValues:{account:t!=null&&t.account?t==null?void 0:t.account:""},validationSchema:M({account:$().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!").max(26,"شماره شبا نامعتبر است!").min(26,"شماره شبا نامعتبر است!")})});return C.useEffect(()=>{n.validateForm()},[]),u.jsxs(i,{xs:12,container:!0,direction:"column",gap:2,children:[u.jsxs(w,{variant:"body1",color:"primary",children:["ویرایش حساب ",t==null?void 0:t.name]}),u.jsx(S,{id:"account",label:"شماره شبا",variant:"outlined",sx:{width:"100%",height:"100%"},value:n.values.account,error:n.touched.account&&n.values.account!=="-"?!!n.errors.account:null,onChange:n.handleChange,onBlur:n.handleBlur,helperText:n.touched.account&&n.values.account!=="-"&&n.errors.account?n.errors.account:null}),u.jsx(i,{children:u.jsx(R,{fullWidth:!0,variant:"contained",disabled:!n.isValid&&n.values.account!=="-",onClick:()=>{a(hr({account_key:t==null?void 0:t.key,account:n.values.account})).then(o=>{o.payload.error?r({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),a(K()),e())})},children:"ویرایش شماره شبا"})})]})},yr=M().shape({sheba:$().required("شبا الزامی است").matches(/^IR[0-9]{24}$/,"شماره شبا باید با IR شروع شود و شامل 24 رقم باشد"),name:$().required("نام ذینفع الزامی است"),percentage:N().required("درصد الزامی است").min(0,"درصد نمی‌تواند کمتر از 0 باشد").max(100,"درصد نمی‌تواند بیشتر از 100 باشد")}),u0=({fetchData:e,item:t})=>{const[r]=C.useContext(D),a=k(),n=l=>{l.payload.error?r({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(e(),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),a(vu({right:!1,bottom:!1,content:null})))},o=H({initialValues:{name:(t==null?void 0:t.name)||"",sheba:(t==null?void 0:t.shaba)||"IR",percentage:(t==null?void 0:t.percent)||""},validationSchema:yr,onSubmit:l=>{t?a($u({name:l.name,percent:l.percentage,shaba:l.sheba,account_key:t==null?void 0:t.key})).then(s=>{n(s)}):a(xr({name:l.name,percent:l.percentage,shaba:l.sheba})).then(s=>{n(s)})}});return u.jsxs(i,{container:!0,xs:12,direction:"grid",gap:2,children:[u.jsx(S,{id:"name",label:"نام",variant:"outlined",sx:{width:"100%",height:"100%"},value:o.values.name,error:o.touched.name?!!o.errors.name:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.name&&o.errors.name?o.errors.name:null}),u.jsx(S,{id:"sheba",label:"شماره شبا",variant:"outlined",sx:{width:"100%"},value:o.values.sheba,error:o.touched.sheba?!!o.errors.sheba:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.sheba&&o.errors.sheba?o.errors.sheba:null}),u.jsx(S,{fullWidth:!0,id:"percentage",name:"percentage",label:"درصد",variant:"outlined",type:"number",value:o.values.percentage,onChange:o.handleChange,onBlur:o.handleBlur,error:o.touched.percentage&&!!o.errors.percentage,helperText:o.touched.percentage&&o.errors.percentage,inputProps:{min:0,max:100,step:"0.01"}}),u.jsx(R,{fullWidth:!0,variant:"contained",onClick:o.handleSubmit,children:"ثبت"})]})},_r=({item:e,fetchData:t})=>{const[r,a]=C.useState(null),n=k(),o=h=>{a(h.currentTarget)},[l]=C.useContext(D),s=()=>{a(null)},c=!!r,d=c?"popover":void 0;return u.jsxs(i,{container:!0,children:[u.jsx(G,{"aria-describedby":d,variant:"contained",color:"primary",onClick:o,children:u.jsx(du,{})}),u.jsx(Yu,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:d,open:c,anchorEl:r,onClose:s,children:u.jsxs(Qu,{sx:{minWidth:140,p:1},children:[u.jsxs(yu,{onClick:()=>{s(),n(vu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(u0,{fetchData:t,item:e}),title:" ویرایش حساب ذینفع"}))},children:[u.jsx(_u,{children:u.jsx(ru,{color:"primary"})}),u.jsx(mu,{primary:u.jsx(w,{variant:"body2",color:"textPrimary",children:"ویرایش"})})]}),u.jsxs(yu,{onClick:()=>{s(),n(Y({title:"حذف حساب",content:u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsx(w,{variant:"body2",color:"red",children:"آیا از حذف حساب اطمینان دارید؟"}),u.jsxs(i,{container:!0,xs:12,mt:2,justifyContent:"center",alignItems:"center",spacing:2,children:[u.jsx(i,{item:!0,xs:6,children:u.jsx(R,{onClick:()=>{n(gr(e==null?void 0:e.key)).then(h=>{h.payload.error?l({vertical:"top",horizontal:"center",msg:h.payload.error,severity:"error"}):(l({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(),n(K()))})},variant:"contained",color:"error",fullWidth:!0,children:"تایید"})}),u.jsx(i,{item:!0,xs:6,children:u.jsx(R,{variant:"contained",color:"primary",fullWidth:!0,children:"رد"})})]})]})}))},children:[u.jsx(_u,{children:u.jsx(Xu,{color:"error"})}),u.jsx(mu,{primary:u.jsx(w,{variant:"body2",color:"textPrimary",children:"حذف"})})]})]})})]})},mr=()=>{const e=k(),[t,r]=C.useState(),[a,n]=C.useState(),[o,l]=C.useState(),[s,c]=C.useState(),[d,h]=C.useState(0),y=(p,j)=>{h(j)},A=()=>{e(dr()).then(p=>{l(p.payload.data)}),e(pr()).then(p=>{c(p.payload.data)})},[F]=C.useContext(D),x=p=>{p.payload.error?F({vertical:"top",horizontal:"center",msg:p.payload.error,severity:"error"}):(A(),F({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))};return C.useEffect(()=>{const p=o==null?void 0:o.map((E,T)=>[T+1,E==null?void 0:E.name,E==null?void 0:E.account,u.jsx(G,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>{e(Y({title:"ویرایش حساب",content:u.jsx(Ar,{item:E,fetchData:A})}))},children:u.jsx(ru,{})},T)]);r(p);const j=s==null?void 0:s.map((E,T)=>[T+1,E==null?void 0:E.name,E==null?void 0:E.percent,E==null?void 0:E.shaba,u.jsx(z,{checked:E.inProvince,onChange:()=>e($u({in_province:!(E!=null&&E.inProvince),account_key:E==null?void 0:E.key})).then(O=>{x(O)})},T),u.jsx(z,{checked:E==null?void 0:E.outProvince,onChange:()=>e($u({out_province:!(E!=null&&E.outProvince),account_key:E==null?void 0:E.key})).then(O=>{x(O)})},T),u.jsx(_r,{item:E,fetchData:A},T)]);n(j)},[o,s]),C.useEffect(()=>{A()},[e,d]),u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsxs(Ne,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:d,onChange:y,children:[u.jsx(gu,{label:"حساب ها",value:0}),u.jsx(gu,{label:"حساب های ذینفع",value:1})]}),d===0&&u.jsx(uu,{noPagination:!0,columns:["ردیف","نام","شماره حساب","ویرایش"],data:t,title:"حساب ها",customColors:[{name:"تعداد تخصیص بدون بار",color:"yellow"},{name:"نام",color:"cyan"},{name:"شماره حساب",color:"orange"}]}),d===1&&u.jsxs(i,{xs:12,container:!0,mt:2,children:[u.jsx(R,{variant:"contained",onClick:()=>{e(vu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(u0,{fetchData:A}),title:" افزودن حساب ذینفع"}))},children:"افزودن حساب ذینفع"}),u.jsx(uu,{noPagination:!0,columns:["ردیف","نام ذینفع","درصد سهم","شماره شبا","سهم داخل استان","سهم خارج استان","عملیات"],data:a,title:"حساب های ذینفع"})]})]})},vr=P("PROVINCE_POLICY_GET_TICKETS",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.get("ticket-permission/");return t(g()),{data:r,status:a}}),jr=P("PROVINCE_POLICY_SUBMIT_TICKET_PERMISSION",async(e,{dispatch:t})=>{try{t(b());const{data:r,status:a}=await _.post("ticket-permission/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),fr=()=>{const e=k(),[t]=C.useContext(D),[r,a]=C.useState(),[n,o]=C.useState();C.useEffect(()=>{e(vr()).then(s=>{a(s.payload.data)})},[]);const l=(s,c)=>{const{target:{value:d}}=s,h=[...r];h[c]={...h[c],roles:typeof d=="string"?d.split(","):d},a(h)};return C.useEffect(()=>{const s=r==null?void 0:r.map((c,d)=>{var h;return[d+1,Lu(c==null?void 0:c.role)!=="نامشخص"?Lu(c==null?void 0:c.role):c==null?void 0:c.role,u.jsx(i,{container:!0,justifyContent:"center",style:{margin:"3px"},children:u.jsxs(Q,{fullWidth:!0,children:[u.jsx(Ku,{id:"demo-simple-select-label",children:"مجوز ارسال تیکت"}),u.jsx(Eu,{size:"small",sx:{width:{xs:"110px",sm:"220px"}},labelId:"demo-simple-select-label",label:"مجوز ارسال تیکت",value:c==null?void 0:c.roles,onChange:y=>l(y,d),multiple:!0,renderValue:y=>y.map(A=>Lu(A)).join(", "),children:(h=x6())==null?void 0:h.map((y,A)=>u.jsxs(Cu,{value:y.role,alignItems:"center",children:[(c==null?void 0:c.roles.includes(y.role))&&u.jsx(g6,{sx:{marginRight:"8px",color:"#00796b"}}),y.translation]},A))})]})},d),u.jsx(G,{color:"primary",onClick:()=>{e(jr({roles:c==null?void 0:c.roles,role:c==null?void 0:c.role})).then(y=>{if(y.payload.error){t({vertical:"top",horizontal:"center",msg:y.payload.error,severity:"error"});return}else t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},children:u.jsx(A6,{})},d)]});o(s)},[r]),u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mb:2,children:u.jsx(uu,{paginated:!0,title:"اجازه ثبت تیکت",columns:["ردیف","نقش","مجوز ارسال","ثبت"],data:n,customColors:[{name:"ردیف",color:"#74b9ff"},{name:"نقش",color:"#81ecec"},{name:"مجوز ارسال",color:"#636e72",text:"white"}]})})},Fr=()=>{const[e]=C.useContext(D),t=async(n,o)=>{try{(await _.get(o)).status===200&&e({vertical:"top",horizontal:"center",msg:`"${n}" با موفقیت ارسال شد`,severity:"success"})}catch{e({vertical:"top",horizontal:"center",msg:`خطا در ارسال "${n}"`,severity:"error"})}},[r,a]=C.useState([{disabled:!1,title:"اس ام اس های بدهی ساعت 9 صبح",description:"اس ام اس های بدهی",link:`${_.defaults.baseURL}send_gate_way_sms_manual/`},{disabled:!1,title:" اس ام اس های بسته شدن پنل برای بدهی",description:" اس ام اس های بسته شدن پنل برای بدهی",link:`${_.defaults.baseURL}send_deactivate_panel_debt_sms_manual/`},{disabled:!1,title:"وارد کردن بارهای خارج استان به انبار",description:"وارد کردن بارهای خارج استان به انبار",link:`${_.defaults.baseURL}add_free_bar_to_warehouse_manual/`},{disabled:!1,title:"ساخت بارهای خارج استان",description:"ساخت بارهای خارج استان",link:`${_.defaults.baseURL}create_kill_house_free_bar/`},{disabled:!1,title:"آپدیت جوجه ریزی ها",description:"آپدیت جوجه ریزی ها",link:`${_.defaults.baseURL}api_update_poultry_hatching_from_rsi/`},{disabled:!1,title:"تیکت اخطاریه بار های واردنشده به انبار خارج استانی",description:"تیکت اخطاریه بار های واردنشده به انبار خارج استانی",link:`${_.defaults.baseURL}warning_free_bar_to_warehouse_manual/`,isTicket:!0},{disabled:!1,title:"تیکت تخصیصات بدون بار",description:"تیکت تخصیصات بدون بار",link:`${_.defaults.baseURL}warning_province_kill_request_without_bar_manual/`,isTicket:!0},{disabled:!1,title:"وارد کردن بارهای داخل استانی به انبار",description:"وارد کردن بارهای داخل استانی به انبار",link:`${_.defaults.baseURL}add_to_warehouse_manual/`},{disabled:!1,title:"خارج کردن تمام افراد",description:"خارج کردن تمام افراد",link:`${_.defaults.baseURL}remove_access_token_manual/`},{disabled:!1,title:"چک کردن تعداد کد قرنطینه داخل استان",description:"چک کردن تعداد کد قرنطینه داخل استان",link:`${_.defaults.baseURL}find_gid_code_manual/`},{disabled:!1,title:"آپدیت سن جموجه ریزی",description:"آپدیت سن جموجه ریزی",link:`${_.defaults.baseURL}update_chicken_age_from_login_manual/`},{disabled:!1,title:"چک کردن کد قرنطینه خارج استان",description:"چک کردن کد قرنطینه خارج استان",link:`${_.defaults.baseURL}get_gid_out_province_manual/`},{disabled:!1,title:"پیغام تعرفه کل ساعت 4 ایتا",description:"پیغام تعرفه کل ساعت 4 ایتا",link:`${_.defaults.baseURL}daily_manual_transaction_for_eata/`},{disabled:_.defaults.baseURL.includes("testbackend.rasadyar.com"),title:"ارسال دستی پیامک گزارش توزیع گوشت مرغ داخل استان",description:"ارسال دستی پیامک گزارش توزیع گوشت مرغ داخل استان",link:`${_.defaults.baseURL}send_daily_distribution_report_sms_manual/`},{disabled:_.defaults.baseURL.includes("testbackend.rasadyar.com"),title:"ارسال دستی پیامک اطلاعات کشتار مرغ گوشتی",description:"ارسال دستی پیامک اطلاعات کشتار مرغ گوشتی",link:`${_.defaults.baseURL}send_daily_slaughter_statistics_sms_manual/`},{disabled:!1,title:"ارسال دستی بارها به ایتا",description:"ارسال دستی بارها به ایتا",link:`${_.defaults.baseURL}send_all_bar_to_eitaa/`},{disabled:!1,title:"ارسال دستی تخصیصات به ایتا فقط برای مرکزی کار میکنه",description:"ارسال دستی تخصیصات به ایتا فقط برای مرکزی کار میکنه",link:`${_.defaults.baseURL}bot_eitaa_for_province_kill_request/`}]);return u.jsx(ce.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:u.jsx(cu,{display:"flex",justifyContent:"center",alignItems:"center",children:u.jsx(i,{container:!0,direction:"column",xs:12,sm:12,md:10,lg:12,children:u.jsx(i,{container:!0,xs:12,justifyContent:"center",mb:2,px:1,children:(r||[]).map((n,o)=>{var l,s,c,d,h;return u.jsx(i,{item:!0,xs:6,sm:4,md:4,lg:2,p:1,children:u.jsx(cu,{style:{outline:"none",color:"#727272"},onClick:()=>{if(!(n!=null&&n.disabled)){const y=r.map((A,F)=>F===o?{...A,disabled:!0}:A);a(y),t(n==null?void 0:n.title,n==null?void 0:n.link)}},sx:{cursor:"pointer"},children:u.jsx(ce.div,{whileHover:{scale:n!=null&&n.disabled?null:1.05},whileTap:{scale:n!=null&&n.disabled?null:.9},children:u.jsxs(cu,{p:((l=q)==null?void 0:l.SMALL)||2,border:"1px solid #E6E6E6",borderRadius:((s=q)==null?void 0:s.SMALL)||1,bgcolor:"#FCFCFC",display:"flex",flexDirection:"column",alignItems:"center",sx:{cursor:n!=null&&n.disabled?"not-allowed":"pointer"},minHeight:"11rem",maxHeight:"11rem",children:[u.jsx(cu,{sx:{width:60,minWidth:60,height:60,minHeight:60,borderRadius:"50%",backgroundColor:n!=null&&n.disabled?"gray":"#244CCC",display:"flex",justifyContent:"center",alignItems:"center",marginBottom:((c=q)==null?void 0:c.SMALL)||1},children:(n==null?void 0:n.icon)||u.jsx(y6,{size:24,color:"#FFFFFF"})}),u.jsx(w,{variant:"body1",mt:((d=q)==null?void 0:d.TINY)||.5,sx:{color:"#727272",minHeight:"50px",fontWeight:{xs:600,md:600},fontSize:{xs:"13px",md:"16px"}},children:(n==null?void 0:n.title)||""}),u.jsx(w,{mt:((h=q)==null?void 0:h.TINY)||.5,sx:{color:"#727272",fontSize:{xs:"10px",md:"12px"}},children:(n==null?void 0:n.description)||""})]})})})},(n==null?void 0:n.id)||o)})})})})})},Er=P("MANAGEMENT_SEND_SMS",async(e,{dispatch:t})=>{var r,a;try{t(b());const{id:n,...o}=e,{data:l,status:s}=await _.put(`management-send-sms/${n}/`,o);return t(g()),{data:l,status:s}}catch(n){return t(g()),{error:((a=(r=n.response)==null?void 0:r.data)==null?void 0:a.result)||"خطا در ارسال پیامک"}}}),br=({item:e,item_id:t,updateTable_data:r})=>{const a=k(),[n]=C.useContext(D),o=()=>{a(Y({title:"ویرایش",content:u.jsx(l,{})}))},l=()=>{const s=M({username:$().required("نام کاربری الزامی است").min(3,"حداقل ۳ کاراکتر وارد کنید"),password:$().required("رمز عبور الزامی است").min(6,"حداقل ۶ کاراکتر وارد کنید")});return u.jsx(_0,{initialValues:{username:(e==null?void 0:e.username)||"",password:(e==null?void 0:e.password)||""},enableReinitialize:!0,validationSchema:s,onSubmit:(c,{setSubmitting:d})=>{const h={id:t,username:c.username,password:c.password};a(Er(h)).then(y=>{d(!1),y.error?n({vertical:"top",horizontal:"center",msg:y.error,severity:"error"}):(r(),a(K()),n({vertical:"top",horizontal:"center",msg:"ویرایش با موفقیت انجام شد",severity:"success"}))})},children:({values:c,errors:d,touched:h,handleChange:y,handleBlur:A,isSubmitting:F})=>u.jsx(m0,{children:u.jsxs(cu,{display:"flex",flexDirection:"column",gap:2,children:[u.jsx(S,{label:"نام کاربری",name:"username",value:c.username,onChange:y,onBlur:A,error:h.username&&!!d.username,helperText:h.username&&d.username,fullWidth:!0}),u.jsx(S,{label:"رمز عبور",name:"password",type:"text",value:c.password,onChange:y,onBlur:A,error:h.password&&!!d.password,helperText:h.password&&d.password,fullWidth:!0}),u.jsx(R,{variant:"contained",color:"primary",type:"submit",disabled:!t||F,children:"ثبت"})]})})})};return u.jsx(i,{container:!0,children:u.jsx(ou,{title:"ویرایش",children:u.jsx(G,{color:"primary",onClick:o,children:u.jsx(du,{})})})})},Sr=()=>{const e=k(),[t,r]=C.useState([]),[a,n]=C.useState(1),[o,l]=C.useState(10),[s,c]=C.useState([]),[d,h]=C.useState(0),y=C.useCallback(async()=>{var p;e(b());try{const j=await _.get("management-send-sms/");e(g()),r((j==null?void 0:j.data)||[]),h(((p=j==null?void 0:j.data)==null?void 0:p.count)||0)}catch(j){e(g()),console.error("Error fetching users:",j)}},[e]);C.useEffect(()=>{y(1)},[y]);const A=C.useCallback(()=>{y(1)},[y]),F=p=>{n(p),y(p)},x=(p,j)=>{l(p)};return C.useEffect(()=>{const p=t==null?void 0:t.map((j,E)=>[a===1?E+1:E+o*(a-1)+1,j==null?void 0:j.name,j==null?void 0:j.username,j==null?void 0:j.password,u.jsx(br,{updateTable_data:A,item:j,item_id:j==null?void 0:j.id},`ops-${E}`)]);c(p)},[t]),u.jsxs(u.Fragment,{children:[u.jsx(i,{container:!0,alignItems:"center",mb:q.SMALL,gap:q.SMALL}),u.jsx(uu,{data:s,columns:["ردیف","نام","نام کابری","رمز عبور","ویرایش"],handlePageChange:F,handlePerRowsChange:x,totalRows:d,title:"مدیریت ارسال پیامک"})]})},kr=({item:e,updateTable:t})=>{const r={market_capacity_percent:(e==null?void 0:e.marketCapacityPercent)??0,market_light_capacity:(e==null?void 0:e.marketLightCapacity)??!1,market_light_capacity_percent:(e==null?void 0:e.marketLightCapacityPercent)??0,total_kill_capacity:(e==null?void 0:e.totalKillCapacity)??0,total_kill_capacity_percent:(e==null?void 0:e.totalKillCapacityPercent)??0},a=k(),[n]=C.useContext(D),[o,l]=C.useState((e==null?void 0:e.marketBuying)||!1),[s,c]=C.useState((e==null?void 0:e.marketBuyingLimitation)||!1),[d,h]=C.useState((e==null?void 0:e.marketBuyingCapacityPercentStatus)||!1),[y,A]=C.useState(!!r.market_light_capacity),F=(j,E)=>M({market_capacity_percent:j&&d?N().required("درصد خرید کل الزامی است").min(0,"حداقل مقدار 0 است").max(100,"حداکثر مقدار 100 است").typeError("فقط عدد مجاز است"):N().notRequired(),total_kill_capacity:s&&!d?N().required("سقف کشتار الزامی است!").typeError("فقط عدد مجاز است"):N().notRequired(),total_kill_capacity_percent:s&&!d?N().required("درصد از سقف کشتار الزامی است!").typeError("فقط عدد مجاز است").min(0,"حداقل مقدار 0 است").max(100,"حداکثر مقدار 100 است"):N().notRequired(),market_light_capacity_percent:j&&y&&s?N().required("درصد خرید سبک الزامی است").min(0,"حداقل مقدار 0 است").max(100,"حداکثر مقدار 100 است").typeError("فقط عدد مجاز است"):N().notRequired()}),x=C.useMemo(()=>F(o),[o,y,s,d]);C.useEffect(()=>{p.validateForm()},[o,y,s,d]);const p=H({initialValues:{market_capacity_percent:r.market_capacity_percent??"",total_kill_capacity:r.total_kill_capacity??"",total_kill_capacity_percent:r.total_kill_capacity_percent??"",market_light_capacity_percent:r.market_light_capacity_percent??""},validationSchema:x,validateOnBlur:!0,validateOnChange:!0,onSubmit:(j,E)=>{const T={key:e==null?void 0:e.key,market_buying:o,market_buying_limitation:s,market_buying_capacity_percent_status:!!(o&&s&&d),market_capacity_percent:o&&s&&d?Number(j.market_capacity_percent):0,total_kill_capacity_percent:o&&s&&!d?j==null?void 0:j.total_kill_capacity_percent:0,market_light_capacity:y,market_light_capacity_percent:y&&s?Number(j.market_light_capacity_percent):0};a(Au(T)).then(O=>{O.payload.error?n({vertical:"top",horizontal:"center",msg:O.payload.error,severity:"error"}):(a(K()),t(),n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}),E.setSubmitting(!1)}});return u.jsxs(i,{container:!0,xs:12,children:[u.jsxs(i,{container:!0,gap:2,xs:12,children:[u.jsx(i,{xs:12,children:u.jsxs(Q,{component:"fieldset",children:[u.jsx(Du,{component:"legend",children:"اجازه خرید"}),u.jsxs(Z,{fullWidth:!0,row:!0,name:"market_buying",value:o?"true":"false",onChange:j=>l(j.target.value==="true"),children:[u.jsx(v,{value:"true",control:u.jsx(I,{}),label:"دارد"}),u.jsx(v,{value:"false",control:u.jsx(I,{}),label:"ندارد"})]})]})}),o&&u.jsxs(i,{container:!0,gap:2,xs:12,children:[u.jsx(i,{xs:12,children:u.jsxs(Q,{component:"fieldset",children:[u.jsx(Du,{component:"legend",children:"محدودیت کشتار"}),u.jsxs(Z,{fullWidth:!0,row:!0,name:"market_buying",value:s?"true":"false",onChange:j=>c(j.target.value==="true"),children:[u.jsx(v,{value:"true",control:u.jsx(I,{}),label:"دارد"}),u.jsx(v,{value:"false",control:u.jsx(I,{}),label:"ندارد"})]})]})}),s&&u.jsx(i,{xs:12,children:u.jsxs(Q,{component:"fieldset",children:[u.jsx(Du,{component:"legend",children:"نوع محدودیت"}),u.jsxs(Z,{fullWidth:!0,row:!0,name:"market_buying",value:d?"true":"false",onChange:j=>h(j.target.value==="true"),children:[u.jsx(v,{value:"false",control:u.jsx(I,{}),label:"درصد از سقف کشتار"}),u.jsx(v,{value:"true",control:u.jsx(I,{}),label:"درصد از اعلام کشتارها"})]})]})}),s&&d&&u.jsx(i,{item:!0,xs:12,children:u.jsx(S,{size:"small",fullWidth:!0,label:"درصد از کل کشتار",name:"market_capacity_percent",value:p.values.market_capacity_percent,onChange:p.handleChange,onBlur:p.handleBlur,error:p.touched.market_capacity_percent&&!!p.errors.market_capacity_percent,helperText:p.touched.market_capacity_percent&&p.errors.market_capacity_percent})}),s&&!d&&u.jsx(i,{item:!0,xs:12,children:u.jsx(S,{disabled:!0,size:"small",fullWidth:!0,label:"سقف کشتار",name:"total_kill_capacity",value:p.values.total_kill_capacity,onChange:p.handleChange,onBlur:p.handleBlur,error:p.touched.total_kill_capacity&&!!p.errors.total_kill_capacity,helperText:p.touched.total_kill_capacity&&p.errors.total_kill_capacity})}),s&&!d&&u.jsx(i,{item:!0,xs:12,children:u.jsx(S,{size:"small",fullWidth:!0,label:"درصد از سقف کشتار",name:"total_kill_capacity_percent",value:p.values.total_kill_capacity_percent,onChange:p.handleChange,onBlur:p.handleBlur,error:p.touched.total_kill_capacity_percent&&!!p.errors.total_kill_capacity_percent,helperText:p.touched.total_kill_capacity_percent&&p.errors.total_kill_capacity_percent})}),s&&u.jsx(i,{item:!0,xs:12,children:u.jsx(Q,{component:"fieldset",children:u.jsx(v,{control:u.jsx(lu,{checked:y,onChange:j=>A(j.target.checked),name:"market_light_capacity"}),label:"اولویت خرید سبک"})})}),y&&s&&u.jsx(i,{item:!0,xs:12,children:u.jsx(S,{fullWidth:!0,type:"number",name:"market_light_capacity_percent",label:"درصد خرید سبک",value:p.values.market_light_capacity_percent,onChange:p.handleChange,onBlur:p.handleBlur,error:p.touched.market_light_capacity_percent&&!!p.errors.market_light_capacity_percent,helperText:p.touched.market_light_capacity_percent&&p.errors.market_light_capacity_percent})})]})]}),u.jsx(i,{container:!0,xs:12,sx:{width:"100%"},mt:2,children:u.jsx(R,{onClick:p.handleSubmit,type:"submit",variant:"contained",fullWidth:!0,disabled:!p.isValid,children:"ثبت"})})]})},Pr=()=>{const e=O=>{d(O.target.value)},t=k(),[r,a]=C.useState([]),[n,o]=C.useState(0),[l,s]=C.useState(10),[c,d]=C.useState(""),[h,y]=C.useState(1),[A,F]=C.useState([]),x=async O=>{let f;t(b()),f=await _.get(`market-kill-houses/?search=filter&value=${c}&role=${V()}&page=${O}&page_size=${l}`),t(g()),a(f.data.results),o(f.data.count)},p=O=>{x(O),y(O)},j=O=>{s(O),y(1)},E=()=>{x(h!==0?h:1)};C.useEffect(()=>{const O=r==null?void 0:r.map((f,B)=>{var U,m;return[h===1?B+1:B+l*(h-1)+1,f==null?void 0:f.name,`${f==null?void 0:f.fullname} (${f==null?void 0:f.mobile})`,f!=null&&f.killer?"کشتارکن":"کشتارگاه",f!=null&&f.marketBuying?"دارد":"ندارد",(U=f==null?void 0:f.totalKillCapacity)==null?void 0:U.toLocaleString(),(m=f==null?void 0:f.totalKillCapacityPercent)==null?void 0:m.toLocaleString(),`%${f==null?void 0:f.marketCapacityPercent}`,f!=null&&f.marketLightCapacity?"دارد":"ندارد",f!=null&&f.marketLightCapacity?`%${f==null?void 0:f.marketLightCapacityPercent}`:"-",u.jsx(ou,{title:"تعیین درصد",placement:"left-start",children:u.jsx(G,{"aria-label":"delete",color:"primary",onClick:()=>{t(Y({title:"تعیین درصد",content:u.jsx(kr,{updateTable:E,item:f})}))},children:u.jsx(v0,{})})},B)]});F(O)},[r]),C.useEffect(()=>{x(1)},[t,l]);const T=async O=>{O.preventDefault(),t(b());try{const f=await _.get(`market-kill-houses/?role=${V()}&search=filter&value=${c}&page=1&page_size=${l}`);a(f.data.results),o(f.data.count),t(g())}catch(f){console.error("Error fetching data:",f)}};return u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:u.jsx(i,{children:u.jsxs("form",{onSubmit:T,children:[u.jsx(S,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:e}),u.jsx(R,{type:"submit",onClick:T,endIcon:u.jsx(Xe,{}),children:"جستجو"})]})})}),u.jsx(uu,{data:A,columns:["ردیف","نام","نام مالک","نوع واحد","اجازه خرید","سقف کشتار","درصد از سقف کشتار","درصد از کل خرید","اولویت خرید سبک"," خرید سبک","عملیات"],handlePageChange:p,totalRows:n,page:h,perPage:l,handlePerRowsChange:j,title:"کشتارگاه ها"})]})};function Ir(e){var o,l;let t=String(e).replace(/[^0-9.]/g,"");const r=t.indexOf(".");r!==-1&&(t=t.slice(0,r+1)+t.slice(r+1).replace(/\./g,"")),t.length===2&&!t.includes(".")&&(t=`${t[0]}.${t[1]}`);const a=t.split(".");if(((o=a[0])==null?void 0:o.length)>1){const s=a[0][0],c=((l=a[0])==null?void 0:l.slice(1))+(a[1]||"");t=c?`${s}.${c.replace(/\D/g,"").slice(0,1)}`:`${s}`}if(t.includes(".")){const[s,c=""]=t.split(".");t=`${s}.${c.slice(0,1)}`}t=t.replace(/^0(\d)/,"$1"),t==="."&&(t="");const n=parseFloat(t);return Number.isNaN(n)||(n>=10&&(t="9.9"),n<0&&(t="0")),t}const wr=M({from_age:N().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),to_age:N().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),from_weight:$().required("این فیلد اجباری است!").test("is-weight","Format: d.d and < 10",e=>e==null||e===""?!0:/^\d(\.\d)?$/.test(String(e))&&parseFloat(e)<10),to_weight:$().required("این فیلد اجباری است!").test("is-weight","Format: d.d and < 10",(e,t)=>{if(e==null||e==="")return!0;if(!(/^\d(\.\d)?$/.test(String(e))&&parseFloat(e)<10))return!1;const a=parseFloat(t.parent.from_weight),n=parseFloat(e);return!Number.isNaN(a)&&!Number.isNaN(n)?n>=a||t.createError({message:"حداکثر وزن از حداقل وزن باید بیشتر باشد!"}):!0})}),Re=({item:e,fetchData:t})=>{const r=k(),[a]=C.useContext(D),n=H({initialValues:{from_age:e==null?void 0:e.fromAge,to_age:e==null?void 0:e.toAge,from_weight:e==null?void 0:e.fromWeight,to_weight:e==null?void 0:e.toWeight},validationSchema:wr,validateOnChange:!0,validateOnBlur:!0,onSubmit:s=>{const c={from_age:Number(s.from_age),to_age:Number(s.to_age),from_weight:s.from_weight===""?null:Number(s.from_weight),to_weight:s.to_weight===""?null:Number(s.to_weight)};r((e?j0:f0)({...c,...e?{id:e==null?void 0:e.id}:{}})).then(h=>{h.payload.error?a({vertical:"top",horizontal:"center",msg:h.payload.error,severity:"error"}):(a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),r(K()),t())})}});C.useEffect(()=>{n.validateForm()},[]);const o=s=>{["e","E","+","-",","].includes(s.key)&&s.preventDefault()},l=s=>c=>{const d=Ir(c.target.value);n.setFieldValue(s,d)};return u.jsxs(i,{container:!0,xs:12,gap:2,justifyContent:"center",alignItems:"center",dierction:"column",children:[u.jsx(S,{fullWidth:!0,label:"از سن",name:"from_age",type:"number",value:n.values.from_age,onChange:n.handleChange,onBlur:n.handleBlur,inputProps:{step:1,inputMode:"numeric",pattern:"[0-9]*",min:0,max:150},onKeyDown:o,error:!!(n.touched.from_age&&n.errors.from_age),helperText:n.touched.from_age&&n.errors.from_age}),u.jsx(S,{fullWidth:!0,label:"تا سن",name:"to_age",type:"number",value:n.values.to_age,onChange:n.handleChange,onBlur:n.handleBlur,inputProps:{step:1,inputMode:"numeric",pattern:"[0-9]*",min:0,max:150},onKeyDown:o,error:!!(n.touched.to_age&&n.errors.to_age),helperText:n.touched.to_age&&n.errors.to_age}),u.jsx(S,{fullWidth:!0,label:"از وزن",name:"from_weight",value:n.values.from_weight,onChange:l("from_weight"),onBlur:n.handleBlur,inputProps:{inputMode:"decimal"},onKeyDown:o,error:!!(n.touched.from_weight&&n.errors.from_weight),helperText:n.touched.from_weight&&n.errors.from_weight}),u.jsx(S,{fullWidth:!0,label:"تا وزن",name:"to_weight",value:n.values.to_weight,onChange:l("to_weight"),onBlur:n.handleBlur,inputProps:{inputMode:"decimal"},onKeyDown:o,error:!!(n.touched.to_weight&&n.errors.to_weight),helperText:n.touched.to_weight&&n.errors.to_weight}),u.jsx(R,{disabled:n.values.to_age<=n.values.from_age,fullWidth:!0,type:"submit",variant:"contained",onClick:n.handleSubmit,children:e?"ویرایش":"ثبت"})]})},Tr=()=>{const e=k(),[t]=C.useContext(D),[r,a]=C.useState(),[n,o]=C.useState(),l=()=>{e(E0()).then(c=>{a(c.payload.data)})};C.useEffect(()=>{l()},[]),C.useEffect(()=>{const c=r==null?void 0:r.map((d,h)=>[h+1,d==null?void 0:d.fromAge,d==null?void 0:d.toAge,d==null?void 0:d.fromWeight,d==null?void 0:d.toWeight,u.jsx(s,{onEdit:()=>{e(Y({title:"ویرایش بازه",content:u.jsx(Re,{fetchData:l,item:d})}))},onDelete:()=>{e(Y({title:"آیا مطمئن هستید؟",content:u.jsxs(i,{container:!0,spacing:2,children:[u.jsx(i,{item:!0,children:u.jsx(R,{variant:"contained",color:"error",onClick:()=>{e(F0(d==null?void 0:d.id)).then(y=>{y.payload.error?t({vertical:"top",horizontal:"center",msg:y.payload.error,severity:"error"}):(l(),e(K()),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"})}),u.jsx(i,{item:!0,children:u.jsx(R,{onClick:()=>{e(K())},children:"لغو"})})]})}))}},`actions-${h}`)]);o(c)},[r]);const s=({onEdit:c,onDelete:d})=>{const[h,y]=C.useState(null),A=!!h,F=E=>{y(E.currentTarget)},x=()=>{y(null)},p=()=>{c(),x()},j=()=>{d(),x()};return u.jsxs(i,{container:!0,justifyContent:"center",children:[u.jsx(G,{color:"primary",onClick:F,children:u.jsx(du,{})}),u.jsx(Yu,{open:A,anchorEl:h,onClose:x,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsxs(Qu,{sx:{minWidth:150,p:1},children:[u.jsxs(yu,{onClick:p,sx:{py:1},children:[u.jsx(_u,{children:u.jsx(ru,{color:"primary"})}),u.jsx(mu,{primary:u.jsx(w,{variant:"body2",color:"textPrimary",children:"ویرایش"})})]}),u.jsxs(yu,{onClick:j,sx:{py:1},children:[u.jsx(_u,{children:u.jsx(Xu,{color:"error"})}),u.jsx(mu,{primary:u.jsx(w,{variant:"body2",color:"textPrimary",children:"حذف"})})]})]})})]})};return u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",children:[u.jsx(R,{variant:"contained",color:"primary",onClick:()=>{e(Y({title:"ایجاد بازه جدید",content:u.jsx(Re,{fetchData:l})}))},children:"ایجاد بازه جدید"}),u.jsx(uu,{title:"بازه وزنی",columns:["ردیف","از سن","تا سن","حداقل وزن","حداکثر وزن","عملیات"],data:n,paginated:!0})]})},Rr=P("PROVINCE_POLICY_GET_WEIGHT_CATEGORY",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.get("index-weight-category/");return t(g()),{data:r,status:a}});P("PROVINCE_POLICY_SUBMIT_WEIGHT_CATEGORY",async(e,{dispatch:t})=>{t(b());try{const{data:r,status:a}=await _.post("index-weight-category/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}});const Dr=P("PROVINCE_POLICY_EDIT_WEIGHT_CATEGORY",async(e,{dispatch:t})=>{t(b());try{const{data:r,status:a}=await _.put("index-weight-category/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}});P("PROVINCE_DELETE_WEIGHT_CATEGORY",async(e,{dispatch:t})=>{t(b());try{const{data:r,status:a}=await _.delete(`index-weight-category/${e}/`);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}});const Or=({item:e,fetchData:t})=>{const r=k(),[a]=C.useContext(D),n=H({initialValues:{min_value:(e==null?void 0:e.minValue)||"",max_value:(e==null?void 0:e.maxValue)||""},validationSchema:M({min_value:N().typeError("لطفا فیلد را به صورت عددی وارد کنید.!").required("این فیلد اجباری است!"),max_value:N().typeError("لطفا فیلد را به صورت عددی وارد کنید.!").required("این فیلد اجباری است!")}),onSubmit:async o=>{r(Dr({...o,key:e==null?void 0:e.key})).then(l=>{l.payload.error?a({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(),r(K()))})}});return u.jsx(i,{container:!0,xs:12,direction:"column",children:u.jsx("form",{onSubmit:n.handleSubmit,children:u.jsxs(i,{container:!0,xs:12,gap:2,direction:"column",children:[u.jsx(S,{fullWidth:!0,id:"min_value",size:"small",label:"حداقل وزن",variant:"outlined",sx:{width:"100%"},value:n.values.min_value,error:n.touched.min_value?!!n.errors.min_value:null,onChange:n.handleChange,onBlur:n.handleBlur,helperText:n.touched.min_value&&n.errors.min_value?n.errors.min_value:null}),u.jsx(S,{fullWidth:!0,id:"max_value",size:"small",label:"حداکثر وزن",variant:"outlined",sx:{width:"100%"},value:n.values.max_value,error:n.touched.max_value?!!n.errors.max_value:null,onChange:n.handleChange,onBlur:n.handleBlur,helperText:n.touched.max_value&&n.errors.max_value?n.errors.max_value:null}),u.jsx(R,{variant:"contained",fullWidth:!0,onClick:n.handleSubmit,children:"ویرایش"})]})})})},Lr=()=>{const e=k(),[t,r]=C.useState(),[a,n]=C.useState(),o=()=>{e(Rr()).then(l=>{r(l.payload.data)})};return C.useEffect(()=>{o()},[]),C.useEffect(()=>{const l=t==null?void 0:t.map((s,c)=>[c+1,s==null?void 0:s.name,s==null?void 0:s.minValue,s==null?void 0:s.maxValue,u.jsx(i,{container:!0,alignItems:"center",gap:12,justifyContent:"center",children:u.jsx(G,{color:"primary",onClick:()=>{e(Y({title:"ویرایش دسته بندی وزنی",content:u.jsx(Or,{fetchData:o,item:s})}))},children:u.jsx(ru,{})})},c)]);n(l)},[t]),u.jsx(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",children:u.jsx(uu,{title:"دسته بندی وزنی",columns:["ردیف","نام","حداقل وزن","حداکثر وزن","ویرایش"],data:a,paginated:!0})})},Nr=P("PROVINCE_POLICY_GET_FINE_PERMISSION",async(e,{dispatch:t})=>{t(b());const{data:r,status:a}=await _.get("fine-permission/");return t(g()),{data:r,status:a}}),Br=P("PROVINCE_POLICY_EDIT_WEIGHT_FINE_PERMISSION",async(e,{dispatch:t})=>{t(b());try{const{data:r,status:a}=await _.put("fine-permission/0/",e);return t(g()),{data:r,status:a}}catch(r){return t(g()),{error:r.response.data.result}}}),zr=({item:e,fetchData:t})=>{const r=k(),[a]=C.useContext(D),[n,o]=C.useState({start_time:(e==null?void 0:e.startTime)||"01:00:00",end_time:(e==null?void 0:e.endTime)||"24:00:00",fine:(e==null?void 0:e.fine)||!1}),l=H({initialValues:{fine_coefficient:(e==null?void 0:e.fineCoefficient)||0},validationSchema:M({fine_coefficient:N().typeError("لطفا فیلد را به صورت عددی وارد کنید!").required("این فیلد اجباری است!")}),onSubmit:async s=>{const c={key:e==null?void 0:e.key,fine:n.fine,start_time:n.fine?n.start_time:"00:00:00",end_time:n.fine?n.end_time:"00:00:00",fine_coefficient:n.fine?s.fine_coefficient:0};r(Br(c)).then(d=>{d.payload.error?a({vertical:"top",horizontal:"center",msg:d.payload.error,severity:"error"}):(a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(),r(K()))})}});return u.jsx(i,{container:!0,xs:12,direction:"column",justifyContent:"center",children:u.jsx("form",{onSubmit:l.handleSubmit,children:u.jsxs(i,{container:!0,xs:12,gap:2,direction:"column",children:[u.jsx(i,{item:!0,display:"flex",justifyContent:"start",children:u.jsxs(Z,{row:!0,value:n.fine?"active":"inactive",onChange:s=>o(c=>({...c,fine:s.target.value==="active"})),children:[u.jsx(v,{value:"active",control:u.jsx(I,{}),label:"فعال"}),u.jsx(v,{value:"inactive",control:u.jsx(I,{}),label:"غیرفعال"})]})}),n.fine&&u.jsxs(i,{item:!0,display:"flex",alignItems:"center",sx:{flexDirection:{xs:"column",md:"row"}},gap:2,children:[u.jsx(S,{id:"fine_coefficient",size:"small",label:"ضریب جریمه",variant:"outlined",value:l.values.fine_coefficient,error:l.touched.fine_coefficient?!!l.errors.fine_coefficient:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.fine_coefficient&&l.errors.fine_coefficient?l.errors.fine_coefficient:null,sx:{width:363,marginTop:"26px"}}),u.jsxs(i,{item:!0,display:"flex",alignItems:"center",gap:2,children:[u.jsx(nu,{value:n.start_time,onChange:s=>o(c=>({...c,start_time:s})),label:"از"}),u.jsx(nu,{value:n.end_time,onChange:s=>o(c=>({...c,end_time:s})),label:"تا"})]})]}),u.jsx(R,{variant:"contained",fullWidth:!0,type:"submit",children:"ویرایش"})]})})})},Ur=()=>{const e=k(),[t,r]=C.useState(),[a,n]=C.useState(),o=()=>{e(Nr()).then(l=>{r(l.payload.data)})};return C.useEffect(()=>{o()},[]),C.useEffect(()=>{const l=t==null?void 0:t.map((s,c)=>[c+1,s==null?void 0:s.name,s!=null&&s.startTime&&(s!=null&&s.endTime)&&(s==null?void 0:s.startTime)!=="00:00:00"&&(s==null?void 0:s.endTime)!=="00:00:00"?`از ${s==null?void 0:s.startTime.slice(0,5)} تا ${s==null?void 0:s.endTime.slice(0,5)}`:"-",s==null?void 0:s.fineCoefficient,s!=null&&s.fine?"فعال":"غیر فعال",u.jsx(i,{container:!0,alignItems:"center",gap:12,justifyContent:"center",children:u.jsx(G,{color:"primary",onClick:()=>{e(Y({title:"ویرایش جریمه",content:u.jsx(zr,{fetchData:o,item:s})}))},children:u.jsx(ru,{})})},c)]);n(l)},[t]),u.jsx(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",children:u.jsx(uu,{name:"جریمه",columns:["ردیف","نام","زمان","ضریب جریمه","وضعیت","ویرایش"],data:a,paginated:!0})})},Vr=M({percentInsideProvince:N().typeError("باید عدد وارد کنید").min(0,"نمی‌تواند کمتر از 0 باشد").max(100,"نمی‌تواند بیشتر از 100 باشد").required("الزامی"),percentOutsideProvince:N().typeError("باید عدد وارد کنید").min(0,"نمی‌تواند کمتر از 0 باشد").max(100,"نمی‌تواند بیشتر از 100 باشد").required("الزامی"),percentSegmentation:N().typeError("باید عدد وارد کنید").min(0,"نمی‌تواند کمتر از 0 باشد").max(100,"نمی‌تواند بیشتر از 100 باشد").required("الزامی")}).test("total-percentage","مجموع درصدها نمی‌تواند بیشتر از 100 باشد",function(e){const{percentInsideProvince:t,percentOutsideProvince:r,percentSegmentation:a}=e;return(t||0)+(r||0)+(a||0)<=100}),De=({item:e,updateTable:t,type:r})=>{const[a]=C.useContext(D),n=k(),o=H({initialValues:{percentInsideProvince:r==="gov"?e==null?void 0:e.inProvinceGovernmentalSellingPercent:(e==null?void 0:e.inProvinceFreeSellingPercent)||0,percentOutsideProvince:r==="gov"?e==null?void 0:e.outProvinceGovernmentalSellingPercent:(e==null?void 0:e.outProvinceFreeSellingPercent)||0,percentSegmentation:r==="gov"?e==null?void 0:e.segmentationGovernmentalPercent:(e==null?void 0:e.segmentationFreeSellingPercent)||0,percentColdHouse:r==="gov"?e==null?void 0:e.coldHouseGovernmentalPercent:(e==null?void 0:e.coldHouseFreePercent)||0},validationSchema:Vr,onSubmit:c=>{n(Au({key:e==null?void 0:e.key,...r==="gov"?{governmental_selling_permission:!0,in_province_governmental_selling_percent:c.percentInsideProvince,segmentation_governmental_percent:c.percentSegmentation,out_province_governmental_selling_percent:c.percentOutsideProvince,cold_house_governmental_percent:c.percentColdHouse}:{free_selling_permission:!0,in_province_free_selling_percent:c.percentInsideProvince,out_province_free_selling_percent:c.percentOutsideProvince,segmentation_free_selling_percent:c.percentSegmentation,cold_house_free_percent:c.percentColdHouse}})).then(d=>{d.payload.error?a({vertical:"top",horizontal:"center",msg:d.payload.error,severity:"error"}):a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),n(K()),t()})}}),s=(()=>{const{percentInsideProvince:c,percentOutsideProvince:d,percentSegmentation:h,percentColdHouse:y}=o.values;return(c||0)+(d||0)+(y||0)+(h||0)})();return u.jsx(cu,{component:"form",onSubmit:o.handleSubmit,sx:{width:"100%"},children:u.jsxs(i,{container:!0,spacing:2,alignItems:"flex-start",children:[u.jsx(i,{item:!0,xs:12,sm:6,children:u.jsx(S,{fullWidth:!0,id:"percentInsideProvince",name:"percentInsideProvince",label:"حداقل توزیع داخل استان",type:"number",value:o.values.percentInsideProvince,onChange:o.handleChange,onBlur:o.handleBlur,error:o.touched.percentInsideProvince&&!!o.errors.percentInsideProvince,helperText:o.touched.percentInsideProvince&&o.errors.percentInsideProvince,inputProps:{min:0,max:100,step:.1},size:"small"})}),u.jsx(i,{item:!0,xs:12,sm:6,children:u.jsx(S,{fullWidth:!0,id:"percentOutsideProvince",name:"percentOutsideProvince",label:"حداکثر فروش خارج استان",type:"number",value:o.values.percentOutsideProvince,onChange:o.handleChange,onBlur:o.handleBlur,error:o.touched.percentOutsideProvince&&!!o.errors.percentOutsideProvince,helperText:o.touched.percentOutsideProvince&&o.errors.percentOutsideProvince,inputProps:{min:0,max:100,step:.1},size:"small"})}),u.jsx(i,{item:!0,xs:12,sm:6,children:u.jsx(S,{fullWidth:!0,id:"percentSegmentation",name:"percentSegmentation",label:"حداکثر قطعه بندی",type:"number",value:o.values.percentSegmentation,onChange:o.handleChange,onBlur:o.handleBlur,error:o.touched.percentSegmentation&&!!o.errors.percentSegmentation,helperText:o.touched.percentSegmentation&&o.errors.percentSegmentation,inputProps:{min:0,max:100,step:.1},size:"small"})}),u.jsx(i,{item:!0,xs:12,sm:6,children:u.jsx(S,{fullWidth:!0,id:"percentColdHouse",name:"percentColdHouse",label:"حداکثر انجماد",type:"number",value:o.values.percentColdHouse,onChange:o.handleChange,onBlur:o.handleBlur,error:o.touched.percentColdHouse&&!!o.errors.percentColdHouse,helperText:o.touched.percentColdHouse&&o.errors.percentColdHouse,inputProps:{min:0,max:100,step:.1},size:"small"})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"center",spacing:1,children:[u.jsx(i,{xs:6,children:u.jsx(R,{onClick:o.handleSubmit,variant:"contained",color:"primary",disabled:!o.isValid||s>100,fullWidth:!0,children:"ثبت"})}),u.jsx(i,{xs:6,children:u.jsx(R,{onClick:()=>n(K()),variant:"contained",color:"error",fullWidth:!0,children:"انصراف"})})]})]})})},qr=()=>{const e=U=>{h(U.target.value)},[t]=C.useContext(D),r=k(),[a,n]=C.useState([]),[o,l]=C.useState(0),[s,c]=C.useState(10),[d,h]=C.useState(""),[y,A]=C.useState(1),[F,x]=C.useState([]),p=async U=>{let m;r(b()),m=await _.get(`market-kill-houses/?search=filter&value=${d}&role=${V()}&page=${U}&page_size=${s}`),r(g()),n(m.data.results),l(m.data.count)},j=U=>{p(U),A(U)},E=U=>{c(U),A(1)},T=()=>{p(y!==0?y:1)},O=U=>{r(Y({title:"فروش دولتی",content:u.jsx(De,{item:U,updateTable:T,type:"gov"})}))},f=U=>{r(Y({title:"فروش آزاد",content:u.jsx(De,{item:U,updateTable:T,type:"free"})}))};C.useEffect(()=>{const U=a==null?void 0:a.map((m,X)=>[y===1?X+1:X+s*(y-1)+1,m==null?void 0:m.name,`${m==null?void 0:m.fullname} (${m==null?void 0:m.mobile})`,m!=null&&m.killer?"کشتارکن":"کشتارگاه",u.jsx(_6,{amount:m==null?void 0:m.outProvinceFreeBuyingCommitmentPercent,updateTable:T,item:m},X),u.jsx(z,{checked:m==null?void 0:m.freeSaleFromFreeQuotaInProvince,onClick:()=>{r(Au({key:m==null?void 0:m.key,free_sale_from_free_quota_in_province:!(m!=null&&m.freeSaleFromFreeQuotaInProvince)})).then(W=>{W.payload.error?t({vertical:"top",horizontal:"center",msg:W.payload.error,severity:"error"}):(T(),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}},X),u.jsx(z,{checked:m==null?void 0:m.freeSaleFormGovernmentalQuota,onClick:()=>{r(Au({key:m==null?void 0:m.key,free_sale_form_governmental_quota:!(m!=null&&m.freeSaleFormGovernmentalQuota)})).then(W=>{W.payload.error?t({vertical:"top",horizontal:"center",msg:W.payload.error,severity:"error"}):(T(),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}},X),u.jsxs(i,{container:!0,alignItems:"center",xs:12,justifyContent:"start",direction:"row",children:[u.jsx(i,{xs:6,children:u.jsx(z,{checked:m==null?void 0:m.governmentalSellingPermission,onChange:()=>{const W=!(m!=null&&m.governmentalSellingPermission);r(Au({key:m==null?void 0:m.key,governmental_selling_permission:W,...W===!1?{in_province_governmental_selling_percent:0,segmentation_governmental_percent:0,out_province_governmental_selling_percent:0}:{}})).then(iu=>{W===!0?O(m):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),T()})}})}),(m==null?void 0:m.governmentalSellingPermission)&&u.jsx(i,{xs:6,children:u.jsx(G,{size:"small",onClick:()=>O(m),color:"primary",children:u.jsx(ru,{})})})]},X),u.jsxs(i,{container:!0,alignItems:"center",xs:12,justifyContent:"center",direction:"row",children:[u.jsx(i,{xs:6,children:u.jsx(z,{checked:m==null?void 0:m.freeSellingPermission,onChange:()=>{const W=!(m!=null&&m.freeSellingPermission);r(Au({key:m==null?void 0:m.key,free_selling_permission:W,...W===!1?{in_province_free_selling_percent:0,out_province_free_selling_percent:0,segmentation_free_selling_percent:0}:{}})).then(iu=>{W===!0?f(m):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),T()})}})}),u.jsxs(i,{xs:6,children:[(m==null?void 0:m.freeSellingPermission)&&u.jsx(G,{size:"small",onClick:()=>f(m),color:"primary",children:u.jsx(ru,{})})," "]})]},X),m==null?void 0:m.inProvinceGovernmentalSellingPercent,m==null?void 0:m.outProvinceGovernmentalSellingPercent,m==null?void 0:m.segmentationGovernmentalPercent,m==null?void 0:m.coldHouseGovernmentalPercent,m==null?void 0:m.inProvinceFreeSellingPercent,m==null?void 0:m.outProvinceFreeSellingPercent,m==null?void 0:m.segmentationFreeSellingPercent,m==null?void 0:m.coldHouseFreePercent]);x(U)},[a]),C.useEffect(()=>{p(1)},[r,s]);const B=async U=>{U.preventDefault(),r(b());try{const m=await _.get(`market-kill-houses/?role=${V()}&search=filter&value=${d}&page=1&page_size=${s}`);n(m.data.results),l(m.data.count),r(g())}catch(m){console.error("Error fetching data:",m)}};return u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:u.jsx(i,{children:u.jsxs("form",{onSubmit:B,children:[u.jsx(S,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:e}),u.jsx(R,{type:"submit",onClick:B,endIcon:u.jsx(Xe,{}),children:"جستجو"})]})})}),u.jsx(uu,{data:F,columns:["ردیف","نام","نام مالک","نوع واحد","درصد تحویل خرید خارج استان","فروش آزاد به داخل استان","فروش آزاد از سهمیه دولتی","فروش دولتی","فروش آزاد","درصد فروش دولتی داخل استان","درصد فروش دولتی خارج استان","درصد فروش دولتی قطعه بندی","درصد فروش دولتی انجماد","درصد فروش آزاد داخل استان","درصد فروش آزاد خارج استان","درصد فروش آزاد قطعه بندی","درصد فروش آزاد انجماد"],handlePageChange:j,totalRows:o,page:y,perPage:s,handlePerRowsChange:E,title:"کشتارگاه ها"})]})},Mr=({item:e,fetchData:t})=>{const r=k(),[a]=C.useContext(D),[n,o]=C.useState({time:(e==null?void 0:e.time)||"16:00:00",allow:(e==null?void 0:e.allow)!==void 0?e==null?void 0:e.allow:!0}),l=async s=>{var c,d;s.preventDefault(),r(b());try{await _.put(`restriction_carcass_distribution/${e==null?void 0:e.id}/`,{time:n.time,allow:n.allow}),r(g()),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(),r(K())}catch(h){r(g()),a({vertical:"top",horizontal:"center",msg:((d=(c=h==null?void 0:h.response)==null?void 0:c.data)==null?void 0:d.message)||"خطا در ویرایش اطلاعات",severity:"error"}),console.error("Error updating data:",h)}};return u.jsx(i,{container:!0,xs:12,direction:"column",justifyContent:"center",children:u.jsx("form",{onSubmit:l,children:u.jsxs(i,{container:!0,xs:12,gap:2,direction:"column",children:[u.jsx(i,{item:!0,display:"flex",justifyContent:"start",children:u.jsxs(Z,{row:!0,value:n.allow?"allow":"disallow",onChange:s=>o(c=>({...c,allow:s.target.value==="allow"})),children:[u.jsx(v,{value:"allow",control:u.jsx(I,{}),label:"فعال"}),u.jsx(v,{value:"disallow",control:u.jsx(I,{}),label:"غیر فعال"})]})}),u.jsx(i,{item:!0,display:"flex",alignItems:"center",gap:2,children:u.jsx(nu,{value:n.time,onChange:s=>o(c=>({...c,time:s})),label:"زمان"})}),u.jsx(R,{variant:"contained",fullWidth:!0,type:"submit",children:"ویرایش"})]})})})},Hr=()=>{const e=k(),[t]=C.useContext(D),[r,a]=C.useState([]),[n,o]=C.useState([]),l=async()=>{var c,d;e(b());try{const h=await _.get("restriction_carcass_distribution/");e(g()),a((h==null?void 0:h.data)||[])}catch(h){e(g()),t({vertical:"top",horizontal:"center",msg:((d=(c=h==null?void 0:h.response)==null?void 0:c.data)==null?void 0:d.message)||"خطا در دریافت اطلاعات",severity:"error"}),console.error("Error fetching data:",h)}};C.useEffect(()=>{l()},[]);const s=c=>({KillHouse:"کشتارگاه",Steward:"مباشر"})[c]||c;return C.useEffect(()=>{const c=r==null?void 0:r.map((d,h)=>[h+1,s(d==null?void 0:d.distributionType),d!=null&&d.out?"خارج استان":"داخل استان",(d==null?void 0:d.time)||"-",d!=null&&d.allow?"فعال":"غیر فعال",u.jsx(i,{container:!0,alignItems:"center",gap:12,justifyContent:"center",children:u.jsx(G,{color:"primary",onClick:()=>{e(Y({title:"ویرایش محدودیت توزیع لاشه",content:u.jsx(Mr,{fetchData:l,item:d})}))},children:u.jsx(ru,{})})},h)]);o(c)},[r]),u.jsx(u.Fragment,{children:u.jsx(uu,{title:"محدودیت توزیع لاشه",columns:["ردیف","نوع توزیع","محل توزیع","زمان","وضعیت","ویرایش"],data:n,paginated:!0})})},Tn=()=>{const{pathname:e}=Ke();return u.jsx(u.Fragment,{children:u.jsx(cu,{display:"flex",justifyContent:"center",children:u.jsxs(i,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[e===b0||e===S0||e===k0?u.jsxs(i,{justifyContent:"center",my:q.MEDIUM,children:[u.jsx(i,{children:u.jsx(w,{variant:"h6",children:"مدیریت فرآیند"})}),u.jsx(D6,{})]}):u.jsx(n0,{}),u.jsx(i,{container:!0,justifyContent:"space-between",gap:q.SMALL,children:u.jsxs(i,{mt:q.SMALL,xs:12,children:[(e===zu||e===ze||e===Ue)&&u.jsx(or,{}),(e===P0||e===I0)&&u.jsx(Pr,{}),(e===w0||e===T0)&&u.jsx(qr,{}),(e===R0||e===D0||e===O0)&&u.jsx(Y6,{}),(e===L0||e===N0||e===B0)&&u.jsx(M6,{}),(e===z0||e===U0||e===V0)&&u.jsx(R6,{}),(e===Uu||e===Ve)&&u.jsx(Cr,{}),e===Vu&&u.jsx(mr,{}),(e===qu||e===qe)&&u.jsx(fr,{}),e===ku&&u.jsx(Fr,{}),e===Pu&&u.jsx(Sr,{}),(e===Mu||e===Me)&&u.jsx(Tr,{}),(e===Hu||e===He)&&u.jsx(Lr,{}),(e===Wu||e===We)&&u.jsx(Ur,{}),(e===Gu||e===Ge)&&u.jsx(Hr,{})]})})]})})})};export{Tn as default}; diff --git a/build/assets/ManageProcess-DBlSLZ24.css b/build/assets/ManageProcess-DBlSLZ24.css new file mode 100644 index 0000000..9494d0f --- /dev/null +++ b/build/assets/ManageProcess-DBlSLZ24.css @@ -0,0 +1 @@ +.time-picker{position:relative;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;width:100%;max-width:100px}.time-picker-label{display:block;margin-bottom:8px;font-size:14px;color:#333;font-weight:500}.time-picker-input-container{position:relative;display:flex;align-items:center}.time-picker-input{width:100%;padding:10px 40px 10px 12px;border:1px solid #ddd;border-radius:6px;font-size:14px;transition:border-color .2s;box-shadow:0 1px 2px #0000000d}.time-picker-input:focus{outline:none;border-color:#4a90e2;box-shadow:0 0 0 3px #4a90e233}.time-picker-input:disabled{background-color:#f5f5f5;cursor:not-allowed}.time-picker-toggle{position:absolute;right:8px;background:none;border:none;cursor:pointer;color:#666;padding:4px;display:flex;align-items:center;justify-content:center}.time-picker-toggle:disabled{color:#ccc;cursor:not-allowed}.time-picker-toggle:hover:not(:disabled){color:#333}.time-picker-dropdown{position:absolute;top:0;transform:translateY(-100%);left:0;margin-bottom:4px;background:#fff;border:1px solid #ddd;border-radius:6px;box-shadow:0 4px 12px #0000001a;z-index:1000;display:flex;max-height:300px;overflow-y:auto}.time-picker-column{flex:1;min-width:60px}.time-picker-header{padding:8px 12px;font-size:12px;font-weight:600;color:#666;background-color:#f9f9f9;border-bottom:1px solid #eee;text-align:center}.time-picker-list{overflow-y:auto;max-height:250px}.time-picker-item{display:block;width:100%;padding:8px 12px;border:none;background:none;text-align:center;cursor:pointer;font-size:14px;color:#333}.time-picker-item:hover{background-color:#f0f7ff}.time-picker-item.selected{background-color:#4a90e2;color:#fff} diff --git a/build/assets/ManageProcessWageFractions-Cl3DA4uk.js b/build/assets/ManageProcessWageFractions-Cl3DA4uk.js new file mode 100644 index 0000000..fcb1f5b --- /dev/null +++ b/build/assets/ManageProcessWageFractions-Cl3DA4uk.js @@ -0,0 +1 @@ +import{j as e,ak as v,B as M,I as G,aX as U,aa as X,b2 as $,b3 as R,aL as q,aM as J,aN as Q,b as Z}from"./mui-vendor-CkIVaoQP.js";import{B as ee}from"./BackButton-Crzr7NMa.js";import{L as f,j as E,h as A,A as T,u as ue,c as ae,M as te,G as g,C as z,O as B,X as ne,k as se,S as W}from"./index-CeyyVc1v.js";import{r as p}from"./react-vendor-CmFgShSM.js";import{a as b,u as D}from"./redux-vendor-B7uoacJt.js";import{d as re}from"./Edit-CqBj1Y2L.js";import{R as S}from"./ResponsiveTable-w7hk7Uq8.js";import{p as oe}from"./province-policy-wages-edit-killhouse-Law73imd.js";import{d as Y}from"./Save-nlxmeU5w.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const le=b("PROVINCE_POLICY_GET_WAGE_FRACTIONS",async(r,{dispatch:u})=>{u(f());const{data:a,status:o}=await E.get("wage-type/");return u(A()),{data:a,status:o}}),ce=b("PROVINCE_POLICY_CREATE_WAGE",async(r,{dispatch:u})=>{try{u(f());const{data:a,status:o}=await E.post("share-type/",r);return u(A()),{data:a,status:o}}catch(a){return u(A()),{error:a.response.data.result}}}),ie=b("PROVINCE_POLICY_EDIT_SHARE_TYPE",async(r,{dispatch:u})=>{try{u(f());const{data:a,status:o}=await E.put("share-type/"+r.id+"/",{name:r.name});return u(A()),{data:a,status:o}}catch(a){return u(A()),{error:a.response.data.result}}}),V=({fetchData:r,item:u,itsEdit:a,fetchDataShareTypes:o})=>{const[w]=p.useContext(T),y=D(),i=ue({initialValues:{wageName:u!=null&&u.name?u==null?void 0:u.name:""},validationSchema:ae({wageName:te().typeError("لطفا فیلد را به درستی وارد کنید.!")})});return p.useEffect(()=>{i.validateForm()},[]),e.jsxs(g,{container:!0,xs:12,gap:2,children:[e.jsx(g,{xs:12,children:e.jsx(v,{id:"wageName",label:"عنوان نقش",variant:"outlined",sx:{width:"100%"},value:i.values.wageName,error:i.touched.wageName?!!i.errors.wageName:null,onChange:i.handleChange,onBlur:i.handleBlur,helperText:i.touched.wageName&&i.errors.wageName?i.errors.wageName:null})}),e.jsx(g,{xs:12,children:e.jsx(M,{variant:"contained",disabled:!i.isValid,onClick:()=>{a?y(ie({name:i.values.wageName,id:u==null?void 0:u.id})).then(x=>{r(),o(),y(z()),x.payload.error?w({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):w({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})}):y(ce({name:i.values.wageName})).then(x=>{r(),o(),y(z()),x.payload.error?w({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):w({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},children:"ثبت"})})]})},de=b("PROVINCE_POLICY_EDIT_WAGE",async(r,{dispatch:u})=>{try{u(f());const{data:a,status:o}=await E.put("wage-type/0/",r);return u(A()),{data:a,status:o}}catch(a){return u(A()),{error:a.response.data.result}}}),Ce=b("PROVINCE_POLICY_GET_SHARE_TYPE",async(r,{dispatch:u})=>{u(f());const{data:a,status:o}=await E.get("share-type/");return u(A()),{data:a,status:o}}),pe=b("PROVINCE_POLICY_WAGES_SETUP_GET_KILLHOUSES",async(r,{dispatch:u})=>{u(f());const{data:a,status:o}=await E.get("kill_house/?gate-way-kill-houses=true/");return u(A()),{data:a,status:o}}),he=()=>{const[r]=p.useContext(T),u=D(),[a,o]=p.useState(),[w,y]=p.useState(),i=()=>{u(pe()).then(l=>{o(l.payload.data)})};p.useEffect(()=>{i()},[]);const x=l=>parseInt(l==null?void 0:l.companyGatewayPercent)+parseInt(l.unionGatewayPercent)+parseInt(l.guildsGatewayPercent)+parseInt(l.otherGatewayPercent)>100;p.useEffect(()=>{const l=a==null?void 0:a.map((t,n)=>{var m,F;return[n+1,t==null?void 0:t.name,(F=(m=t==null?void 0:t.killHouseOperator)==null?void 0:m.user)==null?void 0:F.mobile,e.jsx(v,{style:{width:"160px"},label:"سهم شرکت",value:t.companyGatewayPercent,onChange:h=>I(h,n),size:"small"},n),e.jsx(v,{style:{width:"160px"},label:"سهم اتحادیه",value:t.unionGatewayPercent,onChange:h=>_(h,n),size:"small"},n),e.jsx(v,{style:{width:"160px"},label:"سهم صنف",value:t.guildsGatewayPercent,onChange:h=>j(h,n),size:"small"},n),e.jsx(v,{style:{width:"160px"},label:"سهم دیگر",value:t.otherGatewayPercent,onChange:h=>N(h,n),size:"small"},n),e.jsx(G,{disabled:x(t),color:"primary",onClick:()=>{u(oe({kill_house_key:t==null?void 0:t.key,company_gateway_percent:parseInt(t==null?void 0:t.companyGatewayPercent),union_gateway_percent:parseInt(t.unionGatewayPercent),guilds_gateway_percent:parseInt(t.guildsGatewayPercent),other_gateway_percent:parseInt(t.otherGatewayPercent)})).then(h=>{h.payload.error?r({vertical:"top",horizontal:"center",msg:h.payload.error,severity:"error"}):(i(),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:e.jsx(Y,{})},n)]});y(l)},[a]);const I=(l,t)=>{const n=[...a];n[t].companyGatewayPercent=Number(l.target.value),o(n)},_=(l,t)=>{const n=[...a];n[t].unionGatewayPercent=Number(l.target.value),o(n)},j=(l,t)=>{const n=[...a];n[t].guildsGatewayPercent=Number(l.target.value),o(n)},N=(l,t)=>{const n=[...a];n[t].otherGatewayPercent=Number(l.target.value),o(n)};return e.jsx(g,{container:!0,alignItems:"center",justifyContent:"center",children:e.jsx(S,{paginated:!0,title:"بر اساس کشتارگاه",columns:["ردیف","نام کشتارگاه","موبایل","سهم شرکت","سهم اتحادیه","سهم صنف","سهم دیگر","ذخیره تغییرات"],data:w})})},ye=()=>{const r=D(),[u,a]=p.useState(),[o,w]=p.useState(),[y,i]=p.useState(),[x,I]=p.useState(),[_]=p.useContext(T),[j,N]=p.useState(0),l=(d,C)=>{N(C)},t=()=>{r(le()).then(d=>{a(d.payload.data)})},n=()=>{r(Ce()).then(d=>{i(d.payload.data)})};p.useEffect(()=>{j===0&&(t(),n())},[r,j]),p.useEffect(()=>{const d=u==null?void 0:u.map((s,c)=>{var k;return[c+1,s.name,e.jsx(U,{checked:s.status,onChange:P=>h(P,c,s),inputProps:{"aria-label":"controlled"}},c),e.jsx(v,{style:{width:{xs:"80px",lg:"120px"}},label:"مبلغ تعرفه",value:s.amount,disabled:!s.status,onChange:P=>F(P,c),size:"small",InputProps:{endAdornment:e.jsx(X,{position:"end",children:"ریال"})}},c),e.jsx(g,{container:!0,alignItems:"center",justifyContent:"center",gap:1,children:(k=s==null?void 0:s.percentages)==null?void 0:k.map((P,L)=>e.jsx(v,{disabled:!s.status,style:{width:{xs:"80px",lg:"100px"}},label:P.name,value:P.percent,onChange:K=>m(K,c,L),size:"small"},L))},c),e.jsx(G,{disabled:H(c)||!s.status,color:"primary",onClick:()=>O(s),children:e.jsx(Y,{})},c)]});I(d);const C=y==null?void 0:y.map((s,c)=>[c+1,s==null?void 0:s.name,e.jsx(G,{"aria-label":"delete",color:"primary",onClick:()=>{r(B({title:"ویرایش نقش",content:e.jsx(V,{itsEdit:!0,fetchData:t,fetchDataShareTypes:n,item:s})}))},children:e.jsx(re,{})},c)]);w(C)},[u,y]);const m=(d,C,s)=>{const c=[...u];c[C].percentages[s].percent=Number(d.target.value),a(c)},F=(d,C)=>{const s=[...u];s[C].amount=Number(d.target.value),a(s)},h=(d,C,s)=>{const c=[...u];c[C].status=!c[C].status,a(c,O(s))},H=d=>{if(u[d].percentages.length){let C=0;return u[d].percentages.forEach(s=>{C+=s.percent}),C!==100}},O=d=>{r(de(d)).then(C=>{t(),C.payload.error?_({vertical:"top",horizontal:"center",msg:C.payload.error,severity:"error"}):_({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})};return e.jsxs(g,{container:!0,alignItems:"center",justifyContent:"center",children:[ne()==="AdminX"&&e.jsxs($,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:j,onChange:l,children:[e.jsx(R,{label:"سهامداران"}),e.jsx(R,{label:"نوع تسویه"})]}),j===0&&e.jsx(e.Fragment,{children:e.jsxs(g,{container:!0,mb:2,children:[e.jsx(M,{variant:"contained",onClick:()=>{r(B({title:"افزودن نقش",content:e.jsx(V,{fetchData:t,fetchDataShareTypes:n})}))},children:"افزودن نقش"}),e.jsx(g,{xs:12,mt:2,children:e.jsxs(q,{children:[e.jsx(J,{expandIcon:e.jsx(se,{}),"aria-controls":"panel1-content",id:"panel1-header",children:"سهامداران"}),e.jsx(Q,{children:e.jsx(S,{paginated:!0,columns:["ردیف","نام","ویرایش"],data:o,title:"سهامداران"})})]})}),e.jsx(S,{paginated:!0,title:"تعرفه ها",columns:["ردیف","عنوان","وضعیت","مبلغ تعرفه","سهم بندی","ذخیره تغییرات"],data:x})]})}),j===1&&e.jsx(he,{})]})},me=()=>e.jsx(e.Fragment,{children:e.jsx(Z,{display:"flex",justifyContent:"center",children:e.jsxs(g,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[e.jsx(ee,{}),e.jsx(g,{container:!0,justifyContent:"space-between",gap:W.SMALL,children:e.jsx(g,{mt:W.SMALL,xs:12,children:e.jsx(ye,{})})})]})})});export{me as default}; diff --git a/build/assets/Messages-kMYYq0zn.js b/build/assets/Messages-kMYYq0zn.js new file mode 100644 index 0000000..829e5a8 --- /dev/null +++ b/build/assets/Messages-kMYYq0zn.js @@ -0,0 +1 @@ +import{j as u,aL as g,aM as f,T as o,aN as d,am as c,ar as x,p as t,b as A}from"./mui-vendor-CkIVaoQP.js";import{r as T}from"./react-vendor-CmFgShSM.js";import{f as j,u as S}from"./redux-vendor-B7uoacJt.js";import{k,p as E,q as F,S as i,G as a,hV as P,kI as b}from"./index-CeyyVc1v.js";import{M as D}from"./MessagesSenders-Y1Gaf5ab.js";const m=({heading:n,message:r,linkText:l,link:s,image:e,time:p,number:h})=>u.jsxs(g,{children:[u.jsx(f,{expandIcon:u.jsx(k,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:u.jsx(o,{children:n?h+1+" - "+n:h+1+" بدون عنوان "})}),u.jsx(d,{children:u.jsxs(o,{color:"primary",textAlign:"justify",children:[r||"برای این پیغام توضیحی نوشته نشده است",u.jsx("hr",{}),u.jsxs(o,{mt:i.SMALL,textAlign:"justify",children:["تاریخ ثبت پیام: ",E(p)," - ساعت ",F(p)]})]})}),l&&u.jsxs(u.Fragment,{children:[u.jsx(c,{textAlign:"left",children:u.jsx(x,{label:"پیوند"})}),u.jsx(d,{children:u.jsx("a",{style:{textDecoration:"none"},href:s,children:l})})]}),e!=null&&e.length?u.jsx(c,{textAlign:"left",children:u.jsx(x,{label:"تصاویر"})}):"",e!=null&&e.length?e.map((C,y)=>[u.jsx(a,{display:"inline-block",p:i.SMALL,children:u.jsx("a",{href:C,children:u.jsx("img",{src:C,alt:"Slaughter Payment Factor",width:"100"})},"SlaughterPaymentFactorImage")},y)]):""]});m.propTypes={message:t.PropTypes.string,heading:t.PropTypes.string,link:t.PropTypes.string,linkText:t.PropTypes.string,image:t.PropTypes.any,time:t.PropTypes.string,number:t.PropTypes.any};const B=()=>{const{senderMessages:n}=j(s=>s.messageSlice),{reciverMessages:r}=j(s=>s.messageSlice),l=S();return T.useEffect(()=>{l(P()),l(b())},[]),u.jsx(u.Fragment,{children:u.jsx(A,{display:"flex",justifyContent:"center",children:u.jsxs(a,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsxs(a,{justifyContent:"center",my:i.MEDIUM,children:[!(n!=null&&n.length)&&!(r!=null&&r.length)&&u.jsx(o,{variant:"body1",color:"primary",children:"در حال حاضر پیامی جهت نمایش وجود ندارد!"}),n!=null&&n.length?u.jsx(c,{children:u.jsx(x,{label:"پیام های همگانی"})}):"",u.jsx(a,{p:i.SMALL,children:n==null?void 0:n.map((s,e)=>u.jsx(D,{number:e,heading:s.heading,message:s.message,link:s.link,linkText:s.linkText,image:s.image,time:s.time},e))})]}),u.jsxs(a,{justifyContent:"center",children:[r!=null&&r.length?u.jsx(c,{children:u.jsx(x,{label:"پیام های شما"})}):"",u.jsx(a,{p:i.SMALL,children:r==null?void 0:r.map((s,e)=>u.jsx(m,{number:e,heading:s.heading,message:s.message,link:s.link,linkText:s.linkText,image:s.image,time:s.time},e))})]})]})})})};export{B as default}; diff --git a/build/assets/MessagesSenders-Y1Gaf5ab.js b/build/assets/MessagesSenders-Y1Gaf5ab.js new file mode 100644 index 0000000..9fab664 --- /dev/null +++ b/build/assets/MessagesSenders-Y1Gaf5ab.js @@ -0,0 +1 @@ +import{j as s,an as y,ao as u,aq as m,B as g,bn as f,T as x,ar as c,am as T,p as e}from"./mui-vendor-CkIVaoQP.js";import{r as A}from"./react-vendor-CmFgShSM.js";import{hW as P,k as b,p as E,q as D}from"./index-CeyyVc1v.js";const F=({heading:i,message:a,linkText:n,link:j,image:r,time:o,number:l})=>{const[t,h]=A.useState(!1),d=()=>{h(!t)};return s.jsxs(y,{children:[s.jsxs(u,{children:[s.jsx(m,{primary:i?`${l+1} - ${i}`:`${l+1} بدون عنوان`}),s.jsx(g,{variant:"text",onClick:d,children:t?s.jsx(P,{}):s.jsx(b,{})})]}),s.jsx(f,{in:t,children:s.jsx(u,{children:s.jsx(x,{color:"primary",textAlign:"justify",children:a||"برای این پیام توضیحی نوشته نشده است"})})}),s.jsx(u,{children:s.jsxs(x,{fontSize:13,color:"red",mt:1,textAlign:"justify",children:["تاریخ ثبت پیام: ",E(o)," - ساعت ",D(o)]})}),n&&s.jsxs(s.Fragment,{children:[s.jsx(u,{children:s.jsx(c,{label:"پیوند"})}),s.jsx(u,{children:s.jsx("a",{style:{textDecoration:"none"},href:j,children:n})})]}),s.jsx(T,{}),r&&r.length>0&&s.jsxs("div",{children:[s.jsx(u,{children:s.jsx(c,{label:"تصاویر"})}),r.map((p,C)=>s.jsx(u,{children:s.jsx("a",{href:p,style:{textDecoration:"none"},children:s.jsx("img",{src:p,alt:"Slaughter Payment Factor",width:"100"})})},C))]})]})};F.propTypes={message:e.PropTypes.string,heading:e.PropTypes.string,link:e.PropTypes.string,linkText:e.PropTypes.string,image:e.PropTypes.array,time:e.PropTypes.string,number:e.PropTypes.number};export{F as M}; diff --git a/build/assets/NationalInfo-DSCN5jIW.js b/build/assets/NationalInfo-DSCN5jIW.js new file mode 100644 index 0000000..853da58 --- /dev/null +++ b/build/assets/NationalInfo-DSCN5jIW.js @@ -0,0 +1 @@ +import{j as u,T as Y,b6 as c2,b7 as i2,b8 as b6,b9 as C2,ba as L6,bb as $6,bc as d2,bd as p2,aG as k6,B as A6,be as x2,b as n2,$ as h2,ae as g2,a3 as E,d as F,ag as A2,ah as j2,ai as T6,aj as t2,I as R6,al as I6,ak as R,aw as f2,ax as e2,aX as S6,aA as s2,b2 as F2,b3 as g6}from"./mui-vendor-CkIVaoQP.js";import{u as y2,r as a,j as O6,f as S2}from"./react-vendor-CmFgShSM.js";import{L as C6,j as H,h as t6,G as f,C as E2,c6 as b2,c7 as L2,c8 as I2,X as f6,O as P2,A as j6,v as K,co as B6,cp as _6,_ as a2,W as d6,p as y6,cq as v2,cr as w2}from"./index-CeyyVc1v.js";import{p as M2,P as N2,N as $2,a as l2,b as k2,c as T2}from"./NationalInfoTransports-Bzg92cmL.js";import{a as P6,u as h6}from"./redux-vendor-B7uoacJt.js";import{R as p6}from"./ResponsiveTable-w7hk7Uq8.js";import{R as v6,a as D6}from"./index.esm-Bu7XMDZU.js";import{g as r2}from"./getSamasatProvinces-BvJGUILK.js";import{d as w6}from"./ToggleOffOutlined-Ch26Umk7.js";import{d as M6}from"./ToggleOn-pBgb8alR.js";import{d as o2}from"./Visibility-DeyjG-oI.js";import{d as R2}from"./Search-Dek2fED1.js";import{C as z6}from"./ChechClearanceCode-lPasOZZ_.js";import"./Tune-D4M2CAhp.js";import"./Download-DQ-VVIaV.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./iconBase-BEJYyZsk.js";import"./Pageview-TRcW_9jm.js";import"./Edit-CqBj1Y2L.js";import"./AddCircleOutline-C8LXM-k8.js";const O2=P6("ALL_PROVINCE_DETAIL_FOR_MAP",async(e,{dispatch:j})=>{j(C6());const{data:l,status:s}=await H.get("https://rsibackend.rasadyar.com/app/all_province_detail_for_map/");return j(t6()),{data:l,status:s}}),B2=({provinceId:e})=>{var n,P,v,w,T,A,b,O,M,h,B,_,L,$,g,G,z;const j=h6(),l=y2(),[s,x]=a.useState(null);a.useEffect(()=>{j(M2({province:e})).then(U=>{x(U.payload.data)})},[]);const S=()=>{j(E2()),l(f6()==="AdminX"?`${b2}/${e}`:f6()==="SuperAdmin"?`${L2}/${e}`:`${I2}/${e}`)},o=({icon:U,label:Q,value:V,color:X="text.primary"})=>u.jsxs(f,{container:!0,spacing:1,alignItems:"center",sx:{mb:1,ml:1},children:[u.jsx(f,{item:!0,sx:{color:"primary.main"},children:U}),u.jsx(f,{item:!0,xs:!0,children:u.jsx(Y,{variant:"caption",sx:{display:"flex",alignItems:"center"},children:u.jsxs(n2,{component:"span",sx:{fontWeight:"bold",mr:1,color:X},children:[Q,": ",V]})})})]});return u.jsxs(f,{container:!0,sx:{justifyContent:"center"},children:[u.jsxs(f,{container:!0,gap:.3,xs:12,style:{width:"100%",justifyContent:"space-between"},children:[u.jsxs(f,{container:!0,xs:5.7,direction:"column",sx:{border:"1px solid #e0e0e0",borderRadius:2,boxShadow:2,p:2,backgroundColor:"background.paper"},children:[u.jsx(Y,{children:"کل جوجه ریزی ها"}),u.jsx(o,{icon:u.jsx(c2,{fontSize:"small"}),label:"تعداد فارم ها",value:((n=s==null?void 0:s.poultryCount)==null?void 0:n.toLocaleString())||0}),u.jsx(o,{icon:u.jsx(i2,{fontSize:"small"}),label:"تعداد کل جوجه ریزی",value:((P=s==null?void 0:s.totalHatchingCount)==null?void 0:P.toLocaleString())||0}),u.jsx(o,{icon:u.jsx(b6,{fontSize:"small"}),label:"حجم کل جوجه ریزی",value:((v=s==null?void 0:s.totalHatchingQuantity)==null?void 0:v.toLocaleString())||0}),u.jsx(o,{icon:u.jsx(C2,{fontSize:"small"}),label:"تلفات",value:((w=s==null?void 0:s.totalHatchingEvacuation)==null?void 0:w.toLocaleString())||0,color:"error.main"}),u.jsx(o,{icon:u.jsx(C2,{fontSize:"small"}),label:"درصد تلفات ",value:((T=s==null?void 0:s.totalHatchingEvacuationPercent)==null?void 0:T.toLocaleString())||0,color:"error.main"}),u.jsx(o,{icon:u.jsx(L6,{fontSize:"small"}),label:"کشتار شده",value:((A=s==null?void 0:s.totalHatchingKillingQuantity)==null?void 0:A.toLocaleString())||0}),u.jsx(o,{icon:u.jsx(L6,{fontSize:"small"}),label:"درصد کشتار",value:((b=s==null?void 0:s.totalHatchingKillingQuantityPercent)==null?void 0:b.toLocaleString())||0}),u.jsx(o,{icon:u.jsx(L6,{fontSize:"small"}),label:"مانده در سالن",value:((O=s==null?void 0:s.totalHatchingLeftOver)==null?void 0:O.toLocaleString())||0}),u.jsx(o,{icon:u.jsx(L6,{fontSize:"small"}),label:"درصد مانده در سالن",value:((M=s==null?void 0:s.totalHatchingLeftOverPercent)==null?void 0:M.toLocaleString())||0}),u.jsx(o,{icon:u.jsx($6,{fontSize:"small"}),label:"میانگین سن کشتار",value:Math.floor(s==null?void 0:s.totalHatchingKillingAge)||0}),u.jsx(o,{icon:u.jsx(d2,{fontSize:"small"}),label:"تعداد شهرستان",value:Math.floor((h=s==null?void 0:s.cityCount)==null?void 0:h.toLocaleString())||0})]}),u.jsxs(f,{container:!0,xs:6,direction:"column",sx:{border:"1px solid #e0e0e0",borderRadius:2,boxShadow:2,p:2,backgroundColor:"background.paper"},children:[u.jsx(Y,{children:" جوجه ریزی های فعال"}),u.jsx(o,{icon:u.jsx(p2,{fontSize:"small"}),label:"تعداد جوجه ریزی ",value:Math.floor((B=s==null?void 0:s.totalActiveHatchingCount)==null?void 0:B.toLocaleString())||0,color:"success.main"}),u.jsx(o,{icon:u.jsx(b6,{fontSize:"small",color:"success"}),label:"حجم جوجه ریزی ",value:(_=s==null?void 0:s.totalActiveHatchingQuantity)==null?void 0:_.toLocaleString(),color:"success.main"}),u.jsx(o,{icon:u.jsx(b6,{fontSize:"small",color:"success"}),label:"تلفات",value:(L=s==null?void 0:s.totalActiveHatchingEvacuation)==null?void 0:L.toLocaleString(),color:"success.main"}),u.jsx(o,{icon:u.jsx(b6,{fontSize:"small",color:"success"}),label:"درصد تلفات ",value:Math.floor(($=s==null?void 0:s.totalActiveHatchingEvacuationPercent)==null?void 0:$.toLocaleString()),color:"success.main"}),u.jsx(o,{icon:u.jsx($6,{fontSize:"small"}),label:"کشتار شده ",value:Math.floor(s==null?void 0:s.totalActiveHatchingKillingQuantity).toLocaleString()||0}),u.jsx(o,{icon:u.jsx($6,{fontSize:"small"}),label:"درصد کشتار ",value:Math.floor(s==null?void 0:s.totalActiveHatchingKillingQuantityPercent)||0}),u.jsx(o,{icon:u.jsx(k6,{fontSize:"small"}),label:"مانده در سالن ",value:((g=s==null?void 0:s.totalActiveHatchingLeftOver)==null?void 0:g.toLocaleString())||0}),u.jsx(o,{icon:u.jsx(k6,{fontSize:"small"}),label:"درصد مانده در سالن ",value:Math.floor((G=s==null?void 0:s.totalActiveHatchingLeftOverPercent)==null?void 0:G.toLocaleString())}),u.jsx(o,{icon:u.jsx(k6,{fontSize:"small"}),label:"میانگین سن کشتار",value:((z=Math.floor(s==null?void 0:s.totalActiveHatchingKillingAge))==null?void 0:z.toLocaleString())||0})]})]}),u.jsx(f,{item:!0,xs:10,display:"flex",justifyContent:"center",mt:3,style:{width:"95%"},children:u.jsx(A6,{variant:"contained",color:"primary",fullWidth:!0,sx:{borderRadius:2,fontWeight:"bold",py:1.5,boxShadow:2,transition:"all 0.3s ease","&:hover":{transform:"translateY(-2px)",boxShadow:4}},onClick:S,endIcon:u.jsx(x2,{}),children:"نمایش جزئیات"})})]})};function _2({getProvinceColor:e}){const j=h6(),l=h2(),s=g2(l.breakpoints.down("md")),x=S=>{var o,n;j(P2({title:`نمای کلی استان ${(o=S.target.parentNode)==null?void 0:o.id}`,content:u.jsx(B2,{provinceId:(n=S.target.parentNode)==null?void 0:n.id})}))};return u.jsx(E,{item:!0,md:8,xs:12,mt:4,children:u.jsx("div",{style:{position:"relative",marginLeft:"96px",display:s?"flex":"block",justifyContent:s?"center":"flex-start",overflow:s?"hidden":"visible"},children:u.jsxs("svg",{style:{position:"relative",width:s?"80vw":"800px",height:s?"80vw":"620px"},viewBox:"0 0 800 620",version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid meet",children:[u.jsx(F,{placement:"top",title:"البرز",children:u.jsx("a",{id:"البرز",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M195.228 147.455C193.812 146.633 194.789 143.729 196.476 144.492C200.632 145.165 204.775 145.961 208.886 146.866C212.299 147.533 214.917 150.01 218.143 151.162C219.642 151.731 221.174 152.229 222.693 152.753C222.894 153.723 223.1 154.7 223.307 155.683C220.25 156.744 217.037 157.281 214.019 158.42C211.246 159.144 211.905 162.547 210.826 164.584C209.339 165.872 207.283 166.48 206.126 168.149C204.943 169.805 204.071 171.655 203.114 173.446C203.049 171.959 202.978 170.471 202.914 168.989C201.854 168.834 200.794 168.679 199.74 168.53C199.649 170.186 199.552 171.849 199.455 173.511C199.048 172.25 198.635 170.982 198.247 169.72C195.125 169.656 191.996 169.772 188.874 169.552C188.809 167.806 188.467 166.033 188.764 164.293C190.639 162.314 193.502 161.796 195.745 160.347C199.055 158.316 200.923 154.538 201.375 150.761C199.294 149.726 197.077 148.885 195.228 147.455Z",fill:e("البرز")})})}),u.jsx(F,{placement:"top",title:"اردبیل",children:u.jsx("a",{id:"اردبیل",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M117.12 15.6736C118.755 13.94 121.237 12.0123 123.693 13.3643C127.934 16.1394 130.907 20.3829 134.204 24.1477C132.2 24.9045 130.041 25.4867 128.405 26.9357C126.996 28.1842 126.951 30.3706 127.52 32.0266C128.774 34.1484 131.321 35.0217 132.801 36.9364C133.047 37.8873 133.163 38.8706 133.312 39.8409C130.584 40.1643 127.41 39.9185 125.232 41.9044C123.506 43.3081 124.159 45.7469 123.991 47.681C125.697 48.5866 127.617 49.2529 129.02 50.6372C129.647 51.8145 129.828 53.173 130.183 54.4473C131.954 55.0748 133.926 55.3465 135.464 56.4914C137.591 58.7426 138.463 61.8346 139.155 64.7714C140.713 66.0652 142.296 67.3331 143.874 68.601C139.84 71.9712 138.618 77.3338 137.468 82.2112C137.591 85.9501 139.123 89.495 140.28 93.0205C141.456 96.3519 143.324 99.3534 145.283 102.264C146.821 104.25 146.078 106.838 145.903 109.108C143.609 109.199 140.861 108.985 139.73 111.456C139.09 110.396 138.438 109.335 137.785 108.28C135.315 108.701 132.872 109.548 130.351 109.496C127.52 108.216 126.848 104.832 125.161 102.504C123.112 99.6962 121.502 96.6106 120.009 93.4862C121.754 90.737 123.28 87.8325 124.023 84.637C121.78 84.016 119.518 83.4726 117.242 83.0198C117.126 78.524 116.208 74.1123 115.096 69.7718C112.537 69.7524 109.757 70.3799 107.398 69.0602C104.812 67.7277 102.298 66.2399 99.6669 64.9849C102.498 60.4762 106.519 56.5626 107.643 51.1677C106.461 50.8507 105.284 50.5402 104.108 50.2362C107.314 46.6913 109.382 41.5098 107.159 36.9041C102.265 37.2793 98.7555 41.1346 95.8403 44.686C95.7563 39.8215 95.2844 34.8729 96.1764 30.0537C96.5125 27.9448 98.6262 27.0133 100.203 25.9395C103.19 24.2059 105.575 21.2562 109.182 20.7904C112.53 20.4282 114.928 17.9894 117.12 15.6736Z",fill:e("اردبیل")})})}),u.jsx(F,{placement:"top",title:"آذربایجان شرقی",children:u.jsx("a",{id:"آذربایجان شرقی",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M88.4952 33.4757C89.8332 31.658 92.3865 32.3566 94.3127 31.9944C94.4808 35.9274 94.0736 39.8927 94.5066 43.8128C94.6359 45.1065 95.9093 45.7146 96.7173 46.562C97.9519 44.9254 99.0831 43.1918 100.518 41.7234C102.179 40.0221 104.493 39.2459 106.601 38.282C106.581 40.5784 106.846 43.0236 105.747 45.1389C104.707 47.1442 103.136 48.8002 101.701 50.5209C103.052 51.2195 104.461 51.7888 105.896 52.2998C104.636 55.0231 103.188 57.6753 101.268 59.9911C100.001 61.7118 98.1458 63.5813 98.8051 65.923C101.61 68.0383 104.933 69.3385 107.939 71.1433C109.736 72.34 111.791 71.0721 113.64 70.6646C114.952 75.2186 115.379 79.9537 116.297 84.5853C118.294 84.8894 120.291 85.1999 122.282 85.5362C121.306 87.9491 119.981 90.2067 119.024 92.626C118.514 93.8356 119.141 95.1165 119.567 96.255C120.918 99.6381 123.387 102.374 125.1 105.557C125.941 107.142 127.04 108.578 128.332 109.826C123.349 107.219 117.751 109.548 112.47 109.251C108.436 108.804 105.288 111.676 102.457 114.109C100.525 115.901 98.2299 117.22 96.1614 118.824C94.4937 120.041 94.358 122.259 93.8085 124.084C90.764 125.19 87.4804 125.17 84.4488 124.045C84.6298 120.959 85.2956 117.615 83.8412 114.73C81.8438 112.155 78.0495 111.405 74.9985 112.194C72.051 112.815 70.5901 115.732 68.7738 117.828C65.3156 115.105 63.2471 111.01 59.5627 108.552C61.6053 107.336 65.1217 106.915 65.4966 104.14C64.4559 98.726 59.4528 95.5757 56.0269 91.7009C56.8285 90.556 58.884 89.6956 58.2764 88.0202C56.9513 85.2581 54.1395 83.2204 51.0239 83.1363C48.5353 83.0846 46.428 81.7908 44.7409 80.0507C45.0383 76.5253 45.717 73.0386 46.9257 69.7072C48.0957 66.9386 45.4649 64.7004 43.6744 62.9926C41.774 61.0391 38.9751 60.8579 36.4219 60.7286C36.8679 59.2796 36.9261 57.4683 38.3417 56.5692C40.4101 54.9455 42.6272 53.5289 44.6892 51.8923C44.728 48.0045 44.2497 44.0651 44.8767 40.2097C45.6653 38.696 47.1261 37.4993 48.7098 36.8977C53.0083 37.9586 56.9448 40.2032 61.2756 41.2188C63.7578 41.7557 66.1624 42.6484 68.6704 43.043C70.4156 42.8942 71.9734 41.898 73.7187 41.6846C76.0457 41.9304 78.2951 42.6743 80.6157 42.9783C83.3758 39.9186 85.9032 36.6713 88.4952 33.4757Z",fill:e("آذربایجان شرقی")})})}),u.jsx(F,{placement:"top",title:"آذربایجان غربی",children:u.jsx("a",{id:"آذربایجان غربی",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M19.1572 6.62395C20.4177 5.63423 21.6975 4.66391 22.9644 3.68066C24.477 6.11291 26.707 7.98885 29.6546 8.23466C29.9325 9.82598 30.1976 11.4173 30.4561 13.0086C32.3565 14.6775 34.5284 16.2106 35.6273 18.5717C37.0558 21.198 37.4242 24.206 37.6634 27.1364C39.3828 27.5698 41.6839 27.1558 42.841 28.7794C44.4957 31.037 45.5106 33.6698 46.7775 36.1473C45.614 37.2923 44.4505 38.4437 43.287 39.6016C43.1448 43.5152 43.6425 47.487 42.9897 51.3683C41.0375 53.1925 38.3938 54.1175 36.5839 56.1034C35.4333 57.6947 35.5561 59.9264 34.1664 61.3884C32.9577 62.8115 31.9299 64.3705 31.1025 66.0459C32.9835 66.7122 34.9356 67.2297 36.7067 68.1806C36.9653 70.0759 35.039 71.0139 33.9789 72.2429C31.8911 74.0542 31.8976 77.101 32.0786 79.6367C32.0721 81.3639 33.9983 81.9267 35.1037 82.8776C36.6421 86.3901 38.368 89.8962 38.9756 93.7192C39.2858 95.1488 39.4345 96.7401 40.4752 97.8657C42.0136 99.5605 43.9657 100.867 45.2779 102.775C47.3916 105.518 48.9882 108.604 50.8756 111.495C52.3623 113.843 55.4973 114.859 58.1217 114.115C58.9555 113.481 59.6536 112.699 60.3905 111.968C62.627 113.455 64.2947 115.577 66.1757 117.453C67.1712 118.643 68.897 118.708 70.2803 118.288C72.0643 116.664 73.0857 113.921 75.6712 113.384C78.3731 112.847 80.8617 114.335 83.2534 115.351C83.4538 118.423 83.2534 121.515 82.4648 124.498C84.4298 125.384 86.3755 126.522 88.5603 126.755C90.4607 126.658 92.2576 125.921 94.074 125.397C95.2634 128.282 96.2976 131.251 96.8147 134.343C96.0261 136.277 95.5736 138.321 95.2828 140.385C92.5938 140.327 89.7238 140.469 87.2933 139.097C85.5481 138.205 84.3264 136.601 83.3568 134.938C80.4674 135.384 77.6039 136.387 74.6435 136.031C71.7218 135.682 68.7678 135.727 65.8848 136.297C63.7324 135.035 61.2761 132.739 58.6647 134.272C55.6977 135.462 55.3745 138.858 55.3099 141.62C52.6532 141.633 50.003 141.646 47.3463 141.666C45.5946 144.499 43.5779 147.158 41.7421 149.939C39.9581 149.674 38.1611 149.564 36.3577 149.545C36.1638 144.344 34.7352 139.298 34.593 134.084C32.9253 133.832 31.1801 133.806 29.5899 133.192C28.1614 132.273 27.3664 130.669 26.3645 129.343C27.2823 127.163 28.4264 125.054 29.0082 122.751C28.6527 121.574 27.8124 120.629 27.1531 119.62C25.6082 119.627 24.0633 119.601 22.5184 119.594C23.7272 117.194 25.7181 114.788 25.2462 111.935C24.6063 110.208 23.0355 109.063 21.8009 107.769C22.4602 104.897 24.5804 101.935 23.488 98.9524C22.3504 95.5304 17.2568 96.6819 16.0674 93.3117C14.7359 89.922 17.1792 86.61 17.2245 83.2139C17.2439 81.3704 15.3887 80.5618 14.1153 79.6561C11.31 77.9549 9.23508 75.3609 6.69476 73.3297C8.35598 70.464 11.1807 68.2905 12.0727 65.0109C12.7967 62.5528 13.3138 60.0364 13.9279 57.5524C12.5963 56.8538 11.2712 56.1552 9.93964 55.4501C10.4374 52.8496 10.6507 50.1586 9.95903 47.5711C9.04116 44.7896 11.6073 42.6031 12.299 40.0933C10.6313 37.7192 8.62747 35.5263 7.70959 32.6995C8.8537 30.8818 10.4244 28.8182 9.62291 26.5348C8.87309 25.1052 7.61263 24.0055 6.92099 22.55C6.35863 20.6159 6.30692 18.5847 6.07422 16.5923C9.35789 17.692 12.6351 19.0181 16.1644 18.934C16.6492 14.7164 18.0971 10.7122 19.1572 6.62395Z",fill:e("آذربایجان شرقی")})})}),u.jsx(F,{placement:"top",title:"بوشهر",children:u.jsx("a",{id:"بوشهر",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M177.336 377.678C177.834 377.057 178.338 376.442 178.842 375.828C180.148 376.72 181.356 377.898 182.927 378.312C184.679 378.383 186.405 377.781 188.157 377.917C190.244 378.577 192.597 379.877 193.03 382.238C193.722 385.143 195.609 387.504 197.2 389.962C197.924 390.919 198.57 392.161 199.83 392.498C204.29 393.772 209.397 393.073 213.379 395.803C215.363 397.744 213.65 401.263 215.622 403.275C217.832 405.584 220.903 406.697 223.559 408.378C225.337 409.329 225.699 411.464 226.352 413.191C227.561 416.891 229.248 420.423 231.161 423.806C232.919 426.95 236.08 429.201 237.211 432.714C238.407 436.291 239.105 440.017 239.674 443.743C240.152 447.43 241.891 450.788 243.675 454.003C245.453 457.308 249.098 459.029 250.915 462.308C253.765 467.134 254.05 473.15 257.624 477.588C260.856 481.501 265.187 484.322 269.473 486.954C265.756 486.728 262.013 487.627 258.335 486.818C259.66 486.346 260.992 485.926 262.336 485.518C260.165 483.073 258.387 480.285 256.066 477.976C252.796 474.787 247.573 475.763 244.069 472.988C242.667 471.856 241.865 470.006 240.185 469.236C236.5 468.117 232.615 468.395 228.828 468.311C225.815 468.253 223.643 465.84 221.323 464.243C219.022 462.806 218.24 460.115 217.276 457.748C216.714 457.871 216.152 458 215.596 458.136C215.757 456.305 215.867 454.475 215.932 452.651C211.608 449.086 209.022 443.543 208.944 437.947C208.751 435.864 209.203 433.167 207.141 431.86C204.924 430.618 202.351 429.984 200.535 428.089C201.744 425.585 202.81 423.017 203.799 420.423C201.227 418.657 198.156 418.146 195.118 418.754C195.674 416.561 197.025 414.246 196.152 411.956C195.138 409.122 194 406.334 192.778 403.585C191.783 401.224 189.527 399.866 187.723 398.203C185.868 396.554 184.763 394.283 183.25 392.355C181.867 390.486 179.915 388.746 179.896 386.242C179.76 383.209 178.958 380.252 177.336 377.678Z",fill:e("بوشهر")})})}),u.jsx(F,{placement:"top",title:"چهار محال و بختیاری",children:u.jsx("a",{id:"چهار محال و بختیاری",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M195.19 287.71C198.738 287.549 202.378 287.251 205.474 285.317C205.48 288.512 205.299 291.766 206.133 294.891C206.954 297.847 209.397 299.878 211.401 302.058C213.916 304.665 215.603 307.919 217.115 311.179C217.788 312.796 218.544 314.497 218.408 316.296C217.684 318.489 216.01 320.352 215.848 322.732C215.609 325.494 215.493 328.431 216.669 331.019C217.6 333.276 219.067 335.676 218.234 338.212C217.542 340.864 214.556 341.582 212.364 342.585C210.289 343.257 207.859 344.571 205.771 343.238C202.468 341.401 201.027 337.675 199.592 334.395C194.666 332.713 189.585 331.329 185.106 328.599C186.211 326.368 187.898 324.116 187.523 321.484C187.149 318.372 184.77 316.108 183.025 313.689C181.383 311.418 179.722 309.167 177.976 306.974C176.05 304.626 175.565 301.431 173.536 299.154C172.288 297.64 170.704 296.359 169.825 294.58C169.476 293.286 169.929 291.928 170.039 290.628C173.626 288.357 177.808 286.352 182.171 287.303C184.014 288.221 185.132 290.582 187.407 290.563C190.348 290.777 192.268 287.756 195.19 287.71Z",fill:e("چهار محال و بختیاری")})})}),u.jsx(F,{placement:"top",title:"فارس",children:u.jsx("a",{id:"فارس",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M236.448 329.531C239.149 326.775 242.013 324.162 245.206 321.982C246.202 324.02 246.693 326.782 249.026 327.733C253.047 329.389 257.513 329.453 261.799 329.317C265.005 329.324 267.533 326.866 270.648 326.568C273.466 326.989 275.703 328.962 277.92 330.611C280.745 332.888 284.048 334.932 285.606 338.367C289.064 345.541 290.654 353.485 294.397 360.542C295.974 363.227 297.803 365.769 299.755 368.195C301.675 370.582 304.222 372.555 305.405 375.466C306.904 379.049 306.762 383.028 307.816 386.728C308.32 388.623 310.188 389.606 311.7 390.635C315.876 393.19 320.252 395.842 322.883 400.124C324.635 402.505 325.197 405.914 327.983 407.415C330.821 409.09 334.214 408.961 337.388 409.006C339.463 414.039 340.892 419.343 341.46 424.764C343.128 427.002 344.24 429.577 345.054 432.235C344.033 432.766 343.018 433.303 342.003 433.84C345.171 436.349 347.866 439.396 351.156 441.764C352.947 443.096 354.996 444.72 355.112 447.159C355.196 451.506 353.011 455.542 352.986 459.876C353.787 462.114 355.927 463.544 356.799 465.75C356.735 469.023 353.781 472.354 350.361 472.128C348.422 472.432 345.798 471.507 344.518 473.461C342.094 476.126 342.54 481.346 338.325 482.142C334.867 481.954 331.92 479.412 328.41 479.386C326.936 479.839 325.643 480.829 324.118 481.107C320.155 480.932 316.18 480.964 312.224 480.622C309.238 480.343 306.801 482.381 304.416 483.856C304.396 486.605 304.351 489.361 304.312 492.117C303.187 492.945 302.069 493.785 300.951 494.626C297.183 493.992 293.382 493.546 289.555 493.481C287.616 493.494 285.89 492.563 284.197 491.754C281.546 490.325 278.424 491.36 275.619 490.622C273.563 489.29 272.613 486.735 270.415 485.551C266.789 483.5 263.286 481.184 260.293 478.267C254.585 472.898 255.626 463.693 249.789 458.376C245.555 455.031 242.976 450.044 241.528 444.933C241.05 440.541 240.041 436.233 238.742 432.015C237.708 428.671 234.657 426.582 232.944 423.638C230.572 419.518 228.652 415.138 227.198 410.617C225.653 405.694 219.305 405.649 216.461 401.871C215.66 399.866 216.183 397.589 215.685 395.512C213.21 393.468 210.094 392.09 206.869 391.929C204.147 391.76 201.458 391.275 198.84 390.512C198.162 388.662 197.438 386.792 196.203 385.233C195.479 384.127 194.225 383.079 194.594 381.611C194.516 380.298 196.042 379.716 197.115 379.599C198.918 380.078 200.482 381.203 202.292 381.682C204.587 380.647 206.565 379.023 208.898 378.066C211.135 377.128 213.171 375.789 214.949 374.152C214.496 372.412 214.031 370.646 214.218 368.835C214.477 366.28 213.455 363.854 212.647 361.493C215.123 362.677 217.444 364.152 219.725 365.672C222.673 367.774 227.45 367.308 229.454 364.126C230.359 361.926 230.029 359.255 231.852 357.457C232.084 355.729 232.214 353.989 232.582 352.288C233.5 348.174 236.092 344.661 237.016 340.541C237.469 338.05 237.294 335.508 237.301 332.992C235.103 332.228 232.731 331.853 230.708 330.682C230.042 329.596 229.699 328.36 229.253 327.189C231.509 328.36 233.875 329.376 236.448 329.531Z",fill:e("فارس")})})}),u.jsx(F,{placement:"top",title:"گیلان",children:u.jsx("a",{id:"گیلان",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M140.942 64.1959C143.702 64.1765 146.456 63.9631 149.183 63.4844C148.647 69.6814 149.274 75.9173 150.244 82.0432C151.058 85.8921 151.569 90.1874 154.452 93.1371C157.005 95.7246 160.269 97.4518 163.43 99.1854C170.366 102.73 178.588 100.434 185.698 103.377C186.888 103.901 188.419 104.412 188.827 105.803C189.926 109.083 190.378 112.906 193.119 115.331C195.265 117.188 197.676 118.708 199.893 120.481C197.921 122.143 195.058 123.353 194.573 126.173C194.211 128.217 192.925 129.834 191.458 131.219C189.312 130.779 187.094 130.145 184.89 130.585C182.014 131.27 180.042 133.916 177.14 134.524C174.722 134.557 172.428 133.651 170.049 133.366C168.149 133.017 165.944 133.133 164.445 131.71C162.538 129.951 161.051 127.803 159.338 125.863C157.367 123.767 157.658 120.526 155.841 118.32C153.65 115.59 150.916 113.352 148.647 110.687C146.553 108.643 148.259 105.467 147.309 102.996C146.43 100.958 144.995 99.2372 143.935 97.303C141.912 93.8228 140.852 89.9028 139.63 86.0991C139.139 84.5013 138.563 82.7742 139.236 81.1311C140.709 76.7 141.621 71.5703 145.803 68.7887C144.316 67.1133 142.707 65.5608 140.942 64.1959Z",fill:e("گیلان")})})}),u.jsx(F,{placement:"top",title:"گلستان",children:u.jsx("a",{id:"گلستان",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M349.779 79.3843C354.181 78.2652 358.861 77.9289 363.295 79.1062C366.146 79.9083 369.106 79.462 371.957 78.8992C370.127 82.7481 369.83 87.0821 368.893 91.1898C369.985 93.124 371.75 94.56 372.933 96.436C370.192 99.748 365.111 99.8126 362.552 103.345C361.194 105.253 359.779 107.116 358.156 108.804C355.616 111.495 354.989 115.273 353.573 118.566C351.847 122.408 352.106 126.703 351.434 130.779C347.627 131.121 344.259 129.181 340.633 128.534C336.496 127.784 333.483 131.16 330.433 133.321C327.989 134.97 326.819 137.791 324.757 139.79C320.659 141.743 315.999 140.495 311.648 140.637C307.524 137.428 302.857 135.016 298.785 131.742C299.173 130.947 299.567 130.145 299.968 129.355C302.528 129.381 305.495 129.737 307.524 127.79C308.307 126.037 307.563 124.09 307.156 122.33C305.818 117.679 304.557 112.996 303.821 108.196C306.6 108.274 309.483 108.41 312.127 107.375C315.494 106.12 318.881 104.716 322.514 104.457C324.841 104.114 327.666 104.541 329.353 102.51C331.512 100.628 330.743 97.5227 331.221 95.0193C331.273 93.5897 332.54 92.7294 333.509 91.882C335.203 90.5623 336.825 89.1521 338.331 87.6255C340.374 85.562 342.901 84.0806 345.17 82.2953C346.625 81.215 348.008 79.9212 349.779 79.3843Z",fill:e("گلستان")})})}),u.jsx(F,{placement:"top",title:"همدان",children:u.jsx("a",{id:"همدان",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M119.298 164.326C122.911 165.691 125.354 168.757 128.438 170.891C129.769 170.471 131.004 169.779 132.355 169.41C135.309 170.523 137.526 173.505 140.894 173.498C143.421 173.789 143.298 170.374 144.041 168.737C146.575 169.216 148.948 170.264 151.035 171.771C149.691 172.864 148.178 174.068 148.98 175.989C153.278 175.756 157.538 176.474 161.688 177.541C161.423 181.319 159.503 185.11 160.744 188.888C161.966 193.176 163.64 197.329 164.862 201.618C165.172 202.323 164.661 202.964 164.112 203.365C162.16 201.929 163.42 199.056 162.451 197.083C161.229 194.651 159.807 192.297 158.204 190.104C155.664 189.767 153.375 191.481 151.553 193.047C149.407 195.007 151.268 197.924 152.083 200.072C151.572 200.48 151.068 200.894 150.564 201.314C150.557 203.397 150.564 205.486 150.602 207.576C148.566 206.308 146.304 205.473 143.919 205.156C144.578 206.858 145.496 208.436 146.659 209.84C146.31 211.463 145.677 213.249 146.633 214.795C148.249 218.042 150.357 221.328 149.956 225.125C150.182 228.082 147.351 229.628 145.367 231.206C142.432 229.854 140.002 227.597 137.054 226.335C134.805 225.598 133.732 227.972 132.516 229.343C129.847 228.515 127.112 227.952 124.43 227.202C122.607 226.704 121.385 225.177 119.996 224.019C117.824 222.066 114.611 221.917 112.478 219.918C110.726 218.262 108.929 215.836 110.313 213.398C112.73 214.07 115.174 214.672 117.636 215.157C117.649 212.272 117.675 209.387 117.746 206.508C115.62 206.424 113.596 207.11 111.677 207.964C109.434 206.483 106.88 205.441 104.877 203.63C104.844 203.39 104.767 202.912 104.734 202.672C106.641 201.612 108.845 201.379 110.959 201.042C111.405 198.61 112.329 196.294 113.752 194.27C115.303 193.953 116.848 193.584 118.393 193.228C119.058 193.92 119.724 194.606 120.39 195.305C121.883 193.739 123.661 191.941 123.234 189.56C123.008 184.631 117.152 183.02 115.93 178.55C115.038 175.439 114.075 172.315 112.258 169.598C112.75 168.938 113.247 168.285 113.739 167.625C114.611 169.016 115.477 170.406 116.356 171.797C117.992 171.008 119.621 170.212 121.256 169.417C120.61 167.715 119.957 166.02 119.298 164.326Z",fill:e("همدان")})})}),u.jsx(F,{placement:"top",title:"هرمزگان",children:u.jsx("a",{id:"هرمزگان",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M364.726 432.326C367.247 429.913 370.013 427.752 373.219 426.323C373.549 430.637 374.124 434.926 374.396 439.247C374.648 441.951 373.387 444.448 373.006 447.081C373.549 449.015 375.372 450.212 376.755 451.557C379.269 453.601 381.506 456.286 384.738 457.192C387.272 457.722 389.993 457.748 392.482 456.952C395.701 455.82 396.851 452.191 399.566 450.399C401.105 449.688 402.843 449.733 404.492 449.52C404.53 452.599 404.227 455.756 405.002 458.776C405.797 461.668 409.184 462.36 410.897 464.54C412.436 466.597 413.877 468.745 415.726 470.563C415.215 471.539 414.672 472.516 414.304 473.564C414.756 474.399 415.37 475.142 415.933 475.912C416.573 478.577 417.264 481.236 418.131 483.843C419.145 486.773 418.719 489.917 418.939 492.957C419.055 495.001 419.902 496.91 420.664 498.792C422.933 498.96 425.474 498.566 427.458 499.924C429.998 501.587 432.364 503.508 434.93 505.145C436.249 503.372 437.574 501.606 438.899 499.84C441.659 501.367 444.626 502.725 446.817 505.067C448.666 507.072 448.298 510.009 448.524 512.525C449.771 513.095 451.038 513.754 452.454 513.793C458.155 514.007 463.914 513.593 469.422 512.014C470.152 513.353 470.889 514.699 471.658 516.031C470.643 516.795 469.629 517.552 468.62 518.321C469.635 520.126 470.637 521.937 471.594 523.781C469.7 526.782 469.59 530.411 468.594 533.73C468.303 534.94 467.87 536.162 468 537.43C469.848 540.981 473.597 542.799 476.538 545.277C476.894 546.312 476.978 547.424 477.185 548.511C479.913 550.529 481.432 553.582 482.356 556.778C480.721 557.186 479.098 557.593 477.469 557.994C475.582 555.568 473.281 553.22 470.139 552.619C465.634 551.7 461.006 551.519 456.449 550.943C452.822 550.245 450.159 553.893 446.604 553.68C443.753 552.586 442.105 549.779 440.192 547.56C438.854 547.78 437.516 548.006 436.184 548.226C435.37 547.528 434.594 546.777 433.689 546.228C431.53 546.118 429.41 546.641 427.264 546.674C424.297 546.797 421.427 545.917 418.609 545.134C417.982 542.353 416.909 539.668 415.028 537.495C413.108 535.554 414.562 532.76 414.304 530.411C413.548 528.497 412.158 526.899 411.447 524.965C410.419 522.384 410.529 519.55 410.471 516.827C410.451 513.554 409.74 510.281 408.448 507.279C407.129 504.439 404.013 503.094 402.417 500.481C401.848 498.85 401.9 497.084 401.712 495.396C398.435 494.465 395.061 494.025 391.713 493.455C388.881 493.009 386.031 491.845 383.141 492.569C380.679 493.126 377.996 493.54 376.044 495.286C374.001 497 371.862 498.779 369.179 499.323C365.986 500.306 362.379 500.176 359.516 502.059C357.531 503.301 358.1 505.875 357.939 507.848C356.471 508.547 354.965 509.692 353.252 509.272C351.649 509.175 349.981 508.327 348.404 508.929C343.602 511.303 339.303 514.531 335.179 517.92C333.208 519.706 330.447 519.466 327.991 519.389C325.179 516.051 320.952 514.634 317.377 512.344C315.49 510.947 313.182 512.131 311.082 511.924C309.427 511.587 307.927 510.74 306.272 510.429C304.327 510.669 302.517 511.587 300.545 511.665C296.796 511.717 293.125 510.022 290.591 507.286C289.156 505.617 288.878 503.204 287.34 501.645C282.233 499.051 276.189 498.385 271.529 494.872C268.627 492.627 265.498 490.693 262.512 488.572C265.517 488.539 268.53 488.442 271.535 488.306C272.33 489.522 273.022 490.849 274.127 491.832C276.913 492.459 279.874 491.935 282.595 492.912C284.89 493.74 287.113 494.911 289.602 495.047C292.886 495.306 296.169 495.622 299.447 496.036C301.961 496.45 304.23 494.575 305.529 492.602C305.975 490.57 305.665 488.462 305.807 486.398C305.484 483.791 308.619 482.957 310.584 482.426C315.225 482.064 319.898 483.157 324.533 482.452C326.149 482.155 327.61 481.242 329.252 481.1C332.968 481.779 336.608 484.6 340.492 483.08C343.983 481.068 343.582 476.055 346.717 473.713C349.038 472.645 351.714 473.027 354.196 472.878C356.058 470.88 358.895 468.861 358.262 465.737C358.262 463.052 355.217 461.797 354.687 459.372C355.049 454.805 357.098 450.361 356.303 445.71C356.09 443.691 354.364 442.404 352.91 441.233C350.072 439.111 347.486 436.692 344.772 434.428C345.366 434.137 345.967 433.852 346.568 433.568C346.084 431.343 345.58 429.124 345.017 426.924C347.835 427.267 350.718 427.293 353.491 428.005C354.959 429.492 355.463 431.86 357.331 432.96C359.677 433.898 362.819 434.402 364.726 432.326Z",fill:e("هرمزگان")})})}),u.jsx(F,{placement:"top",title:"ایلام",children:u.jsx("a",{id:"ایلام",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M47.9159 228.508C51.6068 228.715 55.5045 226.937 58.995 228.754C61.1217 229.602 63.5262 229.983 65.2909 231.549C68.1092 233.975 70.8693 236.737 74.5084 237.875C77.4689 238.755 80.4617 237.597 83.3834 237.112C85.9237 236.627 88.5351 236.963 91.0884 236.614C91.9287 236.504 92.4975 235.676 92.4587 234.861C92.6139 232.888 92.3553 230.915 92.1549 228.961C94.4367 229.013 96.7249 229.181 98.9873 229.511C98.3538 232.648 96.9318 235.915 93.9584 237.455C89.5952 237.836 84.8442 238.283 81.3473 241.226C79.9769 242.649 78.2769 244.635 79.1948 246.731C80.5134 252.048 84.4823 256.712 89.8409 258.194C92.9629 258.931 95.3287 261.124 97.6169 263.233C99.9246 265.4 103.001 266.791 104.721 269.54C106.912 273.395 109.006 277.567 108.644 282.147C109.349 282.665 110.041 283.202 110.752 283.719C109.692 285.757 108.625 287.827 107.067 289.535C105.774 291.087 104.139 292.459 103.396 294.399C103.615 295.919 104.262 297.342 104.779 298.785C102.672 299.982 100.661 301.34 98.8386 302.944C98.4896 302.64 98.1405 302.349 97.7915 302.052C96.3242 297.931 94.7922 293.804 93.1633 289.761C90.5002 288.189 86.5572 290.201 84.172 287.723C77.8374 281.714 71.4445 275.711 64.4894 270.42C61.4772 268.505 57.8639 268.045 54.3992 267.638C54.3346 266.144 54.341 264.649 54.3022 263.162C55.3365 261.9 57.4502 260.697 56.7262 258.802C55.1878 254.972 52.7056 251.453 49.5706 248.756C49.409 247.766 49.241 246.776 49.0923 245.787C47.528 244.583 45.9573 243.4 44.3672 242.242C45.0847 237.519 48.0904 233.379 47.9159 228.508Z",fill:e("ایلام")})})}),u.jsx(F,{placement:"top",title:"اصفهان",children:u.jsx("a",{id:"اصفهان",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M233.649 216.393C236.946 214.872 240.171 217.182 243.39 217.751C248.658 218.67 254.081 217.324 259.33 218.56C264.805 219.692 269.718 222.881 275.373 223.256C287.396 224.433 299.497 223.521 311.552 223.89C317.473 224.304 323.084 221.826 328.979 221.891C335.863 221.897 342.753 221.846 349.637 221.936C349.689 225.151 349.573 228.366 349.657 231.581C349.728 234.822 350.523 238.031 350.167 241.284C349.896 243.885 349.741 246.498 349.482 249.099C349.133 252.275 346.955 254.785 345.242 257.34C343.561 257.385 341.855 257.262 340.213 257.65C336.361 261.357 336.593 267.218 334.169 271.713C332.935 274.087 330.071 274.689 327.731 275.394C323.265 276.41 318.753 277.309 314.519 279.094C308.372 281.429 302.974 285.673 296.375 286.766C291.191 287.833 286.472 283.933 281.314 284.716C279.194 285.634 277.772 287.562 275.904 288.856C274.41 289.936 272.562 290.279 270.836 290.79C270.429 296.055 271.637 301.45 270.112 306.612C269.091 310.675 267.358 314.646 267.416 318.909C267.436 321.109 268.308 323.159 269.071 325.184C266.259 326.323 263.538 327.856 260.519 328.373C257.637 328.464 254.851 327.565 252.045 327.066C250.914 326.737 249.557 326.62 248.729 325.695C247.669 324.155 247.184 322.318 246.544 320.585C241.832 320.96 239.279 325.307 235.866 327.933C233.675 327.823 231.749 326.646 229.816 325.747C228.497 327.442 227.98 330.055 229.512 331.769C231.671 333.076 234.179 333.639 236.532 334.518C235.995 337.507 235.562 340.541 234.444 343.381C233.436 346.033 231.858 348.491 231.309 351.311C230.837 353.556 230.462 355.826 229.809 358.032C227.095 356.467 224.373 354.895 221.768 353.161C218.136 350.865 216.604 346.576 213.3 343.918C215.899 342.792 219.234 341.511 219.797 338.348C220.889 333.464 216.455 329.583 217.121 324.712C216.81 321.769 219.105 319.64 219.881 317.027C220.191 312.635 217.728 308.702 215.615 305.047C212.816 300.351 206.785 297.226 206.934 291.113C206.416 288.758 208.168 284.651 204.891 283.946C203.178 284.437 201.665 285.414 199.998 286.022C197.276 287.012 194.129 285.88 191.556 287.394C190.043 288.073 188.595 289.302 186.844 289.114C185.15 288.215 184.058 286.559 182.81 285.162C178.466 285.434 174.032 286.048 170.438 288.72C170.858 287.083 171.272 285.44 171.679 283.797C169.346 281.973 166.405 281.986 163.606 281.746C161.13 281.475 161.331 278.279 161.958 276.533C163.141 274.353 166.01 274.288 168.105 273.505C168.085 271.539 168.072 269.572 168.079 267.612C169.772 267.282 171.505 267.043 173.108 266.364C174.588 265.516 175.693 264.145 176.741 262.819C178.874 260.283 178.085 256.576 180.044 253.937C181.666 251.641 183.056 248.458 186.165 247.992C190.451 247.106 194.743 246.233 199.048 245.444C201.523 245.127 202.939 242.817 205.027 241.737C206.138 241.388 207.308 241.271 208.465 241.084C209.661 238.451 211.394 236.129 212.861 233.651C214.231 231.504 211.827 229.337 212.253 227.092C212.648 224.905 213.204 222.751 213.572 220.565C213.837 219.601 213.889 218.353 214.832 217.777C221.005 215.972 227.605 218.838 233.649 216.393Z",fill:e("اصفهان")})})}),u.jsx(F,{placement:"top",title:"کرمان",children:u.jsx("a",{id:"کرمان",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M392.327 309.905C394.687 308.287 397.35 310.112 399.418 311.347C404.738 314.983 411.183 316.199 416.91 319.006C420.71 320.934 424.983 321.535 428.881 323.204C436.896 326.859 444.717 331.025 453.062 333.904C458.221 335.922 463.146 338.464 468.136 340.845C471.116 342.106 472.344 345.282 474.258 347.656C476.798 350.897 479.099 354.319 481.303 357.799C482.221 359.326 483.288 361.053 482.79 362.916C481.646 369.165 480.411 375.407 479.849 381.747C479.539 386.546 476.72 390.796 476.862 395.661C478.679 397.362 481.051 398.96 481.465 401.612C482.118 405.377 482.208 409.252 483.482 412.9C482.234 415.565 480.243 417.823 479.099 420.527C478.349 424.725 479.487 429.124 482.131 432.462C479.732 434.26 477.289 436.058 474.49 437.19C471.394 438.594 467.916 439.487 465.395 441.874C465.273 442.65 465.286 443.42 465.441 444.202C467.18 445.231 469.183 445.664 471.122 446.182C471.459 447.915 472.015 449.681 471.762 451.473C470.502 453.058 468.53 453.873 467.218 455.413C466.947 459.727 468.951 464.152 467.496 468.376C464.814 468.991 462.028 469.553 459.992 471.572C460.806 475.149 461.297 478.83 462.577 482.29C463.65 482.691 464.775 482.976 465.906 483.241C464.756 489.011 465.344 494.976 466.934 500.603C467.968 502.596 470.153 503.708 471.213 505.694C471.678 506.897 471.775 508.204 471.989 509.478C464.988 512.059 457.458 512.558 450.063 512.279C449.792 509.317 450.057 505.785 447.549 503.67C444.847 501.257 441.776 499.096 438.318 497.938C436.89 499.497 435.842 501.347 434.692 503.107C431.938 501.237 429.185 499.387 426.47 497.472C424.841 497.395 423.218 497.311 421.589 497.24C420.4 494.445 420.006 491.411 420.206 488.397C420.542 484.58 418.7 481.107 418.215 477.393C418.054 475.712 417.02 474.353 416.005 473.085C416.625 472.29 417.239 471.494 417.866 470.705C415.798 468.835 413.981 466.694 412.708 464.204C411.512 461.927 408.862 461.209 407.091 459.527C405.721 455.943 406.011 451.991 405.934 448.219C403.749 448.278 401.454 447.902 399.367 448.666C396.354 450.354 395.023 454.041 391.849 455.497C388.139 456.765 383.801 455.885 380.873 453.272C378.721 451.357 376.4 449.571 374.655 447.269C376.484 440.036 375.586 432.513 374.384 425.255C368.973 425.016 365.961 430.042 361.734 432.436C358.65 432.979 356.737 430.12 355.283 427.895C354.326 426.038 352.083 426.284 350.338 426.045C347.836 425.838 345.38 425.294 342.956 424.693C342.613 419.964 341.366 415.371 339.937 410.875C339.465 409.594 338.832 407.939 337.287 407.732C334.378 407.208 331.185 407.622 328.561 406.017C327.184 405.26 326.615 403.721 325.911 402.421C324.573 399.607 322.452 397.31 320.675 394.788C322.795 393.798 324.999 393.002 327.255 392.381C326.874 389.037 326.189 385.66 326.751 382.303C327.009 379.948 327.759 377.574 327.3 375.213C326.512 373.855 325.316 372.8 324.495 371.474C323.693 369.242 324.055 366.7 322.924 364.566C322.181 363.181 321.153 361.997 320.184 360.788C320.526 356.628 321.735 352.036 325.484 349.668C327.274 349.202 329.162 349.416 330.998 349.26C334.766 349.118 338.153 347.08 341.915 346.88C344.766 346.932 347.448 348.206 350.318 348.154C353.395 348.09 356.866 348.064 359.407 346.078C361.197 343.963 360.783 340.89 361.404 338.322C362.225 334.654 361.727 330.85 362.38 327.176C364.998 324.886 368.463 323.987 371.669 322.836C375.864 321.425 379.438 318.689 382.78 315.849C385.605 313.34 389.147 311.897 392.327 309.905Z",fill:e("کرمان")})})}),u.jsx(F,{placement:"top",title:"کرمانشاه",children:u.jsx("a",{id:"کرمانشاه",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M60.2347 180.847C64.029 183.965 67.5389 187.587 69.8336 191.973C70.8161 193.881 72.3739 195.382 73.977 196.773C74.1967 197.892 74.3648 199.03 74.7138 200.13C77.8295 200.855 81.0226 201.23 84.1382 201.967C85.7607 199.283 88.023 197.077 89.7101 194.438C90.6603 192.393 93.2459 193.681 94.9588 193.5C95.2885 192.704 95.6246 191.921 95.9543 191.138C97.5896 190.847 99.225 190.556 100.86 190.246C100.867 189.081 100.873 187.923 100.88 186.766C103.394 188.687 106.73 189.405 108.798 191.908C109.671 192.853 110.511 193.836 111.364 194.806C110.627 196.559 110 198.358 109.464 200.182C107.208 200.369 104.978 200.855 102.903 201.767C103.478 203.216 103.84 204.943 105.204 205.894C106.594 206.948 108.171 207.705 109.709 208.52C109.781 209.49 109.858 210.461 109.936 211.431C111.907 209.982 114.027 208.746 116.316 207.86C116.303 209.71 116.27 211.56 116.238 213.41C114.409 212.893 112.579 212.395 110.744 211.942C109.186 213.689 107.337 215.183 105.023 215.765C102.005 219.523 98.9277 223.269 96.5619 227.499C94.6033 227.577 92.6512 227.655 90.6926 227.726C90.8219 230.294 90.99 232.862 91.1451 235.436C87.6999 235.449 84.1964 235.132 80.8158 235.986C78.6892 236.484 76.3686 237.118 74.2872 236.096C70.1309 234.667 67.1252 231.374 64.0548 228.405C62.5811 228.295 61.0556 228.386 59.6335 227.926C58.5541 227.351 57.675 226.477 56.7377 225.707C53.1955 226.924 49.3947 227.616 45.749 226.4C45.9947 228.515 46.6087 230.76 45.7814 232.83C44.7471 235.54 43.6806 238.244 42.9889 241.071C41.7155 239.725 40.3711 238.438 39.3045 236.918C38.0699 235.165 37.7015 232.985 36.6737 231.128C35.8851 229.88 34.7151 228.935 33.668 227.913C36.4475 224.517 39.9444 220.888 39.4144 216.114C37.8824 214.232 36.0144 212.654 34.5794 210.687C35.9756 210.305 37.3718 209.924 38.7745 209.561C38.8132 208.384 38.8585 207.207 38.9102 206.036C40.9657 206.528 42.9954 207.09 45.0121 207.724C45.5293 204.956 44.5144 202.316 43.3574 199.852C44.1848 198.558 44.9281 197.167 46.0722 196.113C47.2681 195.13 48.8452 194.845 50.2673 194.334C50.9072 192.122 50.7715 189.437 52.3552 187.639C54.7921 186.688 57.5521 187.011 60.1183 186.597C60.1442 184.676 60.1765 182.761 60.2347 180.847Z",fill:e("کرمانشاه")})})}),u.jsx(F,{placement:"top",title:"خراسان شمالی",children:u.jsx("a",{id:"خراسان شمالی",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M379.689 72.9156C382.591 72.1523 385.565 71.596 388.564 71.3437C391.99 71.2208 395.222 75.0956 398.538 72.9415C399.591 72.3981 400.593 71.7642 401.614 71.1497C403.217 73.4719 404.956 75.7037 406.876 77.7737C407.212 79.6173 406.915 81.9913 408.673 83.2009C410.063 84.3394 411.97 84.016 413.637 84.1583C418.556 84.0678 423.01 86.4159 427.632 87.7549C430.773 88.6088 433.391 90.9893 434.664 93.9649C435.188 96.1772 434.774 98.4931 435.22 100.718C436.106 102.614 437.948 103.791 439.461 105.149C436.81 105.971 434.206 106.909 431.633 107.95C431.672 109.432 431.717 110.92 431.775 112.401C432.674 113.539 433.656 114.639 434.296 115.959C434.677 118.32 432.04 119.432 430.502 120.616C430.469 123.76 430.476 126.897 430.476 130.041C426.087 130.261 421.607 129.55 417.839 127.188C414.452 125.526 412.008 122.524 408.776 120.661C406.34 119.853 403.702 120.338 401.188 120.319C396.947 120.552 392.707 119.931 388.473 120.299C386.618 120.39 385.067 121.593 384.033 123.061C381.583 126.419 379.915 130.255 378.267 134.052C374.938 131.82 372.158 128.903 368.888 126.593C369.062 124.963 369.411 123.314 369.198 121.677C368.765 120.584 368.093 119.62 367.485 118.63C369.359 117.757 371.331 116.703 371.505 114.367C369.321 114.354 366.987 115.072 364.886 114.29C363.71 112.181 362.65 109.995 361.047 108.17C362.411 106.068 363.671 103.7 365.934 102.42C368.881 100.68 372.456 99.7609 374.699 96.9988C373.755 94.6053 371.842 92.82 370.142 90.9634C371.37 87.2957 371.848 83.4338 373.012 79.7466C373.968 79.3973 374.925 79.0415 375.895 78.6922C376.741 76.5963 377.161 73.6207 379.689 72.9156Z",fill:e("خراسان شمالی")})})}),u.jsx(F,{placement:"top",title:"خراسان رضوی",children:u.jsx("a",{id:"خراسان رضوی",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M450.366 94.1203C451.077 93.4411 451.8 92.7619 452.518 92.0891C457.644 93.965 461.923 97.7946 467.404 98.6937C468.949 98.7907 469.208 100.563 469.699 101.715C470.714 105.201 472.168 108.998 475.471 110.92C480.048 112.893 484.902 114.245 489.362 116.47C491.418 118.495 493.073 120.907 495.173 122.9C497.494 125.086 497.778 129.116 500.946 130.371C504.83 130.701 508.715 129.789 512.613 130.035C517.539 130.287 522.425 129.595 527.338 129.349C526.763 132.823 525.748 136.232 525.476 139.757C525.172 142.914 527.758 145.301 528.236 148.283C527.945 150.812 526.775 153.141 526.032 155.554C527.564 156.925 529.406 158.122 530.356 160.011C530.512 162.023 529.93 164.041 530.247 166.053C530.57 167.638 531.19 169.138 531.746 170.659C529.923 173.569 528.475 176.752 528.327 180.239C527.894 180.303 527.021 180.439 526.588 180.51C526.271 182.69 526.659 184.845 527.28 186.934C527.532 189.554 526.763 192.154 526.685 194.774C526.562 197.918 524.966 200.68 523.737 203.487C523.013 204.962 522.341 206.592 520.926 207.537C519.174 208.734 517.183 209.542 515.515 210.868C517.241 213.566 519.872 215.513 521.753 218.094C519.639 218.094 517.286 217.525 515.399 218.76C512.742 220.494 511.947 223.935 509.342 225.727C506.718 227.668 504.184 229.718 501.573 231.672C499.317 230.132 497.235 228.224 494.617 227.318C491.211 226.523 487.527 227.758 484.262 226.225C482.032 225.1 479.524 224.886 477.068 225.028C470.371 225.313 463.623 224.634 456.972 225.669C454.839 225.863 453.384 227.59 451.82 228.851C449.958 227.791 447.974 227.008 445.957 226.316C442.467 225.436 441.898 219.556 437.657 220.701C432.997 221.542 428.336 220.293 424.167 218.249C425.027 215.856 426.236 213.475 426.21 210.881C425.57 207.666 422.48 205.887 420.754 203.319C419.83 200.906 420.884 197.873 419.1 195.751C417.361 193.564 415.266 191.688 413.476 189.541C410.561 189.528 407.633 189.276 404.737 189.651C402.061 190.162 400.277 192.478 397.846 193.506C395.842 193.81 393.806 193.629 391.796 193.694C391.608 197.116 391.647 201.094 388.939 203.63C385.397 207.026 380.148 207.065 375.559 207C376.929 204.212 378.629 201.599 380.633 199.225C382.908 196.501 384.556 193.254 387.226 190.873C390.083 188.279 394.562 188.849 397.316 186.099C399.378 183.706 399.016 180.232 400.477 177.528C401.46 175.465 403.295 173.744 403.586 171.39C401.143 166.855 395.539 165.037 393.244 160.347C391.188 155.916 389.372 151.091 389.831 146.123C390.018 143.354 391.899 141.109 392.436 138.444C392.869 136.484 391.512 134.556 389.727 133.871C388.196 134.032 386.741 134.563 385.235 134.841C383.412 135.32 381.693 134.337 380.006 133.819C381.745 130.209 383.367 126.483 385.81 123.281C387.194 121.49 389.682 121.69 391.699 121.612C396.463 121.677 401.22 121.515 405.978 121.697C408.841 121.716 410.819 124.012 412.881 125.668C417.238 129.291 422.803 131.827 428.563 131.561C429.623 131.484 430.864 131.406 431.588 130.507C432.066 127.648 431.769 124.737 431.866 121.858C433.378 120.5 435.518 119.297 435.764 117.071C436.274 114.322 433.43 112.796 432.37 110.596C432.738 109.535 433.585 108.727 434.658 108.397C437.211 107.446 439.829 106.657 442.215 105.311C440.366 103.752 438.097 102.581 436.72 100.563C436.158 98.6872 436.365 96.6884 436.306 94.7542C439.648 95.4205 442.874 94.3402 445.763 92.723C447.282 93.2276 448.821 93.6869 450.366 94.1203Z",fill:e("خراسان جنوبی")})})}),u.jsx(F,{placement:"top",title:"خراسان جنوبی",children:u.jsx("a",{id:"خراسان جنوبی",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M418.848 204.011C421.149 205.9 423.773 207.899 424.523 210.946C424.801 213.74 422.506 216.393 423.444 219.168C425.195 221.16 428.059 221.509 430.509 222.137C433.553 222.92 436.682 222.189 439.765 222.286C441.601 223.903 442.629 226.406 444.93 227.493C447.192 228.547 449.519 229.55 451.95 230.165C454.315 229.104 456.106 226.717 458.892 226.697C465.563 226.154 472.272 226.503 478.962 226.426C481.309 226.309 483.351 227.571 485.53 228.211C489.221 228.819 493.442 227.551 496.68 229.984C498.561 231.051 500.416 233.528 502.801 232.319C505.665 230.915 507.778 228.405 510.474 226.73C510.513 229.44 510.577 232.17 511.191 234.822C512.045 238.251 511.256 241.77 511.107 245.237C515.29 247.844 520.247 248.031 525.031 247.863C521.062 253.258 515.962 258.09 513.919 264.643C513.131 267.146 514.876 269.346 516.117 271.338C519.86 276.791 520.441 283.551 522.102 289.781C523.033 294.47 525.005 299.173 523.977 304.018C523.046 308.314 524.307 312.615 524.494 316.917C524.649 320.003 525.005 323.095 526.039 326.032C529.187 326.892 534.209 326.504 534.966 330.631C535.948 333.289 533.492 335.262 532.186 337.248C528.676 341.576 530.383 347.45 529.95 352.534C529.42 357.379 531.734 361.733 533.369 366.118C531.301 366.461 529.109 367.173 527.047 366.506C524.559 364.831 523.693 361.733 521.805 359.52C519.53 356.506 515.8 355.374 512.542 353.795C511.114 353.194 509.666 352.256 508.05 352.502C506.04 352.799 504.185 353.679 502.297 354.371C496.447 356.674 490.21 357.838 484.411 360.29C482 356.014 479.311 351.9 476.344 347.986C473.953 344.836 471.975 341.065 468.284 339.234C462.589 336.388 456.849 333.593 450.877 331.381C444.82 329.369 439.28 326.154 433.398 323.729C436.01 318.405 438.123 312.79 441.491 307.867C442.506 306.269 443.728 304.646 443.857 302.686C442.441 300.745 439.959 299.878 438.647 297.873C437.748 294.451 438.75 290.854 438.085 287.4C437.483 285.44 435.88 284.036 434.458 282.652C431.601 280.084 429.048 277.199 426.624 274.223C424.349 271.299 425.002 267.347 424.672 263.899C424.64 260.781 423.069 258.026 421.653 255.354C422.616 252.728 423.605 250.108 424.504 247.456C421.886 247.695 419.01 247.753 416.857 249.493C414.717 250.981 413.244 253.433 410.729 254.351C409.585 254.856 408.758 253.594 408.163 252.818C404.608 247.009 401.654 240.832 399.262 234.453C398.829 233.386 399.663 232.39 400.044 231.445C401.589 228.586 402.934 225.624 404.194 222.629C406.062 218.411 407.148 213.896 409.217 209.762C411.253 209.588 413.476 209.801 415.299 208.688C417.057 207.66 417.898 205.713 418.848 204.011Z",fill:e("خراسان جنوبی")})})}),u.jsx(F,{placement:"top",title:"خوزستان",children:u.jsx("a",{id:"خوزستان",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M125.255 268.97C128.151 269.449 130.866 268.071 133.716 267.942C135.5 268.873 136.851 270.458 138.661 271.357C141.15 272.315 143.961 272.224 146.347 273.492C149.178 275.077 151.201 277.833 154.149 279.243C156.023 279.799 158.014 279.359 159.921 279.223C160.503 280.595 161.104 281.96 161.692 283.331C164.278 283.376 166.954 283.124 169.455 283.926C169.992 287.639 167.813 291.204 168.44 294.93C169.022 296.831 170.735 298.041 171.963 299.509C174.019 301.586 174.394 304.691 176.204 306.942C178.828 310.15 181.019 313.682 183.631 316.904C185.098 318.728 185.751 321.012 186.397 323.23C184.316 326.083 183.553 329.641 181.588 332.539C178.841 334.893 174.801 334.887 171.989 337.183C171.86 342.229 172.984 347.255 172.564 352.333C176.876 355.419 181.872 357.23 186.94 358.66C186.468 360.71 185.731 362.722 185.55 364.831C186.235 368.059 188.459 371.151 187.334 374.573C187.166 376.623 184.626 376.772 183.029 376.798C181.491 376.151 180.386 374.793 178.996 373.9C177.593 374.883 176.553 376.339 175.034 377.154C169.313 379.489 164.058 382.788 158.408 385.285C158.402 383.15 158.402 381.022 158.402 378.894C155.92 378.331 153.36 378.241 150.839 378.616C150.568 377.529 150.296 376.442 150.025 375.362C148.331 375.194 146.547 375.116 145.047 374.217C143.024 373.027 141.835 370.911 140.044 369.45C138.234 368.732 136.955 371.112 136.78 372.626C137.245 374.198 138.241 375.563 138.693 377.147C138.745 379.043 138.558 381.475 136.754 382.581C132.747 385.091 127.97 385.997 123.303 386.184C122.508 381.915 121.002 377.82 120.549 373.493C117.214 370.549 113.116 367.884 111.403 363.608C110.983 358.129 110.866 352.469 112.502 347.158C108.442 345.036 103.795 344.998 99.3281 344.959C99.7547 339.215 99.3281 333.095 102.069 327.843C104.079 323.78 105.404 319.42 107.641 315.468C104.603 311.981 100.976 308.449 100.304 303.649C102.23 301.89 104.506 300.583 106.555 298.972C106.005 297.362 105.462 295.751 104.906 294.14C108.429 290.156 111.803 286.003 114.344 281.306C116.225 277.613 117.382 273.596 119.198 269.876C120.646 268.071 123.277 268.945 125.255 268.97Z",fill:e("خوزستان")})})}),u.jsx(F,{placement:"top",title:"کهکیلویه و بویراحمد",children:u.jsx("a",{id:"کهکیلویه و بویراحمد",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M185.027 330.501C187.548 331.317 189.803 332.791 192.337 333.587C194.173 334.286 196.203 334.583 197.864 335.689C200.43 338.503 201.393 342.896 205.116 344.571C207.553 345.147 210.087 344.817 212.563 344.791C215.433 347.812 217.172 351.868 220.714 354.229C223.021 355.872 225.665 357.017 227.869 358.815C229.136 359.714 228.897 361.513 228.645 362.845C226.965 365.627 222.782 366.293 220.229 364.314C217.43 362.36 214.651 360.064 211.05 359.967C211.348 362.198 211.968 364.365 212.447 366.558C212.834 369.049 212.763 371.584 213.125 374.081C209.531 376.197 205.653 377.801 202.298 380.317C200.837 379.593 199.422 378.7 197.806 378.383C196.267 378.273 194.768 378.674 193.275 378.965C191.775 378.144 190.159 377.439 188.957 376.197C188.511 374.385 188.924 372.477 188.769 370.64C188.763 368.544 187.78 366.655 187.03 364.766C187.774 362.464 188.187 360.07 188.343 357.657C183.488 355.717 177.865 354.837 173.993 351.079C173.611 346.673 174.277 342.171 173.34 337.785C175.841 336.847 178.427 336.129 180.838 334.965C182.745 334.033 183.598 331.957 185.027 330.501Z",fill:e("کهکیلویه و بویراحمد")})})}),u.jsx(F,{placement:"top",title:"کردستان",children:u.jsx("a",{id:"کردستان",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M59.1365 135.578C60.8947 134.517 62.5301 136.309 64.0685 136.995C65.6974 138.295 67.7529 137.377 69.5822 137.215C72.0579 136.794 74.4624 137.81 76.9317 137.771C78.7092 137.642 80.3899 136.943 82.1545 136.749C84.3716 138.075 85.91 140.43 88.4439 141.232C90.9584 142.008 93.6344 141.724 96.2265 141.737C96.6272 140.042 97.0215 138.353 97.4158 136.659C102.742 138.735 108.585 138.962 113.905 141.032C115.282 141.504 115.935 142.914 116.284 144.221C117.68 148.91 116.911 153.859 116.168 158.588C118.695 161.039 122.14 162.268 124.493 164.927C121.837 163.957 119.238 162.831 116.555 161.939C117.467 164.403 118.533 166.809 119.645 169.19C118.663 169.345 117.68 169.488 116.704 169.649C115.954 168.453 115.243 167.224 114.293 166.176C112.464 166.02 111.384 168.006 110.861 169.488C111.455 171.551 112.645 173.382 113.304 175.426C114.047 177.483 114.416 179.753 115.812 181.513C117.751 184.081 120.705 185.931 121.914 189.023C122.619 190.724 121.067 192.167 120.305 193.551C119.833 192.807 119.354 192.07 118.87 191.339C116.601 192.064 114.345 193.021 111.94 193.137C110.389 191.966 109.406 190.213 107.874 189.03C106.317 187.943 104.449 187.367 102.994 186.125C102.096 185.148 101.145 184.23 100.215 183.292C99.4002 185.258 99.4584 187.412 99.4261 189.502C97.4805 189.515 95.5348 189.521 93.5892 189.534C93.7766 190.44 93.9705 191.339 94.158 192.245C92.8781 192.031 91.6112 191.727 90.3314 191.501C88.612 193.28 87.1253 195.266 85.9165 197.426C85.0762 197.808 84.2488 198.215 83.402 198.597C83.3245 199.095 83.1693 200.098 83.0918 200.596C81.1979 199.968 79.3104 199.308 77.4617 198.565C76.964 198.662 76.4663 198.752 75.9685 198.836C75.7035 197.381 75.5419 195.77 74.191 194.89C71.3274 192.613 70.0993 189.043 67.7788 186.319C65.6198 183.544 62.7498 181.455 60.3776 178.887C58.1087 176.267 56.1243 173.362 54.7992 170.141C55.646 169.468 56.5509 168.86 57.2814 168.058C57.6563 166.939 57.8243 165.762 58.057 164.61C60.1578 164.397 62.4266 164.571 64.3141 163.465C65.6974 162.689 66.9708 161.744 68.27 160.845C67.7464 160.024 67.2293 159.209 66.7122 158.394C60.8818 158.872 55.1159 157.773 49.2984 157.721C47.6178 155.14 45.4976 152.882 42.9961 151.09C44.8642 148.238 46.4801 145.152 48.8395 142.668C51.4897 142.248 54.1657 142.992 56.816 143.186C57.0357 140.605 56.4346 137.086 59.1365 135.578Z",fill:e("کردستان")})})}),u.jsx(F,{placement:"top",title:"لرستان",children:u.jsx("a",{id:"لرستان",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M98.0674 227.674C100.873 223.45 103.575 218.987 107.699 215.895C109.017 217.706 110.233 219.614 111.803 221.225C113.529 223.049 116.153 223.398 118.254 224.627C120.2 225.869 121.544 228.017 123.852 228.67C126.489 229.453 129.172 230.165 131.913 230.417C134.298 231.077 135.119 226.691 137.517 228.095C140.167 229.88 142.746 231.834 145.823 232.862C145.196 235.43 144.621 238.011 144.078 240.599C145.067 241.627 146.043 242.682 147.012 243.736C149.384 244.131 151.867 244.997 154.252 244.305C156.32 242.475 156.837 239.234 159.455 237.985C160.102 237.61 160.767 237.261 161.433 236.911C162.59 237.707 163.76 238.477 164.924 239.273C164.562 242.145 164.659 245.159 166.65 247.462C168.608 246.97 170.56 246.453 172.506 245.91C173.747 248.51 175.007 251.097 176.287 253.679C177.865 256.667 177.347 260.691 174.762 262.961C172.842 265.49 169.571 265.963 166.779 266.991C166.714 268.692 166.643 270.387 166.578 272.089C164.323 272.865 162.138 273.971 160.67 275.918C159.345 277.762 156.896 278.745 154.73 277.826C151.602 276.39 149.591 273.337 146.527 271.797C144.194 270.691 141.518 270.788 139.133 269.844C137.239 268.887 135.849 267.024 133.755 266.441C131.919 266.15 130.174 266.998 128.416 267.379C125.371 268.214 122.191 267.399 119.12 267.949C117.705 268.841 117.181 270.549 116.522 271.998C115.106 275.672 113.607 279.321 111.849 282.853C109.631 280.873 110.058 277.729 109.088 275.168C107.821 271.778 106.354 268.22 103.381 265.963C100.478 263.666 97.6731 261.26 94.8096 258.918C92.14 256.661 88.3199 256.732 85.605 254.552C82.6962 252.365 81.3647 248.704 80.4727 245.314C81.3065 241.731 85.1848 240.696 88.2164 239.68C90.1685 238.969 92.2758 239.163 94.3054 239.324C95.8438 237.817 97.5245 236.446 98.8884 234.77C99.845 233.263 100 231.413 100.42 229.712C99.6317 229.033 98.8496 228.353 98.0674 227.674Z",fill:e("لرستان")})})}),u.jsx(F,{placement:"top",title:"مرکزی",children:u.jsx("a",{id:"مرکزی",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M200.846 169.281C201.331 171.5 201.667 173.744 201.919 176.002C203.135 174.934 204.363 173.88 205.572 172.8C206.444 174.844 207.698 176.927 207.381 179.243C206.929 182.328 205.087 184.948 203.574 187.6C202.062 190.084 200.795 192.859 198.468 194.709C196.684 196.152 194.441 196.747 192.321 197.478C188.668 198.526 186.089 201.967 182.082 202.013C180.666 204.076 180.162 206.534 179.664 208.947C179.283 211.03 177.913 212.725 177.234 214.698C177.848 218.469 178.533 222.24 178.766 226.07C182.314 225.746 185.76 224.589 189.334 224.563C191.771 226.393 193.064 229.602 196.011 230.773C200.969 231.866 205.546 228.761 210.407 228.541C211.324 229.912 212.585 231.892 211.35 233.438C209.941 235.508 208.442 237.533 207.53 239.887C206.418 239.92 205.307 239.965 204.201 239.997C202.643 241.621 201.15 243.671 198.772 244.047C194.008 244.765 189.263 245.644 184.59 246.815C181.5 248.044 180.136 251.389 178.255 253.905C176.872 251.66 175.896 249.209 174.706 246.86C174.228 246.058 173.646 244.972 172.573 244.985C170.389 244.829 168.217 245.153 166.045 245.302C166.297 243.283 166.575 241.271 166.904 239.273C165.166 237.707 163.278 236.31 161.242 235.152C159.71 236.109 158.133 236.996 156.51 237.804C155.476 239.829 154.752 242.093 153.188 243.794C150.299 243.354 147.461 242.171 145.477 239.958C146.491 237.3 147.241 234.544 147.739 231.737C149.413 230.093 151.372 228.282 151.359 225.74C151.895 222.053 150.551 218.508 148.657 215.422C147.325 213.495 148.12 211.134 148.01 208.986C147.286 208.151 146.388 207.505 145.541 206.819C147.61 207.789 149.743 208.617 151.902 209.361C151.908 206.133 151.404 202.517 153.841 199.962C153.033 198.131 152.302 196.275 151.682 194.38C153.544 193.345 155.386 192.271 157.183 191.126C158.159 193.002 159.342 194.755 160.525 196.508C162.166 198.739 160.977 201.883 162.509 204.147C164.054 205.331 166.303 204.49 166.232 202.42C165.883 196.805 162.593 191.85 161.837 186.319C162.141 183.363 163.097 180.504 163.104 177.503C164.881 177.69 166.73 178.188 168.508 177.729C169.277 177.127 169.923 176.383 170.595 175.685C176.555 175.394 181.558 171.629 187.369 170.814C190.42 170.924 193.471 171.564 196.529 171.021C197.498 172.593 198.468 174.158 199.508 175.678C200.284 173.621 200.627 171.454 200.846 169.281Z",fill:e("مرکزی")})})}),u.jsx(F,{placement:"top",title:"مازندران",children:u.jsx("a",{id:"مازندران",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M197.932 123.799C198.959 122.893 200.11 122.149 201.235 121.373C206.432 124.4 211.234 128.094 216.658 130.727C220.29 132.603 224.479 132.609 228.331 133.774C233.593 135.197 238.745 137.784 244.349 137.189C248.531 137.047 251.847 133.955 255.945 133.47C258.434 133.146 260.974 133.127 263.405 132.435C269.106 130.785 274.788 129.039 280.528 127.531C284.923 126.677 289.364 126.069 293.798 125.422C293.895 125.946 294.082 127.001 294.179 127.525C295.472 127.861 296.765 128.191 298.064 128.521C297.993 129.886 297.928 131.257 297.857 132.622C301.49 136.102 305.886 138.58 310.165 141.161C307.611 142.688 304.554 144.098 303.416 147.067C302.285 149.881 301.451 152.921 299.286 155.166C297.082 157.475 295.543 160.522 292.725 162.152C290.747 163.388 288.394 162.767 286.261 162.43C284.684 163.452 283.139 164.778 281.193 164.94C279.552 164.985 278.039 164.235 276.514 163.743C273.54 162.521 270.237 163.692 267.225 162.644C263.935 161.842 261.142 159.765 257.891 158.898C255.473 160.638 253.922 163.271 251.75 165.276C250.567 166.311 249.313 167.922 247.536 167.437C244.634 166.932 242.009 165.445 239.546 163.899C236.896 162.256 235.616 159.254 233.341 157.229C231.02 155.547 227.898 155.903 225.423 154.597C224.363 153.549 223.697 152.171 222.617 151.142C220.517 150.01 218.047 149.758 216.011 148.477C214.072 147.3 212.017 146.336 209.922 145.489C208.067 144.777 206.904 143.069 205.333 141.944C203.29 140.462 200.86 139.641 198.843 138.134C196.535 136.432 194.519 134.382 192.418 132.441C193.543 131.18 194.751 129.938 195.411 128.353C196.167 126.8 196.503 124.918 197.932 123.799Z",fill:e("مازندران")})})}),u.jsx(F,{placement:"top",title:"قزوین",children:u.jsx("a",{id:"قزوین",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M146.194 131.891C149.684 129.976 152.729 127.188 156.504 125.849C159.354 126.716 160.447 129.931 162.489 131.846C163.801 133.592 166.051 133.858 168.055 134.155C171.306 134.608 174.37 136.523 177.731 135.908C180.582 135.197 182.592 132.629 185.494 132.046C187.13 131.807 188.978 131.807 190.355 132.861C193.904 135.371 196.748 138.813 200.575 140.954C202.617 142.073 204.634 143.263 206.431 144.764C202.688 144.182 199.01 143.224 195.255 142.713C194.447 143.47 193.632 144.227 192.824 144.984C193.238 146.168 193.316 147.578 194.169 148.561C195.908 149.997 198.17 150.605 199.928 152.035C198.739 154.868 197.336 158.128 194.343 159.448C191.978 160.535 189.605 161.622 187.395 163.012C187.395 165.031 187.395 167.049 187.375 169.067C181.428 170.231 176.173 173.75 170.039 174.171C168.876 175.083 167.815 176.603 166.128 176.267C160.621 175.84 155.243 174.158 149.665 174.546C150.473 174.313 151.281 174.08 152.089 173.854C152.037 172.618 151.979 171.389 151.934 170.16C149.232 168.653 146.304 167.586 143.24 167.126C143.091 164.345 142.134 161.719 140.531 159.455C141.624 158.219 142.71 156.99 143.796 155.754C145.58 156.705 147.254 158.025 149.27 158.426C151.552 157.747 153.75 156.815 156.064 156.233C158.398 155.793 159.774 153.497 160.246 151.343C160.757 147.63 160.576 143.503 158.288 140.365C157.195 138.696 155.023 138.56 153.33 137.894C150.247 136.917 148.281 134.175 146.194 131.891Z",fill:e("قزوین")})})}),u.jsx(F,{placement:"top",title:"قم",children:u.jsx("a",{id:"قم",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M200.186 195.194C202.745 193.021 203.696 189.67 205.648 187.05C211.433 187.089 216.72 190.007 222.46 190.55C223.449 191.999 224.522 193.474 226.119 194.302C230.346 196.656 234.651 198.875 239.04 200.9C240.275 204.574 238.879 208.358 237.25 211.664C235.724 215.092 231.484 215.707 228.168 215.979C223.178 215.675 217.677 214.627 213.043 217.026C211.549 219.802 211.776 223.133 211.136 226.173C206.553 227.564 201.957 229.466 197.102 229.466C193.631 228.722 192.545 224.472 189.391 223.211C186.178 222.81 183.037 223.857 179.928 224.491C179.676 220.513 177.969 216.205 179.992 212.44C181.266 209.684 181.867 206.702 182.468 203.746C184.653 203.274 186.78 202.491 188.583 201.146C192.106 198.468 197.038 198.461 200.186 195.194Z",fill:e("قم")})})}),u.jsx(F,{placement:"top",title:"سمنان",children:u.jsx("a",{id:"سمنان",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M359.604 108.746C361.633 110.829 363.016 113.397 364.038 116.095C365.977 116.179 367.916 116.159 369.849 115.933C368.459 116.399 366.61 116.625 366.197 118.32C366.546 119.969 367.399 121.438 368.162 122.919C367.735 124.219 367.321 125.52 366.901 126.813C369.48 128.838 372.066 130.856 374.509 133.049C377.017 135.494 380.663 135.96 383.973 136.465C385.776 136.788 387.418 135.844 389.014 135.164C389.758 135.941 391.122 136.497 391.057 137.765C390.495 140.469 388.413 142.675 388.355 145.521C387.702 151.22 389.758 156.757 392.227 161.783C394.444 166.046 399.816 167.327 402.078 171.532C401.302 174.165 399.046 176.06 398.329 178.725C397.508 180.911 397.586 183.57 395.944 185.356C393.326 187.186 389.797 187.012 387.243 188.978C383.611 191.675 381.633 195.861 378.84 199.302C373.727 205.253 371.452 213.113 366.19 218.967C364.988 220.41 363.133 220.998 361.329 221.238C355.505 222.221 349.727 220.351 343.896 220.533C337.646 220.675 331.395 220.429 325.151 220.623C319.54 221.276 314.033 222.932 308.338 222.719C299.295 222.292 290.239 222.628 281.19 222.493C277.26 222.389 273.368 221.639 269.665 220.351C265.935 219.084 262.322 217.356 258.392 216.839C255.657 216.528 252.904 216.671 250.163 216.684C250.169 214.982 250.182 213.288 250.208 211.593C247.933 209.115 245.367 206.942 242.885 204.684C241.766 203.546 240.325 202.291 240.448 200.531C240.383 197.704 242.736 195.77 244.52 193.914C244.365 192.258 244.52 190.485 243.764 188.952C242.432 186.475 239.969 184.851 238.605 182.399C239.136 180.29 240.293 178.421 241.217 176.474C242.652 176.7 244.184 176.668 245.535 177.295C247.868 178.835 249.239 181.681 251.992 182.619C254.552 183.311 257.312 182.91 259.833 183.842C262.108 184.631 264.468 185.537 266.937 185.207C270.162 185.051 272.67 182.82 275.185 181.06C276.814 179.831 278.637 178.79 279.942 177.185C280.388 173.557 279.134 170.012 278.501 166.473C280.621 166.415 282.793 166.266 284.719 165.277C287.951 163.633 292.088 165.095 294.997 162.598C297.246 160.522 298.765 157.799 300.853 155.573C302.915 153.355 303.704 150.392 304.809 147.662C305.94 144.822 308.946 143.36 311.693 142.481C315.836 141.478 320.271 143.27 324.336 141.627C327.446 140.618 328.318 137.053 330.645 135.08C332.914 133.185 335.215 131.102 338.046 130.125C342.112 129.446 345.641 132.506 349.675 132.338C351.032 132.266 352.59 131.413 352.784 129.951C353.14 127.104 352.881 124.122 354.103 121.444C355.945 117.214 357.031 112.634 359.604 108.746Z",fill:e("سمنان")})})}),u.jsx(F,{placement:"top",title:"سیستان و بلوچستان",children:u.jsx("a",{id:"سیستان و بلوچستان",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M535.513 327.759C540.794 329.447 546.54 327.668 551.724 329.706C554.568 330.754 555.99 333.645 557.393 336.123C558.395 338.173 559.875 340.45 559.015 342.824C558.007 346.195 557.71 349.953 555.428 352.78C548.337 362.114 541.479 371.623 534.44 380.984C532.856 383.157 530.962 385.137 529.779 387.569C530.199 389.115 531.544 390.208 532.578 391.385C536.476 395.247 540.057 399.426 543.916 403.333C546.049 405.287 546.191 408.347 547.484 410.785C548.938 413.534 550.806 416.031 552.577 418.58C554.568 421.4 555.596 424.822 557.916 427.423C560.463 430.282 563.023 433.225 566.223 435.379C571.18 438.627 577.522 437.682 582.744 440.244C585.414 441.609 587.011 444.287 588.84 446.557C591.432 446.389 594.03 446.13 596.609 445.742C595.886 449.805 595.291 454.022 596.293 458.098C597.579 463.35 598.704 468.655 599.376 474.024C599.745 476.695 597.844 478.901 597.165 481.359C597.973 483.125 599.628 484.956 601.748 484.814C605.284 484.671 608.264 482.42 611.703 481.844C613.926 481.696 615.924 483.106 617.494 484.548C616.693 485.642 615.62 486.489 614.605 487.362C614.877 489.736 615.264 492.097 615.659 494.458C615.116 495.06 614.573 495.662 614.043 496.27C614.017 498.903 614.017 501.535 614.043 504.168C610.158 503.644 606.254 504.116 602.388 504.504C599.997 504.563 598.29 506.536 596.028 507.014C592.44 507.978 588.323 508.243 585.504 510.934C584.58 512.707 584.897 514.835 584.709 516.776C583.326 516.802 581.949 516.827 580.579 516.879C577.353 520.088 572.687 520.78 568.815 522.908C568.472 527.992 568.356 533.09 567.974 538.174C567.244 538.808 565.893 539.022 565.725 540.128C564.898 544.145 564.102 548.266 564.639 552.38C564.93 554.896 564.71 557.445 564.199 559.922C563.294 560.356 562.37 560.763 561.562 561.358C560.942 562.607 560.883 564.043 560.612 565.395C559.216 565.479 557.813 565.615 556.423 565.472C552.752 565.201 549.94 562.232 546.23 562.141C541.33 561.869 536.54 560.718 531.867 559.288C531.182 557.632 531.007 555.485 529.449 554.391C527.575 554.107 525.571 554.372 523.949 555.381C523.606 556.513 523.406 557.691 523.257 558.874C521.092 557.898 518.849 557.089 516.541 556.558C516.444 557.121 516.257 558.24 516.166 558.803C515.772 558.829 514.99 558.881 514.595 558.913C514.098 558.182 513.6 557.451 513.122 556.733C510.956 557.121 508.804 557.548 506.651 557.982C505.481 557.328 504.421 555.925 502.941 556.403C500.627 556.584 498.086 558.227 495.934 556.701C494.57 555.944 493.342 554.948 491.868 554.43C489.082 554.521 486.458 555.608 483.782 556.287C482.974 553.557 481.972 550.827 479.949 548.751C478.268 547.043 478.533 544.016 476.174 542.929C473.465 541.37 471.184 539.235 469.16 536.881C471.048 533.051 471.022 528.672 472.722 524.797C473.84 522.578 471.487 520.696 470.576 518.846C471.733 517.914 472.897 516.989 474.067 516.071C473.252 515.113 472.444 514.162 471.636 513.205C472.67 510.889 473.847 508.289 472.89 505.734C472.263 503.301 470.143 501.82 468.191 500.5C467.816 497.958 467.363 495.435 466.898 492.919C466.168 489.659 467.047 486.36 467.48 483.132C467.59 481.327 469.115 480.188 470.137 478.869C472.205 476.572 472.308 473.312 472.716 470.408C471.617 469.483 470.427 468.629 469.529 467.51C469.232 463.712 469.135 459.896 468.811 456.099C470.052 454.52 471.811 453.479 473.381 452.269C473.162 450.148 473.569 447.761 472.386 445.878C470.835 444.274 468.482 443.931 466.484 443.148C468.372 441.589 470.498 440.347 472.806 439.545C477.04 437.98 481.119 435.606 483.788 431.873C481.965 429.512 479.968 426.912 480.24 423.742C479.936 420.197 482.819 417.726 484.312 414.841C485.353 413.185 484.48 411.244 484.183 409.504C483.439 406.548 483.549 403.456 482.819 400.506C482.198 397.977 479.477 396.858 478.372 394.652C478.43 391.017 480.673 387.866 481.009 384.27C481.804 377.633 482.87 371.035 483.937 364.443C484.17 362.283 486.064 360.969 488.016 360.471C493.911 358.692 499.903 357.179 505.578 354.753C506.864 354.384 508.332 353.297 509.65 354.138C512.378 355.633 515.313 356.681 518.092 358.078C522.003 360.277 522.708 365.394 526.172 368.014C528.874 368.59 531.641 367.962 534.33 367.542C534.537 362.709 531.279 358.641 531.356 353.847C531.35 349.96 531.091 346.039 531.602 342.178C532.151 338.814 535.144 336.686 536.463 333.684C537.012 331.672 536.101 329.661 535.513 327.759Z",fill:e("سیستان و بلوچستان")})})}),u.jsx(F,{placement:"top",title:"تهران",children:u.jsx("a",{id:"تهران",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M222.963 157.242C225.562 156.233 228.432 156.874 230.979 157.734C232.957 158.381 234.036 160.283 235.329 161.757C237.255 164.19 239.795 166.092 242.588 167.431C245.154 168.666 248.095 168.181 250.842 168.252C253.512 165.788 255.949 163.097 258.14 160.205C261.042 162.068 264.164 163.815 267.668 164.164C270.79 164.416 273.938 164.436 277.028 164.992C277.209 169.061 278.282 173.007 278.689 177.05C275.741 178.589 273.182 180.73 270.389 182.522C267.694 184.23 264.268 183.906 261.437 182.736C258.774 181.565 255.826 181.849 253.034 181.332C249.614 180.407 248.16 176.493 244.876 175.342C243.144 175.09 240.591 174.533 239.64 176.474C238.406 178.434 237.132 180.588 237.087 182.969C239.136 186.397 243.344 188.719 243.17 193.215C241.347 194.929 239.899 196.973 238.716 199.166C234.825 197.213 230.972 195.188 227.133 193.144C225.62 192.419 224.599 191.08 223.739 189.696C218.038 188.111 212.376 185.996 206.383 185.983C207.65 183.454 209.092 180.814 208.93 177.884C208.898 175.284 207.03 173.259 206.293 170.872C207.25 168.084 210.423 167.295 212.298 165.315C212.99 163.633 213.177 161.803 213.513 160.03C216.726 159.332 219.874 158.368 222.963 157.242Z",fill:e("تهران")})})}),u.jsx(F,{placement:"top",title:"یزد",children:u.jsx("a",{id:"یزد",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M398.079 195.285C400.755 193.998 402.771 191.313 405.894 191.009C408.111 190.815 410.496 190.505 412.635 191.287C415.829 193.448 418.188 196.695 419.552 200.285C418.117 202.582 417.044 205.189 415.034 207.058C413.017 208.488 410.373 208.145 408.04 208.417C404.918 215.72 402.72 223.431 398.841 230.41C398.105 231.885 396.948 233.535 397.781 235.23C399.74 240.146 401.931 244.978 404.581 249.564C405.771 251.563 406.65 253.905 408.511 255.399C409.772 255.619 411.058 255.619 412.345 255.684C415.092 252.624 418.227 249.629 422.422 248.808C421.659 250.787 420.677 252.76 420.612 254.927C420.761 257.185 421.976 259.171 422.616 261.312C423.831 264.857 423.592 268.66 424.051 272.334C424.148 273.486 424.969 274.359 425.641 275.239C427.625 277.561 429.506 279.993 431.807 282.018C433.617 283.655 435.602 285.311 436.442 287.691C437.774 291.469 437.45 295.544 437.496 299.484C439.157 300.693 440.838 301.871 442.538 303.042C438.582 309.349 435.065 315.914 432.208 322.797C426.972 320.572 421.304 319.55 416.204 317.001C412.261 315.164 408.033 314.051 404.071 312.285C401.912 311.328 400.044 309.853 397.936 308.825C395.403 307.621 392.242 307.731 389.934 309.368C387.329 311.089 384.414 312.344 382.087 314.465C379.301 316.911 376.431 319.44 372.882 320.701C368.778 322.247 364.188 323.25 360.924 326.361C360.258 332.546 360.62 339.111 358.3 344.978C354.357 347.003 349.496 347.411 345.301 345.819C341.119 344.299 336.975 346.356 332.961 347.359C330.369 348.045 327.667 348.019 325.011 348.006C322.955 350.102 320.583 352.159 319.717 355.083C319.148 356.946 318.495 358.893 318.721 360.872C319.419 362.451 320.583 363.764 321.455 365.258C322.716 367.218 322.431 369.657 322.619 371.882C323.847 373.337 325.508 374.586 326.161 376.436C326.077 378.228 325.534 379.961 325.276 381.734C324.746 384.942 325.14 388.196 325.541 391.392C323.459 391.916 321.488 392.783 319.73 394.031C317.041 392.466 314.461 390.719 311.895 388.966C310.88 388.203 309.704 387.426 309.336 386.139C308.185 382.452 308.437 378.422 306.86 374.851C305.515 371.811 302.807 369.747 300.797 367.192C298.088 363.764 295.561 360.115 294.003 356.008C291.469 350.173 290.067 343.911 287.229 338.212C284.973 333.49 280.351 330.65 276.273 327.675C273.984 325.941 270.546 325.21 269.531 322.215C267.921 318.068 269.738 313.689 270.882 309.679C272.84 304.044 272.375 297.957 271.754 292.142C273.461 291.605 275.277 291.171 276.68 290.001C278.399 288.72 279.834 286.928 281.922 286.236C286.356 285.945 290.358 288.739 294.798 288.519C298.437 288.325 301.96 287.09 305.14 285.356C310.855 282.361 316.704 279.457 323.052 278.085C326.963 277.076 331.352 276.662 334.513 273.913C338.048 269.792 337.221 263.563 340.686 259.41C342.237 258.478 344.221 258.899 345.96 258.718C348.041 255.761 350.821 252.857 351.002 249.04C351.306 244.357 352.088 239.654 351.454 234.958C350.905 230.818 350.963 226.633 351.015 222.46C355.811 223.295 360.963 223.547 365.475 221.445C369.786 218.036 371.79 212.718 374.983 208.43C379.43 208.203 384.382 209.051 388.176 206.056C392.035 203.785 393.276 199.205 393.218 194.994C394.827 195.182 396.456 195.518 398.079 195.285Z",fill:e("یزد")})})}),u.jsx(F,{placement:"top",title:"زنجان",children:u.jsx("a",{id:"زنجان",onClick:x,style:{cursor:"pointer"},children:u.jsx("path",{className:"path-city path-city-g1",d:"M109.528 111.036C111.667 109.962 114.104 110.337 116.405 110.305C118.771 110.35 121.13 109.982 123.503 110.046C125.584 110.118 127.381 111.321 129.378 111.767C131.932 111.644 134.33 110.557 136.792 109.93C137.794 111.146 138.829 112.336 139.843 113.539C141.085 112.369 142.158 110.577 144.103 110.641C147.005 110.027 148.693 112.828 150.483 114.549C152.926 117.285 156.449 119.931 156.339 123.98C152.455 126.451 148.292 128.495 144.659 131.367C146.669 134.621 148.951 138.315 152.875 139.389C154.31 140.003 156.229 140.042 157.134 141.484C158.285 143.289 159.067 145.346 159.41 147.462C159.798 149.959 158.375 152.203 157.425 154.403C154.51 154.862 151.64 155.645 149.074 157.119C147.503 156.175 146.055 154.758 144.181 154.519C141.712 155.444 140.037 157.663 138.124 159.384C139.171 160.58 140.464 161.654 141.11 163.148C142.035 166.15 142.229 169.32 141.905 172.431C139.145 171.771 136.715 170.322 134.394 168.75C132.455 167.308 130.089 168.582 128.15 169.326C126.457 167.515 126.004 165.011 124.795 162.922C122.966 160.794 119.786 160.386 118.054 158.187C117.33 154.61 119.385 151.065 118.538 147.475C117.905 144.764 117.769 141.239 114.886 139.893C110.93 137.933 106.464 137.513 102.185 136.698C100.763 136.407 99.1078 135.85 98.7071 134.265C97.5177 130.52 95.8953 126.794 95.6626 122.829C95.4816 121.076 97.0782 120.047 98.2675 119.109C102.023 116.418 105.19 112.847 109.528 111.036Z",fill:e("زنجان")})})}),u.jsx(F,{placement:"top",title:"خزر",children:u.jsx("a",{id:"خزر",style:{cursor:"pointer"},children:u.jsx("path",{d:"M153.972 24.8531C202.135 24.7819 250.304 24.8466 298.473 24.8207C297.581 28.385 296.579 31.9428 296.101 35.5977C295.952 37.2472 295.803 39.0455 296.592 40.5657C298.79 42.5645 302.216 43.6383 303.172 46.7174C303.153 51.1032 300.748 54.9457 299.507 59.0339C298.234 63.3615 301.026 67.5274 300.412 71.8615C300.063 74.6624 299.346 77.4116 299.055 80.2256C298.13 86.662 299.022 93.2213 300.703 99.4572C301.666 103.015 301.802 106.722 302.623 110.312C303.961 115.991 304.756 121.833 307.038 127.247C304.116 127.467 301.097 127.848 298.234 127.008C296.502 126.477 295.228 124.925 293.451 124.562C282.688 124.09 272.643 128.463 262.411 131.063C258.914 131.969 255.165 131.581 251.804 133.017C248.778 134.259 245.747 135.941 242.373 135.76C237.706 135.579 233.414 133.509 228.947 132.377C225.373 131.322 221.552 131.225 218.12 129.705C215.341 128.489 212.736 126.911 210.215 125.229C206.64 122.777 202.691 120.914 199.304 118.197C196.466 115.952 192.969 113.986 191.793 110.325C190.623 107.815 190.732 104.283 188.005 102.821C184.1 100.557 179.459 100.44 175.096 99.9552C171.36 99.5154 167.385 99.703 164.004 97.8076C161.289 96.3133 158.581 94.7479 156.157 92.8073C153.164 90.4074 152.815 86.3127 152.007 82.8325C150.204 74.0738 150.592 65.1016 150.676 56.22C150.798 53.1927 149.984 50.2106 150.126 47.1897C151.05 44.738 153.442 42.8944 153.507 40.1193C153.727 35.0349 153.054 29.9052 153.972 24.8531Z",fill:"#1E90FF"})})}),u.jsx(F,{placement:"top",title:"خلیج فارس",children:u.jsx("a",{id:"خلیج فارس",style:{cursor:"pointer"},children:u.jsx("path",{d:"M138.84 373.448C138.11 372.38 138.827 371.235 139.144 370.174C142.066 373.001 144.684 377.07 149.183 377.245C149.241 378.351 149.312 379.457 149.376 380.57C152.033 379.877 154.8 379.742 157.476 380.414C157.547 382.64 157.637 384.865 157.741 387.097C161.813 385.402 165.847 383.565 169.628 381.275C171.703 380.11 173.959 378.681 176.454 379.185C179.136 382.361 177.081 387.278 179.834 390.428C181.871 392.783 183.538 395.409 185.329 397.951C187.087 400.461 190.345 401.664 191.534 404.607C192.736 407.577 193.803 410.604 195.173 413.502C194.21 415.352 193.745 417.383 193.383 419.427C195.212 420.417 197.255 420.534 199.239 419.964C200.144 420.378 201.055 420.812 201.96 421.245C200.868 423.406 199.808 425.579 198.754 427.759C199.549 428.762 200.293 429.842 201.295 430.67C203.124 431.912 205.451 432.261 207.196 433.665C207.739 436.576 207.183 439.603 207.927 442.495C208.806 446.169 210.629 449.559 213.065 452.437C214.61 453.899 213.912 456.105 214.08 457.975C213.945 459.333 215.199 460.155 215.942 461.112C217.577 462.613 218.346 464.987 220.46 465.931C222.761 467.024 224.552 468.972 226.885 469.974C230.563 470.388 234.293 469.703 237.971 470.291C240.169 470.375 241.332 472.497 242.793 473.83C245.508 476.883 250 476.32 253.387 478.125C256.051 479.438 257.589 482.103 259.244 484.445C258.365 484.956 257.485 485.454 256.613 485.984C257.524 487.304 258.416 488.798 259.974 489.445C263.549 491.146 266.949 493.223 270.013 495.733C271.616 497.059 273.309 498.353 275.339 498.954C279.456 500.261 283.496 501.787 287.536 503.34C287.569 504.362 287.601 505.397 287.64 506.439C289.85 508.819 292.151 511.348 295.306 512.454C298.809 513.58 302.681 513.36 306.088 511.995C309.009 513.101 312.228 514.505 315.254 512.875C319.177 515.786 324.426 516.976 327.296 521.187C329.125 521.31 331.019 521.685 332.835 521.194C335.143 520.295 336.875 518.438 338.789 516.931C341.924 514.292 345.621 512.474 348.989 510.165C350.624 510.494 352.272 511.09 353.972 510.908C355.963 510.54 357.825 509.718 359.732 509.052C359.835 506.969 358.62 504.116 360.837 502.764C363.339 501.71 366.183 502.007 368.768 501.205C371.38 500.655 373.668 499.226 375.652 497.479C378.038 495.364 381.244 494.672 384.262 493.96C385.478 493.65 386.712 494.025 387.901 494.303C391.916 495.403 396.137 495.455 400.105 496.761C400.112 498.003 400.041 499.265 400.28 500.507C401.999 503.65 406.052 504.899 407.229 508.431C408.761 512.81 408.87 517.494 409.258 522.067C409.459 524.603 410.545 526.951 411.831 529.112C413.512 531.524 412.258 534.558 412.283 537.249C415.418 539.267 416.375 542.909 417.112 546.331C420.195 547.256 423.343 548.253 426.607 548.097C429.167 548.168 432.024 547.095 434.293 548.789C435.877 549.96 437.822 549.799 439.665 549.488C441.578 551.325 443.149 553.635 445.547 554.883C449.302 556.293 452.347 552.27 456.083 552.8C461.209 553.259 466.503 553.072 471.422 554.818C473.872 555.64 475.164 558.072 477.207 559.502C481.622 559.431 485.552 556.798 489.941 556.39C492.682 555.717 494.685 558.117 497.109 558.874C499.339 559.075 501.511 558.331 503.683 557.917C504.556 558.415 505.415 558.971 506.372 559.34C508.402 559.353 510.335 558.46 512.377 558.421C513.075 558.926 513.683 559.54 514.336 560.136C515.493 560.168 516.656 560.194 517.833 560.226C517.768 559.573 517.71 558.919 517.658 558.286C520.8 559.392 523.715 561.067 526.895 562.089C526.733 559.832 525.538 557.852 524.672 555.821C526.184 555.814 527.697 555.827 529.222 555.84C529.539 557.264 529.868 558.687 530.185 560.123C532.473 560.99 534.775 561.876 537.192 562.329C540.553 563.021 544.031 562.93 547.366 563.771C550.146 564.463 552.441 566.41 555.272 566.967C557.379 567.458 559.564 567.193 561.697 566.941C562.162 565.356 562.647 563.778 563.138 562.212C566.183 562.219 569.402 561.992 572.194 563.461C575.872 565.324 579.582 567.381 583.771 567.788C588.91 568.286 594.482 568.584 599.2 566.113C601.67 564.89 603.305 562.451 605.807 561.313C609.995 560.692 614.32 561.294 618.437 560.039C618.418 577.459 618.476 594.873 618.411 612.293C552.538 612.209 486.67 612.3 420.796 612.28C417.7 612.099 414.113 613.063 411.443 611.038C408.806 609.169 406.227 607.028 404.675 604.13C403.046 601.154 401.036 598.359 398.328 596.27C395.128 593.812 393.758 589.879 392.038 586.379C390.209 582.291 387.455 578.41 387.274 573.791C387.068 568.189 387.449 562.581 387.145 556.992C387.081 554.378 384.676 552.891 383.351 550.924C383.894 547.767 386.964 545.84 388.018 542.871C389.854 536.945 388.632 530.716 389.162 524.655C388.005 524.234 386.848 523.807 385.704 523.393C384.54 525.347 383.513 527.371 382.562 529.441C381.554 529.092 380.552 528.723 379.518 528.503C377.889 530.256 376.725 532.391 375.736 534.558C374.269 537.76 374.327 541.577 372.104 544.442C370.132 547.218 367.185 549.009 364.483 550.982C362.531 552.367 361.083 554.294 359.661 556.19C359.505 555.019 359.344 553.848 359.189 552.697C357.211 555.705 355.698 559.068 353.067 561.604C349.312 565.233 346.507 569.677 343.01 573.532C340.353 576.514 336.869 578.52 333.805 581.036C331.872 582.621 329.823 584.051 327.729 585.422C327.671 587.44 327.878 589.53 327.283 591.49C326.701 593.23 324.975 594.116 323.553 595.06C324.516 596.011 325.46 596.988 326.43 597.939C324.225 597.421 322.041 596.852 319.862 596.225C320.03 598.295 321.2 600.779 319.746 602.622C318.091 603.968 315.887 604.311 313.948 605.1C312.099 603.25 309.953 601.426 307.122 601.963C308.092 604.149 309.559 606.057 311.239 607.752C308.609 608.425 306.055 609.324 303.528 610.314C299.798 611.814 295.687 611.271 291.777 611.155C290.607 610.521 289.469 609.751 288.157 609.486C286.03 609.33 283.949 609.977 281.829 609.9C279.961 608.942 278.299 607.597 276.27 606.982C276.134 607.603 275.862 608.839 275.727 609.453C274.137 608.632 272.527 607.021 270.601 607.804C266.102 609.007 261.183 608.205 257.285 605.663C253.504 611.879 246.025 614.725 239.012 614.712C236.4 614.622 233.479 614.868 231.164 613.503C229.219 610.21 230.46 606.135 230.318 602.519C227.706 601.84 225.508 603.463 223.485 604.861C221.979 603.547 220.641 601.95 218.818 601.076C216.86 600.449 214.908 601.497 213.065 602.047C213.705 600.132 214.222 598.107 215.483 596.49C216.905 594.595 218.889 593.249 220.796 591.897C219.982 591.211 219.174 590.539 218.359 589.872C219.2 586.839 219.859 583.598 221.927 581.12C223.227 579.328 225.121 577.537 224.92 575.13C224.739 571.702 224.474 568.254 224.985 564.838C223.983 564.554 222.994 564.289 221.999 564.01C222.554 561.177 221.333 558.525 220.9 555.795C221.488 553.796 222.897 552.16 223.615 550.213C224.707 547.412 224.326 544.345 224.416 541.415C222.645 539.934 220.473 539.183 218.165 539.494C217.648 537.327 217.021 535.199 216.394 533.07C214.597 532.559 212.542 531.11 210.784 532.469C207.752 534.526 203.305 535.761 202.471 539.837C201.586 543.492 200.319 547.03 199.078 550.581C198.101 549.449 197.048 548.388 196.078 547.263C195.348 548.304 194.249 549.197 193.984 550.504C194.178 553.039 195.471 555.465 194.928 558.059C193.906 564.948 194.314 572.09 196.86 578.617C197.772 580.525 197.397 582.647 197.016 584.646C196.615 584.678 195.807 584.743 195.406 584.775C194.966 582.226 194.701 579.438 192.704 577.569C192.071 575.712 191.295 573.908 190.267 572.239C189.614 572.362 188.961 572.491 188.315 572.633C188.141 568.196 188.089 563.622 186.512 559.418C185.529 556.338 181.644 556.009 180.138 553.331C178.91 551.254 177.326 549.41 175.258 548.143C176.169 547.806 177.074 547.463 177.992 547.14C176.79 545.484 175.361 543.918 174.702 541.952C174.385 540.509 174.534 539.022 174.528 537.566C173.248 536.602 171.948 535.671 170.636 534.765C170.662 533.109 170.811 531.46 171.192 529.849C172.362 532.042 173.151 534.403 174.153 536.68C176.493 532.863 179.227 528.652 178.451 523.949C178.354 520.689 174.463 520.262 172.627 518.276C171.257 516.18 171.444 513.528 171.153 511.135C172.433 511.381 173.707 511.626 174.993 511.859C173.972 509.078 172.647 506.128 170.093 504.433C167.088 502.926 163.487 502.318 161.128 499.724C159.105 497.35 158.122 494.316 156.965 491.47C156.015 491.243 155.058 491.011 154.115 490.784C153.707 491.619 153.307 492.485 152.912 493.339C151.755 491.949 150.508 490.648 149.073 489.549C148.704 487.66 148.749 485.454 147.289 484.005C146.151 483.022 144.697 482.524 143.365 481.883C145.537 482.032 147.715 482.181 149.887 482.349C149.299 480.945 149.047 479.27 147.857 478.228C145.673 477.788 143.417 478.054 141.232 477.646C139.5 477.342 138.931 475.434 138.026 474.192C137.754 474.179 137.218 474.153 136.953 474.14C137.043 473.092 137.056 472.038 137.017 470.996C135.983 469.819 134.316 470.776 133.016 470.847C133.811 470.388 134.613 469.935 135.408 469.495C135.686 466.125 133.294 463.738 131.103 461.565C131.711 461.397 132.939 461.06 133.546 460.892C131.568 459.43 129.287 458.356 127.509 456.642C126.998 455.439 127.322 454.068 127.225 452.806C127.496 451.06 125.861 449.986 125.02 448.686C123.172 446.46 123.579 443.407 123.404 440.722C122.506 439.694 121.439 438.762 120.825 437.533C120.16 435.47 120.418 433.148 119.274 431.246C118.259 429.525 117.309 427.766 116.598 425.896C115.085 424.272 113.334 422.649 112.862 420.385C111.782 416.432 112.396 411.775 109.539 408.489C107.807 406.38 104.885 407.596 102.629 407.9C102.72 407.318 102.804 406.749 102.894 406.179C101.867 405.901 100.832 405.623 99.8047 405.358C101.505 404.239 103.159 403.042 104.64 401.632C105.965 400.487 107.251 398.682 109.268 399.277C112.403 399.297 116.359 401.088 118.841 398.385C120.205 396.774 122.112 394.413 120.677 392.291C118.996 389.451 116.824 386.864 115.906 383.636C118.182 384.8 120.269 386.495 122.829 387.006C128.866 387.996 135.078 386.042 139.81 382.245C140.172 379.269 140.327 376.164 138.84 373.448ZM183.196 412.066C181.851 412.875 181.851 415.119 183.202 415.934C185.542 416.322 185.542 411.658 183.196 412.066ZM387.876 496.017C387.423 496.716 386.938 497.389 386.505 498.107C386.958 498.773 387.468 499.407 387.953 500.073C388.38 500.073 389.233 500.073 389.66 500.067C390.138 499.394 390.662 498.76 391.127 498.081C390.655 497.421 390.151 496.787 389.673 496.153C389.227 496.114 388.328 496.05 387.876 496.017ZM373.623 500.668C373.623 500.947 373.616 501.503 373.616 501.781C371.574 502.881 369.35 503.631 367.004 503.178C365.73 502.603 364.037 502.156 363.119 503.586C363.5 504.343 364.011 505.015 364.509 505.72C364.528 506.309 364.554 506.911 364.586 507.519C364.166 507.732 363.326 508.159 362.906 508.373C362.576 508.392 361.91 508.437 361.58 508.463C360.986 509.097 360.385 509.738 359.783 510.372C359.467 510.391 358.82 510.423 358.504 510.436C356.972 511.284 355.407 512.053 353.863 512.875C353.565 512.94 352.971 513.069 352.667 513.127C351.555 513.464 350.437 513.761 349.331 514.11C348.885 514.188 347.993 514.337 347.547 514.408C347.754 515.352 347.954 516.31 348.22 517.248C348.297 517.662 348.459 518.496 348.536 518.91C349.907 518.787 351.29 518.703 352.647 518.438C352.958 518.335 353.578 518.121 353.888 518.018C355.42 517.228 356.959 516.446 358.484 515.631C358.769 515.592 359.35 515.514 359.641 515.475C360.824 515.01 361.813 514.175 363.002 513.722C363.293 513.638 363.882 513.477 364.172 513.392C365.064 513.179 365.963 512.998 366.868 512.817C367.385 512.403 367.902 511.995 368.419 511.588C369.505 511.969 370.772 513.574 371.949 512.571C373.649 511.536 375.181 510.223 376.616 508.845C377.314 508.107 377.999 507.344 378.606 506.523C378.807 506.51 379.214 506.484 379.414 506.471C379.421 506.244 379.434 505.785 379.44 505.559C380.856 504.828 382.239 504.026 383.519 503.068C382.924 502.518 382.336 501.962 381.767 501.406C381.438 501.322 380.791 501.141 380.468 501.05C378.219 500.533 375.904 500.681 373.623 500.668ZM386.305 503.709C384.657 504.634 383.564 505.979 383.777 507.965C384.236 507.836 385.167 507.577 385.633 507.448C386.454 507.085 387.268 506.697 388.044 506.238C387.533 505.345 386.919 504.517 386.305 503.709ZM276.955 505.669C277.052 507.732 278.907 508.657 280.316 509.802C281.396 509.763 282.488 509.776 283.574 509.647C284.149 508.994 284.421 508.153 284.783 507.389C282.249 506.51 279.599 506.057 276.955 505.669ZM368.671 512.94C367.585 513.832 367.844 515.314 367.637 516.549C368.581 516.226 369.609 516.006 370.417 515.365C370.695 514.227 369.983 512.733 368.671 512.94ZM289.378 515.145C289.87 516.051 290.464 516.886 291.078 517.726C292.203 517.358 293.315 516.957 294.427 516.556C293.793 515.702 293.14 514.861 292.494 514.026C291.415 514.259 290.29 514.453 289.378 515.145ZM302.229 518.8C301.977 518.8 301.472 518.807 301.22 518.807C301.22 519.091 301.22 519.648 301.22 519.926C302.196 520.081 303.185 520.243 304.168 520.456C304.472 520.612 305.073 520.916 305.377 521.071C306.488 521.64 307.768 521.006 307.762 519.706C307.012 519.143 306.191 518.697 305.357 518.289C304.653 517.765 303.929 517.254 303.218 516.769C302.959 517.474 302.571 518.121 302.229 518.8ZM320.884 528.827C322.092 530.024 323.514 530.696 325.13 529.778C325.143 529.312 325.169 528.374 325.176 527.908C324.271 527.384 323.366 526.873 322.416 526.466C321.569 526.964 321.33 528.005 320.884 528.827ZM347.586 528.665C348.271 529.357 348.963 530.062 349.661 530.768C350.353 530.379 351.031 529.978 351.678 529.526C351.781 528.62 351.665 527.675 350.786 527.21C349.473 526.763 348.588 528.077 347.586 528.665ZM343.223 531.084C343.229 531.57 343.236 532.54 343.242 533.025C343.727 533.025 344.69 533.025 345.175 533.025C345.175 532.54 345.175 531.57 345.175 531.084C344.69 531.084 343.714 531.084 343.223 531.084ZM321.976 534.649C321.931 535.619 321.898 536.596 321.879 537.579C322.849 537.54 323.831 537.501 324.807 537.469C324.587 535.858 323.579 534.862 321.976 534.649ZM321.905 544.003C322.215 546.157 324.975 545.193 326.255 544.481C324.93 543.783 322.441 541.344 321.905 544.003ZM340.14 546.208C339.758 547.185 339.416 548.188 339.099 549.197C340.178 549.165 341.264 549.132 342.35 549.087C341.652 548.097 340.902 547.14 340.14 546.208Z",fill:"#1E90FF"})})}),u.jsx(F,{placement:"top",title:"دریاچه",children:u.jsx("a",{id:"دریاچه",style:{cursor:"pointer"},children:u.jsx("path",{d:"M462.42 471.178C464.96 469.295 468.308 469.709 471.275 469.67C471.133 472.368 471.12 475.298 469.439 477.569C468.185 479.27 466.847 481.204 464.798 481.98C462.698 480.628 462.73 477.776 462.025 475.622C461.864 474.166 460.888 472.2 462.42 471.178Z",fill:"#1E90FF"})})}),u.jsx(F,{placement:"top",title:"دریاچه",children:u.jsx("a",{id:"دریاچه",style:{cursor:"pointer"},children:u.jsx("path",{d:"M240.8 204.678C243.14 206.683 245.66 208.507 247.729 210.804C249.222 212.414 249.248 214.724 249.616 216.761C245.473 216.833 241.465 215.739 237.555 214.478C239.242 211.438 240.489 208.158 240.8 204.678Z",fill:"#1E90FF"})})}),u.jsx(F,{placement:"top",title:"ارومیه",children:u.jsx("a",{id:"ارومیه",style:{cursor:"pointer"},children:u.jsx("path",{d:"M32.9258 64.9334C36.6231 60.8322 43.9597 62.9216 45.5563 68.0125C44.6772 72.3401 42.8867 76.6806 43.6106 81.1829C44.1471 82.6901 45.608 83.641 46.9396 84.3978C48.6525 85.3229 50.6111 84.4367 52.4339 84.7148C54.3084 85.3164 55.4784 87.0371 56.7841 88.402C55.5042 89.5017 53.7719 91.1577 55.0195 92.9495C57.7408 96.2551 61.7096 98.5838 63.5195 102.627C63.8492 103.177 63.8039 103.688 63.3773 104.166C61.7936 105.499 59.7187 106.094 58.148 107.446C57.9217 109.354 58.1092 111.288 58.1674 113.203C56.2347 112.815 53.8107 112.886 52.5696 111.062C49.6027 106.566 47.0688 101.631 42.9513 98.0404C40.9216 96.365 40.8441 93.5835 40.0167 91.2741C38.9178 88.1239 37.5604 85.0706 36.6296 81.8621C35.6988 81.06 34.684 80.3355 33.9277 79.3587C33.4946 78.0391 33.5851 76.5901 33.876 75.251C34.5676 72.7282 37.8577 71.8549 38.3232 69.2545C38.7433 66.1754 34.9231 65.9619 32.9258 64.9334Z",fill:"#1E90FF"})})})]})})})}function D2(){return u.jsxs(E,{xs:12,sx:{display:"flex",flexDirection:"rowReverse",border:"1px solid #A8A8A8",borderRadius:"20px",padding:"10px",gap:"5px",alignItems:"center",marginLeft:{xs:"0px",md:"173px"},width:{xs:"100%",md:"480px"}},children:[u.jsxs(E,{xs:6,item:!0,sx:{display:"flex",alignItems:"center",marginLeft:"10px"},children:[u.jsx(E,{sx:{backgroundColor:"#F18989",width:"15px",height:"15px",borderRadius:"8px"}}),u.jsx(Y,{sx:{marginLeft:"10px",color:"#717171",fontWeight:"400",fontSize:"14px"},children:"کمتر از 25%"})]}),u.jsxs(E,{xs:6,item:!0,sx:{display:"flex",alignItems:"center",marginLeft:"10px"},children:[u.jsx(E,{sx:{backgroundColor:"#FF944D",width:"15px",height:"15px",borderRadius:"8px"}}),u.jsx(Y,{sx:{marginLeft:"10px",color:"#717171",fontWeight:"400",fontSize:"14px"},children:"25% تا 50%"})]}),u.jsxs(E,{xs:6,item:!0,sx:{display:"flex",alignItems:"center",marginLeft:"10px"},children:[u.jsx(E,{sx:{backgroundColor:"#F4C430",width:"15px",height:"15px",borderRadius:"8px"}}),u.jsx(Y,{sx:{marginLeft:"10px",color:"#717171",fontWeight:"400",fontSize:"14px"},children:"50% تا 75%"})]}),u.jsxs(E,{xs:6,item:!0,sx:{display:"flex",alignItems:"center",marginLeft:"10px"},children:[u.jsx(E,{sx:{backgroundColor:"#61D8BA",width:"15px",height:"15px",borderRadius:"8px"}}),u.jsx(Y,{sx:{marginLeft:"10px",color:"#717171",fontWeight:"400",fontSize:"14px"},children:"75% تا 100%"})]})]})}const z2=P6("DASHBOARD_PROVINCE_DETAILS_FOR_MAP",async(e,{dispatch:j})=>{j(C6());const{data:l,status:s}=await H.get("https://rsibackend.rasadyar.com/app/dashboard_province_detail_for_map/");return j(t6()),{data:l,status:s}}),W2=()=>{var x;const[e,j]=a.useState({totalQuantity:0,totalLeftOver:0,totalKilledQuantity:0,totalHatchingLeftOverPercent:0,totalActiveLeft:0,totalActiveLeftPercent:0}),l=h6(),s=()=>{l(z2()).then(S=>{var o;(o=S.payload)!=null&&o.data&&j(S.payload.data)})};return a.useEffect(()=>{s()},[]),u.jsxs(E,{sx:{display:"flex",flexDirection:"row",border:"1px solid #A8A8A8",borderRadius:"20px",padding:"10px",maxHeight:"156px",marginTop:"20px",backgroundColor:"white",flexWrap:"wrap"},children:[u.jsxs(E,{item:!0,sx:{marginTop:"10px",display:"flex"},children:[u.jsx(Y,{sx:{color:"#717171",fontWeight:"600",fontSize:"12px"},children:"حجم کل جوجه ریزی:"}),u.jsxs(Y,{sx:{color:"#333",fontWeight:"700",fontSize:"12px",marginLeft:"10px"},children:[e==null?void 0:e.totalQuantity.toLocaleString()," قطعه"]})]}),u.jsxs(E,{item:!0,sx:{marginTop:"10px",display:"flex",marginRight:"10px"},children:[u.jsx(Y,{sx:{color:"#717171",fontWeight:"600",fontSize:"12px",marginLeft:"10px"},children:"حجم مانده در سالن:"}),u.jsxs(Y,{sx:{color:"#333",fontWeight:"700",fontSize:"12px",marginLeft:"10px"},children:[(x=e==null?void 0:e.totalLeftOver)==null?void 0:x.toLocaleString()," قطعه"]})]}),u.jsxs(E,{item:!0,sx:{marginTop:"10px",display:"flex"},children:[u.jsx(Y,{sx:{color:"#333",fontWeight:"700",fontSize:"12px",marginLeft:"10px"},children:"حجم کل کشتار شده:"}),u.jsx(Y,{sx:{color:"#333",fontWeight:"700",fontSize:"12px",marginLeft:"10px"},children:e==null?void 0:e.totalKilledQuantity.toLocaleString()})]}),u.jsxs(E,{item:!0,sx:{marginTop:"10px",display:"flex"},children:[u.jsx(Y,{sx:{color:"#333",fontWeight:"700",fontSize:"12px",marginLeft:"10px"},children:"درصد مانده در سالن :"}),u.jsxs(E,{sx:{display:"flex",alignItems:"center"},children:[u.jsx(E,{sx:{borderRadius:"8px",marginLeft:"5px"}}),u.jsxs(Y,{sx:{color:"#333",fontWeight:"700",fontSize:"12px"},children:[e==null?void 0:e.totalHatchingLeftOverPercent,"%"]})]})]}),u.jsxs(E,{item:!0,sx:{marginTop:"10px",display:"flex"},children:[u.jsx(Y,{sx:{color:"#333",fontWeight:"700",fontSize:"12px",marginLeft:"10px"},children:"درصد آماده کشتار:"}),u.jsxs(E,{sx:{display:"flex",alignItems:"center"},children:[u.jsx(E,{sx:{borderRadius:"8px",marginLeft:"5px"}}),u.jsxs(Y,{sx:{color:"#333",fontWeight:"700",fontSize:"12px",marginLeft:"10px"},children:[e.totalActiveLeftPercent,"%"]})]})]})]})};function Y2({onPercentageTypeChange:e,selectedPercentageType:j}){const l=s=>{e(s.target.value)};return u.jsx(A2,{children:u.jsxs(j2,{sx:{justifyContent:"center"},"aria-labelledby":"percentage-type-radio-buttons-group",name:"percentage-type-radio-buttons-group",value:j,onChange:l,row:!0,children:[u.jsx(T6,{value:"hatching",control:u.jsx(t2,{}),label:"مانده در سالن"}),u.jsx(T6,{value:"active",control:u.jsx(t2,{}),label:"آماده کشتار"})]})})}const Z2=()=>{const[e,j]=a.useState([]),[l,s]=a.useState("hatching"),[x,S]=a.useState([]),o=h6(),n=()=>{o(O2()).then(A=>{var M;const b=((M=A.payload)==null?void 0:M.data)||[];S(b);const O=b.map((h,B)=>{var _,L,$;return[B+1,(h==null?void 0:h.provinceName)||"",((_=h==null?void 0:h.totalQuantity)==null?void 0:_.toLocaleString())||"0",((L=h==null?void 0:h.totalKilledQuantity)==null?void 0:L.toLocaleString())||"0",(($=h==null?void 0:h.totalLeftOver)==null?void 0:$.toLocaleString())||"0",`% ${h==null?void 0:h.totalHatchingLeftOverPercent.toLocaleString()} `,h==null?void 0:h.totalActiveLeft.toLocaleString(),` % ${h==null?void 0:h.totalActiveLeftPercent.toLocaleString()}`]});j(O)})};a.useEffect(()=>{n()},[]);const P=A=>A<25?"#F18989":A<50?"#FF944D":A<75?"#F4C430":"#61D8BA",v={};x.forEach(A=>{A!=null&&A.provinceName&&(A!=null&&A.totalHatchingLeftOverPercent)&&(v[A==null?void 0:A.provinceName]=A==null?void 0:A.totalHatchingLeftOverPercent)});const w=A=>{const b=x.find(M=>(M==null?void 0:M.provinceName)===A);if(!b)return"#B0B0B0";const O=l==="hatching"?b==null?void 0:b.totalHatchingLeftOverPercent:b==null?void 0:b.totalActiveLeftPercent;return O?P(O):"#B0B0B0"},T=A=>{s(A)};return u.jsxs(E,{xs:12,md:12,container:!0,spacing:2,justifyContent:"center",children:[u.jsx(E,{item:!0,xs:12,md:4,gap:2,sx:{maxHeight:{xs:"auto",md:"668px"},overflowY:"scroll"},children:u.jsx(p6,{title:"اطلاعات کشتار زنده کشتارگاه",columns:["ردیف"," استان"," جوجه ریزی","کشتار شده","مانده در سالن"," مانده در سالن","آماده کشتار"," آماده کشتار"],data:e,sx:{"& .MuiTableCell-root":{fontSize:"0.75rem",padding:"8px"},"& .MuiTableHead-root":{"& .MuiTableCell-root":{fontWeight:600}}}})}),u.jsxs(E,{xs:12,md:7,gap:2,sx:{display:"flex",flexDirection:"column",marginLeft:{xs:"0px",md:"33px"}},children:[u.jsx(W2,{}),u.jsx(Y2,{onPercentageTypeChange:T,selectedPercentageType:l}),u.jsx(_2,{getProvinceColor:w}),u.jsx(D2,{})]})]})},H2=P6("PROVINCE_NATIONAL_GET_DISTRIBUTION_SERVICE",async(e,{dispatch:j})=>{j(C6());const{data:l,status:s}=await H.get("https://rsibackend.rasadyar.com/app/transport-carcass-dashboard",{params:e});return j(t6()),{data:l,status:s}}),U2=P6("PROVINCE_NATIONAL_GET_STEWARD_DISTRIBUTION_SERVICE",async(e,{dispatch:j})=>{j(C6());const{data:l,status:s}=await H.get("https://rsibackend.rasadyar.com/app/guilds-transport-carcass-dashboard",{params:e});return j(t6()),{data:l,status:s}}),V2=()=>{var a6,e6,Z,o6,c,C,s6,c6,i6,W,l6;const[,,e,j,l,s]=a.useContext(j6),x=h6(),[S,o]=a.useState("KillHouse");a.useEffect(()=>{const d=K(new Date).format("YYYY-MM-DD");j(d),s(d)},[]);const[n,P]=a.useState([]),[v,w]=a.useState(!1),[T]=a.useContext(j6),[A,b]=a.useState(""),O=d=>{G(d.target.value)},[M,h]=a.useState([]),[B,_]=a.useState(0),[L,$]=a.useState(10),[g,G]=a.useState(""),[z,U]=a.useState(1),[Q,V]=a.useState([]),X=async d=>{let t;D(),x(C6()),t=await H.get(`https://rsibackend.rasadyar.com/app/transport-carcass-detail/?search=${g}${v?`&date1=${e}&date2=${l}`:""}&role=${S}&province=${A}&page=${d}&page_size=${L}`),x(t6()),h(t.data.results),_(t.data.count)},y=d=>{X(d),U(d)},r=d=>{$(d),U(1)},D=()=>{x(H2({role:S,province:A,date1:v?e:null,date2:v?l:null})).then(d=>{P(d.payload.data)})};a.useEffect(()=>{const d=M==null?void 0:M.map((t,r6)=>{var p,k,I,N,x6,m,u6,N6,E6,i,F6,W6,Y6,Z6,H6,U6,V6,G6,K6,Q6,X6,q6,J6,m6,u2;const n6=((p=t==null?void 0:t.info)==null?void 0:p.totalInputBarsWight)+((k=t==null?void 0:t.info)==null?void 0:k.totalOutputBarsWight);return[z===1?r6+1:r6+L*(z-1)+1,(I=t==null?void 0:t.info)==null?void 0:I.role,(t==null?void 0:t.UnitName)||(t==null?void 0:t.name),(t==null?void 0:t.PartIdCode)||(t==null?void 0:t.jihadiCode),(t==null?void 0:t.Province)||(t==null?void 0:t.province),(t==null?void 0:t.City)||(t==null?void 0:t.city),"گوشت مرغ تازه",(x6=(N=t==null?void 0:t.info)==null?void 0:N.totalInputBuyBarsCount)==null?void 0:x6.toLocaleString(),(u6=(m=t==null?void 0:t.info)==null?void 0:m.totalInputBuyBarsWight)==null?void 0:u6.toLocaleString(),(E6=(N6=t==null?void 0:t.info)==null?void 0:N6.totalOutputBuyBarsCount)==null?void 0:E6.toLocaleString(),(F6=(i=t==null?void 0:t.info)==null?void 0:i.totalOutputBuyBarsWight)==null?void 0:F6.toLocaleString(),(Y6=(W6=t==null?void 0:t.info)==null?void 0:W6.totalWareHouse)==null?void 0:Y6.toLocaleString(),n6==null?void 0:n6.toLocaleString(),"%"+((Z6=t==null?void 0:t.info)!=null&&Z6.totalWareHouse?(n6/((H6=t==null?void 0:t.info)==null?void 0:H6.totalWareHouse)*100).toFixed(1):0),(V6=(U6=t==null?void 0:t.info)==null?void 0:U6.inputBars)==null?void 0:V6.toLocaleString(),(K6=(G6=t==null?void 0:t.info)==null?void 0:G6.totalInputBarsWight)==null?void 0:K6.toLocaleString(),"%"+((X6=(Q6=t==null?void 0:t.info)==null?void 0:Q6.totalInputBarsPercent)==null?void 0:X6.toLocaleString()),(J6=(q6=t==null?void 0:t.info)==null?void 0:q6.totalOutputBarsWight)==null?void 0:J6.toLocaleString(),"%"+((u2=(m6=t==null?void 0:t.info)==null?void 0:m6.totalOutputBarsPercent)==null?void 0:u2.toLocaleString()),u.jsx(R6,{color:"success",size:"small",onClick:()=>{window.open(f6()==="AdminX"?`${B6}/${S==="KillHouse"?t.PartIdCode:t==null?void 0:t.jihadiCode}/${(t==null?void 0:t.UnitName)||(t==null?void 0:t.name)}/distribution`:`${_6}/${S==="KillHouse"?t.PartIdCode:t==null?void 0:t.jihadiCode}/${(t==null?void 0:t.UnitName)||(t==null?void 0:t.name)}/distribution`,"_blank")},children:u.jsx(o2,{})},r6)]});V(d)},[M]),a.useEffect(()=>{X(1)},[x,e,l,L,S,A,v]);const q=async d=>{d.preventDefault(),D(),x(C6());try{const t=await H.get(`https://rsibackend.rasadyar.com/app/transport-carcass-detail/?role=${S}&province=${A}&search=${g}${v?`&date1=${e}&date2=${l}`:""}&page=1&page_size=${L}`);h(t.data.results),_(t.data.count),x(t6())}catch(t){console.error("Error fetching data:",t)}},J=()=>[{name:"همه"},...r2()];return u.jsxs(f,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(f,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(p6,{noPagination:!0,isDashboard:!0,columns:["نقش","تعداد","محصول","وزن خرید داخل استان","وزن خرید خارج استان","وزن کل انبار","وزن کل توزیع","درصد توزیع نسبت به انبار","تعداد توزیع داخل استان","وزن توزیع داخل استان","درصد توزیع داخل استان","تعداد توزیع خارج استان","وزن توزیع خارج استان","درصد توزیع خارج استان","آخرین آپدیت"],data:[[n==null?void 0:n.role,S==="KillHouse"?(a6=n==null?void 0:n.totalCountKillHouse)==null?void 0:a6.toLocaleString():(e6=n==null?void 0:n.totalCountSteward)==null?void 0:e6.toLocaleString(),n==null?void 0:n.product,(Z=n==null?void 0:n.totalInputBuyBarsWight)==null?void 0:Z.toLocaleString(),(o6=n==null?void 0:n.totalOutputBuyBarsWight)==null?void 0:o6.toLocaleString(),(c=n==null?void 0:n.totalWareHouse)==null?void 0:c.toLocaleString(),((n==null?void 0:n.totalInputBarsWight)+(n==null?void 0:n.totalOutputBarsWight)).toLocaleString(),n!=null&&n.totalWareHouse?"%"+(n!=null&&n.totalWareHouse?(((n==null?void 0:n.totalInputBarsWight)+(n==null?void 0:n.totalOutputBarsWight))/(n==null?void 0:n.totalWareHouse)*100).toFixed(1):0):"",(C=n==null?void 0:n.inputBars)==null?void 0:C.toLocaleString(),(s6=n==null?void 0:n.totalInputBarsWight)==null?void 0:s6.toLocaleString(),n!=null&&n.totalInputBarsPercent?"%"+((c6=n==null?void 0:n.totalInputBarsPercent)==null?void 0:c6.toLocaleString()):"",(i6=n==null?void 0:n.outputBars)==null?void 0:i6.toLocaleString(),(W=n==null?void 0:n.totalOutputBarsWight)==null?void 0:W.toLocaleString(),n!=null&&n.totalOutputBarsPercent?"%"+((l6=n==null?void 0:n.totalOutputBarsPercent)==null?void 0:l6.toLocaleString()):"",(n==null?void 0:n.lastUpdate)&&a2(n==null?void 0:n.lastUpdate)]],title:"خلاصه اطلاعات"})}),u.jsxs(f,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(I6,{sx:{minWidth:"220px"},size:"small",disablePortal:!0,id:"hatching",options:J().map(d=>({label:d.name})),onChange:(d,t)=>{t.label!=="همه"?b(t.label):b("")},renderInput:d=>u.jsx(R,{...d,label:"انتخاب استان"})}),u.jsxs(f2,{size:"small",labelId:"demo-simple-select-label",id:"race",label:"نژاد مرغ",value:S,onChange:d=>{o(d.target.value)},children:[u.jsx(e2,{value:"KillHouse",children:"کشتارگاه"}),u.jsx(e2,{value:"Steward",children:"مباشر"})]}),u.jsxs(f,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(S6,{icon:u.jsx(w6,{}),checkedIcon:u.jsx(M6,{}),checked:v,onChange:()=>w(!v),color:"primary",size:"large"}),u.jsx(f,{children:u.jsx(d6,{disabled:!v,label:"از تاریخ",id:"date",renderInput:d=>u.jsx(R,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...d}),value:e,onChange:d=>{j(K(d).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(d6,{disabled:!v,label:"تا تاریخ",id:"date",renderInput:d=>u.jsx(R,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...d}),value:l,onChange:d=>{s(K(d).format("YYYY-MM-DD"))}})})]}),u.jsx(f,{children:u.jsxs("form",{onSubmit:q,children:[u.jsx(R,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:O}),u.jsx(A6,{type:"submit",onClick:q,endIcon:u.jsx(v6,{}),children:"جستجو"})]})}),u.jsx(F,{title:"خروجی اکسل",children:u.jsx(A6,{color:"success",onClick:()=>{T({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const d=`https://rsibackend.rasadyar.com/app/transport-carcass-detail-excel/?search=${g}${v?`&date1=${e}&date2=${l}`:""}&role=${S}&province=${A}`;window.location.href=d},children:u.jsx(D6,{size:32})})})]}),u.jsx(p6,{data:Q,columns:["ردیف","نقش","نام واحد","شناسه یکتا","استان","شهرستان","محصول","تعداد خرید داخل استان","وزن خرید داخل استان","تعداد خرید خارج استان","وزن خرید خارج استان","وزن کل انبار","وزن کل توزیع","درصد توزیع نسبت به انبار","تعداد توزیع داخل استان","وزن توزیع داخل استان","درصد توزیع داخل استان","وزن توزیع خارج استان","درصد توزیع خارج استان","جزئیات"],handlePageChange:y,totalRows:B,page:z,perPage:L,handlePerRowsChange:r,title:"توزیع / فروش گوشت مرغ"})]})},G2=()=>{var q,J,a6,e6,Z,o6;const[,,e,j,l,s]=a.useContext(j6),x=h6(),[S]=a.useContext(j6);a.useEffect(()=>{const c=K(new Date).format("YYYY-MM-DD");j(c),s(c)},[]);const[o,n]=a.useState([]),[P,v]=a.useState(!1),[w,T]=a.useState(""),A=c=>{$(c.target.value)},[b,O]=a.useState([]),[M,h]=a.useState(0),[B,_]=a.useState(10),[L,$]=a.useState(""),[g,G]=a.useState(1),[z,U]=a.useState([]),Q=async c=>{let C;y(),x(C6()),C=await H.get(`https://rsibackend.rasadyar.com/app/guilds-transport-carcass-detail/?search=${L}${P?`&date1=${e}&date2=${l}`:""}&province=${w}&page=${c}&page_size=${B}`),x(t6()),O(C.data.results),h(C.data.count)},V=c=>{Q(c),G(c)},X=c=>{_(c),G(1)},y=()=>{x(U2({province:w,date1:P?e:null,date2:P?l:null})).then(c=>{n(c.payload.data)})};a.useEffect(()=>{const c=b==null?void 0:b.map((C,s6)=>{var c6,i6,W,l6,d,t,r6,n6,p,k,I,N,x6,m,u6;return[g===1?s6+1:s6+B*(g-1)+1,(c6=C==null?void 0:C.info)==null?void 0:c6.role,C==null?void 0:C.name,(C==null?void 0:C.PartIdCode)||(C==null?void 0:C.jihadiCode),(C==null?void 0:C.Province)||(C==null?void 0:C.province),(C==null?void 0:C.City)||(C==null?void 0:C.city),"گوشت مرغ تازه",(W=(i6=C==null?void 0:C.info)==null?void 0:i6.totalInputBuyBarsCount)==null?void 0:W.toLocaleString(),(d=(l6=C==null?void 0:C.info)==null?void 0:l6.totalInputBuyBarsWight)==null?void 0:d.toLocaleString(),(r6=(t=C==null?void 0:C.info)==null?void 0:t.totalOutputBuyBarsCount)==null?void 0:r6.toLocaleString(),(p=(n6=C==null?void 0:C.info)==null?void 0:n6.totalOutputBuyBarsWight)==null?void 0:p.toLocaleString(),(I=(k=C==null?void 0:C.info)==null?void 0:k.totalWareHouse)==null?void 0:I.toLocaleString(),(x6=(N=C==null?void 0:C.info)==null?void 0:N.totalInputBuyBarsPercent)==null?void 0:x6.toLocaleString(),(u6=(m=C==null?void 0:C.info)==null?void 0:m.totalOutputBuyBarsPercent)==null?void 0:u6.toLocaleString(),u.jsx(R6,{color:"success",size:"small",onClick:()=>{window.open(f6()==="AdminX"?`${B6}/${C==null?void 0:C.jihadiCode}/${C==null?void 0:C.name}/Steward`:`${_6}/${C==null?void 0:C.jihadiCode}/${C==null?void 0:C.name}/Steward`,"_blank")},children:u.jsx(o2,{})},s6)]});U(c)},[b]),a.useEffect(()=>{Q(1)},[x,e,l,B,w,P]);const r=async c=>{c.preventDefault(),y(),x(C6());try{const C=await H.get(`https://rsibackend.rasadyar.com/app/guilds-transport-carcass-detail/?&province=${w}&search=${L}${P?`&date1=${e}&date2=${l}`:""}&page=1&page_size=${B}`);O(C.data.results),h(C.data.count),x(t6())}catch(C){console.error("Error fetching data:",C)}},D=()=>[{name:"همه"},...r2()];return u.jsxs(f,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(f,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(p6,{noPagination:!0,isDashboard:!0,columns:["تعداد","نقش","محصول","وزن خرید داخل استان","وزن خرید خارج استان","وزن کل خرید","درصد خرید داخل استان","درصد خرید خارج استان","آخرین آپدیت"],data:[[(q=o==null?void 0:o.totalCountGuild)==null?void 0:q.toLocaleString(),o==null?void 0:o.role,o==null?void 0:o.product,(J=o==null?void 0:o.totalInputBuyBarsWight)==null?void 0:J.toLocaleString(),(a6=o==null?void 0:o.totalOutputBuyBarsWight)==null?void 0:a6.toLocaleString(),(e6=o==null?void 0:o.totalWareHouse)==null?void 0:e6.toLocaleString(),(Z=o==null?void 0:o.totalInputBuyBarsPercent)==null?void 0:Z.toLocaleString(),(o6=o==null?void 0:o.totalOutputBuyBarsPercent)==null?void 0:o6.toLocaleString(),(o==null?void 0:o.lastUpdate)&&a2(o==null?void 0:o.lastUpdate)]],title:"خلاصه اطلاعات"})}),u.jsxs(f,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(I6,{sx:{minWidth:"220px"},size:"small",disablePortal:!0,id:"hatching",options:D().map(c=>({label:c.name})),onChange:(c,C)=>{C.label!=="همه"?T(C.label):T("")},renderInput:c=>u.jsx(R,{...c,label:"انتخاب استان"})}),u.jsxs(f,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(S6,{icon:u.jsx(w6,{}),checkedIcon:u.jsx(M6,{}),checked:P,onChange:()=>v(!P),color:"primary",size:"large"}),u.jsx(f,{children:u.jsx(d6,{disabled:!P,label:"از تاریخ",id:"date",renderInput:c=>u.jsx(R,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...c}),value:e,onChange:c=>{j(K(c).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(d6,{disabled:!P,label:"تا تاریخ",id:"date",renderInput:c=>u.jsx(R,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...c}),value:l,onChange:c=>{s(K(c).format("YYYY-MM-DD"))}})})]}),u.jsx(f,{children:u.jsxs("form",{onSubmit:r,children:[u.jsx(R,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:A}),u.jsx(A6,{type:"submit",onClick:r,endIcon:u.jsx(v6,{}),children:"جستجو"})]})}),u.jsx(F,{title:"خروجی اکسل",children:u.jsx(A6,{color:"success",onClick:()=>{S({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const c=`https://rsibackend.rasadyar.com/app/guilds-transport-carcass-detail-excel/?search=${L}${P?`&date1=${e}&date2=${l}`:""}&province=${w}`;window.location.href=c},children:u.jsx(D6,{size:32})})})]}),u.jsx(p6,{data:z,columns:["ردیف","نقش","نام واحد","شناسه یکتا","استان","شهرستان","محصول","تعداد خرید داخل استان","وزن خرید داخل استان","تعداد خرید خارج استان","وزن خرید خارج استان","وزن کل خرید","درصد خرید داخل استان","درصد خرید خارج استان","جزئیات"],handlePageChange:V,totalRows:M,page:g,perPage:B,handlePerRowsChange:X,title:"خرید صنوف"})]})},K2=()=>{const[e,j]=a.useState(null),[l,s]=a.useState(null),[x,S]=a.useState([]),[o,n]=a.useState(0),[P,v]=a.useState(1),[w,T]=a.useState(20),[A,b]=a.useState(!1),[O,M]=a.useState(null),[h,B]=a.useState(!0),[_,L]=a.useState([]),[$,g]=a.useState(""),[G,z]=a.useState(!1),[U,Q]=a.useState([]),[V,X]=a.useState(""),[y,r]=a.useState(!1),[D,q]=a.useState(""),[J,a6]=a.useState(""),e6=h6(),[,,Z,o6,c,C]=a.useContext(j6),s6=["ردیف","کد رهگیری","محصول","اقلام","مقدار","واحد","تاریخ","مقصد","شناسه مقصد","استان مقصد","شهرستان مقصد","مبدا","شناسه مبدا","استان مبدا","شهرستان مبدا","نوع حمل","مقصد قبلی","تغییر مقصد","کد رهگیری خودرو","تاریخ تخلیه","تخلیه"],c6=["محصول","تعداد بار","حجم بار (کیلوگرم)","تعداد بار داخل استان","حجم بار داخل استان (کیلوگرم)","درصد داخل استان","تعداد بار خارج استان","حجم بار خارج استان (کیلوگرم)","درصد خارج استان","آخرین بروزرسانی"],i6=p=>{if(!p)return"-";const k=new Date(p);if(Number.isNaN(k.getTime()))return"-";const I=k.toLocaleDateString("fa-IR"),N=k.toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit",hour12:!1});return`${I} ${N}`},W=p=>p==null?"-":typeof p=="number"?p.toLocaleString("fa-IR"):p,l6=p=>{if(p==null)return"-";const k=Number(p);return Number.isNaN(k)?"-":`${k.toFixed(1)}%`},d=p=>p==null||p===""?"-":p;a.useEffect(()=>{v(1)},[Z,c,h,$,V,D]),a.useEffect(()=>{let p=!0;return(async()=>{var I;try{z(!0);const{data:N}=await H.get("iran_province/");if(!p)return;const x6=((I=N==null?void 0:N.map)==null?void 0:I.call(N,m=>m==null?void 0:m.name).filter(m=>!!m))??[];L(x6)}catch(N){console.error("Failed to fetch provinces:",N)}finally{p&&z(!1)}})(),()=>{p=!1}},[]),a.useEffect(()=>{let p=!0;return(async()=>{try{r(!0);const{data:I}=await H.get("https://rsibackend.rasadyar.com/app/all-products-transport-products");if(!p)return;const N=Array.isArray(I==null?void 0:I.products)?I.products:[];Q(N)}catch(I){console.error("Failed to fetch product types:",I)}finally{p&&r(!1)}})(),()=>{p=!1}},[]),a.useEffect(()=>{let p=!0;return(async()=>{try{M(null),b(!0),e6(C6());const I=new URLSearchParams;I.append("product_type",V||""),h&&Z&&I.append("date1",Z),h&&c&&I.append("date2",c),$&&I.append("destination_province",$),D&&I.append("search",D),I.append("page",P.toString()),I.append("page_size",w.toString());const N=new URLSearchParams;N.append("product_type",V||""),h&&Z&&N.append("date1",Z),h&&c&&N.append("date2",c),$&&N.append("destination_province",$),D&&N.append("search",D);const[x6,m]=await Promise.all([H.get(`https://rsibackend.rasadyar.com/app/all-products-transport/?${I.toString()}`),H.get(`https://rsibackend.rasadyar.com/app/all-products-transport-dashboard/?${N.toString()}`)]);if(!p)return;const u6=x6.data??{results:[]},E6=((u6==null?void 0:u6.results)??[]).map((i,F6)=>[d(W(F6+1+(P-1)*w)),u.jsx(z6,{clearanceCode:i==null?void 0:i.tracking},(i==null?void 0:i.tracking)||F6),d(i==null?void 0:i.product),d(i==null?void 0:i.items),d(W(i==null?void 0:i.quantity)),d(i==null?void 0:i.unit),d(y6(i==null?void 0:i.date)),d(i==null?void 0:i.destination),d(i==null?void 0:i.jihadiDestination),d(i==null?void 0:i.destinationProvince),d(i==null?void 0:i.destinationCity),d(i==null?void 0:i.origin),d(i==null?void 0:i.jihadiOrigin),d(i==null?void 0:i.originProvince),d(i==null?void 0:i.originCity),d((i==null?void 0:i.originProvince)===(i==null?void 0:i.destinationProvince)?"داخل استان":"خارج استان"),d(i==null?void 0:i.destinationPrev),d(i==null?void 0:i.destinationChanged),d(i==null?void 0:i.carTrackingCode),d(y6(i==null?void 0:i.unloadingDate)),d(i==null?void 0:i.unloading)]);j(u6),S(E6),n((u6==null?void 0:u6.count)??0),s(m.data)}catch(I){if(console.error("Failed to fetch total cargo information:",I),!p)return;M(I),v2("در دریافت اطلاعات بار کل کشور خطایی رخ داد، لطفا مجددا تلاش کنید.","error")}finally{p&&b(!1),e6(t6())}})(),()=>{p=!1}},[e6,P,w,Z,c,$,V,h,D]);const t=p=>{v(p)},r6=p=>{T(p),v(1)},n6=async p=>{p.preventDefault();const k=J.trim();q(k),a6(k),v(1)};return O?u.jsx("div",{children:"خطا در دریافت اطلاعات بار کل کشور"}):A&&(!e||!l)?u.jsx("div",{children:"در حال بارگذاری اطلاعات ..."}):u.jsx(E,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,mt:4,children:u.jsxs(E,{container:!0,direction:"column",xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(E,{container:!0,alignItems:"center",gap:2,children:[u.jsxs(E,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left",maxWidth:"fit-content"},alignItems:"center",justifyContent:"center",children:[u.jsx(S6,{icon:u.jsx(w6,{}),checkedIcon:u.jsx(M6,{}),checked:h,onChange:()=>B(!h),color:"primary",size:"large"}),u.jsx(E,{children:u.jsx(d6,{disabled:!h,label:"از تاریخ",id:"date",renderInput:p=>u.jsx(R,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...p}),value:Z,onChange:p=>{p&&o6(K(p).format("YYYY-MM-DD"))}})}),u.jsx(E,{children:u.jsx(d6,{disabled:!h,label:"تا تاریخ",id:"date",renderInput:p=>u.jsx(R,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...p}),value:c,onChange:p=>{p&&C(K(p).format("YYYY-MM-DD"))}})})]}),u.jsxs(E,{container:!0,alignItems:"center",justifyContent:"center",gap:1,sx:{maxWidth:"fit-content"},children:[u.jsx(I6,{options:_,loading:G,value:$||null,onChange:(p,k)=>{g(k||"")},noOptionsText:"استانی یافت نشد",renderInput:p=>u.jsx(R,{...p,label:"استان مقصد",size:"small",sx:{width:{xs:200,md:240}},InputProps:{...p.InputProps,endAdornment:u.jsxs(u.Fragment,{children:[G?u.jsx(s2,{color:"inherit",size:16}):null,p.InputProps.endAdornment]})}}),clearOnEscape:!0}),u.jsx(I6,{options:U,loading:y,value:V||null,onChange:(p,k)=>{X(k||"")},noOptionsText:"محصولی یافت نشد",renderInput:p=>u.jsx(R,{...p,label:"نوع محصول",size:"small",sx:{width:{xs:200,md:240}},InputProps:{...p.InputProps,endAdornment:u.jsxs(u.Fragment,{children:[y?u.jsx(s2,{color:"inherit",size:16}):null,p.InputProps.endAdornment]})}}),clearOnEscape:!0}),u.jsxs(E,{item:!0,component:"form",onSubmit:n6,sx:{width:{xs:220,md:260},display:"flex"},children:[u.jsx(R,{value:J,onChange:p=>a6(p.target.value),label:"جستجو",size:"small",variant:"outlined",sx:{flexGrow:1}}),u.jsx(R6,{type:"submit",color:"primary","aria-label":"جستجو",sx:{ml:1},children:u.jsx(R2,{})})]})]})]}),l&&u.jsx(E,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(p6,{noPagination:!0,isDashboard:!0,columns:c6,data:[[d(l==null?void 0:l.product),d(W(l==null?void 0:l.bars)),d(W(l==null?void 0:l.totalBarsWight)),d(W(l==null?void 0:l.inputBars)),d(W(l==null?void 0:l.totalInputBarsWight)),l6(l==null?void 0:l.totalInputBarsPercent),d(W(l==null?void 0:l.outputBars)),d(W(l==null?void 0:l.totalOutputBarsWight)),l6(l==null?void 0:l.totalOutputBarsPercent),i6(l==null?void 0:l.lastUpdate)]],title:"خلاصه اطلاعات بار"})}),u.jsx(p6,{columns:s6,data:x,title:"اطلاعات بار کل کشور",paginated:!1,handlePageChange:t,handlePerRowsChange:r6,totalRows:o,page:P,perPage:w})]})})},Q2=()=>{const[e,j]=a.useState(0),l=f6()==="AdminX"||f6()==="SuperAdmin"||f6()==="ProvinceOperator",s=(x,S)=>{j(S)};return u.jsxs(f,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsx(f,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mt:4,children:u.jsxs(F2,{value:e,onChange:s,"aria-label":"simple tabs example",scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,children:[u.jsx(g6,{value:0,label:"مدیریت فارم ها"}),u.jsx(g6,{value:1,label:"جوجه ریزی ها "}),u.jsx(g6,{value:2,label:"اطلاعات بارها "}),u.jsx(g6,{value:3,label:"پایش کشتارگاه ها "}),u.jsx(g6,{value:4,label:"نقشه کشوری"}),l&&u.jsx(g6,{value:5,label:"توزیع / فروش گوشت مرغ"}),l&&u.jsx(g6,{value:6,label:"خرید صنوف"}),l&&u.jsx(g6,{value:7,label:"اطلاعات حمل محصولات"})]})}),u.jsxs(f,{container:!0,xs:12,justifyContent:"center",mt:2,px:2,children:[e===0&&u.jsx(N2,{}),e===1&&u.jsx($2,{}),e===2&&u.jsx(l2,{}),e===3&&u.jsx(k2,{}),e===4&&u.jsx(Z2,{}),e===5&&u.jsx(V2,{}),e===6&&u.jsx(G2,{}),e===7&&u.jsx(K2,{})]})]})},X2=()=>{var r,D,q,J,a6,e6,Z,o6;const[,,e,j,l,s]=a.useContext(j6),x=()=>{S(T2({date1:L?e:null,date2:L?l:null,search:b,RequestCode:z})).then(c=>{G(c.payload.data)})},S=h6();a.useEffect(()=>{const c=K(new Date).format("YYYY-MM-DD");j(c),s(c)},[]);const o=c=>{O(c.target.value)},[n,P]=a.useState([]),[v,w]=a.useState(0),[T,A]=a.useState(10),[b,O]=a.useState(""),[M,h]=a.useState(1),[B,_]=a.useState([]),[L,$]=a.useState(!1),[g,G]=a.useState([]),{key:z,name:U}=O6(),Q=async c=>{S(C6());const C=await H.get(`https://rsibackend.rasadyar.com/app/transporting-detail/?search=${b}${L?`&date1=${e}&date2=${l}`:""}&page=${c}&page_size=${T}&RequestCode=${z}`);S(t6()),x(),P(C.data.results),w(C.data.count)},V=c=>{Q(c),h(c)},X=c=>{A(c),h(1)};a.useEffect(()=>{const c=n==null?void 0:n.map((C,s6)=>{var c6,i6,W,l6,d,t,r6,n6,p;return[M===1?s6+1:s6+T*(M-1)+1,u.jsx(z6,{clearanceCode:C==null?void 0:C.TrackingCode},s6),y6(C==null?void 0:C.Date),C==null?void 0:C.DesUnitName,C==null?void 0:C.DesPartIdCode,C==null?void 0:C.Province,C==null?void 0:C.City,(c6=C==null?void 0:C.GoodAmount)==null?void 0:c6.toLocaleString(),C==null?void 0:C.TrackingStatusDescription,C!=null&&C.Out?"خارج استان":"داخل استان",C==null?void 0:C.SourceUnitName,(W=(i6=C==null?void 0:C.hatching)==null?void 0:i6.poultry)==null?void 0:W.PartIdCode,(l6=C==null?void 0:C.hatching)==null?void 0:l6.RequestCode,(t=(d=C==null?void 0:C.hatching)==null?void 0:d.poultry)==null?void 0:t.Province,(n6=(r6=C==null?void 0:C.hatching)==null?void 0:r6.poultry)==null?void 0:n6.City,C==null?void 0:C.Age,(p=C==null?void 0:C.hatching)==null?void 0:p.PedigreeName]});_(c)},[n]),a.useEffect(()=>{Q(1)},[S,e,l,T,L]);const y=async c=>{c.preventDefault(),S(C6());try{const C=await H.get(`https://rsibackend.rasadyar.com/app/transporting-detail/?search=${b}${L?`&date1=${e}&date2=${l}`:""}&page=1&page_size=${T}&RequestCode=${z}`);P(C.data.results),w(C.data.count),x(),S(t6())}catch(C){console.error("Error fetching data:",C)}};return u.jsxs(f,{container:!0,xs:12,justifyContent:"center",mt:3,children:[u.jsxs(f,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsxs(f,{container:!0,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},children:[u.jsx(f,{children:u.jsx(T6,{control:u.jsx(S6,{checked:L,onChange:()=>$(!L),color:"primary"})})}),u.jsx(f,{children:u.jsx(d6,{disabled:!L,label:"از تاریخ",id:"date",renderInput:c=>u.jsx(R,{size:"small",style:{width:"160px"},...c}),value:e,onChange:c=>{j(K(c).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(d6,{disabled:!L,label:"تا تاریخ",id:"date",renderInput:c=>u.jsx(R,{size:"small",style:{width:"160px"},...c}),value:l,onChange:c=>{s(K(c).format("YYYY-MM-DD"))}})})]}),u.jsx(f,{children:u.jsxs("form",{onSubmit:y,children:[u.jsx(R,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:o}),u.jsx(A6,{type:"submit",onClick:y,endIcon:u.jsx(v6,{}),children:"جستجو"})]})})]}),u.jsx(f,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(p6,{noPagination:!0,isDashboard:!0,columns:["تعداد بار","حجم بار","میانگین سن کشتار","تعداد بار داخل استان","حجم بار داخل استان","درصد داخل استان","تعداد بار خارج استان","حجم بار خارج استان","درصد خارج استان"],data:[[(r=g==null?void 0:g.barCount)==null?void 0:r.toLocaleString(),(D=g==null?void 0:g.barQuantity)==null?void 0:D.toLocaleString(),Math.floor(g==null?void 0:g.totalBarKillingAge),(q=g==null?void 0:g.inputBarCount)==null?void 0:q.toLocaleString(),(J=g==null?void 0:g.inputBarQuantity)==null?void 0:J.toLocaleString(),(a6=g==null?void 0:g.inputBarPercent)==null?void 0:a6.toFixed(1),(e6=g==null?void 0:g.outputBar)==null?void 0:e6.toLocaleString(),(Z=g==null?void 0:g.outputBarQuantity)==null?void 0:Z.toLocaleString(),(o6=g==null?void 0:g.outputBarPercent)==null?void 0:o6.toFixed(1)]],title:"خلاصه اطلاعات"})}),u.jsx(p6,{data:B,columns:["ردیف","کد رهگیری قرنطینه","تاریخ کشتار","نام کشتارگاه","شناسه یکتا کشتار گاه","استان کشتارگاه","شهر کشتارگاه","تعداد ","وضعیت ","مقصد کشتار","نام مرغدار","شناسه یکتا مرغداری","شناسه جوجه ریزی","استان مرغدار","شهرستان مرغدار","سن کشتار","نژاد"],handlePageChange:V,totalRows:v,page:M,perPage:T,handlePerRowsChange:X,title:`جزئیات مجوز جوجه ریزی ${U}`})]})},q2=()=>{const[,,e,j,l,s]=a.useContext(j6),{unitkey:x,name:S,type:o}=O6(),[n,P]=a.useState(!1),[v]=a.useContext(j6),w=h6();a.useEffect(()=>{const y=K(new Date).format("YYYY-MM-DD");j(y),s(y)},[]);const T=y=>{L(y.target.value)},[A,b]=a.useState([]),[O,M]=a.useState(0),[h,B]=a.useState(10),[_,L]=a.useState(""),[$,g]=a.useState(1),[G,z]=a.useState([]),U=async y=>{let r;w(C6()),r=await H.get(`https://rsibackend.rasadyar.com/app/${o==="Steward"?"guilds-":""}transport-carcass-detail/?search=${_}${n?`&date1=${e}&date2=${l}`:""}&page=${y}&page_size=${h}&code=${x}`),w(t6()),b(r.data.results),M(r.data.count)},Q=y=>{U(y),g(y)},V=y=>{B(y),g(1)};a.useEffect(()=>{const y=A==null?void 0:A.map((r,D)=>{var q,J;return[$===1?D+1:D+h*($-1)+1,r!=null&&r.productDate?y6(r==null?void 0:r.productDate):"-",`${y6(r==null?void 0:r.date)} (${(q=r==null?void 0:r.time)==null?void 0:q.slice(0,5)})`,r!=null&&r.out?"خارج استان":"داخل استان",r==null?void 0:r.product,(J=r==null?void 0:r.quantity)==null?void 0:J.toLocaleString(),u.jsx(z6,{clearanceCode:(r==null?void 0:r.tracking)||"-"},D),r==null?void 0:r.origin,r==null?void 0:r.originProvince,r==null?void 0:r.originCity,r==null?void 0:r.destination,r==null?void 0:r.destinationProvince,r==null?void 0:r.destinationCity,r==null?void 0:r.driverName,r==null?void 0:r.owner,r==null?void 0:r.carTrackingCode,r==null?void 0:r.plate,r!=null&&r.unloading?"تخلیه شده":"در انتظار تخلیه"]});z(y)},[A]),a.useEffect(()=>{U(1)},[w,e,l,h,n]);const X=async y=>{y.preventDefault(),w(C6());try{const r=await H.get(`https://rsibackend.rasadyar.com/app/${o==="Steward"?"guilds-":""}transport-carcass-detail/?search=${_}${n?`&date1=${e}&date2=${l}`:""}&page=1&page_size=${h}&code=${x}`);b(r.data.results),M(r.data.count),w(t6())}catch(r){console.error("Error fetching data:",r)}};return u.jsxs(f,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(f,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsxs(f,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(S6,{icon:u.jsx(w6,{}),checkedIcon:u.jsx(M6,{}),checked:n,onChange:()=>P(!n),color:"primary",size:"large"}),u.jsx(f,{children:u.jsx(d6,{disabled:!n,label:"از تاریخ",id:"date",renderInput:y=>u.jsx(R,{size:"small",style:{width:"160px"},...y}),value:e,onChange:y=>{j(K(y).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(d6,{disabled:!n,label:"تا تاریخ",id:"date",renderInput:y=>u.jsx(R,{size:"small",style:{width:"160px"},...y}),value:l,onChange:y=>{s(K(y).format("YYYY-MM-DD"))}})})]}),u.jsx(f,{children:u.jsxs("form",{onSubmit:X,children:[u.jsx(R,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:T}),u.jsx(A6,{type:"submit",onClick:X,endIcon:u.jsx(v6,{}),children:"جستجو"})]})}),u.jsx(F,{title:"خروجی اکسل",children:u.jsx(A6,{color:"success",onClick:()=>{v({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const y=`https://rsibackend.rasadyar.com/app/${o==="Steward"?"guilds-":""}transport-carcass-detail-excel/?search=${_}${n?`&date1=${e}&date2=${l}`:""}&code=${x}`;window.location.href=y},children:u.jsx(D6,{size:32})})})]}),u.jsx(p6,{data:G,columns:["ردیف","تاریخ توزیع","تاریخ ثبت","نوع بار","محصول","وزن","کد قرنطینه","فروشنده","استان فروشنده","شهر فروشنده","خریدار","استان خریدار","شهر خریدار","راننده","مالک","رهگیری خودرو","پلاک خودرو","وضعیت"],handlePageChange:Q,totalRows:O,page:$,perPage:h,handlePerRowsChange:V,title:`توزیع / فروش گوشت ${S} `})]})},f1=()=>{const{key:e,name:j,type:l}=O6(),{pathname:s}=S2(),x=s.includes(B6)||s.includes(w2)||s.includes(_6);return u.jsx(u.Fragment,{children:u.jsx(n2,{display:"flex",justifyContent:"center",children:u.jsx(f,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,mt:4,children:l?u.jsx(q2,{}):x?u.jsx(l2,{}):e||j?u.jsx(X2,{}):u.jsx(Q2,{})})})})};export{f1 as default}; diff --git a/build/assets/NationalInfoTransports-Bzg92cmL.js b/build/assets/NationalInfoTransports-Bzg92cmL.js new file mode 100644 index 0000000..0c6a0f4 --- /dev/null +++ b/build/assets/NationalInfoTransports-Bzg92cmL.js @@ -0,0 +1 @@ +import{j as u,al as Hu,ak as N,aX as bu,B as wu,d as hu,I as du,b0 as Xu,an as qu,b4 as Ju,ap as Zu,aq as mu,T as u6,b2 as s6,b3 as Du}from"./mui-vendor-CkIVaoQP.js";import{r as a,j as zu,u as c6}from"./react-vendor-CmFgShSM.js";import{L as Y,j as B,h as b,A as Vu,v as Cu,co as a6,cp as r6,cr as l6,X as H,G as x,W as Su,c5 as e6,p as t6,c6 as C6,c7 as i6,c8 as A6,cj as g6,ck as p6,cl as x6}from"./index-CeyyVc1v.js";import{a as Mu,u as Uu}from"./redux-vendor-B7uoacJt.js";import{R as Yu,a as Qu}from"./index.esm-Bu7XMDZU.js";import{R as su}from"./ResponsiveTable-w7hk7Uq8.js";import{g as Bu}from"./getSamasatProvinces-BvJGUILK.js";import{d as n6}from"./Tune-D4M2CAhp.js";import{d as o6}from"./Download-DQ-VVIaV.js";import{d as Ku}from"./ToggleOffOutlined-Ch26Umk7.js";import{d as Wu}from"./ToggleOn-pBgb8alR.js";import{d as F6}from"./Visibility-DeyjG-oI.js";import{C as h6}from"./ChechClearanceCode-lPasOZZ_.js";const d6=Mu("PROVINCE-NATIONAL-INFO-SLAUGHTER-HOUSE-SERVICE",async(r,{dispatch:h})=>{h(Y());const{data:l,status:S}=await B.get("https://rsibackend.rasadyar.com/app/dashboard_total_kill_house",{params:{date1:r.date1,date2:r.date2,search:r.search,province:r.province}});return h(b()),{data:l,status:S}}),S6=({excelHref:r,onView:h})=>{const[l,S]=a.useState(null),d=e=>{S(e.currentTarget)},f=()=>{S(null)},y=!!l,L=y?"slaughter-actions-menu":void 0,p=[{key:"excel",label:"دانلود اکسل",color:"success.main",icon:u.jsx(o6,{sx:{fontSize:{xs:20,md:18}}}),action:()=>{window.open(r,"_blank","noopener")}},{key:"details",label:"نمایش جزئیات",color:"primary.main",icon:u.jsx(e6,{sx:{fontSize:{xs:20,md:18}}}),action:h}];return u.jsxs(x,{container:!0,alignItems:"center",justifyContent:"center",gap:.5,children:[u.jsx(hu,{title:"عملیات",children:u.jsx(du,{"aria-describedby":L,color:"primary",onClick:d,size:"small",children:u.jsx(n6,{fontSize:"small"})})}),u.jsx(Xu,{id:L,open:y,anchorEl:l,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{mt:1}}},children:u.jsx(qu,{sx:{p:1},children:p.map(e=>u.jsxs(Ju,{onClick:()=>{f(),e.action()},sx:{borderRadius:1,mb:.5,color:e.color,"&:last-of-type":{mb:0}},children:[u.jsx(Zu,{sx:{color:e.color,minWidth:36},children:e.icon}),u.jsx(mu,{primary:u.jsx(u6,{sx:{color:e.color,fontWeight:600,fontSize:{xs:"13px",md:"14px"}},children:e.label})})]},e.key))})})]})},z6=()=>{var au,W,ru,G,D,X,q,J,Z;const[,,r,h,l,S]=a.useContext(Vu),d=Uu();a.useEffect(()=>{const A=Cu(new Date).format("YYYY-MM-DD");h(A),S(A)},[]);const[f,y]=a.useState(""),L=A=>{P(A.target.value)},[p,e]=a.useState(!1),[$,w]=a.useState([]),[t,iu]=a.useState([]),[I,R]=a.useState(0),[_,ou]=a.useState(10),[j,P]=a.useState(""),[V,cu]=a.useState(1),[v,E]=a.useState([]),{key:C}=zu(),T=()=>{d(d6({date1:p?r:null,date2:p?l:null,search:j,province:C||f?f:"",role:H()})).then(A=>{iu(A.payload.data)})},z=async A=>{d(Y());const s=await B.get(`https://rsibackend.rasadyar.com/app/total-killhouse/?search=${j}&role=${H()}${p?`&date1=${r}&date2=${l}`:""}&page=${A}&page_size=${_}&province=${C||f?f:""}`);T(),d(b()),w(s.data.results),R(s.data.count)},O=A=>{z(A),cu(A)},Q=A=>{ou(A),cu(1)};a.useEffect(()=>{const A=$==null?void 0:$.map((s,i)=>{var c,M,m,uu,eu,tu,nu,F,n,U,k,gu,g,o,lu,pu,xu,Fu;return[V===1?i+1:i+_*(V-1)+1,s==null?void 0:s.UnitName,s==null?void 0:s.PartIdCode,s==null?void 0:s.Province,s==null?void 0:s.City,(M=(c=s==null?void 0:s.info)==null?void 0:c.bars)==null?void 0:M.toLocaleString(),(uu=(m=s==null?void 0:s.info)==null?void 0:m.totalBarsQuantity)==null?void 0:uu.toLocaleString(),(tu=(eu=s==null?void 0:s.info)==null?void 0:eu.inputBars)==null?void 0:tu.toLocaleString(),(F=(nu=s==null?void 0:s.info)==null?void 0:nu.totalInputBarsQuantity)==null?void 0:F.toLocaleString(),(n=s==null?void 0:s.info)!=null&&n.totalInputBarsPercent[0]?(k=(U=s==null?void 0:s.info)==null?void 0:U.totalInputBarsPercent[0])==null?void 0:k.toFixed(1):(gu=s==null?void 0:s.info)==null?void 0:gu.totalInputBarsPercent,(o=(g=s==null?void 0:s.info)==null?void 0:g.outputBars)==null?void 0:o.toLocaleString(),(pu=(lu=s==null?void 0:s.info)==null?void 0:lu.totalOutputBarsQuantity)==null?void 0:pu.toLocaleString(),(Fu=(xu=s==null?void 0:s.info)==null?void 0:xu.totalOutputBarsPercent)==null?void 0:Fu.toFixed(1),u.jsx(S6,{excelHref:`https://rsibackend.rasadyar.com/app/transporting_detail_excel/?PartIdCode=${s.PartIdCode}&province=${C||f?f:""}${p?`&date1=${r}&date2=${l}`:""}`,onView:()=>window.open(H()==="AdminX"?`${a6}/${s.PartIdCode}/${s==null?void 0:s.UnitName}`:H()==="SuperAdmin"?`${r6}/${s.PartIdCode}/${s==null?void 0:s.UnitName}`:`${l6}/${s.PartIdCode}/${s==null?void 0:s.UnitName}`,"_blank")},(s==null?void 0:s.PartIdCode)||i)]});E(A)},[$]),a.useEffect(()=>{z(1)},[d,r,l,_,f,p]);const K=async A=>{A.preventDefault(),d(Y());try{const s=await B.get(`https://rsibackend.rasadyar.com/app/total-killhouse/?role=${H()}&search=${j}${p?`&date1=${r}&date2=${l}`:""}&page=1&page_size=${_}&province=${C||f?f:""}`);w(s.data.results),R(s.data.count),T(),d(b())}catch(s){console.error("Error fetching data:",s)}},Au=()=>[{name:"همه"},...Bu()];return u.jsxs(x,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(x,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[!C&&u.jsx(x,{minWidth:210,children:u.jsx(Hu,{size:"small",disablePortal:!0,id:"hatching",options:Au().map(A=>({label:A.name})),onChange:(A,s)=>{s.label!=="همه"?y(s.label):y("")},renderInput:A=>u.jsx(N,{...A,label:"انتخاب استان"})})}),u.jsxs(x,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(bu,{icon:u.jsx(Ku,{}),checkedIcon:u.jsx(Wu,{}),checked:p,onChange:()=>e(!p),color:"primary",size:"large"}),u.jsx(x,{children:u.jsx(Su,{disabled:!p,label:"از تاریخ",id:"date",renderInput:A=>u.jsx(N,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...A}),value:r,onChange:A=>{h(Cu(A).format("YYYY-MM-DD"))}})}),u.jsx(x,{children:u.jsx(Su,{disabled:!p,label:"تا تاریخ",id:"date",renderInput:A=>u.jsx(N,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...A}),value:l,onChange:A=>{S(Cu(A).format("YYYY-MM-DD"))}})})]}),u.jsx(x,{children:u.jsxs("form",{onSubmit:K,children:[u.jsx(N,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:L}),u.jsx(wu,{type:"submit",onClick:K,endIcon:u.jsx(Yu,{}),children:"جستجو"})]})}),u.jsx(x,{children:u.jsx(hu,{placement:"right",title:"دانلود اکسل",children:u.jsx(du,{size:"small",color:"success",component:"a",href:`https://rsibackend.rasadyar.com/app/total_killhouse_excel/?search=${j}${p?`&date1=${r}&date2=${l}`:""}&province=${C||f?f:""}`,children:u.jsx(Qu,{size:36})})})})]}),u.jsx(x,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(su,{noPagination:!0,isDashboard:!0,columns:["تعداد کشتارگاه ها","تعداد بارها","حجم بارها","حجم بار های داخل استان","حجم بار های خارج استان","بیشترین حجم خرید","حجم خرید","کمترین حجم خرید","میزان کمترین حجم"],data:[[(au=t==null?void 0:t.killHouseCount)==null?void 0:au.toLocaleString(),(W=t==null?void 0:t.bars)==null?void 0:W.toLocaleString(),(ru=t==null?void 0:t.totalBarsQuantity)==null?void 0:ru.toLocaleString(),(G=t==null?void 0:t.totalInputBarsQuantity)==null?void 0:G.toLocaleString(),(D=t==null?void 0:t.totalOutputBarsQuantity)==null?void 0:D.toLocaleString(),(X=t==null?void 0:t.topKillHouseName)==null?void 0:X.toLocaleString(),(q=t==null?void 0:t.topKillHouseAmount)==null?void 0:q.toLocaleString(),(J=t==null?void 0:t.lowKillHouseName)==null?void 0:J.toLocaleString(),(Z=t==null?void 0:t.lowKillHouseAmount)==null?void 0:Z.toLocaleString()]],title:"خلاصه اطلاعات"})}),u.jsx(su,{data:v,columns:["ردیف","نام کشتارگاه","شناسه یکتا کشتارگاه","استان","شهرستان","تعداد بار","حجم بار","تعداد بار داخل استان","حجم بار داخل استان","درصد بار داخل استان","تعداد بار خارج استان","حجم بار خارج استان","درصد بار خارج استان","جزئیات"],handlePageChange:O,totalRows:I,page:V,perPage:_,handlePerRowsChange:Q,title:C?`پایش کشتارگاه ${C}`:"پایش کشتارگاه"})]})},f6=Mu("NATIONAL_INFO_DASHBOARD",async(r,{dispatch:h})=>{h(Y());const{data:l,status:S}=await B.get("https://rsibackend.rasadyar.com/app/hatchings-dashboard",{params:{date1:r.date1,date2:r.date2,search:r.search,province:r.province,system_code:r.system_code}});return h(b()),{data:l,status:S}}),M6=()=>{var G,D,X,q,J,Z,A,s,i,c,M,m,uu,eu,tu,nu,F,n,U,k,gu;const[,,r,h,l,S]=a.useContext(Vu),d=Uu();a.useEffect(()=>{const g=Cu(new Date).format("YYYY-MM-DD");h(g),S(g)},[]);const f=g=>{j(g.target.value)},[y,L]=a.useState(""),{key:p}=zu(),[e,$]=a.useState([]),[w,t]=a.useState([]),[iu,I]=a.useState(0),[R,_]=a.useState(10),[ou,j]=a.useState(""),[P,V]=a.useState(1),[cu,v]=a.useState([]),[E,C]=a.useState(!1),[T,z]=a.useState("0"),O=(g,o)=>{z(o)},Q=()=>{d(f6({date1:E?r:null,date2:E?l:null,search:ou,province:y==="همه"?"":y})).then(g=>{$(g.payload.data)})},K=async g=>{let o;d(Y()),o=await B.get(`https://rsibackend.rasadyar.com/app/hatchings/?search=${ou}${E?`&date1=${r}&date2=${l}`:""}&page=${g}&page_size=${R}&province=${p||y?y:""}&state=${T==="0"?"pending":"archive"}`),d(b()),Q(),t(o.data.results),I(o.data.count)},Au=g=>{K(g),V(g)},au=g=>{_(g),V(1)};a.useEffect(()=>{const g=w==null?void 0:w.map((o,lu)=>{var pu,xu,Fu,fu,yu,vu,ju,Lu,Eu,$u,Pu,Iu,_u,Ou,Nu,Ru;return[P===1?lu+1:lu+R*(P-1)+1,((pu=o==null?void 0:o.poultry)==null?void 0:pu.Province)||"-",((xu=o==null?void 0:o.poultry)==null?void 0:xu.City)||"-",(Fu=o==null?void 0:o.poultry)==null?void 0:Fu.UnitName,`${(fu=o==null?void 0:o.poultry)==null?void 0:fu.FirstName} ${((yu=o==null?void 0:o.poultry)==null?void 0:yu.LastName)||""}`,o==null?void 0:o.RequestCode,o==null?void 0:o.CertId,(vu=o==null?void 0:o.CapacityFemale)==null?void 0:vu.toLocaleString(),t6(o==null?void 0:o.Date),Math.floor(o==null?void 0:o.Age),o==null?void 0:o.PedigreeName,(ju=o==null?void 0:o.ChickCountSum)==null?void 0:ju.toLocaleString(),(Lu=o==null?void 0:o.Period)==null?void 0:Lu.toLocaleString(),(Eu=o==null?void 0:o.Evacuation)==null?void 0:Eu.toLocaleString(),(Pu=($u=o==null?void 0:o.info)==null?void 0:$u.percentHatchingLicense)==null?void 0:Pu.toFixed(2),(Iu=o==null?void 0:o.LeftOver)==null?void 0:Iu.toLocaleString(),Math.floor(o==null?void 0:o.KillingAve),(Ou=(_u=o==null?void 0:o.info)==null?void 0:_u.numberLoads)==null?void 0:Ou.toLocaleString(),(Ru=(Nu=o==null?void 0:o.info)==null?void 0:Nu.loadVolume)==null?void 0:Ru.toLocaleString(),u.jsx(hu,{placement:"right",title:"جزئیات",children:u.jsx(du,{size:"small",color:"success",onClick:()=>{var Tu,ku,Gu;return window.open(H()==="AdminX"?`${C6}/${o.RequestCode}/${(Tu=o==null?void 0:o.poultry)==null?void 0:Tu.UnitName}`:H()==="SuperAdmin"?`${i6}/${o.RequestCode}/${(ku=o==null?void 0:o.poultry)==null?void 0:ku.UnitName}`:`${A6}/${o.RequestCode}/${(Gu=o==null?void 0:o.poultry)==null?void 0:Gu.UnitName}`,"_blank")},children:u.jsx(F6,{})})},lu)]});v(g)},[w]),a.useEffect(()=>{K(1)},[d,r,l,R,E,T,y]);const W=async g=>{g.preventDefault(),d(Y());try{const o=await B.get(`https://rsibackend.rasadyar.com/app/hatchings/?search=${ou}${E?`&date1=${r}&date2=${l}`:""}&page=1&page_size=${R}&province=${p||y?y:""}&state=${T==="0"?"pending":"archive"}`);t(o.data.results),I(o.data.count),d(b()),Q()}catch(o){console.error("Error fetching data:",o)}},ru=()=>[{name:"همه"},...Bu()];return u.jsxs(x,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,mt:2,children:[u.jsx(x,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:u.jsxs(s6,{value:T,onChange:O,children:[u.jsx(Du,{value:"0",label:"فعال"}),u.jsx(Du,{value:"1",label:"بایگانی شده"})]})}),u.jsxs(x,{container:!0,xs:12,alignItems:"center",gap:2,children:[!p&&u.jsx(x,{minWidth:210,children:u.jsx(Hu,{size:"small",disablePortal:!0,id:"hatching",options:ru().map(g=>({label:g.name})),onChange:(g,o)=>{o.label!=="همه"?L(o.label):L("")},renderInput:g=>u.jsx(N,{...g,label:"انتخاب استان"})})}),u.jsx(x,{children:u.jsxs("form",{onSubmit:W,children:[u.jsx(N,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:f}),u.jsx(wu,{type:"submit",onClick:W,endIcon:u.jsx(Yu,{}),children:"جستجو"})]})}),u.jsxs(x,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",sx:{width:{xs:"auto",md:"auto"}},children:[u.jsx(bu,{icon:u.jsx(Ku,{}),checkedIcon:u.jsx(Wu,{}),checked:E,onChange:()=>C(!E),color:"primary",size:"large"}),u.jsx(x,{children:u.jsx(Su,{disabled:!E,label:"از تاریخ",id:"date",renderInput:g=>u.jsx(N,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...g}),value:r,onChange:g=>{h(Cu(g).format("YYYY-MM-DD"))}})}),u.jsx(x,{children:u.jsx(Su,{disabled:!E,label:"تا تاریخ",id:"date",renderInput:g=>u.jsx(N,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...g}),value:l,onChange:g=>{S(Cu(g).format("YYYY-MM-DD"))}})})]}),u.jsx(hu,{placement:"right",title:"دانلود اکسل",children:u.jsx(du,{size:"small",color:"success",component:"a",href:`https://rsibackend.rasadyar.com/app/all_hatching_excel/?search=${ou}${E?`&date1=${r}&date2=${l}`:""}&province=${p||y?y:""}&state=${T==="0"?"pending":"archive"}`,children:u.jsx(Qu,{size:36})})})]}),u.jsxs(x,{container:!0,mt:2,mb:4,isDashboard:!0,gap:3,children:[u.jsx(su,{noPagination:!0,isDashboard:!0,columns:["تعداد دوره جوجه ریزی","حجم کل جوجه ریزی","تلفات","درصد تلفات","کشتار شده"," درصد کشتار شده","میانگین سن کشتار","تعداد بارها","کمترین سن","بیشترین سن","مانده در سالن","درصد مانده در سالن نسبت به جوجه ریزی"],data:[[(G=e==null?void 0:e.totalHatchingCount)==null?void 0:G.toLocaleString(),(D=e==null?void 0:e.totalHatchingQuantity)==null?void 0:D.toLocaleString(),(X=e==null?void 0:e.totalHatchingEvacuation)==null?void 0:X.toLocaleString(),(q=e==null?void 0:e.totalHatchingEvacuationPercent)==null?void 0:q.toLocaleString(),(J=e==null?void 0:e.totalHatchingKillingQuantity)==null?void 0:J.toLocaleString(),(Z=e==null?void 0:e.totalHatchingKillingQuantityPercent)==null?void 0:Z.toLocaleString(),Math.floor(e==null?void 0:e.totalHatchingKillingAge),(A=e==null?void 0:e.totalHatchingBars)==null?void 0:A.toLocaleString(),Math.floor(e==null?void 0:e.leastAge),Math.floor(e==null?void 0:e.mostAge),(s=e==null?void 0:e.totalHatchingLeftOver)==null?void 0:s.toLocaleString(),(i=e==null?void 0:e.totalHatchingLeftOverPercent)==null?void 0:i.toLocaleString()]],title:"خلاصه اطلاعات کل جوجه ریزی ها"}),u.jsx(su,{noPagination:!0,isDashboard:!0,columns:["تعداد دوره جوجه ریزی","حجم کل جوجه ریزی","تلفات","درصد تلفات","کشتار شده","درصد کشتار شده","میانگین سن کشتار","تعداد بارها","حجم جوجه ریزی فعال","کمترین سن","بیشترین سن","مانده در سالن","درصد مانده در سالن","مانده در سالن آماده به کشتار","درصد مانده در سالن آماده به کشتار"],data:[[(c=e==null?void 0:e.totalActiveHatchingCount)==null?void 0:c.toLocaleString(),(M=e==null?void 0:e.totalActiveHatchingQuantity)==null?void 0:M.toLocaleString(),(m=e==null?void 0:e.totalActiveHatchingEvacuation)==null?void 0:m.toLocaleString(),(uu=e==null?void 0:e.totalActiveHatchingEvacuationPercent)==null?void 0:uu.toLocaleString(),(eu=e==null?void 0:e.totalActiveHatchingKillingQuantity)==null?void 0:eu.toLocaleString(),(tu=e==null?void 0:e.totalActiveHatchingKillingQuantityPercent)==null?void 0:tu.toLocaleString(),Math.floor(e==null?void 0:e.totalActiveHatchingKillingAge),(nu=e==null?void 0:e.totalActiveHatchingBars)==null?void 0:nu.toLocaleString(),(F=e==null?void 0:e.totalActiveHatchingQuantity)==null?void 0:F.toLocaleString(),Math.floor(e==null?void 0:e.leastAge),Math.floor(e==null?void 0:e.mostAge),(n=e==null?void 0:e.totalActiveHatchingLeftOver)==null?void 0:n.toLocaleString(),(U=e==null?void 0:e.totalActiveHatchingLeftOverPercent)==null?void 0:U.toLocaleString(),(k=e==null?void 0:e.totalReadyActiveHatchingLeftOver)==null?void 0:k.toLocaleString(),(gu=e==null?void 0:e.totalReadyHatchingLeftOverPercent)==null?void 0:gu.toLocaleString()]],title:"خلاصه اطلاعات جوجه ریزی های فعال",customColors:[{rest:!0,color:"#6262c4"}]})]}),u.jsx(su,{data:cu,columns:["ردیف","استان","شهرستان","نام واحد","نام مالک","شماره مجوز","شماره گواهی بهداشتی","ظرفیت","تاریخ جوجه ریزی","سن گله","نژاد","تعداد جوجه ریزی","دوره جوجه ریزی","مجموع تلفات","درصد جوجه ریزی به مجوز","مانده در سالن","میانگین سن کشتار","تعداد بارها","حجم بارها","جزئیات"],handlePageChange:Au,totalRows:iu,page:P,perPage:R,handlePerRowsChange:au,title:T==="0"?`پایش جوجه ریزی ${p||""}`:`بایگانی جوجه ریزی ${p||""}`})]})},y6=Mu("PROVINCE_NATIONAL_GET_FARM_INFO_DASHBOARD_SERVICE",async(r,{dispatch:h})=>{h(Y());const{data:l,status:S}=await B.get("https://rsibackend.rasadyar.com/app/poultry-dashboard/",{params:{role:H(),search:r.search,province:r.province}});return h(b()),{data:l,status:S}}),v6=({excelHref:r,onView:h})=>{const[l,S]=a.useState(null),d=e=>{S(e.currentTarget)},f=()=>{S(null)},y=!!l,L=y?"farm-actions-menu":void 0,p=[{key:"excel",label:"دانلود اکسل",color:"success.main",icon:u.jsx(o6,{sx:{fontSize:{xs:20,md:18}}}),action:()=>{window.open(r,"_blank","noopener")}},{key:"view",label:"نمایش جزئیات",color:"primary.main",icon:u.jsx(e6,{sx:{fontSize:{xs:20,md:18}}}),action:h}];return u.jsxs(x,{container:!0,alignItems:"center",justifyContent:"center",gap:.5,children:[u.jsx(hu,{title:"عملیات",children:u.jsx(du,{"aria-describedby":L,color:"primary",onClick:d,size:"small",children:u.jsx(n6,{fontSize:"small"})})}),u.jsx(Xu,{id:L,open:y,anchorEl:l,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{mt:1}}},children:u.jsx(qu,{sx:{p:1},children:p.map(e=>u.jsxs(Ju,{onClick:()=>{f(),e.action()},sx:{borderRadius:1,mb:.5,color:e.color,"&:last-of-type":{mb:0}},children:[u.jsx(Zu,{sx:{color:e.color,minWidth:36},children:e.icon}),u.jsx(mu,{primary:u.jsx(u6,{sx:{color:e.color,fontWeight:600,fontSize:{xs:"13px",md:"14px"}},children:e.label})})]},e.key))})})]})},U6=()=>{var O,Q,K,Au,au,W,ru,G,D,X,q,J,Z,A,s,i,c,M,m,uu,eu,tu,nu;const r=c6(),h=F=>{w(F.target.value)},[l,S]=a.useState(""),[d,f]=a.useState([]),[y,L]=a.useState(0),[p,e]=a.useState(10),[$,w]=a.useState(""),[t,iu]=a.useState([]),[I,R]=a.useState(1),[_,ou]=a.useState([]),j=Uu(),{key:P}=zu(),V=()=>{j(y6({search:$,province:l==="همه"?"":l})).then(F=>{iu(F.payload.data)})},cu=async F=>{j(Y());const n=await B.get(`https://rsibackend.rasadyar.com/app/poultry-info/?search=${$}&role=${H()}&page=${F}&page_size=${p}&province=${P||l?l:""}`);j(b()),V(),f(n.data.results),L(n.data.count)},v=F=>{cu(F),R(F)},E=F=>{e(F),R(1)};a.useEffect(()=>{const F=d==null?void 0:d.map((n,U)=>{var gu,g,o,lu,pu,xu,Fu,fu,yu,vu,ju,Lu,Eu,$u,Pu,Iu,_u,Ou,Nu,Ru,Tu,ku;const k=(n.FirstName+""+n.LastName).replace("null","");return[I===1?U+1:U+p*(I-1)+1,k,n==null?void 0:n.Mobile,n==null?void 0:n.UnitName,n==null?void 0:n.EpidemiologicCode,n==null?void 0:n.SystemCode,n==null?void 0:n.UnitId,n==null?void 0:n.UserIsActiveDescription,(g=(gu=n==null?void 0:n.info)==null?void 0:gu.capacity)==null?void 0:g.toLocaleString(),n==null?void 0:n.Province,n==null?void 0:n.City,(lu=(o=n==null?void 0:n.info)==null?void 0:o.countHatching)==null?void 0:lu.toLocaleString(),(xu=(pu=n==null?void 0:n.info)==null?void 0:pu.totalHatching)==null?void 0:xu.toLocaleString(),(fu=(Fu=n==null?void 0:n.info)==null?void 0:Fu.totalEvacuation)==null?void 0:fu.toLocaleString(),(vu=(yu=n==null?void 0:n.info)==null?void 0:yu.totalEvacuationPercent)==null?void 0:vu.toLocaleString(),(Lu=(ju=n==null?void 0:n.info)==null?void 0:ju.totalKilling)==null?void 0:Lu.toLocaleString(),($u=(Eu=n==null?void 0:n.info)==null?void 0:Eu.totalKillingPercent)==null?void 0:$u.toLocaleString(),(Iu=(Pu=n==null?void 0:n.info)==null?void 0:Pu.totalLeftover)==null?void 0:Iu.toLocaleString(),(Ou=(_u=n==null?void 0:n.info)==null?void 0:_u.totalLeftOverPercent)==null?void 0:Ou.toLocaleString(),(Ru=(Nu=n==null?void 0:n.info)==null?void 0:Nu.carsCount)==null?void 0:Ru.toLocaleString(),(ku=(Tu=n==null?void 0:n.info)==null?void 0:Tu.totalCars)==null?void 0:ku.toLocaleString(),u.jsx(v6,{excelHref:`https://rsibackend.rasadyar.com/app/hatching_excel/?system_code=${n.SystemCode}&province=${P||l?l:""}`,onView:()=>{r(H()==="AdminX"?`${g6}/${n==null?void 0:n.SystemCode}/${k}`:H()==="SuperAdmin"?`${p6}/${n==null?void 0:n.SystemCode}/${k}`:`${x6}/${n==null?void 0:n.SystemCode}/${k}`)}},(n==null?void 0:n.SystemCode)||U)]});ou(F)},[d]),a.useEffect(()=>{cu(1)},[j,p,l]);const C=async F=>{F.preventDefault(),j(Y());try{const n=await B.get(`https://rsibackend.rasadyar.com/app/poultry-info/?role=${H()}&search=${$}&page=1&page_size=${p}&province=${P||l?l:""}`);f(n.data.results),L(n.data.count),j(b()),V()}catch(n){console.error("Error fetching data:",n)}},T=()=>[{name:"همه"},...Bu()],z=F=>{var n;return!P&&(l==="همه"||!l)?[F?(n=F==null?void 0:F.provinceCount)==null?void 0:n.toLocaleString():"تعداد استان"]:[]};return u.jsxs(x,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(x,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[!P&&u.jsx(x,{minWidth:210,children:u.jsx(Hu,{size:"small",disablePortal:!0,id:"hatching",options:T().map(F=>({label:F.name})),onChange:(F,n)=>{n.label!=="همه"?S(n.label):S("")},renderInput:F=>u.jsx(N,{...F,label:"انتخاب استان"})})}),u.jsx(x,{children:u.jsxs("form",{onSubmit:C,children:[u.jsx(N,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:h}),u.jsx(wu,{type:"submit",onClick:C,endIcon:u.jsx(Yu,{}),children:"جستجو"})]})})]}),u.jsxs(x,{container:!0,mt:2,mb:4,isDashboard:!0,gap:2,children:[u.jsx(su,{noPagination:!0,isDashboard:!0,columns:[" تعداد فارم ها ","تعداد کل جوجه ریزی","حجم کل جوجه ریزی","تلفات","درصد تلفات","کشتار شده","درصد کشتار شده","مانده درسالن","درصد مانده درسالن","میانگین سن کشتار",...z(),"تعداد شهرستان"],data:[[(O=t==null?void 0:t.poultryCount)==null?void 0:O.toLocaleString(),(Q=t==null?void 0:t.totalHatchingCount)==null?void 0:Q.toLocaleString(),(K=t==null?void 0:t.totalHatchingQuantity)==null?void 0:K.toLocaleString(),(Au=t==null?void 0:t.totalHatchingEvacuation)==null?void 0:Au.toLocaleString(),(au=t==null?void 0:t.totalHatchingEvacuationPercent)==null?void 0:au.toLocaleString(),(W=t==null?void 0:t.totalHatchingKillingQuantity)==null?void 0:W.toLocaleString(),(ru=t==null?void 0:t.totalHatchingKillingQuantityPercent)==null?void 0:ru.toLocaleString(),(G=t==null?void 0:t.totalHatchingLeftOver)==null?void 0:G.toLocaleString(),(D=t==null?void 0:t.totalHatchingLeftOverPercent)==null?void 0:D.toLocaleString(),Math.floor((X=t==null?void 0:t.totalHatchingKillingAge)==null?void 0:X.toLocaleString()),(q=t==null?void 0:t.provinceCount)==null?void 0:q.toLocaleString(),(J=t==null?void 0:t.cityCount)==null?void 0:J.toLocaleString()]],title:"خلاصه اطلاعات فارم ها"}),u.jsx(su,{noPagination:!0,isDashboard:!0,columns:["تعداد جوجه ریزی های فعال","حجم جوجه ریزی ها","تلفات","درصد تلفات","کشتار شده","درصد کشتار شده","مانده در سالن","درصد مانده در سالن","میانگین سن کشتار","مانده در سالن آماده به کشتار","درصد مانده در سالن آماده به کشتار"],data:[[(Z=t==null?void 0:t.totalActiveHatchingCount)==null?void 0:Z.toLocaleString(),(A=t==null?void 0:t.totalActiveHatchingQuantity)==null?void 0:A.toLocaleString(),(s=t==null?void 0:t.totalActiveHatchingEvacuation)==null?void 0:s.toLocaleString(),(i=t==null?void 0:t.totalActiveHatchingEvacuationPercent)==null?void 0:i.toLocaleString(),(c=t==null?void 0:t.totalActiveHatchingKillingQuantity)==null?void 0:c.toLocaleString(),(M=t==null?void 0:t.totalActiveHatchingKillingQuantityPercent)==null?void 0:M.toLocaleString(),(m=t==null?void 0:t.totalActiveHatchingLeftOver)==null?void 0:m.toLocaleString(),(uu=t==null?void 0:t.totalActiveHatchingLeftOverPercent)==null?void 0:uu.toLocaleString(),(eu=Math.floor(t==null?void 0:t.totalActiveHatchingKillingAge))==null?void 0:eu.toLocaleString(),(tu=t==null?void 0:t.totalReadyActiveHatchingLeftOver)==null?void 0:tu.toLocaleString(),(nu=t==null?void 0:t.totalReadyHatchingLeftOverPercent)==null?void 0:nu.toLocaleString()]],title:" جوجه ریزی های فعال (1 تا 70 روز)",allColors:{color:"#6262c4",text:"white"}})]}),u.jsx(su,{data:_,columns:["ردیف","نام و نام خانوادگی","شماره همراه","نام واحد","کد اپیدمیولوژیک","کد سیستمی واحد","شناسه یکتا واحد","وضعیت","ظرفیت فارم","استان","شهرستان","تعداد جوجه ریزی","حجم جوجه ریزی","تلفات","درصد تلفات","کشتار شده","درصد کشتار","مانده در سالن","درصد مانده در سالن ","تعداد ماشین","حجم ماشین ها","جزئیات"],handlePageChange:v,totalRows:y,page:I,perPage:p,handlePerRowsChange:E,title:`مدیریت فارم ${P||""}`})]})},j6=Mu("PROVINCE_NATIONAL_GET_TRANSPORT_INFO_DASHBOARD_SERVICE",async(r,{dispatch:h})=>{h(Y());const{data:l,status:S}=await B.get("https://rsibackend.rasadyar.com/app/transporting-dashboard",{params:{role:H(),search:r.search,value:r.search,province:r.province,PartIdCode:r.PartIdCode,date1:r.date1,date2:r.date2}});return h(b()),{data:l,status:S}}),Y6=()=>{var G,D,X,q,J,Z,A,s;const[,,r,h,l,S]=a.useContext(Vu),[d,f]=a.useState(""),y=()=>z===void 0?d==="همه"?"":d:z,L=()=>{p(j6({date1:v?r:null,date2:v?l:null,search:_,province:y(),PartIdCode:O!==void 0?O:null})).then(i=>{T(i.payload.data)})},p=Uu();a.useEffect(()=>{const i=Cu(new Date).format("YYYY-MM-DD");h(i),S(i)},[]);const e=i=>{ou(i.target.value)},[$,w]=a.useState([]),[t,iu]=a.useState(0),[I,R]=a.useState(10),[_,ou]=a.useState(""),[j,P]=a.useState(1),[V,cu]=a.useState([]),[v,E]=a.useState(!0),[C,T]=a.useState([]),{key:z,unitkey:O,name:Q}=zu(),K=async i=>{let c;p(Y()),c=await B.get(`https://rsibackend.rasadyar.com/app/transporting-detail/?search=${_}${v?`&date1=${r}&date2=${l}`:""}&page=${i}&page_size=${I}${O!==void 0?"&PartIdCode="+O:""}&province=${y()}`),p(b()),L(),w(c.data.results),iu(c.data.count)},Au=i=>{K(i),P(i)},au=i=>{R(i),P(1)};a.useEffect(()=>{const i=$==null?void 0:$.map((c,M)=>{var m,uu,eu,tu,nu,F,n,U,k;return[j===1?M+1:M+I*(j-1)+1,u.jsx(h6,{clearanceCode:c==null?void 0:c.TrackingCode},M),t6(c==null?void 0:c.Date),c==null?void 0:c.DesUnitName,c==null?void 0:c.DesPartIdCode,c==null?void 0:c.Province,c==null?void 0:c.City,(m=c==null?void 0:c.GoodAmount)==null?void 0:m.toLocaleString(),c==null?void 0:c.TrackingStatusDescription,c!=null&&c.Out?"خارج استان":"داخل استان",c==null?void 0:c.SourceUnitName,(eu=(uu=c==null?void 0:c.hatching)==null?void 0:uu.poultry)==null?void 0:eu.PartIdCode,(tu=c==null?void 0:c.hatching)==null?void 0:tu.RequestCode,(F=(nu=c==null?void 0:c.hatching)==null?void 0:nu.poultry)==null?void 0:F.Province,(U=(n=c==null?void 0:c.hatching)==null?void 0:n.poultry)==null?void 0:U.City,c==null?void 0:c.Age,(k=c==null?void 0:c.hatching)==null?void 0:k.PedigreeName]});cu(i)},[$]),a.useEffect(()=>{K(1)},[p,r,l,I,v,d]);const W=async i=>{i.preventDefault(),L(),p(Y());try{const c=await B.get(`https://rsibackend.rasadyar.com/app/transporting-detail/?search=${_}${v?`&date1=${r}&date2=${l}`:""}&page=1&page_size=${I}${O!==void 0?"&PartIdCode="+O:""}&province=${y()}`);w(c.data.results),iu(c.data.count),p(b())}catch(c){console.error("Error fetching data:",c)}},ru=()=>[{name:"همه"},...Bu()];return u.jsxs(x,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,mt:4,children:[u.jsxs(x,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[z===void 0&&O===void 0&&Q===void 0&&u.jsx(x,{minWidth:210,children:u.jsx(Hu,{size:"small",disablePortal:!0,id:"hatching",options:ru().map(i=>({label:i.name})),onChange:(i,c)=>{c.label!=="همه"?f(c.label):f("")},renderInput:i=>u.jsx(N,{...i,label:"انتخاب استان"})})}),u.jsxs(x,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(bu,{icon:u.jsx(Ku,{}),checkedIcon:u.jsx(Wu,{}),checked:v,onChange:()=>E(!v),color:"primary",size:"large"}),u.jsx(x,{children:u.jsx(Su,{disabled:!v,label:"از تاریخ",id:"date",renderInput:i=>u.jsx(N,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...i}),value:r,onChange:i=>{h(Cu(i).format("YYYY-MM-DD"))}})}),u.jsx(x,{children:u.jsx(Su,{disabled:!v,label:"تا تاریخ",id:"date",renderInput:i=>u.jsx(N,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...i}),value:l,onChange:i=>{S(Cu(i).format("YYYY-MM-DD"))}})})]}),u.jsx(x,{children:u.jsxs("form",{onSubmit:W,children:[u.jsx(N,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:e}),u.jsx(wu,{type:"submit",onClick:W,endIcon:u.jsx(Yu,{}),children:"جستجو"})]})}),u.jsx(x,{children:u.jsx(hu,{placement:"right",title:v?"دانلود اکسل":"برای دانلود اکسل، بازه تاریخی را فعال کنید",children:u.jsx(du,{size:"small",color:"success",component:"a",href:`https://rsibackend.rasadyar.com/app/all_send_different_bar_excel/?search=${_}${v?`&date1=${r}&date2=${l}`:""}&province=${y()}`,disabled:!v,children:u.jsx(Qu,{size:36,style:{cursor:"pointer"}})})})})]}),u.jsx(x,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(su,{noPagination:!0,isDashboard:!0,columns:["تعداد بار","حجم بار","میانگین سن کشتار","تعداد بار داخل استان","حجم بار داخل استان","درصد داخل استان","تعداد بار خارج استان","حجم بار خارج استان","درصد خارج استان"],data:[[(G=C==null?void 0:C.barCount)==null?void 0:G.toLocaleString(),(D=C==null?void 0:C.barQuantity)==null?void 0:D.toLocaleString(),Math.floor(C==null?void 0:C.totalBarKillingAge),(X=C==null?void 0:C.inputBarCount)==null?void 0:X.toLocaleString(),(q=C==null?void 0:C.inputBarQuantity)==null?void 0:q.toLocaleString(),(J=C==null?void 0:C.inputBarPercent)==null?void 0:J.toFixed(1),(Z=C==null?void 0:C.outputBar)==null?void 0:Z.toLocaleString(),(A=C==null?void 0:C.outputBarQuantity)==null?void 0:A.toLocaleString(),(s=C==null?void 0:C.outputBarPercent)==null?void 0:s.toFixed(1)]],title:"خلاصه اطلاعات"})}),u.jsx(su,{data:V,columns:["ردیف","کد رهگیری قرنطینه","تاریخ کشتار","نام کشتارگاه","شناسه یکتا کشتار گاه","استان کشتارگاه","شهر کشتارگاه","تعداد ","وضعیت ","مقصد کشتار","نام مرغدار","شناسه یکتا مرغداری","شناسه جوجه ریزی","استان مرغدار","شهرستان مرغدار","سن کشتار","نژاد"],handlePageChange:Au,totalRows:t,page:j,perPage:I,handlePerRowsChange:au,title:z||Q?`گزارش اطلاعات بار ${z||Q} `:"گزارش اطلاعات بار"})]})};export{M6 as N,U6 as P,Y6 as a,z6 as b,j6 as c,f6 as n,y6 as p}; diff --git a/build/assets/NavLink-D2GD_ItM.js b/build/assets/NavLink-D2GD_ItM.js new file mode 100644 index 0000000..ae4cd65 --- /dev/null +++ b/build/assets/NavLink-D2GD_ItM.js @@ -0,0 +1,4 @@ +import{c0 as e}from"./mui-vendor-CkIVaoQP.js";import{L as a}from"./react-vendor-CmFgShSM.js";const m=e(a)` + text-decoration: none !important; + color: ${t=>t.active?t.theme.palette.primary.main:t.theme.palette.grey.A400}; +`;export{m as N}; diff --git a/build/assets/NavigateNext-ByUC5RGi.js b/build/assets/NavigateNext-ByUC5RGi.js new file mode 100644 index 0000000..d802860 --- /dev/null +++ b/build/assets/NavigateNext-ByUC5RGi.js @@ -0,0 +1 @@ +import{i as t,j as r}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},i=t;Object.defineProperty(e,"__esModule",{value:!0});var o=e.default=void 0,u=i(a()),v=r;o=e.default=(0,u.default)((0,v.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext");export{o as d}; diff --git a/build/assets/NewFile-DzVKWg18.js b/build/assets/NewFile-DzVKWg18.js new file mode 100644 index 0000000..5155095 --- /dev/null +++ b/build/assets/NewFile-DzVKWg18.js @@ -0,0 +1 @@ +import{j as u,aO as S,aP as b,aQ as E,aR as P,aS as H,T as s,aT as M,p as j,ak as Pu,B as J,aI as Hu,I as ku,aJ as Lu,cl as Iu,cm as Mu}from"./mui-vendor-CkIVaoQP.js";import{G as r,S as a,_ as U,Q as Y,a0 as Du,v as Z,X as T,j as Wu,$ as xu,A as Ku,u as Nu,c as wu,M as $u,m as Ru,L as Cu,h as pu,p as Fu,hX as Ou,hY as Uu}from"./index-CeyyVc1v.js";import{r as f,j as hu,u as qu}from"./react-vendor-CmFgShSM.js";import{F as Bu}from"./FileInformation-BQPmtbts.js";import{S as m}from"./SimpleTable-DBAoNnCU.js";import{g as Au,u as _u}from"./useRequestFile-FPqBpZfN.js";import{u as Gu}from"./useGetAllocationInformation-DFB6N6mk.js";import{T as Qu}from"./Timer-DHCbB9tg.js";import{u as eu,f as zu,a as Yu}from"./redux-vendor-B7uoacJt.js";import{F as Vu,a as Ju}from"./Factor-CqUlgaYq.js";import{S as Xu}from"./SlaughterPayProvinceFactorForm-QExXum_R.js";import{d as Zu}from"./NavigateNext-ByUC5RGi.js";import{A as u6}from"./index-9Ymn_7Kv.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";import"./NumberFormatCustom-DwWPj40N.js";import"./toBase64-BzgTOHsW.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./Add--yVWBJhC.js";const ju=({file:e})=>{const[c,F]=f.useState({cityOperatorName:"اپراتور شهرستان",cityOperatorMobile:"-",cityUnionName:"-",acceptedRejectedDate:"",cityState:"در انتظار تایید"}),{city:i,cityOperator:n}=e;return f.useEffect(()=>{let o,A,C,p,h;i?(o=i.cityOperatorName,A=i.cityOperatorMobile,C=i.acceptedRejectedDate,h=i.unitName,p=i.cityState==="accept"?"تایید شده":"رد شده"):(o=n==null?void 0:n.cityOperatorName,A=n.cityOperatorMobile,h=n.unitName,C=null,p="در انتظار تایید"),F({cityOperatorName:o,cityOperatorMobile:A,acceptedRejectedDate:C,cityUnionName:h,cityState:p})},[i]),u.jsx(u.Fragment,{children:u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{children:u.jsx(s,{variant:"body1",fontWeight:"bold",children:"مرحله شهرستان"})})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsx(r,{container:!0,gap:a.SMALL,children:u.jsx(r,{container:!0,gap:a.SMALL,children:c.cityState==="در انتظار تایید"?u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"درخواست منتظر انجام عملیات توسط اپراتور می باشد."}):u.jsxs(u.Fragment,{children:[u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"درخواست در تاریخ"}),u.jsx(s,{variant:"body2",fontWeight:"bold",children:c.acceptedRejectedDate?U(c.acceptedRejectedDate):"-"}),u.jsxs(s,{variant:"body2",display:"flex",gap:a.SMALL,children:[c.cityState," است."]})]})})})})})]}),u.jsx(r,{children:u.jsx(r,{xs:12,children:u.jsx(m,{columns:["نام اپراتور","نام اتحادیه","تلفن","استان","شهر","تاریخ بررسی","وضعیت",i!=null&&i.cityOperatorMessage?"دلیل رد":""],data:[[c.cityOperatorName,c.cityUnionName,c.cityOperatorMobile,n.cityOperatorProvince,n.cityOperatorCity,c!=null&&c.acceptedRejectedDate?Y(new Date(c==null?void 0:c.acceptedRejectedDate),"yyyy/MM/dd"):"",i!=null&&i.provinceAccept?"تایید شده توسط استان":c.cityState,i!=null&&i.cityOperatorMessage?i==null?void 0:i.cityOperatorMessage:""]]})})})]})]})})};ju.propTypes={file:j.PropTypes.any};const yu=({file:e,quantity:c})=>{const[F,i]=f.useState({provinceOperatorName:"اپراتور استان",provinceOperatorMobile:"-",acceptedRejectedDate:null,provinceState:"در انتظار تایید"}),{province:n,provinceOperator:o}=e;return f.useEffect(()=>{let A,C,p,h;n?(A=n.provinceOperatorName,C=n.provinceOperatorMobile,p=n.acceptedRejectedDate,h=n.provinceState==="accept"?"تایید شده":"رد شده"):(A=o==null?void 0:o.provinceOperatorName,C=o==null?void 0:o.provinceOperatorMobile,p=null,h="در انتظار تایید"),i({provinceOperatorName:A,provinceOperatorMobile:C,acceptedRejectedDate:p,provinceState:h})},[n]),u.jsx(u.Fragment,{children:u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{children:u.jsx(s,{variant:"body1",fontWeight:"bold",children:"مرحله استان"})})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsx(r,{container:!0,gap:a.SMALL,children:F.provinceState==="در انتظار تایید"?u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"درخواست منتظر انجام عملیات توسط اپراتور می باشد."}):u.jsxs(u.Fragment,{children:[u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"درخواست در تاریخ"}),u.jsx(s,{variant:"body2",fontWeight:"bold",children:F.acceptedRejectedDate?U(F.acceptedRejectedDate):"-"}),u.jsxs(s,{variant:"body2",display:"flex",gap:a.SMALL,children:[F.provinceState," است."]})]})})})})]}),u.jsx(r,{children:u.jsx(r,{xs:12,children:u.jsx(m,{columns:["نام اپراتور","تلفن","استان","تاریخ بررسی","وضعیت درخواست","وضعیت تخصیص",n!=null&&n.provinceMessage?"دلیل رد":""],data:[[F.provinceOperatorName,F.provinceOperatorMobile,o.provinceOperatorProvinc,Y(new Date(F.acceptedRejectedDate),"yyyy/MM/dd"),F.provinceState,c!==0?"در انتظار تخصیص استان":"تخصیص داده شده",n!=null&&n.provinceMessage?n==null?void 0:n.provinceMessage:""]]})})})]})]})})};yu.propTypes={file:j.PropTypes.any,quantity:j.PropTypes.any};const X=({data:e,auction:c})=>{var k,L,I,l,x,d,t,w,$,v,R,q,B,_,G,Q,ru,ou,nu,tu,iu,lu,cu,su,au;const F=eu();f.useEffect(()=>{F(Du())},[]);const{avicultureChickenPrice:i}=zu(y=>y.avicultureSlice),n=i==null?void 0:i.liveChickenPrice;let o,A,C,p,h,g;const D=Z(new Date(e.paymentDeadLine)),W=Z(),K=D.diff(W);let N=Z.duration(K).asSeconds();if(!c){let y;y=!e.killHouseFactorToProvince&&!e.provinceFactorToKillHouse?"در انتظار تایید مالی":y,y=!e.killHouseFactorToProvince&&e.provinceFactorToKillHouse?"در انتظار پرداخت کشتارگاه":y,y=e.killHouseFactorToProvince&&e.provinceFactorToKillHouse?"پرداخت شده توسط کشتارگاه":y;let z;const Su=((k=e.killHouseFactorToProvince)==null?void 0:k.factorState)==="accepted"||((L=e.killHouseFactorToPoultry)==null?void 0:L.factorState)==="accepted",bu=e&&u.jsx(Qu,{isFilePaymentTime:!0,seconds:N},"finincalTimer"),Eu=!e.killHouseFactorToProvince&&!e.provinceFactorToKillHouseForPoultry;!!e.paymentDeadLine?z=bu:Eu?z="در انتظار تایید مالی":z="در انتظار صدور تمامی فاکتورها",Su&&(z="پرداخت شده ✔"),o=["کشتارگاه","نام راننده","ماشین","نوع خرید","سند خودرو بدون بار","سند خودرو با بار","تعداد درخواست","تعداد واقعی بارگیری","وزن بار","میانگین وزن"],A=[[`${e.killHouseName} (${e.killHouseUserProvince}/${e.killHouseUserCity})`,((I=e.cars)==null?void 0:I.driverName)+` (${(l=e.cars)==null?void 0:l.driverMobile})`,`${(x=e.cars)==null?void 0:x.typeCar} با پلاک ${(d=e.cars)==null?void 0:d.pelak}`,`${e.paymentType==="credit"?"زمان دار":"نقدی"}`,u.jsxs("a",{style:{textDecoration:"none",color:"black"},href:e.barInfo.killHouseImageWithoutLoad,alt:"دانلود سند خودرو بدون بار",children:[u.jsx("img",{src:e.barInfo.killHouseImageWithoutLoad,width:"50",height:"50",alt:"بدون بار",className:"images-file"}),u.jsxs("p",{children:[e.barInfo.killHouseWeightWithoutLoad," کیلوگرم"]})]},"provinceKillRequests"),u.jsxs("a",{style:{textDecoration:"none",color:"black"},href:e.barInfo.killHouseImageWithLoad,alt:"دانلود سند خودرو با بار",children:[u.jsx("img",{src:e.barInfo.killHouseImageWithLoad,width:"50",height:"50",alt:"بدون بار",className:"images-file"},"provinceKillRequests"),u.jsxs("p",{children:[e.barInfo.killHouseWeightWithLoad," کیلوگرم"]})]},"provinceKillRequests"),e.quantity+" قطعه",e.barInfo.realQuantity+" قطعه",e.barInfo.killHouseNetWeight+" کیلوگرم",(e.barInfo.killHouseNetWeight/e.barInfo.realQuantity).toFixed(2)+" کیلوگرم"]],C=["قیمت روز","قیمت هرکیلو","سهم مرغدار","سهم اتحادیه","مانده تا سررسید 30 روزه","سهم مرغدار با ضریب سود","سهم اتحادیه با ضریب سود","جمع مبلغ قابل پرداخت","وضعیت"];let O;(t=e.provinceFactorToKillHouse)!=null&&t.poultryShareWithProfit?O=(w=e.provinceFactorToKillHouse)==null?void 0:w.poultryShareWithProfit:($=e.provinceFactorToKillHouseForPoultry)!=null&&$.poultryShareWithProfit&&(O=(v=e.provinceFactorToKillHouseForPoultry)==null?void 0:v.poultryShareWithProfit),h=[[n+" ﷼",e.provinceFactorToKillHouse?e.provinceFactorToKillHouse.provinceFactorFee+" ریال":"نامشخص",e.provinceFactorToKillHouse?e.provinceFactorToKillHouse.provinceFactorFee*e.barInfo.killHouseNetWeight+" ریال":"نامشخص",(R=e.provinceFactorToKillHouse)!=null&&R.totalShareAllocation?((q=e.provinceFactorToKillHouse)==null?void 0:q.totalShareAllocation)+" ریال":"نامشخص",z,O?`${O} ریال`:"نامشخص",(B=e.provinceFactorToKillHouse)!=null&&B.unionShareWithProfit?`${(_=e.provinceFactorToKillHouse)==null?void 0:_.unionShareWithProfit} ریال`:"نامشخص",(G=e.provinceFactorToKillHouse)!=null&&G.cost?`${((Q=e.provinceFactorToKillHouse)==null?void 0:Q.cost)+((ru=e.provinceFactorToKillHouse)==null?void 0:ru.poultryShareWithProfit)} ریال`:"نامشخص",y]],p=["قیمت روز","قیمت هرکیلو","سهم مرغدار","سهم اتحادیه","مبلغ قابل پرداخت","وضعیت"];let V;(ou=e.provinceFactorToKillHouse)!=null&&ou.cost?V=`${(nu=e.provinceFactorToKillHouse)==null?void 0:nu.cost} ریال`:(tu=e.provinceFactorToKillHouseForPoultry)!=null&&tu.cost?V=`${(iu=e.provinceFactorToKillHouseForPoultry)==null?void 0:iu.cost} ریال`:V="نامشخص",g=[[n+" ﷼",e.provinceFactorToKillHouse?e.provinceFactorToKillHouse.provinceFactorFee+" ریال":"ندارد",O?`${O} ریال`:"نامشخص",(lu=e.provinceFactorToKillHouse)!=null&&lu.totalShareAllocation?((cu=e.provinceFactorToKillHouse)==null?void 0:cu.totalShareAllocation)+" ریال":"نامشخص",V,y]],T()==="Poultry"&&(p.splice(5,3),(su=g[0])==null||su.splice(5,3),C.splice(5,4),(au=h[0])==null||au.splice(5,4))}return u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{children:u.jsx(s,{variant:"body1",fontWeight:"bold",children:"مرحله مالی"})})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsx(r,{container:!0,gap:a.SMALL,children:e.barInfo.killHouseAssignmentState==="pending"?u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"درخواست در انتظار تایید اپراتور مالی است."}):u.jsxs(u.Fragment,{children:[u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"درخواست در تاریخ"}),u.jsx(s,{variant:"body2",fontWeight:"bold",children:U(new Date(e.barInfo.acceptRejectDate))}),u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:e.barInfo.killHouseAssignmentState==="accepted"?"تایید شده است.":e.barInfo.killHouseAssignmentState==="pending"?"در انتظار تایید":"رد شده است."})]})})})})]}),u.jsx(r,{container:!0,children:u.jsxs(r,{xs:12,children:[u.jsx(m,{name:`اطلاعات بار ${e.barcod} - کد قرنطینه ${e.clearanceCode} - کد حمل و نقل ${e.trafficCode}`,columns:o,data:A}),e.paymentType==="cash"?u.jsx(m,{name:"اطلاعات مالی",columns:p,data:g}):u.jsx(m,{name:"اطلاعات مالی",columns:C,data:h})]})})]})]})};X.propTypes={item:j.PropTypes.array,data:j.PropTypes.any,auction:j.PropTypes.bool};const uu=({data:e,barCode:c})=>u.jsx(u.Fragment,{children:u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{children:u.jsx(s,{variant:"body1",fontWeight:"bold",children:"اطلاعات پرداختی کشتارگاه"})})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsx(r,{container:!0,gap:a.SMALL,children:u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"اطلاعات پرداختی کشتارگاه در این قسمت نمایش داده میشود."})})})})]}),u.jsx(r,{container:!0,children:u.jsx(r,{xs:12,children:u.jsx(m,{columns:["کد بار","کشتارگاه","تاریخ ثبت شناسه","شناسه پرداخت","مبلغ","وضعیت","پیوست"],data:[[c,`${e==null?void 0:e.killHouseName} (${e==null?void 0:e.killHouseUserProvince}/${e==null?void 0:e.killHouseUserCity})`,U(e.time),Number(e.paymentCode),`${e.totalMoney} ﷼`,e.factorState==="accepted"?"تایید شده":e.factorState==="pending"?"در انتظار تایید":"رد شده",u.jsx("a",{href:e.factorImage,children:u.jsx("img",{src:e.factorImage,alt:"Slaughter Payment Factor",width:"50",height:"50",className:"images-file"})},"SlaughterPaymentFactorImage")]]})})})]})]})});uu.propTypes={data:j.PropTypes.any,barCode:j.PropTypes.any};const fu=({item:e,i:c})=>{let F=[],i=[],n;return n=e.provinceKillRequestState==="pending"?"در انتظار تایید کشتارگاه":n,n=e.provinceKillRequestState==="accepted"?"تایید شده":n,n=e.provinceKillRequestState==="rejected"?"رد شده":n,e.provinceKillRequestMessage?(F=["نام کشتارگاه","مالک کشتارگاه","تعداد تخصیص داده شده","تاریخ تخصیص","نحوه خرید","نوع تخصیص","وضعیت درخواست","دلیل رد"],i=[e.killHouseName,e.killHouseUserName,e.mainQuantity+" قطعه",Y(new Date(e.date),"yyyy/MM/dd"),e.paymentType,e.automaticState?"اتوماتیک":"دستی",n,e.provinceKillRequestMessage]):(F=["نام کشتارگاه","مالک کشتارگاه","تعداد تخصیص داده شده","تاریخ تخصیص","نوع تخصیص","وضعیت درخواست"],i=[e.killHouseName,e.killHouseUserName,e.mainQuantity+" قطعه",Y(new Date(e.date),"yyyy/MM/dd"),e.automaticState?"اتوماتیک":"دستی",n]),u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{variant:"body1",fontWeight:"bold",children:"تخصیصات استان به کشتارگاه"})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsx(s,{variant:"body2",children:"در این قسمت جزییات تخصیصات را مشاهده می کنید."})})})]}),u.jsx(r,{children:u.jsx(r,{children:u.jsx(r,{children:u.jsx(m,{columns:F,data:[i]})})},"ProvinceAllocationInformation"+c)})]})]})};fu.propTypes={item:j.PropTypes.object,i:j.PropTypes.any};const mu=({data:e,barCode:c})=>u.jsx(u.Fragment,{children:u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{children:u.jsx(s,{variant:"body1",fontWeight:"bold",children:"اطلاعات پرداختی کشتارگاه به مرغدار"})})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsx(r,{container:!0,gap:a.SMALL,children:u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"اطلاعات پرداختی کشتارگاه در این قسمت نمایش داده میشود."})})})})]}),u.jsx(r,{container:!0,children:u.jsx(r,{xs:12,children:u.jsx(m,{columns:["کد بار","کشتارگاه","تاریخ ثبت شناسه","شناسه پرداخت","مبلغ","وضعیت","پیوست"],data:[[c,`${e==null?void 0:e.killHouseName} (${e==null?void 0:e.killHouseUserProvince}/${e==null?void 0:e.killHouseUserCity})`,U(e==null?void 0:e.time),Number(e==null?void 0:e.paymentCode),`${e.totalMoney} ﷼`,e.factorState==="accepted"?"تایید شده":e.factorState==="pending"?"در انتظار تایید":"رد شده",u.jsx("a",{href:e==null?void 0:e.factorImage,children:u.jsx("img",{src:e==null?void 0:e.factorImage,alt:"Slaughter Payment Factor",width:"50",height:"50",className:"images-file"})},"SlaughterPaymentFactorImage")]]})})})]})]})});mu.propTypes={data:j.PropTypes.any,barCode:j.PropTypes.any};const gu=({data:e})=>u.jsx(u.Fragment,{children:u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{children:u.jsx(s,{variant:"body1",fontWeight:"bold",children:"اطلاعات تایید نهایی بازرس"})})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsx(r,{container:!0,gap:a.SMALL,children:u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"وضعیت نهایی پرونده بررسی شده توسط بازرس در این مرحله نمایش داده شده است."})})})})]}),u.jsx(r,{container:!0,children:u.jsx(r,{xs:12,children:u.jsx(m,{columns:["نام بازرس","تاریخ ثبت","پیغام","وضعیت"],data:[[e.inspectorName,new Date(e.acceptRejectDate),e.message?e.message:"-",e.state==="accepted"?"تایید شده":"ابراز مشکل"]]})})})]})]})});gu.propTypes={data:j.PropTypes.any};const du=Yu("PROVINCE_CHECK_COMPLAINT",async e=>{const{data:c,status:F}=await Wu.post("check_losses/",e);return{data:c,status:F}}),vu=({item:e})=>{const[c,F]=f.useState(!1),[i]=xu(),{id:n}=hu(),[o]=f.useContext(Ku),A=eu(),C=Nu({initialValues:{rejectText:""},validationSchema:wu({rejectText:$u().required("این فیلد اجباری است!").typeError("لطفا دلیل خود را بیان کنید.")})});return f.useEffect(()=>{C.validateForm()},[]),u.jsx(u.Fragment,{children:u.jsx(r,{container:!0,children:u.jsx(r,{xs:12,children:u.jsx(r,{xs:12,children:e.complaint.state==="pending"&&u.jsx(r,{container:!0,gap:a.SMALL,padding:a.SMALL,children:u.jsx(u6,{children:c?u.jsx(Ru.div,{animate:{x:-10,opacity:1},transition:{duration:.3},initial:{opacity:0},exit:{opacity:0},children:u.jsxs(r,{flexDirection:"column",container:!0,gap:a.SMALL,children:[u.jsx(r,{children:u.jsx(Pu,{multiline:!0,rows:4,fullWidth:!0,id:"rejectText",label:"پیام خود را وارد کنید",variant:"outlined",value:C.values.rejectText,error:C.touched.rejectText?!!C.errors.rejectText:null,onChange:C.handleChange,onBlur:C.handleBlur,helperText:C.touched.rejectText&&C.errors.rejectText?C.errors.rejectText:null})}),u.jsxs(r,{container:!0,gap:a.SMALL,children:[u.jsx(r,{children:u.jsx(J,{variant:"outlined",color:"secondary",onClick:()=>{F(!1)},children:"لغو"})}),u.jsx(r,{children:u.jsx(J,{disabled:!C.isValid,variant:"outlined",onClick:()=>{A(Cu()),A(du({key:e.complaint.complaintKey,state:"rejected",role:T(),message:C.values.rejectText})).then(p=>{p.error?o({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(Au(i,n,A),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})),A(pu())})},children:"رد شکایت"})})]})]})}):u.jsxs(r,{container:!0,gap:a.SMALL,children:[u.jsx(J,{variant:"outlined",color:"secondary",onClick:()=>{F(!0)},children:"رد شکایت"}),u.jsx(J,{variant:"outlined",onClick:()=>{A(Cu()),A(du({key:e.complaint.complaintKey,state:"accepted",role:T()})).then(p=>{p.error?o({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(Au(i,n,A),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})),A(pu())})},children:"تایید شکایت"})]})})})})})})})};vu.propTypes={item:j.PropTypes.object};const Tu=({item:e})=>{var c,F,i,n,o,A,C,p,h,g,D,W,K,N,k,L,I,l,x,d,t,w,$;return u.jsxs(u.Fragment,{children:[u.jsx(r,{container:!0,children:u.jsx(r,{children:u.jsx(H,{variant:"body1",fontWeight:"bold",color:"secondary",children:"بررسی شکایت"})})}),u.jsxs(r,{container:!0,children:[u.jsx(m,{name:`تلفات برای این بار در تاریخ ${Fu((c=e.complaint)==null?void 0:c.createDate)} ثبت شده.`,columns:["عنوان","توضیحات","تاریخ ثبت","وضعیت","درصد تلفات","تلفات عرف","وزن واقعی","وزن با احتساب تلفات","پیوست تصویر"],data:[[(F=e.complaint)==null?void 0:F.title,(i=e.complaint)!=null&&i.description?(n=e.complaint)==null?void 0:n.description:"بدون توضیحات",Y(new Date((o=e.complaint)==null?void 0:o.createDate),"yyyy/MM/dd"),((A=e.complaint)==null?void 0:A.state)==="pending"?"در حال بررسی":((C=e.complaint)==null?void 0:C.state)==="accepted"?"تایید شده":"رد شده",(p=e.complaint)==null?void 0:p.percent,(h=e.complaint)==null?void 0:h.percentageLosses,(g=e.complaint)==null?void 0:g.realWeight,((D=e.complaint)==null?void 0:D.lossesWeight)!==0?(W=e.complaint)==null?void 0:W.lossesWeight:"تلفات بررسی نشده است",(N=(K=e.complaint)==null?void 0:K.image)!=null&&N.length?(L=(k=e.complaint)==null?void 0:k.image)==null?void 0:L.map((v,R)=>[u.jsx(r,{display:"inline-flex",children:u.jsx("a",{href:v,alt:"دانلود",children:u.jsx("img",{src:v,width:"80",height:"80",alt:"دانلود",style:{marginRight:"10px",borderRadius:"5px"}})})},`SlaughterPaymentFactorImage${R}`)]):"بدون پیوست"]]}),((I=e==null?void 0:e.complaint)==null?void 0:I.reviewer)&&u.jsxs(s,{mt:a.TINY,variant:"body2",color:v=>v.palette.grey.A700,children:[`تلفات در تاریخ ${Fu((x=(l=e==null?void 0:e.complaint)==null?void 0:l.reviewer)==null?void 0:x.createDate)} توسط ${(t=(d=e==null?void 0:e.complaint)==null?void 0:d.reviewer)==null?void 0:t.operatorname} `,(($=(w=e==null?void 0:e.complaint)==null?void 0:w.reviewer)==null?void 0:$.state)==="accepted"?"تایید ":"رد ","شده است."]})]})]})};Tu.propTypes={item:j.PropTypes.object};const e6=()=>{var g,D,W,K,N,k,L,I;const e=qu(),c=eu(),{id:F}=hu(),i=_u(F),[n]=xu(),o=(g=i==null?void 0:i.file)==null?void 0:g.process,{quantity:A,provinceAssignments:C}=Gu((D=o==null?void 0:o.poultry)==null?void 0:D.poultryRequestKey);f.useEffect(()=>{c(Ou())},[]);const p=o==null?void 0:o.provinceKillRequests;f.useEffect(()=>()=>{c(Uu())},[]);const h=o==null?void 0:o.filePaymentType;return u.jsx(u.Fragment,{children:o&&u.jsx(Hu,{mt:a.MEDIUM,display:"flex",justifyContent:"center",children:u.jsxs(r,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsx(r,{container:!0,justifyContent:"space-between",mb:a.SMALL,children:u.jsx(r,{container:!0,alignItems:"center",children:u.jsxs(ku,{"aria-label":"delete",color:"primary",onClick:()=>e(-1),children:[u.jsx(Zu,{}),u.jsx(s,{children:"بازگشت"})]})})}),u.jsxs(Lu,{children:[u.jsx(r,{container:!0,px:a.SMALL,gap:a.TINY,justifyContent:"space-between",direction:"column",children:u.jsxs(r,{container:!0,direction:"column",children:[u.jsx(r,{container:!0,children:u.jsxs(s,{variant:"h6",children:["مشخصات پرونده با کد سفارش",(W=o==null?void 0:o.poultry)==null?void 0:W.poultryOrderCode]})}),u.jsxs(r,{container:!0,gap:a.TINY,children:[u.jsx(r,{children:(K=o==null?void 0:o.poultry)!=null&&K.poultryAuction?u.jsx(s,{variant:"body2",color:"secondary",children:"(فروش از طریق مزایده)"}):u.jsx(s,{variant:"body2",color:"secondary",children:"(فروش از طریق اتحادیه)"})}),u.jsxs(r,{children:[h==="cash"&&u.jsx(s,{variant:"body2",color:l=>l.palette.warning.dark,children:"(فروش نقدی)"}),h==="credit"&&u.jsx(s,{variant:"body2",color:l=>l.palette.warning.dark,children:"(فروش زمان دار - تا یک ماه)"}),h==="cash_credit"&&u.jsx(s,{variant:"body2",color:l=>l.palette.warning.dark,children:"(فروش بصورت نقدی و زمان دار)"})]})]})]})}),u.jsxs(Iu,{sx:{gap:a.MEDIUM,[`& .${Mu.root}`]:{}},children:[u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",width:"100%",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{children:u.jsx(s,{variant:"body1",fontWeight:"bold",children:"مشخصات درخواست"})})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsxs(r,{container:!0,gap:a.SMALL,children:[u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"درخواست در تاریخ"}),u.jsx(s,{variant:"body2",fontWeight:"bold",children:U((N=o==null?void 0:o.poultry)==null?void 0:N.poultryRegisterDate)}),u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"ثبت شده است."})]})})})]}),u.jsx(Bu,{file:o})]})]}),u.jsx(ju,{file:o}),!o.auctionsList&&!o.killHouseWinner&&(o==null?void 0:o.city)&&o.city.cityState==="accept"&&u.jsx(yu,{quantity:A,file:o}),!o.killHouseWinner&&C&&!!(p!=null&&p.length)&&(C==null?void 0:C.map((l,x)=>u.jsx(r,{children:u.jsx(r,{children:u.jsx(fu,{item:l,i:x})})},"ProvinceAllocationInformation"+x))),!o.killHouseWinner&&(p==null?void 0:p.map(l=>{const{killHouseRequests:x}=l;return x==null?void 0:x.filter(t=>t.barInfo!==null).map((t,w)=>{var R,q,B,_,G,Q;const $=t.barInfo&&t.provinceFactorToKillHouse&&(!t.killHouseFactorToProvince||t.killHouseFactorToProvince.factorState==="rejected")||t.provinceFactorToKillHouseForPoultry&&!t.killHouseFactorToPoultry||((R=t.killHouseFactorToPoultry)==null?void 0:R.factorState)==="rejected",v=[[t.barcod,`${t.killHouseName} (${t.killHouseUserProvince}/${t.killHouseUserCity})`,t.quantity+" قطعه",((q=t.car)==null?void 0:q.driverName)+` (${(B=t.car)==null?void 0:B.driverMobile})`,`${(_=t.car)==null?void 0:_.typeCar} با پلاک ${(G=t.car)==null?void 0:G.pelak}`,t.barInfo.killHouseNetWeight+" کیلوگرم",t.fee+" ریال",u.jsx("a",{href:t.barInfo.killHouseImageWithoutLoad,alt:"دانلود سند خودرو بدون بار",children:u.jsx("img",{src:t.barInfo.killHouseImageWithoutLoad,width:"100",height:"100",alt:"بدون بار",className:"images-file"})},"provinceKillRequests"),u.jsx("a",{href:t.barInfo.killHouseImageWithLoad,alt:"دانلود سند خودرو با بار",children:u.jsx("img",{src:t.barInfo.killHouseImageWithLoad,width:"100",height:"100",alt:"بدون بار",className:"images-file"},"provinceKillRequests")},"provinceKillRequests")]];return u.jsxs(r,{children:[u.jsx(X,{item:v,data:t,auction:!1}),t.complaint&&u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{color:"secondary"}),u.jsx(P,{})]}),u.jsx(r,{xs:12,children:u.jsx(Tu,{item:t})})]}),(T()==="ProvinceFinancial"||T()==="ProvinceInspector")&&((Q=t.complaint)==null?void 0:Q.state)==="pending"&&u.jsx(vu,{item:t}),(T()==="KillHouse"||T()==="ProvinceFinancial")&&(n.includes("KillHouse")||n.includes("ProvinceFinancial"))&&$&&u.jsx(u.Fragment,{})]},"killHouseRequests"+w)})})),o.killHouseWinner&&((k=o.auction)==null?void 0:k.filter(l=>l.barInfo!==null).map((l,x)=>u.jsxs(r,{children:[u.jsx(X,{data:l,auction:!0}),T()==="ProvinceFinancial"&&n.includes("ProvinceFinancial")&&!l.provinceFactorToKillHouse&&u.jsx(Vu,{item:l})]},"killHouseRequests"+x))),o.killHouseWinner&&o.auction&&((L=o.auction)==null?void 0:L.filter(l=>l.barInfo&&!l.killHouseFactorToProvince&&l.provinceFactorToKillHouse).map((l,x)=>{var d,t;return u.jsxs(u.Fragment,{children:[u.jsx(X,{data:l,auction:!0}),T()==="KillHouse"&&n.includes("KillHouse")&&u.jsx(Xu,{factorKey:(d=l.provinceFactorToKillHouse)==null?void 0:d.provinceFactorKey,price:(t=l.provinceFactorToKillHouse)==null?void 0:t.cost,provinceFactorToKillHouse:l.provinceFactorToKillHouse},`SlaughterPayProvinceFactorForm${x}`)]})})),p==null?void 0:p.map(l=>{const{killHouseRequests:x}=l;return x==null?void 0:x.filter(d=>d.barInfo&&(d.killHouseFactorToProvince||d.killHouseFactorToPoultry)).map((d,t)=>u.jsxs(u.Fragment,{children:[(d==null?void 0:d.killHouseFactorToProvince)&&u.jsx(uu,{data:d.killHouseFactorToProvince,barCode:d.barcod},`SlaughterPaymentFactor${t}`),(d==null?void 0:d.killHouseFactorToPoultry)&&u.jsx(mu,{data:d.killHouseFactorToPoultry,barCode:d.barcod},`SlaughterPaymentFactor${t}`)]}))}),o.killHouseWinner&&((I=o.auction)==null?void 0:I.filter(l=>l.barInfo&&l.killHouseFactorToProvince).map((l,x)=>u.jsx(u.Fragment,{children:u.jsx(uu,{data:l.killHouseFactorToProvince,barCode:l.barcod},`SlaughterPaymentFactor${x}`)}))),o.allocation&&u.jsx(r,{xs:12,children:u.jsx(Ju,{process:o})}),o.provinceIncpector.acceptRejectDate&&u.jsx(gu,{data:o.provinceIncpector})]})]})]})})})};e6.propTypes={id:j.PropTypes.number};export{e6 as default}; diff --git a/build/assets/NumberFormatCustom-DwWPj40N.js b/build/assets/NumberFormatCustom-DwWPj40N.js new file mode 100644 index 0000000..ead14e3 --- /dev/null +++ b/build/assets/NumberFormatCustom-DwWPj40N.js @@ -0,0 +1,9 @@ +import{j as Be,ak as _e,bs as de}from"./mui-vendor-CkIVaoQP.js";import{r as F,b as re}from"./react-vendor-CmFgShSM.js";function xe(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a=g?a=a+ge("0",f-g):a=(a.substring(0,f)||"0")+"."+a.substring(f),t+a}function me(e,r,t){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||t)&&r,a=se(e),i=a.beforeDecimal,f=a.afterDecimal,g=a.hasNegation,V=parseFloat("0."+(f||"0")),y=f.length<=r?"0."+f:V.toFixed(r),S=y.split("."),m=i;i&&Number(S[0])&&(m=i.split("").reverse().reduce(function(I,C,d){return I.length>d?(Number(I[0])+Number(C)).toString()+I.substring(1,I.length):C+I},S[0]));var h=ye(S[1]||"",r,t),x=g?"-":"",v=n?".":"";return""+x+m+v+h}function H(e,r){if(e.value=e.value,e!==null){if(e.createTextRange){var t=e.createTextRange();return t.move("character",r),t.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(r,r),!0):(e.focus(),!1)}}var we=Oe(function(e,r){for(var t=0,n=0,a=e.length,i=r.length;e[t]===r[t]&&tt&&a-n>t;)n++;return{from:{start:t,end:a-n},to:{start:t,end:i-n}}}),Pe=function(e,r){var t=Math.min(e.selectionStart,r);return{from:{start:t,end:e.selectionEnd},to:{start:t,end:r}}};function Ke(e,r,t){return Math.min(Math.max(e,r),t)}function ve(e){return Math.max(e.selectionStart,e.selectionEnd)}function Ue(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function We(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function $e(e){var r=e.currentValue,t=e.formattedValue,n=e.currentValueIndex,a=e.formattedValueIndex;return r[n]===t[a]}function Ge(e,r,t,n,a,i,f){f===void 0&&(f=$e);var g=a.findIndex(function(k){return k}),V=e.slice(0,g);!r&&!t.startsWith(V)&&(r=V,t=V+t,n=n+V.length);for(var y=t.length,S=e.length,m={},h=new Array(y),x=0;x0&&h[d]===-1;)d--;var _=d===-1||h[d]===-1?0:h[d]+1;return _>B?B:n-_=0&&!t[r];)r--;r===-1&&(r=t.indexOf(!0))}else{for(;r<=a&&!t[r];)r++;r>a&&(r=t.lastIndexOf(!0))}return r===-1&&(r=a),r}function qe(e){for(var r=Array.from({length:e.length+1}).map(function(){return!0}),t=0,n=r.length;tP.length-f.length||zM||m>e.length-f.length)&&(U=m),e=e.substring(0,U),e=Je(_?"-"+e:e,a),e=(e.match(Qe(v))||[]).join("");var W=e.indexOf(v);e=e.replace(new RegExp(Ve(v),"g"),function(l,w){return w===W?".":""});var $=se(e,a),J=$.beforeDecimal,Y=$.afterDecimal,c=$.addNegation;return y.end-y.startR?!1:A>=ee.start&&A{const{format:r,removeFormatting:t,...n}=tr(e),a=f=>r(f);delete n.onChange;const i=f=>{const g=f.toLowerCase().replace(/[ ,]/g,"");return t(g)};return Be.jsx(He,{customInput:_e,removeFormatting:i,format:a,...n,onValueChange:f=>{e.onChange({target:{name:e.id,value:f.floatValue}})}})};ar.propTypes={id:de.any.isRequired,onChange:de.func.isRequired};export{ar as N}; diff --git a/build/assets/OperatorNewHatching-Dh3A7QxF.js b/build/assets/OperatorNewHatching-Dh3A7QxF.js new file mode 100644 index 0000000..270df73 --- /dev/null +++ b/build/assets/OperatorNewHatching-Dh3A7QxF.js @@ -0,0 +1,2 @@ +import{j as u,T as _u,ak as M,B as $,d as bu,ao as e6,ap as t6,aq as a6,a3 as w,ag as Tu,av as ku,aw as wu,ax as B,ai as Vu,aX as Wu,I as qu,b2 as Ou,b3 as V,aJ as s6,b as n6}from"./mui-vendor-CkIVaoQP.js";import{A as Fu,v as R,Y as r6,Z as Hu,p as Yu,_ as zu,V as l6,G as o,S as E,W,j as z,X as D,N as Lu,L as G,h as X,$ as c6,u as o6,c as Ku,c2 as i6,M as Du,b as C6,c3 as d6,aZ as A6,c4 as $u,a9 as Ru,c5 as h6,c6 as Gu,c7 as Xu,c8 as Zu,c9 as x6,ca as g6,cb as p6,cc as F6,cd as j6,ce as f6,cf as v6,cg as E6,ch as S6,ci as y6,cj as D6,ck as _6,cl as I6}from"./index-CeyyVc1v.js";import{f as Ju,r as c,j as b6}from"./react-vendor-CmFgShSM.js";import{f as Iu,u as ju,a as L6}from"./redux-vendor-B7uoacJt.js";import{C as N6}from"./CityNewKillRequest-C2SXYvKb.js";import{h as T6}from"./hour-limit-get-kill-request-HFzpgBg7.js";import{R as Qu,a as mu}from"./index.esm-Bu7XMDZU.js";import{d as k6,P as w6}from"./delete-debtor-killhouses-DJCuTTOS.js";import{R as uu}from"./ResponsiveTable-w7hk7Uq8.js";import{d as R6}from"./Delete-C5MyLelE.js";import{s as M6,a as $6}from"./slaughter-new-request-CTd5pQEl.js";import{D as O6}from"./DialogAlert-BfXcr-Kr.js";import{d as Y6}from"./Done-Dp5awdte.js";import{N as P6}from"./NumberFormatCustom-DwWPj40N.js";import{C as Bu}from"./CityManageHatchings-vNwIRT4N.js";import{A as U6}from"./AdvancedTable-BYmmBtmq.js";import{A as H6}from"./AvicultureNewRequest-C3L5QRVn.js";import{B as u6}from"./BackButton-Crzr7NMa.js";import{P as K6,N as B6,a as V6,b as W6,n as q6}from"./NationalInfoTransports-Bzg92cmL.js";import"./Search-Dek2fED1.js";import"./Add--yVWBJhC.js";import"./aviculture-get-unions-C1NoVg85.js";import"./aviculture-get-hatching-data-DsjDNd82.js";import"./SimpleTable-DBAoNnCU.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./province-get-sell-for-freezing-status-ieuVFEgW.js";import"./province-policy-market-daily-limitation-DueqDboR.js";import"./isValidIndexWeight-C_ik-uYa.js";import"./LabelField-B6eRSoQP.js";import"./iconBase-BEJYyZsk.js";import"./Tune-D4M2CAhp.js";import"./Plagiarism-BiXORbzo.js";import"./Edit-CqBj1Y2L.js";import"./VpnKey-Di_7HUWD.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./CityHatchingInfo-CZPJ_c_O.js";import"./CityHatchingsArchiveOperations-DQ9mbEeF.js";import"./FileUploader-DT5gIVb3.js";import"./CloudUpload-BlIgB_r9.js";import"./CheckCircle-zgBvZQ-b.js";import"./index-9Ymn_7Kv.js";import"./Sms-DasNClAG.js";import"./ShowImage-CqhU2hmk.js";import"./Download-DQ-VVIaV.js";import"./ToggleOffOutlined-Ch26Umk7.js";import"./ToggleOn-pBgb8alR.js";import"./ProvinceBarDifference-CBv5I_nz.js";import"./toBase64-BzgTOHsW.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./resizeImage-Csf2MO3w.js";import"./getProvinceName-BujSmyBy.js";import"./Article-DcCZ1D5y.js";import"./SelectCheck-CAe89SYT.js";import"./getSamasatProvinces-BvJGUILK.js";import"./Visibility-DeyjG-oI.js";import"./ChechClearanceCode-lPasOZZ_.js";import"./Pageview-TRcW_9jm.js";import"./AddCircleOutline-C8LXM-k8.js";const z6=()=>{var tu,au,A,t,m,su;const n=Iu(r=>r.userSlice.authToken),{poultryRequestsTotalQuantity:s}=Iu(r=>r.citySlice),{pathname:x}=Ju(),d=ju(),[h,S]=c.useState(!1),[j,O]=c.useState(""),[C]=c.useContext(Fu),[p,y]=c.useState([]),[Y,a]=c.useState(0),[_,I]=c.useState(10),[g,l]=c.useState(""),[N,i]=c.useState(1),[F,f]=c.useState([]),Z=r=>{l(r.target.value)},v=async r=>{d(G());const e=await z.get(`Poultry_Request/?role=${D()}&today&date1=${L}&date2=${T}&search=filter&value=${g||""}&page=${r}&page_size=${_}`);d(X()),y(e.data.results),a(e.data.count)},J=r=>{v(r),i(r)},b=async r=>{r.preventDefault(),d(G());try{const e=await z.get(`Poultry_Request/?role=${D()}&today&date1=${L}&date2=${T}&search=filter&value=${g||""}`);y(e.data.results),a(e.data.count),d(X())}catch(e){console.error("Error fetching data:",e)}},[P,Q]=c.useState(R(new Date).format("YYYY-MM-DD")),[,,L,U,T,q]=c.useContext(Fu);c.useEffect(()=>{const r=R(new Date).format("YYYY-MM-DD");U(r),q(r)},[]);const fu=r=>{I(r),i(1)};c.useEffect(()=>{d(r6(P))},[P]),c.useEffect(()=>{d(T6()).then(r=>{var e,k,H,K;S((k=(e=r.payload.data)==null?void 0:e[0])==null?void 0:k.active),O((K=(H=r.payload.data)==null?void 0:H[0])==null?void 0:K.hour)}),d(k6())},[]),c.useEffect(()=>{h&&j&&d(Hu({hour:j,active:h})),!h&&j&&(O(null),d(Hu({hour:0,active:h})))},[j,h]);const vu="/"+window.location.pathname.split("/")[1]+"/file/",Eu=r=>{let e="";return r!=null&&r.market?e="پنل معاملات":r!=null&&r.directBuying?e="خرید مستقیم":r!=null&&r.union?e="خرید خارج از استان":e="اتحادیه",e};c.useEffect(()=>{const r=p==null?void 0:p.map((e,k)=>{var H,K,nu,ru,lu,cu,ou,iu,Cu,du,Au,hu,xu,gu,pu,Pu,Uu;return[N===1?k+1:k+_*(N-1)+1,u.jsx(w6,{fileUrl:vu,item:e,updateTable:eu},k),e.orderCode,yu(e),e!=null&&e.freezing?"انجماد":e!=null&&e.export?"صادرات":"عادی",Eu(e),zu(e==null?void 0:e.createDate)+` (${(H=e==null?void 0:e.registrar)==null?void 0:H.fullname} - ${l6((K=e==null?void 0:e.registrar)==null?void 0:K.role)})`,Yu(e==null?void 0:e.sendDate),`${(nu=e==null?void 0:e.poultry)==null?void 0:nu.unitName} (${(lu=(ru=e==null?void 0:e.poultry)==null?void 0:ru.user)==null?void 0:lu.mobile})`,(cu=e==null?void 0:e.killHouseList)!=null&&cu.length?e==null?void 0:e.killHouseList.join(" - "):"ندارد",`${(Cu=(iu=(ou=e==null?void 0:e.poultry)==null?void 0:ou.address)==null?void 0:iu.city)==null?void 0:Cu.name}/${(du=e==null?void 0:e.poultry)!=null&&du.cityOperator?(Au=e==null?void 0:e.poultry)==null?void 0:Au.cityOperator:"بدون تعاونی"}`,e==null?void 0:e.killingAge,e==null?void 0:e.IndexWeight,(xu=(hu=e==null?void 0:e.hatching)==null?void 0:hu.totalWeight)==null?void 0:xu.toLocaleString(),e==null?void 0:e.firstQuantity.toLocaleString(),(e==null?void 0:e.amount.toLocaleString())+" ﷼",(pu=(gu=e==null?void 0:e.hatching)==null?void 0:gu.leftOver)==null?void 0:pu.toLocaleString(),(Pu=e.quantity)==null?void 0:Pu.toLocaleString(),(e.quantity-(e==null?void 0:e.remainQuantity)).toLocaleString(),(Uu=e==null?void 0:e.remainQuantity)==null?void 0:Uu.toLocaleString(),u.jsx(_u,{variant:"body2",sx:{color:e.hatching.fileState==="confirmation_code_pending"?"red":"black"},children:e.hatching.fileState==="province_state_pending"?"در انتظار تایید":e.hatching.fileState==="allocated_pending"?"آماده تخصیص":e.hatching.fileState==="confirmation_code_pending"?"در انتظار ورود کد احراز":"تخصیص داده شده"},k)]});f(r)},[p]),c.useEffect(()=>{v(1)},[L,T,_]);const eu=()=>{v(1)},Su=u.jsx(o,{container:!0,alignItems:"center",mb:E.SMALL,gap:E.SMALL,justifyContent:"center",children:u.jsx("form",{onSubmit:b,children:u.jsxs(o,{container:!0,alignItems:"center",gap:E.SMALL,children:[u.jsx(M,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:Z}),u.jsx($,{type:"submit",onClick:b,endIcon:u.jsx(Qu,{}),children:"جستجو"}),u.jsx(o,{children:u.jsx(W,{label:"از تاریخ",id:"date",renderInput:r=>u.jsx(M,{style:{width:"160px"},...r}),value:L,onChange:r=>{U(R(r).format("YYYY-MM-DD"))}})}),u.jsx(o,{children:u.jsx(W,{label:"تا تاریخ",id:"date",renderInput:r=>u.jsx(M,{style:{width:"160px"},...r}),value:T,onChange:r=>{q(R(r).format("YYYY-MM-DD"))}})}),u.jsx(bu,{title:"خروجی اکسل",children:u.jsx($,{color:"success",onClick:()=>{C({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const r=`${z.defaults.baseURL}poultry_kill_request_excel/?start=${L}&end=${T}&role=${D()}&token=${n}`;window.location.href=r},children:u.jsx(mu,{size:32})})})]})})}),yu=r=>{let e="";return r!=null&&r.freeSaleInProvince?e="آزاد":e="دولتی",e};return u.jsx(o,{container:!0,children:u.jsxs(o,{container:!0,alignItems:"center",justifyContent:"space-between",gap:4,xs:12,children:[u.jsx(o,{children:x!=="/vet-supervisor/hatching"&&u.jsx($,{className:"avicultureNewRequestBtn",variant:"contained",onClick:()=>{d(Lu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت درخواست کشتار جدید",content:u.jsx(N6,{updateTable:eu})}))},children:"ثبت درخواست کشتار جدید"})}),u.jsxs(o,{container:!0,children:[u.jsx(o,{my:E.SMALL,children:u.jsxs(o,{mb:2,container:!0,alignItems:"center",gap:E.SMALL,children:[u.jsx(o,{children:u.jsx(_u,{children:"اطلاعات کشتار"})}),u.jsx(o,{children:u.jsx(W,{label:"تاریخ",id:"date",renderInput:r=>u.jsx(M,{style:{width:"160px"},...r}),value:P,onChange:r=>{Q(R(r).format("YYYY-MM-DD"))}})})]})}),u.jsx(o,{xs:12,mb:2,isDashboard:!0,children:u.jsx(uu,{isDashboard:!0,noPagination:!0,title:"خلاصه اطلاعات",columns:["درخواست های کشتار صادر شده","درخواست های کشتار تایید شده","درخواست های رد شده","درخواست خریداران","درخواست های خرید مستقیم","مانده در سالن (جوجه ریزی 45 تا 65 روز)"],data:[[s!=null&&s.firstQuantity?((tu=s==null?void 0:s.firstQuantity)==null?void 0:tu.toLocaleString())+" قطعه":0,s!=null&&s.acceptedQuantity?((au=s==null?void 0:s.acceptedQuantity)==null?void 0:au.toLocaleString())+" قطعه":0,s!=null&&s.rejectedQuantity?((A=s==null?void 0:s.rejectedQuantity)==null?void 0:A.toLocaleString())+" قطعه":0,s!=null&&s.killRequestsQuantity?((t=s==null?void 0:s.killRequestsQuantity)==null?void 0:t.toLocaleString())+" قطعه":0,s!=null&&s.directBuyingQuantity?((m=s==null?void 0:s.directBuyingQuantity)==null?void 0:m.toLocaleString())+" قطعه":0,s!=null&&s.ageUp45?((su=s==null?void 0:s.ageUp45)==null?void 0:su.toLocaleString())+" قطعه":0]]})}),u.jsxs(o,{mt:2,children:[Su,u.jsx(uu,{data:F,columns:["ردیف","عملیات","کدسفارش","فروش","کشتار","درخواست","تاریخ ثبت درخواست","تاریخ کشتار","مرغدار","کشتارگاه های پیشنهادی","شهر/تعاونی","سن مرغ","میانگین وزنی","وزن تقریبی","حجم درخواست کشتار","قیمت مرغدار","مانده در سالن","تایید شده","تخصیص داده شده","مانده قابل تخصیص","وضعیت"],handlePageChange:J,totalRows:Y,page:N,perPage:_,handlePerRowsChange:fu,title:"اطلاعات کشتار"})]})]})]})})},G6=()=>{const[n,,s,,x,,]=c.useContext(Fu),d=ju(),[,h]=c6(),{inspectorGetKillHouses:S}=Iu(i=>i.inspectorSlice),[j,O]=c.useState([]),[C,p]=c.useState([]),[y,Y]=c.useState(!1);c.useEffect(()=>{const i=S==null?void 0:S.map(F=>({name:F.name,key:F.key,killer:F.killer}));O(i)},[S]),c.useEffect(()=>{var i;if(y==="true"){const F=(i=S==null?void 0:S.filter(f=>f.killer===!1))==null?void 0:i.map(f=>({name:f.name,key:f.key,killer:f.killer}));p(F)}},[S,y]);const a=o6({initialValues:{capacity:"",recieveTime:"",selectedKillhouse:"",selectedKillerKillhouse:"",race:"",sellType:{cash:!0,haveTime:!1},weightType:{under2AndHalf:!1,over2AndHalf:!1},recieveDate:R(Date()).format("YYYY-MM-DD hh:mm:ss"),isAccepted:D()!=="KillHouse",indexWeight:""},validationSchema:Ku({capacity:C6().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),selectedKillhouse:Du().required("این فیلد اجباری است!"),selectedKillerKillhouse:y==="true"?Du().required("این فیلد اجباری است!"):Du(),recieveTime:Du().required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!"),sellType:Ku().test("sellType","نحوه فروش را انتخاب کنید!",(i,F)=>F.originalValue&&Object.values(F.originalValue).some(f=>f===!0)).required("این فیلد اجباری است!"),isAccepted:i6().test("req","باید تعهد نامه را بپذیرید!",(i,F)=>F.originalValue&&F.originalValue===!0).required("این فیلد اجباری است!")})}),_=a.values.capacity*1e3,I=u.jsxs(u.Fragment,{children:[u.jsxs(_u,{variant:"body1",children:["اینجانب ",h==null?void 0:h.fullname," موافقت خود را نسبت به موارد ذکر شده اعلام می نمایم."]}),u.jsxs(e6,{children:[u.jsx(t6,{children:u.jsx(Y6,{})}),u.jsx(a6,{primary:`بر اساس این توافق نامه در صورت لغو کشتار ${a.values.capacity} قطعه + مرغ ${_} ریال جریمه خواهم شد.`})]})]});c.useEffect(()=>{d(d6()),a.validateForm()},[]);const[g,l]=c.useState(!0),N=i=>{l(i.target.checked)};return c.useEffect(()=>{d(A6())},[]),u.jsx(u.Fragment,{children:u.jsxs(w,{className:"slaughter-new-request-form",container:!0,gap:E.SMALL,direction:"column",flex:"1",justifyContent:"space-between",children:[u.jsx(w,{container:!0,style:{width:"300px"},justifyContent:"center"}),u.jsxs(w,{container:!0,direction:"column",gap:E.SMALL,children:[u.jsxs(Tu,{fullWidth:!0,error:a.errors.selectedOption&&a.touched.selectedOption,children:[u.jsx(ku,{children:"انتخاب کشتارگاه یا کشتارکن"}),u.jsx(wu,{label:"انتخاب کشتارگاه یا کشتارکن",id:"selectedKillhouse",name:"selectedKillhouse",onChange:i=>{const[F,f]=i.target.value.split("#");a.setFieldValue("selectedKillhouse",F),Y(f)},onBlur:a.handleBlur,children:j==null?void 0:j.map(i=>u.jsx(B,{value:`${i.key+"#"+i.killer}`,children:i.killer?`کشتارکن ${i.name}`:`کشتارگاه ${i.name}`},i))}),a.errors.selectedKillhouse&&a.touched.selectedKillhouse&&u.jsx("div",{children:a.errors.selectedKillhouse})]}),y==="true"&&u.jsxs(Tu,{fullWidth:!0,error:a.errors.selectedKillerKillhouse&&a.touched.selectedKillerKillhouse,children:[u.jsx(ku,{children:"محل کشتار را انتخاب کنید"}),u.jsx(wu,{label:"محل کشتار را انتخاب کنید",id:"selectedKillerKillhouse",name:"selectedKillerKillhouse",value:a.values.selectedKillerKillhouse,onChange:a.handleChange,onBlur:a.handleBlur,children:C==null?void 0:C.map(i=>u.jsx(B,{value:i.key,children:i.name},i))}),a.errors.selectedKillerKillhouse&&a.touched.selectedKillerKillhouse&&u.jsx("div",{children:a.errors.selectedKillerKillhouse})]}),u.jsx(w,{children:u.jsx(P6,{allowLeadingZeros:!0,thousandSeparator:",",id:"capacity",fullWidth:!0,label:"حجم کشتار را در روز به قطعه وارد کنید",variant:"outlined",value:a.values.capacity,error:a.touched.capacity?!!a.errors.capacity:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.capacity&&a.errors.capacity?a.errors.capacity:null})}),u.jsx(w,{children:u.jsxs(Tu,{fullWidth:!0,sx:{minWidth:210},children:[u.jsx(ku,{children:"بازه زمانی دریافت مرغ مرغدار"}),u.jsxs(wu,{id:"recieveTime",value:a.values.recieveTime,label:"بازه زمانی دریافت مرغ مرغدار",onChange:i=>{a.setFieldValue("recieveTime",i.target.value)},children:[u.jsx(B,{value:"12 - 14",children:"12 - 14"}),u.jsx(B,{value:"14 - 16",children:"14 - 16"}),u.jsx(B,{value:"16 - 18",children:"16 - 18"}),u.jsx(B,{value:"18 - 20",children:"18 - 20"}),u.jsx(B,{value:"20 - 22",children:"20 - 22"}),u.jsx(B,{value:"22 - 24",children:"22 - 24"})]})]})}),u.jsx(w,{children:u.jsx(W,{label:"تاریخ کشتار",id:"recieveDate",renderInput:i=>u.jsx(M,{...i}),value:a.values.recieveDate,error:a.touched.recieveDate?!!a.errors.recieveDate:null,onChange:i=>{a.setFieldValue("recieveDate",R(i).format("YYYY-MM-DD hh:mm:ss"))},onBlur:a.handleBlur,helperText:a.touched.recieveDate&&a.errors.recieveDate?a.errors.recieveDate:null})})]}),u.jsxs(w,{children:[D()==="KillHouse"&&u.jsx(O6,{title:"تعهد نامه",content:I,actions:u.jsxs(w,{container:!0,justifyContent:"end",gap:E.TINY,children:[u.jsx($,{variant:"outlined",color:"error",onClick:()=>{a.setFieldValue("isAccepted",!1)},children:"رد"}),u.jsx($,{variant:"contained",color:"success",onClick:()=>{a.setFieldValue("isAccepted",!0)},children:"موافقم"})]}),btnTitle:"با تعهد نامه موافق هستم!",isAccepted:a.values.isAccepted}),u.jsx(w,{children:u.jsx(Vu,{style:{fontSize:"10px"},control:u.jsx(Wu,{checked:g,onChange:N}),label:u.jsx(bu,{title:"5000 تومان",arrow:!0,children:u.jsx(_u,{variant:"caption",children:"مایل به دریافت پیامک اطلاع رسانی هستم!"})})})})]}),u.jsx(w,{container:!0,mt:E.SMALL,justifyContent:"center",children:u.jsx($,{fullWidth:!0,variant:"contained",component:"label",disabled:!a.isValid,size:"large",onClick:()=>{d(G()),d(M6({kill_capacity:a.values.capacity,recive_time:a.values.recieveTime,recive_date:a.values.recieveDate,low_weight:a.values.weightType.under2AndHalf,high_weight:a.values.weightType.over2AndHalf,Index_weight:2.7,chicken_breed:"تعیین نشده",cash:a.values.sellType.cash,credit:a.values.sellType.haveTime,sms_payment:g,kill_house_key:a.values.selectedKillhouse,killer_kill_house_key:a.values.selectedKillerKillhouse?a.values.selectedKillerKillhouse:null,role:D()})).then(i=>{d($u({selectedDate1:s,selectedDate2:x})),d(X()),i.payload.error?n({vertical:"top",horizontal:"center",msg:i.payload.error,severity:"error"}):(n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),d(Lu({right:!1,bottom:!1,content:null})))})},children:"ثبت درخواست"})})]})})},X6=L6("PROVINCE_SLAUGHTER_REQUEST_DASHBOARD",async(n,{dispatch:s})=>{s(G());const{data:x,status:d}=await z.get("dashboard_kill_request",{params:{date1:n.selectedDate1,date2:n.selectedDate2,role:D()}});return s(X()),{data:x,status:d}}),Z6=()=>{var Y,a,_,I;const n=ju(),[s,,x,d,h,S]=c.useContext(Fu);c.useEffect(()=>{const g=Ru(new Date).format("YYYY-MM-DD");d(g),S(g)},[]);const{getSlaughtersKillRequest:j}=Iu(g=>g.citySlice),[O,C]=c.useState([]);c.useEffect(()=>{n($u({selectedDate1:x,selectedDate2:h}))},[x,h]),c.useEffect(()=>{const g=j==null?void 0:j.map((l,N)=>{var i,F,f,Z,v,J,b,P,Q,L,U,T;return[N+1,(i=l==null?void 0:l.killHouse)!=null&&i.killer?"کشتارکن":"کشتارگاه",`${(F=l==null?void 0:l.killHouse)==null?void 0:F.name} (${l.killHouse.killHouseOperator.user.mobile})`,(f=l==null?void 0:l.slaughterHouse)!=null&&f.name?(Z=l==null?void 0:l.slaughterHouse)==null?void 0:Z.name:"مکان کشتارگاه",l!=null&&l.killHouseVet?`${(b=(J=(v=l==null?void 0:l.killHouseVet)==null?void 0:v.vet)==null?void 0:J.user)==null?void 0:b.fullname} (${(L=(Q=(P=l==null?void 0:l.killHouseVet)==null?void 0:P.vet)==null?void 0:Q.user)==null?void 0:L.mobile})`:"-",zu(l==null?void 0:l.createDate),Yu(l==null?void 0:l.reciveDate),l==null?void 0:l.reciveTime,(U=l==null?void 0:l.killCapacity)==null?void 0:U.toLocaleString(),(T=l==null?void 0:l.remainQuantity)==null?void 0:T.toLocaleString(),((l==null?void 0:l.killCapacity)-(l==null?void 0:l.remainQuantity)).toLocaleString(),u.jsx(qu,{"aria-label":"delete",color:"error",onClick:()=>{n(G()),n($6({id:l.id})).then(q=>{n(X()),q.error?q.error.message.includes("403")?s({vertical:"top",horizontal:"center",msg:"این درخواست از سمت استان پذیرفته شده و قابل حذف نمی باشد!",severity:"error"}):s({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(n($u({selectedDate1:x,selectedDate2:h})),s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:u.jsx(R6,{})},N)]});C(g)},[j]);const[p,y]=c.useState([]);return c.useEffect(()=>{n(X6({selectedDate1:x,selectedDate2:h})).then(g=>{y(g.payload.data)})},[x,h]),u.jsxs(o,{container:!0,width:"100%",children:[u.jsx(o,{container:!0,justifyContent:"space-between",mb:E.MEDIUM,children:(D()==="ProvinceOperator"||D()==="SuperAdmin")&&u.jsx(o,{children:u.jsx($,{className:"new-request-form-button",variant:"contained",onClick:()=>{n(Lu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(G6,{}),title:"ثبت درخواست کشتار"}))},children:"ثبت درخواست کشتار جدید"})})}),u.jsxs(o,{container:!0,alignItems:"center",gap:1,xs:12,children:[u.jsx(o,{children:u.jsx(W,{label:"از تاریخ",id:"date",renderInput:g=>u.jsx(M,{style:{width:"160px"},...g}),value:x,onChange:g=>{d(Ru(g).format("YYYY-MM-DD"))}})}),u.jsx(o,{children:u.jsx(W,{label:"تا تاریخ",id:"date",renderInput:g=>u.jsx(M,{style:{width:"160px"},...g}),value:h,onChange:g=>{S(Ru(g).format("YYYY-MM-DD"))}})}),u.jsx(bu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${z.defaults.baseURL}kill_house_excel/?start=${x}&end=${h}`,rel:"noreferrer",children:u.jsx($,{color:"success",children:u.jsx(mu,{size:32})})})})]}),u.jsx(o,{container:!0,mt:2,mb:4,isDashboard:!0,xs:12,children:u.jsx(uu,{noPagination:!0,isDashboard:!0,columns:["تعداد درخواست ها","حجم درخواست ها","حجم تخصیص داده شده","حجم تخصیص داده نشده"],data:[[(Y=p==null?void 0:p.lenKillRequest)==null?void 0:Y.toLocaleString(),(a=p==null?void 0:p.quantity)==null?void 0:a.toLocaleString(),(_=p==null?void 0:p.remainQuantity)==null?void 0:_.toLocaleString(),(I=p==null?void 0:p.leftOver)==null?void 0:I.toLocaleString()]],title:"خلاصه اطلاعات"})}),u.jsx(uu,{paginated:!0,title:"اعلام نیاز خریداران و کشتارگاه ها",columns:["ردیف","ماهیت","خریدار","محل کشتار","دامپزشک کشتارگاه","تاریخ ایجاد درخواست","تاریخ کشتار","زمان دریافت","تعداد درخواست (قطعه)","مانده (قطعه)","تعداد تخصیص داده شده (قطعه)","حذف"],data:O})]})},J6=()=>{const[n,s]=c.useState(0),x=(d,h)=>{s(h)};return u.jsx(o,{container:!0,gap:E.MEDIUM,alignItems:"center",direction:"column",children:u.jsxs(u.Fragment,{children:[u.jsxs(Ou,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:n,onChange:x,children:[u.jsx(V,{label:"درخواست مرغدار"}),D()!=="CityPoultry"&&u.jsx(V,{label:"درخواست کشتارگاه"})]}),u.jsx(Mu,{value:n,index:2,children:u.jsx(Bu,{})}),u.jsx(Mu,{value:n,index:0,children:u.jsx(z6,{})}),u.jsx(Mu,{value:n,index:1,children:D()!=="CityPoultry"?u.jsx(Z6,{}):u.jsx(Bu,{})})]})})};function Mu(n){const{children:s,value:x,index:d}=n;return u.jsx("div",{role:"tabpanel",hidden:x!==d,children:x===d&&u.jsx(u.Fragment,{children:s})})}const Q6=["ردیف","کد سفارش","کدکاربری","تاریخ ثبت درخواست","تاریخ کشتار","مرغدار","تلفن مرغدار","شهر","استان","تاریخ جوجه ریزی","سن مرغ","تعداد","عملیات","مشاهده"],m6=()=>{const n=ju();return u.jsx(o,{container:!0,gap:E.MEDIUM,direction:"column",xs:12,children:u.jsx(o,{container:!0,gap:E.SMALL,justifyContent:{xs:"center",lg:"space-between"},alignSelf:"center",alignItems:"center",xs:12,direction:{xs:"column",lg:"row"},children:u.jsxs(o,{container:!0,xs:12,gap:E.SMALL,alignItems:"start",direction:"column",children:[u.jsx(o,{container:!0,width:"100%",justifyContent:"space-between",children:u.jsx($,{className:"avicultureNewRequestBtn",variant:"contained",onClick:()=>{n(Lu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"اطلاعات جوجه ریزی",content:u.jsx(H6,{})}))},children:"ثبت درخواست کشتار جدید"})}),u.jsx(o,{width:"100%",className:"avicultureActiveRequestsView",children:u.jsx(s6,{children:u.jsx(U6,{name:"درخواست های فعال کشتار",columns:Q6,data:[["sjsjsj"]]})})})]})})})},u0=()=>{const[n,s]=c.useState(0),x=(d,h)=>{s(h)};return u.jsxs(o,{container:!0,xs:12,justifyContent:"center",children:[u.jsx(o,{container:!0,xs:12,children:u.jsx(u6,{})}),u.jsx(o,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mt:2,children:u.jsxs(Ou,{value:n,onChange:x,"aria-label":"simple tabs example",children:[u.jsx(V,{label:"مدیریت فارم ها"}),u.jsx(V,{label:" جوجه ریزی ها"}),u.jsx(V,{label:" اطلاعات بار"}),u.jsx(V,{label:"پایش کشتارگاه ها"})]})}),u.jsxs(o,{mt:4,children:[n===0&&u.jsx(K6,{}),n===1&&u.jsx(B6,{}),n===2&&u.jsx(V6,{}),n===3&&u.jsx(W6,{})]})]})},e0=()=>{var Nu,vu,Eu,eu,Su,yu,tu,au;const[,,n,s,x,d]=c.useContext(Fu),h=ju();c.useEffect(()=>{const A=R(new Date).format("YYYY-MM-DD");s(A),d(A)},[]);const S=A=>{N(A.target.value)},{key:j,name:O}=b6(),[C,p]=c.useState([]),[y,Y]=c.useState([]),[a,_]=c.useState(0),[I,g]=c.useState(10),[l,N]=c.useState(""),[i,F]=c.useState(1),[f,Z]=c.useState([]),[v,J]=c.useState(!1),[b,P]=c.useState("0"),Q=(A,t)=>{P(t)},L=()=>{h(q6({date1:v?n:null,date2:v?x:null,search:l,system_code:j})).then(A=>{p(A.payload.data)})},U=async A=>{let t;h(G()),t=await z.get(`https://rsibackend.rasadyar.com/app/hatchings/?search=${l}${v?`&date1=${n}&date2=${x}`:""}&page=${A}&page_size=${I}&system_code=${j}&state=${b==="0"?"pending":"archive"}`),h(X()),L(),Y(t.data.results),_(t.data.count)},T=A=>{U(A),F(A)},q=A=>{g(A),F(1)};c.useEffect(()=>{const A=y==null?void 0:y.map((t,m)=>{var su,r,e,k,H,K,nu,ru,lu,cu,ou,iu,Cu,du,Au,hu;return[i===1?m+1:m+I*(i-1)+1,((su=t==null?void 0:t.poultry)==null?void 0:su.Province)||"-",((r=t==null?void 0:t.poultry)==null?void 0:r.City)||"-",(e=t==null?void 0:t.poultry)==null?void 0:e.UnitName,`${(k=t==null?void 0:t.poultry)==null?void 0:k.FirstName} ${((H=t==null?void 0:t.poultry)==null?void 0:H.LastName)||""}`,t==null?void 0:t.RequestCode,t==null?void 0:t.CertId,(K=t==null?void 0:t.CapacityFemale)==null?void 0:K.toLocaleString(),Yu(t==null?void 0:t.Date),Math.floor(t==null?void 0:t.Age),(nu=t==null?void 0:t.ChickCountSum)==null?void 0:nu.toLocaleString(),(ru=t==null?void 0:t.Period)==null?void 0:ru.toLocaleString(),(lu=t==null?void 0:t.Evacuation)==null?void 0:lu.toLocaleString(),(ou=(cu=t==null?void 0:t.info)==null?void 0:cu.percentHatchingLicense)==null?void 0:ou.toFixed(2),(iu=t==null?void 0:t.LeftOver)==null?void 0:iu.toLocaleString(),Math.floor(t==null?void 0:t.KillingAve),(du=(Cu=t==null?void 0:t.info)==null?void 0:Cu.numberLoads)==null?void 0:du.toLocaleString(),(hu=(Au=t==null?void 0:t.info)==null?void 0:Au.loadVolume)==null?void 0:hu.toLocaleString(),u.jsx(bu,{placement:"right",title:"باز شدن جزئیات در تب جدید",children:u.jsx(qu,{size:"small",color:"primary",onClick:()=>{var xu,gu,pu;return window.open(D()==="AdminX"?`${Gu}/${t.RequestCode}/${(xu=t==null?void 0:t.poultry)==null?void 0:xu.UnitName}`:D()==="SuperAdmin"?`${Xu}/${t.RequestCode}/${(gu=t==null?void 0:t.poultry)==null?void 0:gu.UnitName}`:`${Zu}/${t.RequestCode}/${(pu=t==null?void 0:t.poultry)==null?void 0:pu.UnitName}`,"_blank")},children:u.jsx(h6,{})})},m)]});Z(A)},[y]),c.useEffect(()=>{U(1)},[h,n,x,I,v,b]);const fu=async A=>{A.preventDefault(),h(G());try{const t=await z.get(`https://rsibackend.rasadyar.com/app/hatchings/?search=${l}${v?`&date1=${n}&date2=${x}`:""}&page=1&page_size=${I}&system_code=${j}&state=${b==="0"?"pending":"archive"}`);Y(t.data.results),_(t.data.count),h(X()),L()}catch(t){console.error("Error fetching data:",t)}};return u.jsxs(o,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(o,{container:!0,xs:12,children:u.jsx(u6,{})}),u.jsx(o,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:u.jsxs(Ou,{value:b,onChange:Q,children:[u.jsx(V,{value:"0",label:"فعال"}),u.jsx(V,{value:"1",label:"بایگانی شده"})]})}),u.jsxs(o,{container:!0,xs:12,alignItems:"center",gap:2,children:[u.jsx(o,{children:u.jsxs("form",{onSubmit:fu,children:[u.jsx(M,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:S}),u.jsx($,{type:"submit",onClick:fu,endIcon:u.jsx(Qu,{}),children:"جستجو"})]})}),u.jsxs(o,{container:!0,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},children:[u.jsx(o,{children:u.jsx(Vu,{control:u.jsx(Wu,{checked:v,onChange:()=>J(!v),color:"primary"})})}),u.jsx(o,{children:u.jsx(W,{disabled:!v,label:"از تاریخ",id:"date",renderInput:A=>u.jsx(M,{size:"small",style:{width:"160px"},...A}),value:n,onChange:A=>{s(R(A).format("YYYY-MM-DD"))}})}),u.jsx(o,{children:u.jsx(W,{disabled:!v,label:"تا تاریخ",id:"date",renderInput:A=>u.jsx(M,{size:"small",style:{width:"160px"},...A}),value:x,onChange:A=>{d(R(A).format("YYYY-MM-DD"))}})})]})]}),u.jsx(o,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(uu,{noPagination:!0,isDashboard:!0,columns:["تعداد دوره جوجه ریزی","حجم کل جوجه ریزی","تلفات","کشتار شده","میانگین سن کشتار","تعداد بارها","تعداد جوجه ریزی فعال","حجم جوجه ریزی فعال","کمترین سن","بیشترین سن","مانده در سالن"],data:[[(Nu=C==null?void 0:C.totalHatchingCount)==null?void 0:Nu.toLocaleString(),(vu=C==null?void 0:C.totalHatchingQuantity)==null?void 0:vu.toLocaleString(),(Eu=C==null?void 0:C.totalHatchingEvacuation)==null?void 0:Eu.toLocaleString(),(eu=C==null?void 0:C.totalActiveHatchingKillingQuantity)==null?void 0:eu.toLocaleString(),Math.floor(C==null?void 0:C.totalActiveHatchingKillingAge),(Su=C==null?void 0:C.totalActiveHatchingBars)==null?void 0:Su.toLocaleString(),(yu=C==null?void 0:C.totalActiveHatchingCount)==null?void 0:yu.toLocaleString(),(tu=C==null?void 0:C.totalActiveHatchingQuantity)==null?void 0:tu.toLocaleString(),Math.floor(C==null?void 0:C.leastAge),Math.floor(C==null?void 0:C.mostAge),(au=C==null?void 0:C.totalActiveHatchingLeftOver)==null?void 0:au.toLocaleString()]],title:"خلاصه اطلاعات"})}),u.jsx(uu,{data:f,columns:["ردیف","استان","شهرستان","نام واحد","نام مالک","شماره مجوز","شماره گواهی بهداشتی","ظرفیت","تاریخ جوجه ریزی","سن گله","تعداد جوجه ریزی","دوره جوجه ریزی","مجموع تلفات","درصد جوجه ریزی به مجوز","مانده در سالن","میانگین سن کشتار","تعداد بارها","حجم بارها","جزئیات"],handlePageChange:T,totalRows:a,page:i,perPage:I,handlePerRowsChange:q,title:b==="0"?`پایش فارم فعال ${O||""}`:`بایگانی فارم ${O||""}`})]})},ce=()=>{const{pathname:n}=Ju();return u.jsx(u.Fragment,{children:u.jsx(n6,{display:"flex",justifyContent:"center",children:u.jsx(o,{container:!0,direction:"column",justifyContent:"center",xs:11,sm:11,md:10,lg:10,children:u.jsx(o,{container:!0,justifyContent:"space-between",mt:E.MEDIUM,gap:E.SMALL,children:u.jsxs(o,{xs:12,children:[(n===x6||n===g6||n===p6||n===F6||n===j6||n===f6)&&u.jsx(J6,{}),(n===v6||n===E6||n===S6||n===y6)&&u.jsx(m6,{}),(n.includes(Gu)||n.includes(Xu)||n.includes(Zu))&&u.jsx(u0,{}),(n.includes(D6)||n.includes(_6)||n.includes(I6))&&u.jsx(e0,{})]})})})})})};export{ce as default}; diff --git a/build/assets/PageTable-C16Ol94B.js b/build/assets/PageTable-C16Ol94B.js new file mode 100644 index 0000000..4e83883 --- /dev/null +++ b/build/assets/PageTable-C16Ol94B.js @@ -0,0 +1,383 @@ +import{j as ie,T as rn,aA as sn}from"./mui-vendor-CkIVaoQP.js";import{r as n,b as w}from"./react-vendor-CmFgShSM.js";import{T as dn,c as j,s as b}from"./styled-components.browser.esm-gS9mh05b.js";import{G as Ne}from"./index-CeyyVc1v.js";var X;function se(e,t){return e[t]}function cn(e=[],t,o=0){return[...e.slice(0,o),t,...e.slice(o)]}function gn(e=[],t,o="id"){const a=e.slice(),l=se(t,o);return l?a.splice(a.findIndex(i=>se(i,o)===l),1):a.splice(a.findIndex(i=>i===t),1),a}function bt(e){return e.map((t,o)=>{const a=Object.assign(Object.assign({},t),{sortable:t.sortable||!!t.sortFunction||void 0});return t.id||(a.id=o+1),a})}function be(e,t){return Math.ceil(e/t)}function We(e,t){return Math.min(e,t)}(function(e){e.ASC="asc",e.DESC="desc"})(X||(X={}));const k=()=>null;function vt(e,t=[],o=[]){let a={},l=[...o];return t.length&&t.forEach(i=>{if(!i.when||typeof i.when!="function")throw new Error('"when" must be defined in the conditional style object and must be function');i.when(e)&&(a=i.style||{},i.classNames&&(l=[...l,...i.classNames]),typeof i.style=="function"&&(a=i.style(e)||{}))}),{conditionalStyle:a,classNames:l.join(" ")}}function Oe(e,t=[],o="id"){const a=se(e,o);return a?t.some(l=>se(l,o)===a):t.some(l=>l===e)}function Se(e,t){return t?e.findIndex(o=>me(o.id,t)):-1}function me(e,t){return e==t}function un(e,t){const o=!e.toggleOnSelectedRowsChange;switch(t.type){case"SELECT_ALL_ROWS":{const{keyField:a,rows:l,rowCount:i,mergeSelections:s}=t,d=!e.allSelected,u=!e.toggleOnSelectedRowsChange;if(s){const h=d?[...e.selectedRows,...l.filter(p=>!Oe(p,e.selectedRows,a))]:e.selectedRows.filter(p=>!Oe(p,l,a));return Object.assign(Object.assign({},e),{allSelected:d,selectedCount:h.length,selectedRows:h,toggleOnSelectedRowsChange:u})}return Object.assign(Object.assign({},e),{allSelected:d,selectedCount:d?i:0,selectedRows:d?l:[],toggleOnSelectedRowsChange:u})}case"SELECT_SINGLE_ROW":{const{keyField:a,row:l,isSelected:i,rowCount:s,singleSelect:d}=t;return d?i?Object.assign(Object.assign({},e),{selectedCount:0,allSelected:!1,selectedRows:[],toggleOnSelectedRowsChange:o}):Object.assign(Object.assign({},e),{selectedCount:1,allSelected:!1,selectedRows:[l],toggleOnSelectedRowsChange:o}):i?Object.assign(Object.assign({},e),{selectedCount:e.selectedRows.length>0?e.selectedRows.length-1:0,allSelected:!1,selectedRows:gn(e.selectedRows,l,a),toggleOnSelectedRowsChange:o}):Object.assign(Object.assign({},e),{selectedCount:e.selectedRows.length+1,allSelected:e.selectedRows.length+1===s,selectedRows:cn(e.selectedRows,l),toggleOnSelectedRowsChange:o})}case"SELECT_MULTIPLE_ROWS":{const{keyField:a,selectedRows:l,totalRows:i,mergeSelections:s}=t;if(s){const d=[...e.selectedRows,...l.filter(u=>!Oe(u,e.selectedRows,a))];return Object.assign(Object.assign({},e),{selectedCount:d.length,allSelected:!1,selectedRows:d,toggleOnSelectedRowsChange:o})}return Object.assign(Object.assign({},e),{selectedCount:l.length,allSelected:l.length===i,selectedRows:l,toggleOnSelectedRowsChange:o})}case"CLEAR_SELECTED_ROWS":{const{selectedRowsFlag:a}=t;return Object.assign(Object.assign({},e),{allSelected:!1,selectedCount:0,selectedRows:[],selectedRowsFlag:a})}case"SORT_CHANGE":{const{sortDirection:a,selectedColumn:l,clearSelectedOnSort:i}=t;return Object.assign(Object.assign(Object.assign({},e),{selectedColumn:l,sortDirection:a,currentPage:1}),i&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:o})}case"CHANGE_PAGE":{const{page:a,paginationServer:l,visibleOnly:i,persistSelectedOnPageChange:s}=t,d=l&&s,u=l&&!s||i;return Object.assign(Object.assign(Object.assign(Object.assign({},e),{currentPage:a}),d&&{allSelected:!1}),u&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:o})}case"CHANGE_ROWS_PER_PAGE":{const{rowsPerPage:a,page:l}=t;return Object.assign(Object.assign({},e),{currentPage:l,rowsPerPage:a})}}}const pn=j` + pointer-events: none; + opacity: 0.4; +`,bn=b.div` + position: relative; + box-sizing: border-box; + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + max-width: 100%; + ${({disabled:e})=>e&&pn}; + ${({theme:e})=>e.table.style}; +`,mn=j` + position: sticky; + position: -webkit-sticky; /* Safari */ + top: 0; + z-index: 1; +`,hn=b.div` + display: flex; + width: 100%; + ${({$fixedHeader:e})=>e&&mn}; + ${({theme:e})=>e.head.style}; +`,wn=b.div` + display: flex; + align-items: stretch; + width: 100%; + ${({theme:e})=>e.headRow.style}; + ${({$dense:e,theme:t})=>e&&t.headRow.denseStyle}; +`,St=(e,...t)=>j` + @media screen and (max-width: ${599}px) { + ${j(e,...t)} + } + `,fn=(e,...t)=>j` + @media screen and (max-width: ${959}px) { + ${j(e,...t)} + } + `,xn=(e,...t)=>j` + @media screen and (max-width: ${1280}px) { + ${j(e,...t)} + } + `,Cn=e=>(t,...o)=>j` + @media screen and (max-width: ${e}px) { + ${j(t,...o)} + } + `,ce=b.div` + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + ${({theme:e,$headCell:t})=>e[t?"headCells":"cells"].style}; + ${({$noPadding:e})=>e&&"padding: 0"}; +`,Et=b(ce)` + flex-grow: ${({button:e,grow:t})=>t===0||e?0:t||1}; + flex-shrink: 0; + flex-basis: 0; + max-width: ${({maxWidth:e})=>e||"100%"}; + min-width: ${({minWidth:e})=>e||"100px"}; + ${({width:e})=>e&&j` + min-width: ${e}; + max-width: ${e}; + `}; + ${({right:e})=>e&&"justify-content: flex-end"}; + ${({button:e,center:t})=>(t||e)&&"justify-content: center"}; + ${({compact:e,button:t})=>(e||t)&&"padding: 0"}; + + /* handle hiding cells */ + ${({hide:e})=>e&&e==="sm"&&St` + display: none; + `}; + ${({hide:e})=>e&&e==="md"&&fn` + display: none; + `}; + ${({hide:e})=>e&&e==="lg"&&xn` + display: none; + `}; + ${({hide:e})=>e&&Number.isInteger(e)&&Cn(e)` + display: none; + `}; +`,yn=j` + div:first-child { + white-space: ${({$wrapCell:e})=>e?"normal":"nowrap"}; + overflow: ${({$allowOverflow:e})=>e?"visible":"hidden"}; + text-overflow: ellipsis; + } +`,Rn=b(Et).attrs(e=>({style:e.style}))` + ${({$renderAsCell:e})=>!e&&yn}; + ${({theme:e,$isDragging:t})=>t&&e.cells.draggingStyle}; + ${({$cellStyle:e})=>e}; +`;var vn=n.memo(function({id:e,column:t,row:o,rowIndex:a,dataTag:l,isDragging:i,onDragStart:s,onDragOver:d,onDragEnd:u,onDragEnter:h,onDragLeave:p}){const{conditionalStyle:m,classNames:D}=vt(o,t.conditionalCellStyles,["rdt_TableCell"]);return n.createElement(Rn,{id:e,"data-column-id":t.id,role:"cell",className:D,"data-tag":l,$cellStyle:t.style,$renderAsCell:!!t.cell,$allowOverflow:t.allowOverflow,button:t.button,center:t.center,compact:t.compact,grow:t.grow,hide:t.hide,maxWidth:t.maxWidth,minWidth:t.minWidth,right:t.right,width:t.width,$wrapCell:t.wrap,style:m,$isDragging:i,onDragStart:s,onDragOver:d,onDragEnd:u,onDragEnter:h,onDragLeave:p},!t.cell&&n.createElement("div",{"data-tag":l},function(R,S,H,x){return S?H&&typeof H=="function"?H(R,x):S(R,x):null}(o,t.selector,t.format,a)),t.cell&&t.cell(o,a,t,e))});const mt="input";var Ot=n.memo(function({name:e,component:t=mt,componentOptions:o={style:{}},indeterminate:a=!1,checked:l=!1,disabled:i=!1,onClick:s=k}){const d=t,u=d!==mt?o.style:(p=>Object.assign(Object.assign({fontSize:"18px"},!p&&{cursor:"pointer"}),{padding:0,marginTop:"1px",verticalAlign:"middle",position:"relative"}))(i),h=n.useMemo(()=>function(p,...m){let D;return Object.keys(p).map(R=>p[R]).forEach((R,S)=>{typeof R=="function"&&(D=Object.assign(Object.assign({},p),{[Object.keys(p)[S]]:R(...m)}))}),D||p}(o,a),[o,a]);return n.createElement(d,Object.assign({type:"checkbox",ref:p=>{p&&(p.indeterminate=a)},style:u,onClick:i?k:s,name:e,"aria-label":e,checked:l,disabled:i},h,{onChange:k}))});const Sn=b(ce)` + flex: 0 0 48px; + min-width: 48px; + justify-content: center; + align-items: center; + user-select: none; + white-space: nowrap; +`;function En({name:e,keyField:t,row:o,rowCount:a,selected:l,selectableRowsComponent:i,selectableRowsComponentProps:s,selectableRowsSingle:d,selectableRowDisabled:u,onSelectedRow:h}){const p=!(!u||!u(o));return n.createElement(Sn,{onClick:m=>m.stopPropagation(),className:"rdt_TableCell",$noPadding:!0},n.createElement(Ot,{name:e,component:i,componentOptions:s,checked:l,"aria-checked":l,onClick:()=>{h({type:"SELECT_SINGLE_ROW",row:o,isSelected:l,keyField:t,rowCount:a,singleSelect:d})},disabled:p}))}const On=b.button` + display: inline-flex; + align-items: center; + user-select: none; + white-space: nowrap; + border: none; + background-color: transparent; + ${({theme:e})=>e.expanderButton.style}; +`;function $n({disabled:e=!1,expanded:t=!1,expandableIcon:o,id:a,row:l,onToggled:i}){const s=t?o.expanded:o.collapsed;return n.createElement(On,{"aria-disabled":e,onClick:()=>i&&i(l),"data-testid":`expander-button-${a}`,disabled:e,"aria-label":t?"Collapse Row":"Expand Row",role:"button",type:"button"},s)}const Pn=b(ce)` + white-space: nowrap; + font-weight: 400; + min-width: 48px; + ${({theme:e})=>e.expanderCell.style}; +`;function kn({row:e,expanded:t=!1,expandableIcon:o,id:a,onToggled:l,disabled:i=!1}){return n.createElement(Pn,{onClick:s=>s.stopPropagation(),$noPadding:!0},n.createElement($n,{id:a,row:e,expanded:t,expandableIcon:o,disabled:i,onToggled:l}))}const Dn=b.div` + width: 100%; + box-sizing: border-box; + ${({theme:e})=>e.expanderRow.style}; + ${({$extendedRowStyle:e})=>e}; +`;var Hn=n.memo(function({data:e,ExpanderComponent:t,expanderComponentProps:o,extendedRowStyle:a,extendedClassNames:l}){const i=["rdt_ExpanderRow",...l.split(" ").filter(s=>s!=="rdt_TableRow")].join(" ");return n.createElement(Dn,{className:i,$extendedRowStyle:a},n.createElement(t,Object.assign({data:e},o)))});const Be="allowRowEvents";var $e,Ge,ht;(function(e){e.LTR="ltr",e.RTL="rtl",e.AUTO="auto"})($e||($e={})),function(e){e.LEFT="left",e.RIGHT="right",e.CENTER="center"}(Ge||(Ge={})),function(e){e.SM="sm",e.MD="md",e.LG="lg"}(ht||(ht={}));const Fn=j` + &:hover { + ${({$highlightOnHover:e,theme:t})=>e&&t.rows.highlightOnHoverStyle}; + } +`,jn=j` + &:hover { + cursor: pointer; + } +`,Tn=b.div.attrs(e=>({style:e.style}))` + display: flex; + align-items: stretch; + align-content: stretch; + width: 100%; + box-sizing: border-box; + ${({theme:e})=>e.rows.style}; + ${({$dense:e,theme:t})=>e&&t.rows.denseStyle}; + ${({$striped:e,theme:t})=>e&&t.rows.stripedStyle}; + ${({$highlightOnHover:e})=>e&&Fn}; + ${({$pointerOnHover:e})=>e&&jn}; + ${({$selected:e,theme:t})=>e&&t.rows.selectedHighlightStyle}; + ${({$conditionalStyle:e})=>e}; +`;function In({columns:e=[],conditionalRowStyles:t=[],defaultExpanded:o=!1,defaultExpanderDisabled:a=!1,dense:l=!1,expandableIcon:i,expandableRows:s=!1,expandableRowsComponent:d,expandableRowsComponentProps:u,expandableRowsHideExpander:h,expandOnRowClicked:p=!1,expandOnRowDoubleClicked:m=!1,highlightOnHover:D=!1,id:R,expandableInheritConditionalStyles:S,keyField:H,onRowClicked:x=k,onRowDoubleClicked:$=k,onRowMouseEnter:F=k,onRowMouseLeave:v=k,onRowExpandToggled:E=k,onSelectedRow:L=k,pointerOnHover:A=!1,row:C,rowCount:y,rowIndex:V,selectableRowDisabled:M=null,selectableRows:N=!1,selectableRowsComponent:U,selectableRowsComponentProps:O,selectableRowsHighlight:te=!1,selectableRowsSingle:ge=!1,selected:ne,striped:oe=!1,draggingColumnId:Pe,onDragStart:ke,onDragOver:De,onDragEnd:He,onDragEnter:B,onDragLeave:we}){const[G,fe]=n.useState(o);n.useEffect(()=>{fe(o)},[o]);const Y=n.useCallback(()=>{fe(!G),E(!G,C)},[G,E,C]),Fe=A||s&&(p||m),je=n.useCallback(P=>{P.target.getAttribute("data-tag")===Be&&(x(C,P),!a&&s&&p&&Y())},[a,p,s,Y,x,C]),xe=n.useCallback(P=>{P.target.getAttribute("data-tag")===Be&&($(C,P),!a&&s&&m&&Y())},[a,m,s,Y,$,C]),Te=n.useCallback(P=>{F(C,P)},[F,C]),q=n.useCallback(P=>{v(C,P)},[v,C]),J=se(C,H),{conditionalStyle:Ce,classNames:ye}=vt(C,t,["rdt_TableRow"]),Ie=te&&ne,Le=S?Ce:{},Ae=oe&&V%2==0;return n.createElement(n.Fragment,null,n.createElement(Tn,{id:`row-${R}`,role:"row",$striped:Ae,$highlightOnHover:D,$pointerOnHover:!a&&Fe,$dense:l,onClick:je,onDoubleClick:xe,onMouseEnter:Te,onMouseLeave:q,className:ye,$selected:Ie,$conditionalStyle:Ce},N&&n.createElement(En,{name:`select-row-${J}`,keyField:H,row:C,rowCount:y,selected:ne,selectableRowsComponent:U,selectableRowsComponentProps:O,selectableRowDisabled:M,selectableRowsSingle:ge,onSelectedRow:L}),s&&!h&&n.createElement(kn,{id:J,expandableIcon:i,expanded:G,row:C,onToggled:Y,disabled:a}),e.map(P=>P.omit?null:n.createElement(vn,{id:`cell-${P.id}-${J}`,key:`cell-${P.id}-${J}`,dataTag:P.ignoreRowClick||P.button?null:Be,column:P,row:C,rowIndex:V,isDragging:me(Pe,P.id),onDragStart:ke,onDragOver:De,onDragEnd:He,onDragEnter:B,onDragLeave:we}))),s&&G&&n.createElement(Hn,{key:`expander-${J}`,data:C,extendedRowStyle:Le,extendedClassNames:ye,ExpanderComponent:d,expanderComponentProps:u}))}const Ln=b.span` + padding: 2px; + color: inherit; + flex-grow: 0; + flex-shrink: 0; + ${({$sortActive:e})=>e?"opacity: 1":"opacity: 0"}; + ${({$sortDirection:e})=>e==="desc"&&"transform: rotate(180deg)"}; +`,An=({sortActive:e,sortDirection:t})=>w.createElement(Ln,{$sortActive:e,$sortDirection:t},"▲"),Mn=b(Et)` + ${({button:e})=>e&&"text-align: center"}; + ${({theme:e,$isDragging:t})=>t&&e.headCells.draggingStyle}; +`,_n=j` + cursor: pointer; + span.__rdt_custom_sort_icon__ { + i, + svg { + transform: 'translate3d(0, 0, 0)'; + ${({$sortActive:e})=>e?"opacity: 1":"opacity: 0"}; + color: inherit; + font-size: 18px; + height: 18px; + width: 18px; + backface-visibility: hidden; + transform-style: preserve-3d; + transition-duration: 95ms; + transition-property: transform; + } + + &.asc i, + &.asc svg { + transform: rotate(180deg); + } + } + + ${({$sortActive:e})=>!e&&j` + &:hover, + &:focus { + opacity: 0.7; + + span, + span.__rdt_custom_sort_icon__ * { + opacity: 0.7; + } + } + `}; +`,zn=b.div` + display: inline-flex; + align-items: center; + justify-content: inherit; + height: 100%; + width: 100%; + outline: none; + user-select: none; + overflow: hidden; + ${({disabled:e})=>!e&&_n}; +`,Nn=b.div` + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +`;var Wn=n.memo(function({column:e,disabled:t,draggingColumnId:o,selectedColumn:a={},sortDirection:l,sortIcon:i,sortServer:s,pagination:d,paginationServer:u,persistSelectedOnSort:h,selectableRowsVisibleOnly:p,onSort:m,onDragStart:D,onDragOver:R,onDragEnd:S,onDragEnter:H,onDragLeave:x}){n.useEffect(()=>{typeof e.selector=="string"&&console.error(`Warning: ${e.selector} is a string based column selector which has been deprecated as of v7 and will be removed in v8. Instead, use a selector function e.g. row => row[field]...`)},[]);const[$,F]=n.useState(!1),v=n.useRef(null);if(n.useEffect(()=>{v.current&&F(v.current.scrollWidth>v.current.clientWidth)},[$]),e.omit)return null;const E=()=>{if(!e.sortable&&!e.selector)return;let O=l;me(a.id,e.id)&&(O=l===X.ASC?X.DESC:X.ASC),m({type:"SORT_CHANGE",sortDirection:O,selectedColumn:e,clearSelectedOnSort:d&&u&&!h||s||p})},L=O=>n.createElement(An,{sortActive:O,sortDirection:l}),A=()=>n.createElement("span",{className:[l,"__rdt_custom_sort_icon__"].join(" ")},i),C=!(!e.sortable||!me(a.id,e.id)),y=!e.sortable||t,V=e.sortable&&!i&&!e.right,M=e.sortable&&!i&&e.right,N=e.sortable&&i&&!e.right,U=e.sortable&&i&&e.right;return n.createElement(Mn,{"data-column-id":e.id,className:"rdt_TableCol",$headCell:!0,allowOverflow:e.allowOverflow,button:e.button,compact:e.compact,grow:e.grow,hide:e.hide,maxWidth:e.maxWidth,minWidth:e.minWidth,right:e.right,center:e.center,width:e.width,draggable:e.reorder,$isDragging:me(e.id,o),onDragStart:D,onDragOver:R,onDragEnd:S,onDragEnter:H,onDragLeave:x},e.name&&n.createElement(zn,{"data-column-id":e.id,"data-sort-id":e.id,role:"columnheader",tabIndex:0,className:"rdt_TableCol_Sortable",onClick:y?void 0:E,onKeyPress:y?void 0:O=>{O.key==="Enter"&&E()},$sortActive:!y&&C,disabled:y},!y&&U&&A(),!y&&M&&L(C),typeof e.name=="string"?n.createElement(Nn,{title:$?e.name:void 0,ref:v,"data-column-id":e.id},e.name):e.name,!y&&N&&A(),!y&&V&&L(C)))});const Bn=b(ce)` + flex: 0 0 48px; + justify-content: center; + align-items: center; + user-select: none; + white-space: nowrap; + font-size: unset; +`;function Gn({headCell:e=!0,rowData:t,keyField:o,allSelected:a,mergeSelections:l,selectedRows:i,selectableRowsComponent:s,selectableRowsComponentProps:d,selectableRowDisabled:u,onSelectAllRows:h}){const p=i.length>0&&!a,m=u?t.filter(S=>!u(S)):t,D=m.length===0,R=Math.min(t.length,m.length);return n.createElement(Bn,{className:"rdt_TableCol",$headCell:e,$noPadding:!0},n.createElement(Ot,{name:"select-all-rows",component:s,componentOptions:d,onClick:()=>{h({type:"SELECT_ALL_ROWS",rows:m,rowCount:R,mergeSelections:l,keyField:o})},checked:a,indeterminate:p,disabled:D}))}function $t(e=$e.AUTO){const t=typeof window=="object",[o,a]=n.useState(!1);return n.useEffect(()=>{if(t)if(e!=="auto")a(e==="rtl");else{const l=!(!window.document||!window.document.createElement),i=document.getElementsByTagName("BODY")[0],s=document.getElementsByTagName("HTML")[0],d=i.dir==="rtl"||s.dir==="rtl";a(l&&d)}},[e,t]),o}const Vn=b.div` + display: flex; + align-items: center; + flex: 1 0 auto; + height: 100%; + color: ${({theme:e})=>e.contextMenu.fontColor}; + font-size: ${({theme:e})=>e.contextMenu.fontSize}; + font-weight: 400; +`,Un=b.div` + display: flex; + align-items: center; + justify-content: flex-end; + flex-wrap: wrap; +`,wt=b.div` + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + box-sizing: inherit; + z-index: 1; + align-items: center; + justify-content: space-between; + display: flex; + ${({$rtl:e})=>e&&"direction: rtl"}; + ${({theme:e})=>e.contextMenu.style}; + ${({theme:e,$visible:t})=>t&&e.contextMenu.activeStyle}; +`;function qn({contextMessage:e,contextActions:t,contextComponent:o,selectedCount:a,direction:l}){const i=$t(l),s=a>0;return o?n.createElement(wt,{$visible:s},n.cloneElement(o,{selectedCount:a})):n.createElement(wt,{$visible:s,$rtl:i},n.createElement(Vn,null,((d,u,h)=>{if(u===0)return null;const p=u===1?d.singular:d.plural;return h?`${u} ${d.message||""} ${p}`:`${u} ${p} ${d.message||""}`})(e,a,i)),n.createElement(Un,null,t))}const Zn=b.div` + position: relative; + box-sizing: border-box; + overflow: hidden; + display: flex; + flex: 1 1 auto; + align-items: center; + justify-content: space-between; + width: 100%; + flex-wrap: wrap; + ${({theme:e})=>e.header.style} +`,Kn=b.div` + flex: 1 0 auto; + color: ${({theme:e})=>e.header.fontColor}; + font-size: ${({theme:e})=>e.header.fontSize}; + font-weight: 400; +`,Xn=b.div` + flex: 1 0 auto; + display: flex; + align-items: center; + justify-content: flex-end; + + > * { + margin-left: 5px; + } +`,Yn=({title:e,actions:t=null,contextMessage:o,contextActions:a,contextComponent:l,selectedCount:i,direction:s,showMenu:d=!0})=>n.createElement(Zn,{className:"rdt_TableHeader",role:"heading","aria-level":1},n.createElement(Kn,null,e),t&&n.createElement(Xn,null,t),d&&n.createElement(qn,{contextMessage:o,contextActions:a,contextComponent:l,direction:s,selectedCount:i}));function Pt(e,t){var o={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(o[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var l=0;for(a=Object.getOwnPropertySymbols(e);lJn[e]}; + flex-wrap: ${({$wrapContent:e})=>e?"wrap":"nowrap"}; + ${({theme:e})=>e.subHeader.style} +`,eo=e=>{var{align:t="right",wrapContent:o=!0}=e,a=Pt(e,["align","wrapContent"]);return n.createElement(Qn,Object.assign({align:t,$wrapContent:o},a))},to=b.div` + display: flex; + flex-direction: column; +`,no=b.div` + position: relative; + width: 100%; + border-radius: inherit; + ${({$responsive:e,$fixedHeader:t})=>e&&j` + overflow-x: auto; + + // hidden prevents vertical scrolling in firefox when fixedHeader is disabled + overflow-y: ${t?"auto":"hidden"}; + min-height: 0; + `}; + + ${({$fixedHeader:e=!1,$fixedHeaderScrollHeight:t="100vh"})=>e&&j` + max-height: ${t}; + -webkit-overflow-scrolling: touch; + `}; + + ${({theme:e})=>e.responsiveWrapper.style}; +`,ft=b.div` + position: relative; + box-sizing: border-box; + width: 100%; + height: 100%; + ${e=>e.theme.progress.style}; +`,oo=b.div` + position: relative; + width: 100%; + ${({theme:e})=>e.tableWrapper.style}; +`,ao=b(ce)` + white-space: nowrap; + ${({theme:e})=>e.expanderCell.style}; +`,lo=b.div` + box-sizing: border-box; + width: 100%; + height: 100%; + ${({theme:e})=>e.noData.style}; +`,ro=()=>w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},w.createElement("path",{d:"M7 10l5 5 5-5z"}),w.createElement("path",{d:"M0 0h24v24H0z",fill:"none"})),io=b.select` + cursor: pointer; + height: 24px; + max-width: 100%; + user-select: none; + padding-left: 8px; + padding-right: 24px; + box-sizing: content-box; + font-size: inherit; + color: inherit; + border: none; + background-color: transparent; + appearance: none; + direction: ltr; + flex-shrink: 0; + + &::-ms-expand { + display: none; + } + + &:disabled::-ms-expand { + background: #f60; + } + + option { + color: initial; + } +`,so=b.div` + position: relative; + flex-shrink: 0; + font-size: inherit; + color: inherit; + margin-top: 1px; + + svg { + top: 0; + right: 0; + color: inherit; + position: absolute; + fill: currentColor; + width: 24px; + height: 24px; + display: inline-block; + user-select: none; + pointer-events: none; + } +`,co=e=>{var{defaultValue:t,onChange:o}=e,a=Pt(e,["defaultValue","onChange"]);return n.createElement(so,null,n.createElement(io,Object.assign({onChange:o,defaultValue:t},a)),n.createElement(ro,null))},r={columns:[],data:[],title:"",keyField:"id",selectableRows:!1,selectableRowsHighlight:!1,selectableRowsNoSelectAll:!1,selectableRowSelected:null,selectableRowDisabled:null,selectableRowsComponent:"input",selectableRowsComponentProps:{},selectableRowsVisibleOnly:!1,selectableRowsSingle:!1,clearSelectedRows:!1,expandableRows:!1,expandableRowDisabled:null,expandableRowExpanded:null,expandOnRowClicked:!1,expandableRowsHideExpander:!1,expandOnRowDoubleClicked:!1,expandableInheritConditionalStyles:!1,expandableRowsComponent:function(){return w.createElement("div",null,"To add an expander pass in a component instance via ",w.createElement("strong",null,"expandableRowsComponent"),". You can then access props.data from this component.")},expandableIcon:{collapsed:w.createElement(()=>w.createElement("svg",{fill:"currentColor",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},w.createElement("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),w.createElement("path",{d:"M0-.25h24v24H0z",fill:"none"})),null),expanded:w.createElement(()=>w.createElement("svg",{fill:"currentColor",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},w.createElement("path",{d:"M7.41 7.84L12 12.42l4.59-4.58L18 9.25l-6 6-6-6z"}),w.createElement("path",{d:"M0-.75h24v24H0z",fill:"none"})),null)},expandableRowsComponentProps:{},progressPending:!1,progressComponent:w.createElement("div",{style:{fontSize:"24px",fontWeight:700,padding:"24px"}},"Loading..."),persistTableHead:!1,sortIcon:null,sortFunction:null,sortServer:!1,striped:!1,highlightOnHover:!1,pointerOnHover:!1,noContextMenu:!1,contextMessage:{singular:"item",plural:"items",message:"selected"},actions:null,contextActions:null,contextComponent:null,defaultSortFieldId:null,defaultSortAsc:!0,responsive:!0,noDataComponent:w.createElement("div",{style:{padding:"24px"}},"There are no records to display"),disabled:!1,noTableHead:!1,noHeader:!1,subHeader:!1,subHeaderAlign:Ge.RIGHT,subHeaderWrap:!0,subHeaderComponent:null,fixedHeader:!1,fixedHeaderScrollHeight:"100vh",pagination:!1,paginationServer:!1,paginationServerOptions:{persistSelectedOnSort:!1,persistSelectedOnPageChange:!1},paginationDefaultPage:1,paginationResetDefaultPage:!1,paginationTotalRows:0,paginationPerPage:10,paginationRowsPerPageOptions:[10,15,20,25,30],paginationComponent:null,paginationComponentOptions:{},paginationIconFirstPage:w.createElement(()=>w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation"},w.createElement("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),w.createElement("path",{fill:"none",d:"M24 24H0V0h24v24z"})),null),paginationIconLastPage:w.createElement(()=>w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation"},w.createElement("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),w.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"})),null),paginationIconNext:w.createElement(()=>w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation"},w.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),w.createElement("path",{d:"M0 0h24v24H0z",fill:"none"})),null),paginationIconPrevious:w.createElement(()=>w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation"},w.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),w.createElement("path",{d:"M0 0h24v24H0z",fill:"none"})),null),dense:!1,conditionalRowStyles:[],theme:"default",customStyles:{},direction:$e.AUTO,onChangePage:k,onChangeRowsPerPage:k,onRowClicked:k,onRowDoubleClicked:k,onRowMouseEnter:k,onRowMouseLeave:k,onRowExpandToggled:k,onSelectedRowsChange:k,onSort:k,onColumnOrderChange:k},go={rowsPerPageText:"Rows per page:",rangeSeparatorText:"of",noRowsPerPage:!1,selectAllRowsItem:!1,selectAllRowsItemText:"All"},uo=b.nav` + display: flex; + flex: 1 1 auto; + justify-content: flex-end; + align-items: center; + box-sizing: border-box; + padding-right: 8px; + padding-left: 8px; + width: 100%; + ${({theme:e})=>e.pagination.style}; +`,Ee=b.button` + position: relative; + display: block; + user-select: none; + border: none; + ${({theme:e})=>e.pagination.pageButtonsStyle}; + ${({$isRTL:e})=>e&&"transform: scale(-1, -1)"}; +`,po=b.div` + display: flex; + align-items: center; + border-radius: 4px; + white-space: nowrap; + ${St` + width: 100%; + justify-content: space-around; + `}; +`,kt=b.span` + flex-shrink: 1; + user-select: none; +`,bo=b(kt)` + margin: 0 24px; +`,mo=b(kt)` + margin: 0 4px; +`;var ho=n.memo(function({rowsPerPage:e,rowCount:t,currentPage:o,direction:a=r.direction,paginationRowsPerPageOptions:l=r.paginationRowsPerPageOptions,paginationIconLastPage:i=r.paginationIconLastPage,paginationIconFirstPage:s=r.paginationIconFirstPage,paginationIconNext:d=r.paginationIconNext,paginationIconPrevious:u=r.paginationIconPrevious,paginationComponentOptions:h=r.paginationComponentOptions,onChangeRowsPerPage:p=r.onChangeRowsPerPage,onChangePage:m=r.onChangePage}){const D=(()=>{const O=typeof window=="object";function te(){return{width:O?window.innerWidth:void 0,height:O?window.innerHeight:void 0}}const[ge,ne]=n.useState(te);return n.useEffect(()=>{if(!O)return()=>null;function oe(){ne(te())}return window.addEventListener("resize",oe),()=>window.removeEventListener("resize",oe)},[]),ge})(),R=$t(a),S=D.width&&D.width>599,H=be(t,e),x=o*e,$=x-e+1,F=o===1,v=o===H,E=Object.assign(Object.assign({},go),h),L=o===H?`${$}-${t} ${E.rangeSeparatorText} ${t}`:`${$}-${x} ${E.rangeSeparatorText} ${t}`,A=n.useCallback(()=>m(o-1),[o,m]),C=n.useCallback(()=>m(o+1),[o,m]),y=n.useCallback(()=>m(1),[m]),V=n.useCallback(()=>m(be(t,e)),[m,t,e]),M=n.useCallback(O=>p(Number(O.target.value),o),[o,p]),N=l.map(O=>n.createElement("option",{key:O,value:O},O));E.selectAllRowsItem&&N.push(n.createElement("option",{key:-1,value:t},E.selectAllRowsItemText));const U=n.createElement(co,{onChange:M,defaultValue:e,"aria-label":E.rowsPerPageText},N);return n.createElement(uo,{className:"rdt_Pagination"},!E.noRowsPerPage&&S&&n.createElement(n.Fragment,null,n.createElement(mo,null,E.rowsPerPageText),U),S&&n.createElement(bo,null,L),n.createElement(po,null,n.createElement(Ee,{id:"pagination-first-page",type:"button","aria-label":"First Page","aria-disabled":F,onClick:y,disabled:F,$isRTL:R},s),n.createElement(Ee,{id:"pagination-previous-page",type:"button","aria-label":"Previous Page","aria-disabled":F,onClick:A,disabled:F,$isRTL:R},u),!E.noRowsPerPage&&!S&&U,n.createElement(Ee,{id:"pagination-next-page",type:"button","aria-label":"Next Page","aria-disabled":v,onClick:C,disabled:v,$isRTL:R},d),n.createElement(Ee,{id:"pagination-last-page",type:"button","aria-label":"Last Page","aria-disabled":v,onClick:V,disabled:v,$isRTL:R},i)))});const ee=(e,t)=>{const o=n.useRef(!0);n.useEffect(()=>{o.current?o.current=!1:e()},t)};function wo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fo=function(e){return function(t){return!!t&&typeof t=="object"}(e)&&!function(t){var o=Object.prototype.toString.call(t);return o==="[object RegExp]"||o==="[object Date]"||function(a){return a.$$typeof===xo}(t)}(e)},xo=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function he(e,t){return t.clone!==!1&&t.isMergeableObject(e)?de((o=e,Array.isArray(o)?[]:{}),e,t):e;var o}function Co(e,t,o){return e.concat(t).map(function(a){return he(a,o)})}function xt(e){return Object.keys(e).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(o){return Object.propertyIsEnumerable.call(t,o)}):[]}(e))}function Ct(e,t){try{return t in e}catch{return!1}}function yo(e,t,o){var a={};return o.isMergeableObject(e)&&xt(e).forEach(function(l){a[l]=he(e[l],o)}),xt(t).forEach(function(l){(function(i,s){return Ct(i,s)&&!(Object.hasOwnProperty.call(i,s)&&Object.propertyIsEnumerable.call(i,s))})(e,l)||(Ct(e,l)&&o.isMergeableObject(t[l])?a[l]=function(i,s){if(!s.customMerge)return de;var d=s.customMerge(i);return typeof d=="function"?d:de}(l,o)(e[l],t[l],o):a[l]=he(t[l],o))}),a}function de(e,t,o){(o=o||{}).arrayMerge=o.arrayMerge||Co,o.isMergeableObject=o.isMergeableObject||fo,o.cloneUnlessOtherwiseSpecified=he;var a=Array.isArray(t);return a===Array.isArray(e)?a?o.arrayMerge(e,t,o):yo(e,t,o):he(t,o)}de.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(o,a){return de(o,a,t)},{})};var Ro=wo(de);const yt={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)"},background:{default:"#FFFFFF"},context:{background:"#e3f2fd",text:"rgba(0, 0, 0, 0.87)"},divider:{default:"rgba(0,0,0,.12)"},button:{default:"rgba(0,0,0,.54)",focus:"rgba(0,0,0,.12)",hover:"rgba(0,0,0,.12)",disabled:"rgba(0, 0, 0, .18)"},selected:{default:"#e3f2fd",text:"rgba(0, 0, 0, 0.87)"},highlightOnHover:{default:"#EEEEEE",text:"rgba(0, 0, 0, 0.87)"},striped:{default:"#FAFAFA",text:"rgba(0, 0, 0, 0.87)"}},Rt={default:yt,light:yt,dark:{text:{primary:"#FFFFFF",secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(0,0,0,.12)"},background:{default:"#424242"},context:{background:"#E91E63",text:"#FFFFFF"},divider:{default:"rgba(81, 81, 81, 1)"},button:{default:"#FFFFFF",focus:"rgba(255, 255, 255, .54)",hover:"rgba(255, 255, 255, .12)",disabled:"rgba(255, 255, 255, .18)"},selected:{default:"rgba(0, 0, 0, .7)",text:"#FFFFFF"},highlightOnHover:{default:"rgba(0, 0, 0, .7)",text:"#FFFFFF"},striped:{default:"rgba(0, 0, 0, .87)",text:"#FFFFFF"}}};function vo(e,t,o,a){const[l,i]=n.useState(()=>bt(e)),[s,d]=n.useState(""),u=n.useRef("");ee(()=>{i(bt(e))},[e]);const h=n.useCallback(x=>{var $,F,v;const{attributes:E}=x.target,L=($=E.getNamedItem("data-column-id"))===null||$===void 0?void 0:$.value;L&&(u.current=((v=(F=l[Se(l,L)])===null||F===void 0?void 0:F.id)===null||v===void 0?void 0:v.toString())||"",d(u.current))},[l]),p=n.useCallback(x=>{var $;const{attributes:F}=x.target,v=($=F.getNamedItem("data-column-id"))===null||$===void 0?void 0:$.value;if(v&&u.current&&v!==u.current){const E=Se(l,u.current),L=Se(l,v),A=[...l];A[E]=l[L],A[L]=l[E],i(A),t(A)}},[t,l]),m=n.useCallback(x=>{x.preventDefault()},[]),D=n.useCallback(x=>{x.preventDefault()},[]),R=n.useCallback(x=>{x.preventDefault(),u.current="",d("")},[]),S=function(x=!1){return x?X.ASC:X.DESC}(a),H=n.useMemo(()=>l[Se(l,o==null?void 0:o.toString())]||{},[o,l]);return{tableColumns:l,draggingColumnId:s,handleDragStart:h,handleDragEnter:p,handleDragOver:m,handleDragLeave:D,handleDragEnd:R,defaultSortDirection:S,defaultSortColumn:H}}var So=n.memo(function(e){const{data:t=r.data,columns:o=r.columns,title:a=r.title,actions:l=r.actions,keyField:i=r.keyField,striped:s=r.striped,highlightOnHover:d=r.highlightOnHover,pointerOnHover:u=r.pointerOnHover,dense:h=r.dense,selectableRows:p=r.selectableRows,selectableRowsSingle:m=r.selectableRowsSingle,selectableRowsHighlight:D=r.selectableRowsHighlight,selectableRowsNoSelectAll:R=r.selectableRowsNoSelectAll,selectableRowsVisibleOnly:S=r.selectableRowsVisibleOnly,selectableRowSelected:H=r.selectableRowSelected,selectableRowDisabled:x=r.selectableRowDisabled,selectableRowsComponent:$=r.selectableRowsComponent,selectableRowsComponentProps:F=r.selectableRowsComponentProps,onRowExpandToggled:v=r.onRowExpandToggled,onSelectedRowsChange:E=r.onSelectedRowsChange,expandableIcon:L=r.expandableIcon,onChangeRowsPerPage:A=r.onChangeRowsPerPage,onChangePage:C=r.onChangePage,paginationServer:y=r.paginationServer,paginationServerOptions:V=r.paginationServerOptions,paginationTotalRows:M=r.paginationTotalRows,paginationDefaultPage:N=r.paginationDefaultPage,paginationResetDefaultPage:U=r.paginationResetDefaultPage,paginationPerPage:O=r.paginationPerPage,paginationRowsPerPageOptions:te=r.paginationRowsPerPageOptions,paginationIconLastPage:ge=r.paginationIconLastPage,paginationIconFirstPage:ne=r.paginationIconFirstPage,paginationIconNext:oe=r.paginationIconNext,paginationIconPrevious:Pe=r.paginationIconPrevious,paginationComponent:ke=r.paginationComponent,paginationComponentOptions:De=r.paginationComponentOptions,responsive:He=r.responsive,progressPending:B=r.progressPending,progressComponent:we=r.progressComponent,persistTableHead:G=r.persistTableHead,noDataComponent:fe=r.noDataComponent,disabled:Y=r.disabled,noTableHead:Fe=r.noTableHead,noHeader:je=r.noHeader,fixedHeader:xe=r.fixedHeader,fixedHeaderScrollHeight:Te=r.fixedHeaderScrollHeight,pagination:q=r.pagination,subHeader:J=r.subHeader,subHeaderAlign:Ce=r.subHeaderAlign,subHeaderWrap:ye=r.subHeaderWrap,subHeaderComponent:Ie=r.subHeaderComponent,noContextMenu:Le=r.noContextMenu,contextMessage:Ae=r.contextMessage,contextActions:P=r.contextActions,contextComponent:Dt=r.contextComponent,expandableRows:Re=r.expandableRows,onRowClicked:Ve=r.onRowClicked,onRowDoubleClicked:Ue=r.onRowDoubleClicked,onRowMouseEnter:qe=r.onRowMouseEnter,onRowMouseLeave:Ze=r.onRowMouseLeave,sortIcon:Ht=r.sortIcon,onSort:Ft=r.onSort,sortFunction:Ke=r.sortFunction,sortServer:Me=r.sortServer,expandableRowsComponent:jt=r.expandableRowsComponent,expandableRowsComponentProps:Tt=r.expandableRowsComponentProps,expandableRowDisabled:Xe=r.expandableRowDisabled,expandableRowsHideExpander:Ye=r.expandableRowsHideExpander,expandOnRowClicked:It=r.expandOnRowClicked,expandOnRowDoubleClicked:Lt=r.expandOnRowDoubleClicked,expandableRowExpanded:Je=r.expandableRowExpanded,expandableInheritConditionalStyles:At=r.expandableInheritConditionalStyles,defaultSortFieldId:Mt=r.defaultSortFieldId,defaultSortAsc:_t=r.defaultSortAsc,clearSelectedRows:Qe=r.clearSelectedRows,conditionalRowStyles:zt=r.conditionalRowStyles,theme:et=r.theme,customStyles:tt=r.customStyles,direction:ue=r.direction,onColumnOrderChange:Nt=r.onColumnOrderChange,className:Wt,ariaLabel:nt}=e,{tableColumns:ot,draggingColumnId:at,handleDragStart:lt,handleDragEnter:rt,handleDragOver:it,handleDragLeave:st,handleDragEnd:dt,defaultSortDirection:Bt,defaultSortColumn:Gt}=vo(o,Nt,Mt,_t),[{rowsPerPage:Z,currentPage:_,selectedRows:_e,allSelected:ct,selectedCount:gt,selectedColumn:W,sortDirection:ae,toggleOnSelectedRowsChange:Vt},Q]=n.useReducer(un,{allSelected:!1,selectedCount:0,selectedRows:[],selectedColumn:Gt,toggleOnSelectedRowsChange:!1,sortDirection:Bt,currentPage:N,rowsPerPage:O,selectedRowsFlag:!1,contextMessage:r.contextMessage}),{persistSelectedOnSort:ut=!1,persistSelectedOnPageChange:ve=!1}=V,pt=!(!y||!ve&&!ut),Ut=q&&!B&&t.length>0,qt=ke||ho,Zt=n.useMemo(()=>((c={},f="default",I="default")=>{const z=Rt[f]?f:I;return Ro({table:{style:{color:(g=Rt[z]).text.primary,backgroundColor:g.background.default}},tableWrapper:{style:{display:"table"}},responsiveWrapper:{style:{}},header:{style:{fontSize:"22px",color:g.text.primary,backgroundColor:g.background.default,minHeight:"56px",paddingLeft:"16px",paddingRight:"8px"}},subHeader:{style:{backgroundColor:g.background.default,minHeight:"52px"}},head:{style:{color:g.text.primary,fontSize:"12px",fontWeight:500}},headRow:{style:{backgroundColor:g.background.default,minHeight:"52px",borderBottomWidth:"1px",borderBottomColor:g.divider.default,borderBottomStyle:"solid"},denseStyle:{minHeight:"32px"}},headCells:{style:{paddingLeft:"16px",paddingRight:"16px"},draggingStyle:{cursor:"move"}},contextMenu:{style:{backgroundColor:g.context.background,fontSize:"18px",fontWeight:400,color:g.context.text,paddingLeft:"16px",paddingRight:"8px",transform:"translate3d(0, -100%, 0)",transitionDuration:"125ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)",willChange:"transform"},activeStyle:{transform:"translate3d(0, 0, 0)"}},cells:{style:{paddingLeft:"16px",paddingRight:"16px",wordBreak:"break-word"},draggingStyle:{}},rows:{style:{fontSize:"13px",fontWeight:400,color:g.text.primary,backgroundColor:g.background.default,minHeight:"48px","&:not(:last-of-type)":{borderBottomStyle:"solid",borderBottomWidth:"1px",borderBottomColor:g.divider.default}},denseStyle:{minHeight:"32px"},selectedHighlightStyle:{"&:nth-of-type(n)":{color:g.selected.text,backgroundColor:g.selected.default,borderBottomColor:g.background.default}},highlightOnHoverStyle:{color:g.highlightOnHover.text,backgroundColor:g.highlightOnHover.default,transitionDuration:"0.15s",transitionProperty:"background-color",borderBottomColor:g.background.default,outlineStyle:"solid",outlineWidth:"1px",outlineColor:g.background.default},stripedStyle:{color:g.striped.text,backgroundColor:g.striped.default}},expanderRow:{style:{color:g.text.primary,backgroundColor:g.background.default}},expanderCell:{style:{flex:"0 0 48px"}},expanderButton:{style:{color:g.button.default,fill:g.button.default,backgroundColor:"transparent",borderRadius:"2px",transition:"0.25s",height:"100%",width:"100%","&:hover:enabled":{cursor:"pointer"},"&:disabled":{color:g.button.disabled},"&:hover:not(:disabled)":{cursor:"pointer",backgroundColor:g.button.hover},"&:focus":{outline:"none",backgroundColor:g.button.focus},svg:{margin:"auto"}}},pagination:{style:{color:g.text.secondary,fontSize:"13px",minHeight:"56px",backgroundColor:g.background.default,borderTopStyle:"solid",borderTopWidth:"1px",borderTopColor:g.divider.default},pageButtonsStyle:{borderRadius:"50%",height:"40px",width:"40px",padding:"8px",margin:"px",cursor:"pointer",transition:"0.4s",color:g.button.default,fill:g.button.default,backgroundColor:"transparent","&:disabled":{cursor:"unset",color:g.button.disabled,fill:g.button.disabled},"&:hover:not(:disabled)":{backgroundColor:g.button.hover},"&:focus":{outline:"none",backgroundColor:g.button.focus}}},noData:{style:{display:"flex",alignItems:"center",justifyContent:"center",color:g.text.primary,backgroundColor:g.background.default}},progress:{style:{display:"flex",alignItems:"center",justifyContent:"center",color:g.text.primary,backgroundColor:g.background.default}}},c);var g})(tt,et),[tt,et]),Kt=n.useMemo(()=>Object.assign({},ue!=="auto"&&{dir:ue}),[ue]),T=n.useMemo(()=>{if(Me)return t;if(W!=null&&W.sortFunction&&typeof W.sortFunction=="function"){const c=W.sortFunction,f=ae===X.ASC?c:(I,z)=>-1*c(I,z);return[...t].sort(f)}return function(c,f,I,z){return f?z&&typeof z=="function"?z(c.slice(0),f,I):c.slice(0).sort((g,ze)=>{const re=f(g),K=f(ze);if(I==="asc"){if(reK)return 1}if(I==="desc"){if(re>K)return-1;if(re{if(q&&!y){const c=_*Z,f=c-Z;return T.slice(f,c)}return T},[_,q,y,Z,T]),Xt=n.useCallback(c=>{Q(c)},[]),Yt=n.useCallback(c=>{Q(c)},[]),Jt=n.useCallback(c=>{Q(c)},[]),Qt=n.useCallback((c,f)=>Ve(c,f),[Ve]),en=n.useCallback((c,f)=>Ue(c,f),[Ue]),tn=n.useCallback((c,f)=>qe(c,f),[qe]),nn=n.useCallback((c,f)=>Ze(c,f),[Ze]),le=n.useCallback(c=>Q({type:"CHANGE_PAGE",page:c,paginationServer:y,visibleOnly:S,persistSelectedOnPageChange:ve}),[y,ve,S]),on=n.useCallback(c=>{const f=be(M||pe.length,c),I=We(_,f);y||le(I),Q({type:"CHANGE_ROWS_PER_PAGE",page:I,rowsPerPage:c})},[_,le,y,M,pe.length]);if(q&&!y&&T.length>0&&pe.length===0){const c=be(T.length,Z),f=We(_,c);le(f)}ee(()=>{E({allSelected:ct,selectedCount:gt,selectedRows:_e.slice(0)})},[Vt]),ee(()=>{Ft(W,ae,T.slice(0))},[W,ae]),ee(()=>{C(_,M||T.length)},[_]),ee(()=>{A(Z,_)},[Z]),ee(()=>{le(N)},[N,U]),ee(()=>{if(q&&y&&M>0){const c=be(M,Z),f=We(_,c);_!==f&&le(f)}},[M]),n.useEffect(()=>{Q({type:"CLEAR_SELECTED_ROWS",selectedRowsFlag:Qe})},[m,Qe]),n.useEffect(()=>{if(!H)return;const c=T.filter(I=>H(I)),f=m?c.slice(0,1):c;Q({type:"SELECT_MULTIPLE_ROWS",keyField:i,selectedRows:f,totalRows:T.length,mergeSelections:pt})},[t,H]);const an=S?pe:T,ln=ve||m||R;return n.createElement(dn,{theme:Zt},!je&&(!!a||!!l)&&n.createElement(Yn,{title:a,actions:l,showMenu:!Le,selectedCount:gt,direction:ue,contextActions:P,contextComponent:Dt,contextMessage:Ae}),J&&n.createElement(eo,{align:Ce,wrapContent:ye},Ie),n.createElement(no,Object.assign({$responsive:He,$fixedHeader:xe,$fixedHeaderScrollHeight:Te,className:Wt},Kt),n.createElement(oo,null,B&&!G&&n.createElement(ft,null,we),n.createElement(bn,Object.assign({disabled:Y,className:"rdt_Table",role:"table"},nt&&{"aria-label":nt}),!Fe&&(!!G||T.length>0&&!B)&&n.createElement(hn,{className:"rdt_TableHead",role:"rowgroup",$fixedHeader:xe},n.createElement(wn,{className:"rdt_TableHeadRow",role:"row",$dense:h},p&&(ln?n.createElement(ce,{style:{flex:"0 0 48px"}}):n.createElement(Gn,{allSelected:ct,selectedRows:_e,selectableRowsComponent:$,selectableRowsComponentProps:F,selectableRowDisabled:x,rowData:an,keyField:i,mergeSelections:pt,onSelectAllRows:Yt})),Re&&!Ye&&n.createElement(ao,null),ot.map(c=>n.createElement(Wn,{key:c.id,column:c,selectedColumn:W,disabled:B||T.length===0,pagination:q,paginationServer:y,persistSelectedOnSort:ut,selectableRowsVisibleOnly:S,sortDirection:ae,sortIcon:Ht,sortServer:Me,onSort:Xt,onDragStart:lt,onDragOver:it,onDragEnd:dt,onDragEnter:rt,onDragLeave:st,draggingColumnId:at})))),!T.length&&!B&&n.createElement(lo,null,fe),B&&G&&n.createElement(ft,null,we),!B&&T.length>0&&n.createElement(to,{className:"rdt_TableBody",role:"rowgroup"},pe.map((c,f)=>{const I=se(c,i),z=function(K=""){return typeof K!="number"&&(!K||K.length===0)}(I)?f:I,g=Oe(c,_e,i),ze=!!(Re&&Je&&Je(c)),re=!!(Re&&Xe&&Xe(c));return n.createElement(In,{id:z,key:z,keyField:i,"data-row-id":z,columns:ot,row:c,rowCount:T.length,rowIndex:f,selectableRows:p,expandableRows:Re,expandableIcon:L,highlightOnHover:d,pointerOnHover:u,dense:h,expandOnRowClicked:It,expandOnRowDoubleClicked:Lt,expandableRowsComponent:jt,expandableRowsComponentProps:Tt,expandableRowsHideExpander:Ye,defaultExpanderDisabled:re,defaultExpanded:ze,expandableInheritConditionalStyles:At,conditionalRowStyles:zt,selected:g,selectableRowsHighlight:D,selectableRowsComponent:$,selectableRowsComponentProps:F,selectableRowDisabled:x,selectableRowsSingle:m,striped:s,onRowExpandToggled:v,onRowClicked:Qt,onRowDoubleClicked:en,onRowMouseEnter:tn,onRowMouseLeave:nn,onSelectedRow:Jt,draggingColumnId:at,onDragStart:lt,onDragOver:it,onDragEnd:dt,onDragEnter:rt,onDragLeave:st})}))))),Ut&&n.createElement("div",null,n.createElement(qt,{onChangePage:le,onChangeRowsPerPage:on,rowCount:M||T.length,currentPage:_,rowsPerPage:Z,direction:ue,paginationRowsPerPageOptions:te,paginationIconLastPage:ge,paginationIconFirstPage:ne,paginationIconNext:oe,paginationIconPrevious:Pe,paginationComponentOptions:De})))});const Eo={rows:{style:{minHeight:"72px"}},headCells:{style:{paddingLeft:"0px",paddingRight:"0px",backgroundColor:"#ddd"}},cells:{style:{paddingLeft:"0px",paddingRight:"0px"}}},Do=e=>{var s,d;const t=e.title;n.useEffect(()=>{if(!e.progressPending){const u=document.querySelector(".rdt_Pagination span"),h=document.querySelector(".rdt_Pagination"),p=h==null?void 0:h.querySelectorAll("span")[(h==null?void 0:h.querySelectorAll("span").length)-1];p&&(p.textContent=p.textContent.replace("of","از"),u.textContent="سطر در صفحه:")}},[e.progressPending]);const[o,a]=n.useState(window.devicePixelRatio),l=()=>{const u=window.devicePixelRatio;a(u)};n.useEffect(()=>(window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}),[o]),n.useEffect(()=>{const u=document.querySelectorAll(".rdt_Table"),h="There are no records to display",p="داده ای جهت نمایش وجود ندارد";u==null||u.forEach(m=>{(m==null?void 0:m.textContent).includes(h)&&(m.textContent=p)})},[]);const i=window.innerWidth<=600;return ie.jsxs(Ne,{container:!0,className:"page-table",direction:"column",alignItems:"center",children:[ie.jsx(Ne,{container:!0,alignItems:"start",justifyContent:"start",children:t}),!!((s=e==null?void 0:e.data)!=null&&s.length)&&ie.jsx(Ne,{className:"table-section",width:i?"95vw":o>=1?window.screen.width-200:window.screen.width*(10/(o*10))-250,children:ie.jsx(So,{progressComponent:null,customStyles:Eo,...e,title:null,pagination:!0,paginationRowsPerPageOptions:[10,20,50,100],fixedHeader:!0,fixedHeaderScrollHeight:"70vh"})}),!((d=e==null?void 0:e.data)!=null&&d.length)&&!e.progressPending&&ie.jsx(rn,{variant:"h6",my:1,color:"red",mt:4,children:"داده ای جهت نمایش وجود ندارد!"}),e.progressPending&&ie.jsx(sn,{style:{alignItems:"center",justifyContent:"center"}})]})};export{Do as P}; diff --git a/build/assets/Pageview-TRcW_9jm.js b/build/assets/Pageview-TRcW_9jm.js new file mode 100644 index 0000000..dfee98f --- /dev/null +++ b/build/assets/Pageview-TRcW_9jm.js @@ -0,0 +1 @@ +import{i as r,j as a}from"./mui-vendor-CkIVaoQP.js";import{r as t}from"./index-CeyyVc1v.js";var e={},i=r;Object.defineProperty(e,"__esModule",{value:!0});var o=e.default=void 0,u=i(t()),v=a;o=e.default=(0,u.default)((0,v.jsx)("path",{d:"M11.5 9C10.12 9 9 10.12 9 11.5s1.12 2.5 2.5 2.5 2.5-1.12 2.5-2.5S12.88 9 11.5 9M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-3.21 14.21-2.91-2.91c-.69.44-1.51.7-2.39.7C9.01 16 7 13.99 7 11.5S9.01 7 11.5 7 16 9.01 16 11.5c0 .88-.26 1.69-.7 2.39l2.91 2.9z"}),"Pageview");export{o as d}; diff --git a/build/assets/ParentCompany-BF1TX0KI.js b/build/assets/ParentCompany-BF1TX0KI.js new file mode 100644 index 0000000..24f5418 --- /dev/null +++ b/build/assets/ParentCompany-BF1TX0KI.js @@ -0,0 +1 @@ +import{j as e,B as k,T as n,ak as su,d as Q,ai as C6,I as P6,aX as R6,aL as U6,aM as Q6,aN as G6,b2 as X6,b3 as A6,b as q6,a3 as d6,ag as W6,aw as J6,ax as v6}from"./mui-vendor-CkIVaoQP.js";import{r as g,f as Z6}from"./react-vendor-CmFgShSM.js";import{B as y6}from"./BackButton-Crzr7NMa.js";import{lo as O6,X as s,G as A,O as c6,A as g6,W as n6,v as _6,p as H6,j as r6,a9 as F6,lp as N6,_ as B6,Q as m6,S as H,L as V6,h as K6,lq as u0,fr as e0}from"./index-CeyyVc1v.js";import{d as r0,b as o0,c as a0}from"./ProvinceWagePaymentTransactions-OloKgjY0.js";import{u as i6,f as o6}from"./redux-vendor-B7uoacJt.js";import{R as B}from"./ResponsiveTable-w7hk7Uq8.js";import{v as l0,V as t0,a as s0,b as z6,c as c0,d as n0,e as C0}from"./VetFarmAggregateBars-CA10Fi1e.js";import{R as Y6,a as tu}from"./index.esm-Bu7XMDZU.js";import{V as A0}from"./VetFarmEditTrafficCode-D3hZa5p9.js";import{a as d0}from"./ChainBarManagement-BxgsJV2X.js";import{S as F0}from"./ShowImage-CqhU2hmk.js";import{d as g0}from"./ArrowDownward-DdOsPC7b.js";import{d as i0}from"./Refresh-DkAX1rkD.js";import{P as f0}from"./PageTable-C16Ol94B.js";import{V as h0}from"./VetFarmSubmitClearanceCode-B4m3TtXY.js";import"./num2persian-BIYy8amq.js";import"./SlaughterPayFeesGateway-BhtyiEES.js";import"./Edit-CqBj1Y2L.js";import"./resizeImage-Csf2MO3w.js";import"./toBase64-BzgTOHsW.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./Delete-C5MyLelE.js";import"./Tune-D4M2CAhp.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./Pageview-TRcW_9jm.js";import"./AddCircleOutline-C8LXM-k8.js";import"./SimpleTable-DBAoNnCU.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./iconBase-BEJYyZsk.js";import"./Settings-BckUi175.js";import"./CarPelak-BYFY8OXg.js";import"./Download-DQ-VVIaV.js";import"./LabelField-B6eRSoQP.js";const x0=({province:x})=>{var E,l,w,m,uu,L,eu,ru,j,ou,i,G,N,X,T,W,R,M,J,F,au,D,S,v,Z,C,p,I,y,r,t,d,O,V,cu,a6,l6,lu,nu,Cu,Au,du,Fu,gu,iu,fu,hu,xu,ju,Su,bu,Eu,Lu,Iu,$u,wu,o,u,$,K,z,Y,P,U;const f=i6(),[q,b]=g.useState(),{parentCompanyPaymentByWeightOverview:a}=o6(_=>_.provinceSlice);return g.useEffect(()=>{f(O6(x)),s()!=="KillHouse"&&f(r0(x)).then(_=>{var Du;const t6=(Du=_.payload.data)==null?void 0:Du.map((c,s6)=>{var pu,Mu,ku,Tu,Ru,qu,_u,Hu,Nu,Vu,Ku,zu,Yu,Pu,Uu,Qu,Gu,Xu,Wu,Ju,vu,Zu,yu,Ou,Bu,mu,u6,e6;return[s6+1,c==null?void 0:c.name,(Mu=Math.ceil((pu=c==null?void 0:c.wageInfo)==null?void 0:pu.totalWage))==null?void 0:Mu.toLocaleString(),(Tu=Math.ceil((ku=c==null?void 0:c.wageInfo)==null?void 0:ku.totalPaidWage))==null?void 0:Tu.toLocaleString(),(qu=Math.ceil((Ru=c==null?void 0:c.wageInfo)==null?void 0:Ru.off))==null?void 0:qu.toLocaleString(),(Hu=Math.ceil((_u=c==null?void 0:c.wageInfo)==null?void 0:_u.totalUnpaidWage))==null?void 0:Hu.toLocaleString(),(Vu=Math.ceil((Nu=c==null?void 0:c.wageInfo)==null?void 0:Nu.totalProvinceLiveWeight))==null?void 0:Vu.toLocaleString(),(zu=Math.ceil((Ku=c==null?void 0:c.wageInfo)==null?void 0:Ku.totalProvinceCarcassesWeight))==null?void 0:zu.toLocaleString(),(Pu=Math.ceil((Yu=c==null?void 0:c.wageInfo)==null?void 0:Yu.provinceKillRequestsTotalWeight))==null?void 0:Pu.toLocaleString(),(Qu=Math.ceil((Uu=c==null?void 0:c.wageInfo)==null?void 0:Uu.provinceKillRequestsTotalWage))==null?void 0:Qu.toLocaleString(),(Xu=Math.ceil((Gu=c==null?void 0:c.wageInfo)==null?void 0:Gu.freeBarsOutProvinceCarcasesTotalWeight))==null?void 0:Xu.toLocaleString(),(Ju=Math.ceil((Wu=c==null?void 0:c.wageInfo)==null?void 0:Wu.freeBarsOutProvinceCarcasesTotalWage))==null?void 0:Ju.toLocaleString(),(Zu=Math.ceil((vu=c==null?void 0:c.wageInfo)==null?void 0:vu.freeBarsCarcasesTotalWeight))==null?void 0:Zu.toLocaleString(),(Ou=Math.ceil((yu=c==null?void 0:c.wageInfo)==null?void 0:yu.freeBarsCarcasesTotalWage))==null?void 0:Ou.toLocaleString(),(mu=Math.ceil((Bu=c==null?void 0:c.wageInfo)==null?void 0:Bu.freeBarsLiveTotalWeight))==null?void 0:mu.toLocaleString(),(e6=Math.ceil((u6=c==null?void 0:c.wageInfo)==null?void 0:u6.freeBarsLiveTotalWage))==null?void 0:e6.toLocaleString()]});b(t6)})},[f,x]),e.jsxs(A,{container:!0,justifyContent:"center",xs:12,mt:1,children:[e.jsxs(A,{isDashboard:!0,container:!0,justifyContent:"center",xs:12,p:2,children:[e.jsx(A,{container:!0,xs:12,justifyContent:"space-between",children:(s()==="KillHouse"||s()==="ChainCompany")&&e.jsx(A,{children:e.jsx(k,{variant:"contained",onClick:()=>{f(c6({title:"پرداخت تعرفه",content:e.jsx(o0,{})}))},children:"پرداخت تعرفه"})})}),e.jsx(B,{isDashboard:!0,noPagination:!0,title:"اطلاعات کلی تعرفه",columns:["کل تعرفه (ریال)","کل تعرفه پرداخت شده (ریال)","تخفیف (ریال)","کل تعرفه پرداخت نشده (ریال)"],data:[[(l=Math.ceil((E=a==null?void 0:a.wageInfo)==null?void 0:E.totalWage))==null?void 0:l.toLocaleString(),(m=Math.ceil((w=a==null?void 0:a.wageInfo)==null?void 0:w.totalPaidWage))==null?void 0:m.toLocaleString(),(L=Math.ceil((uu=a==null?void 0:a.wageInfo)==null?void 0:uu.off))==null?void 0:L.toLocaleString(),(ru=Math.ceil((eu=a==null?void 0:a.wageInfo)==null?void 0:eu.totalUnpaidWage))==null?void 0:ru.toLocaleString()]]}),s()!=="KillHouse"&&e.jsx(B,{noPagination:!0,title:"جزئیات کلی تعرفه",columns:["کل وزن زنده کشتار داخل استان (کیلوگرم)","وزن لاشه کشتار داخل استان (کیلوگرم)","وزن توزیع لاشه داخل استان (کیلوگرم)","تعرفه توزیع لاشه داخل استان (ریال)","وزن توزیع لاشه به خارج استان (کیلوگرم)","تعرفه توزیع لاشه خارج استان (ریال)","وزن لاشه ورودی به استان (کیلوگرم)","تعرفه لاشه ورودی به استان (ریال)","وزن مرغ زنده ورودی به استان (کیلوگرم)","تعرفه مرغ زنده ورودی به استان (ریال)"],data:[[(ou=Math.ceil((j=a==null?void 0:a.wageInfo)==null?void 0:j.totalProvinceLiveWeight))==null?void 0:ou.toLocaleString(),(G=Math.ceil((i=a==null?void 0:a.wageInfo)==null?void 0:i.totalProvinceCarcassesWeight))==null?void 0:G.toLocaleString(),(X=Math.ceil((N=a==null?void 0:a.wageInfo)==null?void 0:N.provinceKillRequestsTotalWeight))==null?void 0:X.toLocaleString(),(W=Math.ceil((T=a==null?void 0:a.wageInfo)==null?void 0:T.provinceKillRequestsTotalWage))==null?void 0:W.toLocaleString(),(M=Math.ceil((R=a==null?void 0:a.wageInfo)==null?void 0:R.freeBarsOutProvinceCarcasesTotalWeight))==null?void 0:M.toLocaleString(),(F=Math.ceil((J=a==null?void 0:a.wageInfo)==null?void 0:J.freeBarsOutProvinceCarcasesTotalWage))==null?void 0:F.toLocaleString(),(D=Math.ceil((au=a==null?void 0:a.wageInfo)==null?void 0:au.freeBarsCarcasesTotalWeight))==null?void 0:D.toLocaleString(),(v=Math.ceil((S=a==null?void 0:a.wageInfo)==null?void 0:S.freeBarsCarcasesTotalWage))==null?void 0:v.toLocaleString(),(C=Math.ceil((Z=a==null?void 0:a.wageInfo)==null?void 0:Z.freeBarsLiveTotalWeight))==null?void 0:C.toLocaleString(),(I=Math.ceil((p=a==null?void 0:a.wageInfo)==null?void 0:p.freeBarsLiveTotalWage))==null?void 0:I.toLocaleString()]]})]}),e.jsx(A,{container:!0,justifyContent:"center",xs:12,mt:2,mb:2,children:e.jsx(B,{noPagination:!0,title:"مبنای تعرفه به ازای هر کیلوگرم (ریال)",columns:["تعرفه پایه توزیع لاشه درون استان","تعرفه پایه توزیع لاشه خارج استان","تعرفه پایه خرید مرغ زنده خارج از استان","تعرفه پایه لاشه خارج از استان"],data:[[(r=(y=a==null?void 0:a.wageInfo)==null?void 0:y.provinceLiveWageAmount)==null?void 0:r.toLocaleString(),(d=(t=a==null?void 0:a.wageInfo)==null?void 0:t.freeSellCarcessesWeightAmount)==null?void 0:d.toLocaleString(),(V=(O=a==null?void 0:a.wageInfo)==null?void 0:O.freeBuyingLiveWeightAmount)==null?void 0:V.toLocaleString(),(a6=(cu=a==null?void 0:a.wageInfo)==null?void 0:cu.freeBuyingCarcessesWeightAmount)==null?void 0:a6.toLocaleString()]]})}),e.jsx(A,{container:!0,justifyContent:"center",xs:12,mt:1,children:e.jsx(B,{noPagination:s()==="KillHouse",paginated:s()!=="KillHouse",title:"جزئیات",columns:s()==="KillHouse"?["کل تعرفه (ریال)","کل تعرفه پرداخت شده (ریال)","تخفیف (ریال)","کل تعرفه پرداخت نشده (ریال)","کل وزن زنده کشتار داخل استان (کیلوگرم)","وزن لاشه کشتار داخل استان (کیلوگرم)","وزن توزیع لاشه داخل استان (کیلوگرم)","تعرفه توزیع لاشه داخل استان (ریال)","وزن توزیع لاشه به خارج استان (کیلوگرم)","تعرفه توزیع لاشه خارج استان (ریال)","وزن لاشه ورودی به استان (کیلوگرم)","تعرفه لاشه ورودی به استان (ریال)","وزن مرغ زنده ورودی به استان (کیلوگرم)","تعرفه مرغ زنده ورودی به استان (ریال)"]:["ردیف","کشتارگاه","کل تعرفه (ریال)","کل تعرفه پرداخت شده (ریال)","تخفیف (ریال)","کل تعرفه پرداخت نشده (ریال)","کل وزن زنده کشتار داخل استان (کیلوگرم)","وزن لاشه کشتار داخل استان (کیلوگرم)","وزن توزیع لاشه داخل استان (کیلوگرم)","تعرفه توزیع لاشه داخل استان (ریال)","وزن توزیع لاشه به خارج استان (کیلوگرم)","تعرفه توزیع لاشه خارج استان (ریال)","وزن لاشه ورودی به استان (کیلوگرم)","تعرفه لاشه ورودی به استان (ریال)","وزن مرغ زنده ورودی به استان (کیلوگرم)","تعرفه مرغ زنده ورودی به استان (ریال)"],data:s()==="KillHouse"?[[(lu=Math.ceil((l6=a==null?void 0:a.wageInfo)==null?void 0:l6.totalWage))==null?void 0:lu.toLocaleString(),(Cu=Math.ceil((nu=a==null?void 0:a.wageInfo)==null?void 0:nu.totalPaidWage))==null?void 0:Cu.toLocaleString(),(du=Math.ceil((Au=a==null?void 0:a.wageInfo)==null?void 0:Au.off))==null?void 0:du.toLocaleString(),(gu=Math.ceil((Fu=a==null?void 0:a.wageInfo)==null?void 0:Fu.totalUnpaidWage))==null?void 0:gu.toLocaleString(),(fu=Math.ceil((iu=a==null?void 0:a.wageInfo)==null?void 0:iu.totalProvinceLiveWeight))==null?void 0:fu.toLocaleString(),(xu=Math.ceil((hu=a==null?void 0:a.wageInfo)==null?void 0:hu.totalProvinceCarcassesWeight))==null?void 0:xu.toLocaleString(),(Su=Math.ceil((ju=a==null?void 0:a.wageInfo)==null?void 0:ju.provinceKillRequestsTotalWeight))==null?void 0:Su.toLocaleString(),(Eu=Math.ceil((bu=a==null?void 0:a.wageInfo)==null?void 0:bu.provinceKillRequestsTotalWage))==null?void 0:Eu.toLocaleString(),(Iu=Math.ceil((Lu=a==null?void 0:a.wageInfo)==null?void 0:Lu.freeBarsOutProvinceCarcasesTotalWeight))==null?void 0:Iu.toLocaleString(),(wu=Math.ceil(($u=a==null?void 0:a.wageInfo)==null?void 0:$u.freeBarsOutProvinceCarcasesTotalWage))==null?void 0:wu.toLocaleString(),(u=Math.ceil((o=a==null?void 0:a.wageInfo)==null?void 0:o.freeBarsCarcasesTotalWeight))==null?void 0:u.toLocaleString(),(K=Math.ceil(($=a==null?void 0:a.wageInfo)==null?void 0:$.freeBarsCarcasesTotalWage))==null?void 0:K.toLocaleString(),(Y=Math.ceil((z=a==null?void 0:a.wageInfo)==null?void 0:z.freeBarsLiveTotalWeight))==null?void 0:Y.toLocaleString(),(U=Math.ceil((P=a==null?void 0:a.wageInfo)==null?void 0:P.freeBarsLiveTotalWage))==null?void 0:U.toLocaleString()]]:q})}),e.jsx(a0,{province:x})]})},j0=({readOnly:x,province:f})=>{var D,S,v,Z,C,p,I,y;const[q,b]=g.useState([]),[a,E]=g.useState(!1),[l,w]=g.useState(0),[m,uu]=g.useState(10),[L,eu]=g.useState(""),ru=r=>{eu(r.target.value)},[,,j,ou,i,G]=g.useContext(g6),N=async(r,t)=>{E(!0);const d=await r6.get(`${f}parent-company-out-province-poultry-requests/?search=filter&value=${t}&page=${r}&role=${s()}&page_size=${m}&date1=${j}&date2=${i}&state=accepted`);b(d.data.results),w(d.data.count),E(!1)},X=r=>{N(r,L)},T=async(r,t)=>{E(!0);const d=await r6.get(`${f}parent-company-out-province-poultry-requests/?search=filter&value=${L}&page=${t}&role=${s()}&page_size=${r}&date1=${j}&date2=${i}&state=accepted`);b(d.data.results),w(d.data.count),uu(r),E(!1)};g.useEffect(()=>{N(1)},[]);const W=async r=>{r.preventDefault(),E(!0);try{const t=await r6.get(`${f}parent-company-out-province-poultry-requests/?search=filter&value=${L}&date1=${j}&date2=${i}&state=accepted&role=${s()}`);b(t.data.results),w(t.data.count)}catch(t){console.error("Error fetching data:",t)}finally{E(!1)}},R=o6(r=>r.userSlice.userProfile.key);g.useEffect(()=>{N(1)},[j,i,f]);const M=[{name:"ردیف",selector:(r,t)=>t+1,sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"60px"},{name:"وضعیت",selector:r=>e.jsx(n,{variant:"body2",style:{color:"green"},children:r.outState}),sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"ثبت کننده سفارش",selector:(r,t)=>{var d;return`${(d=r==null?void 0:r.registrar)==null?void 0:d.fullname}`},sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"کد سفارش",selector:r=>r.orderCode,sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"اطلاعات خریدار",selector:r=>{var t,d,O,V;return(t=r.buyer)!=null&&t.firstName?`${(d=r.buyer)==null?void 0:d.firstName} ${(O=r.buyer)==null?void 0:O.lastName} (${(V=r.buyer)==null?void 0:V.mobile}) / ${r.buyer.province} - ${r.buyer.city}`:`${r.buyerFullname} (${r.buyerMobile}) / ${r.buyerProvince} - ${r.buyerCity}`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"پرداخت کننده",selector:r=>r!=null&&r.hasWage?r==null?void 0:r.payerFullname:"-",sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"مرغدار",selector:r=>{var t;return`${(t=r.poultry)==null?void 0:t.unitName} (${r.poultry.user.mobile})`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"میانگین وزن (کیلوگرم)",selector:r=>{var t;return(t=r.IndexWeight)==null?void 0:t.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"تعداد",selector:r=>r.quantity.toLocaleString(),sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"وزن کل (کیلوگرم)",selector:r=>{var t;return(t=Math.floor(r.IndexWeight*r.quantity))==null?void 0:t.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"ثبت کد قرنطینه",selector:r=>e.jsx(h0,{item:r,readOnly:s()==="CityOperator"}),sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"140px"},{name:"کد بهداشتی ماشین",selector:r=>{var t,d;return x?(t=r==null?void 0:r.outProvinceDriverInfo)==null?void 0:t.driverhealthCode:e.jsx(t0,{item:r,trafficCode:(d=r==null?void 0:r.outProvinceDriverInfo)==null?void 0:d.driverhealthCode})},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"140px"},{name:"نوع خودرو",selector:r=>{var t,d;return(t=r==null?void 0:r.outProvinceDriverInfo)!=null&&t.driverCar?(d=r==null?void 0:r.outProvinceDriverInfo)==null?void 0:d.driverCar:"-"},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"پلاک",selector:r=>{var t,d;return(t=r==null?void 0:r.outProvinceDriverInfo)!=null&&t.driverPelak?(d=r==null?void 0:r.outProvinceDriverInfo)==null?void 0:d.driverPelak:"-"},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"نام راننده",selector:r=>{var t,d;return(t=r==null?void 0:r.outProvinceDriverInfo)!=null&&t.driverName?(d=r==null?void 0:r.outProvinceDriverInfo)==null?void 0:d.driverName:"-"},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"تلفن راننده",selector:r=>{var t,d;return(t=r==null?void 0:r.outProvinceDriverInfo)!=null&&t.driverMobile?(d=r==null?void 0:r.outProvinceDriverInfo)==null?void 0:d.driverMobile:"-"},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"تاریخ ثبت درخواست",selector:r=>H6(r.createDate),sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"تاریخ کشتار",selector:r=>H6(r.sendDate),sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"سن مرغ",selector:r=>r.hatching.age,sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"نوع کشتار",selector:r=>r!=null&&r.freezing?"انجماد":"عادی",sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"تعرفه",selector:r=>r!=null&&r.hasWage?"دارد":"ندارد",sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"شهر",selector:r=>{var t;return(t=r.hatching)==null?void 0:t.city},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"استان",selector:r=>{var t;return(t=r.hatching)==null?void 0:t.province},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"مانده در سالن",selector:r=>{var t;return(t=r.hatching.leftOver)==null?void 0:t.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"جوجه ریزی اولیه",selector:r=>{var t;return(t=r.hatching.hatchingQuantity)==null?void 0:t.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0}],J=i6(),[F,au]=g.useState([]);return g.useEffect(()=>{J(l0({selectedDate1:j,selectedDate2:i,text:L,province:f})).then(r=>{au(r.payload.data)})},[j,i,f]),e.jsxs(A,{container:!0,alignItems:"start",direction:"column",gap:2,xs:12,mt:2,children:[e.jsxs(A,{container:!0,gap:2,xs:12,alignItems:"center",children:[e.jsx(A,{children:e.jsx(n,{variant:"body1",children:"درخواست های فروش خارج از استان"})}),e.jsx(A,{children:e.jsx(n6,{label:"از تاریخ",id:"date",renderInput:r=>e.jsx(su,{style:{width:"160px"},...r}),value:j,onChange:r=>{ou(_6(r).format("YYYY-MM-DD"))}})}),e.jsx(A,{children:e.jsx(n6,{label:"تا تاریخ",id:"date",renderInput:r=>e.jsx(su,{style:{width:"160px"},...r}),value:i,onChange:r=>{G(_6(r).format("YYYY-MM-DD"))}})}),e.jsxs("form",{onSubmit:W,children:[e.jsx(su,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:ru}),e.jsx(k,{type:"submit",onClick:W,endIcon:e.jsx(Y6,{}),children:"جستجو"})]}),e.jsx(A,{children:e.jsx(Q,{title:"خروجی اکسل",children:e.jsx("a",{href:`${f}bar_free_excel/?date1=${j}&date2=${i}&state=accepted&role=${s()}&key=${R}&search=filter&value=${L}`,rel:"noreferrer",children:e.jsx(k,{color:"success",children:e.jsx(tu,{size:32})})})})})]}),e.jsx(A,{container:!0,mt:2,mb:4,isDashboard:!0,children:e.jsx(B,{noPagination:!0,isDashboard:!0,columns:["تعداد بار","مجموع حجم","مجموع وزن","میانگین وزنی","تعداد بار های دارای کد قرنطینه","تعدا بار فاقد کد قرنطینه","مجموع جوجه ریزی","مجموع مانده در سالن"],data:[[(D=F==null?void 0:F.lenBar)==null?void 0:D.toLocaleString(),(S=F==null?void 0:F.quantity)==null?void 0:S.toLocaleString(),(v=F==null?void 0:F.weight)==null?void 0:v.toLocaleString(),(Z=F==null?void 0:F.indexWeight)==null?void 0:Z.toLocaleString(),(C=F==null?void 0:F.hasCode)==null?void 0:C.toLocaleString(),(p=F==null?void 0:F.hasntCode)==null?void 0:p.toLocaleString(),(I=F==null?void 0:F.hatchingQuantity)==null?void 0:I.toLocaleString(),(y=F==null?void 0:F.leftOver)==null?void 0:y.toLocaleString()]],title:"خلاصه اطلاعات"})}),e.jsx(A,{container:!0,gap:2,xs:12,justifyContent:"center",children:e.jsx(f0,{columns:M,data:q,progressPending:a,pagination:!0,paginationServer:!0,paginationTotalRows:l,onChangeRowsPerPage:T,onChangePage:X})})]})},S0=({province:x})=>{var nu,Cu,Au,du,Fu,gu,iu,fu,hu,xu,ju,Su,bu,Eu,Lu,Iu,$u,wu;const[,,f,q,b,a]=g.useContext(g6),E=o6(o=>o.userSlice),{parentCompanyBarsOverview:l}=o6(o=>o.vetFarmSlice);g.useEffect(()=>{const o=F6(new Date).format("YYYY-MM-DD");q(o),a(o)},[]);const[w,m]=g.useState(0),uu=(o,u)=>{m(u)},[L,eu]=g.useState(!1),ru=()=>{eu(!L)},j=i6(),ou=o=>{let u="";return o.trash===!0?u="حذف شده":o!=null&&o.wareHouseConfirmation?u="ورود به انبار":(o==null?void 0:o.assignmentStateArchive)!=="pending"?u="ثبت اطلاعات بار":o.vetState==="accepted"?u="تایید تخلیه":o.vetState==="pending"&&(u="در انتظار تخلیه"),e.jsx(n,{variant:"body2",color:o!=null&&o.trash?"error":"primary",children:u})},[i,G]=g.useState([]),[N,X]=g.useState(0),[T,W]=g.useState(10),R=async o=>{let u;j(V6()),u=await r6.get(`${x}parent_company_kill_house_request_bar_management/?check&search=filter&value=${t}&role=${s()}&date1=${f}&date2=${b}&page=${o}&page_size=${T}&without_quarantine_code_state=${L}`),j(K6()),G(u.data.results),X(u.data.count)},[M,J]=g.useState(1),F=o=>{R(o),J(o)},au=o=>{W(o),J(1)},D=()=>{R(M!==0?M:1)},S=!1;g.useEffect(()=>{R(M),j(N6({selectedDate1:f,selectedDate2:b,textValue:t,hasDocumentState:L,province:x}))},[f,b,L,T,x]),g.useEffect(()=>{R(1)},[]);const[v,Z]=g.useState([]),[C,p]=g.useState([]);g.useEffect(()=>{const o=i==null?void 0:i.map((u,$)=>{var K,z,Y,P,U,_,t6,Du,c,s6,pu,Mu,ku,Tu,Ru,qu,_u,Hu,Nu,Vu,Ku,zu,Yu,Pu,Uu,Qu,Gu,Xu,Wu,Ju,vu,Zu,yu,Ou,Bu,mu,u6,e6,f6,h6,x6,j6,S6,b6,E6,L6,I6,$6,w6,D6,p6,M6,k6,T6;return[e.jsxs(A,{id:"merge",container:!0,alignItems:"center",justifyContent:"center",style:{minWidth:s()==="VetFarm"||s()==="AdminX"||s()==="SuperAdmin"?"100px":"50px"},children:[(S==null?void 0:S.allow)&&(s()==="VetFarm"||s()==="AdminX"||s()==="SuperAdmin")&&e.jsx(A,{item:!0,children:u!=null&&u.clearanceCode&&(u!=null&&u.aggregateCode)?e.jsx(C6,{control:e.jsx(Q,{title:"حذف از ادغام",placement:"top",children:e.jsx(P6,{color:"error",disabled:(i==null?void 0:i.filter(h=>h.aggregateCode===(u==null?void 0:u.aggregateCode)).length)<3,onClick:()=>{j(s0({kill_house_request_key:u==null?void 0:u.key})).then(h=>{h.payload.error?I({vertical:"top",horizontal:"center",msg:h.payload.error,severity:"error"}):(p([]),D(),I({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:e.jsx(i0,{})},$)})}):e.jsx(C6,{control:e.jsx(R6,{disabled:C.length&&!(((Y=(z=(K=C[0])==null?void 0:K.poultryRequest)==null?void 0:z.poultry)==null?void 0:Y.unitName)===((U=(P=u==null?void 0:u.poultryRequest)==null?void 0:P.poultry)==null?void 0:U.unitName)&&((t6=(_=C[0])==null?void 0:_.killhouseUser)==null?void 0:t6.name)===((Du=u==null?void 0:u.killhouseUser)==null?void 0:Du.name))||(u==null?void 0:u.clearanceCode)&&(u==null?void 0:u.aggregateCode),checked:C.filter(h=>(h==null?void 0:h.barCode)===(u==null?void 0:u.barCode)).length>0,onChange:()=>{C.some(h=>(h==null?void 0:h.barCode)===(u==null?void 0:u.barCode))?p(C.filter(h=>(h==null?void 0:h.barCode)!==(u==null?void 0:u.barCode))):u!=null&&u.aggregateCode?p(i==null?void 0:i.filter(h=>(h==null?void 0:h.aggregateCode)===(u==null?void 0:u.aggregateCode))):p([...C,u])},color:"primary"})})}),e.jsx(A,{item:!0,children:M===1?$+1:$+T*M/2+1})]},$),u!=null&&u.aggregateCode?e.jsxs(Q,{title:"مشاهده بارها",placement:"top",children:[" ",e.jsx(n,{variant:"body2",color:"primary",style:{cursor:"pointer"},onClick:()=>{lu()?I({vertical:"top",horizontal:"center",msg:`فقط بارهای با خریدار و مرغدار یکسان و با مجموع تعداد حداکثر ${S==null?void 0:S.limitation} میتوانید ادغام کنید!`,severity:"error"}):j(c6({title:"مشاهده بارهای ادغام شده",content:e.jsx(z6,{toShow:!0,setAggregates:p,bars:i==null?void 0:i.filter(h=>(h==null?void 0:h.aggregateCode)===(u==null?void 0:u.aggregateCode))})}))},children:"دارد"})]}):e.jsx(n,{variant:"body2",children:"ندارد"}),ou(u),e.jsx(n,{style:{fontSize:"13px",color:u!=null&&u.trash?"red":"black"},children:u.barCode},$),B6(u.createDate),(c=u==null?void 0:u.poultryRequest)!=null&&c.freezing?"انجماد":(s6=u==null?void 0:u.poultryRequest)!=null&&s6.export?"صادرات":"عادی",`${(pu=u.killhouseUser)==null?void 0:pu.name} (${(Tu=(ku=(Mu=u.killhouseUser)==null?void 0:Mu.killHouseOperator)==null?void 0:ku.user)==null?void 0:Tu.mobile})`,u!=null&&u.killer?`${(Ru=u==null?void 0:u.killer)==null?void 0:Ru.name} (${(Hu=(_u=(qu=u==null?void 0:u.killer)==null?void 0:qu.killHouseOperator)==null?void 0:_u.user)==null?void 0:Hu.mobile})`:"-",`${(Ku=(Vu=(Nu=u.poultryRequest)==null?void 0:Nu.poultry)==null?void 0:Vu.user)==null?void 0:Ku.fullname} (${(Yu=(zu=u.poultryRequest.poultry)==null?void 0:zu.user)==null?void 0:Yu.mobile})`,`${(Uu=(Pu=u.poultryRequest)==null?void 0:Pu.poultry)==null?void 0:Uu.unitName}`,(Qu=u.quantity)==null?void 0:Qu.toLocaleString(),(Xu=(Gu=u==null?void 0:u.weightInfo)==null?void 0:Gu.weight)==null?void 0:Xu.toLocaleString(),e.jsx(A0,{updateTable:D,killHouseRequestKey:u.key,trafficCode:u==null?void 0:u.trafficCode,isEditable:(s()==="ProvinceOperator"||s()==="SuperAdmin"||s()==="VetFarm"||s()==="VetSupervisor"||s()==="AdminX"||s()==="CityVet"||s()==="Supporter")&&u.trash!==!0&&u.assignmentStateArchive==="pending"&&!(u!=null&&u.clearanceCode)},$),e.jsx(c0,{item:u,updateTable:D,isEditable:s()==="VetFarm"||s()==="ProvinceOperator"||s()==="SuperAdmin"||s()==="CityVet"||s()==="VetSupervisor"||s()==="AdminX"||s()==="Supporter"},$),e.jsx(e.Fragment,{children:u!=null&&u.quarantineQuantity?e.jsx(n0,{code:u==null?void 0:u.quarantineQuantity,updateTable:D,item:u}):e.jsxs(e.Fragment,{children:[(u==null?void 0:u.quarantineCodeState)&&((u==null?void 0:u.quarantineCodeState)==="contradiction"?"مغایرت کد رهگیری":(u==null?void 0:u.quarantineCodeState)==="noclearance"?"فاقد کد رهگیری":(u==null?void 0:u.quarantineCodeState)==="merge"?"ادغام":"عدم تایید راهداری"),(s()==="ProvinceOperator"||s()==="SuperAdmin"||s()==="AdminX"||s()==="Supporter")&&e.jsx(k,{onClick:()=>{j(c6({title:"تعداد ثبت شده در قرنطینه",content:e.jsx(C0,{item:u,updateTable:D})}))},children:u!=null&&u.quarantineCodeState?"ویرایش":"ثبت"})]})}),`${u.addCar.driver.typeCar} ${u.addCar.driver.pelak}`,`${u.addCar.driver.driverName} (${u.addCar.driver.driverMobile})`,u.poultryRequest.chickenBreed,(Ju=(Wu=u==null?void 0:u.weightInfo)==null?void 0:Wu.indexWeight)==null?void 0:Ju.toLocaleString(),((Zu=(vu=u==null?void 0:u.poultryRequest)==null?void 0:vu.amount)==null?void 0:Zu.toLocaleString())+" ﷼",((Ou=(yu=u==null?void 0:u.weightInfo)==null?void 0:yu.killHousePrice)==null?void 0:Ou.toLocaleString())+" ﷼",(u6=(mu=(Bu=u==null?void 0:u.vetFarm)==null?void 0:Bu.vet)==null?void 0:mu.user)!=null&&u6.fullname?((h6=(f6=(e6=u==null?void 0:u.vetFarm)==null?void 0:e6.vet)==null?void 0:f6.user)==null?void 0:h6.fullname)+`(${(S6=(j6=(x6=u==null?void 0:u.vetFarm)==null?void 0:x6.vet)==null?void 0:j6.user)==null?void 0:S6.mobile})`:"فاقد دامپزشک",`${u.killPlace}`,u.poultryRequest.poultry.address.city.name,u!=null&&u.poultryRequest.sendDate?m6(new Date(u==null?void 0:u.poultryRequest.sendDate),"yyyy/MM/dd"):"-",u==null?void 0:u.poultryRequest.orderCode,e.jsx(n,{variant:"body2",color:(b6=u==null?void 0:u.barDocumentStatus)!=null&&b6.isError?"error":"primary",children:(E6=u==null?void 0:u.barDocumentStatus)!=null&&E6.title?(L6=u==null?void 0:u.barDocumentStatus)==null?void 0:L6.title:"-"},$),e.jsx(F0,{src:(I6=u==null?void 0:u.assignmentInfo)==null?void 0:I6.imageWithBar},$),($6=u.acceptedRealQuantity)==null?void 0:$6.toLocaleString(),(w6=u==null?void 0:u.acceptedRealWeight)==null?void 0:w6.toLocaleString(),(p6=(D6=u==null?void 0:u.weightInfo)==null?void 0:D6.finalIndexWeight)==null?void 0:p6.toLocaleString(),(M6=u==null?void 0:u.wareHouseAcceptedRealQuantity)==null?void 0:M6.toLocaleString(),(k6=u==null?void 0:u.wareHouseAcceptedRealWeight)==null?void 0:k6.toLocaleString(),(T6=u==null?void 0:u.weightLoss)==null?void 0:T6.toLocaleString()]});Z(o)},[i,C]);const[I]=g.useContext(g6),y=o=>{q(o)},r=o=>{a(o)},[t,d]=g.useState(""),O=o=>{d(o.target.value)},V=async o=>{o.preventDefault(),j(V6());try{const u=await r6.get(`${x}parent_company_kill_house_request_bar_management/?check&role=${s()}&search=filter&value=${t}&date1=${f}&date2=${b}&page=1&page_size=${T}&without_quarantine_code_state=${L}`);G(u.data.results),X(u.data.count),j(K6())}catch(u){console.error("Error fetching data:",u)}j(N6({selectedDate1:f,selectedDate2:b,textValue:t}))};g.useEffect(()=>{w===0&&R(1)},[f,b,L,w]);const cu=o6(o=>o.userSlice.userProfile.key),a6=e.jsxs(A,{container:!0,alignItems:"start",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,children:[e.jsxs(A,{container:!0,alignItems:"center",gap:H.SMALL,xs:12,children:[e.jsx(n,{children:"مدیریت بارها"}),e.jsx(A,{style:{width:"150px"},children:e.jsx(n6,{label:"از تاریخ",id:"date",renderInput:o=>e.jsx(su,{...o}),value:f,onChange:o=>{y(F6(o).format("YYYY-MM-DD"))}})}),e.jsx(A,{style:{width:"150px"},children:e.jsx(n6,{label:"تا تاریخ",id:"date",renderInput:o=>e.jsx(su,{...o}),value:b,onChange:o=>{r(F6(o).format("YYYY-MM-DD"))}})}),e.jsxs("form",{onSubmit:V,children:[e.jsx(su,{autoComplete:"off",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:O}),e.jsx(k,{type:"submit",onClick:V,endIcon:e.jsx(Y6,{}),children:"جستجو"})]}),(s()==="SuperAdmin"||s()==="Supporter"||s()==="AdminX")&&e.jsx(C6,{control:e.jsx(R6,{checked:L,onChange:ru,name:"item4"}),label:"بدون وضعیت قرنطینه"})]}),e.jsx(A,{container:!0,alignItems:"center",gap:H.SMALL,xs:12,children:e.jsxs(U6,{style:{width:"100%"},children:[e.jsx(Q6,{expandIcon:e.jsx(g0,{}),"aria-controls":"panel1-content",id:"panel1-header",children:e.jsx(n,{children:"گزارش خروجی ها"})}),e.jsx(G6,{children:e.jsxs(A,{container:!0,justifyContent:"space-between",alignItems:"center",xs:12,p:1,children:[e.jsxs(A,{display:"grid",justifyContent:"center",children:[e.jsx(Q,{placement:"top",title:"خروجی اکسل",children:e.jsx(k,{color:"success",onClick:()=>{var u;I({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const o=`${x}bar_excel/?start=${f}&end=${b}&key=${(u=E==null?void 0:E.userProfile)==null?void 0:u.key}&role=${s()}&search=filter&value=${t}`;window.location.href=o},children:e.jsx(tu,{size:32})})}),e.jsx(n,{variant:"body2",children:"خروجی اکسل "})]}),s()!=="VetFarm"&&s()!=="CityPoultry"&&e.jsxs(A,{display:"grid",justifyContent:"center",children:[e.jsx(Q,{placement:"top",title:"خروجی اکسل گزارش جامع",children:e.jsx(k,{color:"warning",onClick:()=>{I({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const o=`${x}detail_of_killing_excel/?date1=${f}&date2=${b}&role=${s()}&key=${cu}`;window.location.href=o},children:e.jsx(tu,{size:32})})}),e.jsx(n,{variant:"body2",children:"گزارش جامع "})]}),e.jsxs(A,{display:"grid",justifyContent:"center",children:[e.jsx(Q,{placement:"top",title:"خروجی اکسل گزارش پایش کشتارگاه",children:e.jsx(k,{color:"primary",onClick:()=>{I({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const o=`${x}comprehensive_report_of_the_slaughterhouse_excel/?date1=${f}&date2=${b}`;window.location.href=o},children:e.jsx(tu,{size:32})})}),e.jsx(n,{variant:"body2",children:"پایش کشتارگاه "})]}),e.jsxs(A,{display:"grid",justifyContent:"center",children:[e.jsx(Q,{placement:"top",title:"خروجی اکسل گزارش عملکرد کشتارگاه ها",children:e.jsx(k,{style:{color:"gray"},onClick:()=>{I({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const o=`${x}from_allocation_to_distribution_excel/?date1=${f}&date2=${b}`;window.location.href=o},children:e.jsx(tu,{size:32})})}),e.jsx(n,{variant:"body2",children:"گزارش عملکرد کشتارگاه ها"})]}),e.jsxs(A,{display:"grid",justifyContent:"center",children:[e.jsx(Q,{placement:"top",title:"خروجی اکسل پایش بارها",children:e.jsx(k,{color:"error",onClick:()=>{I({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const o=`${x}monitor_loads_excel/?role=${s()}&key=${cu}&date1=${f}&date2=${b}`;window.location.href=o},children:e.jsx(tu,{size:32})})}),e.jsx(n,{variant:"body2",children:"پایش بارها "})]})]})})]})})]});let l6=e.jsxs(X6,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:w,onChange:uu,children:[e.jsx(A6,{label:"اطلاعات بارها",value:0}),e.jsx(A6,{label:"فروش خارج استان",value:4}),e.jsx(A6,{label:"بارهای زنجیره",value:5})]});const lu=()=>(C==null?void 0:C.reduce((o,u)=>o+(u==null?void 0:u.quantity),0))>(S==null?void 0:S.limitation)||!C.every(o=>{var u,$,K,z,Y,P,U,_;return(($=(u=o.poultryRequest)==null?void 0:u.poultry)==null?void 0:$.unitName)===((Y=(z=(K=C[0])==null?void 0:K.poultryRequest)==null?void 0:z.poultry)==null?void 0:Y.unitName)&&((P=o.killhouseUser)==null?void 0:P.name)===((_=(U=C[0])==null?void 0:U.killhouseUser)==null?void 0:_.name)});return e.jsxs(A,{container:!0,direction:"column",flexWrap:"nowrap",mt:H.SMALL,xs:12,children:[e.jsx(A,{container:!0,justifyContent:"center",mb:H.MEDIUM,children:l6}),w===0&&e.jsxs(A,{container:!0,mt:H.MEDIUM,alignItems:"center",justifyContent:"center",xs:12,children:[a6,e.jsx(A,{container:!0,mt:2,mb:4,isDashboard:!0,children:e.jsx(B,{title:"اطلاعات کلی",noPagination:!0,isDashboard:!0,columns:["تعداد بارها","حجم بارها","وزن بارها","میانگین وزن","کمترین سن ","بیشترین سن ","میانگین سنی","بارهای دارای کد قرنطینه","حجم بارهای دارای کد قرنطینه","بارهای احراز شده از قرنطینه","حجم بارهای احراز شده از قرنطینه","بارهای فاقد کد قرنطینه","حجم بارهای فاقد کد قرنطینه","بارهایی که در قرنطینه و رصدیار اختلاف دارند","بارهای تکمیل شده کشتارگاه","حجم نهایی در کشتارگاه ","وزن نهایی در کشتارگاه","تعداد بار ورودی به انبار","حجم لاشه های انبار","وزن لاشه های انبار","درصد افت بار انبار"],data:[[e.jsx(n,{variant:"caption",style:{color:"blue"},children:(nu=l==null?void 0:l.lenKillRequest)==null?void 0:nu.toLocaleString()},"1"),e.jsx(n,{variant:"caption",children:(Cu=l==null?void 0:l.killRequestQuantity)==null?void 0:Cu.toLocaleString()},"1"),e.jsx(n,{variant:"caption",style:{color:"blue"},children:(Au=l==null?void 0:l.killRequestWeight)==null?void 0:Au.toLocaleString()},"1"),e.jsx(n,{variant:"caption",children:l==null?void 0:l.avgWeight},"1"),e.jsx(n,{variant:"caption",style:{color:"blue"},children:l==null?void 0:l.minAge},"1"),e.jsx(n,{variant:"caption",children:l==null?void 0:l.maxAge},"1"),e.jsx(n,{variant:"caption",style:{color:"blue"},children:l==null?void 0:l.avgAge},"1"),e.jsx(n,{variant:"caption",children:(du=l==null?void 0:l.lenKillRequestHasCode)==null?void 0:du.toLocaleString()},"1"),e.jsx(n,{variant:"caption",style:{color:"blue"},children:(Fu=l==null?void 0:l.quantityOfKillRequestHasCode)==null?void 0:Fu.toLocaleString()},"1"),e.jsx(n,{variant:"caption",children:(gu=l==null?void 0:l.lenKillRequestHasQuarantine)==null?void 0:gu.toLocaleString()},"1"),e.jsx(n,{variant:"caption",style:{color:"blue"},children:(iu=l==null?void 0:l.quantityOfKillRequestHasQuarantine)==null?void 0:iu.toLocaleString()},"1"),e.jsx(n,{variant:"caption",children:(fu=l==null?void 0:l.lenKillRequestHasNotCode)==null?void 0:fu.toLocaleString()},"1"),e.jsx(n,{variant:"caption",style:{color:"blue"},children:(hu=l==null?void 0:l.quantityOfKillRequestHasNotCode)==null?void 0:hu.toLocaleString()},"1"),e.jsx(n,{variant:"caption",children:(xu=l==null?void 0:l.differenceBar)==null?void 0:xu.toLocaleString()},"1"),e.jsx(n,{variant:"caption",style:{color:"blue"},children:(ju=l==null?void 0:l.lenCompleteWithKillHouse)==null?void 0:ju.toLocaleString()},"1"),e.jsx(n,{variant:"caption",children:(Su=l==null?void 0:l.quantityFinalKillHouse)==null?void 0:Su.toLocaleString()},"1"),e.jsx(n,{variant:"caption",style:{color:"blue"},children:(bu=l==null?void 0:l.weightFinalKillHouse)==null?void 0:bu.toLocaleString()},"1"),e.jsx(n,{variant:"caption",children:(Eu=l==null?void 0:l.wareHouseBars)==null?void 0:Eu.toLocaleString()},"1"),e.jsx(n,{variant:"caption",style:{color:"blue"},children:(Lu=l==null?void 0:l.wareHouseBarsQuantity)==null?void 0:Lu.toLocaleString()},"1"),e.jsx(n,{variant:"caption",children:(Iu=l==null?void 0:l.wareHouseBarsWeight)==null?void 0:Iu.toLocaleString()},"1"),e.jsx(n,{variant:"caption",style:{color:"blue"},children:(wu=($u=l==null?void 0:l.wareHouseBarsWeightLose)==null?void 0:$u.toFixed(2))==null?void 0:wu.toLocaleString()},"1")]]})}),(S==null?void 0:S.allow)&&(s()==="VetFarm"||s()==="AdminX"||s()==="SuperAdmin")&&e.jsx(A,{id:"merge",container:!0,xs:12,justifyContent:"end",children:e.jsx(k,{color:lu()?"error":"primary",variant:"outlined",disabled:C.some(o=>o==null?void 0:o.clearanceCode)?!0:C.some(o=>o==null?void 0:o.aggregateCode)?!1:(C==null?void 0:C.length)<2,onClick:()=>{lu()?I({vertical:"top",horizontal:"center",msg:`فقط بارهای با خریدار و مرغدار یکسان و با مجموع تعداد حداکثر ${S==null?void 0:S.limitation} میتوانید ادغام کنید!`,severity:"error"}):j(c6({title:C.some(o=>o==null?void 0:o.aggregateCode)&&!C.some(o=>o==null?void 0:o.clearanceCode)?"ورود اطلاعات / لغو ادغام":"ادغام بارها",content:e.jsx(z6,{setAggregates:p,bars:C.some(o=>o==null?void 0:o.aggregateCode)?i==null?void 0:i.filter(o=>{var u;return(o==null?void 0:o.aggregateCode)===((u=C[0])==null?void 0:u.aggregateCode)}):C,updateTable:D,canReturn:C.some(o=>o==null?void 0:o.aggregateCode)&&!C.some(o=>o==null?void 0:o.clearanceCode)})}))},children:C.some(o=>o==null?void 0:o.aggregateCode)&&!C.some(o=>o==null?void 0:o.clearanceCode)?"ورود اطلاعات / لغو ادغام":"ادغام بارها"})}),e.jsx(B,{data:v,columns:["ردیف","ادغام","وضعیت","کدبار","تاریخ ثبت خودرو","نوع کشتار","خریدار","کشتارکن اختصاصی","مشخصات مرغدار","نام فارم","تعداد اولیه","وزن اولیه بار (کیلوگرم)","کد بهداشتی حمل و نقل","کدرهگیری سامانه قرنطینه","تعداد در قرنطینه","ماشین","راننده","نژاد","میانگین وزن اولیه (کیلوگرم)","قیمت مرغدار","قیمت کشتارگاه","دامپزشک فارم","محل کشتار","شهر","تاریخ کشتار","کدسفارش کشتار","وضعیت سند","سند (بارنامه)","تعداد نهایی","وزن نهایی بار (کیلوگرم)","میانگین وزن نهایی (کیلوگرم)","حجم لاشه","وزن لاشه","درصد افت"],handlePageChange:F,totalRows:N,page:M,perPage:T,handlePerRowsChange:au,title:"مدیریت بارها"})]}),w===4&&e.jsx(A,{mt:H.MEDIUM,children:e.jsx(j0,{readOnly:s()==="VetSupervisor"||s()==="CityOperator"||s()==="ProvinceSupervisor"||s()==="ParentCompany",province:x})}),w===5&&e.jsx(d0,{province:x})]})},b0=[{label:"استان مرکزی",value:"https://mabackend.rasadyar.com/"},{label:"استان همدان",value:"https://habackend.rasadyar.com/"},{label:"استان بوشهر",value:"https://bubackend.rasadyar.com/"}],l2=()=>{const[x,f]=g.useState("https://mabackend.rasadyar.com/"),{pathname:q}=Z6(),b=E=>f(E.target.value),a=()=>q.includes(u0)?e.jsx(x0,{province:x}):q.includes(e0)?e.jsx(S0,{province:x}):null;return e.jsx(q6,{display:"flex",justifyContent:"center",sx:{p:H.SMALL},children:e.jsxs(d6,{container:!0,direction:"column",justifyContent:"center",xs:12,md:10,children:[e.jsxs(d6,{container:!0,justifyContent:"space-between",gap:H.SMALL,children:[e.jsx(y6,{}),e.jsx(q6,{sx:{width:160},children:e.jsx(W6,{fullWidth:!0,children:e.jsx(J6,{labelId:"province-select-label",id:"province-select",value:x,onChange:b,children:b0.map(E=>e.jsx(v6,{value:E.value,children:E.label},E.value))})})})]}),e.jsx(d6,{container:!0,sx:{mt:H.MEDIUM},children:a()})]})})};export{l2 as default}; diff --git a/build/assets/Payment-BnucYNy2.js b/build/assets/Payment-BnucYNy2.js new file mode 100644 index 0000000..cb9f716 --- /dev/null +++ b/build/assets/Payment-BnucYNy2.js @@ -0,0 +1 @@ +import{i as d,j as e,b as r,a9 as x,T as i,am as o,B as h,cz as v,cA as g,cB as b,aI as A}from"./mui-vendor-CkIVaoQP.js";import{r as f,m as s,Q as j,G as w,S as p}from"./index-CeyyVc1v.js";import{u as y,f as S}from"./react-vendor-CmFgShSM.js";import"./redux-vendor-B7uoacJt.js";var l={},D=d;Object.defineProperty(l,"__esModule",{value:!0});var C=l.default=void 0,I=D(f()),R=e;C=l.default=(0,I.default)((0,R.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5m-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11m3.5 3c-2.33 0-4.31 1.46-5.11 3.5h10.22c-.8-2.04-2.78-3.5-5.11-3.5"}),"MoodBad");const M=({params:u})=>{const n=y();return e.jsx(r,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"80vh",backgroundColor:"#f4f6f8",p:2},children:e.jsx(s.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{duration:.6,ease:"easeOut"},children:e.jsxs(x,{elevation:6,sx:{width:400,p:4,borderRadius:3,display:"flex",flexDirection:"column",alignItems:"center",gap:3,backgroundColor:"white",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.12)"},children:[e.jsx(s.div,{initial:{scale:0},animate:{scale:1},transition:{duration:.5,ease:"easeOut"},children:e.jsx(C,{sx:{fontSize:60,color:"success.main",mb:2}})}),e.jsx(s.div,{initial:{scale:0},animate:{scale:1},transition:{duration:.5,ease:"easeOut"},children:e.jsx(i,{variant:"h5",color:"error.main",textAlign:"center",sx:{fontWeight:800},children:"تراکنش انجام نشد!"})}),e.jsx(i,{variant:"body1",color:"text.secondary",textAlign:"center",sx:{fontWeight:700},children:(u==null?void 0:u.error)||"خطای ناشناخته"}),e.jsx(i,{variant:"body2",color:"error",children:"در صورت کسر مبلغ از حساب با پشتیبانی تماس بگیرید."}),e.jsx(o,{sx:{width:"100%",mb:2}}),e.jsxs(r,{sx:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[e.jsx(i,{color:"text.secondary",children:"تاریخ و زمان:"}),e.jsx(i,{children:j(new Date((u==null?void 0:u.date)||new Date),"yyyy/MM/dd hh:mm:ss")})]}),e.jsx(s.div,{whileHover:{scale:1.05},whileTap:{scale:.95},children:e.jsx(h,{fullWidth:!0,variant:"contained",color:"primary",size:"large",onClick:()=>n("/"),sx:{borderRadius:3,textTransform:"none",fontWeight:600},children:"بازگشت"})})]})})})};var c={},P=d;Object.defineProperty(c,"__esModule",{value:!0});var m=c.default=void 0,_=P(f()),E=e;m=c.default=(0,_.default)((0,E.jsx)("path",{d:"M12 19c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M6 1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12-8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m-6 8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"Dialpad");const F=({params:u})=>{var t;const n=y();return e.jsx(r,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"80vh",backgroundColor:"#f4f6f8",p:2,borderRadius:"20px"},children:e.jsx(s.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{duration:.6,ease:"easeOut"},children:e.jsxs(x,{elevation:6,sx:{width:400,p:4,borderRadius:3,display:"flex",flexDirection:"column",alignItems:"center",gap:3,backgroundColor:"white",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.12)"},children:[e.jsx(s.div,{initial:{scale:0},animate:{scale:1},transition:{duration:.5,ease:"easeOut"},children:e.jsx(v,{sx:{fontSize:60,color:"success.main",mb:2}})}),e.jsx(i,{variant:"h5",color:"success.main",textAlign:"center",sx:{fontWeight:600},children:"تراکنش با موفقیت انجام شد."}),e.jsx(o,{sx:{width:"100%",mb:2}}),e.jsxs(r,{sx:{width:"100%",display:"flex",flexDirection:"column",gap:2},children:[e.jsx(a,{label:"تاریخ و زمان",value:j(new Date((u==null?void 0:u.date)||new Date),"yyyy/MM/dd hh:mm:ss")}),e.jsx(a,{label:"شماره کارت",value:u==null?void 0:u.cardHolderPan,icon:e.jsx(g,{fontSize:"small"})}),e.jsx(a,{label:"شماره پیگیری",value:u==null?void 0:u.saleReferenceId,icon:e.jsx(m,{fontSize:"small"})}),e.jsx(a,{label:"مبلغ",value:`${(t=parseInt(u==null?void 0:u.finalAmount))==null?void 0:t.toLocaleString()} ریال`,icon:e.jsx(b,{fontSize:"small"})})]}),e.jsx(o,{sx:{width:"100%",mb:2}}),e.jsx(s.div,{whileHover:{scale:1.05},whileTap:{scale:.95},children:e.jsx(h,{fullWidth:!0,variant:"contained",color:"primary",size:"large",onClick:()=>n("/"),sx:{borderRadius:3,textTransform:"none",fontWeight:600},children:"بازگشت"})})]})})})},a=({label:u,value:n,icon:t})=>e.jsxs(r,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1},children:[e.jsxs(i,{color:"text.secondary",sx:{fontWeight:500},children:[u,":"]}),e.jsxs(r,{sx:{display:"flex",alignItems:"center",gap:1},children:[t,e.jsx(i,{sx:{fontWeight:500},children:n})]})]}),O=()=>{const u=S(),n=new URLSearchParams(u.search),t=Object.fromEntries(n.entries());return e.jsxs(e.Fragment,{children:[(t==null?void 0:t.error)&&e.jsx(M,{params:t}),!(t!=null&&t.error)&&e.jsx(F,{params:t})]})},T=()=>e.jsx(A,{display:"flex",justifyContent:"center",children:e.jsx(w,{container:!0,direction:"column",justifyContent:"center",my:p.MEDIUM,xs:12,sm:12,md:10,lg:10,children:e.jsx(O,{})})});export{T as default}; diff --git a/build/assets/Person-Q1IHBezR.js b/build/assets/Person-Q1IHBezR.js new file mode 100644 index 0000000..8cd18b6 --- /dev/null +++ b/build/assets/Person-Q1IHBezR.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,s=o(a()),i=t;u=e.default=(0,s.default)((0,i.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person");export{u as d}; diff --git a/build/assets/Phone-Dv2y8iMM.js b/build/assets/Phone-Dv2y8iMM.js new file mode 100644 index 0000000..f4f313a --- /dev/null +++ b/build/assets/Phone-Dv2y8iMM.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(a()),s=t;u=e.default=(0,i.default)((0,s.jsx)("path",{d:"M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02z"}),"Phone");export{u as d}; diff --git a/build/assets/PictureAsPdf-oEJEta1d.js b/build/assets/PictureAsPdf-oEJEta1d.js new file mode 100644 index 0000000..582fe30 --- /dev/null +++ b/build/assets/PictureAsPdf-oEJEta1d.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},v=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,c=v(a()),i=t;u=e.default=(0,c.default)((0,i.jsx)("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5zm4-3H19v1h1.5V11H19v2h-1.5V7h3zM9 9.5h1v-1H9zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm10 5.5h1v-3h-1z"}),"PictureAsPdf");export{u as d}; diff --git a/build/assets/Plagiarism-BiXORbzo.js b/build/assets/Plagiarism-BiXORbzo.js new file mode 100644 index 0000000..7c16d8d --- /dev/null +++ b/build/assets/Plagiarism-BiXORbzo.js @@ -0,0 +1 @@ +import{i as a,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as i}from"./index-CeyyVc1v.js";var e={},o=a;Object.defineProperty(e,"__esModule",{value:!0});var s=e.default=void 0,u=o(i()),r=t;s=e.default=(0,u.default)([(0,r.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm1.04 17.45-1.88-1.88c-1.33.71-3.01.53-4.13-.59-1.37-1.37-1.37-3.58 0-4.95s3.58-1.37 4.95 0c1.12 1.12 1.31 2.8.59 4.13l1.88 1.88zM13 9V3.5L18.5 9z"},"0"),(0,r.jsx)("circle",{cx:"11.5",cy:"14.5",r:"1.5"},"1")],"Plagiarism");export{s as d}; diff --git a/build/assets/PolicyCouncil-0xtufC-L.js b/build/assets/PolicyCouncil-0xtufC-L.js new file mode 100644 index 0000000..2fd8ce7 --- /dev/null +++ b/build/assets/PolicyCouncil-0xtufC-L.js @@ -0,0 +1 @@ +import{j as t,b5 as C,b as x}from"./mui-vendor-CkIVaoQP.js";import{L as A,j as d,h as l,dN as p,G as _,dO as m,dP as E,S as I,dm as j,dj as f,dk as P,dl as g,dQ as T,dR as F,dS as N}from"./index-CeyyVc1v.js";import{r as c,f as D}from"./react-vendor-CmFgShSM.js";import{a as S,u as h,f as O}from"./redux-vendor-B7uoacJt.js";import{A as y}from"./AdvancedTable-BYmmBtmq.js";import{B as L}from"./BackButton-Crzr7NMa.js";import{R as w}from"./ResponsiveTable-w7hk7Uq8.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const U=S("POLICY_CHANGE_KILLHOUSE_DIRECT_BUY_SERVICE",async(e,{dispatch:u})=>{try{u(A());const{data:r,status:a}=await d.put("allow_direct_buying/0/",e);return u(l()),{data:r,status:a}}catch(r){return u(l()),{error:r.response.data.result}}}),H=()=>{const e=h(),{provinceGetKillhouses:u}=O(o=>o.provinceSlice),[r,a]=c.useState();return c.useEffect(()=>{e(p())},[]),c.useEffect(()=>{const o=u==null?void 0:u.map(s=>[s.killHouse.name,t.jsx(C,{checked:s.allow,onChange:n=>{e(U({direct_buying_key:s.key,allow:n.target.checked})).then(i=>{e(p())})},name:"checked",color:"primary"},"kkk"),t.jsx(C,{checked:s.exportStatus,onChange:n=>{e(U({direct_buying_key:s.key,export_status:n.target.checked})).then(i=>{e(p())})},name:"checked",color:"primary"},"kkk")]);a(o)},[u]),t.jsxs(_,{container:!0,children:[t.jsx(L,{}),t.jsx(y,{name:"اجازه خرید مستقیم",columns:["کشتارگاه/کشتارکن","خرید مستقیم","صادرات"],data:r})]})},G=S("POLICY_CHANGE_KILLHOUSE_GUILDS_SERVICE",async(e,{dispatch:u})=>{try{u(A());const{data:r,status:a}=await d.put("allow_register_guilds/0/",e);return u(l()),{data:r,status:a}}catch(r){return u(l()),{error:r.response.data.result}}}),Y=()=>{const e=h(),{provinceGetKillhousesGuilds:u}=O(o=>o.provinceSlice),[r,a]=c.useState();return c.useEffect(()=>{e(m())},[]),c.useEffect(()=>{const o=u==null?void 0:u.map((s,n)=>{var i,k;return[(i=s.killHouse)==null?void 0:i.name,(k=s.killHouse)!=null&&k.killer?"کشتارکن":"کشتارگاه",t.jsx(C,{checked:s.allow,onChange:R=>{e(G({register_guilds_key:s.key,allow:R.target.checked})).then(V=>{e(m())})},name:"checked",color:"primary"},n)]});a(o)},[u]),t.jsxs(_,{container:!0,children:[t.jsx(L,{}),t.jsx(w,{paginated:!0,title:"دسترسی به اصناف",columns:["کشتارگاه/کشتارکن","ماهیت","دسترسی"],data:r,customColors:[{name:"ماهیت",color:"green"}]})]})},v=S("POLICY_CHANGE_POULTRY_CHOOSE_SLAUGHTER_SERVICE",async(e,{dispatch:u})=>{try{u(A());const{data:r,status:a}=await d.put("province_allow_poultry_choose_kill_house/0/",e);return u(l()),{data:r,status:a}}catch(r){return u(l()),{error:r.response.data.result}}}),K=()=>{const e=h(),{provinceGetPoultries:u}=O(o=>o.provinceSlice),[r,a]=c.useState();return c.useEffect(()=>{e(E())},[]),c.useEffect(()=>{const o=u==null?void 0:u.map(s=>[s.name,t.jsx(C,{checked:s.allowState,onChange:n=>{e(v({poultry_key:s.key,allow:n.target.checked})).then(()=>{e(E())})},name:"checked",color:"primary"},"kkk")]);a(o)},[u]),t.jsx(_,{container:!0,children:t.jsx(y,{name:"دسترسی مرغداران جهت انتخاب کشتارگاه",columns:["مرغدار","دسترسی"],data:r})})},b=S("POLICY_CHANGE_POULTRY_CHOOSE_SLAUGHTER_SERVICE",async(e,{dispatch:u})=>{try{u(A());const{data:r,status:a}=await d.put("province_allow_poultry_sell_free/0/",e);return u(l()),{data:r,status:a}}catch(r){return u(l()),{error:r.response.data.result}}}),B=()=>{const e=h(),{provinceGetPoultries:u}=O(o=>o.provinceSlice),[r,a]=c.useState();return c.useEffect(()=>{e(E())},[]),c.useEffect(()=>{const o=u==null?void 0:u.map(s=>[s.name,t.jsx(C,{checked:s.allowSellState,onChange:n=>{e(b({poultry_key:s.key,allow:n.target.checked})).then(i=>{e(E())})},name:"checked",color:"primary"},"kkk")]);a(o)},[u]),t.jsxs(_,{container:!0,children:[t.jsx(L,{}),t.jsx(y,{name:"دسترسی مرغداران جهت فروش آزاد",columns:["مرغدار","دسترسی"],data:r})]})},su=()=>{const{pathname:e}=D();return t.jsx(t.Fragment,{children:t.jsx(x,{display:"flex",justifyContent:"center",children:t.jsx(_,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:t.jsx(_,{container:!0,justifyContent:"space-between",gap:I.SMALL,children:t.jsxs(_,{mt:I.SMALL,xs:12,children:[e===j&&t.jsx(K,{}),(e===f||e===P||e===g)&&t.jsx(B,{}),t.jsx(H,{}),(e===T||e===F||e===N)&&t.jsx(Y,{})]})})})})})};export{su as default}; diff --git a/build/assets/Poultries-DB3DCFBq.js b/build/assets/Poultries-DB3DCFBq.js new file mode 100644 index 0000000..af095b2 --- /dev/null +++ b/build/assets/Poultries-DB3DCFBq.js @@ -0,0 +1 @@ +import{j as s,al as ou,ak as Y,B as N,ar as nu,d as Q,I as lu,b0 as cu,an as iu,b4 as O,ap as k,aq as w,T as M}from"./mui-vendor-CkIVaoQP.js";import{L as R,j as E,h as v,e6 as Cu,G as S,C as du,X as T,A as Au,e7 as gu,O as hu}from"./index-CeyyVc1v.js";import{r as C,u as Fu}from"./react-vendor-CmFgShSM.js";import{a as B,u as W,f as X}from"./redux-vendor-B7uoacJt.js";import{a as fu}from"./index.esm-Bu7XMDZU.js";import{R as I}from"./ResponsiveTable-w7hk7Uq8.js";import{d as pu}from"./Tune-D4M2CAhp.js";import{d as xu}from"./FileDownload-Br429XFy.js";import{d as yu}from"./ToggleOn-pBgb8alR.js";import{d as vu}from"./ToggleOff-D4LkiR4X.js";import{d as Eu}from"./Visibility-DeyjG-oI.js";import"./iconBase-BEJYyZsk.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const ju=B("PROVINCE_EDIT_POULTRY_CITY_SERVICE",async(i,{dispatch:n})=>{try{n(R());const{data:A,status:F}=await E.put("Poultry/0/",i);return n(v()),{data:A,status:F}}catch(A){return n(v()),{error:A.response.data.result}}}),Lu=({item:i,updateTable:n})=>{const A=W(),[F,t]=C.useState(),{getCitiesOptions:f}=X(h=>h.provinceSlice),j=h=>h.label;return C.useEffect(()=>{A(Cu())},[]),s.jsxs(S,{container:!0,gap:1,width:"100%",children:[s.jsx(ou,{options:f,getOptionLabel:j,sx:{width:"100%"},onChange:(h,D)=>t(D),value:F,renderInput:h=>s.jsx(Y,{...h,label:"تعاونی"})}),s.jsx(N,{fullWidth:!0,variant:"contained",onClick:()=>{F&&A(ju({key:i.key,city_operator:F.value})).then(h=>{A(du()),n()})},children:"ثبت"})]})},K=B("POULTRIES_DASHBOARD",async(i,{dispatch:n})=>{n(R());const{data:A,status:F}=await E.get("total_poultry_hatching_dashboard",{params:{search:"filter",value:i.textValue,role:T()}});return n(v()),{data:A,status:F}}),Pu=B("GET_POULTRY_ACTIVE_LIMITED_SERVICE",async(i,{dispatch:n})=>{try{n(R());const{data:A,status:F}=await E.put("/Poultry/0/",i);return n(v()),{data:A,status:F}}catch(A){return n(v()),{error:A.response.data.result}}}),Su=()=>{const i=W(),[n]=C.useContext(Au),A=e=>{Z(e.target.value)},F=X(e=>{var u,a;return(a=(u=e.userSlice)==null?void 0:u.userProfile)==null?void 0:a.key}),[t,f]=C.useState([]),[j,h]=C.useState([]),[D,b]=C.useState(0),[L,J]=C.useState(10),[x,Z]=C.useState(""),[P,q]=C.useState(1),[uu,U]=C.useState([]),[V,d]=C.useState(!1),eu=({poultryItem:e,onToggleLimit:u})=>{const a=Fu(),[l,r]=C.useState(null),o=!!l,c=$=>{r($.currentTarget)},g=()=>{r(null)},y=()=>{i(hu({title:"ویرایش تعاونی",content:s.jsx(Lu,{updateTable:m,item:e})})),g()},p=()=>{e!=null&&e.key&&window.open(`${E.defaults.baseURL}poultry_monitoring_excel/?key=${e.key}`,"_blank"),g()},_=()=>{e!=null&&e.breedingUniqueId&&a(window.location.pathname+`${e.breedingUniqueId}?from=Poultry`),g()};return s.jsxs(S,{children:[s.jsx(Q,{title:"تنظیمات",placement:"right-start",children:s.jsx(lu,{color:"primary",className:"avicultureActiveRequestsBtn",onClick:c,children:s.jsx(pu,{})})}),s.jsx(cu,{open:o,anchorEl:l,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:s.jsxs(iu,{sx:{minWidth:220,p:1},children:[s.jsxs(O,{sx:{py:1},onClick:()=>u(!(e!=null&&e.orderLimit)),children:[s.jsx(k,{children:e!=null&&e.orderLimit?s.jsx(yu,{color:"success"}):s.jsx(vu,{color:"disabled"})}),s.jsx(w,{primary:s.jsx(M,{variant:"body2",color:"textPrimary",children:"محدودیت ثبت سفارش"})})]}),s.jsxs(O,{onClick:_,sx:{py:1},children:[s.jsx(k,{children:s.jsx(Eu,{color:"primary"})}),s.jsx(w,{primary:s.jsx(M,{variant:"body2",color:"textPrimary",children:"مشاهده جزییات"})})]}),s.jsxs(O,{disabled:T()==="VetSupervisor",onClick:y,sx:{py:1},children:[s.jsx(k,{children:s.jsx(gu,{color:"secondary"})}),s.jsx(w,{primary:s.jsx(M,{variant:"body2",color:"textPrimary",children:"ویرایش تعاونی"})})]}),s.jsxs(O,{onClick:p,sx:{py:1},children:[s.jsx(k,{children:s.jsx(xu,{color:"success"})}),s.jsx(w,{primary:s.jsx(M,{variant:"body2",color:"textPrimary",children:"خروجی اکسل"})})]})]})})]})},z=async e=>{var u,a,l;if(!V){i(R());try{const r=await E.get(`total_poultry/?search=filter&value=${x}&role=${T()}&page=${e}&page_size=${L}&search=filter&value=${x}`);d(!1),h(((u=r.data)==null?void 0:u.results)||[]),b(((a=r.data)==null?void 0:a.count)||0)}catch(r){console.error("Error fetching data:",r);const o=(r==null?void 0:r.message)||"",c=(l=r==null?void 0:r.response)==null?void 0:l.status;o.includes("500")||c===500?(d(!0),n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),h([]),b(0)}finally{i(v())}}},su=e=>{z(e),q(e)},tu=e=>{J(e),q(1)},m=()=>{z(P!==0?P:1)};C.useEffect(()=>{z(1)},[]),C.useEffect(()=>{V||i(K({textValue:x})).then(e=>{var u,a,l,r;e!=null&&e.error?((((u=e.error)==null?void 0:u.message)||"").includes("500")||((a=e.error)==null?void 0:a.status)===500||((l=e.error)==null?void 0:l.statusCode)===500?(d(!0),n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),f([])):(r=e==null?void 0:e.payload)!=null&&r.data?(d(!1),f(e.payload.data)):f([])}).catch(e=>{var r;console.error("Error fetching dashboard data:",e);const u=(e==null?void 0:e.message)||"",a=(r=e==null?void 0:e.response)==null?void 0:r.status;u.includes("500")||a===500?(d(!0),n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),f([])})},[]),C.useEffect(()=>{d(!1)},[x]);const ru=(e,u)=>{i(Pu({key:e,order_limit:u})).then(a=>{var l,r,o;a!=null&&a.error?(((l=a.error)==null?void 0:l.message)||"").includes("500")||((r=a.error)==null?void 0:r.status)===500||((o=a.error)==null?void 0:o.statusCode)===500?(d(!0),n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):n({vertical:"top",horizontal:"center",msg:"مشکلی در تغییر وضعیت محدودیت پیش آمده است!",severity:"error"}):(d(!1),m())}).catch(a=>{var c;console.error("Error updating order limit:",a);const l=(a==null?void 0:a.message)||"",r=(c=a==null?void 0:a.response)==null?void 0:c.status;l.includes("500")||r===500?(d(!0),n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):n({vertical:"top",horizontal:"center",msg:"مشکلی در تغییر وضعیت محدودیت پیش آمده است!",severity:"error"})})};C.useEffect(()=>{if(!j||!Array.isArray(j)){U([]);return}const e=j.map((u,a)=>{var l,r,o,c,g,y,p,_,$,G;return[P===1?a+1:a+L*(P-1)+1,(u==null?void 0:u.unitName)||"",`${((l=u==null?void 0:u.user)==null?void 0:l.fullname)||""} (${((r=u==null?void 0:u.user)==null?void 0:r.mobile)||""})`,(u==null?void 0:u.breedingUniqueId)||"",(u==null?void 0:u.epidemiologicalCode)||"",(u==null?void 0:u.healthCertificateNumber)||"",(u==null?void 0:u.numberOfHalls)||0,u!=null&&u.totalCapacity?u.totalCapacity.toLocaleString():"0",`${((c=(o=u==null?void 0:u.address)==null?void 0:o.province)==null?void 0:c.name)||""}/${((y=(g=u==null?void 0:u.address)==null?void 0:g.city)==null?void 0:y.name)||""}`,(u==null?void 0:u.cityOperator)||"ندارد",(p=u==null?void 0:u.vetFarm)!=null&&p.vetFarmName?`${u.vetFarm.vetFarmName} (${((_=u.vetFarm)==null?void 0:_.vetFarmMobile)||""})`:"ندارد",`${($=u==null?void 0:u.hatchingInfo)!=null&&$.activeHatching?"دارد":"ندارد"} (${((G=u==null?void 0:u.hatchingInfo)==null?void 0:G.period)||"0"})`,s.jsx(nu,{label:u!=null&&u.orderLimit?"فعال":"غیرفعال",color:u!=null&&u.orderLimit?"success":"default",variant:u!=null&&u.orderLimit?"filled":"outlined",size:"small",sx:{width:80,justifyContent:"center"}},`orderLimitStatus-${a}`),s.jsx(eu,{poultryItem:u,onToggleLimit:au=>ru(u==null?void 0:u.key,au)},`actions-${a}`)]});U(e)},[j,P,L]),C.useEffect(()=>{d(!1),z(1)},[L]);const H=async e=>{var u,a,l;e.preventDefault(),d(!1),i(R());try{const r=await E.get(`total_poultry/?role=${T()}&search=filter&value=${x}&page=1&page_size=${L}&search=filter&value=${x}`);d(!1),h(((u=r.data)==null?void 0:u.results)||[]),b(((a=r.data)==null?void 0:a.count)||0),i(v()),i(K({textValue:x})).then(o=>{var c,g,y,p;o!=null&&o.error?((((c=o.error)==null?void 0:c.message)||"").includes("500")||((g=o.error)==null?void 0:g.status)===500||((y=o.error)==null?void 0:y.statusCode)===500?(d(!0),n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),f([])):(p=o==null?void 0:o.payload)!=null&&p.data?(d(!1),f(o.payload.data)):f([])}).catch(o=>{var p;console.error("Error fetching dashboard data:",o);const c=(o==null?void 0:o.message)||"",g=(p=o==null?void 0:o.response)==null?void 0:p.status;c.includes("500")||g===500?(d(!0),n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),f([])})}catch(r){console.error("Error fetching data:",r);const o=(r==null?void 0:r.message)||"",c=(l=r==null?void 0:r.response)==null?void 0:l.status;o.includes("500")||c===500?(d(!0),n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):n({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),h([]),b(0),i(v())}};return s.jsxs(S,{container:!0,xs:10,alignItems:"center",justifyContent:"center",mt:2,children:[s.jsxs(S,{container:!0,alignItems:"center",gap:2,paddingTop:2,paddingRight:2,mx:4,mb:1,children:[s.jsxs("form",{onSubmit:H,children:[s.jsx(Y,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:A}),s.jsx(N,{onClick:H,children:"جستجو"})]}),s.jsx(Q,{title:"خروجی اکسل",children:s.jsx("a",{href:`${E.defaults.baseURL}management_poultry/?key=${F||""}&role=${T()}&search=filter&value=${x||""}`,rel:"noreferrer",children:s.jsx(N,{color:"success",children:s.jsx(fu,{size:32})})})})]}),s.jsx(S,{container:!0,mt:2,mb:4,isDashboard:!0,children:s.jsx(I,{noPagination:!0,isDashboard:!0,columns:["تعداد مرغداران","تعداد کل دوره جوجه ریزی","حجم کل جوجه ریزی","جوجه ریزی های فعال"," حجم جوجه ریزی فعال","حجم مانده در سالن فعال","تعداد کل بار","حجم کل بار","میانگین درصد افت"],data:[[t!=null&&t.poultryCounts?t.poultryCounts.toLocaleString():"0",t!=null&&t.allPeriod?t.allPeriod.toLocaleString():"0",t!=null&&t.allTotalQuantity?t.allTotalQuantity.toLocaleString():"0",t!=null&&t.hatchingPending?t.hatchingPending.toLocaleString():"0",t!=null&&t.totalQuantityPoultryHatchingPending?t.totalQuantityPoultryHatchingPending.toLocaleString():"0",t!=null&&t.totalLeftOverPoultryHatchingPending?t.totalLeftOverPoultryHatchingPending.toLocaleString():"0",t!=null&&t.allKillRequest?t.allKillRequest.toLocaleString():"0",t!=null&&t.allKillRequestQuantity?t.allKillRequestQuantity.toLocaleString():"0",t!=null&&t.percentLoss?t.percentLoss.toLocaleString():"0"]],title:"خلاصه اطلاعات"})}),s.jsx(I,{data:uu,columns:["ردیف","نام واحد","مالک (تلفن)","شناسه یکتا","کداپیدمیولوژیک","کد بهداشتی","تعداد سالن","ظرفیت فارم (قطعه)","استان/شهر","تعاونی","دامپزشک فارم (تلفن)","جوجه ریزی فعال (تعداد دوره)","محدودیت ثبت سفارش","عملیات"],handlePageChange:su,totalRows:D,page:P,perPage:L,handlePerRowsChange:tu,title:"مدیریت مرغداران"})]})},Uu=()=>s.jsx(s.Fragment,{children:s.jsx(S,{container:!0,direction:"column",alignItems:"center",justifyContent:"center",xs:12,children:s.jsx(Su,{})})});export{Uu as default}; diff --git a/build/assets/PoultriesDetailsPage-Bu9GJg8X.js b/build/assets/PoultriesDetailsPage-Bu9GJg8X.js new file mode 100644 index 0000000..c33bc4d --- /dev/null +++ b/build/assets/PoultriesDetailsPage-Bu9GJg8X.js @@ -0,0 +1 @@ +import{j as t,b2 as Pu,b3 as U,aX as Su,ak as T,al as $,aA as q,I as Eu,T as Tu,b as bu}from"./mui-vendor-CkIVaoQP.js";import{L as Q,j as D,h as v,A as Iu,G as h,W as H,v as J,p as X}from"./index-CeyyVc1v.js";import{j as vu,l as Du,r as o}from"./react-vendor-CmFgShSM.js";import{a as O,u as _u}from"./redux-vendor-B7uoacJt.js";import{d as Ou}from"./ToggleOffOutlined-Ch26Umk7.js";import{d as Ru}from"./ToggleOn-pBgb8alR.js";import{d as Bu}from"./Search-Dek2fED1.js";import{R as K}from"./ResponsiveTable-w7hk7Uq8.js";import{C as wu}from"./ChechClearanceCode-lPasOZZ_.js";import{B as ku}from"./BackButton-Crzr7NMa.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./Pageview-TRcW_9jm.js";import"./Edit-CqBj1Y2L.js";import"./AddCircleOutline-C8LXM-k8.js";const Lu=O("GET_POULTRY_TRANSPORT_BY_CODE_SERVICE",async(r,{dispatch:x})=>{var i;try{x(Q());const{data:l,status:p}=await D.get("https://rsibackend.rasadyar.com/app/get-all-products-transport-by-code/",{params:{code:r.code,type:r.type,page:r.page||1,page_size:r.page_size||10,date1:r.date1||"",date2:r.date2||"",search:r.search||"",province:r.province||"",product:r.product||"",from:r.from||""}});return x(v()),{data:l,status:p}}catch(l){return x(v()),{error:((i=l.response)==null?void 0:i.data)||l.message}}}),Nu=O("GET_POULTRY_TRANSPORT_PRODUCTS_BY_CODE_SERVICE",async r=>{var x;try{const{data:i,status:l}=await D.get("https://rsibackend.rasadyar.com/app/get-all-products-transport-products-by-code/",{params:{code:r.code,type:r.type,date1:r.date1||"",date2:r.date2||"",search:r.search||"",from:r.from||""}});return{data:i,status:l}}catch(i){return{error:((x=i.response)==null?void 0:x.data)||i.message}}}),Yu=O("GET_POULTRY_TRANSPORT_DASHBOARD_BY_CODE_SERVICE",async(r,{dispatch:x})=>{var i;try{x(Q());const{data:l,status:p}=await D.get("https://rsibackend.rasadyar.com/app/get-all-products-transport-dashboard-by-code/",{params:{code:r.code,type:r.type,date1:r.date1||"",date2:r.date2||"",search:r.search||"",product:r.product||"",province:r.province||"",from:r.from||""}});return x(v()),{data:l,status:p}}catch(l){return x(v()),{error:((i=l.response)==null?void 0:i.data)||l.message}}}),zu=()=>{const{key:r}=vu(),[x]=Du(),i=x.get("from"),l=_u(),[p,Z]=o.useState("1"),[m,uu]=o.useState([]),[eu,tu]=o.useState(0),[b,E]=o.useState(1),[I,ru]=o.useState(10),[Mu,R]=o.useState(!1),[B,_]=o.useState(null),[C,nu]=o.useState(!0),[su,ou]=o.useState([]),[P,w]=o.useState(""),[k,L]=o.useState(!1),[F,au]=o.useState(""),[N,Y]=o.useState(""),[n,cu]=o.useState(null),[lu,du]=o.useState([]),[S,iu]=o.useState(""),[z,M]=o.useState(!1);console.log(i);const[,,y,pu,A,Cu]=o.useContext(Iu),fu=["ردیف","کد رهگیری","محصول","اقلام","مقدار","واحد","تاریخ","مقصد","شناسه مقصد","استان مقصد","شهرستان مقصد","مبدا","شناسه مبدا","استان مبدا","شهرستان مبدا","نوع حمل","مقصد قبلی","تغییر مقصد","کد رهگیری خودرو","تاریخ تخلیه","تخلیه"],j=e=>e==null?"-":typeof e=="number"?e.toLocaleString("fa-IR"):e,s=e=>e==null||e===""?"-":e,V=e=>{if(e==null)return"-";const a=Number(e);return Number.isNaN(a)?"-":`${a.toFixed(1)}%`},hu=e=>{if(!e)return"-";const a=new Date(e);if(Number.isNaN(a.getTime()))return"-";const f=a.toLocaleDateString("fa-IR"),c=a.toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit",hour12:!1});return`${f} ${c}`},xu=["محصول","تعداد بار","حجم بار (کیلوگرم)","تعداد بار داخل استان","حجم بار داخل استان (کیلوگرم)","درصد داخل استان","تعداد بار خارج استان","حجم بار خارج استان (کیلوگرم)","درصد خارج استان","آخرین بروزرسانی"],gu=(e,a)=>{Z(a),w(""),E(1)},yu=async e=>{e.preventDefault();const a=N.trim();au(a),Y(a),E(1)};o.useEffect(()=>{E(1)},[y,A,C,P,F,p,S]),o.useEffect(()=>{const e={current:!0};return(async()=>{var f;try{M(!0);const{data:c}=await D.get("iran_province/");if(!e.current)return;const g=((f=c==null?void 0:c.map)==null?void 0:f.call(c,d=>d==null?void 0:d.name).filter(d=>!!d))??[];du(g)}catch(c){console.error("Failed to fetch provinces:",c)}finally{e.current&&M(!1)}})(),()=>{e.current=!1}},[]),o.useEffect(()=>{if(!r)return;const e={current:!0};return(async()=>{var f,c;try{L(!0);const d=await l(Nu({code:r,type:p==="1"?"in":"out",date1:C&&y?y:"",date2:C&&A?A:"",search:F||"",from:i}));if(!e.current)return;if(d.error){console.error("Failed to fetch products:",d.error);return}const G=Array.isArray((c=(f=d.payload)==null?void 0:f.data)==null?void 0:c.products)?d.payload.data.products:[];ou(G)}catch(g){console.error("Failed to fetch product types:",g)}finally{e.current&&L(!1)}})(),()=>{e.current=!1}},[r,p,y,A,C,F,l]),o.useEffect(()=>{if(!r)return;const e={current:!0};return(async()=>{var f;try{const g=await l(Yu({code:r,type:p==="1"?"in":"out",date1:C&&y?y:"",date2:C&&A?A:"",search:F||"",product:P||"",province:S||"",from:i}));if(!e.current)return;!g.error&&((f=g.payload)!=null&&f.data)&&cu(g.payload.data)}catch(c){console.error("Failed to fetch dashboard data:",c)}})(),()=>{e.current=!1}},[r,p,y,A,C,P,F,S,l]),o.useEffect(()=>{if(!r)return;const e={current:!0};return(async()=>{var f;try{_(null),R(!0);const g=await l(Lu({code:r,type:p==="1"?"in":"out",page:b,page_size:I,date1:C&&y?y:"",date2:C&&A?A:"",search:F||"",product:P||"",province:S||"",from:i}));if(!e.current)return;if(g.error){_(g.error);return}const d=((f=g.payload)==null?void 0:f.data)??{results:[]},Fu=((d==null?void 0:d.results)??[]).map((u,W)=>[s(j(W+1+(b-1)*I)),t.jsx(wu,{clearanceCode:u==null?void 0:u.tracking},(u==null?void 0:u.tracking)||W),s(u==null?void 0:u.product),s(u==null?void 0:u.items),s(j(u==null?void 0:u.quantity)),s(u==null?void 0:u.unit),s(X(u==null?void 0:u.date)),s(u==null?void 0:u.destination),s(u==null?void 0:u.jihadiDestination),s(u==null?void 0:u.destinationProvince),s(u==null?void 0:u.destinationCity),s(u==null?void 0:u.origin),s(u==null?void 0:u.jihadiOrigin),s(u==null?void 0:u.originProvince),s(u==null?void 0:u.originCity),s((u==null?void 0:u.originProvince)===(u==null?void 0:u.destinationProvince)?"داخل استان":"خارج استان"),s(u==null?void 0:u.destinationPrev),s(u==null?void 0:u.destinationChanged),s(u==null?void 0:u.carTrackingCode),s(X(u==null?void 0:u.unloadingDate)),s(u==null?void 0:u.unloading)]);uu(Fu),tu((d==null?void 0:d.count)??0)}catch(c){if(console.error("Failed to fetch transport data:",c),!e.current)return;_(c)}finally{e.current&&R(!1)}})(),()=>{e.current=!1}},[r,p,b,I,y,A,C,P,F,S,l]);const Au=e=>{E(e)},ju=e=>{ru(e),E(1)};return t.jsx(o.Fragment,{children:t.jsxs(h,{container:!0,justifyContent:"center",xs:12,mt:2,children:[t.jsx(h,{container:!0,alignItems:"center",justifyContent:"center",xs:12,mt:2,children:t.jsxs(Pu,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:p,onChange:gu,children:[t.jsx(U,{label:"بارهای ورودی",value:"1"}),t.jsx(U,{label:"بارهای خروجی",value:"2"})]})}),n&&t.jsx(h,{container:!0,mt:2,mb:4,isDashboard:!0,children:t.jsx(K,{noPagination:!0,isDashboard:!0,columns:xu,data:[[s(n==null?void 0:n.product),s(j(n==null?void 0:n.bars)),s(j(n==null?void 0:n.totalBarsWight)),s(j(n==null?void 0:n.inputBars)),s(j(n==null?void 0:n.totalInputBarsWight)),V(n==null?void 0:n.totalInputBarsPercent),s(j(n==null?void 0:n.outputBars)),s(j(n==null?void 0:n.totalOutputBarsWight)),V(n==null?void 0:n.totalOutputBarsPercent),hu(n==null?void 0:n.lastUpdate)]],title:"داشبورد"})}),t.jsxs(h,{container:!0,alignItems:"center",justifyContent:"center",gap:2,xs:12,mt:2,px:2,children:[t.jsxs(h,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left",maxWidth:"fit-content"},alignItems:"center",justifyContent:"center",children:[t.jsx(Su,{icon:t.jsx(Ou,{}),checkedIcon:t.jsx(Ru,{}),checked:C,onChange:()=>nu(!C),color:"primary",size:"large"}),t.jsx(h,{children:t.jsx(H,{disabled:!C,label:"از تاریخ",id:"date",renderInput:e=>t.jsx(T,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...e}),value:y,onChange:e=>{e&&pu(J(e).format("YYYY-MM-DD"))}})}),t.jsx(h,{children:t.jsx(H,{disabled:!C,label:"تا تاریخ",id:"date",renderInput:e=>t.jsx(T,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...e}),value:A,onChange:e=>{e&&Cu(J(e).format("YYYY-MM-DD"))}})})]}),t.jsxs(h,{container:!0,alignItems:"center",justifyContent:"center",gap:1,sx:{maxWidth:"fit-content"},children:[t.jsx($,{options:lu,loading:z,value:S||null,onChange:(e,a)=>{iu(a||"")},noOptionsText:"استانی یافت نشد",renderInput:e=>t.jsx(T,{...e,label:p==="2"?"استان مقصد":"استان مبدا",size:"small",sx:{width:{xs:200,md:240}},InputProps:{...e.InputProps,endAdornment:t.jsxs(t.Fragment,{children:[z?t.jsx(q,{color:"inherit",size:16}):null,e.InputProps.endAdornment]})}}),clearOnEscape:!0}),t.jsx($,{options:su,loading:k,value:P||null,onChange:(e,a)=>{w(a||"")},noOptionsText:"محصولی یافت نشد",renderInput:e=>t.jsx(T,{...e,label:"نوع محصول",size:"small",sx:{width:{xs:200,md:240}},InputProps:{...e.InputProps,endAdornment:t.jsxs(t.Fragment,{children:[k?t.jsx(q,{color:"inherit",size:16}):null,e.InputProps.endAdornment]})}}),clearOnEscape:!0}),t.jsxs(h,{item:!0,component:"form",onSubmit:yu,sx:{width:{xs:220,md:260},display:"flex"},children:[t.jsx(T,{value:N,onChange:e=>Y(e.target.value),label:"جستجو",size:"small",variant:"outlined",sx:{flexGrow:1}}),t.jsx(Eu,{type:"submit",color:"primary","aria-label":"جستجو",sx:{ml:1},children:t.jsx(Bu,{})})]})]})]}),t.jsxs(h,{container:!0,justifyContent:"center",alignItems:"center",px:2,xs:12,mt:2,children:[B&&t.jsx(h,{container:!0,justifyContent:"center",xs:12,children:t.jsx(Tu,{variant:"body1",color:"error",children:"خطا در دریافت اطلاعات"})}),!B&&t.jsx(K,{columns:fu,data:m,title:p==="1"?"بارهای ورودی":"بارهای خروجی",paginated:!1,handlePageChange:Au,handlePerRowsChange:ju,totalRows:eu,page:b,perPage:I})]})]})})},te=()=>t.jsx(bu,{display:"flex",justifyContent:"center",children:t.jsxs(h,{container:!0,direction:"column",xs:12,sm:12,md:10,lg:10,children:[t.jsx(h,{children:t.jsx(ku,{})}),t.jsx(zu,{})]})});export{te as default}; diff --git a/build/assets/PoultryScienceExperts-DLgx0ZrE.js b/build/assets/PoultryScienceExperts-DLgx0ZrE.js new file mode 100644 index 0000000..6ddf881 --- /dev/null +++ b/build/assets/PoultryScienceExperts-DLgx0ZrE.js @@ -0,0 +1 @@ +import{j as e,al as W,ak as M,B as k,T as H,d as J,I as K,b as Q}from"./mui-vendor-CkIVaoQP.js";import{r as n}from"./react-vendor-CmFgShSM.js";import{L as m,j as A,h as f,A as V,G as i,C as Z,v as ee,O as te,X as N,S as w}from"./index-CeyyVc1v.js";import{a as Y,u as z}from"./redux-vendor-B7uoacJt.js";import{R as ue}from"./index.esm-Bu7XMDZU.js";import{R as se}from"./ResponsiveTable-w7hk7Uq8.js";import{d as ae}from"./Add--yVWBJhC.js";import"./iconBase-BEJYyZsk.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const ne=Y("PROVINCE_POULTRY_SCIENCE_EXPERTS",async(l,{dispatch:c})=>{c(m());const{data:s,status:d}=await A.get("get-all-poultry-for-poultry-science/");return c(f()),{data:s,status:d}}),re=Y("PROVINCE_POLICY_UPDATE_LIMITATIONS_EDIT",async(l,{dispatch:c})=>{c(m());try{const{data:s,status:d}=await A.put("poultry_science/0/",l);return c(f()),{data:s,status:d}}catch(s){return c(f()),{error:s.response.data.result}}}),oe=({item:l,updateTable:c,poultryExperts:s})=>{const[d,x]=n.useState(),h=z(),[p]=n.useContext(V),S=s?s.map(t=>{var r,o;return{id:t.id,label:`${t.unitName||"-"} (${((r=t.user)==null?void 0:r.fullname)||"-"} - ${((o=t.user)==null?void 0:o.mobile)||"-"})`}}):[],y=l!=null&&l.poultry?l.poultry.map(t=>{var r,o;return{id:t.id,label:`${t.unitName||"-"} (${((r=t.user)==null?void 0:r.fullname)||"-"} - ${((o=t.user)==null?void 0:o.mobile)||"-"})`}}):[],g=[...y,...S.filter(t=>!y.some(r=>r.id===t.id))],C=y,E=()=>{h(re({poultry:d,poultry_science_id:l.id})).then(t=>{t.payload.error?p({vertical:"top",horizontal:"center",msg:t.payload.error,severity:"error"}):(c(),h(Z()),p({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})};return e.jsxs(i,{container:!0,xs:12,justifyContent:"center",direction:"column",gap:2,children:[e.jsx(i,{children:e.jsx(W,{disablePortal:!0,multiple:!0,defaultValue:C,id:"province",options:g,getOptionLabel:t=>t.label,isOptionEqualToValue:(t,r)=>t.id===r.id,onChange:(t,r)=>{x(r.map(o=>o.id))},renderInput:t=>e.jsx(M,{...t,label:"مرغداری را انتخاب کنید"})})}),e.jsx(k,{fullWidth:!0,variant:"contained",onClick:E,children:"ثبت"})]})},le=()=>{const[,,,l,,c]=n.useContext(V),s=z();n.useEffect(()=>{const a=ee(new Date).format("YYYY-MM-DD");l(a),c(a)},[]);const d=a=>{r(a.target.value)},[x,h]=n.useState([]),[p,S]=n.useState([]),[y,g]=n.useState(0),[C,E]=n.useState(10),[t,r]=n.useState(""),[o,I]=n.useState(1),[B,G]=n.useState([]),P=async a=>{let u;s(m()),u=await A.get(`poultry_science/?search=filter&value=${t}&role=${N()}&page=${a}&page_size=${C}`),s(f()),h(u.data.results),g(u.data.count)},U=a=>{P(a),I(a)},X=a=>{E(a),I(1)},q=()=>{s(ne()).then(a=>{S(a.payload.data)})},v=()=>{q(),P(o!==0?o:1)};n.useEffect(()=>{v()},[s]),n.useEffect(()=>{const a=x==null?void 0:x.map((u,j)=>{var T,_,O,$,R;return[o===1?j+1:j+C*(o-1)+1,(T=u==null?void 0:u.user)==null?void 0:T.fullname,(_=u==null?void 0:u.user)==null?void 0:_.mobile,e.jsx(H,{variant:"caption",children:(O=u==null?void 0:u.poultry)!=null&&O.length?(R=($=u==null?void 0:u.poultry)==null?void 0:$.map((b,ce)=>{var F,L;return`${b.unitName} (${(F=b.user)==null?void 0:F.fullname} - ${(L=b.user)==null?void 0:L.mobile})`}))==null?void 0:R.join(" - "):"-"},j),e.jsx(J,{title:"مدیریت مرغدار زیر مجموعه",placement:"right",children:e.jsx(K,{disabled:!(p!=null&&p.length),color:"primary",onClick:()=>{s(te({title:"افزودن مرغدار زیرمجموعه",content:e.jsx(oe,{updateTable:v,item:u,poultryExperts:p})}))},children:e.jsx(ae,{})})},j)]});G(a)},[x]),n.useEffect(()=>{P(1)},[s,C]);const D=async a=>{a.preventDefault(),s(m());try{const u=await A.get(`poultry_science/?role=${N()}&search=filter&value=${t}&page=1&page_size=${C}`);h(u.data.results),g(u.data.count),s(f())}catch(u){console.error("Error fetching data:",u)}};return e.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[e.jsx(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:e.jsx(i,{children:e.jsxs("form",{onSubmit:D,children:[e.jsx(M,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:d}),e.jsx(k,{type:"submit",onClick:D,endIcon:e.jsx(ue,{}),children:"جستجو"})]})})}),e.jsx(se,{data:B,columns:["ردیف","نام کامل","موبایل","مرغداران زیر مجموعه","عملیات"],handlePageChange:U,totalRows:y,page:o,perPage:C,handlePerRowsChange:X,title:"کارشناسان علوم دامی"})]})},me=()=>e.jsx(e.Fragment,{children:e.jsx(Q,{display:"flex",justifyContent:"center",children:e.jsx(i,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:e.jsx(i,{container:!0,justifyContent:"space-between",mt:w.MEDIUM,gap:w.SMALL,children:e.jsx(i,{xs:12,children:e.jsx(le,{})})})})})});export{me as default}; diff --git a/build/assets/ProvinceBarDifference-CBv5I_nz.js b/build/assets/ProvinceBarDifference-CBv5I_nz.js new file mode 100644 index 0000000..cc78817 --- /dev/null +++ b/build/assets/ProvinceBarDifference-CBv5I_nz.js @@ -0,0 +1 @@ +import{j as u,al as au,ak as I,T as h,a9 as Wu,bh as Mu,B as R,I as wu,b0 as $u,an as Vu,d as nu,ao as su,b4 as ou,ap as lu,aq as cu,b2 as mu,b3 as du}from"./mui-vendor-CkIVaoQP.js";import{r as i}from"./react-vendor-CmFgShSM.js";import{a as q,u as Q,f as zu}from"./redux-vendor-B7uoacJt.js";import{j as B,L,h as _,A as pu,fn as Yu,af as Qu,fm as Gu,c as Hu,b as Su,M as iu,u as Uu,G as l,S as k,N as ru,X as N,a_ as Ku,O as Cu,C as hu,p as Ju,W as Du,v as Ru}from"./index-CeyyVc1v.js";import{R as Xu}from"./index.esm-Bu7XMDZU.js";import{R as Bu}from"./ResponsiveTable-w7hk7Uq8.js";import{a as Zu}from"./aviculture-get-hatching-data-DsjDNd82.js";import{I as Nu,f as qu}from"./toBase64-BzgTOHsW.js";import{r as Lu}from"./resizeImage-Csf2MO3w.js";import{d as u0}from"./Tune-D4M2CAhp.js";import{d as e0}from"./Edit-CqBj1Y2L.js";import{d as r0}from"./Delete-C5MyLelE.js";import{S as Tu}from"./ShowImage-CqhU2hmk.js";const t0=q("PROVINCE_CREATE_BAR_DIFFERENCE_SERVICE",async(e,{dispatch:s})=>{try{s(L());const{data:n,status:d}=await B.post("bar-difference-request/",e);return s(_()),{data:n,status:d}}catch(n){return s(_()),{error:n.response.data.result}}}),Pu=q("PROVINCE_EDIT_BAR_DIFFERENCE_SERVICE",async(e,{dispatch:s})=>{try{s(L());const{data:n,status:d}=await B.put("bar-difference-request/0/",e);return s(_()),{data:n,status:d}}catch(n){return s(_()),{error:n.response.data.result}}}),a0=q("PROVINCE_DELETE_BAR_DIFFERENCE_SERVICE",async(e,{dispatch:s})=>{s(L());try{const{data:n,status:d}=await B.delete(`bar-difference-request/0/?bar_key=${e}`);return s(_()),{data:n,status:d}}catch(n){return s(_()),{error:n.response.data.result}}}),n0=q("PROVINCE_GET_BAR_DIFFERENCE_INFO_SERVICE",async e=>{const{data:s,status:n}=await B.get("get_hatching_kill_ingo/",{params:e});return{data:s,status:n}}),Ou=({updateTable:e,isEdit:s,item:n})=>{var G,S,w,H,U,P,K,J,O,W,M,$,V,z,C,r,D,Y;const[d,p]=i.useState(""),[x]=i.useContext(pu),[o,f]=i.useState(""),[b,F]=i.useState([]),[A,E]=i.useState(null),c=Q(),{slaughterGetPoultries:y,slaughterGetKillhouses:j}=zu(a=>a.slaughterSlice);i.useEffect(()=>{s||(c(Yu()),c(Qu()),c(Gu()))},[]);const T={killhouse:null,killerPlace:null,poultry:null,hatching_key:null,quantity:parseInt(n==null?void 0:n.quantity)||null,difference_image:null,register_message:(n==null?void 0:n.registerMessage)||null},tu=Hu().shape({killhouse:iu().typeError("این فیلد الزامی است").required("این فیلد الزامی است"),poultry:iu().typeError("این فیلد الزامی است").required("این فیلد الزامی است"),poultryPrice:Su().typeError("لطفا فیلد را به درستی وارد کنید!"),hatching_key:iu().required("این فیلد الزامی است"),quantity:Su().required("این فیلد الزامی است").typeError("لطفا فیلد را به درستی وارد کنید!")}),t=Uu({initialValues:T,validationSchema:tu});i.useEffect(()=>{t.values.poultry&&c(Zu(t.values.poultry)).then(a=>{p(a.payload.data)})},[t.values.poultry]),i.useEffect(()=>{t.validateForm()},[t.values.quantity,c]);const g=(a,v)=>{if(a.length===0)t.setFieldValue("difference_image",[]),F([]);else{const X=a.map(m=>new Promise(Z=>{const uu=m.file;Lu(uu,eu=>{Z(qu(eu))})}));Promise.all(X).then(m=>{t.setFieldValue("difference_image",m),F(a)})}};return i.useEffect(()=>{t.values.hatching_key&&t.values.killhouse&&c(n0({hatching_key:t.values.hatching_key,kill_house_key:t.values.killhouse})).then(a=>{E(a.payload.data)})},[t.values.hatching_key,t.values.killhouse]),u.jsxs(l,{container:!0,direction:"column",gap:k.SMALL,children:[!s&&u.jsxs(u.Fragment,{children:[y!=null&&y.length?u.jsx(au,{id:"poultry",disableClearable:!0,options:y==null?void 0:y.map(a=>{var v;return{label:`${a.unitName} (${(v=a.user)==null?void 0:v.fullname})`,value:a.key,item:a}}),getOptionLabel:a=>a.label,onChange:(a,v)=>{t.setFieldValue("poultry",v.item.key)},onBlur:t.handleBlur,renderInput:a=>u.jsx(I,{...a,label:"انتخاب مرغداری",variant:"outlined",error:t.touched.poultry&&!!t.errors.poultry,helperText:t.touched.poultry&&t.errors.poultry})}):u.jsx(h,{color:"error",variant:"body2",children:"موردی یافت نشد!"}),d&&u.jsx(l,{minWidth:210,children:u.jsx(au,{disablePortal:!0,disabled:!t.values.poultry,id:"combo-box-demo",options:d==null?void 0:d.map(a=>({label:`${a==null?void 0:a.poultry.unitName}`,value:a.key,item:a})),onChange:(a,v)=>{f(v.item),t.setFieldValue("hatching_key",v.value)},renderInput:a=>u.jsx(I,{...a,label:"محل پرورش"})})}),o&&u.jsxs(u.Fragment,{children:[u.jsxs(l,{container:!0,direction:"column",justifyContent:"space-between",children:[u.jsxs(l,{container:!0,gap:k.TINY,children:[u.jsx(h,{children:"نام و نام خانوادگی:"}),u.jsx(h,{children:(S=(G=o==null?void 0:o.poultry)==null?void 0:G.userprofile)==null?void 0:S.fullName})]}),u.jsxs(l,{container:!0,gap:k.TINY,children:[u.jsx(h,{children:"تلفن:"}),u.jsx(h,{children:(H=(w=o==null?void 0:o.poultry)==null?void 0:w.userprofile)==null?void 0:H.mobile})]}),u.jsxs(l,{container:!0,gap:k.TINY,children:[u.jsx(h,{children:"آدرس:"}),u.jsx(h,{children:`شهر ${(K=(P=(U=o.poultry)==null?void 0:U.address)==null?void 0:P.city)==null?void 0:K.name} ${(O=(J=o==null?void 0:o.poultry)==null?void 0:J.address)!=null&&O.address?"-"+((M=(W=o==null?void 0:o.poultry)==null?void 0:W.address)==null?void 0:M.address):""}`})]}),u.jsxs(l,{container:!0,gap:k.TINY,children:[u.jsx(h,{children:"سن جوجه:"}),u.jsxs(h,{children:[o==null?void 0:o.chickenAge," روز"]})]}),u.jsxs(l,{container:!0,gap:k.TINY,children:[u.jsx(h,{children:"مانده در سالن:"}),u.jsxs(h,{children:[($=o==null?void 0:o.leftOver)==null?void 0:$.toLocaleString()," قطعه"]})]}),u.jsxs(l,{container:!0,gap:k.TINY,children:[u.jsx(h,{color:"error",children:"مانده فروش آزاد:"}),u.jsxs(h,{color:"error",children:[(z=(V=o==null?void 0:o.freeGovernmentalInfo)==null?void 0:V.leftTotalFreeCommitmentQuantity)==null?void 0:z.toLocaleString()," ","قطعه"]})]}),u.jsxs(l,{container:!0,gap:k.TINY,children:[u.jsx(h,{children:"نژاد:"}),u.jsx(h,{children:o==null?void 0:o.chickenBreed})]})]}),(j==null?void 0:j.length)&&u.jsx(au,{id:"killhouse",disableClearable:!0,options:j==null?void 0:j.map(a=>({label:(a!=null&&a.killer?"کشتارکن":"کشتارگاه")+" "+a.name,value:a.key,killer:a.killer,item:a})),getOptionLabel:a=>a.label,onChange:(a,v)=>{t.setFieldValue("killhouse",v.value)},onBlur:t.handleBlur,renderInput:a=>u.jsx(I,{...a,label:"انتخاب کشتارگاه/کشتارکن",variant:"outlined",error:t.touched.killhouse&&!!t.errors.killhouse,helperText:t.touched.killhouse&&t.errors.killhouse})}),A&&u.jsx(Wu,{elevation:3,sx:{p:1,borderRadius:2},children:u.jsxs(Mu,{spacing:1,children:[u.jsxs(h,{variant:"body2",fontWeight:500,color:"text.primary",children:["حجم کم شده از سالن مرغدار:"," ",u.jsxs(h,{component:"span",variant:"body1",color:"primary",fontWeight:600,children:[(C=A.totalQuantity)==null?void 0:C.toLocaleString()," قطعه"]})]}),u.jsxs(h,{variant:"body2",fontWeight:500,color:"text.primary",children:["وزن تقریبی کشتار:"," ",u.jsxs(h,{component:"span",variant:"body1",color:"primary",fontWeight:600,children:[(r=A.totalWeight)==null?void 0:r.toLocaleString()," کیلوگرم"]})]}),u.jsxs(h,{variant:"body2",fontWeight:500,color:"text.primary",children:["حجم سفارشات دریافتی توسط کشتارگاه:",u.jsxs(h,{component:"span",variant:"body2",color:"primary",fontWeight:600,children:[(D=A.firstTotalQuantity)==null?void 0:D.toLocaleString()," قطعه"]})]}),u.jsxs(h,{variant:"body2",fontWeight:500,color:"text.primary",children:["اختلاف کشتار(حجم):",u.jsxs(h,{component:"span",variant:"body1",color:"primary",fontWeight:600,children:[(Y=A.differenceQuantity)==null?void 0:Y.toLocaleString()," قطعه"]})]})]})})]})]}),(s||o)&&u.jsxs(u.Fragment,{children:[u.jsx(I,{label:"حجم (قطعه)",variant:"outlined",fullWidth:!0,type:"text",name:"quantity",id:"quantity",onChange:t.handleChange,onBlur:t.handleBlur,value:t.values.quantity,error:t.touched.quantity&&!!t.errors.quantity,helperText:t.touched.quantity&&t.errors.quantity}),u.jsx(Nu,{onChange:g,images:b,maxNumber:1,title:"سند"}),u.jsx(I,{label:"توضیحات",name:"register_message",id:"register_message",onChange:t.handleChange,onBlur:t.handleBlur,value:t.values.register_message,minRows:2,maxRows:6,sx:{width:"100%","& .MuiInputBase-root":{height:150}}}),u.jsx(R,{disabled:s?!t.values.quantity:!t.isValid,fullWidth:!0,variant:"contained",onClick:()=>{s?c(Pu({bar_key:n==null?void 0:n.key,quantity:t.values.quantity,register_message:t.values.register_message,images:t.values.difference_image})).then(a=>{a.payload.error?x({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(e(),x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),c(ru({right:!1,bottom:!1,content:null})))}):c(t0({hatching_key:t.values.hatching_key,kill_house_key:t.values.killhouse,quantity:t.values.quantity,register_message:t.values.register_message,images:t.values.difference_image})).then(a=>{a.payload.error?x({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(e(),x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),c(ru({right:!1,bottom:!1,content:null})))})},children:"ثبت"})]})]})},s0=({item:e,updateTable:s})=>{const n=Q(),[d,p]=i.useState(null),[x]=i.useContext(pu),o=c=>p(c.currentTarget),f=()=>p(null),b=!!d,F=b?"popover":void 0,A=()=>{n(Cu({title:"آیا مطمئن هستید؟",content:u.jsxs(l,{container:!0,spacing:2,children:[u.jsx(R,{variant:"contained",onClick:()=>{n(a0(e==null?void 0:e.key)).then(c=>{c.payload.error?x({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(s(),n(hu()),x({vertical:"top",horizontal:"center",msg:c.payload.data.result,severity:"success"}))})},children:"تایید"}),u.jsx(R,{onClick:()=>n(hu()),children:"لغو"})]})})),f()},E=()=>{n(Cu({title:"تایید/ رد",content:u.jsx(o0,{item:e,updateTable:s,openNotif:x})})),f()};return u.jsxs("div",{children:[u.jsx(wu,{"aria-describedby":F,color:"primary",onClick:o,children:u.jsx(u0,{})}),u.jsx($u,{id:F,open:b,anchorEl:d,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsx(Vu,{dense:!0,sx:{py:0,minWidth:200},children:N()!=="KillHouse"?u.jsxs(u.Fragment,{children:[u.jsx(nu,{title:"ویرایش",placement:"left-start",children:u.jsx(su,{disablePadding:!0,children:u.jsxs(ou,{sx:{py:.5},onClick:()=>{f(),n(ru({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Ou,{item:e,isEdit:!0,updateTable:s}),title:"ویرایش اختلاف کشتار"}))},children:[u.jsx(lu,{sx:{minWidth:40},children:u.jsx(e0,{color:"primary",fontSize:"small"})}),u.jsx(cu,{primary:"ویرایش اختلاف کشتار",primaryTypographyProps:{color:"primary",variant:"body2"}})]})})}),u.jsx(nu,{title:"حذف",placement:"left-start",children:u.jsx(su,{disablePadding:!0,children:u.jsxs(ou,{sx:{py:.5},onClick:()=>{f(),A()},children:[u.jsx(lu,{sx:{minWidth:40},children:u.jsx(r0,{color:"error",fontSize:"small"})}),u.jsx(cu,{primary:"حذف اختلاف کشتار",primaryTypographyProps:{color:"error",variant:"body2"}})]})})})]}):u.jsx(nu,{title:"تایید/ رد",placement:"left-start",children:u.jsx(su,{disablePadding:!0,children:u.jsxs(ou,{sx:{py:.5},onClick:()=>{f(),E()},children:[u.jsx(lu,{sx:{minWidth:40},children:u.jsx(Ku,{color:"primary",fontSize:"small"})}),u.jsx(cu,{primary:"تایید/ رد اختلاف",primaryTypographyProps:{color:"primary",variant:"body2"}})]})})})})})]})},o0=({item:e,updateTable:s,openNotif:n})=>{const d=Q(),[p,x]=i.useState(""),[o,f]=i.useState([]),[b,F]=i.useState([]),A=c=>{d(Pu({bar_key:e==null?void 0:e.key,kill_house_check:!0,acceptor_message:p,acceptor_images:b,state:c})).then(y=>{y.payload.error?n({vertical:"top",horizontal:"center",msg:y.payload.error,severity:"error"}):(s(),d(hu()),n({vertical:"top",horizontal:"center",msg:y.payload.data.result,severity:"success"}))})},E=c=>{if(c.length===0){f([]),F([]);return}Promise.all(c.map(y=>new Promise(j=>Lu(y.file,T=>j(qu(T)))))).then(y=>{f(c),F(y)})};return u.jsxs(l,{container:!0,spacing:2,justifyContent:"center",children:[u.jsx(l,{item:!0,xs:12,justifyContent:"center",children:u.jsx(h,{variant:"body2",color:"error",children:"توجه: در صورت تایید حجم قطعه اعلام شده، حجم مورد نظر از سالن مرغدار کسر شده و با میانگین وزن کشتار مرغدار به انبار شما اضافه می‌گردد."})}),u.jsx(l,{item:!0,xs:12,justifyContent:"center",children:u.jsx(Nu,{onChange:E,images:o,maxNumber:1,title:"سند"})}),u.jsx(l,{item:!0,xs:12,justifyContent:"center",children:u.jsx(I,{label:"توضیحات",value:p,onChange:c=>x(c.target.value),fullWidth:!0})}),u.jsx(l,{item:!0,children:u.jsx(R,{variant:"contained",color:"success",onClick:()=>A("accepted"),children:"تایید"})}),u.jsx(l,{item:!0,children:u.jsx(R,{variant:"contained",color:"error",onClick:()=>A("rejected"),children:"رد"})})]})},l0=q("GET_PROVINCE_BAR_DIFFRENCE_REQUEST",async(e,{dispatch:s})=>{s(L());const{data:n,status:d}=await B.get("dashboard_bar_difference_request/",{params:{role:N(),state:e.state,filter:"search",value:e.value,date1:e.date1,date2:e.date2}});return s(_()),{data:n,status:d}}),c0=({item:e})=>{var x,o,f,b,F,A;const[s,n]=i.useState(0),d=(E,c)=>{n(c)},p=[];return(e!=null&&e.registerMessage||(x=e==null?void 0:e.violationImage)!=null&&x[0])&&p.push({key:"register",label:"درخواست کننده"}),(e!=null&&e.acceptorMessage||(o=e==null?void 0:e.acceptorImage)!=null&&o[0])&&p.push({key:"acceptor",label:"کشتارگاه"}),i.useEffect(()=>{s>=p.length&&n(0)},[p.length,s]),u.jsxs(l,{container:!0,xs:12,flexDirection:"column",sx:{width:"100%",justifyContent:"center",alignItems:"center"},children:[u.jsx(mu,{value:s,onChange:d,centered:!0,children:p.map((E,c)=>u.jsx(du,{label:E.label},E.key))}),((f=p[s])==null?void 0:f.key)==="register"&&u.jsxs(l,{container:!0,sx:{padding:2,width:"100%",marginTop:"10px"},children:[(e==null?void 0:e.registerMessage)&&u.jsx(I,{label:"پیغام درخواست کننده",value:e==null?void 0:e.registerMessage,fullWidth:!0,multiline:!0,variant:"outlined",InputProps:{readOnly:!0,style:{color:"black"}},sx:{backgroundColor:"white","& .MuiOutlinedInput-notchedOutline":{borderColor:"#c4c4c4"}}}),((b=e==null?void 0:e.violationImage)==null?void 0:b[0])&&u.jsxs(l,{item:!0,mt:2,sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:[u.jsx(h,{variant:"subtitle2",sx:{mb:1},children:"پیوست درخواست کننده:"}),u.jsx(Tu,{src:e==null?void 0:e.violationImage[0]})]})]}),((F=p[s])==null?void 0:F.key)==="acceptor"&&u.jsxs(l,{container:!0,sx:{padding:2,width:"100%"},children:[(e==null?void 0:e.acceptorMessage)&&u.jsx(I,{label:"پیغام کشتارگاه",value:e==null?void 0:e.acceptorMessage,fullWidth:!0,multiline:!0,variant:"outlined",InputProps:{readOnly:!0,style:{color:"black"}},sx:{backgroundColor:"white","& .MuiOutlinedInput-notchedOutline":{borderColor:"#c4c4c4"}}}),((A=e==null?void 0:e.acceptorImage)==null?void 0:A[0])&&u.jsxs(l,{item:!0,mt:2,sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:[u.jsx(h,{variant:"subtitle2",sx:{mb:1},children:"پیوست کشتارگاه:"}),u.jsx(Tu,{src:e==null?void 0:e.acceptorImage[0]})]})]})]})},i0=({state:e})=>{var O,W,M,$,V,z;const s=Q(),[,,n,d,p,x]=i.useContext(pu),[o,f]=i.useState([]),[b,F]=i.useState(0),[A,E]=i.useState(10),[c,y]=i.useState(""),[j,T]=i.useState(1),[tu,t]=i.useState([]),[g,G]=i.useState([]),S=async C=>{s(L());try{const r=await B.get(`bar-difference-request/?search=filter&value=${c}&role=${N()}&page=${C}&page_size=${A}&state=${e}&date1=${n}&date2=${p}`);f(r.data.results),F(r.data.count)}catch(r){console.error("Error fetching data:",r)}finally{s(_())}},w=()=>{s(l0({role:N(),state:e,filter:"search",value:c,date1:n,date2:p})).then(C=>{var r;(r=C.payload)!=null&&r.data&&G(C.payload.data)})},H=C=>{S(C),T(C)},U=C=>{E(C),T(1)},P=()=>{S(j!==0?j:1),w()};i.useEffect(()=>{const C=o==null?void 0:o.map((r,D)=>{var Y,a,v,X,m,Z,uu,eu,gu,Au,xu,fu,yu,ju,vu,Fu,bu,Eu,Iu,_u,ku;return[j===1?D+1:D+A*(j-1)+1,r==null?void 0:r.registerFullname,Ju(r==null?void 0:r.createDate),`${((a=(Y=r==null?void 0:r.hatching)==null?void 0:Y.poultry)==null?void 0:a.unitName)||""} (${((m=(X=(v=r==null?void 0:r.hatching)==null?void 0:v.poultry)==null?void 0:X.user)==null?void 0:m.mobile)||""})`,`${((Z=r==null?void 0:r.killHouse)==null?void 0:Z.name)||""} (${((gu=(eu=(uu=r==null?void 0:r.killHouse)==null?void 0:uu.killHouseOperator)==null?void 0:eu.user)==null?void 0:gu.mobile)||""})`,(xu=(Au=r==null?void 0:r.barInfo)==null?void 0:Au.totalQuantity)==null?void 0:xu.toLocaleString(),(yu=(fu=r==null?void 0:r.barInfo)==null?void 0:fu.totalWeight)==null?void 0:yu.toLocaleString(),(vu=(ju=r==null?void 0:r.barInfo)==null?void 0:ju.firstTotalQuantity)==null?void 0:vu.toLocaleString(),(bu=(Fu=r==null?void 0:r.barInfo)==null?void 0:Fu.differenceQuantity)==null?void 0:bu.toLocaleString(),(Eu=r==null?void 0:r.quantity)==null?void 0:Eu.toLocaleString(),(Iu=r==null?void 0:r.weight)==null?void 0:Iu.toLocaleString(),(_u=r==null?void 0:r.acceptorImages)!=null&&_u[0]||r!=null&&r.acceptorMessage||r!=null&&r.registerMessage||(ku=r==null?void 0:r.violationImage)!=null&&ku[0]?u.jsx(l,{container:!0,children:u.jsx(wu,{variant:"contained",onClick:()=>{s(Cu({content:u.jsx(c0,{item:r}),title:"پیوست"}))},children:"✉️"})},D):"-",r.state==="pending"?"در انتظار تایید":r.state==="rejected"?"رد شده":"تایید شده",e==="pending"?u.jsx(s0,{updateTable:P,item:r},D):"-"]});t(C)},[o,e,j,A]),i.useEffect(()=>{S(1),w()},[e,A,n,p]);const K=C=>{y(C.target.value)},J=async C=>{C.preventDefault(),S(1),w()};return u.jsxs(l,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(l,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(l,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(Bu,{noPagination:!0,isDashboard:!0,columns:["تعداد","وزن تقریبی کشتار","حجم سفارشات دریافتی توسط کشتارگاه","اختلاف کشتار (حجم)","اختلاف حجم","اختلاف وزن"],data:[[(O=g==null?void 0:g.count)==null?void 0:O.toLocaleString(),(W=g==null?void 0:g.totalWeight)==null?void 0:W.toLocaleString(),(M=g==null?void 0:g.firstTotalQuantity)==null?void 0:M.toLocaleString(),($=g==null?void 0:g.differenceQuantity)==null?void 0:$.toLocaleString(),(V=g==null?void 0:g.quantity)==null?void 0:V.toLocaleString(),(z=g==null?void 0:g.weight)==null?void 0:z.toLocaleString()]],title:"خلاصه اطلاعات"})}),N()!=="KillHouse"&&u.jsx(l,{children:u.jsx(R,{variant:"contained",onClick:()=>{s(ru({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Ou,{updateTable:P}),title:" ثبت اختلاف کشتار"}))},children:"ثبت اختلاف کشتار"})}),u.jsx(l,{children:u.jsx(Du,{label:"از تاریخ",renderInput:C=>u.jsx(I,{...C,style:{width:"160px"},size:"small"}),value:n,onChange:C=>{d(Ru(C).format("YYYY-MM-DD"))}})}),u.jsx(l,{children:u.jsx(Du,{label:"تا تاریخ",renderInput:C=>u.jsx(I,{...C,style:{width:"160px"},size:"small"}),value:p,onChange:C=>{x(Ru(C).format("YYYY-MM-DD"))}})}),u.jsx(l,{children:u.jsxs("form",{onSubmit:J,children:[u.jsx(I,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:K}),u.jsx(R,{type:"submit",endIcon:u.jsx(Xu,{}),children:"جستجو"})]})})]}),u.jsx(Bu,{data:tu,customColors:[{name:"اختلاف حجم",color:"#ff5555"},{name:"اختلاف وزن",color:"#ff5555"}],columns:["ردیف","ثبت کننده","تاریخ ثبت","مرغدار","کشتارگاه","حجم کم شده از سالن مرغدار","وزن تقریبی کشتار (کیلوگرم)","حجم سفارشات دریافتی توسط کشتارگاه"," اختلاف کشتار(حجم)","اختلاف حجم","اختلاف وزن","پیوست","وضعیت","عملیات"],handlePageChange:H,totalRows:b,page:j,perPage:A,handlePerRowsChange:U,title:e==="pending"?"اختلاف کشتار":"بایگانی اختلاف کشتار"})]})},d0=q("PROVINCE_BAR_DASHBOARD_SERVICE",async(e,{dispatch:s})=>{s(L());const{data:n,status:d}=await B.get("dashboard_bar_difference_request/",{params:{role:N(),date1:e.selectedDate1,date2:e.selectedDate2,filter:"search",value:e.textValue,state:e.state}});return s(_()),{data:n,status:d}}),I0=()=>{const[e,s]=i.useState("0"),n=Q(),d=(p,x)=>{s(x),n(d0({state:x==="0"?"pending":"archive"}))};return u.jsxs(l,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsxs(mu,{value:e,onChange:d,children:[u.jsx(du,{value:"0",label:"جدید"}),u.jsx(du,{value:"1",label:"بایگانی شده"})]}),u.jsx(l,{container:!0,xs:12,justifyContent:"center",alignItem:"center",mt:2,children:u.jsx(i0,{state:e==="0"?"pending":"archive"})})]})};export{I0 as P,c0 as a}; diff --git a/build/assets/ProvinceCases-0uMkWb0x.js b/build/assets/ProvinceCases-0uMkWb0x.js new file mode 100644 index 0000000..564ed1a --- /dev/null +++ b/build/assets/ProvinceCases-0uMkWb0x.js @@ -0,0 +1 @@ +import{j as u,T as C,cb as Nu,cc as wu,cd as Iu,p as Bu,a9 as Mu,d as Ru,I as Ku,bn as Pu,ak as vu,B as Fu,bq as Wu}from"./mui-vendor-CkIVaoQP.js";import{G as h,S as v,p as cu,q as Qu,v as Tu,l as Uu,A as ku,t as Vu,g4 as Yu,a9 as Su,W as $u,j as gu,X as Hu,L as Gu,h as Ou}from"./index-CeyyVc1v.js";import{R as _u,a as fu}from"./index.esm-Bu7XMDZU.js";import{r as M}from"./react-vendor-CmFgShSM.js";import{G as Ju}from"./iconBase-BEJYyZsk.js";import{u as Xu,f as zu}from"./redux-vendor-B7uoacJt.js";import{R as Du}from"./ResponsiveTable-w7hk7Uq8.js";const Zu=({item:e})=>{var c,s,n,b,H,i,x,A,a,R,o,k,d,S,f,E;return u.jsxs(h,{container:!0,direction:{xs:"column",sm:"row"},justifyContent:"space-between",gap:v.SMALL,mt:v.SMALL,children:[u.jsxs(h,{children:[u.jsxs(h,{container:!0,gap:v.SMALL,children:[u.jsx(C,{variant:"caption",children:"مرغداری:"}),u.jsx(C,{variant:"caption",children:(c=e==null?void 0:e.poultry)==null?void 0:c.unitName})]}),u.jsxs(h,{container:!0,gap:v.SMALL,children:[u.jsx(C,{variant:"caption",children:"مرغدار:"}),u.jsx(C,{variant:"caption",children:(n=(s=e==null?void 0:e.poultry)==null?void 0:s.user)==null?void 0:n.fullname})]}),u.jsxs(h,{container:!0,gap:v.SMALL,children:[u.jsx(C,{variant:"caption",children:"موبایل:"}),u.jsx(C,{variant:"caption",children:(H=(b=e==null?void 0:e.poultry)==null?void 0:b.user)==null?void 0:H.mobile})]}),u.jsxs(h,{container:!0,gap:v.SMALL,children:[u.jsx(C,{variant:"caption",children:"تاریخ کشتار:"}),u.jsx(C,{variant:"caption",children:cu(e==null?void 0:e.sendDate)})]}),u.jsxs(h,{container:!0,gap:v.SMALL,children:[u.jsx(C,{variant:"caption",children:"زمان و تاریخ ثبت:"}),u.jsx(C,{variant:"caption",children:cu(e==null?void 0:e.createDate)})]}),u.jsxs(h,{container:!0,gap:v.SMALL,children:[u.jsx(C,{variant:"caption",children:"شهرستان:"}),u.jsx(C,{variant:"caption",children:(A=(x=(i=e==null?void 0:e.poultry)==null?void 0:i.address)==null?void 0:x.city)==null?void 0:A.name})]})]}),u.jsxs(h,{children:[u.jsxs(h,{container:!0,gap:v.SMALL,children:[u.jsx(C,{variant:"caption",children:"تعداد:"}),u.jsx(C,{variant:"caption",children:(a=e==null?void 0:e.quantity)==null?void 0:a.toLocaleString()})]}),u.jsxs(h,{container:!0,gap:v.SMALL,children:[u.jsx(C,{variant:"caption",children:"متوسط وزن:"}),u.jsx(C,{variant:"caption",children:e==null?void 0:e.IndexWeight})]}),u.jsxs(h,{container:!0,gap:v.SMALL,children:[u.jsx(C,{variant:"caption",children:"وزن حدودی:"}),u.jsx(C,{variant:"caption",children:(R=e==null?void 0:e.hatching)==null?void 0:R.weight})]}),u.jsxs(h,{container:!0,gap:v.SMALL,children:[u.jsx(C,{variant:"caption",children:"سن گله:"}),u.jsx(C,{variant:"caption",children:(o=e==null?void 0:e.hatching)==null?void 0:o.age})]}),u.jsxs(h,{container:!0,gap:v.SMALL,children:[u.jsx(C,{variant:"caption",children:"نژاد:"}),u.jsx(C,{variant:"caption",children:e==null?void 0:e.chickenBreed})]}),u.jsxs(h,{container:!0,gap:v.SMALL,children:[u.jsx(C,{variant:"caption",children:"قیمت پیشنهادی:"}),u.jsxs(C,{variant:"caption",children:[(k=e==null?void 0:e.amount)==null?void 0:k.toLocaleString()," ریال"]})]})]}),u.jsx(h,{children:(d=e==null?void 0:e.provinceKillRequests)!=null&&d.provinceKillRequestSerializer.length?u.jsxs(u.Fragment,{children:[u.jsx(h,{container:!0,gap:v.SMALL,children:u.jsx(C,{variant:"caption",children:"خریداران:"})}),(f=(S=e==null?void 0:e.provinceKillRequests)==null?void 0:S.provinceKillRequestSerializer)==null?void 0:f.map((p,F)=>{var q,g,B,N,w;return u.jsxs(h,{container:!0,gap:v.TINY,children:[u.jsxs(C,{variant:"caption",children:[F+1,"- "]}),u.jsx(C,{variant:"caption",children:(q=p==null?void 0:p.killhouseUser)==null?void 0:q.name}),u.jsxs(C,{variant:"caption",children:["(",(N=(B=(g=p==null?void 0:p.killhouseUser)==null?void 0:g.killHouseOperator)==null?void 0:B.user)==null?void 0:N.mobile,")"]}),u.jsx(C,{variant:"caption",children:"تعداد: "}),u.jsx(C,{variant:"caption",children:(w=p==null?void 0:p.mainQuantity)==null?void 0:w.toLocaleString()}),u.jsx(C,{variant:"caption",children:"محل کشتار: "}),u.jsx(C,{variant:"caption",children:p==null?void 0:p.killPlace})]},F)})]}):u.jsx(u.Fragment,{children:u.jsx(h,{container:!0,gap:v.SMALL,children:u.jsx(C,{variant:"caption",children:"خریداران: بدون خریدار"})})})}),u.jsx(h,{children:u.jsxs(h,{container:!0,gap:v.SMALL,children:[u.jsx(C,{variant:"caption",children:"قیمت مرغ:"}),u.jsxs(C,{variant:"caption",children:[(E=e==null?void 0:e.amount)==null?void 0:E.toLocaleString()," ریال"]})]})})]})},mu=({stepClickedHandler:e,item:c})=>{const[s,n]=M.useState(0);M.useEffect(()=>{var x,A,a,R,o,k,d,S,f,E;let i=0;((x=c==null?void 0:c.cityState)==null?void 0:x.state)==="reject"||((A=c==null?void 0:c.provinceState)==null?void 0:A.state)==="reject"?i=-1:((a=c==null?void 0:c.cityState)!=null&&a.date&&(i=1),(R=c==null?void 0:c.provinceState)!=null&&R.date&&(i=2),((o=c==null?void 0:c.provinceKillRequests)==null?void 0:o.provinceKillRequestSerializer.length)>0&&(i=3),((k=c==null?void 0:c.killHouseRequests)==null?void 0:k.killHouseRequestsSerializer.length)>0&&(i=4),((S=(d=c==null?void 0:c.killHouseRequests)==null?void 0:d.killHouseRequestVetCheckSerializer)==null?void 0:S.length)>0&&(i=5),((E=(f=c==null?void 0:c.killHouseRequests)==null?void 0:f.killHouseRequestAssignmentSerializer)==null?void 0:E.length)>0&&(i=6)),n(i)},[c]);const b=c.out?["درخواست کشتار","تایید شهرستان","تایید استان"]:["درخواست کشتار","تایید شهرستان","تایید استان","تخصیص به خریدار","ایجاد بار","تخلیه","اطلاعات بار","اطلاعات پرداخت"],H=i=>{var A,a;let x=!1;switch(i){case 1:x=((A=c==null?void 0:c.cityState)==null?void 0:A.state)==="reject";break;case 2:x=((a=c==null?void 0:c.provinceState)==null?void 0:a.state)==="reject";break}return x};return u.jsxs(h,{container:!0,width:"100%",mt:v.MEDIUM,justifyContent:"start",alignItems:"center",children:[u.jsx(h,{display:{xs:"none",sm:"grid"},width:"100%",children:u.jsx(Nu,{activeStep:s,alternativeLabel:!0,children:b.map((i,x)=>{const A={};return H(x)&&(A.optional=u.jsx(C,{variant:"caption",color:"error",children:"پرونده در این مرحله رد شد."}),A.error=!0),u.jsx(wu,{sx:{cursor:"pointer"},onClick:()=>{s>=x&&e(x)},children:u.jsx(Iu,{...A,children:i})},i)})})}),u.jsx(h,{display:{xs:"block",sm:"none"},children:u.jsx(Nu,{activeStep:s,orientation:"vertical",children:b.map((i,x)=>{const A={};return H(x)&&(A.optional=u.jsx(C,{variant:"caption",color:"error",children:"پرونده در این مرحله رد شد."}),A.error=!0),u.jsx(wu,{onClick:()=>{s>=x&&e(x)},children:u.jsx(Iu,{...A,children:i})},i)})})})]})},u6=()=>u.jsx(C,{children:"اطلاعات پرداخت"});function l6(e){return Ju({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.523 12.424c.14-.082.293-.162.459-.238a7.878 7.878 0 0 1-.45.606c-.28.337-.498.516-.635.572a.266.266 0 0 1-.035.012.282.282 0 0 1-.026-.044c-.056-.11-.054-.216.04-.36.106-.165.319-.354.647-.548zm2.455-1.647c-.119.025-.237.05-.356.078a21.148 21.148 0 0 0 .5-1.05 12.045 12.045 0 0 0 .51.858c-.217.032-.436.07-.654.114zm2.525.939a3.881 3.881 0 0 1-.435-.41c.228.005.434.022.612.054.317.057.466.147.518.209a.095.095 0 0 1 .026.064.436.436 0 0 1-.06.2.307.307 0 0 1-.094.124.107.107 0 0 1-.069.015c-.09-.003-.258-.066-.498-.256zM8.278 6.97c-.04.244-.108.524-.2.829a4.86 4.86 0 0 1-.089-.346c-.076-.353-.087-.63-.046-.822.038-.177.11-.248.196-.283a.517.517 0 0 1 .145-.04c.013.03.028.092.032.198.005.122-.007.277-.038.465z"}},{tag:"path",attr:{fillRule:"evenodd",d:"M4 0h5.293A1 1 0 0 1 10 .293L13.707 4a1 1 0 0 1 .293.707V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm5.5 1.5v2a1 1 0 0 0 1 1h2l-3-3zM4.165 13.668c.09.18.23.343.438.419.207.075.412.04.58-.03.318-.13.635-.436.926-.786.333-.401.683-.927 1.021-1.51a11.651 11.651 0 0 1 1.997-.406c.3.383.61.713.91.95.28.22.603.403.934.417a.856.856 0 0 0 .51-.138c.155-.101.27-.247.354-.416.09-.181.145-.37.138-.563a.844.844 0 0 0-.2-.518c-.226-.27-.596-.4-.96-.465a5.76 5.76 0 0 0-1.335-.05 10.954 10.954 0 0 1-.98-1.686c.25-.66.437-1.284.52-1.794.036-.218.055-.426.048-.614a1.238 1.238 0 0 0-.127-.538.7.7 0 0 0-.477-.365c-.202-.043-.41 0-.601.077-.377.15-.576.47-.651.823-.073.34-.04.736.046 1.136.088.406.238.848.43 1.295a19.697 19.697 0 0 1-1.062 2.227 7.662 7.662 0 0 0-1.482.645c-.37.22-.699.48-.897.787-.21.326-.275.714-.08 1.103z"}}]})(e)}const du="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAbQAAAG0BjlwfygAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAACGSURBVDiNxdAxCgIxEAXQp/1eQARlT2DnObyEl9Bij2ApeDfRfgsLW1mbDawDQhILB6ZJ/vuB8KdpsK7FLW54YV+D7xjGffyCB5xy8QrXgC+Yp8AWi4KXz5ilwHE87LEpxfCcXE5LsjAcQqjHLhen6UI47seHlZZk4W8lRTiWVOE0y1pYPG/VW0IYJ55ztwAAAABJRU5ErkJggg==",pu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAArklEQVR4nO2Syw3CMBAFJw2EK4hLaAEoKUkFRLQBtMK3ARKuoRQoAGTpRVpZjnyCk0faS8a7T/YGEonEX1kDZ+AJ7IGJcRlQA52q0rcBd/ag3hOw8ocvgDfwMXUxvvacq9L4m+deQGEDtoEBrmbyj4Br5eYjvY0NaCIBXcDd5aYjvRsbUOha9oDbx0AVeaJr7InQYo5AD+yA3LhMIa2q9Jac68foNWPpD08kEvyOL/PvS+0Tw0KbAAAAAElFTkSuQmCC",l={page:{width:"214mm",height:"302mm",display:"flex",margin:"0 auto",flexDirection:"column",position:"relative",direction:"rtl",fontFamily:"titr",fontWeight:"bold"},pageData:{position:"relative",display:"flex",direction:"rtl",flexDirection:"column"},invoiceTable:{width:"195mm",borderCollapse:"collapse",alignSelf:"center"},tableCell:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:9},tableCellAlert:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:9,color:"red"},tableHeader:{pageBreakAfter:"auto"},headerRow:{backgroundColor:"rgba(32, 95, 243, 0.8)",color:"white",pageBreakInside:"avoid",pageBreakAfter:"auto"},logo:{marginTop:"15px",width:"100px",height:"auto",zIndex:10},contentContainer:{alignItems:"center",display:"flex",justifyContent:"space-between",marginRight:"20px",marginLeft:"20px"},contentInLine:{display:"flex",flexDirection:"column",alignItems:"center"},watermarkContainer:{position:"fixed",top:350,left:30,right:0,bottom:0,justifyContent:"center",alignItems:"center",opacity:.15,zIndex:-1,userSelect:"none"},watermarkp:{fontFamily:"nazanin",fontSize:100,fontWeight:"bolder",color:"grey",transform:"rotate(-45deg)",left:"50%",userSelect:"none"},firsttitle:{pAlign:"center",color:"#00008b",fontWeight:"800"},divider:{alignSelf:"center",width:"120mm",height:"1px",backgroundColor:"black",margin:"0em"},tableHeaderCell:{backgroundColor:"rgba(211, 211, 211, 0.3)",fontSize:10,border:"1px solid #000",padding:"4px",textAlign:"center",fontWeight:"bold"},levelDetails:{color:"red",fontSize:10}},Eu=M.forwardRef((e,c)=>{var S,f,E,p,F,q,g,B,N,w,K,P,W,Q,U,Z,m,uu,lu,ou,Cu,hu,iu,xu,y,D,Lu,qu;const{item:s}=e,n=j=>{let L="";return j!=null&&j.directBuying?L="خرید مستقیم":j!=null&&j.union?L="خرید خارج از استان":L="اتحادیه",L},b=()=>{var j;return u.jsx(u.Fragment,{children:u.jsxs("div",{style:l.contentContainer,children:[u.jsx("div",{style:l.contentInLine}),u.jsxs("div",{style:{...l.contentInLine,marginRight:"100px"},children:[u.jsxs("span",{style:{...l.firsttitle,fontSize:14,zIndex:1},children:["مشخصات پرونده با کد سفارش ",s==null?void 0:s.orderCode]}),u.jsxs("span",{style:{fontSize:"15px",color:"#485460"},children:["فروش از طریق ",n(s)]}),u.jsxs("span",{style:{fontSize:"10px",color:"red"},children:["این گزارش در تاریخ ",cu(Tu())," ساعت"," ",Qu(Tu())," صادر شده است."]}),u.jsx("hr",{style:l.divider}),u.jsxs("span",{style:{fontSize:"14px",color:"#2d3436"},children:["اطلاعات پرونده کشتار تاریخ ",cu(s==null?void 0:s.sendDate)," ","مرغداری ",(j=s==null?void 0:s.poultry)==null?void 0:j.unitName]})]}),u.jsx("div",{style:l.contentInLine,children:u.jsx("img",{alt:"logo",src:Uu,style:l.logo})})]})})},H=()=>{var j,L,r,I,T,$,z,V,Y,G,O,_,J,X;return u.jsxs("table",{style:l.invoiceTable,children:[u.jsx("thead",{style:l.tableHeader,children:u.jsxs("tr",{style:l.headerRow,children:[u.jsx("th",{style:l.tableHeaderCell,children:"کد سفارش"}),u.jsx("th",{style:l.tableHeaderCell,children:"مرغدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"تلفن"}),u.jsx("th",{style:l.tableHeaderCell,children:"تاریخ درخواست کشتار"}),u.jsx("th",{style:l.tableHeaderCell,children:"آدرس"}),u.jsx("th",{style:l.tableHeaderCell,children:"تاریخ جوجه ریزی"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعداد جوجه ریزی"}),u.jsx("th",{style:l.tableHeaderCell,children:"مانده در سالن"}),u.jsx("th",{style:l.tableHeaderCell,children:"سفارش کشتار (قطعه)"}),u.jsx("th",{style:l.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:l.tableHeaderCell,children:"وزن تقریبی سفارش"}),u.jsx("th",{style:l.tableHeaderCell,children:"قیمت پیشنهادی"}),u.jsx("th",{style:l.tableHeaderCell,children:"نوع فروش"}),u.jsx("th",{style:l.tableHeaderCell,children:"فرآیند مالی"}),u.jsx("th",{style:l.tableHeaderCell,children:"دامپزشک فارم"})]})}),u.jsx("tbody",{children:u.jsxs("tr",{style:l.tableRow,children:[u.jsx("td",{style:l.tableCell,children:s==null?void 0:s.orderCode}),u.jsx("td",{style:l.tableCell,children:(j=s==null?void 0:s.poultry)==null?void 0:j.unitName}),u.jsx("td",{style:l.tableCell,children:(r=(L=s==null?void 0:s.poultry)==null?void 0:L.user)==null?void 0:r.mobile}),u.jsx("td",{style:l.tableCell,children:cu(s==null?void 0:s.sendDate)}),u.jsx("td",{style:l.tableCell,children:(T=(I=s==null?void 0:s.poultry)==null?void 0:I.address)==null?void 0:T.address}),u.jsx("td",{style:l.tableCell,children:cu(s==null?void 0:s.sendDate)}),u.jsx("td",{style:l.tableCell,children:($=s==null?void 0:s.amount)==null?void 0:$.toLocaleString()}),u.jsx("td",{style:l.tableCell,children:(V=(z=s==null?void 0:s.hatching)==null?void 0:z.leftOver)==null?void 0:V.toLocaleString()}),u.jsx("td",{style:l.tableCell,children:(Y=s==null?void 0:s.quantity)==null?void 0:Y.toLocaleString()}),u.jsx("td",{style:l.tableCell,children:s==null?void 0:s.IndexWeight}),u.jsx("td",{style:l.tableCell,children:(G=s==null?void 0:s.hatching)==null?void 0:G.weight}),u.jsx("td",{style:l.tableCell,children:(O=s==null?void 0:s.amount)==null?void 0:O.toLocaleString()}),u.jsx("td",{style:l.tableCell,children:(s==null?void 0:s.freeSaleInProvince)===!1?"دولتی":"آزاد"}),u.jsx("td",{style:l.tableCell,children:(s==null?void 0:s.financialOperation)==="outside-system"?"خارج از سامانه":"از طریق سامانه"}),u.jsx("td",{style:l.tableCell,children:(_=s==null?void 0:s.hatching)!=null&&_.vetFarmInfo?`${(J=s==null?void 0:s.vetFarm)==null?void 0:J.vetFarmFullName} (${(X=s==null?void 0:s.vetFarm)==null?void 0:X.vetFarmMobile})`:"ندارد"})]})})]})},i=()=>{var j,L,r,I,T,$,z;return u.jsxs("table",{style:l.invoiceTable,children:[u.jsx("thead",{style:l.tableHeader,children:u.jsxs("tr",{style:l.headerRow,children:[u.jsx("th",{style:l.tableHeaderCell,children:"اپراتور"}),u.jsx("th",{style:l.tableHeaderCell,children:"سمت"}),u.jsx("th",{style:l.tableHeaderCell,children:"تلفن"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعاونی مرغدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"آدرس"}),u.jsx("th",{style:l.tableHeaderCell,children:"وضعیت"})]})}),(j=s==null?void 0:s.cityState)!=null&&j.date?u.jsx("tbody",{children:u.jsxs("tr",{style:l.tableRow,children:[u.jsx("td",{style:l.tableCell,children:(L=s==null?void 0:s.cityState)==null?void 0:L.cityOperatorFullname}),u.jsx("td",{style:l.tableCell,children:"سمت"}),u.jsx("td",{style:l.tableCell,children:(r=s==null?void 0:s.cityState)==null?void 0:r.cityOperatorMobile}),u.jsx("td",{style:l.tableCell,children:(I=s==null?void 0:s.cityState)==null?void 0:I.poultry}),u.jsx("td",{style:l.tableCell,children:((T=s==null?void 0:s.cityState)==null?void 0:T.province)+" - "+(($=s==null?void 0:s.cityState)==null?void 0:$.city)}),u.jsx("td",{style:l.tableCell,children:((z=s==null?void 0:s.cityState)==null?void 0:z.state)==="accept"?"تایید شده":"رد شده"})]})}):u.jsx("td",{style:l.tableCellAlert,colSpan:6,children:"هنوز شهرستان پرونده را تائید نکرده است"})]})},x=()=>{var j,L,r,I,T,$,z;return u.jsxs("table",{style:l.invoiceTable,children:[u.jsx("thead",{style:l.tableHeader,children:u.jsxs("tr",{style:l.headerRow,children:[u.jsx("th",{style:l.tableHeaderCell,children:"اپراتور"}),u.jsx("th",{style:l.tableHeaderCell,children:"سمت"}),u.jsx("th",{style:l.tableHeaderCell,children:"تلفن"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعاونی مرغدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"آدرس"}),u.jsx("th",{style:l.tableHeaderCell,children:"وضعیت"})]})}),(j=s==null?void 0:s.provinceState)!=null&&j.date?u.jsx("tbody",{children:u.jsxs("tr",{style:l.tableRow,children:[u.jsx("td",{style:l.tableCell,children:(L=s==null?void 0:s.provinceState)==null?void 0:L.provinceOperatorFullname}),u.jsx("td",{style:l.tableCell,children:"اپراتور استان"}),u.jsx("td",{style:l.tableCell,children:(r=s==null?void 0:s.provinceState)==null?void 0:r.cityOperatorMobile}),u.jsx("td",{style:l.tableCell,children:(I=s==null?void 0:s.provinceState)==null?void 0:I.poultry}),u.jsx("td",{style:l.tableCell,children:((T=s==null?void 0:s.provinceState)==null?void 0:T.province)+" - "+(($=s==null?void 0:s.provinceState)==null?void 0:$.city)}),u.jsx("td",{style:l.tableCell,children:((z=s==null?void 0:s.provinceState)==null?void 0:z.state)==="accept"?"تایید شده":"رد شده"})]})}):u.jsx("td",{style:l.tableCellAlert,colSpan:6,children:"هنوز استان پرونده را تائید نکرده است"})]})},A=()=>{var j,L;return u.jsxs("table",{style:l.invoiceTable,children:[u.jsx("thead",{style:l.tableHeader,children:u.jsxs("tr",{style:l.headerRow,children:[u.jsx("th",{style:l.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:l.tableHeaderCell,children:"ماهیت خریدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"نوع تخصیص"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعداد تخصیصی"}),u.jsx("th",{style:l.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:l.tableHeaderCell,children:"وزن تخصیصی"}),u.jsx("th",{style:l.tableHeaderCell,children:"وضعیت"})]})}),(j=s==null?void 0:s.provinceKillRequests)!=null&&j.provinceKillRequestSerializer?u.jsx("tbody",{children:(L=s==null?void 0:s.provinceKillRequests)==null?void 0:L.provinceKillRequestSerializer.map((r,I)=>{var T,$,z,V,Y,G,O,_,J,X;return u.jsxs("tr",{style:l.tableRow,children:[u.jsx("td",{style:l.tableCell,children:I+1}),u.jsx("td",{style:l.tableCell,children:((T=r==null?void 0:r.killhouseUser)==null?void 0:T.killer)===!1?"کشتارگاه":"کشتارکن"}),u.jsx("td",{style:l.tableCell,children:`${(V=(z=($=r==null?void 0:r.killhouseUser)==null?void 0:$.killHouseOperator)==null?void 0:z.user)==null?void 0:V.fullname} (${(O=(G=(Y=r==null?void 0:r.killhouseUser)==null?void 0:Y.killHouseOperator)==null?void 0:G.user)==null?void 0:O.mobile})`}),u.jsx("td",{style:l.tableCell,children:(r==null?void 0:r.automatic)===!1?"دستی":"اتوماتیک"}),u.jsx("td",{style:l.tableCell,children:(_=r==null?void 0:r.weightInfo)==null?void 0:_.provinceKillRequestQuantity}),u.jsx("td",{style:l.tableCell,children:(J=r==null?void 0:r.weightInfo)==null?void 0:J.provinceKillRequestIndexWeight}),u.jsx("td",{style:l.tableCell,children:(X=r==null?void 0:r.weightInfo)==null?void 0:X.provinceKillRequestWeight}),u.jsx("td",{style:l.tableCell,children:(r==null?void 0:r.state)==="accepted"?"تایید شده":(r==null?void 0:r.state)==="rejected"?"رد شده":"در انتظار تایید"})]},I)})}):u.jsx("td",{style:l.tableCellAlert,colSpan:8,children:"داده ای ثبت نشده!"})]})},a=()=>{var j,L;return u.jsxs("table",{style:l.invoiceTable,children:[u.jsx("thead",{style:l.tableHeader,children:u.jsxs("tr",{style:l.headerRow,children:[u.jsx("th",{style:l.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:l.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:l.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:l.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:l.tableHeaderCell,children:"وزن بار"}),u.jsx("th",{style:l.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:l.tableHeaderCell,children:"کد قرنطینه"}),u.jsx("th",{style:l.tableHeaderCell,children:"محل کشتار"})]})}),(j=s==null?void 0:s.killHouseRequests)!=null&&j.killHouseRequestsSerializer?u.jsx("tbody",{children:(L=s==null?void 0:s.killHouseRequests)==null?void 0:L.killHouseRequestsSerializer.map((r,I)=>{var T,$,z,V,Y,G,O,_,J,X,eu,su,ru,tu,au,nu;return u.jsxs("tr",{style:l.tableRow,children:[u.jsx("td",{style:l.tableCell,children:I+1}),u.jsx("td",{style:l.tableCell,children:r==null?void 0:r.barCode}),u.jsx("td",{style:l.tableCell,children:`${(z=($=(T=r==null?void 0:r.killhouseUser)==null?void 0:T.killHouseOperator)==null?void 0:$.user)==null?void 0:z.fullname} (${(G=(Y=(V=r==null?void 0:r.killhouseUser)==null?void 0:V.killHouseOperator)==null?void 0:Y.user)==null?void 0:G.mobile})`}),u.jsx("td",{style:l.tableCell,children:`${(_=(O=r==null?void 0:r.addCar)==null?void 0:O.driver)==null?void 0:_.typeCar} (${(X=(J=r==null?void 0:r.addCar)==null?void 0:J.driver)==null?void 0:X.pelak})`}),u.jsx("td",{style:l.tableCell,children:`${(su=(eu=r==null?void 0:r.addCar)==null?void 0:eu.driver)==null?void 0:su.driverName} (${(tu=(ru=r==null?void 0:r.addCar)==null?void 0:ru.driver)==null?void 0:tu.driverMobile})`}),u.jsx("td",{style:l.tableCell,children:r==null?void 0:r.quantity.toLocaleString()}),u.jsx("td",{style:l.tableCell,children:(au=r==null?void 0:r.weightInfo)==null?void 0:au.weight}),u.jsx("td",{style:l.tableCell,children:(nu=r==null?void 0:r.weightInfo)==null?void 0:nu.indexWeight}),u.jsx("td",{style:l.tableCell,children:r==null?void 0:r.clearanceCode}),u.jsx("td",{style:l.tableCell,children:r==null?void 0:r.killPlace})]},I)})}):u.jsx("td",{style:l.tableCellAlert,colSpan:10,children:"داده ای ثبت نشده!"})]})},R=()=>{var j,L;return u.jsxs("table",{style:l.invoiceTable,children:[u.jsx("thead",{style:l.tableHeader,children:u.jsxs("tr",{style:l.headerRow,children:[u.jsx("th",{style:l.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:l.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:l.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:l.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:l.tableHeaderCell,children:"وزن بار"}),u.jsx("th",{style:l.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:l.tableHeaderCell,children:"کد قرنطینه"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعداد تخلیه شده "}),u.jsx("th",{style:l.tableHeaderCell,children:"وزن تخلیه شده "}),u.jsx("th",{style:l.tableHeaderCell,children:"وضعیت"}),u.jsx("th",{style:l.tableHeaderCell,children:"اطلاعات تخلیه"})]})}),(j=s==null?void 0:s.killHouseRequests)!=null&&j.killHouseRequestVetCheckSerializer?u.jsx("tbody",{children:(L=s==null?void 0:s.killHouseRequests)==null?void 0:L.killHouseRequestVetCheckSerializer.map((r,I)=>{var T,$,z,V,Y,G,O,_,J,X,eu,su,ru,tu,au,nu,ju,Au,yu,bu;return u.jsxs("tr",{style:l.tableRow,children:[u.jsx("td",{style:l.tableCell,children:I+1}),u.jsx("td",{style:l.tableCell,children:r==null?void 0:r.barCode}),u.jsx("td",{style:l.tableCell,children:`${(z=($=(T=r==null?void 0:r.killhouseUser)==null?void 0:T.killHouseOperator)==null?void 0:$.user)==null?void 0:z.fullname} (${(G=(Y=(V=r==null?void 0:r.killhouseUser)==null?void 0:V.killHouseOperator)==null?void 0:Y.user)==null?void 0:G.mobile})`}),u.jsx("td",{style:l.tableCell,children:`${(_=(O=r==null?void 0:r.addCar)==null?void 0:O.driver)==null?void 0:_.typeCar} (${(X=(J=r==null?void 0:r.addCar)==null?void 0:J.driver)==null?void 0:X.pelak})`}),u.jsx("td",{style:l.tableCell,children:`${(su=(eu=r==null?void 0:r.addCar)==null?void 0:eu.driver)==null?void 0:su.driverName} (${(tu=(ru=r==null?void 0:r.addCar)==null?void 0:ru.driver)==null?void 0:tu.driverMobile})`}),u.jsx("td",{style:l.tableCell,children:r==null?void 0:r.quantity.toLocaleString()}),u.jsx("td",{style:l.tableCell,children:(au=r==null?void 0:r.weightInfo)==null?void 0:au.weight}),u.jsx("td",{style:l.tableCell,children:(nu=r==null?void 0:r.weightInfo)==null?void 0:nu.indexWeight}),u.jsx("td",{style:l.tableCell,children:r==null?void 0:r.clearanceCode}),u.jsx("td",{style:l.tableCell,children:(ju=r==null?void 0:r.vetAcceptedRealQuantity)==null?void 0:ju.toLocaleString()}),u.jsx("td",{style:l.tableCell,children:(Au=r==null?void 0:r.vetAcceptedRealWeight)==null?void 0:Au.toLocaleString()}),u.jsx("td",{style:l.tableCell,children:(r==null?void 0:r.vetState)==="accepted"?"تخلیه شده":"در انتظار تخلیه"}),u.jsx("td",{style:l.tableCell,children:(r==null?void 0:r.vetState)==="accepted"?`${(yu=r==null?void 0:r.killHouseVet)==null?void 0:yu.fullname} (${(bu=r==null?void 0:r.killHouseVet)==null?void 0:bu.mobile})`:"-"})]},I)})}):u.jsx("td",{style:l.tableCellAlert,colSpan:13,children:"داده ای ثبت نشده!"})]})},o=()=>{var j,L;return u.jsxs("table",{style:l.invoiceTable,children:[u.jsx("thead",{style:l.tableHeader,children:u.jsxs("tr",{style:l.headerRow,children:[u.jsx("th",{style:l.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:l.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:l.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:l.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:l.tableHeaderCell,children:"وزن بار"}),u.jsx("th",{style:l.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:l.tableHeaderCell,children:"کد قرنطینه"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعداد تخلیه شده (دامپزشک)"}),u.jsx("th",{style:l.tableHeaderCell,children:"وزن تخلیه شده (دامپزشک)"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعداد نهایی"}),u.jsx("th",{style:l.tableHeaderCell,children:"وزن خالص واقعی"})]})}),(j=s==null?void 0:s.killHouseRequests)!=null&&j.killHouseRequestAssignmentSerializer?u.jsx("tbody",{children:(L=s==null?void 0:s.killHouseRequests)==null?void 0:L.killHouseRequestAssignmentSerializer.map((r,I)=>{var T,$,z,V,Y,G,O,_,J,X,eu,su,ru,tu,au,nu,ju,Au,yu,bu;return u.jsxs("tr",{style:l.tableRow,children:[u.jsx("td",{style:l.tableCell,children:I+1}),u.jsx("td",{style:l.tableCell,children:r==null?void 0:r.barCode}),u.jsx("td",{style:l.tableCell,children:`${(z=($=(T=r==null?void 0:r.killhouseUser)==null?void 0:T.killHouseOperator)==null?void 0:$.user)==null?void 0:z.fullname} (${(G=(Y=(V=r==null?void 0:r.killhouseUser)==null?void 0:V.killHouseOperator)==null?void 0:Y.user)==null?void 0:G.mobile})`}),u.jsx("td",{style:l.tableCell,children:`${(_=(O=r==null?void 0:r.addCar)==null?void 0:O.driver)==null?void 0:_.typeCar} (${(X=(J=r==null?void 0:r.addCar)==null?void 0:J.driver)==null?void 0:X.pelak})`}),u.jsx("td",{style:l.tableCell,children:`${(su=(eu=r==null?void 0:r.addCar)==null?void 0:eu.driver)==null?void 0:su.driverName} (${(tu=(ru=r==null?void 0:r.addCar)==null?void 0:ru.driver)==null?void 0:tu.driverMobile})`}),u.jsx("td",{style:l.tableCell,children:r==null?void 0:r.quantity.toLocaleString()}),u.jsx("td",{style:l.tableCell,children:(au=r==null?void 0:r.weightInfo)==null?void 0:au.weight}),u.jsx("td",{style:l.tableCell,children:(nu=r==null?void 0:r.weightInfo)==null?void 0:nu.indexWeight}),u.jsx("td",{style:l.tableCell,children:r==null?void 0:r.clearanceCode}),u.jsx("td",{style:l.tableCell,children:(ju=r==null?void 0:r.vetAcceptedRealQuantity)==null?void 0:ju.toLocaleString()}),u.jsx("td",{style:l.tableCell,children:(Au=r==null?void 0:r.vetAcceptedRealWeight)==null?void 0:Au.toLocaleString()}),u.jsx("td",{style:l.tableCell,children:(yu=r==null?void 0:r.acceptedRealQuantity)==null?void 0:yu.toLocaleString()})," ",u.jsx("td",{style:l.tableCell,children:(bu=r==null?void 0:r.acceptedRealWeight)==null?void 0:bu.toLocaleString()})]},I)})}):u.jsx("td",{style:l.tableCellAlert,colSpan:13,children:"داده ای ثبت نشده!"})]})},k=()=>{var j;return u.jsxs("table",{style:l.invoiceTable,children:[u.jsx("thead",{style:l.tableHeader,children:u.jsxs("tr",{style:l.headerRow,children:[u.jsx("th",{style:l.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:l.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:l.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:l.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:l.tableHeaderCell,children:"نژاد"}),u.jsx("th",{style:l.tableHeaderCell,children:"کد قرنطینه"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعداد نهایی"}),u.jsx("th",{style:l.tableHeaderCell,children:"وزن خالص بار"}),u.jsx("th",{style:l.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:l.tableHeaderCell,children:"مبلغ فاکتور"}),u.jsx("th",{style:l.tableHeaderCell,children:"وضعیت"}),u.jsx("th",{style:l.tableHeaderCell,children:"اطلاعات پرداخت (شناسه پرداخت)"})]})}),((j=s==null?void 0:s.provinceState)==null?void 0:j.date)&&u.jsx("tbody",{children:u.jsx("tr",{style:l.tableRow})})]})},d=()=>{var j;return u.jsxs("table",{style:l.invoiceTable,children:[u.jsx("thead",{style:l.tableHeader,children:u.jsxs("tr",{style:l.headerRow,children:[u.jsx("th",{style:l.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:l.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:l.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:l.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:l.tableHeaderCell,children:"نژاد"}),u.jsx("th",{style:l.tableHeaderCell,children:"کد قرنطینه"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعداد نهایی"}),u.jsx("th",{style:l.tableHeaderCell,children:"وزن خالص بار"}),u.jsx("th",{style:l.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:l.tableHeaderCell,children:"مبلغ فاکتور"}),u.jsx("th",{style:l.tableHeaderCell,children:"وضعیت پرداخت"}),u.jsx("th",{style:l.tableHeaderCell,children:"وضعیت"}),u.jsx("th",{style:l.tableHeaderCell,children:"نظر بازرس"})]})}),((j=s==null?void 0:s.provinceState)==null?void 0:j.date)&&u.jsx("tbody",{children:u.jsx("tr",{style:l.tableRow})})]})};return u.jsxs("div",{ref:c,children:[u.jsx("div",{style:l.watermarkContainer,children:u.jsx("p",{style:l.watermarkp,children:"سامانه رصدیار "})}),u.jsxs("div",{style:l.page,children:[u.jsx(b,{}),u.jsx("div",{style:l.pageData,children:u.jsx("div",{className:"timeline",children:u.jsxs("ul",{className:"base-timeline activity-timeline",children:[u.jsxs("li",{className:"main-level-item",children:[u.jsx("div",{className:"timeline-icon bg-primary",children:u.jsx("img",{src:du,alt:"icon",className:"icon-image"})}),u.jsxs("div",{className:"timeline-content",children:[u.jsx("div",{className:"act-time",children:"مشخصات درخواست"}),u.jsx("div",{className:"base-timeline-info",children:u.jsx(H,{})})]})]}),u.jsxs("li",{className:"main-level-item",children:[u.jsx("div",{className:"timeline-icon bg-primary",children:u.jsx("img",{src:((S=s==null?void 0:s.cityState)==null?void 0:S.state)==="accept"?du:pu,alt:"icon",className:"icon-image"})}),u.jsxs("div",{className:"timeline-content",children:[u.jsx("div",{className:"act-time",children:"مرحله شهرستان"}),u.jsx("div",{className:"base-timeline-info",children:u.jsx(i,{})})]})]}),u.jsxs("li",{className:"main-level-item",children:[u.jsx("div",{className:"timeline-icon bg-primary",children:u.jsx("img",{src:((f=s==null?void 0:s.provinceState)==null?void 0:f.state)==="accept"?du:pu,alt:"icon",className:"icon-image"})}),u.jsxs("div",{className:"timeline-content",children:[u.jsx("div",{className:"act-time",children:"مرحله استان"}),u.jsx("div",{className:"base-timeline-info",children:u.jsx(x,{})})]})]}),u.jsxs("li",{className:"main-level-item",children:[u.jsx("div",{className:"timeline-icon bg-primary",children:u.jsx("img",{src:du,alt:"icon",className:"icon-image"})}),u.jsxs("div",{className:"timeline-content",children:[u.jsxs("div",{className:"act-time",children:["تخصیصات استان به کشتارگاه"," ( ",u.jsxs("span",{style:l.levelDetails,children:["تعداد درخواست:"," ",(p=(E=s==null?void 0:s.provinceKillRequests)==null?void 0:E.provinceKillRequestsTotalInfo)==null?void 0:p.poultryRequestQuantity.toLocaleString(),"، تعداد تخصیصی به کشتارگاه:"," ",(q=(F=s==null?void 0:s.provinceKillRequests)==null?void 0:F.provinceKillRequestsTotalInfo)==null?void 0:q.allocatedQuantity.toLocaleString(),"، مانده قابل تخصیصی:"," ",(B=(g=s==null?void 0:s.provinceKillRequests)==null?void 0:g.provinceKillRequestsTotalInfo)==null?void 0:B.poultryRequestRemainQuantity.toLocaleString()]})," ) "]}),u.jsx("div",{className:"base-timeline-info",children:u.jsx(A,{})})]})]}),u.jsxs("li",{className:"main-level-item",children:[u.jsx("div",{className:"timeline-icon bg-primary",children:u.jsx("img",{src:du,alt:"icon",className:"icon-image"})}),u.jsxs("div",{className:"timeline-content",children:[u.jsxs("div",{className:"act-time",children:["ثبت ماشین توسط خریدار (ایجاد بار)"," ( ",u.jsxs("span",{style:l.levelDetails,children:["تعداد تخصیص به خریداران:"," ",(w=(N=s==null?void 0:s.killHouseRequests)==null?void 0:N.allocatedQuantity)==null?void 0:w.toLocaleString(),"، تعداد بارها:"," ",(P=(K=s==null?void 0:s.killHouseRequests)==null?void 0:K.numberOfBars)==null?void 0:P.toLocaleString(),"، تعداد تخصیص به ماشین:"," ",(Q=(W=s==null?void 0:s.killHouseRequests)==null?void 0:W.killHouseRequestQuantity)==null?void 0:Q.toLocaleString(),"، مانده قابل تخصیص:"," ",(Z=(U=s==null?void 0:s.killHouseRequests)==null?void 0:U.remainQuantity)==null?void 0:Z.toLocaleString()]})," ) "]}),u.jsx("div",{className:"base-timeline-info",children:u.jsx(a,{})})]})]}),u.jsxs("li",{className:"main-level-item",children:[u.jsx("div",{className:"timeline-icon bg-primary",children:u.jsx("img",{src:du,alt:"icon",className:"icon-image"})}),u.jsxs("div",{className:"timeline-content",children:[u.jsxs("div",{className:"act-time",children:["تایید تخلیه توسط دامپزشک کشتارگاه"," ( ",u.jsxs("span",{style:l.levelDetails,children:["تعداد بارها:"," ",(uu=(m=s==null?void 0:s.killHouseRequests)==null?void 0:m.numberOfBars)==null?void 0:uu.toLocaleString(),"، تایید تخلیه:"," ",(ou=(lu=s==null?void 0:s.killHouseRequests)==null?void 0:lu.vetAcceptedNumberOfBars)==null?void 0:ou.toLocaleString(),"، تخلیه نشده:"," ",(hu=(Cu=s==null?void 0:s.killHouseRequests)==null?void 0:Cu.vetRemainNumberOfBars)==null?void 0:hu.toLocaleString()]})," ) "]}),u.jsx("div",{className:"base-timeline-info",children:u.jsx(R,{})})]})]}),u.jsxs("li",{className:"main-level-item",children:[u.jsx("div",{className:"timeline-icon bg-primary",children:u.jsx("img",{src:du,alt:"icon",className:"icon-image"})}),u.jsxs("div",{className:"timeline-content",children:[u.jsxs("div",{className:"act-time",children:["ورود اطلاعات بار توسط کشتارگاه"," ( ",u.jsxs("span",{style:l.levelDetails,children:["تعداد بارها:"," ",(xu=(iu=s==null?void 0:s.killHouseRequests)==null?void 0:iu.numberOfBars)==null?void 0:xu.toLocaleString(),"، ورود اطلاعات بار:"," ",(D=(y=s==null?void 0:s.killHouseRequests)==null?void 0:y.killHouseRequestAssignment)==null?void 0:D.toLocaleString(),"، وارد نشده:"," ",(qu=(Lu=s==null?void 0:s.killHouseRequests)==null?void 0:Lu.assignmentRemainNumberOfBars)==null?void 0:qu.toLocaleString()]})," ) "]}),u.jsx("div",{className:"base-timeline-info",children:u.jsx(o,{})})]})]}),u.jsxs("li",{className:"main-level-item",children:[u.jsx("div",{className:"timeline-icon bg-primary",children:u.jsx("img",{src:pu,alt:"icon",className:"icon-image"})}),u.jsxs("div",{className:"timeline-content",children:[u.jsx("div",{className:"act-time",children:"اطلاعات مالی"}),u.jsx("div",{className:"base-timeline-info",children:u.jsx(k,{})})]})]}),u.jsxs("li",{className:"main-level-item",children:[u.jsx("div",{className:"timeline-icon bg-primary",children:u.jsx("img",{src:pu,alt:"icon",className:"icon-image"})}),u.jsxs("div",{className:"timeline-content",children:[u.jsx("div",{className:"act-time",children:"بازرس"}),u.jsx("div",{className:"base-timeline-info",children:u.jsx(d,{})})]})]}),u.jsxs("div",{style:{display:"flex"},children:[u.jsx("div",{className:"timeline-icon bg-primary",children:u.jsx("img",{src:pu,alt:"icon",className:"icon-image"})}),u.jsx("div",{className:"timeline-content",children:u.jsx("div",{className:"act-time",children:"اتمام پرونده"})})]})]})})})]})]})});Eu.displayName="ProvinceGetCaseFile";Eu.propTypes={item:Bu.PropTypes.any};const t={invoiceTable:{width:"100%",borderCollapse:"collapse",alignSelf:"center",fontFamily:"titr",marginBottom:"5px",marginTop:"15px",borderRadius:"10px"},tableCell:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:12,fontWeight:"bolder",color:"#403e3e"},tableHeader:{backgroundColor:"rgba(211, 211, 211, 0.3)",pageBreakAfter:"auto"},headerRow:{background:"linear-gradient(to right, #E684AE, #79CBCA, #77A1D3)",backgroundColor:"rgba(232, 67, 147, 0.4)",color:"#422020",pageBreakInside:"avoid",pageBreakAfter:"auto"},tableHeaderCell:{fontSize:14,border:"1px solid #000",padding:"4px",textAlign:"center",fontWeight:"bolder"},tableCellAlert:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:12,color:"red"},levelDetails:{color:"red",fontSize:12}},e6=({item:e})=>{var c,s,n,b,H,i,x;return u.jsxs(h,{mt:v.SMALL,children:[u.jsx(C,{variant:"body2",children:"مرحله شهرستان"}),u.jsxs("table",{style:t.invoiceTable,children:[u.jsx("thead",{style:t.tableHeader,children:u.jsxs("tr",{style:t.headerRow,children:[u.jsx("th",{style:t.tableHeaderCell,children:"اپراتور"}),u.jsx("th",{style:t.tableHeaderCell,children:"سمت"}),u.jsx("th",{style:t.tableHeaderCell,children:"تلفن"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعاونی مرغدار"}),u.jsx("th",{style:t.tableHeaderCell,children:"آدرس"}),u.jsx("th",{style:t.tableHeaderCell,children:"وضعیت"})]})}),(c=e==null?void 0:e.cityState)!=null&&c.date?u.jsx("tbody",{children:u.jsxs("tr",{style:t.tableRow,children:[u.jsx("td",{style:t.tableCell,children:(s=e==null?void 0:e.cityState)==null?void 0:s.cityOperatorFullname}),u.jsx("td",{style:t.tableCell,children:"اپراتور شهرستان"}),u.jsx("td",{style:t.tableCell,children:(n=e==null?void 0:e.cityState)==null?void 0:n.cityOperatorMobile}),u.jsx("td",{style:t.tableCell,children:(b=e==null?void 0:e.cityState)==null?void 0:b.poultry}),u.jsx("td",{style:t.tableCell,children:((H=e==null?void 0:e.cityState)==null?void 0:H.province)+" - "+((i=e==null?void 0:e.cityState)==null?void 0:i.city)}),u.jsx("td",{style:t.tableCell,children:((x=e==null?void 0:e.cityState)==null?void 0:x.state)==="accept"?"تایید شده":"رد شده"})]})}):u.jsx("td",{style:t.tableCellAlert,colSpan:6,children:"هنوز شهرستان پرونده را تائید نکرده است"})]})]})},s6=({item:e})=>{var c,s,n,b,H,i,x;return u.jsxs(h,{mt:v.SMALL,children:[u.jsx(C,{variant:"body2",children:"مرحله استان"}),u.jsxs("table",{style:t.invoiceTable,children:[u.jsx("thead",{style:t.tableHeader,children:u.jsxs("tr",{style:t.headerRow,children:[u.jsx("th",{style:t.tableHeaderCell,children:"اپراتور"}),u.jsx("th",{style:t.tableHeaderCell,children:"سمت"}),u.jsx("th",{style:t.tableHeaderCell,children:"تلفن"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعاونی مرغدار"}),u.jsx("th",{style:t.tableHeaderCell,children:"آدرس"}),u.jsx("th",{style:t.tableHeaderCell,children:"وضعیت"})]})}),(c=e==null?void 0:e.provinceState)!=null&&c.date?u.jsx("tbody",{children:u.jsxs("tr",{style:t.tableRow,children:[u.jsx("td",{style:t.tableCell,children:(s=e==null?void 0:e.provinceState)==null?void 0:s.provinceOperatorFullname}),u.jsx("td",{style:t.tableCell,children:"اپراتور استان"}),u.jsx("td",{style:t.tableCell,children:(n=e==null?void 0:e.provinceState)==null?void 0:n.provinceOperatorMobile}),u.jsx("td",{style:t.tableCell,children:(b=e==null?void 0:e.provinceState)==null?void 0:b.poultry}),u.jsx("td",{style:t.tableCell,children:((H=e==null?void 0:e.provinceState)==null?void 0:H.province)+" - "+((i=e==null?void 0:e.provinceState)==null?void 0:i.city)}),u.jsx("td",{style:t.tableCell,children:((x=e==null?void 0:e.provinceState)==null?void 0:x.state)==="accept"?"تایید شده":"رد شده"})]})}):u.jsx("td",{style:t.tableCellAlert,colSpan:6,children:"هنوز استان پرونده را تائید نکرده است"})]})]})},r6=({item:e})=>{var c,s,n,b,H,i,x,A;return u.jsxs(h,{mt:v.SMALL,children:[u.jsxs(C,{variant:"body2",children:["مرحله تخصیص به خریدار "," ( ",u.jsxs("span",{style:t.levelDetails,children:["تعداد درخواست:"," ",(s=(c=e==null?void 0:e.provinceKillRequests)==null?void 0:c.provinceKillRequestsTotalInfo)==null?void 0:s.poultryRequestQuantity.toLocaleString(),"، تعداد تخصیصی به کشتارگاه:"," ",(b=(n=e==null?void 0:e.provinceKillRequests)==null?void 0:n.provinceKillRequestsTotalInfo)==null?void 0:b.allocatedQuantity.toLocaleString(),"، مانده قابل تخصیصی:"," ",(i=(H=e==null?void 0:e.provinceKillRequests)==null?void 0:H.provinceKillRequestsTotalInfo)==null?void 0:i.poultryRequestRemainQuantity.toLocaleString()]})," ) "]}),u.jsxs("table",{style:t.invoiceTable,children:[u.jsx("thead",{style:t.tableHeader,children:u.jsxs("tr",{style:t.headerRow,children:[u.jsx("th",{style:t.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:t.tableHeaderCell,children:"ماهیت خریدار"}),u.jsx("th",{style:t.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:t.tableHeaderCell,children:"نوع تخصیص"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعداد تخصیصی"}),u.jsx("th",{style:t.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:t.tableHeaderCell,children:"وزن تخصیصی"}),u.jsx("th",{style:t.tableHeaderCell,children:"وضعیت"})]})}),(x=e==null?void 0:e.provinceKillRequests)!=null&&x.provinceKillRequestSerializer?u.jsx("tbody",{children:(A=e==null?void 0:e.provinceKillRequests)==null?void 0:A.provinceKillRequestSerializer.map((a,R)=>{var o,k,d,S,f,E,p,F,q,g;return u.jsxs("tr",{style:t.tableRow,children:[u.jsx("td",{style:t.tableCell,children:R+1}),u.jsx("td",{style:t.tableCell,children:((o=a==null?void 0:a.killhouseUser)==null?void 0:o.killer)===!1?"کشتارگاه":"کشتارکن"}),u.jsx("td",{style:t.tableCell,children:`${(S=(d=(k=a==null?void 0:a.killhouseUser)==null?void 0:k.killHouseOperator)==null?void 0:d.user)==null?void 0:S.fullname} (${(p=(E=(f=a==null?void 0:a.killhouseUser)==null?void 0:f.killHouseOperator)==null?void 0:E.user)==null?void 0:p.mobile})`}),u.jsx("td",{style:t.tableCell,children:(a==null?void 0:a.automatic)===!1?"دستی":"اتوماتیک"}),u.jsx("td",{style:t.tableCell,children:(F=a==null?void 0:a.weightInfo)==null?void 0:F.provinceKillRequestQuantity}),u.jsx("td",{style:t.tableCell,children:(q=a==null?void 0:a.weightInfo)==null?void 0:q.provinceKillRequestIndexWeight}),u.jsx("td",{style:t.tableCell,children:(g=a==null?void 0:a.weightInfo)==null?void 0:g.provinceKillRequestWeight}),u.jsx("td",{style:t.tableCell,children:(a==null?void 0:a.state)==="accepted"?"تایید شده":(a==null?void 0:a.state)==="rejected"?"رد شده":"در انتظار تایید"})]},R)})}):u.jsx("td",{style:t.tableCellAlert,colSpan:8,children:"داده ای ثبت نشده!"})]})]})},t6=({item:e})=>{var c,s,n,b,H,i,x,A,a,R;return u.jsxs(h,{mt:v.SMALL,children:[u.jsxs(C,{variant:"body2",children:["مرحله ایجاد بار"," ( ",u.jsxs("span",{style:t.levelDetails,children:["تعداد تخصیص به خریداران:"," ",(s=(c=e==null?void 0:e.killHouseRequests)==null?void 0:c.allocatedQuantity)==null?void 0:s.toLocaleString(),"، تعداد بارها: ",(b=(n=e==null?void 0:e.killHouseRequests)==null?void 0:n.numberOfBars)==null?void 0:b.toLocaleString(),"، تعداد تخصیص به ماشین:"," ",(i=(H=e==null?void 0:e.killHouseRequests)==null?void 0:H.killHouseRequestQuantity)==null?void 0:i.toLocaleString(),"، مانده قابل تخصیص:"," ",(A=(x=e==null?void 0:e.killHouseRequests)==null?void 0:x.remainQuantity)==null?void 0:A.toLocaleString()]})," ) "]}),u.jsxs("table",{style:t.invoiceTable,children:[u.jsx("thead",{style:t.tableHeader,children:u.jsxs("tr",{style:t.headerRow,children:[u.jsx("th",{style:t.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:t.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:t.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:t.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:t.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:t.tableHeaderCell,children:"وزن بار"}),u.jsx("th",{style:t.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:t.tableHeaderCell,children:"کد قرنطینه"}),u.jsx("th",{style:t.tableHeaderCell,children:"محل کشتار"})]})}),(a=e==null?void 0:e.killHouseRequests)!=null&&a.killHouseRequestsSerializer?u.jsx("tbody",{children:(R=e==null?void 0:e.killHouseRequests)==null?void 0:R.killHouseRequestsSerializer.map((o,k)=>{var d,S,f,E,p,F,q,g,B,N,w,K,P,W,Q,U;return u.jsxs("tr",{style:t.tableRow,children:[u.jsx("td",{style:t.tableCell,children:k+1}),u.jsx("td",{style:t.tableCell,children:o==null?void 0:o.barCode}),u.jsx("td",{style:t.tableCell,children:`${(f=(S=(d=o==null?void 0:o.killhouseUser)==null?void 0:d.killHouseOperator)==null?void 0:S.user)==null?void 0:f.fullname} (${(F=(p=(E=o==null?void 0:o.killhouseUser)==null?void 0:E.killHouseOperator)==null?void 0:p.user)==null?void 0:F.mobile})`}),u.jsx("td",{style:t.tableCell,children:`${(g=(q=o==null?void 0:o.addCar)==null?void 0:q.driver)==null?void 0:g.typeCar} (${(N=(B=o==null?void 0:o.addCar)==null?void 0:B.driver)==null?void 0:N.pelak})`}),u.jsx("td",{style:t.tableCell,children:`${(K=(w=o==null?void 0:o.addCar)==null?void 0:w.driver)==null?void 0:K.driverName} (${(W=(P=o==null?void 0:o.addCar)==null?void 0:P.driver)==null?void 0:W.driverMobile})`}),u.jsx("td",{style:t.tableCell,children:o==null?void 0:o.quantity.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(Q=o==null?void 0:o.weightInfo)==null?void 0:Q.weight}),u.jsx("td",{style:t.tableCell,children:(U=o==null?void 0:o.weightInfo)==null?void 0:U.indexWeight}),u.jsx("td",{style:t.tableCell,children:o==null?void 0:o.clearanceCode}),u.jsx("td",{style:t.tableCell,children:o==null?void 0:o.killPlace})]},k)})}):u.jsx("td",{style:t.tableCellAlert,colSpan:10,children:"داده ای ثبت نشده!"})]})]})},a6=({item:e})=>{var c,s,n,b,H,i,x,A;return u.jsxs(h,{mt:v.SMALL,children:[u.jsxs(C,{variant:"body2",children:["مرحله تخلیه بار"," ( ",u.jsxs("span",{style:t.levelDetails,children:["تعداد بارها: ",(s=(c=e==null?void 0:e.killHouseRequests)==null?void 0:c.numberOfBars)==null?void 0:s.toLocaleString(),"، تایید تخلیه:"," ",(b=(n=e==null?void 0:e.killHouseRequests)==null?void 0:n.vetAcceptedNumberOfBars)==null?void 0:b.toLocaleString(),"، تخلیه نشده:"," ",(i=(H=e==null?void 0:e.killHouseRequests)==null?void 0:H.vetRemainNumberOfBars)==null?void 0:i.toLocaleString()]})," ) "]}),u.jsxs("table",{style:t.invoiceTable,children:[u.jsx("thead",{style:t.tableHeader,children:u.jsxs("tr",{style:t.headerRow,children:[u.jsx("th",{style:t.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:t.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:t.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:t.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:t.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:t.tableHeaderCell,children:"وزن بار"}),u.jsx("th",{style:t.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:t.tableHeaderCell,children:"کد قرنطینه"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعداد تخلیه شده "}),u.jsx("th",{style:t.tableHeaderCell,children:"وزن تخلیه شده "}),u.jsx("th",{style:t.tableHeaderCell,children:"وضعیت"}),u.jsx("th",{style:t.tableHeaderCell,children:"اطلاعات تخلیه"})]})}),(x=e==null?void 0:e.killHouseRequests)!=null&&x.killHouseRequestVetCheckSerializer.length?u.jsx("tbody",{children:(A=e==null?void 0:e.killHouseRequests)==null?void 0:A.killHouseRequestVetCheckSerializer.map((a,R)=>{var o,k,d,S,f,E,p,F,q,g,B,N,w,K,P,W,Q,U,Z,m;return u.jsxs("tr",{style:t.tableRow,children:[u.jsx("td",{style:t.tableCell,children:R+1}),u.jsx("td",{style:t.tableCell,children:a==null?void 0:a.barCode}),u.jsx("td",{style:t.tableCell,children:`${(d=(k=(o=a==null?void 0:a.killhouseUser)==null?void 0:o.killHouseOperator)==null?void 0:k.user)==null?void 0:d.fullname} (${(E=(f=(S=a==null?void 0:a.killhouseUser)==null?void 0:S.killHouseOperator)==null?void 0:f.user)==null?void 0:E.mobile})`}),u.jsx("td",{style:t.tableCell,children:`${(F=(p=a==null?void 0:a.addCar)==null?void 0:p.driver)==null?void 0:F.typeCar} (${(g=(q=a==null?void 0:a.addCar)==null?void 0:q.driver)==null?void 0:g.pelak})`}),u.jsx("td",{style:t.tableCell,children:`${(N=(B=a==null?void 0:a.addCar)==null?void 0:B.driver)==null?void 0:N.driverName} (${(K=(w=a==null?void 0:a.addCar)==null?void 0:w.driver)==null?void 0:K.driverMobile})`}),u.jsx("td",{style:t.tableCell,children:a==null?void 0:a.quantity.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(P=a==null?void 0:a.weightInfo)==null?void 0:P.weight}),u.jsx("td",{style:t.tableCell,children:(W=a==null?void 0:a.weightInfo)==null?void 0:W.indexWeight}),u.jsx("td",{style:t.tableCell,children:a==null?void 0:a.clearanceCode}),u.jsx("td",{style:t.tableCell,children:(Q=a==null?void 0:a.vetAcceptedRealQuantity)==null?void 0:Q.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(U=a==null?void 0:a.vetAcceptedRealWeight)==null?void 0:U.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(a==null?void 0:a.vetState)==="accepted"?"تخلیه شده":"در انتظار تخلیه"}),u.jsx("td",{style:t.tableCell,children:(a==null?void 0:a.vetState)==="accepted"?`${(Z=a==null?void 0:a.killHouseVet)==null?void 0:Z.fullname} (${(m=a==null?void 0:a.killHouseVet)==null?void 0:m.mobile})`:"-"})]},R)})}):u.jsx("td",{style:t.tableCellAlert,colSpan:13,children:"تخلیه بار تایید نشده است."})]})]})},n6=({item:e})=>{var c,s;return u.jsxs(h,{mt:v.SMALL,children:[u.jsx(C,{variant:"body2",children:"اطلاعات بار"}),u.jsxs("table",{style:t.invoiceTable,children:[u.jsx("thead",{style:t.tableHeader,children:u.jsxs("tr",{style:t.headerRow,children:[u.jsx("th",{style:t.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:t.tableHeaderCell,children:"کد بار"}),u.jsx("th",{style:t.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:t.tableHeaderCell,children:"ماشین"}),u.jsx("th",{style:t.tableHeaderCell,children:"راننده"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:t.tableHeaderCell,children:"وزن بار"}),u.jsx("th",{style:t.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:t.tableHeaderCell,children:"کد قرنطینه"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعداد تخلیه شده (دامپزشک)"}),u.jsx("th",{style:t.tableHeaderCell,children:"وزن تخلیه شده (دامپزشک)"}),u.jsx("th",{style:t.tableHeaderCell,children:"تعداد نهایی"}),u.jsx("th",{style:t.tableHeaderCell,children:"وزن خالص واقعی"})]})}),(c=e==null?void 0:e.killHouseRequests)!=null&&c.killHouseRequestAssignmentSerializer?u.jsx("tbody",{children:(s=e==null?void 0:e.killHouseRequests)==null?void 0:s.killHouseRequestAssignmentSerializer.map((n,b)=>{var H,i,x,A,a,R,o,k,d,S,f,E,p,F,q,g,B,N,w,K;return u.jsxs("tr",{style:t.tableRow,children:[u.jsx("td",{style:t.tableCell,children:b+1}),u.jsx("td",{style:t.tableCell,children:n==null?void 0:n.barCode}),u.jsx("td",{style:t.tableCell,children:`${(x=(i=(H=n==null?void 0:n.killhouseUser)==null?void 0:H.killHouseOperator)==null?void 0:i.user)==null?void 0:x.fullname} (${(R=(a=(A=n==null?void 0:n.killhouseUser)==null?void 0:A.killHouseOperator)==null?void 0:a.user)==null?void 0:R.mobile})`}),u.jsx("td",{style:t.tableCell,children:`${(k=(o=n==null?void 0:n.addCar)==null?void 0:o.driver)==null?void 0:k.typeCar} (${(S=(d=n==null?void 0:n.addCar)==null?void 0:d.driver)==null?void 0:S.pelak})`}),u.jsx("td",{style:t.tableCell,children:`${(E=(f=n==null?void 0:n.addCar)==null?void 0:f.driver)==null?void 0:E.driverName} (${(F=(p=n==null?void 0:n.addCar)==null?void 0:p.driver)==null?void 0:F.driverMobile})`}),u.jsx("td",{style:t.tableCell,children:n==null?void 0:n.quantity.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(q=n==null?void 0:n.weightInfo)==null?void 0:q.weight}),u.jsx("td",{style:t.tableCell,children:(g=n==null?void 0:n.weightInfo)==null?void 0:g.indexWeight}),u.jsx("td",{style:t.tableCell,children:n==null?void 0:n.clearanceCode}),u.jsx("td",{style:t.tableCell,children:(B=n==null?void 0:n.vetAcceptedRealQuantity)==null?void 0:B.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(N=n==null?void 0:n.vetAcceptedRealWeight)==null?void 0:N.toLocaleString()}),u.jsx("td",{style:t.tableCell,children:(w=n==null?void 0:n.acceptedRealQuantity)==null?void 0:w.toLocaleString()})," ",u.jsx("td",{style:t.tableCell,children:(K=n==null?void 0:n.acceptedRealWeight)==null?void 0:K.toLocaleString()})]},b)})}):u.jsx("td",{style:t.tableCellAlert,colSpan:13,children:"داده ای ثبت نشده!"})]})]})},d6=({caseData:e,caseIndex:c,pageIndex:s,data:n})=>{var q;const[b,H]=M.useState(!1),[i,x]=M.useState(null),[A,a]=M.useState("black"),[,,R]=M.useContext(ku),[o,k]=M.useState("تایید شهرستان");M.useEffect(()=>{var B,N,w,K,P,W,Q,U,Z,m,uu,lu;let g="تایید شهرستان";((B=e==null?void 0:e.cityState)==null?void 0:B.state)==="reject"||((N=e==null?void 0:e.provinceState)==null?void 0:N.state)==="reject"?(g="درخواست رد شد",a("red")):((w=e==null?void 0:e.cityState)!=null&&w.date&&(g="تایید شهرستان"),(K=e==null?void 0:e.provinceState)!=null&&K.date&&(g="تایید استان"),((W=(P=e==null?void 0:e.provinceKillRequests)==null?void 0:P.provinceKillRequestSerializer)==null?void 0:W.length)>0&&(g="تخصیص به خریدار"),((U=(Q=e==null?void 0:e.killHouseRequests)==null?void 0:Q.killHouseRequestsSerializer)==null?void 0:U.length)>0&&(g="ایجاد بار"),((m=(Z=e==null?void 0:e.killHouseRequests)==null?void 0:Z.killHouseRequestVetCheckSerializer)==null?void 0:m.length)>0&&(g="تخلیه بار"),((lu=(uu=e==null?void 0:e.killHouseRequests)==null?void 0:uu.killHouseRequestAssignmentSerializer)==null?void 0:lu.length)>0&&(g="اطلاعات بار")),k(g)},[e]);const d=M.useRef(),S=Vu.useReactToPrint({content:()=>d.current,documentTitle:"گزارش پرونده "}),f=()=>{e&&S()},E=()=>{H(!b)},p=g=>{x(g)};let F;switch(i){case 1:F=u.jsx(e6,{item:e});break;case 2:F=u.jsx(s6,{item:e});break;case 3:F=u.jsx(r6,{item:e});break;case 4:F=u.jsx(t6,{item:e});break;case 5:F=u.jsx(a6,{item:e});break;case 6:F=u.jsx(n6,{item:e});break;case 7:F=u.jsx(u6,{});break}return u.jsx(Mu,{children:u.jsxs(h,{container:!0,direction:"row",mb:2,children:[u.jsxs("div",{style:{width:"3%",background:e.out?"rgb(255 123 123)":"rgb(172 235 230)",display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"column"},children:[u.jsxs(C,{color:e!=null&&e.out?"white":"grey",children:[s+c,"."]}),u.jsx("div",{style:{background:e.out?"rgb(255 123 123)":"rgb(172 235 230)",writingMode:"vertical-rl",display:"flex",alignItems:"center",justifyContent:"center",width:"100%"},children:u.jsx(C,{style:{background:"#2196f3",borderRadius:"10px",padding:"2px",color:"white",fontSize:"10px"},children:e.out?"خارج استان":"داخل استان"})}),u.jsx("div",{style:{height:"10px"}})]}),u.jsxs("div",{style:{width:"97%"},children:[u.jsxs(h,{style:{backgroundColor:c%2===0?"white":"rgb(247, 249, 250)",padding:"10px",cursor:"pointer",width:"100%"},children:[u.jsx("div",{style:{visibility:"hidden",position:"absolute"},children:u.jsx(Eu,{ref:d,item:e,inDate:R,reportType:"slaughter"})}),u.jsxs(h,{container:!0,onClick:E,justifyContent:"space-between",alignItems:"center",height:"100px",children:[u.jsx(h,{xs:2,children:u.jsxs(C,{variant:"body2",children:["شماره سفارش: ",e==null?void 0:e.orderCode]})}),u.jsx(h,{xs:2,children:u.jsxs(C,{variant:"body2",color:A,children:["نوع کشتار: ",e!=null&&e.freezing?"انجماد":"عادی"]})}),u.jsx(h,{xs:2,children:u.jsxs(C,{variant:"body2",children:["تاریخ کشتار: ",cu(e==null?void 0:e.sendDate)]})}),u.jsx(h,{xs:2,children:u.jsxs(C,{variant:"body2",children:["مرغدار: ",(q=e==null?void 0:e.poultry)==null?void 0:q.unitName]})}),u.jsx(h,{xs:2,children:u.jsxs(C,{variant:"body2",color:A,children:["وضعیت: ",o]})}),u.jsx(h,{xs:1,children:u.jsx(Ru,{title:"خروجی PDF",children:u.jsx(Ku,{"aria-label":"delete",color:"success",onClick:f,children:u.jsx(l6,{size:25})})})})]})]}),u.jsx(Pu,{in:b,children:u.jsxs(h,{style:{padding:"20px"},children:[u.jsx(Zu,{item:e}),u.jsx(mu,{stepClickedHandler:p,item:e}),F]})})]})]})})},A6=()=>{var N,w,K,P,W,Q,U,Z,m,uu,lu,ou,Cu,hu,iu,xu;const[,,e,c,s,n]=M.useContext(ku),[b,H]=M.useState(""),[i,x]=M.useState([]),[A,a]=M.useState(0),[R,o]=M.useState(10),k=Xu(),{casesOverview:d}=zu(y=>y.provinceSlice),S=async y=>{E(1),k(Gu());const D=await gu.get(`poultry_requests_for_total_information/?date1=${e}&date2=${s}&search=filter&value=${b||""}&page=${y}&page_size=${R}&role=${Hu()}`);x(D.data.results),a(D.data.count),k(Ou())},[f,E]=M.useState(1),p=(y,D)=>{E(D+1,S(D+1))},F=zu(y=>y.userSlice.userProfile.key),[q]=M.useContext(ku);M.useEffect(()=>{o(10),S(1),k(Yu({date1:e,date2:s}))},[e,s]),M.useEffect(()=>{const y=Su(new Date).format("YYYY-MM-DD");c(y),n(y)},[]);const g=y=>{H(y.target.value)},B=async y=>{y.preventDefault(),S(1)};return u.jsxs(h,{container:!0,p:v.TINY,xs:12,children:[u.jsxs(h,{container:!0,alignItems:"center",gap:v.SMALL,children:[u.jsx(C,{children:"روند پرونده ها"}),u.jsx(h,{style:{width:"150px"},children:u.jsx($u,{label:"از تاریخ",id:"date",renderInput:y=>u.jsx(vu,{...y}),value:e,onChange:y=>{c(Su(y).format("YYYY-MM-DD"))}})}),u.jsx(h,{style:{width:"150px"},children:u.jsx($u,{label:"تا تاریخ",id:"date",renderInput:y=>u.jsx(vu,{...y}),value:s,onChange:y=>{n(Su(y).format("YYYY-MM-DD"))}})}),u.jsx(vu,{autoComplete:"off",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:g,value:b}),u.jsx(Fu,{type:"submit",onClick:B,endIcon:u.jsx(_u,{}),children:"جستجو"}),u.jsx(Ru,{title:"خروجی اکسل",children:u.jsx(Fu,{color:"success",onClick:()=>{q({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const y=`${gu.defaults.baseURL}poultry_request_report_excel/?start=${e}&end=${s}&role=${Hu()}&key=${F}`;window.location.href=y},children:u.jsx(fu,{size:32})})}),u.jsx(Ru,{title:"خروجی اکسل گزارش جامع",children:u.jsx(Fu,{color:"warning",onClick:()=>{q({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const y=`${gu.defaults.baseURL}detail_of_killing_excel/?date1=${e}&date2=${s}&role=${Hu()}&key=${F}`;window.location.href=y},children:u.jsx(fu,{size:32})})})]}),u.jsxs(h,{width:"100%",mt:v.SMALL,isDashboard:!0,children:[u.jsx(h,{container:!0,mb:2,children:u.jsx(Du,{title:"خلاصه اطلاعات",noPagination:!0,isDashboard:!0,columns:["تعداد پرونده ها","تعداد مرغداران","درخواست های کشتار (حجم)","درخواست های کشتار (وزن)","تعداد پرونده خارج از استان","خارج استان (تعداد)","خارج استان (وزن)","تعداد تخصیصات","تعداد بار","تعداد خریداران","تعداد بار دارای کد قرنطینه","تعداد بار بدون کد قرنطینه","تعداد بار تخلیه شده توسط دامپزشک","تعداد بار تخلیه نشده توسط دامپزشک","تعداد بار تکمیل شده توسط کشتارگاه","تعداد بار تکمیل نشده توسط کشتارگاه","جزئیات کامل"],data:[[(N=d==null?void 0:d.poultryRequests)==null?void 0:N.toLocaleString(),(w=d==null?void 0:d.poultry)==null?void 0:w.toLocaleString(),(K=d==null?void 0:d.poultryRequestsQuantity)==null?void 0:K.toLocaleString(),(P=d==null?void 0:d.poultryRequestsWeight)==null?void 0:P.toLocaleString(),(W=d==null?void 0:d.outPoultryRequest)==null?void 0:W.toLocaleString(),(Q=parseInt(d==null?void 0:d.outPoultryRequestQuantity))==null?void 0:Q.toLocaleString(),(U=parseInt(d==null?void 0:d.outPoultryRequestWeight))==null?void 0:U.toLocaleString(),(Z=d==null?void 0:d.provinceKillRequests)==null?void 0:Z.toLocaleString(),(m=d==null?void 0:d.killHouseRequests)==null?void 0:m.toLocaleString(),(uu=d==null?void 0:d.provinceKillRequestsBuyers)==null?void 0:uu.toLocaleString(),(lu=d==null?void 0:d.killHouseRequestsWithQuarantineCode)==null?void 0:lu.toLocaleString(),(ou=d==null?void 0:d.killHouseRequestsWithoutQuarantineCode)==null?void 0:ou.toLocaleString(),(Cu=d==null?void 0:d.killHouseRequestsWithKillHouseVetAccepted)==null?void 0:Cu.toLocaleString(),(hu=d==null?void 0:d.killHouseRequestsWithoutKillHouseVetAccepted)==null?void 0:hu.toLocaleString(),(iu=d==null?void 0:d.killHouseRequestsWithKillHouseAssignment)==null?void 0:iu.toLocaleString(),(xu=d==null?void 0:d.killHouseRequestsWithoutKillHouseAssignment)==null?void 0:xu.toLocaleString(),u.jsx(Fu,{color:"warning",onClick:()=>{q({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const y=`${gu.defaults.baseURL}detail_of_killing_excel/?date1=${e}&date2=${s}&role=${Hu()}&key=${F}`;window.location.href=y},children:u.jsx(fu,{size:30})},"ss")]]})}),u.jsxs(h,{alignItems:"center",justifyContent:"center",children:[i.map((y,D)=>u.jsx(d6,{caseData:y,caseIndex:D,pageIndex:f!==1?f*R-9:1,data:i},D)),!!(i!=null&&i.length)&&u.jsx(h,{container:!0,justifyContent:"center",mt:v.SMALL,children:u.jsx(Wu,{count:Math.ceil(A/R),page:f,variant:"outlined",onChange:(y,D)=>{p(y,D-1)}})})]})]})]})};export{l6 as B,A6 as P}; diff --git a/build/assets/ProvinceCases-D2p07oto.css b/build/assets/ProvinceCases-D2p07oto.css new file mode 100644 index 0000000..9504797 --- /dev/null +++ b/build/assets/ProvinceCases-D2p07oto.css @@ -0,0 +1 @@ +.timeline{width:100%;margin:0}.base-timeline{position:relative}.timeline .base-timeline{margin:0;padding-left:20px;padding-right:20px}.base-timeline li{list-style-type:none;margin:0;padding:0;position:relative;display:flex;align-items:flex-start}.text-primary{text-decoration:none}.timeline-icon{margin-top:5px;color:#fff;width:15px;height:15px;border-radius:50%;text-align:center;line-height:13px;align-items:center;justify-content:center}.icon-image{width:9px;align-self:center}.timeline-content{margin-right:10px;position:relative}.act-time{font-size:14px;color:#453939}.base-timeline-info{margin-top:2px}.base-timeline-info a{font-size:14px;font-weight:700;color:#333}.text-muted{font-size:12px;color:#999}.base-timeline li+li:before,.base-timeline li:before{content:"";position:absolute;top:10px;right:6.5px;width:2px;height:100%;background-color:#ddd;z-index:-1}.fa-caret-down{color:#fff!important}.bg-primary{background-color:orange} diff --git a/build/assets/ProvinceColdHousesPage-61BwlOTB.js b/build/assets/ProvinceColdHousesPage-61BwlOTB.js new file mode 100644 index 0000000..9ede73b --- /dev/null +++ b/build/assets/ProvinceColdHousesPage-61BwlOTB.js @@ -0,0 +1 @@ +import{j as u,d as X,I as q,ak as R,B as H,a3 as D,al as Z,T as tu,ai as m,aX as uu,b2 as du,b3 as ou,b0 as iu,b as Cu}from"./mui-vendor-CkIVaoQP.js";import{f as nu,u as ru,r as l,j as lu}from"./react-vendor-CmFgShSM.js";import{G as j,S as G,h1 as B,h2 as K,h3 as J,h4 as hu,X as E,A as cu,j as w,L as k,h as S,c as pu,c2 as eu,M as W,u as gu,N as M,c5 as xu,h5 as fu,h6 as ju,h7 as Fu}from"./index-CeyyVc1v.js";import{B as yu}from"./BackButton-Crzr7NMa.js";import{N as Au}from"./NavLink-D2GD_ItM.js";import{L as vu}from"./LinkItem-DT6qswcs.js";import{R as Q}from"./ResponsiveTable-w7hk7Uq8.js";import{u as N,a as Y}from"./redux-vendor-B7uoacJt.js";import{R as au,a as Su}from"./index.esm-Bu7XMDZU.js";import{d as Eu}from"./Visibility-DeyjG-oI.js";import{s as _u,a as bu}from"./slaughter-get-provinces-CSWL-EuK.js";import{d as wu}from"./Edit-CqBj1Y2L.js";import{d as ku}from"./Tune-D4M2CAhp.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./iconBase-BEJYyZsk.js";const Lu=()=>{const{pathname:t}=nu();return u.jsx(j,{container:!0,gap:G.SMALL,p:G.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",style:{placeContent:"baseline"},children:u.jsx(j,{container:!0,direction:"column",style:{width:"100%"},children:u.jsx(j,{container:!0,gap:G.SMALL,justifyContent:"center",children:u.jsx(Au,{to:E()==="ProvinceOperator"?B:E()==="AdminX"?K:J,active:t===B?"true":null,children:u.jsx(vu,{icon:u.jsx(hu,{size:30,color:"#244CCC"}),title:"سردخانه ها",description:"سردخانه ها"})})})})})},Iu=()=>{const t=N(),d=ru(),a=c=>{A(c.target.value)},[r]=l.useContext(cu),[p,C]=l.useState([]),[y,g]=l.useState(0),[x,f]=l.useState(10),[_,A]=l.useState(""),[v,F]=l.useState(1),[o,s]=l.useState([]),i=async c=>{let e;t(k()),e=await w.get(`kill-house-cold-house/?search=filter&value=${_}&role=${E()}&page=${c}&page_size=${x}`),t(S()),C(e.data.results),g(e.data.count)},b=c=>{i(c),F(c)},$=c=>{f(c),F(1)};l.useEffect(()=>{const c=p==null?void 0:p.map((e,h)=>{var n,L,I,P,O,V,z,U;return[v===1?h+1:h+x*(v-1)+1,e==null?void 0:e.name,e==null?void 0:e.fullname,e==null?void 0:e.mobile,e==null?void 0:e.city,(L=(n=e==null?void 0:e.coldHousesInfo)==null?void 0:n.totalColdHouses)==null?void 0:L.toLocaleString(),(P=(I=e==null?void 0:e.coldHousesInfo)==null?void 0:I.totalInputWeight)==null?void 0:P.toLocaleString(),(V=(O=e==null?void 0:e.coldHousesInfo)==null?void 0:O.totalAllocatedWeight)==null?void 0:V.toLocaleString(),(U=(z=e==null?void 0:e.coldHousesInfo)==null?void 0:z.totalRemainWeight)==null?void 0:U.toLocaleString(),u.jsx(X,{placement:"left",title:"نمایش",children:u.jsx(q,{size:"small",color:"success",onClick:()=>{d((E()==="ProvinceOperator"?B:E()==="AdminX"?K:J)+"/"+(e==null?void 0:e.key)+"/"+(e==null?void 0:e.fullname)+"/killhouse")},children:u.jsx(Eu,{})})},h)]});s(c)},[p]),l.useEffect(()=>{i(1)},[t,x]);const T=async c=>{c.preventDefault(),t(k());try{const e=await w.get(`kill-house-cold-house/?role=${E()}&search=filter&value=${_}&page=1&page_size=${x}`);C(e.data.results),g(e.data.count),t(S())}catch(e){console.error("Error fetching data:",e)}};return u.jsxs(j,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(j,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(j,{children:u.jsxs("form",{onSubmit:T,children:[u.jsx(R,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:a}),u.jsx(H,{type:"submit",onClick:T,endIcon:u.jsx(au,{}),children:"جستجو"})]})}),u.jsx(X,{title:"خروجی اکسل",children:u.jsx(H,{color:"success",onClick:()=>{r({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const c=`${w.defaults.baseURL}management_cold_house_excel`;window.location.href=c},children:u.jsx(Su,{size:32})})})]}),u.jsx(Q,{data:o,columns:["ردیف","نام کشتارگاه","نام مالک","موبایل","شهر","تعداد سردخانه ها","وزن وارد شده","وزن خارج شده","وزن باقیمانده","سردخانه ها"],handlePageChange:b,totalRows:y,page:v,perPage:x,handlePerRowsChange:$,title:"سردخانه های کشتارگاه ها"})]})},Pu=Y("GET_PROVINCE_COLD_HOUSES_DASHBOARD",async(t,{dispatch:d})=>{d(k());const{data:a,status:r}=await w.get("cold-house-total-dashboard");return d(S()),{data:a,status:r}}),Ou=Y("PROVINCE_GET_ALL_STEWARDS_SERVICE",async(t,{dispatch:d})=>{try{d(k());const{data:a,status:r}=await w.get("stewards-for-cold-house/",{});return d(S()),{data:a,status:r}}catch(a){return d(S()),{error:a.response.data.result}}}),Ru=Y("PROVINCE_CREATE_COLD_HOUSE_SERVICE",async(t,{dispatch:d})=>{try{d(k());const{data:a,status:r}=await w.post("cold-house/",t);return d(S()),{data:a,status:r}}catch(a){return d(S()),{error:a.response.data.result}}}),$u=Y("PROVINCE_EDIT_COLD_HOUSE_SERVICE",async(t,{dispatch:d})=>{try{d(k());const{data:a,status:r}=await w.put("cold-house/0/",t);return d(S()),{data:a,status:r}}catch(a){return d(S()),{error:a.response.data.result}}}),su=({isEdit:t,updateTable:d,item:a,stewardKey:r,killhouseKey:p})=>{const C=N(),[y,g]=l.useState([]),x=pu({name:W().required("این فیلد اجباریست!"),address:W().required("این فیلد اجباریست!"),steward_key:W(),province:W().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),city:W().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),active:eu(),broadcast:eu(),relocate:eu()}),[f,_]=l.useState([]),[A,v]=l.useState([]),[F]=l.useContext(cu);l.useEffect(()=>{!t&&!r&&C(Ou()).then(s=>{g(s.payload.data)})},[]);const o=gu({initialValues:{name:t?a==null?void 0:a.name:"",address:t?a==null?void 0:a.address:"",steward_key:"",province:t?a==null?void 0:a.province:"",city:t?a==null?void 0:a.city:"",active:t?a==null?void 0:a.active:!1,broadcast:t?a==null?void 0:a.broadcast:!1,relocate:t?a==null?void 0:a.relocate:!1},validationSchema:x,onSubmit:s=>{if(t)C($u({cold_house_key:a==null?void 0:a.key,name:s.name,province:s.province,city:s.city,address:s.address,active:s.active,broadcast:s.broadcast,relocate:s.relocate})).then(i=>{i.payload.error?F({vertical:"top",horizontal:"center",msg:i.payload.error,severity:"error"}):(C(M({right:!1,bottom:!1,content:null})),d(),F({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))});else{let i={steward_key:p?null:r||s.steward_key,kill_house_key:p,name:s.name,province:s.province,city:s.city,address:s.address,active:s.active,broadcast:s.broadcast,relocate:s.relocate};i=Object.fromEntries(Object.entries(i).filter(([b,$])=>$!==null)),C(Ru(i)).then(b=>{b.payload.error?F({vertical:"top",horizontal:"center",msg:b.payload.error,severity:"error"}):(C(M({right:!1,bottom:!1,content:null})),d(),F({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}});return l.useEffect(()=>{o.validateForm()},[]),l.useEffect(()=>{C(_u()).then(s=>{_(s.payload.data)})},[]),l.useEffect(()=>{o.values.province&&v([],C(bu(o.values.province)).then(s=>{v(s.payload.data)}))},[o.values.province]),u.jsxs(D,{xs:12,container:!0,justifyContent:"center",alignItems:"center",gap:2,children:[!t&&!r&&u.jsx(D,{item:!0,xs:12,children:u.jsx(Z,{style:{width:"100%"},options:y?y.map(s=>({id:s.key,label:`${s.fullname} / ${s.mobile} `,item:s})):[],value:o.values.guild,onChange:(s,i)=>{o.setFieldValue("steward_key",i==null?void 0:i.id),o.validateForm()},error:o.touched.guild&&!!o.errors.guild,helperText:o.touched.guild&&o.errors.guild,getOptionLabel:s=>s.label,renderInput:s=>u.jsx(R,{...s,label:"انتخاب مباشر",variant:"outlined"})})}),u.jsx(D,{item:!0,xs:12,children:u.jsx(R,{fullWidth:!0,id:"name",name:"name",label:"نام سردخانه",value:o.values.name,onChange:o.handleChange,onBlur:o.handleBlur,error:o.touched.name&&!!o.errors.name,helperText:o.touched.name&&o.errors.name})}),u.jsx(Z,{style:{width:"100%"},disablePortal:!0,id:"province",options:f?f.map(s=>({id:s.name,label:s.name})):[],onChange:(s,i)=>{o.setFieldValue("province",i?i.id:""),o.setFieldValue("city","")},renderInput:s=>u.jsx(R,{...s,label:"استان را انتخاب کنید"})}),t&&u.jsxs(tu,{variant:"caption",color:"error",children:["استان: ",o.values.province]}),u.jsx(Z,{minWidth:210,style:{width:"100%"},disabled:!o.values.province,disablePortal:!0,id:"city",options:A?A.map(s=>({id:s.name,label:s.name})):[],onChange:(s,i)=>{o.setFieldValue("city",i?i.id:"")},renderInput:s=>u.jsx(R,{...s,label:"شهر را انتخاب کنید"})}),t&&u.jsxs(tu,{variant:"caption",color:"error",children:["شهر: ",o.values.city]}),u.jsx(D,{item:!0,xs:12,children:u.jsx(R,{fullWidth:!0,id:"address",name:"address",label:"آدرس",value:o.values.address,onChange:o.handleChange,onBlur:o.handleBlur,error:o.touched.address&&!!o.errors.address,helperText:o.touched.address&&o.errors.address})}),u.jsxs(D,{item:!0,xs:12,container:!0,direction:"column",children:[u.jsx(m,{control:u.jsx(uu,{checked:o.values.active,onChange:o.handleChange,name:"active"}),label:"فعال"}),u.jsx(m,{control:u.jsx(uu,{checked:o.values.broadcast,onChange:o.handleChange,name:"broadcast"}),label:"اجازه پخش"}),u.jsx(m,{control:u.jsx(uu,{checked:o.values.relocate,onChange:o.handleChange,name:"relocate"}),label:"اجازه جابجایی"})]}),u.jsx(D,{item:!0,xs:12,children:u.jsx(H,{disabled:t||r?!o.isValid:!o.isValid&&!o.values.steward_key,fullWidth:!0,type:"submit",variant:"contained",color:"primary",onClick:o.handleSubmit,children:"ثبت"})})]})},Tu=()=>{const t=N(),d=ru(),a=c=>{_(c.target.value)},[r,p]=l.useState([]),[C,y]=l.useState(0),[g,x]=l.useState(10),[f,_]=l.useState(""),[A,v]=l.useState(1),[F,o]=l.useState([]),s=async c=>{let e;t(k()),e=await w.get(`stewards-for-cold-house/?search=filter&value=${f}&role=${E()}&page=${c}&page_size=${g}&total=true`),t(S()),p(e.data.results),y(e.data.count)},i=c=>{s(c),v(c)},b=c=>{x(c),v(1)},$=()=>{s(A!==0?A:1)};l.useEffect(()=>{const c=r==null?void 0:r.map((e,h)=>{var n,L,I,P,O,V,z,U;return[A===1?h+1:h+g*(A-1)+1,e==null?void 0:e.fullname,e==null?void 0:e.mobile,e==null?void 0:e.city,(L=(n=e==null?void 0:e.coldHousesInfo)==null?void 0:n.totalColdHouses)==null?void 0:L.toLocaleString(),(P=(I=e==null?void 0:e.coldHousesInfo)==null?void 0:I.totalInputWeight)==null?void 0:P.toLocaleString(),(V=(O=e==null?void 0:e.coldHousesInfo)==null?void 0:O.totalAllocatedWeight)==null?void 0:V.toLocaleString(),(U=(z=e==null?void 0:e.coldHousesInfo)==null?void 0:z.totalRemainWeight)==null?void 0:U.toLocaleString(),u.jsx(X,{placement:"left",title:"نمایش",children:u.jsx(q,{color:"primary",size:"small",onClick:()=>{d((E()==="ProvinceOperator"?B:E()==="AdminX"?K:J)+"/"+(e==null?void 0:e.key)+"/"+(e==null?void 0:e.fullname)+"/steward")},children:u.jsx(xu,{})})},h)]});o(c)},[r]),l.useEffect(()=>{s(1)},[t,g]);const T=async c=>{c.preventDefault(),t(k());try{const e=await w.get(`stewards-for-cold-house/?role=${E()}&search=filter&value=${f}&page=1&page_size=${g}&total=true`);p(e.data.results),y(e.data.count),t(S())}catch(e){console.error("Error fetching data:",e)}};return u.jsxs(j,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(j,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(H,{variant:"contained",onClick:()=>{t(M({right:!0,title:"ایجاد سردخانه",content:u.jsx(su,{updateTable:$})}))},children:"ایجاد سردخانه"}),u.jsx(j,{children:u.jsxs("form",{onSubmit:T,children:[u.jsx(R,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:a}),u.jsx(H,{type:"submit",onClick:T,endIcon:u.jsx(au,{}),children:"جستجو"})]})})]}),u.jsx(Q,{data:F,columns:["ردیف","نام مالک","موبایل","شهر","تعداد سردخانه ها","وزن وارد شده","وزن خارج شده","وزن باقیمانده","سردخانه ها"],handlePageChange:i,totalRows:C,page:A,perPage:g,handlePerRowsChange:b,title:"مباشرین"})]})},Hu=()=>{var y,g,x,f,_,A;const[t,d]=l.useState(0),a=(v,F)=>{d(F)},[r,p]=l.useState([]),C=N();return l.useEffect(()=>{C(Pu()).then(v=>{p(v.payload.data)})},[C]),u.jsxs(j,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(Q,{isDashboard:!0,noPagination:!0,columns:["تعداد کل سردخانه ها","تعداد کل سردخانه های کشتارگاه ها","تعداد کل سردخانه های مباشرین","کل وزن وارد شده","کل وزن خارج شده","کل وزن باقیمانده"],data:[[(y=r==null?void 0:r.totalColdHouses)==null?void 0:y.toLocaleString(),(g=r==null?void 0:r.totalKillHouseColdHouse)==null?void 0:g.toLocaleString(),(x=r==null?void 0:r.totalStewardColdHouse)==null?void 0:x.toLocaleString(),(f=r==null?void 0:r.totalInputWeight)==null?void 0:f.toLocaleString(),(_=r==null?void 0:r.totalAllocatedWeight)==null?void 0:_.toLocaleString(),(A=r==null?void 0:r.totalRemainWeight)==null?void 0:A.toLocaleString()]],title:"خلاصه اطلاعات"}),u.jsx(j,{xs:12,container:!0,alignItems:"center",justifyContent:"center",mt:2,children:u.jsxs(du,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:t,onChange:a,children:[u.jsx(ou,{label:"سردخانه های کشتارگاه ها",value:0}),u.jsx(ou,{label:"سردخانه های مباشرین",value:1})]})}),t===0&&u.jsx(Iu,{}),t===1&&u.jsx(Tu,{})]})},Du=({item:t,updateTable:d})=>{const[a,r]=l.useState(null),p=N(),C=f=>{r(f.currentTarget)},y=()=>{r(null)},g=!!a,x=g?"popover":void 0;return u.jsxs("div",{children:[u.jsx(q,{"aria-describedby":x,variant:"contained",color:"primary",onClick:C,children:u.jsx(ku,{})}),u.jsx(iu,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:x,open:g,anchorEl:a,onClose:y,children:u.jsx("div",{style:{padding:"20px"},children:u.jsx(j,{container:!0,direction:"column",children:u.jsx(X,{placement:"left",title:"ویرایش سردخانه",children:u.jsx(q,{color:"primary",onClick:()=>{y(),p(M({title:"ویرایش سردخانه",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(su,{isEdit:!0,item:t,updateTable:d})}))},children:u.jsx(wu,{})})})})})})]})},Nu=()=>{const t=N(),d=h=>{v(h.target.value)},{key:a,name:r,type:p}=lu(),[C,y]=l.useState([]),[g,x]=l.useState(0),[f,_]=l.useState(10),[A,v]=l.useState(""),[F,o]=l.useState(1),[s,i]=l.useState([]),b=async h=>{let n;t(k()),n=await w.get(`cold-house-for-province/?search=filter&value=${A}&role=${E()}&page=${h}&page_size=${f}${p==="steward"?`&type=Steward&steward_key=${a}`:""}${p==="killhouse"?`&type=KillHouse&kill_house_key=${a}`:""}`),t(S()),y(n.data.results),x(n.data.count)},$=h=>{b(h),o(h)},T=h=>{_(h),o(1)},c=()=>{b(F!==0?F:1)};l.useEffect(()=>{const h=C==null?void 0:C.map((n,L)=>{var I,P,O;return[F===1?L+1:L+f*(F-1)+1,n==null?void 0:n.name,n==null?void 0:n.city,n==null?void 0:n.address,(I=n==null?void 0:n.totalInputWeight)==null?void 0:I.toLocaleString(),(P=n==null?void 0:n.totalAllocatedWeight)==null?void 0:P.toLocaleString(),(O=n==null?void 0:n.totalRemainWeight)==null?void 0:O.toLocaleString(),n!=null&&n.active?"فعال":"غیر فعال",n!=null&&n.broadcast?"دارد":"ندارد",n!=null&&n.relocate?"دارد":"ندارد",n==null?void 0:n.capacity,u.jsx(Du,{item:n,updateTable:c},L)]});i(h)},[C]),l.useEffect(()=>{b(1)},[t,f]);const e=async h=>{h.preventDefault(),t(k());try{const n=await w.get(`cold-house-for-province/?role=${E()}&search=filter&value=${A}&page=1&page_size=${f}${p==="steward"?`&type=Steward&steward_key=${a}`:""}${p==="killhouse"?`&type=KillHouse&kill_house_key=${a}`:""}`);y(n.data.results),x(n.data.count),t(S())}catch(n){console.error("Error fetching data:",n)}};return u.jsxs(j,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(j,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(H,{variant:"contained",onClick:()=>{t(M({right:!0,title:"افزودن سردخانه",content:u.jsx(su,{updateTable:c,stewardKey:a,killhouseKey:a})}))},children:"افزودن سردخانه"}),u.jsx(j,{children:u.jsxs("form",{onSubmit:e,children:[u.jsx(R,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:d}),u.jsx(H,{type:"submit",onClick:e,endIcon:u.jsx(au,{}),children:"جستجو"})]})})]}),u.jsx(Q,{data:s,columns:["ردیف","نام سردخانه","شهر","آدرس","وزن کل","وزن خارج شده","وزن باقیمانده","وضعیت","اجازه پخش","اجازه جابجایی","ظرفیت","عملیات"],handlePageChange:$,totalRows:g,page:F,perPage:f,handlePerRowsChange:T,title:`مشاهده سردخانه های ${r}`})]})},e6=()=>{const{pathname:t}=nu(),{key:d}=lu();return u.jsx(u.Fragment,{children:u.jsx(Cu,{display:"flex",justifyContent:"center",children:u.jsxs(j,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[t===fu||t===ju||t===Fu?u.jsxs(j,{justifyContent:"center",my:G.MEDIUM,children:[u.jsx(j,{children:u.jsx(tu,{variant:"h6",children:"داشبورد مدیریت سردخانه ها "})}),u.jsx(Lu,{})]}):u.jsx(yu,{}),(t===B||t===K||t===J)&&u.jsx(Hu,{}),d&&u.jsx(Nu,{})]})})})};export{e6 as default}; diff --git a/build/assets/ProvinceDispensersStock-BetLU9Ax.js b/build/assets/ProvinceDispensersStock-BetLU9Ax.js new file mode 100644 index 0000000..e55d0f7 --- /dev/null +++ b/build/assets/ProvinceDispensersStock-BetLU9Ax.js @@ -0,0 +1 @@ +import{j as i,b as A}from"./mui-vendor-CkIVaoQP.js";import{f as d}from"./react-vendor-CmFgShSM.js";import{G as e,S as n,i1 as o,i2 as u,i3 as a,X as t,i4 as E,i5 as c,i6 as m,i7 as _,i8 as R,i9 as l}from"./index-CeyyVc1v.js";import{N as s}from"./NavLink-D2GD_ItM.js";import{L as S}from"./LinkItem-DT6qswcs.js";import{B as p}from"./BackButton-Crzr7NMa.js";import{k as I}from"./index.esm-CjWvmHks.js";import{n as C}from"./index.esm-BY9chGNa.js";import{G as O}from"./index.esm-BVxcT1y_.js";import"./redux-vendor-B7uoacJt.js";import"./iconBase-BEJYyZsk.js";const X=()=>{const{pathname:r}=d();return i.jsx(A,{display:"flex",justifyContent:"center",children:i.jsxs(e,{container:!0,justifyContent:"center",gap:n.SMALL,p:n.SMALL,direction:"column",xs:12,sm:12,md:10,lg:10,children:[i.jsx(e,{container:!0,children:i.jsx(p,{})}),i.jsx(e,{container:!0,gap:n.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",alignItems:"center",style:{placeContent:"baseline"},xs:12,children:i.jsxs(e,{container:!0,gap:n.SMALL,justifyContent:"center",xs:12,children:[i.jsx(s,{to:t()==="AdminX"?o:t()==="SuperAdmin"?u:a,active:r===(t()==="AdminX"?o:t()==="SuperAdmin"?u:a)?"true":null,children:i.jsx(S,{icon:i.jsx(C,{size:30,color:"#244CCC"}),title:"کشتارگاه",description:"کشتارگاه"})}),i.jsx(s,{to:t()==="AdminX"?E:t()==="SuperAdmin"?c:m,active:r===(t()==="AdminX"?E:t()==="SuperAdmin"?c:m)?"true":null,children:i.jsx(S,{icon:i.jsx(I,{size:30,color:"#244CCC"}),title:"مباشر",description:"مباشر"})}),i.jsx(s,{to:t()==="AdminX"?_:t()==="SuperAdmin"?R:l,active:r===(t()==="AdminX"?_:t()==="SuperAdmin"?R:l)?"true":null,children:i.jsx(S,{icon:i.jsx(O,{size:30,color:"#244CCC"}),title:"صنف",description:"صنف"})})]})})]})})};export{X as default}; diff --git a/build/assets/ProvinceDispensersStockSlug-DxEHlpI2.js b/build/assets/ProvinceDispensersStockSlug-DxEHlpI2.js new file mode 100644 index 0000000..6f4d2d0 --- /dev/null +++ b/build/assets/ProvinceDispensersStockSlug-DxEHlpI2.js @@ -0,0 +1 @@ +import{j as u,b as J,B as X,T as L,ai as fe,b5 as xe,ak as oe,I as pe,b2 as Fe,b3 as he}from"./mui-vendor-CkIVaoQP.js";import{L as re,j as Q,h as V,A as le,p as ae,N as Ae,G as l,S as H,X as De,v as ne,W as Ce,_ as _e,O as Ee,C as ge}from"./index-CeyyVc1v.js";import{B as Pe}from"./BackButton-Crzr7NMa.js";import{r,f as ce}from"./react-vendor-CmFgShSM.js";import{a as m,u as ie}from"./redux-vendor-B7uoacJt.js";import{R as se}from"./ResponsiveTable-w7hk7Uq8.js";import{I as Ie,f as Te}from"./toBase64-BzgTOHsW.js";import{r as Re}from"./resizeImage-Csf2MO3w.js";import{d as ze}from"./Delete-C5MyLelE.js";import{d as ke}from"./Search-Dek2fED1.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./PublishedWithChanges-C8kvr_m4.js";const Le=m("PROVINCE_WAREHOUSE_ARCHIVE",async e=>{const{data:a,status:c}=await Q.post("ware-house-archive/",e);return{data:a,status:c}}),We=m("PROVINCE_GET_WAREHOUSE_ARCHIVE",async(e,{dispatch:a})=>{var c,x;try{a(re());const n={date1:e==null?void 0:e.date1,date2:e==null?void 0:e.date2,search:(e==null?void 0:e.search)??"filter",value:(e==null?void 0:e.value)??"",page:(e==null?void 0:e.page)??1,page_size:(e==null?void 0:e.page_size)??10};e!=null&&e.archive_type&&(n.archive_type=e.archive_type),e!=null&&e.owner_type&&(n.owner_type=e.owner_type);const{data:s,status:b}=await Q.get("ware-house-archive/",{params:n});return a(V()),{data:s,status:b}}catch(n){return a(V()),{error:((x=(c=n.response)==null?void 0:c.data)==null?void 0:x.result)||"خطا در دریافت اطلاعات"}}}),Ne=m("PROVINCE_DELETE_WAREHOUSE_ARCHIVE",async({key:e},{dispatch:a})=>{var c,x;try{a(re());const n="ware-house-archive/0/",{data:s,status:b}=await Q.delete(`${n}?key=${e}`);return a(V()),{data:s,status:b}}catch(n){return a(V()),{error:((x=(c=n.response)==null?void 0:c.data)==null?void 0:x.result)||"خطا در حذف بایگانی"}}}),Be=m("PROVINCE_GET_TOTAL_KILLHOUSE_REMAIN_WEIGHT",async(e,{dispatch:a})=>{var c,x;try{a(re());const n=typeof window<"u"?window.location.pathname:"",s=(n==null?void 0:n.split("/").filter(Boolean).pop())==="steward",b=s?"total-steward-remain-weight/":"total-kill-house-remain-weight/",S={search:(e==null?void 0:e.search)??"filter",value:(e==null?void 0:e.value)??"",page:(e==null?void 0:e.page)??1,page_size:(e==null?void 0:e.page_size)??(s?40:10),quota:(e==null?void 0:e.quota)??!1};e!=null&&e.date1&&(S.date1=e.date1),e!=null&&e.date2&&(S.date2=e.date2),s?S.owner_type=(e==null?void 0:e.owner_type)??"steward":S.role=(e==null?void 0:e.role)??"SuperAdmin";const{data:F,status:_}=await Q.get(b,{params:S});return a(V()),{data:F,status:_}}catch(n){return a(V()),{error:((x=(c=n.response)==null?void 0:c.data)==null?void 0:x.result)||"خطا در دریافت اطلاعات"}}}),Me=m("PROVINCE_GET_TOTAL_KILLHOUSE_ARCHIVE_DASHBOARD",async(e,{dispatch:a})=>{var c,x;try{a(re());const n=(e==null?void 0:e.owner_type)==="steward",s=n?"total-guild-steward-archive-dashboard/":"total-kill-house-archive-dashboard/",b={search:(e==null?void 0:e.search)??"filter",value:(e==null?void 0:e.value)??"",date1:e==null?void 0:e.date1,date2:e==null?void 0:e.date2,page:(e==null?void 0:e.page)??1,page_size:(e==null?void 0:e.page_size)??10};n?b.owner_type=e.owner_type??"steward":b.role=(e==null?void 0:e.role)??"SuperAdmin";const{data:S,status:F}=await Q.get(s,{params:b});return a(V()),{data:S,status:F}}catch(n){return a(V()),{error:((x=(c=n.response)==null?void 0:c.data)==null?void 0:x.result)||"خطا در دریافت اطلاعات"}}}),Oe=({killhouseName:e,killhouseKey:a,dayData:c,governmentalData:x,freeData:n,selectedType:s,onSuccess:b})=>{const S=ie(),F=ce(),[_]=r.useContext(le),[R,d]=r.useState(""),[U,$]=r.useState([]),[E,P]=r.useState(""),D=s==="free"?n:x,Y=()=>{const j=F.pathname.split("/").filter(Boolean);return j.includes("steward")?"steward":j.includes("killhouse")?"kill_house":j[j.length-1]||"kill_house"},z=j=>{var k;if($(j),j[0]){const A=(k=j[0])==null?void 0:k.file;Re(A,p=>{const i=Te(p);P(i)})}else P("")},Z=()=>{const j=Y(),A={role:De(),owner_key:a,archive_type:j,date:c,weight:D.amount,quota:s,image:E||"",description:R||""};S(Le(A)).then(p=>{var i;(i=p.payload)!=null&&i.error?_({vertical:"top",horizontal:"center",msg:p.payload.error,severity:"error"}):(_({vertical:"top",horizontal:"center",msg:"بایگانی با موفقیت ثبت شد",severity:"success"}),S(Ae({top:!1,left:!1,bottom:!1,right:!1,title:null,content:null,size:null})),d(""),P(""),$([]),b&&b())})};return u.jsxs(l,{container:!0,gap:2,children:[u.jsxs(l,{item:!0,xs:12,children:[u.jsx(L,{variant:"h6",color:"primary",gutterBottom:!0,children:e}),u.jsxs(L,{variant:"body2",color:"text.secondary",children:["تاریخ: ",ae(c)]})]}),u.jsx(l,{item:!0,xs:12,children:u.jsxs(J,{sx:{padding:2,backgroundColor:s==="free"?"#e8f5e9":"#e3f2fd",borderRadius:2,mt:1,border:`2px solid ${s==="free"?"#2e7d32":"#1565c0"}`,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[u.jsxs(L,{variant:"subtitle2",gutterBottom:!0,fontWeight:"bold",sx:{color:s==="free"?"#2e7d32":"#1565c0"},children:["موجودی ",s==="free"?"آزاد":"دولتی",":"]}),u.jsxs(L,{variant:"h6",fontWeight:"600",children:[D.amount.toLocaleString()," کیلوگرم"]})]})}),u.jsx(l,{item:!0,xs:12,children:u.jsx(Ie,{onChange:z,images:U,maxNumber:1,title:"بارگذاری سند"})}),u.jsx(l,{item:!0,xs:12,children:u.jsx(oe,{fullWidth:!0,multiline:!0,rows:5,label:"توضیحات",variant:"outlined",value:R,onChange:j=>{d(j.target.value)},placeholder:"توضیحات خود را وارد کنید..."})}),u.jsx(l,{item:!0,xs:12,children:u.jsx(X,{variant:"contained",color:"primary",fullWidth:!0,onClick:Z,disabled:!R.trim(),children:"ثبت بایگانی"})})]})},Ve=()=>{const e=ie(),[a]=r.useContext(le),x=ce().pathname.split("/").filter(Boolean),s=(x[x.length-1]||"")==="steward",b=s?"مباشر":"کشتارگاه",[S,F]=r.useState([]),[_,R]=r.useState([]),[d,U]=r.useState("governmental"),$=s?40:10,[E,P]=r.useState(1),[D,Y]=r.useState($),[z,Z]=r.useState(0),j=()=>{U(A=>A==="free"?"governmental":"free")},k=r.useCallback(()=>{const A={search:"filter",value:"",page:E,page_size:D,quota:d==="free"?"free":"governmental",...s?{owner_type:"steward"}:{}};e(Be(A)).then(p=>{var i,W;if((i=p.payload)!=null&&i.error)a({vertical:"top",horizontal:"center",msg:p.payload.error,severity:"error"});else if((W=p.payload)!=null&&W.data){const h=p.payload.data.results||[],M=p.payload.data.count||0;if(Z(M),h.length===0&&M>0&&E>1){P(C=>Math.max(C-1,1));return}const w=h.filter(C=>C.info!==null).map(C=>{var q,y;return{id:C.key,key:C.key,name:s&&C.guildsName||C.name,governmental:((q=C.info)==null?void 0:q.governmental)||[],free:((y=C.info)==null?void 0:y.free)||[]}});R(w)}})},[e,a,s,E,D,d]);return r.useEffect(()=>{P(1),Y(s?40:10)},[s]),r.useEffect(()=>{k()},[k]),r.useEffect(()=>{const A=_.map(i=>{const W=d==="free"?i.free:i.governmental,h=Array.isArray(W)?W.filter(w=>w==null?void 0:w.amount):[];if(!h.length)return null;const M=h.reduce((w,C)=>w+((C==null?void 0:C.amount)||0),0);return{killhouse:i,nonZeroDays:h,totalWeight:M}}).filter(Boolean);if(!A.length&&z>0&&E>1){P(i=>Math.max(i-1,1));return}const p=A.map((i,W)=>{const{killhouse:h,nonZeroDays:M,totalWeight:w}=i,C=[...new Set(M.map(y=>y.day))].sort(),q=u.jsx(J,{sx:{display:"flex",gap:1,flexWrap:"wrap",alignItems:"center",width:"100%",justifyContent:"flex-start"},children:C.map((y,ee)=>{const o=h.governmental.find(N=>N.day===y),g=h.free.find(N=>N.day===y),I=d==="free"?(g==null?void 0:g.amount)||0:(o==null?void 0:o.amount)||0;return I?u.jsxs(X,{variant:"outlined",size:"small",onClick:()=>{e(Ae({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,size:360,title:`جزئیات موجودی - ${ae(y)}`,content:u.jsx(Oe,{killhouseName:h.name,killhouseKey:h.key,dayData:y,governmentalData:o||{day:y,amount:0},freeData:g||{day:y,amount:0},selectedType:d,onSuccess:k})}))},sx:{minWidth:90,minHeight:42,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"2px 8px",backgroundColor:"#e3f2fd",borderColor:"primary.main","&:hover":{backgroundColor:"#bbdefb"}},children:[u.jsx(L,{variant:"caption",sx:{fontSize:{xs:"11px",md:"14px"},color:"text.secondary",marginBottom:"0px"},children:ae(y)}),u.jsxs(L,{variant:"caption",sx:{fontSize:{xs:"11px",md:"13px"},color:d==="free"?"#2e7d32":"#1565c0",fontWeight:600},children:[d==="free"?"آزاد":"دولتی",":"," ",I.toLocaleString()]})]},`day-${ee}-${y}`):null}).filter(Boolean)},`days-${h.id}`);return[(E-1)*D+W+1,h.name||"نامشخص",w.toLocaleString(),q]});F(p)},[d,_,k,e,E,D,z]),u.jsxs(l,{container:!0,spacing:2,px:2,mt:H.SMALL,children:[u.jsx(l,{item:!0,xs:12,children:u.jsx(J,{sx:{display:"flex",alignItems:"flex-start",flexDirection:"column",justifyContent:"space-between",mb:2},children:u.jsx(l,{children:u.jsx(fe,{control:u.jsx(xe,{checked:d==="free",onChange:j,color:"primary"}),label:u.jsxs(J,{sx:{display:"flex",alignItems:"center",gap:1},children:[u.jsx(L,{variant:"body2",sx:{color:d==="governmental"?"#1565c0":"#666",fontWeight:d==="governmental"?600:400},children:"دولتی"}),u.jsx(L,{variant:"body2",color:"text.secondary",children:"/"}),u.jsx(L,{variant:"body2",sx:{color:d==="free"?"#2e7d32":"#666",fontWeight:d==="free"?600:400},children:"آزاد"})]}),labelPlacement:"start"})})})}),u.jsx(l,{item:!0,xs:12,children:u.jsx(se,{title:"مانده فعال "+(d==="free"?"آزاد":"دولتی"),columns:["ردیف",b,`کل مانده ${d==="free"?"آزاد":"دولتی"} (کیلوگرم)`,"روزها"],data:S,totalRows:z,page:E,perPage:D,handlePageChange:A=>P(A),handlePerRowsChange:A=>{Y(A),P(1)}})})]})},G=e=>{let a=Number(e).toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,"),c=a.split(".");return c.length>1&&(a=c[0]),a},Ye=()=>{const e=ie(),[a]=r.useContext(le),n=ce().pathname.split("/").filter(Boolean).includes("steward"),s=n?"نام مباشر":"نام کشتارگاه",[b,S]=r.useState([]),[F,_]=r.useState(1),[R,d]=r.useState(10),[U,$]=r.useState(0),[E,P]=r.useState([]),[D,Y]=r.useState(1),[z,Z]=r.useState(10),[j,k]=r.useState(0),[A,p]=r.useState(""),[i,W]=r.useState(!1),[h,M]=r.useState(ne(new Date).format("YYYY-MM-DD")),[w,C]=r.useState(ne(new Date).format("YYYY-MM-DD")),q=o=>{e(Ee({title:"تأیید حذف",size:"auto",content:u.jsxs(l,{container:!0,spacing:2,children:[u.jsx(l,{item:!0,xs:12,container:!0,justifyContent:"center",alignItems:"center",children:u.jsx(L,{variant:"body1",children:"آیا از حذف این بایگانی اطمینان دارید؟"})}),u.jsx(l,{item:!0,xs:6,mt:4,children:u.jsx(X,{fullWidth:!0,variant:"contained",color:"error",onClick:()=>{e(ge()),e(Ne({key:o,ownerType:n?"steward":"kill_house"})).then(g=>{var I;(I=g.payload)!=null&&I.error?a({vertical:"top",horizontal:"center",msg:g.payload.error,severity:"error"}):(a({vertical:"top",horizontal:"center",msg:"حذف با موفقیت انجام شد",severity:"success"}),ee())})},children:"بله"})}),u.jsx(l,{item:!0,xs:6,mt:4,children:u.jsx(X,{fullWidth:!0,variant:"outlined",onClick:()=>e(ge()),children:"خیر"})})]})}))},y=()=>{const o={search:"filter",value:A,page:D,page_size:z,...n?{owner_type:"steward"}:{role:"SuperAdmin"}};i&&(o.date1=h,o.date2=w),e(Me(o)).then(g=>{var I,N;if((I=g.payload)!=null&&I.error)a({vertical:"top",horizontal:"center",msg:g.payload.error,severity:"error"});else if((N=g.payload)!=null&&N.data){const ue=g.payload.data.results||[];k(g.payload.data.count||0);const te=ue.map((v,t)=>{const B=(v==null?void 0:v.info)||{},f=(...O)=>{for(const K of O)if((B==null?void 0:B[K])!==void 0&&(B==null?void 0:B[K])!==null)return B[K];return 0},T=n?(v==null?void 0:v.guilds_name)||(v==null?void 0:v.guildsName)||(v==null?void 0:v.name)||"نامشخص":(v==null?void 0:v.name)||"نامشخص";return[(D-1)*z+t+1,T,G(f("total_count","totalCount"))||0,G(f("total_governmental_count","totalGovernmentalCount"))||0,G(f("total_free_count","totalFreeCount"))||0,G(f("total_weight","totalWeight"))||0,G(f("total_governmental_weight","totalGovernmentalWeight"))||0,G(f("total_free_weight","totalFreeWeight"))||0]});P(te)}})},ee=()=>{const o={search:"filter",value:"",page:F,page_size:R,...n?{archive_type:"steward",owner_type:"steward"}:{}};i&&(o.date1=h,o.date2=w),e(We(o)).then(g=>{var I,N;if((I=g.payload)!=null&&I.error)a({vertical:"top",horizontal:"center",msg:g.payload.error,severity:"error"});else if((N=g.payload)!=null&&N.data){const ue=g.payload.data.results||[],te=g.payload.data.count||0;if($(te),ue.length===0&&te>0&&F>1){_(t=>Math.max(t-1,1));return}const v=ue.map((t,B)=>{const f=(t==null?void 0:t.killHouse)||{},T=(t==null?void 0:t.steward)||{},O=(t==null?void 0:t.guild)||{},K=t==null?void 0:t.createDate,ye=(t==null?void 0:t.registererMobile)||"-",ve=(t==null?void 0:t.registerer)||"-",be=(t==null?void 0:t.quota)==="free"?"آزاد":"دولتی",je=(t==null?void 0:t.description)||"-",de=t==null?void 0:t.key,we=n?(t==null?void 0:t.guildsName)||(T==null?void 0:T.guildsName)||(T==null?void 0:T.fullname)||(O==null?void 0:O.name)||(t==null?void 0:t.ownerName)||(f==null?void 0:f.name)||"نامشخص":(f==null?void 0:f.name)||(t==null?void 0:t.ownerName)||"نامشخص",Se=n?(t==null?void 0:t.guildsCity)||(T==null?void 0:T.city)||(O==null?void 0:O.city)||(t==null?void 0:t.ownerCity)||(f==null?void 0:f.city)||"-":(f==null?void 0:f.city)||(t==null?void 0:t.ownerCity)||"-";return[(F-1)*R+B+1,K?_e(K):"-",t!=null&&t.date?ae(t.date):"-",we,Se,G((t==null?void 0:t.weight)||0)||0,be,ve,ye,je,u.jsx(pe,{color:"error",onClick:()=>q(de),size:"small",children:u.jsx(ze,{})},`delete-${de}`)]});S(v)}})};return r.useEffect(()=>{_(1)},[h,w,i]),r.useEffect(()=>{ee()},[h,w,i,F,R]),r.useEffect(()=>{y()},[h,w,i,D,z]),u.jsxs(l,{container:!0,direction:"column",alignItems:"center",spacing:2,px:2,mt:H.SMALL,children:[u.jsx(l,{children:u.jsxs(l,{container:!0,alignItems:"center",gap:H.SMALL,pt:1,children:[u.jsx(fe,{control:u.jsx(xe,{checked:i,onChange:o=>W(o.target.checked),color:"primary"})}),u.jsx(l,{children:u.jsx(Ce,{label:"از تاریخ",id:"date1",renderInput:o=>u.jsx(oe,{style:{width:"160px"},...o}),value:h,onChange:o=>{M(ne(o).format("YYYY-MM-DD"))}})}),u.jsx(l,{children:u.jsx(Ce,{label:"تا تاریخ",id:"date2",renderInput:o=>u.jsx(oe,{style:{width:"160px"},...o}),value:w,onChange:o=>{C(ne(o).format("YYYY-MM-DD"))}})}),u.jsxs(l,{container:!0,alignItems:"center",gap:H.TINY,children:[u.jsx(oe,{label:`جستجو در ${n?"مباشرها":"کشتارگاه‌ها"}`,variant:"outlined",size:"small",sx:{width:"240px"},value:A,onChange:o=>p(o.target.value),onKeyPress:o=>{o.key==="Enter"&&y()}}),u.jsx(X,{variant:"contained",color:"primary",size:"small",startIcon:u.jsx(ke,{}),onClick:y,children:"جستجو"})]})]})}),u.jsx(l,{item:!0,xs:12,children:u.jsx(se,{columns:["ردیف",s,"تعداد کل","تعداد دولتی","تعداد آزاد","وزن کل (کیلوگرم)","وزن دولتی (کیلوگرم)","وزن آزاد (کیلوگرم)"],title:"داشبورد جمع مانده "+(n?"مباشرها":"کشتارگاه‌ها"),data:E,paginated:!0,totalRows:j,page:D,perPage:z,handlePageChange:o=>Y(o),handlePerRowsChange:o=>{Z(o),Y(1)}})}),u.jsx(l,{item:!0,xs:12,children:u.jsx(se,{columns:["ردیف","تاریخ بایگانی","تاریخ انبار",s,n?"شهر مباشر":"شهر","وزن (کیلوگرم)","نوع سهمیه","ثبت کننده","شماره تماس","توضیحات","عملیات"],title:"مانده بایگانی شده",data:b,totalRows:U,page:F,perPage:R,handlePageChange:o=>_(o),handlePerRowsChange:o=>{d(o),_(1)}})})]})},tu=()=>{const[e,a]=r.useState("active"),c=(x,n)=>{a(n)};return u.jsx(J,{display:"flex",justifyContent:"center",children:u.jsxs(l,{container:!0,justifyContent:"center",gap:H.SMALL,p:H.SMALL,direction:"column",xs:12,sm:12,md:10,lg:10,children:[u.jsx(l,{container:!0,children:u.jsx(Pe,{})}),u.jsxs(l,{container:!0,justifyContent:"center",direction:"column",alignItems:"center",children:[u.jsxs(Fe,{value:e,onChange:c,"aria-label":"dispensers stock slug tabs",scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,children:[u.jsx(he,{label:"فعال",value:"active"}),u.jsx(he,{label:"بایگانی",value:"archive"})]}),u.jsxs(l,{container:!0,justifyContent:"center",px:2,py:3,children:[e==="active"&&u.jsx(Ve,{}),e==="archive"&&u.jsx(Ye,{})]})]})]})})};export{tu as default}; diff --git a/build/assets/ProvinceFees-UfT7wk-6.js b/build/assets/ProvinceFees-UfT7wk-6.js new file mode 100644 index 0000000..e7ae1ae --- /dev/null +++ b/build/assets/ProvinceFees-UfT7wk-6.js @@ -0,0 +1,14 @@ +import{j as u,p as ve,i as Ge,I as T6,aX as w6,ak as N,B as X,b0 as Je,an as Ze,ao as he,b4 as xe,ap as pe,T as Wu,d as I6,aL as Oe,aM as Be,aN as me,ai as N6,b2 as De,b3 as X6,bo as Re,bp as q6,bl as ua,bm as Se,b as ea}from"./mui-vendor-CkIVaoQP.js";import{B as aa}from"./BackButton-Crzr7NMa.js";import{l as la,p as ge,q as Fe,v as H,e8 as Ye,r as ta,A as ju,t as Pe,X as d,G as f,O as ie,W as G,S as Iu,L as v6,j as K,h as U6,e9 as oa,ea as na,eb as We,ec as ze,ed as Ke,y as Z6,aj as O6,au as B6,ee as sa,Q as ra,N as ca}from"./index-CeyyVc1v.js";import{u as m6,f as Ru,a as Ue}from"./redux-vendor-B7uoacJt.js";import{R as E6}from"./ResponsiveTable-w7hk7Uq8.js";import{d as ye}from"./ToggleOffOutlined-Ch26Umk7.js";import{d as Ee}from"./ToggleOn-pBgb8alR.js";import{r as c,u as G6,j as Ca}from"./react-vendor-CmFgShSM.js";import{d as He}from"./Edit-CqBj1Y2L.js";import{P as da,a as ga,p as Aa,b as ia,c as fa}from"./ProvinceWagePaymentTransactions-OloKgjY0.js";import{d as ha}from"./Article-DcCZ1D5y.js";import{a as xa}from"./index-CIfb_iLp.js";import{d as pa}from"./Tune-D4M2CAhp.js";import{R as b6,a as V6}from"./index.esm-Bu7XMDZU.js";import{d as Sa}from"./ArrowDownward-DdOsPC7b.js";import{g as Ae}from"./getSystemBaseAddress-B3dWKz82.js";import{S as Ne}from"./SimpleTable-DBAoNnCU.js";import{d as ja}from"./SystemUpdateAlt-Bu3pObDi.js";import{d as Ce}from"./Visibility-DeyjG-oI.js";import{P as J6}from"./PageTable-C16Ol94B.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./num2persian-BIYy8amq.js";import"./SlaughterPayFeesGateway-BhtyiEES.js";import"./ShowImage-CqhU2hmk.js";import"./Download-DQ-VVIaV.js";import"./Close-_jAEIgMD.js";import"./resizeImage-Csf2MO3w.js";import"./toBase64-BzgTOHsW.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./Delete-C5MyLelE.js";import"./Search-Dek2fED1.js";import"./iconBase-BEJYyZsk.js";const Y={page:{width:"214mm",height:"302mm",display:"flex",margin:"0 auto",justifyContent:"center",alignItems:"center",position:"relative",direction:"rtl",fontFamily:"titr",fontWeight:"bold"},pageData:{display:"flex",flexDirection:"column",padding:"20px",border:"2px solid #666",borderRadius:"10px",width:"50%",position:"relative",backgroundColor:"#fff",boxShadow:"0px 0px 20px rgba(0, 0, 0, 0.1)"},title:{textAlign:"center",marginBottom:"10px",fontSize:"24px",fontWeight:"bold",color:"#333"},logo:{width:"100px",height:"auto",margin:"0 auto",display:"block"},hr:{border:"none",borderTop:"1px solid #ccc",margin:"5px 0"},row:{display:"flex",flexDirection:"row",marginBottom:"10px",justifyContent:"space-between"},label:{flex:"0 0 40%",textAlign:"right",marginRight:"10px",fontWeight:"bold",color:"#555"},value:{textAlign:"right",color:"#333",fontFamily:"titr"}},we=c.forwardRef(({item:t,isPayment:y},x)=>{var p,T,g,_,E;return u.jsx("div",{ref:x,children:u.jsx("div",{style:Y.page,children:t&&u.jsxs("div",{style:Y.pageData,children:[u.jsx("img",{src:la,alt:"Logo",style:Y.logo}),u.jsx("h1",{style:Y.title,children:"رسید پرداخت"}),u.jsx("hr",{style:Y.hr}),u.jsxs("div",{style:Y.row,children:[u.jsx("div",{style:Y.label,children:"تاریخ و زمان:"}),u.jsx("div",{style:Y.value,children:`${ge(t.date)} ساعت ${Fe(t.date)}`})]}),u.jsx("hr",{style:Y.hr}),u.jsxs("div",{style:Y.row,children:[u.jsx("div",{style:Y.label,children:"پرداخت کننده:"}),u.jsx("div",{style:Y.value,children:y?(p=t==null?void 0:t.payerInfo)==null?void 0:p.fullname:t.payer})]}),!y&&u.jsxs(u.Fragment,{children:[u.jsx("hr",{style:Y.hr}),u.jsxs("div",{style:Y.row,children:[u.jsx("div",{style:Y.label,children:"تعداد سفارشات:"}),u.jsx("div",{style:Y.value,children:(T=t.information)==null?void 0:T.totalRequestNumber})]}),u.jsx("hr",{style:Y.hr}),u.jsxs("div",{style:Y.row,children:[u.jsx("div",{style:Y.label,children:"تعداد کل (قطعه):"}),u.jsx("div",{style:Y.value,children:(g=t.information)==null?void 0:g.totalQuantity})]}),u.jsx("hr",{style:Y.hr}),u.jsxs("div",{style:Y.row,children:[u.jsx("div",{style:Y.label,children:"وزن کل (کیلوگرم):"}),u.jsx("div",{style:Y.value,children:(_=t.information)==null?void 0:_.totalWeight})]})]}),u.jsx("hr",{style:Y.hr}),u.jsxs("div",{style:Y.row,children:[u.jsx("div",{style:Y.label,children:"شماره درخواست:"}),u.jsx("div",{style:Y.value,children:t.orderId})]}),u.jsx("hr",{style:Y.hr}),u.jsxs("div",{style:Y.row,children:[u.jsx("div",{style:Y.label,children:"شماره پیگیری:"}),u.jsx("div",{style:Y.value,children:t.refId})]}),u.jsx("hr",{style:Y.hr}),u.jsxs("div",{style:Y.row,children:[u.jsx("div",{style:Y.label,children:"کدسفارش:"}),u.jsx("div",{style:Y.value,children:t.orderId})]}),u.jsx("hr",{style:Y.hr}),u.jsxs("div",{style:Y.row,children:[u.jsx("div",{style:Y.label,children:"شماره کارت:"}),u.jsx("div",{style:Y.value,children:t.cardHolderPan})]}),u.jsx("hr",{style:Y.hr}),u.jsxs("div",{style:Y.row,children:[u.jsx("div",{style:Y.label,children:"مبلغ:"}),u.jsxs("div",{style:Y.value,children:[(E=t.amount)==null?void 0:E.toLocaleString()," ریال"]})]})]})})})});we.displayName="SuccessTransactionRecipt";we.propTypes={item:ve.PropTypes.object};const Fa="/assets/signature-D8sU-GQE.png",j={documentTitle:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:"12px"},row:{display:"flex",justifyContent:"space-between",alignItems:"start",gap:"5px",direction:"rtl"},column:{display:"flex",height:"100px",borderStyle:"solid",borderWidth:"1px",justifyContent:"center",alignItems:"center",fontSize:"12px"},itemsColumn:{display:"flex",height:"100px",borderStyle:"solid",borderWidth:"1px",justifyContent:"center",alignItems:"center",fontSize:"12px"},item:{display:"flex",gap:"5px",marginTop:"10px",alignItems:"center"},itemTitle:{fontSize:"12px",fontWeight:"bolder"},itemText:{fontSize:"10px"},invoiceTable:{width:"100%",borderCollapse:"collapse",alignSelf:"center"},tableCell:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:11,padding:"10px",fontFamily:"iranyekan"},tableCellTexts:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:12,padding:"10px",fontFamily:"iranyekan"},tableHeader:{pageBreakAfter:"auto"},headerRow:{backgroundColor:"#eee",pageBreakInside:"avoid",pageBreakAfter:"auto"},tableHeaderCell:{backgroundColor:"#eee",fontSize:10,border:"1px solid #000",padding:"4px",textAlign:"center",fontWeight:"bold",minWidth:"100px"},tableHeaderCellText:{backgroundColor:"#eee",fontSize:10,border:"1px solid #000",padding:"4px",textAlign:"center",fontWeight:"bold",minWidth:"260px"}},Le=c.forwardRef(({item:t,isUnion:y,union:x,user:p},T)=>{const g=[{title:"فروشنده",text:y?(x==null?void 0:x.unitName)||"-":"هوشمند سازان "},{title:"شناسه ملی",text:y?(x==null?void 0:x.unitNationalId)||"-":"14013838372"},{title:"شماره ثبت",text:y?(x==null?void 0:x.unitRegistrationNumber)||"-":"17514"},{title:"استان",text:y?(x==null?void 0:x.unitProvince)||"-":"البرز"},{title:"شهرستان",text:y?(x==null?void 0:x.unitCity)||"-":"کرج"},{title:"تلفن",text:y?(x==null?void 0:x.mobile)||"-":"(021)28421237"},{title:"کد پستی",text:y?(x==null?void 0:x.unitPostalCode)||"-":"3139735185"},{title:"نشانی",text:y?(x==null?void 0:x.unitAddress)||"-":"نبش بلوار سرداران"}],_=[{title:"فروشنده",text:(p==null?void 0:p.unitName)||"-"},{title:"شناسه ملی",text:(p==null?void 0:p.unitNationalId)||"-"},{title:"شماره ثبت",text:(p==null?void 0:p.unitRegistrationNumber)||"-"},{title:"استان",text:(p==null?void 0:p.unitProvince)||"-"},{title:"شهرستان",text:(p==null?void 0:p.unitCity)||"-"},{title:"تلفن",text:(p==null?void 0:p.mobile)||"-"},{title:"کد پستی",text:(p==null?void 0:p.unitPostalCode)||"-"},{title:"نشانی",text:(p==null?void 0:p.unitAddress)||"-"}];return u.jsxs("div",{ref:T,style:{fontFamily:"iranyekan"},children:[u.jsx("div",{style:j.documentTitle,children:u.jsx("h2",{children:"صورتحسـاب فروش کالا و خدمات"})}),u.jsxs("div",{style:j.row,children:[u.jsx("div",{style:{...j.column,backgroundColor:"#eee",width:"5%"},children:u.jsx("span",{style:{writingMode:"vertical-lr",rotate:"180deg"},children:"فروشنده"})}),u.jsx("div",{style:{...j.itemsColumn,width:"85%"},children:u.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"5px",padding:"10px",width:"100%"},children:g==null?void 0:g.map((E,I)=>u.jsxs("div",{style:j.item,children:[u.jsxs("span",{style:j.itemTitle,children:[E.title,":"]}),u.jsx("span",{style:j.itemText,children:E.text})]},I))})}),u.jsx("div",{style:{...j.column,width:"10%"},children:u.jsxs("div",{style:{display:"grid"},children:[u.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:0},children:[u.jsxs("span",{style:{fontSize:"11px",fontWeight:"bolder"},children:["شماره فاکتور: ","‌"]}),u.jsx("span",{style:{fontSize:"11px"},children:H(new Ye).format("YYMMDD")})]}),u.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:"10px"},children:[u.jsxs("span",{style:{fontSize:"11px",fontWeight:"bolder"},children:["تاریخ: ","‌"]}),u.jsx("span",{style:{fontSize:"11px"},children:new Ye().toLocale("fa").format("YYYY/MM/DD")})]})]})})]}),u.jsxs("div",{style:{...j.row,marginTop:"3px"},children:[u.jsx("div",{style:{...j.column,backgroundColor:"#eee",width:"5%"},children:u.jsx("span",{style:{writingMode:"vertical-lr",rotate:"180deg"},children:"خریدار"})}),u.jsx("div",{style:{...j.itemsColumn,width:"85%"},children:u.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"5px",padding:"10px",width:"100%"},children:_==null?void 0:_.map((E,I)=>u.jsxs("div",{style:j.item,children:[u.jsxs("span",{style:j.itemTitle,children:[E.title,":"]}),u.jsx("span",{style:j.itemText,children:E.text})]},I))})}),u.jsx("div",{style:{display:"flex",height:"100px",marginRight:"2px",width:"10%"}})]}),u.jsx("div",{style:{...j.row,marginTop:"3px"},children:u.jsxs("table",{style:j.invoiceTable,children:[u.jsx("thead",{style:j.tableHeader,children:u.jsxs("tr",{style:j.headerRow,children:[u.jsx("th",{style:{...j.tableHeaderCell,minWidth:"30px"},children:"ردیف"}),u.jsx("th",{style:j.tableHeaderCellText,children:"شرح خدمت"}),u.jsx("th",{style:j.tableHeaderCell,children:"مبلغ واحد (ریال)"}),u.jsx("th",{style:j.tableHeaderCell,children:"جمع مالیات و عوارض ارزش افزوده (ریال)"}),u.jsx("th",{style:j.tableHeaderCell,children:"مبلغ کل (ریال)"}),u.jsx("th",{style:j.tableHeaderCell,children:"تخفیف (ریال)"}),u.jsxs("th",{style:j.tableHeaderCell,children:["جمع کل پس از تخفیف",u.jsx("br",{}),"( با احتساب مالیات و عوارض ) ریال"]})]})}),u.jsxs("tbody",{children:[y?u.jsxs(u.Fragment,{children:[u.jsxs("tr",{style:j.tableRow,children:[u.jsx("td",{style:j.tableCell,children:"1"}),u.jsxs("td",{style:j.tableCellTexts,children:["تعرفه استفاده از سامانه رصدیار",u.jsx("br",{}),"(سهم اتحادیه مرغداران گوشتی)"]}),u.jsx("td",{style:j.tableCell,children:((t==null?void 0:t.unionShare)/100*90).toLocaleString()}),u.jsx("td",{style:j.tableCell,children:((t==null?void 0:t.unionShare)/100*10).toLocaleString()}),u.jsx("td",{style:j.tableCell,children:t==null?void 0:t.unionShare.toLocaleString()}),u.jsx("td",{style:j.tableCell,children:"0"}),u.jsx("td",{style:j.tableCell,children:t==null?void 0:t.unionShare.toLocaleString()})]}),u.jsxs("tr",{style:j.tableRow,children:[u.jsx("td",{style:j.tableCell,children:"2"}),u.jsxs("td",{style:j.tableCellTexts,children:["تعرفه استفاده از سامانه رصدیار",u.jsx("br",{}),"(سهم صنف پروتئین)"]}),u.jsx("td",{style:j.tableCell,children:((t==null?void 0:t.guildsShare)/100*90).toLocaleString()}),u.jsxs("td",{style:j.tableCell,children:[" ",((t==null?void 0:t.guildsShare)/100*10).toLocaleString()]}),u.jsx("td",{style:j.tableCell,children:t==null?void 0:t.guildsShare.toLocaleString()}),u.jsx("td",{style:j.tableCell,children:"0"}),u.jsx("td",{style:j.tableCell,children:t==null?void 0:t.guildsShare.toLocaleString()})]}),u.jsxs("tr",{style:j.tableRow,children:[u.jsx("td",{style:j.tableCell,children:"3"}),u.jsxs("td",{style:j.tableCellTexts,children:["تعرفه استفاده از سامانه رصدیار",u.jsx("br",{}),"(سهم دامپزشک فارم)"]}),u.jsxs("td",{style:j.tableCell,children:[" ",((t==null?void 0:t.otherShare)/100*90).toLocaleString()]}),u.jsx("td",{style:j.tableCell,children:((t==null?void 0:t.otherShare)/100*10).toLocaleString()}),u.jsx("td",{style:j.tableCell,children:t==null?void 0:t.otherShare.toLocaleString()}),u.jsx("td",{style:j.tableCell,children:"0"}),u.jsx("td",{style:j.tableCell,children:t==null?void 0:t.otherShare.toLocaleString()})]})]}):u.jsxs("tr",{style:j.tableRow,children:[u.jsx("td",{style:j.tableCell,children:"1"}),u.jsxs("td",{style:j.tableCellTexts,children:["تعرفه استفاده از سامانه رصدیار",u.jsx("br",{}),"(سهم شرکت هوشمند سازان)"]}),u.jsx("td",{style:j.tableCell,children:((t==null?void 0:t.companyShare)/100*90).toLocaleString()}),u.jsx("td",{style:j.tableCell,children:((t==null?void 0:t.companyShare)/100*10).toLocaleString()}),u.jsx("td",{style:j.tableCell,children:t==null?void 0:t.companyShare.toLocaleString()}),u.jsx("td",{style:j.tableCell,children:"0"}),u.jsx("td",{style:j.tableCell,children:t==null?void 0:t.companyShare.toLocaleString()})]}),y?u.jsxs("tr",{style:j.tableRow,children:[u.jsx("td",{style:{...j.tableCell,backgroundColor:"#eee"},colSpan:2,children:"جمع کل"}),u.jsx("td",{style:j.tableCell,children:(((t==null?void 0:t.unionShare)+(t==null?void 0:t.guildsShare)+(t==null?void 0:t.otherShare))/100*90).toLocaleString()}),u.jsx("td",{style:j.tableCell,children:(((t==null?void 0:t.unionShare)+(t==null?void 0:t.guildsShare)+(t==null?void 0:t.otherShare))/100*10).toLocaleString()}),u.jsxs("td",{style:j.tableCell,children:[" ",((t==null?void 0:t.unionShare)+(t==null?void 0:t.guildsShare)+(t==null?void 0:t.otherShare)).toLocaleString()]}),u.jsx("td",{style:j.tableCell,children:"0"}),u.jsxs("td",{style:j.tableCell,children:[" ",((t==null?void 0:t.unionShare)+(t==null?void 0:t.guildsShare)+(t==null?void 0:t.otherShare)).toLocaleString()]})]}):u.jsxs("tr",{style:j.tableRow,children:[u.jsx("td",{style:{...j.tableCell,backgroundColor:"#eee"},colSpan:2,children:"جمع کل"}),u.jsx("td",{style:j.tableCell,children:((t==null?void 0:t.companyShare)/100*90).toLocaleString()}),u.jsx("td",{style:j.tableCell,children:((t==null?void 0:t.companyShare)/100*10).toLocaleString()}),u.jsx("td",{style:j.tableCell,children:t==null?void 0:t.companyShare.toLocaleString()}),u.jsx("td",{style:j.tableCell,children:"0"}),u.jsx("td",{style:j.tableCell,children:t==null?void 0:t.companyShare.toLocaleString()})]}),u.jsx("tr",{style:{height:"120px"},children:u.jsxs("td",{style:j.tableCell,colSpan:9,children:[u.jsx("div",{style:{display:"flex",height:"120px",alignItems:"start",justifyContent:"center"},children:u.jsxs("div",{style:{display:"flex",justifyContent:"space-around",alignItems:"start",width:"100%"},children:[u.jsxs("div",{style:{display:"grid"},children:[u.jsxs("span",{style:{fontSize:"12px"},children:[" ","مهر و امضای فروشنده:"]}),!y&&u.jsx("img",{src:Fa,alt:"امضا",style:{height:"90px",marginTop:"20px"}})]}),u.jsx("div",{style:{fontSize:"12px"},children:"مهر و امضای خریدار:"})]})}),u.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"start"},children:y&&u.jsx("span",{style:{color:"red",fontSize:"11px"},children:"* توجه: مبلغ کل به حساب اتحادیه مرغداران گوشتی استان واریز گردیده است ."})})]})})]})]})}),u.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",direction:"rtl",marginTop:"10px",alignItems:"center"},children:u.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:"10px",alignItems:"center",width:"100%"},children:[u.jsx("div",{children:u.jsxs("span",{style:{fontSize:"13px",fontWeight:"bolder"},children:["اطلاعات تراکنش"," "]})}),u.jsx("div",{children:u.jsxs("span",{style:{fontSize:"11px"},children:["تاریخ پرداخت:"," ",(t==null?void 0:t.date)&&`${ge(t==null?void 0:t.date)} ساعت (${Fe(t==null?void 0:t.date)})`]})}),u.jsx("div",{children:u.jsxs("span",{style:{fontSize:"11px"},children:["نوع پرداخت:"," ",(t==null?void 0:t.transactionType)==="wage-gateway-auto"?"آنلاین":(t==null?void 0:t.transactionType)==="correspondence"?"مکاتبات":"دستی"]})}),u.jsx("div",{children:u.jsxs("span",{style:{fontSize:"11px"},children:["کد پیگیری: ",t==null?void 0:t.refId]})}),u.jsx("div",{children:u.jsxs("span",{style:{fontSize:"11px"},children:["شماره کارت: ",t==null?void 0:t.cardHolderPan]})})]})})]})});Le.displayName="ProvincePaymentFactorFile";Le.propTypes={item:ve.PropTypes.object};var be={},ya=Ge;Object.defineProperty(be,"__esModule",{value:!0});var Ve=be.default=void 0,Ea=ya(ta()),wa=u;Ve=be.default=(0,Ea.default)((0,wa.jsx)("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"}),"Description");const de=({killhouseKey:t,type:y})=>{var Ku,Hu,qu,k6,_6,M6,D6,R6,Y6,P6;const[,,x,p,T,g]=c.useContext(ju),_=m6();c.useEffect(()=>{const q=H(new Date).format("YYYY-MM-DD");p(q),g(q)},[]);const E=q=>{D(q.target.value)},[I,l]=c.useState([]),[b,w]=c.useState(0),[P,v]=c.useState(10),[M,D]=c.useState(""),[$,k]=c.useState(1),[e,z]=c.useState([]),[W,V]=c.useState(!1),C=async q=>{_(v6());const F=await K.get(`internal-transactions/?search=filter&value=${M}&page=${q}&page_size=${P}&type=paid&${y}=${t}&role=${d()}${W?`&date1=${x}&date2=${T}`:""}`);_(U6()),l(F.data.results),w(F.data.count)},S=q=>{C(q),k(q)},n=q=>{v(q),k(1)},s=()=>{C($!==0?$:1)},[r,A]=c.useState(),h=c.useRef(),L=Pe.useReactToPrint({content:()=>h.current,documentTitle:"گزارش پرونده "}),U=q=>{A(q,L())},[J,ku]=c.useState(),Fu=c.useRef(),_u=Pe.useReactToPrint({content:()=>Fu.current,documentTitle:"فاکتور پرداخت",pageStyle:` + @page { + size: landscape; + margin: 0; + dir: rtl; + margin: 20px; + } + body { + -webkit-print-color-adjust: exact; + } + `}),Mu=q=>{ku(q),setTimeout(()=>{_u()},1)},Du=({item:q})=>{const[F,Yu]=c.useState(null),L6=$6=>{Yu($6.currentTarget)},Pu=()=>{Yu(null)},vu=!!F,W6=vu?`paid-fee-actions-${q==null?void 0:q.key}`:void 0,Q6=()=>{Pu(),U(q)},z6=$6=>{Pu(),Mu({item:q,isUnion:$6})};return u.jsxs("div",{children:[u.jsx(T6,{"aria-describedby":W6,color:"primary",onClick:L6,size:"small",children:u.jsx(pa,{fontSize:"small"})}),u.jsx(Je,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:W6,open:vu,anchorEl:F,onClose:Pu,children:u.jsxs(Ze,{sx:{p:1},children:[u.jsx(he,{disablePadding:!0,children:u.jsxs(xe,{sx:{color:"error.main"},onClick:Q6,children:[u.jsx(pe,{sx:{minWidth:36,color:"inherit"},children:u.jsx(xa,{fontSize:"small"})}),u.jsx(Wu,{variant:"body2",color:"inherit",children:"چاپ رسید"})]})}),u.jsx(he,{disablePadding:!0,children:u.jsxs(xe,{sx:{color:"primary.main"},onClick:()=>z6(!0),children:[u.jsx(pe,{sx:{minWidth:36,color:"inherit"},children:u.jsx(ha,{fontSize:"small"})}),u.jsx(Wu,{variant:"body2",color:"inherit",children:"فاکتور اتحادیه"})]})}),u.jsx(he,{disablePadding:!0,children:u.jsxs(xe,{sx:{color:"success.main"},onClick:()=>z6(!1),children:[u.jsx(pe,{sx:{minWidth:36,color:"inherit"},children:u.jsx(Ve,{fontSize:"small"})}),u.jsx(Wu,{variant:"body2",color:"inherit",children:"فاکتور سامانه"})]})})]})})]})};c.useEffect(()=>{const q=I==null?void 0:I.map((F,Yu)=>{var L6,Pu,vu;return[$===1?Yu+1:Yu+P*($-1)+1,`${ge(F.date)} ساعت (${Fe(F.date)})`,d()==="SuperAdmin"?u.jsxs(f,{container:!0,xs:12,alignItems:"center",children:[(F==null?void 0:F.transactionType)==="wage-gateway-auto"?"آنلاین":(F==null?void 0:F.transactionType)==="correspondence"?"مکاتبات":"دستی",u.jsx(T6,{"aria-label":"delete",color:"primary",onClick:()=>{_(ie({title:"ویرایش نوع پرداخت",content:u.jsx(da,{fetchApiData:s,item:F})}))},children:u.jsx(He,{})})]}):(F==null?void 0:F.transactionType)==="wage-gateway-auto"?"آنلاین":(F==null?void 0:F.transactionType)==="correspondence"?"مکاتبات":"دستی",`${(L6=F==null?void 0:F.payerInfo)==null?void 0:L6.fullname} (${(Pu=F==null?void 0:F.payerInfo)==null?void 0:Pu.mobile})`,F==null?void 0:F.orderId,F==null?void 0:F.refId,F==null?void 0:F.orderId,F==null?void 0:F.cardHolderPan,(vu=F==null?void 0:F.transactionAmount)==null?void 0:vu.toLocaleString(),d()==="SuperAdmin"?u.jsxs(f,{container:!0,xs:12,alignItems:"center",children:[F!=null&&F.description?F==null?void 0:F.description:"-"," ",u.jsx(T6,{"aria-label":"delete",color:"primary",onClick:()=>{_(ie({title:"ویرایش توضیحات",content:u.jsx(ga,{fetchApiData:s,item:F})}))},children:u.jsx(He,{})})]}):F!=null&&F.description?F==null?void 0:F.description:"-",u.jsx(Du,{item:F},(F==null?void 0:F.key)??Yu)]});z(q)},[I]),c.useEffect(()=>{C(1)},[_,x,T,P]);const zu=async q=>{q.preventDefault(),_(v6());try{const F=await K.get(`internal-transactions/?search=filter&value=${M}&page=${$}&page_size=${P}&type=paid&${y}=${t}&role=${d()}${W?`&date1=${x}&date2=${T}`:""}`);l(F.data.results),w(F.data.count),_(U6())}catch(F){console.error("Error fetching data:",F)}};return u.jsxs(f,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(f,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,width:"100%",children:[u.jsxs("div",{style:{visibility:"hidden",position:"absolute"},children:[u.jsx(we,{ref:h,item:r,isPayment:!0}),u.jsx(Le,{ref:Fu,item:J==null?void 0:J.item,user:(qu=(Hu=(Ku=J==null?void 0:J.item)==null?void 0:Ku.killHouse)==null?void 0:Hu.killHouseOperator)==null?void 0:qu.user,union:(k6=J==null?void 0:J.item)==null?void 0:k6.unionInfo,isUnion:J==null?void 0:J.isUnion})]}),u.jsxs(f,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(w6,{icon:u.jsx(ye,{}),checkedIcon:u.jsx(Ee,{}),checked:W,onChange:()=>V(!W),color:"primary",size:"large"}),u.jsx(f,{children:u.jsx(G,{disabled:!W,label:"از تاریخ",id:"date",renderInput:q=>u.jsx(N,{size:"small",style:{width:"160px"},...q}),value:x,onChange:q=>{p(H(q).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(G,{disabled:!W,label:"تا تاریخ",id:"date",renderInput:q=>u.jsx(N,{size:"small",style:{width:"160px"},...q}),value:T,onChange:q=>{g(H(q).format("YYYY-MM-DD"))}})})]}),u.jsx(f,{container:!0,alignItems:"center",gap:Iu.SMALL,children:u.jsxs("form",{onSubmit:zu,children:[u.jsx(N,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:E}),u.jsx(X,{type:"submit",onClick:zu,endIcon:u.jsx(b6,{}),children:"جستجو"})]})})]}),u.jsx(E6,{data:e,columns:["ردیف","تاریخ پرداخت","نوع پرداخت","نام پرداخت کننده","شماره درخواست","شماره پیگیری","کدسفارش","شماره کارت","مبلغ تراکنش (ریال)","توضیحات","عملیات"],handlePageChange:S,totalRows:b,page:$,perPage:P,handlePerRowsChange:n,title:` + تعرفه های پرداخت شده + ${(M6=(_6=I[0])==null?void 0:_6.provinceRequest)!=null&&M6.killHouseUserFullName?`${(R6=(D6=I[0])==null?void 0:D6.provinceRequest)!=null&&R6.killer?"کشتارکن":"کشتارگاه"} ${(P6=(Y6=I[0])==null?void 0:Y6.provinceRequest)==null?void 0:P6.killHouseUserFullName}`:""} +`})]})},La=()=>{var n,s,r,A,h,L,U,J,ku,Fu,_u,Mu,Du,zu,Ku,Hu,qu,k6,_6,M6,D6,R6,Y6,P6,q,F,Yu,L6,Pu,vu,W6,Q6,z6,$6,u0,e0,a0,l0,t0,o0,n0,s0,r0,c0,C0,d0,g0,A0,i0,f0,h0,x0,p0,S0,j0,F0,y0,E0,w0,L0,b0,$0,T0,I0,k0,_0,M0,D0,R0,Y0,P0,W0,z0,K0,H0,q0,v0,U0;const t=m6(),[y,x]=c.useState(),[p,T]=c.useState([]),[g,_]=c.useState(),{provincePaymentKillersOfKillhouses:E}=Ru(R=>R.provinceSlice),I=Ru(R=>R.userSlice.userPath),[l]=c.useContext(ju),b=Ru(R=>R.userSlice.userProfile.key),[w,P]=c.useState(!1),v=G6(),[,,M,D,$,k]=c.useContext(ju);c.useEffect(()=>{const R=H(new Date).format("YYYY-MM-DD");D(R),k(R)},[]),c.useEffect(()=>{d()==="KillHouse"&&t(oa())},[]);const{provincePaymentByWeightOverview:e}=Ru(R=>R.provinceSlice);c.useEffect(()=>{var i,pu;const R=(pu=(i=e==null?void 0:e.wageInfo)==null?void 0:i.shares)==null?void 0:pu.map((o,au)=>{var lu,tu,ou,nu,su,ru,cu,Cu;return[au+1,o==null?void 0:o.name,(lu=o==null?void 0:o.outProvincePoultryRequestWage)==null?void 0:lu.toLocaleString(),(tu=o==null?void 0:o.provinceKillRequestWage)==null?void 0:tu.toLocaleString(),(ou=o==null?void 0:o.freeSellCarcassesWage)==null?void 0:ou.toLocaleString(),(nu=o==null?void 0:o.freeBuyingCarcassesWage)==null?void 0:nu.toLocaleString(),(su=o==null?void 0:o.freeBuyingLiveWage)==null?void 0:su.toLocaleString(),(ru=parseInt(Math.floor((o==null?void 0:o.totalWage)/1e3)*1e3))==null?void 0:ru.toLocaleString(),(cu=parseInt(Math.floor((o==null?void 0:o.totalPaidWage)/1e3)*1e3))==null?void 0:cu.toLocaleString(),(Cu=parseInt(Math.floor((o==null?void 0:o.totalUnpaidWage)/1e3)*1e3))==null?void 0:Cu.toLocaleString()]});T(R)},[e]),c.useEffect(()=>{t(na({date1:w?M:null,date2:w?$:null,role:d()}))},[t,M,$,w]),c.useEffect(()=>{if(e){const R=E==null?void 0:E.map((i,pu)=>{var o,au,lu,tu,ou,nu,su,ru,cu,Cu,Uu,Nu,Vu,Qu,Xu,Gu,Ju,Zu,Ou,Bu,mu,u6,e6,a6,l6,t6,o6,n6,s6,r6,c6,C6,Q,yu,d6,g6,A6,i6,f6,h6,x6,p6,a,Su,Z,O,B,m,uu,eu,du,gu,Au,iu,fu,hu,xu;return((o=e==null?void 0:e.wageInfo)==null?void 0:o.wageCountingType)==="live"?[i==null?void 0:i.name,(lu=Math.ceil((au=i==null?void 0:i.wageInfo)==null?void 0:au.totalWage))==null?void 0:lu.toLocaleString(),(ou=Math.ceil((tu=i==null?void 0:i.wageInfo)==null?void 0:tu.totalPaidWage))==null?void 0:ou.toLocaleString(),(su=Math.ceil((nu=i==null?void 0:i.wageInfo)==null?void 0:nu.off))==null?void 0:su.toLocaleString(),(cu=Math.ceil((ru=i==null?void 0:i.wageInfo)==null?void 0:ru.totalUnpaidWage))==null?void 0:cu.toLocaleString(),u.jsx("a",{href:`${window.location.origin}/pay/${Ae(I)}/${(Cu=i==null?void 0:i.wageInfo)==null?void 0:Cu.userToken}`,style:{color:"blue"},target:"_blank",rel:"noreferrer",children:`${window.location.origin}/pay/${Ae(I)}/${(Uu=i==null?void 0:i.wageInfo)==null?void 0:Uu.userToken}`},pu),(Vu=Math.ceil((Nu=i==null?void 0:i.wageInfo)==null?void 0:Nu.totalProvinceLiveWeight))==null?void 0:Vu.toLocaleString(),(Xu=Math.ceil((Qu=i==null?void 0:i.wageInfo)==null?void 0:Qu.provinceKillRequestsTotalWage))==null?void 0:Xu.toLocaleString(),(Ju=Math.ceil((Gu=i==null?void 0:i.wageInfo)==null?void 0:Gu.freeBarsOutProvinceCarcasesTotalWeight))==null?void 0:Ju.toLocaleString(),(Ou=Math.ceil((Zu=i==null?void 0:i.wageInfo)==null?void 0:Zu.freeBarsOutProvinceCarcasesTotalWage))==null?void 0:Ou.toLocaleString(),(mu=Math.ceil((Bu=i==null?void 0:i.wageInfo)==null?void 0:Bu.freeBarsCarcasesTotalWeight))==null?void 0:mu.toLocaleString(),(e6=Math.ceil((u6=i==null?void 0:i.wageInfo)==null?void 0:u6.freeBarsCarcasesTotalWage))==null?void 0:e6.toLocaleString(),(l6=Math.ceil((a6=i==null?void 0:i.wageInfo)==null?void 0:a6.freeBarsLiveTotalWeight))==null?void 0:l6.toLocaleString(),(o6=Math.ceil((t6=i==null?void 0:i.wageInfo)==null?void 0:t6.freeBarsLiveTotalWage))==null?void 0:o6.toLocaleString()]:[i==null?void 0:i.name,(s6=Math.ceil((n6=i==null?void 0:i.wageInfo)==null?void 0:n6.totalWage))==null?void 0:s6.toLocaleString(),(c6=Math.ceil((r6=i==null?void 0:i.wageInfo)==null?void 0:r6.totalPaidWage))==null?void 0:c6.toLocaleString(),(Q=Math.ceil((C6=i==null?void 0:i.wageInfo)==null?void 0:C6.off))==null?void 0:Q.toLocaleString(),(d6=Math.ceil((yu=i==null?void 0:i.wageInfo)==null?void 0:yu.totalUnpaidWage))==null?void 0:d6.toLocaleString(),u.jsx("a",{href:`${window.location.origin}/pay/${Ae(I)}/${(g6=i==null?void 0:i.wageInfo)==null?void 0:g6.userToken}`,style:{color:"blue"},target:"_blank",rel:"noreferrer",children:`${window.location.origin}/pay/${Ae(I)}/${(A6=i==null?void 0:i.wageInfo)==null?void 0:A6.userToken}`},pu),(f6=Math.ceil((i6=i==null?void 0:i.wageInfo)==null?void 0:i6.totalProvinceLiveWeight))==null?void 0:f6.toLocaleString(),(x6=Math.ceil((h6=i==null?void 0:i.wageInfo)==null?void 0:h6.totalProvinceCarcassesWeight))==null?void 0:x6.toLocaleString(),(a=Math.ceil((p6=i==null?void 0:i.wageInfo)==null?void 0:p6.provinceKillRequestsTotalWeight))==null?void 0:a.toLocaleString(),(Z=Math.ceil((Su=i==null?void 0:i.wageInfo)==null?void 0:Su.provinceKillRequestsTotalWage))==null?void 0:Z.toLocaleString(),(B=Math.ceil((O=i==null?void 0:i.wageInfo)==null?void 0:O.freeBarsOutProvinceCarcasesTotalWeight))==null?void 0:B.toLocaleString(),(uu=Math.ceil((m=i==null?void 0:i.wageInfo)==null?void 0:m.freeBarsOutProvinceCarcasesTotalWage))==null?void 0:uu.toLocaleString(),(du=Math.ceil((eu=i==null?void 0:i.wageInfo)==null?void 0:eu.freeBarsCarcasesTotalWeight))==null?void 0:du.toLocaleString(),(Au=Math.ceil((gu=i==null?void 0:i.wageInfo)==null?void 0:gu.freeBarsCarcasesTotalWage))==null?void 0:Au.toLocaleString(),(fu=Math.ceil((iu=i==null?void 0:i.wageInfo)==null?void 0:iu.freeBarsLiveTotalWeight))==null?void 0:fu.toLocaleString(),(xu=Math.ceil((hu=i==null?void 0:i.wageInfo)==null?void 0:hu.freeBarsLiveTotalWage))==null?void 0:xu.toLocaleString()]});x(R)}},[E,e]);const z=(R,i)=>{const pu=R==null?void 0:R.map((o,au)=>{var lu,tu,ou,nu,su,ru,cu,Cu;return[au+1,o==null?void 0:o.name,(lu=o==null?void 0:o.provinceKillRequestWage)==null?void 0:lu.toLocaleString(),(tu=o==null?void 0:o.returnProvinceKillRequestWage)==null?void 0:tu.toLocaleString(),(ou=o==null?void 0:o.freeSellCarcassesWage)==null?void 0:ou.toLocaleString(),(nu=o==null?void 0:o.freeBuyingCarcassesWage)==null?void 0:nu.toLocaleString(),(su=o==null?void 0:o.freeBuyingLiveWage)==null?void 0:su.toLocaleString(),(ru=parseInt(Math.floor((o==null?void 0:o.totalWage)/1e3)*1e3))==null?void 0:ru.toLocaleString(),(cu=parseInt(Math.floor((o==null?void 0:o.totalPaidWage)/1e3)*1e3))==null?void 0:cu.toLocaleString(),(Cu=parseInt(Math.floor((o==null?void 0:o.totalUnpaidWage)/1e3)*1e3))==null?void 0:Cu.toLocaleString()]});return u.jsx(T6,{size:"small",color:"success",onClick:()=>{var o;t(ie({title:"سهم بندی تعرفه کشتارگاه "+i,size:1e3,content:u.jsx(f,{container:!0,xs:12,justifyContent:"center",children:u.jsx(Ne,{data:pu,columns:["ردیف","سهم",`${((o=e==null?void 0:e.wageInfo)==null?void 0:o.wageCountingType)==="live"?"تعرفه کشتار داخل استان (ریال)":" تعرفه توزیع لاشه داخل استان (ریال)"}`,"تعرفه خریدهای بازگشتی (ریال)","تعرفه توزیع لاشه خارج استان (ریال)","تعرفه لاشه ورودی به استان (ریال)","تعرفه مرغ زنده ورودی به استان (ریال)","تعرفه کل (ریال)","تعرفه پرداخت شده (ریال)","تعرفه پرداخت نشده (ریال)"]})})}))},children:u.jsx(Ce,{fontSize:"small"})})};c.useEffect(()=>{d()!=="KillHouse"&&e&&t(Aa({date1:w?M:null,date2:w?$:null})).then(R=>{var pu;const i=(pu=R.payload.data)==null?void 0:pu.map((o,au)=>{var lu,tu,ou,nu,su,ru,cu,Cu,Uu,Nu,Vu,Qu,Xu,Gu,Ju,Zu,Ou,Bu,mu,u6,e6,a6,l6,t6,o6,n6,s6,r6,c6,C6,Q,yu,d6,g6,A6,i6,f6,h6,x6,p6,a,Su,Z,O,B,m,uu,eu,du,gu,Au,iu,fu,hu,xu,Eu,wu,Lu,bu,$u,Tu;return((lu=e==null?void 0:e.wageInfo)==null?void 0:lu.wageCountingType)==="live"?[au+1,o==null?void 0:o.name,(ou=Math.ceil((tu=o==null?void 0:o.wageInfo)==null?void 0:tu.totalWage))==null?void 0:ou.toLocaleString(),z(o==null?void 0:o.shares,o==null?void 0:o.name),(su=Math.ceil((nu=o==null?void 0:o.wageInfo)==null?void 0:nu.totalPaidWage))==null?void 0:su.toLocaleString(),(cu=Math.ceil((ru=o==null?void 0:o.wageInfo)==null?void 0:ru.off))==null?void 0:cu.toLocaleString(),(Uu=Math.ceil((Cu=o==null?void 0:o.wageInfo)==null?void 0:Cu.totalUnpaidWage))==null?void 0:Uu.toLocaleString(),(Vu=Math.ceil((Nu=o==null?void 0:o.wageInfo)==null?void 0:Nu.totalProvinceLiveWeight))==null?void 0:Vu.toLocaleString(),(Xu=Math.ceil((Qu=o==null?void 0:o.wageInfo)==null?void 0:Qu.provinceKillRequestsTotalWage))==null?void 0:Xu.toLocaleString(),(Ju=Math.ceil((Gu=o==null?void 0:o.wageInfo)==null?void 0:Gu.freeBarsOutProvinceCarcasesTotalWeight))==null?void 0:Ju.toLocaleString(),(Ou=Math.ceil((Zu=o==null?void 0:o.wageInfo)==null?void 0:Zu.freeBarsOutProvinceCarcasesTotalWage))==null?void 0:Ou.toLocaleString(),(mu=Math.ceil((Bu=o==null?void 0:o.wageInfo)==null?void 0:Bu.freeBarsCarcasesTotalWeight))==null?void 0:mu.toLocaleString(),(e6=Math.ceil((u6=o==null?void 0:o.wageInfo)==null?void 0:u6.freeBarsCarcasesTotalWage))==null?void 0:e6.toLocaleString(),(l6=Math.ceil((a6=o==null?void 0:o.wageInfo)==null?void 0:a6.freeBarsLiveTotalWeight))==null?void 0:l6.toLocaleString(),(o6=Math.ceil((t6=o==null?void 0:o.wageInfo)==null?void 0:t6.freeBarsLiveTotalWage))==null?void 0:o6.toLocaleString(),(s6=Math.ceil((n6=o==null?void 0:o.wageInfo)==null?void 0:n6.returnTotalProvinceLiveWeight))==null?void 0:s6.toLocaleString(),(c6=Math.ceil((r6=o==null?void 0:o.wageInfo)==null?void 0:r6.totalReturnPureProvinceCarcassesPrice))==null?void 0:c6.toLocaleString(),u.jsx(T6,{size:"small",color:"success",onClick:()=>{v(d()==="ProvinceOperator"?We+"/"+(o==null?void 0:o.key):d()==="SuperAdmin"?ze+"/"+(o==null?void 0:o.key):Ke+"/"+(o==null?void 0:o.key))},children:u.jsx(Ce,{fontSize:"small"})},au)]:[au+1,o==null?void 0:o.name,(Q=Math.ceil((C6=o==null?void 0:o.wageInfo)==null?void 0:C6.totalWage))==null?void 0:Q.toLocaleString(),z(o==null?void 0:o.shares,o==null?void 0:o.name),(d6=Math.ceil((yu=o==null?void 0:o.wageInfo)==null?void 0:yu.totalPaidWage))==null?void 0:d6.toLocaleString(),(A6=Math.ceil((g6=o==null?void 0:o.wageInfo)==null?void 0:g6.off))==null?void 0:A6.toLocaleString(),(f6=Math.ceil((i6=o==null?void 0:o.wageInfo)==null?void 0:i6.totalUnpaidWage))==null?void 0:f6.toLocaleString(),(x6=Math.ceil((h6=o==null?void 0:o.wageInfo)==null?void 0:h6.totalProvinceLiveWeight))==null?void 0:x6.toLocaleString(),(a=Math.ceil((p6=o==null?void 0:o.wageInfo)==null?void 0:p6.totalProvinceCarcassesWeight))==null?void 0:a.toLocaleString(),(Z=Math.ceil((Su=o==null?void 0:o.wageInfo)==null?void 0:Su.provinceKillRequestsTotalWeight))==null?void 0:Z.toLocaleString(),(B=Math.ceil((O=o==null?void 0:o.wageInfo)==null?void 0:O.provinceKillRequestsTotalWage))==null?void 0:B.toLocaleString(),(uu=Math.ceil((m=o==null?void 0:o.wageInfo)==null?void 0:m.freeBarsOutProvinceCarcasesTotalWeight))==null?void 0:uu.toLocaleString(),(du=Math.ceil((eu=o==null?void 0:o.wageInfo)==null?void 0:eu.freeBarsOutProvinceCarcasesTotalWage))==null?void 0:du.toLocaleString(),(Au=Math.ceil((gu=o==null?void 0:o.wageInfo)==null?void 0:gu.freeBarsCarcasesTotalWeight))==null?void 0:Au.toLocaleString(),(fu=Math.ceil((iu=o==null?void 0:o.wageInfo)==null?void 0:iu.freeBarsCarcasesTotalWage))==null?void 0:fu.toLocaleString(),(xu=Math.ceil((hu=o==null?void 0:o.wageInfo)==null?void 0:hu.freeBarsLiveTotalWeight))==null?void 0:xu.toLocaleString(),(wu=Math.ceil((Eu=o==null?void 0:o.wageInfo)==null?void 0:Eu.freeBarsLiveTotalWage))==null?void 0:wu.toLocaleString(),(bu=Math.ceil((Lu=o==null?void 0:o.wageInfo)==null?void 0:Lu.returnTotalProvinceLiveWeight))==null?void 0:bu.toLocaleString(),(Tu=Math.ceil(($u=o==null?void 0:o.wageInfo)==null?void 0:$u.totalReturnPureProvinceCarcassesPrice))==null?void 0:Tu.toLocaleString(),u.jsx(T6,{size:"small",color:"success",onClick:()=>{v(d()==="ProvinceOperator"?We+"/"+(o==null?void 0:o.key):d()==="SuperAdmin"?ze+"/"+(o==null?void 0:o.key):Ke+"/"+(o==null?void 0:o.key))},children:u.jsx(Ce,{fontSize:"small"})},au)]});_(i)})},[t,e,M,$,w]);const W=()=>{var R;return((R=e==null?void 0:e.wageInfo)==null?void 0:R.wageCountingType)==="live"?["وزن کل فروش زنده به خارج استان","تعرفه کل فروش به خارج استان (ریال)","کل وزن زنده کشتار داخل استان (کیلوگرم)","تعرفه کشتار داخل استان (ریال)","وزن توزیع لاشه به خارج استان (کیلوگرم)","تعرفه توزیع لاشه خارج استان (ریال)","وزن لاشه ورودی به استان (کیلوگرم)","تعرفه لاشه ورودی به استان (ریال)","وزن مرغ زنده ورودی به استان (کیلوگرم)","تعرفه مرغ زنده ورودی به استان (ریال)","وزن خریدهای بازگشتی (کیلوگرم)","تعرفه خریدهای بازگشتی (ریال)"]:["وزن کل فروش زنده به خارج استان","تعرفه کل فروش به خارج استان (ریال)","کل وزن زنده کشتار داخل استان (کیلوگرم)","وزن لاشه کشتار داخل استان (کیلوگرم)","وزن توزیع لاشه داخل استان (کیلوگرم)","تعرفه توزیع لاشه داخل استان (ریال)","وزن توزیع لاشه به خارج استان (کیلوگرم)","تعرفه توزیع لاشه خارج استان (ریال)","وزن لاشه ورودی به استان (کیلوگرم)","تعرفه لاشه ورودی به استان (ریال)","وزن مرغ زنده ورودی به استان (کیلوگرم)","تعرفه مرغ زنده ورودی به استان (ریال)","وزن خریدهای بازگشتی (کیلوگرم)","تعرفه خریدهای بازگشتی (ریال)"]},V=()=>{var R;return((R=e==null?void 0:e.wageInfo)==null?void 0:R.wageCountingType)==="live"?["کل تعرفه (ریال)","کل تعرفه پرداخت شده (ریال)","تخفیف (ریال)","کل تعرفه پرداخت نشده (ریال)","کل وزن زنده کشتار داخل استان (کیلوگرم)","تعرفه کشتار داخل استان (ریال)","وزن توزیع لاشه به خارج استان (کیلوگرم)","تعرفه توزیع لاشه خارج استان (ریال)","وزن لاشه ورودی به استان (کیلوگرم)","تعرفه لاشه ورودی به استان (ریال)","وزن مرغ زنده ورودی به استان (کیلوگرم)","تعرفه مرغ زنده ورودی به استان (ریال)"]:["کل تعرفه (ریال)","کل تعرفه پرداخت شده (ریال)","تخفیف (ریال)","کل تعرفه پرداخت نشده (ریال)","کل وزن زنده کشتار داخل استان (کیلوگرم)","وزن لاشه کشتار داخل استان (کیلوگرم)","وزن توزیع لاشه داخل استان (کیلوگرم)","تعرفه توزیع لاشه داخل استان (ریال)","وزن توزیع لاشه به خارج استان (کیلوگرم)","تعرفه توزیع لاشه خارج استان (ریال)","وزن لاشه ورودی به استان (کیلوگرم)","تعرفه لاشه ورودی به استان (ریال)","وزن مرغ زنده ورودی به استان (کیلوگرم)","تعرفه مرغ زنده ورودی به استان (ریال)"]},C=()=>{var R;return((R=e==null?void 0:e.wageInfo)==null?void 0:R.wageCountingType)==="live"?["ردیف","کشتارگاه","کل تعرفه (ریال)","سهم بندی","کل تعرفه پرداخت شده (ریال)","تخفیف (ریال)","کل تعرفه پرداخت نشده (ریال)","کل وزن زنده کشتار داخل استان (کیلوگرم)","تعرفه کشتار داخل استان (ریال)","وزن توزیع لاشه به خارج استان (کیلوگرم)","تعرفه توزیع لاشه خارج استان (ریال)","وزن لاشه ورودی به استان (کیلوگرم)","تعرفه لاشه ورودی به استان (ریال)","وزن مرغ زنده ورودی به استان (کیلوگرم)","تعرفه مرغ زنده ورودی به استان (ریال)","وزن خریدهای بازگشتی (کیلوگرم)","تعرفه خریدهای بازگشتی (ریال)","کشتارکن"]:["ردیف","کشتارگاه","کل تعرفه (ریال)","سهم بندی","کل تعرفه پرداخت شده (ریال)","تخفیف (ریال)","کل تعرفه پرداخت نشده (ریال)","کل وزن زنده کشتار داخل استان (کیلوگرم)","وزن لاشه کشتار داخل استان (کیلوگرم)","وزن توزیع لاشه داخل استان (کیلوگرم)","تعرفه توزیع لاشه داخل استان (ریال)","وزن توزیع لاشه به خارج استان (کیلوگرم)","تعرفه توزیع لاشه خارج استان (ریال)","وزن لاشه ورودی به استان (کیلوگرم)","تعرفه لاشه ورودی به استان (ریال)","وزن مرغ زنده ورودی به استان (کیلوگرم)","تعرفه مرغ زنده ورودی به استان (ریال)","وزن خریدهای بازگشتی (کیلوگرم)","تعرفه خریدهای بازگشتی (ریال)","کشتارکن"]},S=()=>{var R,i,pu,o,au,lu,tu,ou,nu,su,ru,cu,Cu,Uu,Nu,Vu,Qu,Xu,Gu,Ju,Zu,Ou,Bu,mu,u6,e6,a6,l6,t6,o6,n6,s6,r6,c6,C6,Q,yu,d6,g6,A6,i6,f6,h6,x6,p6,a,Su,Z,O,B,m,uu,eu;return((R=e==null?void 0:e.wageInfo)==null?void 0:R.wageCountingType)==="live"?[[(pu=Math.ceil((i=e==null?void 0:e.wageInfo)==null?void 0:i.totalWage))==null?void 0:pu.toLocaleString(),(au=Math.ceil((o=e==null?void 0:e.wageInfo)==null?void 0:o.totalPaidWage))==null?void 0:au.toLocaleString(),(tu=Math.ceil((lu=e==null?void 0:e.wageInfo)==null?void 0:lu.off))==null?void 0:tu.toLocaleString(),(nu=Math.ceil((ou=e==null?void 0:e.wageInfo)==null?void 0:ou.totalUnpaidWage))==null?void 0:nu.toLocaleString(),(ru=Math.ceil((su=e==null?void 0:e.wageInfo)==null?void 0:su.totalProvinceLiveWeight))==null?void 0:ru.toLocaleString(),(Cu=Math.ceil((cu=e==null?void 0:e.wageInfo)==null?void 0:cu.provinceKillRequestsTotalWage))==null?void 0:Cu.toLocaleString(),(Nu=Math.ceil((Uu=e==null?void 0:e.wageInfo)==null?void 0:Uu.freeBarsOutProvinceCarcasesTotalWeight))==null?void 0:Nu.toLocaleString(),(Qu=Math.ceil((Vu=e==null?void 0:e.wageInfo)==null?void 0:Vu.freeBarsOutProvinceCarcasesTotalWage))==null?void 0:Qu.toLocaleString(),(Gu=Math.ceil((Xu=e==null?void 0:e.wageInfo)==null?void 0:Xu.freeBarsCarcasesTotalWeight))==null?void 0:Gu.toLocaleString(),(Zu=Math.ceil((Ju=e==null?void 0:e.wageInfo)==null?void 0:Ju.freeBarsCarcasesTotalWage))==null?void 0:Zu.toLocaleString(),(Bu=Math.ceil((Ou=e==null?void 0:e.wageInfo)==null?void 0:Ou.freeBarsLiveTotalWeight))==null?void 0:Bu.toLocaleString(),(u6=Math.ceil((mu=e==null?void 0:e.wageInfo)==null?void 0:mu.freeBarsLiveTotalWage))==null?void 0:u6.toLocaleString()]]:[[(a6=Math.ceil((e6=e==null?void 0:e.wageInfo)==null?void 0:e6.totalWage))==null?void 0:a6.toLocaleString(),(t6=Math.ceil((l6=e==null?void 0:e.wageInfo)==null?void 0:l6.totalPaidWage))==null?void 0:t6.toLocaleString(),(n6=Math.ceil((o6=e==null?void 0:e.wageInfo)==null?void 0:o6.off))==null?void 0:n6.toLocaleString(),(r6=Math.ceil((s6=e==null?void 0:e.wageInfo)==null?void 0:s6.totalUnpaidWage))==null?void 0:r6.toLocaleString(),(C6=Math.ceil((c6=e==null?void 0:e.wageInfo)==null?void 0:c6.totalProvinceLiveWeight))==null?void 0:C6.toLocaleString(),(yu=Math.ceil((Q=e==null?void 0:e.wageInfo)==null?void 0:Q.totalProvinceCarcassesWeight))==null?void 0:yu.toLocaleString(),(g6=Math.ceil((d6=e==null?void 0:e.wageInfo)==null?void 0:d6.provinceKillRequestsTotalWeight))==null?void 0:g6.toLocaleString(),(i6=Math.ceil((A6=e==null?void 0:e.wageInfo)==null?void 0:A6.provinceKillRequestsTotalWage))==null?void 0:i6.toLocaleString(),(h6=Math.ceil((f6=e==null?void 0:e.wageInfo)==null?void 0:f6.freeBarsOutProvinceCarcasesTotalWeight))==null?void 0:h6.toLocaleString(),(p6=Math.ceil((x6=e==null?void 0:e.wageInfo)==null?void 0:x6.freeBarsOutProvinceCarcasesTotalWage))==null?void 0:p6.toLocaleString(),(Su=Math.ceil((a=e==null?void 0:e.wageInfo)==null?void 0:a.freeBarsCarcasesTotalWeight))==null?void 0:Su.toLocaleString(),(O=Math.ceil((Z=e==null?void 0:e.wageInfo)==null?void 0:Z.freeBarsCarcasesTotalWage))==null?void 0:O.toLocaleString(),(m=Math.ceil((B=e==null?void 0:e.wageInfo)==null?void 0:B.freeBarsLiveTotalWeight))==null?void 0:m.toLocaleString(),(eu=Math.ceil((uu=e==null?void 0:e.wageInfo)==null?void 0:uu.freeBarsLiveTotalWage))==null?void 0:eu.toLocaleString()]]};return u.jsxs(f,{container:!0,justifyContent:"center",xs:12,mt:1,children:[u.jsxs(f,{container:!0,gap:1,mb:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray"},justifyContent:{xs:"space-between",sm:"left"},alignItems:"center",children:[u.jsx(w6,{icon:u.jsx(ye,{}),checkedIcon:u.jsx(Ee,{}),checked:w,onChange:()=>P(!w),color:"primary",size:"large"}),u.jsx(f,{sx:{width:{xs:"39%",sm:"auto"}},children:u.jsx(G,{disabled:!w,label:"از تاریخ",id:"date",renderInput:R=>u.jsx(N,{size:"small",sx:{width:{xs:"100%",md:"160px"}},...R}),value:M,onChange:R=>{D(H(R).format("YYYY-MM-DD"))}})}),u.jsx(f,{sx:{width:{xs:"39%",sm:"auto"}},children:u.jsx(G,{disabled:!w,label:"تا تاریخ",id:"date",renderInput:R=>u.jsx(N,{size:"small",sx:{width:{xs:"100%",md:"160px"}},...R}),value:$,onChange:R=>{k(H(R).format("YYYY-MM-DD"))}})})]}),u.jsxs(f,{isDashboard:!0,container:!0,justifyContent:"center",xs:12,p:2,children:[u.jsx(f,{container:!0,xs:12,justifyContent:"space-between",mb:2,children:(d()==="KillHouse"||d()==="ChainCompany")&&u.jsx(f,{children:u.jsx(X,{variant:"contained",onClick:()=>{t(ie({title:"پرداخت تعرفه",content:u.jsx(ia,{})}))},children:"پرداخت تعرفه"})})}),u.jsx(E6,{operation:u.jsx(f,{children:(d()==="AdminX"||d()==="ProvinceOperator"||d()==="SuperAdmin")&&u.jsx(I6,{title:"خروجی اکسل",placement:"top",children:u.jsx(T6,{color:"primary",onClick:()=>{l({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const R=`${K.defaults.baseURL}kill_house_total_transactions_wage_payid_admin_x_excel/?date1=${M}&date2=${$}&key=${b}&role=${d()}`;window.location.href=R},children:u.jsx(ja,{})})})}),isDashboard:!0,noPagination:!0,title:"اطلاعات کلی تعرفه",columns:["کل تعرفه (ریال)","کل تعرفه پرداخت شده (ریال)","تخفیف (ریال)","کل تعرفه پرداخت نشده (ریال)"],data:[[(s=Math.ceil((n=e==null?void 0:e.wageInfo)==null?void 0:n.totalWage))==null?void 0:s.toLocaleString(),(A=Math.ceil((r=e==null?void 0:e.wageInfo)==null?void 0:r.totalPaidWage))==null?void 0:A.toLocaleString(),(L=Math.ceil((h=e==null?void 0:e.wageInfo)==null?void 0:h.off))==null?void 0:L.toLocaleString(),(J=Math.ceil((U=e==null?void 0:e.wageInfo)==null?void 0:U.totalUnpaidWage))==null?void 0:J.toLocaleString()]]}),d()!=="KillHouse"&&u.jsx(E6,{noPagination:!0,title:"جزئیات کلی تعرفه",columns:W(),data:((ku=e==null?void 0:e.wageInfo)==null?void 0:ku.wageCountingType)==="live"?[[(_u=Math.ceil((Fu=e==null?void 0:e.wageInfo)==null?void 0:Fu.outProvincePoultryRequestWeight))==null?void 0:_u.toLocaleString(),(Du=Math.ceil((Mu=e==null?void 0:e.wageInfo)==null?void 0:Mu.outProvincePoultryRequestWage))==null?void 0:Du.toLocaleString(),(Ku=Math.ceil((zu=e==null?void 0:e.wageInfo)==null?void 0:zu.totalProvinceLiveWeight))==null?void 0:Ku.toLocaleString(),(qu=Math.ceil((Hu=e==null?void 0:e.wageInfo)==null?void 0:Hu.provinceKillRequestsTotalWage))==null?void 0:qu.toLocaleString(),(_6=Math.ceil((k6=e==null?void 0:e.wageInfo)==null?void 0:k6.freeBarsOutProvinceCarcasesTotalWeight))==null?void 0:_6.toLocaleString(),(D6=Math.ceil((M6=e==null?void 0:e.wageInfo)==null?void 0:M6.freeBarsOutProvinceCarcasesTotalWage))==null?void 0:D6.toLocaleString(),(Y6=Math.ceil((R6=e==null?void 0:e.wageInfo)==null?void 0:R6.freeBarsCarcasesTotalWeight))==null?void 0:Y6.toLocaleString(),(q=Math.ceil((P6=e==null?void 0:e.wageInfo)==null?void 0:P6.freeBarsCarcasesTotalWage))==null?void 0:q.toLocaleString(),(Yu=Math.ceil((F=e==null?void 0:e.wageInfo)==null?void 0:F.freeBarsLiveTotalWeight))==null?void 0:Yu.toLocaleString(),(Pu=Math.ceil((L6=e==null?void 0:e.wageInfo)==null?void 0:L6.freeBarsLiveTotalWage))==null?void 0:Pu.toLocaleString(),(W6=Math.ceil((vu=e==null?void 0:e.wageInfo)==null?void 0:vu.returnTotalProvinceLiveWeight))==null?void 0:W6.toLocaleString(),(z6=Math.ceil((Q6=e==null?void 0:e.wageInfo)==null?void 0:Q6.totalReturnPureProvinceCarcassesPrice))==null?void 0:z6.toLocaleString()]]:[[(u0=Math.ceil(($6=e==null?void 0:e.wageInfo)==null?void 0:$6.outProvincePoultryRequestWeight))==null?void 0:u0.toLocaleString(),(a0=Math.ceil((e0=e==null?void 0:e.wageInfo)==null?void 0:e0.outProvincePoultryRequestWage))==null?void 0:a0.toLocaleString(),(t0=Math.ceil((l0=e==null?void 0:e.wageInfo)==null?void 0:l0.totalProvinceLiveWeight))==null?void 0:t0.toLocaleString(),(n0=Math.ceil((o0=e==null?void 0:e.wageInfo)==null?void 0:o0.totalProvinceCarcassesWeight))==null?void 0:n0.toLocaleString(),(r0=Math.ceil((s0=e==null?void 0:e.wageInfo)==null?void 0:s0.provinceKillRequestsTotalWeight))==null?void 0:r0.toLocaleString(),(C0=Math.ceil((c0=e==null?void 0:e.wageInfo)==null?void 0:c0.provinceKillRequestsTotalWage))==null?void 0:C0.toLocaleString(),(g0=Math.ceil((d0=e==null?void 0:e.wageInfo)==null?void 0:d0.freeBarsOutProvinceCarcasesTotalWeight))==null?void 0:g0.toLocaleString(),(i0=Math.ceil((A0=e==null?void 0:e.wageInfo)==null?void 0:A0.freeBarsOutProvinceCarcasesTotalWage))==null?void 0:i0.toLocaleString(),(h0=Math.ceil((f0=e==null?void 0:e.wageInfo)==null?void 0:f0.freeBarsCarcasesTotalWeight))==null?void 0:h0.toLocaleString(),(p0=Math.ceil((x0=e==null?void 0:e.wageInfo)==null?void 0:x0.freeBarsCarcasesTotalWage))==null?void 0:p0.toLocaleString(),(j0=Math.ceil((S0=e==null?void 0:e.wageInfo)==null?void 0:S0.freeBarsLiveTotalWeight))==null?void 0:j0.toLocaleString(),(y0=Math.ceil((F0=e==null?void 0:e.wageInfo)==null?void 0:F0.freeBarsLiveTotalWage))==null?void 0:y0.toLocaleString(),(w0=Math.ceil((E0=e==null?void 0:e.wageInfo)==null?void 0:E0.returnTotalProvinceLiveWeight))==null?void 0:w0.toLocaleString(),(b0=Math.ceil((L0=e==null?void 0:e.wageInfo)==null?void 0:L0.totalReturnPureProvinceCarcassesPrice))==null?void 0:b0.toLocaleString()]]}),d()!=="KillHouse"&&u.jsx(E6,{noPagination:!0,title:"سهم بندی",columns:["ردیف","سهم","تعرفه فروش مرغ زنده به خارج استان (ریال)",`${(($0=e==null?void 0:e.wageInfo)==null?void 0:$0.wageCountingType)==="live"?"تعرفه کشتار داخل استان (ریال)":" تعرفه توزیع لاشه داخل استان (ریال)"}`,"تعرفه توزیع لاشه خارج استان (ریال)","تعرفه لاشه ورودی به استان (ریال)","تعرفه مرغ زنده ورودی به استان (ریال)","تعرفه کل (ریال)","تعرفه پرداخت شده (ریال)","تعرفه پرداخت نشده (ریال)"],data:p})]}),u.jsx(f,{container:!0,justifyContent:"center",xs:12,mt:2,mb:2,children:u.jsx(E6,{noPagination:!0,title:"مبنای تعرفه به ازای هر کیلوگرم (ریال)",columns:["تعرفه پایه فروش مرغ زنده به خارج استان",`${((T0=e==null?void 0:e.wageInfo)==null?void 0:T0.wageCountingType)==="live"?"تعرفه کشتار داخل استان (ریال)":"تعرفه پایه توزیع لاشه درون استان (ریال)"}`,"تعرفه پایه توزیع لاشه خارج استان (ریال)","تعرفه پایه خرید مرغ زنده از خارج از استان (ریال)","تعرفه پایه خرید لاشه خارج از استان (ریال)","وزن خریدهای بازگشتی (کیلوگرم)","تعرفه خریدهای بازگشتی (ریال)"],data:[[(k0=(I0=e==null?void 0:e.wageInfo)==null?void 0:I0.outProvincePoultryRequestWageAmount)==null?void 0:k0.toLocaleString(),(M0=(_0=e==null?void 0:e.wageInfo)==null?void 0:_0.provinceLiveWageAmount)==null?void 0:M0.toLocaleString(),(R0=(D0=e==null?void 0:e.wageInfo)==null?void 0:D0.freeSellCarcessesWeightAmount)==null?void 0:R0.toLocaleString(),(P0=(Y0=e==null?void 0:e.wageInfo)==null?void 0:Y0.freeBuyingLiveWeightAmount)==null?void 0:P0.toLocaleString(),(z0=(W0=e==null?void 0:e.wageInfo)==null?void 0:W0.freeBuyingCarcessesWeightAmount)==null?void 0:z0.toLocaleString(),(H0=(K0=e==null?void 0:e.wageInfo)==null?void 0:K0.returnTotalProvinceLiveWeight)==null?void 0:H0.toLocaleString(),(v0=(q0=e==null?void 0:e.wageInfo)==null?void 0:q0.totalReturnPureProvinceCarcassesPrice)==null?void 0:v0.toLocaleString()]]})}),u.jsx(f,{container:!0,justifyContent:"center",xs:12,mt:1,children:u.jsx(E6,{noPagination:d()==="KillHouse",paginated:d()!=="KillHouse",title:"جزئیات",columns:d()==="KillHouse"?V():C(),data:d()==="KillHouse"?S():g})}),d()==="KillHouse"&&u.jsxs(Oe,{style:{width:"100%",marginTop:"20px"},children:[u.jsx(Be,{expandIcon:u.jsx(Sa,{}),"aria-controls":"panel1-content",id:"panel1-header",children:u.jsx(Wu,{variant:"body1",style:{color:"gray"},children:"کشتارکن ها"})}),u.jsx(me,{children:u.jsx(f,{container:!0,justifyContent:"center",xs:12,mt:1,children:u.jsx(E6,{paginated:!0,columns:((U0=e==null?void 0:e.wageInfo)==null?void 0:U0.wageCountingType)==="live"?["نام کشتارکن","کل تعرفه (ریال)","کل تعرفه پرداخت شده (ریال)","تخفیف (ریال)","کل تعرفه پرداخت نشده (ریال)","لینک پرداخت","کل وزن زنده کشتار داخل استان (کیلوگرم)","تعرفه کشتار داخل استان (ریال)","وزن توزیع لاشه به خارج استان (کیلوگرم)","تعرفه توزیع لاشه خارج استان (ریال)","وزن لاشه ورودی به استان (کیلوگرم)","تعرفه لاشه ورودی به استان (ریال)","وزن مرغ زنده ورودی به استان (کیلوگرم)","تعرفه مرغ زنده ورودی به استان (ریال)"]:["نام کشتارکن","کل تعرفه (ریال)","کل تعرفه پرداخت شده (ریال)","تخفیف (ریال)","کل تعرفه پرداخت نشده (ریال)","لینک پرداخت","کل وزن زنده کشتار داخل استان (کیلوگرم)","وزن لاشه کشتار داخل استان (کیلوگرم)","وزن توزیع لاشه داخل استان (کیلوگرم)","تعرفه توزیع لاشه داخل استان (ریال)","وزن توزیع لاشه به خارج استان (کیلوگرم)","تعرفه توزیع لاشه خارج استان (ریال)","وزن لاشه ورودی به استان (کیلوگرم)","تعرفه لاشه ورودی به استان (ریال)","وزن مرغ زنده ورودی به استان (کیلوگرم)","تعرفه مرغ زنده ورودی به استان (ریال)"],data:y})})})]})]})},ba=()=>{const t=G6(),[y,x]=c.useState([]),[p,T]=c.useState(0),[g,_]=c.useState(10),[E,I]=c.useState(!1),l=Ru(r=>r.userSlice.userProfile.key),[b,w]=c.useState(""),[P,v]=c.useState([]),[M,D]=c.useState(1),$=m6(),k=r=>{w(r.target.value)},[,,e,z,W,V]=c.useContext(ju);c.useEffect(()=>{const r=H(new Date).format("YYYY-MM-DD");z(r),V(r)},[]);const C=async r=>{let A;$(v6()),A=await K.get(`kill_house_total_transactions_wage/?search=filter&value=${b}&type=paid&page=${r}&role=${d()}&page_size=${g}${E?`&date1=${e}&date2=${W}`:""}`),$(U6()),x(A.data.results),T(A.data.count)},S=r=>{C(r),D(r)},n=r=>{_(r),D(1)};c.useEffect(()=>{C(1)},[]);const s=async r=>{r.preventDefault(),$(v6());try{const A=await K.get(`kill_house_total_transactions_wage/?search=filter&value=${b}&role=${d()}&type=paid${E?`&date1=${e}&date2=${W}`:""}`);x(A.data.results),T(A.data.count),$(U6())}catch(A){console.error("Error fetching data:",A)}};return c.useEffect(()=>{C(1)},[e,W,E]),c.useEffect(()=>{const r=y==null?void 0:y.map((A,h)=>{var L,U,J,ku,Fu,_u,Mu,Du;return[M===1?h+1:h+g*(M-1)+1,`${(L=A==null?void 0:A.info)!=null&&L.killer?"کشتارکن":"کشتارگاه"} ${(U=A==null?void 0:A.info)==null?void 0:U.killHouseName} - ${(J=A==null?void 0:A.info)==null?void 0:J.killHouseFullname} (${(ku=A==null?void 0:A.info)==null?void 0:ku.killHouseMobile})`,`${(Fu=A==null?void 0:A.info)==null?void 0:Fu.killHouseCity}`,(_u=A==null?void 0:A.info)==null?void 0:_u.totalPaidCount,(Du=(Mu=A==null?void 0:A.info)==null?void 0:Mu.totalPaidWage)==null?void 0:Du.toLocaleString(),u.jsx(T6,{size:"small",color:"success",onClick:()=>{t(d()==="ProvinceOperator"?`${Z6}/kill_house_key/${A.key}`:d()==="SuperAdmin"?`${O6}/kill_house_key/${A.key}`:d()==="AdminX"?`${B6}/kill_house_key/${A.key}`:d()==="Commerce"?`${sa}/kill_house_key/${A.key}`:"-")},children:u.jsx(Ce,{fontSize:"small"})},h)]});v(r)},[y]),u.jsxs(f,{container:!0,justifyContent:"end",children:[u.jsx(f,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,width:"100%",children:u.jsxs(f,{container:!0,alignItems:"center",gap:Iu.SMALL,children:[u.jsxs(f,{container:!0,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},children:[u.jsx(f,{children:u.jsx(N6,{control:u.jsx(w6,{checked:E,onChange:()=>I(!E),color:"primary"})})}),u.jsx(f,{children:u.jsx(G,{disabled:!E,label:"از تاریخ",id:"date",renderInput:r=>u.jsx(N,{size:"small",style:{width:"160px"},...r}),value:e,onChange:r=>{z(H(r).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(G,{disabled:!E,label:"تا تاریخ",id:"date",renderInput:r=>u.jsx(N,{size:"small",style:{width:"160px"},...r}),value:W,onChange:r=>{V(H(r).format("YYYY-MM-DD"))}})})]}),u.jsxs("form",{onSubmit:s,children:[u.jsx(N,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:k}),u.jsx(X,{type:"submit",onClick:s,endIcon:u.jsx(b6,{}),children:"جستجو"})]}),u.jsx(I6,{title:"خروجی اکسل",children:u.jsx("a",{href:`${K.defaults.baseURL}kill_house_total_transactions_wage_payid_excel/?key=${l}&search=filter&value=${b}${E?`&date1=${e}&date2=${W}`:""}&role=${d()}`,rel:"noreferrer",children:u.jsx(X,{color:"success",children:u.jsx(V6,{size:32})})})})]})}),u.jsx(E6,{data:P,columns:["ردیف","خریدار","شهر","تعداد تراکنش","مبلغ (﷼)","جزییات سفارش"],handlePageChange:S,totalRows:p,page:M,perPage:g,handlePerRowsChange:n,title:"پرداختی های کشتارگاه ها"})]})},$a=()=>{const t=Ru(n=>n.userSlice.authToken),y=G6(),[x,p]=c.useState([]),[T,g]=c.useState(!1),[_,E]=c.useState(0),[I,l]=c.useState(10),[b,w]=c.useState(!1),[P,v]=c.useState(""),M=n=>{v(n.target.value)},[,,D,$,k,e]=c.useContext(ju);c.useEffect(()=>{const n=H(new Date).format("YYYY-MM-DD");$(n),e(n)},[]);const z=async(n,s)=>{g(!0);const r=await K.get(`chain-company-total-transactions/?search=filter&value=${s}&type=paid&page=${n}&role=${d()}&page_size=${I}${b?`&date1=${D}&date2=${k}`:""}`);p(r.data.results),E(r.data.count),g(!1)},W=n=>{z(n,P)},V=async(n,s)=>{g(!0);const r=await K.get(`chain-company-total-transactions/?search=filter&value=${P}&type=paid&page=${s}&role=${d()}&page_size=${n}${b?`&date1=${D}&date2=${k}`:""}`);p(r.data.results),E(r.data.count),l(n),g(!1)};c.useEffect(()=>{z(1)},[]);const C=async n=>{n.preventDefault(),g(!0);try{const s=await K.get(`chain-company-total-transactions/?search=filter&value=${P}&role=${d()}&type=paid${b?`&date1=${D}&date2=${k}`:""}`);p(s.data.results),E(s.data.count)}catch(s){console.error("Error fetching data:",s)}finally{g(!1)}};c.useEffect(()=>{z(1)},[D,k,b]);const S=[{name:"خریدار",selector:n=>{var s,r,A;return`${(s=n==null?void 0:n.info)==null?void 0:s.company} - ${(r=n==null?void 0:n.info)==null?void 0:r.companyUserFullname} (${(A=n==null?void 0:n.info)==null?void 0:A.companyUserMobile})`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"شهر",selector:n=>{var s;return`${(s=n==null?void 0:n.info)==null?void 0:s.companyUserCity}`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"تعداد تراکنش",selector:n=>{var s;return(s=n==null?void 0:n.info)==null?void 0:s.totalPaidCount},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"سهم شما از واریزی (﷼)",selector:n=>{var s,r;return(r=(s=n==null?void 0:n.info)==null?void 0:s.totalPaidWage)==null?void 0:r.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"جزییات سفارش",selector:n=>u.jsx(X,{onClick:()=>{y(d()==="ProvinceOperator"?`${Z6}/chain_company_key/${n.key}`:d()==="SuperAdmin"?`${O6}/chain_company_key/${n.key}`:d()==="AdminX"?`${B6}/chain_company_key/${n.key}`:"-")},children:"مشاهده"}),sortable:!0,wrap:!0,allowOverflow:!0,center:!0}];return u.jsx(f,{container:!0,justifyContent:"end",children:u.jsx(J6,{title:u.jsx(f,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,width:"100%",children:u.jsxs(f,{container:!0,alignItems:"center",gap:Iu.SMALL,children:[u.jsx(Wu,{children:"پرداختی های شرکت های زنجیره"}),u.jsxs(f,{container:!0,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},children:[u.jsx(f,{children:u.jsx(N6,{control:u.jsx(w6,{checked:b,onChange:()=>w(!b),color:"primary"})})}),u.jsx(f,{children:u.jsx(G,{disabled:!b,label:"از تاریخ",id:"date",renderInput:n=>u.jsx(N,{size:"small",style:{width:"160px"},...n}),value:D,onChange:n=>{$(H(n).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(G,{disabled:!b,label:"تا تاریخ",id:"date",renderInput:n=>u.jsx(N,{size:"small",style:{width:"160px"},...n}),value:k,onChange:n=>{e(H(n).format("YYYY-MM-DD"))}})})]}),u.jsxs("form",{onSubmit:C,children:[u.jsx(N,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:M}),u.jsx(X,{type:"submit",onClick:C,endIcon:u.jsx(b6,{}),children:"جستجو"})]}),u.jsx(I6,{title:"خروجی اکسل",children:u.jsx("a",{href:`${K.defaults.baseURL}chain-company-total-transactions_not_payid_excel/?token=${t}${P}${b?`&date1=${D}&date2=${k}`:""}`,rel:"noreferrer",children:u.jsx(X,{color:"success",children:u.jsx(V6,{size:32})})})})]})}),columns:S,data:x,progressPending:T,pagination:!0,paginationServer:!0,paginationTotalRows:_,onChangeRowsPerPage:V,onChangePage:W})})},Ta=()=>{const t=Ru(n=>n.userSlice.authToken),y=G6(),[x,p]=c.useState([]),[T,g]=c.useState(!1),[_,E]=c.useState(0),[I,l]=c.useState(10),[b,w]=c.useState(!1),[P,v]=c.useState(""),M=n=>{v(n.target.value)},[,,D,$,k,e]=c.useContext(ju);c.useEffect(()=>{const n=H(new Date).format("YYYY-MM-DD");$(n),e(n)},[]);const z=async(n,s)=>{g(!0);const r=await K.get(`kill_house_total_wage/?search=filter&value=${s}&type=unpaid&page=${n}&role=${d()}&page_size=${I}${b?`&date1=${D}&date2=${k}`:""}`);p(r.data.results),E(r.data.count),g(!1)},W=n=>{z(n,P)},V=async(n,s)=>{g(!0);const r=await K.get(`kill_house_total_wage/?search=filter&value=${P}&type=unpaid&page=${s}&role=${d()}&page_size=${n}${b?`&date1=${D}&date2=${k}`:""}`);p(r.data.results),E(r.data.count),l(n),g(!1)};c.useEffect(()=>{z(1)},[]);const C=async n=>{n.preventDefault(),g(!0);try{const s=await K.get(`kill_house_total_wage/?search=filter&value=${P}&type=unpaid${b?`&date1=${D}&date2=${k}`:""}`);p(s.data.results),E(s.data.count)}catch(s){console.error("Error fetching data:",s)}finally{g(!1)}};c.useEffect(()=>{z(1)},[D,k,b]);const S=[{name:"خریدار",selector:n=>{var r,A,h,L;return`${(r=n==null?void 0:n.info)!=null&&r.killer?"کشتارکن":"کشتارگاه"} ${(A=n==null?void 0:n.info)==null?void 0:A.killHouseName} - ${(h=n==null?void 0:n.info)==null?void 0:h.killHouseFullname} (${(L=n==null?void 0:n.info)==null?void 0:L.killHouseMobile})`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"شهر",selector:n=>{var s;return`${(s=n==null?void 0:n.info)==null?void 0:s.killHouseCity}`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"تعداد پرونده",selector:n=>{var s,r;return(r=(s=n==null?void 0:n.info)==null?void 0:s.totalCount)==null?void 0:r.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"حجم",selector:n=>{var s,r;return(r=(s=n.info)==null?void 0:s.totalQuantity)==null?void 0:r.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"وزن سفارشات (کیلوگرم)",selector:n=>{var s,r;return(r=(s=n.info)==null?void 0:s.totalWeight)==null?void 0:r.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"مبلغ تعرفه (﷼)",selector:n=>{var s,r;return(r=(s=n==null?void 0:n.info)==null?void 0:s.totalWage)==null?void 0:r.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"جزییات سفارش",selector:n=>u.jsx(X,{onClick:()=>{y(`${d()==="SuperAdmin"?O6:d()==="AdminX"?B6:Z6}/unpaid/${n.key}`)},children:"مشاهده"}),sortable:!0,wrap:!0,allowOverflow:!0,center:!0}];return u.jsx(f,{container:!0,justifyContent:"end",children:u.jsx(J6,{title:u.jsx(f,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,width:"100%",children:u.jsxs(f,{container:!0,alignItems:"center",gap:Iu.SMALL,children:[u.jsx(Wu,{children:"تعرفه های پرداخت نشده"}),u.jsxs(f,{container:!0,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},children:[u.jsx(f,{children:u.jsx(N6,{control:u.jsx(w6,{checked:b,onChange:()=>w(!b),color:"primary"})})}),u.jsx(f,{children:u.jsx(G,{disabled:!b,label:"از تاریخ",id:"date",renderInput:n=>u.jsx(N,{size:"small",style:{width:"160px"},...n}),value:D,onChange:n=>{$(H(n).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(G,{disabled:!b,label:"تا تاریخ",id:"date",renderInput:n=>u.jsx(N,{size:"small",style:{width:"160px"},...n}),value:k,onChange:n=>{e(H(n).format("YYYY-MM-DD"))}})})]}),u.jsxs("form",{onSubmit:C,children:[u.jsx(N,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:M}),u.jsx(X,{type:"submit",onClick:C,endIcon:u.jsx(b6,{}),children:"جستجو"})]}),u.jsx(I6,{title:"خروجی اکسل",children:u.jsx("a",{href:`${K.defaults.baseURL}kill_house_total_wage_excel/?token=${t}${P}${b?`&date1=${D}&date2=${k}`:""}`,rel:"noreferrer",children:u.jsx(X,{color:"success",children:u.jsx(V6,{size:32})})})})]})}),columns:S,data:x,progressPending:T,pagination:!0,paginationServer:!0,paginationTotalRows:_,onChangeRowsPerPage:V,onChangePage:W})})},Ia=()=>{const t=Ru(r=>r.userSlice.authToken),[,,y,x,p,T]=c.useContext(ju),g=m6();c.useEffect(()=>{const r=H(new Date).format("YYYY-MM-DD");x(r),T(r)},[]);const _=G6(),E=r=>{k(r.target.value)},[I,l]=c.useState(!1),[b,w]=c.useState([]),[P,v]=c.useState(0),[M,D]=c.useState(10),[$,k]=c.useState(""),[e,z]=c.useState(1),[W,V]=c.useState([]),C=async r=>{let A;g(v6()),A=await K.get(`kill-house-request-total-wage/?search=filter&value=${$}&page=${r}&role=${d()}&page_size=${M}${I?`&date1=${y}&date2=${p}`:""}`),g(U6()),w(A.data.results),v(A.data.count)},S=r=>{C(r),z(r)},n=r=>{D(r),z(1)};c.useEffect(()=>{const r=b==null?void 0:b.map((A,h)=>{var U,J,ku,Fu,_u,Mu,Du,zu,Ku,Hu,qu;const L=(U=A==null?void 0:A.info)!=null&&U.killer?"کشتارکن":"کشتارگاه";return[e===1?h+1:h+M*(e-1)+1,`${L} ${(J=A==null?void 0:A.info)==null?void 0:J.killHouseName} - ${(ku=A==null?void 0:A.info)==null?void 0:ku.killHouseFullname} (${(Fu=A==null?void 0:A.info)==null?void 0:Fu.killHouseMobile})`,(_u=A==null?void 0:A.info)==null?void 0:_u.killHouseCity,(Du=(Mu=A==null?void 0:A.info)==null?void 0:Mu.totalCount)==null?void 0:Du.toLocaleString(),(Ku=(zu=A.info)==null?void 0:zu.totalQuantity)==null?void 0:Ku.toLocaleString(),(qu=(Hu=A.info)==null?void 0:Hu.totalWeight)==null?void 0:qu.toLocaleString(),u.jsx(T6,{size:"small",color:"success",onClick:()=>{_(`${d()==="SuperAdmin"?O6:d()==="AdminX"?B6:Z6}/daily_bar/${A.key}`)},children:u.jsx(Ce,{fontSize:"small"})},h)]});V(r)},[b]),c.useEffect(()=>{C(1)},[g,y,p,M]);const s=async r=>{r.preventDefault(),g(v6());try{const A=await K.get(`kill-house-request-total-wage/?search=filter&value=${$}${I?`&date1=${y}&date2=${p}`:""}`);w(A.data.results),v(A.data.count),g(U6())}catch(A){console.error("Error fetching data:",A)}};return u.jsxs(f,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(f,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsxs(f,{container:!0,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},children:[u.jsx(f,{children:u.jsx(N6,{control:u.jsx(w6,{checked:I,onChange:()=>l(!I),color:"primary"})})}),u.jsx(f,{children:u.jsx(G,{disabled:!I,label:"از تاریخ",id:"date",renderInput:r=>u.jsx(N,{size:"small",style:{width:"160px"},...r}),value:y,onChange:r=>{x(H(r).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(G,{disabled:!I,label:"تا تاریخ",id:"date",renderInput:r=>u.jsx(N,{size:"small",style:{width:"160px"},...r}),value:p,onChange:r=>{T(H(r).format("YYYY-MM-DD"))}})})]}),u.jsx(f,{children:u.jsxs("form",{onSubmit:s,children:[u.jsx(N,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:E}),u.jsx(X,{type:"submit",onClick:s,endIcon:u.jsx(b6,{}),children:"جستجو"})]})}),u.jsx(I6,{title:"خروجی اکسل",children:u.jsx("a",{href:`${K.defaults.baseURL}kill_house_total_wage_excel/?token=${t}${$}${I?`&date1=${y}&date2=${p}`:""}`,rel:"noreferrer",children:u.jsx(X,{color:"success",children:u.jsx(V6,{size:32})})})})]}),u.jsx(E6,{data:W,columns:["ردیف","خریدار","شهر","تعداد پرونده","حجم","وزن سفارشات (کیلوگرم)","جزییات سفارش"],handlePageChange:S,totalRows:P,page:e,perPage:M,handlePerRowsChange:n,title:"بارهای روزانه"})]})},qe=({type:t})=>{const y=Ru(s=>s.userSlice.authToken),x=G6(),[p,T]=c.useState([]),[g,_]=c.useState(!1),[E,I]=c.useState(0),[l,b]=c.useState(10),[w,P]=c.useState(!1),[v,M]=c.useState(""),D=s=>{M(s.target.value)},[,,$,k,e,z]=c.useContext(ju);c.useEffect(()=>{const s=H(new Date).format("YYYY-MM-DD");k(s),z(s)},[]);const W=async(s,r)=>{_(!0);const A=await K.get(`kill_house_free_bar_total_wage/?search=filter&value=${r}&type=${t==="live_chicken"?"live":"carcass"}&page=${s}&role=${d()}&page_size=${l}${w?`&date1=${$}&date2=${e}`:""}`);T(A.data.results),I(A.data.count),_(!1)},V=s=>{W(s,v)},C=async(s,r)=>{_(!0);const A=await K.get(`kill_house_free_bar_total_wage/?search=filter&value=${v}&type=${t==="live_chicken"?"live":"carcass"}&page=${r}&role=${d()}&page_size=${s}${w?`&date1=${$}&date2=${e}`:""}`);T(A.data.results),I(A.data.count),b(s),_(!1)};c.useEffect(()=>{W(1)},[]);const S=async s=>{s.preventDefault(),_(!0);try{const r=await K.get(`kill_house_free_bar_total_wage/?search=filter&value=${v}&type=${t==="live_chicken"?"live":"carcass"}${w?`&date1=${$}&date2=${e}`:""}`);T(r.data.results),I(r.data.count)}catch(r){console.error("Error fetching data:",r)}finally{_(!1)}};c.useEffect(()=>{W(1)},[$,e,w]);const n=[{name:"خریدار",selector:s=>{var A,h,L,U;return`${(A=s==null?void 0:s.info)!=null&&A.killer?"کشتارکن":"کشتارگاه"} ${(h=s==null?void 0:s.info)==null?void 0:h.killHouseName} - ${(L=s==null?void 0:s.info)==null?void 0:L.killHouseFullname} (${(U=s==null?void 0:s.info)==null?void 0:U.killHouseMobile})`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"شهر",selector:s=>{var r;return`${(r=s==null?void 0:s.info)==null?void 0:r.killHouseCity}`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"تعداد پرونده",selector:s=>{var r,A;return(A=(r=s==null?void 0:s.info)==null?void 0:r.totalCount)==null?void 0:A.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"حجم",selector:s=>{var r,A;return(A=(r=s.info)==null?void 0:r.totalQuantity)==null?void 0:A.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"وزن سفارشات (کیلوگرم)",selector:s=>{var r,A;return(A=(r=s.info)==null?void 0:r.totalWeight)==null?void 0:A.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"مبلغ کل",selector:s=>{var r,A;return`${(A=(r=s.info)==null?void 0:r.totalWage)==null?void 0:A.toLocaleString()} ریال`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"جزییات سفارش",selector:s=>u.jsx(X,{onClick:()=>{x(`${d()==="SuperAdmin"?O6:d()==="AdminX"?B6:Z6}/${t}/${s.key}`)},children:"مشاهده"}),sortable:!0,wrap:!0,allowOverflow:!0,center:!0}];return u.jsx(f,{container:!0,justifyContent:"end",children:u.jsx(J6,{title:u.jsx(f,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,width:"100%",children:u.jsxs(f,{container:!0,alignItems:"center",gap:Iu.SMALL,children:[u.jsxs(Wu,{children:["خرید ",t==="live_chicken"?"مرغ زنده":"لاشه"," آزاد"]}),u.jsxs(f,{container:!0,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},children:[u.jsx(f,{children:u.jsx(N6,{control:u.jsx(w6,{checked:w,onChange:()=>P(!w),color:"primary"})})}),u.jsx(f,{children:u.jsx(G,{disabled:!w,label:"از تاریخ",id:"date",renderInput:s=>u.jsx(N,{size:"small",style:{width:"160px"},...s}),value:$,onChange:s=>{k(H(s).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(G,{disabled:!w,label:"تا تاریخ",id:"date",renderInput:s=>u.jsx(N,{size:"small",style:{width:"160px"},...s}),value:e,onChange:s=>{z(H(s).format("YYYY-MM-DD"))}})})]}),u.jsxs("form",{onSubmit:S,children:[u.jsx(N,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:D}),u.jsx(X,{type:"submit",onClick:S,endIcon:u.jsx(b6,{}),children:"جستجو"})]}),u.jsx(I6,{title:"خروجی اکسل",children:u.jsx("a",{href:`${K.defaults.baseURL}kill_house_total_wage_excel/?token=${y}${v}${w?`&date1=${$}&date2=${e}`:""}`,rel:"noreferrer",children:u.jsx(X,{color:"success",children:u.jsx(V6,{size:32})})})})]})}),columns:n,data:p,progressPending:g,pagination:!0,paginationServer:!0,paginationTotalRows:E,onChangeRowsPerPage:C,onChangePage:V})})},ka=()=>{const t=Ru(n=>n.userSlice.authToken),y=G6(),[x,p]=c.useState([]),[T,g]=c.useState(!1),[_,E]=c.useState(0),[I,l]=c.useState(10),[b,w]=c.useState(!1),[P,v]=c.useState(""),M=n=>{v(n.target.value)},[,,D,$,k,e]=c.useContext(ju);c.useEffect(()=>{const n=H(new Date).format("YYYY-MM-DD");$(n),e(n)},[]);const z=async(n,s)=>{g(!0);const r=await K.get(`chain-company-total-allocations/?search=filter&value=${s}&type=live&page=${n}&role=${d()}&page_size=${I}${b?`&date1=${D}&date2=${k}`:""}`);p(r.data.results),E(r.data.count),g(!1)},W=n=>{z(n,P)},V=async(n,s)=>{g(!0);const r=await K.get(`chain-company-total-allocations/?search=filter&value=${P}&type=live&page=${s}&role=${d()}&page_size=${n}${b?`&date1=${D}&date2=${k}`:""}`);p(r.data.results),E(r.data.count),l(n),g(!1)};c.useEffect(()=>{z(1)},[]);const C=async n=>{n.preventDefault(),g(!0);try{const s=await K.get(`chain-company-total-allocations/?search=filter&value=${P}&type=live${b?`&date1=${D}&date2=${k}`:""}`);p(s.data.results),E(s.data.count)}catch(s){console.error("Error fetching data:",s)}finally{g(!1)}};c.useEffect(()=>{z(1)},[D,k,b]);const S=[{name:"شرکت زنجیره",selector:n=>{var s;return`${(s=n==null?void 0:n.info)==null?void 0:s.company}`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"تعداد پرونده",selector:n=>{var s,r;return(r=(s=n==null?void 0:n.info)==null?void 0:s.totalCount)==null?void 0:r.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"حجم",selector:n=>{var s,r;return(r=(s=n.info)==null?void 0:s.totalQuantity)==null?void 0:r.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"وزن سفارشات (کیلوگرم)",selector:n=>{var s,r;return(r=(s=n.info)==null?void 0:s.totalWeight)==null?void 0:r.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"مبلغ کل",selector:n=>{var s,r;return`${(r=(s=n.info)==null?void 0:s.totalWage)==null?void 0:r.toLocaleString()} ریال`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"جزییات سفارش",selector:n=>u.jsx(X,{onClick:()=>{y(`${d()==="SuperAdmin"?O6:d()==="AdminX"?B6:Z6}/chain/${n.key}`)},children:"مشاهده"}),sortable:!0,wrap:!0,allowOverflow:!0,center:!0}];return u.jsx(f,{container:!0,justifyContent:"end",children:u.jsx(J6,{title:u.jsx(f,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,width:"100%",children:u.jsxs(f,{container:!0,alignItems:"center",gap:Iu.SMALL,children:[u.jsx(Wu,{children:"زنجیره ها"}),u.jsxs(f,{container:!0,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},children:[u.jsx(f,{children:u.jsx(N6,{control:u.jsx(w6,{checked:b,onChange:()=>w(!b),color:"primary"})})}),u.jsx(f,{children:u.jsx(G,{disabled:!b,label:"از تاریخ",id:"date",renderInput:n=>u.jsx(N,{size:"small",style:{width:"160px"},...n}),value:D,onChange:n=>{$(H(n).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(G,{disabled:!b,label:"تا تاریخ",id:"date",renderInput:n=>u.jsx(N,{size:"small",style:{width:"160px"},...n}),value:k,onChange:n=>{e(H(n).format("YYYY-MM-DD"))}})})]}),u.jsxs("form",{onSubmit:C,children:[u.jsx(N,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:M}),u.jsx(X,{type:"submit",onClick:C,endIcon:u.jsx(b6,{}),children:"جستجو"})]}),u.jsx(I6,{title:"خروجی اکسل",children:u.jsx("a",{href:`${K.defaults.baseURL}kill_house_total_wage_excel/?token=${t}${P}${b?`&date1=${D}&date2=${k}`:""}`,rel:"noreferrer",children:u.jsx(X,{color:"success",children:u.jsx(V6,{size:32})})})})]})}),columns:S,data:x,progressPending:T,pagination:!0,paginationServer:!0,paginationTotalRows:_,onChangeRowsPerPage:V,onChangePage:W})})},_a=({item:t})=>{const[y,x]=c.useState([]);return c.useEffect(()=>{var T;const p=(T=t==null?void 0:t.killHouseRequests)==null?void 0:T.map(g=>{var I,l,b,w,P,v,M,D,$,k,e,z,W,V,C,S,n,s,r,A,h,L;const _=(b=(l=(I=g==null?void 0:g.vetFarm)==null?void 0:I.vet)==null?void 0:l.user)!=null&&b.fullname?((v=(P=(w=g==null?void 0:g.vetFarm)==null?void 0:w.vet)==null?void 0:P.user)==null?void 0:v.fullname)+`(${($=(D=(M=g==null?void 0:g.vetFarm)==null?void 0:M.vet)==null?void 0:D.user)==null?void 0:$.mobile})`:"فاقد دامپزشک";let E="";return g.vetState==="accepted"?E="تایید تخلیه":g.vetState==="pending"&&(E="در انتظار تخلیه"),[g.barCode,`${(k=g.killhouseUser)==null?void 0:k.name} (${(W=(z=(e=g.killhouseUser)==null?void 0:e.killHouseOperator)==null?void 0:z.user)==null?void 0:W.mobile})`,`${g.addCar.driver.typeCar} ${g.addCar.driver.pelak}`,`${g.addCar.driver.driverName} (${g.addCar.driver.driverMobile})`,g==null?void 0:g.trafficCode,g.poultryRequest.chickenBreed,(V=g.quantity)==null?void 0:V.toLocaleString(),(S=(C=g==null?void 0:g.weightInfo)==null?void 0:C.weight)==null?void 0:S.toLocaleString(),(s=(n=g==null?void 0:g.weightInfo)==null?void 0:n.indexWeight)==null?void 0:s.toLocaleString(),`${(A=(r=g.poultryRequest)==null?void 0:r.poultry)==null?void 0:A.unitName} (${(L=(h=g.poultryRequest.poultry)==null?void 0:h.user)==null?void 0:L.mobile})`,_,g!=null&&g.clearanceCode?g==null?void 0:g.clearanceCode:"-",g.killPlace,g.poultryRequest.poultry.address.city.name,g!=null&&g.poultryRequest.sendDate?ra(new Date(g==null?void 0:g.poultryRequest.sendDate),"yyyy/MM/dd"):"-",g==null?void 0:g.poultryRequest.orderCode,E]});x(p)},[t]),u.jsx(Ne,{columns:["کدبار","خریدار","ماشین","راننده","کدبهداشتی حمل و نقل","نژاد","تعداد","وزن بار","میانگین وزن","مرغدار","دامپزشک فارم","کدرهگیری سامانه قرنطینه","محل کشتار","شهر","تاریخ کشتار","کدسفارش کشتار","وضعیت"],data:y})},Qe=({killhouseKey:t})=>{var n,s,r,A;const[,,y,x,p,T]=c.useContext(ju),[g,_]=c.useState(!1);c.useEffect(()=>{const h=H(new Date).format("YYYY-MM-DD");x(h),T(h)},[]);const E=m6(),[I,l]=c.useState([]),[b,w]=c.useState(!1),[P,v]=c.useState(0),[M,D]=c.useState(10),[$,k]=c.useState(""),e=h=>{k(h.target.value)},z=async(h,L)=>{w(!0);const U=await K.get(`province_wage/?search=filter&value=${L}&page=${h}&page_size=${M}&type=unpaid&kill_house_key=${t}&role=${d()}${g?`&date1=${y}&date2=${p}`:""}`);l(U.data.results),v(U.data.count),w(!1)},W=h=>{z(h,$)},V=async(h,L)=>{w(!0);const U=await K.get(`province_wage/?search=filter&value=${$}&page=${L}&page_size=${h}&type=unpaid&kill_house_key=${t}&role=${d()}${g?`&date1=${y}&date2=${p}`:""}`);l(U.data.results),v(U.data.count),D(h),w(!1)};c.useEffect(()=>{z(1)},[]),c.useEffect(()=>{z(1)},[y,p,g]);const C=async h=>{h.preventDefault(),w(!0);try{const L=await K.get(`province_wage/?search=filter&value=${$}&type=unpaid&kill_house_key=${t}&role=${d()}&date1=${y}&date2=${p}`);l(L.data.results),v(L.data.count)}catch(L){console.error("Error fetching data:",L)}finally{w(!1)}},S=[{name:"کدسفارش",selector:h=>{var L;return(L=h==null?void 0:h.provinceRequest)==null?void 0:L.orderCode},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"مرغدار (تلفن)",selector:h=>{var L,U;return`${(L=h==null?void 0:h.provinceRequest)==null?void 0:L.poultryFullname} (${(U=h==null?void 0:h.provinceRequest)==null?void 0:U.poultryMobile})`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"شهر",selector:h=>{var L;return`${(L=h==null?void 0:h.provinceRequest)==null?void 0:L.poultryCity}`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"تاریخ کشتار",selector:h=>{var L;return ge((L=h==null?void 0:h.provinceRequest)==null?void 0:L.sendDate)},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"محل کشتار",selector:h=>{var L;return(L=h==null?void 0:h.provinceRequest)==null?void 0:L.killPlace},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"نژاد",selector:h=>{var L;return(L=h==null?void 0:h.provinceRequest)==null?void 0:L.breed},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"تعداد (قطعه)",selector:h=>{var L,U;return(U=(L=h==null?void 0:h.provinceRequest)==null?void 0:L.provinceKillRequestQuantity)==null?void 0:U.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"وزن (کیلوگرم)",selector:h=>{var L,U;return(U=(L=h==null?void 0:h.provinceRequest)==null?void 0:L.provinceKillRequestTotalWeight)==null?void 0:U.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"میانگین وزنی (کیلوگرم)",selector:h=>{var L;return(L=h==null?void 0:h.provinceRequest)==null?void 0:L.indexWeight},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"تعرفه اتحادیه (ریال)",selector:h=>{var L,U;return(U=(L=h==null?void 0:h.provinceRequest)==null?void 0:L.wage)==null?void 0:U.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"مبلغ تعرفه (ریال)",selector:h=>{var L,U;return(U=(L=h==null?void 0:h.provinceRequest)==null?void 0:L.totalAmount)==null?void 0:U.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"جزییات سفارش",selector:h=>u.jsx(X,{onClick:()=>{E(ca({top:!0,title:"جزییات سفارش",content:u.jsx(_a,{item:h})}))},children:"مشاهده"}),sortable:!0,wrap:!0,allowOverflow:!0,center:!0}];return u.jsx(f,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,width:"100%",children:u.jsx(f,{container:!0,alignItems:"center",gap:Iu.SMALL,children:u.jsx(J6,{title:u.jsx(f,{container:!0,alignItems:"center",justifyContent:"space-between",gap:1,paddingTop:2,mb:1,width:"100%",children:u.jsxs(f,{container:!0,xs:12,alignItems:"center",gap:2,children:[u.jsxs(Wu,{children:["تعرفه های پرداخت نشده"," ",((s=(n=I[0])==null?void 0:n.provinceRequest)==null?void 0:s.killHouseUserFullName)&&` ${(A=(r=I[0])==null?void 0:r.provinceRequest)==null?void 0:A.killHouseUserFullName}`]}),u.jsxs(f,{container:!0,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},children:[u.jsx(f,{children:u.jsx(N6,{control:u.jsx(w6,{checked:g,onChange:()=>_(!g),color:"primary"})})}),u.jsx(f,{children:u.jsx(G,{disabled:!g,label:"از تاریخ",id:"date",renderInput:h=>u.jsx(N,{size:"small",style:{width:"160px"},...h}),value:y,onChange:h=>{x(H(h).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(G,{disabled:!g,label:"تا تاریخ",id:"date",renderInput:h=>u.jsx(N,{size:"small",style:{width:"160px"},...h}),value:p,onChange:h=>{T(H(h).format("YYYY-MM-DD"))}})})]}),u.jsx(f,{container:!0,alignItems:"center",gap:Iu.SMALL,children:u.jsxs("form",{onSubmit:C,children:[u.jsx(N,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:e}),u.jsx(X,{type:"submit",onClick:C,children:"جستجو"})]})})]})}),columns:S,data:I,progressPending:b,pagination:!0,paginationServer:!0,paginationTotalRows:P,onChangeRowsPerPage:V,onChangePage:W})})})},Xe=({killhouseKey:t,type:y})=>{const[,,x,p,T,g]=c.useContext(ju),[_]=c.useContext(ju),E=Ru(S=>S.userSlice.userProfile.key);c.useEffect(()=>{const S=H(new Date).format("YYYY-MM-DD");p(S),g(S)},[]);const[I,l]=c.useState([]),[b,w]=c.useState(!1),[P,v]=c.useState(0),[M,D]=c.useState(10),[$,k]=c.useState(!1),[e,z]=c.useState(""),W=S=>{z(S.target.value)},V=async(S,n)=>{w(!0);const s=await K.get(`kill_house_request_bar_management_wage/?search=filter&value=${n}&page=${S}&page_size=${M}&type=paid&kill_house_key=${t}&role=${d()}&date1=${x}&date2=${T}`);l(s.data.results),v(s.data.count),w(!1)};c.useEffect(()=>{V(1)},[]),c.useEffect(()=>{V(1)},[x,T,M,$]);const C=async S=>{S.preventDefault(),w(!0);try{const n=await K.get(`kill_house_request_bar_management_wage/?search=filter&value=${e}&type=paid&kill_house_key=${t}&role=${d()}&date1=${x}&date2=${T}`);l(n.data.results),v(n.data.count)}catch(n){console.error("Error fetching data:",n)}finally{w(!1)}};return u.jsxs(f,{children:[u.jsxs(f,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,width:"100%",children:[u.jsx(Wu,{children:"بارها "}),u.jsxs(f,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(w6,{icon:u.jsx(ye,{}),checkedIcon:u.jsx(Ee,{}),checked:$,onChange:()=>k(!$),color:"primary",size:"large"}),u.jsx(f,{children:u.jsx(G,{disabled:!$,label:"از تاریخ",id:"date",renderInput:S=>u.jsx(N,{size:"small",style:{width:"160px"},...S}),value:x,onChange:S=>{p(H(S).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(G,{disabled:!$,label:"تا تاریخ",id:"date",renderInput:S=>u.jsx(N,{size:"small",style:{width:"160px"},...S}),value:T,onChange:S=>{g(H(S).format("YYYY-MM-DD"))}})})]}),u.jsx(f,{container:!0,alignItems:"center",gap:Iu.SMALL,children:u.jsxs("form",{onSubmit:C,children:[u.jsx(N,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:W}),u.jsx(X,{type:"submit",onClick:C,endIcon:u.jsx(b6,{}),children:"جستجو"})]})}),u.jsx(I6,{title:"خروجی اکسل",children:u.jsx(X,{color:"success",onClick:()=>{_({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const S=`${K.defaults.baseURL}kill_house_total_wage_excel_new/?date1=${x}&date2=${T}&role=KillHouse&search=filter&value=${e}&key=${E}`;window.location.href=S},children:u.jsx(V6,{size:32})})})]}),!1]})},fe=({killhouseKey:t,type:y})=>{const[,,x,p,T,g]=c.useContext(ju);c.useEffect(()=>{const C=H(new Date).format("YYYY-MM-DD");p(C),g(C)},[]);const[_,E]=c.useState([]),[I,l]=c.useState(!1),[b,w]=c.useState(0),[P,v]=c.useState(10),[M,D]=c.useState(""),$=C=>{D(C.target.value)},k=async(C,S)=>{l(!0);const n=await K.get(`kill_house_free_bar_wage_total/?search=filter&value=${S}&page=${C}&page_size=${P}&kill_house_key=${t}&role=${d()}&date1=${x}&date2=${T}&type=${y}`);E(n.data.results),w(n.data.count),l(!1)},e=C=>{k(C,M)},z=async(C,S)=>{l(!0);const n=await K.get(`kill_house_free_bar_wage_total/?search=filter&value=${M}&page=${S}&page_size=${C}&kill_house_key=${t}&role=${d()}&date1=${x}&date2=${T}&type=${y}`);E(n.data.results),w(n.data.count),v(C),l(!1)};c.useEffect(()=>{k(1)},[]),c.useEffect(()=>{k(1)},[x,T,P]);const W=async C=>{C.preventDefault(),l(!0);try{const S=await K.get(`kill_house_free_bar_wage_total/?search=filter&value=${M}&kill_house_key=${t}&role=${d()}&date1=${x}&date2=${T}&type=${y}`);E(S.data.results),w(S.data.count)}catch(S){console.error("Error fetching data:",S)}finally{l(!1)}},V=[{name:"نام خریدار",selector:C=>{var S,n,s,r,A,h;return`${(s=(n=(S=C.killHouse)==null?void 0:S.killHouseOperator)==null?void 0:n.user)==null?void 0:s.fullname} (${(h=(A=(r=C.killHouse)==null?void 0:r.killHouseOperator)==null?void 0:A.user)==null?void 0:h.mobile})`},sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"نام فروشنده",selector:C=>C==null?void 0:C.poultryName,sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"شهر",selector:C=>C==null?void 0:C.city,sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"تعداد",selector:C=>y==="live"?C==null?void 0:C.quantity.toLocaleString():C==null?void 0:C.numberOfCarcasses.toLocaleString(),sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"وزن",selector:C=>y==="live"?C==null?void 0:C.liveWeight.toLocaleString():C==null?void 0:C.weightOfCarcasses.toLocaleString(),sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"مبلغ کل",selector:C=>{var S;return(S=C==null?void 0:C.totalAmount)==null?void 0:S.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0}];return u.jsx(f,{children:u.jsx(J6,{title:u.jsxs(f,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,width:"100%",children:[u.jsxs(Wu,{children:["بارهای ",y==="live"?"مرغ زنده":"لاشه"]}),u.jsx(f,{children:u.jsx(G,{label:"از تاریخ",id:"date",renderInput:C=>u.jsx(N,{style:{width:"160px"},...C}),value:x,onChange:C=>{p(H(C).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(G,{label:"تا تاریخ",id:"date",renderInput:C=>u.jsx(N,{style:{width:"160px"},...C}),value:T,onChange:C=>{g(H(C).format("YYYY-MM-DD"))}})}),u.jsx(f,{container:!0,alignItems:"center",gap:Iu.SMALL,children:u.jsxs("form",{onSubmit:W,children:[u.jsx(N,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:$}),u.jsx(X,{type:"submit",onClick:W,endIcon:u.jsx(b6,{}),children:"جستجو"})]})})]}),columns:V,data:_,progressPending:I,pagination:!0,paginationServer:!0,paginationTotalRows:b,onChangeRowsPerPage:z,onChangePage:e})})},je=({killhouseKey:t,type:y})=>{const[,,x,p,T,g]=c.useContext(ju);c.useEffect(()=>{const C=H(new Date).format("YYYY-MM-DD");p(C),g(C)},[]);const[_,E]=c.useState([]),[I,l]=c.useState(!1),[b,w]=c.useState(0),[P,v]=c.useState(10),[M,D]=c.useState(""),$=C=>{D(C.target.value)},k=async(C,S)=>{l(!0);const n=await K.get(`chain-allocation-total-wage/?search=filter&value=${S}&page=${C}&page_size=${P}&type=paid&chain_company_key=${t}&role=${d()}&date1=${x}&date2=${T}`);E(n.data.results),w(n.data.count),l(!1)},e=C=>{k(C,M)},z=async(C,S)=>{l(!0);const n=await K.get(`chain-allocation-total-wage/?search=filter&value=${M}&page=${S}&page_size=${C}&type=paid&chain_company_key=${t}&role=${d()}&date1=${x}&date2=${T}`);E(n.data.results),w(n.data.count),v(C),l(!1)};c.useEffect(()=>{k(1)},[]),c.useEffect(()=>{k(1)},[x,T,P]);const W=async C=>{C.preventDefault(),l(!0);try{const S=await K.get(`chain-allocation-total-wage/?search=filter&value=${M}&type=paid&chain_company_key=${t}&role=${d()}&date1=${x}&date2=${T}`);E(S.data.results),w(S.data.count)}catch(S){console.error("Error fetching data:",S)}finally{l(!1)}},V=[{name:"ردیف",selector:(C,S)=>S+1,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"30px"},{name:"تاریخ ایجاد",selector:C=>ge(C==null?void 0:C.createDate),sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"auto"},{name:"مرغداری",selector:(C,S)=>{var n,s,r,A,h;return`${(s=(n=C==null?void 0:C.poultryHatching)==null?void 0:n.poultry)==null?void 0:s.unitName} (${(h=(A=(r=C==null?void 0:C.poultryHatching)==null?void 0:r.poultry)==null?void 0:A.user)==null?void 0:h.mobile})`},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"auto"},{name:"شرکت زنجیره",selector:(C,S)=>{var n,s;return`${(n=C==null?void 0:C.chainCompany)==null?void 0:n.name} (${(s=C==null?void 0:C.chainCompany)==null?void 0:s.user.mobile})`},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"auto"},{name:"کد قرنطینه",selector:(C,S)=>C!=null&&C.quarantineCode?C==null?void 0:C.quarantineCode:"-",sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"auto"},{name:"تعداد",selector:C=>C==null?void 0:C.quantity,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"auto"},{name:"وزن",selector:C=>C==null?void 0:C.weight,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"60px"}];return u.jsx(f,{children:u.jsx(J6,{title:u.jsxs(f,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,width:"100%",children:[u.jsx(Wu,{children:"سفارشات زنجیره"}),u.jsx(f,{children:u.jsx(G,{label:"از تاریخ",id:"date",renderInput:C=>u.jsx(N,{style:{width:"160px"},...C}),value:x,onChange:C=>{p(H(C).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(G,{label:"تا تاریخ",id:"date",renderInput:C=>u.jsx(N,{style:{width:"160px"},...C}),value:T,onChange:C=>{g(H(C).format("YYYY-MM-DD"))}})}),u.jsx(f,{container:!0,alignItems:"center",gap:Iu.SMALL,children:u.jsxs("form",{onSubmit:W,children:[u.jsx(N,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:$}),u.jsx(X,{type:"submit",onClick:W,endIcon:u.jsx(b6,{}),children:"جستجو"})]})})]}),columns:V,data:_,progressPending:I,pagination:!0,paginationServer:!0,paginationTotalRows:b,onChangeRowsPerPage:z,onChangePage:e})})},Ma=Ue("PROVINCE_PAYMENT_GET_KILLHOUSES",async(t,{dispatch:y})=>{try{y(v6());const{data:x,status:p}=await K.get("detail_general_killhouse_wage/",{params:{date1:t.withDate?t.selectedDate1:"null",date2:t.withDate?t.selectedDate2:"null",search:"filter",value:t.textValue,role:d()}});return y(U6()),{data:x,status:p}}catch(x){return y(U6()),{error:x.response.data}}}),Da=Ue("PROVINCE_GET_PAYMENT_DASHBOARD",async(t,{dispatch:y})=>{try{y(v6());const{data:x,status:p}=await K.get("dashboard_detail_general_killhouse_wage",{params:{date1:t.withDate?t.selectedDate1:"null",date2:t.withDate?t.selectedDate2:"null",role:d()}});return{data:x,status:p}}catch(x){return{error:x.response.data}}}),Ra=()=>{var v,M,D,$,k,e,z,W,V,C,S,n,s,r,A,h,L,U,J,ku,Fu,_u,Mu,Du,zu,Ku,Hu,qu,k6,_6,M6,D6,R6,Y6,P6,q,F,Yu,L6,Pu,vu,W6,Q6,z6,$6,u0,e0,a0,l0,t0,o0,n0,s0,r0,c0,C0,d0,g0,A0,i0,f0,h0,x0,p0,S0,j0,F0,y0,E0,w0,L0,b0,$0,T0,I0,k0,_0,M0,D0,R0,Y0,P0,W0,z0,K0,H0,q0,v0,U0,R,i,pu,o,au,lu,tu,ou,nu,su,ru,cu,Cu,Uu,Nu,Vu,Qu,Xu,Gu,Ju,Zu,Ou,Bu,mu,u6,e6,a6,l6,t6,o6,n6,s6,r6,c6,C6;const[t,y]=c.useState([]),x=m6(),[p,T]=c.useState(!1),[,,g,_,E,I]=c.useContext(ju);c.useEffect(()=>{const Q=H(new Date).format("YYYY-MM-DD");_(Q),I(Q)},[]);const[l,b]=c.useState([]);c.useEffect(()=>{x(Da({selectedDate1:g,selectedDate2:E,withDate:p})).then(Q=>{b(Q.payload.data)})},[g,E,p]);const w=()=>{x(Ma({selectedDate1:g,selectedDate2:E,withDate:p})).then(Q=>{var d6,g6,A6,i6,f6,h6,x6,p6;let yu=[];switch(d()){case"AdminX":yu=(g6=(d6=Q.payload)==null?void 0:d6.data)==null?void 0:g6.map((a,Su)=>{var Z,O,B,m,uu,eu,du,gu,Au,iu,fu,hu,xu,Eu,wu,Lu,bu,$u,Tu,S6,j6,F6,y6,K6,H6,N0,V0,Q0,X0,G0,J0,Z0,O0,B0,m0,ue,ee,ae,le,te,oe,ne,se,re,ce,$e,Te,Ie,ke,_e,Me;return[Su+1,(Z=a==null?void 0:a.info)==null?void 0:Z.type,(O=a==null?void 0:a.info)==null?void 0:O.killHouseName,(B=a==null?void 0:a.info)==null?void 0:B.fullname,(m=a==null?void 0:a.info)==null?void 0:m.mobile,(uu=a==null?void 0:a.info)==null?void 0:uu.city,(du=(eu=a==null?void 0:a.info)==null?void 0:eu.lenProvinceKillRequests)==null?void 0:du.toLocaleString(),(Au=(gu=a==null?void 0:a.info)==null?void 0:gu.totalKilledQuantity)==null?void 0:Au.toLocaleString(),(fu=(iu=a==null?void 0:a.info)==null?void 0:iu.totalKilledWeight)==null?void 0:fu.toLocaleString(),(xu=(hu=a==null?void 0:a.info)==null?void 0:hu.lenKillHouseRequests)==null?void 0:xu.toLocaleString(),(wu=(Eu=a==null?void 0:a.info)==null?void 0:Eu.acceptedRealQuantity)==null?void 0:wu.toLocaleString(),(bu=(Lu=a==null?void 0:a.info)==null?void 0:Lu.acceptedRealWeight)==null?void 0:bu.toLocaleString(),(Tu=($u=a==null?void 0:a.info)==null?void 0:$u.lenSlaughterTransactions)==null?void 0:Tu.toLocaleString(),(j6=(S6=a==null?void 0:a.info)==null?void 0:S6.off)==null?void 0:j6.toLocaleString(),(y6=(F6=a==null?void 0:a.info)==null?void 0:F6.totalWage)==null?void 0:y6.toLocaleString(),(H6=(K6=a==null?void 0:a.info)==null?void 0:K6.companyTotalWage)==null?void 0:H6.toLocaleString(),(V0=(N0=a==null?void 0:a.info)==null?void 0:N0.unionTotalWage)==null?void 0:V0.toLocaleString(),(X0=(Q0=a==null?void 0:a.info)==null?void 0:Q0.guildsTotalWage)==null?void 0:X0.toLocaleString(),(J0=(G0=a==null?void 0:a.info)==null?void 0:G0.otherTotalWage)==null?void 0:J0.toLocaleString(),(O0=(Z0=a==null?void 0:a.info)==null?void 0:Z0.notPaied)==null?void 0:O0.toLocaleString(),(m0=(B0=a==null?void 0:a.info)==null?void 0:B0.companyTotalUnpaidWage)==null?void 0:m0.toLocaleString(),(ee=(ue=a==null?void 0:a.info)==null?void 0:ue.unionTotalUnpaidWage)==null?void 0:ee.toLocaleString(),(le=(ae=a==null?void 0:a.info)==null?void 0:ae.guildsTotalUnpaidWage)==null?void 0:le.toLocaleString(),(oe=(te=a==null?void 0:a.info)==null?void 0:te.otherTotalUnpaidWage)==null?void 0:oe.toLocaleString(),(se=(ne=a==null?void 0:a.info)==null?void 0:ne.totalPaidWage)==null?void 0:se.toLocaleString(),(ce=(re=a==null?void 0:a.info)==null?void 0:re.unionTotalPaidWage)==null?void 0:ce.toLocaleString(),(Te=($e=a==null?void 0:a.info)==null?void 0:$e.companyTotalPaidWage)==null?void 0:Te.toLocaleString(),(ke=(Ie=a==null?void 0:a.info)==null?void 0:Ie.guildsTotalPaidWage)==null?void 0:ke.toLocaleString(),(Me=(_e=a==null?void 0:a.info)==null?void 0:_e.otherTotalPaidWage)==null?void 0:Me.toLocaleString()]});break;case"SuperAdmin":yu=(i6=(A6=Q.payload)==null?void 0:A6.data)==null?void 0:i6.map((a,Su)=>{var Z,O,B,m,uu,eu,du,gu,Au,iu,fu,hu,xu,Eu,wu,Lu,bu,$u,Tu,S6,j6,F6,y6,K6,H6,N0,V0,Q0,X0,G0,J0,Z0,O0,B0,m0,ue,ee,ae,le,te,oe,ne,se,re,ce;return[Su+1,(Z=a==null?void 0:a.info)==null?void 0:Z.type,(O=a==null?void 0:a.info)==null?void 0:O.killHouseName,(B=a==null?void 0:a.info)==null?void 0:B.fullname,(m=a==null?void 0:a.info)==null?void 0:m.mobile,(uu=a==null?void 0:a.info)==null?void 0:uu.city,(du=(eu=a==null?void 0:a.info)==null?void 0:eu.lenProvinceKillRequests)==null?void 0:du.toLocaleString(),(Au=(gu=a==null?void 0:a.info)==null?void 0:gu.totalKilledQuantity)==null?void 0:Au.toLocaleString(),(fu=(iu=a==null?void 0:a.info)==null?void 0:iu.totalKilledWeight)==null?void 0:fu.toLocaleString(),(xu=(hu=a==null?void 0:a.info)==null?void 0:hu.lenKillHouseRequests)==null?void 0:xu.toLocaleString(),(wu=(Eu=a==null?void 0:a.info)==null?void 0:Eu.acceptedRealQuantity)==null?void 0:wu.toLocaleString(),(bu=(Lu=a==null?void 0:a.info)==null?void 0:Lu.acceptedRealWeight)==null?void 0:bu.toLocaleString(),(Tu=($u=a==null?void 0:a.info)==null?void 0:$u.lenSlaughterTransactions)==null?void 0:Tu.toLocaleString(),(j6=(S6=a==null?void 0:a.info)==null?void 0:S6.off)==null?void 0:j6.toLocaleString(),(y6=(F6=a==null?void 0:a.info)==null?void 0:F6.totalWage)==null?void 0:y6.toLocaleString(),(H6=(K6=a==null?void 0:a.info)==null?void 0:K6.companyTotalWage)==null?void 0:H6.toLocaleString(),(V0=(N0=a==null?void 0:a.info)==null?void 0:N0.unionTotalWage)==null?void 0:V0.toLocaleString(),(X0=(Q0=a==null?void 0:a.info)==null?void 0:Q0.guildsTotalWage)==null?void 0:X0.toLocaleString(),(J0=(G0=a==null?void 0:a.info)==null?void 0:G0.notPaied)==null?void 0:J0.toLocaleString(),(O0=(Z0=a==null?void 0:a.info)==null?void 0:Z0.companyTotalUnpaidWage)==null?void 0:O0.toLocaleString(),(m0=(B0=a==null?void 0:a.info)==null?void 0:B0.unionTotalUnpaidWage)==null?void 0:m0.toLocaleString(),(ee=(ue=a==null?void 0:a.info)==null?void 0:ue.guildsTotalUnpaidWage)==null?void 0:ee.toLocaleString(),(le=(ae=a==null?void 0:a.info)==null?void 0:ae.totalPaidWage)==null?void 0:le.toLocaleString(),(oe=(te=a==null?void 0:a.info)==null?void 0:te.unionTotalPaidWage)==null?void 0:oe.toLocaleString(),(se=(ne=a==null?void 0:a.info)==null?void 0:ne.companyTotalPaidWage)==null?void 0:se.toLocaleString(),(ce=(re=a==null?void 0:a.info)==null?void 0:re.guildsTotalPaidWage)==null?void 0:ce.toLocaleString()]});break;case"ProvinceOperator":yu=(h6=(f6=Q.payload)==null?void 0:f6.data)==null?void 0:h6.map((a,Su)=>{var Z,O,B,m,uu,eu,du,gu,Au,iu,fu,hu,xu,Eu,wu,Lu,bu,$u,Tu,S6,j6,F6,y6;return[Su+1,(Z=a==null?void 0:a.info)==null?void 0:Z.type,(O=a==null?void 0:a.info)==null?void 0:O.killHouseName,(B=a==null?void 0:a.info)==null?void 0:B.fullname,(m=a==null?void 0:a.info)==null?void 0:m.mobile,(uu=a==null?void 0:a.info)==null?void 0:uu.city,(du=(eu=a==null?void 0:a.info)==null?void 0:eu.totalKilledQuantity)==null?void 0:du.toLocaleString(),(Au=(gu=a==null?void 0:a.info)==null?void 0:gu.totalKilledWeight)==null?void 0:Au.toLocaleString(),(fu=(iu=a==null?void 0:a.info)==null?void 0:iu.lenKillHouseRequests)==null?void 0:fu.toLocaleString(),(xu=(hu=a==null?void 0:a.info)==null?void 0:hu.acceptedRealQuantity)==null?void 0:xu.toLocaleString(),(wu=(Eu=a==null?void 0:a.info)==null?void 0:Eu.acceptedRealWeight)==null?void 0:wu.toLocaleString(),(bu=(Lu=a==null?void 0:a.info)==null?void 0:Lu.lenSlaughterTransactions)==null?void 0:bu.toLocaleString(),(Tu=($u=a==null?void 0:a.info)==null?void 0:$u.unionTotalWage)==null?void 0:Tu.toLocaleString(),(j6=(S6=a==null?void 0:a.info)==null?void 0:S6.unionTotalUnpaidWage)==null?void 0:j6.toLocaleString(),(y6=(F6=a==null?void 0:a.info)==null?void 0:F6.unionTotalPaidWage)==null?void 0:y6.toLocaleString()]});break;default:yu=(p6=(x6=Q.payload)==null?void 0:x6.data)==null?void 0:p6.map((a,Su)=>{var Z,O,B,m,uu,eu,du,gu,Au,iu,fu,hu,xu,Eu,wu,Lu,bu,$u,Tu,S6,j6,F6,y6,K6,H6;return[Su+1,(Z=a==null?void 0:a.info)==null?void 0:Z.type,(O=a==null?void 0:a.info)==null?void 0:O.killHouseName,(B=a==null?void 0:a.info)==null?void 0:B.fullname,(m=a==null?void 0:a.info)==null?void 0:m.mobile,(uu=a==null?void 0:a.info)==null?void 0:uu.city,(du=(eu=a==null?void 0:a.info)==null?void 0:eu.lenProvinceKillRequests)==null?void 0:du.toLocaleString(),(Au=(gu=a==null?void 0:a.info)==null?void 0:gu.totalKilledQuantity)==null?void 0:Au.toLocaleString(),(fu=(iu=a==null?void 0:a.info)==null?void 0:iu.totalKilledWeight)==null?void 0:fu.toLocaleString(),(xu=(hu=a==null?void 0:a.info)==null?void 0:hu.lenKillHouseRequests)==null?void 0:xu.toLocaleString(),(wu=(Eu=a==null?void 0:a.info)==null?void 0:Eu.acceptedRealQuantity)==null?void 0:wu.toLocaleString(),(bu=(Lu=a==null?void 0:a.info)==null?void 0:Lu.acceptedRealWeight)==null?void 0:bu.toLocaleString(),(Tu=($u=a==null?void 0:a.info)==null?void 0:$u.lenSlaughterTransactions)==null?void 0:Tu.toLocaleString(),(j6=(S6=a==null?void 0:a.info)==null?void 0:S6.unionTotalWage)==null?void 0:j6.toLocaleString(),(y6=(F6=a==null?void 0:a.info)==null?void 0:F6.unionTotalUnpaidWage)==null?void 0:y6.toLocaleString(),(H6=(K6=a==null?void 0:a.info)==null?void 0:K6.unionTotalPaidWage)==null?void 0:H6.toLocaleString()]});break}y(yu)})},P=Ru(Q=>Q.userSlice.userProfile.key);return c.useEffect(()=>{w()},[]),u.jsxs(f,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,mb:1,width:"100%",children:[u.jsx(f,{container:!0,alignItems:"center",justifyContent:"center",gap:2,paddingTop:2,mb:1,width:"100%",children:u.jsxs(f,{container:!0,alignItems:"center",gap:Iu.SMALL,justifyContent:"center",children:[u.jsxs(f,{container:!0,justifyContent:"center",style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},children:[u.jsx(f,{children:u.jsx(N6,{control:u.jsx(w6,{checked:p,onChange:()=>T(!p),color:"primary"})})}),u.jsx(f,{children:u.jsx(G,{disabled:!p,label:"از تاریخ",id:"date",renderInput:Q=>u.jsx(N,{size:"small",style:{width:"160px"},...Q}),value:g,onChange:Q=>{_(H(Q).format("YYYY-MM-DD"))}})}),u.jsx(f,{children:u.jsx(G,{disabled:!p,label:"تا تاریخ",id:"date",renderInput:Q=>u.jsx(N,{size:"small",style:{width:"160px"},...Q}),value:E,onChange:Q=>{I(H(Q).format("YYYY-MM-DD"))}})})]}),u.jsx(X,{type:"submit",onClick:()=>{w()},children:"جستجو"}),(d()==="SuperAdmin"||d()==="AdminX")&&u.jsx(I6,{title:"خروجی اکسل",placement:"top",children:u.jsx("a",{href:`${K.defaults.baseURL}kill_house_total_transactions_wage_payid_super_admin_excel/?key=${P}${p?`&date1=${g}&date2=${E}`:""}&role=${d()}`,rel:"noreferrer",children:u.jsx(X,{color:"primary",children:u.jsx(V6,{size:32})})})})]})}),u.jsx(f,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(E6,{noPagination:!0,columns:d()==="AdminX"?["تعداد تخصیص بدون بار","حجم تخصیص بدون بار","وزن تخصیص بدون بار","تعداد بار","حجم بار","وزن بار","تعداد تراکنش ","کل تعرفه (ریال)","سهم شرکت (ریال)","سهم اتحادیه (ریال)","سهم صنف (ریال)","سهم غیره (ریال)","تخفیف کل (ریال)","کل تعرفه پرداخت نشده (ریال)"," سهم شرکت پرداخت نشده"," سهم اتحادیه پرداخت نشده","سهم صنف پرداخت نشده","سهم غیره پرداخت نشده","کل تعرفه پرداخت شده (ریال)","سهم اتحادیه از واریزی(ریال)","سهم شرکت از واریزی(ریال)","سهم اصناف از واریزی(ریال)","سهم غیره از واریزی(ریال)"]:d()==="SuperAdmin"?["تعداد تخصیص بدون بار","حجم تخصیص بدون بار","وزن تخصیص بدون بار","تعداد بار","حجم بار","وزن بار","تعداد تراکنش ","کل تعرفه (ریال)","سهم شرکت (ریال)","سهم اتحادیه (ریال)","سهم صنف (ریال)","تخفیف کل (ریال)","کل تعرفه پرداخت نشده (ریال)"," سهم شرکت پرداخت نشده"," سهم اتحادیه پرداخت نشده","سهم صنف پرداخت نشده","کل تعرفه پرداخت شده (ریال)","سهم اتحادیه از واریزی(ریال)","سهم شرکت از واریزی(ریال)","سهم اصناف از واریزی(ریال)"]:d()==="ProvinceOperator"?["تعداد تخصیص بدون بار","حجم تخصیص بدون بار","وزن تخصیص بدون بار","تعداد بار","حجم بار","وزن بار","سهم اتحادیه (ریال)"," سهم اتحادیه پرداخت نشده","سهم اتحادیه از واریزی(ریال)"]:["تعداد تخصیص بدون بار","حجم تخصیص بدون بار","وزن تخصیص بدون بار","تعداد بار","حجم بار","وزن بار","تعداد تراکنش ","سهم اتحادیه (ریال)"," سهم اتحادیه پرداخت نشده","سهم اتحادیه از واریزی(ریال)"],data:d()==="AdminX"?[[(M=(v=l==null?void 0:l.info)==null?void 0:v.lenProvinceKillRequests)==null?void 0:M.toLocaleString(),($=(D=l==null?void 0:l.info)==null?void 0:D.totalKilledQuantity)==null?void 0:$.toLocaleString(),(e=(k=l==null?void 0:l.info)==null?void 0:k.totalKilledWeight)==null?void 0:e.toLocaleString(),(W=(z=l==null?void 0:l.info)==null?void 0:z.lenKillHouseRequests)==null?void 0:W.toLocaleString(),(C=(V=l==null?void 0:l.info)==null?void 0:V.acceptedRealQuantity)==null?void 0:C.toLocaleString(),(n=(S=l==null?void 0:l.info)==null?void 0:S.acceptedRealWeight)==null?void 0:n.toLocaleString(),(r=(s=l==null?void 0:l.info)==null?void 0:s.lenSlaughterTransactions)==null?void 0:r.toLocaleString(),(h=(A=l==null?void 0:l.info)==null?void 0:A.totalWage)==null?void 0:h.toLocaleString(),(U=(L=l==null?void 0:l.info)==null?void 0:L.companyTotalWage)==null?void 0:U.toLocaleString(),(ku=(J=l==null?void 0:l.info)==null?void 0:J.unionTotalWage)==null?void 0:ku.toLocaleString(),(_u=(Fu=l==null?void 0:l.info)==null?void 0:Fu.guildsTotalWage)==null?void 0:_u.toLocaleString(),(Du=(Mu=l==null?void 0:l.info)==null?void 0:Mu.otherTotalWage)==null?void 0:Du.toLocaleString(),(Ku=(zu=l==null?void 0:l.info)==null?void 0:zu.totalOff)==null?void 0:Ku.toLocaleString(),(qu=(Hu=l==null?void 0:l.info)==null?void 0:Hu.notPaied)==null?void 0:qu.toLocaleString(),(_6=(k6=l==null?void 0:l.info)==null?void 0:k6.companyTotalUnpaidWage)==null?void 0:_6.toLocaleString(),(D6=(M6=l==null?void 0:l.info)==null?void 0:M6.unionTotalUnpaidWage)==null?void 0:D6.toLocaleString(),(Y6=(R6=l==null?void 0:l.info)==null?void 0:R6.guildsTotalUnpaidWage)==null?void 0:Y6.toLocaleString(),(q=(P6=l==null?void 0:l.info)==null?void 0:P6.otherTotalUnpaidWage)==null?void 0:q.toLocaleString(),(Yu=(F=l==null?void 0:l.info)==null?void 0:F.totalPaidWage)==null?void 0:Yu.toLocaleString(),(Pu=(L6=l==null?void 0:l.info)==null?void 0:L6.unionTotalPaidWage)==null?void 0:Pu.toLocaleString(),(W6=(vu=l==null?void 0:l.info)==null?void 0:vu.companyTotalPaidWage)==null?void 0:W6.toLocaleString(),(z6=(Q6=l==null?void 0:l.info)==null?void 0:Q6.guildsTotalPaidWage)==null?void 0:z6.toLocaleString(),(u0=($6=l==null?void 0:l.info)==null?void 0:$6.otherTotalPaidWage)==null?void 0:u0.toLocaleString()]]:d()==="SuperAdmin"?[[(a0=(e0=l==null?void 0:l.info)==null?void 0:e0.lenProvinceKillRequests)==null?void 0:a0.toLocaleString(),(t0=(l0=l==null?void 0:l.info)==null?void 0:l0.totalKilledQuantity)==null?void 0:t0.toLocaleString(),(n0=(o0=l==null?void 0:l.info)==null?void 0:o0.totalKilledWeight)==null?void 0:n0.toLocaleString(),(r0=(s0=l==null?void 0:l.info)==null?void 0:s0.lenKillHouseRequests)==null?void 0:r0.toLocaleString(),(C0=(c0=l==null?void 0:l.info)==null?void 0:c0.acceptedRealQuantity)==null?void 0:C0.toLocaleString(),(g0=(d0=l==null?void 0:l.info)==null?void 0:d0.acceptedRealWeight)==null?void 0:g0.toLocaleString(),(i0=(A0=l==null?void 0:l.info)==null?void 0:A0.lenSlaughterTransactions)==null?void 0:i0.toLocaleString(),(h0=(f0=l==null?void 0:l.info)==null?void 0:f0.totalWage)==null?void 0:h0.toLocaleString(),(p0=(x0=l==null?void 0:l.info)==null?void 0:x0.companyTotalWage)==null?void 0:p0.toLocaleString(),(j0=(S0=l==null?void 0:l.info)==null?void 0:S0.unionTotalWage)==null?void 0:j0.toLocaleString(),(y0=(F0=l==null?void 0:l.info)==null?void 0:F0.guildsTotalWage)==null?void 0:y0.toLocaleString(),(w0=(E0=l==null?void 0:l.info)==null?void 0:E0.totalOff)==null?void 0:w0.toLocaleString(),(b0=(L0=l==null?void 0:l.info)==null?void 0:L0.notPaied)==null?void 0:b0.toLocaleString(),(T0=($0=l==null?void 0:l.info)==null?void 0:$0.companyTotalUnpaidWage)==null?void 0:T0.toLocaleString(),(k0=(I0=l==null?void 0:l.info)==null?void 0:I0.unionTotalUnpaidWage)==null?void 0:k0.toLocaleString(),(M0=(_0=l==null?void 0:l.info)==null?void 0:_0.guildsTotalUnpaidWage)==null?void 0:M0.toLocaleString(),(R0=(D0=l==null?void 0:l.info)==null?void 0:D0.totalPaidWage)==null?void 0:R0.toLocaleString(),(P0=(Y0=l==null?void 0:l.info)==null?void 0:Y0.unionTotalPaidWage)==null?void 0:P0.toLocaleString(),(z0=(W0=l==null?void 0:l.info)==null?void 0:W0.companyTotalPaidWage)==null?void 0:z0.toLocaleString(),(H0=(K0=l==null?void 0:l.info)==null?void 0:K0.guildsTotalPaidWage)==null?void 0:H0.toLocaleString()]]:d()==="ProvinceOperator"?[[(v0=(q0=l==null?void 0:l.info)==null?void 0:q0.lenProvinceKillRequests)==null?void 0:v0.toLocaleString(),(R=(U0=l==null?void 0:l.info)==null?void 0:U0.totalKilledQuantity)==null?void 0:R.toLocaleString(),(pu=(i=l==null?void 0:l.info)==null?void 0:i.totalKilledWeight)==null?void 0:pu.toLocaleString(),(au=(o=l==null?void 0:l.info)==null?void 0:o.acceptedRealQuantity)==null?void 0:au.toLocaleString(),(tu=(lu=l==null?void 0:l.info)==null?void 0:lu.acceptedRealWeight)==null?void 0:tu.toLocaleString(),(nu=(ou=l==null?void 0:l.info)==null?void 0:ou.lenSlaughterTransactions)==null?void 0:nu.toLocaleString(),(ru=(su=l==null?void 0:l.info)==null?void 0:su.unionTotalWage)==null?void 0:ru.toLocaleString(),(Cu=(cu=l==null?void 0:l.info)==null?void 0:cu.unionTotalUnpaidWage)==null?void 0:Cu.toLocaleString(),(Nu=(Uu=l==null?void 0:l.info)==null?void 0:Uu.unionTotalPaidWage)==null?void 0:Nu.toLocaleString()]]:[[(Qu=(Vu=l==null?void 0:l.info)==null?void 0:Vu.lenProvinceKillRequests)==null?void 0:Qu.toLocaleString(),(Gu=(Xu=l==null?void 0:l.info)==null?void 0:Xu.totalKilledQuantity)==null?void 0:Gu.toLocaleString(),(Zu=(Ju=l==null?void 0:l.info)==null?void 0:Ju.totalKilledWeight)==null?void 0:Zu.toLocaleString(),(Bu=(Ou=l==null?void 0:l.info)==null?void 0:Ou.lenKillHouseRequests)==null?void 0:Bu.toLocaleString(),(u6=(mu=l==null?void 0:l.info)==null?void 0:mu.acceptedRealQuantity)==null?void 0:u6.toLocaleString(),(a6=(e6=l==null?void 0:l.info)==null?void 0:e6.acceptedRealWeight)==null?void 0:a6.toLocaleString(),(t6=(l6=l==null?void 0:l.info)==null?void 0:l6.lenSlaughterTransactions)==null?void 0:t6.toLocaleString(),(n6=(o6=l==null?void 0:l.info)==null?void 0:o6.unionTotalWage)==null?void 0:n6.toLocaleString(),(r6=(s6=l==null?void 0:l.info)==null?void 0:s6.unionTotalUnpaidWage)==null?void 0:r6.toLocaleString(),(C6=(c6=l==null?void 0:l.info)==null?void 0:c6.unionTotalPaidWage)==null?void 0:C6.toLocaleString()]],title:"خلاصه اطلاعات",customColors:[{name:"تعداد تخصیص بدون بار",color:"yellow"},{name:"حجم تخصیص بدون بار",color:"yellow"},{name:"وزن تخصیص بدون بار",color:"yellow"},{name:"تعداد بار",color:"cyan"},{name:"حجم بار",color:"cyan"},{name:"وزن بار",color:"cyan"},{name:"تعداد تراکنش ",color:"orange"},{name:"کل تعرفه (ریال)",color:"green"},{name:"سهم شرکت (ریال)",color:"green"},{name:"سهم اتحادیه (ریال)",color:"green"},{name:"سهم صنف (ریال)",color:"green"},{name:"سهم غیره (ریال)",color:"green"},{name:"کل تعرفه پرداخت شده (ریال)",color:"red"},{name:"سهم اتحادیه از واریزی(ریال)",color:"red"},{name:"سهم شرکت از واریزی(ریال)",color:"red"},{name:"سهم اصناف از واریزی(ریال)",color:"red"},{name:"سهم غیره از واریزی(ریال)",color:"red"},{name:"تخفیف کل (ریال)",color:"pink"}]})}),u.jsx(E6,{paginated:!0,columns:d()==="AdminX"?["ردیف","ماهیت","خریدار","نام و نام خانوادگی مالک","تلفن مالک","شهر","تعداد تخصیص بدون بار","حجم تخصیص بدون بار","وزن تخصیص بدون بار","تعداد بار","حجم بار","وزن بار","تعداد تراکنش ","تخفیف (ریال)","کل تعرفه (ریال)","سهم شرکت (ریال)","سهم اتحادیه (ریال)","سهم صنف (ریال)","سهم غیره (ریال)","کل تعرفه پرداخت نشده (ریال)"," سهم شرکت پرداخت نشده"," سهم اتحادیه پرداخت نشده","سهم صنف پرداخت نشده","سهم غیره پرداخت نشده","کل تعرفه پرداخت شده (ریال)","سهم اتحادیه از واریزی(ریال)","سهم شرکت از واریزی(ریال)","سهم اصناف از واریزی(ریال)","سهم غیره از واریزی(ریال)"]:d()==="SuperAdmin"?["ردیف","ماهیت","خریدار","نام و نام خانوادگی مالک","تلفن مالک","شهر","تعداد تخصیص بدون بار","حجم تخصیص بدون بار","وزن تخصیص بدون بار","تعداد بار","حجم بار","وزن بار","تعداد تراکنش ","تخفیف (ریال)","کل تعرفه (ریال)","سهم شرکت (ریال)","سهم اتحادیه (ریال)","سهم صنف (ریال)","کل تعرفه پرداخت نشده (ریال)"," سهم شرکت پرداخت نشده"," سهم اتحادیه پرداخت نشده","سهم صنف پرداخت نشده","کل تعرفه پرداخت شده (ریال)","سهم اتحادیه از واریزی(ریال)","سهم شرکت از واریزی(ریال)","سهم اصناف از واریزی(ریال)"]:d()==="ProvinceOperator"?["ردیف","ماهیت","خریدار","نام و نام خانوادگی مالک","تلفن مالک","شهر","تعداد تخصیص بدون بار","حجم تخصیص بدون بار","وزن تخصیص بدون بار","تعداد بار","حجم بار","وزن بار","سهم اتحادیه (ریال)"," سهم اتحادیه پرداخت نشده","سهم اتحادیه از واریزی(ریال)"]:["ردیف","ماهیت","خریدار","نام و نام خانوادگی مالک","تلفن مالک","شهر","تعداد تخصیص بدون بار","حجم تخصیص بدون بار","وزن تخصیص بدون بار","تعداد بار","حجم بار","وزن بار","تعداد تراکنش ","سهم اتحادیه (ریال)"," سهم اتحادیه پرداخت نشده","سهم اتحادیه از واریزی(ریال)"],data:t,title:"پایش تعرفه ها",customColors:[{name:"تعداد تخصیص بدون بار",color:"yellow"},{name:"حجم تخصیص بدون بار",color:"yellow"},{name:"وزن تخصیص بدون بار",color:"yellow"},{name:"تعداد بار",color:"cyan"},{name:"حجم بار",color:"cyan"},{name:"وزن بار",color:"cyan"},{name:"تعداد تراکنش ",color:"orange"},{name:"کل تعرفه (ریال)",color:"green"},{name:"سهم شرکت (ریال)",color:"green"},{name:"سهم اتحادیه (ریال)",color:"green"},{name:"سهم صنف (ریال)",color:"green"},{name:"سهم غیره (ریال)",color:"green"},{name:"کل تعرفه پرداخت شده (ریال)",color:"red"},{name:"سهم اتحادیه از واریزی(ریال)",color:"red"},{name:"سهم شرکت از واریزی(ریال)",color:"red"},{name:"سهم اصناف از واریزی(ریال)",color:"red"},{name:"سهم غیره از واریزی(ریال)",color:"red"}]})]})},Ya=()=>{const{slaughterExclusiveState:t}=Ru(b=>b.slaughterSlice),[y,x]=c.useState("1"),p=(b,w)=>{x(w)},[T,g]=c.useState(),_=(b,w)=>{g(w)},[E,I]=c.useState("1"),l=(b,w)=>{I(w)};return c.useEffect(()=>{d()!=="ChainCompany"&&g("1")},[]),u.jsxs(f,{justifyContent:"center",gap:Iu.SMALL,xs:12,children:[u.jsx(f,{sx:{maxWidth:{xs:"100%",md:"90vw"}},px:{xs:2,md:0},children:u.jsx(La,{})}),d()!=="ParentCompany"&&u.jsx(f,{container:!0,alignItems:"center",justifyContent:"center",mt:2,xs:12,children:u.jsxs(De,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:y,onChange:p,children:[u.jsx(X6,{label:"پرداختی ها",value:"1"}),u.jsx(X6,{label:"اطلاعات تعرفه",value:"2"})]})}),d()!=="ParentCompany"&&u.jsxs(Re,{value:y,children:[u.jsx(q6,{value:"3",children:u.jsx(f,{container:!0,alignItems:"center",justifyContent:"center",xs:12,children:u.jsx(Ra,{})})}),u.jsx(q6,{value:"1",children:u.jsx(f,{container:!0,alignItems:"center",justifyContent:"center",mt:2,xs:12,children:u.jsx(f,{container:!0,alignItems:"center",justifyContent:"center",xs:12,children:d()==="SuperAdmin"||d()==="AdminX"||d()==="ProvinceOperator"?u.jsxs(u.Fragment,{children:[u.jsx(f,{container:!0,alignItems:"center",justifyContent:"center",xs:12,mb:1,children:u.jsxs(ua,{size:"small",color:"primary",value:E,exclusive:!0,onChange:l,"aria-label":"Platform",children:[u.jsx(Se,{value:"1",children:"کشتارگاه"}),u.jsx(Se,{value:"2",children:"شرکت زنجیره"}),(d()==="SuperAdmin"||d()==="AdminX"||d()==="ProvinceOperator"||d()==="Guilds")&&u.jsx(Se,{value:"3",children:"تراکنش ها"})]})}),u.jsx(f,{container:!0,alignItems:"center",justifyContent:"center",xs:12,children:E==="1"?u.jsx(ba,{}):E==="2"?u.jsx($a,{}):u.jsx(fa,{})})]}):u.jsx(u.Fragment,{children:d==="KillHouse"?u.jsx(de,{killhouseKey:"killhouse",type:"kill_house_key"}):u.jsx(de,{killhouseKey:"chain_company",type:"chain_company_key"})})})})}),u.jsx(q6,{value:"2",children:u.jsxs(f,{container:!0,alignItems:"center",justifyContent:"center",mt:2,xs:12,children:[u.jsx(f,{container:!0,alignItems:"center",justifyContent:"center",xs:12,children:(d()==="ProvinceOperator"||d()==="SuperAdmin"||d()==="AdminX"||d()==="Commerce"||d()==="KillHouse")&&u.jsxs(De,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:T,onChange:_,children:[u.jsx(X6,{label:"بارهای روزانه",value:"1"}),!t&&u.jsx(X6,{disabled:!0,label:"تخصیص روزانه",value:"2"}),u.jsx(X6,{disabled:!0,label:"مرغ زنده",value:"3"}),(d()==="KillHouse"||d()==="SuperAdmin"||d()==="AdminX"||d()==="Commerce")&&u.jsx(X6,{disabled:!0,label:"لاشه",value:"4"}),d()!=="KillHouse"&&d()!=="ChainCompany"&&u.jsx(X6,{disabled:!0,label:"زنجیره",value:"5"})]})}),d()==="ChainCompany"&&u.jsx(je,{killhouseKey:"killhouseKey"}),u.jsxs(Re,{value:T,children:[u.jsx(q6,{value:"1",children:d()==="SuperAdmin"||d()==="AdminX"||d()==="ProvinceOperator"||d()==="Commerce"?u.jsx(Ia,{}):u.jsx(Xe,{killhouseKey:"killhouse"})}),u.jsx(q6,{value:"2",children:d()==="SuperAdmin"||d()==="AdminX"||d()==="ProvinceOperator"||d()==="Commerce"?u.jsx(Ta,{}):u.jsx(Qe,{killhouseKey:"killhouse"})}),u.jsx(q6,{value:"3",children:d()==="SuperAdmin"||d()==="AdminX"||d()==="ProvinceOperator"||d()==="Commerce"?u.jsx(qe,{type:"live_chicken"}):u.jsx(fe,{killhouseKey:"live_chicken",type:"live"})}),u.jsx(q6,{value:"4",children:d()==="SuperAdmin"||d()==="AdminX"||d()==="ProvinceOperator"||d()==="Commerce"?u.jsx(qe,{type:"carcassess"}):u.jsx(fe,{killhouseKey:"carcassess",type:"carcass"})}),u.jsx(q6,{value:"5",children:d()==="SuperAdmin"||d()==="AdminX"||d()==="ProvinceOperator"||d()==="Commerce"?u.jsx(ka,{}):u.jsx(je,{killhouseKey:"killhouseKey"})})]})]})})]})]})},fl=()=>{const t=Ca(),y=()=>{let x;switch(t.type){case"unpaid":x=u.jsx(Qe,{killhouseKey:t.key});break;case"kill_house_key":x=u.jsx(de,{killhouseKey:t.key,type:t.type});break;case"chain_company_key":x=u.jsx(de,{killhouseKey:t.key,type:t.type});break;case"daily_bar":x=u.jsx(Xe,{killhouseKey:t.key,type:t.type});break;case"live_chicken":x=u.jsx(fe,{killhouseKey:t.key,type:"live"});break;case"carcassess":x=u.jsx(fe,{killhouseKey:t.key,type:"carcass"});break;case"chain":x=u.jsx(je,{killhouseKey:t.key});break;default:x=u.jsx(de,{killhouseKey:t.key,type:t.type});break}return x};return u.jsx(u.Fragment,{children:u.jsx(ea,{display:"flex",justifyContent:"center",children:u.jsx(f,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsxs(f,{container:!0,justifyContent:"space-between",gap:Iu.SMALL,direction:"column",children:[u.jsx(aa,{}),t.type?u.jsx(u.Fragment,{children:y()}):u.jsx(f,{children:u.jsx(Ya,{})})]})})})})};export{fl as default}; diff --git a/build/assets/ProvinceFinancial-D2wtnzpF.js b/build/assets/ProvinceFinancial-D2wtnzpF.js new file mode 100644 index 0000000..5db77b2 --- /dev/null +++ b/build/assets/ProvinceFinancial-D2wtnzpF.js @@ -0,0 +1 @@ +import{j as u,I as P,aJ as G,ak as X,aO as Ru,aP as gu,aQ as vu,aR as Iu,aS as Su,aT as Nu,T as hu,B as z,p as au,b as Tu}from"./mui-vendor-CkIVaoQP.js";import{G as l,S as y,jL as m,jM as uu,jN as eu,ew as Cu,jO as su,jP as ru,jQ as ou,jR as nu,a4 as ju,Q as Y,jh as K,T as Lu,A as yu,a9 as J,hZ as _u,p as tu,N as V,W as iu,j as ku,u as bu,c as Du,M as qu,m as Mu,L as pu,h as Au,jS as lu,h_ as Pu,jT as Ou,jU as wu}from"./index-CeyyVc1v.js";import{N as q}from"./NavLink-D2GD_ItM.js";import{L as M}from"./LinkItem-DT6qswcs.js";import{d as Hu}from"./index.esm-BcDC8KuM.js";import{a as Fu}from"./index.esm-BVxcT1y_.js";import{G as Uu}from"./iconBase-BEJYyZsk.js";import{a as Wu}from"./index.esm-CjWvmHks.js";import{a as Vu}from"./index.esm-YBNW__9r.js";import{d as $u,u as Qu}from"./index.esm-BY9chGNa.js";import{L as du}from"./LineWithText-BpnpjRWf.js";import{f as Eu,u as $,r as a}from"./react-vendor-CmFgShSM.js";import{A as Z}from"./AdvancedTable-BYmmBtmq.js";import{d as Q}from"./Plagiarism-BiXORbzo.js";import{u as O,f as B,a as Bu}from"./redux-vendor-B7uoacJt.js";import{A as zu}from"./AvicultureArchivedRequests-Bul1i4cq.js";import{R as Yu,a as Gu}from"./RequestsAwaitingInspections-C8DP5FQL.js";import{F as Ku,a as Zu}from"./Factor-CqUlgaYq.js";import{d as cu}from"./Edit-CqBj1Y2L.js";import{S as Ju}from"./SimpleTable-DBAoNnCU.js";import{R as Xu}from"./ResponsiveTable-w7hk7Uq8.js";import{A as mu}from"./index-9Ymn_7Kv.js";import{B as u6}from"./BackButton-Crzr7NMa.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";import"./NumberFormatCustom-DwWPj40N.js";import"./toBase64-BzgTOHsW.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./useRequestFile-FPqBpZfN.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";function e6(s){return Uu({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Money_Check_1"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M19.437,18.218H4.563a2.5,2.5,0,0,1-2.5-2.5V8.282a2.5,2.5,0,0,1,2.5-2.5H19.437a2.5,2.5,0,0,1,2.5,2.5v7.436A2.5,2.5,0,0,1,19.437,18.218ZM4.563,6.782a1.5,1.5,0,0,0-1.5,1.5v7.436a1.5,1.5,0,0,0,1.5,1.5H19.437a1.5,1.5,0,0,0,1.5-1.5V8.282a1.5,1.5,0,0,0-1.5-1.5Z"}},{tag:"path",attr:{d:"M12,12.786H5.064a.5.5,0,0,1,0-1H12a.5.5,0,0,1,0,1Z"}},{tag:"path",attr:{d:"M14,15.714H5.064a.5.5,0,1,1,0-1H14a.5.5,0,0,1,0,1Z"}},{tag:"rect",attr:{x:"15.436",y:"8.283",width:"4",height:"2",rx:"0.5"}}]}]}]})(s)}const s6=()=>{const{pathname:s}=Eu();return u.jsxs(l,{container:!0,gap:y.SMALL,p:y.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",style:{placeContent:"baseline"},children:[u.jsxs(l,{container:!0,direction:"column",style:{width:"100%"},children:[u.jsx(l,{children:u.jsx(du,{text:"صدور فاکتور"})}),u.jsxs(l,{container:!0,justifyContent:"center",gap:y.SMALL,children:[u.jsx(q,{to:m,active:s===m?"true":null,children:u.jsx(M,{icon:u.jsx(Hu,{size:30,color:"#244CCC"}),title:"صدور فاکتور",description:"درخواست های در انتظار تایید و صدور فاکتور"})}),u.jsx(q,{to:uu,active:s===uu?"true":null,children:u.jsx(M,{icon:u.jsx(Fu,{size:30,color:"#244CCC"}),title:"در انتظار پرداخت",description:"مشاهده درخواست های در انتظار پرداخت کشتارگاه"})}),u.jsx(q,{to:eu,active:s===eu?"true":null,children:u.jsx(M,{icon:u.jsx(Fu,{size:30,color:"#244CCC"}),title:"فاکتورهای پرداخت شده",description:"بررسی فاکتورهای پرداخت شده"})}),u.jsx(q,{to:Cu,active:s===Cu?"true":null,children:u.jsx(M,{icon:u.jsx($u,{size:30,style:{color:"#4285F4"},color:"#244CCC"}),title:"تراکنش ها"})})]})]}),u.jsxs(l,{container:!0,direction:"column",style:{width:"100%"},children:[u.jsx(l,{children:u.jsx(du,{text:"اسناد"})}),u.jsxs(l,{container:!0,justifyContent:"center",gap:y.SMALL,children:[u.jsx(q,{to:su,active:s===su?"true":null,children:u.jsx(M,{icon:u.jsx(e6,{size:30,color:"#244CCC"}),title:"اسناد مالی",description:"مشاهده و بررسی فاکتور های نهایی"})}),u.jsx(q,{to:ru,active:s===ru?"true":null,children:u.jsx(M,{icon:u.jsx(Wu,{size:30,color:"#244CCC"}),title:"درخواست های فعال",description:"مشاهده درخواست های در جریان"})}),u.jsx(q,{to:ou,active:s===ou?"true":null,children:u.jsx(M,{icon:u.jsx(Vu,{className:"svg-icon-color",fill:"#244CCC",stroke:"#244CCC",style:{color:"#4285F4"},color:"#244CCC",size:30}),title:"در انتظار بازرسی",description:"درخواست های در انتظار بررسی بازرس"})}),u.jsx(q,{to:nu,active:s===nu?"true":null,children:u.jsx(M,{icon:u.jsx(Qu,{className:"svg-icon-color",color:"#244CCC",size:30}),title:"بایگانی",description:"درخواست های پایان یافته"})})]})]})]})},r6=()=>{const s=$(),C=O(),{provinceAllRequests:t}=B(n=>n.provinceSlice),[F,d]=a.useState([]);a.useEffect(()=>{C(ju())},[]),a.useEffect(()=>{const n=t==null?void 0:t.filter((e,p)=>{var c;return e.state==="accept"&&((c=e==null?void 0:e.poultryRequest)==null?void 0:c.finalState)!=="archive"}),r=n==null?void 0:n.map((e,p)=>{var c,o,A,x,h,j,E,f,R,g,v,I,S,N,T,L,_,k,b,D,w;return[p+1,(c=e==null?void 0:e.poultryRequest)==null?void 0:c.orderCode,Y(new Date((o=e==null?void 0:e.poultryRequest)==null?void 0:o.createDate),"yyyy/MM/dd"),Y(new Date((A=e==null?void 0:e.poultryRequest)==null?void 0:A.sendDate),"yyyy/MM/dd"),(j=(h=(x=e==null?void 0:e.poultryRequest)==null?void 0:x.process)==null?void 0:h.poultry)==null?void 0:j.poultryName,(R=(f=(E=e==null?void 0:e.poultryRequest)==null?void 0:E.process)==null?void 0:f.poultry)==null?void 0:R.poultryMobile,(I=(v=(g=e==null?void 0:e.poultryRequest)==null?void 0:g.process)==null?void 0:v.poultry)==null?void 0:I.poultryCity,(T=(N=(S=e==null?void 0:e.poultryRequest)==null?void 0:S.process)==null?void 0:N.poultry)==null?void 0:T.poultryProvince,(k=(_=(L=e==null?void 0:e.poultryRequest)==null?void 0:L.process)==null?void 0:_.poultry)==null?void 0:k.age,(w=(D=(b=e==null?void 0:e.poultryRequest)==null?void 0:b.process)==null?void 0:D.poultry)==null?void 0:w.poultryQuantity,u.jsx(P,{"aria-label":"delete",color:"primary",onClick:()=>{var H,U,W;s(K+((W=(U=(H=e==null?void 0:e.poultryRequest)==null?void 0:H.process)==null?void 0:U.poultry)==null?void 0:W.poultryRequestId))},children:u.jsx(Q,{})},p)]});d(r)},[t]);const[i]=a.useState(["ردیف","کد سفارش","تاریخ ثبت درخواست","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","استان","سن مرغ","تعداد","مشاهده"]);return u.jsx(G,{children:u.jsx(Z,{name:"درخواست های فعال",columns:i,data:F})})},o6=()=>{const s=$(),C=O(),{provinceAllRequests:t}=B(n=>n.provinceSlice),[F,d]=a.useState([]);a.useEffect(()=>{C(ju())},[]),a.useEffect(()=>{const n=t==null?void 0:t.filter((e,p)=>e.state==="pending"),r=n==null?void 0:n.map((e,p)=>{var c,o,A,x,h,j,E,f,R,g,v,I,S,N,T,L,_,k,b,D,w;return[p+1,(c=e==null?void 0:e.poultryRequest)==null?void 0:c.orderCode,Y(new Date((o=e==null?void 0:e.poultryRequest)==null?void 0:o.createDate),"yyyy/MM/dd"),Y(new Date((A=e==null?void 0:e.poultryRequest)==null?void 0:A.sendDate),"yyyy/MM/dd"),(j=(h=(x=e==null?void 0:e.poultryRequest)==null?void 0:x.process)==null?void 0:h.poultry)==null?void 0:j.poultryName,(R=(f=(E=e==null?void 0:e.poultryRequest)==null?void 0:E.process)==null?void 0:f.poultry)==null?void 0:R.poultryMobile,(I=(v=(g=e==null?void 0:e.poultryRequest)==null?void 0:g.process)==null?void 0:v.poultry)==null?void 0:I.poultryCity,(T=(N=(S=e==null?void 0:e.poultryRequest)==null?void 0:S.process)==null?void 0:N.poultry)==null?void 0:T.poultryProvince,(k=(_=(L=e==null?void 0:e.poultryRequest)==null?void 0:L.process)==null?void 0:_.poultry)==null?void 0:k.age,(w=(D=(b=e==null?void 0:e.poultryRequest)==null?void 0:b.process)==null?void 0:D.poultry)==null?void 0:w.poultryQuantity,u.jsx(P,{"aria-label":"delete",color:"primary",onClick:()=>{var H,U,W;s(Lu+((W=(U=(H=e==null?void 0:e.poultryRequest)==null?void 0:H.process)==null?void 0:U.poultry)==null?void 0:W.poultryRequestId))},children:u.jsx(Q,{})},p)]});d(r)},[t]);const[i]=a.useState(["ردیف","کد سفارش","تاریخ ثبت درخواست","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","استان","سن مرغ","تعداد","مشاهده"]);return u.jsx(G,{children:u.jsx(Z,{columns:i,data:F})})},n6=({data:s})=>{var F,d,i,n;const C=["خریدار","مرغدار","محل کشتار","دامپزشک کشتارگاه","راننده/ماشین","تعداد تخصیصی","وزن تخصیصی (کیلوگرم)","تعداد واقعی","وزن خالص (کیلوگرم)","سند خودرو بدون بار","سند خودرو با بار"],t=[[`${s.killHouseName} (${s.killHouseMobile})`,`${s==null?void 0:s.unitName} (${s==null?void 0:s.mobile})`,`${s==null?void 0:s.killPlace}`,`${s==null?void 0:s.killHouseVetName} (${s==null?void 0:s.killHouseVetMobile})`,s.cars.driverName+` (${s.cars.driverMobile})/${s.cars.typeCar} با پلاک ${s.cars.pelak}`,(F=s==null?void 0:s.quantity)==null?void 0:F.toLocaleString(),(d=s==null?void 0:s.firstWeight)==null?void 0:d.toLocaleString(),s!=null&&s.acceptedRealQuantity?(i=s==null?void 0:s.acceptedRealQuantity)==null?void 0:i.toLocaleString():"وارد نشده",s!=null&&s.acceptedRealWeight?(n=s==null?void 0:s.acceptedRealWeight)==null?void 0:n.toLocaleString():"وارد نشده",u.jsx("a",{href:s.barInfo.killHouseImageWithoutLoad,alt:"دانلود سند خودرو بدون بار",children:u.jsx("img",{src:s.barInfo.killHouseImageWithoutLoad,width:"50",height:"50",alt:"بدون بار",className:"images-file"})},"provinceKillRequests"),u.jsx("a",{href:s.barInfo.killHouseImageWithLoad,alt:"دانلود سند خودرو با بار",children:u.jsx("img",{src:s.barInfo.killHouseImageWithLoad,width:"50",height:"50",alt:"بدون بار",className:"images-file"},"provinceKillRequests")},"provinceKillRequests")]];return u.jsx(Ju,{columns:C,data:t})},t6=()=>{const s=$(),C=O(),{provinceFinancialGetPendingRequests:t}=B(c=>c.provinceFinancialSlice),[F,d]=a.useState([]),[,,i,n,r,e]=a.useContext(yu);a.useEffect(()=>{const c=J(new Date).format("YYYY-MM-DD");n(c),e(c)},[]),a.useEffect(()=>{C(_u({selectedDate1:i,selectedDate2:r}))},[i,r]),a.useEffect(()=>{const c=t==null?void 0:t.map((o,A)=>{var x,h;return[A+1,o==null?void 0:o.barCode,tu(o==null?void 0:o.sendDate),`${o==null?void 0:o.fullName} (${o==null?void 0:o.mobile})`,o==null?void 0:o.unitName,`${o==null?void 0:o.killHouseName} (${o.killHouseMobile})`,`${o==null?void 0:o.killPlace}`,`${o==null?void 0:o.province}/${o==null?void 0:o.city}`,o==null?void 0:o.age,(x=o==null?void 0:o.acceptedRealQuantity)==null?void 0:x.toLocaleString(),((h=o==null?void 0:o.killHouseNetWeight)==null?void 0:h.toLocaleString())+" کیلوگرم",u.jsx(P,{color:"primary",onClick:()=>{C(V({title:"انجام عملیات تایید / رد درخواست",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsxs(l,{contianer:!0,children:[u.jsx(n6,{data:o}),u.jsx(Ku,{item:o})]})}))},children:u.jsx(cu,{})},A),u.jsx(P,{"aria-label":"delete",color:"primary",onClick:()=>{var j,E,f;s(K+((f=(E=(j=o==null?void 0:o.poultryRequest)==null?void 0:j.process)==null?void 0:E.poultry)==null?void 0:f.poultryRequestId))},children:u.jsx(Q,{})},A)]});d(c||[])},[t]);const[p]=a.useState(["ردیف","کد بار","تاریخ کشتار","مرغدار","نام مرغداری","خریدار","محل کشتار","استان/شهر","سن مرغ","تعداد","وزن بار","عملیات","مشاهده"]);return u.jsxs(l,{container:!0,direction:"column",gap:y.SMALL,children:[u.jsxs(l,{container:!0,alignItems:"center",gap:y.SMALL,children:[u.jsx(l,{style:{width:160},children:u.jsx(iu,{label:"از تاریخ",renderInput:c=>u.jsx(X,{...c}),value:i,onChange:c=>{n(J(c).format("YYYY-MM-DD"))}})}),u.jsx(l,{style:{width:160},children:u.jsx(iu,{label:"تا تاریخ",renderInput:c=>u.jsx(X,{...c}),value:r,onChange:c=>{e(J(c).format("YYYY-MM-DD"))}})})]}),u.jsx(Xu,{title:"درخواست های در انتظار تایید",columns:p,data:F,paginated:!0})]})},xu=Bu("PROVINCE_FINANCIAL_CHECK_REQUEST",async s=>{const{data:C,status:t}=await ku.post("province_check_factor/",s);return{data:C,status:t}}),fu=({factorKey:s,factorType:C})=>{const[t]=a.useContext(yu),[F]=a.useState(!1),[d,i]=a.useState(!1),n=O(),r=bu({initialValues:{rejectText:""},validationSchema:Du({rejectText:qu().required("این فیلد اجباری است!").typeError("لطفا دلیل خود را بیان کنید.")})});return u.jsx(u.Fragment,{children:!F&&u.jsxs(Ru,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(gu,{children:[u.jsx(vu,{color:"secondary"}),u.jsx(Iu,{})]}),u.jsxs(l,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(l,{container:!0,children:[u.jsx(l,{children:u.jsx(Su,{variant:"body1",fontWeight:"bold",color:"secondary",children:"انجام عملیات"})}),u.jsx(l,{children:u.jsx(Nu,{color:"textSecondary",children:u.jsx(hu,{variant:"body2",children:"در این مرحله فاکتور پرداخت را تایید یا رد کنید."})})})]}),u.jsx(l,{children:u.jsx(l,{children:u.jsx(l,{container:!0,gap:y.SMALL,padding:y.SMALL,children:u.jsx(mu,{children:d?u.jsx(Mu.div,{animate:{x:-10,opacity:1},transition:{duration:.3},initial:{opacity:0},exit:{opacity:0},children:u.jsxs(l,{flexDirection:"column",container:!0,gap:y.SMALL,children:[u.jsx(l,{children:u.jsx(X,{multiline:!0,rows:4,fullWidth:!0,id:"rejectText",label:"پیام خود را وارد کنید",variant:"outlined",value:r.values.rejectText,error:r.touched.rejectText?!!r.errors.rejectText:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.rejectText&&r.errors.rejectText?r.errors.rejectText:null})}),u.jsxs(l,{container:!0,gap:y.SMALL,children:[u.jsx(l,{children:u.jsx(z,{variant:"outlined",color:"secondary",onClick:()=>{i(!1)},children:"لغو"})}),u.jsx(l,{children:u.jsx(z,{variant:"outlined",onClick:()=>{n(pu()),n(xu({key:s,type:C,message:r.values.rejectText,state:"rejected"})).then(e=>{n(Au()),e.error?t({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(i(!1),n(lu()),n(V({right:!1,bottom:!1,top:!1,content:null,size:null})),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"رد پرداخت"})})]})]})}):u.jsxs(l,{container:!0,gap:y.SMALL,children:[u.jsx(z,{variant:"outlined",color:"secondary",onClick:()=>{i(!0)},children:"رد پرداخت"}),u.jsx(z,{variant:"outlined",onClick:()=>{n(pu()),n(xu({key:s,type:C,state:"accepted"})).then(e=>{n(Au()),e.error?t({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(n(lu()),n(V({right:!1,bottom:!1,top:!1,content:null,size:null})),i(!1),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید پرداخت"})]})})})})})]})]})})};fu.propTypes={factorKey:au.PropTypes.any,factorType:au.PropTypes.any};const l6=()=>{const s=$(),C=O(),{provinceFinancialGetPayedFactors:t}=B(n=>n.provinceFinancialSlice),[F,d]=a.useState([]);a.useEffect(()=>{C(lu())},[]),a.useEffect(()=>{const n=t==null?void 0:t.map((r,e)=>{var c,o,A,x,h,j,E,f,R,g,v,I,S,N,T,L,_;let p="";return r.state==="pending"?p="در انتظار تایید":r.state==="accepted"?p="تایید نهایی":r.state==="rejected"&&(p="رد شده"),[e+1,(c=r==null?void 0:r.provinceFactor)==null?void 0:c.factorBarCode,(E=(j=(h=(x=(A=(o=r==null?void 0:r.provinceFactor)==null?void 0:o.provinceCheckInfo)==null?void 0:A.killHouseAssignment)==null?void 0:x.killHouseRequest)==null?void 0:h.killRequest)==null?void 0:j.killHouse)==null?void 0:E.name,(T=(N=(S=(I=(v=(g=(R=(f=r==null?void 0:r.provinceFactor)==null?void 0:f.provinceCheckInfo)==null?void 0:R.killHouseAssignment)==null?void 0:g.killHouseRequest)==null?void 0:v.killRequest)==null?void 0:I.killHouse)==null?void 0:S.killHouseOperator)==null?void 0:N.user)==null?void 0:T.mobile,tu((L=r==null?void 0:r.provinceFactor)==null?void 0:L.createDate),tu(r==null?void 0:r.createDate),((_=r==null?void 0:r.provinceFactor)==null?void 0:_.totalPrice.toLocaleString())+" ﷼",Number(r==null?void 0:r.paymentCode),u.jsx("a",{href:r.factorImage,children:u.jsx("img",{src:r.factorImage,width:"50",height:"50",alt:"بدون بار",className:"images-file"})},"provinceKillRequests"),p,u.jsx(P,{color:"primary",disabled:r.state!=="pending",onClick:()=>{C(V({title:"انجام عملیات تایید / رد درخواست",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(l,{contianer:!0,children:u.jsx(fu,{factorKey:r.key,factorType:"province"})})}))},children:u.jsx(cu,{})},e),u.jsx(P,{"aria-label":"delete",color:"primary",onClick:()=>{var k,b,D;s(K+((D=(b=(k=r==null?void 0:r.poultryRequest)==null?void 0:k.process)==null?void 0:b.poultry)==null?void 0:D.poultryRequestId))},children:u.jsx(Q,{})},e)]});d(n)},[t]);const[i]=a.useState(["ردیف","شناسه فاکتور","کشتارگاه","تلفن کشتارگاه","تاریخ صدور فاکتور","تاریخ پرداخت فاکتور","مبلغ فاکتور نهایی","شناسه پرداخت","سند پرداختی","وضعیت","عملیات","مشاهده"]);return u.jsx(G,{children:u.jsx(Z,{name:"فاکتور های پرداخت شده",columns:i,data:F})})},c6=()=>{const s=$(),C=O(),{provinceFinancialGetFinalFactors:t}=B(n=>n.provinceFinancialSlice),[F,d]=a.useState([]);a.useEffect(()=>{C(Pu())},[]),a.useEffect(()=>{const n=t==null?void 0:t.map((r,e)=>{var p,c,o,A,x,h,j;return[e+1,(p=r==null?void 0:r.poultry)==null?void 0:p.orderCode,(o=(c=r==null?void 0:r.poultry)==null?void 0:c.poultry)==null?void 0:o.unitName,(h=(x=(A=r==null?void 0:r.poultry)==null?void 0:A.poultry)==null?void 0:x.userprofile)==null?void 0:h.mobile,((j=r==null?void 0:r.poultry)==null?void 0:j.quantity)+" قطعه",u.jsx(P,{color:"primary",onClick:()=>{C(V({title:"فاکتور نهایی",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(l,{contianer:!0,children:u.jsx(Zu,{process:r.poultry.process})})}))},children:u.jsx(cu,{})},e),u.jsx(P,{"aria-label":"delete",color:"primary",onClick:()=>{s(K+r.poultry.process.poultry.poultryRequestId)},children:u.jsx(Q,{})},e)]});d(n)},[t]);const[i]=a.useState(["ردیف","کدسفارش","مرغدار","تلفن مرغدار","تعداد","عملیات","مشاهده"]);return u.jsx(G,{children:u.jsx(Z,{name:"فاکتور های نهایی",columns:i,data:F})})},V6=()=>{const{pathname:s}=Eu();return u.jsx(u.Fragment,{children:u.jsx(Tu,{display:"flex",justifyContent:"center",children:u.jsxs(l,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[s===Ou?u.jsxs(l,{justifyContent:"center",my:y.MEDIUM,children:[u.jsx(l,{children:u.jsx(hu,{variant:"h6",children:"صفحه مدیریت درخواست ها (اپراتور مالی)"})}),u.jsx(s6,{})]}):u.jsx(u6,{}),u.jsx(l,{container:!0,justifyContent:"space-between",gap:y.SMALL,children:u.jsxs(l,{xs:12,children:[s===m&&u.jsx(t6,{}),s===ru&&u.jsx(r6,{}),s===nu&&u.jsx(zu,{}),s===wu&&u.jsx(o6,{}),s===uu&&u.jsx(Yu,{}),s===ou&&u.jsx(Gu,{}),s===eu&&u.jsx(l6,{}),s===su&&u.jsx(c6,{})]})})]})})})};export{V6 as default}; diff --git a/build/assets/ProvinceFinancialComplaints-D204yz0f.js b/build/assets/ProvinceFinancialComplaints-D204yz0f.js new file mode 100644 index 0000000..2f694c8 --- /dev/null +++ b/build/assets/ProvinceFinancialComplaints-D204yz0f.js @@ -0,0 +1 @@ +import{j as u,I as d,aI as C}from"./mui-vendor-CkIVaoQP.js";import{r as n,u as m}from"./react-vendor-CmFgShSM.js";import{u as f,f as A}from"./redux-vendor-B7uoacJt.js";import{L as x,jW as j,h as F,p as h,jh as I,G as a,S as o}from"./index-CeyyVc1v.js";import{S as E}from"./SimpleTable-DBAoNnCU.js";import{d as S}from"./Plagiarism-BiXORbzo.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const b=()=>{const[c,i]=n.useState(),l=m(),s=f(),{registeredComplaints:r}=A(e=>e.provinceFinancialSlice);return n.useEffect(()=>{s(x()),s(j()).then(e=>{s(F())})},[]),n.useEffect(()=>{const e=r==null?void 0:r.map((t,p)=>[t.title,t.description,h(t==null?void 0:t.createDate),t.state==="pending"?"در حال بررسی":t.state==="accepted"?"تایید شده":"رد شده",u.jsx(d,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>l(I+t.poultryRequestId),children:u.jsx(S,{})},p)]);i(e)},[]),u.jsx(u.Fragment,{children:u.jsx(C,{display:"flex",justifyContent:"center",children:u.jsx(a,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsx(a,{container:!0,justifyContent:"space-between",gap:o.SMALL,children:u.jsx(a,{xs:12,children:u.jsx(a,{mt:o.SMAll,children:u.jsx(E,{name:"شکایات ثبت شده",columns:[" موضوع"," توضیحات"," تاریخ ثبت"," وضعیت"," پرونده"],data:c})})})})})})})};export{b as default}; diff --git a/build/assets/ProvinceFinancialDebts-BtSseWWb.js b/build/assets/ProvinceFinancialDebts-BtSseWWb.js new file mode 100644 index 0000000..5ad1f4e --- /dev/null +++ b/build/assets/ProvinceFinancialDebts-BtSseWWb.js @@ -0,0 +1 @@ +import{j as u,al as o,ak as i,B as n,b as a}from"./mui-vendor-CkIVaoQP.js";import{r as l}from"./react-vendor-CmFgShSM.js";import{u as c}from"./redux-vendor-B7uoacJt.js";import{u as d,c as p,b as C,M as h,G as r,S as t,N as m,jV as x}from"./index-CeyyVc1v.js";import{S as j}from"./SimpleTable-DBAoNnCU.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const A=()=>{const e=d({initialValues:{price:"",description:""},validationSchema:p({description:h().required("لطفا پیغام خود را بنویسید!").typeError("لطفا فیلد را پر کنید!"),price:C().required("لطفا عدد وارد کنید!").typeError("لطفا فیلد را پر کنید!")})});return l.useEffect(()=>{e.validateForm()},[]),u.jsx(r,{children:u.jsxs(r,{container:!0,gap:t.SMALL,direction:"column",children:[u.jsx(r,{children:u.jsx(o,{disablePortal:!0,id:"province",renderInput:s=>u.jsx(i,{...s,label:"انتخاب مرغدار "})})}),u.jsx(r,{children:u.jsx(i,{fullWidth:!0,id:"price",label:"مبلغ",variant:"outlined",value:e.values.price,error:e.touched.price?!!e.errors.price:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.price&&e.errors.price?e.errors.price:null})}),u.jsx(r,{children:u.jsx(i,{fullWidth:!0,multiline:!0,rows:5,id:"description",label:"توضیحات",variant:"outlined",value:e.values.description,error:e.touched.description?!!e.errors.description:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.description&&e.errors.description?e.errors.description:null})}),u.jsx(r,{children:u.jsx(n,{fullWidth:!0,variant:"contained",children:"ثبت اطلاعات"})})]})})},M=()=>{const e=c();return u.jsx(u.Fragment,{children:u.jsx(a,{display:"flex",justifyContent:"center",children:u.jsx(r,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsxs(r,{justifyContent:"center",my:t.MEDIUM,children:[u.jsx(r,{container:!0,xs:12,alignItems:"start",gap:t.SMALL,direction:"column",children:u.jsx(n,{startIcon:u.jsx(x,{}),className:"first-step",variant:"contained",onClick:()=>{e(m({title:"ثبت اطلاعات جوجه ریزی",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(A,{})}))},children:"ثبت بدهی جدید"})}),u.jsx(r,{container:!0,justifyContent:"space-between",gap:t.SMALL,children:u.jsx(r,{width:"100%",mt:t.MEDIUM,children:u.jsx(j,{columns:["نام مرغدار","مبلغ","توضیحات","سند"],data:[["ssss"]]})})})]})})})})};export{M as default}; diff --git a/build/assets/ProvinceFinancialDocumentRegister-B88BVveg.js b/build/assets/ProvinceFinancialDocumentRegister-B88BVveg.js new file mode 100644 index 0000000..6651912 --- /dev/null +++ b/build/assets/ProvinceFinancialDocumentRegister-B88BVveg.js @@ -0,0 +1 @@ +import{j as u,B as T,a3 as B,aL as Ku,aM as Yu,T as v,aN as Ju,ak as k,al as _u,i as ku,ag as Xu,av as Zu,aw as Qu,ax as Au,aU as ue,aa as ee,p as M,I as wu,aJ as te,ch as ne,aX as Nu,am as ae,an as re,aI as Bu,d as oe,ap as le,aq as Fu,b as se}from"./mui-vendor-CkIVaoQP.js";import{j as pu,u as vu,c as Tu,b as Cu,M as H,L as O,jX as ie,h as R,V as du,jY as q,S as j,k as ce,r as Mu,A as Pu,G as h,N as W,jZ as de,j_ as Ce,j$ as pe,O as he,C as xe,jh as ye,p as me,k0 as fe}from"./index-CeyyVc1v.js";import{A as Ae}from"./AdvancedTable-BYmmBtmq.js";import{r as f,u as Ou,b as V,j as Du,f as Fe}from"./react-vendor-CmFgShSM.js";import{a as hu,u as $,f as xu}from"./redux-vendor-B7uoacJt.js";import{d as je}from"./Search-Dek2fED1.js";import{c as be,a as ge}from"./city-get-city-qTSRxslT.js";import{d as ve}from"./FilterAlt-scT0HEUg.js";import{d as Te}from"./NavigateNext-ByUC5RGi.js";import{S as bu}from"./SimpleTable-DBAoNnCU.js";import{d as Ie}from"./Info-CZK82--l.js";import{I as Ru,f as Vu}from"./toBase64-BzgTOHsW.js";import{N as Se}from"./NumberFormatCustom-DwWPj40N.js";import{N as gu}from"./num2persian-BIYy8amq.js";import{d as Le}from"./Download-DQ-VVIaV.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Delete-C5MyLelE.js";import"./PublishedWithChanges-C8kvr_m4.js";const Ee=hu("PROVINCE_FINANCIAL_SEARCH_USER_DOCUMENT",async C=>{const{data:c,status:r}=await pu.get("searchwallet/?type=filter&value="+C);return{data:c,status:r}}),_e=()=>{const[C,c]=f.useState(!0),[r,g]=f.useState(!1),_=()=>{c(!C)},x=$(),[A,F]=f.useState(),[E,l]=f.useState(),[b,I]=f.useState(),[p,s]=f.useState(),[z,y]=f.useState(!0),[G,w]=f.useState([]),S=xu(d=>d.provinceFinancialSlice.userWaletInfo),o=vu({initialValues:{username:"",fullname:"",mobile:"",nationalcode:""},validationSchema:Tu({fullname:H().typeError("لطفا فیلد را پر کنید!"),username:Cu().typeError("لطفا عدد وارد کنید!"),mobile:Cu().test("len","شماره تلفن باید با 0 شروع شود",(d,n)=>{var i;if(((i=n.originalValue)==null?void 0:i.length)>0)return n.originalValue&&n.originalValue.startsWith("0")}).test("len","شماره تماس 11 رقم باید باشد",(d,n)=>{var i;if(((i=n.originalValue)==null?void 0:i.length)>0&&n.originalValue)return n.originalValue.length===11}).typeError("لطفا عدد وارد کنید!"),nationalcode:Cu()})});f.useEffect(()=>{o.validateForm(),x(O()),x(ie()).then(()=>{var d;(d=x(be()))==null||d.then(n=>{F(n.payload.data),x(R())})})},[]);const yu=()=>{const d=Object.values(o.values).filter(i=>i.length>0);let n="";for(let i=0;i{x(R());const L=i.payload.data,m=L==null?void 0:L.map((t,a)=>{const P=du(t.role);return[a+1,t.fullname,P,t.mobile,t.nationalId,t.province,t.city,t.creditor.toLocaleString()+" ریال",t.debtor.toLocaleString()+" ریال",t.penalty.toLocaleString()+" ریال",Math.abs(t.depositable).toLocaleString(),u.jsx(T,{onClick:()=>{N(q+t.walletKey+"/"+t.id)},children:"مشاهده"},a)]});w(m)})};f.useEffect(()=>{const d=S==null?void 0:S.map((n,i)=>{const L=du(n.role);return[i+1,n.fullname,L,n.mobile,n.nationalId,n.province,n.city,n.creditor.toLocaleString()+" ریال",n.debtor.toLocaleString()+" ریال",n.penalty.toLocaleString()+" ریال",Math.abs(n.depositable).toLocaleString(),u.jsx(T,{onClick:()=>{N(q+n.walletKey+"/"+n.id)},children:"مشاهده"},i)]});w(d)},[S]);const mu=()=>{g(!r)};f.useEffect(()=>{if(r){const d=S.filter(i=>i.creditor>1||i.debtor>1||i.penalty>1),n=d==null?void 0:d.map((i,L)=>{const m=du(i.role);return[L+1,i.fullname,m,i.mobile,i.nationalId,i.province,i.city,i.creditor.toLocaleString()+" ریال",i.debtor.toLocaleString()+" ریال",i.penalty.toLocaleString()+" ریال",Math.abs(i.depositable).toLocaleString()+" ریال",u.jsx(T,{onClick:()=>{N(q+i.walletKey+"/"+i.id)},children:"مشاهده"},L)]});w(n)}else{const d=S==null?void 0:S.map((n,i)=>{const L=du(n.role);return[i+1,n.fullname,L,n.mobile,n.nationalId,n.province,n.city,n.creditor.toLocaleString()+" ریال",n.debtor.toLocaleString()+" ریال",n.penalty.toLocaleString()+" ریال",Math.abs(n.depositable).toLocaleString()+" ریال",u.jsx(T,{onClick:()=>{N(q+n.walletKey+"/"+n.id)},children:"مشاهده"},i)]});w(d)}},[r]);const fu=()=>o.isValid?Object.values(o.values).filter(d=>d.length>0).length===0&&!p:!0;f.useEffect(()=>{b&&(x(O()),x(ge(b)).then(d=>{l(d.payload.data),y(!1),x(R())}))},[b]);const N=Ou();return u.jsx(u.Fragment,{children:u.jsx(B,{container:!0,justifyContent:"space-between",gap:j.SMALL,children:u.jsxs(B,{justifyContent:"start",xs:12,mt:j.MEDIUM,children:[u.jsxs(Ku,{expanded:C,onChange:_,children:[u.jsx(Yu,{expandIcon:u.jsx(ce,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:u.jsx(v,{children:"جستجو"})}),u.jsx(Ju,{children:u.jsxs(B,{container:!0,xs:12,gap:j.SMALL,children:[u.jsx(B,{children:u.jsx(k,{size:"small",id:"username",label:"کد کاربری",value:o.values.username,error:o.touched.username?!!o.errors.username:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.username&&o.errors.username?o.errors.username:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(B,{children:u.jsx(k,{size:"small",id:"fullname",label:"نام و نام خانوادگی",value:o.values.fullname,error:o.touched.fullname?!!o.errors.fullname:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.fullname&&o.errors.fullname?o.errors.fullname:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(B,{children:u.jsx(k,{size:"small",id:"mobile",label:"تلفن",value:o.values.mobile,error:o.touched.mobile?!!o.errors.mobile:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.mobile&&o.errors.mobile?o.errors.mobile:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(B,{children:u.jsx(k,{size:"small",id:"nationalcode",label:"کد ملی",value:o.values.nationalcode,error:o.touched.nationalcode?!!o.errors.nationalcode:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.nationalcode&&o.errors.nationalcode?o.errors.nationalcode:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(B,{children:u.jsx(_u,{sx:{minWidth:"150px"},size:"small",disablePortal:!0,id:"province",options:A?A==null?void 0:A.map(d=>({id:d.key,label:d.name})):[],onChange:(d,n)=>{I(n.id)},renderInput:d=>u.jsx(k,{...d,label:"استان"})})}),u.jsx(B,{children:u.jsx(_u,{sx:{minWidth:"180px"},size:"small",disabled:z,disablePortal:!0,id:"city",options:E?E.map(d=>({id:d.key,label:d.name})):[],onChange:(d,n)=>{s(n.label)},renderInput:d=>u.jsx(k,{...d,label:"شهر"})})}),u.jsx(T,{disabled:fu(),onClick:yu,variant:"contained",endIcon:u.jsx(je,{}),children:"جستجو"}),u.jsx(T,{onClick:mu,variant:"contained",endIcon:u.jsx(ve,{}),sx:{backgroundColor:"#e3e3e3",color:"#000","&:hover":{backgroundColor:"#d0d0d0"}},children:r?u.jsx(u.Fragment,{children:"حذف فیلتر"}):u.jsx(u.Fragment,{children:" فقط کاربران دارای تراکنش"})})]})})]}),u.jsx(B,{mt:j.SMAll,children:u.jsx(Ae,{columns:["ردیف","نام و نام خانوادگی","نقش","تلفن","کد ملی","استان","شهر","بستانکار","بدهکار","جریمه","قابل واریز","مشاهده"],data:G})})]})})})};var Iu={},we=ku;Object.defineProperty(Iu,"__esModule",{value:!0});var Uu=Iu.default=void 0,Ne=we(Mu()),Be=u;Uu=Iu.default=(0,Ne.default)((0,Be.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var Su={},De=ku;Object.defineProperty(Su,"__esModule",{value:!0});var Wu=Su.default=void 0,ke=De(Mu()),Me=u;Wu=Su.default=(0,ke.default)((0,Me.jsx)("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"CheckBoxOutlineBlank");const Pe=hu("PROVINCE_FINANCIAL_SUBMIT_FINANCIAL_TRANSACTION",async C=>{const{data:c,status:r}=await pu.post("financial_transaction/",C);return{data:c,status:r}}),$u=({profileid:C,walletkey:c})=>{const[r,g]=V.useState([]),[_,x]=V.useState([]),[A]=f.useContext(Pu),F=$(),E=(b,I)=>{g(b),x(b.map(p=>Vu(p.data_url)))},l=vu({initialValues:{debt:"",description:"",transactionType:""},validationSchema:Tu({debt:Cu().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),description:H().typeError("لطفا فیلد را به درستی پر کنید!"),transactionType:H().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی پر کنید!")})});return f.useEffect(()=>{l.validateForm()},[]),u.jsx(h,{className:"slaughter-new-request-form",container:!0,gap:j.SMALL,direction:"column",flex:"1",justifyContent:"space-between",children:u.jsxs(h,{container:!0,gap:j.SMALL,direction:"column",children:[u.jsxs(Xu,{fullWidth:!0,children:[u.jsx(Zu,{id:"demo-simple-select-label",children:"نوع تراکنش"}),u.jsxs(Qu,{labelId:"demo-simple-select-label",id:"transactionType",label:"نوع تراکنش",value:l.values.transactionType,error:l.touched.transactionType?!!l.errors.transactionType:null,onChange:b=>{l.setFieldValue("transactionType",b.target.value)},onBlur:l.handleBlur,children:[u.jsx(Au,{value:"debtor",children:"بدهی"}),u.jsx(Au,{value:"penalty",children:"جریمه"}),u.jsx(Au,{value:"deposit",children:"واریز"})]}),u.jsx(ue,{children:l.touched.transactionType&&l.errors.transactionType?l.errors.transactionType:null})]}),u.jsx(Se,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"debt",label:"مبلغ بدهی را وارد کنید",variant:"outlined",InputLabelProps:{shrink:!0},InputProps:{endAdornment:u.jsx(ee,{position:"start",children:"ریال"})},value:l.values.debt,error:l.touched.debt?!!l.errors.debt:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.debt&&l.errors.debt?l.errors.debt:null}),u.jsx(k,{multiline:!0,rows:4,fullWidth:!0,id:"description",label:"توضیحات",variant:"outlined",value:l.values.description,error:l.touched.description?!!l.errors.description:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.description&&l.errors.description?l.errors.description:null}),u.jsx(v,{children:"پیوست تصویر"}),u.jsx(Ru,{id:"image",onChange:E,images:r,maxNumber:4,title:"بارگذاری سند"}),u.jsx(T,{disabled:!l.isValid,fullWidth:!0,variant:"contained",onClick:()=>{F(O()),F(Pe({wallet_receive:c,type:l.values.transactionType,cost:l.values.debt,user_id:C,image:_})).then(b=>{F(R()),b.error?A({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(F(W({right:!1,bottom:!1,content:null})),A({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),window.location.reload(!1))})},children:"ثبت اطلاعات"})]})})};$u.propTypes={profileid:M.PropTypes.any,walletkey:M.PropTypes.any};const Oe=hu("PROVINCE_FINANCIAL_SUBMIT_FINANCIAL_DOCUMENT",async C=>{const{data:c,status:r}=await pu.post("financialdocument/",C);return{data:c,status:r}}),zu=({payable:C,transactionsList:c,userId:r,paymentType:g,userKey:_})=>{const[x]=f.useContext(Pu),[A,F]=V.useState([]),[E,l]=V.useState([]),b=$(),I=(s,z)=>{F(s),l(s.map(y=>Vu(y.data_url)))},p=vu({initialValues:{paymentId:"",description:""},validationSchema:Tu({paymentId:H().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی پر کنید!"),description:H().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی پر کنید!")})});return f.useEffect(()=>{p.validateForm()},[]),u.jsxs(h,{container:!0,direction:"column",display:"flex",justifyContent:"space-between",children:[u.jsxs(h,{className:"slaughter-new-request-form",container:!0,gap:j.SMALL,direction:"column",children:[u.jsxs(h,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:j.TINY,color:s=>s.palette.grey.A700,children:"مبلغ:"}),u.jsx(v,{mr:j.TINY,variant:"body2",fontWeight:"bold",children:Math.abs(C).toLocaleString()})]}),u.jsxs(h,{display:"flex",children:[u.jsx(v,{variant:"body2",mr:j.TINY,color:s=>s.palette.grey.A700,children:"به حروف:"}),u.jsxs(v,{mr:j.TINY,variant:"body2",fontWeight:"bold",children:[gu(Math.abs(C))," ریال"]})]}),u.jsxs(h,{container:!0,gap:j.SMALL,direction:"column",children:[u.jsx(k,{fullWidth:!0,id:"paymentId",label:"شناسه پرداخت",variant:"outlined",value:p.values.paymentId,error:p.touched.paymentId?!!p.errors.paymentId:null,onChange:p.handleChange,onBlur:p.handleBlur,helperText:p.touched.paymentId&&p.errors.paymentId?p.errors.paymentId:null}),u.jsx(k,{multiline:!0,rows:4,fullWidth:!0,id:"description",label:"توضیحات",variant:"outlined",value:p.values.description,error:p.touched.description?!!p.errors.description:null,onChange:p.handleChange,onBlur:p.handleBlur,helperText:p.touched.description&&p.errors.description?p.errors.description:null}),u.jsx(v,{children:"پیوست تصویر"}),u.jsx(Ru,{id:"image",onChange:I,images:A,maxNumber:4,title:"بارگذاری سند"})]})]}),u.jsx(h,{children:u.jsx(T,{disabled:!p.isValid,fullWidth:!0,variant:"contained",onClick:()=>{b(O()),b(Oe({cost:Math.abs(C),description:p.values.description,payment_code:p.values.paymentId,image:E,type:g,transaction_list:c,user_id:r})).then(s=>{b(R()),s.error?x({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(window.location.reload(!1),b(W({right:!1,bottom:!1,content:null})),x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت اطلاعات"})})]})};zu.propTypes={payable:M.PropTypes.any,transactionsList:M.PropTypes.any,userId:M.PropTypes.any,paymentType:M.PropTypes.any,userKey:M.PropTypes.any};const Gu=({paymentCode:C})=>{var g,_;const c=$(),{transactionInfo:r}=xu(x=>x.provinceFinancialSlice);return f.useEffect(()=>{c(O()),c(de(C)).then(()=>{c(R())})},[]),u.jsxs(h,{className:"slaughter-new-request-form",container:!0,gap:j.SMALL,direction:"column",flex:"1",justifyContent:"space-between",children:[u.jsxs(v,{variant:"body2",color:"primary",children:["مبلغ بدهی: ",r==null?void 0:r.cost.toLocaleString()]}),u.jsxs(v,{variant:"body2",color:"primary",children:["شناسه پرداخت: ",C]}),u.jsxs(v,{variant:"body2",color:"primary",children:["توضیحات:",r!=null&&r.description?r==null?void 0:r.description:"ندارد"]}),(g=r==null?void 0:r.image)!=null&&g.length?u.jsxs(h,{container:!0,gap:j.SMALL,children:[u.jsx(v,{variant:"body2",children:"پیوست سند:"}),(_=r==null?void 0:r.image)==null?void 0:_.map((x,A)=>[u.jsx("a",{href:x,children:u.jsx("img",{alt:"سند بدهکاری",style:{width:"100%"},src:x})},A),u.jsx(T,{style:{width:"100%"},startIcon:u.jsx(Le,{}),target:"_blank",variant:"outlined",href:x,children:"دانلود سند"},A)])]}):u.jsx(v,{variant:"body2",color:"secondary",children:"سند ثبت نشده است"})]})};Gu.propTypes={paymentCode:M.PropTypes.any};function qu({profileid:C}){const[c,r]=f.useState(),{financialHistory:g}=xu(x=>x.provinceFinancialSlice),_=$();return f.useEffect(()=>{_(Ce(C))},[]),f.useEffect(()=>{const x=g==null?void 0:g.map((A,F)=>[F+1,A.totalCreditor-A.totalDebtors<0?"بدهی":"طلبکار",A.nationalId,A.totalCreditor,A.totalDebtors,A.cost,A.paymentCode,A.image.length?A.image.map((E,l)=>[u.jsx(h,{display:"flex",children:u.jsx("a",{href:E,alt:"دانلود",children:u.jsx("img",{src:E,width:"80",height:"80",alt:"دانلود",style:{borderRadius:"5px"}})})},`SlaughterPaymentFactorImage${l}`)]):"بدون پیوست",A.description]);r(x)},[g]),u.jsx(h,{xs:12,container:!0,justifyContent:"space-between",gap:j.SMALL,mt:j.SMALL,mb:j.SMALL,children:u.jsx(bu,{name:"سابقه اسناد مالی",columns:["ردیف","نوع سند","کدملی","بستانکار","بدهکار","قابل واریز","شناسه پرداخت","سند پرداخت","توضیحات"],data:c})})}qu.propTypes={profileid:M.PropTypes.string};const Re=hu("PROVINCE_FINANCIAL_CHANGE_TRANSACTION_STATE",async C=>{const{data:c,status:r}=await pu.put("typecheck/0/",C);return{data:c,status:r}});function U(C,c){return C.filter(r=>c.indexOf(r)===-1)}function ju(C,c){return C.filter(r=>c.indexOf(r)!==-1)}function Ve(C,c){return[...C,...U(c,C)]}const Ue=()=>{const{userFinancialInfo:C}=xu(m=>m.provinceFinancialSlice),[c,r]=f.useState({creditor:"",debtor:"",payable:""}),[g,_]=f.useState({creditor:"",debtor:"",payable:""}),[x,A]=f.useState([]),F=$(),E=Ou(),{userid:l}=Du(),{profileid:b}=Du(),[I,p]=V.useState([]),[s,z]=V.useState([]),[y,G]=V.useState([]),w=ju(I,s),S=ju(I,y),[o,yu]=f.useState(!1);f.useEffect(()=>{F(O()),F(pe(l)).then(()=>{F(R()),yu(!o)})},[]),f.useEffect(()=>{G(C)},[o]);const mu=m=>()=>{const t=I.indexOf(m),a=[...I];t===-1?a.push(m):a.splice(t,1),p(a)},fu=m=>{if((m==null?void 0:m.length)===0)return!0;for(let t=0;t<(m==null?void 0:m.length);t++)return m[t].transactionType==="creditor"},N=m=>ju(I,m).length,d=m=>()=>{const t=m.filter(a=>a.transactionType==="penalty"||a.transactionType==="negative"||a.transactionType==="positive"||a.transactionType==="debtor"||a.transactionType==="deposit");N(t)===(t==null?void 0:t.length)?p(U(I,t)):p(Ve(I,t))},n=()=>{G(y.concat(w)),z(U(s,w)),p(U(I,w))},i=()=>{z(s.concat(S)),G(U(y,S)),p(U(I,S))};f.useEffect(()=>{let m=y==null?void 0:y.filter(e=>(e==null?void 0:e.transactionType)==="creditor"),t=0;for(let e=0;e<(m==null?void 0:m.length);e++)t=t+m[e].transferAmount;let a=y==null?void 0:y.filter(e=>e.transactionType==="debtor"),P=0;for(let e=0;e<(a==null?void 0:a.length);e++)P=P+a[e].transferAmount;let D=y==null?void 0:y.filter(e=>e.transactionType==="penalty"),K=0;for(let e=0;e<(D==null?void 0:D.length);e++)K=K+D[e].transferAmount;let Y=y==null?void 0:y.filter(e=>e.transactionType==="deposit"),J=0;for(let e=0;e<(Y==null?void 0:Y.length);e++)J=J+Y[e].transferAmount;let X=y==null?void 0:y.filter(e=>e.transactionType==="positive"),Z=0;for(let e=0;e<(X==null?void 0:X.length);e++)Z=Z+X[e].transferAmount;let Q=y==null?void 0:y.filter(e=>e.transactionType==="negative"),uu=0;for(let e=0;e<(Q==null?void 0:Q.length);e++)uu=uu+Q[e].transferAmount;let eu=s==null?void 0:s.filter(e=>e.transactionType==="creditor"),tu=0;for(let e=0;e<(eu==null?void 0:eu.length);e++)tu=tu+eu[e].transferAmount;let Lu=s==null?void 0:s.filter(e=>e.transactionType==="debtor"),nu=0;for(let e=0;ee.transactionType==="penalty"),ru=0;for(let e=0;e<(au==null?void 0:au.length);e++)ru=ru+au[e].transferAmount;let Eu=s==null?void 0:s.filter(e=>e.transactionType==="deposit"),ou=0;for(let e=0;ee.transactionType==="positive"),su=0;for(let e=0;e<(lu==null?void 0:lu.length);e++)su=su+lu[e].transferAmount;let iu=s==null?void 0:s.filter(e=>e.transactionType==="negative"),cu=0;for(let e=0;e<(iu==null?void 0:iu.length);e++)cu=cu+iu[e].transferAmount;r({creditor:tu+ou+su,debtor:nu+ru+cu,payable:tu+ou+su-(nu+ru+cu)}),_({creditor:t+J+Z,debtor:P+K+uu,payable:Math.abs(t+J+Z-(P+K+uu))});const Hu=s.map(e=>e.key);A(Hu)},[s,y]);const L=(m,t)=>u.jsxs(te,{children:[u.jsx(ne,{avatar:u.jsx(Nu,{onClick:d(t),checked:N(t)===(t==null?void 0:t.length)&&(t==null?void 0:t.length)!==0,indeterminate:N(t)!==(t==null?void 0:t.length)&&N(t)!==0,disabled:(t==null?void 0:t.length)===0,inputProps:{"aria-label":"همه موارد انتخاب شده اند"}}),title:m,subheader:`${N(t)}/${t==null?void 0:t.length} انتخاب شده`}),u.jsx(ae,{}),u.jsxs(re,{sx:{height:250,bgcolor:"background.paper",overflow:"auto"},dense:!0,component:"div",role:"list",children:[u.jsx(Bu,{sx:{border:"1px dashed grey"},children:u.jsxs(h,{xs:12,display:"flex",justifyContent:"space-between",children:[u.jsx(v,{children:"انتخاب سند"}),u.jsx(v,{children:"نوع سند"}),u.jsx(v,{children:"کد پیگیری"}),u.jsx(v,{children:"مبلغ"}),u.jsx(v,{children:"زمان ثبت"})]})}),u.jsx(Bu,{children:t==null?void 0:t.map((a,P)=>{const D=`transfer-list-all-item-${a}-label`;return u.jsxs(h,{display:"flex",justifyContent:"space-between",children:[u.jsx(h,{item:!0,children:u.jsx(oe,{title:a.transactionType==="creditor"&&"امکان انجام عملیات روی تراکنش در انتظار پرداخت وجود ندارد",placement:"top-start",children:u.jsx(le,{children:u.jsx(Nu,{icon:a.transactionType==="creditor"?u.jsx(Uu,{}):u.jsx(Wu,{}),color:"secondary",disabled:a.transactionType==="creditor",onClick:mu(a),checked:I.indexOf(a)!==-1,tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":D}})})})}),u.jsxs(h,{item:!0,display:"flex",alignItems:"center",children:[u.jsx(Fu,{style:{color:a.transactionType==="creditor"?"blue":a.transactionType==="penalty"?"yellow":a.transactionType==="debtor"?"red":a.transactionType==="deposit"?"green":a.transactionType==="positive"?"purple":a.transactionType==="negative"?"brown":"pink"},id:D,primary:a.transactionType==="creditor"?"پرداخت نشده":a.transactionType==="penalty"?"جریمه":a.transactionType==="debtor"?"بدهکار":a.transactionType==="deposit"?"واریزی":a.transactionType==="positive"?"بستانکار از سند":a.transactionType==="negative"?"بدهی از سند":"نامشخص"}),u.jsx(wu,{disabled:!(a.transactionType==="deposit"&&a.state==="waiting"),"aria-label":"delete",color:"primary",onClick:()=>{F(W({right:!1,bottom:!1,content:null})),F(he({title:"تراکنش را تایید میکنید؟",content:u.jsxs(h,{container:!0,gap:j.SMALL,children:[u.jsx(T,{color:"primary",variant:"contained",onClick:()=>{F(O()),F(Re({transaction_key:a.key,state:"accepted"})).then(()=>{F(R()),window.location.reload(!1)})},children:"بله"}),u.jsx(T,{variant:"outlined",onClick:()=>{F(xe())},children:"خیر"})]})}))},children:u.jsx(Ie,{})})]}),u.jsx(h,{item:!0,children:a.fileId>0?u.jsx(T,{size:"small",onClick:()=>{E(ye+a.fileId)},children:a.paymentCode}):u.jsx(T,{size:"small",onClick:()=>{F(W({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Gu,{paymentCode:a.paymentCode}),title:"اطلاعات سند بدهکاری"}))},children:a.paymentCode})}),u.jsx(h,{item:!0,children:u.jsx(Fu,{id:D,primary:a.transferAmount.toLocaleString()+" ریال"})}),u.jsx(h,{item:!0,children:u.jsx(Fu,{id:D,primary:me(a.createDate)})})]},P)})})]})]});return u.jsxs(h,{children:[u.jsx(h,{container:!0,alignItems:"center",children:u.jsxs(wu,{"aria-label":"delete",color:"primary",onClick:()=>E(-1),children:[u.jsx(Te,{}),u.jsx(v,{children:"بازگشت"})]})}),u.jsxs(h,{container:!0,direction:"column",justifyContent:"center",mt:j.SMALL,children:[u.jsxs(h,{xs:12,container:!0,justifyContent:"end",gap:j.SMALL,children:[u.jsx(T,{className:"new-request-form-button",variant:"contained",onClick:()=>{F(W({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx($u,{profileid:b,walletkey:l}),title:"ایجاد سند جدید"}))},children:"ایجاد سند جدید"}),u.jsxs(h,{xs:12,display:"flex",gap:j.SMALL,children:[u.jsx(bu,{columns:["بستانکار","بدهکار","قابل واریز","قابل واریز به حروف","اقدام"],data:[[c.creditor.toLocaleString()+" ریال",c.debtor.toLocaleString()+" ریال",Math.abs(c.payable).toLocaleString()+" ریال",gu(Math.abs(c.payable).toLocaleString())+" ریال",u.jsx(T,{disabled:(s==null?void 0:s.length)===0,size:"small",variant:"outlined",onClick:()=>{F(W({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(zu,{paymentType:c.payable<0?"negative":c.payable>1?"positive":"zero",payable:c.payable,transactionsList:x,userId:b,userKey:l}),title:"ایجاد سند مالی"}))},children:c.payable>0?u.jsx(u.Fragment,{children:"ایجاد سند مالی (طلبکار)"}):c.payable<0?u.jsx(u.Fragment,{children:"ایجاد سند مالی (بدهکار)"}):u.jsx(u.Fragment,{children:"ایجاد سند مالی "})},"test")]]}),u.jsx(bu,{columns:["بستانکار","بدهکار","قابل واریز","قابل واریز به حروف"],data:[[g.creditor.toLocaleString()+" ریال",g.debtor.toLocaleString()+" ریال",g.payable.toLocaleString()+" ریال",gu(g.payable)+" ریال"]]})]})]}),u.jsxs(h,{xs:12,mt:j.MEDIUM,container:!0,spacing:2,justifyContent:"center",alignItems:"center",children:[u.jsx(h,{item:!0,xs:5.5,children:L("انتخاب شده ها",s)}),u.jsx(h,{item:!0,children:u.jsxs(h,{container:!0,direction:"column",alignItems:"center",children:[u.jsx(T,{sx:{my:.5},variant:"outlined",size:"small",onClick:n,disabled:(w==null?void 0:w.length)===0,"aria-label":"move selected right",children:">"}),u.jsx(T,{sx:{my:.5},variant:"outlined",size:"small",onClick:i,disabled:fu(S),"aria-label":"move selected left",children:"<"})]})}),u.jsx(h,{item:!0,xs:5.5,children:L("انتخاب شده",y)})]}),u.jsx(qu,{profileid:b})]})]})},l6=()=>{const{pathname:C}=Fe();return u.jsx(u.Fragment,{children:u.jsx(se,{display:"flex",justifyContent:"center",children:u.jsx(h,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsx(h,{container:!0,justifyContent:"space-between",gap:j.SMALL,children:u.jsxs(h,{xs:12,children:[C.includes(fe)&&u.jsx(_e,{}),C.includes(q)&&u.jsx(Ue,{})]})})})})})};export{l6 as default}; diff --git a/build/assets/ProvinceFreeSales-oCkrGhR8.js b/build/assets/ProvinceFreeSales-oCkrGhR8.js new file mode 100644 index 0000000..d69ab8c --- /dev/null +++ b/build/assets/ProvinceFreeSales-oCkrGhR8.js @@ -0,0 +1,2 @@ +import{i as I6,j as u,aO as u0,aP as e0,aQ as r0,aR as l0,aS as n0,aT as t0,T as j,ak as f,B as R,p as o0,ao as a0,ap as n6,aq as t6,al as l6,aa as B6,ag as Gu,ah as Ju,am as s6,av as s0,aw as i0,ax as Iu,aU as c0,I as Nu,aX as C0,ai as Ou,aj as zu,bi as h6,b0 as A6,an as v6,b4 as p6,ar as i6,d as Yu,b2 as L6,b3 as Wu}from"./mui-vendor-CkIVaoQP.js";import{r as D6,A as bu,$ as d0,u as Du,c as ku,M as J,X as W,G as o,S as $,m as h0,L as U,fc as k6,K as _6,a1 as c6,h as D,fd as A0,N as gu,O as Vu,C as Lu,j as G,a0 as S6,fe as v0,ff as T6,du as p0,b as Bu,c2 as x0,v as Tu,W as Uu,fg as E6,p as Qu}from"./index-CeyyVc1v.js";import{r as i,b as R6}from"./react-vendor-CmFgShSM.js";import{u as ju,a as _u,f as mu}from"./redux-vendor-B7uoacJt.js";import{g as $6}from"./useRequestFile-FPqBpZfN.js";import{A as F0}from"./index-9Ymn_7Kv.js";import{R as o6,a as u6}from"./index.esm-Bu7XMDZU.js";import{L as y0}from"./LabelField-B6eRSoQP.js";import{a as g0}from"./aviculture-get-hatching-data-DsjDNd82.js";import{d as P6}from"./Delete-C5MyLelE.js";import{d as Zu}from"./Add--yVWBJhC.js";import{N as C6}from"./NumberFormatCustom-DwWPj40N.js";import{D as b0}from"./DialogAlert-BfXcr-Kr.js";import{d as j0}from"./Done-Dp5awdte.js";import{a as f0}from"./aviculture-get-unions-C1NoVg85.js";import{C as N6}from"./CarPelak-BYFY8OXg.js";import{b as d6}from"./index-CIfb_iLp.js";import{i as k0}from"./isValidIndexWeight-C_ik-uYa.js";import{R as Hu}from"./ResponsiveTable-w7hk7Uq8.js";import{d as x6}from"./Tune-D4M2CAhp.js";import{d as F6}from"./Edit-CqBj1Y2L.js";import{d as M6}from"./Close-_jAEIgMD.js";import{V as _0}from"./VetFarmSubmitClearanceCode-B4m3TtXY.js";import{d as S0}from"./ToggleOn-pBgb8alR.js";import{d as E0}from"./ToggleOff-D4LkiR4X.js";import{d as $0}from"./Check-CRb6laYC.js";import{d as P0}from"./Sms-DasNClAG.js";var y6={},q0=I6;Object.defineProperty(y6,"__esModule",{value:!0});var w0=y6.default=void 0,I0=q0(D6()),B0=u;w0=y6.default=(0,I0.default)((0,B0.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Create");const L0=({id:r,file:s,updateTable:n})=>{var O,H,k,m,M;const[v,,y,,c,,]=i.useContext(bu),[C]=i.useState(!1),[d]=d0(),x=Du({initialValues:{rejectText:"",canHaching:"False"},validationSchema:ku({rejectText:J().required("این فیلد اجباری است!").typeError("لطفا دلیل خود را بیان کنید.")})}),[E,B]=i.useState(!1),X=((O=s==null?void 0:s.hatching)==null?void 0:O.allowHatching)==="pending"&&((H=s==null?void 0:s.hatching)==null?void 0:H.leftOver)!==0,w=!x.values.canHaching&&X,g=ju(),h=W()==="ProvinceOperator"?"تایید اطلاعات بجای شهرستان":"ثبت اطلاعات و ارسال به استان";return u.jsx(u.Fragment,{children:!C&&u.jsxs(u0,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(e0,{children:[u.jsx(r0,{color:"secondary"}),u.jsx(l0,{})]}),u.jsxs(o,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",xs:12,children:[u.jsxs(o,{container:!0,children:[u.jsx(o,{children:u.jsx(n0,{variant:"body1",fontWeight:"bold",color:"secondary",children:"انجام عملیات"})}),u.jsx(o,{children:u.jsx(t0,{color:"textSecondary",children:u.jsx(j,{variant:"body2",children:"در این مرحله درخواست را تایید یا رد کنید."})})})]}),u.jsx(o,{container:!0,xs:12,children:u.jsx(o,{xs:12,children:u.jsx(o,{container:!0,gap:$.SMALL,padding:$.SMALL,xs:12,children:u.jsx(F0,{children:E?u.jsx(h0.div,{animate:{x:-10,opacity:1},transition:{duration:.3},initial:{opacity:0},exit:{opacity:0},children:u.jsxs(o,{flexDirection:"column",container:!0,gap:$.SMALL,xs:12,children:[u.jsx(o,{children:u.jsx(f,{multiline:!0,rows:4,fullWidth:!0,id:"rejectText",label:"پیام خود را وارد کنید",variant:"outlined",value:x.values.rejectText,error:x.touched.rejectText?!!x.errors.rejectText:null,onChange:x.handleChange,onBlur:x.handleBlur,helperText:x.touched.rejectText&&x.errors.rejectText?x.errors.rejectText:null})}),u.jsxs(o,{container:!0,gap:$.SMALL,xs:12,children:[u.jsx(o,{children:u.jsx(R,{fullWidth:!0,variant:"outlined",color:"secondary",onClick:()=>{B(!1)},children:"لغو"})}),u.jsx(o,{container:!0,xs:12,children:u.jsx(R,{fullWidth:!0,disabled:!x.values.rejectText,variant:"outlined",onClick:()=>{g(U()),g(k6({message:x.values.rejectText,key:s==null?void 0:s.key,allow_hatching:x.values.canHaching,state:"reject",role:W()})).then(z=>{n&&n(),g(_6({selectedDate1:y,selectedDate2:c})),g(c6({selectedDate1:y,selectedDate2:c})),$6(d,r,g),g(D())})},children:"رد اطلاعات و پیام به مرغدار"})})]})]})}):u.jsxs(o,{container:!0,direction:"column",alignItems:"start",gap:$.SMALL,children:[u.jsxs(o,{container:!0,gap:$.TINY,direction:"column",alignItems:"start",children:[u.jsxs(o,{container:!0,gap:$.TINY,children:[u.jsx(j,{variant:"body2",fontWeight:"bold",children:"تعداد درخواست کشتار:"}),u.jsxs(j,{children:[(k=s==null?void 0:s.quantity)==null?void 0:k.toLocaleString()," قطعه"]})]}),u.jsxs(o,{container:!0,gap:$.TINY,children:[u.jsx(j,{variant:"body2",fontWeight:"bold",children:"تعداد باقی مانده از جوجه ریزی:"}),u.jsxs(j,{children:[(M=(m=s==null?void 0:s.hatching)==null?void 0:m.leftOver)==null?void 0:M.toLocaleString()," قطعه"]})]}),!!X&&u.jsx(o,{container:!0,gap:$.TINY,alignItems:"start"})]}),u.jsxs(o,{container:!0,gap:$.SMALL,xs:12,children:[u.jsx(R,{fullWidth:!0,disabled:w,variant:"outlined",color:"error",onClick:()=>{B(!0)},children:"رد اطلاعات و پیام به مرغدار"}),u.jsx(o,{xs:12,children:u.jsx(R,{fullWidth:!0,disabled:w,variant:"outlined",onClick:()=>{g(U()),g(k6({key:s==null?void 0:s.key,allow_hatching:x.values.canHaching,state:"accept",role:W()})).then(z=>{$6(d,r,g),g(D()),z.error?v({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(n&&n(),g(_6({selectedDate1:y,selectedDate2:c})),g(c6({selectedDate1:y,selectedDate2:c})),g(A0({selectedDate1:y,selectedDate2:c})),g(gu({right:!1,bottom:!1,content:null})),v({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),W()==="ProvinceOperator"&&g(Vu({title:"عملیات با موفقیت انجام شد.",content:u.jsxs(o,{xs:12,container:!0,direction:"column",gap:$.MEDIUM,alignItems:"center",justifyContent:"center",children:[u.jsx(o,{children:u.jsx(j,{color:"green",children:"پرونده به کارتابل (در انتظار تخصیص) انتقال پیدا کرد."})}),u.jsx(o,{children:u.jsx(R,{variant:"contained",color:"success",onClick:()=>{g(Lu())},children:"تایید"})})]})})))})},children:h})})]})]})})})})})]})]})})};L0.propTypes={file:o0.PropTypes.object};const D0=_u("PROVINCE_GET_POULTRY",async(r,{dispatch:s})=>{s(U());const{data:n,status:v}=await G.get("get-all-poultry/",{params:{role:W(),active_hatching:!0,...r}});return s(D()),{data:n,status:v}}),g6=_u("AVICULTURE_GET_WAGE_TYPE",async()=>{const{data:r,status:s}=await G.get("poultry-out-province-wage-type");return{data:r,status:s}}),T0=({fetchApiData:r})=>{var j6,f6;const[s]=i.useContext(bu),[n,v]=i.useState(""),[y,c]=i.useState(""),[C,d]=i.useState(""),[x,E]=i.useState(""),[B,X]=i.useState(""),[w,g]=i.useState(""),[h,O]=i.useState(""),[H,k]=i.useState(""),[m]=i.useState(!1),[M,z]=i.useState(!1),[V,p]=i.useState(),[K,Au]=i.useState(""),[Q,cu]=i.useState(""),[F,Y]=i.useState(),[e,lu]=i.useState([]),[eu,au]=i.useState(),[I,P]=i.useState(),[b,nu]=i.useState(),[Z,_]=i.useState("poultry"),[L,Cu]=i.useState(!1),[ru,du]=i.useState([]),[tu,hu]=i.useState(!1),q=l=>{var A;_(l.target.value),l.target.value==="poultry"?iu.setFieldValue("mobile",(A=F==null?void 0:F.user)==null?void 0:A.mobile):I?iu.setFieldValue("mobile",I.mobile):iu.setFieldValue("mobile","")},[t,vu]=i.useState([]),Su=(l,A,uu,yu)=>{vu([l,A,uu,yu])},Eu=[{type:"text",id:1,value:""}],$u=[{type:"text",id:1,value:""}],[su,pu]=i.useState(Eu),[xu,Fu]=i.useState($u),[fu,Pu]=i.useState(),{weightRange:Mu}=mu(l=>l.provinceSlice),T=ju(),{avicultureChickenPrice:S}=mu(l=>l.avicultureSlice);i.useEffect(()=>{T(U()),T(S6()),T(v0()),T(g6()).then(l=>{Pu(l.payload.data.status)}),T(T6()).then(l=>{lu(l.payload.data)}),T(D())},[]);const[ou,Ru]=i.useState(),[Xu,U6]=i.useState();i.useEffect(()=>{T(U()),T(p0()),T(f0()).then(l=>{var A,uu,yu,Ku;((uu=(A=l==null?void 0:l.payload)==null?void 0:A.data)==null?void 0:uu.length)>0?Ru((Ku=(yu=l==null?void 0:l.payload)==null?void 0:yu.data[0])==null?void 0:Ku.key):Ru([])}),T(D())},[]);const K6=()=>{su.length<3&&(pu(l=>[...l,{type:"text",value:""}]),Fu(l=>[...l,{type:"text",value:""}]))},G6=()=>{const l=su.length-1;if(l!==0){const A=su.filter((yu,Ku)=>Ku!==l),uu=xu.filter((yu,Ku)=>Ku!==l);pu(A),Fu(uu)}},Q6=l=>{l.preventDefault();const A=l.target.id;pu(uu=>{const yu=uu.slice();return yu[A].value=l.target.value,yu})},qu=l=>{l.preventDefault();const A=l.target.id;Fu(uu=>{const yu=uu.slice();return yu[A].value=l.target.dataset.value,yu})};i.useEffect(()=>{S&&p(S==null?void 0:S.key)},[S]);const a=Du({initialValues:{noChicken:"",sellType:{cash:!0,haveTime:!1},price1:"",price2:"",price3:"",slaughterDate:Tu(Date()).format("YYYY-MM-DD"),period1:"4",period2:"4",period3:"4",weight:"",losses:"0",isUnion:m,isStockMarket:M,isAccepted:!1,selectedSlaughters:[],killer_kill_house_city:"",killer_kill_house_province:"",killer_kill_house_unit_name:"",kill_house_unique_id:"",intermediaryNumber:""},validationSchema:ku({noChicken:J().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!").min(0,"تعداد وارد شده از حداقل ممکن کمتر است").max(Q,"تعداد وارد شده از کل موجودی بیشتر است"),isAccepted:x0().test("req","باید تعهد نامه را بپذیرید!",(l,A)=>A.originalValue&&A.originalValue===!0).required("این فیلد اجباری است!"),price1:Bu().typeError("لطفا عدد وارد کنید!").min(S==null?void 0:S.floorPrice,"قیمت وارد شده از کف قیمت امروز کمتر است").max(S==null?void 0:S.ceilingPrice,"قیمت وارد شده از سقف قیمت امروز بیشتر است"),price2:Bu().typeError("لطفا عدد وارد کنید!").min(S==null?void 0:S.floorPrice,"قیمت وارد شده از کف قیمت امروز کمتر است").max(S==null?void 0:S.ceilingPrice,"قیمت وارد شده از سقف قیمت امروز بیشتر است"),price3:Bu().typeError("لطفا عدد وارد کنید!").min(S==null?void 0:S.floorPrice,"قیمت وارد شده از کف قیمت امروز کمتر است").max(S==null?void 0:S.ceilingPrice,"قیمت وارد شده از سقف قیمت امروز بیشتر است"),weight:Bu().test("weight","وزن را تا دو رقم اعشار وارد کنید",(l,A)=>A.originalValue&&A.originalValue.toString().length<=4).required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!"),losses:Bu().required("این فیلد اجباری است!").max(w,"تلفات وارد شده از باقیمانده بیشتر است!").typeError("لطفا تعداد تلفات را وارد کنید!"),sellType:ku().test("sellType","نحوه فروش را انتخاب کنید!",(l,A)=>A.originalValue&&Object.values(A.originalValue).some(uu=>uu===!0)).required("این فیلد اجباری است!"),intermediaryNumber:J().min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد")})}),N=Du({initialValues:{driverName:"",driverMobile:"",driverCar:"",driverhealthCode:""},validationSchema:ku({driverName:J().required("این فیلد اجباری است!"),driverMobile:J().required("این فیلد اجباری است!").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),driverCar:J().required("این فیلد اجباری است!"),driverhealthCode:J().required("این فیلد اجباری است!").matches(/^[^*&^%$#@!()|.]*$/,"این فیلد نباید شامل کاراکترهای ویژه باشد!")})}),iu=Du({initialValues:{mobile:"",weight:"",quantity:""},validationSchema:ku({mobile:J().required("شماره موبایل الزامی است").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),weight:Bu(),quantity:Bu()})}),wu=Du({initialValues:{healthCode:""},validationSchema:ku({healthCode:J().required("این فیلد اجباری است!").matches(/^[^*&^%$#@!()|.]*$/,"این فیلد نباید شامل کاراکترهای ویژه باشد!")})}),X6=()=>{wu.values.healthCode.trim()&&(du([...ru,wu.values.healthCode]),wu.resetForm(),hu(!1))},Z6=l=>{du(ru.filter((A,uu)=>uu!==l))};i.useEffect(()=>{var l;iu.setFieldValue("mobile",(l=F==null?void 0:F.user)==null?void 0:l.mobile)},[F]);const a6=a.values.noChicken*1e3,J6=u.jsxs(u.Fragment,{children:[u.jsxs(j,{variant:"body1",children:["اینجانب ",(j6=F==null?void 0:F.user)==null?void 0:j6.fullname," موافقت خود را نسبت به موارد ذکر شده اعلام می نمایم."]}),u.jsxs(a0,{children:[u.jsx(n6,{children:u.jsx(j0,{})}),u.jsx(t6,{primary:` بر اساس این توافق نامه در صورت لغو فروش ${a.values.noChicken} قطعه + مرغ ${a6==null?void 0:a6.toLocaleString()} ریال جریمه خواهم شد.`})]}),u.jsx(j,{})]});i.useEffect(()=>{T(U()),T(D0()).then(l=>{E(l.payload.data),T(D())})},[]),i.useEffect(()=>{let l=a.values.weight;const A=a.values.weight.toString().split(".").join("");a.values.weight&&A.length<=3&&(A.length===2&&(l=A[0]+"."+A[1]),A.length===3&&(l=A[0]+"."+A[1]+A[2])),isNaN(Number.parseFloat(l))?a.setFieldValue("weight",""):a.setFieldValue("weight",Number.parseFloat(l))},[a.values.weight]),i.useEffect(()=>{M&&T(S6()).then(l=>{Array.isArray(l.payload.data)?(s({vertical:"top",horizontal:"center",msg:"قیمت روز مرغ در سامانه ثبت نشده است.",severity:"error"}),T(gu({right:!1,bottom:!1,content:null}))):T(D())})},[M]),i.useEffect(()=>{a.validateForm(),N.validateForm()},[]),i.useEffect(()=>{B&&(T(U()),T(g0(B)).then(l=>{l.payload.data?(c(l.payload.data),T(D())):s({vertical:"top",horizontal:"center",msg:"اطلاعات جوجه ریزی یافت نشد!",severity:"error"}),T(D())}))},[B,F]),i.useEffect(()=>{cu(C==null?void 0:C.leftOver)},[a.values.losses,H,a.values.noChicken,C]),i.useEffect(()=>{g(C==null?void 0:C.quantity),O(C==null?void 0:C.losses),k(C==null?void 0:C.leftOver)},[C]);const e6=()=>(I==null?void 0:I.type)==="killer"?a.values.killer_kill_house_city&&a.values.killer_kill_house_province&&a.values.killer_kill_house_unit_name:!0,r6=()=>fu?iu.isValid:!0,m6=()=>Z==="poultry"?L?a.isValid&&r6()&&eu&&N&&t[0]&&e6():a.isValid&&r6()&&eu&&e6():L?a.isValid&&eu&&N&&t[0]&&e6()&&r6():a.isValid&&eu&&e6()&&r6();return u.jsxs(o,{container:!0,gap:$.SMALL,direction:"column",display:"flex",children:[u.jsxs(o,{container:!0,gap:$.SMALL,direction:"column",children:[u.jsx(o,{minWidth:210,children:u.jsx(l6,{disablePortal:!0,id:"combo-box-demo",getOptionDisabled:l=>l.disabled,options:x?x.map(l=>({id:l.key,label:`${l.unitName} / ${l.user.mobile} / ${l.lastHatchingRemainQuantity.toLocaleString()} `,item:l,disabled:!l.lastHatchingRemainQuantity})):[],onChange:(l,A)=>{d(null),v(null),nu(null),X(A.id),Y(A.item)},renderInput:l=>u.jsx(f,{...l,label:"محل پرورش/تلفن/مانده جوجه ریزی"})})}),F!=null&&F.provinceAllowSellFree?u.jsxs(o,{container:!0,direction:"column",gap:$.SMALL,width:"100%",children:[u.jsx(o,{minWidth:210,children:u.jsx(l6,{disablePortal:!0,id:"hatching",value:b,options:y?y.map(l=>{var A,uu;return{id:l.key,race:l.chickenBreed,selected:l,label:`دوره ${l.period} سالن ${l.hall} نژاد ${l.chickenBreed} باقیمانده ${(A=l==null?void 0:l.lastHatchingDiffrentRequestQuantity)!=null&&A.leftOver?(uu=l==null?void 0:l.lastHatchingDiffrentRequestQuantity)==null?void 0:uu.leftOver:l.leftOver} قطعه`}}):[],onChange:(l,A)=>{nu(A.label),v(A.id),d(A.selected);let uu=A.race;uu.includes("-")&&(uu="ترکیبی"),Au(uu)},renderInput:l=>u.jsx(f,{...l,label:"دوره جوجه ریزی"})})}),u.jsx(o,{children:u.jsx(f,{disabled:!0,fullWidth:!0,id:"outlined-read-only-input",label:"تعداد جوجه ریزی",value:w||"نامشخص",InputProps:{readOnly:!0}})}),u.jsx(o,{children:u.jsx(f,{disabled:!0,fullWidth:!0,id:"outlined-read-only-input",label:"جمع تلفات ثبت شده دامپزشک و مرغدار",value:h||"نامشخص",InputProps:{readOnly:!0}})}),u.jsx(o,{children:u.jsx(f,{disabled:!0,fullWidth:!0,id:"outlined-read-only-input",label:"باقیمانده",value:Q||"نامشخص",InputProps:{readOnly:!0}})})]}):F&&u.jsx(j,{color:"error",variant:"body",children:"مرغدار اجازه فروش مستقیم ندارد!"})]}),C&&u.jsxs(o,{container:!0,gap:$.SMALL,direction:"column",children:[u.jsx(j,{children:"اطلاعات کشتار"}),u.jsxs(o,{container:!0,gap:$.TINY,children:[u.jsxs(o,{container:!0,gap:$.TINY,children:[u.jsx(j,{color:l=>l.palette.grey.A700,variant:"caption",children:"باقیمانده:"}),u.jsx(j,{variant:"button",children:Q}),u.jsx(j,{variant:"button",children:"قطعه"})]}),u.jsx(o,{container:!0,children:u.jsxs(o,{container:!0,gap:$.TINY,alignItems:"center",children:[u.jsx(j,{color:l=>l.palette.grey.A700,variant:"caption",children:"سن مرغ:"}),u.jsx(j,{variant:"button",children:C.age}),u.jsx(j,{variant:"button",children:"روزه"})]})}),u.jsx(o,{container:!0,xs:12,children:u.jsx(Uu,{label:"تاریخ کشتار",id:"slaughterDate",renderInput:l=>u.jsx(f,{fullWidth:!0,...l}),value:a.values.slaughterDate,error:a.touched.slaughterDate?!!a.errors.slaughterDate:null,onChange:l=>{a.setFieldValue("slaughterDate",Tu(l).format("YYYY-MM-DD"))},onBlur:a.handleBlur,helperText:a.touched.slaughterDate&&a.errors.slaughterDate?a.errors.slaughterDate:null})}),u.jsx(o,{container:!0,xs:12,children:u.jsx(C6,{allowLeadingZeros:!0,thousandSeparator:",",id:"noChicken",label:"تعداد مرغ برای کشتار",variant:"outlined",value:a.values.noChicken,error:a.touched.noChicken?!!a.errors.noChicken:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.noChicken&&a.errors.noChicken?a.errors.noChicken:null})}),u.jsx(o,{container:!0,xs:12,children:u.jsx(f,{id:"weight",label:"وزن تقریبی مرغ",variant:"outlined",InputProps:{endAdornment:u.jsx(B6,{position:"end",children:"کیلوگرم"})},value:a.values.weight,error:a.touched.weight?!!a.errors.weight:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.weight&&a.errors.weight?a.errors.weight:null})})]}),a.values.weight&&u.jsxs(j,{variant:"body2",style:{color:"green"},children:["وزن کل:"," ",parseInt(parseInt(a.values.noChicken)*parseFloat(a.values.weight)).toLocaleString()," ","کیلوگرم"]}),u.jsx(o,{display:"none",children:u.jsx(Gu,{children:u.jsx(Ju,{"aria-labelledby":"demo-radio-buttons-group-label",defaultValue:"فروش اتحادیه",name:"radio-buttons-group",onChange:l=>{z(l.currentTarget.value)},children:M==="فروش مزایده ای"&&u.jsxs(o,{container:!0,gap:$.SMALL,children:[u.jsxs(o,{container:!0,gap:$.SMALL,alignItems:"center",children:[u.jsx(j,{color:l=>l.palette.grey.A700,variant:"caption",children:"کف قیمت امروز:"}),u.jsxs(j,{color:"secondary",variant:"button",children:[S!=null&&S.floorPrice?S==null?void 0:S.floorPrice.toLocaleString():"نامشخص"," "," ","ریال"]})]}),u.jsxs(o,{container:!0,gap:$.SMALL,alignItems:"center",children:[u.jsx(j,{color:l=>l.palette.grey.A700,variant:"caption",children:"سقف قیمت امروز:"}),u.jsxs(j,{color:"secondary",variant:"button",children:[S!=null&&S.ceilingPrice?S==null?void 0:S.ceilingPrice.toLocaleString():"نامشخص"," "," ","ریال"]})]}),u.jsx(s6,{style:{width:"100%"}}),su.map((l,A)=>u.jsxs(o,{gap:$.SMALL,container:!0,sx:{minWidth:210},children:[u.jsxs(j,{mb:$.SMALL,display:"flex",children:["پیشنهاد ",A+1]}),u.jsx(C6,{allowLeadingZeros:!0,thousandSeparator:",",error:!1,fullWidth:!0,label:"قیمت پیشنهادی",variant:"outlined",onChange:Q6,id:A}),u.jsxs(Gu,{fullWidth:!0,children:[u.jsx(s0,{id:"demo-simple-select-label",children:"بازه زمانی (ساعت)"}),u.jsxs(i0,{id:A,labelId:"demo-simple-select-label",label:"بازه زمانی (ساعت)",children:[u.jsx(Iu,{onClick:qu,id:A,value:"1",children:"1"}),u.jsx(Iu,{onClick:qu,id:A,value:"2",children:"2"}),u.jsx(Iu,{onClick:qu,id:A,value:"3",children:"3"}),u.jsx(Iu,{onClick:qu,id:A,value:"4",children:"4"}),u.jsx(Iu,{onClick:qu,id:A,value:"5",children:"5"}),u.jsx(Iu,{onClick:qu,id:A,value:"6",children:"6"}),u.jsx(Iu,{onClick:qu,id:A,value:"7",children:"7"}),u.jsx(Iu,{onClick:qu,id:A,value:"8",children:"8"}),u.jsx(Iu,{onClick:qu,id:A,value:"9",children:"9"}),u.jsx(Iu,{onClick:qu,id:A,value:"10",children:"10"})]}),u.jsx(c0,{children:a.touched.period1&&a.errors.period1?a.errors.period1:null})]})]},l==null?void 0:l.id)),u.jsxs(o,{container:!0,children:[su.length>1&&u.jsx(Nu,{onClick:G6,"aria-label":"delete",color:"secondary",children:u.jsx(P6,{})}),su.length<3&&u.jsxs(Nu,{xs:12,onClick:K6,"aria-label":"add",color:"primary",children:[u.jsx(Zu,{}),u.jsx(j,{children:"افزودن پیشنهاد جدید"})]})]}),u.jsx(o,{container:!0,sx:{width:"100%"},children:u.jsxs(j,{variant:"body2",children:["در صورت عدم فروش در بورس، از طریق اتحادیه فروش برود",u.jsx(C0,{id:"isUnion",onChange:a.handleChange})]})})]})})})}),u.jsxs(o,{container:!0,gap:$.SMALL,direction:"column",children:[u.jsx(j,{variant:"body1",children:"اطلاعات خریدار"}),u.jsx(l6,{disablePortal:!0,id:"combo-box-demo",getOptionDisabled:l=>l.disabled,options:e?e==null?void 0:e.map(l=>({id:l.key,label:l.type==="killhouse"?`کشتارگاه ${l==null?void 0:l.unitName} / ${l.mobile} / استان ${l==null?void 0:l.province}/ ${l==null?void 0:l.city}`:`کشتارکن ${l==null?void 0:l.fullname} / ${l.mobile} / استان ${l==null?void 0:l.province}/ ${l==null?void 0:l.city}`,item:l,mobile:l.mobile})):[],onChange:(l,A)=>{au(A.id),P(A.item),Z==="buyer"&&iu.setFieldValue("mobile",A.mobile)},renderInput:l=>u.jsx(f,{...l,label:"انتخاب خریدار"})}),(I==null?void 0:I.type)==="killer"&&u.jsxs(o,{container:!0,direction:"column",gap:$.SMALL,children:[u.jsx(f,{id:"killer_kill_house_unit_name",label:"نام کشتارگاه",variant:"outlined",sx:{width:"100%",height:"100%"},value:a.values.killer_kill_house_unit_name,onChange:a.handleChange,onBlur:a.handleBlur,error:a.touched.killer_kill_house_unit_name?!!a.errors.killer_kill_house_unit_name:null,helperText:a.touched.killer_kill_house_unit_name&&a.errors.killer_kill_house_unit_name?a.errors.killer_kill_house_unit_name:null}),u.jsx(f,{id:"kill_house_unique_id",label:"شناسه یکتا کشتارگاه",variant:"outlined",sx:{width:"100%",height:"100%"},value:a.values.kill_house_unique_id,onChange:a.handleChange,onBlur:a.handleBlur,error:a.touched.kill_house_unique_id?!!a.errors.kill_house_unique_id:null,helperText:a.touched.kill_house_unique_id&&a.errors.kill_house_unique_id?a.errors.kill_house_unique_id:null}),u.jsx(f,{id:"killer_kill_house_province",label:"استان کشتارگاه",variant:"outlined",sx:{width:"100%",height:"100%"},value:a.values.killer_kill_house_province,onChange:a.handleChange,onBlur:a.handleBlur,error:a.touched.killer_kill_house_province?!!a.errors.killer_kill_house_province:null,helperText:a.touched.killer_kill_house_province&&a.errors.killer_kill_house_province?a.errors.killer_kill_house_province:null}),u.jsx(f,{id:"killer_kill_house_city",label:"شهر کشتارگاه",variant:"outlined",sx:{width:"100%",height:"100%"},value:a.values.killer_kill_house_city,onChange:a.handleChange,onBlur:a.handleBlur,error:a.touched.killer_kill_house_city?!!a.errors.killer_kill_house_city:null,helperText:a.touched.killer_kill_house_city&&a.errors.killer_kill_house_city?a.errors.killer_kill_house_city:null})]})]}),(I==null?void 0:I.key)&&u.jsxs(u.Fragment,{children:[u.jsxs(o,{container:!0,xs:12,alignItems:"center",justifyContent:"center",gap:$.SMALL,children:[u.jsxs(Nu,{color:L?"error":"primary",onClick:()=>{Cu(!L)},children:[u.jsxs(j,{variant:"body1",color:L?"error":"primary",children:[" ","افزودن خودرو"]}),L?u.jsx(d6,{}):u.jsx(Zu,{})]}),L&&u.jsxs(o,{container:!0,xs:12,alignItems:"center",justifyContent:"center",gap:$.SMALL,children:[u.jsx(j,{variant:"body1",children:"اطلاعات خودرو حمل"}),u.jsx(f,{label:"نام و نام خانوادگی راننده",name:"driverName",value:N.values.driverName,onChange:N.handleChange,error:N.touched.driverName&&!!N.errors.driverName,helperText:N.touched.driverName&&N.errors.driverName,required:!0,fullWidth:!0}),u.jsx(f,{label:"تلفن راننده",name:"driverMobile",value:N.values.driverMobile,onChange:N.handleChange,onBlur:a.handleBlur,error:N.touched.driverMobile&&!!N.errors.driverMobile,helperText:N.touched.driverMobile&&N.errors.driverMobile,required:!0,fullWidth:!0}),u.jsx(f,{label:"مدل خودرو",name:"driverCar",value:N.values.driverCar,onChange:N.handleChange,error:N.touched.driverCar&&!!N.errors.driverCar,helperText:N.touched.driverCar&&N.errors.driverCar,type:"tel",required:!0,fullWidth:!0}),u.jsx(N6,{width:"100%",handleChange:Su}),u.jsx(f,{id:"driverhealthCode",label:"کد بهداشتی حمل",variant:"outlined",sx:{width:"100%",height:"100%"},value:N.values.driverhealthCode,onChange:N.handleChange,onBlur:N.handleBlur,error:N.touched.driverhealthCode?!!N.errors.driverhealthCode:null,helperText:N.touched.driverhealthCode&&N.errors.driverhealthCode?N.errors.driverhealthCode:null})]})]}),u.jsxs(o,{container:!0,xs:12,spacing:$,alignItems:"center",justifyContent:"center",mt:2,children:[u.jsx(o,{item:!0,xs:12,mb:$.SMALL,children:u.jsx(j,{variant:"body1",sx:{mb:1},children:"کدهای بهداشتی حمل و نقل"})}),ru.length>0&&u.jsx(o,{item:!0,xs:12,mb:2,children:ru.map((l,A)=>u.jsxs(o,{container:!0,spacing:1,alignItems:"center",sx:{mb:1},children:[u.jsx(o,{item:!0,xs:10,children:u.jsx(f,{value:l,disabled:!0,fullWidth:!0,variant:"outlined",label:`کد بهداشتی ${A+1}`})}),u.jsx(o,{item:!0,xs:2,children:u.jsx(Nu,{color:"error",onClick:()=>Z6(A),"aria-label":"حذف",children:u.jsx(P6,{})})})]},A))}),tu&&u.jsx(o,{item:!0,xs:12,children:u.jsxs(o,{container:!0,spacing:2,alignItems:"center",children:[u.jsx(o,{item:!0,xs:9,children:u.jsx(f,{label:"کد بهداشتی حمل و نقل جدید",name:"healthCode",value:wu.values.healthCode,onChange:wu.handleChange,onBlur:wu.handleBlur,error:wu.touched.healthCode&&!!wu.errors.healthCode,helperText:wu.touched.healthCode&&wu.errors.healthCode,variant:"outlined"})}),u.jsx(o,{item:!0,xs:3,children:u.jsx(R,{variant:"contained",color:"success",onClick:X6,startIcon:u.jsx(Zu,{}),fullWidth:!0,sx:{fontSize:"12px"},children:"افزودن"})})]})}),u.jsx(o,{item:!0,xs:12,mt:tu?2:0,mb:2,children:u.jsx(R,{variant:"outlined",color:"primary",onClick:()=>hu(!tu),startIcon:tu?u.jsx(d6,{}):u.jsx(Zu,{}),fullWidth:!0,children:tu?"لغو":"افزودن کد بهداشتی حمل"})})]})]}),fu&&u.jsxs(u.Fragment,{children:[u.jsx(y0,{label:"پرداخت کننده",children:u.jsx(Gu,{fullWidth:!0,children:u.jsxs(Ju,{row:!0,"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:Z,onChange:q,justifyContent:"space-between",children:[u.jsx(Ou,{value:"poultry",control:u.jsx(zu,{}),label:"مرغدار",sx:{marginRight:"auto"}}),u.jsx(Ou,{value:"buyer",control:u.jsx(zu,{}),label:"خریدار"})]})})}),u.jsxs(o,{container:!0,xs:12,alignItems:"center",justifyContent:"center",mt:1,p:1,gap:1,style:{borderStyle:"solid",borderWidth:"2px",borderColor:"gray",borderRadius:"5px"},children:[u.jsxs(j,{variant:"body2",color:"error",children:["از این قسمت میتوانید تلفن"," ",Z==="poultry"?"مرغدار":"خریدار"," را ویرایش کنید."]}),u.jsx(f,{fullWidth:!0,disabled:!0,id:"mobile",value:iu.values.mobile,error:iu.touched.mobile?!!iu.errors.mobile:null,onChange:iu.handleChange,onBlur:iu.handleBlur,helperText:iu.touched.mobile&&iu.errors.mobile?iu.errors.mobile:null,label:"موبایل",autoComplete:"current-password",variant:"outlined"})]})]}),u.jsx(o,{container:!0,xs:12,children:u.jsx(f,{id:"intermediaryNumber",label:"شماره واسطه (اختیاری)",variant:"outlined",value:a.values.intermediaryNumber,error:a.touched.intermediaryNumber?!!a.errors.intermediaryNumber:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.intermediaryNumber&&a.errors.intermediaryNumber?a.errors.intermediaryNumber:null})}),(ou==null?void 0:ou.length)>1&&u.jsxs(u.Fragment,{children:[u.jsx(s6,{}),u.jsx(o,{children:u.jsxs(Gu,{children:[u.jsx(h6,{id:"demo-radio-buttons-group-label",children:"انتخاب اتحادیه"}),u.jsx(Ju,{"aria-labelledby":"demo-radio-buttons-group-label",defaultValue:(f6=ou[0])==null?void 0:f6.key,name:"radio-buttons-group",onChange:l=>{U6(l.currentTarget.value)},children:ou.map(l=>u.jsx(u.Fragment,{children:u.jsx(Ou,{value:l.key,control:u.jsx(zu,{}),label:l.unitName})}))})]})})]}),u.jsx(o,{children:u.jsx(b0,{title:"تعهد نامه",content:J6,actions:u.jsxs(o,{container:!0,gap:$.TINY,children:[u.jsx(R,{variant:"outlined",color:"error",onClick:()=>{a.setFieldValue("isAccepted",!1)},children:"رد"}),u.jsx(R,{variant:"contained",color:"success",onClick:()=>{a.setFieldValue("isAccepted",!0)},children:"موافقم"})]}),btnTitle:"با تعهد نامه موافق هستم!",isAccepted:a.values.isAccepted})}),u.jsx(o,{mb:$.SMALL,children:u.jsx(R,{fullWidth:!0,disabled:!m6(),onClick:()=>{W()!=="SuperAdmin"&&W()!=="AdminX"&&!k0(Mu,C==null?void 0:C.age,a.values.weight)?s({vertical:"top",horizontal:"center",msg:"میانگین وزنی با احراز سنی مطابقت ندارد. لطفا با اتحادیه تماس بگیرید.",severity:"error"}):(T(U()),M==="فروش مزایده ای"?T(E6({operator_key:(ou==null?void 0:ou.length)>1?Xu:"",poultry_hatching_key:n,quantity:a.values.noChicken,send_date:a.values.slaughterDate,chicken_breed:K,Index_weight:a.values.weight,union:a.values.isUnion,losses:a.values.losses!==""?a.values.losses:0,auction:!0,auction_list:su.map((l,A)=>({pricing_key:V,fee:l.value?l.value:S==null?void 0:S.floorPrice,hour:xu[A].value?xu[A].value:"4"}))})).then(l=>{T(D()),l.error?l.error.message.includes("403")?s({vertical:"top",horizontal:"center",msg:"قیمت پیشنهادی نباید از حداکثر قیمت روز بیشتر باشد.",severity:"error"}):s({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(T(c6()),s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),T(gu({right:!1,bottom:!1,content:null})))}):T(E6({operator_key:(ou==null?void 0:ou.length)>1?Xu:"",poultry_hatching_key:n,poultry_key:F.key,role:W(),quantity:a.values.noChicken,send_date:a.values.slaughterDate,interface_number:a.values.intermediaryNumber?a.values.intermediaryNumber:null,chicken_breed:K,Index_weight:a.values.weight,hatching_left_over:parseInt(H),losses:a.values.losses!==""?a.values.losses:0,auction_list:[],cash:a.values.sellType.cash,credit:a.values.sellType.haveTime,kill_house_list:a.values.selectedSlaughters,killer_kill_house_unit_name:(I==null?void 0:I.type)==="killer"?a.values.killer_kill_house_unit_name:null,killer_kill_house_city:(I==null?void 0:I.type)==="killer"?a.values.killer_kill_house_city:null,killer_kill_house_province:(I==null?void 0:I.type)==="killer"?a.values.killer_kill_house_province:null,kill_house_unique_id:(I==null?void 0:I.type)==="killer"?a.values.kill_house_unique_id:null,out_province_driver_info:{driverName:L?N.values.driverName:null,driverMobile:L?N.values.driverMobile:null,driverCar:L?N.values.driverCar:null,driverPelak:L?t[0]+" "+t[1]+" "+t[2]+" "+t[3]:null,driverhealthCode:L?N.values.driverhealthCode:null},traffic_codes:ru.length>0?ru:null,out_province_poultry_request_buyer_key:eu,payer_type:Z,poultry_mobile:Z==="poultry"?iu.values.mobile:null,buyer_mobile:Z==="buyer"?iu.values.mobile:null})).then(l=>{var A;if(T(D()),(A=l.payload)!=null&&A.error){s({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"});return}else if(l.error){s({vertical:"top",horizontal:"center",msg:l.error.message||"خطا در ثبت درخواست",severity:"error"});return}else s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),r(1),T(gu({right:!1,bottom:!1,content:null}))}).catch(l=>{T(D()),s({vertical:"top",horizontal:"center",msg:l.message||"خطا در ثبت درخواست",severity:"error"})}))},size:"large",variant:"contained",children:"ثبت درخواست"})})]})]})},W6=_u("PROVINCE_OUT_REQUEST_CANCEL_REQUEST",async(r,{dispatch:s})=>{try{s(U());const{data:n,status:v}=await G.put("cancel-out-poultry_request/0/",r);return s(D()),{data:n,status:v}}catch(n){return s(D()),{error:n.response.data.result}}}),R0=_u("PROVINCE_FREE_SALE_EDIT_REQUEST",async(r,{dispatch:s})=>{s(U());try{const{data:n,status:v}=await G.put("Poultry_Request/0/",r);return s(D()),{data:n,status:v}}catch(n){return s(D()),{error:n.response.data.result}}}),V6=({item:r,fetchApiData:s})=>{var Q,cu,F,Y,e,lu,eu,au,I,P,b,nu,Z;const[n]=i.useContext(bu),[v,y]=i.useState(!!((Q=r==null?void 0:r.outProvinceDriverInfo)!=null&&Q.driverName)),c=ju(),C=Du({initialValues:{noChicken:r!=null&&r.quantity?r==null?void 0:r.quantity:"",weight:r!=null&&r.IndexWeight?r==null?void 0:r.IndexWeight:""},validationSchema:ku({noChicken:J().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),weight:Bu().test("weight","وزن را تا دو رقم اعشار وارد کنید",(_,L)=>L.originalValue&&L.originalValue.toString().length<=4).required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!")})}),d=Du({initialValues:{driverName:(cu=r==null?void 0:r.outProvinceDriverInfo)!=null&&cu.driverName?(F=r==null?void 0:r.outProvinceDriverInfo)==null?void 0:F.driverName:"",driverMobile:(Y=r==null?void 0:r.outProvinceDriverInfo)!=null&&Y.driverMobile?(e=r==null?void 0:r.outProvinceDriverInfo)==null?void 0:e.driverMobile:"",driverCar:(lu=r==null?void 0:r.outProvinceDriverInfo)!=null&&lu.driverCar?(eu=r==null?void 0:r.outProvinceDriverInfo)==null?void 0:eu.driverCar:"",driverhealthCode:(au=r==null?void 0:r.outProvinceDriverInfo)!=null&&au.driverhealthCode?(I=r==null?void 0:r.outProvinceDriverInfo)==null?void 0:I.driverhealthCode:""},validationSchema:ku({driverName:J().required("این فیلد اجباری است!"),driverMobile:J().required("این فیلد اجباری است!"),driverCar:J().required("این فیلد اجباری است!"),driverhealthCode:J().required("این فیلد اجباری است!")})}),x=Du({initialValues:{mobile:"",weight:"",quantity:""},validationSchema:ku({mobile:J().required("شماره موبایل الزامی است").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),weight:Bu(),quantity:Bu()})}),[E,B]=i.useState([]),X=(_,L,Cu,ru)=>{B([_,L,Cu,ru])},[w,g]=i.useState([]),[h,O]=i.useState(),[H,k]=i.useState(),[m,M]=i.useState();i.useEffect(()=>{var _;O((_=r==null?void 0:r.outProvincePoultryRequestBuyer)==null?void 0:_.key),c(g6()).then(L=>{M(L.payload.data.status)}),c(T6()).then(L=>{g(L.payload.data)})},[]);const[z,V]=i.useState("poultry"),p=_=>{V(_.target.value),_.target.value==="poultry"?x.setFieldValue("mobile",r.poultry.user.mobile):H?x.setFieldValue("mobile",H.mobile):x.setFieldValue("mobile",r==null?void 0:r.outProvincePoultryRequestBuyer.mobile)},K=()=>m?x.isValid:!0,Au=()=>z==="poultry"?v?C.isValid&&K()&&h&&d&&E[0]:C.isValid&&x.isValid&&h&&K():v?C.isValid&&h&&d&&E[0]&&K():C.isValid&&h&&K();return i.useEffect(()=>{x.setFieldValue("mobile",r.poultry.user.mobile)},[]),u.jsx(o,{container:!0,gap:$.SMALL,direction:"column",display:"flex",children:u.jsxs(o,{container:!0,gap:$.SMALL,direction:"column",children:[u.jsxs(o,{xs:12,container:!0,justifyContent:"space-between",alignItems:"center",children:[u.jsxs(j,{variant:"body2",style:{color:"gray"},children:["وزن کل:"," "]}),u.jsx(j,{variant:"body2",children:(P=Math.floor(r.IndexWeight*r.quantity))==null?void 0:P.toLocaleString()})]})," ",u.jsx(C6,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"noChicken",label:"تعداد مرغ برای کشتار",variant:"outlined",value:C.values.noChicken,error:C.touched.noChicken?!!C.errors.noChicken:null,onChange:C.handleChange,onBlur:C.handleBlur,helperText:C.touched.noChicken&&C.errors.noChicken?C.errors.noChicken:null}),u.jsx(f,{id:"weight",label:"وزن تقریبی مرغ",variant:"outlined",InputProps:{endAdornment:u.jsx(B6,{position:"end",children:"کیلوگرم"})},value:C.values.weight,error:C.touched.weight?!!C.errors.weight:null,onChange:C.handleChange,onBlur:C.handleBlur,helperText:C.touched.weight&&C.errors.weight?C.errors.weight:null}),u.jsxs(o,{xs:12,container:!0,justifyContent:"space-between",alignItems:"center",children:[u.jsxs(j,{variant:"body2",style:{color:"gray"},children:["وزن کل:"," "]}),u.jsxs(j,{variant:"body2",children:[(b=Math.floor(parseInt(C.values.noChicken)*parseFloat(C.values.weight)))==null?void 0:b.toLocaleString(),"‌ ‌","کیلوگرم"]})]}),u.jsx(s6,{}),u.jsx(j,{variant:"body1",children:"اطلاعات خریدار"}),u.jsx(l6,{disablePortal:!0,id:"combo-box-demo",getOptionDisabled:_=>_.disabled,options:w?w==null?void 0:w.map(_=>({id:_.key,label:`${_==null?void 0:_.fullname} / ${_.mobile} / استان ${_==null?void 0:_.province}/ ${_==null?void 0:_.city}`,item:_,mobile:_.mobile})):[],onChange:(_,L)=>{O(L.id),k(L.item),z==="buyer"&&x.setFieldValue("mobile",L.mobile)},renderInput:_=>u.jsx(f,{..._,label:"انتخاب خریدار"})}),u.jsxs(o,{container:!0,xs:12,style:{borderStyle:"solid",borderWidth:"2px",borderColor:"red",borderRadius:"10px",padding:"5px"},alignItems:"center",children:[u.jsxs(j,{variant:"body2",color:"primary",children:["خریدار:","‌ ‌"]}),H?u.jsxs(j,{variant:"body2",children:[" ",H==null?void 0:H.fullname," (",H==null?void 0:H.mobile,")"]}):u.jsxs(j,{variant:"body2",children:[" ",(nu=r==null?void 0:r.outProvincePoultryRequestBuyer)==null?void 0:nu.fullname," (",(Z=r==null?void 0:r.outProvincePoultryRequestBuyer)==null?void 0:Z.mobile,")"]})]}),u.jsxs(o,{container:!0,xs:12,alignItems:"center",justifyContent:"center",gap:$.SMALL,children:[u.jsxs(Nu,{color:v?"error":"primary",onClick:()=>{y(!v)},children:[u.jsxs(j,{variant:"body1",color:v?"error":"primary",children:[" ","افزودن اطلاعات خودرو"]}),v?u.jsx(d6,{}):u.jsx(Zu,{})]}),v&&u.jsxs(o,{container:!0,xs:12,alignItems:"center",justifyContent:"center",gap:$.SMALL,children:[u.jsx(j,{variant:"body1",children:"اطلاعات خودرو حمل"}),u.jsx(f,{label:"نام و نام خانوادگی راننده",name:"driverName",value:d.values.driverName,onChange:d.handleChange,error:d.touched.driverName&&!!d.errors.driverName,helperText:d.touched.driverName&&d.errors.driverName,required:!0,fullWidth:!0}),u.jsx(f,{label:"تلفن راننده",name:"driverMobile",value:d.values.driverMobile,onChange:d.handleChange,error:d.touched.driverMobile&&!!d.errors.driverMobile,helperText:d.touched.driverMobile&&d.errors.driverMobile,required:!0,fullWidth:!0}),u.jsx(f,{label:"مدل خودرو",name:"driverCar",value:d.values.driverCar,onChange:d.handleChange,error:d.touched.driverCar&&!!d.errors.driverCar,helperText:d.touched.driverCar&&d.errors.driverCar,type:"tel",required:!0,fullWidth:!0}),u.jsx(N6,{width:"100%",handleChange:X}),u.jsx(f,{label:"کد بهداشتی حمل",name:"driverhealthCode",value:d.values.driverhealthCode,onChange:d.handleChange,error:d.touched.driverhealthCode&&!!d.errors.driverhealthCode,helperText:d.touched.driverhealthCode&&d.errors.driverhealthCode,required:!0,fullWidth:!0})]})]}),m&&u.jsxs(u.Fragment,{children:[u.jsxs(Gu,{children:[u.jsx(h6,{id:"demo-controlled-radio-buttons-group",children:"پرداخت کننده"}),u.jsxs(Ju,{row:!0,"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:z,onChange:p,children:[u.jsx(Ou,{value:"poultry",control:u.jsx(zu,{}),label:"مرغدار"}),u.jsx(Ou,{value:"buyer",control:u.jsx(zu,{}),label:"خریدار"})]})]}),u.jsxs(o,{container:!0,xs:12,alignItems:"center",justifyContent:"center",mt:1,p:1,gap:1,style:{borderStyle:"solid",borderWidth:"2px",borderColor:"gray",borderRadius:"5px"},children:[u.jsxs(j,{variant:"body2",color:"error",children:["از این قسمت میتوانید تلفن"," ",z==="poultry"?"مرغدار":"خریدار"," را ویرایش کنید."]}),u.jsx(f,{fullWidth:!0,disabled:!0,id:"mobile",value:x.values.mobile,error:x.touched.mobile?!!x.errors.mobile:null,onChange:x.handleChange,onBlur:x.handleBlur,helperText:x.touched.mobile&&x.errors.mobile?x.errors.mobile:null,label:"موبایل",autoComplete:"current-password",variant:"outlined"})]})]}),u.jsx(o,{mb:$.SMALL,children:u.jsx(R,{fullWidth:!0,variant:"contained",disabled:!Au(),onClick:()=>{c(R0({edit:!0,quantity:C.values.noChicken,Index_weight:parseInt(C.values.weight),poultry_request_key:r==null?void 0:r.key,out_province_driver_info:{driverName:v?d.values.driverName:null,driverMobile:v?d.values.driverMobile:null,driverCar:v?d.values.driverCar:null,driverPelak:v?E[0]+" "+E[1]+" "+E[2]+" "+E[3]:null,driverhealthCode:v?d.values.driverhealthCode:null},out_province_poultry_request_buyer_key:h,poultry_mobile:z==="poultry"?x.values.mobile:null,buyer_mobile:z==="buyer"?x.values.mobile:null})).then(_=>{_.payload.error?n({vertical:"top",horizontal:"center",msg:_.payload.error,severity:"error"}):(s(1),c(gu({right:!1,bottom:!1,content:null})),n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ویرایش درخواست"})})]})})},N0=({fetchApiData:r,item:s})=>{const n=ju(),[v,y]=i.useState(null),c=h=>{y(h.currentTarget)},C=()=>{y(null)},d=!!v,x=d?"popover":void 0,[E]=i.useContext(bu),B=W(),X=()=>{C(),n(gu({title:"ویرایش درخواست",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(V6,{item:s,fetchApiData:r})}))},w=()=>{C(),n(Vu({title:"آیا از لغو درخواست مطمئن هستید؟",content:u.jsxs(o,{children:[u.jsx(R,{variant:"contained",onClick:()=>{n(W6({role:B,poultry_request_key:s.key})).then(h=>{h.payload.error?E({vertical:"top",horizontal:"center",msg:h.payload.error,severity:"error"}):(r(1),E({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}),n(Lu())},children:"بله"}),u.jsx(R,{onClick:()=>{n(Lu())},children:"خیر"})]})}))},g=[{key:"edit",label:"ویرایش",color:"primary.main",icon:u.jsx(F6,{}),action:X,disabled:!!(s.quarantineCode||(s==null?void 0:s.outState)==="پرداخت شده")},{key:"cancel",label:"لغو",color:"error.main",icon:u.jsx(M6,{}),action:w,disabled:!s.provinceState==="pending"||!s.provinceState==="accepted"||(s==null?void 0:s.outState)==="پرداخت شده"||s.quarantineCode}];return u.jsxs(o,{container:!0,children:[u.jsx(Nu,{"aria-describedby":x,variant:"contained",color:"primary",onClick:c,children:u.jsx(x6,{})}),u.jsx(A6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:x,open:d,anchorEl:v,onClose:C,children:u.jsx(v6,{sx:{width:220,p:1},children:g.map(h=>u.jsxs(p6,{onClick:()=>{h.disabled||h.action()},disabled:!!h.disabled,sx:{borderRadius:1,mb:.5,color:h.disabled?"text.disabled":h.color,"&:last-of-type":{mb:0}},children:[u.jsx(n6,{sx:{color:h.disabled?"text.disabled":h.color,minWidth:40},children:h.icon}),u.jsx(t6,{primary:u.jsx(j,{sx:{color:h.disabled?"text.disabled":h.color,fontWeight:600},children:h.label})})]},h.key))})})]})},q6=({state:r})=>{const[s,n]=i.useState([]),[v,y]=i.useState(0),[c,C]=i.useState(10),[d,x]=i.useState(""),[E,B]=i.useState(1),[X,w]=i.useState([]),[g,h]=i.useState([]),[,,O,H,k,m]=i.useContext(bu),M=mu(F=>F.userSlice.userProfile.key),z=async F=>{p(U());const Y=await G.get(`out-province-poultry-requests/?search=filter&value=${d}&page=${F}&role=${W()}&page_size=${c}&date1=${O}&date2=${k}&state=${r}`);p(D()),n(Y.data.results),y(Y.data.count)},V=F=>{z(F),B(F)},p=ju();i.useEffect(()=>{const F=Tu(new Date).format("YYYY-MM-DD");H(F),m(F)},[]);const K=F=>{x(F.target.value)},Au=F=>{C(F),B(1)},Q=()=>{z(E!==0?E:1)};i.useEffect(()=>{const F=s==null?void 0:s.map((e,lu)=>{var eu,au,I,P,b,nu,Z,_,L,Cu,ru,du,tu,hu,q,t,vu,Su,Eu,$u,su,pu,xu,Fu,fu,Pu;return[E===1?lu+1:lu+c*(E-1)+1,W()==="CityOperator"?"-":u.jsx(N0,{item:e,fetchApiData:z}),u.jsx(i6,{label:e.outState,color:e.outState==="تایید شده"?"success":e.outState==="رد شده"?"error":"info",size:"small",variant:"outlined"},lu),`${(eu=e==null?void 0:e.totalWageAmount)==null?void 0:eu.toLocaleString()} ریال`,`${(au=e==null?void 0:e.registrar)==null?void 0:au.fullname}`,e.orderCode,(I=e.buyer)!=null&&I.firstName?`${(P=e.buyer)==null?void 0:P.firstName} ${(b=e.buyer)==null?void 0:b.lastName} (${(nu=e.buyer)==null?void 0:nu.mobile}) / ${e.buyer.province} - ${e.buyer.city}`:(e==null?void 0:e.outProvincePoultryRequestBuyer.type)==="killhouse"?`کشتارگاه ${e.buyerFullname} (${e.buyerMobile}) / شناسه یکتا ${(Z=e.outProvincePoultryRequestBuyer)==null?void 0:Z.killHouseUniqueId} / ${e.buyerProvince} - ${e.buyerCity}`:`کشتارکن ${e.buyerFullname} (${e.buyerMobile}) / نام کشتارگاه ${e.killerKillHouseUnitName?e.killerKillHouseUnitName:"-"} / شناسه یکتا ${e.killerKillHouseUniqueId?e.killerKillHouseUniqueId:"-"} / استان ${e.killerKillHouseProvince?e.killerKillHouseProvince:"-"} / شهر ${e.killerKillHouseCity?e.killerKillHouseCity:"-"}`,((_=e==null?void 0:e.outProvincePoultryRequestBuyer)==null?void 0:_.type)==="killhouse"?"محل کشتارگاه":e!=null&&e.killerKillHouseUnitName?`کشتارگاه ${e==null?void 0:e.killerKillHouseUnitName} / ${e==null?void 0:e.killerKillHouseProvince} / ${e==null?void 0:e.killerKillHouseCity}`:"-",e!=null&&e.hasWage?e==null?void 0:e.payerFullname:"-",`${(L=e.poultry)==null?void 0:L.unitName} (${e.poultry.user.mobile})`,u.jsx(Yu,{placement:"left-start",children:u.jsx(R,{variant:"contained",color:"primary",size:"small",sx:{minWidth:0,px:1.5,py:.25,fontSize:"0.8rem"},onClick:()=>{p(Vu({title:"ثبت کد قرنطینه",size:{xs:"340px",md:"690px"},content:u.jsx(_0,{readOnly:W()==="CityOperator",item:e,updateTable:Q},lu)}))},children:W()==="VetFarm"||W()==="AdminX"?"ثبت":"مشاهده"})},lu),Qu(e==null?void 0:e.createDate),Qu(e.sendDate),e.hatching.age,(Cu=e.IndexWeight)==null?void 0:Cu.toLocaleString(),e.quantity.toLocaleString(),(ru=Math.floor(e.IndexWeight*e.quantity))==null?void 0:ru.toLocaleString(),e!=null&&e.freezing?"انجماد":"عادی",e!=null&&e.hasWage?"دارد":"ندارد",(du=e.hatching)==null?void 0:du.city,(tu=e.hatching)==null?void 0:tu.province,(hu=e.hatching.leftOver)==null?void 0:hu.toLocaleString(),(q=e.hatching.hatchingQuantity)==null?void 0:q.toLocaleString(),(t=e==null?void 0:e.outProvinceDriverInfo)!=null&&t.driverCar?(vu=e==null?void 0:e.outProvinceDriverInfo)==null?void 0:vu.driverCar:"-",(Su=e==null?void 0:e.outProvinceDriverInfo)!=null&&Su.driverPelak?(Eu=e==null?void 0:e.outProvinceDriverInfo)==null?void 0:Eu.driverPelak:"-",($u=e==null?void 0:e.outProvinceDriverInfo)!=null&&$u.driverName?(su=e==null?void 0:e.outProvinceDriverInfo)==null?void 0:su.driverName:"-",(pu=e==null?void 0:e.outProvinceDriverInfo)!=null&&pu.driverMobile?(xu=e==null?void 0:e.outProvinceDriverInfo)==null?void 0:xu.driverMobile:"-",(Fu=e==null?void 0:e.outProvinceDriverInfo)!=null&&Fu.driverhealthCode?(fu=e==null?void 0:e.outProvinceDriverInfo)==null?void 0:fu.driverhealthCode:"-",(Pu=e==null?void 0:e.outProvinceDriverInfo)==null?void 0:Pu.driverhealthCode]});w(F);const Y=s==null?void 0:s.map((e,lu)=>{var eu,au,I,P,b,nu,Z,_,L,Cu,ru,du,tu,hu,q,t,vu,Su,Eu,$u,su,pu,xu,Fu,fu,Pu,Mu,T,S,ou,Ru;return[E===1?lu+1:lu+c*(E-1)+1,u.jsx(i6,{label:e.outState,color:e.outState==="تایید شده"?"success":e.outState==="رد شده"?"error":"info",size:"small",variant:"outlined"},lu),`${(eu=e==null?void 0:e.totalWageAmount)==null?void 0:eu.toLocaleString()} ریال`,(au=e.outProvinceRequestCanceller)!=null&&au.fullname?`${(I=e.outProvinceRequestCanceller)==null?void 0:I.fullname} (${(P=e.outProvinceRequestCanceller)==null?void 0:P.mobile})`:(b=e.agent)!=null&&b.fullname?`${(nu=e.agent)==null?void 0:nu.fullname} (${(Z=e.agent)==null?void 0:Z.mobile})`:"-",`${(_=e==null?void 0:e.registrar)==null?void 0:_.fullname}`,e.orderCode,(L=e.buyer)!=null&&L.firstName?`${(Cu=e.buyer)==null?void 0:Cu.firstName} ${(ru=e.buyer)==null?void 0:ru.lastName} (${(du=e.buyer)==null?void 0:du.mobile}) / ${e.buyer.province} - ${e.buyer.city}`:(e==null?void 0:e.outProvincePoultryRequestBuyer.type)==="killhouse"?`کشتارگاه ${e.buyerFullname} (${e.buyerMobile}) / شناسه یکتا ${(tu=e.outProvincePoultryRequestBuyer)==null?void 0:tu.killHouseUniqueId} / ${e.buyerProvince} - ${e.buyerCity}`:`کشتارکن ${e.buyerFullname} (${e.buyerMobile}) / نام کشتارگاه ${e.killerKillHouseUnitName?e.killerKillHouseUnitName:"-"} / شناسه یکتا ${e.killerKillHouseUniqueId?e.killerKillHouseUniqueId:"-"} / استان ${e.killerKillHouseProvince?e.killerKillHouseProvince:"-"} / شهر ${e.killerKillHouseCity?e.killerKillHouseCity:"-"}`,((hu=e==null?void 0:e.outProvincePoultryRequestBuyer)==null?void 0:hu.type)==="killhouse"?"محل کشتارگاه":e!=null&&e.killerKillHouseUnitName?`کشتارگاه ${e==null?void 0:e.killerKillHouseUnitName} / ${e==null?void 0:e.killerKillHouseProvince} / ${e==null?void 0:e.killerKillHouseCity}`:"-",e!=null&&e.hasWage?e==null?void 0:e.payerFullname:"-",`${(q=e.poultry)==null?void 0:q.unitName} (${e.poultry.user.mobile})`,e.quarantineCode?e==null?void 0:e.quarantineCode:"-",Qu(e==null?void 0:e.createDate),Qu(e.sendDate),(t=e.IndexWeight)==null?void 0:t.toLocaleString(),e.hatching.age,e.quantity.toLocaleString(),(vu=Math.floor(e.IndexWeight*e.quantity))==null?void 0:vu.toLocaleString(),e!=null&&e.freezing?"انجماد":"عادی",e!=null&&e.hasWage?"دارد":"ندارد",(Su=e.hatching)==null?void 0:Su.city,(Eu=e.hatching)==null?void 0:Eu.province,($u=e.hatching.leftOver)==null?void 0:$u.toLocaleString(),(su=e.hatching.hatchingQuantity)==null?void 0:su.toLocaleString(),(pu=e==null?void 0:e.outProvinceDriverInfo)!=null&&pu.driverCar?(xu=e==null?void 0:e.outProvinceDriverInfo)==null?void 0:xu.driverCar:"-",(Fu=e==null?void 0:e.outProvinceDriverInfo)!=null&&Fu.driverPelak?(fu=e==null?void 0:e.outProvinceDriverInfo)==null?void 0:fu.driverPelak:"-",(Pu=e==null?void 0:e.outProvinceDriverInfo)!=null&&Pu.driverName?(Mu=e==null?void 0:e.outProvinceDriverInfo)==null?void 0:Mu.driverName:"-",(T=e==null?void 0:e.outProvinceDriverInfo)!=null&&T.driverMobile?(S=e==null?void 0:e.outProvinceDriverInfo)==null?void 0:S.driverMobile:"-",(ou=e==null?void 0:e.outProvinceDriverInfo)!=null&&ou.driverhealthCode?(Ru=e==null?void 0:e.outProvinceDriverInfo)==null?void 0:Ru.driverhealthCode:"-"]});h(Y)},[s]),i.useEffect(()=>{z(1)},[p,O,k,c]);const cu=async F=>{F.preventDefault(),p(U());try{const Y=await await G.get(`out-province-poultry-requests/?search=filter&value=${d}&date1=${O}&date2=${k}&state=${r}&role=${W()}`);n(Y.data.results),y(Y.data.count),p(D())}catch(Y){console.error("Error fetching data:",Y)}};return u.jsxs(o,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,mt:4,children:[u.jsxs(o,{container:!0,gap:2,xs:12,children:[u.jsx(o,{children:u.jsx(Uu,{label:"از تاریخ",id:"date",renderInput:F=>u.jsx(f,{style:{width:"160px"},...F}),value:O,onChange:F=>{H(Tu(F).format("YYYY-MM-DD"))}})}),u.jsx(o,{children:u.jsx(Uu,{label:"تا تاریخ",id:"date",renderInput:F=>u.jsx(f,{style:{width:"160px"},...F}),value:k,onChange:F=>{m(Tu(F).format("YYYY-MM-DD"))}})}),u.jsxs("form",{onSubmit:cu,children:[u.jsx(f,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:K}),u.jsx(R,{type:"submit",onClick:cu,endIcon:u.jsx(o6,{}),children:"جستجو"})]}),u.jsx(o,{children:u.jsx(Yu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${G.defaults.baseURL}bar_free_excel/?date1=${O}&date2=${k}&state=${r}&role=${W()}&key=${M}`,rel:"noreferrer",children:u.jsx(R,{color:"success",children:u.jsx(u6,{size:32})})})})})]}),u.jsx(o,{container:!0,gap:2,xs:12,justifyContent:"center",children:u.jsx(Hu,{data:r==="accepted"?X:g,columns:r==="accepted"?["ردیف","عملیات","وضعیت","مبلغ کل ","ثبت کننده سفارش","کد سفارش","اطلاعات خریدار","محل کشتار","پرداخت کننده","مرغدار","کد قرنطینه","تاریخ ثبت درخواست","تاریخ کشتار","سن مرغ","میانگین وزن (کیلوگرم)","تعداد","وزن کل (کیلوگرم)","نوع کشتار","تعرفه","شهر","استان","مانده در سالن","جوجه ریزی اولیه","نوع خودرو","پلاک","نام راننده","تلفن راننده","کد بهداشتی ماشین"]:["ردیف","وضعیت","مبلغ کل","رد/لغو کننده","ثبت کننده سفارش","کد سفارش","اطلاعات خریدار","محل کشتار","پرداخت کننده","مرغدار","کد قرنطینه","تاریخ ثبت درخواست","تاریخ کشتار","میانگین وزن (کیلوگرم)","سن مرغ","تعداد","وزن کل (کیلوگرم)","نوع کشتار","تعرفه","شهر","استان","مانده در سالن","جوجه ریزی اولیه","نوع خودرو","پلاک","نام راننده","تلفن راننده","کد بهداشتی ماشین"],handlePageChange:V,totalRows:v,page:E,perPage:c,handlePerRowsChange:Au,title:r==="accepted"?" تایید شده":" رد شده"})})]})},M0=_u("PROVINCE_CREATE_FREE_SALE_BUYER",async(r,{dispatch:s})=>{try{s(U());const{data:n,status:v}=await G.post("out-province-poultry-request-buyers/",r);return s(D()),{data:n,status:v}}catch(n){return s(D()),{error:n.response.data.result}}}),O6=_u("PROVINCE_FREE_SALES_EDIT_BUYER",async(r,{dispatch:s})=>{try{s(U());const{data:n,status:v}=await G.put("out-province-poultry-request-buyers/0/",r);return s(D()),{data:n,status:v}}catch(n){return s(D()),{error:n.response.data.result}}}),z6=({fetchApiData:r,isEdit:s,item:n})=>{const[v]=i.useContext(bu),y=ju(),c=Du({initialValues:{fullname:n!=null&&n.fullname?n==null?void 0:n.fullname:"",mobile:n!=null&&n.mobile?n==null?void 0:n.mobile:"",province:n!=null&&n.province?n==null?void 0:n.province:"",city:n!=null&&n.city?n==null?void 0:n.city:"",unitname:n!=null&&n.unitName?n==null?void 0:n.unitName:"",uniqueCode:n!=null&&n.killHouseUniqueId?n==null?void 0:n.killHouseUniqueId:""},validationSchema:ku({fullname:J().required("این فیلد اجباری است!").matches(/^[^*&^%$#@!()|.]*$/,"این فیلد نباید شامل کاراکترهای ویژه باشد!"),mobile:J().required("شماره موبایل الزامی است").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),province:J().required("این فیلد اجباری است!").matches(/^[^*&^%$#@!()|.]*$/,"این فیلد نباید شامل کاراکترهای ویژه باشد!"),city:J().required("این فیلد اجباری است!").matches(/^[^*&^%$#@!()|.]*$/,"این فیلد نباید شامل کاراکترهای ویژه باشد!"),unitname:J().matches(/^[^*&^%$#@!()|.]*$/,"این فیلد نباید شامل کاراکترهای ویژه باشد!"),uniqueCode:J().matches(/^[^*&^%$#@!()|.]*$/,"این فیلد نباید شامل کاراکترهای ویژه باشد!")})});i.useEffect(()=>{c.validateForm()},[]);const[C,d]=i.useState(n!=null&&n.type?n==null?void 0:n.type:"killhouse"),x=B=>{d(B.target.value)},E=()=>C==="killhouse"?c.isValid&&c.values.unitname:c.isValid;return u.jsx(o,{container:!0,direction:"column",flex:"1",justifyContent:"space-between",gap:$.SMALL,children:u.jsxs(o,{container:!0,direction:"column",gap:$.TINY,children:[u.jsx(f,{id:"fullname",label:"نام و نام خانوادگی خریدار",variant:"outlined",sx:{width:"100%",height:"100%"},value:c.values.fullname,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.fullname?!!c.errors.fullname:null,helperText:c.touched.fullname&&c.errors.fullname?c.errors.fullname:null}),u.jsx(f,{id:"mobile",label:"موبایل",variant:"outlined",sx:{width:"100%",height:"100%"},value:c.values.mobile,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.mobile?!!c.errors.mobile:null,helperText:c.touched.mobile&&c.errors.mobile?c.errors.mobile:null}),u.jsx(f,{id:"province",label:"استان",variant:"outlined",sx:{width:"100%",height:"100%"},value:c.values.province,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.province?!!c.errors.province:null,helperText:c.touched.province&&c.errors.province?c.errors.province:null}),u.jsx(f,{id:"city",label:"شهر",variant:"outlined",sx:{width:"100%",height:"100%"},value:c.values.city,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.city?!!c.errors.city:null,helperText:c.touched.city&&c.errors.city?c.errors.city:null}),u.jsxs(Gu,{children:[u.jsx(h6,{id:"demo-controlled-radio-buttons-group",children:"نوع خریدار"}),u.jsxs(Ju,{row:!0,"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:C,onChange:x,children:[u.jsx(Ou,{value:"killhouse",control:u.jsx(zu,{}),label:"کشتارگاه"}),u.jsx(Ou,{value:"killer",control:u.jsx(zu,{}),label:"کشتارکن"})]})]}),C==="killhouse"&&u.jsxs(o,{container:!0,direction:"column",gap:$.TINY,children:[u.jsx(f,{id:"unitname",label:"نام کشتارگاه",variant:"outlined",sx:{width:"100%",height:"100%"},value:c.values.unitname,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.unitname?!!c.errors.unitname:null,helperText:c.touched.unitname&&c.errors.unitname?c.errors.unitname:null}),u.jsx(f,{id:"uniqueCode",label:"شناسه یکتا",variant:"outlined",sx:{width:"100%",height:"100%"},value:c.values.uniqueCode,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.uniqueCode?!!c.errors.uniqueCode:null,helperText:c.touched.uniqueCode&&c.errors.uniqueCode?c.errors.uniqueCode:null})]}),u.jsx(R,{variant:"contained",disabled:!E(),onClick:()=>{s?y(O6({buyer_key:n==null?void 0:n.key,type:C,fullname:c.values.fullname,mobile:c.values.mobile,unit_name:C==="killhouse"?c.values.unitname:null,city:c.values.city,province:c.values.province,kill_house_unique_id:C==="killhouse"?c.values.uniqueCode:null})).then(B=>{B.payload.error?v({vertical:"top",horizontal:"center",msg:B.payload.error,severity:"error"}):(r(1),y(gu({right:!1,bottom:!1,content:null})),v({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}):y(M0({type:C,fullname:c.values.fullname,mobile:c.values.mobile,unit_name:C==="killhouse"?c.values.unitname:null,city:c.values.city,province:c.values.province,kill_house_unique_id:C==="killhouse"?c.values.uniqueCode:null})).then(B=>{B.payload.error?v({vertical:"top",horizontal:"center",msg:B.payload.error,severity:"error"}):(r(1),y(gu({right:!1,bottom:!1,content:null})),v({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت"})]})})},W0=({item:r,fetchApiData:s,openNotif:n})=>{const v=ju(),[y,c]=i.useState(null),C=g=>{c(g.currentTarget)},d=()=>{c(null)},x=()=>{d(),v(O6({buyer_key:r==null?void 0:r.key,active:!(r!=null&&r.active)})).then(g=>{g.payload.error?n({vertical:"top",horizontal:"center",msg:g.payload.error,severity:"error"}):(s(1),n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},E=()=>{d(),v(gu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ویرایش خریدار",content:u.jsx(z6,{fetchApiData:s,isEdit:!0,item:r})}))},B=[{key:"toggle",label:r!=null&&r.active?"غیرفعال سازی":"فعالسازی",color:r!=null&&r.active?"error.main":"success.main",icon:r!=null&&r.active?u.jsx(E0,{}):u.jsx(S0,{}),action:x},{key:"edit",label:"ویرایش",color:"primary.main",icon:u.jsx(F6,{}),action:E,disabled:!(r!=null&&r.active)}],X=!!y,w=X?`buyer-operations-${r==null?void 0:r.key}`:void 0;return u.jsxs(o,{container:!0,alignItems:"center",justifyContent:"center",gap:.5,children:[u.jsx(Yu,{title:"تنظیمات",children:u.jsx(Nu,{"aria-describedby":w,color:"primary",onClick:C,children:u.jsx(x6,{})})}),u.jsx(A6,{id:w,open:X,anchorEl:y,onClose:d,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsx(v6,{dense:!0,sx:{width:150,py:.5,px:1},children:B.map(g=>u.jsxs(p6,{onClick:()=>{g.disabled||g.action()},disabled:!!g.disabled,sx:{borderRadius:1,mb:.5,color:g.disabled?"text.disabled":g.color,"&:last-of-type":{mb:0}},children:[u.jsx(n6,{sx:{color:g.disabled?"text.disabled":g.color,minWidth:32},children:R6.cloneElement(g.icon,{fontSize:"small"})}),u.jsx(t6,{primary:u.jsx(j,{sx:{color:g.disabled?"text.disabled":g.color,fontWeight:600,fontSize:"0.85rem"},children:g.label})})]},g.key))})})]})},V0=()=>{const[r,s]=i.useState([]),[n,v]=i.useState(0),[y,c]=i.useState(10),[C,d]=i.useState(""),[x,E]=i.useState(1),[B,X]=i.useState([]),w=ju(),[g]=i.useContext(bu),h=mu(V=>V.userSlice.userProfile.key),O=async V=>{w(U());const p=await G.get(`out-province-poultry-request-buyers/?search=filter&value=${C}&page=${V}&page_size=${y}&role=${W()}&state=buyer-list`);w(D()),s(p.data.results),v(p.data.count)},H=V=>{O(V),E(V)},k=V=>{c(V),E(1)},m=()=>{O(x!==0?x:1)},M=V=>{d(V.target.value)};i.useEffect(()=>{const V=r==null?void 0:r.map((p,K)=>{var Au,Q,cu,F,Y,e;return[x===1?K+1:K+y*(x-1)+1,p==null?void 0:p.fullname,p==null?void 0:p.mobile,p==null?void 0:p.province,p==null?void 0:p.city,(p==null?void 0:p.type)==="killhouse"?"کشتارگاه":"کشتارکن",p!=null&&p.unitName?p==null?void 0:p.unitName:"-",p!=null&&p.killHouseUniqueId?p==null?void 0:p.killHouseUniqueId:"-",(Q=(Au=p==null?void 0:p.requestsInfo)==null?void 0:Au.numberOfRequests)==null?void 0:Q.toLocaleString(),(F=(cu=p==null?void 0:p.requestsInfo)==null?void 0:cu.totalQuantity)==null?void 0:F.toLocaleString(),(e=(Y=p==null?void 0:p.requestsInfo)==null?void 0:Y.totalWeight)==null?void 0:e.toLocaleString(),p!=null&&p.active?"فعال":"غیر فعال",u.jsx(W0,{item:p,fetchApiData:O,openNotif:g},(p==null?void 0:p.key)||K)]});X(V)},[r]),i.useEffect(()=>{O(1)},[w,y]);const z=async V=>{V.preventDefault(),w(U());try{const p=await G.get(`out-province-poultry-request-buyers/?search=filter&value=${C}&role=${W()}&state=buyer-list`);s(p.data.results),v(p.data.count),w(D())}catch(p){console.error("Error fetching data:",p)}};return u.jsxs(o,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(o,{container:!0,mt:$.SMALL,xs:12,children:u.jsx(R,{variant:"contained",onClick:()=>{w(gu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"افزودن خریدار",content:u.jsx(z6,{fetchApiData:m})}))},children:"افزودن خریدار"})}),u.jsxs(o,{container:!0,alignItems:"center",justifyContent:"center",gap:2,paddingTop:2,mb:1,width:"100%",children:[u.jsx(o,{container:!0,alignItems:"center",gap:$.SMALL,children:u.jsxs("form",{onSubmit:z,children:[u.jsx(f,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:M}),u.jsx(R,{type:"submit",onClick:z,endIcon:u.jsx(o6,{}),children:"جستجو"})]})}),u.jsx(Yu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${G.defaults.baseURL}out_province_poultry_request_buyers_excel/?key=${h}&role=${W()}&search=filter&value=${C}`,rel:"noreferrer",children:u.jsx(R,{color:"success",children:u.jsx(u6,{size:32})})})})]}),u.jsx(Hu,{data:B,columns:["ردیف","نام کامل","موبایل","استان","شهر","ماهیت خریدار","نام واحد","شناسه یکتا","تعداد درخواست ها","حجم درخواست ها (قطعه)","وزن درخواست ها (کیلوگرم)","وضعیت","عملیات"],handlePageChange:H,totalRows:n,page:x,perPage:y,handlePerRowsChange:k,title:"خریداران"})]})},O0=_u("PROVINCE_APPROVE_FREE_SALE_SERVICE",async(r,{dispatch:s})=>{try{s(U());const{data:n,status:v}=await G.post("final-approval-out-province-poultry-request/",r);return s(D()),{data:n,status:v}}catch(n){return s(D()),{error:n.response.data.result}}});var b6={},z0=I6;Object.defineProperty(b6,"__esModule",{value:!0});var H6=b6.default=void 0,H0=z0(D6()),Y0=u;H6=b6.default=(0,H0.default)((0,Y0.jsx)("path",{d:"m10.89 18.28.57-2.89c.12-.59-.04-1.2-.42-1.66-.38-.46-.94-.73-1.54-.73H4v-1.08L6.57 6h8.09c.18 0 .34.16.34.34v7.84zM10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4h-8.1c-.71 0-1.36.37-1.72.97l-2.67 6.15c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22zm10-7h2V4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1"}),"ThumbDownOffAlt");const Y6=_u("PROVINCE_CHECK_FREE_SALE_SERVICE",async(r,{dispatch:s})=>{try{s(U());const{data:n,status:v}=await G.post("province_check_operator_out_request/",r);return s(D()),{data:n,status:v}}catch(n){return s(D()),{error:n.response.data.result}}}),U0=({item:r,fetchApiData:s})=>{const[n]=i.useContext(bu),v=ju(),y=Du({initialValues:{textFieldInput:""},validationSchema:ku({textFieldInput:J().required("این فیلد اجباری است!")})});return i.useEffect(()=>{y.validateForm()},[]),u.jsxs(o,{xs:12,container:!0,justifyContent:"center",children:[u.jsx(f,{fullWidth:!0,id:"textFieldInput",name:"textFieldInput",label:"توضیحات",multiline:!0,rows:4,value:y.values.textFieldInput,onChange:y.handleChange,onBlur:y.handleBlur,error:y.touched.textFieldInput&&!!y.errors.textFieldInput,helperText:y.touched.textFieldInput&&y.errors.textFieldInput,margin:"normal"}),u.jsx(R,{color:"error",fullWidth:!0,variant:"contained",type:"submit",disabled:!y.isValid,onClick:()=>{v(Y6({poultry_request_key:r==null?void 0:r.key,state:"rejected",message:y.values.textFieldInput})).then(c=>{c.payload.error?n({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(v(Lu()),s(1),n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت"})]})},K0=_u("PROVINCE_SEND_SMS_AGAIN_SERVICE",async(r,{dispatch:s})=>{try{s(U());const{data:n,status:v}=await G.get("send_again_sms_for_final_approval_out_province/?key="+r);return s(D()),{data:n,status:v}}catch(n){return s(D()),{error:n.response.data.result}}}),G0=({item:r,fetchApiData:s})=>{const n=ju(),[v,y]=i.useState(null),c=k=>{y(k.currentTarget)},C=()=>{y(null)},d=!!v,x=d?"popover":void 0,[E]=i.useContext(bu),B=W(),X=()=>{n(gu({title:"ویرایش درخواست",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(V6,{item:r,fetchApiData:s})}))},w=()=>{n(Vu({title:"آیا از تایید درخواست مطمئن هستید؟",content:u.jsxs(o,{children:[u.jsx(R,{variant:"contained",onClick:()=>{n(Y6({poultry_request_key:r==null?void 0:r.key})).then(k=>{k.payload.error?E({vertical:"top",horizontal:"center",msg:k.payload.error,severity:"error"}):(n(Lu()),s(1),E({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"بله"}),u.jsx(R,{onClick:()=>{n(Lu())},children:"خیر"})]})}))},g=()=>{var k,m,M;n(Vu({title:"پیامک مجددا ارسال شود؟",content:u.jsxs(o,{children:[(r==null?void 0:r.hasWage)&&u.jsxs(j,{fullWidth:!0,variant:"body2",children:["پیامک پرداخت مجددا برای ",r==null?void 0:r.payerFullname," ","‌‌"," به شماره موبایل"," ",(r==null?void 0:r.payerType)==="buyer"?(k=r==null?void 0:r.outProvincePoultryRequestBuyer)==null?void 0:k.mobile:(M=(m=r==null?void 0:r.poultry)==null?void 0:m.user)==null?void 0:M.mobile," ","ارسال میشود."]}),u.jsxs(o,{xs:12,container:!0,justifyContent:"center",mt:2,children:[u.jsx(R,{variant:"contained",onClick:()=>{n(K0(r==null?void 0:r.key)).then(z=>{z.payload.error?E({vertical:"top",horizontal:"center",msg:z.payload.error,severity:"error"}):(n(Lu()),s(1),E({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"بله"}),u.jsx(R,{onClick:()=>{n(Lu())},children:"خیر"})]})]})}))},h=()=>{n(Vu({title:"آیا از لغو درخواست مطمئن هستید؟",content:u.jsxs(o,{children:[u.jsx(R,{variant:"contained",onClick:()=>{n(W6({role:W(),poultry_request_key:r.key})).then(k=>{k.payload.error?E({vertical:"top",horizontal:"center",msg:k.payload.error,severity:"error"}):(s(1),E({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}),n(Lu())},children:"بله"}),u.jsx(R,{onClick:()=>{n(Lu())},children:"خیر"})]})}))},O=()=>{n(Vu({title:"رد درخواست فروش خارج از استان",content:u.jsx(U0,{item:r,fetchApiData:s})}))},H=[{key:"edit",label:"ویرایش",color:"primary.main",icon:u.jsx(F6,{}),action:X},B!=="CityOperator"&&{key:"approve",label:"تایید درخواست",color:"success.main",icon:u.jsx($0,{}),action:w,disabled:r.provinceState!=="pending"},(B==="CityOperator"||B==="ProvinceOperator"||B==="SuperAdmin"||B==="AdminX")&&{key:"resendSms",label:"ارسال مجدد پیامک",color:"info.main",icon:u.jsx(P0,{}),action:g,disabled:r.outState!=="در انتظار پرداخت"},{key:"cancel",label:"لغو",color:"error.main",icon:u.jsx(M6,{}),action:h,disabled:!r.provinceState==="pending"||!r.provinceState==="accepted"},B!=="CityOperator"&&{key:"reject",label:"رد درخواست",color:"error.main",icon:u.jsx(H6,{}),action:O,disabled:!r.provinceState==="pending"||!r.provinceState==="accepted"||r.outState==="در انتظار پرداخت"}].filter(Boolean);return u.jsxs(o,{container:!0,children:[u.jsx(Nu,{"aria-describedby":x,variant:"contained",color:"primary",onClick:c,children:u.jsx(x6,{})}),u.jsx(A6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:x,open:d,anchorEl:v,onClose:C,children:u.jsx(v6,{dense:!0,sx:{width:176,py:.5,px:1},children:H.map(k=>u.jsxs(p6,{onClick:()=>{C(),k.action()},disabled:!!k.disabled,sx:{borderRadius:1,mb:.5,color:k.disabled?"text.disabled":k.color,"&:last-of-type":{mb:0}},children:[u.jsx(n6,{sx:{color:k.disabled?"text.disabled":k.color,minWidth:32},children:R6.cloneElement(k.icon,{fontSize:"small"})}),u.jsx(t6,{primary:u.jsx(j,{sx:{color:k.disabled?"text.disabled":k.color,fontWeight:600,fontSize:"0.85rem"},children:k.label})})]},k.key))})})]})},w6=_u("PROVINCE_FREE_SALES_TRANSACTIONS_DASH",async(r,{dispatch:s})=>{s(U());const{data:n,status:v}=await G.get("total-dashboard-poultry-requests-transactions",{params:{date1:r.selectedDate1,date2:r.selectedDate2,role:W(),filter:"search",value:r.textValue}});return s(D()),{data:n,status:v}}),Q0=()=>{var F,Y,e,lu,eu,au,I;const[,,r,s,n,v]=i.useContext(bu),y=ju();i.useEffect(()=>{const P=Tu(new Date).format("YYYY-MM-DD");s(P),v(P)},[]);const c=P=>{H(P.target.value)},C=(P,b)=>{p(b)},[d,x]=i.useState([]),[E,B]=i.useState([]),[X,w]=i.useState(0),[g,h]=i.useState(10),[O,H]=i.useState(""),[k,m]=i.useState(1),[M,z]=i.useState([]),[V,p]=i.useState(0),K=async P=>{let b;y(U()),b=await G.get(`poultry-requests-transactions/?search=filter&value=${O}&role=${W()}&date1=${r}&date2=${n}&page=${P}&page_size=${g}&type=${V===0?"poultry":"buyer"}`),y(D()),B(b.data.results),w(b.data.count)},Au=P=>{K(P),m(P)},Q=P=>{h(P),m(1)};i.useEffect(()=>{const P=E==null?void 0:E.map((b,nu)=>{var Z,_,L,Cu,ru,du,tu,hu;return[k===1?nu+1:nu+g*(k-1)+1,b==null?void 0:b.orderId,(Z=b==null?void 0:b.poultryRequest)==null?void 0:Z.map((q,t)=>u.jsx(j,{variant:"caption",children:q.orderCode},t)),(_=b==null?void 0:b.amount)==null?void 0:_.toLocaleString(),`${(L=b==null?void 0:b.payerInfo)==null?void 0:L.fullname} (${(Cu=b==null?void 0:b.payerInfo)==null?void 0:Cu.mobile})`,b==null?void 0:b.refId,(ru=b==null?void 0:b.unionShare)==null?void 0:ru.toLocaleString(),(du=b==null?void 0:b.companyShare)==null?void 0:du.toLocaleString(),(tu=b==null?void 0:b.guildsShare)==null?void 0:tu.toLocaleString(),(hu=b==null?void 0:b.otherShare)==null?void 0:hu.toLocaleString()]});z(P)},[E]),i.useEffect(()=>{K(1),y(w6({selectedDate1:r,selectedDate2:n,textValue:O})).then(P=>{x(P.payload.data)})},[y,r,n,g,V]);const cu=async P=>{P.preventDefault(),y(U());try{const b=await G.get(`poultry-requests-transactions/?role=${W()}&search=filter&value=${O}&date1=${r}&date2=${n}&page=1&page_size=${g}&type=${V===0?"poultry":"buyer"}`);B(b.data.results),w(b.data.count),y(D()),y(w6({selectedDate1:r,selectedDate2:n,textValue:O,type:V===0?"poultry":"buyer"})).then(nu=>{x(nu.payload.data)})}catch(b){console.error("Error fetching data:",b)}};return u.jsxs(o,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,mt:2,children:[u.jsxs(o,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(o,{children:u.jsx(Uu,{label:"از تاریخ",id:"date",renderInput:P=>u.jsx(f,{style:{width:"160px"},...P,size:"small"}),value:r,onChange:P=>{s(Tu(P).format("YYYY-MM-DD"))}})}),u.jsx(o,{children:u.jsx(Uu,{label:"تا تاریخ",id:"date",renderInput:P=>u.jsx(f,{style:{width:"160px"},...P,size:"small"}),value:n,onChange:P=>{v(Tu(P).format("YYYY-MM-DD"))}})}),u.jsx(o,{children:u.jsxs("form",{onSubmit:cu,children:[u.jsx(f,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:c}),u.jsx(R,{type:"submit",onClick:cu,endIcon:u.jsx(o6,{}),children:"جستجو"})]})}),u.jsx(o,{children:u.jsx(Yu,{title:"خروجی اکسل کلی",children:u.jsx("a",{href:`${G.defaults.baseURL}transacion_out_request_excel/?date1=${r}&date2=${n}&role=${W()}&search=filter&value=${O}&type=${V===0?"poultry":"buyer"}`,rel:"noreferrer",children:u.jsx(R,{color:"primary",children:u.jsx(u6,{size:32})})})})})]}),u.jsx(o,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(Hu,{noPagination:!0,isDashboard:!0,columns:["تعداد پرداختی ها","تعداد پرداخت کننده ها","مبلغ کل پرداختی","تعداد مرغداران"," پرداختی مرغداران","تعداد خریداران"," پرداختی خریداران"],data:[[(F=d==null?void 0:d.totalNumberOfTransactions)==null?void 0:F.toLocaleString(),(Y=d==null?void 0:d.totalNumberOfPayers)==null?void 0:Y.toLocaleString(),(e=d==null?void 0:d.totalAmountOfTransactions)==null?void 0:e.toLocaleString(),(lu=d==null?void 0:d.totalNumberOfPoultries)==null?void 0:lu.toLocaleString(),(eu=d==null?void 0:d.totalAmountOfPoultries)==null?void 0:eu.toLocaleString(),(au=d==null?void 0:d.totalNumberOfBuyers)==null?void 0:au.toLocaleString(),(I=d==null?void 0:d.totalAmountOfBuyers)==null?void 0:I.toLocaleString()]],title:"خلاصه اطلاعات"})}),u.jsxs(L6,{value:V,onChange:C,"aria-label":"simple tabs example",children:[u.jsx(Wu,{label:"مرغدار"}),u.jsx(Wu,{label:"خریدار"})]}),V===0?u.jsx(Hu,{data:M,columns:["ردیف","شماره سفارش","کد سفارش","مبلغ تراکنش (ریال)","پرداخت کننده","کد پیگیری","سهم اتحادیه (ریال)","سهم شرکت (ریال)","سهم صنف (ریال)","سهم دیگر (ریال)"],handlePageChange:Au,totalRows:X,page:k,perPage:g,handlePerRowsChange:Q,title:"تراکنش های مرغداران"}):u.jsx(Hu,{data:M,columns:["ردیف","شماره سفارش","کد سفارش","مبلغ تراکنش (ریال)","پرداخت کننده","کد پیگیری","سهم اتحادیه (ریال)","سهم شرکت (ریال)","سهم صنف (ریال)","سهم دیگر (ریال)"],handlePageChange:Au,totalRows:X,page:k,perPage:g,handlePerRowsChange:Q,title:"تراکنش های خریداران"})]})},X0=_u("GET_PROVINCE_FEE_SALES_DASHBOARD",async(r,{dispatch:s})=>{s(U());const{data:n,status:v}=await G.get("out-province-poultry-requests-dashboard",{params:{date1:r.selectedDate1,date2:r.selectedDate2,search:"filter",value:r.textValue,role:W()}});return s(D()),{data:n,status:v}}),ke=()=>{var au,I,P,b,nu,Z,_,L,Cu,ru,du,tu,hu;const[r,s]=i.useState([]),[n,v]=i.useState(0),[y,c]=i.useState(10),[C,d]=i.useState(""),[x,E]=i.useState(1),[B,X]=i.useState([]),[w,g]=i.useState(0),[h,O]=i.useState([]),[H,k]=i.useState(),[m]=i.useContext(bu),M=ju(),z=mu(q=>q.userSlice.userProfile.key),V=q=>{d(q.target.value)},p=(q,t)=>{g(t),Y()},[,,K,Au,Q,cu]=i.useContext(bu),F=async q=>{M(U());const t=await G.get(`out-province-poultry-requests/?search=filter&value=${C}&page=${q}&role=${W()}&page_size=${y}&date1=${K}&date2=${Q}&state=pending`);M(D()),s(t.data.results),v(t.data.count)},Y=()=>{M(X0({selectedDate1:K,selectedDate2:Q,textValue:C})).then(q=>{O(q.payload.data)})},e=q=>{F(q),E(q)},lu=q=>{c(q),E(1)};i.useEffect(()=>{F(1),Y(),M(g6()).then(q=>{k(q.payload.data.status)})},[M,y]),i.useEffect(()=>{w===0&&F(1),Y()},[K,Q,w]),i.useEffect(()=>{const q=r==null?void 0:r.map((t,vu)=>{var Su,Eu,$u,su,pu,xu,Fu,fu,Pu,Mu,T,S,ou,Ru,Xu;return[x===1?vu+1:vu+y*(x-1)+1,u.jsx(G0,{item:t,wageType:H,fetchApiData:F},vu),u.jsx(i6,{label:t.outState,color:t.outState==="در انتظار پرداخت"?"info":t.outState==="در انتظار تایید"?"warning":t.outState==="رد شده"?"error":"success",size:"small",variant:"outlined"},vu),`${(Su=t==null?void 0:t.registrar)==null?void 0:Su.fullname}`,t.orderCode,(Eu=t.buyer)!=null&&Eu.firstName?`${($u=t.buyer)==null?void 0:$u.firstName} ${(su=t.buyer)==null?void 0:su.lastName} (${(pu=t.buyer)==null?void 0:pu.mobile}) / ${t.buyer.province} - ${t.buyer.city}`:(t==null?void 0:t.outProvincePoultryRequestBuyer.type)==="killhouse"?`کشتارگاه ${t.buyerFullname} (${t.buyerMobile}) / شناسه یکتا ${(xu=t.outProvincePoultryRequestBuyer)==null?void 0:xu.killHouseUniqueId} / ${t.buyerProvince} - ${t.buyerCity}`:`کشتارکن ${t.buyerFullname} (${t.buyerMobile}) / نام کشتارگاه ${t.killerKillHouseUnitName?t.killerKillHouseUnitName:"-"} / شناسه یکتا ${t.killerKillHouseUniqueId?t.killerKillHouseUniqueId:"-"} / استان ${t.killerKillHouseProvince?t.killerKillHouseProvince:"-"} / شهر ${t.killerKillHouseCity?t.killerKillHouseCity:"-"}`,((Fu=t==null?void 0:t.outProvincePoultryRequestBuyer)==null?void 0:Fu.type)==="killhouse"?"محل کشتارگاه":t!=null&&t.killerKillHouseUnitName?`کشتارگاه ${t==null?void 0:t.killerKillHouseUnitName} / ${t==null?void 0:t.killerKillHouseProvince} / ${t==null?void 0:t.killerKillHouseCity}`:"-",t!=null&&t.hasWage?t==null?void 0:t.payerFullname:"-",t!=null&&t.paymentLink?u.jsx("a",{href:t==null?void 0:t.paymentLink,target:"_blank",rel:"noreferrer",dir:"ltr",children:(t==null?void 0:t.paymentLink.length)>25?`${t==null?void 0:t.paymentLink.slice(0,25)}...`:t==null?void 0:t.paymentLink}):"-",`${(fu=t.poultry)==null?void 0:fu.unitName} (${t.poultry.user.mobile})`,Qu(t.createDate),Qu(t.sendDate),t.hatching.age,(Pu=t.IndexWeight)==null?void 0:Pu.toLocaleString(),t.quantity.toLocaleString(),(Mu=Math.floor(t.IndexWeight*t.quantity))==null?void 0:Mu.toLocaleString(),t!=null&&t.freezing?"انجماد":"عادی",t!=null&&t.hasWage?"دارد":"ندارد",(T=t.hatching)==null?void 0:T.city,(S=t.hatching)==null?void 0:S.province,t.hatching.hatchingLeftOver?t.hatching.hatchingLeftOver.toLocaleString():t.hatching.leftOver.toLocaleString(),(ou=t.hatching.hatchingQuantity)==null?void 0:ou.toLocaleString(),((Ru=t.totalWageAmount)==null?void 0:Ru.toLocaleString())+" ریال",((Xu=t==null?void 0:t.outProvinceDriverInfo)==null?void 0:Xu.driverhealthCode)||"-"]});X(q)},[r]);const eu=async q=>{q.preventDefault(),M(U());try{const t=await G.get(`out-province-poultry-requests/?search=filter&value=${C}&page=${x}&page_size=${y}&date1=${K}&date2=${Q}&state=pending&role=${W()}`);s(t.data.results),v(t.data.count),Y(),M(D())}catch(t){console.error("Error fetching data:",t),M(D())}};return u.jsx(o,{container:!0,justifyContent:"center",children:u.jsxs(o,{container:!0,justifyContent:"center",alignItems:"center",children:[u.jsxs(L6,{value:w,onChange:p,"aria-label":"simple tabs example",scrollButtons:"auto",variant:"scrollable",centered:!0,allowScrollButtonsMobile:!0,children:[u.jsx(Wu,{label:"درخواست های جدید"}),u.jsx(Wu,{label:"تایید شده"}),u.jsx(Wu,{label:"رد شده"}),u.jsx(Wu,{label:"خریداران"}),u.jsx(Wu,{label:"پرداختی ها"})]}),u.jsxs(o,{pt:2,px:2,children:[u.jsx(o,{container:!0,justifyContent:"center",alignItems:"center",children:u.jsx(Hu,{isDashboard:!0,noPagination:!0,columns:["تعداد فارم","تعداد فروش","حجم فروش","وزن فروش","تعداد فروش های تایید شده بدون تعرفه","حجم فروش های تایید شده بدون تعرفه","وزن فروش های تایید شده بدون تعرفه","تعداد فروش های تایید شده با تعرفه","حجم فروش های تایید شده با تعرفه","وزن فروش های تایید شده با تعرفه","تعداد کل فروش های تایید شده","حجم کل فروش های تایید شده","وزن کل فروش های تایید شده"],data:[[(au=h==null?void 0:h.poultries)==null?void 0:au.toLocaleString(),(I=h==null?void 0:h.totalNumberOfPoultryRequest)==null?void 0:I.toLocaleString(),(P=h==null?void 0:h.totalPoultryRequestQuantity)==null?void 0:P.toLocaleString(),(b=Math.round(h==null?void 0:h.totalPoultryRequestWeight))==null?void 0:b.toLocaleString(),(nu=h==null?void 0:h.totalNumberOfAcceptedPoultryRequestWithOutWage)==null?void 0:nu.toLocaleString(),(Z=h==null?void 0:h.totalAcceptedPoultryRequestQuantityWithOutWage)==null?void 0:Z.toLocaleString(),(_=Math.round(h==null?void 0:h.totalAcceptedPoultryRequestWeightWithOutWage))==null?void 0:_.toLocaleString(),(L=h==null?void 0:h.totalNumberOfAcceptedPoultryRequestWithWage)==null?void 0:L.toLocaleString(),(Cu=h==null?void 0:h.totalAcceptedPoultryRequestQuantityWithWage)==null?void 0:Cu.toLocaleString(),(ru=Math.round(h==null?void 0:h.totalAcceptedPoultryRequestWeightWithWage))==null?void 0:ru.toLocaleString(),(du=h==null?void 0:h.totalNumberOfAcceptedPoultryRequest)==null?void 0:du.toLocaleString(),(tu=h==null?void 0:h.totalAcceptedPoultryRequestQuantity)==null?void 0:tu.toLocaleString(),(hu=h==null?void 0:h.totalAcceptedPoultryRequestWeight)==null?void 0:hu.toLocaleString()]],title:"خلاصه اطلاعات"})}),w===0&&u.jsxs(o,{container:!0,alignItems:"start",direction:"column",gap:2,xs:12,children:[u.jsx(o,{container:!0,alignItems:"center",gap:$.SMALL,mt:$.SMALL,children:u.jsx(o,{style:{width:190},children:u.jsx(R,{className:"avicultureNewRequestBtn",variant:"contained",fullWidth:!0,onClick:()=>{M(gu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت درخواست فروش به خارج استان",size:{xs:"100%",md:"400px"},content:u.jsx(T0,{fetchApiData:F})}))},children:"فروش به خارج استان"})})}),u.jsxs(o,{container:!0,gap:2,xs:12,justifyContent:"space-between",mt:2,children:[u.jsxs(o,{container:!0,gap:2,children:[u.jsx(o,{children:u.jsx(Uu,{label:"از تاریخ",id:"date",renderInput:q=>u.jsx(f,{style:{width:"160px"},...q}),value:K,onChange:q=>{Au(Tu(q).format("YYYY-MM-DD"))}})}),u.jsx(o,{children:u.jsx(Uu,{label:"تا تاریخ",id:"date",renderInput:q=>u.jsx(f,{style:{width:"160px"},...q}),value:Q,onChange:q=>{cu(Tu(q).format("YYYY-MM-DD"))}})}),u.jsxs("form",{onSubmit:eu,children:[u.jsx(f,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:V}),u.jsx(R,{type:"submit",onClick:eu,endIcon:u.jsx(o6,{}),children:"جستجو"})]}),u.jsx(o,{children:u.jsx(Yu,{title:"خروجی اکسل کلی",children:u.jsx("a",{href:`${G.defaults.baseURL}general_free_bar_excel/?date1=${K}&date2=${Q}&role=${W()}&key=${z}&search=filter&value=${C}`,rel:"noreferrer",children:u.jsx(R,{color:"primary",children:u.jsx(u6,{size:32})})})})}),u.jsx(o,{children:u.jsx(Yu,{title:"خروجی اکسل درخواست های جدید",children:u.jsx("a",{href:`${G.defaults.baseURL}bar_free_excel/?date1=${K}&date2=${Q}&state=pending&role=${W()}&key=${z}`,rel:"noreferrer",children:u.jsx(R,{color:"success",children:u.jsx(u6,{size:32})})})})})]}),W()!=="CityOperator"&&u.jsx(o,{children:u.jsx(R,{color:"error",variant:"contained",onClick:()=>{M(O0()).then(q=>{q.payload.error?m({vertical:"top",horizontal:"center",msg:q.payload.error,severity:"error"}):(F(1),Y(),m({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید یکجا"})})]}),u.jsx(o,{container:!0,gap:2,xs:12,justifyContent:"center",children:u.jsx(Hu,{data:B,columns:["ردیف","عملیات","وضعیت","ثبت کننده سفارش","کد سفارش","اطلاعات خریدار","محل کشتار","پرداخت کننده","لینک پرداخت","مرغدار","تاریخ ثبت درخواست","تاریخ کشتار","سن مرغ","میانگین وزن (کیلوگرم)","تعداد","وزن کل (کیلوگرم)","نوع کشتار","تعرفه","شهر","استان","مانده در سالن","جوجه ریزی اولیه","مبلغ تراکنش (ریال)","کد بهداشتی ماشین"],handlePageChange:e,totalRows:n,page:x,perPage:y,handlePerRowsChange:lu,title:"فروش خارج از استان"})})]}),w===1&&u.jsx(q6,{state:"accepted"}),w===2&&u.jsx(q6,{state:"rejected"}),w===3&&u.jsx(V0,{}),w===4&&u.jsx(Q0,{})]})]})})};export{L0 as C,ke as P,w0 as d,D0 as p}; diff --git a/build/assets/ProvinceGuildsTransactions-DY4o9JwV.js b/build/assets/ProvinceGuildsTransactions-DY4o9JwV.js new file mode 100644 index 0000000..c044939 --- /dev/null +++ b/build/assets/ProvinceGuildsTransactions-DY4o9JwV.js @@ -0,0 +1 @@ +import{i as z,j as e,a3 as n,b as j,T as i,ak as R,ag as U,av as V,aw as W,ax as f,am as D,ar as H,aJ as O,b1 as B,bq as J,I as Q}from"./mui-vendor-CkIVaoQP.js";import{r as o}from"./react-vendor-CmFgShSM.js";import{j as k,r as X,A as K,v as m,m as l,dq as Z,W as M,ey as ee,aE as C,L as ae,h as te,N as se,G as ue}from"./index-CeyyVc1v.js";import{a as w,u as Y}from"./redux-vendor-B7uoacJt.js";import{A as ne}from"./AdvancedTable-BYmmBtmq.js";import{d as re}from"./Person-Q1IHBezR.js";import{d as oe}from"./Phone-Dv2y8iMM.js";import{d as ie}from"./CheckCircle-zgBvZQ-b.js";import{g as le}from"./getPosProviderName-CYVCBpcT.js";import{u as ce}from"./getProvinceName-BujSmyBy.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const de=w("MAIN_GET_STEWARDS",async s=>{const u=k.create();u.defaults.headers.common={};const t=`https://amait.mrkiani.ir/api/report/pos/${s==="markazi"?"markazi":"hamadan"}`;try{const c=await u.get(t),{data:x,status:y}=c;return{data:x,status:y}}catch(c){throw console.error("Error fetching data:",c),c}});var v={},xe=z;Object.defineProperty(v,"__esModule",{value:!0});var F=v.default=void 0,he=xe(X()),pe=e;F=v.default=(0,he.default)((0,pe.jsx)("path",{d:"M18 17H6v-2h12zm0-4H6v-2h12zm0-4H6V7h12zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2z"}),"Receipt");const ye=w("AVICULTURE_REQUESTS_SERVICE",async s=>{const{data:u,status:t}=await k.get("https://amait.mrkiani.ir/api/report/transactions/",{params:{shop:s.key,datefrom:s.datefrom,dateto:s.dateto,page:s.page,mode:s.mode}});return{data:u,status:t}}),je=({item:s})=>{var _,E;const u=Y(),[t,c]=o.useState(),[x,y]=o.useState(1),[h,r]=o.useState("0"),[,,p,A,g,b]=o.useContext(K),[S,P]=o.useState(!1);o.useEffect(()=>{const a=m(new Date).format("YYYY-MM-DD");A(a),b(a),P(!0)},[]);const I=a=>{u(ae()),u(ye({key:s.shop,datefrom:C(p),dateto:C(g),page:a,mode:h})).then(d=>{u(te()),c(d.payload.data)})};o.useEffect(()=>{S&&I(1)},[p,g,S,h]);const N=a=>{y(a),I(a)},$=a=>{r(a.target.value)};return e.jsx(l.div,{initial:{opacity:0,y:-50},animate:{opacity:1,y:0},exit:{opacity:0,y:-50},transition:{duration:.5},children:e.jsxs(n,{container:!0,justifyContent:"center",style:{overflowX:"hidden"},children:[e.jsxs(n,{container:!0,justifyContent:"center",spacing:2,xs:12,children:[e.jsx(n,{item:!0,xs:12,sm:4,md:4,children:e.jsx(l.div,{initial:{opacity:0,x:-50},animate:{opacity:1,x:0},transition:{delay:.2},children:e.jsxs(j,{display:"flex",alignItems:"center",justifyContent:{xs:"flex-start",sm:"center"},children:[e.jsx(re,{}),e.jsxs(i,{variant:"body2",color:"textSecondary",children:["نام مالک: ",s.guild_info.fullname]})]})})}),e.jsx(n,{item:!0,xs:12,sm:4,md:4,children:e.jsx(l.div,{initial:{opacity:0,x:-50},animate:{opacity:1,x:0},transition:{delay:.4},children:e.jsxs(j,{display:"flex",alignItems:"center",justifyContent:{xs:"flex-start",sm:"center"},children:[" ",e.jsx(oe,{sx:{mr:1}}),e.jsxs(i,{variant:"body2",color:"textSecondary",children:["شماره همراه: ",s.guild_info.mobile]})]})})}),e.jsx(n,{item:!0,xs:12,sm:4,md:4,children:e.jsx(l.div,{initial:{opacity:0,x:-50},animate:{opacity:1,x:0},transition:{delay:.6},children:e.jsxs(j,{display:"flex",alignItems:"center",justifyContent:{xs:"flex-start",sm:"center"},children:[" ",e.jsx(Z,{sx:{mr:1}}),e.jsxs(i,{variant:"body2",color:"textSecondary",children:["موجودی: ",s==null?void 0:s.ware_house_info.quantity.toLocaleString()]})]})})})]}),e.jsxs(n,{container:!0,justifyContent:"center",spacing:2,sx:{my:2},alignItems:"center",children:[e.jsx(n,{item:!0,xs:12,sm:6,md:3,children:e.jsx(l.div,{initial:{opacity:0,y:-50},animate:{opacity:1,y:0},transition:{delay:.8},children:e.jsx(M,{label:"از تاریخ",id:"date",renderInput:a=>e.jsx(R,{...a}),value:p,onChange:a=>{A(m(a).format("YYYY-MM-DD"))}})})}),e.jsx(n,{item:!0,xs:12,sm:6,md:3,children:e.jsx(l.div,{initial:{opacity:0,y:-50},animate:{opacity:1,y:0},transition:{delay:1},children:e.jsx(M,{label:"تا تاریخ",id:"date",renderInput:a=>e.jsx(R,{...a}),value:g,onChange:a=>{b(m(a).format("YYYY-MM-DD"))}})})}),e.jsx(n,{item:!0,xs:12,sm:6,md:3,children:e.jsx(l.div,{initial:{opacity:0,y:-50},animate:{opacity:1,y:0},transition:{delay:1},children:e.jsxs(U,{fullWidth:!0,children:[e.jsx(V,{id:"demo-simple-select-label",children:"فیلتر تراکنش ها"}),e.jsxs(W,{labelId:"demo-simple-select-label",id:"demo-simple-select",value:h,label:"Age",onChange:$,children:[e.jsx(f,{value:"0",children:"همه"}),e.jsx(f,{value:"1",children:"موفق"}),e.jsx(f,{value:"3",children:"ناموفق"}),e.jsx(f,{value:"2",children:"نسیه"})]})]})})})]}),e.jsx(D,{style:{width:"100%"},children:e.jsx(H,{label:`تعداد کل تراکنش ها: ${t!=null&&t.totalItems?t==null?void 0:t.totalItems:0} ، جمع کل: ${t==null?void 0:t.sum.toLocaleString()} ریال`})}),e.jsx(n,{container:!0,justifyContent:"center",spacing:2,mt:2,p:2,children:(_=t==null?void 0:t.items)==null?void 0:_.map((a,d)=>{var T,L;return e.jsx(n,{item:!0,xs:12,sm:6,md:3,className:"bluehover",children:e.jsx(l.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},transition:{delay:d*.1+1.2},children:e.jsx(O,{style:{width:"100%",height:"100%",backgroundColor:a!=null&&a.name.includes("موفق")?"white":"rgb(255 229 229)"},children:e.jsxs(B,{children:[e.jsxs(j,{display:"flex",alignItems:"center",children:[e.jsxs(i,{variant:"h6",component:"h2",style:{marginRight:"8px"},children:[x>1?x*20-20+d+1:d+1," -"]}),e.jsx(i,{variant:(a==null?void 0:a.name.length)<17?"h6":"body1",component:"h2",style:{marginRight:"8px"},children:a==null?void 0:a.name}),a!=null&&a.name.includes("موفق")?e.jsx(ie,{style:{color:"green",marginRight:"4px"}}):e.jsx(ee,{style:{color:"red",marginRight:"4px"}})]}),e.jsx(D,{}),e.jsxs(n,{display:"grid",gap:2,mt:2,children:[e.jsxs(i,{variant:"body2",children:[e.jsx("strong",{children:"تاریخ:"})," ",C(a==null?void 0:a.date)]}),(a==null?void 0:a.product.length)===1&&e.jsxs(i,{variant:"body2",children:[e.jsx("strong",{children:"محصول:"})," ",(T=a==null?void 0:a.product[0])==null?void 0:T.name]}),(a==null?void 0:a.product.length)>1&&e.jsxs(i,{variant:"body2",children:[e.jsx("strong",{children:"محصولات:"})," ",(L=a==null?void 0:a.product)==null?void 0:L.map((q,G)=>e.jsxs("span",{children:[q.name," / "]},G))]}),e.jsxs(i,{variant:"body2",children:[e.jsx("strong",{children:"مبلغ:"})," ",a==null?void 0:a.price.toLocaleString()," ","ریال"]}),e.jsxs(i,{variant:"body2",children:[e.jsx("strong",{children:"از سرویس:"})," ",le(a==null?void 0:a.posProvider)]})]})]})})})},d)})}),e.jsx(n,{mt:2,children:e.jsx(l.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{delay:((E=t==null?void 0:t.items)==null?void 0:E.length)*.1+1.5},children:e.jsx(J,{count:Math.ceil((t==null?void 0:t.totalItems)/20),page:x,variant:"outlined",onChange:(a,d)=>{N(d)}})})})]})})},De=()=>{const s=Y(),[u,t]=o.useState(),[c,x]=o.useState(),y=ce();return o.useEffect(()=>{s(de(y)).then(h=>{t(h.payload.data)})},[]),o.useEffect(()=>{const h=u==null?void 0:u.map((r,p)=>[p+1,r==null?void 0:r.guild_info.fullname,r==null?void 0:r.guild_info.mobile,r==null?void 0:r.ware_house_info.quantity.toLocaleString(),e.jsx(Q,{"aria-label":"delete",color:"primary",onClick:()=>{s(se({title:"مشخصات کامل محل",right:!1,bottom:!0,content:e.jsx(je,{item:r})}))},children:e.jsx(F,{})},p)]);x(h)},[u]),e.jsx(j,{display:"flex",justifyContent:"center",children:e.jsxs(ue,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[" ",e.jsx(ne,{name:"لیست اصناف",data:c,columns:["ردیف","نام کامل","موبایل","موجودی","مشاهده تراکنش ها"]})]})})};export{De as default}; diff --git a/build/assets/ProvinceJahadRequests-zfkXqXU8.js b/build/assets/ProvinceJahadRequests-zfkXqXU8.js new file mode 100644 index 0000000..7bff4a1 --- /dev/null +++ b/build/assets/ProvinceJahadRequests-zfkXqXU8.js @@ -0,0 +1 @@ +import{j as u,a3 as au,ak as w,al as Du,T as tu,B as V,I as m,b0 as zu,d as Z,ai as _u,b5 as Yu,i as M6,aU as c0,ag as qu,bi as i0,ah as q6,aj as u6,b2 as Y6,b3 as e6,aX as Gu,av as i6,aw as C6,ax as ju,$ as C0,ae as h0,b as r6,Y as d0,cC as Ku,cD as g0,cE as p0,cF as A0,cG as x0}from"./mui-vendor-CkIVaoQP.js";import{r as o,f as G6}from"./react-vendor-CmFgShSM.js";import{L as z,j as D,h as P,A as nu,c as $u,M as G,u as Bu,N as eu,S as lu,G as d,O as pu,C as vu,X as O,b as gu,r as K6,a7 as v0,lr as y0,c5 as a6,ls as h6,lt as Z6,lu as X6,lv as mu,lw as d6,lx as g6,ly as Q6,lz as m6,lA as p6,lB as A6,lC as x6,v as su,V as U6,_ as t6,W as Fu,m as j0,kv as f0,kw as _0,lD as F0,lE as S0,lF as E0,lG as b0,lH as k0,lI as I0,lJ as P0,ky as w0,lK as T0,lL as L0,lM as R0,lN as $0,lO as B0,lP as O0}from"./index-CeyyVc1v.js";import{R as yu,a as fu}from"./index.esm-Bu7XMDZU.js";import{R as ou}from"./ResponsiveTable-w7hk7Uq8.js";import{a as Q,u as X,f as Nu}from"./redux-vendor-B7uoacJt.js";import{d as Wu}from"./Tune-D4M2CAhp.js";import{d as Uu}from"./Edit-CqBj1Y2L.js";import{d as y6}from"./Delete-C5MyLelE.js";import{c as j6,a as f6}from"./city-get-city-qTSRxslT.js";import{S as o6}from"./SimpleTable-DBAoNnCU.js";import{d as D0}from"./Search-Dek2fED1.js";import{d as N0}from"./Add--yVWBJhC.js";import{N as Zu}from"./NavLink-D2GD_ItM.js";import{L as Xu}from"./LinkItem-DT6qswcs.js";import{n as z0,o as W0,p as U0,q as J0}from"./index.esm-CjWvmHks.js";import{B as V0}from"./BackButton-Crzr7NMa.js";import{N as Mu}from"./NumberFormatCustom-DwWPj40N.js";import{d as l6}from"./ToggleOffOutlined-Ch26Umk7.js";import{d as s6}from"./ToggleOn-pBgb8alR.js";import"./iconBase-BEJYyZsk.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";const H0=Q("PROVINCE-JAHAD-DELETE-UNIONS-SERVICE",async(e,{dispatch:r})=>{r(z());try{const{data:a,status:n}=await D.delete("/LiveStock/union/union-view/0/?key="+e);return r(P()),{data:a,status:n}}catch(a){return r(P()),{error:a.response.data.result}}}),u0=Q("PROVINCE_JAHAD_UPDATE_PRODUCT_SERVICE",async(e,{dispatch:r})=>{r(z());try{const{data:a,status:n}=await D.put("LiveStock/union/union-view/0/",e);return r(P()),{data:a,status:n}}catch(a){return r(P()),{error:a.response.data.result}}}),M0=Q("PROVINCE_JAHAD_SUBMIT_PRODUCT_SERVICE",async(e,{dispatch:r})=>{r(z());try{const{data:a,status:n}=await D.post("LiveStock/union/union-view/",e);return r(P()),{data:a,status:n}}catch(a){return r(P()),{error:a.response.data.result}}}),e0=({updateTable:e,item:r})=>{var q,I,T,F,p,B,K;const[a,n]=o.useState([]),[x,t]=o.useState([]),[s,v]=o.useState(),[i,f]=o.useState(),[_,C]=o.useState(!0),[N]=o.useContext(nu),E=X(),l=$u().shape({name:G().required("این فیلد الزامی است"),first_name:G().required("این فیلد الزامی است"),last_name:G().required("این فیلد الزامی است"),address:G().required("این فیلد الزامی است"),nationalId:G().matches(/^\d+$/,"لطفا فقط عدد وارد کنید").length(10,"کد ملی باید ۱۰ رقم باشد").required("این فیلد الزامی است"),postalCode:G().matches(/^\d+$/,"لطفا فقط عدد وارد کنید").length(10,"کد پستی باید ۱۰ رقم باشد").required("این فیلد الزامی است"),mobile:G().matches(/^\d+$/,"لطفا فقط عدد وارد کنید").length(11,"شماره موبایل باید ۱۱ رقم باشد").required("این فیلد الزامی است")});o.useEffect(()=>{var L;E(z()),(L=E(j6()))==null||L.then(U=>{E(P()),n(U.payload.data)})},[]),o.useEffect(()=>{E(P()),s&&(E(z()),E(f6(s)).then(L=>{t(L.payload.data),C(!1),E(P())}))},[s]);const c=Bu({initialValues:{name:(r==null?void 0:r.name)||"",first_name:((q=r==null?void 0:r.user)==null?void 0:q.firstName)||"",last_name:((I=r==null?void 0:r.user)==null?void 0:I.lastName)||"",mobile:((T=r==null?void 0:r.user)==null?void 0:T.mobile)||"",address:((F=r==null?void 0:r.address)==null?void 0:F.address)||"",nationalId:(r==null?void 0:r.nationalId)||"",postalCode:((p=r==null?void 0:r.address)==null?void 0:p.postalCode)||""},validationSchema:l,enableReinitialize:!0,onSubmit:L=>{var U,$,M,J;r?E(u0({union_key:r==null?void 0:r.key,first_name:L.first_name,last_name:L.last_name,name:L.name,address:L.address,mobile:L.mobile,national_id:L.nationalId,postal_code:L.postalCode,city:i||(($=(U=r==null?void 0:r.address)==null?void 0:U.city)==null?void 0:$.name)})).then(Y=>{Y.payload.error?N({vertical:"top",horizontal:"center",msg:Y.payload.error,severity:"error"}):(N({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),E(eu({right:!1,bottom:!1,content:null})),e())}):E(M0({first_name:L.first_name,last_name:L.last_name,name:L.name,address:L.address,mobile:L.mobile,national_id:L.nationalId,postal_code:L.postalCode,city:i||((J=(M=r==null?void 0:r.address)==null?void 0:M.city)==null?void 0:J.name)})).then(Y=>{Y.payload.error?N({vertical:"top",horizontal:"center",msg:Y.payload.error,severity:"error"}):(N({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),E(eu({right:!1,bottom:!1,content:null})),e())})}}),g=()=>r?c.isValid:c.isValid&&i;return u.jsx(au,{container:!0,direction:"column",gap:lu.SMALL,children:u.jsx("form",{onSubmit:c.handleSubmit,children:u.jsxs(au,{container:!0,direction:"column",gap:lu.TINY,children:[u.jsx(w,{name:"name",label:" نام اتحادیه",fullWidth:!0,value:c.values.name,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.name&&!!c.errors.name,helperText:c.touched.name&&c.errors.name}),u.jsx(Du,{disablePortal:!0,id:"province",options:a==null?void 0:a.map(L=>({id:L.key,label:L.name})),onChange:(L,U)=>{v(U.id)},renderInput:L=>u.jsx(w,{...L,label:"استان را انتخاب کنید*"})}),u.jsx(Du,{disabled:_,disablePortal:!0,id:"city",options:x==null?void 0:x.map(L=>({id:L.key,label:L.name})),onChange:(L,U)=>{f(U.label)},renderInput:L=>u.jsx(w,{...L,label:"شهر را انتخاب کنید*"})}),r&&!i&&u.jsxs(tu,{variant:"caption",color:"error",children:["شهر: ",(K=(B=r==null?void 0:r.address)==null?void 0:B.city)==null?void 0:K.name]}),u.jsx(w,{name:"first_name",label:"نام ",fullWidth:!0,value:c.values.first_name,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.first_name&&!!c.errors.first_name,helperText:c.touched.first_name&&c.errors.first_name}),u.jsx(w,{name:"last_name",label:" نام خانوادگی",fullWidth:!0,value:c.values.last_name,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.last_name&&!!c.errors.last_name,helperText:c.touched.last_name&&c.errors.last_name}),u.jsx(w,{name:"mobile",label:"تلفن",fullWidth:!0,value:c.values.mobile,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.mobile&&!!c.errors.mobile,helperText:c.touched.mobile&&c.errors.mobile}),u.jsx(w,{name:"address",label:"آدرس ",fullWidth:!0,value:c.values.address,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.address&&!!c.errors.address,helperText:c.touched.address&&c.errors.address}),u.jsx(w,{name:"nationalId",label:"کد ملی",inputProps:{inputMode:"numeric",pattern:"[0-9]*"},fullWidth:!0,value:c.values.nationalId,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.nationalId&&!!c.errors.nationalId,helperText:c.touched.nationalId&&c.errors.nationalId}),u.jsx(w,{name:"postalCode",label:"کد پستی",fullWidth:!0,inputProps:{inputMode:"numeric",pattern:"[0-9]*"},value:c.values.postalCode,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.postalCode&&!!c.errors.postalCode,helperText:c.touched.postalCode&&c.errors.postalCode}),u.jsx(V,{type:"submit",variant:"contained",color:"primary",disabled:!g(),children:"ثبت اطلاعات"})]})})})},q0=({item:e,updateTable:r})=>{const a=X(),[n,x]=o.useState(!1),[t,s]=o.useState(null),[v]=o.useContext(nu),i=_=>{x(!0),s(_.currentTarget)},f=()=>{x(!1),s(null)};return u.jsxs(d,{children:[u.jsx(m,{variant:"contained",color:"primary",onClick:i,children:u.jsx(Wu,{})}),u.jsx(zu,{open:n,anchorEl:t,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsx("div",{style:{padding:2},children:u.jsxs(d,{container:!0,direction:"column",alignItems:"center",justifyContent:"center",gap:1,children:[u.jsx(Z,{title:"ویرایش اتحادیه",placement:"left-start",children:u.jsx(m,{color:"primary",onClick:()=>{f(),a(eu({right:!0,top:!1,content:u.jsx(e0,{item:e,updateTable:r}),title:"ویرایش اتحادیه "}))},children:u.jsx(Uu,{})})}),u.jsx(_u,{control:u.jsx(Yu,{size:"small",checked:e==null?void 0:e.active,onChange:()=>{a(u0({union_key:e==null?void 0:e.key,active:!(e!=null&&e.active)})).then(_=>{_.payload.error?v({vertical:"top",horizontal:"center",msg:_.payload.error,severity:"error"}):(r(),v({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},color:"primary"}),label:e!=null&&e.active?"فعال":"غیرفعال",style:{justifyContent:"center",alignItems:"center",display:"flex"}}),u.jsx(Z,{title:"حذف",placement:"left-start",children:u.jsx(m,{"aria-label":"delete",color:"error",onClick:()=>{f(),a(pu({title:"آیا مطمئن هستید؟",content:u.jsxs(d,{container:!0,children:[u.jsx(V,{color:"error",variant:"contained",onClick:()=>{a(H0(e==null?void 0:e.key)).then(_=>{_.payload.error?v({vertical:"top",horizontal:"center",msg:_.payload.error,severity:"error"}):(r(),a(vu()),v({vertical:"top",horizontal:"center",msg:_.payload.data.result,severity:"success"}))})},children:"تایید"}),u.jsx(V,{onClick:()=>{a(vu())},children:"لغو"})]})}))},children:u.jsx(y6,{})})})]})})})]})},Y0=()=>{const e=X(),r=T=>{f(T.target.value)},[a,n]=o.useState([]),[x,t]=o.useState(0),[s,v]=o.useState(10),[i,f]=o.useState(""),[_,C]=o.useState(1),[N,E]=o.useState([]),l=async T=>{let F;e(z()),F=await D.get(`LiveStock/union/union-view/?search=filter&value=${i}&role=${O()}&page=${T}&page_size=${s}`),e(P()),n(F.data.results),t(F.data.count)},c=T=>{l(T),C(T)},g=T=>{v(T),C(1)},q=()=>{l(_!==0?_:1)};o.useEffect(()=>{const T=a==null?void 0:a.map((F,p)=>[_===1?p+1:p+s*(_-1)+1,F==null?void 0:F.name,F==null?void 0:F.user.fullname,F==null?void 0:F.user.provinceName,F==null?void 0:F.user.cityName,F==null?void 0:F.user.mobile,F==null?void 0:F.nationalId,u.jsx(q0,{updateTable:q,item:F},p)]);E(T)},[a]),o.useEffect(()=>{l(1)},[e,s]);const I=async T=>{T.preventDefault(),e(z());try{const F=await D.get(`LiveStock/union/union-view/?search=filter&value=${i}&role=${O()}&page=${_}&page_size=${s}`);n(F.data.results),t(F.data.count),e(P())}catch(F){console.error("Error fetching data:",F)}};return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(d,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(V,{variant:"contained",color:"primary",onClick:()=>{e(eu({right:!0,top:!1,content:u.jsx(e0,{updateTable:q}),title:"ایجاد اتحادیه "}))},children:"ایجاد اتحادیه"}),u.jsx(d,{children:u.jsxs("form",{onSubmit:I,children:[u.jsx(w,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:r}),u.jsx(V,{type:"submit",onClick:I,endIcon:u.jsx(yu,{}),children:"جستجو"})]})})]}),u.jsx(ou,{ignoreTextsLength:!0,data:N,columns:["ردیف","نام اتحادیه","کاربر","استان","شهر","موبایل","کد ملی","عملیات"],handlePageChange:c,totalRows:x,page:_,perPage:s,handlePerRowsChange:g,title:"اتحادیه ها"})]})},r0=Q("PROVINCE_JAHAD_SUBMIT_COOPERATIVE_SERVICE",async(e,{dispatch:r})=>{r(z());try{const{data:a,status:n}=await D.put("/LiveStock/cooperative/cooperative-views/0/",e);return r(P()),{data:a,status:n}}catch(a){return r(P()),{error:a.response.data.result}}}),G0=Q("PROVINCE_JAHAD_SUBMIT_COOPERATIVE_SERVICE",async(e,{dispatch:r})=>{r(z());try{const{data:a,status:n}=await D.post("/LiveStock/cooperative/cooperative-views/",e);return r(P()),{data:a,status:n}}catch(a){return r(P()),{error:a.response.data.result}}}),n0=({updateTable:e,item:r,getDashboardData:a})=>{var I,T,F,p,B,K,L,U;const[n,x]=o.useState([]),[t,s]=o.useState([]),[v,i]=o.useState(),[f,_]=o.useState(),[C,N]=o.useState(!0),[E]=o.useContext(nu),l=X(),c=$u().shape({name:G().required("این فیلد الزامی است"),first_name:G().required("این فیلد الزامی است"),last_name:G().required("این فیلد الزامی است"),address:G().required("این فیلد الزامی است"),nationalId:G().matches(/^\d+$/,"لطفا فقط عدد وارد کنید").length(10,"کد ملی باید ۱۰ رقم باشد").required("این فیلد الزامی است"),postalCode:G().matches(/^\d+$/,"لطفا فقط عدد وارد کنید").length(10,"کد پستی باید ۱۰ رقم باشد").required("این فیلد الزامی است"),mobile:G().matches(/^\d+$/,"لطفا فقط عدد وارد کنید").length(11,"شماره موبایل باید ۱۱ رقم باشد").required("این فیلد الزامی است"),account:gu().required("این فیلد اجباری است!").typeError("صرفا اعداد شماره شبا را وارد کنید!")});o.useEffect(()=>{var $;l(z()),($=l(j6()))==null||$.then(M=>{l(P()),x(M.payload.data)})},[]),o.useEffect(()=>{l(P()),v&&(l(z()),l(f6(v)).then($=>{s($.payload.data),N(!1),l(P())}))},[v]);const g=Bu({initialValues:{name:(r==null?void 0:r.name)||"",first_name:((I=r==null?void 0:r.user)==null?void 0:I.firstName)||"",last_name:((T=r==null?void 0:r.user)==null?void 0:T.lastName)||"",mobile:((F=r==null?void 0:r.user)==null?void 0:F.mobile)||"",address:((p=r==null?void 0:r.address)==null?void 0:p.address)||"",nationalId:(r==null?void 0:r.nationalId)||"",postalCode:((B=r==null?void 0:r.address)==null?void 0:B.postalCode)||"",account:((K=r==null?void 0:r.account)==null?void 0:K.replace(/ir/gi,""))??""},validationSchema:c,enableReinitialize:!0,onSubmit:$=>{var M,J;r?l(r0({cooperative_key:r==null?void 0:r.key,first_name:$.first_name,last_name:$.last_name,name:$.name,address:$.address,mobile:$.mobile,account:"IR"+$.account,national_id:$.nationalId,postal_code:$.postalCode,city:f||((J=(M=r==null?void 0:r.address)==null?void 0:M.city)==null?void 0:J.name)})).then(Y=>{Y.payload.error?E({vertical:"top",horizontal:"center",msg:Y.payload.error,severity:"error"}):(E({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),l(eu({right:!1,bottom:!1,content:null})),e(),a())}):l(G0({first_name:$.first_name,last_name:$.last_name,name:$.name,mobile:$.mobile,address:$.address,national_id:$.nationalId,postal_code:$.postalCode,account:"IR"+$.account,city:f})).then(Y=>{Y.payload.error?E({vertical:"top",horizontal:"center",msg:Y.payload.error,severity:"error"}):(E({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),l(eu({right:!1,bottom:!1,content:null})),e(),a())})}}),q=()=>r?g.isValid:g.isValid&&f;return u.jsx(au,{container:!0,direction:"column",gap:lu.SMALL,children:u.jsx("form",{onSubmit:g.handleSubmit,children:u.jsxs(au,{container:!0,direction:"column",gap:lu.TINY,children:[u.jsx(w,{name:"name",label:" نام تعاونی",fullWidth:!0,value:g.values.name,onChange:g.handleChange,onBlur:g.handleBlur,error:g.touched.name&&!!g.errors.name,helperText:g.touched.name&&g.errors.name}),u.jsx(Du,{disablePortal:!0,id:"province",options:n==null?void 0:n.map($=>({id:$.key,label:$.name})),onChange:($,M)=>{i(M.id)},renderInput:$=>u.jsx(w,{...$,label:"استان را انتخاب کنید*"})}),u.jsx(Du,{disabled:C,disablePortal:!0,id:"city",options:t==null?void 0:t.map($=>({id:$.key,label:$.name})),onChange:($,M)=>{_(M.label)},renderInput:$=>u.jsx(w,{...$,label:"شهر را انتخاب کنید*"})}),r&&!f&&u.jsxs(tu,{variant:"caption",color:"error",children:["شهر: ",(U=(L=r==null?void 0:r.address)==null?void 0:L.city)==null?void 0:U.name]}),u.jsx(w,{name:"first_name",label:"نام ",fullWidth:!0,value:g.values.first_name,onChange:g.handleChange,onBlur:g.handleBlur,error:g.touched.first_name&&!!g.errors.first_name,helperText:g.touched.first_name&&g.errors.first_name}),u.jsx(w,{name:"last_name",label:" نام خانوادگی",fullWidth:!0,value:g.values.last_name,onChange:g.handleChange,onBlur:g.handleBlur,error:g.touched.last_name&&!!g.errors.last_name,helperText:g.touched.last_name&&g.errors.last_name}),u.jsx(w,{name:"mobile",label:"تلفن",fullWidth:!0,value:g.values.mobile,onChange:g.handleChange,onBlur:g.handleBlur,error:g.touched.mobile&&!!g.errors.mobile,helperText:g.touched.mobile&&g.errors.mobile}),u.jsx(w,{name:"address",label:"آدرس ",fullWidth:!0,value:g.values.address,onChange:g.handleChange,onBlur:g.handleBlur,error:g.touched.address&&!!g.errors.address,helperText:g.touched.address&&g.errors.address}),u.jsx(w,{name:"nationalId",label:"کد ملی",inputProps:{inputMode:"numeric",pattern:"[0-9]*"},fullWidth:!0,value:g.values.nationalId,onChange:g.handleChange,onBlur:g.handleBlur,error:g.touched.nationalId&&!!g.errors.nationalId,helperText:g.touched.nationalId&&g.errors.nationalId}),u.jsx(w,{name:"postalCode",label:"کد پستی",fullWidth:!0,inputProps:{inputMode:"numeric",pattern:"[0-9]*"},value:g.values.postalCode,onChange:g.handleChange,onBlur:g.handleBlur,error:g.touched.postalCode&&!!g.errors.postalCode,helperText:g.touched.postalCode&&g.errors.postalCode}),u.jsx(w,{name:"account",label:"شماره شبا",fullWidth:!0,inputProps:{inputMode:"numeric",pattern:"[0-9]*"},value:g.values.account,onChange:g.handleChange,onBlur:g.handleBlur,error:g.touched.account&&!!g.errors.account,helperText:g.touched.account&&g.errors.account}),u.jsx(V,{type:"submit",variant:"contained",color:"primary",disabled:!q(),children:"ثبت اطلاعات"})]})})})},K0=({item:e,updateTable:r,getDashboardData:a})=>{const[n,x]=o.useState(null),t=X(),s=C=>{x(C.currentTarget)},[v]=o.useContext(nu),i=()=>{x(null)},f=!!n,_=f?"popover":void 0;return u.jsxs(d,{container:!0,children:[u.jsx(m,{"aria-describedby":_,variant:"contained",color:"primary",onClick:s,children:u.jsx(Wu,{})}),u.jsx(zu,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:_,open:f,anchorEl:n,onClose:i,children:u.jsxs("div",{style:{padding:"20px",display:"flex",flexDirection:"column"},children:[u.jsx(Z,{title:"ویرایش",placement:"left-start",children:u.jsx(m,{"aria-label":"delete",color:"primary",onClick:()=>{i(),t(eu({title:"ویرایش اطلاعات ",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(n0,{updateTable:r,getDashboardData:a,item:e})}))},children:u.jsx(Uu,{})})}),u.jsx(_u,{control:u.jsx(Yu,{size:"small",checked:e==null?void 0:e.active,onChange:()=>{t(r0({cooperative_key:e==null?void 0:e.key,active:!(e!=null&&e.active)})).then(C=>{C.payload.error?v({vertical:"top",horizontal:"center",msg:C.payload.error,severity:"error"}):(r(),v({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},color:"primary"}),label:e!=null&&e.active?"فعال":"غیرفعال",style:{justifyContent:"center",alignItems:"center",display:"flex"}})]})})]})};var _6={},Z0=M6;Object.defineProperty(_6,"__esModule",{value:!0});var a0=_6.default=void 0,X0=Z0(K6()),Q0=u;a0=_6.default=(0,X0.default)((0,Q0.jsx)("path",{d:"M18 0H6C4.34 0 3 1.34 3 3v18c0 1.66 1.34 3 3 3h12c1.66 0 3-1.34 3-3V3c0-1.66-1.34-3-3-3m-4 22h-4v-1h4zm5.25-3H4.75V3h14.5z"}),"TabletAndroid");const m0=Q("PROVINCE_JAHAD_GET_COOPERATIVES_POS_INFO",async(e,{dispatch:r})=>{r(z());const{data:a,status:n}=await D.get(`/cooperative-pos/?cooperative_key=${e}`);return r(P()),{data:a,status:n}}),ue=({item:e})=>{const r=X(),[a,n]=o.useState([]);return o.useEffect(()=>{r(m0(e.key)).then(x=>{var s;const t=(s=x.payload.data)==null?void 0:s.map((v,i)=>[i+1,v==null?void 0:v.companyName,v==null?void 0:v.posId]);n(t)})},[]),u.jsx(d,{container:!0,xs:12,children:u.jsx(o6,{columns:["ردیف","نام شرکت","شناسه POS"],data:a})})},ee=()=>{const e=X(),r=F=>{_(F.target.value)},a=Nu(F=>F.userSlice.userProfile.key),[n,x]=o.useState([]),[t,s]=o.useState(0),[v,i]=o.useState(10),[f,_]=o.useState(""),[C,N]=o.useState(1),[E,l]=o.useState([]),c=async F=>{let p;e(z()),p=await D.get(`/LiveStock/cooperative/cooperative-views/?search=filter&value=${f}&role=${O()}&page=${F}&page_size=${v}`),e(P()),x(p.data.results),s(p.data.count)},g=F=>{c(F),N(F)},q=F=>{i(F),N(1)},I=()=>{c(C!==0?C:1)};o.useEffect(()=>{const F=n==null?void 0:n.map((p,B)=>{var K,L,U,$,M;return[C===1?B+1:B+v*(C-1)+1,p==null?void 0:p.name,p==null?void 0:p.user.fullname,(L=(K=p==null?void 0:p.address)==null?void 0:K.province)==null?void 0:L.name,($=(U=p==null?void 0:p.address)==null?void 0:U.city)==null?void 0:$.name,p==null?void 0:p.user.mobile,p==null?void 0:p.nationalId,(p==null?void 0:p.account)||"-",((M=p==null?void 0:p.user)==null?void 0:M.password)||"-",u.jsx(Z,{placement:"left",title:"لیست دستگاه POS",children:u.jsx(m,{"aria-label":"delete",variant:"outlined",color:"primary",onClick:()=>{e(pu({title:`لیست دستگاه‌های POS تعاونی ${p==null?void 0:p.name}`,content:u.jsx(ue,{item:p})}))},children:u.jsx(a0,{})})},B),u.jsx(K0,{item:p,updateTable:I},B)]});l(F)},[n]),o.useEffect(()=>{c(1)},[e,v]);const T=async F=>{F.preventDefault(),e(z());try{const p=await D.get(`/LiveStock/cooperative/cooperative-views/?search=filter&value=${f}&role=${O()}&page=${C}&page_size=${v}`);x(p.data.results),s(p.data.count),e(P())}catch(p){console.error("Error fetching data:",p)}};return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(d,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(V,{variant:"contained",onClick:()=>{e(eu({title:"ایجاد تعاونی",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(n0,{updateTable:I})}))},children:"ایجاد تعاونی"}),u.jsx(d,{children:u.jsxs("form",{onSubmit:T,children:[u.jsx(w,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:r}),u.jsx(V,{type:"submit",onClick:T,endIcon:u.jsx(yu,{}),children:"جستجو"})]})}),u.jsx(Z,{title:"خروجی اکسل",children:u.jsx("a",{href:`${D.defaults.baseURL}live-stock-cooperatives-excel/?role=${O()}&key=${a}`,rel:"noreferrer",children:u.jsx(V,{color:"success",children:u.jsx(fu,{size:32})})})})]}),u.jsx(ou,{data:E,columns:["ردیف","نام تعاونی","کاربر","استان","شهر","موبایل","کد ملی","شماره شبا","کلمه عبور","POS","عملیات"],handlePageChange:g,totalRows:t,page:C,perPage:v,handlePerRowsChange:q,title:"تعاونی ها "})]})},re=Q("PROVINCE_JAHAD_GET_HERD_INFO_DASHBOARD_SERVICE",async(e,{dispatch:r})=>{r(z());const{data:a,status:n}=await D.get("/LiveStock/live-stock/dashboard_live_stock/",{params:{role:O(),search:"filter",value:e.search,type:e.type}});return r(P()),{data:a,status:n}}),v6=Q("PROVINCE_JAHAD_EDIT_HERD_SERVICE",async(e,{dispatch:r})=>{r(z());try{const{data:a,status:n}=await D.put("/LiveStock/live-stock/live-stock-view/0/",e);return r(P()),{data:a,status:n}}catch(a){return r(P()),{error:a.response.data.result}}}),ne=Q("PROVINCE_JAHAD_SUBMIT_HERD_SERVICE",async(e,{dispatch:r})=>{r(z());try{const{data:a,status:n}=await D.post("/LiveStock/live-stock/live-stock-view/",e);return r(P()),{data:a,status:n}}catch(a){return r(P()),{error:a.response.data.result}}}),ae=Q("PROVINCE-JAHAD-DELETE-HERD-SERVICE",async(e,{dispatch:r})=>{var a,n;r(z());try{const{data:x,status:t}=await D.delete(`/LiveStock/live-stock/live-stock-view/0/?live_stock_key=${e.live_stock_key}`);return r(P()),{data:x,status:t}}catch(x){return r(P()),{error:((n=(a=x.response)==null?void 0:a.data)==null?void 0:n.result)||"خطا در بایگانی گله"}}}),te=Q("PROVINCE_JAHAD_GET_SINGLE_RANCHER",async(e,{dispatch:r})=>{r(z());const{data:a,status:n}=await D.get("LiveStock/rancher/rancher-view/",{params:{value:e.value,search:"filter",role:O()}});return r(P()),{data:a,status:n}}),F6=({item:e,updateTable:r,getDashboardData:a,rancherKey:n})=>{const[x]=o.useContext(nu),t=X(),[s,v]=o.useState(null),i=Bu({initialValues:{herd_code:(e==null?void 0:e.herdCode)||"",type:(e==null?void 0:e.type)||"",contractor_code:(e==null?void 0:e.contractorCode)||"",agent:(e==null?void 0:e.agent)||"",unique_identifier:(e==null?void 0:e.uniqueIdentifier)||"",gender:(e==null?void 0:e.gender)||"نر",userInfoCheck:null},validationSchema:$u({...e&&{herd_code:G().required("این فیلد اجباریست!"),contractor_code:G().required("این فیلد اجباریست!")},type:G().required("این فیلد اجباریست!"),agent:G().required("این فیلد اجباریست!"),unique_identifier:G().required("این فیلد اجباریست!"),gender:G().required("این فیلد اجباریست!")}),onSubmit:f=>{e?t(v6({live_stock_key:e==null?void 0:e.key,unique_identifier:f.unique_identifier,agent:f.agent,contractor_code:f.contractor_code,gender:f.gender,type:f.type,herd_code:f.herd_code})).then(_=>{_.payload.error?x({vertical:"top",horizontal:"center",msg:_.payload.error,severity:"error"}):(x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(eu({right:!1,bottom:!1,content:null})),r(),a())}):t(ne({unique_identifier:f.unique_identifier,agent:f.agent,gender:f.gender,type:f.type,rancher_key:n||(s==null?void 0:s.key)})).then(_=>{_.payload.error?x({vertical:"top",horizontal:"center",msg:_.payload.error,severity:"error"}):(x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(eu({right:!1,bottom:!1,content:null})),r(),a())})}});return u.jsx(u.Fragment,{children:!n&&!s?u.jsxs(d,{children:[u.jsx(tu,{children:"جستجو کاربر"}),u.jsxs(d,{mt:lu.SMALL,display:"flex",width:1,children:[u.jsx(w,{fullWidth:!0,id:"userInfoCheck",label:"شماره موبایل، کد گله یا کد ملی دامدار",variant:"outlined",value:i.values.userInfoCheck,error:i.touched.userInfoCheck?!!i.errors.userInfoCheck:null,onChange:i.handleChange,onBlur:i.handleBlur,helperText:i.touched.userInfoCheck&&i.errors.userInfoCheck?i.errors.userInfoCheck:null}),u.jsx(m,{disabled:!i.values.userInfoCheck,"aria-label":"delete",color:"primary",onClick:()=>{t(te({value:i.values.userInfoCheck})).then(f=>{f.error?x({vertical:"top",horizontal:"center",msg:"کاربر یافت نشد",severity:"error"}):v(f.payload.data)})},children:u.jsx(D0,{})})]}),u.jsx(c0,{children:"شماره موبایل، کد گله یا کد ملی دامدار را وارد کنید"})]}):u.jsxs(d,{container:!0,justifyContent:"center",alignItems:"center",direction:"column",gap:2,children:[s&&u.jsxs(d,{container:!0,p:2,direction:"column",gap:1,xs:12,style:{border:"1px solid #d9d9d9",borderRadius:"10px",padding:"20px",backgroundColor:"#f0f0f0"},children:[u.jsxs(d,{container:!0,gap:1,xs:12,children:[u.jsx(tu,{variant:"body",children:"نام دامدای:"}),u.jsx(tu,{variant:"body2",color:"primary",children:s==null?void 0:s.name})]}),u.jsxs(d,{container:!0,gap:1,xs:12,children:[u.jsx(tu,{variant:"body",children:"کد گله:"}),u.jsx(tu,{variant:"body2",color:"primary",children:s==null?void 0:s.herdCode})]}),u.jsxs(d,{container:!0,gap:1,xs:12,children:[u.jsx(tu,{variant:"body",children:"کد اپیدمیولوژیک:"}),u.jsx(tu,{variant:"body2",color:"primary",children:s==null?void 0:s.epidemiologicalCode})]}),u.jsxs(d,{container:!0,gap:1,xs:12,children:[u.jsx(tu,{variant:"body",children:"نام گله:"}),u.jsx(tu,{variant:"body2",color:"primary",children:s==null?void 0:s.herdName})]})]}),e&&u.jsx(w,{fullWidth:!0,id:"herd_code",name:"herd_code",label:"کد گله",value:i.values.herd_code,onChange:i.handleChange,onBlur:i.handleBlur,error:i.touched.herd_code&&!!i.errors.herd_code,helperText:i.touched.herd_code&&i.errors.herd_code}),u.jsx(w,{fullWidth:!0,id:"type",name:"type",label:"نوع",value:i.values.type,onChange:i.handleChange,onBlur:i.handleBlur,error:i.touched.type&&!!i.errors.type,helperText:i.touched.type&&i.errors.type}),e&&u.jsx(w,{fullWidth:!0,id:"contractor_code",name:"contractor_code",label:"کد پیمانکار",value:i.values.contractor_code,onChange:i.handleChange,onBlur:i.handleBlur,error:i.touched.contractor_code&&!!i.errors.contractor_code,helperText:i.touched.contractor_code&&i.errors.contractor_code}),u.jsx(w,{fullWidth:!0,id:"agent",name:"agent",label:"مامور",value:i.values.agent,onChange:i.handleChange,onBlur:i.handleBlur,error:i.touched.agent&&!!i.errors.agent,helperText:i.touched.agent&&i.errors.agent}),u.jsx(w,{fullWidth:!0,id:"unique_identifier",name:"unique_identifier",label:"شناسه یکتا دام",value:i.values.unique_identifier,onChange:i.handleChange,onBlur:i.handleBlur,error:i.touched.unique_identifier&&!!i.errors.unique_identifier,helperText:i.touched.unique_identifier&&i.errors.unique_identifier}),u.jsxs(qu,{component:"fieldset",children:[u.jsx(i0,{component:"legend",children:"جنسیت"}),u.jsxs(q6,{row:!0,id:"gender",name:"gender",value:i.values.gender,onChange:i.handleChange,children:[u.jsx(_u,{value:"نر",control:u.jsx(u6,{}),label:"نر"}),u.jsx(_u,{value:"ماده",control:u.jsx(u6,{}),label:"ماده"})]}),i.touched.gender&&i.errors.gender&&u.jsx("div",{style:{color:"red"},children:i.errors.gender})]}),u.jsx(V,{disabled:!i.isValid,type:"submit",variant:"contained",color:"primary",fullWidth:!0,onClick:i.handleSubmit,children:"ثبت"})]})})};var S6={},oe=M6;Object.defineProperty(S6,"__esModule",{value:!0});var t0=S6.default=void 0,le=oe(K6()),se=u;t0=S6.default=(0,le.default)((0,se.jsx)("path",{d:"m20.55 5.22-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.15.55L3.46 5.22C3.17 5.57 3 6.01 3 6.5V19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.49-.17-.93-.45-1.28M12 9.5l5.5 5.5H14v2h-4v-2H6.5zM5.12 5l.82-1h12l.93 1z"}),"Unarchive");const ce=({item:e,updateTable:r,getDashboardData:a,dataType:n})=>{const[x,t]=o.useState(null),s=X(),[v]=o.useContext(nu),i=c=>{t(c.currentTarget)},f=()=>{t(null)},_=!!x,C=_?"popover":void 0,N=()=>{s(ae({live_stock_key:e==null?void 0:e.key})).then(c=>{c.payload.error?v({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(r(),v({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),s(vu()))}),f()},E=()=>{s(v6({live_stock_key:e==null?void 0:e.key,return_from_archive:!0})).then(c=>{c.payload.error?v({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(r(),s(vu()),v({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}),f()},l=c=>{f(),s(pu({title:"آیا مطمئن هستید؟",content:u.jsxs(d,{container:!0,spacing:2,children:[u.jsx(d,{item:!0,xs:12,container:!0,justifyContent:"center",alignItems:"center",children:u.jsx(tu,{variant:"body2",children:c==="archive"?"آیا می‌خواهید این گله را به بایگانی منتقل کنید؟":"آیا می‌خواهید این گله را از بایگانی خارج کنید؟"})}),u.jsx(d,{item:!0,xs:6,children:u.jsx(V,{fullWidth:!0,variant:"contained",color:"primary",onClick:()=>{c==="archive"?N():E()},children:"بله"})}),u.jsx(d,{item:!0,xs:6,children:u.jsx(V,{fullWidth:!0,variant:"outlined",onClick:()=>s(vu()),children:"خیر"})})]})}))};return u.jsxs(d,{container:!0,children:[u.jsx(m,{"aria-describedby":C,variant:"contained",color:"primary",onClick:i,children:u.jsx(Wu,{})}),u.jsx(zu,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:C,open:_,anchorEl:x,onClose:f,children:u.jsxs("div",{style:{padding:"20px",display:"flex",flexDirection:"column"},children:[u.jsx(Z,{title:"ویرایش",placement:"left-start",children:u.jsx(m,{"aria-label":"delete",color:"primary",onClick:()=>{f(),s(eu({title:"ویرایش اطلاعات",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(F6,{updateTable:r,getDashboardData:a,item:e})}))},children:u.jsx(Uu,{})})}),u.jsx(_u,{control:u.jsx(Yu,{size:"small",checked:e==null?void 0:e.active,onChange:()=>{s(v6({live_stock_key:e==null?void 0:e.key,active:!(e!=null&&e.active)})).then(c=>{c.payload.error?v({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(r(),v({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},color:"primary"}),label:e!=null&&e.active?"فعال":"غیرفعال",style:{justifyContent:"center",alignItems:"center",display:"flex"}}),n==="archive"?u.jsx(Z,{title:"برگشت از بایگانی",placement:"left-start",children:u.jsx(m,{variant:"outlined",color:"primary",onClick:()=>l("unarchive"),style:{marginTop:"10px"},children:u.jsx(t0,{})})}):u.jsx(Z,{title:"انتقال به بایگانی",placement:"left-start",children:u.jsx(m,{variant:"outlined",color:"error",onClick:()=>l("archive"),style:{marginTop:"10px"},children:u.jsx(v0,{})})})]})})]})},ie=()=>{var $,M,J,Y,W,h,b,R,A;const e=X(),r=Nu(j=>j.userSlice.userProfile.key),[a,n]=o.useState([]),[x,t]=o.useState(0),[s,v]=o.useState(10),[i,f]=o.useState(""),[_,C]=o.useState(1),[N,E]=o.useState([]),[l,c]=o.useState([]),[g,q]=o.useState("0"),I=async j=>{let y;e(z()),y=await D.get(`/LiveStock/live-stock/live-stock-view/?search=filter&value=${i}&role=${O()}&page=${j}&page_size=${s}&type=${g==="0"?"pending":"archive"}`),e(P()),n(y.data.results),t(y.data.count)},T=j=>{f(j.target.value)},F=(j,y)=>{q(y)},p=j=>{I(j),C(j)},B=j=>{v(j),C(1)},K=()=>{I(_!==0?_:1)},L=()=>{e(re({search:i,type:g==="0"?"pending":"archive"})).then(j=>{c(j.payload.data)})};o.useEffect(()=>{const j=a==null?void 0:a.map((y,k)=>{var ru,cu,iu,Cu;return[_===1?k+1:k+s*(_-1)+1,((ru=y==null?void 0:y.rancher)==null?void 0:ru.fullname)||"-",(cu=y==null?void 0:y.rancher)==null?void 0:cu.nationalId,((iu=y==null?void 0:y.rancher)==null?void 0:iu.mobile)||"-",((Cu=y==null?void 0:y.rancher)==null?void 0:Cu.city)||"-",(y==null?void 0:y.nationalIdLivestockCode)||"-",(y==null?void 0:y.herdCode)||"-",(y==null?void 0:y.type)||"-",(y==null?void 0:y.birthDay)||"-",(y==null?void 0:y.gender)||"-",y0(y==null?void 0:y.age)||"-",(y==null?void 0:y.contractorCode)||"-",(y==null?void 0:y.uniqueIdentifier)||"-",(y==null?void 0:y.agent)||"-",(y==null?void 0:y.registeringUser)||"-",(y==null?void 0:y.registeringDate)||"-",u.jsx(ce,{dataType:g==="0"?"pending":"archive",item:y,getDashboardData:L,updateTable:K},k)]});E(j)},[a]),o.useEffect(()=>{I(1)},[e,s,g]),o.useEffect(()=>{L()},[]);const U=async j=>{j.preventDefault(),e(z());try{const y=await D.get(`/LiveStock/live-stock/live-stock-view/?search=filter&value=${i}&role=${O()}&page=1&page_size=${s}&type=${g==="0"?"pending":"archive"}`);n(y.data.results),t(y.data.count),L(),e(P())}catch(y){console.error("Error fetching data:",y)}};return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(d,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:u.jsxs(Y6,{value:g,onChange:F,children:[u.jsx(e6,{value:"0",label:"فعال"}),u.jsx(e6,{value:"1",label:"بایگانی شده"})]})}),u.jsx(V,{variant:"contained","aria-label":"delete",color:"primary",onClick:()=>{e(eu({title:"ایجاد گله",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(F6,{updateTable:K,getDashboardData:L})}))},children:"ایجاد گله"}),u.jsx(d,{children:u.jsxs("form",{onSubmit:U,children:[u.jsx(w,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:T}),u.jsx(V,{type:"submit",onClick:U,endIcon:u.jsx(yu,{}),children:"جستجو"})]})}),u.jsx(Z,{title:"خروجی اکسل",children:u.jsx("a",{href:`${D.defaults.baseURL}live-stock-herds-excel/?role=${O()}&key=${r}`,rel:"noreferrer",children:u.jsx(V,{color:"success",children:u.jsx(fu,{size:32})})})})]}),u.jsx(d,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(ou,{noPagination:!0,isDashboard:!0,columns:["تعداد گله","تعداد گوسفندان","تعداد بزها ","تعداد گاوها","تعداد اسب ها ","تعداد شترها","تعداد دام سبک","تعداد دام سنگین","مجموع دام ها"],data:[[($=l==null?void 0:l.liveStocksCount)==null?void 0:$.toLocaleString(),(M=l==null?void 0:l.sheep)==null?void 0:M.toLocaleString(),(J=l==null?void 0:l.goat)==null?void 0:J.toLocaleString(),(Y=l==null?void 0:l.cow)==null?void 0:Y.toLocaleString(),(W=l==null?void 0:l.horse)==null?void 0:W.toLocaleString(),(h=l==null?void 0:l.camel)==null?void 0:h.toLocaleString(),(b=l==null?void 0:l.lightLivestock)==null?void 0:b.toLocaleString(),(R=l==null?void 0:l.heavyLivestock)==null?void 0:R.toLocaleString(),(A=Math.round((l==null?void 0:l.lightLivestock)+(l==null?void 0:l.heavyLivestock)))==null?void 0:A.toLocaleString()]],title:"خلاصه اطلاعات"})}),u.jsx(ou,{data:N,columns:["ردیف","دامدار","کد ملی دامدار","موبایل","شهرستان","کد ملی دام","کد گله","گونه","تاریخ تولد","جنسیت","سن","کد پیمانکار","شناسه یکتای واحد کشاورزی","مامور","کاربر ثبت کننده","تاریخ تکمیل فرم","عملیات"],handlePageChange:p,totalRows:x,page:_,perPage:s,handlePerRowsChange:B,title:"گله ها "})]})},J6=Q("PROVINCE_JAHAD_GET_RANCHERD_INFO_DASHBOARD_SERVICE",async(e,{dispatch:r})=>{r(z());const{data:a,status:n}=await D.get("/LiveStock/rancher/dashboard_rancher",{params:{role:O(),search:"filter",value:e.search}});return r(P()),{data:a,status:n}}),Ce=Q("PROVINCE_JAHAD_GET_PRODUCT_INFO",async(e,{dispatch:r})=>{r(z());const{data:a,status:n}=await D.get("LiveStock/rancher/get_detail_rancher/",{params:{herd_code:e.herd_code}});return r(P()),{data:a,status:n}}),he=({item:e})=>{const r=X(),[a,n]=o.useState();return o.useEffect(()=>{r(Ce({herd_code:e==null?void 0:e.herdCode})).then(x=>{n(x.payload.data)})},[]),u.jsx(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsx(o6,{columns:["تعداد دام سبک","تعداد دام سنگین","جمع کل گله","گاو","گوسفند","بز","شتر","اسب"],data:[[a==null?void 0:a.lightLivestock,a==null?void 0:a.heavyLivestock,Math.round((a==null?void 0:a.lightLivestock)+(a==null?void 0:a.heavyLivestock)).toLocaleString(),a==null?void 0:a.cow,a==null?void 0:a.sheep,a==null?void 0:a.goat,a==null?void 0:a.camel,a==null?void 0:a.horse]]})})},c6=Q("PROVINCE_JAHAD_RANCHER_ACTIVATION",async(e,{dispatch:r})=>{r(z());try{const{data:a,status:n}=await D.put("LiveStock/rancher/rancher-view/0/",e);return r(P()),{data:a,status:n}}catch(a){return r(P()),{error:a.response.data.result}}}),de=Q("PROVINCE_JAHAD_SUBMIT_RANCHER",async(e,{dispatch:r})=>{r(z());try{const{data:a,status:n}=await D.post("LiveStock/rancher/rancher-view/",e);return r(P()),{data:a,status:n}}catch(a){return r(P()),{error:a.response.data.result}}}),ge=$u({mobile:G().required("این فیلد اجباری است!").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),first_name:G().required("این فیلد اجباریست!"),last_name:G().required("این فیلد اجباریست!"),national_id:G().required("این فیلد اجباریست!").matches(/^\d{10}$/,"کد ملی باید 10 رقم باشد!"),postal_code:G().required("این فیلد اجباریست!"),name:G().required("این فیلد اجباریست!"),epidemiological_code:G().required("این فیلد اجباریست!"),herd_code:G().required("این فیلد اجباریست!"),herd_name:G().required("این فیلد اجباریست!")}),o0=({item:e,updateTable:r})=>{var g,q;const[a,n]=o.useState([]),[x,t]=o.useState([]),[s,v]=o.useState(),[i,f]=o.useState(),[_,C]=o.useState(!0),[N]=o.useContext(nu),E=X(),l=Bu({initialValues:{mobile:(e==null?void 0:e.mobile)||"",first_name:((g=e==null?void 0:e.user)==null?void 0:g.firstName)||"",last_name:((q=e==null?void 0:e.user)==null?void 0:q.lastName)||"",national_id:(e==null?void 0:e.nationalId)||"",postal_code:(e==null?void 0:e.postalCode)||"",name:(e==null?void 0:e.name)||"",epidemiological_code:(e==null?void 0:e.epidemiologicalCode)||"",herd_code:(e==null?void 0:e.herdCode)||"",herd_name:(e==null?void 0:e.herdName)||""},validationSchema:ge,onSubmit:I=>{e?E(c6({key:e==null?void 0:e.key,city:i||(e==null?void 0:e.city),mobile:I.mobile,first_name:I.first_name,last_name:I.last_name,national_id:I.national_id,postal_code:I.postal_code,name:I.name,epidemiological_code:I.epidemiological_code,herd_code:I.herd_code,herd_name:I.herd_name})).then(T=>{T.payload.error?N({vertical:"top",horizontal:"center",msg:T.payload.error,severity:"error"}):(N({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),E(eu({right:!1,bottom:!1,content:null})),r())}):E(de({city:i,mobile:I.mobile,first_name:I.first_name,last_name:I.last_name,national_id:I.national_id,postal_code:I.postal_code,name:I.name,epidemiological_code:I.epidemiological_code,herd_code:I.herd_code,herd_name:I.herd_name})).then(T=>{T.payload.error?N({vertical:"top",horizontal:"center",msg:T.payload.error,severity:"error"}):(N({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),E(eu({right:!1,bottom:!1,content:null})),r())})}}),c=()=>e?l.isValid:l.isValid&&i;return o.useEffect(()=>{var I;E(z()),(I=E(j6()))==null||I.then(T=>{E(P()),n(T.payload.data)})},[]),o.useEffect(()=>{E(P()),s&&(E(z()),E(f6(s)).then(I=>{t(I.payload.data),C(!1),E(P())}))},[s]),u.jsx(au,{container:!0,direction:"column",gap:lu.SMALL,children:u.jsxs(au,{container:!0,direction:"column",gap:lu.TINY,children:[u.jsx(au,{item:!0,xs:12,children:u.jsx(w,{fullWidth:!0,id:"name",name:"name",label:"نام دامداری",value:l.values.name,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.name&&!!l.errors.name,helperText:l.touched.name&&l.errors.name})}),u.jsx(au,{item:!0,xs:12,children:u.jsx(w,{fullWidth:!0,id:"herd_name",name:"herd_name",label:"نام گله",value:l.values.herd_name,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.herd_name&&!!l.errors.herd_name,helperText:l.touched.herd_name&&l.errors.herd_name})}),u.jsx(au,{item:!0,xs:12,children:u.jsx(w,{fullWidth:!0,id:"first_name",name:"first_name",label:"نام",value:l.values.first_name,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.first_name&&!!l.errors.first_name,helperText:l.touched.first_name&&l.errors.first_name})}),u.jsx(au,{item:!0,xs:12,children:u.jsx(w,{fullWidth:!0,id:"last_name",name:"last_name",label:"نام خانوادگی",value:l.values.last_name,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.last_name&&!!l.errors.last_name,helperText:l.touched.last_name&&l.errors.last_name})}),u.jsx(au,{item:!0,xs:12,children:u.jsx(w,{fullWidth:!0,id:"mobile",name:"mobile",label:"موبایل",value:l.values.mobile,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.mobile&&!!l.errors.mobile,helperText:l.touched.mobile&&l.errors.mobile})}),u.jsx(Du,{disablePortal:!0,id:"province",options:a==null?void 0:a.map(I=>({id:I.key,label:I.name})),onChange:(I,T)=>{v(T.id)},renderInput:I=>u.jsx(w,{...I,label:"استان را انتخاب کنید*"})}),u.jsx(Du,{disabled:_,disablePortal:!0,id:"city",options:x==null?void 0:x.map(I=>({id:I.key,label:I.name})),onChange:(I,T)=>{f(T.label)},renderInput:I=>u.jsx(w,{...I,label:"شهر را انتخاب کنید*"})}),e&&!i&&u.jsxs(tu,{variant:"caption",color:"error",children:["شهر: ",e==null?void 0:e.city]}),u.jsx(au,{item:!0,xs:12,children:u.jsx(w,{fullWidth:!0,id:"national_id",name:"national_id",label:"کد ملی",value:l.values.national_id,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.national_id&&!!l.errors.national_id,helperText:l.touched.national_id&&l.errors.national_id})}),u.jsx(au,{item:!0,xs:12,children:u.jsx(w,{fullWidth:!0,id:"postal_code",name:"postal_code",label:"کد پستی",value:l.values.postal_code,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.postal_code&&!!l.errors.postal_code,helperText:l.touched.postal_code&&l.errors.postal_code})}),u.jsx(au,{item:!0,xs:12,children:u.jsx(w,{fullWidth:!0,id:"epidemiological_code",name:"epidemiological_code",label:"کد اپیدمیولوژیک",value:l.values.epidemiological_code,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.epidemiological_code&&!!l.errors.epidemiological_code,helperText:l.touched.epidemiological_code&&l.errors.epidemiological_code})}),u.jsx(au,{item:!0,xs:12,children:u.jsx(w,{fullWidth:!0,id:"herd_code",name:"herd_code",label:"کد گله",value:l.values.herd_code,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.herd_code&&!!l.errors.herd_code,helperText:l.touched.herd_code&&l.errors.herd_code})}),u.jsx(au,{item:!0,xs:12,children:u.jsx(V,{disabled:!c(),type:"submit",variant:"contained",color:"primary",fullWidth:!0,onClick:l.handleSubmit,children:"ثبت"})})]})})},pe=$u({amount:gu().required("تعداد الزامی است").integer("تعداد باید یک عدد صحیح باشد")}),Ae=({updateTable:e,item:r,getDashboardData:a})=>{const n=X(),[x]=o.useContext(nu),t=Bu({initialValues:{amount:(r==null?void 0:r.dhiAmount)||""},validationSchema:pe,onSubmit:s=>{n(c6({key:r==null?void 0:r.key,dhi_amount:s.amount})).then(v=>{v.payload.error?x({vertical:"top",horizontal:"center",msg:v.payload.error,severity:"error"}):(x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),n(vu()),a(),e())})}});return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",children:[u.jsx(tu,{variant:"body2",color:"error",children:"در صورت وارد کردن مقدار 0 دامدار از پروژه DHI خارج میشود."}),u.jsx(w,{fullWidth:!0,id:"amount",name:"amount",label:"تعداد دام DHI",variant:"outlined",margin:"normal",value:t.values.amount,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.amount&&!!t.errors.amount,helperText:t.touched.amount&&t.errors.amount}),u.jsx(V,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,onClick:t.handleSubmit,children:"ثبت"})]})},xe=Q("PROVINCE-JAHAD-DELETE-RANCHER-SERVICE",async(e,{dispatch:r})=>{r(z());try{const{data:a,status:n}=await D.delete("/LiveStock/rancher/rancher-view/0/?rancher_key="+e);return r(P()),{data:a,status:n}}catch(a){return r(P()),{error:a.response.data.result}}}),ve=({item:e,updateTable:r,getDashboardData:a})=>{const n=X(),[x,t]=o.useState(!1),[s,v]=o.useState(null),[i]=o.useContext(nu),f=C=>{t(!0),v(C.currentTarget)},_=()=>{t(!1),v(null)};return u.jsxs(d,{children:[u.jsx(m,{variant:"contained",color:"primary",onClick:f,children:u.jsx(Wu,{})}),u.jsx(zu,{open:x,anchorEl:s,onClose:_,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsx("div",{style:{padding:10},children:u.jsxs(d,{container:!0,direction:"column",alignItems:"center",justifyContent:"center",gap:1,children:[u.jsx(Z,{title:"جزِئیات گله",placement:"left-start",children:u.jsx(m,{color:"primary",size:"small",onClick:()=>{_(),n(pu({title:"جزئیات گله",content:u.jsx(he,{item:e})}))},children:u.jsx(a6,{})})}),u.jsx(Z,{title:"DHI",placement:"left-start",children:u.jsx(V,{variant:"outlined",size:"small","aria-label":"delete",onClick:()=>{_(),n(pu({title:"DHI",content:u.jsx(Ae,{item:e,updateTable:r,getDashboardData:a})}))},children:"DHI"})}),u.jsx(Z,{title:"ایجاد گله",placement:"left-start",children:u.jsx(m,{"aria-label":"delete",color:"primary",onClick:()=>{_(),n(eu({title:"ایجاد گله برای دامدار",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(F6,{updateTable:r,getDashboardData:a,rancherKey:e==null?void 0:e.key})}))},children:u.jsx(N0,{})})}),u.jsx(Z,{title:"ویرایش دامدار",placement:"left-start",children:u.jsx(m,{color:"primary",onClick:()=>{_(),n(eu({right:!0,top:!1,content:u.jsx(o0,{item:e,updateTable:r}),title:"ویرایش دامدار "}))},children:u.jsx(Uu,{})})}),u.jsx(_u,{control:u.jsx(Yu,{size:"small",checked:(e==null?void 0:e.type)==="industrial",onChange:()=>{n(c6({key:e==null?void 0:e.key,type:(e==null?void 0:e.type)==="rural"?"industrial":"rural"})).then(C=>{C.payload.error?i({vertical:"top",horizontal:"center",msg:C.payload.error,severity:"error"}):(r(),i({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},color:"primary"}),label:(e==null?void 0:e.type)==="rural"?"روستایی":"صنعتی",style:{justifyContent:"center",alignItems:"center",display:"flex"}}),u.jsx(Z,{title:"حذف",placement:"left-start",children:u.jsx(m,{"aria-label":"delete",color:"error",onClick:()=>{_(),n(pu({title:"آیا مطمئن هستید؟",content:u.jsxs(d,{container:!0,children:[u.jsx(V,{color:"error",variant:"contained",onClick:()=>{n(xe(e==null?void 0:e.key)).then(C=>{C.payload.error?i({vertical:"top",horizontal:"center",msg:C.payload.error,severity:"error"}):(r(),n(vu()),i({vertical:"top",horizontal:"center",msg:C.payload.data.result,severity:"success"}))})},children:"تایید"}),u.jsx(V,{onClick:()=>{n(vu())},children:"لغو"})]})}))},children:u.jsx(y6,{})})})]})})})]})},ye=()=>{var K,L,U,$,M,J,Y,W,h,b;const e=X(),r=R=>{_(R.target.value)},a=Nu(R=>R.userSlice.userProfile.key),[n,x]=o.useState([]),[t,s]=o.useState(0),[v,i]=o.useState(10),[f,_]=o.useState(""),[C,N]=o.useState(1),[E,l]=o.useState([]),[c,g]=o.useState([]),q=async R=>{let A;e(z()),A=await D.get(`/LiveStock/rancher/rancher-view/?search=filter&value=${f}&role=${O()}&page=${R}&page_size=${v}`),e(P()),x(A.data.results),s(A.data.count)},I=R=>{q(R),N(R)},T=R=>{i(R),N(1)},F=()=>{q(C!==0?C:1)},p=()=>{e(J6({search:f})).then(R=>{g(R.payload.data)})};o.useEffect(()=>{p()},[]),o.useEffect(()=>{const R=n==null?void 0:n.map((A,j)=>{var y;return[C===1?j+1:j+v*(C-1)+1,(A==null?void 0:A.type)==="rural"?"روستایی":"صنعتی",A==null?void 0:A.name,A==null?void 0:A.herdCode,A==null?void 0:A.epidemiologicalCode,A==null?void 0:A.postalCode,A==null?void 0:A.unitId,A==null?void 0:A.herdName,A==null?void 0:A.nationalId,A==null?void 0:A.mobile,(A==null?void 0:A.contractorCode)||"-",A==null?void 0:A.city,(A==null?void 0:A.registeringUser)||"-",(A==null?void 0:A.type)==="rural"?"-":(y=A==null?void 0:A.dhiAmount)==null?void 0:y.toLocaleString(),u.jsx(ve,{item:A,updateTable:F,getDashboardData:p},j)]});l(R)},[n]),o.useEffect(()=>{q(1)},[e,v]);const B=async R=>{R.preventDefault(),e(z());try{const A=await D.get(`/LiveStock/rancher/rancher-view/?search=filter&value=${f}&role=${O()}&page=${C}&page_size=${v}`);x(A.data.results),s(A.data.count),e(J6({search:f})).then(j=>{g(j.payload.data)}),e(P())}catch(A){console.error("Error fetching data:",A)}};return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(d,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(V,{variant:"contained",color:"primary",onClick:()=>{e(eu({right:!0,top:!1,content:u.jsx(o0,{updateTable:F}),title:"ایجاد دامدار"}))},children:"ایجاد دامدار"}),u.jsx(d,{children:u.jsxs("form",{onSubmit:B,children:[u.jsx(w,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:r}),u.jsx(V,{type:"submit",onClick:B,endIcon:u.jsx(yu,{}),children:"جستجو"})]})}),u.jsx(Z,{title:"خروجی اکسل",children:u.jsx("a",{href:`${D.defaults.baseURL}live-stock-ranchers-excel/?role=${O()}&key=${a}`,rel:"noreferrer",children:u.jsx(V,{color:"success",children:u.jsx(fu,{size:32})})})})]}),u.jsx(d,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(ou,{noPagination:!0,isDashboard:!0,columns:["تعداد دامداران","تعداد گوسفندان","تعداد بزها ","تعداد گاوها","تعداد اسب ها ","تعداد شترها","تعداد دام سبک","تعداد دام سنگین","تعداد دام DHI","مجموع دام ها"],data:[[(K=c==null?void 0:c.rancherCount)==null?void 0:K.toLocaleString(),(L=c==null?void 0:c.sheep)==null?void 0:L.toLocaleString(),(U=c==null?void 0:c.goat)==null?void 0:U.toLocaleString(),($=c==null?void 0:c.cow)==null?void 0:$.toLocaleString(),(M=c==null?void 0:c.horse)==null?void 0:M.toLocaleString(),(J=c==null?void 0:c.camel)==null?void 0:J.toLocaleString(),(Y=c==null?void 0:c.lightLivestock)==null?void 0:Y.toLocaleString(),(W=c==null?void 0:c.heavyLivestock)==null?void 0:W.toLocaleString(),(h=c==null?void 0:c.dhiAmount)==null?void 0:h.toLocaleString(),(b=c==null?void 0:c.liveStocksCount)==null?void 0:b.toLocaleString()]],title:"خلاصه اطلاعات"})}),u.jsx(ou,{data:E,columns:["ردیف","مجوز فعالیت","نام دامداری","کد گله","کد اپیدمیولوژیک","کد پستی","شناسه یکتا","نام گله","کد ملی دامدار","موبایل","کد پیمانکار","شهرستان","کاربر ثبت کننده","تعداد دام DHI","جزئیات"],handlePageChange:I,totalRows:t,page:C,perPage:v,handlePerRowsChange:T,title:" دامداران "})]})},je=()=>u.jsx("div",{children:"این بخش در دست توسعه است"}),fe=({product:e})=>{const{pathname:r}=G6(),a=(e==null?void 0:e.key)==="bran"?"rgba(224, 224, 224, 0.5)":(e==null?void 0:e.key)==="barley"?"rgba(245, 194, 149, 0.5)":(e==null?void 0:e.key)==="soy"?"rgba(164, 239, 204, 0.5)":(e==null?void 0:e.key)==="corn"?"rgba(193, 239, 164, 0.5)":"rgba(132, 243, 233, 0.5)";return u.jsx(d,{container:!0,gap:lu.SMALL,p:lu.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",style:{placeContent:"baseline"},children:u.jsx(d,{container:!0,direction:"column",style:{width:"100%"},children:u.jsxs(d,{container:!0,gap:lu.SMALL,justifyContent:"center",children:[u.jsx(Zu,{active:h6,to:r===mu?h6:r===d6?Z6:X6,children:u.jsx(Xu,{style:{backgroundColor:a},icon:u.jsx(z0,{size:30,color:"#244CCC"}),title:`انبار و تخصیص ${e==null?void 0:e.label}`,description:`انبار و تخصیص ${e==null?void 0:e.label}`})}),(O()==="LiveStockProvinceJahad"||O()==="Union")&&u.jsx(Zu,{active:g6,to:r===mu?g6:r===d6?Q6:m6,children:u.jsx(Xu,{style:{backgroundColor:a},icon:u.jsx(W0,{size:30,color:"#244CCC"}),title:`مدیریت توزیع ${e==null?void 0:e.label}`,description:`مدیریت توزیع ${e==null?void 0:e.label}`})}),(O()==="LiveStockProvinceJahad"||O()==="Union")&&u.jsx(Zu,{active:r===mu?p6:A6,to:O()==="LiveStockProvinceJahad"?p6:A6,children:u.jsx(Xu,{style:{backgroundColor:a},icon:u.jsx(U0,{size:30,color:"#244CCC"}),title:`گزارش فروش ${e==null?void 0:e.label}`,description:`گزارش فروش ${e==null?void 0:e.label}`})}),O()==="LiveStockProvinceJahad"&&u.jsx(Zu,{active:x6,to:x6,children:u.jsx(Xu,{style:{backgroundColor:a},icon:u.jsx(J0,{size:30,color:"#244CCC"}),title:`سهم بندی ${e==null?void 0:e.label}`,description:`سهم بندی ${e==null?void 0:e.label}`})})]})})})},_e=Q("PROVINCE_JAHAD_GET_DISTRIBUTION_INFO",async(e,{dispatch:r})=>{r(z());const{data:a,status:n}=await D.get("LiveStock/jahad/dashboard-live-stock-allocation/",{params:e});return r(P()),{data:a,status:n}}),Fe=Q("PROVINCE_JAHAD_GET_INVENTORY_INFO",async(e,{dispatch:r})=>{r(z());const{data:a,status:n}=await D.get("LiveStock/jahad/live-stock-role-products/",{params:e});return r(P()),{data:a,status:n}}),Se=Q("SLAUGHTER_GET_GUILDS_FOR_ALLOCATE_SERVICE",async(e,{dispatch:r})=>{r(z());const{data:a,status:n}=await D.get("LiveStock/jahad/get_user_live_stock/",{params:e});return r(P()),{data:a,status:n}}),Ee=Q("PROVINCE_JAHAD_SUBMIT_ALLOCATION_SERVICE",async(e,{dispatch:r})=>{r(z());try{const{data:a,status:n}=await D.post("LiveStock/jahad/live-stock-allocation/",e);return r(P()),{data:a,status:n}}catch(a){return r(P()),{error:a.response.data.result}}}),be=Q("PROVINCE_JAHAD_EDIT_ALLOCATION_SERVICE",async(e,{dispatch:r})=>{r(z());try{const{data:a,status:n}=await D.put("/LiveStock/jahad/live-stock-allocation/0/",e);return r(P()),{data:a,status:n}}catch(a){return r(P()),{error:a.response.data.result}}}),ke=Q("PROVINCE_JAHAD_DELETE_ALLOCATION",async(e,{dispatch:r})=>{r(z());try{const{data:a,status:n}=await D.delete("LiveStock/jahad/live-stock-allocation/0/?allocation_key="+e);return r(P()),{data:a,status:n}}catch(a){return r(P()),{error:a.response.data.result}}}),n6=({type:e,productKey:r,updateTable:a,getDashboardData:n,item:x,maxAllow:t})=>{const s=$u({allocationType:G().required("لطفا یک گزینه را انتخاب کنید"),weight:gu().required("این فیلد اجباریست!").positive("عدد مثبت وارد کنید!"),place:G().required("این فیلد اجباریست!"),description:G()}),[v,i]=o.useState([]),f=X(),[_]=o.useContext(nu),C=Bu({initialValues:{allocationType:e==="charge"?"LiveStockProvinceJahad":"Cooperative",buyer_key:null,weight:(x==null?void 0:x.weight)||"",place:(x==null?void 0:x.place)||"",description:(x==null?void 0:x.description)||""},validationSchema:s,onSubmit:E=>{if(x){let l={allocation_key:x==null?void 0:x.key,weight:E.weight,place:E.place,description:E.description};l=Object.fromEntries(Object.entries(l).filter(([c,g])=>g!==null)),f(be(l)).then(c=>{c.payload.error?_({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(_({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),f(vu()),a(),n())})}else{let l={allocator:O(),receiver:O()==="Cooperative"?"Cooperative":E.allocationType,product_key:r,buyer_key:E.buyer_key,weight:E.weight,place:E.place,description:E.description};if(l=Object.fromEntries(Object.entries(l).filter(([c,g])=>g!==null)),t&&E.weight>t){_({vertical:"top",horizontal:"center",msg:"مقدار وارد شده از سهیه دریافتی بیشتر است!",severity:"error"});return}f(Ee(l)).then(c=>{c.payload.error?_({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(_({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),f(vu()),a(),n())})}}});o.useEffect(()=>{e!=="charge"&&!x&&(C.setFieldValue("buyer_key",null),f(Se({type:C.values.allocationType})).then(E=>{i(E.payload.data)}))},[C.values.allocationType]),o.useEffect(()=>{C.validateForm()},[]);const N=()=>e==="charge"?C.isValid:x?C.values.weight&&C.values.place&&C.values.description:C.isValid&&C.values.buyer_key;return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[e!=="charge"&&!x&&O()==="LiveStockProvinceJahad"&&u.jsx(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsxs(qu,{component:"fieldset",children:[u.jsxs(q6,{row:!0,name:"allocationType",value:C.values.allocationType,onChange:C.handleChange,children:[u.jsx(_u,{value:"Cooperative",control:u.jsx(u6,{}),label:"تخصیص به تعاونی"}),u.jsx(_u,{value:"Union",control:u.jsx(u6,{}),label:"تخصیص به اتحادیه"})]}),C.touched.allocationType&&C.errors.allocationType&&u.jsx(tu,{color:"error",children:C.errors.allocationType})]})}),u.jsx(d,{item:!0,xs:12,children:u.jsx(Mu,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"weight",label:"وزن",variant:"outlined",InputLabelProps:{shrink:!0},value:C.values.weight,error:C.touched.weight?!!C.errors.weight:null,onChange:C.handleChange,onBlur:C.handleBlur,helperText:C.touched.weight&&C.errors.weight?C.errors.weight:null})}),e!=="charge"&&!x&&u.jsx(d,{xs:12,container:!0,children:u.jsx(Du,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"hatching",options:v?v.map(E=>({data:E,label:`${E==null?void 0:E.name}`})):[],onChange:(E,l)=>{var c;C.setFieldValue("buyer_key",(c=l==null?void 0:l.data)==null?void 0:c.key)},renderInput:E=>u.jsx(w,{fullWidth:!0,...E,label:"انتخاب تخصیص گیرنده"})})}),u.jsx(w,{id:"place",label:e==="charge"?"مبدا":"مکان دریافت ",variant:"outlined",sx:{width:"100%",height:"100%"},value:C.values.place,onChange:C.handleChange,onBlur:C.handleBlur,error:C.touched.place?!!C.errors.place:null,helperText:C.touched.place&&C.errors.place?C.errors.place:null}),u.jsx(w,{id:"description",label:"توضیحات",variant:"outlined",sx:{width:"100%",height:"100%"},value:C.values.description,onChange:C.handleChange,onBlur:C.handleBlur,error:C.touched.description?!!C.errors.description:null,helperText:C.touched.description&&C.errors.description?C.errors.description:null}),u.jsx(V,{disabled:!N(),type:"submit",variant:"contained",color:"primary",fullWidth:!0,onClick:C.handleSubmit,children:x?"ویرایش":"ثبت"})]})},l0=({item:e,updateTable:r,getDashboardData:a})=>{const[n,x]=o.useState(null),t=X(),s=C=>{x(C.currentTarget)},[v]=o.useContext(nu),i=()=>{x(null)},f=!!n,_=f?"popover":void 0;return u.jsxs(d,{container:!0,children:[u.jsx(m,{"aria-describedby":_,variant:"contained",color:"primary",onClick:s,children:u.jsx(Wu,{})}),u.jsx(zu,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:_,open:f,anchorEl:n,onClose:i,children:u.jsxs("div",{style:{padding:"20px",display:"flex",flexDirection:"column"},children:[u.jsx(Z,{title:"ویرایش",placement:"left-start",children:u.jsx(m,{"aria-label":"delete",color:"primary",onClick:()=>{i(),t(pu({title:"ویرایش",content:u.jsx(n6,{updateTable:r,getDashboardData:a,item:e})}))},children:u.jsx(Uu,{})})}),u.jsx(Z,{title:"حذف ",placement:"left-start",children:u.jsx(m,{"aria-label":"delete",color:"error",onClick:()=>{t(pu({title:"حذف تخصیص",content:u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsx(tu,{variant:"body2",color:"red",children:"آیا از حذف تخصیص اطمینان دارید؟"}),u.jsxs(d,{container:!0,xs:12,mt:2,justifyContent:"center",alignItems:"center",spacing:2,children:[u.jsx(d,{item:!0,xs:6,children:u.jsx(V,{onClick:()=>{t(ke(e==null?void 0:e.key)).then(C=>{C.payload.error?v({vertical:"top",horizontal:"center",msg:C.payload.error,severity:"error"}):(v({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),r(),a(),t(vu()))})},variant:"contained",color:"error",fullWidth:!0,children:"تایید"})}),u.jsx(d,{item:!0,xs:6,children:u.jsx(V,{variant:"contained",color:"primary",fullWidth:!0,children:"رد"})})]})]})}))},children:u.jsx(y6,{})})})]})})]})},Ie=({inventoryData:e,getDashboardData:r,maxAllow:a,product:n})=>{const[,,x,t,s,v]=o.useContext(nu),i=Nu(h=>h.userSlice.userProfile.key),f=X();o.useEffect(()=>{const h=su(new Date).format("YYYY-MM-DD");t(h),v(h)},[]);const[_,C]=o.useState(""),[N,E]=o.useState(!1),l=h=>{C(h.target.value)},[c,g]=o.useState([]),[q,I]=o.useState(0),[T,F]=o.useState(10),[p,B]=o.useState(1),[K,L]=o.useState([]),U=async h=>{let b;f(z()),b=await D.get(`LiveStock/jahad/live-stock-allocation/?search=filter&value=${_}&role=${O()}${N?`&date1=${x}&date2=${s}`:""}&page=${h}&page_size=${T}&name=${n==null?void 0:n.key}`),f(P()),g(b.data.results),I(b.data.count)},$=h=>{U(h),B(h)},M=h=>{F(h),B(1)};o.useEffect(()=>{const h=c==null?void 0:c.map((b,R)=>{var ru,cu,iu,Cu,Au,xu,H,S,du;const A=(b==null?void 0:b.allocateFrom)==="LiveStockProvinceJahad"?(ru=b==null?void 0:b.jahad)==null?void 0:ru.name:(cu=b==null?void 0:b.union)==null?void 0:cu.name,j=U6(b==null?void 0:b.allocateFrom),y=(b==null?void 0:b.allocateTo)==="Union"?(iu=b==null?void 0:b.union)==null?void 0:iu.name:(Cu=b==null?void 0:b.cooperative)==null?void 0:Cu.name,k=U6(b==null?void 0:b.allocateTo);return[p===1?R+1:R+T*(p-1)+1,(Au=b==null?void 0:b.weight)==null?void 0:Au.toLocaleString(),`${j} (${A})`,`${k} (${y})`,(b==null?void 0:b.allocateFrom)==="LiveStockProvinceJahad"?(H=(xu=b==null?void 0:b.jahad)==null?void 0:xu.user)==null?void 0:H.fullname:(du=(S=b==null?void 0:b.union)==null?void 0:S.user)==null?void 0:du.fullname,t6(b==null?void 0:b.date),b==null?void 0:b.place,b==null?void 0:b.description,u.jsx(l0,{updateTable:Y,item:b,getDashboardData:r},R)]});L(h)},[c]),o.useEffect(()=>{U(1)},[f,x,s,T,N]);const J=async h=>{h.preventDefault(),f(z());try{const b=await D.get(`LiveStock/jahad/live-stock-allocation/?role=${O()}&search=filter&value=${_}${N?`&date1=${x}&date2=${s}`:""}&page=1&page_size=${T}&name=${n==null?void 0:n.key}`);g(b.data.results),I(b.data.count),f(P())}catch(b){console.error("Error fetching data:",b)}},Y=()=>{U(p!==0?p:1)},W=()=>O()==="LiveStockProvinceJahad"||O()==="Union"?["ردیف","وزن (کیلوگرم)","مبدا","مقصد","ثبت کننده","تاریخ ثبت","مکان دریافت","توضیحات","عملیات"]:["ردیف","وزن (کیلوگرم)","مبدا","مقصد","ثبت کننده","تاریخ ثبت","مکان دریافت","توضیحات"];return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(d,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[(O()==="LiveStockProvinceJahad"||O()==="Union")&&u.jsxs(V,{variant:"contained",onClick:()=>{f(pu({title:`تخصیص ${n==null?void 0:n.label}`,content:u.jsx(n6,{updateTable:Y,type:"allocate",productKey:e==null?void 0:e.key,getDashboardData:r})}))},children:["تخصیص ",n==null?void 0:n.label]}),u.jsxs(d,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(Gu,{icon:u.jsx(l6,{}),checkedIcon:u.jsx(s6,{}),checked:N,onChange:()=>E(!N),color:"primary",size:"large"}),u.jsx(d,{children:u.jsx(Fu,{disabled:!N,label:"از تاریخ",id:"date",renderInput:h=>u.jsx(w,{size:"small",style:{width:"160px"},...h}),value:x,onChange:h=>{t(su(h).format("YYYY-MM-DD"))}})}),u.jsx(d,{children:u.jsx(Fu,{disabled:!N,label:"تا تاریخ",id:"date",renderInput:h=>u.jsx(w,{size:"small",style:{width:"160px"},...h}),value:s,onChange:h=>{v(su(h).format("YYYY-MM-DD"))}})})]}),u.jsx(d,{children:u.jsxs("form",{onSubmit:J,children:[u.jsx(w,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:l}),u.jsx(V,{type:"submit",onClick:J,endIcon:u.jsx(yu,{}),children:"جستجو"})]})}),u.jsx(Z,{title:"خروجی اکسل",placement:"left-start",children:u.jsx("a",{href:`${D.defaults.baseURL}LiveStock/jahad/allocation_live_stock_excel/?search=filter&value=${_}&role=${O()}&key=${i}&name=${n==null?void 0:n.key}`,rel:"noreferrer",children:u.jsxs(V,{color:"success",children:[u.jsx(fu,{size:32})," "]})})})]}),u.jsx(ou,{ignoreTextsLength:!0,data:K,columns:W(),handlePageChange:$,totalRows:q,page:p,perPage:T,handlePerRowsChange:M,title:`تخصیصات ${n==null?void 0:n.label}`})]})},Pe=({inventoryData:e,getDashboardData:r,product:a,maxAllow:n})=>{var b;const[,,x,t,s,v]=o.useContext(nu),i=Nu(R=>R.userSlice.userProfile.key),f=X();o.useEffect(()=>{const R=su(new Date).format("YYYY-MM-DD");t(R),v(R)},[]);const[_,C]=o.useState(""),[N,E]=o.useState(!1),l=R=>{C(R.target.value)},[c,g]=o.useState([]),[q,I]=o.useState(0),[T,F]=o.useState(10),[p,B]=o.useState(1),[K,L]=o.useState([]),U=async R=>{let A;f(z()),A=await D.get(`/LiveStock/jahad/live-stock-warehouse-charge-allocation/?search=filter&value=${_}&role=${O()}${N?`&date1=${x}&date2=${s}`:""}&page=${R}&page_size=${T}&name=${a==null?void 0:a.key}`),f(P()),g(A.data.results),I(A.data.count)},$=R=>{U(R),B(R)},M=R=>{F(R),B(1)},J=R=>{var A,j,y,k;return O()==="Cooperative"?{key:[],value:[]}:{key:"ثبت کننده",value:[((j=(A=R==null?void 0:R.jahad)==null?void 0:A.user)==null?void 0:j.fullname)||((k=(y=R==null?void 0:R.union)==null?void 0:y.user)==null?void 0:k.fullname)]}};o.useEffect(()=>{const R=c==null?void 0:c.map((A,j)=>{var y,k;return[p===1?j+1:j+T*(p-1)+1,(y=A==null?void 0:A.weight)==null?void 0:y.toLocaleString(),(k=J(A))==null?void 0:k.value,t6(A==null?void 0:A.date),A==null?void 0:A.place,A==null?void 0:A.description,u.jsx(l0,{updateTable:W,item:A,getDashboardData:r},j)]});L(R)},[c]),o.useEffect(()=>{U(1)},[f,x,s,T,N]);const Y=async R=>{R.preventDefault(),f(z());try{const A=await D.get(`LiveStock/jahad/live-stock-warehouse-charge-allocation/?role=${O()}&search=filter&value=${_}${N?`&date1=${x}&date2=${s}`:""}&page=1&page_size=${T}&name=${a==null?void 0:a.key}`);g(A.data.results),I(A.data.count),f(P())}catch(A){console.error("Error fetching data:",A)}},W=()=>{U(p!==0?p:1)},h=["ردیف","وزن (کیلوگرم)",(b=J())==null?void 0:b.key,"تاریخ ثبت","مبدا","توضیحات","عملیات"];return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(d,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[O()==="LiveStockProvinceJahad"&&u.jsxs(V,{variant:"contained",onClick:()=>{f(pu({title:`شارژ انبار ${a==null?void 0:a.label}`,content:u.jsx(n6,{updateTable:W,type:"charge",productKey:e==null?void 0:e.key,getDashboardData:r})}))},children:["شارژ انبار ",a==null?void 0:a.label]}),O()==="Cooperative"&&u.jsxs(V,{variant:"contained",onClick:()=>{f(pu({title:`ورود ${a==null?void 0:a.label} به انبار`,content:u.jsx(n6,{updateTable:W,type:"charge",productKey:e==null?void 0:e.key,getDashboardData:r,maxAllow:n})}))},children:["ورود ",a==null?void 0:a.label," به انبار"]}),u.jsxs(d,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(Gu,{icon:u.jsx(l6,{}),checkedIcon:u.jsx(s6,{}),checked:N,onChange:()=>E(!N),color:"primary",size:"large"}),u.jsx(d,{children:u.jsx(Fu,{disabled:!N,label:"از تاریخ",id:"date",renderInput:R=>u.jsx(w,{size:"small",style:{width:"160px"},...R}),value:x,onChange:R=>{t(su(R).format("YYYY-MM-DD"))}})}),u.jsx(d,{children:u.jsx(Fu,{disabled:!N,label:"تا تاریخ",id:"date",renderInput:R=>u.jsx(w,{size:"small",style:{width:"160px"},...R}),value:s,onChange:R=>{v(su(R).format("YYYY-MM-DD"))}})})]}),u.jsx(d,{children:u.jsxs("form",{onSubmit:Y,children:[u.jsx(w,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:l}),u.jsx(V,{type:"submit",onClick:Y,endIcon:u.jsx(yu,{}),children:"جستجو"})]})}),u.jsx(Z,{title:"خروجی اکسل",children:u.jsx("a",{href:`${D.defaults.baseURL}LiveStock/jahad/warehouse_live_stock_excel/?search=filter&value=${_}&role=${O()}&key=${i}&name=${a==null?void 0:a.key}`,rel:"noreferrer",children:u.jsx(V,{color:"success",children:u.jsx(fu,{size:32})})})})]}),u.jsx(ou,{data:K,columns:O()==="LiveStockProvinceJahad"||O()==="Cooperative"?[...h]:h.slice(0,-1),handlePageChange:$,totalRows:q,page:p,perPage:T,handlePerRowsChange:M,title:`شارژ انبار ${a==null?void 0:a.label}`})]})},we=({product:e})=>{var _,C,N,E,l,c,g,q,I,T,F,p,B,K,L,U,$;const[r,a]=o.useState([]),[n,x]=o.useState([]),t=X(),s=()=>{t(_e({name:e==null?void 0:e.key,search:"filter",role:O()})).then(M=>{a(M.payload.data)}),t(Fe({name:e==null?void 0:e.key,search:"filter",role:O()})).then(M=>{x(M.payload.data)})};o.useEffect(()=>{s()},[t]);const[v,i]=o.useState(0),f=(M,J)=>{i(J)};return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(d,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(ou,{noPagination:!0,isDashboard:!0,columns:O()==="LiveStockProvinceJahad"?["ورودی به انبار","تخصیص جهاد به اتحادیه","تخصیص جهاد به تعاونی ها","مجموع تخصیصات","مجموع تخصیص اتحادیه به تعاونی","مجموع تخصیص به تعاونی ها","توزیع به دامداران","مجموع توزیع به دامداران","مانده انبار جهاد استان","مانده انبار اتحادیه","مانده انبار تعاونی ها"]:O()==="Union"?["ورودی به انبار","تخصیص به تعاونی ها","مجموع تخصیص و توزیع","مانده انبار"]:["سهمیه دریافتی","مانده سهمیه دریافتی","ورودی به انبار","توزیع به دامداران","مانده انبار"],data:O()==="LiveStockProvinceJahad"?[[(_=r==null?void 0:r.totalWeight)==null?void 0:_.toLocaleString(),(C=r==null?void 0:r.jahadToUnion)==null?void 0:C.toLocaleString(),(N=r==null?void 0:r.jahatToCooperative)==null?void 0:N.toLocaleString(),(E=r==null?void 0:r.allocationCount)==null?void 0:E.toLocaleString(),(l=r==null?void 0:r.unionToCooperative)==null?void 0:l.toLocaleString(),(c=parseInt((r==null?void 0:r.unionToCooperative)+(r==null?void 0:r.jahatToCooperative)))==null?void 0:c.toLocaleString(),0,0,(g=r==null?void 0:r.totalRemainWeightJahad)==null?void 0:g.toLocaleString(),(q=r==null?void 0:r.totalRemainWeightUnion)==null?void 0:q.toLocaleString(),(I=r==null?void 0:r.totalRemainWeightCooperative)==null?void 0:I.toLocaleString()]]:O()==="Union"?[[(T=r==null?void 0:r.jahadToUnion)==null?void 0:T.toLocaleString(),(F=r==null?void 0:r.unionToCooperative)==null?void 0:F.toLocaleString(),(p=parseInt(0+(r==null?void 0:r.unionToCooperative)))==null?void 0:p.toLocaleString(),(B=r==null?void 0:r.totalRemainWeight)==null?void 0:B.toLocaleString()]]:[[(K=r==null?void 0:r.roleProductCooperativeReceiptWeight)==null?void 0:K.toLocaleString(),(L=parseInt((r==null?void 0:r.roleProductCooperativeReceiptWeight)-(r==null?void 0:r.totalWeight)))==null?void 0:L.toLocaleString(),(U=r==null?void 0:r.totalWeight)==null?void 0:U.toLocaleString(),0,($=r==null?void 0:r.totalRemainWeight)==null?void 0:$.toLocaleString()]],title:`اطلاعات انبار و تخصیصات ${e==null?void 0:e.label}`})}),u.jsx(d,{container:!0,justifyContent:"center",alignItems:"center",mb:lu.MEDIUM,mt:lu.SMALL,xs:12,children:u.jsxs(Y6,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:v,onChange:f,children:[u.jsx(e6,{label:"انبار"}),u.jsx(e6,{label:"تخصیصات"})]})}),v===0&&u.jsx(Pe,{inventoryData:n,getDashboardData:s,product:e,maxAllow:r==null?void 0:r.roleProductCooperativeReceiptWeight}),v===1&&u.jsx(Ie,{inventoryData:n,getDashboardData:s,maxAllow:r==null?void 0:r.roleProductCooperativeReceiptWeight,product:e})]})},Te=Q("PROVINCE_JAHAD_GET_PRODUCT_INFO",async(e,{dispatch:r})=>{r(z());const{data:a,status:n}=await D.get("LiveStock/jahad/live-stock-product/",{params:{name:e.product}});return r(P()),{data:a,status:n}}),Le=Q("PROVINCE_JAHAD_UPDATE_PRODUCT_SERVICE",async(e,{dispatch:r})=>{r(z());try{const{data:a,status:n}=await D.put("LiveStock/jahad/live-stock-product/0/",e);return r(P()),{data:a,status:n}}catch(a){return r(P()),{error:a.response.data.result}}}),Re=({item:e,updateTable:r})=>{const a=X(),[n]=o.useContext(nu),x=$u({light_weight:gu().required("این فیلد اجباری است!"),heavy_weight:gu().required("این فیلد اجباری است!"),light_wight_industrial:gu().required("این فیلد اجباری است!"),heavy_wight_industrial:gu().required("این فیلد اجباری است!"),light_wight_dha:gu().required("این فیلد اجباری است!"),heavy_wight_dha:gu().required("این فیلد اجباری است!"),price:gu().required("این فیلد اجباری است!").positive("عدد مثبت وارد کنید!"),unionPrice:gu().required("این فیلد اجباری است!").positive("عدد مثبت وارد کنید!"),cooperativePrice:gu().required("این فیلد اجباری است!").positive("عدد مثبت وارد کنید!"),shippingPrice:gu().required("این فیلد اجباری است!").positive("عدد مثبت وارد کنید!")}),t=Bu({initialValues:{light_weight:e.lightWight||0,heavy_weight:e.heavyWight||0,light_wight_industrial:e.lightWightIndustrial||0,heavy_wight_industrial:e.heavyWightIndustrial||0,light_wight_dha:e.lightWightDha||0,heavy_wight_dha:e.heavyWightDha||0,price:e.price||0,unionPrice:e.unionPrice||0,cooperativePrice:e.cooperativePrice||0,shippingPrice:e.shippingPrice||0},validationSchema:x,onSubmit:s=>{a(Le({key:e==null?void 0:e.key,light_wight:s.light_weight,heavy_wight:s.heavy_weight,light_wight_industrial:s.light_wight_industrial,heavy_wight_industrial:s.heavy_wight_industrial,light_wight_dha:s.light_wight_dha,heavy_wight_dha:s.heavy_wight_dha,price:s.price,union_price:s.unionPrice,cooperative_price:s.cooperativePrice,shipping_price:s.shippingPrice})).then(v=>{v.payload.error?n({vertical:"top",horizontal:"center",msg:v.payload.error,severity:"error"}):(r(),n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),a(eu({right:!1,bottom:!1,content:null})))})}});return o.useEffect(()=>{t.validateForm()},[a]),u.jsxs(d,{container:!0,xs:12,alignItems:"center",justifyContent:"center",gap:1,children:[u.jsx(d,{item:!0,xs:12,children:u.jsx(w,{fullWidth:!0,id:"light_weight",name:"light_weight",label:"سهمیه دام سبک روستایی",value:t.values.light_weight,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.light_weight&&!!t.errors.light_weight,helperText:t.touched.light_weight&&t.errors.light_weight})}),u.jsx(d,{item:!0,xs:12,children:u.jsx(w,{fullWidth:!0,id:"heavy_weight",name:"heavy_weight",label:"سهمیه دام سنگین روستایی",value:t.values.heavy_weight,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.heavy_weight&&!!t.errors.heavy_weight,helperText:t.touched.heavy_weight&&t.errors.heavy_weight})}),u.jsx(d,{item:!0,xs:12,children:u.jsx(w,{fullWidth:!0,id:"light_wight_industrial",name:"light_wight_industrial",label:"سهمیه دام سبک صنعتی",value:t.values.light_wight_industrial,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.light_wight_industrial&&!!t.errors.light_wight_industrial,helperText:t.touched.light_wight_industrial&&t.errors.light_wight_industrial})}),u.jsx(d,{item:!0,xs:12,children:u.jsx(w,{fullWidth:!0,id:"heavy_wight_industrial",name:"heavy_wight_industrial",label:"سهمیه دام سنگین صنعتی",value:t.values.heavy_wight_industrial,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.heavy_wight_industrial&&!!t.errors.heavy_wight_industrial,helperText:t.touched.heavy_wight_industrial&&t.errors.heavy_wight_industrial})}),u.jsx(d,{item:!0,xs:12,children:u.jsx(w,{fullWidth:!0,id:"light_wight_dha",name:"light_wight_dha",label:"سهمیه دام سبک DHA",value:t.values.light_wight_dha,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.light_wight_dha&&!!t.errors.light_wight_dha,helperText:t.touched.light_wight_dha&&t.errors.light_wight_dha})}),u.jsx(d,{item:!0,xs:12,children:u.jsx(w,{fullWidth:!0,id:"heavy_wight_dha",name:"heavy_wight_dha",label:"سهمیه دام سنگین DHA",value:t.values.heavy_wight_dha,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.heavy_wight_dha&&!!t.errors.heavy_wight_dha,helperText:t.touched.heavy_wight_dha&&t.errors.heavy_wight_dha})}),u.jsx(d,{item:!0,xs:12,children:u.jsx(Mu,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"price",label:"قیمت هر کیلو (ریال)",variant:"outlined",value:t.values.price,error:t.touched.price?!!t.errors.price:null,onChange:t.handleChange,onBlur:t.handleBlur,helperText:t.touched.price&&t.errors.price?t.errors.price:null})}),u.jsx(d,{item:!0,xs:12,children:u.jsx(Mu,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"unionPrice",label:"کارمزد اتحادیه (ریال)",variant:"outlined",value:t.values.unionPrice,error:t.touched.unionPrice?!!t.errors.unionPrice:null,onChange:t.handleChange,onBlur:t.handleBlur,helperText:t.touched.unionPrice&&t.errors.unionPrice?t.errors.unionPrice:null})}),u.jsx(d,{item:!0,xs:12,children:u.jsx(Mu,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"cooperativePrice",label:"کارمزد تعاونی (ریال)",variant:"outlined",value:t.values.cooperativePrice,error:t.touched.cooperativePrice?!!t.errors.cooperativePrice:null,onChange:t.handleChange,onBlur:t.handleBlur,helperText:t.touched.cooperativePrice&&t.errors.cooperativePrice?t.errors.cooperativePrice:null})}),u.jsx(d,{item:!0,xs:12,children:u.jsx(Mu,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"shippingPrice",label:"هزینه حمل و نقل (ریال)",variant:"outlined",value:t.values.shippingPrice,error:t.touched.shippingPrice?!!t.errors.shippingPrice:null,onChange:t.handleChange,onBlur:t.handleBlur,helperText:t.touched.shippingPrice&&t.errors.shippingPrice?t.errors.shippingPrice:null})}),u.jsx(d,{item:!0,xs:12,children:u.jsx(V,{type:"submit",variant:"contained",fullWidth:!0,onClick:t.handleSubmit,children:"ثبت"})})]})},$e=({product:e})=>{var L,U,$,M,J,Y,W,h,b,R;const r=X(),a=A=>{l(A.target.value)},[n,x]=o.useState([]),t=()=>{r(Te({product:e==null?void 0:e.key})).then(A=>{x(A.payload.data)})};o.useEffect(()=>{O()==="LiveStockProvinceJahad"&&t()},[]);const[s]=o.useContext(nu),[v,i]=o.useState([]),[f,_]=o.useState(0),[C,N]=o.useState(10),[E,l]=o.useState(""),[c,g]=o.useState(1),[q,I]=o.useState([]),T=async A=>{let j;r(z()),j=await D.get(`/LiveStock/rancher/rancher-view/?search=filter&value=${E}&role=${O()}&page=${A}&page_size=${C}&name=${e==null?void 0:e.key}`),r(P()),i(j.data.results),_(j.data.count)},F=A=>{T(A),g(A)},p=A=>{N(A),g(1)},B=()=>{T(c!==0?c:1)};o.useEffect(()=>{const A=v==null?void 0:v.map((j,y)=>{var k;return[c===1?y+1:y+C*(c-1)+1,j==null?void 0:j.herdCode,j==null?void 0:j.epidemiologicalCode,j==null?void 0:j.postalCode,j==null?void 0:j.unitId,j==null?void 0:j.herdName,j==null?void 0:j.nationalId,(k=j==null?void 0:j.user)==null?void 0:k.fullname.replace(":"," "),j==null?void 0:j.mobile,(j==null?void 0:j.contractorCode)||"-",j==null?void 0:j.city,u.jsx(_u,{control:u.jsx(Yu,{checked:j==null?void 0:j.allowBuy,onChange:()=>{r(c6({key:j==null?void 0:j.key,allow_buy:!(j!=null&&j.allowBuy)})).then(ru=>{ru.payload.error?s({vertical:"top",horizontal:"center",msg:ru.payload.error,severity:"error"}):(B(),s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},color:"primary"}),label:j!=null&&j.allowBuy?"فعال":"غیرفعال",style:{justifyContent:"center",alignItems:"center",display:"flex"}},y)]});I(A)},[v]),o.useEffect(()=>{T(1)},[r,C]);const K=async A=>{A.preventDefault(),r(z());try{const j=await D.get(`/LiveStock/rancher/rancher-view/?search=filter&value=${E}&role=${O()}&page=${c}&page_size=${C}&name=${e==null?void 0:e.key}`);i(j.data.results),_(j.data.count),r(P())}catch(j){console.error("Error fetching data:",j)}};return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[O()==="LiveStockProvinceJahad"&&u.jsx(d,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(ou,{noPagination:!0,isDashboard:!0,columns:["محصول","سهمیه دام سبک روستایی (کیلوگرم)","سهمیه دام سنگین روستایی (کیلوگرم)","سهمیه دام سبک صنعتی (کیلوگرم)","سهمیه دام سنگین صنعتی (کیلوگرم)","سهمیه دام سبک DHI (کیلوگرم)","سهمیه دام سنگین DHI (کیلوگرم)","قیمت سبوس (ریال)","کارمزد اتحادیه","کارمزد تعاونی","هزینه حمل و نقل","قیمت درب کارخانه (ریال)","قیمت درب تعاونی (ریال)","عملیات"],data:[[n==null?void 0:n.name,((L=n==null?void 0:n.lightWight)==null?void 0:L.toLocaleString())||"0",((U=n==null?void 0:n.heavyWight)==null?void 0:U.toLocaleString())||"0",(($=n==null?void 0:n.lightWightIndustrial)==null?void 0:$.toLocaleString())||"0",((M=n==null?void 0:n.heavyWightIndustrial)==null?void 0:M.toLocaleString())||"0",((J=n==null?void 0:n.lightWightDha)==null?void 0:J.toLocaleString())||"0",((Y=n==null?void 0:n.heavyWightDha)==null?void 0:Y.toLocaleString())||"0",((W=n==null?void 0:n.price)==null?void 0:W.toLocaleString())||"0",((h=n==null?void 0:n.unionPrice)==null?void 0:h.toLocaleString())||"0",((b=n==null?void 0:n.cooperativePrice)==null?void 0:b.toLocaleString())||"0",((R=n==null?void 0:n.shippingPrice)==null?void 0:R.toLocaleString())||"0",(((n==null?void 0:n.price)||0)+((n==null?void 0:n.unionPrice)||0)+((n==null?void 0:n.cooperativePrice)||0)).toLocaleString()||"0",(((n==null?void 0:n.price)||0)+((n==null?void 0:n.unionPrice)||0)+((n==null?void 0:n.cooperativePrice)||0)+((n==null?void 0:n.shippingPrice)||0)).toLocaleString()||"0",u.jsx(Z,{title:"ویرایش محصول",placement:"left",children:u.jsx(m,{color:"primary",size:"small",onClick:()=>{r(eu({title:"ویرایش محصول",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Re,{item:n,updateTable:t})}))},children:u.jsx(a6,{})})},`edit-${(n==null?void 0:n.name)||"product"}`)]],title:`محدودیت های توزیع ${e==null?void 0:e.label}`})}),u.jsx(d,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:u.jsx(d,{children:u.jsxs("form",{onSubmit:K,children:[u.jsx(w,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:a}),u.jsx(V,{type:"submit",onClick:K,endIcon:u.jsx(yu,{}),children:"جستجو"})]})})}),u.jsx(ou,{data:q,columns:["ردیف","کد گله","کد اپیدمیولوژیک","کد پستی","شناسه یکتا","نام گله","کد ملی دامدار","نام دامدار","موبایل","کد پیمانکار","شهرستان","عملیات"],handlePageChange:F,totalRows:f,page:c,perPage:C,handlePerRowsChange:p,title:`مجوز دریافت ${e==null?void 0:e.label}`})]})},Be=Q("PROVINCE_JAHAD_SUBMIT_SHARE_SERVICE",async(e,{dispatch:r})=>{r(z());try{const{data:a,status:n}=await D.put("/LiveStock/jahad/cooperative-shares/0/",e);return r(P()),{data:a,status:n}}catch(a){return r(P()),{error:a.response.data.result}}}),Oe=({updateTable:e,item:r})=>{const[a]=o.useContext(nu),n=X(),x=$u().shape({price:G().required("این فیلد الزامی است"),shipping_price:G().required("این فیلد الزامی است"),union_price:G().required("این فیلد الزامی است"),cooperative_price:G().required("این فیلد الزامی است"),company_price:G().required("این فیلد الزامی است")}),t=Bu({initialValues:{price:(r==null?void 0:r.price)||"",shipping_price:(r==null?void 0:r.shippingPrice)||"",union_price:(r==null?void 0:r.unionPrice)||"",company_price:(r==null?void 0:r.companyPrice)||"",cooperative_price:(r==null?void 0:r.cooperativePrice)||""},validationSchema:x,enableReinitialize:!0,onSubmit:s=>{n(Be({share_key:r==null?void 0:r.key,shipping_price:s.shipping_price,union_price:s.union_price,company_price:s.company_price,price:s.price,cooperative_price:s.cooperative_price})).then(v=>{v.payload.error?a({vertical:"top",horizontal:"center",msg:v.payload.error,severity:"error"}):(a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),n(eu({right:!1,bottom:!1,content:null})),e())})}});return u.jsx(au,{container:!0,direction:"column",gap:lu.SMALL,children:u.jsx("form",{onSubmit:t.handleSubmit,children:u.jsxs(au,{container:!0,direction:"column",gap:lu.TINY,children:[u.jsx(w,{name:"price",label:"قیمت پایه ",fullWidth:!0,value:t.values.price,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.price&&!!t.errors.price,helperText:t.touched.price&&t.errors.price}),u.jsx(w,{name:"shipping_price",label:"هزینه حمل و نقل",fullWidth:!0,value:t.values.shipping_price,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.shipping_price&&!!t.errors.shipping_price,helperText:t.touched.shipping_price&&t.errors.shipping_price}),u.jsx(w,{name:"union_price",label:"سهم اتحادیه",fullWidth:!0,value:t.values.union_price,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.union_price&&!!t.errors.union_price,helperText:t.touched.union_price&&t.errors.union_price}),u.jsx(w,{name:"cooperative_price",label:"سهم تعاونی",fullWidth:!0,value:t.values.cooperative_price,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.cooperative_price&&!!t.errors.cooperative_price,helperText:t.touched.cooperative_price&&t.errors.cooperative_price}),u.jsx(w,{name:"company_price",label:"سهم شرکت",fullWidth:!0,value:t.values.company_price,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.company_price&&!!t.errors.company_price,helperText:t.touched.company_price&&t.errors.company_price}),u.jsx(V,{type:"submit",variant:"contained",color:"primary",children:"ثبت اطلاعات"})]})})})},De=({item:e,updateTable:r})=>{const[a,n]=o.useState(null),x=X(),t=f=>{n(f.currentTarget)},s=()=>{n(null)},v=!!a,i=v?"popover":void 0;return u.jsxs(d,{container:!0,children:[u.jsx(m,{"aria-describedby":i,variant:"contained",color:"primary",onClick:t,children:u.jsx(Wu,{})}),u.jsx(zu,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:i,open:v,anchorEl:a,onClose:s,children:u.jsx("div",{style:{padding:"20px",display:"flex",flexDirection:"column"},children:u.jsx(Z,{title:"ویرایش",placement:"left-start",children:u.jsx(m,{"aria-label":"delete",color:"primary",onClick:()=>{s(),x(eu({title:"ویرایش اطلاعات ",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Oe,{item:e,updateTable:r})}))},children:u.jsx(Uu,{})})})})})]})},Ne=({product:e})=>{const r=X(),a=F=>{_(F.target.value)},[n,x]=o.useState([]),[t,s]=o.useState(0),[v,i]=o.useState(10),[f,_]=o.useState(""),[C,N]=o.useState(1),[E,l]=o.useState([]),c=async F=>{let p;r(z()),p=await D.get(`LiveStock/jahad/cooperative-shares/?search=filter&value=${f}&role=${O()}&page=${F}&page_size=${v}&name=${e==null?void 0:e.label}`),r(P()),x(p.data.results),s(p.data.count)},g=F=>{c(F),N(F)},q=F=>{i(F),N(1)},I=()=>{c(C!==0?C:1)};o.useEffect(()=>{const F=n==null?void 0:n.map((p,B)=>{var K,L,U,$,M,J,Y,W;return[C===1?B+1:B+v*(C-1)+1,`${(K=p==null?void 0:p.cooperative)==null?void 0:K.name} (${(U=(L=p==null?void 0:p.cooperative)==null?void 0:L.user)==null?void 0:U.fullname})`,($=p==null?void 0:p.price)==null?void 0:$.toLocaleString(),(M=p==null?void 0:p.unionPrice)==null?void 0:M.toLocaleString(),(J=p==null?void 0:p.cooperativePrice)==null?void 0:J.toLocaleString(),(Y=p==null?void 0:p.companyPrice)==null?void 0:Y.toLocaleString(),(W=p==null?void 0:p.shippingPrice)==null?void 0:W.toLocaleString(),u.jsx(De,{item:p,updateTable:I},B)]});l(F)},[n]),o.useEffect(()=>{c(1)},[r,v]);const T=async F=>{F.preventDefault(),r(z());try{const p=await D.get(`LiveStock/jahad/cooperative-shares/?role=${O()}&search=filter&value=${f}&page=1&page_size=${v}&name=${e==null?void 0:e.label}`);x(p.data.results),s(p.data.count),r(P())}catch(p){console.error("Error fetching data:",p)}};return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(d,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:u.jsx(d,{children:u.jsxs("form",{onSubmit:T,children:[u.jsx(w,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:a}),u.jsx(V,{type:"submit",onClick:T,endIcon:u.jsx(yu,{}),children:"جستجو"})]})})}),u.jsx(ou,{data:E,ignoreTextsLength:!0,columns:["ردیف","تعاونی","قیمت پایه","سهم اتحادیه","سهم تعاونی","سهم شرکت","هزینه حمل و نقل","عملیات"],handlePageChange:g,totalRows:t,page:C,perPage:v,handlePerRowsChange:q,title:`سهم بندی ${e==null?void 0:e.label}`})]})},ze=Q("PROVINCE_JAHAD_GET_TRANSACTION_INFO_DASHBOARD_SERVICE",async(e,{dispatch:r})=>{r(z());const{data:a,status:n}=await D.get("/live-stock-transactions-dashboard",{params:{...e}});return r(P()),{data:a,status:n}}),We=({product:e})=>{var y,k,ru,cu,iu,Cu,Au,xu;const[,,r,a,n,x]=o.useContext(nu),t=Nu(H=>H.userSlice.userProfile.key),[s,v]=o.useState([]),[i,f]=o.useState("all"),[_,C]=o.useState("bran"),N=H=>{f(H.target.value)},E=H=>{C(H.target.value)},l=X();o.useEffect(()=>{const H=su(new Date).format("YYYY-MM-DD");a(H),x(H)},[]);const c=H=>{K(H.target.value)},[g,q]=o.useState([]),[I,T]=o.useState(0),[F,p]=o.useState(10),[B,K]=o.useState(""),[L,U]=o.useState(1),[$,M]=o.useState([]),[J,Y]=o.useState(!1),W=()=>{l(ze({date1:J?r:"",date2:J?n:"",search:"filter",role:O(),value:B,name:_||(e==null?void 0:e.key),state:i})).then(H=>{v(H.payload.data)})},h=async H=>{let S;l(z()),S=await D.get(`live-stock-transactions/?search=filter&value=${B}&role=${O()}${J?`&date1=${r}&date2=${n}`:""}&page=${H}&page_size=${F}&state=${i}&name=${_}`),W(),l(P()),q(S.data.results),T(S.data.count)},b=H=>{h(H),U(H)},R=H=>{p(H),U(1)},A=H=>{if(H)return JSON.parse(H)};o.useEffect(()=>{const H=g==null?void 0:g.map((S,du)=>{var Su,Eu,bu,ku,Iu,Pu,wu,Tu,Lu,uu,Ru,Ju,Vu,Hu,E6,b6,k6,I6,P6,w6,T6,L6,R6,$6,B6,O6,D6;const Ou=(Su=S==null?void 0:S.products)==null?void 0:Su.map((hu,s0)=>{var N6,z6,W6;return[s0+1,hu==null?void 0:hu.name,(N6=hu==null?void 0:hu.curWeight)==null?void 0:N6.toLocaleString(),(z6=hu==null?void 0:hu.price)==null?void 0:z6.toLocaleString(),(W6=hu==null?void 0:hu.curPrice)==null?void 0:W6.toLocaleString()]});return[L===1?du+1:du+F*(L-1)+1,t6(S==null?void 0:S.date),(S==null?void 0:S.fullname)||"-",(S==null?void 0:S.natcode)||"-",(S==null?void 0:S.mobile)||"-",`${(bu=(Eu=S==null?void 0:S.pos)==null?void 0:Eu.cooperative)==null?void 0:bu.name} شهرستان ${(Pu=(Iu=(ku=S==null?void 0:S.pos)==null?void 0:ku.cooperative)==null?void 0:Iu.user)==null?void 0:Pu.cityName} (${(Lu=(Tu=(wu=S==null?void 0:S.pos)==null?void 0:wu.cooperative)==null?void 0:Tu.user)==null?void 0:Lu.fullname})`,(Ju=(Ru=(uu=S==null?void 0:S.pos)==null?void 0:uu.cooperative)==null?void 0:Ru.user)==null?void 0:Ju.mobile,S!=null&&S.paid?"پرداخت شده":`پرداخت نشده (${S==null?void 0:S.result})`,A(S==null?void 0:S.additional).isTaavoni?"تعاونی":"کارخانه",S!=null&&S.products?S==null?void 0:S.products.map(hu=>hu.name).join("-"):"-",((Hu=(Vu=A(S==null?void 0:S.additional))==null?void 0:Vu.ownerNatcode)==null?void 0:Hu.toLocaleString())||0,((b6=(E6=S==null?void 0:S.shares)==null?void 0:E6.curHeavy)==null?void 0:b6.toLocaleString())||0,((I6=(k6=S==null?void 0:S.shares)==null?void 0:k6.curLight)==null?void 0:I6.toLocaleString())||0,((w6=(P6=S==null?void 0:S.shares)==null?void 0:P6.curWeight)==null?void 0:w6.toLocaleString())||0,(T6=S==null?void 0:S.price)==null?void 0:T6.toLocaleString(),((R6=(L6=A(S==null?void 0:S.additional))==null?void 0:L6.cooperative_price)==null?void 0:R6.toLocaleString())||0,((B6=($6=S==null?void 0:S.shares)==null?void 0:$6.totalUnionPrice)==null?void 0:B6.toLocaleString())||0,((D6=(O6=S==null?void 0:S.shares)==null?void 0:O6.totalCompanyPrice)==null?void 0:D6.toLocaleString())||0,u.jsx(Z,{placement:"left",title:"مشاهده",children:u.jsx(m,{size:"small",color:"primary",onClick:()=>{l(pu({title:"جزئیات محصول",content:u.jsx(d,{container:!0,xs:12,justifyContent:"center",children:u.jsx(o6,{columns:["ردیف","محصول","وزن","فی","قیمت کل"],data:Ou})})}))},children:u.jsx(a6,{})},du)},du)]});M(H)},[g]),o.useEffect(()=>{h(1)},[l,r,n,F,i,J,_]);const j=async H=>{H.preventDefault(),l(z());try{const S=await D.get(`live-stock-transactions/?role=${O()}&search=filter&value=${B}${J?`&date1=${r}&date2=${n}`:""}&page=1&page_size=${F}&state=${i}&name=${_}`);q(S.data.results),T(S.data.count),W(),l(P())}catch(S){console.error("Error fetching data:",S)}};return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(d,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(d,{width:"200px",children:u.jsxs(qu,{size:"small",children:[u.jsx(i6,{id:"demo-simple-select-label",children:"انتخاب محصول"}),u.jsxs(C6,{labelId:"demo-simple-select-label",id:"demo-simple-select",value:_,label:"Age",onChange:E,children:[u.jsx(ju,{value:"bran",children:"سبوس"}),u.jsx(ju,{value:"barley",children:"جو"}),u.jsx(ju,{value:"soy",children:"سویا"}),u.jsx(ju,{value:"corn",children:"ذرت"})]})]})}),u.jsx(d,{width:"200px",children:u.jsxs(qu,{size:"small",children:[u.jsx(i6,{id:"demo-simple-select-label",children:"فیلتر تراکنش"}),u.jsxs(C6,{labelId:"demo-simple-select-label",id:"demo-simple-select",value:i,label:"Age",onChange:N,children:[u.jsx(ju,{value:"all",children:"همه"}),u.jsx(ju,{value:"paid",children:"تراکنش های موفق"}),u.jsx(ju,{value:"unpaid",children:"تراکنش های ناموفق"})]})]})}),u.jsxs(d,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(Gu,{icon:u.jsx(l6,{}),checkedIcon:u.jsx(s6,{}),checked:J,onChange:()=>Y(!J),color:"primary",size:"large"}),u.jsx(d,{children:u.jsx(Fu,{disabled:!J,label:"از تاریخ",id:"date",renderInput:H=>u.jsx(w,{size:"small",style:{width:"160px"},...H}),value:r,onChange:H=>{a(su(H).format("YYYY-MM-DD"))}})}),u.jsx(d,{children:u.jsx(Fu,{disabled:!J,label:"تا تاریخ",id:"date",renderInput:H=>u.jsx(w,{size:"small",style:{width:"160px"},...H}),value:n,onChange:H=>{x(su(H).format("YYYY-MM-DD"))}})})]})," ",u.jsx(d,{children:u.jsxs("form",{onSubmit:j,children:[u.jsx(w,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:c}),u.jsx(V,{type:"submit",onClick:j,endIcon:u.jsx(yu,{}),children:"جستجو"})]})}),u.jsx(d,{children:u.jsx(Z,{title:"خروجی اکسل",children:u.jsx("a",{href:`${D.defaults.baseURL}LiveStock/jahad/live_stock_transaction_excel/?search=filter&value=${B}&role=${O()}&key=${t}&name=${_}${J?`&date1=${r}&date2=${n}`:""}`,rel:"noreferrer",children:u.jsx(V,{color:"success",children:u.jsx(fu,{size:32})})})})}),u.jsx(d,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(ou,{noPagination:!0,isDashboard:!0,columns:["کل وزن فروش","تعداد تراکنش ها","مبلغ کل تراکنش ها","مجموع سهم تعاونی ها","مجموع سهم اتحادیه","مجموع سهم شرکت","مجموع دام سنگین","مجموع دام سبک"],data:[[(y=s==null?void 0:s.curWeight)==null?void 0:y.toLocaleString(),(k=s==null?void 0:s.lenTransaction)==null?void 0:k.toLocaleString(),(ru=s==null?void 0:s.price)==null?void 0:ru.toLocaleString(),(cu=s==null?void 0:s.totalCooperativePrice)==null?void 0:cu.toLocaleString(),(iu=s==null?void 0:s.totalUnionPrice)==null?void 0:iu.toLocaleString(),(Cu=s==null?void 0:s.totalCompanyPrice)==null?void 0:Cu.toLocaleString(),(Au=s==null?void 0:s.curHeavy)==null?void 0:Au.toLocaleString(),(xu=s==null?void 0:s.curLight)==null?void 0:xu.toLocaleString()]],title:"خلاصه اطلاعات"})})]}),u.jsx(ou,{ignoreTextsLength:!0,data:$,columns:["ردیف","تاریخ","خریدار","کد ملی خریدار","موبایل خریدار","فروشنده","تلفن فروشنده","وضعیت","محل تحویل","کالا","کد ملی فروشنده","دام سنگین","دام سبک","وزن (کیلوگرم)","مبلغ تراکنش","سهم تعاونی","سهم اتحادیه","سهم شرکت","جزئیات محصولات"],handlePageChange:b,totalRows:I,page:L,perPage:F,handlePerRowsChange:R,title:"تراکنش ها"})]})},Ue=({cooperative_key:e,product:r})=>{const[,,a,n,x,t]=o.useContext(nu),[s,v]=o.useState(!1),[i,f]=o.useState("all"),_=W=>{f(W.target.value)},C=X();o.useEffect(()=>{const W=su(new Date).format("YYYY-MM-DD");n(W),t(W)},[]);const N=W=>{F(W.target.value)},[E,l]=o.useState([]),[c,g]=o.useState(0),[q,I]=o.useState(10),[T,F]=o.useState(""),[p,B]=o.useState(1),[K,L]=o.useState([]),U=async W=>{let h;C(z()),h=await D.get(`live-stock-transactions/?search=filter&value=${T}${s?`&date1=${a}&date2=${x}`:""}&page=${W}&page_size=${q}&cooperative_key=${e}&state=${i}&name=${r==null?void 0:r.key}`),C(P()),l(h.data.results),g(h.data.count)},$=W=>{U(W),B(W)},M=W=>{I(W),B(1)},J=W=>{if(W)return JSON.parse(W)};o.useEffect(()=>{const W=E==null?void 0:E.map((h,b)=>{var A,j,y,k,ru,cu,iu,Cu,Au,xu,H,S,du,Ou,Su,Eu,bu,ku,Iu,Pu,wu,Tu,Lu;const R=(A=h==null?void 0:h.products)==null?void 0:A.map((uu,Ru)=>{var Ju,Vu,Hu;return[Ru+1,uu==null?void 0:uu.name,(Ju=uu==null?void 0:uu.curWeight)==null?void 0:Ju.toLocaleString(),(Vu=uu==null?void 0:uu.price)==null?void 0:Vu.toLocaleString(),(Hu=uu==null?void 0:uu.curPrice)==null?void 0:Hu.toLocaleString()]});return[p===1?b+1:b+q*(p-1)+1,t6(h==null?void 0:h.date),(h==null?void 0:h.fullname)||"-",(h==null?void 0:h.natcode)||"-",(h==null?void 0:h.mobile)||"-",`${(y=(j=h==null?void 0:h.pos)==null?void 0:j.cooperative)==null?void 0:y.name} شهرستان ${(cu=(ru=(k=h==null?void 0:h.pos)==null?void 0:k.cooperative)==null?void 0:ru.user)==null?void 0:cu.cityName} (${(Au=(Cu=(iu=h==null?void 0:h.pos)==null?void 0:iu.cooperative)==null?void 0:Cu.user)==null?void 0:Au.fullname})`,(S=(H=(xu=h==null?void 0:h.pos)==null?void 0:xu.cooperative)==null?void 0:H.user)==null?void 0:S.mobile,h!=null&&h.paid?"پرداخت شده":`پرداخت نشده (${h==null?void 0:h.result})`,J(h==null?void 0:h.additional).isTaavoni?"تعاونی":"کارخانه",h!=null&&h.products?h==null?void 0:h.products.map(uu=>uu.name).join("-"):"-",((Ou=(du=J(h==null?void 0:h.additional))==null?void 0:du.ownerNatcode)==null?void 0:Ou.toLocaleString())||0,((Eu=(Su=J(h==null?void 0:h.additional))==null?void 0:Su.cur_heavy)==null?void 0:Eu.toLocaleString())||0,((ku=(bu=J(h==null?void 0:h.additional))==null?void 0:bu.cur_light)==null?void 0:ku.toLocaleString())||0,h==null?void 0:h.products.reduce((uu,Ru)=>uu+(Ru==null?void 0:Ru.curWeight),0).toLocaleString(),(Iu=h==null?void 0:h.price)==null?void 0:Iu.toLocaleString(),((wu=(Pu=J(h==null?void 0:h.additional))==null?void 0:Pu.cooperative_price)==null?void 0:wu.toLocaleString())||0,((Lu=(Tu=J(h==null?void 0:h.additional))==null?void 0:Tu.union_price)==null?void 0:Lu.toLocaleString())||0,u.jsx(V,{size:"small",variant:"outlined",onClick:()=>{C(pu({title:"جزئیات محصول",content:u.jsx(d,{container:!0,xs:12,justifyContent:"center",children:u.jsx(o6,{columns:["ردیف","محصول","وزن","فی","قیمت کل"],data:R})})}))},children:"مشاهده"},b)]});L(W)},[E]),o.useEffect(()=>{U(1)},[C,a,x,q,s,i]);const Y=async W=>{W.preventDefault(),C(z());try{const h=await D.get(`live-stock-transactions/?search=filter&value=${T}${s?`&date1=${a}&date2=${x}`:""}&page=1&page_size=${q}&cooperative_key=${e}&state=${i}`);l(h.data.results),g(h.data.count),C(P())}catch(h){console.error("Error fetching data:",h)}};return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(d,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(d,{width:"200px",children:u.jsxs(qu,{size:"small",children:[u.jsx(i6,{id:"demo-simple-select-label",children:"فیلتر تراکنش"}),u.jsxs(C6,{labelId:"demo-simple-select-label",id:"demo-simple-select",value:i,label:"Age",onChange:_,children:[u.jsx(ju,{value:"all",children:"همه"}),u.jsx(ju,{value:"paid",children:"تراکنش های موفق"}),u.jsx(ju,{value:"unpaid",children:"تراکنش های ناموفق"})]})]})}),u.jsxs(d,{container:!0,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},children:[u.jsx(d,{children:u.jsx(_u,{control:u.jsx(Gu,{checked:s,onChange:()=>v(!s),color:"primary"})})}),u.jsx(d,{children:u.jsx(Fu,{disabled:!s,label:"از تاریخ",id:"date",renderInput:W=>u.jsx(w,{size:"small",style:{width:"160px"},...W}),value:a,onChange:W=>{n(su(W).format("YYYY-MM-DD"))}})}),u.jsx(d,{children:u.jsx(Fu,{disabled:!s,label:"تا تاریخ",id:"date",renderInput:W=>u.jsx(w,{size:"small",style:{width:"160px"},...W}),value:x,onChange:W=>{t(su(W).format("YYYY-MM-DD"))}})})]}),u.jsx(d,{children:u.jsxs("form",{onSubmit:Y,children:[u.jsx(w,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:N}),u.jsx(V,{type:"submit",onClick:Y,endIcon:u.jsx(yu,{}),children:"جستجو"})]})}),u.jsx(Z,{title:"خروجی اکسل",children:u.jsx("a",{href:`${D.defaults.baseURL}`,rel:"noreferrer",children:u.jsx(V,{color:"success",children:u.jsx(fu,{size:32})})})})]}),u.jsx(ou,{ignoreTextsLength:!0,data:K,columns:["ردیف","تاریخ","خریدار","کد ملی خریدار","موبایل خریدار","فروشنده","تلفن فروشنده","وضعیت","محل تحویل","کالا","کد ملی فروشنده","دام سنگین","دام سبک","وزن (کیلوگرم)","مبلغ تراکنش","سهم تعاونی","سهم اتحادیه","جزئیات محصولات"],handlePageChange:$,totalRows:c,page:p,perPage:q,handlePerRowsChange:M,title:`تراکنش های ${r==null?void 0:r.label}`})]})},Je=Q("PROVINCE_JAHAD_GET_SELL_REPORT_INFO_DASHBOARD_SERVICE",async(e,{dispatch:r})=>{r(z());const{data:a,status:n}=await D.get("/cooperative-warehouse-dashboard",{params:{...e}});return r(P()),{data:a,status:n}}),Ve=({product:e})=>{var Y,W,h,b,R,A,j;const[,,r,a,n,x]=o.useContext(nu),[t,s]=o.useState(!1),v=Nu(y=>y.userSlice.userProfile.key),i=X();o.useEffect(()=>{const y=su(new Date).format("YYYY-MM-DD");a(y),x(y)},[]);const f=y=>{q(y.target.value)},[_,C]=o.useState([]),[N,E]=o.useState(0),[l,c]=o.useState(10),[g,q]=o.useState(""),[I,T]=o.useState(1),[F,p]=o.useState([]),[B,K]=o.useState([]),L=()=>{i(Je({date1:r,date2:n,search:"filter",role:O(),value:g,name:e==null?void 0:e.key})).then(y=>{K(y.payload.data)})},U=async y=>{let k;i(z()),k=await D.get(`cooperative-warehouse/?search=filter&value=${g}&role=${O()}${t?`&date1=${r}&date2=${n}`:""}&page=${y}&page_size=${l}&name=${e==null?void 0:e.key}`),i(P()),L(),C(k.data.results),E(k.data.count)},$=y=>{U(y),T(y)},M=y=>{c(y),T(1)};o.useEffect(()=>{const y=_==null?void 0:_.map((k,ru)=>{var cu,iu,Cu,Au,xu,H,S,du,Ou,Su,Eu,bu,ku,Iu,Pu,wu,Tu,Lu,uu;return[I===1?ru+1:ru+l*(I-1)+1,e==null?void 0:e.label,k==null?void 0:k.name,(cu=k==null?void 0:k.user)==null?void 0:cu.fullname,(iu=k==null?void 0:k.user)==null?void 0:iu.provinceName,(Cu=k==null?void 0:k.user)==null?void 0:Cu.cityName,(Au=k==null?void 0:k.user)==null?void 0:Au.mobile,(xu=k==null?void 0:k.user)==null?void 0:xu.nationalId,((S=(H=k==null?void 0:k.info)==null?void 0:H.totalReceiptWeight)==null?void 0:S.toLocaleString())||0,((Ou=(du=k==null?void 0:k.info)==null?void 0:du.totalWeight)==null?void 0:Ou.toLocaleString())||0,((Eu=(Su=k==null?void 0:k.info)==null?void 0:Su.totalAllocatedWeight)==null?void 0:Eu.toLocaleString())||0,((ku=(bu=k==null?void 0:k.info)==null?void 0:bu.totalRemainWeight)==null?void 0:ku.toLocaleString())||0,((Pu=(Iu=k==null?void 0:k.info)==null?void 0:Iu.transactions)==null?void 0:Pu.toLocaleString())||0,((Tu=(wu=k==null?void 0:k.info)==null?void 0:wu.totalTransactionsPrice)==null?void 0:Tu.toLocaleString())||0,((uu=(Lu=k==null?void 0:k.info)==null?void 0:Lu.totalTransactionsWeight)==null?void 0:uu.toLocaleString())||0,u.jsxs(d,{container:!0,gap:1,alignItems:"center",direction:"column",children:[u.jsx(Z,{title:"جزئیات",placement:"left",children:u.jsx(m,{color:"primary",onClick:()=>{i(eu({top:!0,title:"تراکنش ها",content:u.jsx(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsx(d,{container:!0,xs:10,justifyContent:"center",alignItems:"center",children:u.jsx(Ue,{cooperative_key:k==null?void 0:k.key,product:e})})})}))},children:u.jsx(a6,{})},ru)}),u.jsx(Z,{title:"خروجی اکسل",children:u.jsx("a",{href:`${D.defaults.baseURL}LiveStock/jahad/live_stock_transaction_excel/?search=filter&value=${g}&key=${v}&cooperative_key=${k==null?void 0:k.key}&name=${e==null?void 0:e.key}`,rel:"noreferrer",target:"_blank",children:u.jsx(V,{color:"success",children:u.jsx(fu,{size:24})})})})]},ru)]});p(y)},[_]),o.useEffect(()=>{U(1)},[i,r,n,l,t]);const J=async y=>{y.preventDefault(),i(z());try{const k=await D.get(`cooperative-warehouse/?role=${O()}&search=filter&value=${g}${t?`&date1=${r}&date2=${n}`:""}&page=1&page_size=${l}&name=${e==null?void 0:e.key}`);C(k.data.results),E(k.data.count),i(P()),L()}catch(k){console.error("Error fetching data:",k)}};return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(d,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsxs(d,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(Gu,{icon:u.jsx(l6,{}),checkedIcon:u.jsx(s6,{}),checked:t,onChange:()=>s(!t),color:"primary",size:"large"}),u.jsx(d,{children:u.jsx(Fu,{disabled:!t,label:"از تاریخ",id:"date",renderInput:y=>u.jsx(w,{size:"small",style:{width:"160px"},...y}),value:r,onChange:y=>{a(su(y).format("YYYY-MM-DD"))}})}),u.jsx(d,{children:u.jsx(Fu,{disabled:!t,label:"تا تاریخ",id:"date",renderInput:y=>u.jsx(w,{size:"small",style:{width:"160px"},...y}),value:n,onChange:y=>{x(su(y).format("YYYY-MM-DD"))}})})]}),u.jsx(d,{children:u.jsxs("form",{onSubmit:J,children:[u.jsx(w,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:f}),u.jsx(V,{type:"submit",onClick:J,endIcon:u.jsx(yu,{}),children:"جستجو"})]})}),u.jsx(Z,{title:"خروجی اکسل",children:u.jsx("a",{href:`${D.defaults.baseURL}LiveStock/jahad/cooperative_warehouse_excel/?search=filter&value=${g}&role=${O()}&key=${v}&name=${e==null?void 0:e.key}`,rel:"noreferrer",target:"_blank",children:u.jsx(V,{color:"success",children:u.jsx(fu,{size:32})})})}),u.jsx(Z,{title:"خروجی اکسل تراکنش مشکوک",children:u.jsx("a",{href:`${D.defaults.baseURL}LiveStock/jahad/rancher_management/?search=filter&value=${g}&role=${O()}&key=${v}&name=${e==null?void 0:e.key}`,rel:"noreferrer",target:"_blank",children:u.jsx(V,{color:"error",children:u.jsx(fu,{size:32})})})})]}),u.jsx(d,{container:!0,mt:2,mb:4,isDashboard:!0,gap:2,children:u.jsx(ou,{noPagination:!0,isDashboard:!0,columns:["محصول","تعداد کل تراکنش ها","وزن کل تراکنش ها","مبلغ کل تراکنش ها","کل وزن ورود به انبار","کل وزن دریافتی","کل وزن تخصیص داده شده","کل وزن باقی مانده"],data:[[e==null?void 0:e.label,(Y=B==null?void 0:B.transactions)==null?void 0:Y.toLocaleString(),(W=B==null?void 0:B.totalTransactionsWeight)==null?void 0:W.toLocaleString(),(h=B==null?void 0:B.totalTransactionsPrice)==null?void 0:h.toLocaleString(),(b=B==null?void 0:B.totalWeight)==null?void 0:b.toLocaleString(),(R=B==null?void 0:B.totalReceiptWeight)==null?void 0:R.toLocaleString(),(A=B==null?void 0:B.totalAllocatedWeight)==null?void 0:A.toLocaleString(),(j=B==null?void 0:B.totalRemainWeight)==null?void 0:j.toLocaleString()]],title:"خلاصه اطلاعات"})}),u.jsx(ou,{data:F,columns:["ردیف","محصول","نام تعاونی","کاربر","استان","شهر","موبایل","کد ملی","سهمیه دریافتی","وزن تحویلی","وزن فروش رفته","مانده انبار","تعداد تراکنش ها","جمع کل تراکنش ها","وزن کل تراکنش ها","جزئیات"],handlePageChange:$,totalRows:N,page:I,perPage:l,handlePerRowsChange:M,title:"گزارش فروش تعاونی ها"})]})},Qu={bran:{label:"سبوس",icon:u.jsx(x0,{fontSize:"small"})},barley:{label:"جو",icon:u.jsx(A0,{fontSize:"small"})},soy:{label:"سویا",icon:u.jsx(p0,{fontSize:"small"})},corn:{label:"ذرت",icon:u.jsx(g0,{fontSize:"small"})},sheep_concentrate:{label:"کنسانتره گوسفندی",icon:u.jsx(Ku,{fontSize:"small"})},high_cow_concentrate:{label:"کنسانتره گاو شیری پرتولید",icon:u.jsx(Ku,{fontSize:"small"})},medium_cow_concentrate:{label:"کنسانتره گاو شیری متوسط",icon:u.jsx(Ku,{fontSize:"small"})},fattening_calf_concentrate:{label:"کنسانتره گوساله پرواری",icon:u.jsx(Ku,{fontSize:"small"})}},V6="selectedProduct",He=j0(r6),Me=({onSelect:e})=>{const r=C0(),a=h0(r.breakpoints.down("sm")),[n,x]=o.useState("bran");o.useEffect(()=>{const s=localStorage.getItem(V6);if(s){const v=JSON.parse(s);v.key&&Qu[v.key]&&(x(v.key),e(v))}else e({key:"bran",label:Qu.bran.label})},[e]);const t=s=>{const v={key:s,label:Qu[s].label};x(s),localStorage.setItem(V6,JSON.stringify(v)),e(v)};return u.jsxs(r6,{sx:{mt:2},children:[u.jsx(tu,{variant:"h6",textAlign:"center",color:"primary",mb:1,children:"انتخاب محصول"}),u.jsx(r6,{sx:{display:"flex",flexWrap:a?"nowrap":"wrap",overflowX:a?"auto":"visible",gap:1,px:2,py:1,justifyContent:a?"flex-start":"center",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},children:Object.entries(Qu).map(([s,{label:v,icon:i}])=>{const f=n===s;return u.jsx(He,{whileTap:{scale:.95},whileHover:{scale:1.05},transition:{duration:.15},children:u.jsxs(d0,{onClick:()=>t(s),sx:{borderRadius:"30px",border:`1px solid ${f?r.palette.primary.main:"#ddd"}`,backgroundColor:f?"#e3f2fd":"#fff",px:2,py:1,display:"flex",alignItems:"center",gap:1,whiteSpace:"nowrap",boxShadow:f?"0 2px 5px rgba(0,0,0,0.1)":"none",transition:"all 0.2s ease-in-out",minWidth:150,justifyContent:"center"},children:[i,u.jsx(tu,{fontSize:13,children:v})]})},s)})})]})},H6="selectedProduct",xr=()=>{const{pathname:e}=G6(),r=localStorage.getItem(H6);let a;try{a=r?JSON.parse(r):{key:"bran",label:"سبوس"}}catch{a={key:"bran",label:"سبوس"}}const[n,x]=o.useState(a);return o.useEffect(()=>{localStorage.setItem(H6,JSON.stringify(n))},[n]),u.jsx(r6,{display:"flex",justifyContent:"center",children:u.jsxs(d,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,my:lu.MEDIUM,children:[u.jsx(V0,{}),e===f0&&u.jsx(Y0,{}),(e===_0||e===F0)&&u.jsx(ee,{}),(e===S0||e===E0||e===b0)&&u.jsx(ye,{}),(e===k0||e===I0||e===P0)&&u.jsx(ie,{}),(e===w0||e===T0||e===L0)&&u.jsx(je,{}),(e===mu||e===d6||e===R0)&&u.jsxs(u.Fragment,{children:[u.jsx(Me,{onSelect:t=>x(t)}),u.jsx(fe,{product:n})]}),(e===h6||e===Z6||e===X6)&&u.jsx(we,{product:n}),(e===g6||e===Q6||e===m6)&&u.jsx($e,{product:n}),(e===$0||e===B0||e===O0)&&u.jsx(We,{product:n}),e===x6&&u.jsx(Ne,{product:n}),(e===A6||e===p6)&&u.jsx(Ve,{product:n})]})})};export{xr as default}; diff --git a/build/assets/ProvinceKillersWages-DomGWVQy.js b/build/assets/ProvinceKillersWages-DomGWVQy.js new file mode 100644 index 0000000..2e399b1 --- /dev/null +++ b/build/assets/ProvinceKillersWages-DomGWVQy.js @@ -0,0 +1 @@ +import{j as n,b as S6,B as p6}from"./mui-vendor-CkIVaoQP.js";import{j as E6,r as F}from"./react-vendor-CmFgShSM.js";import{e9 as I6,G as e,O as W6}from"./index-CeyyVc1v.js";import{B as w6}from"./BackButton-Crzr7NMa.js";import{u as M6,f as t6}from"./redux-vendor-B7uoacJt.js";import{R as d6}from"./ResponsiveTable-w7hk7Uq8.js";import{S as T6}from"./SimpleTable-DBAoNnCU.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const U6=()=>{var p;const{key:e6}=E6(),[F6,L6]=F.useState(),L=M6();F.useEffect(()=>{L(I6({kill_house_key:e6}))},[]);const{provincePaymentByWeightOverview:a}=t6(C=>C.provinceSlice),{provincePaymentKillersOfKillhouses:f}=t6(C=>C.provinceSlice),S=(C,u)=>{const E=C.map((o,t)=>{var l,c,A,g,r,s;return[t+1,o==null?void 0:o.name,((l=o==null?void 0:o.provinceKillRequestWage)==null?void 0:l.toLocaleString())||"0",((c=o==null?void 0:o.freeSellCarcassesWage)==null?void 0:c.toLocaleString())||"0",((A=o==null?void 0:o.freeBuyingCarcassesWage)==null?void 0:A.toLocaleString())||"0",((g=o==null?void 0:o.freeBuyingLiveWage)==null?void 0:g.toLocaleString())||"0",(((o==null?void 0:o.provinceKillRequestWage)||0)+((o==null?void 0:o.freeSellCarcassesWage)||0)+((o==null?void 0:o.freeBuyingCarcassesWage)||0)+((o==null?void 0:o.freeBuyingLiveWage)||0)).toLocaleString(),((r=o==null?void 0:o.totalPaidWage)==null?void 0:r.toLocaleString())||"0",((s=o==null?void 0:o.totalUnpaidWage)==null?void 0:s.toLocaleString())||"0"]});return n.jsx(p6,{size:"small",variant:"outlined",color:"success",onClick:()=>{var o;L(W6({title:"سهم بندی تعرفه کشتارگاه "+u,size:1e3,content:n.jsx(e,{container:!0,xs:12,justifyContent:"center",children:n.jsx(T6,{data:E,columns:["ردیف","سهم",`${((o=a==null?void 0:a.wageInfo)==null?void 0:o.wageCountingType)==="live"?"تعرفه کشتار داخل استان (ریال)":" تعرفه توزیع لاشه داخل استان (ریال)"}`,"تعرفه توزیع لاشه خارج استان (ریال)","تعرفه لاشه ورودی به استان (ریال)","تعرفه مرغ زنده ورودی به استان (ریال)","تعرفه کل (ریال)","تعرفه پرداخت شده (ریال)","تعرفه پرداخت نشده (ریال)"]})})}))},children:"مشاهده"})};return F.useEffect(()=>{if(a){const C=f==null?void 0:f.map((u,E)=>{var o,t,l,c,A,g,r,s,I,W,w,M,d,T,x,j,B,v,P,R,K,b,k,q,y,D,G,U,_,z,O,H,N,$,J,Q,V,X,Y,Z,i,h,m,u6,o6,a6,n6,C6,l6,c6,A6,g6,r6,s6,f6;return((o=a==null?void 0:a.wageInfo)==null?void 0:o.wageCountingType)==="live"?[u==null?void 0:u.name,(l=Math.ceil((t=u==null?void 0:u.wageInfo)==null?void 0:t.totalWage))==null?void 0:l.toLocaleString(),(A=Math.ceil((c=u==null?void 0:u.wageInfo)==null?void 0:c.totalPaidWage))==null?void 0:A.toLocaleString(),(r=Math.ceil((g=u==null?void 0:u.wageInfo)==null?void 0:g.off))==null?void 0:r.toLocaleString(),(I=Math.ceil((s=u==null?void 0:u.wageInfo)==null?void 0:s.totalUnpaidWage))==null?void 0:I.toLocaleString(),(w=Math.ceil((W=u==null?void 0:u.wageInfo)==null?void 0:W.totalProvinceLiveWeight))==null?void 0:w.toLocaleString(),(d=Math.ceil((M=u==null?void 0:u.wageInfo)==null?void 0:M.provinceKillRequestsTotalWage))==null?void 0:d.toLocaleString(),(x=Math.ceil((T=u==null?void 0:u.wageInfo)==null?void 0:T.freeBarsOutProvinceCarcasesTotalWeight))==null?void 0:x.toLocaleString(),(B=Math.ceil((j=u==null?void 0:u.wageInfo)==null?void 0:j.freeBarsOutProvinceCarcasesTotalWage))==null?void 0:B.toLocaleString(),(P=Math.ceil((v=u==null?void 0:u.wageInfo)==null?void 0:v.freeBarsCarcasesTotalWeight))==null?void 0:P.toLocaleString(),(K=Math.ceil((R=u==null?void 0:u.wageInfo)==null?void 0:R.freeBarsCarcasesTotalWage))==null?void 0:K.toLocaleString(),(k=Math.ceil((b=u==null?void 0:u.wageInfo)==null?void 0:b.freeBarsLiveTotalWeight))==null?void 0:k.toLocaleString(),(y=Math.ceil((q=u==null?void 0:u.wageInfo)==null?void 0:q.freeBarsLiveTotalWage))==null?void 0:y.toLocaleString(),S((D=u==null?void 0:u.wageInfo)==null?void 0:D.shares,u==null?void 0:u.name)]:[u==null?void 0:u.name,(U=Math.ceil((G=u==null?void 0:u.wageInfo)==null?void 0:G.totalWage))==null?void 0:U.toLocaleString(),(z=Math.ceil((_=u==null?void 0:u.wageInfo)==null?void 0:_.totalPaidWage))==null?void 0:z.toLocaleString(),(H=Math.ceil((O=u==null?void 0:u.wageInfo)==null?void 0:O.off))==null?void 0:H.toLocaleString(),($=Math.ceil((N=u==null?void 0:u.wageInfo)==null?void 0:N.totalUnpaidWage))==null?void 0:$.toLocaleString(),(Q=Math.ceil((J=u==null?void 0:u.wageInfo)==null?void 0:J.totalProvinceLiveWeight))==null?void 0:Q.toLocaleString(),(X=Math.ceil((V=u==null?void 0:u.wageInfo)==null?void 0:V.totalProvinceCarcassesWeight))==null?void 0:X.toLocaleString(),(Z=Math.ceil((Y=u==null?void 0:u.wageInfo)==null?void 0:Y.provinceKillRequestsTotalWeight))==null?void 0:Z.toLocaleString(),(h=Math.ceil((i=u==null?void 0:u.wageInfo)==null?void 0:i.provinceKillRequestsTotalWage))==null?void 0:h.toLocaleString(),(u6=Math.ceil((m=u==null?void 0:u.wageInfo)==null?void 0:m.freeBarsOutProvinceCarcasesTotalWeight))==null?void 0:u6.toLocaleString(),(a6=Math.ceil((o6=u==null?void 0:u.wageInfo)==null?void 0:o6.freeBarsOutProvinceCarcasesTotalWage))==null?void 0:a6.toLocaleString(),(C6=Math.ceil((n6=u==null?void 0:u.wageInfo)==null?void 0:n6.freeBarsCarcasesTotalWeight))==null?void 0:C6.toLocaleString(),(c6=Math.ceil((l6=u==null?void 0:u.wageInfo)==null?void 0:l6.freeBarsCarcasesTotalWage))==null?void 0:c6.toLocaleString(),(g6=Math.ceil((A6=u==null?void 0:u.wageInfo)==null?void 0:A6.freeBarsLiveTotalWeight))==null?void 0:g6.toLocaleString(),(s6=Math.ceil((r6=u==null?void 0:u.wageInfo)==null?void 0:r6.freeBarsLiveTotalWage))==null?void 0:s6.toLocaleString(),S((f6=u==null?void 0:u.wageInfo)==null?void 0:f6.shares,u==null?void 0:u.name)]});L6(C)}},[f,a]),n.jsx(n.Fragment,{children:n.jsx(S6,{display:"flex",justifyContent:"center",children:n.jsxs(e,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[n.jsx(w6,{}),n.jsx(e,{container:!0,xs:12,justifyContent:"center",children:n.jsx(e,{container:!0,justifyContent:"center",xs:12,mt:1,children:n.jsx(d6,{paginated:!0,columns:((p=a==null?void 0:a.wageInfo)==null?void 0:p.wageCountingType)==="live"?["نام کشتارکن","کل تعرفه (ریال)","کل تعرفه پرداخت شده (ریال)","تخفیف (ریال)","کل تعرفه پرداخت نشده (ریال)","کل وزن زنده کشتار داخل استان (کیلوگرم)","تعرفه کشتار داخل استان (ریال)","وزن توزیع لاشه به خارج استان (کیلوگرم)","تعرفه توزیع لاشه خارج استان (ریال)","وزن لاشه ورودی به استان (کیلوگرم)","تعرفه لاشه ورودی به استان (ریال)","وزن مرغ زنده ورودی به استان (کیلوگرم)","تعرفه مرغ زنده ورودی به استان (ریال)","سهم بندی"]:["نام کشتارکن","کل تعرفه (ریال)","کل تعرفه پرداخت شده (ریال)","تخفیف (ریال)","کل تعرفه پرداخت نشده (ریال)","کل وزن زنده کشتار داخل استان (کیلوگرم)","وزن لاشه کشتار داخل استان (کیلوگرم)","وزن توزیع لاشه داخل استان (کیلوگرم)","تعرفه توزیع لاشه داخل استان (ریال)","وزن توزیع لاشه به خارج استان (کیلوگرم)","تعرفه توزیع لاشه خارج استان (ریال)","وزن لاشه ورودی به استان (کیلوگرم)","تعرفه لاشه ورودی به استان (ریال)","وزن مرغ زنده ورودی به استان (کیلوگرم)","تعرفه مرغ زنده ورودی به استان (ریال)","سهم بندی"],data:F6})})})]})})})};export{U6 as default}; diff --git a/build/assets/ProvinceManageDistributionsSubmitCommitmentPercent-BeA64jYA.js b/build/assets/ProvinceManageDistributionsSubmitCommitmentPercent-BeA64jYA.js new file mode 100644 index 0000000..f0944f6 --- /dev/null +++ b/build/assets/ProvinceManageDistributionsSubmitCommitmentPercent-BeA64jYA.js @@ -0,0 +1 @@ +import{j as s,b as E,ak as g,I as A,T as x}from"./mui-vendor-CkIVaoQP.js";import{r as _}from"./react-vendor-CmFgShSM.js";import{L as o,j as i,h as a,A as f,u as T,G as h,c as I,b as D}from"./index-CeyyVc1v.js";import{d as G}from"./Check-CRb6laYC.js";import{d as N}from"./Edit-CqBj1Y2L.js";import{a as c,u as S}from"./redux-vendor-B7uoacJt.js";const R=c("PROVINCE_MANAGE_TRADES_EDIT_PERCENTS",async(r,{dispatch:t})=>{try{t(o());const{data:e,status:n}=await i.put("market-kill-houses/0/",r);return t(a()),{data:e,status:n}}catch(e){return t(a()),{error:e.response.data.result}}}),j=c("PROVINCE_MANAGE_GUILD_TRADES_EDIT_PERCENTS",async(r,{dispatch:t})=>{try{t(o());const{data:e,status:n}=await i.put("guilds-for-configs/0/",r);return t(a()),{data:e,status:n}}catch(e){return t(a()),{error:e.response.data.result}}}),b=c("PROVINCE_MANAGE_GUILD_TRADES_EDIT_ALL_PERCENTS",async(r,{dispatch:t})=>{try{t(o());const{data:e,status:n}=await i.put("guilds-configs/0/",r);return t(a()),{data:e,status:n}}catch(e){return t(a()),{error:e.response.data.result}}}),B=c("PROVINCE_MANAGE_GUILD_TRADES_GET_PERCENTS",async(r,{dispatch:t})=>{try{t(o());const{data:e,status:n}=await i.get("guilds-configs",{params:r});return t(a()),{data:e,status:n}}catch(e){return t(a()),{error:e.response.data}}}),v=I({commitmentPercent:D().min(0,"درصد نمی‌تواند کمتر از ۰ باشد").max(100,"درصد نمی‌تواند بیشتر از ۱۰۰ باشد").required("درصد تعهد الزامی است").integer("درصد باید عدد صحیح باشد")}),U=({amount:r,updateTable:t,item:e,isGuild:n,isDashboard:l})=>{const[F,d]=_.useState(!1),[p]=_.useContext(f),P=S(),u=T({initialValues:{commitmentPercent:r||0},validationSchema:v,onSubmit:m=>{P((l?b:n?j:R)({...l?{}:{key:e==null?void 0:e.key},out_province_free_buying_commitment_percent:m==null?void 0:m.commitmentPercent})).then(C=>{C.payload.error?p({vertical:"top",horizontal:"center",msg:C.payload.error,severity:"error"}):(t(),p({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}),t(),d(!1)}}),y=()=>{u.setValues({commitmentPercent:r||0}),u.setErrors({}),d(!0)};return s.jsx(h,{xs:12,container:!0,justifyContent:"center",alignItems:"center",children:F?s.jsxs(E,{component:"form",onSubmit:u.handleSubmit,display:"flex",alignItems:"center",gap:1,children:[s.jsx(g,{size:"small",id:"commitmentPercent",name:"commitmentPercent",label:"درصد تعهد",variant:"outlined",type:"number",value:u.values.commitmentPercent,style:{width:80},inputProps:{min:0,max:100,step:1},onChange:u.handleChange,onBlur:u.handleBlur,error:u.touched.commitmentPercent&&!!u.errors.commitmentPercent,helperText:u.touched.commitmentPercent&&u.errors.commitmentPercent}),s.jsx(A,{size:"small",color:"primary",type:"submit",disabled:!u.isValid||u.isSubmitting,children:s.jsx(G,{})})]}):s.jsxs(E,{display:"flex",alignItems:"center",children:[s.jsxs(x,{variant:"caption",children:["%",r||0]}),s.jsx(A,{size:"small",color:"primary",onClick:y,children:s.jsx(N,{})})]})})};export{U as P,j as a,B as b,R as c,b as p}; diff --git a/build/assets/ProvinceManagePricing-C6sFsNo-.js b/build/assets/ProvinceManagePricing-C6sFsNo-.js new file mode 100644 index 0000000..a0618a4 --- /dev/null +++ b/build/assets/ProvinceManagePricing-C6sFsNo-.js @@ -0,0 +1 @@ +import{j as u,ak as B,aa as W,B as v,I as uu,b0 as eu,d as U,T as R,b as ru}from"./mui-vendor-CkIVaoQP.js";import{j as V,A as G,u as K,c as X,b as D,v as J,G as l,S as g,W as ou,L as H,h as _,aZ as nu,N as M,X as Y,O as tu,a_ as iu,C as lu,p as S}from"./index-CeyyVc1v.js";import{r as C}from"./react-vendor-CmFgShSM.js";import{a as Q,u as T}from"./redux-vendor-B7uoacJt.js";import{N as O}from"./NumberFormatCustom-DwWPj40N.js";import{C as au}from"./CustomCard-B-6dDbAN.js";import{R as su}from"./ResponsiveTable-w7hk7Uq8.js";import{d as cu}from"./Edit-CqBj1Y2L.js";import{d as Cu}from"./Tune-D4M2CAhp.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const du=Q("PROVINCE_NEW_PRICING",async i=>{const{data:r,status:e}=await V.post("pricing/",i);return{data:r,status:e}}),hu=()=>{const[i]=C.useContext(G),r=T(),e=K({initialValues:{date:J(Date()).format("YYYY-MM-DD hh:mm:ss"),price:"",floorprice:"",ceilingprice:""},validationSchema:X({price:D().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!")})});return C.useEffect(()=>{e.validateForm()},[]),u.jsxs(l,{container:!0,gap:g.SMALL,direction:"column",height:"100%",justifyContent:"space-between",children:[u.jsx(l,{children:u.jsx(ou,{fullWidth:!0,label:"تاریخ",id:"date",renderInput:a=>u.jsx(B,{...a}),value:e.values.date,error:e.touched.date?!!e.errors.date:null,onChange:a=>{e.setFieldValue("date",J(a).format("YYYY-MM-DD hh:mm:ss"))},onBlur:e.handleBlur,helperText:e.touched.date&&e.errors.date?e.errors.date:null})}),u.jsx(l,{children:u.jsx(O,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"price",label:"قیمت هر کیلو مرغ زنده",variant:"outlined",InputLabelProps:{shrink:!0},InputProps:{endAdornment:u.jsx(W,{position:"start",children:"ریال"})},value:e.values.price,error:e.touched.price?!!e.errors.price:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.price&&e.errors.price?e.errors.price:null})}),u.jsx(l,{children:u.jsx(O,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"floorprice",label:"قیمت کف",variant:"outlined",InputLabelProps:{shrink:!0},InputProps:{endAdornment:u.jsx(W,{position:"start",children:"ریال"})},value:e.values.floorprice,error:e.touched.floorprice?!!e.errors.floorprice:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.floorprice&&e.errors.floorprice?e.errors.floorprice:null})}),u.jsx(l,{children:u.jsx(O,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"ceilingprice",label:"قیمت سقف",variant:"outlined",InputLabelProps:{shrink:!0},InputProps:{endAdornment:u.jsx(W,{position:"start",children:"ریال"})},value:e.values.ceilingprice,error:e.touched.ceilingprice?!!e.errors.ceilingprice:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.ceilingprice&&e.errors.ceilingprice?e.errors.ceilingprice:null})}),u.jsx(l,{children:u.jsx(v,{fullWidth:!0,variant:"contained",component:"label",disabled:!e.isValid,size:"large",onClick:()=>{e.values.floorprice>e.values.ceilingprice?i({vertical:"top",horizontal:"center",msg:"قیمت گذاری غیر استاندارد است!",severity:"error"}):(r(H()),r(du({date:e.values.date,live_chicken_price:e.values.price,floor_price:e.values.floorprice?e.values.floorprice:0,ceiling_price:e.values.ceilingprice?e.values.ceilingprice:0})).then(a=>{a.error?(r(_()),i({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"})):r(nu()).then(c=>{r(_()),i({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),r(M({right:!1,bottom:!1,content:null}))})}))},children:"ثبت درخواست"})})]})},$=Q("PROVINCE_PRICE_EDIT_SERVICE",async(i,{dispatch:r})=>{var e,a;try{r(H());const{data:c,status:d}=await V.put(`chicken-commission-prices/${i.id}/`,{kill_house_price:i.kill_house_price,wholesaler_price:i.wholesaler_price,retailer_price:i.retailer_price});return r(_()),{data:c,status:d}}catch(c){return r(_()),{error:((a=(e=c==null?void 0:c.response)==null?void 0:e.data)==null?void 0:a.result)||"خطایی رخ داده است"}}}),pu=({updateTable:i,item:r})=>{const[e]=C.useContext(G),a=T(),c={kill_house_price:(r==null?void 0:r.killHousePrice)||0,wholesaler_price:(r==null?void 0:r.wholesalerPrice)||0,retailer_price:(r==null?void 0:r.retailerPrice)||0},d=X().shape({kill_house_price:D().required("این فیلد الزامی است").min(0,"مقدار نمی‌تواند منفی باشد"),wholesaler_price:D().required("این فیلد الزامی است").min(0,"مقدار نمی‌تواند منفی باشد"),retailer_price:D().required("این فیلد الزامی است").min(0,"مقدار نمی‌تواند منفی باشد")}),t=K({initialValues:c,validationSchema:d,enableReinitialize:!0}),p=()=>{a($({id:r==null?void 0:r.id,kill_house_price:Number(t.values.kill_house_price),wholesaler_price:Number(t.values.wholesaler_price),retailer_price:Number(t.values.retailer_price)})).then(F=>{var A;(A=F.payload)!=null&&A.error?e({vertical:"top",horizontal:"center",msg:F.payload.error,severity:"error"}):(i(),e({vertical:"top",horizontal:"center",msg:"قیمت‌ها با موفقیت ویرایش شدند",severity:"success"}),a(M({right:!1,bottom:!1,content:null})))})};return u.jsxs(l,{container:!0,direction:"column",gap:g.SMALL,sx:{p:1},children:[u.jsx(B,{label:"کارمزد کشتارگاه (ریال)",variant:"outlined",fullWidth:!0,name:"kill_house_price",value:t.values.kill_house_price,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.kill_house_price&&!!t.errors.kill_house_price,helperText:t.touched.kill_house_price&&t.errors.kill_house_price}),u.jsx(B,{label:"کارمزد عمده فروش (ریال)",variant:"outlined",fullWidth:!0,name:"wholesaler_price",value:t.values.wholesaler_price,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.wholesaler_price&&!!t.errors.wholesaler_price,helperText:t.touched.wholesaler_price&&t.errors.wholesaler_price}),u.jsx(B,{label:"کارمزد خرده فروش (ریال)",variant:"outlined",fullWidth:!0,name:"retailer_price",value:t.values.retailer_price,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.retailer_price&&!!t.errors.retailer_price,helperText:t.touched.retailer_price&&t.errors.retailer_price}),u.jsx(v,{variant:"contained",color:"primary",fullWidth:!0,onClick:p,disabled:!t.isValid||!t.dirty,children:"ذخیره تغییرات"})]})},Au=({item:i,updateTable:r})=>{const e=T(),[a,c]=C.useState(null),[d]=C.useContext(G),t=s=>c(s.currentTarget),p=()=>c(null),F=!!a,A=F?"popover":void 0,E=Y(),x=()=>{if(!(i!=null&&i.date))return!1;const s=new Date,h=new Date(i.date);return h.getFullYear()===s.getFullYear()&&h.getMonth()===s.getMonth()&&h.getDate()===s.getDate()},z=()=>{if(p(),!x()){d({msg:"فقط قیمت‌های مربوط به تاریخ امروز قابل ویرایش هستند.",severity:"error",vertical:"top",horizontal:"center"});return}e(M({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(pu,{item:i,isEdit:!0,updateTable:r,onSubmit:s=>{e($({id:i.id,prices:{kill_house_price:s.killHousePrice,wholesaler_price:s.wholesalerPrice,retailer_price:s.retailerPrice}})).then(h=>{h.payload.error?d({msg:h.payload.error,severity:"error",vertical:"top",horizontal:"center"}):(r(),d({msg:"قیمت‌ها با موفقیت ویرایش شدند",severity:"success",vertical:"top",horizontal:"center"}))})}}),title:"ویرایش قیمت‌های کارمزد"}))},L=s=>{e($({id:i.id,prices:{kill_house_check:!0,state:s}})).then(h=>{h.payload.error?d({msg:h.payload.error,severity:"error",vertical:"top",horizontal:"center"}):(r(),e(lu()),d({msg:"وضعیت با موفقیت به روز رسانی شد",severity:"success",vertical:"top",horizontal:"center"}))})},N=()=>E!=="KillHouse"?u.jsx(U,{title:"ویرایش قیمت‌ها",children:u.jsx(v,{size:"small",startIcon:u.jsx(cu,{fontSize:"small"}),sx:{"&.Mui-disabled":{backgroundColor:"transparent",color:"text.disabled"}},onClick:z,children:u.jsx(R,{variant:"body2",fontWeight:600,children:"ویرایش قیمت‌ها"})})}):u.jsx(U,{title:"تایید/رد",children:u.jsx(v,{size:"small",startIcon:u.jsx(iu,{fontSize:"small"}),onClick:()=>{p(),e(tu({title:"تایید/ رد",content:u.jsxs(l,{container:!0,spacing:2,justifyContent:"center",children:[u.jsx(l,{item:!0,xs:12,children:u.jsx(R,{variant:"body2",color:"error",children:"توجه: در صورت تایید حجم قطعه اعلام شده، حجم مورد نظر از سالن مرغدار کسر شده و با میانگین وزن کشتار مرغدار به انبار شما اضافه می‌گردد."})}),u.jsx(l,{item:!0,children:u.jsx(v,{color:"success",variant:"contained",onClick:()=>L("accepted"),children:"تایید"})}),u.jsx(l,{item:!0,children:u.jsx(v,{color:"error",variant:"contained",onClick:()=>L("rejected"),children:"رد"})})]})}))},sx:{"&.Mui-disabled":{backgroundColor:"transparent",color:"text.disabled"}},children:u.jsx(R,{variant:"body2",fontWeight:600,children:"تایید / رد"})})});return u.jsxs("div",{children:[u.jsx(uu,{"aria-describedby":A,color:"primary",onClick:t,disabled:!x(),children:u.jsx(Cu,{})}),u.jsx(eu,{id:A,open:F,anchorEl:a,onClose:p,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsx("div",{style:{padding:"10px"},children:u.jsx(l,{container:!0,direction:"column",gap:1,alignItems:"flex-start",style:{width:150},children:N()})})})]})},gu=()=>{const i=T(),[r,e]=C.useState([]),[a,c]=C.useState([]),[d,t]=C.useState(0),[p,F]=C.useState(10),[A,E]=C.useState(1),x=async o=>{try{i(H());const n=await V.get(`chicken-commission-prices/?role=${Y()}&page=${o}&page_size=${p}`);i(_()),e(n.data.results),t(n.data.count)}catch(n){console.error("Error fetching pricing data:",n),i(_())}},z=o=>{x(o),E(o)},L=o=>{F(o),E(1)},N=()=>{x(A!==0?A:1)};C.useEffect(()=>{x(1)},[i,p]),C.useEffect(()=>{const o=r==null?void 0:r.map((n,j)=>{var P,b,k,y,w,m,f,I,q,Z;return[j+1,S(n==null?void 0:n.date),((P=n==null?void 0:n.chickenAveragePrice)==null?void 0:P.toLocaleString())+" ﷼",((b=n==null?void 0:n.killHousePrice)==null?void 0:b.toLocaleString())+" ﷼",((k=n==null?void 0:n.wholesalerPrice)==null?void 0:k.toLocaleString())+" ﷼",((y=n==null?void 0:n.retailerPrice)==null?void 0:y.toLocaleString())+" ﷼",((m=(w=n==null?void 0:n.priceInfo)==null?void 0:w.killHousePrice)==null?void 0:m.toLocaleString())+" ﷼",((I=(f=n==null?void 0:n.priceInfo)==null?void 0:f.wholesalePrice)==null?void 0:I.toLocaleString())+" ﷼",((Z=(q=n==null?void 0:n.priceInfo)==null?void 0:q.retailPrice)==null?void 0:Z.toLocaleString())+" ﷼",u.jsx(Au,{updateTable:N,item:n},j)]});c(o)},[r]);const s=Y(),h=()=>{var j,P,b,k,y,w,m;if(!r||r.length===0)return null;const o=r[0],n=[{title:"قیمت مرغ زنده",value:((j=o==null?void 0:o.chickenAveragePrice)==null?void 0:j.toLocaleString())+" ریال",date:S(o==null?void 0:o.createDate)},{title:"قیمت درب کشتارگاه",value:((b=(P=o==null?void 0:o.priceInfo)==null?void 0:P.killHousePrice)==null?void 0:b.toLocaleString())+" ریال",date:S(o==null?void 0:o.createDate)},{title:"قیمت عمده فروشی",value:((y=(k=o==null?void 0:o.priceInfo)==null?void 0:k.wholesalePrice)==null?void 0:y.toLocaleString())+" ریال",date:S(o==null?void 0:o.createDate)},{title:"قیمت خرده فروشی",value:((m=(w=o==null?void 0:o.priceInfo)==null?void 0:w.retailPrice)==null?void 0:m.toLocaleString())+" ریال",date:S(o==null?void 0:o.createDate)}];return u.jsx(l,{container:!0,mt:g.SMALL,px:2,children:n.map((f,I)=>u.jsx(l,{item:!0,xs:12,sm:6,md:3,p:1,children:u.jsx(au,{title:f.title,value:`${f.value} - ${f.date}`})},I))})};return u.jsxs(u.Fragment,{children:[u.jsx(l,{container:!0,direction:"column",alignItems:"start",justifyContent:"center",gap:g.SMALL,px:2,children:(s==="ProvinceFinancial"||s==="ProvinceOperator")&&u.jsx(l,{container:!0,gap:g.MEDIUM,alignItems:"start",children:u.jsx(l,{children:u.jsx(v,{variant:"contained",onClick:()=>{i(M({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"قیمت گذاری",content:u.jsx(hu,{})}))},children:"قیمت گذاری"})})})}),h(),u.jsx(l,{container:!0,alignItems:"center",justifyContent:"space-between",gap:g.SMALL,mt:g.MEDIUM,px:2,children:u.jsx(su,{title:"قیمت مرغ",name:"بایگانی قیمت‌ها",columns:["ردیف","تاریخ","قیمت مرغ زنده"," کارمزد کشتارگاه","کارمزد عمده‌فروش","کارمزد خرده‌فروش","قیمت درب کشتارگاه","قیمت عمده فروش","قیمت خرده فروش","عملیات"],customWidth:"100%",data:a,page:A,perPage:p,totalRows:d,handlePageChange:z,handlePerRowsChange:L})})]})},mu=()=>u.jsx(u.Fragment,{children:u.jsx(ru,{display:"flex",justifyContent:"center",children:u.jsx(l,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsx(l,{container:!0,justifyContent:"space-between",gap:g.SMALL,mt:g.SMALL,children:u.jsx(l,{width:"100%",children:u.jsx(gu,{})})})})})});export{mu as default}; diff --git a/build/assets/ProvinceProducts-CJk-kZIC.js b/build/assets/ProvinceProducts-CJk-kZIC.js new file mode 100644 index 0000000..950c6cd --- /dev/null +++ b/build/assets/ProvinceProducts-CJk-kZIC.js @@ -0,0 +1 @@ +import{j as r,ak as t,B as f,b5 as h,T as v,b as F}from"./mui-vendor-CkIVaoQP.js";import{L as k,j as S,h as y,A as x,u as T,c as b,M as I,G as o,a$ as A,O as M,S as g}from"./index-CeyyVc1v.js";import{r as p}from"./react-vendor-CmFgShSM.js";import{a as O,u as P,f as D}from"./redux-vendor-B7uoacJt.js";import{S as E}from"./SimpleTable-DBAoNnCU.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const C=O("PROVINCE_SUBMUIT_PRODUCT_PRICE",async(n,{dispatch:e})=>{try{e(k());const{data:l,status:s}=await S.put("additional-products/0/",n);return e(y()),{data:l,status:s}}catch(l){return e(y()),{error:l.response.data.result}}}),B=({item:n})=>{const[e]=p.useContext(x),l=P(),s=T({initialValues:{price:""},validationSchema:b({price:I().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!")})});return p.useEffect(()=>{s.validateForm()},[]),r.jsxs(o,{container:!0,justifyContent:"center",gap:2,alignItems:"center",children:[r.jsx(o,{children:r.jsx(t,{fullWidth:!0,id:"price",label:"قیمت",value:s.values.price,error:s.touched.price?!!s.errors.price:null,onChange:s.handleChange,onBlur:s.handleBlur,helperText:s.touched.price&&s.errors.price?s.errors.price:null,autoComplete:"current-password",variant:"outlined"})}),r.jsx(o,{children:r.jsx(f,{disabled:!s.isValid,variant:"contained",onClick:()=>{l(C({product_key:n==null?void 0:n.key,selling_free_price:n==null?void 0:n.sellingFreePrice,selling_approved_price:n==null?void 0:n.sellingApprovedPrice,selling_more_than_inventory:n==null?void 0:n.sellingMoreThanInventory,selling_other_products:n==null?void 0:n.sellingOtherProducts,price:s.values.price})).then(_=>{_.error?e({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(e({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),l(A()))})},children:"ثبت"})})]})},$=()=>{const[n]=p.useContext(x),e=P();p.useEffect(()=>{e(A())},[]);const l=d=>{d.error?n({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),e(A()))},{provinceProductList:s}=D(d=>d.provinceSlice),[_,j]=p.useState([]);return p.useEffect(()=>{const d=s==null?void 0:s.map((u,a)=>[a+1,u==null?void 0:u.name,r.jsx(h,{checked:u==null?void 0:u.sellingApprovedPrice,onClick:()=>{e(C({product_key:u==null?void 0:u.key,selling_free_price:u==null?void 0:u.sellingFreePrice,selling_approved_price:(u==null?void 0:u.sellingApprovedPrice)!==!0,selling_more_than_inventory:u==null?void 0:u.sellingMoreThanInventory,selling_other_products:u==null?void 0:u.sellingOtherProducts,price:u==null?void 0:u.price})).then(c=>{l(c)})}},a),r.jsx(h,{checked:u==null?void 0:u.sellingFreePrice,onClick:()=>{e(C({product_key:u==null?void 0:u.key,selling_free_price:(u==null?void 0:u.sellingFreePrice)!==!0,selling_approved_price:u==null?void 0:u.sellingApprovedPrice,selling_more_than_inventory:u==null?void 0:u.sellingMoreThanInventory,selling_other_products:u==null?void 0:u.sellingOtherProducts,price:u==null?void 0:u.price})).then(c=>{l(c)})}},a),r.jsx(h,{checked:u==null?void 0:u.sellingMoreThanInventory,onClick:()=>{e(C({product_key:u==null?void 0:u.key,selling_free_price:u==null?void 0:u.sellingFreePrice,selling_approved_price:u==null?void 0:u.sellingApprovedPrice,selling_more_than_inventory:(u==null?void 0:u.sellingMoreThanInventory)!==!0,selling_other_products:u==null?void 0:u.sellingOtherProducts,price:u==null?void 0:u.price})).then(c=>{l(c)})}},a),r.jsx(h,{checked:u==null?void 0:u.sellingOtherProducts,onClick:()=>{e(C({product_key:u==null?void 0:u.key,selling_free_price:u==null?void 0:u.sellingFreePrice,selling_approved_price:u==null?void 0:u.sellingApprovedPrice,selling_more_than_inventory:u==null?void 0:u.sellingMoreThanInventory,selling_other_products:(u==null?void 0:u.sellingOtherProducts)!==!0,price:u==null?void 0:u.price})).then(c=>{l(c)})}},a),r.jsx("a",{href:u==null?void 0:u.image,alt:"دانلود تصویر محصول",children:r.jsx("img",{src:u==null?void 0:u.image,width:"50",height:"50",alt:"بدون بار",className:"images-file"})},"productPicture"),r.jsxs(o,{container:!0,justifyContent:"center",children:[r.jsx(v,{mr:2,children:u==null?void 0:u.price}),r.jsx(f,{disabled:!(u!=null&&u.sellingApprovedPrice),size:"small",variant:"contained",onClick:()=>{e(M({title:"ثبت قیمت",content:r.jsx(B,{item:u})}))},children:"ثبت"})]},a)]);j(d)},[s]),r.jsx(r.Fragment,{children:r.jsx(F,{display:"flex",justifyContent:"center",children:r.jsx(o,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:r.jsx(o,{container:!0,justifyContent:"space-between",gap:g.SMALL,mt:g.SMALL,children:r.jsxs(o,{width:"100%",children:[r.jsx(o,{mt:g.SMALL,mb:g.SMALL,children:r.jsx(v,{variant:"body1",children:"محصولات"})}),r.jsx(E,{data:_,columns:["ردیف","نام محصول","قیمت به قیمت دولتی","فروش به قیمت آزاد","فروش بیشتر از انبار","فروش سایر محصولات","تصویر","قیمت"]})]})})})})})};export{$ as default}; diff --git a/build/assets/ProvinceReports-B30xgkxd.js b/build/assets/ProvinceReports-B30xgkxd.js new file mode 100644 index 0000000..f4a361f --- /dev/null +++ b/build/assets/ProvinceReports-B30xgkxd.js @@ -0,0 +1 @@ +import{j as e,b as A,T as x,ak as p}from"./mui-vendor-CkIVaoQP.js";import{A as F,j as i,X as n,m as E,G as C,S as a,W as R,v}from"./index-CeyyVc1v.js";import{B as P}from"./BackButton-Crzr7NMa.js";import{r as o}from"./react-vendor-CmFgShSM.js";import{f as U}from"./redux-vendor-B7uoacJt.js";import{b as B,a as Y}from"./index.esm-Bu7XMDZU.js";import{I as H}from"./index.esm-C4MeAo59.js";import"./iconBase-BEJYyZsk.js";const O=()=>{var k,h,_,f,m,y,b,g,L;const[,,l,S,s,D]=o.useContext(F);o.useContext(F);const[c]=o.useContext(F),w=U(u=>u.userSlice.authToken),t=U(u=>u.userSlice),[$,M]=o.useState(""),T=(u,r=!1)=>{r||(c({vertical:"top",horizontal:"center",msg:"فایل در حال دانلود می باشد، این عملیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"}),window.location.href=u)},z=async u=>{try{(await i.get(u)).status===200&&c({vertical:"top",horizontal:"center",msg:"تیکت با موفقیت ارسال شد",severity:"success"})}catch{c({vertical:"top",horizontal:"center",msg:"خطا در ارسال تیکت",severity:"error"})}},d=[{title:"گزارش تحلیلی",description:"گزارش تحلیلی از زنجیره مرغ گوشتی در استان",link:`${i.defaults.baseURL}management_all_poultry_and_warehouse_pdf/?date1=${l}&date2=${s}`,icon:e.jsx(H,{size:24,color:"red"})},{title:"تیکت وضعیت سند بار ها",description:"تیکت وضعیت سند بار ها",link:`${i.defaults.baseURL}send_bar_info_from_ticket/?key=${(k=t==null?void 0:t.userProfile)==null?void 0:k.key}&date1=${l}&date2=${s}`,icon:e.jsx(B,{size:24,color:"#FFFFFF"}),isTicket:!0},{title:"مغایرت قرنطینه",description:"مغایرت قرنطینه",link:`${i.defaults.baseURL}send_clearance_code_to_rsi/?date1=${l}&date2=${s}`},{title:"گزارش جامع کشتار",description:"اطلاعات کلی از کشتار تا صنف",link:`${i.defaults.baseURL}detail_of_killing_excel/?date1=${l}&date2=${s}&role=${n()}&key=${(h=t==null?void 0:t.userProfile)==null?void 0:h.key}`},{title:"گزارش پایش کشتارگاه ها",description:"پایش کلی کشتارگاه ها",link:`${i.defaults.baseURL}comprehensive_report_of_the_slaughterhouse_excel/?date1=${l}&date2=${s}`},{title:"اطلاعات بارها",description:"جزئیات بارهای ایجاد شده",link:`${i.defaults.baseURL}bar_excel/?start=${l}&end=${s}&key=${(_=t==null?void 0:t.userProfile)==null?void 0:_.key}&role=${n()}`},{title:"گزارش پایش تعاونی ها",description:"جزئیات جوجه ریزی و کشتار تعاونی ها",link:`${i.defaults.baseURL}general_city_operator/?date1=${l}&date2=${s}&key=${(f=t==null?void 0:t.userProfile)==null?void 0:f.key}&role=${n()}`},{title:"گزارش کلی خریداران",description:"گزارش تخصیص و پخش خریداران",link:`${i.defaults.baseURL}kill_house_user_excel/?date1=${l}&date2=${s}`},{title:"درخواست مرغداران",description:"درخواست های کتشار ثبت شده توسط مرغداران",link:`${i.defaults.baseURL}poultry_kill_request_excel/?start=${l}&end=${l}&role=${n()}&token=${w}`},{title:"اعلام نیاز خریداران",description:"اعلام نیاز کشتار از طرف خریداران",link:`${i.defaults.baseURL}kill_house_excel/?start=${l}&end=${s}`},{title:"جوجه ریزی های فعال",description:"اطلاعات تکمیلی جوجه ریزی",link:`${i.defaults.baseURL}0/hatching_excel`},{title:"جوجه ریزی های بایگانی شده",description:"اطلاعات تکمیلی جوجه ریزی",link:`${i.defaults.baseURL}archive_hatching_excel/?key=${(m=t==null?void 0:t.userProfile)==null?void 0:m.key}`},{title:"درخواست های کشتار",description:"جزئیات درخواست مرغداران تا تحویلی کشتارگاه",link:`${i.defaults.baseURL}poultry_request_report_excel/?start=${l}&end=${s}&key=${(y=t==null?void 0:t.userProfile)==null?void 0:y.key}`},{title:"اصناف",description:"اطلاعات اصناف ثبت شده",link:`${i.defaults.baseURL}guilds_excel/?key=${(b=t==null?void 0:t.userProfile)==null?void 0:b.key}`},{title:"کاربران",description:"اطلاعات کاربران ثبت شده",link:`${i.defaults.baseURL}get_all_user_excel/`},{title:"تخصیصات",description:"جزئیات تخصیص به خریداران",link:`${i.defaults.baseURL}allocated_excel/?start=${l}&end=${s}`},{title:"گزارش پخش روزانه",description:"کشتارگاه به مباشر/صنف",link:`${i.defaults.baseURL}all_inventory_excel/?date1=${l}&date2=${s}`},{title:"گزارش پخش روزانه",description:"مباشر به صنف",link:`${i.defaults.baseURL}steward_ware_house_total_report_daily_excel/?date1=${l}&date2=${s}`},{title:"آمار جوجه ریزی",description:"جزئیات جوجه ریزی",link:`${i.defaults.baseURL}hatching_date_range_excel/?date1=${l}&date2=${s}`},{title:"بارهای تکمیل شده",description:"جزئیات بارهای تکمیل شده",link:`${i.defaults.baseURL}bar-management-kill-house-excel/?key=${(g=t==null?void 0:t.userProfile)==null?void 0:g.key}&date1=${l}&date2=${s}`}];return e.jsx(E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:e.jsx(A,{display:"flex",justifyContent:"center",alignItems:"center",children:e.jsxs(C,{container:!0,direction:"column",xs:12,sm:12,md:10,lg:10,children:[e.jsx(P,{}),e.jsx(C,{container:!0,alignItems:"center",gap:a.SMALL,sx:{color:"#727272"},px:2,children:e.jsxs(C,{xs:12,container:!0,mt:1,alignItems:"center",spacing:1,mb:a.SMALL,children:[e.jsx(C,{children:e.jsx(x,{sx:{fontSize:"14px",color:"black"},children:"تاریخ گزارش:"})}),e.jsxs(C,{container:!0,direction:"row",mr:1,mt:{xs:2,md:0},mb:{xs:1,md:0},children:[e.jsx(R,{label:"از تاریخ",renderInput:u=>e.jsx(p,{...u,style:{width:"160px"},size:"small"}),value:l,onChange:u=>{S(v(u).format("YYYY-MM-DD"))}}),e.jsx(C,{mx:.5}),e.jsx(R,{label:"تا تاریخ",renderInput:u=>e.jsx(p,{...u,style:{width:"160px"},size:"small"}),value:s,onChange:u=>{D(v(u).format("YYYY-MM-DD"))}})]}),e.jsx(C,{children:e.jsx(p,{sx:{minWidth:"250px"},id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",value:$,onChange:u=>{M(u.target.value)}})})]})}),e.jsx(C,{container:!0,xs:12,rowSpacing:a.SMALL,justifyContent:"center",mb:2,px:1,children:(L=d==null?void 0:d.filter(u=>u==null?void 0:u.title.includes($)))==null?void 0:L.map((u,r)=>e.jsx(C,{item:!0,xs:6,sm:4,md:4,lg:2,px:1,children:e.jsx("a",{style:{outline:"none",color:"#727272"},href:u.isTicket?"#":u==null?void 0:u.link,rel:"noreferrer",onClick:j=>{u.isTicket?(j.preventDefault(),z(u.link)):(j.preventDefault(),T(u.link,u.isTicket))},children:e.jsx(E.div,{whileHover:{scale:1.05},whileTap:{scale:.9},children:e.jsxs(A,{p:a.MEDIUM,border:"1px solid #E6E6E6",borderRadius:a.SMALL,bgcolor:"#FCFCFC",display:"flex",flexDirection:"column",alignItems:"center",sx:{cursor:"pointer"},minHeight:"11rem",maxHeight:"11rem",children:[e.jsx(A,{sx:{width:60,minWidth:60,height:60,minHeight:60,borderRadius:"50%",backgroundColor:"#244CCC",display:"flex",justifyContent:"center",alignItems:"center",marginBottom:a.SMALL},children:u.icon||e.jsx(Y,{size:24,color:"#FFFFFF"})}),e.jsx(x,{variant:"body1",mt:a.SMALL,sx:{color:"#727272",fontWeight:{xs:500,md:600},fontSize:{xs:"12px",md:"16px"}},children:u==null?void 0:u.title}),e.jsx(x,{mt:a.SMALL,sx:{color:"#727272",fontSize:"10px"},children:u==null?void 0:u.description})]})})})},r))})]})})})};export{O as default}; diff --git a/build/assets/ProvinceRequests-hAb6-LPy.js b/build/assets/ProvinceRequests-hAb6-LPy.js new file mode 100644 index 0000000..d3f409e --- /dev/null +++ b/build/assets/ProvinceRequests-hAb6-LPy.js @@ -0,0 +1 @@ +import{j as u,aL as we,aM as Pe,T as H,aN as Oe,aO as I6,aP as z6,aQ as R6,aR as B6,aS as U6,aT as W6,ak as U,B as W,p as u0,I as xu,aJ as F0,d as Lu,i as e0,am as Me,ag as k0,av as T0,aw as N0,ax as Tu,aU as $e,aV as Y6,aW as Eu,aX as X0,aY as Ie,a9 as V6,aZ as ze,a_ as Re,a$ as Be,b0 as y0,b1 as Ue,b as K6,al as Hu,an as Q6,ao as We,ap as s0,aq as o0,b2 as g0,b3 as Nu,b4 as d0,ar as Ye}from"./mui-vendor-CkIVaoQP.js";import{G as o,S as w,R as w0,w as P0,x as O0,y as b6,z as Ju,B as M0,D as H6,E as $0,F as I0,k as Ve,H as z0,I as R0,O as wu,P as G6,J as S6,K as A0,j as J,A as su,u as ku,c as Iu,M as gu,m as X6,L as q,N as bu,h as V,C as Yu,Q as qu,T as J0,U as Ke,p as pu,v as ou,V as i0,W as yu,X as tu,Y as Qu,Z as _6,_ as Zu,r as n0,$ as v0,a0 as J6,b as $u,a1 as Qe,a2 as p0,a3 as He,a4 as C0,a5 as Z6,a6 as Ge,a7 as q6,a8 as Xe,a9 as c0,aa as Je,ab as Ze,ac as a0,ad as qe,ae as h0,af as me,n as Z0,o as q0,t as m0,ag as B0,ah as U0,ai as W0,aj as D6,ak as D0,al as Y0,am as V0,an as K0,ao as Q0,ap as H0,aq as L6,ar as m6,as as ue,at as ee,au as un,av as ne,aw as re,ax as te,ay as le,az as ae,aA as se,aB as oe,aC as en,aD as j0,aE as k6,aF as nn,aG as rn,aH as tn,aI as ln,aJ as an,aK as sn,aL as on,aM as T6,aN as cn,aO as Cn,aP as dn,aQ as hn,aR as An,aS as xn,aT as pn,aU as jn,aV as fn,aW as Fn,aX as yn,aY as gn}from"./index-CeyyVc1v.js";import{N as lu}from"./NavLink-D2GD_ItM.js";import{L as au}from"./LinkItem-DT6qswcs.js";import{V as ce,a as Wu}from"./index.esm-CjWvmHks.js";import{F as ie,a as Ce,b as de,c as he,d as Ae}from"./index.esm-BY9chGNa.js";import{M as xe,a as G0,b as pe}from"./index.esm-BcDC8KuM.js";import{L as Vu}from"./LineWithText-BpnpjRWf.js";import{u as m,f as Fu,a as Au}from"./redux-vendor-B7uoacJt.js";import{f as u6,r as c,u as e6,j as vn,b as x0}from"./react-vendor-CmFgShSM.js";import{A as E0}from"./AdvancedTable-BYmmBtmq.js";import{d as b0}from"./Plagiarism-BiXORbzo.js";import{u as je,g as S0}from"./useRequestFile-FPqBpZfN.js";import{A as En}from"./index-9Ymn_7Kv.js";import{d as fe,C as bn,p as Sn,P as _n}from"./ProvinceFreeSales-oCkrGhR8.js";import{A as Dn}from"./AvicultureArchivedRequests-Bul1i4cq.js";import{R as zu}from"./ResponsiveTable-w7hk7Uq8.js";import{R as Ku,a as mu}from"./index.esm-Bu7XMDZU.js";import{R as Ln,a as kn}from"./RequestsAwaitingInspections-C8DP5FQL.js";import{B as Tn}from"./BackButton-Crzr7NMa.js";import{h as Nn}from"./hour-limit-get-kill-request-HFzpgBg7.js";import{d as wn,P as Pn,a as On}from"./delete-debtor-killhouses-DJCuTTOS.js";import{u as Mn}from"./useGetAllocationInformation-DFB6N6mk.js";import{d as n6}from"./Delete-C5MyLelE.js";import{d as Fe}from"./Add--yVWBJhC.js";import{S as _0}from"./SimpleTable-DBAoNnCU.js";import{d as ye}from"./Tune-D4M2CAhp.js";import{d as ge}from"./Edit-CqBj1Y2L.js";import{d as $n,a as f0}from"./index-CIfb_iLp.js";import{N as ve}from"./NumberFormatCustom-DwWPj40N.js";import{P as In}from"./ProvinceSelectSlaughterForSlaughter-DoXgfxS6.js";import{E as zn,S as Rn,P as Bn,a as Un}from"./EnterAuthCodeDirectBuy-zD0YV5ZE.js";import{l as r6}from"./ChickenLogo-BK6_Z2uq.js";import{s as Wn,a as Yn}from"./slaughter-get-provinces-CSWL-EuK.js";import{C as Vn,a as Kn}from"./CityHatchingsArchiveOperations-DQ9mbEeF.js";import{C as Qn,a as Hn}from"./ChainBarManagement-BxgsJV2X.js";import{d as Gn}from"./AddCircleOutline-C8LXM-k8.js";import"./iconBase-BEJYyZsk.js";import"./LabelField-B6eRSoQP.js";import"./aviculture-get-hatching-data-DsjDNd82.js";import"./DialogAlert-BfXcr-Kr.js";import"./Done-Dp5awdte.js";import"./aviculture-get-unions-C1NoVg85.js";import"./CarPelak-BYFY8OXg.js";import"./isValidIndexWeight-C_ik-uYa.js";import"./Close-_jAEIgMD.js";import"./VetFarmSubmitClearanceCode-B4m3TtXY.js";import"./Pageview-TRcW_9jm.js";import"./ToggleOn-pBgb8alR.js";import"./ToggleOff-D4LkiR4X.js";import"./Check-CRb6laYC.js";import"./Sms-DasNClAG.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./VpnKey-Di_7HUWD.js";import"./Search-Dek2fED1.js";import"./DoneOutline-DQzOHpRS.js";import"./ThumbUpAlt-HKYD-o6a.js";import"./province-get-sell-for-freezing-status-ieuVFEgW.js";import"./ProvinceSettlementPdfKillRequest-ChEooZGT.js";import"./PictureAsPdf-oEJEta1d.js";import"./FileUploader-DT5gIVb3.js";import"./CloudUpload-BlIgB_r9.js";import"./CheckCircle-zgBvZQ-b.js";import"./Settings-BckUi175.js";const Xn=()=>{const{pathname:e}=u6(),t=m();return u.jsxs(o,{container:!0,gap:w.SMALL,p:w.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",style:{placeContent:"baseline"},children:[u.jsxs(o,{container:!0,direction:"column",style:{width:"100%"},children:[u.jsx(o,{children:u.jsx(Vu,{text:"مدیریت درخواست ها"})}),u.jsxs(o,{container:!0,justifyContent:"center",gap:w.SMALL,children:[u.jsx(lu,{to:w0,active:e===w0?"true":null,children:u.jsx(au,{icon:u.jsx(ce,{size:30,color:"#244CCC"}),title:"درخواست های کشتار",description:"درخواست های کشتار مرغدار در انتظار بررسی"})}),u.jsx(lu,{to:P0,active:e===P0?"true":null,children:u.jsx(au,{icon:u.jsx(xe,{size:30,color:"#244CCC"}),title:"اعلام نیاز خریداران",description:"درخواست های کشتار در انتظار بررسی"})}),u.jsx(lu,{to:O0,active:e===O0?"true":null,children:u.jsx(au,{icon:u.jsx(Wu,{size:30,color:"#244CCC"}),title:"تخصیصات",description:"مشاهده و تخصیص درخواست ها"})}),u.jsx(lu,{to:b6,active:e===b6?"true":null,children:u.jsx(au,{icon:u.jsx(ie,{size:30,color:"#244CCC"}),title:"تعرفه ها"})})]})]}),u.jsxs(o,{container:!0,direction:"column",style:{width:"100%"},children:[u.jsx(o,{children:u.jsx(Vu,{text:"ویژه"})}),u.jsxs(o,{container:!0,justifyContent:"center",gap:w.SMALL,children:[u.jsx(lu,{to:Ju,active:e===Ju?"true":null,children:u.jsx(au,{icon:u.jsx(G0,{size:30,color:"#244CCC"}),title:"خرید مستقیم"})}),u.jsx(lu,{to:M0,active:e===M0?"true":null,children:u.jsx(au,{icon:u.jsx(pe,{size:30,color:"#244CCC"}),title:"صادرات"})}),u.jsx(lu,{to:H6,children:u.jsx(au,{icon:u.jsx(Wu,{size:30,color:"#244CCC"}),title:"فروش به خارج استان"})}),u.jsx(lu,{to:$0,active:e===$0?"true":null,children:u.jsx(au,{icon:u.jsx(Ce,{size:30,color:"#244CCC"}),title:"زنجیره ها"})}),u.jsx(lu,{to:I0,active:e===I0?"true":null,children:u.jsx(au,{icon:u.jsx(Wu,{size:30,color:"#244CCC"}),title:"مدیریت تخصیصات"})})]})]}),u.jsx(o,{container:!0,gap:w.SMALL,p:w.SMALL,direction:"column",justifyContent:"center",style:{width:"100%"},children:u.jsxs(we,{style:{width:"100%"},children:[u.jsx(Pe,{expandIcon:u.jsx(Ve,{}),children:u.jsx(H,{variant:"body1",color:"error",children:"نظارت درخواست ها"})}),u.jsx(Oe,{children:u.jsxs(o,{container:!0,justifyContent:"center",gap:w.SMALL,mb:2,children:[u.jsx(lu,{to:z0,active:e===z0?"true":null,children:u.jsx(au,{icon:u.jsx(Wu,{size:30,color:"#244CCC"}),title:"تخصیصات خودکار"})}),u.jsx(lu,{to:R0,active:e===R0?"true":null,children:u.jsx(au,{icon:u.jsx(de,{color:"#244CCC",size:30}),title:"صدور نامه",description:"ارسال نامه سیستمی"})}),u.jsx(lu,{onClick:()=>t(wu({title:"اطلاعات گزارش",content:u.jsx(G6,{})})),children:u.jsx(au,{icon:u.jsx(he,{color:"#244CCC",size:30}),title:"گزارش روزانه",description:"گزارش روزانه"})}),u.jsx(lu,{to:S6,active:e===S6?"true":null,children:u.jsx(au,{icon:u.jsx(Ae,{size:30,color:"#244CCC"}),title:"تراکنش ها"})})]})})]})})]})},Jn=()=>{const[e,t]=c.useState(null),r=m(),x=Fu(f=>f.provinceSlice.provinceNewRequests);return c.useEffect(()=>{r(A0())},[]),c.useEffect(()=>{t(x)},[x]),e||[]},Zn=Au("PROVINCE_ACCEPT_REQUEST",async e=>{const{data:t,status:r}=await J.post("province_check_operator_request/",e);return{data:t,status:r}}),qn=Au("PROVINCE_REJECT_REQUEST",async e=>{const{data:t,status:r}=await J.post("province_check_operator_request/",e);return{data:t,status:r}}),t6=({id:e,file:t,item:r,updateTable:x})=>{var j;const f=je(e);t=t||((j=f==null?void 0:f.file)==null?void 0:j.process);const[p,,n,,l,,]=c.useContext(su),[g,F]=c.useState(!1);c.useEffect(()=>{(t==null?void 0:t.province)!==null&&F(!0)},[t]);const A=ku({initialValues:{rejectText:""},validationSchema:Iu({rejectText:gu().required("این فیلد اجباری است!").typeError("لطفا دلیل خود را بیان کنید.")})}),[S,d]=c.useState(!1),h=m();return u.jsx(u.Fragment,{children:!g&&u.jsxs(I6,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(z6,{children:[u.jsx(R6,{color:"secondary"}),u.jsx(B6,{})]}),u.jsxs(o,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(o,{container:!0,children:[u.jsx(o,{children:u.jsx(U6,{variant:"body1",fontWeight:"bold",color:"secondary",children:"انجام عملیات"})}),u.jsx(o,{children:u.jsx(W6,{color:"textSecondary",children:u.jsx(H,{variant:"body2",children:"در این مرحله درخواست را تایید یا رد کنید."})})})]}),u.jsx(o,{children:u.jsx(o,{xs:12,children:u.jsx(o,{container:!0,gap:w.SMALL,padding:w.SMALL,children:u.jsx(En,{children:S?u.jsx(X6.div,{animate:{x:-10,opacity:1},transition:{duration:.3},initial:{opacity:0},exit:{opacity:0},children:u.jsxs(o,{flexDirection:"column",container:!0,gap:w.SMALL,children:[u.jsx(o,{children:u.jsx(U,{multiline:!0,rows:4,fullWidth:!0,id:"rejectText",label:"پیام خود را وارد کنید",variant:"outlined",value:A.values.rejectText,error:A.touched.rejectText?!!A.errors.rejectText:null,onChange:A.handleChange,onBlur:A.handleBlur,helperText:A.touched.rejectText&&A.errors.rejectText?A.errors.rejectText:null})}),u.jsxs(o,{container:!0,gap:w.SMALL,children:[u.jsx(o,{children:u.jsx(W,{variant:"outlined",color:"secondary",onClick:()=>{d(!1)},children:"لغو"})}),u.jsx(o,{children:u.jsx(W,{disabled:!A.values.rejectText,variant:"outlined",onClick:()=>{h(q()),h(qn({message:A.values.rejectText,key:r==null?void 0:r.cityCheckRequest,state:"reject"})).then(b=>{b.error?p({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(x(),h(bu({right:!1,bottom:!1,content:null})),h(A0({selectedDate1:n,selectedDate2:l})),h(V()),p({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"رد اطلاعات و پیام به مرغدار"})})]})]})}):u.jsxs(o,{container:!0,gap:w.SMALL,xs:12,children:[u.jsx(W,{fullWidth:!0,variant:"outlined",color:"secondary",onClick:()=>{d(!0)},children:"رد اطلاعات و پیام به مرغدار"}),u.jsx(W,{fullWidth:!0,variant:"outlined",onClick:()=>{h(q()),h(Zn({key:r==null?void 0:r.cityCheckRequest,state:"accept"})).then(b=>{b.error?p({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(x(),h(A0({selectedDate1:n,selectedDate2:l})),h(bu({right:!1,bottom:!1,content:null})),h(wu({title:"عملیات با موفقیت انجام شد.",content:u.jsxs(o,{container:!0,direction:"column",gap:w.MEDIUM,alignItems:"center",justifyContent:"center",children:[u.jsx(o,{children:u.jsx(H,{color:"green",children:"پرونده به کارتابل (در انتظار تخصیص) انتقال پیدا کرد."})}),u.jsx(o,{children:u.jsx(W,{variant:"contained",color:"success",onClick:()=>{h(Yu())},children:"تایید"})})]})})),h(A0({selectedDate1:n,selectedDate2:l})),p({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),h(V()),x())})},children:"تایید و اختصاص به کشتارگاه"})]})})})})})]})]})})};t6.propTypes={file:u0.PropTypes.object};const mn=()=>{const e=e6(),t=m(),r=Jn(),[x,f]=c.useState([]);c.useEffect(()=>{const n=r==null?void 0:r.map((l,g)=>{var F,A,S,d,h,j,b,v,E,L,$,z,P,s,D,a,M,N,R,Y,K;return[g+1,(F=l==null?void 0:l.poultryRequest)==null?void 0:F.orderCode,qu(new Date((A=l==null?void 0:l.poultryRequest)==null?void 0:A.createDate),"yyyy/MM/dd"),qu(new Date((S=l==null?void 0:l.poultryRequest)==null?void 0:S.sendDate),"yyyy/MM/dd"),(j=(h=(d=l==null?void 0:l.poultryRequest)==null?void 0:d.process)==null?void 0:h.poultry)==null?void 0:j.poultryName,(E=(v=(b=l==null?void 0:l.poultryRequest)==null?void 0:b.process)==null?void 0:v.poultry)==null?void 0:E.poultryMobile,(z=($=(L=l==null?void 0:l.poultryRequest)==null?void 0:L.process)==null?void 0:$.poultry)==null?void 0:z.poultryCity,(D=(s=(P=l==null?void 0:l.poultryRequest)==null?void 0:P.process)==null?void 0:s.poultry)==null?void 0:D.poultryProvince,(N=(M=(a=l==null?void 0:l.poultryRequest)==null?void 0:a.process)==null?void 0:M.poultry)==null?void 0:N.age,(K=(Y=(R=l==null?void 0:l.poultryRequest)==null?void 0:R.process)==null?void 0:Y.poultry)==null?void 0:K.poultryQuantity,u.jsx(xu,{color:"primary",onClick:()=>{var y,C,i,k;return t(bu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(t6,{file:(y=l==null?void 0:l.poultryRequest)==null?void 0:y.process,id:(k=(i=(C=l.poultryRequest)==null?void 0:C.process)==null?void 0:i.poultry)==null?void 0:k.poultryRequestId}),title:"انجام عملیات استان"}))},children:u.jsx(fe,{})},g),u.jsx(xu,{"aria-label":"delete",color:"primary",onClick:()=>{var y,C,i;e(J0+((i=(C=(y=l==null?void 0:l.poultryRequest)==null?void 0:y.process)==null?void 0:C.poultry)==null?void 0:i.poultryRequestId))},children:u.jsx(b0,{})},g)]});f(n)},[r]);const[p]=c.useState(["ردیف","کد سفارش","تاریخ ثبت درخواست","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","استان","سن مرغ","تعداد","عملیات","مشاهده"]);return u.jsx(F0,{children:u.jsx(E0,{name:"درخواست های جدید در انتظار بررسی",columns:p,data:x})})},ur=()=>{const e=e6(),t=m(),{provinceRejectedRequests:r}=Fu(n=>n.provinceSlice),[x,f]=c.useState([]);c.useEffect(()=>{t(Ke())},[]),c.useEffect(()=>{const n=r==null?void 0:r.map((l,g)=>[g+1,l.orderCode,pu(l==null?void 0:l.createDate),pu(l==null?void 0:l.sendDate),l.fullname,l.mobile,l.city,l.province,l.poultryQuantity,u.jsx(xu,{"aria-label":"delete",color:"primary",onClick:()=>{e(J0+l.id)},children:u.jsx(b0,{})},g)]);f(n)},[r]);const[p]=c.useState(["ردیف","کد سفارش","تاریخ ثبت درخواست","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","استان","تعداد","مشاهده"]);return u.jsx(F0,{children:u.jsx(E0,{name:"درخواست های رد شده",columns:p,data:x})})},er=()=>{const[,,e,t,r,x]=c.useContext(su),f=m();c.useEffect(()=>{const D=ou(new Date).format("YYYY-MM-DD");t(D),x(D)},[]);const p=D=>{h(D.target.value)},[n,l]=c.useState([]),[g,F]=c.useState(0),[A,S]=c.useState(10),[d,h]=c.useState(""),[j,b]=c.useState(1),[v,E]=c.useState([]),L=async D=>{let a;f(q()),a=await J.get(`management_request/?search=filter&value=${d}&role=${tu()}&date1=${e}&date2=${r}&page=${D}&page_size=${A}`),f(V()),l(a.data.results),F(a.data.count)},$=D=>{L(D),b(D)},z=D=>{S(D),b(1)},P=()=>{L(j!==0?j:1)};c.useEffect(()=>{const D=n==null?void 0:n.map((a,M)=>{var N,R,Y,K,y,C,i,k,B,T,Q,nu,Z,eu,ju;return[j===1?M+1:M+A*(j-1)+1,a.stateProcess==="pending"?"در انتظار تایید شهرستان":"در انتظار تایید استان",a.orderCode,(R=(N=a==null?void 0:a.poultry)==null?void 0:N.user)==null?void 0:R.baseOrder,pu(a==null?void 0:a.createDate)+` (${(Y=a==null?void 0:a.registrar)==null?void 0:Y.fullname} - ${i0((K=a==null?void 0:a.registrar)==null?void 0:K.role)})`,pu(a==null?void 0:a.sendDate),a!=null&&a.freezing?"انجماد":a!=null&&a.export?"صادرات":"عادی",`${(C=(y=a==null?void 0:a.poultry)==null?void 0:y.user)==null?void 0:C.fullname} (${(k=(i=a==null?void 0:a.poultry)==null?void 0:i.user)==null?void 0:k.mobile})`,`${(B=a==null?void 0:a.poultry)==null?void 0:B.unitName}`,(T=a==null?void 0:a.poultry)==null?void 0:T.cityOperator,(Z=(nu=(Q=a==null?void 0:a.poultry)==null?void 0:Q.address)==null?void 0:nu.city)==null?void 0:Z.name,pu((eu=a==null?void 0:a.hatching)==null?void 0:eu.hatchingDate),(ju=a==null?void 0:a.hatching)==null?void 0:ju.age,a==null?void 0:a.IndexWeight,a==null?void 0:a.quantity.toLocaleString(),((a==null?void 0:a.quantity)*(a==null?void 0:a.IndexWeight)).toLocaleString(),u.jsx(xu,{color:"primary",onClick:()=>{var cu;return f(bu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:a.stateProcess==="pending"?u.jsx(bn,{file:a,id:a.id,updateTable:P}):u.jsx(t6,{item:a,file:(cu=a==null?void 0:a.poultryRequest)==null?void 0:cu.process,id:a.id,updateTable:P}),title:"انجام عملیات تایید/رد"}))},children:u.jsx(fe,{})},M)]});E(D)},[n]),c.useEffect(()=>{L(1)},[f,e,r,A]);const s=async D=>{D.preventDefault(),f(q());try{const a=await J.get(`management_request/?role=${tu()}&search=filter&value=${d}&date1=${e}&date2=${r}&page=1&page_size=${A}`);l(a.data.results),F(a.data.count),f(V())}catch(a){console.error("Error fetching data:",a)}};return u.jsxs(o,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(o,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(o,{children:u.jsx(yu,{label:"از تاریخ",id:"date",renderInput:D=>u.jsx(U,{style:{width:"160px"},...D,size:"small"}),value:e,onChange:D=>{t(ou(D).format("YYYY-MM-DD"))}})}),u.jsx(o,{children:u.jsx(yu,{label:"تا تاریخ",id:"date",renderInput:D=>u.jsx(U,{style:{width:"160px"},...D,size:"small"}),value:r,onChange:D=>{x(ou(D).format("YYYY-MM-DD"))}})}),u.jsx(o,{children:u.jsxs("form",{onSubmit:s,children:[u.jsx(U,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:p}),u.jsx(W,{type:"submit",onClick:s,endIcon:u.jsx(Ku,{}),children:"جستجو"})]})})]}),u.jsx(zu,{data:v,columns:["ردیف","وضعیت","کد سفارش","کدکاربری","تاریخ ثبت درخواست","نوع کشتار","تاریخ کشتار","مرغدار (تلفن)","فارم","تعاونی","شهر","تاریخ جوجه ریزی","سن مرغ","میانگین وزن (کیلوگرم)","تعداد","وزن بار (کیلوگرم)","عملیات"],handlePageChange:$,totalRows:g,page:j,perPage:A,handlePerRowsChange:z,title:"مدیریت درخواست ها"})]})},nr=()=>{var nu,Z,eu,ju,cu,iu;const e=Fu(O=>O.userSlice.authToken),{poultryRequestsTotalQuantity:t}=Fu(O=>O.citySlice),r=m(),[x,f]=c.useState(!1),[p,n]=c.useState(""),[l]=c.useContext(su),[g,F]=c.useState([]),[A,S]=c.useState(0),[d,h]=c.useState(10),[j,b]=c.useState(""),[v,E]=c.useState(1),[L,$]=c.useState([]),z=O=>{b(O.target.value)},P=async O=>{r(q());const _=await J.get(`Poultry_Request/?role=${tu()}&today&date1=${N}&date2=${Y}&search=filter&value=${j||""}&page=${O}&page_size=${d}`);r(V()),F(_.data.results),S(_.data.count)},s=O=>{P(O),E(O)},D=async O=>{O.preventDefault(),r(q());try{const _=await J.get(`Poultry_Request/?role=${tu()}&today&date1=${N}&date2=${Y}&search=filter&value=${j||""}`);F(_.data.results),S(_.data.count),r(V())}catch(_){console.error("Error fetching data:",_)}},[a,M]=c.useState(ou(new Date).format("YYYY-MM-DD")),[,,N,R,Y,K]=c.useContext(su);c.useEffect(()=>{const O=ou(new Date).format("YYYY-MM-DD");R(O),K(O)},[]);const y=O=>{h(O),E(1)};c.useEffect(()=>{r(Qu(a))},[a]),c.useEffect(()=>{r(Nn()).then(O=>{var _,Cu,vu,Su;f((Cu=(_=O.payload.data)==null?void 0:_[0])==null?void 0:Cu.active),n((Su=(vu=O.payload.data)==null?void 0:vu[0])==null?void 0:Su.hour)}),r(wn())},[]),c.useEffect(()=>{x&&p&&r(_6({hour:p,active:x})),!x&&p&&(n(null),r(_6({hour:0,active:x})))},[p,x]);const i="/"+window.location.pathname.split("/")[1]+"/file/",k=O=>{let _="";return O!=null&&O.market?_="پنل معاملات":O!=null&&O.directBuying?_="خرید مستقیم":O!=null&&O.union?_="خرید خارج از استان":_="اتحادیه",_};c.useEffect(()=>{const O=g==null?void 0:g.map((_,Cu)=>{var vu,Su,Pu,Ou,I,ru,du,hu,fu,_u,Du,Mu,Ru,Bu,Uu,r0,t0,l0;return[v===1?Cu+1:Cu+d*(v-1)+1,u.jsx(Pn,{fileUrl:i,item:_,updateTable:B},Cu),_.orderCode,Q(_),_!=null&&_.freezing?"انجماد":_!=null&&_.export?"صادرات":"عادی",k(_),Zu(_==null?void 0:_.createDate)+` (${(vu=_==null?void 0:_.registrar)==null?void 0:vu.fullname} - ${i0((Su=_==null?void 0:_.registrar)==null?void 0:Su.role)})`,pu(_==null?void 0:_.sendDate),`${(Pu=_==null?void 0:_.poultry)==null?void 0:Pu.unitName} (${(I=(Ou=_==null?void 0:_.poultry)==null?void 0:Ou.user)==null?void 0:I.mobile})`,(ru=_==null?void 0:_.killHouseList)!=null&&ru.length?_==null?void 0:_.killHouseList.join(" - "):"ندارد",`${(fu=(hu=(du=_==null?void 0:_.poultry)==null?void 0:du.address)==null?void 0:hu.city)==null?void 0:fu.name}/${(_u=_==null?void 0:_.poultry)!=null&&_u.cityOperator?(Du=_==null?void 0:_.poultry)==null?void 0:Du.cityOperator:"بدون تعاونی"}`,(Mu=_==null?void 0:_.hatching)==null?void 0:Mu.age,_==null?void 0:_.IndexWeight,(Bu=(Ru=_==null?void 0:_.hatching)==null?void 0:Ru.totalWeight)==null?void 0:Bu.toLocaleString(),_==null?void 0:_.firstQuantity.toLocaleString(),(_==null?void 0:_.amount.toLocaleString())+" ﷼",(r0=(Uu=_==null?void 0:_.hatching)==null?void 0:Uu.leftOver)==null?void 0:r0.toLocaleString(),(t0=_.quantity)==null?void 0:t0.toLocaleString(),(_.quantity-(_==null?void 0:_.remainQuantity)).toLocaleString(),(l0=_==null?void 0:_.remainQuantity)==null?void 0:l0.toLocaleString(),u.jsx(H,{variant:"body2",sx:{color:_.hatching.fileState==="confirmation_code_pending"?"red":"black"},children:_.hatching.fileState==="province_state_pending"?"در انتظار تایید":_.hatching.fileState==="allocated_pending"?"آماده تخصیص":_.hatching.fileState==="confirmation_code_pending"?"در انتظار ورود کد احراز":"تخصیص داده شده"},Cu)]});$(O)},[g]),c.useEffect(()=>{P(1)},[N,Y,d]);const B=()=>{P(1)},T=u.jsx(o,{container:!0,alignItems:"center",mb:w.SMALL,gap:w.SMALL,justifyContent:"center",children:u.jsx("form",{onSubmit:D,children:u.jsxs(o,{container:!0,alignItems:"center",gap:w.SMALL,children:[u.jsx(U,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:z}),u.jsx(W,{type:"submit",onClick:D,endIcon:u.jsx(Ku,{}),children:"جستجو"}),u.jsx(o,{children:u.jsx(yu,{label:"از تاریخ",id:"date",renderInput:O=>u.jsx(U,{style:{width:"160px"},...O}),value:N,onChange:O=>{R(ou(O).format("YYYY-MM-DD"))}})}),u.jsx(o,{children:u.jsx(yu,{label:"تا تاریخ",id:"date",renderInput:O=>u.jsx(U,{style:{width:"160px"},...O}),value:Y,onChange:O=>{K(ou(O).format("YYYY-MM-DD"))}})}),u.jsx(Lu,{title:"خروجی اکسل",children:u.jsx(W,{color:"success",onClick:()=>{l({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const O=`${J.defaults.baseURL}poultry_kill_request_excel/?start=${N}&end=${Y}&role=${tu()}&token=${e}`;window.location.href=O},children:u.jsx(mu,{size:32})})})]})})}),Q=O=>{let _="";return O!=null&&O.freeSaleInProvince?_="آزاد":_="دولتی",_};return u.jsx(o,{container:!0,children:u.jsx(o,{container:!0,alignItems:"center",justifyContent:"space-between",gap:4,xs:12,children:u.jsxs(o,{container:!0,children:[u.jsx(o,{my:w.SMALL,children:u.jsxs(o,{mb:2,container:!0,alignItems:"center",gap:w.SMALL,children:[u.jsx(o,{children:u.jsx(H,{children:"اطلاعات کشتار"})}),u.jsx(o,{children:u.jsx(yu,{label:"تاریخ",id:"date",renderInput:O=>u.jsx(U,{style:{width:"160px"},...O}),value:a,onChange:O=>{M(ou(O).format("YYYY-MM-DD"))}})})]})}),u.jsx(o,{xs:12,mb:2,isDashboard:!0,children:u.jsx(zu,{isDashboard:!0,noPagination:!0,title:"خلاصه اطلاعات",columns:["درخواست های کشتار صادر شده","درخواست های کشتار تایید شده","درخواست های رد شده","درخواست خریداران","درخواست های خرید مستقیم","مانده در سالن (جوجه ریزی 45 تا 65 روز)"],data:[[t!=null&&t.firstQuantity?((nu=t==null?void 0:t.firstQuantity)==null?void 0:nu.toLocaleString())+" قطعه":0,t!=null&&t.acceptedQuantity?((Z=t==null?void 0:t.acceptedQuantity)==null?void 0:Z.toLocaleString())+" قطعه":0,t!=null&&t.rejectedQuantity?((eu=t==null?void 0:t.rejectedQuantity)==null?void 0:eu.toLocaleString())+" قطعه":0,t!=null&&t.killRequestsQuantity?((ju=t==null?void 0:t.killRequestsQuantity)==null?void 0:ju.toLocaleString())+" قطعه":0,t!=null&&t.directBuyingQuantity?((cu=t==null?void 0:t.directBuyingQuantity)==null?void 0:cu.toLocaleString())+" قطعه":0,t!=null&&t.ageUp45?((iu=t==null?void 0:t.ageUp45)==null?void 0:iu.toLocaleString())+" قطعه":0]]})}),u.jsxs(o,{mt:2,children:[T,u.jsx(zu,{data:L,columns:["ردیف","عملیات","کدسفارش","فروش","کشتار","درخواست","تاریخ ثبت درخواست","تاریخ کشتار","مرغدار","کشتارگاه های پیشنهادی","شهر/تعاونی","سن مرغ","میانگین وزنی","وزن تقریبی","حجم درخواست کشتار","قیمت مرغدار","مانده در سالن","تایید شده","تخصیص داده شده","مانده قابل تخصیص","وضعیت"],handlePageChange:s,totalRows:A,page:v,perPage:d,handlePerRowsChange:y,title:"اطلاعات کشتار"})]})]})})})},rr=Au("PROVINCE_CLOSE_ALLOCATION_SERVICE",async(e,{dispatch:t})=>{try{t(q());const{data:r,status:x}=await J.put("Poultry_Request/0/",e);return t(V()),{data:r,status:x}}catch(r){return t(V()),{error:r.response.data.result}}});var l6={},tr=e0;Object.defineProperty(l6,"__esModule",{value:!0});var Ee=l6.default=void 0,lr=tr(n0()),ar=u;Ee=l6.default=(0,lr.default)((0,ar.jsx)("path",{d:"m13.7826 15.1719 2.1213-2.1213 5.9963 5.9962-2.1213 2.1213zM17.5 10c1.93 0 3.5-1.57 3.5-3.5 0-.58-.16-1.12-.41-1.6l-2.7 2.7-1.49-1.49 2.7-2.7c-.48-.25-1.02-.41-1.6-.41C15.57 3 14 4.57 14 6.5c0 .41.08.8.21 1.16l-1.85 1.85-1.78-1.78.71-.71-1.41-1.41L12 3.49c-1.17-1.17-3.07-1.17-4.24 0L4.22 7.03l1.41 1.41H2.81l-.71.71 3.54 3.54.71-.71V9.15l1.41 1.41.71-.71 1.78 1.78-7.41 7.41 2.12 2.12L16.34 9.79c.36.13.75.21 1.16.21"}),"Construction");var a6={},sr=e0;Object.defineProperty(a6,"__esModule",{value:!0});var be=a6.default=void 0,or=sr(n0()),N6=u;be=a6.default=(0,or.default)([(0,N6.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),(0,N6.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime");const cr=Au("PROVINCE_REQUEST_AUCTION",async e=>{const{data:t,status:r}=await J.post("province_request_auction/",e);return{data:t,status:r}}),Se=({poultryRequestKey:e})=>{const[t,r]=c.useState(),{id:x}=vn(),[f]=v0(),{avicultureChickenPrice:p}=Fu(j=>j.avicultureSlice),[n]=c.useContext(su),l=m();c.useEffect(()=>{l(J6())},[]);const[g,F]=c.useState([{id:0,value:"",hour:2}]),A=()=>{F(j=>[...j,{id:j.length,value:"",hour:1}])},S=j=>{let b=g.length-1;if(b!==0){let v=g.filter((E,L)=>L{const[b,v]=j.target.name.split("-");b==="price"?F(E=>{const L=E;return L[v].value=j.target.value,L}):b==="hour"&&F(E=>{const L=E;return L[v].hour=Number(j.target.value),L})};c.useEffect(()=>{p&&r(p.key)},[p]);const h=ku({initialValues:{noChicken:"",price1:"",price2:"",price3:"",slaughterDate:ou(Date()).format("YYYY-MM-DD hh:mm:ss"),period1:"4",period2:"4",period3:"4",weight:""},validationSchema:Iu({price1:$u().typeError("لطفا عدد وارد کنید!").min(p==null?void 0:p.floorPrice,"قیمت وارد شده از کف قیمت امروز کمتر است").max(p==null?void 0:p.ceilingPrice,"قیمت وارد شده از سقف قیمت امروز بیشتر است"),price2:$u().typeError("لطفا عدد وارد کنید!").min(p==null?void 0:p.floorPrice,"قیمت وارد شده از کف قیمت امروز کمتر است").max(p==null?void 0:p.ceilingPrice,"قیمت وارد شده از سقف قیمت امروز بیشتر است"),price3:$u().typeError("لطفا عدد وارد کنید!").min(p==null?void 0:p.floorPrice,"قیمت وارد شده از کف قیمت امروز کمتر است").max(p==null?void 0:p.ceilingPrice,"قیمت وارد شده از سقف قیمت امروز بیشتر است"),weight:$u().required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!")})});return u.jsxs(o,{container:!0,gap:w.SMALL,children:[u.jsxs(o,{container:!0,gap:w.SMALL,alignItems:"center",children:[u.jsx(H,{color:j=>j.palette.grey.A700,variant:"caption",children:"کف قیمت امروز:"}),u.jsxs(H,{color:"secondary",variant:"button",children:[p!=null&&p.floorPrice?p==null?void 0:p.floorPrice.toLocaleString():"نامشخص"," "," ","ریال"]})]}),u.jsxs(o,{container:!0,gap:w.SMALL,alignItems:"center",children:[u.jsx(H,{color:j=>j.palette.grey.A700,variant:"caption",children:"سقف قیمت امروز:"}),u.jsxs(H,{color:"secondary",variant:"button",children:[p!=null&&p.ceilingPrice?p==null?void 0:p.ceilingPrice.toLocaleString():"نامشخص"," "," ","ریال"]})]}),u.jsx(Me,{style:{width:"100%"}}),u.jsx(o,{container:!0,direction:"column",children:u.jsx(o,{container:!0,direction:"column",gap:w.SMALL,alignItems:"start",children:u.jsxs(o,{container:!0,gap:w.MEDIUM,alignItems:"center",children:[g.map((j,b)=>u.jsxs(o,{gap:w.SMALL,container:!0,children:[u.jsxs(H,{variant:"body2",fontWeight:"bold",children:["پیشنهاد ",b+1]}),u.jsx(U,{error:!1,fullWidth:!0,label:"قیمت پیشنهادی",variant:"outlined",onChange:d,name:"price-"+b}),u.jsxs(k0,{fullWidth:!0,children:[u.jsx(T0,{id:"demo-simple-select-label",children:"بازه زمانی (ساعت)"}),u.jsxs(N0,{labelId:"demo-simple-select-label",label:"بازه زمانی (ساعت)",name:"hour-"+b,onChange:d,children:[u.jsx(Tu,{value:"1",children:"1"}),u.jsx(Tu,{value:"2",children:"2"}),u.jsx(Tu,{value:"3",children:"3"}),u.jsx(Tu,{value:"4",children:"4"}),u.jsx(Tu,{value:"5",children:"5"}),u.jsx(Tu,{value:"6",children:"6"}),u.jsx(Tu,{value:"7",children:"7"}),u.jsx(Tu,{value:"8",children:"8"}),u.jsx(Tu,{value:"9",children:"9"}),u.jsx(Tu,{value:"10",children:"10"})]}),u.jsx($e,{children:h.touched.period1&&h.errors.period1?h.errors.period1:null})]})]},b)),u.jsxs(o,{container:!0,direction:"column",children:[u.jsx(xu,{"aria-label":"delete",color:"secondary",children:u.jsx(n6,{onClick:S})}),u.jsx(xu,{"aria-label":"delete",color:"success",children:u.jsx(Fe,{onClick:A})})]})]})})}),u.jsx(W,{fullWidth:!0,disabled:!h.isValid,onClick:()=>{l(q()),l(cr({poultry_request_key:e,auction_list:g.map((j,b)=>({pricing_key:t,fee:j.value,hour:j.hour}))})).then(j=>{l(V()),j.error?n({vertical:"top",horizontal:"center",severity:"error",msg:"مشکلی پیش آمده است!"}):(l(Qe()),S0(f,x,l),n({vertical:"top",horizontal:"center",severity:"success",msg:"با موفقیت انجام شد!"}),l(bu({right:!1,bottom:!1,content:null})))})},size:"large",variant:"contained",children:"ثبت درخواست"})]})};Se.propTypes={poultryRequestKey:u0.PropTypes.any};var s6={},ir=e0;Object.defineProperty(s6,"__esModule",{value:!0});var _e=s6.default=void 0,Cr=ir(n0()),dr=u;_e=s6.default=(0,Cr.default)((0,dr.jsx)("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4h-8.1c-.71 0-1.36.37-1.72.97z"}),"ThumbDownAlt");const hr=Au("PROVINCE_REMOVE_ALLOCATION",async(e,{dispatch:t})=>{t(q());const{data:r,status:x}=await J.delete("province_kill_request/0/",{params:e});return t(V()),{data:r,status:x}}),Ar=Au("PROVINCE_EDIT_KILL_CAPACITY_SERVICE",async(e,{dispatch:t})=>{try{t(q());const{data:r,status:x}=await J.put("kill_request/0/",e);return t(V()),{data:r,status:x}}catch(r){return t(V()),{error:r.response.data.result}}}),xr=({killRequestKey:e,poultryRequestKey:t,killCapacity:r,updateTable:x})=>{const f=m(),[p]=c.useContext(su),n=ku({initialValues:{number:r},onSubmit:l=>{f(Ar({kill_request_key:e,quantity:l.number})).then(g=>{g.payload.error?p({vertical:"top",horizontal:"center",msg:g.payload.error,severity:"error"}):(f(p0(t)),f(Yu()),p({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),x())})},validate:l=>{const g={};return l.number?isNaN(parseInt(l.number))&&(g.number="باید عدد وارد شود."):g.number="این فیلد اجباری است",g}});return u.jsx("form",{onSubmit:n.handleSubmit,children:u.jsxs(o,{container:!0,gap:w.SMALL,children:[u.jsx(U,{fullWidth:!0,variant:"outlined",label:"ظرفیت کل",name:"number",onChange:n.handleChange,onBlur:n.handleBlur,value:n.values.number,error:n.touched.number&&!!n.errors.number,helperText:n.touched.number&&n.errors.number}),u.jsx(W,{fullWidth:!0,variant:"contained",type:"submit",children:"ثبت"})]})})};var o6={},pr=e0;Object.defineProperty(o6,"__esModule",{value:!0});var De=o6.default=void 0,jr=pr(n0()),fr=u;De=o6.default=(0,jr.default)((0,fr.jsx)("path",{d:"m23 12-2.44-2.79.34-3.69-3.61-.82-1.89-3.2L12 2.96 8.6 1.5 6.71 4.69 3.1 5.5l.34 3.7L1 12l2.44 2.79-.34 3.7 3.61.82L8.6 22.5l3.4-1.47 3.4 1.46 1.89-3.19 3.61-.82-.34-3.69zm-12.91 4.72-3.8-3.81 1.48-1.48 2.32 2.33 5.85-5.87 1.48 1.48z"}),"Verified");const Fr=Iu().shape({quantity:$u().required("تعداد اجباری است.").positive("تعداد باید بالاتر از 0 باشد.").integer("تعداد باید عدد باشد.")});function yr({slaughterHouseReq:e,provinceCheckRequestKey:t,poultryRequestId:r,poultryRequestKey:x,handleAllEntredQauntity:f,allEntredQauntity:p,name:n,file:l,avgLast4KillhousesWeight:g,defaultValueForAllocate:F,updateTable:A}){var a,M,N,R,Y,K,y,C,i,k,B,T,Q,nu;const[S,,d]=c.useContext(su),[h]=v0(),j=m(),[b,v]=c.useState(!1),E=Z=>{v(Z.target.checked)},L=ku({initialValues:{quantity:e.remainQuantity},validationSchema:Fr,onSubmit:Z=>{j(q()),j(He({kill_request_key:e.key,province_check_request_key:t,quantity:Z.quantity,payment_type:"نقدی"})).then(eu=>{j(V()),eu.payload.error?S({vertical:"top",horizontal:"center",msg:eu.payload.error,severity:"error"}):(v(!1),S0(h,r,j),j(C0(d)),j(p0({key:x})),j(Z6({key:x})),S({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),A())})}});c.useEffect(()=>{L.validateForm()},[]),c.useEffect(()=>{const Z=Number(F)<0?0:Number(F);L.setFieldValue("quantity",Z)},[F]),c.useEffect(()=>{if(b){const Z=Number(L.values.quantity)<0?0:Number(L.values.quantity);f({...p,[n]:Z})}else f({...p,[n]:0})},[L.values.quantity,b]);const{poultryRequestIndexWeight:$}=Fu(Z=>Z.fileSlice),z=$==null?void 0:$.ave,P=(a=l==null?void 0:l.poultry)==null?void 0:a.IndexWeight;P>z&&e.firstAverageWeightg;const s=b&&L.isValid&&F>0,D=(M=e==null?void 0:e.killHouse)!=null&&M.killer?"کشتارکن":"کشتارگاه";return u.jsxs(Y6,{children:[u.jsx(Eu,{style:{alignItems:"center",textAlign:"center"},children:u.jsxs(o,{container:!0,direction:"row",flexWrap:"nowrap",alignItems:"center",children:[u.jsx(X0,{checked:b,onChange:E},(N=e==null?void 0:e.killHouse)==null?void 0:N.name),D+" "+((R=e==null?void 0:e.killHouse)==null?void 0:R.name),(e==null?void 0:e.priority)&&u.jsx(Lu,{title:"پیشنهادی مرغدار",placement:"left-start",children:u.jsx(De,{color:"success"})})]})}),u.jsxs(Eu,{style:{alignItems:"center",textAlign:"center"},children:[(y=(K=(Y=e==null?void 0:e.killHouse)==null?void 0:Y.killHouseOperator)==null?void 0:K.user)==null?void 0:y.fullname," (",(k=(i=(C=e==null?void 0:e.killHouse)==null?void 0:C.killHouseOperator)==null?void 0:i.user)==null?void 0:k.mobile,")"]}),u.jsx(Eu,{style:{alignItems:"center",textAlign:"center"},children:u.jsxs(Gu,{checked:b,children:[e.firstAverageWeight," کیلوگرم"]},"vv")}),u.jsx(Eu,{style:{alignItems:"center",textAlign:"center"},children:u.jsxs(Gu,{checked:b,children:[e==null?void 0:e.killCapacity,u.jsx(W,{"aria-label":"delete",color:"primary",onClick:()=>{j(wu({title:"اضافه کردن به درخواست کشتارگاه",content:u.jsx(xr,{poultryRequestKey:x,killRequestKey:e==null?void 0:e.key,killCapacity:e.killCapacity,updateTable:A})}))},children:"ویرایش"})]},"vv")}),u.jsx(Eu,{style:{alignItems:"center",textAlign:"center"},children:u.jsx(Gu,{checked:b,children:(B=e==null?void 0:e.remainQuantity)==null?void 0:B.toLocaleString()},"vv")}),u.jsx(Eu,{style:{alignItems:"center",textAlign:"center"},children:u.jsx(Gu,{checked:b,children:(T=e==null?void 0:e.numberOfAllocated)==null?void 0:T.toLocaleString()},"vv")}),u.jsx(Eu,{style:{alignItems:"center",textAlign:"center"},children:u.jsx(Gu,{checked:b,children:u.jsx(o,{children:u.jsx(U,{disabled:!b,label:"حجم",type:"number",style:{width:"80%"},inputProps:{min:0,step:1},fullWidth:!0,id:"quantity",value:L.values.quantity,onChange:L.handleChange,error:L.touched.quantity&&!!L.errors.quantity,helperText:L.touched.quantity&&L.errors.quantity})},(Q=e==null?void 0:e.killHouse)==null?void 0:Q.name)},"vv")}),u.jsx(Eu,{style:{alignItems:"center",textAlign:"center"},children:u.jsx(Gu,{checked:b,children:u.jsx(W,{variant:"contained",type:"submit",color:"primary",disabled:!s,onClick:L.handleSubmit,children:"تخصیص"},(nu=e==null?void 0:e.killHouse)==null?void 0:nu.name)},"vv")})]})}const Gu=({children:e,checked:t})=>u.jsx(o,{style:{opacity:t?1:.5},children:e}),gr=({children:e})=>u.jsx(Ie,{component:V6,sx:{maxHeight:"70vh",overflow:"auto"},children:u.jsxs(ze,{stickyHeader:!0,children:[u.jsx(Re,{children:u.jsxs(Y6,{children:[u.jsx(Eu,{children:"خریدار"}),u.jsx(Eu,{children:"اطلاعات خریدار"}),u.jsx(Eu,{children:"میانگین وزن 4 کشتار قبلی"}),u.jsx(Eu,{children:"کل سهمیه خریدار"}),u.jsx(Eu,{children:"مانده از سهمیه"}),u.jsx(Eu,{children:"تعداد تخصیص به کل سفارشات"}),u.jsx(Eu,{children:"قابل تخصیص"}),u.jsx(Eu,{children:"اقدام"})]})}),u.jsx(Be,{children:e})]})}),vr=Au("PROVINCE_EDIT_POULTRY_REQUEST_SERVICE",async(e,{dispatch:t})=>{try{t(q());const{data:r,status:x}=await J.put("Poultry_Request/0/",e);return t(V()),{data:r,status:x}}catch(r){return t(V()),{error:r.response.data.result}}}),Er=({quantity:e,poultryRequestKey:t})=>{const[r]=c.useContext(su),[x]=v0(),f=m(),p=ku({initialValues:{numberField:e},onSubmit:n=>{f(vr({quantity:n.numberField,key:t})).then(l=>{l.payload.error?r({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(S0(x,t,f),f(C0()),f(Yu()),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},validate:n=>{const l={};return n.numberField?/^\d+$/.test(n.numberField)||(l.numberField="Only numbers are allowed"):l.numberField="Field cannot be empty",l}});return u.jsx("form",{onSubmit:p.handleSubmit,children:u.jsxs(o,{container:!0,gap:w.TINY,children:[u.jsx(U,{fullWidth:!0,id:"numberField",label:"حداقل تعداد",variant:"outlined",name:"numberField",value:p.values.numberField,onChange:p.handleChange,error:p.touched.numberField&&!!p.errors.numberField,helperText:p.touched.numberField&&p.errors.numberField}),u.jsx(W,{type:"submit",fullWidth:!0,variant:"contained",children:"ثبت"})]})})},br=({allocated:e})=>{const[t,r]=c.useState([]);return c.useEffect(()=>{const x=e==null?void 0:e.map((f,p)=>{var l;let n;return f.provinceKillRequestState==="accepted"?n="تایید شده":f.provinceKillRequestState==="pending"?n="در انتظار تایید و تخصیص خودرو توسط کشتارگاه می باشد.":f.provinceKillRequestState==="rejected"&&(n="درخواست توسط کشتارگاه رد شده است!"),[`${f.killHouseName} (${f.killHouseUserName})`,qu(new Date(f.date),"yyyy/MM/dd"),(l=f.mainQuantity)==null?void 0:l.toLocaleString(),f.automaticState?"تخصیص خودکار":"تخصیص دستی",n]});r(x)},[]),u.jsx(_0,{columns:["خریدار","تاریخ کشتار","تعداد","نوع تخصیص","وضعیت"],data:t})},Le=({id:e,orginalQuantity:t,item:r,getItemFreeSaleInProvince:x,updateTable:f})=>{var T,Q,nu,Z,eu,ju,cu,iu,O,_,Cu,vu,Su,Pu,Ou;const p=je(e),n=(T=p==null?void 0:p.file)==null?void 0:T.process,[l,,g]=c.useContext(su),F=(Q=n==null?void 0:n.poultry)==null?void 0:Q.poultryRemainQuantity;let{slaughterHousesRequest:A}=Fu(I=>I.fileSlice);const[,S]=c.useState(),[,d]=c.useState(),[h,j]=c.useState(F);c.useEffect(()=>{j(F)},[F,n]);const[b,v]=c.useState(null),E=I=>{v(I)};c.useEffect(()=>{if(b!==null){const I=(du,hu)=>du+hu,ru=Object.values(b).reduce(I,0);j(F-ru)}},[b]),c.useEffect(()=>{var I;D(Ge()),D(p0((I=n==null?void 0:n.poultry)==null?void 0:I.poultryRequestKey))},[n]);const[L]=c.useState("allocate"),[$]=c.useState(),z=(I,ru)=>I+ru,P=Array.isArray(A)?((nu=A==null?void 0:A.map(I=>I.firstAverageWeight))==null?void 0:nu.reduce(z,0))/(A==null?void 0:A.length):"",s=Mn((Z=n==null?void 0:n.poultry)==null?void 0:Z.poultryRequestKey),D=m(),[a]=v0();c.useEffect(()=>{D(J6())},[]);const M=ku({initialValues:{quantity:"",slaughterHouse:"",paymentType:"cash"},validationSchema:Iu({quantity:$u().test("testlimit","تعداد باید کمتر یا مساوی ظرفیت کشتارگاه و مانده درخواست باشد",(I,ru)=>ru.originalValue&&ru.originalValue<=s.quantity&&ru.originalValue<=$&&ru.originalValue>0).required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),slaughterHouse:gu().required("این فیلد اجباری است!"),paymentType:gu().required("این فیلد اجباری است!")})});c.useEffect(()=>{M.validateForm()},[]),c.useEffect(()=>{M.values.slaughterHouse||(d(null),S(null))},[M.values.slaughterHouse]);const N=(eu=n==null?void 0:n.poultry)==null?void 0:eu.IndexWeight;let R;const{poultryRequestIndexWeight:Y}=Fu(I=>I.fileSlice),K=Y==null?void 0:Y.ave;N>K?R="high":Nru.firstAverageWeight&&((Du=(_u=I.killHouse.systemAddress)==null?void 0:_u.city)==null?void 0:Du.name)===((Mu=n==null?void 0:n.poultry)==null?void 0:Mu.poultryCity)?-1:0}),C=(ju=s==null?void 0:s.provinceAssignments)!=null&&ju.length?(cu=s==null?void 0:s.provinceAssignments)==null?void 0:cu.reduce((I,ru)=>ru.provinceKillRequestState!=="rejected"?I+ru.mainQuantity:I,0):0,i=t-C,[k,B]=c.useState("");return u.jsxs(I6,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(z6,{children:[u.jsx(R6,{color:"secondary"}),u.jsx(B6,{})]}),u.jsxs(o,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(o,{container:!0,children:[u.jsx(o,{children:u.jsx(U6,{variant:"body1",fontWeight:"bold",color:"secondary",children:"انجام عملیات"})}),u.jsx(o,{children:u.jsx(W6,{color:"textSecondary",children:u.jsxs(o,{container:!0,gap:w.LARGE,alignItems:"center",children:[u.jsxs(H,{variant:"body1",color:h<0?"red":"black",children:["تعداد اولیه درخواست کشتار: ",t==null?void 0:t.toLocaleString()," ","قطعه",u.jsx(W,{"aria-label":"delete",color:"primary",onClick:()=>{D(wu({title:"ویرایش تعداد اولیه درخواست کشتار",content:u.jsx(Er,{quantity:C,poultryRequestKey:r.poultryRequest.key})}))},children:"ویرایش"})]}),u.jsxs(H,{variant:"body1",color:h<0?"red":"black",children:["تخصیص داده شده: ‌",C==null?void 0:C.toLocaleString()," قطعه",u.jsx(W,{onClick:()=>{D(wu({title:"تخصیصات انجام شده",content:u.jsx(br,{allocated:s==null?void 0:s.provinceAssignments})}))},children:"مشاهده"})]}),u.jsxs(H,{variant:"body1",color:"green",children:["تعداد قابل تخصیص:‌ ",h==null?void 0:h.toLocaleString()," قطعه"]}),u.jsxs(H,{variant:"body1",color:"primary",children:["مرغدار:‌"," ",`${(O=(iu=r==null?void 0:r.poultryRequest)==null?void 0:iu.poultry)==null?void 0:O.unitName} (${(vu=(Cu=(_=r==null?void 0:r.poultryRequest)==null?void 0:_.poultry)==null?void 0:Cu.userprofile)==null?void 0:vu.mobile})`]}),u.jsxs(H,{variant:"body1",color:"primary",children:["نوع فروش:‌ ",x(r)]})]})})})]}),L==="allocate"&&u.jsxs(o,{container:!0,direction:"column",width:"100%",alignItems:"start",children:[u.jsx(o,{container:!0,direction:"column",gap:w.TINY,mt:w.SMALL,children:u.jsxs(o,{container:!0,xs:12,gap:2,children:[u.jsx(U,{label:"جستجو بر اساس خریدار",value:k,onChange:I=>B(I.target.value)}),u.jsx(gr,{children:y==null?void 0:y.filter(I=>{var hu,fu;return(((hu=I==null?void 0:I.killHouse)!=null&&hu.killer?"کشتارکن":"کشتارگاه")+" "+((fu=I==null?void 0:I.killHouse)==null?void 0:fu.name)).includes(k)}).map((I,ru)=>{var du,hu,fu;return u.jsx(yr,{name:ru,slaughterHouseReq:I,avgLast4KillhousesWeight:P,provinceCheckRequestKey:(du=n==null?void 0:n.province)==null?void 0:du.provinceCheckRequestKey,poultryRequestKey:(hu=n==null?void 0:n.poultry)==null?void 0:hu.poultryRequestKey,poultryRequestId:(fu=n==null?void 0:n.poultry)==null?void 0:fu.poultryRequestId,file:n,handleAllEntredQauntity:E,allEntredQauntity:b,defaultValueForAllocate:i,updateTable:f},I==null?void 0:I.name)})})]})}),u.jsx(o,{textAlign:"start",my:w.SMALL,children:u.jsx(H,{fontWeight:"bold",variant:"body1",children:"تخصیص های انجام شده"})}),!((Su=s==null?void 0:s.provinceAssignments)!=null&&Su.length)&&u.jsx(H,{textAlign:"start",variant:"body2",children:"تخصیصی انجام نشده است."}),(Pu=s==null?void 0:s.provinceAssignments)==null?void 0:Pu.map((I,ru)=>{var hu;let du;return I.provinceKillRequestState==="accept"?du="تایید شده است.":I.provinceKillRequestState==="pending"?du="در انتظار تایید و تخصیص خودرو توسط کشتارگاه می باشد.":I.provinceKillRequestState==="rejected"&&(du="درخواست توسط کشتارگاه رد شده است!"),u.jsxs(o,{container:!0,gap:w.MEDIUM,alignItems:"center",mb:w.SMALL,children:[u.jsxs(o,{gap:w.TINY,container:!0,direction:"column",children:[u.jsxs(o,{container:!0,gap:w.SMALL,alignItems:"center",children:[u.jsx(o,{children:u.jsxs(H,{variant:"caption",children:[I.killHouseName," / ",I.killHouseUserName," /",I.killHouseMobile]})}),u.jsx(o,{children:u.jsxs(H,{variant:"caption",children:["تاریخ کشتار"," ",qu(new Date(I.date),"yyyy/MM/dd")]})}),u.jsx(o,{children:u.jsxs(H,{variant:"caption",children:[(hu=I.mainQuantity)==null?void 0:hu.toLocaleString()," قطعه"]})}),u.jsx(o,{children:u.jsx(H,{variant:"caption",fontWeight:"bold",color:"error",children:I!=null&&I.market?"پنل معاملات":I.automaticState?"تخصیص خودکار":"تخصیص دستی"})})]}),u.jsxs(o,{textAlign:"start",container:!0,gap:w.TINY,alignItems:"center",children:[I.provinceKillRequestState!=="rejected"?u.jsx(be,{color:"primary"}):u.jsx(_e,{color:"error"}),u.jsx(H,{variant:"caption",children:du})]})]}),I.provinceKillRequestState!=="rejected"&&(I==null?void 0:I.returnToProvince)===!1&&u.jsx(o,{children:u.jsx(o,{children:u.jsx(W,{size:"small",variant:"outlined",color:"error",onClick:()=>{D(hr({key:I.provinceKillRequestKey})).then(fu=>{var _u,Du;fu.error?(D(V()),fu.error.message.includes("403")?l({vertical:"top",horizontal:"center",msg:"به علت تایید کشتارگاه امکان حذف تخصیص وجود ندارد!",severity:"error"}):l({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"})):(S0(a,e,D),D(p0((_u=n==null?void 0:n.poultry)==null?void 0:_u.poultryRequestKey)),D(C0(g)),D(Z6({key:(Du=n==null?void 0:n.poultry)==null?void 0:Du.poultryRequestKey})),l({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد!",severity:"success"}),f())})},children:"حذف"})})})]},ru)})]}),L==="auction"&&u.jsx(o,{children:u.jsx(Se,{poultryRequestKey:(Ou=n==null?void 0:n.poultry)==null?void 0:Ou.poultryRequestKey})})]})]})};Le.propTypes={file:u0.PropTypes.object};const Sr=({item:e,remainQuantity:t,getItemFreeSaleInProvince:r,updateTable:x})=>{const f=m(),[p,,n]=c.useContext(su),[l,g]=c.useState(null),F=!!l,A=F?"ProvinceAllocateRequests":void 0,S=h=>{g(h.currentTarget)},d=()=>{g(null)};return u.jsxs(o,{children:[u.jsx(xu,{"aria-describedby":A,variant:"contained",color:"primary",onClick:S,children:u.jsx(ye,{})}),u.jsx(y0,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:A,open:F,anchorEl:l,onClose:d,children:u.jsxs("div",{style:{padding:"20px",display:"flex",flexDirection:"column"},children:[u.jsx(Lu,{title:"تخصیص",placement:"right",children:u.jsx(xu,{color:"primary",onClick:()=>{var h,j,b,v,E,L,$,z,P;d(),((h=e==null?void 0:e.poultryRequest)==null?void 0:h.priceConfirmation)===!0&&!((j=e==null?void 0:e.poultryRequest)!=null&&j.inputPriceConfirmationCode)?f(wu({title:"ورود کد احراز",content:u.jsx(On,{updateTable:x,item:e==null?void 0:e.poultryRequest})})):(e==null?void 0:e.provinceState)==="pending"?f(wu({title:"اطلاعیه سیستم",content:u.jsxs(o,{children:[u.jsx(H,{variant:"body1",color:"secondary",children:"درخواست ابتدا باید توسط استان تایید شود!"}),u.jsx(o,{container:!0,justifyContent:"center",children:u.jsx(o,{item:!0,container:!0,xs:12,justifyContent:"center",mt:2,children:u.jsx(W,{size:"small",color:"success",variant:"contained",onClick:()=>f(Yu()),children:"متوجه شدم"})})})]})})):f(bu({title:"انجام عملیات تخصیص",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,size:1e3,content:u.jsx(Le,{remainQuantity:t,item:e,id:(E=(v=(b=e==null?void 0:e.poultryRequest)==null?void 0:b.process)==null?void 0:v.poultry)==null?void 0:E.poultryRequestId,orginalQuantity:(z=($=(L=e==null?void 0:e.poultryRequest)==null?void 0:L.process)==null?void 0:$.poultry)==null?void 0:z.poultryQuantity,file:(P=e==null?void 0:e.poultryRequest)==null?void 0:P.process,getItemFreeSaleInProvince:r,updateTable:x})}))},children:u.jsx(Ee,{})})}),u.jsx(Lu,{title:"اتمام",placement:"right",children:u.jsx(xu,{"aria-label":"delete",color:"primary",onClick:()=>{d(),f(wu({title:"آیا مطمئن هستید؟",content:u.jsxs(o,{container:!0,children:[u.jsx(W,{variant:"contained",onClick:()=>{var h,j;f(rr({allocated_number:(h=e==null?void 0:e.quantity)==null?void 0:h.allocatedNumber,final_state:"archive",key:(j=e==null?void 0:e.poultryRequest)==null?void 0:j.key})).then(b=>{f(C0(n)),b.payload.error?p({vertical:"top",horizontal:"center",msg:b.payload.error,severity:"error"}):(f(Yu()),p({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),u.jsx(W,{onClick:()=>{f(Yu())},children:"لغو"})]})}))},children:u.jsx(q6,{})})})]})})]})},_r=Au("PROVINCE_EDIT_SEND_DATE",async(e,{dispatch:t})=>{try{t(q());const{data:r,status:x}=await J.put("Poultry_Request/0/",e);return t(V()),{data:r,status:x}}catch(r){return t(V()),{error:r.response.data.result}}}),Dr=({poultryRequestKey:e})=>{const[t]=c.useContext(su),r=m(),x=ku({initialValues:{date:ou(Date()).format("YYYY-MM-DD hh:mm:ss")}});return u.jsxs(o,{container:!0,direction:"column",gap:w.SMALL,children:[u.jsx(yu,{fullWidth:!0,label:"تاریخ",id:"date",renderInput:f=>u.jsx(U,{...f}),value:x.values.date,error:x.touched.date?!!x.errors.date:null,onChange:f=>{x.setFieldValue("date",ou(f).format("YYYY-MM-DD hh:mm:ss"))},onBlur:x.handleBlur,helperText:x.touched.date&&x.errors.date?x.errors.date:null}),u.jsx(W,{variant:"contained",fullWidth:!0,onClick:()=>{r(_r({key:e,send_date:x.values.date})).then(f=>{r(C0()),r(Yu()),f.payload.error?t({vertical:"top",horizontal:"center",msg:f.payload.error,severity:"error"}):t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},children:"ثبت"})]})},Lr={hidden:{opacity:0,y:20},visible:{opacity:1,y:0}},kr=()=>{const[,,e,t]=c.useContext(su),r=m();c.useEffect(()=>{const D=ou(new Date).format("YYYY-MM-DD");t(D)},[]);const x=D=>{S(D.target.value)},[f,p]=c.useState([]),[n,l]=c.useState(0),[g,F]=c.useState(10),[A,S]=c.useState(""),[d,h]=c.useState(1),[j,b]=c.useState([]),v=async D=>{r(Qu(e)).then(async()=>{let a;r(q()),a=await J.get(`city_operator_check_request_new/?state=waiting&date=${e}&page=${D}&page_size=${g}&search=filter&value=${A||""}`),r(V()),p(a.data.results),l(a.data.count)})},E=D=>{v(D),h(D)},L=D=>{F(D),h(1)},$=D=>{var M;let a="";return(M=D==null?void 0:D.poultryRequest)!=null&&M.freeSaleInProvince?a="آزاد":a="دولتی",a},z=()=>{v(d!==0?d:1)};c.useEffect(()=>{const D=f==null?void 0:f.map((a,M)=>{var N,R,Y,K,y,C,i,k,B,T,Q,nu,Z,eu,ju,cu,iu,O,_,Cu,vu,Su,Pu,Ou,I,ru,du,hu,fu,_u,Du,Mu,Ru,Bu,Uu,r0,t0,l0,A6,x6,p6,j6,f6,F6,y6,g6,v6;return[d===1?M+1:M+g*(d-1)+1,(N=a==null?void 0:a.poultryRequest)==null?void 0:N.orderCode,$(a),Zu((R=a==null?void 0:a.poultryRequest)==null?void 0:R.createDate),u.jsxs(o,{container:!0,alignItems:"center",justifyContent:"center",width:"100px",children:[u.jsx(H,{variant:"caption",children:pu((Y=a==null?void 0:a.poultryRequest)==null?void 0:Y.sendDate)}),u.jsx(xu,{size:"small",color:"primary",disabled:Number((K=a==null?void 0:a.quantity)==null?void 0:K.allocatedNumber)>0,onClick:()=>{var E6;r(wu({title:"ویرایش تاریخ درخواست کشتار",content:u.jsx(Dr,{poultryRequestKey:(E6=a==null?void 0:a.poultryRequest)==null?void 0:E6.key})}))},children:u.jsx(ge,{fontSize:"small"})})]},(y=a==null?void 0:a.poultryRequest)==null?void 0:y.orderCode),(C=a==null?void 0:a.poultryRequest)!=null&&C.freezing?"انجماد":(i=a==null?void 0:a.poultryRequest)!=null&&i.export?"صادرات":"عادی",`${(T=(B=(k=a==null?void 0:a.poultryRequest)==null?void 0:k.process)==null?void 0:B.poultry)==null?void 0:T.poultryName}/${(Z=(nu=(Q=a==null?void 0:a.poultryRequest)==null?void 0:Q.process)==null?void 0:nu.poultry)==null?void 0:Z.poultryMobile}`,(eu=a==null?void 0:a.poultryRequest)!=null&&eu.killHouseList.length?(cu=(ju=a==null?void 0:a.poultryRequest)==null?void 0:ju.killHouseList)==null?void 0:cu.join(" - "):"-",`${(_=(O=(iu=a==null?void 0:a.poultryRequest)==null?void 0:iu.process)==null?void 0:O.poultry)==null?void 0:_.poultryProvince}/${(Su=(vu=(Cu=a==null?void 0:a.poultryRequest)==null?void 0:Cu.process)==null?void 0:vu.poultry)==null?void 0:Su.poultryCity}`,(Ou=(Pu=a==null?void 0:a.poultryRequest)==null?void 0:Pu.poultry)==null?void 0:Ou.cityOperator,(I=a==null?void 0:a.poultryRequest)==null?void 0:I.killingAge,(hu=(du=(ru=a==null?void 0:a.poultryRequest)==null?void 0:ru.process)==null?void 0:du.poultry)==null?void 0:hu.IndexWeight,(Mu=(Du=(_u=(fu=a==null?void 0:a.poultryRequest)==null?void 0:fu.process)==null?void 0:_u.poultry)==null?void 0:Du.totalWeight)==null?void 0:Mu.toLocaleString(),(r0=(Uu=(Bu=(Ru=a==null?void 0:a.poultryRequest)==null?void 0:Ru.process)==null?void 0:Bu.poultry)==null?void 0:Uu.poultryQuantity)==null?void 0:r0.toLocaleString(),((l0=(t0=a==null?void 0:a.poultryRequest)==null?void 0:t0.amount)==null?void 0:l0.toLocaleString())+" ﷼",u.jsx(H,{color:"green",variant:"caption",fontWeight:"bold",children:(x6=(A6=a==null?void 0:a.quantity)==null?void 0:A6.allocatedNumber)==null?void 0:x6.toLocaleString()},"sss"),(j6=(p6=a==null?void 0:a.quantity)==null?void 0:p6.returnedNumber)==null?void 0:j6.toLocaleString(),(F6=(f6=a==null?void 0:a.quantity)==null?void 0:f6.assignableNumber)==null?void 0:F6.toLocaleString(),u.jsx(Sr,{remainQuantity:(v6=(g6=(y6=a==null?void 0:a.poultryRequest)==null?void 0:y6.process)==null?void 0:g6.poultry)==null?void 0:v6.poultryRemainQuantity,item:a,getItemFreeSaleInProvince:$,updateTable:z},M)]});b(D)},[f]),c.useEffect(()=>{v(1)},[r,e,g]);const P=async D=>{D.preventDefault(),r(q());try{const a=await J.get(`city_operator_check_request_new/?state=waiting&date=${e}&page=1&page_size=${g}&search=filter&value=${A||""}`);p(a.data.results),l(a.data.count),r(V())}catch(a){console.error("Error fetching data:",a)}},{poultryRequestsTotalQuantity:s}=Fu(D=>D.citySlice);return u.jsxs(o,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(o,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,px:{xs:2,sm:0},children:[u.jsx(o,{children:u.jsx(yu,{label:"تاریخ",id:"date",renderInput:D=>u.jsx(U,{style:{width:"160px"},...D,size:"small"}),value:e,onChange:D=>{t(ou(D).format("YYYY-MM-DD"))}})}),u.jsx(o,{children:u.jsxs("form",{onSubmit:P,children:[u.jsx(U,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:x}),u.jsx(W,{type:"submit",onClick:P,endIcon:u.jsx(Ku,{}),children:"جستجو"})]})})]}),u.jsx(o,{container:!0,sx:{gap:{xs:"8px 0px",sm:"8px"}},mt:2,justifyContent:"center",alignItems:"center",children:[{label:"تعداد درخواست کشتار",value:(s==null?void 0:s.acceptedQuantity)||0},{label:"اعلام نیاز کشتارگاه ها",value:(s==null?void 0:s.killRequestsQuantity)||0},{label:"تخصیص داده شده",value:(s==null?void 0:s.allocatedQuantity)||0},{label:"قابل تخصیص",value:(s==null?void 0:s.assignableQuantity)||0},{label:"برگشت داده شده",value:(s==null?void 0:s.returnedQuantity)||0}].map((D,a)=>{var M;return u.jsx(o,{item:!0,sx:{width:"250px"},children:u.jsx(X6.div,{variants:Lr,initial:"hidden",animate:"visible",transition:{duration:.5,delay:a*.2},children:u.jsx(F0,{elevation:3,sx:{borderRadius:2},children:u.jsxs(Ue,{children:[u.jsx(H,{color:"red",variant:"subtitle2",gutterBottom:!0,children:D.label}),u.jsxs(H,{variant:"h6",sx:{fontSize:18},children:[(M=D.value)==null?void 0:M.toLocaleString()," قطعه"]})]})})})},a)})}),u.jsx(K6,{px:{xs:1,sm:0},children:u.jsx(zu,{data:j,columns:["ردیف","کد سفارش","نوع فروش","تاریخ ثبت درخواست","تاریخ کشتار","نوع کشتار","مرغدار/تلفن","کشتارگاه انتخابی","استان/شهر","تعاونی","سن مرغ","میانگین وزنی","وزن تقریبی","تعداد","قیمت مرغدار","تخصیص داده شده","برگشت داده شده","قابل تخصیص","عملیات"],handlePageChange:E,totalRows:n,page:d,perPage:g,handlePerRowsChange:L,title:"مدیریت تخصیصات"})})]})},Tr=()=>{const e=m(),t=e6(),{provinceGetActiveRequests:r}=Fu(p=>p.provinceSlice),[x,f]=c.useState([]);return c.useEffect(()=>{e(Xe())},[]),c.useEffect(()=>{const p=r==null?void 0:r.map((n,l)=>{var g,F,A,S,d,h,j,b,v,E,L,$,z,P,s,D,a,M,N,R,Y;return[l+1,(g=n==null?void 0:n.poultryRequest)==null?void 0:g.orderCode,qu(new Date((F=n==null?void 0:n.poultryRequest)==null?void 0:F.createDate),"yyyy/MM/dd"),qu(new Date((A=n==null?void 0:n.poultryRequest)==null?void 0:A.sendDate),"yyyy/MM/dd"),(h=(d=(S=n==null?void 0:n.poultryRequest)==null?void 0:S.process)==null?void 0:d.poultry)==null?void 0:h.poultryName,(v=(b=(j=n==null?void 0:n.poultryRequest)==null?void 0:j.process)==null?void 0:b.poultry)==null?void 0:v.poultryMobile,($=(L=(E=n==null?void 0:n.poultryRequest)==null?void 0:E.process)==null?void 0:L.poultry)==null?void 0:$.poultryCity,(s=(P=(z=n==null?void 0:n.poultryRequest)==null?void 0:z.process)==null?void 0:P.poultry)==null?void 0:s.poultryProvince,(M=(a=(D=n==null?void 0:n.poultryRequest)==null?void 0:D.process)==null?void 0:a.poultry)==null?void 0:M.age,(Y=(R=(N=n==null?void 0:n.poultryRequest)==null?void 0:N.process)==null?void 0:R.poultry)==null?void 0:Y.poultryQuantity,u.jsx(xu,{"aria-label":"delete",color:"primary",onClick:()=>{var K,y,C;t(J0+((C=(y=(K=n==null?void 0:n.poultryRequest)==null?void 0:K.process)==null?void 0:y.poultry)==null?void 0:C.poultryRequestId))},children:u.jsx(b0,{})},l)]});f(p)},[r]),u.jsx(F0,{children:u.jsx(E0,{name:"درخواست های فعال",columns:["ردیف","کد سفارش","تاریخ ثبت درخواست","تاریخ کشتار","مرغدار","تلفن مرغدار","شهر","استان","سن مرغ","تعداد","مشاهده"],data:x})})},Nr=({dataTable:e,item:t,setIsSingleView:r})=>{const x=Array.isArray(e)&&(e==null?void 0:e.reduce((n,l)=>{var g;return n+((g=l.allocations)==null?void 0:g.reduce((F,A)=>F+A.allocationQuantity,0))},0)),f=Array.isArray(e)&&(e==null?void 0:e.reduce((n,l)=>n+l.allocationsSum,0)),p=Array.isArray(e)&&(e==null?void 0:e.reduce((n,l)=>n+l.poultryQuantity,0));return u.jsxs(o,{container:!0,alignItems:"start",my:w.SMALL,children:[u.jsx("table",{className:"auto-allocation-table",children:u.jsxs("tr",{children:[u.jsx("th",{children:u.jsx(o,{children:u.jsxs(W,{color:"error",onClick:()=>{r(null)},children:[u.jsx($n,{}),"بازگشت به بایگانی"]})})}),u.jsxs("th",{children:["کد تخصیص خودکار ",t.allocationOrderCode]}),u.jsxs("th",{children:["تاریخ تخصیص ",pu(t.allocationDate)]})]})}),u.jsxs("table",{className:"auto-allocation-table",children:[u.jsxs("tr",{children:[u.jsx("th",{children:"ردیف"}),u.jsx("th",{children:"نام واحد (مرغدار)"}),u.jsx("th",{children:"تلفن مرغدار"}),u.jsx("th",{children:"آدرس"}),u.jsx("th",{children:"تعداد درخواست کشتار"}),u.jsx("th",{children:"مانده قابل تخصیص"}),u.jsx("th",{children:"ماهیت خریدار"}),u.jsx("th",{children:"نام خریدار"}),u.jsx("th",{children:"تلفن خریدار"}),u.jsx("th",{children:"آدرس"}),u.jsx("th",{children:"محل کشتار"}),u.jsx("th",{children:"تعداد تخصیص"}),u.jsx("th",{children:"جمع مرغ تخصیصی"}),u.jsx("th",{children:"سهم درصد"}),u.jsx("th",{children:"حواله مرغدار"}),u.jsx("th",{children:"حواله خریدار"})]}),e==null?void 0:e.map((n,l)=>{var g;return(g=n==null?void 0:n.allocations)==null?void 0:g.map((F,A)=>{var d,h;const S=(n==null?void 0:n.poultryQuantity)-(n==null?void 0:n.allocationsSum);return u.jsxs("tr",{children:[!A&&u.jsx("td",{rowSpan:n==null?void 0:n.allocations.length,children:l+1}),!A&&u.jsx("td",{rowSpan:n==null?void 0:n.allocations.length,children:n==null?void 0:n.poultryName}),!A&&u.jsx("td",{rowSpan:n==null?void 0:n.allocations.length,children:n==null?void 0:n.poultryMobile}),!A&&u.jsx("td",{rowSpan:n==null?void 0:n.allocations.length,children:n==null?void 0:n.poultryAddress}),!A&&u.jsx("td",{rowSpan:n==null?void 0:n.allocations.length,children:(d=n==null?void 0:n.poultryQuantity)==null?void 0:d.toLocaleString()}),!A&&u.jsx("td",{rowSpan:n==null?void 0:n.allocations.length,children:S.toLocaleString()}),u.jsx("td",{children:F!=null&&F.type?"کشتارکن":"کشتارگاه"}),u.jsx("td",{children:F==null?void 0:F.buyerName}),u.jsx("td",{children:F==null?void 0:F.buyerMobile}),u.jsx("td",{children:F==null?void 0:F.buyerAddress}),u.jsx("td",{children:F==null?void 0:F.KillingPlace}),u.jsx("td",{children:F==null?void 0:F.allocationQuantity}),!A&&u.jsx("td",{rowSpan:n==null?void 0:n.allocations.length,children:(h=n==null?void 0:n.allocationsSum)==null?void 0:h.toLocaleString()}),u.jsxs("td",{children:["%",((F==null?void 0:F.allocationQuantity)/x*100).toFixed(2)]}),!A&&u.jsx("td",{rowSpan:n==null?void 0:n.allocations.length,children:u.jsx(xu,{disabled:!0,color:"primary",children:u.jsx(f0,{})})}),u.jsx("td",{children:u.jsx(xu,{disabled:!0,color:"primary",children:u.jsx(f0,{})})})]},A)})}),u.jsxs("tr",{children:[u.jsx("td",{colSpan:"11",children:"جمع کل"}),u.jsx("td",{children:x.toLocaleString()}),u.jsx("td",{children:f.toLocaleString()}),u.jsx("td",{children:(x/p*100).toFixed(2)})]})]})]})},wr=()=>{const e=m(),[t,r]=c.useState([]),[x,f]=c.useState(),[,,p,n,l,g]=c.useContext(su);c.useEffect(()=>{const A=c0(new Date).format("YYYY-MM-DD");n(A),g(A)},[]);const{provinceGetArchiveAutoAllocations:F}=Fu(A=>A.provinceSlice);return c.useEffect(()=>{e(Je({selectedDate1:p,selectedDate2:l}))},[p,l]),c.useEffect(()=>{const A=F==null?void 0:F.map((S,d)=>[d+1,S.allocationOrderCode,pu(S.allocationDate),S.totalQuantity.toLocaleString(),S.allocatedQuantity.toLocaleString(),S.numberOfPoultry.toLocaleString(),S.numberOfKillHouse.toLocaleString(),u.jsx(xu,{color:"primary",onClick:()=>{f(S)},children:u.jsx(b0,{})},d)]);r(A)},[F]),u.jsxs(o,{mt:w.SMALL,xs:12,px:2,children:[!x&&u.jsx(E0,{name:u.jsxs(o,{container:!0,alignItems:"center",gap:w.SMALL,mb:2,children:[u.jsx(o,{children:u.jsx(H,{children:"بایگانی تخصیصات خودکار"})}),u.jsx(o,{children:u.jsx(yu,{label:"از تاریخ",id:"date",renderInput:A=>u.jsx(U,{style:{width:"160px"},...A}),value:p,onChange:A=>{n(c0(A).format("YYYY-MM-DD"))}})}),u.jsx(o,{children:u.jsx(yu,{label:"تا تاریخ",id:"date",renderInput:A=>u.jsx(U,{style:{width:"160px"},...A}),value:l,onChange:A=>{g(c0(A).format("YYYY-MM-DD"))}})})]}),columns:["ردیف","کد تخصیص خودکار","تاریخ تخصیص","تعداد درخواست کشتار","تعداد تخصیصی","تعداد مرغدار","تعداد کشتارگاه","مشاهده"],data:t}),x&&u.jsx(o,{container:!0,direction:"column",alignItems:"start",gap:w.SMALL,children:u.jsx(Nr,{dataTable:x.allocationsList,item:x,setIsSingleView:f})})]})},Pr=Au("PROVINCE_CREATE_AUTO_ALLOCATION_SERVICE",async(e,{dispatch:t})=>{try{t(q());const{data:r,status:x}=await J.post("automatic_allocation/",e);return t(V()),{data:r,status:x}}catch(r){return t(V()),{error:r.response.data.result}}}),w6=Au("PROVINCE_EDIT_AUTO_ALLOCATION_SERVICE",async(e,{dispatch:t})=>{try{t(q());const{data:r,status:x}=await J.put("automatic_allocation/0/",e);return t(V()),{data:r,status:x}}catch(r){return t(V()),{error:r.response.data.result}}}),Or=({dataTable:e,setDataTable:t,setAddedRows:r,poultryIndex:x})=>{const f=m(),[p,n]=c.useState(null),{provinceGetBuyers:l}=Fu(F=>F.provinceSlice),g=ku({initialValues:{num:""},onSubmit:F=>{}});return c.useEffect(()=>{f(Ze())},[]),u.jsxs(o,{contianer:!0,width:"70%",children:[u.jsx(Hu,{id:"country-select",options:l==null?void 0:l.map(F=>({name:F.debt?`${F.name} (بدهکار)`:F.name,obj:F})),getOptionLabel:F=>F.name,getOptionDisabled:F=>F.disabled,value:p,onChange:(F,A)=>{n(A)},renderInput:F=>u.jsx(U,{...F,label:"انتخاب خریدار",variant:"outlined"})}),u.jsx("div",{style:{marginTop:"10px"}}),u.jsx(ve,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"num",label:"تعداد مرغ",variant:"outlined",value:g.values.num,error:g.touched.num?!!g.errors.num:null,onChange:g.handleChange,onBlur:g.handleBlur,helperText:g.touched.num&&g.errors.num?g.errors.num:null}),u.jsx("div",{style:{marginTop:"10px"}}),u.jsx(W,{variant:"contained",fullWidth:!0,onClick:()=>{r(F=>{var A;return[...F,{kill_house_key:(A=p==null?void 0:p.obj)==null?void 0:A.key,poultry_request_key:e[x].poultryRequestKey,quantity:Number(g.values.num)}]}),t(F=>{var S,d,h,j,b,v,E;let A=ke(F);return A[x].allocations.push({allocationKey:null,type:(S=p==null?void 0:p.obj)==null?void 0:S.killer,buyerName:p==null?void 0:p.name,buyerMobile:(d=p==null?void 0:p.obj)==null?void 0:d.phone,buyerAddress:(b=(j=(h=p==null?void 0:p.obj)==null?void 0:h.systemAddress)==null?void 0:j.city)==null?void 0:b.name,allocationQuantity:Number(g.values.num),allocationPercent:0,KillingPlace:(v=p==null?void 0:p.obj)==null?void 0:v.killPlace}),A[x].allocationsSum=(E=A[x].allocations)==null?void 0:E.reduce((L,$)=>L+$.allocationQuantity,0),A}),f(Yu())},children:"ثبت"})]})};function ke(e){let t=Array.isArray(e)?[]:{};for(let r in e)typeof e[r]=="object"&&e[r]!==null?t[r]=ke(e[r]):t[r]=e[r];return t}const P6=Au("PROVINCE_DELETE_AUTO_ALLOCATION_SERVICE",async(e,{dispatch:t})=>{try{t(q());const{data:r,status:x}=await J.put("automatic_allocation/0/",e);return t(V()),{data:r,status:x}}catch(r){return t(V()),{error:r.response.data.result}}}),O6=Au("PROVINCE_ADD_AUTO_ALLOCATION_SERVICE",async(e,{dispatch:t})=>{try{t(q());const{data:r,status:x}=await J.put("automatic_allocation/0/",e);return t(V()),{data:r,status:x}}catch(r){return t(V()),{error:r.response.data.result}}}),M6=Au("PROVINCE_SUBMIT_FINAL_AUTO_ALLOCATIONS_SERVICE",async(e,{dispatch:t})=>{try{t(q());const{data:r,status:x}=await J.put("automatic_allocation/0/",e);return t(V()),{data:r,status:x}}catch(r){return t(V()),{error:r.response.data.result}}}),Mr=({handleList:e})=>{function t(L,$){return L.filter(z=>$.indexOf(z)===-1)}function r(L,$){return L.filter(z=>$.indexOf(z)!==-1)}const[x,f]=x0.useState([]),[p,n]=x0.useState([{label:"شهر",key:"city",value:!0},{label:"عدم بدهی",key:"no_debt",value:!0},{label:"حداقل تعداد تخصیص",key:"minimum_allocation",value:!0}]),[l,g]=x0.useState([{label:"شهر محل کشتار",key:"kill_place",value:!0}]),F=r(x,p),A=r(x,l),S=L=>()=>{const $=x.indexOf(L),z=[...x];$===-1?z.push(L):z.splice($,1),f(z)},d=()=>{g(l.concat(p)),n([])},h=()=>{g(l.concat(F)),n(t(p,F)),f(t(x,F))},j=()=>{n(p.concat(A)),g(t(l,A)),f(t(x,A))},b=()=>{n(p.concat(l)),g([])},v=L=>{const $=p.find(P=>P.key==="minimum_allocation"),z=l.find(P=>P.key==="minimum_allocation");$?n(P=>[...P.filter(s=>s.key!=="minimum_allocation"),{...$,value:L.target.value}]):z&&g(P=>[...P.filter(s=>s.key!=="minimum_allocation"),{...z,value:L.target.value}])};c.useEffect(()=>{e(l)},[l]);const E=L=>u.jsx(V6,{sx:{width:"100%",height:150,overflow:"auto"},children:u.jsx(Q6,{dense:!0,component:"div",role:"list",children:L.map(($,z)=>{const P=`transfer-list-item-${$}-label`;return u.jsx(We,{role:"listitem",onClick:S($),children:u.jsxs(o,{container:!0,alignItems:"center",children:[u.jsx(s0,{children:u.jsx(X0,{checked:x.indexOf($)!==-1,tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":P}})}),u.jsx(o0,{id:P,primary:`${z+1}. ${$.label}`}),$.label==="حداقل تعداد تخصیص"&&u.jsx(o,{children:u.jsx(U,{label:"تعداد",type:"number",style:{width:"100px"},value:$.value,onChange:v,size:"small"})})]})},$)})})});return u.jsxs(o,{container:!0,spacing:2,justifyContent:"center",alignItems:"center",mt:w.TINY,width:"100%",children:[u.jsxs(o,{item:!0,flex:1,children:[u.jsx(H,{children:"انتخاب اولویت های تخصیص خودکار"}),E(p)]}),u.jsx(o,{item:!0,flex:1,children:u.jsxs(o,{container:!0,direction:"column",alignItems:"center",children:[u.jsx(W,{sx:{my:.5},variant:"outlined",size:"large",onClick:d,disabled:!0,"aria-label":"move all right",children:"≫"}),u.jsx(W,{sx:{my:.5},variant:"outlined",size:"large",onClick:h,disabled:!0,"aria-label":"move selected right",children:">"}),u.jsx(W,{sx:{my:.5},variant:"outlined",size:"large",onClick:j,disabled:!0,"aria-label":"move selected left",children:"<"}),u.jsx(W,{sx:{my:.5},variant:"outlined",size:"large",onClick:b,disabled:!0,"aria-label":"move all left",children:"≪"})]})}),u.jsxs(o,{item:!0,flex:1,children:[u.jsx(H,{children:"اولویت های انتخاب شده تخصیص خودکار"}),E(l)]})]})},$r=()=>{var R,Y,K,y,C;const e=m(),[t]=c.useContext(su),[r,x]=c.useState([]),[f,p]=c.useState([]),[n,l]=c.useState([]),[g,F]=c.useState({}),[A,S]=c.useState(null),d=!!A,h=d?"popoverr":void 0,j=i=>{S(i.currentTarget)},b=()=>{S(null)};c.useEffect(()=>{b()},[]);const{poultryRequestsTotalQuantity:v}=Fu(i=>i.citySlice),{provinceGetAutoAllocations:E}=Fu(i=>i.provinceSlice);c.useEffect(()=>{e(a0())},[]),c.useEffect(()=>{x(Xu(E))},[E]);const L=()=>{const i=r==null?void 0:r.reduce((k,B)=>{let T=Xu(B.allocations);return T=T.filter(Q=>Q.allocationKey),[...k,...T]},[]);e(P6({allocation_delete_list:f==null?void 0:f.filter(k=>k.allocationKey)})).then(()=>{p([]),e(O6({allocation_add_list:n})).then(()=>{e(w6({allocation_list:i})).then(k=>{l([]),k.payload.error?t({vertical:"top",horizontal:"center",msg:k.payload.error,severity:"error"}):(e(Qu()),e(a0()),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})})})},$=()=>r.map(B=>B.allocations.some(Q=>Q.debt)).some(B=>B),z=()=>{const i=r==null?void 0:r.reduce((k,B)=>{let T=Xu(B.allocations);return T=T.filter(Q=>Q.allocationKey),[...k,...T]},[]);e(P6({allocation_delete_list:f==null?void 0:f.filter(k=>k.allocationKey)})).then(()=>{p([]),e(O6({allocation_add_list:n})).then(()=>{e(w6({allocation_list:i})).then(()=>{l([]);const B=(E==null?void 0:E.reduce((T,Q)=>[...T,...Q.allocations],[])).map(T=>({allocationKey:T.allocationKey}));e(M6({final_registration_list:B})).then(T=>{T.payload.error?t({vertical:"top",horizontal:"center",msg:T.payload.error,severity:"error"}):(e(Qu()),e(a0()),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})})})})},P=Array.isArray(r)&&(r==null?void 0:r.reduce((i,k)=>{var B;return i+((B=k.allocations)==null?void 0:B.reduce((T,Q)=>T+Q.allocationQuantity,0))},0)),s=Array.isArray(r)&&(r==null?void 0:r.reduce((i,k)=>i+k.allocationsSum,0)),D=Array.isArray(r)&&(r==null?void 0:r.reduce((i,k)=>i+k.poultryQuantity,0)),[a,M]=c.useState(c0(new Date).format("YYYY-MM-DD"));c.useEffect(()=>{e(Qu(a))},[a]);const N=i=>{const k=i.map(B=>({[B.key]:B.value}));F(k)};return u.jsxs(o,{container:!0,my:w.SMALL,direction:"column",alignItems:"start",xs:12,pt:2,px:2,children:[u.jsx(_0,{name:u.jsx(o,{xs:12,mb:2,children:u.jsx(yu,{label:"تاریخ تخصیص",id:"date",renderInput:i=>u.jsx(U,{style:{width:"180px"},...i}),value:a,onChange:i=>{M(c0(i).format("YYYY-MM-DD"))}})}),columns:["تعداد کل درخواست کشتار","تخصیص داده شده","قابل تخصیص","تعداد خریداران آماده به تخصیص","تعداد مرغدار"],data:[[`${(R=v==null?void 0:v.acceptedQuantity)==null?void 0:R.toLocaleString()} قطعه`,`${(Y=v==null?void 0:v.allocatedQuantity)==null?void 0:Y.toLocaleString()} قطعه`,`${(K=v==null?void 0:v.assignableQuantity)==null?void 0:K.toLocaleString()} قطعه`,`${(y=v==null?void 0:v.numberOfKillHouse)==null?void 0:y.toLocaleString()} واحد`,`${(C=v==null?void 0:v.numberOfPoultry)==null?void 0:C.toLocaleString()} واحد`]]}),u.jsx(o,{container:!0,gap:w.SMALL,my:w.SMALL,justifyContent:"center",alignItems:"center",width:"100%",children:u.jsxs(o,{container:!0,alignItems:"center",justifyContent:"center",direction:"column",gap:w.SMALL,width:"100%",children:[u.jsx(H,{fontWeight:"bold",children:"اولویت بندی کشتارگاه"}),u.jsx(Mr,{handleList:N}),u.jsx(o,{children:u.jsx(W,{variant:"contained",color:"primary",disabled:r.length,onClick:()=>{e(Pr({date:a,filter_list:g})).then(i=>{i.payload.error?t({vertical:"top",horizontal:"center",msg:i.payload.error,severity:"error"}):(e(Qu()),e(a0()),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ایجاد تخصیص خودکار"})})]})}),!!(r!=null&&r.length)&&u.jsxs(u.Fragment,{children:[u.jsx(o,{mb:w.SMALL,children:u.jsx(H,{fontWeight:"bold",color:"error",children:"* توجه: رنگ قرمز خریدار نشان دهنده بدهی قبلی است."})}),u.jsxs("table",{className:"auto-allocation-table",children:[u.jsxs("tr",{children:[u.jsx("th",{children:"ردیف"}),u.jsx("th",{children:"واحد (مرغدار)"}),u.jsx("th",{children:"تعداد درخواست کشتار"}),u.jsx("th",{children:"وزن تقریبی درخواست کشتار"}),u.jsx("th",{children:"مانده قابل تخصیص"}),u.jsx("th",{children:"اضافه"}),u.jsx("th",{children:"ماهیت خریدار"}),u.jsx("th",{children:"خریدار"}),u.jsx("th",{children:"محل کشتار"}),u.jsx("th",{children:"تعداد تخصیص"}),u.jsx("th",{children:"جمع مرغ تخصیصی"}),u.jsx("th",{children:"سهم درصد"}),u.jsx("th",{children:"حواله مرغدار"}),u.jsx("th",{children:"حواله خریدار"}),u.jsx("th",{children:"حذف"})]}),r==null?void 0:r.map((i,k)=>{var B;return(B=i==null?void 0:i.allocations)==null?void 0:B.map((T,Q)=>{var Z,eu,ju;let nu=(i==null?void 0:i.poultryQuantity)-(i==null?void 0:i.allocationsSum);return u.jsxs("tr",{children:[!Q&&u.jsx("td",{rowSpan:i==null?void 0:i.allocations.length,style:{backgroundColor:k%2===0?"#fff":"#f2f2f2"},children:k+1}),!Q&&u.jsxs("td",{rowSpan:i==null?void 0:i.allocations.length,style:{backgroundColor:k%2===0?"#fff":"#f2f2f2"},children:[i==null?void 0:i.poultryName," (",i==null?void 0:i.poultryAddress,") (",i==null?void 0:i.poultryMobile,")"]}),!Q&&u.jsx("td",{rowSpan:i==null?void 0:i.allocations.length,style:{backgroundColor:k%2===0?"#fff":"#f2f2f2"},children:(Z=i==null?void 0:i.poultryQuantity)==null?void 0:Z.toLocaleString()}),!Q&&u.jsxs("td",{rowSpan:i==null?void 0:i.allocations.length,style:{backgroundColor:k%2===0?"#fff":"#f2f2f2"},children:["وزن تقریبی:"," ",(eu=i==null?void 0:i.poultryRequestWeight)==null?void 0:eu.toLocaleString(),u.jsx("hr",{}),"میانگین وزن:"," ",i==null?void 0:i.poultryRequestIndexWeight]}),!Q&&u.jsx("td",{rowSpan:i==null?void 0:i.allocations.length,style:{backgroundColor:k%2===0?"#fff":"#f2f2f2"},children:nu.toLocaleString()}),!Q&&u.jsx("td",{rowSpan:i==null?void 0:i.allocations.length,style:{backgroundColor:k%2===0?"#fff":"#f2f2f2"},children:u.jsx(xu,{color:"primary",onClick:()=>{e(wu({title:"اضافه کردن خریدار",content:u.jsx(Or,{dataTable:r,poultryIndex:k,setDataTable:x,setAddedRows:l})}))},children:u.jsx(Fe,{})})}),u.jsxs("td",{style:{backgroundColor:k%2===0?"#fff":"#f2f2f2",color:T.debt?"red":""},children:[T!=null&&T.type?"کشتارکن":"کشتارگاه"," ",T.debt?"(بدهکار)":""]}),u.jsxs("td",{style:{backgroundColor:k%2===0?"#fff":"#f2f2f2",color:T.debt?"red":""},children:[T==null?void 0:T.buyerName," (",T==null?void 0:T.buyerAddress,") (",T==null?void 0:T.buyerMobile,")"]}),u.jsx("td",{style:{backgroundColor:k%2===0?"#fff":"#f2f2f2",color:T.debt?"red":""},children:T==null?void 0:T.KillingPlace}),u.jsx("td",{style:{backgroundColor:k%2===0?"#fff":"#f2f2f2"},children:u.jsx(U,{style:{width:"100px"},type:"number",color:T.debt?"error":"",inputProps:{style:{color:T.debt?"red":""}},value:T==null?void 0:T.allocationQuantity,onChange:cu=>{if(Number(cu.target.value)<1){t({vertical:"top",horizontal:"center",msg:"در صورت نیاز به کاهش کمتر از 1 از گزینه حذف استفاده نمایید.",severity:"error"});return}x(iu=>{var _;let O=Xu(iu);return O[k].allocations[Q].allocationQuantity=Number(cu.target.value),O[k].allocationsSum=(_=O[k].allocations)==null?void 0:_.reduce((Cu,vu)=>Cu+vu.allocationQuantity,0),O})}})}),!Q&&u.jsx("td",{rowSpan:i==null?void 0:i.allocations.length,style:{backgroundColor:k%2===0?"#fff":"#f2f2f2",color:T.debt?"red":""},children:(ju=i==null?void 0:i.allocationsSum)==null?void 0:ju.toLocaleString()}),u.jsxs("td",{style:{backgroundColor:k%2===0?"#fff":"#f2f2f2",color:T.debt?"red":""},children:["%",((T==null?void 0:T.allocationQuantity)/P*100).toFixed(2)]}),!Q&&u.jsx("td",{rowSpan:i==null?void 0:i.allocations.length,style:{backgroundColor:k%2===0?"#fff":"#f2f2f2"},children:u.jsx(xu,{disabled:!0,color:"primary",children:u.jsx("a",{href:`https://core-inventory.iran.liara.run/pdf/aviculture-remittance?poultryRequestKey=${i.poultryRequestKey}&which=${window.location.origin}`,children:u.jsx(f0,{})})})}),u.jsx("td",{style:{backgroundColor:k%2===0?"#fff":"#f2f2f2"},children:u.jsx(xu,{disabled:!0,color:"primary",children:u.jsx("a",{href:`https://core-inventory.iran.liara.run/pdf/buyer-remittance?allocationKey=${T.allocationKey}&which=${window.location.origin}`,children:u.jsx(f0,{})})})}),u.jsx("td",{style:{backgroundColor:k%2===0?"#fff":"#f2f2f2"},children:u.jsx(xu,{color:"error",onClick:()=>{x(cu=>{var O;let iu=Xu(cu);return p([...f,iu[k].allocations[Q]]),iu[k].allocations.splice(Q,1),iu[k].allocationsSum=(O=iu[k].allocations)==null?void 0:O.reduce((_,Cu)=>_+Cu.allocationQuantity,0),iu})},children:u.jsx(n6,{})})})]},Q)})}),u.jsxs("tr",{children:[u.jsx("td",{colSpan:"10",children:"جمع کل"}),u.jsx("td",{children:P.toLocaleString()}),u.jsx("td",{children:s.toLocaleString()}),u.jsxs("td",{children:["%",(P/D*100).toFixed(2)]}),u.jsxs("td",{colSpan:3,children:[u.jsx(W,{"aria-describedby":h,variant:"contained",color:"primary",onClick:j,fullWidth:!0,children:"عملیات"}),u.jsx(y0,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:h,open:d,anchorEl:A,onClose:b,children:u.jsx("div",{style:{padding:"20px"},children:u.jsxs(o,{container:!0,direction:"column",gap:w.TINY,children:[u.jsx(W,{variant:"contained",color:"success",onClick:()=>{L()},children:"ثبت موقت"}),u.jsx(W,{variant:"contained",color:"error",onClick:()=>{const k=(E==null?void 0:E.reduce((B,T)=>[...B,...T.allocations],[])).map(B=>({allocationKey:B.allocationKey}));e(M6({cancellation:k})).then(B=>{B.payload.error?t({vertical:"top",horizontal:"center",msg:B.payload.error,severity:"error"}):(e(Qu()),e(a0()),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"لغو تخصیص خودکار"}),u.jsx(W,{variant:"contained",onClick:()=>{$()?(t({vertical:"top",horizontal:"center",msg:"عدم بدهی در اولویت تخصیص خودکار شما می باشد. لطفا تخصیص را مدیریت نمایید.",severity:"error"}),b()):(z(),b())},children:"ثبت نهایی"})]})})})]})]})]})]}),!r.length&&u.jsx(o,{container:!0,children:u.jsx(H,{children:"تخصیص خودکار ایجاد نشده است!"})})]})};function Xu(e){let t=Array.isArray(e)?[]:{};for(let r in e)typeof e[r]=="object"&&e[r]!==null?t[r]=Xu(e[r]):t[r]=e[r];return t}const L0=Au("PROVINCE_SET_SLAUGHTERHOUSES_QUOTA_SERVICE",async(e,{dispatch:t})=>{try{t(q());const{data:r,status:x}=await J.put("kill_house_percent/0/",e);return t(V()),{data:r,status:x}}catch(r){return t(V()),{error:r.response.data.result}}}),Ir=({item:e})=>{const t=m(),[r,x]=c.useState(null),[f,p]=c.useState([]),[n,l]=c.useState([]);c.useEffect(()=>{const d=n==null?void 0:n.map(h=>{var j,b,v,E,L;return[h==null?void 0:h.guildsName,(j=h==null?void 0:h.user)==null?void 0:j.fullname,(b=h==null?void 0:h.user)==null?void 0:b.mobile,(v=h==null?void 0:h.allocationLimit)==null?void 0:v.toLocaleString(),(L=(E=h==null?void 0:h.address)==null?void 0:E.city)==null?void 0:L.name]});p(d)},[n]);const g=d=>{x(d.currentTarget)},F=()=>{x(null)},A=!!r,S=A?e.key:void 0;return c.useEffect(()=>{t(qe({key:e.key})).then(d=>l(d.payload.data))},[]),u.jsxs(o,{container:!0,alignItems:"center",justifyContent:"center",children:[u.jsx(H,{onClick:g,variant:"caption",color:"success",style:{cursor:"pointer"},children:e.guildsQuantity}),u.jsx(y0,{id:S,open:A,anchorEl:r,onClose:F,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsx(o,{width:"500px",children:u.jsx(_0,{columns:["نام صنف","نام","تلفن","وزن (کیلوگرم)","شهر"],data:f})})})]})},zr=Iu({percent:$u().typeError("لطفا عدد وارد کنید").min(0,"باید برابر یا بزرگتر از 0 باشد").max(100,"باید کوچکتر یا برابر با 100 باشد").required("درصد الزامی است")}),Rr=({percent:e,slaughterKey:t,onPercentChange:r})=>{const x=ku({initialValues:{percent:e},validationSchema:zr,onSubmit:f=>{}});return c.useEffect(()=>{x.setFieldValue("percent",e)},[e]),u.jsx(o,{container:!0,justifyContent:"center",children:u.jsx(U,{size:"small",name:"percent",type:"number",className:"percent-input-quota",value:x.values.percent,onChange:f=>{r(t,Number(f.target.value)),x.setFieldValue("percent",f.target.value)},onBlur:x.handleBlur,error:x.touched.percent&&!!x.errors.percent,helperText:x.touched.percent&&x.errors.percent,InputProps:{startAdornment:u.jsx("span",{children:"%"})},inputProps:{step:.1},style:{width:100,textAlign:"center"}})})},Br=()=>{var A;const e=m(),[t,r]=c.useState(),[x,f]=c.useState([]),[p]=c.useContext(su),{provinceGetSlaughterhousesQuota:n}=Fu(S=>S.provinceSlice),l=(S,d)=>{f(h=>{const j=h.filter(E=>E.key!==S),b=h.filter(E=>E.key===S)[0],v={key:S,percent:d,killer_kill_house_key:b==null?void 0:b.killer_kill_house_key};return j.push(v),j})},g=(S,d)=>{f(h=>{const j=h.findIndex(L=>L.key===S),b=h[j],v=h.filter(L=>L.key!==S),E={...b,killer_kill_house_key:d};return v.push(E),v})};c.useEffect(()=>{e(h0()),e(me())},[]),c.useEffect(()=>{const S=[],d=n==null?void 0:n.map((h,j)=>{var v,E,L,$,z,P,s,D,a,M,N,R,Y,K,y,C,i;const b=(v=h==null?void 0:h.killHouse)!=null&&v.killer?"کشتارکن":"کشتارگاه";return S.push({key:h.key,percent:h.percent,killer_kill_house_key:(E=h==null?void 0:h.killHouseForKiller)==null?void 0:E.key}),[u.jsx(X0,{defaultChecked:!0},j),j+1,b,(L=h.killHouse)==null?void 0:L.name,(P=(z=($=h.killHouse)==null?void 0:$.killHouseOperator)==null?void 0:z.user)==null?void 0:P.fullname,`${(a=(D=(s=h.killHouse)==null?void 0:s.systemAddress)==null?void 0:D.province)==null?void 0:a.name} - ${(R=(N=(M=h.killHouse)==null?void 0:M.systemAddress)==null?void 0:N.city)==null?void 0:R.name} - ${(K=(Y=h.killHouse)==null?void 0:Y.systemAddress)==null?void 0:K.address}`,(y=h==null?void 0:h.killHouse)!=null&&y.killer?u.jsx(In,{onSlaughterChange:g,slaughterKey:h.key,killHouseForKiller:h.killHouseForKiller,disabled:!0},((C=h.killHouse)==null?void 0:C.name)+j):(i=h.killHouse)==null?void 0:i.name,u.jsx(Rr,{slaughterKey:h.key,onPercentChange:l,percent:h.percent},j),u.jsx(Ir,{item:h},h.key),h.guildsWeight]});f(S),r(d)},[n]);const F=x==null?void 0:x.reduce((S,d)=>S+d.percent,0);return u.jsxs(o,{display:"flex",width:"100%",direction:"column",alignItems:"end",style:{flexDirection:"column"},mt:w.SMALL,pb:w.LARGE,px:2,children:[u.jsxs(o,{container:!0,alignItems:"center",justifyContent:"space-between",mb:w.TINY,width:"100%",children:[u.jsx(o,{children:u.jsxs(H,{style:{color:"green"},children:["تاریخ آخرین بروزرسانی:"," ",(n==null?void 0:n.length)&&pu((A=n[0])==null?void 0:A.lastGuildsUpdateDate)]})}),u.jsxs(o,{container:!0,gap:w.TINY,children:[u.jsx(W,{variant:"contained",onClick:()=>{e(L0({percentage_list:x,type:"guild"})).then(S=>{S.payload.error?p({vertical:"top",horizontal:"center",msg:S.payload.error,severity:"error"}):(e(h0()),p({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"بروزرسانی بر اساس واحد"}),u.jsx(W,{variant:"contained",onClick:()=>{e(L0({percentage_list:x,type:"guilds_weight"})).then(S=>{S.payload.error?p({vertical:"top",horizontal:"center",msg:S.payload.error,severity:"error"}):(e(h0()),p({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"بروزرسانی بر اساس وزن"})]})]}),u.jsx(_0,{columns:["وضعیت","ردیف","ماهیت","نام واحد","نام و نام خانوادگی","آدرس","محل کشتار","سهم روزانه (درصد)","تعداد زیرمجموعه ها (واحد)","زیرمجموعه (وزن)"],data:t}),u.jsxs(o,{container:!0,gap:w.SMALL,mx:w.SMALL,mt:w.TINY,style:{position:"fixed",bottom:"4px",padding:"10px",borderRadius:"10px",background:"#3c3c3c",color:"white",justifyContent:"center",alignItems:"center",zIndex:99999999999},children:[u.jsx(H,{children:"جمع کل درصد ها"}),u.jsxs(H,{children:[F.toFixed(2),"%"]}),u.jsx(W,{variant:"contained",disabled:F.toFixed(2)!==100 .toFixed(2),onClick:()=>{e(L0({percentage_list:x,type:"manual"})).then(S=>{S.payload.error?p({vertical:"top",horizontal:"center",msg:S.payload.error,severity:"error"}):(e(h0()),p({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت"})]})]})},Ur=()=>{const[e,t]=c.useState(0),r=(x,f)=>{t(f)};return u.jsxs(o,{container:!0,justifyContent:"center",xs:12,children:[u.jsx(o,{container:!0,xs:12,justifyContent:"center",children:u.jsxs(g0,{value:e,onChange:r,"aria-label":"simple tabs example",children:[u.jsx(Nu,{label:"تخصیص خودکار"}),u.jsx(Nu,{label:"سهم بندی کشتارگاه"}),u.jsx(Nu,{label:"بایگانی"})]})}),e===0&&u.jsx($r,{}),e===1&&u.jsx(Br,{}),e===2&&u.jsx(wr,{})]})},G={page:{width:"210mm",margin:"0 auto",display:"flex",flexDirection:"column",position:"relative",direction:"rtl",fontFamily:"nazanin",fontWeight:"bold"},container:{width:"95%",alignSelf:"center",pageBreakInside:"avoid"},invoiceTable:{width:"100%",borderCollapse:"collapse",alignSelf:"center"},tableCell:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:11},tableCellMobile:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:10},tableInnerCell:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:8,whiteSpace:"nowrap"},tableHeader:{pageBreakAfter:"auto"},headerRow:{color:"black",pageBreakInside:"avoid",pageBreakAfter:"auto"},tableRowEven:{backgroundColor:"rgba(170, 183, 255, 0.3)"},logo:{width:"60px",height:"auto",marginBottom:"10px"},contentContainer:{display:"flex",justifyContent:"space-between",marginTop:"20px",marginLeft:"100px",marginRight:"30px"},contentInLine:{display:"flex",flexDirection:"column",alignItems:"center"},mainTitle:{fontFamily:"nazanin",fontSize:11,pAlign:"center",fontWeight:"bolder"},signature:{display:"flex",flexDirection:"column",alignItems:"flex-end",marginLeft:"20px"},watermarkContainer:{position:"fixed",top:450,left:0,right:30,bottom:0,justifyContent:"center",alignItems:"center",opacity:.2,zIndex:-1},watermarkp:{fontSize:100,fontWeight:"bolder",color:"grey",transform:"rotate(-45deg)",left:"50%"},title:{fontSize:12,fontWeight:"bolder",pAlign:"center"},titleTopic:{marginTop:"10px",fontSize:12,fontWeight:"bolder",pAlign:"center"},firsttitle:{fontSize:14,fontWeight:"bolder",marginLeft:"40px",pAlign:"center"},options:{padding:"10px",marginTop:"15px",display:"flex",flexDirection:"column",alignItems:"flex-start"},divider:{width:"100%",height:"2px",backgroundColor:"red",marginBottom:15},pTitleContainer:{pAlign:"right",margin:"15px",textAlign:"justify",textJustify:"inter-word"},tableHeaderCell:{backgroundColor:"rgba(255, 229, 153, 0.5)",fontSize:10,border:"1px solid #000",padding:"4px",textAlign:"center",fontWeight:"bold"}},c6=c.forwardRef((e,t)=>{const{sDate:r}=e,{date:x}=e,{fnumber:f}=e,{receiver:p}=e,{item:n}=e,l=Z0(),g=q0(),F=n==null?void 0:n.reduce((d,h)=>d+((h==null?void 0:h.quantity)||0),0);function A(d){let h=0;return d==null||d.forEach(j=>{j!=null&&j.provinceKillRequests&&j.provinceKillRequests.forEach(b=>{var v;((v=b.info)==null?void 0:v.quantity)!==void 0&&(h+=b.info.quantity)})}),h}function S(d){let h=0;return d==null||d.forEach(j=>{j!=null&&j.provinceKillRequests&&j.provinceKillRequests.forEach(b=>{var v;((v=b.info)==null?void 0:v.weight)!==void 0&&(h+=b.info.weight)})}),h}return u.jsxs("div",{style:G.page,ref:t,children:[u.jsxs("div",{style:G.contentContainer,children:[u.jsxs("div",{style:G.contentInLine,children:[u.jsx("img",{alt:"logo",src:r6,style:G.logo}),u.jsx("span",{style:G.mainTitle,children:"اتحادیه سراسری تعاونی‌های کشاورزی پرورش دهندگان مرغ گوشتی ایران"}),u.jsxs("span",{style:G.title,children:["اتحادیه شرکت های تعاونی کشاورزی مرغداران "," ‌"," ",l]})]}),u.jsx("div",{children:u.jsx("span",{style:G.firsttitle,children:"بسمه تعالی"})}),u.jsxs("div",{style:G.options,children:[u.jsxs("span",{style:G.title,children:["شماره: ",f]}),u.jsxs("span",{style:G.titleTopic,children:["تاریخ: ",pu(x)]}),u.jsx("span",{style:G.titleTopic,children:"پیوست:"})]})]}),u.jsx("hr",{style:G.divider}),u.jsxs("p",{style:G.pTitleContainer,children:[u.jsxs("strong",{style:{fontSize:"20px"},children:[p,u.jsx("br",{}),"با سلام",u.jsx("br",{})]}),u.jsx("br",{}),"احتراماً گزارش تخصیص و کشتار مورخ ",pu(r),"، مرغ گوشتی استان جهت استحضار بحضورتان ارسال میگردد."]}),u.jsxs("div",{style:G.container,children:[u.jsxs("p",{style:{marginTop:"40px"},children:["اطلاعات تخصیص:"," ",u.jsxs("span",{style:{color:"green",fontWeight:"boler"},children:[" ","تعداد درخواست کشتار (",F!==void 0&&F.toLocaleString()," ","قطعه)، تخصیص داده شده (",A(n).toLocaleString()," ","قطعه)، وزن کل تخصیص ("," ",Math.round(S(n)).toLocaleString()," کیلوگرم)."]})]}),u.jsxs("table",{style:G.invoiceTable,children:[u.jsx("thead",{style:G.tableHeader,children:u.jsxs("tr",{style:G.headerRow,children:[u.jsx("th",{style:G.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:G.tableHeaderCell,children:"مرغدار"}),u.jsx("th",{style:G.tableHeaderCell,children:"تلفن"}),u.jsx("th",{style:G.tableHeaderCell,children:"شهر"}),u.jsx("th",{style:G.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:G.tableHeaderCell,children:"میانگین وزنی"}),u.jsx("th",{style:G.tableHeaderCell,children:"سن"}),u.jsx("th",{style:G.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:G.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:G.tableHeaderCell,children:"وزن تقریبی بار"}),u.jsx("th",{style:G.tableHeaderCell,children:"محل کشتار"})]})}),u.jsx("tbody",{children:n==null?void 0:n.map((d,h)=>{var j,b,v,E,L,$,z,P,s,D,a,M;return u.jsxs("tr",{style:h%2===0?G.tableRowEven:{},children:[u.jsx("td",{style:G.tableCell,children:h+1}),u.jsx("td",{style:G.tableCell,children:(b=(j=d==null?void 0:d.poultry)==null?void 0:j.user)==null?void 0:b.fullname}),u.jsx("td",{style:G.tableCellMobile,children:(E=(v=d==null?void 0:d.poultry)==null?void 0:v.user)==null?void 0:E.mobile}),u.jsx("td",{style:G.tableCell,children:(z=($=(L=d==null?void 0:d.poultry)==null?void 0:L.address)==null?void 0:$.city)==null?void 0:z.name}),u.jsx("td",{style:G.tableCell,children:d==null?void 0:d.quantity.toLocaleString()}),u.jsx("td",{style:G.tableCell,children:d==null?void 0:d.IndexWeight.toLocaleString()}),u.jsx("td",{style:G.tableCell,children:(P=d==null?void 0:d.hatching)==null?void 0:P.age}),u.jsx("td",{style:G.tableInnerCell,children:(s=d==null?void 0:d.provinceKillRequests)==null?void 0:s.map((N,R,Y)=>{var K,y,C,i,k,B;return u.jsxs(u.Fragment,{children:[(C=(y=(K=N==null?void 0:N.killhouseUser)==null?void 0:K.killHouseOperator)==null?void 0:y.user)!=null&&C.fullname?(B=(k=(i=N==null?void 0:N.killhouseUser)==null?void 0:i.killHouseOperator)==null?void 0:k.user)==null?void 0:B.fullname:"............",u.jsx("br",{}),R{var K,y;return u.jsxs(u.Fragment,{children:[(K=N==null?void 0:N.info)!=null&&K.quantity?(y=N==null?void 0:N.info)==null?void 0:y.quantity.toLocaleString():"............",u.jsx("br",{}),R{var K,y;return u.jsxs(u.Fragment,{children:[Math.round((K=N==null?void 0:N.info)==null?void 0:K.weight)?Math.round((y=N==null?void 0:N.info)==null?void 0:y.weight).toLocaleString():"............",u.jsx("br",{}),R{var K,y;return u.jsxs(u.Fragment,{children:[(K=N==null?void 0:N.info)!=null&&K.killPlace?(y=N==null?void 0:N.info)==null?void 0:y.killPlace:"............",u.jsx("br",{}),R{t(q());const{data:r,status:x}=await J.get("poultry_request_letter/?date="+e);return t(V()),{data:r,status:x}}),Yr=()=>{var S;const[,,e,t,r,x]=c.useContext(su);c.useEffect(()=>{const d=ou(new Date).format("YYYY-MM-DD");t(d),x(d)},[]);const f=c.useRef(),[p,n]=c.useState(null),l=m(),g=()=>{try{const d=l(Wr(e));n(d)}catch(d){console.error(d)}},F=m0.useReactToPrint({content:()=>f.current,documentTitle:"گزارش روزانه",onAfterPrint:()=>{n(null)}});c.useEffect(()=>{p&&F()},[p,F]);const A=ku({initialValues:{receiver:"",formNumber:""},validationSchema:Iu({receiver:gu().required("این فیلد اجباری است!").typeError("لطفا مشخصات دریافت کننده را وارد کنید!"),formNumber:gu().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!")})});return c.useEffect(()=>{A.validateForm()},[]),u.jsxs(o,{container:!0,mb:2,mt:2,alignItems:"center",justifyContents:"center",gap:2,xs:12,px:2,children:[u.jsx(o,{item:!0,xs:12,children:u.jsx(Vu,{sx:{alignSlef:"center",textAlign:"center"},text:"صدور نامه گزارش کشتار روزانه"})}),u.jsx(o,{item:!0,xs:12,sm:6,md:6,lg:6,children:u.jsx(U,{id:"receiver",label:"مثال: معاونت محترم توسعه بازرگانی و صنایع کشاورزی",value:A.values.receiver,error:A.touched.receiver?!!A.errors.receiver:null,onChange:A.handleChange,onBlur:A.handleBlur,helperText:A.touched.receiver&&A.errors.receiver?A.errors.receiver:null,autoComplete:"current-password",variant:"outlined",fullWidth:!0})}),u.jsx(o,{item:!0,xs:12,sm:6,md:4,lg:3,children:u.jsx(U,{id:"formNumber",label:"شماره نامه را وارد کنید",value:A.values.formNumber,error:A.touched.formNumber?!!A.errors.formNumber:null,onChange:A.handleChange,onBlur:A.handleBlur,helperText:A.touched.formNumber&&A.errors.formNumber?A.errors.formNumber:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(o,{item:!0,xs:12,sm:6,md:4,lg:3,children:u.jsx(yu,{label:"تاریخ کشتار",id:"date",renderInput:d=>u.jsx(U,{...d,fullWidth:!0}),value:e,onChange:d=>{t(ou(d).format("YYYY-MM-DD"))}})}),u.jsx(o,{item:!0,xs:12,sm:6,md:4,lg:3,children:u.jsx(yu,{label:"تاریخ نامه",id:"date",renderInput:d=>u.jsx(U,{...d,fullWidth:!0}),value:r,onChange:d=>{x(ou(d).format("YYYY-MM-DD"))}})}),u.jsx(o,{item:!0,xs:12,sm:6,md:4,lg:3,children:u.jsx(Lu,{title:"تولید خروجی PDF",children:u.jsx(W,{fullWidth:!0,disabled:!A.isValid,onClick:()=>{g()},variant:"contained",children:"صدور نامه"})})}),u.jsx("div",{style:{display:"none",position:"absolute"},children:u.jsx(c6,{ref:f,sDate:e,date:r,fnumber:A.values.formNumber,receiver:A.values.receiver,item:(S=p==null?void 0:p.payload)==null?void 0:S.data})})]})},Vr=Au("PROVINCE_GET_SLAUGHTER_LETTER",async(e,{dispatch:t})=>{t(q());const{data:r,status:x}=await J.get("poultry_request_letter_order_code/?date="+e);return t(V()),{data:r,status:x}}),Kr=Au("PROVINCE_GET_VETERINARY_LETTER",async(e,{dispatch:t})=>{t(q());const{data:r,status:x}=await J.get("poultry_request_letter/?order_code="+e);return t(V()),{data:r,status:x}}),uu={page:{width:"210mm",margin:"0 auto",display:"flex",flexDirection:"column",position:"relative",direction:"rtl",fontFamily:"nazanin",fontWeight:"bold"},container:{width:"95%",alignSelf:"center",pageBreakInside:"avoid"},invoiceTable:{width:"100%",borderCollapse:"collapse",alignSelf:"center"},tableCell:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:11},tableHeader:{pageBreakAfter:"auto"},headerRow:{color:"black",pageBreakInside:"avoid",pageBreakAfter:"auto"},logo:{width:"60px",height:"auto",marginBottom:"10px"},contentContainer:{display:"flex",justifyContent:"space-between",marginTop:"20px",marginLeft:"100px",marginRight:"30px"},contentInLine:{display:"flex",flexDirection:"column",alignItems:"center"},mainTitle:{fontFamily:"nazanin",fontSize:11,pAlign:"center",fontWeight:"bolder"},signature:{display:"flex",flexDirection:"column",alignItems:"flex-end",marginLeft:"20px"},watermarkContainer:{position:"fixed",top:450,left:0,right:30,bottom:0,justifyContent:"center",alignItems:"center",opacity:.2,zIndex:-1},watermarkp:{fontSize:100,fontWeight:"bolder",color:"grey",transform:"rotate(-45deg)",left:"50%"},title:{fontSize:12,fontWeight:"bolder",pAlign:"center"},titleTopic:{marginTop:"10px",fontSize:12,fontWeight:"bolder",pAlign:"center"},firsttitle:{fontSize:14,fontWeight:"bolder",marginLeft:"40px",pAlign:"center"},options:{padding:"10px",marginTop:"15px",display:"flex",flexDirection:"column",alignItems:"flex-start"},divider:{width:"100%",height:"2px",backgroundColor:"red",marginBottom:15},pTitleContainer:{pAlign:"right",margin:"15px",textAlign:"justify",textJustify:"inter-word"},tableHeaderCell:{backgroundColor:"rgba(255, 229, 153, 0.5)",fontSize:10,border:"1px solid #000",padding:"4px",textAlign:"center",fontWeight:"bold"}},i6=c.forwardRef((e,t)=>{var A,S,d,h,j,b,v,E,L,$,z,P,s,D,a,M,N,R,Y,K;const{sDate:r}=e,{date:x}=e,{fnumber:f}=e,{receiver:p}=e,{item:n}=e,{price:l}=e,g=Z0(),F=q0();return u.jsxs("div",{style:uu.page,ref:t,children:[u.jsxs("div",{style:uu.contentContainer,children:[u.jsxs("div",{style:uu.contentInLine,children:[u.jsx("img",{alt:"logo",src:r6,style:uu.logo}),u.jsx("span",{style:uu.mainTitle,children:"اتحادیه سراسری تعاونی‌های کشاورزی پرورش دهندگان مرغ گوشتی ایران"}),u.jsxs("span",{style:uu.title,children:["اتحادیه شرکت های تعاونی کشاورزی مرغداران "," ‌"," ",g]})]}),u.jsx("div",{children:u.jsx("span",{style:uu.firsttitle,children:"بسمه تعالی"})}),u.jsxs("div",{style:uu.options,children:[u.jsxs("span",{style:uu.title,children:["شماره: ",f]}),u.jsxs("span",{style:uu.titleTopic,children:["تاریخ: ",pu(x)]}),u.jsx("span",{style:uu.titleTopic,children:"پیوست:"})]})]}),u.jsx("div",{style:uu.watermarkContainer,children:u.jsx("p",{style:uu.watermarkp,children:"سامانه رصدیار "})}),u.jsx("hr",{style:uu.divider}),u.jsxs("p",{style:uu.pTitleContainer,children:[u.jsxs("strong",{style:{fontSize:"20px"},children:[p,u.jsx("br",{}),"با سلام",u.jsx("br",{})]}),u.jsx("br",{}),"احتراماً بدینوسیله واحد"," ‌",(A=n==null?void 0:n.poultry)!=null&&A.unitName?(S=n==null?void 0:n.poultry)==null?void 0:S.unitName:"..................."," "," ‌","به مالکیت/ مستاجر"," ‌",(h=(d=n==null?void 0:n.poultry)==null?void 0:d.user)!=null&&h.fullname?(b=(j=n==null?void 0:n.poultry)==null?void 0:j.user)==null?void 0:b.fullname:"..................."," ‌","به کد سیستمی"," ‌",(v=n==null?void 0:n.poultry)!=null&&v.systemCode?(E=n==null?void 0:n.poultry)==null?void 0:E.systemCode:"..................."," ‌","به ظرفیت پروانه"," ‌",(L=n==null?void 0:n.poultry)!=null&&L.totalCapacity?($=n==null?void 0:n.poultry)==null?void 0:$.totalCapacity.toLocaleString():"..................."," ‌","قطعه و تعداد جوجه ریزي"," ",(z=n==null?void 0:n.hatching)==null?void 0:z.hatchingQuantity.toLocaleString()," قطعه در سالن با کد یکتا"," ‌"," ",(P=n==null?void 0:n.poultry)!=null&&P.breedingUniqueId?(s=n==null?void 0:n.poultry)==null?void 0:s.breedingUniqueId:"..................."," ‌","و مسئول فنی فارم آقاي/خانم"," ‌",(D=n==null?void 0:n.hatching)!=null&&D.vetFarmName?(a=n==null?void 0:n.hatching)==null?void 0:a.vetFarmName:"..................."," ‌","تلفن تماس:"," ‌",(M=n==null?void 0:n.hatching)!=null&&M.vetFarmMobile?(N=n==null?void 0:n.hatching)==null?void 0:N.vetFarmMobile:"..................."," ‌","در راستاي اجراي شیوه نامه ابلاغی مقام عالی وزارت جهاد کشاورزي براي کشتار"," ‌",n==null?void 0:n.quantity.toLocaleString()," ‌"," قطعه مرغ با میانگین وزنی",n!=null&&n.IndexWeight?n==null?void 0:n.IndexWeight:"..................."," ‌","کیلوگرم و سن "," ‌",(R=n==null?void 0:n.hatching)!=null&&R.age?(Y=n==null?void 0:n.hatching)==null?void 0:Y.age:"..................."," "," ‌","روز به تاریخ کشتار ",pu(r)," طبق جدول ذیل جهت اخذ مجوز کشتار به حضورتان معرفی می گردد. لازم به توضیح است قیمت مصوب دولتی"," ‌",l.toLocaleString()," ‌","ریال براي مرغ زنده ملاك فروش خواهد بود.",u.jsx("br",{}),u.jsx("br",{}),"اعتبار این معرفینامه از تاریخ صدور 24 ساعت می باشد."]}),u.jsxs("div",{style:uu.container,children:[u.jsx("p",{children:"اطلاعات تخصیص:"}),u.jsxs("table",{style:uu.invoiceTable,children:[u.jsx("thead",{style:uu.tableHeader,children:u.jsxs("tr",{style:uu.headerRow,children:[u.jsx("th",{style:uu.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:uu.tableHeaderCell,children:"خریدار"}),u.jsx("th",{style:uu.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:uu.tableHeaderCell,children:"وزن تقریبی بار"})]})}),u.jsx("tbody",{children:(K=n==null?void 0:n.provinceKillRequests)==null?void 0:K.map((y,C)=>{var i,k,B,T,Q;return u.jsxs("tr",{children:[u.jsx("td",{style:uu.tableCell,children:C+1}),u.jsx("td",{style:uu.tableCell,children:(B=(k=(i=y==null?void 0:y.killhouseUser)==null?void 0:i.killHouseOperator)==null?void 0:k.user)==null?void 0:B.fullname}),u.jsx("td",{style:uu.tableCell,children:(T=y==null?void 0:y.info)==null?void 0:T.quantity}),u.jsxs("td",{style:uu.tableCell,children:[" ",Math.round((Q=y==null?void 0:y.info)==null?void 0:Q.weight)]})]},C)})})]}),u.jsx("div",{style:{flexDirection:"row",marginTop:"20px"},children:u.jsx("div",{style:uu.signature,children:u.jsxs("div",{style:uu.contentInLine,children:[u.jsx("span",{style:uu.title,children:F}),u.jsxs("span",{style:uu.title,children:["مدیرعامل اتحادیه مرغداران"," ‌",g]})]})})})]})]})});i6.displayName="ProvinceQuarantineInvoice";i6.propTypes={item:u0.PropTypes.any};const Qr=()=>{var v;const[,,e,t,r,x]=c.useContext(su),f=c.useRef(),[p,n]=c.useState(""),[l,g]=c.useState(null),[F,A]=c.useState(null),S=m(),d=()=>{const E=S(Kr(b.values.userInfoCheck));A(E)},h=m0.useReactToPrint({content:()=>f.current,documentTitle:"فاکتور قرنطینه",onAfterPrint:()=>{A(null)}});c.useEffect(()=>{F&&h()},[F,h]);const j=ku({initialValues:{receiver:"",formNumber:"",price:""},validationSchema:Iu({receiver:gu().required("این فیلد اجباری است!").typeError("لطفا مشخصات دریافت کننده را وارد کنید!"),formNumber:gu().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),price:gu().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!")})}),b=ku({initialValues:{userInfoCheck:""},validationSchema:Iu({userInfoCheck:gu().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!")})});return c.useEffect(()=>{j.validateForm(),b.validateForm()},[]),c.useEffect(()=>{S(Vr(e)).then(E=>{n(E.payload.data),g(null)})},[e]),u.jsxs(o,{container:!0,mb:2,mt:2,alignItems:"center",justifyContents:"center",gap:2,px:2,children:[u.jsx(o,{item:!0,xs:12,children:u.jsx(Vu,{sx:{alignSlef:"center",textAlign:"center"},text:"صدور حواله کشتار"})}),u.jsx(o,{item:!0,xs:12,sm:6,md:4,lg:3,children:u.jsx(yu,{label:"تاریخ کشتار",id:"date",renderInput:E=>u.jsx(U,{...E,fullWidth:!0}),value:e,onChange:E=>{t(ou(E).format("YYYY-MM-DD"))}})}),u.jsx(o,{item:!0,xs:12,sm:6,md:4,lg:3,children:u.jsx(Hu,{sx:{width:"100%"},id:"userInfoCheck",getOptionDisabled:E=>E.disabled<=0,options:p?p==null?void 0:p.map(E=>{var L,$,z;return{id:E.orderCode,label:((L=E==null?void 0:E.poultry)==null?void 0:L.unitName)+` (${(z=($=E.poultry)==null?void 0:$.user)==null?void 0:z.mobile})`}}):[],getOptionLabel:E=>E.label,value:l,onChange:(E,L)=>{g(L),b.setFieldValue("userInfoCheck",L?L.id:"")},onBlur:b.handleBlur,renderInput:E=>u.jsx(U,{...E,label:"مرغدار",variant:"outlined",fullWidth:!0})})}),u.jsx(o,{item:!0,xs:12,sm:6,md:6,lg:6,children:u.jsx(U,{id:"receiver",label:"مثال: معاونت محترم توسعه بازرگانی و صنایع کشاورزی",value:j.values.receiver,error:j.touched.receiver?!!j.errors.receiver:null,onChange:j.handleChange,onBlur:j.handleBlur,helperText:j.touched.receiver&&j.errors.receiver?j.errors.receiver:null,autoComplete:"current-password",variant:"outlined",fullWidth:!0})}),u.jsx(o,{item:!0,xs:12,sm:6,md:4,lg:3,children:u.jsx(yu,{label:"تاریخ نامه",id:"date",renderInput:E=>u.jsx(U,{...E,fullWidth:!0}),value:r,onChange:E=>{x(ou(E).format("YYYY-MM-DD"))}})}),u.jsx(o,{item:!0,xs:12,sm:6,md:4,lg:3,children:u.jsx(U,{id:"formNumber",label:"شماره نامه",value:j.values.formNumber,error:j.touched.formNumber?!!j.errors.formNumber:null,onChange:j.handleChange,onBlur:j.handleBlur,helperText:j.touched.formNumber&&j.errors.formNumber?j.errors.formNumber:null,autoComplete:"current-password",variant:"outlined",fullWidth:!0})}),u.jsx(o,{item:!0,xs:12,sm:6,md:4,lg:3,children:u.jsx(ve,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"price",label:"قیمت روز مرغ (ریال)",variant:"outlined",value:j.values.price,error:j.touched.price?!!j.errors.price:null,onChange:j.handleChange,onBlur:j.handleBlur,helperText:j.touched.price&&j.errors.price?j.errors.price:null})}),u.jsx(o,{item:!0,xs:12,sm:6,md:4,lg:3,children:u.jsx(Lu,{title:"تولید خروجی PDF",children:u.jsx(W,{disabled:!(j.isValid&&b.values.userInfoCheck),onClick:d,variant:"contained",fullWidth:!0,children:"صدور نامه"})})}),u.jsx("div",{style:{display:"none",position:"absolute"},children:u.jsx(i6,{ref:f,sDate:e,date:r,fnumber:j.values.formNumber,receiver:j.values.receiver,item:(v=F==null?void 0:F.payload)==null?void 0:v.data,price:j.values.price})})]})},X={page:{width:"210mm",margin:"0 auto",display:"flex",flexDirection:"column",position:"relative",direction:"rtl",fontFamily:"nazanin",fontWeight:"bold"},container:{width:"95%",alignSelf:"center",pageBreakInside:"avoid"},invoiceTable:{width:"100%",borderCollapse:"collapse",alignSelf:"center"},tableCell:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:11},tableHeader:{pageBreakAfter:"auto"},headerRow:{color:"black",pageBreakInside:"avoid",pageBreakAfter:"auto"},tableRowEven:{backgroundColor:"rgba(170, 183, 255, 0.3)"},logo:{width:"60px",height:"auto",marginBottom:"10px"},contentContainer:{display:"flex",justifyContent:"space-between",marginTop:"20px",marginLeft:"100px",marginRight:"30px"},contentInLine:{display:"flex",flexDirection:"column",alignItems:"center"},mainTitle:{fontFamily:"nazanin",fontSize:11,pAlign:"center",fontWeight:"bolder"},signature:{display:"flex",flexDirection:"column",alignItems:"flex-end",marginLeft:"20px"},watermarkContainer:{position:"fixed",top:450,left:0,right:30,bottom:0,justifyContent:"center",alignItems:"center",opacity:.2,zIndex:-1},watermarkp:{fontSize:100,fontWeight:"bolder",color:"grey",transform:"rotate(-45deg)",left:"50%"},title:{fontSize:12,fontWeight:"bolder",pAlign:"center"},titleTopic:{marginTop:"10px",fontSize:12,fontWeight:"bolder",pAlign:"center"},firsttitle:{fontSize:14,fontWeight:"bolder",marginLeft:"40px",pAlign:"center"},options:{padding:"10px",marginTop:"15px",display:"flex",flexDirection:"column",alignItems:"flex-start"},divider:{width:"100%",height:"2px",backgroundColor:"red",marginBottom:15},pTitleContainer:{pAlign:"right",margin:"15px",textAlign:"justify",textJustify:"inter-word"},tableHeaderCell:{backgroundColor:"rgba(255, 229, 153, 0.5)",fontSize:10,border:"1px solid #000",padding:"4px",textAlign:"center",fontWeight:"bold"}},C6=c.forwardRef((e,t)=>{const{sDate:r}=e,{date:x}=e,{fnumber:f}=e,{receiver:p}=e,{item:n}=e,l=Z0(),g=q0(),F=n==null?void 0:n.reduce((d,h)=>d+((h==null?void 0:h.quantity)||0),0);function A(d){let h=0;return d==null||d.forEach(j=>{var b,v,E;(b=j==null?void 0:j.hatching)!=null&&b.totalWeight&&((v=j==null?void 0:j.hatching)==null?void 0:v.totalWeight)!==void 0&&(h+=(E=j==null?void 0:j.hatching)==null?void 0:E.totalWeight)}),h}const S=d=>{let h="";return d!=null&&d.directBuying?h="خرید مستقیم":d!=null&&d.union?h="خرید خارج از استان":h="اتحادیه",h};return u.jsxs("div",{style:X.page,ref:t,children:[u.jsxs("div",{style:X.contentContainer,children:[u.jsxs("div",{style:X.contentInLine,children:[u.jsx("img",{alt:"logo",src:r6,style:X.logo}),u.jsx("span",{style:X.mainTitle,children:"اتحادیه سراسری تعاونی‌های کشاورزی پرورش دهندگان مرغ گوشتی ایران"}),u.jsxs("span",{style:X.title,children:["اتحادیه شرکت های تعاونی کشاورزی مرغداران "," ‌"," ",l]})]}),u.jsx("div",{children:u.jsx("span",{style:X.firsttitle,children:"بسمه تعالی"})}),u.jsxs("div",{style:X.options,children:[u.jsxs("span",{style:X.title,children:["شماره: ",f]}),u.jsxs("span",{style:X.titleTopic,children:["تاریخ: ",pu(x)]}),u.jsx("span",{style:X.titleTopic,children:"پیوست:"})]})]}),u.jsx("hr",{style:X.divider}),u.jsxs("p",{style:X.pTitleContainer,children:[u.jsxs("strong",{style:{fontSize:"20px"},children:[p,u.jsx("br",{}),"با سلام",u.jsx("br",{})]}),u.jsx("br",{}),"احتراما گزارش درخواست کشتار مرغداران مرغ گوشتی استان مورخ"," ",pu(r),"، به حضورتان ارسال میگردد."]}),u.jsxs("div",{style:X.container,children:[u.jsxs("p",{style:{marginTop:"40px"},children:["اطلاعات درخواست:"," ",u.jsxs("span",{style:{color:"green",fontWeight:"boler"},children:[" ","تعداد درخواست کشتار (",F!==void 0&&F.toLocaleString()," ","قطعه)، وزن کل تقریبی (",A(n).toLocaleString()," ","کیلوگرم)."]})]}),u.jsxs("table",{style:X.invoiceTable,children:[u.jsx("thead",{style:X.tableHeader,children:u.jsxs("tr",{style:X.headerRow,children:[u.jsx("th",{style:X.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:X.tableHeaderCell,children:"کد سفارش"}),u.jsx("th",{style:X.tableHeaderCell,children:"نوع فروش"}),u.jsx("th",{style:X.tableHeaderCell,children:"تاریخ کشتار"}),u.jsx("th",{style:X.tableHeaderCell,children:"مرغدار"}),u.jsx("th",{style:X.tableHeaderCell,children:"شهر/تعاونی"}),u.jsx("th",{style:X.tableHeaderCell,children:"سن مرغ"}),u.jsx("th",{style:X.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:X.tableHeaderCell,children:"وزن تقریبی"}),u.jsx("th",{style:X.tableHeaderCell,children:"مانده در سالن"}),u.jsx("th",{style:X.tableHeaderCell,children:"تعداد درخواست کشتار"})]})}),u.jsx("tbody",{children:n==null?void 0:n.map((d,h)=>{var j,b,v,E,L,$,z,P,s,D,a,M,N,R;return u.jsxs("tr",{style:h%2===0?X.tableRowEven:{},children:[u.jsx("td",{style:X.tableCell,children:h+1}),u.jsx("td",{style:X.tableCell,children:d.orderCode}),u.jsx("td",{style:X.tableCell,children:S(d)}),u.jsx("td",{style:X.tableCell,children:pu(d==null?void 0:d.sendDate)}),u.jsx("td",{style:X.tableCell,children:`${(j=d==null?void 0:d.poultry)==null?void 0:j.unitName} (${(v=(b=d==null?void 0:d.poultry)==null?void 0:b.user)==null?void 0:v.mobile})`}),u.jsx("td",{style:X.tableCell,children:`${($=(L=(E=d==null?void 0:d.poultry)==null?void 0:E.address)==null?void 0:L.city)==null?void 0:$.name}/${(z=d==null?void 0:d.poultry)!=null&&z.cityOperator?(P=d==null?void 0:d.poultry)==null?void 0:P.cityOperator:"بدون تعاونی"}`}),u.jsx("td",{style:X.tableCell,children:(s=d==null?void 0:d.hatching)==null?void 0:s.age}),u.jsx("td",{style:X.tableCell,children:d==null?void 0:d.IndexWeight}),u.jsx("td",{style:X.tableCell,children:(a=(D=d==null?void 0:d.hatching)==null?void 0:D.totalWeight)==null?void 0:a.toLocaleString()}),u.jsx("td",{style:X.tableCell,children:(N=(M=d==null?void 0:d.hatching)==null?void 0:M.leftOver)==null?void 0:N.toLocaleString()}),u.jsx("td",{style:X.tableCell,children:(R=d==null?void 0:d.firstQuantity)==null?void 0:R.toLocaleString()})]},h)})})]})]}),u.jsxs("div",{style:{flexDirection:"row",marginTop:"20px"},children:[u.jsx("div",{style:X.signature,children:u.jsxs("div",{style:X.contentInLine,children:[u.jsx("span",{style:X.title,children:g}),u.jsxs("span",{style:X.title,children:["مدیرعامل اتحادیه مرغداران"," ‌",l]})]})}),u.jsx("div",{style:X.watermarkContainer,children:u.jsx("p",{style:X.watermarkp,children:"سامانه رصدیار "})})]})]})});C6.displayName="ProvinceSendLetterDeclarationNeedFactor";C6.propTypes={item:u0.PropTypes.any};const Hr=()=>{const[,,e,t,r,x]=c.useContext(su),f=c.useRef(),[p,n]=c.useState(null),l=m(),g=async()=>{try{l(q());let S=await J.get(`Poultry_Request/?role=${tu()}&today&date1=${e}&date2=${e}&search=filter&value=&page=1&page_size=1000`);l(V()),n(S.data.results)}catch(S){console.error(S)}},F=m0.useReactToPrint({content:()=>f.current,documentTitle:"گزارش اعلام کشتار مرغ",onAfterPrint:()=>{n(null)}});c.useEffect(()=>{p&&F()},[p,F]);const A=ku({initialValues:{receiver:"",formNumber:""},validationSchema:Iu({receiver:gu().required("این فیلد اجباری است!").typeError("لطفا مشخصات دریافت کننده را وارد کنید!"),formNumber:gu().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!")})});return c.useEffect(()=>{A.validateForm()},[]),u.jsxs(o,{container:!0,mb:2,mt:2,alignItems:"center",justifyContents:"center",gap:2,px:2,children:[u.jsx(o,{item:!0,xs:12,children:u.jsx(Vu,{sx:{alignSlef:"center",textAlign:"center"},text:"صدور نامه اعلام نیاز کشتار مرغدار"})}),u.jsx(o,{item:!0,xs:12,sm:6,md:6,lg:6,children:u.jsx(U,{id:"receiver",label:"مثال: معاونت محترم توسعه بازرگانی و صنایع کشاورزی",value:A.values.receiver,error:A.touched.receiver?!!A.errors.receiver:null,onChange:A.handleChange,onBlur:A.handleBlur,helperText:A.touched.receiver&&A.errors.receiver?A.errors.receiver:null,autoComplete:"current-password",variant:"outlined",fullWidth:!0})}),u.jsx(o,{item:!0,xs:12,sm:6,md:4,lg:3,children:u.jsx(U,{id:"formNumber",label:"شماره نامه را وارد کنید",value:A.values.formNumber,error:A.touched.formNumber?!!A.errors.formNumber:null,onChange:A.handleChange,onBlur:A.handleBlur,helperText:A.touched.formNumber&&A.errors.formNumber?A.errors.formNumber:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(o,{item:!0,xs:12,sm:6,md:4,lg:3,children:u.jsx(yu,{label:"تاریخ کشتار",id:"date",renderInput:S=>u.jsx(U,{...S,fullWidth:!0}),value:e,onChange:S=>{t(ou(S).format("YYYY-MM-DD"))}})}),u.jsx(o,{item:!0,xs:12,sm:6,md:4,lg:3,children:u.jsx(yu,{label:"تاریخ نامه",id:"date",renderInput:S=>u.jsx(U,{...S,fullWidth:!0}),value:r,onChange:S=>{x(ou(S).format("YYYY-MM-DD"))}})}),u.jsx(o,{item:!0,xs:12,sm:6,md:4,lg:3,children:u.jsx(Lu,{title:"تولید خروجی PDF",children:u.jsx(W,{fullWidth:!0,disabled:!A.isValid,onClick:()=>{g()},variant:"contained",children:"صدور نامه"})})}),u.jsx("div",{style:{display:"none",position:"absolute"},children:u.jsx(C6,{ref:f,sDate:e,date:r,fnumber:A.values.formNumber,receiver:A.values.receiver,item:p})})]})},Gr=()=>{const[e,t]=c.useState("1"),r=(x,f)=>{t(f)};return u.jsxs(o,{xs:12,children:[u.jsx(o,{container:!0,alignItems:"center",justifyContent:"center",xs:12,children:u.jsxs(g0,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:e,onChange:r,children:[u.jsx(Nu,{label:"گزارش کشتار روزانه",value:"1"}),u.jsx(Nu,{label:"صدور حواله کشتار",value:"2"}),u.jsx(Nu,{label:"گزارش اعلام کشتار مرغدار",value:"3"})]})}),u.jsxs(o,{xs:12,children:[e==="1"&&u.jsx(Yr,{}),e==="2"&&u.jsx(Qr,{}),e==="3"&&u.jsx(Hr,{})]})]})},Xr=()=>{const{pathname:e}=u6(),t=m(),r=(x,f)=>tu()==="SuperAdmin"?x:f;return u.jsxs(o,{container:!0,gap:w.SMALL,p:w.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",style:{placeContent:"baseline"},children:[u.jsxs(o,{container:!0,direction:"column",style:{width:"100%"},children:[u.jsx(o,{children:u.jsx(Vu,{text:"مدیریت درخواست ها"})}),u.jsxs(o,{container:!0,justifyContent:"center",gap:w.SMALL,children:[u.jsx(lu,{to:r(B0,m6),active:e===B0?"true":null,children:u.jsx(au,{icon:u.jsx(ce,{size:30,color:"#244CCC"}),title:"درخواست های کشتار",description:"درخواست های کشتار مرغدار در انتظار بررسی"})}),u.jsx(lu,{to:r(U0,ue),active:e===U0?"true":null,children:u.jsx(au,{icon:u.jsx(xe,{size:30,color:"#244CCC"}),title:"اعلام نیاز خریداران",description:"درخواست های کشتار در انتظار بررسی"})}),u.jsx(lu,{to:r(W0,ee),active:e===W0?"true":null,children:u.jsx(au,{icon:u.jsx(Wu,{size:30,color:"#244CCC"}),title:"تخصیصات",description:"مشاهده و تخصیص درخواست ها"})}),u.jsx(lu,{to:r(D6,un),active:e===D6?"true":null,children:u.jsx(au,{icon:u.jsx(ie,{size:30,color:"#244CCC"}),title:"تعرفه ها"})})]})]}),u.jsxs(o,{container:!0,direction:"column",style:{width:"100%"},children:[u.jsx(o,{children:u.jsx(Vu,{text:"ویژه"})}),u.jsxs(o,{container:!0,justifyContent:"center",gap:w.SMALL,children:[u.jsx(lu,{to:r(Ju,Ju),active:e===Ju?"true":null,children:u.jsx(au,{icon:u.jsx(G0,{size:30,color:"#244CCC"}),title:"خرید مستقیم"})}),u.jsx(lu,{to:r(D0,D0),active:e===D0?"true":null,children:u.jsx(au,{icon:u.jsx(G0,{size:30,color:"#244CCC"}),title:"پنل معاملات"})}),u.jsx(lu,{to:r(Y0,ne),active:e===Y0?"true":null,children:u.jsx(au,{icon:u.jsx(pe,{size:30,color:"#244CCC"}),title:"صادرات"})}),u.jsx(lu,{to:r(te,re),children:u.jsx(au,{icon:u.jsx(Wu,{size:30,color:"#244CCC"}),title:"فروش خارج از استان"})}),u.jsx(lu,{to:r(V0,le),active:e===V0?"true":null,children:u.jsx(au,{icon:u.jsx(Wu,{size:30,color:"#244CCC"}),title:"تخصیصات خودکار"})}),u.jsx(lu,{to:r(K0,ae),active:e===K0?"true":null,children:u.jsx(au,{icon:u.jsx(Ce,{size:30,color:"#244CCC"}),title:"زنجیره ها"})})]})]}),u.jsxs(o,{container:!0,direction:"column",style:{width:"100%"},children:[u.jsx(o,{children:u.jsx(Vu,{text:"نظارت درخواست ها"})}),u.jsxs(o,{container:!0,justifyContent:"center",placeContent:"baseline",gap:w.SMALL,children:[u.jsx(lu,{to:r(Q0,se),active:e===Q0?"true":null,children:u.jsx(au,{icon:u.jsx(Wu,{size:30,color:"#244CCC"}),title:"مدیریت تخصیصات"})}),u.jsx(lu,{to:r(H0,oe),active:e===H0?"true":null,children:u.jsx(au,{icon:u.jsx(de,{className:"svg-icon-color",color:"#244CCC",size:30}),title:"صدور نامه",description:"ارسال نامه سیستمی"})}),u.jsx(lu,{onClick:()=>t(wu({title:"اطلاعات گزارش",content:u.jsx(G6,{})})),children:u.jsx(au,{icon:u.jsx(he,{className:"svg-icon-color",color:"#244CCC",size:30}),title:"گزارش روزانه",description:"گزارش روزانه"})}),u.jsx(lu,{to:r(L6,en),active:e===L6?"true":null,children:u.jsx(au,{icon:u.jsx(Ae,{size:30,style:{color:"#4285F4"},color:"#244CCC"}),title:"تراکنش ها"})})]})]})]})},Jr=Au("PROVINCE_CHAINS_SUBMIT_COMPANY",async(e,{dispatch:t})=>{try{t(q());const{data:r,status:x}=await J.post("chain-company/",e);return t(V()),{data:r,status:x}}catch(r){return t(V()),{error:r.response.data.result}}}),Zr=Au("PROVINCE_CHAINS_EDIT_COMPANY",async(e,{dispatch:t})=>{try{t(q());const{data:r,status:x}=await J.put("chain-company/0/",e);return t(V()),{data:r,status:x}}catch(r){return t(V()),{error:r.response.data.result}}}),$6=({item:e})=>{var g,F,A,S,d,h,j,b;const t=m(),[r]=c.useContext(su),[x,f]=c.useState([]),[p,n]=c.useState([]),l=ku({initialValues:{mobile:(g=e==null?void 0:e.user)!=null&&g.mobile?(F=e==null?void 0:e.user)==null?void 0:F.mobile:"",name:e!=null&&e.name?e==null?void 0:e.name:"",firstname:(A=e==null?void 0:e.user)!=null&&A.firstName?(S=e==null?void 0:e.user)==null?void 0:S.firstName:"",lastname:(d=e==null?void 0:e.user)!=null&&d.lastName?(h=e==null?void 0:e.user)==null?void 0:h.lastName:"",natioanlId:(j=e==null?void 0:e.user)!=null&&j.nationalId?(b=e==null?void 0:e.user)==null?void 0:b.nationalId:"",postal:e!=null&&e.postalCode?e==null?void 0:e.postalCode:"",province:e!=null&&e.province?e==null?void 0:e.province:"",city:e!=null&&e.city?e==null?void 0:e.city:"",address:e!=null&&e.address?e==null?void 0:e.address:""},validationSchema:Iu({mobile:$u().required("این فیلد اجباری است!").typeError("لطفا فیلد را به صورت عددی وارد کنید!").test("len","شماره تلفن باید با 0 شروع شود",(v,E)=>E.originalValue&&E.originalValue.startsWith("0")).test("len","شماره تماس 11 رقم باید باشد",(v,E)=>{if(E.originalValue)return E.originalValue.length===11}),name:gu().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!"),firstname:gu().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!"),lastname:gu().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!"),province:gu().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),city:gu().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),address:gu().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!"),natioanlId:$u().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!"),postal:$u().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!")})});return c.useEffect(()=>{l.validateForm()},[]),c.useEffect(()=>{t(Wn()).then(v=>{f(v.payload.data)})},[]),c.useEffect(()=>{l.values.province&&n([],t(Yn(l.values.province)).then(v=>{n(v.payload.data)}))},[l.values.province]),u.jsxs(o,{container:!0,gap:w.SMALL,direction:"column",justifyContent:"space-between",children:[u.jsxs(o,{container:!0,direction:"column",gap:w.SMALL,children:[u.jsx(o,{children:u.jsx(U,{fullWidth:!0,id:"name",label:"نام شرکت",variant:"outlined",value:l.values.name,error:l.touched.name?!!l.errors.name:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.name&&l.errors.name?l.errors.name:null})}),u.jsx(o,{children:u.jsx(U,{fullWidth:!0,id:"firstname",label:"نام مدیرعامل",variant:"outlined",value:l.values.firstname,error:l.touched.firstname?!!l.errors.firstname:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.firstname&&l.errors.firstname?l.errors.firstname:null})}),u.jsx(o,{children:u.jsx(U,{fullWidth:!0,id:"lastname",label:"نام خانوادگی مدیرعامل",variant:"outlined",value:l.values.lastname,error:l.touched.lastname?!!l.errors.lastname:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.lastname&&l.errors.lastname?l.errors.lastname:null})}),u.jsx(o,{children:u.jsx(U,{fullWidth:!0,id:"mobile",label:"موبایل",variant:"outlined",value:l.values.mobile,error:l.touched.mobile?!!l.errors.mobile:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.mobile&&l.errors.mobile?l.errors.mobile:null})}),u.jsxs(o,{children:[u.jsx(Hu,{style:{width:"100%"},disablePortal:!0,id:"province",options:x?x.map(v=>({id:v.name,label:v.name})):[],onChange:(v,E)=>{l.setFieldValue("province",E?E.id:""),l.setFieldValue("city","")},renderInput:v=>u.jsx(U,{...v,label:"استان را انتخاب کنید"})}),e&&u.jsxs(H,{variant:"caption",color:"error",children:["استان: ",l.values.province]})]}),u.jsxs(o,{children:[u.jsx(Hu,{minWidth:210,style:{width:"100%"},disabled:!l.values.province,disablePortal:!0,id:"city",options:p?p.map(v=>({id:v.name,label:v.name})):[],onChange:(v,E)=>{l.setFieldValue("city",E?E.id:"")},renderInput:v=>u.jsx(U,{...v,label:"شهر را انتخاب کنید"})}),e&&u.jsxs(H,{variant:"caption",color:"error",children:["شهر: ",l.values.city]})]}),u.jsx(o,{children:u.jsx(U,{fullWidth:!0,id:"natioanlId",label:"کد ملی",variant:"outlined",value:l.values.natioanlId,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.natioanlId?!!l.errors.natioanlId:null,helperText:l.touched.natioanlId&&l.errors.natioanlId?l.errors.natioanlId:null})}),u.jsx(o,{children:u.jsx(U,{fullWidth:!0,id:"address",label:"آدرس",variant:"outlined",sx:{width:"100%"},value:l.values.address,error:l.touched.address?!!l.errors.address:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.address&&l.errors.address?l.errors.address:null})}),u.jsx(o,{children:u.jsx(U,{fullWidth:!0,id:"postal",label:"کد پستی",variant:"outlined",value:l.values.postal,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.postal?!!l.errors.postal:null,helperText:l.touched.postal&&l.errors.postal?l.errors.postal:null})})]}),u.jsx(o,{children:u.jsx(W,{variant:"contained",fullWidth:!0,onClick:()=>{e?t(Zr({city:l.values.city,province:l.values.province,mobile:l.values.mobile,first_name:l.values.firstname,last_name:l.values.lastname,national_id:l.values.natioanlId,address:l.values.address,postal_code:l.values.postal,name:l.values.name,company_key:e==null?void 0:e.key})).then(v=>{v.payload.error?r({vertical:"top",horizontal:"center",msg:v.payload.error,severity:"error"}):(t(bu({right:!1,bottom:!1,content:null})),t(j0()),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}):t(Jr({city:l.values.city,province:l.values.province,mobile:l.values.mobile,first_name:l.values.firstname,last_name:l.values.lastname,national_id:l.values.natioanlId,address:l.values.address,postal_code:l.values.postal,name:l.values.name})).then(v=>{v.payload.error?r({vertical:"top",horizontal:"center",msg:v.payload.error,severity:"error"}):(t(j0()),t(bu({right:!1,bottom:!1,content:null})),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت"})})]})},qr=()=>{const[,,e,t,r,x]=c.useContext(su),f=Fu(a=>a.userSlice.userProfile.key),p=m();c.useEffect(()=>{const a=ou(new Date).format("YYYY-MM-DD");t(a),x(a)},[t,x]);const[n,l]=c.useState([]),[g,F]=c.useState(0),[A,S]=c.useState(10),[d,h]=c.useState(""),[j,b]=c.useState(1),[v,E]=c.useState([]),L=a=>{h(a.target.value)},$=()=>!(tu()==="AdminX"||tu()==="SuperAdmin"||tu()==="ProvinceOperator"),z=async(a=1)=>{try{p(q());const M=await J.get(`chain-company/?search=filter&value=${d}&page=${a}&page_size=${A}&role=${tu()}&state=total_companies`);p(V()),l(M.data.results),F(M.data.count)}catch(M){p(V()),console.error("Error fetching data:",M)}},P=a=>{b(a),z(a)},s=a=>{S(a),b(1)};c.useEffect(()=>{z()},[e,r,A]),c.useEffect(()=>{const a=n==null?void 0:n.map((M,N)=>{var R,Y,K,y,C,i;return[j===1?N+1:N+A*(j-1)+1,M.name,M.user.firstName,M.user.lastName,M.user.mobile,M.province,M.city,M.address,M.postalCode,(Y=(R=M.requestsInfo)==null?void 0:R.numberOfRequests)==null?void 0:Y.toLocaleString(),(y=(K=M.requestsInfo)==null?void 0:K.totalQuantity)==null?void 0:y.toLocaleString(),(i=(C=M.requestsInfo)==null?void 0:C.totalWeight)==null?void 0:i.toLocaleString(),u.jsx(Lu,{title:"ویرایش اطلاعات",placement:"left",children:u.jsx(xu,{disabled:$(),color:"primary",onClick:()=>p(bu({title:"ویرایش شرکت زنجیره",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx($6,{item:M})})),children:u.jsx(ge,{})})},N)]});E(a)},[n,j,A]);const D=async a=>{a.preventDefault(),z(1)};return u.jsxs(o,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(o,{container:!0,xs:12,children:(tu()==="ProvinceOperator"||tu()==="SuperAdmin")&&u.jsx(W,{onClick:()=>p(bu({title:"ثبت شرکت زنجیره",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx($6,{})})),variant:"contained",children:"ثبت شرکت زنجیره"})}),u.jsx(o,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:u.jsxs(o,{container:!0,alignItems:"center",justifyContent:"center",gap:2,paddingTop:2,mb:1,width:"100%",children:[u.jsx(H,{children:"خریداران"}),u.jsxs(o,{container:!0,alignItems:"center",gap:2,children:[u.jsxs("form",{onSubmit:D,children:[u.jsx(U,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:L}),u.jsx(W,{type:"submit",endIcon:u.jsx(Ku,{}),children:"جستجو"})]}),u.jsx(o,{children:u.jsx(Lu,{title:"خروجی اکسل شرکت های زنجیره",children:u.jsx("a",{href:`${J.defaults.baseURL}chain_company_buyers_excel/?role=${tu()}&key=${f}&search=filter&value=${d}`,rel:"noreferrer",children:u.jsx(W,{color:"success",children:u.jsx(mu,{size:32})})})})})]})]})}),u.jsx(zu,{data:v,columns:["ردیف","نام شرکت","نام مدیرعامل","نام خانوادگی مدیرعامل","موبایل","استان","شهر","آدرس","کد پستی","تعداد سفارشات","حجم سفارشات (قطعه)","وزن سفارشات (کیلوگرم)","عملیات"],handlePageChange:P,totalRows:g,page:j,perPage:A,handlePerRowsChange:s,title:"مدیریت بارها"})]})};var d6={},mr=e0;Object.defineProperty(d6,"__esModule",{value:!0});var Te=d6.default=void 0,ut=mr(n0()),et=u;Te=d6.default=(0,ut.default)((0,et.jsx)("path",{d:"M11 6c1.38 0 2.63.56 3.54 1.46L12 10h6V4l-2.05 2.05C14.68 4.78 12.93 4 11 4c-3.53 0-6.43 2.61-6.92 6H6.1c.46-2.28 2.48-4 4.9-4m5.64 9.14c.66-.9 1.12-1.97 1.28-3.14H15.9c-.46 2.28-2.48 4-4.9 4-1.38 0-2.63-.56-3.54-1.46L10 12H4v6l2.05-2.05C7.32 17.22 9.07 18 11 18c1.55 0 2.98-.51 4.14-1.36L20 21.49 21.49 20z"}),"FindReplace");const nt=Au("PROVINCE_CHAINS_DELETE_CHAIN",async(e,{dispatch:t})=>{try{t(q());const{data:r,status:x}=await J.put("poultry-choose-chain-company/0/",e);return t(V()),{data:r,status:x}}catch(r){return t(V()),{error:r.response.data.result}}}),rt=Au("PROVINCE_CHAINS_REPLACE_ACTIVE_CHAIN",async(e,{dispatch:t})=>{try{t(q());const{data:r,status:x}=await J.put("poultry-choose-chain-company/0/",e);return t(V()),{data:r,status:x}}catch(r){return t(V()),{error:r.response.data.result}}}),tt=({item:e,updateTable:t})=>{const r=m(),[x,f]=c.useState([]),[p,n]=c.useState(""),[l]=c.useContext(su);return c.useEffect(()=>{r(j0()).then(g=>{f(g.payload.data)})},[]),u.jsxs(o,{container:!0,gap:w.SMALL,direction:"column",justifyContent:"space-between",children:[u.jsx(o,{container:!0,direction:"column",gap:w.SMALL,children:u.jsx(o,{children:u.jsx(Hu,{disablePortal:!0,id:"province",options:x?x==null?void 0:x.map(g=>({id:g.key,label:`${g.name} (${g.user.mobile})`})):[],onChange:(g,F)=>{n(F.id)},renderInput:g=>u.jsx(U,{...g,label:"شرکت زنجیره"})})})}),u.jsx(o,{children:u.jsx(W,{disabled:!p,variant:"contained",fullWidth:!0,onClick:()=>{r(rt({type:"replace",hatching_key:e==null?void 0:e.key,company_key:p})).then(g=>{g.payload.error?l({vertical:"top",horizontal:"center",msg:g.payload.error,severity:"error"}):(t(),l({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت"})})]})};var h6={},lt=e0;Object.defineProperty(h6,"__esModule",{value:!0});var Ne=h6.default=void 0,at=lt(n0()),st=u;Ne=h6.default=(0,at.default)((0,st.jsx)("path",{d:"M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zM12 20c-4.41 0-8-3.59-8-8s3.59-8 8-8c1.57 0 3.04.46 4.28 1.25l1.45-1.45C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10c1.73 0 3.36-.44 4.78-1.22l-1.5-1.5c-1 .46-2.11.72-3.28.72m7-5h-3v2h3v3h2v-3h3v-2h-3v-3h-2z"}),"AddTask");const ot=({item:e,updateTable:t})=>{const[r,x]=c.useState(null),f=m(),[p]=c.useContext(su),n=A=>{x(A.currentTarget)},l=()=>{x(null)},g=!!r,F=g?"popover":void 0;return u.jsxs("div",{children:[u.jsx(xu,{"aria-describedby":F,variant:"contained",color:"primary",onClick:n,children:u.jsx(ye,{})}),u.jsx(y0,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{mt:1}}},id:F,open:g,anchorEl:r,onClose:l,children:u.jsxs(Q6,{sx:{p:1},children:[u.jsxs(d0,{onClick:()=>{l(),f(bu({title:"تخصیص به زنجیره",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Qn,{item:e,updateTable:t})}))},sx:{borderRadius:1,mb:.5,color:"primary.main","&:last-of-type":{mb:0}},children:[u.jsx(s0,{sx:{color:"primary.main",minWidth:36},children:u.jsx(Ne,{sx:{fontSize:{xs:20,md:18}}})}),u.jsx(o0,{primary:u.jsx(H,{sx:{color:"primary.main",fontWeight:600,fontSize:{xs:"13px",md:"14px"}},children:"تخصیص به زنجیره"})})]}),u.jsxs(d0,{onClick:()=>{l(),f(bu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"جایگزین کردن مرغداری ",content:u.jsx(tt,{item:e,updateTable:t})}))},sx:{borderRadius:1,mb:.5,color:"info.main","&:last-of-type":{mb:0}},children:[u.jsx(s0,{sx:{color:"info.main",minWidth:36},children:u.jsx(Te,{sx:{fontSize:{xs:20,md:18}}})}),u.jsx(o0,{primary:u.jsx(H,{sx:{color:"info.main",fontWeight:600,fontSize:{xs:"13px",md:"14px"}},children:"جایگزین کردن"})})]}),u.jsxs(d0,{onClick:()=>{l(),f(bu({title:"انتقال به آرشیو",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Vn,{item:e,updateTable:t})}))},sx:{borderRadius:1,mb:.5,color:"secondary.main","&:last-of-type":{mb:0}},children:[u.jsx(s0,{sx:{color:"secondary.main",minWidth:36},children:u.jsx(q6,{sx:{fontSize:{xs:20,md:18}}})}),u.jsx(o0,{primary:u.jsx(H,{sx:{color:"secondary.main",fontWeight:600,fontSize:{xs:"13px",md:"14px"}},children:"انتقال به بایگانی"})})]}),u.jsxs(d0,{onClick:()=>{l(),f(nt({type:"delete",hatching_key:e==null?void 0:e.key})).then(A=>{A.payload.error?p({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"}):(t(),p({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},sx:{borderRadius:1,mb:.5,color:"error.main","&:last-of-type":{mb:0}},children:[u.jsx(s0,{sx:{color:"error.main",minWidth:36},children:u.jsx(n6,{sx:{fontSize:{xs:20,md:18}}})}),u.jsx(o0,{primary:u.jsx(H,{sx:{color:"error.main",fontWeight:600,fontSize:{xs:"13px",md:"14px"}},children:"خروج از زنجیره"})})]})]})})]})},ct=Au("PROVINCE_CHAINS_SUBMIT_ACTIVE_CHAIN",async(e,{dispatch:t})=>{try{t(q());const{data:r,status:x}=await J.post("poultry-choose-chain-company/",e);return t(V()),{data:r,status:x}}catch(r){return t(V()),{error:r.response.data.result}}}),it=({updateTable:e})=>{const t=m(),[r,x]=c.useState([]),[f,p]=c.useState([]),[n,l]=c.useState([]),[g,F]=c.useState([]),[A,S]=c.useState(""),[d]=c.useContext(su);return c.useEffect(()=>{t(Sn({chain:!0})).then(h=>{p(h.payload.data)}),t(j0()).then(h=>{l(h.payload.data)})},[]),c.useEffect(()=>{x(f==null?void 0:f.map(h=>{var j;return{label:`${h.unitName} (${h==null?void 0:h.user.mobile})`,value:`${(j=h.chainCompany)==null?void 0:j.hatchingKey}`}}))},[f]),u.jsxs(o,{container:!0,gap:w.SMALL,direction:"column",justifyContent:"space-between",children:[u.jsxs(o,{container:!0,direction:"column",gap:w.SMALL,children:[u.jsx(o,{children:u.jsx(Hu,{disablePortal:!0,id:"province",multiple:!0,options:r,getOptionLabel:h=>h.label,onChange:(h,j)=>{F(j)},renderInput:h=>u.jsx(U,{...h,label:"انتخاب مرغداران"})})}),u.jsx(o,{children:u.jsx(Hu,{disablePortal:!0,id:"province",options:n?n==null?void 0:n.map(h=>({id:h.key,label:`${h.name} (${h.user.mobile})`})):[],onChange:(h,j)=>{S(j.id)},renderInput:h=>u.jsx(U,{...h,label:"شرکت زنجیره"})})})]}),u.jsx(o,{children:u.jsx(W,{disabled:!g.length||!A,variant:"contained",fullWidth:!0,onClick:()=>{t(ct({poultry_hitchings:g==null?void 0:g.map(h=>h==null?void 0:h.value),chain_company:A})).then(h=>{h.payload.error?d({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(e(),d({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد!",severity:"success"}),t(bu({right:!1,bottom:!1,content:null})))})},children:"ثبت"})})]})},Ct=()=>{const e=m(),[t,r]=c.useState(0),[x,f]=c.useState(0),p=Fu(y=>y.userSlice.userProfile.key),n=y=>{b(y.target.value)},[l]=c.useContext(su),[g,F]=c.useState([]),[A,S]=c.useState(0),[d,h]=c.useState(10),[j,b]=c.useState(""),[v,E]=c.useState(1),[L,$]=c.useState([]),z=async y=>{let C;e(q()),C=await J.get(`poultry_hatching?search=filter&value=${j}&role=${tu()}&page=${y}&page_size=${d}&chain=true`),e(V()),F(C.data.results),S(C.data.count)},P=y=>{z(y),E(y)},s=y=>{h(y),E(1)},D=()=>{z(v!==0?v:1)},a=y=>{let C="";return C=y.quantity-y.losses-y.leftOver,C};c.useEffect(()=>{const y=g==null?void 0:g.map((C,i)=>{var B,T,Q,nu,Z,eu,ju,cu,iu,O,_,Cu,vu,Su,Pu,Ou,I,ru,du,hu,fu,_u,Du,Mu,Ru,Bu,Uu;let k;return[u.jsx(ot,{item:C,updateTable:D},i),v===1?i+1:i+d*(v-1)+1,`${(B=C==null?void 0:C.chainCompany)==null?void 0:B.name} (${(T=C==null?void 0:C.chainCompany)==null?void 0:T.user.mobile})`,C.violation?"متخلف":"عادی",C.poultry.unitName,`${C.poultry.userprofile.fullName} (${C.poultry.userprofile.mobile})`,`${(Q=C==null?void 0:C.poultry)==null?void 0:Q.address.city.name}/${(nu=C==null?void 0:C.poultry)!=null&&nu.cityOperator?(Z=C==null?void 0:C.poultry)==null?void 0:Z.cityOperator:"بدون تعاونی"}`,(eu=C==null?void 0:C.vetFarm)!=null&&eu.vetFarmMobile?`${(ju=C==null?void 0:C.vetFarm)==null?void 0:ju.vetFarmFullName} (${(cu=C==null?void 0:C.vetFarm)==null?void 0:cu.vetFarmMobile})`:"-",C.hall,C.period,k6(C==null?void 0:C.createDate),k6(C==null?void 0:C.date),C.chickenBreed,C.age,(iu=C==null?void 0:C.quantity)==null?void 0:iu.toLocaleString(),`${C.losses} (%${(C.losses*100/C.quantity).toFixed(0)})`,`${(O=C==null?void 0:C.totalCommitmentQuantity)==null?void 0:O.toLocaleString()}`,`${(_=C==null?void 0:C.governmentalQuantity)==null?void 0:_.toLocaleString()}`,`${(Cu=C==null?void 0:C.governmentalKilledQuantity)==null?void 0:Cu.toLocaleString()}`,`${(vu=C==null?void 0:C.freeQuantity)==null?void 0:vu.toLocaleString()}`,`${(Su=C==null?void 0:C.freeKilledQuantity)==null?void 0:Su.toLocaleString()}`,`${(Pu=C==null?void 0:C.outProvinceKilledQuantity)==null?void 0:Pu.toLocaleString()}`,`${(Ou=C==null?void 0:C.outProvinceKilledWeight)==null?void 0:Ou.toLocaleString()}`,(I=C==null?void 0:C.chainKilledQuantity)==null?void 0:I.toLocaleString(),(ru=C==null?void 0:C.chainKilledWeight)==null?void 0:ru.toLocaleString(),((du=a(C))==null?void 0:du.toLocaleString())+` (%${(a(C)*100/C.quantity).toFixed(0)})`,`${(hu=C==null?void 0:C.leftOver)==null?void 0:hu.toLocaleString()} (%${(C.leftOver*100/C.quantity).toFixed(0)})`,((fu=C==null?void 0:C.totalCommitment)==null?void 0:fu.toLocaleString())+" کیلوگرم ",((_u=C==null?void 0:C.governmentalKilledQuantity)==null?void 0:_u.toLocaleString())+" کیلوگرم ",((Du=C==null?void 0:C.freeKilledQuantity)==null?void 0:Du.toLocaleString())+" کیلوگرم ",((Mu=C==null?void 0:C.totalAverageKilledWeight)==null?void 0:Mu.toLocaleString())+" کیلوگرم ",((Ru=C==null?void 0:C.totalKilledWeight)==null?void 0:Ru.toLocaleString())+" کیلوگرم ",(Bu=C==null?void 0:C.activeKill)!=null&&Bu.activeKill?"دارد":"ندارد",(Uu=C==null?void 0:C.activeKill)!=null&&Uu.countOfRequest?C.activeKill.countOfRequest:"-",k=C.lastChange?`${C.lastChange.fullName} (${i0(C.lastChange.role)}) در تاریخ ${C.lastChange.date}`:"-",k=C.latestHatchingChange&&C.latestHatchingChange.date&&`${C.latestHatchingChange.fullName} (${i0(C.latestHatchingChange.role)}) در تاریخ ${C.latestHatchingChange.date}`,C.latestHatchingChange?k:"-"]});$(y)},[g]),c.useEffect(()=>{z(1)},[e,d]);const M=async y=>{y.preventDefault(),e(q());try{const C=await J.get(`poultry_hatching/?role=${tu()}&search=filter&value=${j}&chain=true`);F(C.data.results),S(C.data.count),e(V())}catch(C){console.error("Error fetching data:",C)}},N=async y=>{y.preventDefault(),r(null),f(null);try{const C=await J.get(`poultry_hatching/?role=${tu()}&chain=true&search=filter&value=`);F(C.data.results),S(C.data.count)}catch(C){console.error("Error fetching data:",C)}},R=async y=>{y.preventDefault(),e(q());try{const C=await J.get(`poultry_hatching?role=${tu()}&age1=${t}&age2=${x}&chain=true`);F(C.data.results),S(C.data.count),e(V())}catch(C){console.error("Error fetching data:",C)}},Y=Array.from({length:75},(y,C)=>C+1),K=u.jsxs(o,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,children:[u.jsxs(o,{container:!0,alignItems:"center",gap:w.SMALL,style:{padding:"10px",border:"1px solid #bbb",borderRadius:"10px"},children:[u.jsx(H,{children:"زنجیره های فعال"}),u.jsxs("form",{onSubmit:M,children:[u.jsx(U,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:n}),u.jsx(W,{type:"submit",onClick:M,endIcon:u.jsx(Ku,{}),children:"جستجو"}),u.jsx(Lu,{title:"خروجی اکسل",children:u.jsx(W,{color:"success",onClick:()=>{l({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const y=`${J.defaults.baseURL}0/hatching_excel/?role=${tu()}&key=${p}&chain=true`;window.location.href=y},children:u.jsx(mu,{size:32})})})]})]}),u.jsxs(o,{container:!0,alignItems:"center",gap:w.SMALL,style:{padding:"10px",border:"1px solid #bbb",borderRadius:"10px"},children:[u.jsx(o,{children:u.jsx(H,{variant:"caption",children:"جستجو براساس سن:"})}),u.jsx(o,{style:{width:"80px"},children:u.jsxs(k0,{fullWidth:!0,children:[u.jsx(T0,{id:"demo-simple-select-label",children:"از سن"}),u.jsx(N0,{MenuProps:{PaperProps:{style:{maxHeight:200,width:80}}},labelId:"demo-simple-select-label",id:"demo-simple-select",value:t,label:"از سن",size:"small",onChange:y=>r(y.target.value),children:Y.map(y=>u.jsx(Tu,{value:y,children:y},y))})]})}),u.jsx(o,{style:{width:"80px"},children:u.jsxs(k0,{fullWidth:!0,children:[u.jsx(T0,{id:"demo-simple-select-label",children:"تا سن"}),u.jsx(N0,{MenuProps:{PaperProps:{style:{maxHeight:200,width:80}}},labelId:"demo-simple-select-label",id:"demo-simple-select",value:x,label:"تا سن",size:"small",onChange:y=>f(y.target.value),children:Y.map(y=>u.jsx(Tu,{value:y,children:y},y))})]})}),u.jsx(W,{onClick:R,endIcon:u.jsx(Ku,{}),children:"جستجو"}),u.jsx(Lu,{title:"خروجی اکسل",children:u.jsx(W,{color:"success",onClick:()=>{l({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const y=`${J.defaults.baseURL}hatching_report_from_age_excel/?age1=${t}&age2=${x}&chain=true`;window.location.href=y},children:u.jsx(mu,{size:32})})})]}),u.jsx(W,{onClick:N,color:"error",children:"حذف فیلتر"})]});return u.jsxs(o,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(o,{container:!0,xs:12,children:u.jsx(W,{onClick:()=>{e(bu({title:"ثبت زنجیره فعال",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(it,{updateTable:D})}))},variant:"contained",children:"ثبت زنجیره فعال"})}),K,u.jsx(zu,{data:L,columns:["عملیات","ردیف","شرکت زنجیره","وضعیت","نام فارم","مرغدار","شهر/تعاونی","دامپزشک فارم","سالن","دوره جوجه ریزی","تاریخ ثبت جوجه ریزی","تاریخ جوجه ریزی","نژاد","سن","تعداد جوجه ریزی","تلفات دوره (قطعه)","تعداد کل تعهد دولتی (قطعه)","تعداد کشتار شده دولتی (قطعه)","وزن کشتار شده دولتی","تعداد کشتار شده آزاد (قطعه)","وزن کشتار شده آزاد ","حجم خارج از استان","وزن خارج از استان","حخم کشتار زنجیره (قطعه)","وزن کشتار زنجیره (کیلوگرم)","کشتار شده (قطعه)","مانده در سالن (قطعه)","وزن تعهد دولتی","وزن کشتار دولتی","وزن کشتار آزاد","میانگین وزن کشتار","وزن کل کشتار شده","کشتار فعال","تعداد درخواست کشتار","آخرین تغییر","سازنده جوجه ریزی"],handlePageChange:P,totalRows:A,page:v,perPage:d,handlePerRowsChange:s,title:"زنجیره"})]})},dt=({item:e,updateArchive:t,readOnly:r})=>u.jsx(Kn,{item:e,updateArchive:t,readOnly:r}),ht=({readOnly:e})=>{e=e||!1;const[t,r]=c.useState([]),[x,f]=c.useState([]),[p,n]=c.useState(0),[l,g]=c.useState(10),[F,A]=c.useState(1),[S,d]=c.useState(""),h=Fu(P=>P.userSlice.userProfile.key),j=P=>{d(P.target.value)},b=async(P,s)=>{let D;s?D=await J.get(`poultry_hatching/?archive=true&search=filter&value=${s}&role=${tu()}&page=${P}&page_size=&chain=true`):D=await J.get(`poultry_hatching/?archive=true&role=${tu()}&page=${P}&page_size=${l}&chain=true`),r(D.data.results),n(D.data.count)},v=P=>{A(P),b(P,S)},E=P=>{g(Number(P)),A(1)};c.useEffect(()=>{l&&b(1,S)},[l]),c.useEffect(()=>{b(1,"")},[]);const L=["عملیات","ردیف","شرکت زنجیره","وضعیت","نام فارم","مرغدار","شهر/تعاونی","دامپزشک فارم","سالن","دوره جوجه ریزی","تاریخ ثبت جوجه ریزی","تاریخ جوجه ریزی","نژاد","سن","تعداد جوجه ریزی","تلفات دوره","حجم خارج از استان","وزن کشتار شده دولتی","وزن کشتار شده آزاد ","وزن خارج از استان","حخم کشتار زنجیره (قطعه)","وزن کشتار زنجیره (کیلوگرم)","کشتار شده","مانده در سالن","کشتار فعال","تعداد درخواست کشتار","آخرین تغییر"];c.useEffect(()=>{if(!t||!Array.isArray(t)){f([]);return}const P=t.map((s,D)=>{var N,R,Y,K,y,C,i,k,B,T,Q,nu,Z,eu,ju,cu,iu,O,_;const a=(s==null?void 0:s.quantity)-(s==null?void 0:s.losses)-(s==null?void 0:s.leftOver),M=(s==null?void 0:s.lastChange)&&((N=s==null?void 0:s.lastChange)==null?void 0:N.date)&&`${(R=s==null?void 0:s.lastChange)==null?void 0:R.fullName} (${i0((Y=s==null?void 0:s.lastChange)==null?void 0:Y.role)}) در تاریخ ${Zu((K=s==null?void 0:s.lastChange)==null?void 0:K.date)}`;return[u.jsx(dt,{item:s,updateArchive:Cu=>b(Cu||F,S),readOnly:e},`operations-${(s==null?void 0:s.key)||D}`),F===1?D+1:D+l*(F-1)+1,(y=s==null?void 0:s.chainCompany)!=null&&y.name&&((i=(C=s==null?void 0:s.chainCompany)==null?void 0:C.user)!=null&&i.mobile)?`${s.chainCompany.name} (${s.chainCompany.user.mobile})`:"-",u.jsx(H,{variant:"body2",color:s!=null&&s.violation?"error":"black",children:s!=null&&s.violation?"متخلف":"عادی"},`status-${(s==null?void 0:s.key)||D}`),((k=s==null?void 0:s.poultry)==null?void 0:k.unitName)||"-",(T=(B=s==null?void 0:s.poultry)==null?void 0:B.userprofile)!=null&&T.fullName&&((nu=(Q=s==null?void 0:s.poultry)==null?void 0:Q.userprofile)!=null&&nu.mobile)?`${s.poultry.userprofile.fullName} (${s.poultry.userprofile.mobile})`:"-",(ju=(eu=(Z=s==null?void 0:s.poultry)==null?void 0:Z.address)==null?void 0:eu.city)!=null&&ju.name?`${s.poultry.address.city.name}/${(cu=s==null?void 0:s.poultry)!=null&&cu.cityOperator?s.poultry.cityOperator:"بدون تعاونی"}`:"-",(iu=s==null?void 0:s.vetFarm)!=null&&iu.vetFarmMobile?`${s.vetFarm.vetFarmFullName} (${s.vetFarm.vetFarmMobile})`:"-",(s==null?void 0:s.hall)||"-",(s==null?void 0:s.period)||"-",Zu(s==null?void 0:s.createDate)||"-",Zu(s==null?void 0:s.date)||"-",(s==null?void 0:s.chickenBreed)||"-",(s==null?void 0:s.age)||"-",s!=null&&s.quantity?s.quantity.toLocaleString():"-",s!=null&&s.losses&&(s!=null&&s.quantity)?`${s.losses} (%${(s.losses*100/s.quantity).toFixed(0)})`:"-",s!=null&&s.outProvinceKilledQuantity?s.outProvinceKilledQuantity.toLocaleString():"-",s!=null&&s.governmentalKilledQuantity?s.governmentalKilledQuantity.toLocaleString():"-",s!=null&&s.freeKilledQuantity?s.freeKilledQuantity.toLocaleString():"-",s!=null&&s.outProvinceKilledWeight?s.outProvinceKilledWeight.toLocaleString():"-",s!=null&&s.chainKilledQuantity?s.chainKilledQuantity.toLocaleString():"-",s!=null&&s.chainKilledWeight?s.chainKilledWeight.toLocaleString():"-",s!=null&&s.quantity&&a!==void 0?`${a.toLocaleString()} (%${(a*100/s.quantity).toFixed(0)})`:"-",s!=null&&s.leftOver&&(s!=null&&s.quantity)?`${s.leftOver.toLocaleString()} (%${(s.leftOver*100/s.quantity).toFixed(0)})`:"-",(O=s==null?void 0:s.activeKill)!=null&&O.activeKill?"دارد":"ندارد",((_=s==null?void 0:s.activeKill)==null?void 0:_.countOfRequest)||"-",M||"-"]});f(P)},[t,F,l,S,e]);const $=async P=>{P.preventDefault(),A(1),b(1,S)},z=u.jsx(o,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,children:u.jsxs(o,{container:!0,alignItems:"center",gap:w.SMALL,children:[u.jsx(H,{children:"آرشیو جوجه ریزی "}),u.jsxs("form",{onSubmit:$,children:[u.jsx(U,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:j}),u.jsx(W,{type:"submit",onClick:$,endIcon:u.jsx(Ku,{}),children:"جستجو"}),u.jsx(Lu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${J.defaults.baseURL}archive_hatching_excel/?chain=true&key=${h}&role=${tu()}`,rel:"noreferrer",children:u.jsx(W,{color:"success",children:u.jsx(mu,{size:32})})})})]})]})});return u.jsx(o,{alignItems:"center",justifyContent:"center",xs:12,children:u.jsx(zu,{title:z,columns:L,data:x,totalRows:p,page:F,perPage:l,handlePageChange:v,handlePerRowsChange:E})})},At=()=>{const[e,t]=x0.useState("0"),r=(x,f)=>{t(f)};return u.jsxs(o,{container:!0,justifyContent:"center",xs:12,children:[u.jsxs(g0,{value:e,onChange:r,textColor:"secondary",indicatorColor:"secondary","aria-label":"secondary tabs example",scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,children:[u.jsx(Nu,{value:"0",label:"زنجیره های فعال"}),u.jsx(Nu,{value:"1",label:"مدیریت بارها"}),u.jsx(Nu,{value:"2",label:"شرکت ها"}),u.jsx(Nu,{value:"3",label:"بایگانی"})]}),u.jsxs(o,{container:!0,justifyContent:"center",alignItems:"center",px:2,xs:12,children:[u.jsx(o,{container:!0,justifyContent:"center",mt:2,xs:12,children:e==="0"&&u.jsx(Ct,{})}),u.jsx(o,{container:!0,justifyContent:"center",mt:2,xs:12,children:e==="1"&&u.jsx(Hn,{})}),u.jsx(o,{container:!0,justifyContent:"center",mt:2,xs:12,children:e==="2"&&u.jsx(qr,{})}),u.jsx(o,{container:!0,justifyContent:"center",xs:12,children:e==="3"&&u.jsx(ht,{})})]})]})},xt=()=>{const e=m(),[t,r]=c.useState(0),x=(y,C)=>{r(C)},[,,f,p,n,l]=c.useContext(su);c.useEffect(()=>{const y=ou(new Date).format("YYYY-MM-DD");p(y),l(y)},[]);const g=y=>{v(y.target.value)},[F,A]=c.useState([]),[S,d]=c.useState(0),[h,j]=c.useState(10),[b,v]=c.useState(""),[E,L]=c.useState(1),[$,z]=c.useState([]),[P,s]=c.useState([]),D=async y=>{e(q());const C=await J.get(`kill_request/?export=true&type=${t===0?"pending":"archive"}&search=filter&value=${b}&role=${tu()}&date1=${f}&date2=${n}&page=${y}&page_size=${h}`);e(V()),A(C.data.results),d(C.data.count)},a=y=>{D(y),L(y)},M=y=>{j(y),L(1)},N=()=>{D(E!==0?E:1)};c.useEffect(()=>{D(1)},[]);const R=y=>{let C="";return y.exportState==="pending"?C="در انتظار تایید":y.exportState==="rejected"?C="رد شده":y.exportState==="accepted"?C="تایید شده":y.exportState==="deleted"&&(C="حذف شده"),C};c.useEffect(()=>{const y=F==null?void 0:F.map((i,k)=>{var B,T,Q,nu,Z,eu;return[E===1?k+1:k+h*(E-1)+1,pu(i==null?void 0:i.createDate),pu(i.reciveDate),`${i.killHouse.name} (${i.killHouse.killHouseOperator.user.mobile})`,i!=null&&i.slaughterHouse?(B=i==null?void 0:i.slaughterHouse)==null?void 0:B.name:(T=i==null?void 0:i.killHouse)==null?void 0:T.name,i==null?void 0:i.exportCountry,`${(nu=(Q=i==null?void 0:i.poultry)==null?void 0:Q.userprofile)==null?void 0:nu.fullName} (${(eu=(Z=i==null?void 0:i.poultry)==null?void 0:Z.userprofile)==null?void 0:eu.mobile})`,i.killCapacity,i.IndexWeight,(i.IndexWeight*i.killCapacity).toLocaleString(),u.jsx(u.Fragment,{children:i!=null&&i.inputDirectBuyingCode?i==null?void 0:i.inputDirectBuyingCode:u.jsx(Lu,{title:"ثبت کد احراز",placement:"top",children:u.jsx(xu,{color:"primary",size:"small",onClick:()=>{e(wu({title:"ثبت کد احراز",size:"auto",content:u.jsx(zn,{item:i,updateTable:N})}))},children:u.jsx(Gn,{fontSize:"small"})})})}),u.jsx(Ye,{label:R(i),color:R(i)==="تایید شده"?"success":R(i)==="رد شده"?"error":R(i)==="حذف شده"?"default":"warning",size:"small",variant:"outlined"},`${i.key}-state`),u.jsx(Rn,{item:i,updateTable:N},i)]});z(y);const C=F==null?void 0:F.map((i,k)=>{var B,T,Q,nu,Z,eu;return[E===1?k+1:k+h*(E-1)+1,pu(i==null?void 0:i.createDate),pu(i.reciveDate),`${i.killHouse.name} (${i.killHouse.killHouseOperator.user.mobile})`,i!=null&&i.slaughterHouse?(B=i==null?void 0:i.slaughterHouse)==null?void 0:B.name:(T=i==null?void 0:i.killHouse)==null?void 0:T.name,i==null?void 0:i.exportCountry,`${(nu=(Q=i==null?void 0:i.poultry)==null?void 0:Q.userprofile)==null?void 0:nu.fullName} (${(eu=(Z=i==null?void 0:i.poultry)==null?void 0:Z.userprofile)==null?void 0:eu.mobile})`,i.killCapacity,i.IndexWeight,(i.IndexWeight*i.killCapacity).toLocaleString(),R(i),i!=null&&i.acceptRejectDate?Zu(i==null?void 0:i.acceptRejectDate):"-",i==null?void 0:i.directBuyingMessage]});s(C)},[F]),c.useEffect(()=>{D(1)},[f,n,h,t]);const Y=async y=>{y.preventDefault(),e(q());try{const C=await J.get(`kill_request/?export=true&type=${t===0?"pending":"archive"}&role=${tu()}&search=filter&value=${b}&date1=${f}&date2=${n}&page=1&page_size=${h}`);A(C.data.results),d(C.data.count),e(V())}catch(C){console.error("Error fetching data:",C)}},K=Fu(y=>y.userSlice.userProfile.key);return u.jsxs(o,{container:!0,direction:"column",flexWrap:"nowrap",mt:w.SMALL,children:[u.jsx(o,{container:!0,justifyContent:"center",alignItems:"center",my:w.SMALL,children:u.jsxs(g0,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:t,onChange:x,children:[u.jsx(Nu,{label:"درخواست های جدید"}),u.jsx(Nu,{label:"بایگانی"})]})}),u.jsxs(o,{container:!0,mt:w.MEDIUM,alignItems:"center",justifyContent:"center",gap:2,children:[u.jsx("form",{onSubmit:Y,children:u.jsxs(o,{container:!0,alignItems:"center",gap:w.SMALL,children:[u.jsx(U,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:g}),u.jsx(W,{type:"submit",onClick:Y,endIcon:u.jsx(Ku,{}),children:"جستجو"}),u.jsx(o,{children:u.jsx(yu,{label:"از تاریخ",id:"date",renderInput:y=>u.jsx(U,{style:{width:"160px"},...y}),value:f,onChange:y=>{p(ou(y).format("YYYY-MM-DD"))}})}),u.jsx(o,{children:u.jsx(yu,{label:"تا تاریخ",id:"date",renderInput:y=>u.jsx(U,{style:{width:"160px"},...y}),value:n,onChange:y=>{l(ou(y).format("YYYY-MM-DD"))}})}),t===1&&u.jsx(o,{children:u.jsx(Lu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${J.defaults.baseURL}export_kill_house_excel/?date1=${f}&date2=${n}&role=${tu()}&key=${K}`,rel:"noreferrer",children:u.jsx(W,{color:"success",children:u.jsx(mu,{size:32})})})})})]})}),t===0?u.jsx(zu,{data:$,columns:["ردیف","تاریخ ثبت درخواست","تاریخ کشتار","خریدار","محل کشتار","کشور مقصد","مرغدار (تلفن)","تعداد درخواست (قطعه)","میانگین وزنی (کیلوگرم)","وزن کل (کیلوگرم)","کد احراز","وضعیت","عملیات"],handlePageChange:a,totalRows:S,page:E,perPage:h,handlePerRowsChange:M,title:"صادرات"}):u.jsx(zu,{data:P,columns:["ردیف","تاریخ ثبت درخواست","تاریخ کشتار","خریدار","محل کشتار","کشور مقصد","مرغدار (تلفن)","تعداد درخواست (قطعه)","میانگین وزنی (کیلوگرم)","وزن کل (کیلوگرم)","وضعیت","تاریخ تایید/رد","دلیل رد"],handlePageChange:a,totalRows:S,page:E,perPage:h,handlePerRowsChange:M,title:"بایگانی صادرات"})]})]})},Dl=()=>{const{pathname:e}=u6();return u.jsx(K6,{display:"flex",justifyContent:"center",children:u.jsxs(o,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[e===nn||e===rn||e===tn?u.jsx(o,{justifyContent:"start",alignItems:"start",my:w.MEDIUM,children:tu()==="SuperAdmin"||tu()==="AdminX"?u.jsxs(u.Fragment,{children:[u.jsx(o,{children:tu()==="SuperAdmin"?u.jsx(H,{textAlign:"center",variant:"h6",children:"داشبورد ادمین کل"}):u.jsx(H,{textAlign:"center",variant:"h6",children:"داشبورد ادمین ایکس"})}),u.jsx(Xr,{})]}):u.jsxs(u.Fragment,{children:[u.jsx(o,{children:u.jsx(H,{textAlign:"center",variant:"h6",children:"داشبورد تخصیص استان"})}),u.jsx(Xn,{})]})}):u.jsx(Tn,{}),u.jsxs(o,{xs:12,container:!0,children:[(e===w0||e===B0||e===m6)&&u.jsx(er,{}),(e===P0||e===U0||e===ue)&&u.jsx(nr,{}),e===ln&&u.jsx(mn,{}),(e===O0||e===W0||e===ee)&&u.jsx(kr,{}),(e===an||e===sn||e===on)&&u.jsx(Tr,{}),(e===H6||e===te||e===re)&&u.jsx(_n,{}),(e===T6||e===cn||e===T6)&&u.jsx(ur,{}),(e===Cn||e===dn||e===hn)&&u.jsx(Dn,{}),(e===An||e===xn||e===pn)&&u.jsx(Ln,{}),(e===jn||e===fn||e===Fn)&&u.jsx(kn,{}),(e===z0||e===V0||e===le)&&u.jsx(Ur,{}),(e===$0||e===K0||e===ae)&&u.jsx(At,{}),(e===I0||e===Q0||e===se)&&u.jsx(Bn,{}),(e===Ju||e===yn||e===gn)&&u.jsx(Un,{}),(e===R0||e===H0||e===oe)&&u.jsx(Gr,{}),(e===Y0||e===M0||e===ne)&&u.jsx(xt,{})]})]})})};export{Dl as default}; diff --git a/build/assets/ProvinceSelectSlaughterForSlaughter-DoXgfxS6.js b/build/assets/ProvinceSelectSlaughterForSlaughter-DoXgfxS6.js new file mode 100644 index 0000000..dc26f98 --- /dev/null +++ b/build/assets/ProvinceSelectSlaughterForSlaughter-DoXgfxS6.js @@ -0,0 +1 @@ +import{j as c,aw as d,ax as S}from"./mui-vendor-CkIVaoQP.js";import{r as l}from"./react-vendor-CmFgShSM.js";import{a as g,u as v,f as y}from"./redux-vendor-B7uoacJt.js";import{L as C,j as x,h as i,A,G as _,ae as f,af as E}from"./index-CeyyVc1v.js";const I=g("PROVINCE_UPDATE_SLAUGHTER_KILLPLACE_SERVICE",async(t,{dispatch:a})=>{try{a(C());const{data:r,status:s}=await x.put("kill_house_percent/0/",t);return a(i()),{data:r,status:s}}catch(r){return a(i()),{error:r.response.data.result}}}),N=({killHouseForKiller:t,slaughterKey:a,disabled:r})=>{const s=v(),[o]=l.useContext(A),[p,h]=l.useState(t==null?void 0:t.key),{slaughterGetKillerKillhouses:n}=y(e=>e.slaughterSlice),m=e=>{s(I({percentage_key:a,kill_house_key:e.target.value})).then(u=>{u.payload.error?o({vertical:"top",horizontal:"center",msg:u.payload.error,severity:"error"}):(s(f()),s(E()),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}),h(e.target.value)};return c.jsx(_,{container:!0,alignItems:"center",justifyContent:"center",children:c.jsx(d,{labelId:"demo-simple-select-label",id:"demo-simple-select",value:p,onChange:m,style:{width:"170px"},size:"small",disabled:r,children:n==null?void 0:n.map((e,u)=>c.jsx(S,{value:e.key,children:e.name},u))})})};export{N as P}; diff --git a/build/assets/ProvinceSendMessage-CZGfVdJQ.js b/build/assets/ProvinceSendMessage-CZGfVdJQ.js new file mode 100644 index 0000000..35e9a22 --- /dev/null +++ b/build/assets/ProvinceSendMessage-CZGfVdJQ.js @@ -0,0 +1,112 @@ +import{cj as M,j as u,s as f,T as k,ck as N,bs as h,$ as W,ak as b,ag as S,av as z,aw as _,ax as G,b as w,ar as T,bj as O,am as I,B as L}from"./mui-vendor-CkIVaoQP.js";import{j as R,G as n,u as V,c as U,M as j,A as H,S as c,L as q,h as K,hV as J,b4 as Q,N as X}from"./index-CeyyVc1v.js";import{r as o}from"./react-vendor-CmFgShSM.js";import{a as Y,f as B,u as D}from"./redux-vendor-B7uoacJt.js";import{I as Z,f as uu}from"./toBase64-BzgTOHsW.js";import{d as eu}from"./Check-CRb6laYC.js";import{d as ru}from"./Close-_jAEIgMD.js";import{M as tu}from"./MessagesSenders-Y1Gaf5ab.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./Delete-C5MyLelE.js";const au=Y("PROVINCE_SEND_MESSAGE",async r=>{const{data:t,status:s}=await R.post("user_message/",r);return{data:t,status:s}}),su=f("div")(({theme:r})=>` + color: ${r.palette.mode==="dark"?"rgba(255,255,255,0.65)":"rgba(0,0,0,.85)"}; + font-size: 14px; +`),nu=f("label")` + padding: 0 0 4px; + line-height: 1.5; + display: block; +`,lu=f("div")(({theme:r})=>` + width: 300px; + border: 1px solid ${r.palette.mode==="dark"?"#434343":"#d9d9d9"}; + background-color: ${r.palette.mode==="dark"?"#141414":"#fff"}; + border-radius: 4px; + padding: 1px; + display: flex; + flex-wrap: wrap; + + &:hover { + border-color: ${r.palette.mode==="dark"?"#177ddc":"#40a9ff"}; + } + + &.focused { + border-color: ${r.palette.mode==="dark"?"#177ddc":"#40a9ff"}; + box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); + } + + & input { + background-color: ${r.palette.mode==="dark"?"#141414":"#fff"}; + color: ${r.palette.mode==="dark"?"rgba(255,255,255,0.65)":"rgba(0,0,0,.85)"}; + height: 30px; + box-sizing: border-box; + padding: 4px 6px; + width: 0; + min-width: 30px; + flex-grow: 1; + border: 0; + margin: 0; + outline: 0; + } +`);function $(r){const{label:t,onDelete:s,...e}=r;return u.jsxs("div",{...e,children:[u.jsx("span",{children:t}),u.jsx(ru,{onClick:s})]})}$.propTypes={label:h.string.isRequired,onDelete:h.func.isRequired};const iu=f($)(({theme:r})=>` + display: flex; + align-items: center; + height: 24px; + margin: 2px; + line-height: 22px; + background-color: ${r.palette.mode==="dark"?"rgba(255,255,255,0.08)":"#fafafa"}; + border: 1px solid ${r.palette.mode==="dark"?"#303030":"#e8e8e8"}; + border-radius: 2px; + box-sizing: content-box; + padding: 0 4px 0 10px; + outline: 0; + overflow: hidden; + + &:focus { + border-color: ${r.palette.mode==="dark"?"#177ddc":"#40a9ff"}; + background-color: ${r.palette.mode==="dark"?"#003b57":"#e6f7ff"}; + } + + & span { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + + & svg { + font-size: 12px; + cursor: pointer; + padding: 4px; + } +`),ou=f("ul")(({theme:r})=>` + width: 300px; + margin: 2px 0 0; + padding: 0; + position: absolute; + list-style: none; + background-color: ${r.palette.mode==="dark"?"#141414":"#fff"}; + overflow: auto; + max-height: 250px; + border-radius: 4px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); + z-index: 1; + + & li { + padding: 5px 12px; + display: flex; + + & span { + flex-grow: 1; + } + + & svg { + color: transparent; + } + } + + & li[aria-selected='true'] { + background-color: ${r.palette.mode==="dark"?"#2b2b2b":"#fafafa"}; + font-weight: 600; + + & svg { + color: #1890ff; + } + } + + & li.${N.focused} { + background-color: ${r.palette.mode==="dark"?"#003b57":"#e6f7ff"}; + cursor: pointer; + + & svg { + color: currentColor; + } + } +`);function P({title:r,options:t,defualtValueIndex:s,onChange:e}){const{getInputLabelProps:A,getInputProps:p,getTagProps:v,getListboxProps:x,getOptionProps:g,groupedOptions:m,value:C,focused:y,setAnchorEl:E}=M({id:"customized-hook-demo",multiple:!0,options:t,getOptionLabel:l=>l.title});return o.useEffect(()=>{e(C)},[C]),u.jsx(n,{children:u.jsxs(su,{children:[u.jsx(nu,{...A(),children:u.jsx(k,{varinat:"body1",children:r})}),u.jsxs(lu,{style:{width:"275px",minHeight:"56px"},ref:E,className:y?"focused":"",children:[C.map((l,d)=>u.jsx(k,{variant:"body2",children:u.jsx(iu,{label:l==null?void 0:l.title,...v({index:d})})},l.id+d)),u.jsx("input",{...p()})]}),m.length>0?u.jsx(ou,{style:{position:"inherit",width:"275px"},...x(),children:m.map((l,d)=>u.jsx("li",{...g({option:l,index:d}),children:u.jsxs(n,{container:!0,children:[u.jsx(k,{variant:"body2",children:l.title}),u.jsx(eu,{fontSize:"small"})]})},l.id+d))}):null]})})}P.propTypes={title:h.string,defualtValueIndex:h.any,options:h.any,onChange:h.any};function du(r){let t;switch(r){case"شهرستان":t="CityOperator";break;case"مرغدار":t="Poultry";break;case"دامپزشک":t="VetFarm";break;case"راننده":t="Driver";break;case"کشتارگاه":t="KillHouse";break;case"پشتیبانی امور دام":t="LiveStockSupport";break;case"مالی":t="ProvinceFinancial";break;case"ادمین کل":t="SuperAdmin";break;case"پخش کننده":t="Dispenser";break}return t}const cu=48,pu=8,hu={PaperProps:{style:{maxHeight:cu*4.5+pu,width:250}}},xu=["شهرستان","دامپزشک","راننده","مرغدار","کشتارگاه","مالی"];function gu(r,t,s){return{fontWeight:t.indexOf(r)===-1?s.typography.fontWeightRegular:s.typography.fontWeightMedium}}const Cu=()=>{const[r,t]=o.useState([]),{provinceUsers:s}=B(a=>a.provinceSlice);o.useEffect(()=>{t(s.map(a=>{const i=a.profile.fullname?a.profile.fullname:`${a.profile.firstName} ${a.profile.lastName}`;return{id:a.profile.key,title:`${i}`}}))},[]);const e=V({initialValues:{description:"",linkText:"",heading:"",link:"",usersList:[]},validationSchema:U({description:j().required("لطفا پیغام خود را بنویسید!").typeError("لطفا فیلد را پر کنید!"),heading:j().required("لطفا عنوان پیغام خود را بنویسید!").typeError("لطفا فیلد را پر کنید!"),link:j().typeError("لطفا فیلد را پر کنید!"),linkText:j().typeError("لطفا فیلد را پر کنید!")})});o.useEffect(()=>{e.validateForm()},[]);const A=W(),[p,v]=o.useState([]),x=D(),[g]=o.useContext(H),[m,C]=o.useState([]),[y,E]=o.useState([]),l=(a,i)=>{E(a.map(F=>uu(F.data_url))),C(a)},d=a=>{const{target:{value:i}}=a;v(typeof i=="string"?i.split(","):i)};return u.jsx(u.Fragment,{children:u.jsx(n,{justifyContent:"center",children:u.jsxs(n,{container:!0,justifyContent:"center",xs:12,sm:12,md:8,lg:8,gap:c.SMALL,direction:"column",children:[u.jsx(n,{children:u.jsx(b,{fullWidth:!0,id:"heading",label:"عنوان",variant:"outlined",value:e.values.heading,error:e.touched.heading?!!e.errors.heading:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.heading&&e.errors.heading?e.errors.heading:null})}),u.jsx(n,{justifyContent:"center",children:u.jsx(b,{fullWidth:!0,id:"description",label:"توضیحات",multiline:!0,rows:5,variant:"outlined",sx:{width:"100%",height:"100%"},value:e.values.description,error:e.touched.description?!!e.errors.description:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.description&&e.errors.description?e.errors.description:null})}),u.jsx(n,{children:u.jsxs(S,{fullWidth:!0,children:[u.jsx(z,{children:"ارسال پیام بر اساس نقش"}),u.jsx(_,{id:"demo-multiple-chip",multiple:!0,value:p,onChange:d,input:u.jsx(O,{label:"ارسال پیام بر اساس نقش",id:"select-multiple-chip"}),renderValue:a=>u.jsx(w,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:a.map(i=>u.jsx(T,{label:i},i))}),MenuProps:hu,children:xu.map(a=>u.jsx(G,{value:a,label:a,style:gu(a,p,A),children:a},a))})]})}),u.jsx(n,{children:u.jsx(S,{fullWidth:!0,children:u.jsx(n,{children:u.jsx(P,{options:r,title:"انتخاب کاربر",onChange:a=>{const i=a.map(F=>F.id);e.setFieldValue("usersList",i)}})})})}),u.jsx(n,{children:u.jsx(Z,{onChange:l,images:m,maxNumber:5,title:"تصاویر ضمیمه"})}),u.jsx(n,{m:c.SMALL,children:u.jsx(I,{children:u.jsx(T,{label:"پیوند"})})}),u.jsx(n,{children:u.jsx(b,{fullWidth:!0,size:"small",id:"linkText",label:"متن توضیح پیوند",variant:"outlined",value:e.values.linkText,error:e.touched.linkText?!!e.errors.linkText:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.linkText&&e.errors.linkText?e.errors.linkText:null})}),u.jsx(n,{children:u.jsx(b,{fullWidth:!0,size:"small",id:"link",label:"لینک",variant:"outlined",value:e.values.link,error:e.touched.link?!!e.errors.link:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.link&&e.errors.link?e.errors.link:null})}),u.jsx(n,{mb:c.SMALL,children:u.jsx(L,{fullWidth:!0,disabled:!e.isValid,size:"large",variant:"contained",onClick:()=>{p.length?(x(q()),x(au({roles:p.map(a=>du(a)),users:e.values.usersList,heading:e.values.heading,message:e.values.description,link_text:e.values.linkText,link:e.values.link,image:y})).then(a=>{a.error?g({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است",severity:"error"}):g({vertical:"top",horizontal:"center",msg:"پیغام با موفقیت فرستاده شد.",severity:"success"})}),x(K())):g({vertical:"top",horizontal:"center",msg:"لطفا کاربر هدف را انتخاب کنید.",severity:"error"})},children:"ارسال پیغام"})})]})})})},Tu=()=>{const r=D(),{senderMessages:t}=B(s=>s.messageSlice);return o.useEffect(()=>{r(J()),r(Q())},[]),u.jsx(u.Fragment,{children:u.jsx(w,{display:"flex",justifyContent:"center",children:u.jsxs(n,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,my:c.MEDIUM,children:[u.jsx(n,{container:!0,mt:c.MEDIUM,children:u.jsx(L,{className:"first-step",variant:"contained",onClick:()=>{r(X({title:"ارسال پیام جدید",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Cu,{})}))},children:"ثبت پیام جدید"})}),u.jsx(I,{children:u.jsx(T,{size:"small",label:"پیام های استان"})}),!(t!=null&&t.length)&&u.jsx(n,{mt:c.SMALL,children:u.jsx(k,{variant:"body1",color:"primary",children:"در حال حاضر پیامی جهت نمایش وجود ندارد!"})}),u.jsx(n,{p:c.SMALL,children:t==null?void 0:t.map((s,e)=>[u.jsx(tu,{number:e,heading:s.heading,message:s.message,link:s.link,linkText:s.linkText,image:s.image,time:s.time},e)])})]})})})};export{Tu as default}; diff --git a/build/assets/ProvinceSettlementPage-aomMVXar.js b/build/assets/ProvinceSettlementPage-aomMVXar.js new file mode 100644 index 0000000..3c181df --- /dev/null +++ b/build/assets/ProvinceSettlementPage-aomMVXar.js @@ -0,0 +1 @@ +import{j as u,B as C,I as h,b as A}from"./mui-vendor-CkIVaoQP.js";import{L as f,j as x,h as F,A as S,u as j,k1 as c,N as p,G as s,S as l}from"./index-CeyyVc1v.js";import{r as a}from"./react-vendor-CmFgShSM.js";import{a as k,u as d,f as v}from"./redux-vendor-B7uoacJt.js";import{A as b}from"./AdvancedTable-BYmmBtmq.js";import{N as g}from"./NumberFormatCustom-DwWPj40N.js";import{d as y}from"./Edit-CqBj1Y2L.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const L=k("PROVINCE_FINANCIAL_SETTLMENT_SERVICE",async(t,{dispatch:r})=>{r(f());const{data:n,status:e}=await x.put("kill_house_creditors/0/",t);return r(F()),{data:n,status:e}}),E=(t,r)=>{const n={};return t.price?/^[0-9]*$/i.test(t.price)?parseInt(t.price)>parseInt(r)&&(n.price=`عدد نمی تواند بزرگتر از ${r} ﷼ باشد.`):n.price="لطفا عدد وارد کنید.":n.price="این فیلد اجباری است.",n},I=({item:t})=>{const[r]=a.useContext(S),n=d(),e=j({initialValues:{price:t.amount},validate:i=>E(i,t.amount),onSubmit:i=>{n(L({amount:i.price,key:t.key})).then(o=>{n(c()),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),n(p({right:!1,bottom:!1,content:null,size:null}))})}});return a.useEffect(()=>{e.setFieldValue("price",t.amount)},[]),u.jsxs("form",{onSubmit:e.handleSubmit,width:"100%",children:[u.jsx(s,{children:u.jsx(g,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"price",label:"مبلغ (﷼)",variant:"outlined",value:e.values.price,error:e.touched.price?!!e.errors.price:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.price&&e.errors.price?e.errors.price:null})}),u.jsx(s,{mt:l.SMALL,children:u.jsx(C,{fullWidth:!0,color:"primary",variant:"contained",type:"submit",children:"ثبت"})})]})},N=()=>{const t=d(),{provinceFinancialGetSlaughterSattlement:r}=v(i=>i.provinceFinancialSlice),[n,e]=a.useState([]);return a.useEffect(()=>{t(c())},[]),a.useEffect(()=>{const i=r==null?void 0:r.map((o,m)=>[o.killHouse.name,o.killHouse.killHouseOperator.user.fullname,o.killHouse.killHouseOperator.user.mobile,o.killHouse.killHouseOperator.user.city,o.killHouse.killHouseOperator.user.province,o.amount.toLocaleString()+" ﷼",u.jsx(h,{color:"primary",onClick:()=>{t(p({title:"انجام عملیات تسویه حساب",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(I,{item:o})}))},children:u.jsx(y,{})},m)]);e(i)},[r]),u.jsx(s,{container:!0,mt:l.SMALL,children:u.jsx(b,{name:"تسویه با کشتارگاه",columns:["نام","مالک","تلفن","شهر","استان","مبلغ","تسویه"],data:n})})},M=()=>u.jsx(u.Fragment,{children:u.jsx(A,{display:"flex",justifyContent:"center",children:u.jsx(s,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsx(s,{container:!0,justifyContent:"space-between",gap:l.SMALL,children:u.jsx(s,{xs:12,children:u.jsx(N,{})})})})})});export{M as default}; diff --git a/build/assets/ProvinceSettlementPdfKillRequest-ChEooZGT.js b/build/assets/ProvinceSettlementPdfKillRequest-ChEooZGT.js new file mode 100644 index 0000000..d44541d --- /dev/null +++ b/build/assets/ProvinceSettlementPdfKillRequest-ChEooZGT.js @@ -0,0 +1 @@ +import{j as r,I as s}from"./mui-vendor-CkIVaoQP.js";import{d as t}from"./PictureAsPdf-oEJEta1d.js";import{j as o}from"./index-CeyyVc1v.js";function f({pdf_key:e}){return r.jsx("a",{rel:"noreferrer",href:`${o.defaults.baseURL}kill_request_pdf/?key=${e}`,target:"_blank",children:r.jsx(s,{children:r.jsx(t,{sx:{color:"green"}})})})}export{f as P}; diff --git a/build/assets/ProvinceUserFile-cShttUtU.js b/build/assets/ProvinceUserFile-cShttUtU.js new file mode 100644 index 0000000..c6694e0 --- /dev/null +++ b/build/assets/ProvinceUserFile-cShttUtU.js @@ -0,0 +1 @@ +import{j as u,ak as v,al as Au,ag as pu,av as bu,aw as mu,ax as l,B as eu,p,T as su,am as e0,ar as r0,I as L,d as N,ai as Y,b5 as Q,b as a0}from"./mui-vendor-CkIVaoQP.js";import{A as hu,L as _,h as k,u as iu,c as Cu,b as J,M as V,G as i,S as D,e4 as du,N as E,j as l0,Q as n0}from"./index-CeyyVc1v.js";import{r as y,j as t0,u as o0}from"./react-vendor-CmFgShSM.js";import{d as s0}from"./NavigateNext-ByUC5RGi.js";import{u as cu,a as d0,f as c0}from"./redux-vendor-B7uoacJt.js";import{S as B}from"./SimpleTable-DBAoNnCU.js";import{d as z}from"./Edit-CqBj1Y2L.js";import{i as vu,I as i0,a as Z,b as C0}from"./InspectorEditAviculture-MsTqlKJp.js";import{c as h0,a as A0}from"./city-get-city-qTSRxslT.js";import{p as p0}from"./province-get-kill-houses-C3UQguyo.js";import{N as b0}from"./NumberFormatCustom-DwWPj40N.js";import{C as m0}from"./CarPelak-BYFY8OXg.js";import{C as v0}from"./CitySubmitTenantForm-BnB_IQ2s.js";import{d as y0}from"./Info-CZK82--l.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const uu=({id:b,address:n,postal:A,name_of_bank_user:H,card:s,shaba:r,account:M,accountHolder:x,type:e})=>{const[d]=y.useContext(hu),[R,W]=y.useState(),[I,t]=y.useState(),[o,K]=y.useState(),[G,$]=y.useState(),[f,w]=y.useState(!0);y.useEffect(()=>{var C;F(_()),(C=F(h0()))==null||C.then(S=>{F(k()),W(S.payload.data)})},[]),y.useEffect(()=>{o&&(F(_()),F(A0(o)).then(C=>{t(C.payload.data),w(!1),F(k())}))},[o]);const F=cu(),a=iu({initialValues:{address:n||"",postal:A||"",bankName:H||"",cardNumber:s||"",accountNumber:M||"",shabaNumber:r||"",accountHolder:x||""},validationSchema:Cu({cardNumber:J().typeError("لطفا شماره کارتتان را وارد کنید!"),accountNumber:J().typeError("لطفا شماره حسابتان را وارد کنید!"),shabaNumber:J().typeError("لطفا شماره شبا را وارد کنید!"),accountHolder:V().typeError("لطفا نام صاحب حساب را وارد کنید!"),address:V().typeError("لطفا نام صاحب حساب را وارد کنید!"),postal:J().typeError("لطفا نام صاحب حساب را وارد کنید!")})});return y.useEffect(()=>{a.validateForm()},[]),u.jsx(u.Fragment,{children:u.jsx(i,{children:u.jsxs(i,{container:!0,gap:D.SMALL,direction:"column",children:[u.jsx(i,{children:u.jsx(v,{fullWidth:!0,id:"address",label:"آدرس",value:a.values.address,error:a.touched.address?!!a.errors.address:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.address&&a.errors.address?a.errors.address:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(i,{children:u.jsx(v,{fullWidth:!0,id:"postal",label:"کد پستی",value:a.values.postal,error:a.touched.postal?!!a.errors.postal:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.postal&&a.errors.postal?a.errors.postal:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(i,{children:u.jsx(Au,{disablePortal:!0,id:"province",options:R?R==null?void 0:R.map(C=>({id:C.key,label:C.name})):[],onChange:(C,S)=>{K(S.id)},renderInput:C=>u.jsx(v,{...C,label:"استان را انتخاب کنید"})})}),u.jsx(i,{children:u.jsx(Au,{disabled:f,disablePortal:!0,id:"city",options:I?I.map(C=>({id:C.key,label:C.name})):[],onChange:(C,S)=>{$(S.id)},renderInput:C=>u.jsx(v,{...C,label:"شهر را انتخاب کنید"})})}),u.jsx(i,{children:u.jsxs(pu,{fullWidth:!0,disabled:e==="ProvinceOperator"||e==="ProvinceInspector",children:[u.jsx(bu,{id:"demo-simple-select-label",children:"بانک"}),u.jsxs(mu,{fullWidth:!0,value:a.values.bankName,id:"bankName",label:"بانک",onChange:C=>{a.setFieldValue("bankName",C.target.value)},children:[u.jsx(l,{value:"موسسه افضل توس",children:"موسسه افضل توس"}),u.jsx(l,{value:"انصار",children:"انصار"}),u.jsx(l,{value:"سپه",children:"سپه"}),u.jsx(l,{value:"دی",children:"دی"}),u.jsx(l,{value:"کاب",children:"اقتصاد نوین"}),u.jsx(l,{value:"گردشگری",children:"گردشگری"}),u.jsx(l,{value:"حکمت ایرانیان",children:"حکمت ایرانیان"}),u.jsx(l,{value:"ایران زمین",children:"ایران زمین"}),u.jsx(l,{value:"کشاورزی",children:"کشاورزی"}),u.jsx(l,{value:"مسکن",children:"مسکن"}),u.jsx(l,{value:"مهر ایران",children:"مهر ایران"}),u.jsx(l,{value:"مهر اقتصاد",children:"مهر اقتصاد"}),u.jsx(l,{value:"ملت",children:"ملت"}),u.jsx(l,{value:"ملی",children:"ملی"}),u.jsx(l,{value:"پارسیان",children:"پارسیان"}),u.jsx(l,{value:"پاسارگاد",children:"پاسارگاد"}),u.jsx(l,{value:"پست بانک ایران",children:"پست بانک ایران"}),u.jsx(l,{value:"صادرات",children:"صادرات"}),u.jsx(l,{value:"سامان",children:"سامان"}),u.jsx(l,{value:"صنعت و معدن",children:"صنعت و معدن"}),u.jsx(l,{value:"سرمایه",children:"سرمایه"}),u.jsx(l,{value:"شهر",children:"شهر"}),u.jsx(l,{value:"سینا",children:"سینا"}),u.jsx(l,{value:"تجارت",children:"تجارت"}),u.jsx(l,{value:"موسسه اعتباری توسعه",children:"موسسه اعتباری توسعه"}),u.jsx(l,{value:"خاورمیانه",children:"خاورمیانه"})]})]})}),u.jsx(i,{children:u.jsx(v,{disabled:e==="ProvinceOperator"||e==="ProvinceInspector",fullWidth:!0,id:"cardNumber",label:"شماره کارت",value:a.values.cardNumber,error:a.touched.cardNumber?!!a.errors.cardNumber:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.cardNumber&&a.errors.cardNumber?a.errors.cardNumber:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(i,{children:u.jsx(v,{disabled:e==="ProvinceOperator"||e==="ProvinceInspector",fullWidth:!0,id:"accountNumber",label:"شماره حساب",value:a.values.accountNumber,error:a.touched.accountNumber?!!a.errors.accountNumber:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.accountNumber&&a.errors.accountNumber?a.errors.accountNumber:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(i,{children:u.jsx(v,{disabled:e==="ProvinceOperator"||e==="ProvinceInspector",fullWidth:!0,id:"shabaNumber",label:"شماره شبا",value:a.values.shabaNumber,error:a.touched.shabaNumber?!!a.errors.shabaNumber:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.shabaNumber&&a.errors.shabaNumber?a.errors.shabaNumber:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(i,{children:u.jsx(v,{disabled:e==="ProvinceOperator"||e==="ProvinceInspector",fullWidth:!0,id:"accountHolder",label:"نام صاحب حساب",value:a.values.accountHolder,error:a.touched.accountHolder?!!a.errors.accountHolder:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.accountHolder&&a.errors.accountHolder?a.errors.accountHolder:null,variant:"outlined"})}),u.jsx(eu,{fullWidth:!0,color:"primary",variant:"contained",onClick:()=>{F(_()),F(vu({user_bank_info:{name_of_bank_user:a.values.accountHolder,bank_name:a.values.bankName,card:a.values.cardNumber,shaba:a.values.shabaNumber,account:a.values.accountNumber},address:{address:a.values.address,postal_code:a.values.postal,city:G,province:o},type:e,person_type:"operator",userprofile_key:b})).then(C=>{C.error?C.error.message.includes("403")?d({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):d({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):d({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),F(k()),F(du(b)),F(E({right:!1,bottom:!1,content:null}))})},children:"ارسال اطلاعات"})]})})})};uu.propTypes={id:p.PropTypes.any,address:p.PropTypes.any,postal:p.PropTypes.any,name_of_bank_user:p.PropTypes.any,bank_name:p.PropTypes.any,card:p.PropTypes.any,shaba:p.PropTypes.any,account:p.PropTypes.any,accountHolder:p.PropTypes.any,type:p.PropTypes.any};const U6=({id:b})=>{const[n]=y.useContext(hu),A=cu(),[H,s]=y.useState(),[r,M]=y.useState();return y.useEffect(()=>{A(_()),A(p0()).then(x=>{s(x.payload.data),A(k())})},[]),u.jsx(u.Fragment,{children:u.jsx(i,{children:u.jsxs(i,{container:!0,gap:D.SMALL,direction:"column",children:[u.jsx(i,{children:u.jsx(Au,{disablePortal:!0,id:"province",options:H?H.map(x=>({id:x.key,label:x.name})):[],onChange:(x,e)=>{M(e.id)},renderInput:x=>u.jsx(v,{...x,label:"انتخاب کشتارگاه"})})}),u.jsx(eu,{disabled:!r,fullWidth:!0,color:"primary",variant:"contained",onClick:()=>{A(_()),A(vu({type:"KillHouseVet",kill_house_key:r,vet_key:b})).then(x=>{x.error?x.error.message.includes("403")?n({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):n({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),A(k()),A(du(b)),A(E({right:!1,bottom:!1,content:null}))})},children:"ارسال اطلاعات"})]})})})};U6.propTypes={id:p.PropTypes.any};const u0=({id:b,capocity:n,healthCode:A,driverName:H,mobile:s,name_of_bank_user:r,card:M,shaba:x,account:e,accountHolder:d,type:R})=>{const[W]=y.useContext(hu),I=cu(),t=iu({initialValues:{driver_name:H||"",driver_mobile:s||"",type_car:"ایسوزو",type_weight:"سنگین",capocity:n||"",health_code:A||""},validationSchema:Cu({driver_name:V().matches(/^[ض‌ص‌ث‌ق‌ف‌غ‌ع‌ه‌خ‌خ‌ح‌ج‌چ‌ش‌س‌ی‌ب‌ل‌ا‌ت‌ن‌ن‌م‌ک‌گ‌ظ‌ط‌ز‌ر‌ذ‌د‌و‌پ‌آ‌ژ ]+$/,"فقط حروف فارسی وارد کنید").typeError("لطفا فیلد را به درستی وارد کنید!"),driver_mobile:V().test("len","شماره تلفن باید با 0 شروع شود",(f,w)=>w.originalValue&&w.originalValue.startsWith("0")).test("len","شماره تماس 11 رقم باید باشد",(f,w)=>{if(w.originalValue)return w.originalValue.length===11}).typeError("لطفا عدد وارد کنید!"),type_weight:V().typeError("لطفا فیلد را به درستی وارد کنید!"),capocity:V().typeError("لطفا فیلد را به درستی وارد کنید!"),name:V().typeError("لطفا فیلد را به درستی وارد کنید!"),health_code:J().typeError("لطفا فیلد را به درستی وارد کنید!")})}),o=iu({initialValues:{bankName:r||"",cardNumber:M||"",accountNumber:e||"",shabaNumber:x||"",accountHolder:d||""},validationSchema:Cu({cardNumber:J().typeError("لطفا شماره کارتتان را وارد کنید!"),accountNumber:J().typeError("لطفا شماره حسابتان را وارد کنید!"),shabaNumber:J().typeError("لطفا شماره شبا را وارد کنید!"),accountHolder:V().typeError("لطفا نام صاحب حساب را وارد کنید!")})}),[K,G]=y.useState([]),$=(f,w,F,a)=>{G([f,w,F,a])};return y.useEffect(()=>{t.validateForm(),o.validateForm()},[]),u.jsx(u.Fragment,{children:u.jsxs(i,{children:[u.jsxs(i,{container:!0,gap:D.SMALL,direction:"column",children:[u.jsx(v,{fullWidth:!0,id:"driver_name",label:"نام و نام خانوادگی راننده",variant:"outlined",value:t.values.driver_name,error:t.touched.driver_name?!!t.errors.driver_name:null,onChange:t.handleChange,onBlur:t.handleBlur,helperText:t.touched.driver_name&&t.errors.driver_name?t.errors.driver_name:null}),u.jsx(v,{fullWidth:!0,id:"driver_mobile",label:"شماره تماس راننده",variant:"outlined",value:t.values.driver_mobile,error:t.touched.driver_mobile?!!t.errors.driver_mobile:null,onChange:t.handleChange,onBlur:t.handleBlur,helperText:t.touched.driver_mobile&&t.errors.driver_mobile?t.errors.driver_mobile:null}),u.jsxs(pu,{fullWidth:!0,children:[u.jsx(bu,{id:"demo-simple-select-label",children:"مدل خودرو"}),u.jsxs(mu,{labelId:"demo-simple-select-label",id:"type_car",label:"مدل خودرو",value:t.values.type_car,onChange:f=>{t.setFieldValue("type_car",f.target.value)},error:t.touched.type_car?!!t.errors.type_car:null,onBlur:t.handleBlur,helperText:t.touched.type_car&&t.errors.type_car?t.errors.type_car:null,children:[u.jsx(l,{value:"ایسوزو",children:"ایسوزو"}),u.jsx(l,{value:"نیسان",children:"نیسان"}),u.jsx(l,{value:"وانت",children:"وانت"}),u.jsx(l,{value:"اف ام",children:"اف ام"}),u.jsx(l,{value:"کامیون",children:"کامیون"}),u.jsx(l,{value:"هیوندا کروس",children:"هیوندا کروس"}),u.jsx(l,{value:"بادسان",children:"بادسان"}),u.jsx(l,{value:"هیوندا",children:"هیوندا"}),u.jsx(l,{value:"کامیونت ایسوزو",children:"کامیونت ایسوزو"}),u.jsx(l,{value:"خاور بنز",children:"خاور بنز"})]})]}),u.jsx(b0,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"capocity",label:"ظرفیت خودرو (قطعه)",variant:"outlined",value:t.values.capocity,error:t.touched.capocity?!!t.errors.capocity:null,onChange:t.handleChange,onBlur:t.handleBlur,helperText:t.touched.capocity&&t.errors.capocity?t.errors.capocity:null}),u.jsx(v,{fullWidth:!0,id:"health_code",label:"کد بهداشتی",variant:"outlined",value:t.values.health_code,error:t.touched.health_code?!!t.errors.health_code:null,onChange:t.handleChange,onBlur:t.handleBlur,helperText:t.touched.health_code&&t.errors.health_code?t.errors.health_code:null})]}),u.jsx(su,{mt:D.SMALL,children:"مشخصات پلاک"}),u.jsx(i,{mt:D.TINY,justifyContent:"center",sx:{display:"flex",flexDirection:"row"},children:u.jsx(m0,{width:"100%",handleChange:$})}),u.jsxs(i,{container:!0,gap:D.SMALL,mt:D.SMALL,direction:"column",children:[u.jsx(e0,{width:"100%",children:u.jsx(r0,{label:"اطلاعات بانکی"})}),u.jsxs(pu,{fullWidth:!0,children:[u.jsx(bu,{id:"demo-simple-select-label",children:"بانک"}),u.jsxs(mu,{fullWidth:!0,value:o.values.bankName,id:"bankName",label:"بانک",onChange:f=>{o.setFieldValue("bankName",f.target.value)},children:[u.jsx(l,{value:"موسسه افضل توس",children:"موسسه افضل توس"}),u.jsx(l,{value:"انصار",children:"انصار"}),u.jsx(l,{value:"سپه",children:"سپه"}),u.jsx(l,{value:"دی",children:"دی"}),u.jsx(l,{value:"کاب",children:"اقتصاد نوین"}),u.jsx(l,{value:"گردشگری",children:"گردشگری"}),u.jsx(l,{value:"حکمت ایرانیان",children:"حکمت ایرانیان"}),u.jsx(l,{value:"ایران زمین",children:"ایران زمین"}),u.jsx(l,{value:"کشاورزی",children:"کشاورزی"}),u.jsx(l,{value:"مسکن",children:"مسکن"}),u.jsx(l,{value:"مهر ایران",children:"مهر ایران"}),u.jsx(l,{value:"مهر اقتصاد",children:"مهر اقتصاد"}),u.jsx(l,{value:"ملت",children:"ملت"}),u.jsx(l,{value:"ملی",children:"ملی"}),u.jsx(l,{value:"پارسیان",children:"پارسیان"}),u.jsx(l,{value:"پاسارگاد",children:"پاسارگاد"}),u.jsx(l,{value:"پست بانک ایران",children:"پست بانک ایران"}),u.jsx(l,{value:"صادرات",children:"صادرات"}),u.jsx(l,{value:"سامان",children:"سامان"}),u.jsx(l,{value:"صنعت و معدن",children:"صنعت و معدن"}),u.jsx(l,{value:"سرمایه",children:"سرمایه"}),u.jsx(l,{value:"شهر",children:"شهر"}),u.jsx(l,{value:"سینا",children:"سینا"}),u.jsx(l,{value:"تجارت",children:"تجارت"}),u.jsx(l,{value:"موسسه اعتباری توسعه",children:"موسسه اعتباری توسعه"}),u.jsx(l,{value:"خاورمیانه",children:"خاورمیانه"})]})]}),u.jsx(v,{fullWidth:!0,id:"cardNumber",label:"شماره کارت",value:o.values.cardNumber,error:o.touched.cardNumber?!!o.errors.cardNumber:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.cardNumber&&o.errors.cardNumber?o.errors.cardNumber:null,autoComplete:"current-password",variant:"outlined"}),u.jsx(v,{fullWidth:!0,id:"accountNumber",label:"شماره حساب",value:o.values.accountNumber,error:o.touched.accountNumber?!!o.errors.accountNumber:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.accountNumber&&o.errors.accountNumber?o.errors.accountNumber:null,autoComplete:"current-password",variant:"outlined"}),u.jsx(v,{fullWidth:!0,id:"shabaNumber",label:"شماره شبا",value:o.values.shabaNumber,error:o.touched.shabaNumber?!!o.errors.shabaNumber:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.shabaNumber&&o.errors.shabaNumber?o.errors.shabaNumber:null,autoComplete:"current-password",variant:"outlined"}),u.jsx(v,{fullWidth:!0,id:"accountHolder",label:"نام صاحب حساب",value:o.values.accountHolder,error:o.touched.accountHolder?!!o.errors.accountHolder:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.accountHolder&&o.errors.accountHolder?o.errors.accountHolder:null,variant:"outlined"}),u.jsx(eu,{disabled:!t.isValid,fullWidth:!0,color:"primary",variant:"contained",onClick:()=>{I(_()),I(vu({type:"Driver",person_type:"operator",driver_key:b,driver_name:t.values.driver_name,driver_mobile:t.values.driver_mobile,type_car:t.values.type_car,capocity:t.values.capocity,weight_without_load:"0",health_code:t.values.health_code,pelak:K[0]+" "+K[1]+" "+K[2]+" "+K[3],user_bank_info:{name_of_bank_user:o.values.accountHolder,bank_name:o.values.bankName,card:o.values.cardNumber,shaba:o.values.shabaNumber,account:o.values.accountNumber}})).then(f=>{f.error?f.error.message.includes("403")?W({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):W({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):W({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),I(k()),I(du(b)),I(E({right:!1,bottom:!1,content:null}))})},children:"ارسال اطلاعات"})]})]})})};u0.propTypes={id:p.PropTypes.any,capocity:p.PropTypes.any,healthCode:p.PropTypes.any,driverName:p.PropTypes.any,mobile:p.PropTypes.any,name_of_bank_user:p.PropTypes.any,bank_name:p.PropTypes.any,card:p.PropTypes.any,shaba:p.PropTypes.any,account:p.PropTypes.any,accountHolder:p.PropTypes.any,type:p.PropTypes.any};const x0=d0("PROVINCE_UPDATE_TENANT_SERVICE",async(b,{dispatch:n})=>{n(_());try{const{data:A,status:H}=await l0.put("poultry_tenant_update/0/",b);return n(k()),{data:A,status:H}}catch(A){return n(k()),{error:A.response.data.result}}}),F0=Cu({uniqueId:V().required("شناسه یکتا الزامی است."),firstName:V().required("نام الزامی است."),lastName:V().required("نام خانوادگی الزامی است"),mobileNumber:V().matches(/^[0-9]{11}$/,"شماره موبایل نامعتبر است").required("موبایل الزامی است"),nationalCode:V().required("کدملی الزامی است")}),j0=({tenant:b,updateData:n})=>{const A=cu(),[H]=y.useContext(hu),s=iu({initialValues:{uniqueId:b.breedingUniqueId,firstName:b.firstName,lastName:b.lastName,mobileNumber:b.mobile,nationalCode:b.nationalId},validationSchema:F0,onSubmit:r=>{A(x0({breeding_unique_id:r.uniqueId,first_name:r.firstName,last_name:r.lastName,mobile:r.mobileNumber,national_id:r.nationalCode,tenant_key:b.key})).then(M=>{n(),H({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),A(E({right:!1,bottom:!1,content:null}))})}});return u.jsx("form",{onSubmit:s.handleSubmit,children:u.jsxs(i,{container:!0,direction:"column",gap:D.TINY,children:[u.jsx(v,{fullWidth:!0,id:"uniqueId",name:"uniqueId",label:"شناسه یکتا",value:s.values.uniqueId,onChange:s.handleChange,onBlur:s.handleBlur,error:s.touched.uniqueId&&!!s.errors.uniqueId,helperText:s.touched.uniqueId&&s.errors.uniqueId}),u.jsx(v,{fullWidth:!0,id:"firstName",name:"firstName",label:"نام",value:s.values.firstName,onChange:s.handleChange,onBlur:s.handleBlur,error:s.touched.firstName&&!!s.errors.firstName,helperText:s.touched.firstName&&s.errors.firstName}),u.jsx(v,{fullWidth:!0,id:"lastName",name:"lastName",label:"نام خانوادگی",value:s.values.lastName,onChange:s.handleChange,onBlur:s.handleBlur,error:s.touched.lastName&&!!s.errors.lastName,helperText:s.touched.lastName&&s.errors.lastName}),u.jsx(v,{fullWidth:!0,id:"mobileNumber",name:"mobileNumber",label:"تلفن",value:s.values.mobileNumber,onChange:s.handleChange,onBlur:s.handleBlur,error:s.touched.mobileNumber&&!!s.errors.mobileNumber,helperText:s.touched.mobileNumber&&s.errors.mobileNumber}),u.jsx(v,{fullWidth:!0,id:"nationalCode",name:"nationalCode",label:"کدملی",value:s.values.nationalCode,onChange:s.handleChange,onBlur:s.handleBlur,error:s.touched.nationalCode&&!!s.errors.nationalCode,helperText:s.touched.nationalCode&&s.errors.nationalCode}),u.jsx(eu,{color:"primary",fullWidth:!0,variant:"contained",type:"submit",children:"ثبت"})]})})},k0=()=>{var x;const{userid:b}=t0(),n=cu(),A=o0(),[H,s]=y.useState([]),{provinceUserInfo:r}=c0(e=>e.provinceSlice);y.useEffect(()=>{n(_()),n(du(b)).then(e=>{n(k())})},[]);const M=()=>{n(du(b)).then(e=>{n(k())})};return y.useEffect(()=>{var W,I,t,o,K,G,$,f,w,F,a,C,S;const e=(I=(W=r==null?void 0:r.profile)==null?void 0:W.role)==null?void 0:I.map((X,U)=>{let j="";switch(X){case"ProvinceOperator":j="اپراتور تخصیص استان";break;case"CityOperator":j="اپراتور شهرستان";break;case"KillHouseVet":j="دامپزشک کشتارگاه";break;case"VetFarm":j="دامپزشک";break;case"Poultry":j="مرغدار";break;case"KillHouse":j="کشتارگاه";break;case"Vet":j="دامپزشک";break;case"ProvinceInspector":j="بازرس استان";break;case"ProvinceFinancial":j="اپراتور مالی";break;case"Driver":j="راننده";break;case"Admin":j="ادمین";break;default:j="کاربر پایه";break}return u.jsx("div",{children:j},U)}),d=((o=(t=r==null?void 0:r.profile)==null?void 0:t.image)==null?void 0:o.length)>5?u.jsx("a",{href:r==null?void 0:r.profile.image,children:u.jsx("img",{width:"80",height:"80",alt:"img",src:r==null?void 0:r.profile.image})}):"موجود نیست",R=[[(K=r==null?void 0:r.profile)!=null&&K.fullname?(G=r==null?void 0:r.profile)==null?void 0:G.fullname:(($=r==null?void 0:r.profile)==null?void 0:$.firstName)+" "+((f=r==null?void 0:r.profile)==null?void 0:f.lastName),e,(w=r==null?void 0:r.profile)==null?void 0:w.mobile,(F=r==null?void 0:r.profile)!=null&&F.birthday?n0(new Date((a=r==null?void 0:r.profile)==null?void 0:a.birthday),"yyyy/MM/dd"):"نامشخص",(C=r==null?void 0:r.profile)==null?void 0:C.city,u.jsx(su,{variant:"caption",children:(S=r==null?void 0:r.profile)==null?void 0:S.password},"password"),d,u.jsx(L,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>{var X,U,j,ru,au,lu,nu,tu;n(E({title:"ویرایش پروفایل کاربر",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(i0,{id:(X=r==null?void 0:r.profile)==null?void 0:X.key,birthday:(U=r==null?void 0:r.profile)==null?void 0:U.birthday,nationalCode:(j=r==null?void 0:r.profile)==null?void 0:j.nationalCode,nationalId:(ru=r==null?void 0:r.profile)==null?void 0:ru.nationalId,firstName:(au=r==null?void 0:r.profile)==null?void 0:au.firstName,lastName:(lu=r==null?void 0:r.profile)==null?void 0:lu.lastName,password:(nu=r==null?void 0:r.profile)==null?void 0:nu.password,phone:(tu=r==null?void 0:r.profile)==null?void 0:tu.mobile})}))},children:u.jsx(z,{})},r)]];s(R)},[r]),u.jsxs(u.Fragment,{children:[u.jsx(i,{container:!0,alignItems:"center",mt:D.SMALL,children:u.jsxs(L,{"aria-label":"delete",color:"primary",onClick:()=>A(-1),children:[u.jsx(s0,{}),u.jsx(su,{children:"بازگشت"})]})}),u.jsx(i,{container:!0,xs:12,alignItems:"start",gap:D.SMALL,direction:"column",children:u.jsx(i,{width:"100%",container:!0,alignItems:"center",justifyContent:"space-between",children:u.jsxs(i,{width:"100%",className:"second",children:[u.jsx(B,{name:"اطلاعات پایه کاربر",columns:["نام کامل","نوع کاربری","شمار تلفن","تاریخ تولد","شهر","کلمه عبور","تصویر پروفایل","ویرایش"],data:H}),(x=r==null?void 0:r.rolesData)==null?void 0:x.map((e,d)=>{var R,W,I,t,o,K,G,$,f,w,F,a,C,S,X,U,j,ru,au,lu,nu,tu,yu,xu,Fu,ju,ku,fu,Nu,Bu,Pu,gu,_u,Eu,Du,wu,Hu,Iu,Ou,Tu,Vu,Ku,Wu,Su,qu,Lu,Mu,Ru,zu,Gu,$u,Yu,Qu,Zu,Ju,Xu,Uu,u6,e6,r6,a6,l6,n6,t6,o6,s6,d6,c6,i6,C6,h6,A6,p6,b6,m6,v6,y6,x6,F6,j6,k6,f6,N6,B6,P6,g6,_6,E6,D6,w6,H6,I6,O6,T6,V6,K6,W6,S6,q6,L6,M6,R6,z6,G6,$6,Y6,Q6,Z6,J6;return Object.keys(e).includes("ProvinceOperator")?u.jsx(u.Fragment,{children:u.jsx(B,{name:"اطلاعات اپراتور استان",columns:["آدرس","استان","شهر","کد پستی","موبایل","ویرایش","وضعیت"],data:[[(R=e.ProvinceOperator.address)==null?void 0:R.address,(W=e.ProvinceOperator.address)==null?void 0:W.province.name,(I=e.ProvinceOperator.address)==null?void 0:I.city.name,Number((t=e.ProvinceOperator.address)==null?void 0:t.postalCode),(o=e.ProvinceOperator.address)==null?void 0:o.phone,u.jsx(N,{title:"ویرایش کاربر",placement:"bottom-start",children:u.jsx(L,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>{var c,h;n(E({title:"ویرایش اطلاعات اپراتور",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(uu,{id:r==null?void 0:r.profile.key,type:"ProvinceOperator",address:(c=e.ProvinceOperator.address)==null?void 0:c.address,postal:Number((h=e.ProvinceOperator.address)==null?void 0:h.postalCode)})}))},children:u.jsx(z,{})})},d),u.jsx(N,{title:e.ProvinceOperator.trash===!0?"فعالسازی کاربر":"غیر فعال کردن کاربر",placement:"bottom-start",children:u.jsx(Y,{label:e.ProvinceOperator.trash===!0?"غیرفعال":" فعال",control:u.jsx(Q,{checked:!e.ProvinceOperator.trash,onClick:()=>{n(_()),n(Z({type:e.ProvinceOperator.trash===!0?"Activate":"Deactivate",role_data_key:e.ProvinceOperator.key,role:"ProvinceOperator"})).then(c=>{n(k()),window.location.reload(!1)})}})})},d)]]},d)}):Object.keys(e).includes("ProvinceInspector")?u.jsx(B,{name:"اطلاعات بازرس استان",expandable:!0,columns:["آدرس","استان","شهر","کد پستی","موبایل","ویرایش","وضعیت"],data:[[(K=e.ProvinceInspector.address)==null?void 0:K.address,(G=e.ProvinceInspector.address)==null?void 0:G.province.name,($=e.ProvinceInspector.address)==null?void 0:$.city.name,Number((f=e.ProvinceInspector.address)==null?void 0:f.phone),u.jsx(N,{title:"ویرایش کاربر",placement:"bottom-start",children:u.jsx(L,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>{var c,h,m;n(E({title:"ویرایش اطلاعات بازرس استان",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(uu,{id:r==null?void 0:r.profile.key,type:"ProvinceInspector",address:(c=e.ProvinceInspector.address)==null?void 0:c.address,postal:Number((m=(h=e.ProvinceInspector)==null?void 0:h.address)==null?void 0:m.postalCode)})}))},children:u.jsx(z,{})})},d),u.jsx(N,{title:((w=e.ProvinceInspector)==null?void 0:w.trash)===!0?"فعالسازی کاربر":"غیر فعال کردن کاربر",placement:"bottom-start",children:u.jsx(Y,{label:((F=e.ProvinceInspector)==null?void 0:F.trash)===!0?"غیرفعال":" فعال",control:u.jsx(Q,{checked:!((a=e.ProvinceInspector)!=null&&a.trash),onClick:()=>{n(_()),n(Z({type:e.ProvinceInspector.trash===!0?"Activate":"Deactivate",role_data_key:e.ProvinceInspector.key,role:"ProvinceInspector"})).then(c=>{n(k()),window.location.reload(!1)})}})})},d)]]},d):Object.keys(e).includes("CityOperator")?u.jsxs(u.Fragment,{children:[u.jsx(B,{name:"اطلاعات اپراتور شهرستان",expandable:!0,columns:["آدرس","استان","شهر","کد پستی","موبایل","ویرایش","وضعیت"],data:[[(C=e.CityOperator.address)==null?void 0:C.address,(X=(S=e.CityOperator.address)==null?void 0:S.province)==null?void 0:X.name,(j=(U=e.CityOperator.address)==null?void 0:U.city)==null?void 0:j.name,Number((ru=e.CityOperator.address)==null?void 0:ru.postalCode),(au=e.CityOperator.address)==null?void 0:au.phone,u.jsx(N,{title:"ویرایش کاربر",placement:"bottom-start",children:u.jsx(L,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>{var c,h,m,P,g,O,T,q,ou;n(E({title:"ویرایش اطلاعات اپراتور",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(uu,{id:r==null?void 0:r.profile.key,type:"CityOperator",address:(c=e.CityOperator.address)==null?void 0:c.address,postal:Number((h=e.CityOperator.address)==null?void 0:h.postalCode),accountHolder:(m=e.CityOperator.userBankInfo)==null?void 0:m.nameOfBankUser,card:(P=e.CityOperator.userBankInfo)==null?void 0:P.card,shaba:(g=e.CityOperator.userBankInfo)==null?void 0:g.shaba,account:(T=(O=e.CityOperator)==null?void 0:O.userBankInfo)==null?void 0:T.account,name_of_bank_user:(ou=(q=e.CityOperator)==null?void 0:q.userBankInfo)==null?void 0:ou.bankName})}))},children:u.jsx(z,{})})},d),u.jsx(N,{title:((lu=e.CityOperator)==null?void 0:lu.trash)===!0?"فعالسازی کاربر":"غیر فعال کردن کاربر",placement:"bottom-start",children:u.jsx(Y,{label:((nu=e.CityOperator)==null?void 0:nu.trash)===!0?"غیرفعال":" فعال",control:u.jsx(Q,{checked:!e.CityOperator.trash,onClick:()=>{n(_()),n(Z({type:e.CityOperator.trash===!0?"Activate":"Deactivate",role_data_key:e.CityOperator.key,role:"CityOperator"})).then(c=>{n(k()),window.location.reload(!1)})}})})},d)]]},d),u.jsx(B,{name:"اطلاعات بانکی شهرستان",expandable:!0,columns:["نام صاحب حساب","نام بانک","شماره حساب","شماره کارت","شماره شبا"],data:[[(tu=e.CityOperator.userBankInfo)==null?void 0:tu.nameOfBankUser,(yu=e.CityOperator.userBankInfo)==null?void 0:yu.bankName,Number((xu=e.CityOperator.userBankInfo)==null?void 0:xu.account),Number((Fu=e.CityOperator.userBankInfo)==null?void 0:Fu.card),(ju=e.CityOperator.userBankInfo)==null?void 0:ju.shaba]]},d)]}):Object.keys(e).includes("VetFarm")?u.jsxs(u.Fragment,{children:[u.jsx(B,{name:"اطلاعات دامپزشک فارم",expandable:!0,columns:["آدرس","استان","شهر","کد پستی","موبایل","ویرایش","وضعیت"],data:[[(ku=e.VetFarm.address)==null?void 0:ku.address,(fu=e.VetFarm.address)==null?void 0:fu.province.name,(Nu=e.VetFarm.address)==null?void 0:Nu.city.name,Number((Bu=e.VetFarm.address)==null?void 0:Bu.postalCode),(Pu=e.VetFarm.address)==null?void 0:Pu.phone,u.jsx(N,{title:"ویرایش کاربر",placement:"bottom-start",children:u.jsx(L,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>{var c,h,m,P,g,O,T,q;n(E({title:"ویرایش اطلاعات اپراتور",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(uu,{id:(c=r==null?void 0:r.profile)==null?void 0:c.key,type:"VetFarm",address:(h=e.VetFarm.address)==null?void 0:h.address,postal:Number((m=e.VetFarm.address)==null?void 0:m.postalCode),accountHolder:(P=e.VetFarm.userBankInfo)==null?void 0:P.nameOfBankUser,card:(g=e.VetFarm.userBankInfo)==null?void 0:g.card,shaba:(O=e.VetFarm.userBankInfo)==null?void 0:O.shaba,account:(T=e.VetFarm.userBankInfo)==null?void 0:T.account,name_of_bank_user:(q=e.VetFarm.userBankInfo)==null?void 0:q.bankName})}))},children:u.jsx(z,{})})},d),u.jsx(N,{title:e.VetFarm.trash===!0?"فعالسازی کاربر":"غیر فعال کردن کاربر",placement:"bottom-start",children:u.jsx(Y,{label:((gu=e.VetFarm)==null?void 0:gu.trash)===!0?"غیرفعال":" فعال",control:u.jsx(Q,{checked:!((_u=e.VetFarm)!=null&&_u.trash),onClick:()=>{n(_()),n(Z({type:e.VetFarm.trash===!0?"Activate":"Deactivate",role_data_key:e.VetFarm.key,role:"Vet"})).then(c=>{n(k()),window.location.reload(!1)})}})})},d)]]},d),u.jsx(B,{name:"اطلاعات بانکی دامپزشک فارم",expandable:!0,columns:["نام صاحب حساب","نام بانک","شماره حساب","شماره کارت","شماره شبا"],data:[[(Eu=e.VetFarm.userBankInfo)==null?void 0:Eu.nameOfBankUser,(Du=e.VetFarm.userBankInfo)==null?void 0:Du.bankName,Number((wu=e.VetFarm.userBankInfo)==null?void 0:wu.account),Number((Hu=e.VetFarm.userBankInfo)==null?void 0:Hu.card),(Iu=e.VetFarm.userBankInfo)==null?void 0:Iu.shaba]]},d)]}):Object.keys(e).includes("KillHouse")?u.jsxs(u.Fragment,{children:[" ",u.jsx(B,{name:"اطلاعات کشتارگاه",expandable:!0,columns:["آدرس","استان","شهر","کد پستی","موبایل","ویرایش","وضعیت"],data:[[(Ou=e.KillHouse.address)==null?void 0:Ou.address,(Vu=(Tu=e.KillHouse.address)==null?void 0:Tu.province)==null?void 0:Vu.name,(Wu=(Ku=e.KillHouse.address)==null?void 0:Ku.city)==null?void 0:Wu.name,Number((Su=e.KillHouse.address)==null?void 0:Su.postalCode),(qu=e.KillHouse.address)==null?void 0:qu.phone,u.jsx(N,{title:"ویرایش کاربر",placement:"bottom-start",children:u.jsx(L,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>{var c,h,m,P,g,O,T,q;n(E({title:"ویرایش اطلاعات کشتارگاه",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(uu,{id:(c=r==null?void 0:r.profile)==null?void 0:c.key,type:"KillHouse",address:(h=e.KillHouse.address)==null?void 0:h.address,postal:Number((m=e.KillHouse.address)==null?void 0:m.postalCode),accountHolder:(P=e.KillHouse.userBankInfo)==null?void 0:P.nameOfBankUser,card:(g=e.KillHouse.userBankInfo)==null?void 0:g.card,shaba:(O=e.KillHouse.userBankInfo)==null?void 0:O.shaba,account:(T=e.KillHouse.userBankInfo)==null?void 0:T.account,name_of_bank_user:(q=e.KillHouse.userBankInfo)==null?void 0:q.bankName})}))},children:u.jsx(z,{})})},d),u.jsx(N,{title:((Lu=e.KillHouse)==null?void 0:Lu.trash)===!0?"فعالسازی کاربر":"غیر فعال کردن کاربر",placement:"bottom-start",children:u.jsx(Y,{label:e.KillHouse.trash===!0?"غیرفعال":" فعال",control:u.jsx(Q,{checked:!((Mu=e.KillHouse)!=null&&Mu.trash),onClick:()=>{var c,h;n(_()),n(Z({type:((c=e.KillHouse)==null?void 0:c.trash)===!0?"Activate":"Deactivate",role_data_key:(h=e.KillHouse)==null?void 0:h.key,role:"KillHouse"})).then(m=>{n(k()),window.location.reload(!1)})}})})},d)]]},d),u.jsx(B,{name:"اطلاعات بانکی کشتارگاه",expandable:!0,columns:["نام صاحب حساب","نام بانک","شماره حساب","شماره کارت","شماره شبا"],data:[[(Ru=e.KillHouse.userBankInfo)==null?void 0:Ru.nameOfBankUser,(zu=e.KillHouse.userBankInfo)==null?void 0:zu.bankName,Number((Gu=e.KillHouse.userBankInfo)==null?void 0:Gu.account),Number(($u=e.KillHouse.userBankInfo)==null?void 0:$u.card),(Yu=e.KillHouse.userBankInfo)==null?void 0:Yu.shaba]]},d)]}):Object.keys(e).includes("Poultry")?u.jsxs(u.Fragment,{children:[u.jsx(B,{name:"اطلاعات مرغدار",columns:["نام فارم","آدرس","استان","شهر","کد پستی","موبایل","شناسه یکتا","کد اقتصادی","کد اپیدمیولوژیک","تعداد سالن","ویرایش","وضعیت"],data:[[(Qu=e.Poultry)==null?void 0:Qu.unitName,(Zu=e.Poultry.address)==null?void 0:Zu.address,(Xu=(Ju=e.Poultry.address)==null?void 0:Ju.province)==null?void 0:Xu.name,(u6=(Uu=e.Poultry.address)==null?void 0:Uu.city)==null?void 0:u6.name,Number((e6=e.Poultry.address)==null?void 0:e6.postalCode),(r6=e.Poultry.address)==null?void 0:r6.phone,Number(e.Poultry.breedingUniqueId),e.Poultry.economicCode,e.Poultry.epidemiologicalCode,e.Poultry.numberOfHalls,u.jsx(N,{title:"ویرایش کاربر",placement:"bottom-start",children:u.jsx(L,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>{var c,h,m,P,g,O,T,q,ou,X6;n(E({title:"ویرایش اطلاعات مرغدار",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(C0,{farmName:(c=e.Poultry)==null?void 0:c.unitName,id:r==null?void 0:r.profile.key,type:"Poultry",address:(h=e.Poultry.address)==null?void 0:h.address,uniqueId:(m=e.Poultry)==null?void 0:m.breedingUniqueId,poultry:(P=e.Poultry)==null?void 0:P.key,halls:e.Poultry.numberOfHalls,postal:Number((g=e.Poultry.address)==null?void 0:g.postalCode),accountHolder:(O=e.Poultry.userBankInfo)==null?void 0:O.nameOfBankUser,card:(T=e.Poultry.userBankInfo)==null?void 0:T.card,shaba:(q=e.Poultry.userBankInfo)==null?void 0:q.shaba,account:(ou=e.Poultry.userBankInfo)==null?void 0:ou.account,name_of_bank_user:(X6=e.Poultry.userBankInfo)==null?void 0:X6.bankName})}))},children:u.jsx(z,{})})},d),u.jsx(N,{title:e.Poultry.trash===!0?"فعالسازی کاربر":"غیر فعال کردن کاربر",placement:"bottom-start",children:u.jsx(Y,{label:e.Poultry.trash===!0?"غیرفعال":" فعال",control:u.jsx(Q,{checked:!e.Poultry.trash,onClick:()=>{n(_()),n(Z({type:e.Poultry.trash===!0?"Activate":"Deactivate",role_data_key:e.Poultry.key,role:"Poultry"})).then(c=>{n(k()),window.location.reload(!1)})}})})},d)]]},d),u.jsx(B,{name:"اطلاعات بانکی مرغدار",expandable:!0,columns:["نام صاحب حساب","نام بانک","شماره حساب","شماره کارت","شماره شبا"],data:[[(a6=e.Poultry.userBankInfo)==null?void 0:a6.nameOfBankUser,(l6=e.Poultry.userBankInfo)==null?void 0:l6.bankName,Number((n6=e.Poultry.userBankInfo)==null?void 0:n6.account),Number((t6=e.Poultry.userBankInfo)==null?void 0:t6.card),(o6=e.Poultry.userBankInfo)==null?void 0:o6.shaba]]},d),Object.keys((s6=e.Poultry)==null?void 0:s6.poultryTenant).length>0?u.jsx(B,{name:u.jsxs(i,{container:!0,alignItems:"center",gap:D.TINY,children:[u.jsx(su,{children:"اطلاعات مستاجر مرغدار"}),u.jsx(eu,{onClick:()=>{n(E({title:"ویرایش اطلاعات مستاجر",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(j0,{tenant:e.Poultry.poultryTenant,updateData:M})}))},children:"ویرایش"})]}),expandable:!0,columns:["شناسه یکتا","نام کامل","تلفن همراه","کد ملی"],data:[[(d6=e.Poultry.poultryTenant)==null?void 0:d6.breedingUniqueId,(c6=e.Poultry.poultryTenant)==null?void 0:c6.fullName,(i6=e.Poultry.poultryTenant)==null?void 0:i6.mobile,(C6=e.Poultry.poultryTenant)==null?void 0:C6.nationalId]]},d):!e.Poultry.poultryOwner.length>0&&u.jsxs(i,{display:"flex",mt:D.MEDIUM,gap:D.SMALL,alignItems:"center",mb:D.MEDIUM,children:[u.jsxs(i,{display:"flex",gap:D.TINY,children:[u.jsx(y0,{color:"primary"}),u.jsx(su,{children:"مرغدار مستاجر ندارد"})]}),u.jsx(eu,{variant:"outlined",onClick:()=>{n(E({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ایجاد مستاجر جدید",content:u.jsx(v0,{id:e.Poultry.key,userid:b})}))},children:"افزودن مستاجر"})]})]}):Object.keys(e).includes("ProvinceFinancial")?u.jsxs(u.Fragment,{children:[u.jsx(B,{name:"اطلاعات اپراتور مالی",expandable:!0,columns:["آدرس","استان","شهر","کد پستی","موبایل","ویرایش","وضعیت"],data:[[(h6=e.ProvinceFinancial.address)==null?void 0:h6.address,(A6=e.ProvinceFinancial.address)==null?void 0:A6.province.name,(p6=e.ProvinceFinancial.address)==null?void 0:p6.city.name,Number((b6=e.ProvinceFinancial.address)==null?void 0:b6.postalCode),(m6=e.ProvinceFinancial.address)==null?void 0:m6.phone,u.jsx(N,{title:"ویرایش کاربر",placement:"bottom-start",children:u.jsx(L,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>{var c,h,m,P,g,O,T;n(E({title:"ویرایش اطلاعات اپراتور مالی",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(uu,{id:r==null?void 0:r.profile.key,type:"ProvinceFinancial",address:(c=e.ProvinceFinancial.address)==null?void 0:c.address,postal:Number((h=e.ProvinceFinancial.address)==null?void 0:h.postalCode),accountHolder:(m=e.ProvinceFinancial.userBankInfo)==null?void 0:m.nameOfBankUser,card:(P=e.ProvinceFinancial.userBankInfo)==null?void 0:P.card,shaba:(g=e.ProvinceFinancial.userBankInfo)==null?void 0:g.shaba,account:(O=e.ProvinceFinancial.userBankInfo)==null?void 0:O.account,name_of_bank_user:(T=e.ProvinceFinancial.userBankInfo)==null?void 0:T.bankName})}))},children:u.jsx(z,{})})},d),u.jsx(N,{title:e.ProvinceFinancial.trash===!0?"فعالسازی کاربر":"غیر فعال کردن کاربر",placement:"bottom-start",children:u.jsx(Y,{label:e.ProvinceFinancial.trash===!0?"غیرفعال":" فعال",control:u.jsx(Q,{checked:!e.ProvinceFinancial.trash,onClick:()=>{n(_()),n(Z({type:e.ProvinceFinancial.trash===!0?"Activate":"Deactivate",role_data_key:e.ProvinceFinancial.key,role:"ProvinceFinancial"})).then(c=>{n(k()),window.location.reload(!1)})}})})},d)]]},d),u.jsx(B,{name:"اطلاعات بانکی اپراتور مالی",expandable:!0,columns:["نام صاحب حساب","نام بانک","شماره حساب","شماره کارت","شماره شبا"],data:[[(v6=e.ProvinceFinancial.userBankInfo)==null?void 0:v6.nameOfBankUser,(y6=e.ProvinceFinancial.userBankInfo)==null?void 0:y6.bankName,Number((x6=e.ProvinceFinancial.userBankInfo)==null?void 0:x6.account),Number((F6=e.ProvinceFinancial.userBankInfo)==null?void 0:F6.card),(j6=e.ProvinceFinancial.userBankInfo)==null?void 0:j6.shaba]]},d)]}):Object.keys(e).includes("KillHouseVet")?u.jsxs(u.Fragment,{children:[u.jsx(B,{name:"اطلاعات دامپزشک کشتارگاه",expandable:!0,columns:["آدرس","استان","شهر","کد پستی","موبایل","ویرایش","وضعیت"],data:[[(f6=(k6=e.KillHouseVet.vet)==null?void 0:k6.address)==null?void 0:f6.address,(B6=(N6=e.KillHouseVet.vet)==null?void 0:N6.address)==null?void 0:B6.province.name,(g6=(P6=e.KillHouseVet.vet)==null?void 0:P6.address)==null?void 0:g6.city.name,Number((E6=(_6=e.KillHouseVet.vet)==null?void 0:_6.address)==null?void 0:E6.postalCode),(w6=(D6=e.KillHouseVet.vet)==null?void 0:D6.address)==null?void 0:w6.phone,u.jsx(N,{title:"ویرایش کاربر",placement:"bottom-start",children:u.jsx(L,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>{var c;n(E({title:"ویرایش اطلاعات دامپزشک کشتارگاه",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(U6,{id:(c=e.KillHouseVet.vet)==null?void 0:c.key})}))},children:u.jsx(z,{})})},d),u.jsx(N,{title:((H6=e.KillHouseVet.vet)==null?void 0:H6.trash)===!0?"فعالسازی کاربر":"غیر فعال کردن کاربر",placement:"bottom-start",children:u.jsx(Y,{label:((I6=e.KillHouseVet.vet)==null?void 0:I6.trash)===!0?"غیرفعال":" فعال",control:u.jsx(Q,{checked:!e.KillHouseVet.vet.trash,onClick:()=>{n(_()),n(Z({type:e.KillHouseVet.vet.trash===!0?"Activate":"Deactivate",role_data_key:e.KillHouseVet.key,role:"KillHouseVet"})).then(c=>{n(k()),window.location.reload(!1)})}})})},d)]]},d),u.jsx(B,{name:"اطلاعات بانکی دامپزشک کشتارگاه",expandable:!0,columns:["نام صاحب حساب","نام بانک","شماره حساب","شماره کارت","شماره شبا"],data:[[(T6=(O6=e.KillHouseVet.vet)==null?void 0:O6.userBankInfo)==null?void 0:T6.nameOfBankUser,(K6=(V6=e.KillHouseVet.vet)==null?void 0:V6.userBankInfo)==null?void 0:K6.bankName,Number((S6=(W6=e.KillHouseVet.vet)==null?void 0:W6.userBankInfo)==null?void 0:S6.account),Number((L6=(q6=e.KillHouseVet.vet)==null?void 0:q6.userBankInfo)==null?void 0:L6.card),(R6=(M6=e.KillHouseVet.vet)==null?void 0:M6.userBankInfo)==null?void 0:R6.shaba]]},d)]}):Object.keys(e).includes("Driver")?u.jsxs(u.Fragment,{children:[u.jsx(B,{name:"اطلاعات راننده",expandable:!0,columns:["نام راننده","نوع خودرو","ظرفیت","کد بهداشتی","پلاک","شماره موبایل","ویرایش","وضعیت"],data:[[e.Driver.driverName,e.Driver.typeCar,e.Driver.capocity,e.Driver.healthCode,e.Driver.pelak,e.Driver.driverMobile,u.jsx(N,{title:"ویرایش کاربر",placement:"bottom-start",children:u.jsx(L,{"aria-label":"delete",color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>{var c,h,m,P,g;n(E({title:"ویرایش اطلاعات راننده",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(u0,{id:e.Driver.key,capocity:e.Driver.capocity,healthCode:e.Driver.healthCode,mobile:e.Driver.driverMobile,driverName:e.Driver.driverName,accountHolder:(c=e.Driver.userBankInfo)==null?void 0:c.nameOfBankUser,card:(h=e.Driver.userBankInfo)==null?void 0:h.card,shaba:(m=e.Driver.userBankInfo)==null?void 0:m.shaba,account:(P=e.Driver.userBankInfo)==null?void 0:P.account,name_of_bank_user:(g=e.Driver.userBankInfo)==null?void 0:g.bankName})}))},children:u.jsx(z,{})})},d),u.jsx(N,{title:((z6=e.Driver)==null?void 0:z6.trash)===!0?"فعالسازی کاربر":"غیر فعال کردن کاربر",placement:"bottom-start",children:u.jsx(Y,{label:((G6=e.Driver)==null?void 0:G6.trash)===!0?"غیرفعال":" فعال",control:u.jsx(Q,{checked:!e.Driver.trash,onClick:()=>{n(_()),n(Z({type:e.Driver.trash===!0?"Activate":"Deactivate",role_data_key:e.Driver.key,role:"Driver"})).then(c=>{n(k()),window.location.reload(!1)})}})})},d)]]},d),u.jsx(B,{name:"اطلاعات بانکی راننده",expandable:!0,columns:["نام صاحب حساب","نام بانک","شماره حساب","شماره کارت","شماره شبا"],data:[[($6=e.Driver.userBankInfo)==null?void 0:$6.nameOfBankUser,(Y6=e.Driver.userBankInfo)==null?void 0:Y6.bankName,Number((Q6=e.Driver.userBankInfo)==null?void 0:Q6.account),Number((Z6=e.Driver.userBankInfo)==null?void 0:Z6.card),(J6=e.Driver.userBankInfo)==null?void 0:J6.shaba]]},d)]}):null})]})})})]})},L0=()=>u.jsx(u.Fragment,{children:u.jsx(a0,{display:"flex",justifyContent:"center",children:u.jsx(i,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsx(i,{container:!0,justifyContent:"space-between",gap:D.SMALL,children:u.jsx(i,{xs:12,children:u.jsx(k0,{})})})})})});export{L0 as default}; diff --git a/build/assets/ProvinceUserManagement-CHb4mhM7.js b/build/assets/ProvinceUserManagement-CHb4mhM7.js new file mode 100644 index 0000000..7458708 --- /dev/null +++ b/build/assets/ProvinceUserManagement-CHb4mhM7.js @@ -0,0 +1 @@ +import{j as u,T as w,p as e6,ak as i,I as du,aU as r6,al as z,ag as Q,av as Z,aw as uu,ax as l,am as q,ar as $,B as fu,d as Su,b0 as l6,an as a6,b4 as Ku,ap as Bu,aq as Iu,b as n6}from"./mui-vendor-CkIVaoQP.js";import{G as a,S as f,p as s6,A as Ou,u as eu,c as ru,v as Vu,M as Y,b as W,L as V,h as _,N as au,W as t6,b4 as ou,j as Hu,X as lu,b5 as o6,b6 as i6,b7 as Tu,b8 as c6,f as d6}from"./index-CeyyVc1v.js";import{r as A,b as C6,u as h6}from"./react-vendor-CmFgShSM.js";import{u as Mu,f as A6}from"./redux-vendor-B7uoacJt.js";import{R as p6}from"./ResponsiveTable-w7hk7Uq8.js";import{d as v6}from"./VpnKey-Di_7HUWD.js";import{p as x6,a as iu,d as m6}from"./province-register-user-DVseE2hL.js";import{d as b6}from"./Tune-D4M2CAhp.js";import{d as Wu}from"./Delete-C5MyLelE.js";import{d as Lu}from"./Add--yVWBJhC.js";import{c as j6,a as cu}from"./city-get-city-qTSRxslT.js";import{d as F6}from"./Search-Dek2fED1.js";import{N as f6}from"./NumberFormatCustom-DwWPj40N.js";import{p as y6}from"./province-get-kill-houses-C3UQguyo.js";import{d as g6}from"./Check-CRb6laYC.js";import{C as k6}from"./CarPelak-BYFY8OXg.js";import{R as P6,a as N6}from"./index.esm-Bu7XMDZU.js";import{S as E6}from"./SelectCheck-CAe89SYT.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./iconBase-BEJYyZsk.js";const Ru=({userData:y})=>{var g,x,nu;return u.jsx(u.Fragment,{children:u.jsxs(a,{container:!0,gap:f.SMALL,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:[u.jsxs(a,{display:"flex",children:[u.jsx(w,{variant:"body1",mr:f.TINY,color:v=>v.palette.grey.A700,children:"نام کامل:"}),u.jsx(w,{mr:f.TINY,fontWeight:"bold",children:y.fullname})," "]}),u.jsxs(a,{display:"flex",children:[u.jsx(w,{variant:"body1",mr:f.TINY,color:v=>v.palette.grey.A700,children:"موبایل:"}),u.jsx(w,{mr:f.TINY,fontWeight:"bold",children:y.mobile})]}),u.jsxs(a,{display:"flex",children:[u.jsx(w,{variant:"body1",mr:f.TINY,color:v=>v.palette.grey.A700,children:"استان:"}),u.jsx(w,{mr:f.TINY,fontWeight:"bold",children:y.province})," "]}),u.jsxs(a,{display:"flex",children:[u.jsx(w,{variant:"body1",mr:f.TINY,color:v=>v.palette.grey.A700,children:"شهر:"}),u.jsx(w,{mr:f.TINY,fontWeight:"bold",children:y.city})]}),u.jsxs(a,{display:"flex",children:[u.jsx(w,{variant:"body1",mr:f.TINY,color:v=>v.palette.grey.A700,children:"تاریخ تولد:"}),u.jsx(w,{mr:f.TINY,fontWeight:"bold",children:s6(y==null?void 0:y.birthday)})]}),(y==null?void 0:y.role.length)>0&&u.jsxs(a,{display:"flex",children:[u.jsx(w,{variant:"body1",mr:f.TINY,color:v=>v.palette.grey.A700,children:((g=y==null?void 0:y.role)==null?void 0:g.length)>1?"نقش ها:":"نقش:"}),u.jsx(w,{mr:f.TINY,fontWeight:"bold",children:(x=y==null?void 0:y.role)==null?void 0:x.map((v,L)=>{var N="";switch(v){case"ProvinceOperator":N="اپراتور تخصیص استان";break;case"CityOperator":N="اپراتور شهرستان";break;case"KillHouseVet":N="دامپزشک کشتارگاه";break;case"Poultry":N="مرغدار";break;case"KillHouse":N="کشتارگاه";break;case"VetFarm":N="دامپزشک";break;case"Vet":N="دامپزشک";break;case"ProvinceInspector":N="بازرس استان";break;case"ProvinceFinancial":N="اپراتور مالی";break;case"Driver":N="راننده";break;case"Admin":N="راننده";break}return[u.jsxs(a,{display:"flex",gap:f.TINY,children:[u.jsx(g6,{color:"primary"}),u.jsx(w,{children:N})]},L)]})})]}),((nu=y==null?void 0:y.image)==null?void 0:nu.length)>5&&u.jsx(u.Fragment,{children:u.jsxs(a,{display:"flex",children:[u.jsx(w,{variant:"body1",mr:f.TINY,color:v=>v.palette.grey.A700,children:"پروفایل:"}),u.jsx(a,{mr:f.TINY,children:u.jsx("a",{href:y.image,children:u.jsx("img",{width:"100",height:"100",alt:"img",src:y.image})})})]})})]})})};Ru.propTypes={userData:e6.PropTypes.any};const _6=y=>{const[g]=A.useContext(Ou),[x,nu]=A.useState([]),[v,L]=A.useState([]),[N,Au]=A.useState(),[D,pu]=A.useState(),[su,vu]=A.useState(),[O,yu]=A.useState(),[Cu,gu]=A.useState(),[X,xu]=A.useState(),[hu,ku]=A.useState(),[mu,Pu]=A.useState(),[tu,Nu]=A.useState(),[Eu,bu]=A.useState(),[C,h]=A.useState(!1),[I,M]=A.useState(!0),[m,G]=A.useState(),o=Mu(),s=eu({initialValues:{mobile:"",fname:"",lname:"",nationalcode:"",password:"",birthday:Vu(Date()).format("YYYY-MM-DD hh:mm:ss")},validationSchema:ru({mobile:W().required("این فیلد اجباری است!").typeError("لطفا فیلد را به صورت عددی وارد کنید!").test("len","شماره تلفن باید با 0 شروع شود",(e,r)=>r.originalValue&&r.originalValue.startsWith("0")).test("len","شماره تماس 11 رقم باید باشد",(e,r)=>{if(r.originalValue)return r.originalValue.length===11}),fname:Y().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!"),lname:Y().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!"),nationalcode:W().required("این فیلد اجباری است!").test("len","کد ملی میبایست ده رقم باشد.",(e,r)=>{if(r.originalValue)return r.originalValue.length===10}),password:Y().required("این فیلد اجباری است!").typeError("لطفا مقادیر را به درستی وارد کنید!")})}),E=eu({initialValues:{KillHousePostal:"",KillHouseCapacity:"",KillHousePhone:"",KillHouseAddress:""},validationSchema:ru({KillHousePostal:W().typeError("لطفا فیلد را به درستی وارد کنید!"),KillHouseCapacity:W().typeError("لطفا فیلد را به صورت عددی وارد کنید!"),KillHousePhone:W().typeError("لطفا فیلد را به صورت عددی وارد کنید!").test("len","شماره تلفن باید با 0 شروع شود",(e,r)=>r.originalValue&&r.originalValue.startsWith("0")).test("len","شماره تماس 11 رقم باید باشد",(e,r)=>{if(r.originalValue)return r.originalValue.length===11}),KillHouseAddress:Y().typeError("لطفا فیلد را به درستی وارد کنید!")})}),P=eu({initialValues:{KillHouseVetPostal:"",KillHouseVetAddress:""},validationSchema:ru({KillHouseVetPostal:W().typeError("لطفا فیلد را به درستی وارد کنید!"),KillHouseVetAddress:Y().typeError("لطفا فیلد را به درستی وارد کنید!")})}),k=eu({initialValues:{cityProvinceAddress:"",cityProvincePostalCode:""},validationSchema:ru({cityProvinceAddress:Y().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),cityProvincePostalCode:W().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!")})}),c=eu({initialValues:{bankName:"",cardNumber:"",accountNumber:"",shabaNumber:"",accountHolder:""},validationSchema:ru({cardNumber:W().typeError("لطفا شماره کارتتان را وارد کنید!"),accountNumber:W().typeError("لطفا شماره حسابتان را وارد کنید!"),shabaNumber:W().typeError("لطفا شماره شبا را وارد کنید!"),accountHolder:Y().typeError("لطفا نام صاحب حساب را وارد کنید!")})}),j=eu({initialValues:{type_car:"ایسوزو",type_weight:"سنگین",capocity:"",health_code:""},validationSchema:ru({type_weight:Y().typeError("لطفا فیلد را به درستی وارد کنید!"),capocity:Y().typeError("لطفا فیلد را به درستی وارد کنید!"),name:Y().typeError("لطفا فیلد را به درستی وارد کنید!"),health_code:W().typeError("لطفا فیلد را به درستی وارد کنید!").required("این فیلد اجباری است!")})});A.useEffect(()=>{s.validateForm(),R.validateForm(),E.validateForm(),k.validateForm(),c.validateForm(),j.validateForm(),P.validateForm()},[]);const R=eu({initialValues:{userInfoCheck:""},validationSchema:ru({userInfoCheck:W().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!")})}),[F,zu]=C6.useState(),Uu=e=>{zu(e.target.value)};A.useEffect(()=>{var e;o(V()),(e=o(j6()))==null||e.then(r=>{o(_()),nu(r.payload.data)})},[]),A.useEffect(()=>{o(_()),N?(o(V()),o(cu(N)).then(e=>{L(e.payload.data),M(!1),o(_())})):su?(o(V()),o(cu(su)).then(e=>{L(e.payload.data),M(!1),o(_())})):O?(o(V()),o(cu(O)).then(e=>{L(e.payload.data),M(!1),o(_())})):tu?(o(V()),o(cu(tu)).then(e=>{L(e.payload.data),M(!1),o(_())})):hu&&(o(V()),o(cu(hu)).then(e=>{L(e.payload.data),M(!1),o(_())}),o(_()))},[N,su,tu,hu,O]);const[U,wu]=A.useState(!1),[ju,Yu]=A.useState([]),qu=(e,r,p,t)=>{Yu([e,r,p,t])};A.useEffect(()=>{(m||s.isValid&&D&&N)&&wu(!0)},[m]);const $u=e=>{if(m)switch(e){case"Poultry":return!(U&&mu);case"KillHouse":return!(U&&Cu);case"Driver":return!(U&&j.isValid);case"ProvinceOperator":return!(U&&k.isValid);case"CityOperator":return!(U&&k.isValid);case"VetFarm":return!(U&&k.isValid);case"ProvinceInspector":return!(U&&k.isValid);case"ProvinceFinancial":return!(U&&k.isValid);case"KillHouseVet":return!(U&&O&&X&&P.isValid);default:return!(U&&e)}else return!(s.isValid&&D&&N)},[J,S]=A.useState([{id:0,killHouseAddress:"",postal:"",shift_work_from:"",shift_work_to:"",province:"",city:"",name:"",capacity:"",killing_race:"",phone:"",bankName:"",cardNumber:"",accountNumber:"",shabaNumber:"",accountHolder:""}]),Du=()=>{S(e=>[...e,{id:e.length,killHouseAddress:"",postal:"",shift_work_from:"",shift_work_to:"",province:"",city:"",name:"",capacity:"",killing_race:"",phone:"",bankName:"",cardNumber:"",accountNumber:"",shabaNumber:"",accountHolder:""}])},Gu=e=>{let r=J.length-1;if(r!==0){let p=J.filter((t,n)=>n{let t,n,B;r?(t=r,[n,,B]=e.target.id.split("-")):(t=e.target.value,[n,B]=e.target.name.split("-")),n==="shift_work_from"?S(b=>{const d=b;return d[B].shift_work_from=t,d}):n==="shift_work_to"?S(b=>{const d=b;return d[B].shift_work_to=t,d}):n==="killHouseAddress"?S(b=>{const d=b;return d[B].killHouseAddress=t,d}):n==="postal"?S(b=>{const d=b;return d[B].postal=t,d}):n==="capacity"?S(b=>{const d=b;return d[B].capacity=Number(t),d}):n==="name"?S(b=>{const d=b;return d[B].name=t,d}):n==="killing_race"?S(b=>{const d=b;return d[B].killing_race=t,d}):n==="phone"?S(b=>{const d=b;return d[B].phone=Number(t),d}):n==="province"?(o(V()),o(cu(t)).then(b=>{L(b.payload.data),M(!1),o(_())}),S(b=>{const d=b;return d[p].province=t,d})):n==="city"?S(b=>{const d=b;return d[p].city=t,d}):n==="bankName"?S(b=>{const d=b;return d[B].bankName=e.target.value,d}):n==="cardNumber"?S(b=>{const d=b;return d[B].cardNumber=Number(e.target.value),d}):n==="accountNumber"?S(b=>{const d=b;return d[B].accountNumber=Number(e.target.value),d}):n==="shabaNumber"?S(b=>{const d=b;return d[B].shabaNumber=Number(e.target.value),d}):n==="accountHolder"&&S(b=>{const d=b;return d[B].accountHolder=e.target.value,d})},[Fu,H]=A.useState([{id:0,uniqueID:"",poultryAddress:"",halls:"",systemCode:"",epidemiologicalCode:"",unitName:"",capacity:"",licenseNumber:"",postal:"",bankName:"",cardNumber:"",accountNumber:"",shabaNumber:"",accountHolder:"",province:"",city:""}]),Xu=()=>{H(e=>[...e,{id:e.length,uniqueID:"",poultryAddress:"",halls:"",systemCode:"",epidemiologicalCode:"",unitName:"",capacity:"",licenseNumber:"",postal:"",bankName:"",cardNumber:"",accountNumber:"",shabaNumber:"",accountHolder:"",province:"",city:""}])},Ju=e=>{let r=Fu.length-1;if(r!==0){let p=Fu.filter((t,n)=>n{const[r,p]=e.target.name.split("-");r==="uniqueID"?H(t=>{const n=t;return n[p].uniqueID=e.target.value,n}):r==="poultryAddress"?H(t=>{const n=t;return n[p].poultryAddress=e.target.value,n}):r==="halls"?H(t=>{const n=t;return n[p].halls=Number(e.target.value),n}):r==="systemCode"?H(t=>{const n=t;return n[p].systemCode=Number(e.target.value),n}):r==="epidemiologicalCode"?H(t=>{const n=t;return n[p].epidemiologicalCode=Number(e.target.value),n}):r==="ownerName"?H(t=>{const n=t;return n[p].ownerName=e.target.value,n}):r==="unitName"?H(t=>{const n=t;return n[p].unitName=e.target.value,n}):r==="capacity"?H(t=>{const n=t;return n[p].capacity=Number(e.target.value),n}):r==="licenseNumber"?H(t=>{const n=t;return n[p].licenseNumber=Number(e.target.value),n}):r==="postal"?H(t=>{const n=t;return n[p].postal=Number(e.target.value),n}):r==="bankName"?H(t=>{const n=t;return n[p].bankName=e.target.value,n}):r==="cardNumber"?H(t=>{const n=t;return n[p].cardNumber=Number(e.target.value),n}):r==="accountNumber"?H(t=>{const n=t;return n[p].accountNumber=Number(e.target.value),n}):r==="shabaNumber"?H(t=>{const n=t;return n[p].shabaNumber=Number(e.target.value),n}):r==="accountHolder"?H(t=>{const n=t;return n[p].accountHolder=e.target.value,n}):r==="province"?(ku(e.target.value),H(t=>{const n=t;return n[p].province=e.target.value,n})):r==="city"&&(Pu(e.target.value),H(t=>{const n=t;return n[p].city=e.target.value,n}))},[_u,Qu]=A.useState(),[Zu,u6]=A.useState();return A.useEffect(()=>{F==="KillHouseVet"&&(o(V()),o(y6()).then(e=>{Qu(e.payload.data),o(_())}))},[F]),u.jsx(a,{container:!0,display:"block",gap:f.SMALL,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:u.jsxs(a,{container:!0,direction:"column",gap:f.SMALL,children:[!C&&u.jsxs(u.Fragment,{children:[u.jsx(w,{children:"بررسی کاربر"}),u.jsxs(a,{display:"flex",width:1,children:[u.jsx(i,{fullWidth:!0,id:"userInfoCheck",label:"شماره موبایل، کد کاربری یا کد ملی",variant:"outlined",value:R.values.userInfoCheck,error:R.touched.userInfoCheck?!!R.errors.userInfoCheck:null,onChange:R.handleChange,onBlur:R.handleBlur,helperText:R.touched.userInfoCheck&&R.errors.userInfoCheck?R.errors.userInfoCheck:null}),u.jsx(du,{disabled:!R.isValid,"aria-label":"delete",color:"primary",onClick:()=>{o(V()),o(x6({type:"check_user",value:R.values.userInfoCheck})).then(e=>{o(_()),e.error?e.error.message.includes("409")&&g({vertical:"top",horizontal:"center",msg:"کاربر پیدا نشد، یک کاربر جدید بسازید!",severity:"error"}):e.payload.data?G(e.payload.data.profile):(g({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}),o(au({right:!1,bottom:!1,content:null})))}),h(!0)},children:u.jsx(F6,{})})]}),u.jsx(r6,{children:"شماره موبایل با صفر شروع می‌شود!"})]}),C&&u.jsxs(u.Fragment,{children:[m?u.jsx(Ru,{userData:m}):u.jsxs(u.Fragment,{children:[u.jsx(a,{children:u.jsx(i,{id:"fname",label:"نام",variant:"outlined",sx:{width:"100%"},value:s.values.fname,error:s.touched.fname?!!s.errors.fname:null,onChange:s.handleChange,onBlur:s.handleBlur,helperText:s.touched.fname&&s.errors.fname?s.errors.fname:null})}),u.jsx(a,{children:u.jsx(i,{id:"lname",label:"نام خانوادگی ",variant:"outlined",sx:{width:"100%"},value:s.values.lname,error:s.touched.lname?!!s.errors.lname:null,onChange:s.handleChange,onBlur:s.handleBlur,helperText:s.touched.lname&&s.errors.lname?s.errors.lname:null})}),u.jsx(a,{children:u.jsx(i,{id:"mobile",label:"موبایل",variant:"outlined",sx:{width:"100%"},value:s.values.mobile,error:s.touched.mobile?!!s.errors.mobile:null,onChange:s.handleChange,onBlur:s.handleBlur,helperText:s.touched.mobile&&s.errors.mobile?s.errors.mobile:null})}),u.jsx(a,{children:u.jsx(t6,{fullWidth:!0,label:"تاریخ تولد",id:"birthday",renderInput:e=>u.jsx(i,{...e}),value:s.values.birthday,error:s.touched.birthday?!!s.errors.birthday:null,onChange:e=>{s.setFieldValue("birthday",Vu(e).format("YYYY-MM-DD hh:mm:ss"))},onBlur:s.handleBlur,helperText:s.touched.birthday&&s.errors.birthday?s.errors.birthday:null})}),u.jsx(a,{children:u.jsx(z,{disablePortal:!0,id:"province",options:x==null?void 0:x.map(e=>({id:e.key,label:e.name})),onChange:(e,r)=>{Au(r.id)},renderInput:e=>u.jsx(i,{...e,label:"استان را انتخاب کنید*"})})}),u.jsx(a,{children:u.jsx(z,{disabled:I,disablePortal:!0,id:"city",options:v==null?void 0:v.map(e=>({id:e.key,label:e.name})),onChange:(e,r)=>{pu(r.id)},renderInput:e=>u.jsx(i,{...e,label:"شهر را انتخاب کنید*"})})}),u.jsx(a,{children:u.jsx(i,{id:"password",label:"رمز عبور",type:"password",variant:"outlined",sx:{width:"100%"},value:s.values.password,error:s.touched.password?!!s.errors.password:null,onChange:s.handleChange,onBlur:s.handleBlur,helperText:s.touched.password&&s.errors.password?s.errors.password:null})}),u.jsx(a,{children:u.jsx(i,{id:"nationalcode",label:"کد ملی",variant:"outlined",sx:{width:"100%"},value:s.values.nationalcode,error:s.touched.nationalcode?!!s.errors.nationalcode:null,onChange:s.handleChange,onBlur:s.handleBlur,helperText:s.touched.nationalcode&&s.errors.nationalcode?s.errors.nationalcode:null})})]}),m&&u.jsx(a,{children:u.jsxs(Q,{children:[u.jsx(Z,{id:"demo-simple-select-helper-label",children:m?"افزودن نقش":"نوع کاربر"}),u.jsxs(uu,{fullWidth:!0,value:F,label:m?"افزودن نقش":"نوع کاربر",onChange:Uu,children:[!m.role.includes("CityOperator")&&u.jsx(l,{value:"CityOperator",children:"شهرستان"}),!m.role.includes("ProvinceOperator")&&u.jsx(l,{value:"ProvinceOperator",children:"استان"}),!m.role.includes("KillHouse")&&u.jsx(l,{value:"KillHouse",children:"کشتارگاه"}),u.jsx(l,{value:"Poultry",children:"مرغدار"}),!m.role.includes("VetFarm")&&u.jsx(l,{value:"VetFarm",children:"دامپزشک"}),!m.role.includes("ProvinceFinancial")&&u.jsx(l,{value:"ProvinceFinancial",children:"اپراتور مالی"}),!m.role.includes("ProvinceInspector")&&u.jsx(l,{value:"ProvinceInspector",children:"بازرس استان"}),!m.role.includes("Driver")&&u.jsx(l,{value:"Driver",children:"راننده"}),!m.role.includes("KillHouseVet")&&u.jsx(l,{disabled:m==null?void 0:m.role.includes("KillHouseVet"),value:"KillHouseVet",children:"دامپزشک کشتارگاه"})]})]})}),Fu.map((e,r)=>u.jsx(u.Fragment,{children:F==="Poultry"&&u.jsxs(u.Fragment,{children:[u.jsx(q,{children:u.jsx($,{label:"اطلاعات مرغدار "+(r+1)})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"شناسه یکتا مرغدار",variant:"outlined",onChange:K,name:"uniqueID-"+r})}),u.jsx(a,{children:u.jsxs(Q,{fullWidth:!0,children:[u.jsx(Z,{id:"demo-simple-select-label",children:"استان *"}),u.jsx(uu,{fullWidth:!0,id:"province",label:"استان *",onChange:K,name:"province-"+r,children:x==null?void 0:x.map(p=>[u.jsx(l,{value:p.key,children:p.name},p.key)])})]})}),u.jsx(a,{children:u.jsxs(Q,{fullWidth:!0,disabled:I,children:[u.jsx(Z,{id:"demo-simple-select-label",children:"شهر *"}),u.jsx(uu,{fullWidth:!0,id:"city",label:"شهر *",onChange:K,name:"city-"+r,children:v?v.map(p=>[u.jsx(l,{value:p.key,children:p.name},p.key)]):[]})]})}),u.jsx(a,{children:u.jsx(i,{error:!1,fullWidth:!0,label:"آدرس مرغداری",variant:"outlined",onChange:K,name:"poultryAddress-"+r})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"تعداد سالن",variant:"outlined",onChange:K,name:"halls-"+r})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"کد سیستمی",variant:"outlined",onChange:K,name:"systemCode-"+r})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"کد اپیدمیولوژیک",variant:"outlined",onChange:K,name:"epidemiologicalCode-"+r})}),u.jsx(a,{children:u.jsx(i,{error:!1,fullWidth:!0,label:"نام واحد",variant:"outlined",onChange:K,name:"unitName-"+r})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"ظرفیت",variant:"outlined",onChange:K,name:"capacity-"+r})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"شماره گواهی بهداشتی",variant:"outlined",onChange:K,name:"licenseNumber-"+r})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"کد پستی",variant:"outlined",onChange:K,name:"postal-"+r})}),u.jsx(q,{children:u.jsx($,{label:"اطلاعات بانکی مرغدار "+(r+1)})}),u.jsx(a,{children:u.jsxs(Q,{fullWidth:!0,children:[u.jsx(Z,{id:"demo-simple-select-label",children:"بانک"}),u.jsxs(uu,{fullWidth:!0,id:"bankName",label:"بانک",onChange:K,name:"bankName-"+r,children:[u.jsx(l,{value:"موسسه افضل توس",children:"موسسه افضل توس"}),u.jsx(l,{value:"انصار",children:"انصار"}),u.jsx(l,{value:"سپه",children:"سپه"}),u.jsx(l,{value:"دی",children:"دی"}),u.jsx(l,{value:"کاب",children:"اقتصاد نوین"}),u.jsx(l,{value:"گردشگری",children:"گردشگری"}),u.jsx(l,{value:"حکمت ایرانیان",children:"حکمت ایرانیان"}),u.jsx(l,{value:"ایران زمین",children:"ایران زمین"}),u.jsx(l,{value:"کشاورزی",children:"کشاورزی"}),u.jsx(l,{value:"مسکن",children:"مسکن"}),u.jsx(l,{value:"مهر ایران",children:"مهر ایران"}),u.jsx(l,{value:"مهر اقتصاد",children:"مهر اقتصاد"}),u.jsx(l,{value:"ملت",children:"ملت"}),u.jsx(l,{value:"ملی",children:"ملی"}),u.jsx(l,{value:"پارسیان",children:"پارسیان"}),u.jsx(l,{value:"پاسارگاد",children:"پاسارگاد"}),u.jsx(l,{value:"پست بانک ایران",children:"پست بانک ایران"}),u.jsx(l,{value:"صادرات",children:"صادرات"}),u.jsx(l,{value:"سامان",children:"سامان"}),u.jsx(l,{value:"صنعت و معدن",children:"صنعت و معدن"}),u.jsx(l,{value:"سرمایه",children:"سرمایه"}),u.jsx(l,{value:"شهر",children:"شهر"}),u.jsx(l,{value:"سینا",children:"سینا"}),u.jsx(l,{value:"تجارت",children:"تجارت"}),u.jsx(l,{value:"موسسه اعتباری توسعه",children:"موسسه اعتباری توسعه"}),u.jsx(l,{value:"خاورمیانه",children:"خاورمیانه"})]})]})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"شماره کارت",variant:"outlined",onChange:K,name:"cardNumber-"+r})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"شماره حساب",variant:"outlined",onChange:K,name:"accountNumber-"+r})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"شماره شبا",variant:"outlined",onChange:K,name:"shabaNumber-"+r})}),u.jsx(a,{children:u.jsx(i,{error:!1,fullWidth:!0,label:"نام صاحب حساب",variant:"outlined",onChange:K,name:"accountHolder-"+r})}),u.jsxs(a,{container:!0,direction:"row",children:[u.jsx(du,{"aria-label":"delete",color:"success",children:u.jsx(Lu,{onClick:Xu})}),u.jsx(du,{"aria-label":"delete",color:"secondary",children:u.jsx(Wu,{onClick:Ju})})]})]})})),F==="Driver"&&u.jsxs(u.Fragment,{children:[u.jsx(q,{children:u.jsx($,{label:"اطلاعات راننده"})}),u.jsxs(a,{container:!0,mt:f.SMALL,gap:f.SMALL,alignSelf:"center",direction:{xs:"column",sm:"row"},children:[u.jsxs(Q,{fullWidth:!0,children:[u.jsx(Z,{id:"demo-simple-select-label",children:"مدل خودرو"}),u.jsxs(uu,{labelId:"demo-simple-select-label",id:"type_car",label:"مدل خودرو",value:j.values.type_car,onChange:e=>{j.setFieldValue("type_car",e.target.value)},error:j.touched.type_car?!!j.errors.type_car:null,onBlur:j.handleBlur,helperText:j.touched.type_car&&j.errors.type_car?j.errors.type_car:null,children:[u.jsx(l,{value:"ایسوزو",children:"ایسوزو"}),u.jsx(l,{value:"نیسان",children:"نیسان"}),u.jsx(l,{value:"وانت",children:"وانت"}),u.jsx(l,{value:"اف ام",children:"اف ام"}),u.jsx(l,{value:"کامیون",children:"کامیون"}),u.jsx(l,{value:"هیوندا کروس",children:"هیوندا کروس"}),u.jsx(l,{value:"بادسان",children:"بادسان"}),u.jsx(l,{value:"هیوندا",children:"هیوندا"}),u.jsx(l,{value:"کامیونت ایسوزو",children:"کامیونت ایسوزو"}),u.jsx(l,{value:"خاور بنز",children:"خاور بنز"})]})]}),u.jsx(f6,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"capocity",label:"ظرفیت خودرو (قطعه)",variant:"outlined",value:j.values.capocity,error:j.touched.capocity?!!j.errors.capocity:null,onChange:j.handleChange,onBlur:j.handleBlur,helperText:j.touched.capocity&&j.errors.capocity?j.errors.capocity:null}),u.jsx(i,{fullWidth:!0,id:"health_code",label:"کد بهداشتی*",variant:"outlined",value:j.values.health_code,error:j.touched.health_code?!!j.errors.health_code:null,onChange:j.handleChange,onBlur:j.handleBlur,helperText:j.touched.health_code&&j.errors.health_code?j.errors.health_code:null})]}),u.jsx(w,{children:"مشخصات پلاک"}),u.jsx(a,{mt:f.TINY,justifyContent:"center",sx:{display:"flex",flexDirection:"row"},children:u.jsx(k6,{width:"100%",handleChange:qu})})]}),F==="KillHouse"&&u.jsxs(u.Fragment,{children:[u.jsx(q,{children:u.jsx($,{label:"اطلاعات پایه کشتارگاه"})}),u.jsx(a,{children:u.jsx(z,{disablePortal:!0,id:"province",options:x==null?void 0:x.map(e=>({id:e.key,label:e.name})),onChange:(e,r)=>{vu(r.id)},renderInput:e=>u.jsx(i,{...e,label:"استان کشتارگاه*"})})}),u.jsx(a,{children:u.jsx(z,{disabled:I,disablePortal:!0,id:"city",options:v==null?void 0:v.map(e=>({id:e.key,label:e.name})),onChange:(e,r)=>{gu(r.id)},renderInput:e=>u.jsx(i,{...e,label:"شهر کشتارگاه*"})})}),u.jsx(a,{children:u.jsx(i,{id:"KillHouseAddress",label:"آدرس کشتارگاه",variant:"outlined",sx:{width:"100%"},value:E.values.KillHouseAddress,error:E.touched.KillHouseAddress?!!E.errors.KillHouseAddress:null,onChange:E.handleChange,onBlur:E.handleBlur,helperText:E.touched.KillHouseAddress&&E.errors.KillHouseAddress?E.errors.KillHouseAddress:null})}),u.jsx(a,{children:u.jsx(i,{id:"KillHousePostal",label:"کد پستی",variant:"outlined",sx:{width:"100%"},value:E.values.KillHousePostal,error:E.touched.KillHousePostal?!!E.errors.KillHousePostal:null,onChange:E.handleChange,onBlur:E.handleBlur,helperText:E.touched.KillHousePostal&&E.errors.KillHousePostal?E.errors.KillHousePostal:null})}),J==null?void 0:J.map((e,r)=>{var p;return u.jsxs(u.Fragment,{children:[u.jsx(q,{children:u.jsx($,{label:"کشتارگاه "+(r+1)})}),u.jsx(a,{children:u.jsx(i,{error:!1,fullWidth:!0,label:"نام کشتارگاه",variant:"outlined",onChange:T,name:"name-"+r})}),u.jsx(a,{children:u.jsx(z,{disablePortal:!0,id:"province",options:x==null?void 0:x.map(t=>({id:t.key,label:t.name})),onChange:(t,n)=>{T(t,n.id,r)},name:"province-"+r,renderInput:t=>u.jsx(i,{name:"province-"+r,...t,label:"استان *"})})}),u.jsx(a,{children:u.jsx(z,{disabled:!((p=J[0])!=null&&p.province),id:"city",options:v==null?void 0:v.map(t=>({id:t.key,label:t.name})),name:"city-"+r,onChange:(t,n)=>{T(t,n.id,r)},renderInput:t=>u.jsx(i,{name:"city-"+r,...t,label:"شهر *"})})}),u.jsx(a,{children:u.jsx(i,{error:!1,fullWidth:!0,label:"آدرس",variant:"outlined",onChange:T,name:"killHouseAddress-"+r})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"کد پستی",variant:"outlined",onChange:T,name:"postal-"+r})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"ظرفیت",variant:"outlined",onChange:T,name:"capacity-"+r})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"موبایل",variant:"outlined",onChange:T,name:"phone-"+r})}),u.jsx(q,{children:u.jsx($,{label:"اطلاعات بانکی کشتارگاه "+(r+1)})}),u.jsx(a,{children:u.jsxs(Q,{fullWidth:!0,children:[u.jsx(Z,{id:"demo-simple-select-label",children:"بانک"}),u.jsxs(uu,{fullWidth:!0,id:"bankName",label:"بانک",onChange:T,name:"bankName-"+r,children:[u.jsx(l,{value:"موسسه افضل توس",children:"موسسه افضل توس"}),u.jsx(l,{value:"انصار",children:"انصار"}),u.jsx(l,{value:"سپه",children:"سپه"}),u.jsx(l,{value:"دی",children:"دی"}),u.jsx(l,{value:"کاب",children:"اقتصاد نوین"}),u.jsx(l,{value:"گردشگری",children:"گردشگری"}),u.jsx(l,{value:"حکمت ایرانیان",children:"حکمت ایرانیان"}),u.jsx(l,{value:"ایران زمین",children:"ایران زمین"}),u.jsx(l,{value:"کشاورزی",children:"کشاورزی"}),u.jsx(l,{value:"مسکن",children:"مسکن"}),u.jsx(l,{value:"مهر ایران",children:"مهر ایران"}),u.jsx(l,{value:"مهر اقتصاد",children:"مهر اقتصاد"}),u.jsx(l,{value:"ملت",children:"ملت"}),u.jsx(l,{value:"ملی",children:"ملی"}),u.jsx(l,{value:"پارسیان",children:"پارسیان"}),u.jsx(l,{value:"پاسارگاد",children:"پاسارگاد"}),u.jsx(l,{value:"پست بانک ایران",children:"پست بانک ایران"}),u.jsx(l,{value:"صادرات",children:"صادرات"}),u.jsx(l,{value:"سامان",children:"سامان"}),u.jsx(l,{value:"صنعت و معدن",children:"صنعت و معدن"}),u.jsx(l,{value:"سرمایه",children:"سرمایه"}),u.jsx(l,{value:"شهر",children:"شهر"}),u.jsx(l,{value:"سینا",children:"سینا"}),u.jsx(l,{value:"تجارت",children:"تجارت"}),u.jsx(l,{value:"موسسه اعتباری توسعه",children:"موسسه اعتباری توسعه"}),u.jsx(l,{value:"خاورمیانه",children:"خاورمیانه"})]})]})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"شماره کارت",variant:"outlined",onChange:T,name:"cardNumber-"+r})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"شماره حساب",variant:"outlined",onChange:T,name:"accountNumber-"+r})}),u.jsx(a,{children:u.jsx(i,{inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:!1,fullWidth:!0,label:"شماره شبا",variant:"outlined",onChange:T,name:"shabaNumber-"+r})}),u.jsx(a,{children:u.jsx(i,{error:!1,fullWidth:!0,label:"نام صاحب حساب",variant:"outlined",onChange:T,name:"accountHolder-"+r})}),u.jsxs(a,{container:!0,direction:"row",children:[u.jsx(du,{"aria-label":"delete",color:"success",children:u.jsx(Lu,{onClick:Du})}),u.jsx(du,{"aria-label":"delete",color:"secondary",children:u.jsx(Wu,{onClick:Gu})})]})]})})]}),F==="KillHouseVet"&&u.jsxs(u.Fragment,{children:[u.jsx(q,{children:u.jsx($,{label:"اطلاعات دامپزشک کشتارگاه"})}),u.jsx(a,{children:u.jsx(z,{disablePortal:!0,id:"province",options:_u==null?void 0:_u.map(e=>({id:e.key,label:e.name})),onChange:(e,r)=>{u6(r.id)},renderInput:e=>u.jsx(i,{...e,label:"انتخاب کشتارگاه"})})}),u.jsx(a,{children:u.jsx(z,{disablePortal:!0,id:"province",options:x==null?void 0:x.map(e=>({id:e.key,label:e.name})),onChange:(e,r)=>{yu(r.id)},renderInput:e=>u.jsx(i,{...e,label:"استان کشتارگاه*"})})}),u.jsx(a,{children:u.jsx(z,{disabled:I,disablePortal:!0,id:"city",options:v==null?void 0:v.map(e=>({id:e.key,label:e.name})),onChange:(e,r)=>{xu(r.id)},renderInput:e=>u.jsx(i,{...e,label:"شهر کشتارگاه*"})})}),u.jsx(a,{children:u.jsx(i,{id:"KillHouseVetAddress",label:"آدرس ",variant:"outlined",sx:{width:"100%"},value:P.values.KillHouseVetAddress,error:P.touched.KillHouseAddress?!!P.errors.KillHouseVetAddress:null,onChange:P.handleChange,onBlur:P.handleBlur,helperText:P.touched.KillHouseVetAddress&&P.errors.KillHouseVetAddress?P.errors.KillHouseVetAddress:null})}),u.jsx(a,{children:u.jsx(i,{id:"KillHouseVetPostal",label:"کد پستی",variant:"outlined",sx:{width:"100%"},value:P.values.KillHouseVetPostal,error:P.touched.KillHouseVetPostal?!!P.errors.KillHouseVetPostal:null,onChange:P.handleChange,onBlur:P.handleBlur,helperText:P.touched.KillHouseVetPostal&&P.errors.KillHouseVetPostal?P.errors.KillHouseVetPostal:null})})]}),(F==="CityOperator"||F==="ProvinceOperator"||F==="VetFarm"||F==="ProvinceInspector"||F==="ProvinceFinancial")&&u.jsxs(u.Fragment,{children:[u.jsx(q,{children:u.jsx($,{label:"اطلاعات اپراتور"})}),u.jsx(a,{children:u.jsx(z,{disablePortal:!0,id:"province",options:x==null?void 0:x.map(e=>({id:e.key,label:e.name})),onChange:(e,r)=>{Nu(r.id)},renderInput:e=>u.jsx(i,{...e,label:"استان *"})})}),u.jsx(a,{children:u.jsx(z,{disabled:I,disablePortal:!0,id:"city",options:v==null?void 0:v.map(e=>({id:e.key,label:e.name})),onChange:(e,r)=>{bu(r.id)},renderInput:e=>u.jsx(i,{...e,label:"شهر *"})})}),u.jsx(a,{children:u.jsx(i,{id:"cityProvinceAddress",label:"آدرس",variant:"outlined",sx:{width:"100%"},value:k.values.cityProvinceAddress,error:k.touched.cityProvinceAddress?!!k.errors.cityProvinceAddress:null,onChange:k.handleChange,onBlur:k.handleBlur,helperText:k.touched.cityProvinceAddress&&k.errors.cityProvinceAddress?k.errors.cityProvinceAddress:null})}),u.jsx(a,{children:u.jsx(i,{id:"cityProvincePostalCode",label:"کد پستی",variant:"outlined",sx:{width:"100%"},value:k.values.cityProvincePostalCode,error:k.touched.cityProvincePostalCode?!!k.errors.cityProvincePostalCode:null,onChange:k.handleChange,onBlur:k.handleBlur,helperText:k.touched.cityProvincePostalCode&&k.errors.cityProvincePostalCode?k.errors.cityProvincePostalCode:null})})]}),(F==="CityOperator"||F==="KillHouseVet"||F==="VetFarm"||F==="ProvinceOperator"||F==="Driver"||F==="ProvinceFinancial")&&u.jsxs(u.Fragment,{children:[u.jsx(q,{children:u.jsx($,{label:"اطلاعات بانکی"})}),u.jsx(a,{children:u.jsxs(Q,{fullWidth:!0,children:[u.jsx(Z,{id:"demo-simple-select-label",children:"بانک"}),u.jsxs(uu,{fullWidth:!0,value:c.values.bankName,id:"bankName",label:"بانک",onChange:e=>{c.setFieldValue("bankName",e.target.value)},children:[u.jsx(l,{value:"موسسه افضل توس",children:"موسسه افضل توس"}),u.jsx(l,{value:"انصار",children:"انصار"}),u.jsx(l,{value:"سپه",children:"سپه"}),u.jsx(l,{value:"دی",children:"دی"}),u.jsx(l,{value:"کاب",children:"اقتصاد نوین"}),u.jsx(l,{value:"گردشگری",children:"گردشگری"}),u.jsx(l,{value:"حکمت ایرانیان",children:"حکمت ایرانیان"}),u.jsx(l,{value:"ایران زمین",children:"ایران زمین"}),u.jsx(l,{value:"کشاورزی",children:"کشاورزی"}),u.jsx(l,{value:"مسکن",children:"مسکن"}),u.jsx(l,{value:"مهر ایران",children:"مهر ایران"}),u.jsx(l,{value:"مهر اقتصاد",children:"مهر اقتصاد"}),u.jsx(l,{value:"ملت",children:"ملت"}),u.jsx(l,{value:"ملی",children:"ملی"}),u.jsx(l,{value:"پارسیان",children:"پارسیان"}),u.jsx(l,{value:"پاسارگاد",children:"پاسارگاد"}),u.jsx(l,{value:"پست بانک ایران",children:"پست بانک ایران"}),u.jsx(l,{value:"صادرات",children:"صادرات"}),u.jsx(l,{value:"سامان",children:"سامان"}),u.jsx(l,{value:"صنعت و معدن",children:"صنعت و معدن"}),u.jsx(l,{value:"سرمایه",children:"سرمایه"}),u.jsx(l,{value:"شهر",children:"شهر"}),u.jsx(l,{value:"سینا",children:"سینا"}),u.jsx(l,{value:"تجارت",children:"تجارت"}),u.jsx(l,{value:"موسسه اعتباری توسعه",children:"موسسه اعتباری توسعه"}),u.jsx(l,{value:"خاورمیانه",children:"خاورمیانه"})]})]})}),u.jsx(a,{children:u.jsx(i,{fullWidth:!0,id:"cardNumber",label:"شماره کارت",value:c.values.cardNumber,error:c.touched.cardNumber?!!c.errors.cardNumber:null,onChange:c.handleChange,onBlur:c.handleBlur,helperText:c.touched.cardNumber&&c.errors.cardNumber?c.errors.cardNumber:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(a,{children:u.jsx(i,{fullWidth:!0,id:"accountNumber",label:"شماره حساب",value:c.values.accountNumber,error:c.touched.accountNumber?!!c.errors.accountNumber:null,onChange:c.handleChange,onBlur:c.handleBlur,helperText:c.touched.accountNumber&&c.errors.accountNumber?c.errors.accountNumber:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(a,{children:u.jsx(i,{fullWidth:!0,id:"shabaNumber",label:"شماره شبا",value:c.values.shabaNumber,error:c.touched.shabaNumber?!!c.errors.shabaNumber:null,onChange:c.handleChange,onBlur:c.handleBlur,helperText:c.touched.shabaNumber&&c.errors.shabaNumber?c.errors.shabaNumber:null,autoComplete:"current-password",variant:"outlined"})}),u.jsx(a,{children:u.jsx(i,{fullWidth:!0,id:"accountHolder",label:"نام صاحب حساب",value:c.values.accountHolder,error:c.touched.accountHolder?!!c.errors.accountHolder:null,onChange:c.handleChange,onBlur:c.handleBlur,helperText:c.touched.accountHolder&&c.errors.accountHolder?c.errors.accountHolder:null,variant:"outlined"})})]}),u.jsx(a,{mb:f.SMALL,children:u.jsx(fu,{fullWidth:!0,variant:"contained",disabled:$u(F),onClick:()=>{o(V()),m?F==="ProvinceOperator"||F==="CityOperator"||F==="VetFarm"||F==="ProvinceInspector"||F==="ProvinceFinancial"?o(iu({type:F,userprofile_key:m.key,city:Eu,province:tu,address:k.values.cityProvinceAddress,postal_code:k.values.cityProvincePostalCode,user_bank_info:{name_of_bank_user:c.values.accountHolder,bank_name:c.values.bankName,card:c.values.cardNumber,shaba:c.values.shabaNumber,account:c.values.accountNumber}})).then(e=>{o(_()),e.error?e.error.message.includes("403")?g({vertical:"top",horizontal:"center",msg:"کاربر از قبل موجود است!",severity:"error"}):e.error.message.includes("406")?g({vertical:"top",horizontal:"center",msg:"اپراتور تکراری قابل ثبت نیست!",severity:"error"}):g({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(g({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(ou()),o(au({right:!1,bottom:!1,content:null})))}):F==="KillHouse"?o(iu({type:"KillHouse",userprofile_key:m.key,city:Cu,province:su,address:E.values.KillHouseAddress,postal_code:E.values.KillHousePostal,killhouse_data:J.map((e,r)=>({address:{city_key:e.city,province_key:e.province,address:e.killHouseAddress,postal_code:e.postal},user_bank_info:{name_of_bank_user:e.accountHolder,bank_name:e.bankName,card:e.cardNumber,shaba:e.shabaNumber,account:e.accountNumber},name:e.name,capacity:e.capacity,phone:e.phone}))})).then(e=>{o(_()),e.error?e.error.message.includes("403")?g({vertical:"top",horizontal:"center",msg:"کشتارگاه با این مشخصات از قبل موجود است!",severity:"error"}):g({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(g({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(ou()),o(au({right:!1,bottom:!1,content:null})))}):F==="Poultry"?o(iu({type:"Poultry",owner_key:m.key,poultry_list:Fu.map((e,r)=>({address:{province_key:e.province,city_key:e.city,address:e.poultryAddress,postal_code:e.postal},user_bank_info:{name_of_bank_user:e.accountHolder,bank_name:e.bankName,card:e.cardNumber,shaba:e.shabaNumber,account:e.accountNumber},epidemiological_code:e.epidemiologicalCode,system_code:e.systemCode,number_of_halls:e.halls,breeding_unique_id:e.uniqueID,unit_name:e.unitName,licence_number:e.licenseNumber,total_capacity:e.capacity,health_certificate_number:e.licenseNumber}))})).then(e=>{o(_()),e.payload.error?g({vertical:"top",horizontal:"center",msg:e.payload.error,severity:"error"}):(g({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(ou()),o(au({right:!1,bottom:!1,content:null})))}):F==="Driver"?o(iu({type:"Driver",userprofile_key:m.key,driver_name:m.fullname,driver_mobile:m.mobile,type_car:j.values.type_car,capocity:j.values.capocity,weight_without_load:"0",health_code:j.values.health_code,pelak:ju[0]+" "+ju[1]+" "+ju[2]+" "+ju[3],user_bank_info:{name_of_bank_user:c.values.accountHolder,bank_name:c.values.bankName,card:c.values.cardNumber,shaba:c.values.shabaNumber,account:c.values.accountNumber}})).then(e=>{o(au({right:!1,bottom:!1,content:null})),o(_()),e.error?e.error.message.includes("403")?g({vertical:"top",horizontal:"center",msg:"راننده با این مشخصات از قبل موجود است!",severity:"error"}):g({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(g({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(ou()))}):F==="KillHouseVet"&&o(iu({userprofile_key:m.key,type:"KillHouseVet",kill_house_key:Zu,city:X,province:O,address:P.values.KillHouseVetAddress,postal_code:P.values.KillHouseVetPostal,user_bank_info:{name_of_bank_user:c.values.accountHolder,bank_name:c.values.bankName,card:c.values.cardNumber,shaba:c.values.shabaNumber,account:c.values.accountNumber}})).then(e=>{o(_()),e.error?e.error.message.includes("403")?g({vertical:"top",horizontal:"center",msg:"دامپزشک کشتارگاه با این مشخصات از قبل موجود است!",severity:"error"}):g({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(g({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(ou()),o(au({right:!1,bottom:!1,content:null})))}):o(iu({type:"profile",fullname:s.values.fname+" "+s.values.lname,first_name:s.values.fname,last_name:s.values.lname,national_code:s.values.nationalcode,national_id:s.values.national_id,birthday:s.values.birthday,mobile:s.values.mobile,password:s.values.password,city:D,province:N,image:""})).then(e=>{o(_()),e.payload.error?g({vertical:"top",horizontal:"center",msg:e.payload.error,severity:"error"}):(g({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),G(e.payload.data),o(ou()))})},children:"ثبت اطلاعات"})})]})]})})},H6=()=>{const y=h6(),g=A6(C=>C.userSlice.authToken);A.useContext(Ou);const x=Mu(),nu=({item:C})=>{const[h,I]=A.useState(null),M=!!h,m=P=>{I(P.currentTarget)},G=()=>{I(null)},o=()=>{y(lu()==="AdminX"?o6+(C==null?void 0:C.key):lu()==="SuperAdmin"?i6+(C==null?void 0:C.key):lu()==="ProvinceOperator"?Tu+(C==null?void 0:C.key):Tu+(C==null?void 0:C.key)),G()},s=()=>{x(c6(g)),x(V()),x(d6({mobile:C==null?void 0:C.mobile,password:C==null?void 0:C.password})).then(()=>{x(_()),y("/")}),G()},E=lu()==="AdminX"||lu()==="SuperAdmin";return u.jsxs(a,{children:[u.jsx(Su,{title:"تنظیمات",placement:"right-start",children:u.jsx(du,{"aria-label":"actions",color:"primary",className:"avicultureActiveRequestsBtn",onClick:m,children:u.jsx(b6,{})})}),u.jsx(l6,{open:M,anchorEl:h,onClose:G,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsxs(a6,{sx:{minWidth:200,p:1},children:[u.jsxs(Ku,{onClick:o,children:[u.jsx(Bu,{children:u.jsx(m6,{fontSize:"small",color:"primary"})}),u.jsx(Iu,{primary:u.jsx(w,{variant:"body2",sx:{color:"primary.main"},children:"پرونده کاربر"})})]}),E&&u.jsxs(Ku,{onClick:s,children:[u.jsx(Bu,{children:u.jsx(v6,{fontSize:"small",color:"success"})}),u.jsx(Iu,{primary:u.jsx(w,{variant:"body2",sx:{color:"success.main"},children:"ورود به پنل"})})]})]})})]})},v=C=>{gu(C.target.value)},[L,N]=A.useState([]),Au=L.length?L.join():"",[D,pu]=A.useState([]),[su,vu]=A.useState(0),[O,yu]=A.useState(10),[Cu,gu]=A.useState(""),[X,xu]=A.useState(1),[hu,ku]=A.useState([]),mu=async C=>{x(V());const h=await Hu.get(`system_user_profile/?users_info&search=filter&value=${Cu||""}&page=${C}&page_size=${O}&roles=${Au}`);x(_()),pu(h.data.results),vu(h.data.count)},Pu=C=>{mu(C),xu(C)},tu=C=>{yu(C),xu(1)},Nu=C=>lu()!=="ProvinceOperator"?[C==null?void 0:C.password]:[],Eu=()=>lu()!=="ProvinceOperator"?["کلمه عبور"]:[];A.useEffect(()=>{const C=D==null?void 0:D.map((h,I)=>{var M,m;return[X===1?I+1:I+O*(X-1)+1,h!=null&&h.fullname?h==null?void 0:h.fullname:(h==null?void 0:h.firstName)+" "+(h==null?void 0:h.lastName),u.jsxs(a,{children:[!(((M=h==null?void 0:h.role)==null?void 0:M.length)>0)&&"کاربر پایه",(m=h==null?void 0:h.role)==null?void 0:m.map((G,o)=>{let s="";switch(G){case"ProvinceOperator":s="اپراتور تخصیص استان";break;case"CityOperator":s="اپراتور شهرستان";break;case"KillHouseVet":s="دامپزشک کشتارگاه";break;case"VetFarm":s="دامپزشک";break;case"Poultry":s="مرغدار";break;case"KillHouse":s="کشتارگاه";break;case"Vet":s="دامپزشک";break;case"ProvinceInspector":s="بازرس استان";break;case"ProvinceFinancial":s="اپراتور مالی";break;case"Driver":s="راننده";break;case"Admin":s="ادمین";break}return u.jsx(a,{children:s},o)})]},I),h==null?void 0:h.mobile,h==null?void 0:h.baseOrder,h==null?void 0:h.city,...Nu(h),u.jsx(nu,{item:h},I)]});ku(C)},[D]),A.useEffect(()=>{mu(1)},[x,O]);const bu=async C=>{C.preventDefault(),x(V());try{const h=await Hu.get(`system_user_profile/?users_info&search=filter&value=${Cu||""}&page=${X}&page_size=${O}&roles=${Au}`);pu(h.data.results),vu(h.data.count),x(_())}catch(h){console.error("Error fetching data:",h)}};return u.jsxs(a,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(a,{container:!0,alignItems:"center",mb:f.SMALL,gap:f.SMALL,children:[u.jsx(w,{children:"کاربران"}),u.jsx(fu,{className:"first-step",variant:"contained",onClick:()=>{x(au({title:"ثبت کاربر جدید",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(_6,{})}))},children:"ثبت کاربر جدید"}),u.jsx(E6,{size:"small",label:"فیلتر نقش",onChange:C=>N(C),options:[{label:"اپراتور تخصیص استان",value:"ProvinceOperator"},{label:"اپراتور شهرستان",value:"CityOperator"},{label:"بازرس استان",value:"ProvinceInspector"},{label:"دامپزشک",value:"VetFarm"},{label:"کشتارگاه",value:"KillHouse"},{label:"دامپزشک کشتارگاه",value:"KillHouseVet"},{label:"مرغدار",value:"Poultry"},{label:"اپراتور مالی",value:"ProvinceFinancial"},{label:"راننده",value:"Driver"},{label:"ادمین",value:"Admin"}]}),u.jsx("form",{onSubmit:bu,children:u.jsxs(a,{container:!0,alignItems:"center",gap:f.SMALL,children:[u.jsx(i,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:v}),u.jsx(fu,{type:"submit",onClick:bu,endIcon:u.jsx(P6,{}),children:"جستجو"})]})}),u.jsx(a,{children:u.jsx(Su,{title:"خروجی اکسل",children:u.jsx("a",{href:`${Hu.defaults.baseURL}get_all_user_excel/`,rel:"noreferrer",children:u.jsx(fu,{color:"success",children:u.jsx(N6,{size:32})})})})})]}),u.jsx(p6,{data:hu,columns:["ردیف","نام کامل","نوع کاربری","شماره تلفن","کد کاربری","شهر",...Eu(),"عملیات"],handlePageChange:Pu,totalRows:su,page:X,perPage:O,handlePerRowsChange:tu,title:"مدیریت کاربران"})]})},w6=()=>u.jsx(a,{container:!0,xs:12,alignItems:"start",gap:f.SMALL,direction:"column",children:u.jsx(a,{width:"100%",mt:f.SMALL,children:u.jsx(H6,{})})}),Z6=()=>u.jsx(u.Fragment,{children:u.jsx(n6,{display:"flex",justifyContent:"center",children:u.jsx(a,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsx(a,{container:!0,justifyContent:"space-between",gap:f.SMALL,children:u.jsx(a,{xs:12,children:u.jsx(w6,{})})})})})});export{Z6 as default}; diff --git a/build/assets/ProvinceWagePaymentTransactions-OloKgjY0.js b/build/assets/ProvinceWagePaymentTransactions-OloKgjY0.js new file mode 100644 index 0000000..38cb75a --- /dev/null +++ b/build/assets/ProvinceWagePaymentTransactions-OloKgjY0.js @@ -0,0 +1 @@ +import{j as e,ag as lu,av as cu,aw as du,ax as N,aU as iu,B as T,ak as A,aa as _u,T as ou,a3 as x,al as Fu,I as H,b0 as Iu,d as X,ai as Su,aX as Tu}from"./mui-vendor-CkIVaoQP.js";import{r as c}from"./react-vendor-CmFgShSM.js";import{L as b,j as _,h as v,A as E,u as q,c as G,C as z,G as i,M as S,b as R,O as L,S as hu,v as O,ab as bu,X as p,W as K,N as V,p as Eu}from"./index-CeyyVc1v.js";import{N as Pu}from"./num2persian-BIYy8amq.js";import{S as ku}from"./SlaughterPayFeesGateway-BhtyiEES.js";import{a as P,u as k,f as Bu}from"./redux-vendor-B7uoacJt.js";import{R as Du,a as wu}from"./index.esm-Bu7XMDZU.js";import{d as U}from"./Edit-CqBj1Y2L.js";import{S as su}from"./ShowImage-CqhU2hmk.js";import{r as Ru}from"./resizeImage-Csf2MO3w.js";import{I as Cu,f as pu}from"./toBase64-BzgTOHsW.js";import{d as Wu}from"./Tune-D4M2CAhp.js";import{d as $u}from"./Delete-C5MyLelE.js";import{R as Nu}from"./ResponsiveTable-w7hk7Uq8.js";const yu=P("PROVINCE_EDIT_CAR_SERVICE",async(o,{dispatch:u})=>{try{u(b());const{data:n,status:l}=await _.put("internal-transactions/0/",o);return u(v()),{data:n,status:l}}catch(n){return u(v()),{error:n.response.data.result}}}),Hu=G({paymentType:S().required("نوع پرداخت را وارد کنید!")}),Ou=({fetchApiData:o,item:u})=>{const n=k(),[l]=c.useContext(E),t=q({initialValues:{paymentType:u!=null&&u.transactionType?u==null?void 0:u.transactionType:""},validationSchema:Hu,onSubmit:C=>{n(yu({transaction_key:u==null?void 0:u.key,transaction_type:C.paymentType})).then(y=>{y.payload.error?l({vertical:"top",horizontal:"center",msg:y.payload.error,severity:"error"}):(o(1),n(z()),l({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}});return e.jsxs(i,{xs:12,container:!0,children:[e.jsxs(lu,{fullWidth:!0,margin:"normal",error:t.touched.paymentType&&!!t.errors.paymentType,children:[e.jsx(cu,{id:"payment-type-label",children:"نوع پرداخت"}),e.jsxs(du,{fullWidth:!0,labelId:"payment-type-label",id:"paymentType",name:"paymentType",value:t.values.paymentType,onChange:t.handleChange,onBlur:t.handleBlur,label:"نوع پرداخت",children:[e.jsx(N,{value:"wage-gateway-auto",children:"آنلاین"}),e.jsx(N,{value:"wage-gateway-manual",children:"دستی"}),e.jsx(N,{value:"correspondence",children:"مکاتبات"})]}),t.touched.paymentType&&t.errors.paymentType?e.jsx(iu,{children:t.errors.paymentType}):null]}),e.jsx(T,{color:"primary",variant:"contained",fullWidth:!0,type:"submit",onClick:t.handleSubmit,children:"ثبت"})]})},zu=P("PROVINCE_PAID_FEES_EDIT_DESCRIPTION",async(o,{dispatch:u})=>{u(b());const{data:n,status:l}=await _.put("internal-transactions/0/",o);return u(v()),{data:n,status:l}}),Yu=({fetchApiData:o,item:u})=>{const[n]=c.useContext(E),l=k(),t=q({initialValues:{description:u!=null&&u.description?u==null?void 0:u.description:""},validationSchema:G({description:S().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!")})});return c.useEffect(()=>{t.validateForm()},[]),e.jsxs(i,{xs:12,container:!0,direction:"column",gap:2,children:[e.jsx(A,{id:"description",label:"توضیحات",multiline:!0,rows:5,variant:"outlined",sx:{width:"100%",height:"100%"},value:t.values.description,error:t.touched.description?!!t.errors.description:null,onChange:t.handleChange,onBlur:t.handleBlur,helperText:t.touched.description&&t.errors.description?t.errors.description:null}),e.jsx(i,{children:e.jsx(T,{fullWidth:!0,variant:"contained",disabled:!t.isValid,onClick:()=>{l(zu({transaction_key:u==null?void 0:u.key,description:t.values.description})).then(C=>{C.payload.error?n({vertical:"top",horizontal:"center",msg:C.payload.error,severity:"error"}):(n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),l(z()),o(1))})},children:"ویرایش توضیحات"})})]})},se=()=>{const o=G({paymentAmount:R().required("مبلغ اجباری است").positive("یک عدد مثبت وارد کنید!").min(2e5,"حداقل مبلغ دویست هزار ریال است!")}),u=k(),n=q({initialValues:{paymentAmount:""},validationSchema:o,onSubmit:l=>{u(z()),u(L({title:"واریز بدهی از طریق درگاه پرداخت",content:e.jsx(ku,{amount:n.values.paymentAmount,isZarinPal:!0})}))}});return e.jsx(i,{children:e.jsx("form",{onSubmit:n.handleSubmit,children:e.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:1,children:[e.jsx(i,{style:{width:"500px"},container:!0,xs:12,alignItems:"center",justifyContent:"space-between",children:e.jsx(A,{id:"paymentAmount",name:"paymentAmount",label:"مبلغ",value:n.values.paymentAmount,onChange:n.handleChange,onBlur:n.handleBlur,error:n.touched.paymentAmount&&!!n.errors.paymentAmount,helperText:n.touched.paymentAmount&&n.errors.paymentAmount,fullWidth:!0,margin:"normal",variant:"outlined",endAdornment:e.jsx(_u,{position:"end",children:"ریال"})})}),e.jsx(i,{container:!0,xs:12,children:e.jsx(i,{item:!0,xs:12,children:n.values.paymentAmount>0?e.jsxs(ou,{variant:"body1",mb:2,sx:{color:"darkcyan"},children:[Pu(n.values.paymentAmount)," ریال"]}):e.jsx(ou,{variant:"body1",mb:2,sx:{color:"darkcyan"},children:"مبلغ را وارد کنید"})})}),e.jsx(i,{xs:12,children:e.jsx(T,{color:"primary",variant:"contained",type:"submit",fullWidth:!0,children:"پرداخت"})})]})})})},te=P("PROVINCE_GET_VETERINARY_LETTER",async(o,{dispatch:u})=>{u(b());const{data:n,status:l}=await _.get("kill-house-new-wage/",{params:{...o}});return u(v()),{data:n,status:l}}),le=P("PARENT_COMPANY_GET_VETERINARY_LETTER",async(o,{dispatch:u})=>{u(b());const{data:n,status:l}=await _.get(o+"parent-company-kill-house-new-wage/");return u(v()),{data:n,status:l}}),tu=({item:o,updateTable:u})=>{const n=k(),[l]=c.useContext(E),[t,C]=c.useState([]),[y,g]=c.useState(),F=(h,j)=>{var f;if(h[0]){const r=(f=h[0])==null?void 0:f.file;Ru(r,W=>{const d=pu(W);g(d)})}C(h)};return c.useEffect(()=>{y&&n(yu({image:y,transaction_key:o==null?void 0:o.key})).then(h=>{g(null),C([]),h.payload.error?l({vertical:"top",horizontal:"center",msg:h.payload.error,severity:"error"}):(l({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),u(1))})},[y,t]),e.jsx(i,{width:"100%",children:e.jsx(i,{mt:hu.SMALL,children:e.jsx(Cu,{onChange:F,images:t,maxNumber:1,showImages:!1,title:o!=null&&o.image?"ویرایش":"ثبت"})})})},Mu=P("CREATE_TRANSACTION",async(o,{dispatch:u})=>{try{u(b());const{data:n,status:l}=await _.post("internal-transactions/",o);return u(v()),{data:n,status:l}}catch(n){return u(v()),{error:n.response.data.result}}}),Lu=P("EDIT_TRANSACTION",async(o,{dispatch:u})=>{try{u(b());const{data:n,status:l}=await _.put("internal-transactions/0/",o);return u(v()),{data:n,status:l}}catch(n){return u(v()),{error:n.response.data.result}}}),Vu=P("DELETE_TRANSACTION",async(o,{dispatch:u})=>{u(b());try{const{data:n,status:l}=await _.delete("internal-transactions/0/?transaction_key="+o);return u(v()),{data:n,status:l}}catch(n){return u(v()),{error:n.response.data.result}}}),Au=({fetchApiData:o,item:u,isEdit:n})=>{const[l,t]=c.useState([]),C=k(),[y]=c.useContext(E),[g,F]=c.useState([]),[,,h,j]=c.useContext(E);c.useEffect(()=>{u!=null&&u.date&&j(O(u==null?void 0:u.date).format("YYYY-MM-DD HH:MM"))},[]);const f=G({kill_house_key:S().required("کشتارگاه را انتخاب کنید!"),description:S(),amount:R().required("مبلغ را وارد کنید!"),image:S(),transaction_type:S().required("نوع تراکنش را وارد کنید!"),refId:S().required("شناسه ارجاع را وارد کنید!"),orderId:S().required("شناسه سفارش را وارد کنید!"),cardHolderPan:S().required("کارت بانکی را وارد کنید!"),union_share:R().required("سهم اتحادیه را وارد کنید!"),company_share:R().required("سهم شرکت را وارد کنید!"),guilds_share:R().required("سهم اصناف را وارد کنید!"),other_share:R().required("سایر سهم ها را وارد کنید!")}),r=q({initialValues:{kill_house_key:n?"test":"",description:u!=null&&u.description?u==null?void 0:u.description:"",amount:u!=null&&u.amount?u==null?void 0:u.amount:"",transaction_type:u!=null&&u.transactionType?u==null?void 0:u.transactionType:"",refId:u!=null&&u.refId?u==null?void 0:u.refId:"",orderId:u!=null&&u.orderId?u==null?void 0:u.orderId:"",cardHolderPan:u!=null&&u.cardHolderPan?u==null?void 0:u.cardHolderPan:"",union_share:u!=null&&u.unionShare?u==null?void 0:u.unionShare:0,company_share:u!=null&&u.companyShare?u==null?void 0:u.companyShare:0,guilds_share:u!=null&&u.guildsShare?u==null?void 0:u.guildsShare:0,other_share:u!=null&&u.otherShare?u==null?void 0:u.otherShare:0,image:""},validationSchema:f});c.useEffect(()=>{n||C(bu({dispenser:!0,role:p()})).then(d=>{t(d.payload.data)})},[]),c.useEffect(()=>{r.validateForm()},[]);const W=(d,Y)=>{var M;d[0]&&r.setFieldValue("image",pu((M=d[0])==null?void 0:M.data_url)),F(d)};return e.jsxs(x,{container:!0,spacing:2,children:[e.jsx(x,{item:!0,xs:12,children:e.jsx(K,{label:"تاریخ تراکنش",id:"date",renderInput:d=>e.jsx(A,{...d}),value:h,onChange:d=>{j(O(d).format("YYYY-MM-DD HH:MM:SS"))}})}),!n&&e.jsx(x,{item:!0,xs:12,children:e.jsx(Fu,{fullWidth:!0,id:"kill_house_key",options:l||[],getOptionLabel:d=>d.name,onChange:(d,Y)=>{r.setFieldValue("kill_house_key",Y.key)},onBlur:r.handleBlur,renderInput:d=>e.jsx(A,{...d,label:"کشتارگاه",variant:"outlined",error:r.touched.kill_house_key&&!!r.errors.kill_house_key,helperText:r.touched.kill_house_key&&r.errors.kill_house_key})})}),e.jsx(x,{item:!0,xs:12,children:e.jsxs(lu,{fullWidth:!0,children:[e.jsx(cu,{id:"demo-simple-select-label",children:"نوع تراکنش"}),e.jsxs(du,{labelId:"demo-simple-select-label",id:"transaction_type",label:"نوع تراکنش",value:r.values.transaction_type,error:r.touched.transaction_type?!!r.errors.transaction_type:null,onChange:d=>{r.setFieldValue("transaction_type",d.target.value)},onBlur:r.handleBlur,children:[e.jsx(N,{value:"wage-gateway-manual",children:"دستی"}),e.jsx(N,{value:"wage-gateway-auto",children:"آنلاین"})]}),e.jsx(iu,{children:r.touched.transaction_type&&r.errors.transaction_type?r.errors.transaction_type:null})]})}),e.jsx(x,{item:!0,xs:12,children:e.jsx(A,{fullWidth:!0,id:"refId",name:"refId",label:"شماره پیگیری",value:r.values.refId,onChange:r.handleChange,onBlur:r.handleBlur,variant:"outlined",error:r.touched.refId&&!!r.errors.refId,helperText:r.touched.refId&&r.errors.refId})}),e.jsx(x,{item:!0,xs:12,children:e.jsx(A,{fullWidth:!0,id:"orderId",name:"orderId",label:"شماره درخواست",value:r.values.orderId,onChange:r.handleChange,onBlur:r.handleBlur,variant:"outlined",error:r.touched.orderId&&!!r.errors.orderId,helperText:r.touched.orderId&&r.errors.orderId})}),e.jsx(x,{item:!0,xs:12,children:e.jsx(A,{fullWidth:!0,id:"cardHolderPan",name:"cardHolderPan",label:"کارت بانکی",value:r.values.cardHolderPan,onChange:r.handleChange,onBlur:r.handleBlur,variant:"outlined",error:r.touched.cardHolderPan&&!!r.errors.cardHolderPan,helperText:r.touched.cardHolderPan&&r.errors.cardHolderPan})}),e.jsx(x,{item:!0,xs:12,children:e.jsx(A,{fullWidth:!0,id:"amount",name:"amount",label:"مبلغ تراکنش",value:r.values.amount,onChange:r.handleChange,onBlur:r.handleBlur,variant:"outlined",error:r.touched.amount&&!!r.errors.amount,helperText:r.touched.amount&&r.errors.amount})}),e.jsx(x,{item:!0,xs:12,children:e.jsx(A,{fullWidth:!0,id:"union_share",name:"union_share",label:"سهم اتحادیه",value:r.values.union_share,onChange:r.handleChange,onBlur:r.handleBlur,variant:"outlined",error:r.touched.union_share&&!!r.errors.union_share,helperText:r.touched.union_share&&r.errors.union_share})}),e.jsx(x,{item:!0,xs:12,children:e.jsx(A,{fullWidth:!0,id:"company_share",name:"company_share",label:"سهم شرکت",value:r.values.company_share,onChange:r.handleChange,onBlur:r.handleBlur,variant:"outlined",error:r.touched.company_share&&!!r.errors.company_share,helperText:r.touched.company_share&&r.errors.company_share})}),e.jsx(x,{item:!0,xs:12,children:e.jsx(A,{fullWidth:!0,id:"guilds_share",name:"guilds_share",label:"سهم اصناف",value:r.values.guilds_share,onChange:r.handleChange,onBlur:r.handleBlur,variant:"outlined",error:r.touched.guilds_share&&!!r.errors.guilds_share,helperText:r.touched.guilds_share&&r.errors.guilds_share})}),e.jsx(x,{item:!0,xs:12,children:e.jsx(A,{fullWidth:!0,id:"other_share",name:"other_share",label:"سهم دیگر",value:r.values.other_share,onChange:r.handleChange,onBlur:r.handleBlur,variant:"outlined",error:r.touched.other_share&&!!r.errors.other_share,helperText:r.touched.other_share&&r.errors.other_share})}),e.jsx(x,{item:!0,xs:12,children:e.jsx(A,{fullWidth:!0,id:"description",name:"description",label:"توضیحات",multiline:!0,rows:4,value:r.values.description,onChange:r.handleChange,onBlur:r.handleBlur,variant:"outlined",error:r.touched.description&&!!r.errors.description,helperText:r.touched.description&&r.errors.description})}),e.jsxs(x,{item:!0,xs:12,justifyContent:"center",children:[e.jsx(Cu,{onChange:W,images:g,maxNumber:1,title:"سند"}),(u==null?void 0:u.image)&&!g.length&&e.jsx("img",{src:u==null?void 0:u.image,alt:"سند",style:{width:"150px",borderRadius:"5px"}})]}),e.jsx(x,{item:!0,xs:12,children:e.jsx(T,{variant:"contained",disabled:!r.isValid,fullWidth:!0,onClick:()=>{if(parseInt(r.values.union_share)+parseInt(r.values.company_share)+parseInt(r.values.other_share)+parseInt(r.values.guilds_share)!==parseInt(r.values.amount)){y({vertical:"top",horizontal:"center",msg:"مجموع سهم ها باید با مبلغ تراکنش برابر باشد!",severity:"error"});return}else n?C(Lu({transaction_key:u==null?void 0:u.key,image:r.values.image,description:r.values.description.length?r.values.description:null,amount:r.values.amount,transaction_type:r.values.transaction_type,refId:r.values.refId,orderId:r.values.orderId,cardHolderPan:r.values.cardHolderPan,union_share:r.values.union_share,company_share:r.values.company_share,guilds_share:r.values.guilds_share,other_share:r.values.other_share,date:h})).then(d=>{if(d.payload.error){y({vertical:"top",horizontal:"center",msg:d.payload.error,severity:"error"});return}else y({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(1),C(V({right:!1,bottom:!1,content:null}))}):C(Mu({kill_house_key:r.values.kill_house_key,image:r.values.image,description:r.values.description.length?r.values.description:null,amount:r.values.amount,transaction_type:r.values.transaction_type,refId:r.values.refId,orderId:r.values.orderId,cardHolderPan:r.values.cardHolderPan,union_share:r.values.union_share,company_share:r.values.company_share,guilds_share:r.values.guilds_share,other_share:r.values.other_share,date:h})).then(d=>{if(d.payload.error){y({vertical:"top",horizontal:"center",msg:d.payload.error,severity:"error"});return}else y({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(1),C(V({right:!1,bottom:!1,content:null}))})},children:n?"ویرایش تراکنش":"ثبت تراکنش"})})]})},qu=({item:o,fetchApiData:u})=>{const n=k(),[l,t]=c.useState(null),C=j=>{t(j.currentTarget)},y=()=>{t(null)},[g]=c.useContext(E),F=!!l,h=F?"popover":void 0;return e.jsxs("div",{children:[e.jsx(H,{"aria-describedby":h,variant:"contained",color:"primary",onClick:C,children:e.jsx(Wu,{})}),e.jsx(Iu,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:h,open:F,anchorEl:l,onClose:y,children:e.jsx("div",{style:{padding:"20px"},children:e.jsxs(i,{container:!0,direction:"column",alignItems:"center",justifyContent:"center",children:[e.jsx(X,{title:"ویرایش",placement:"right",children:e.jsx(H,{color:"primary",onClick:()=>{y(),n(V({title:"ویرایش تراکنش",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:e.jsx(Au,{fetchApiData:u,item:o,isEdit:!0})}))},children:e.jsx(U,{})})}),e.jsx(X,{title:"حذف تراکنش",placement:"right",children:e.jsx(H,{"aria-label":"delete",color:"error",onClick:()=>{y(),n(L({title:"آیا مطمئن هستید؟",content:e.jsxs(i,{container:!0,gap:2,children:[e.jsx(T,{variant:"contained",onClick:()=>{n(Vu(o==null?void 0:o.key)).then(j=>{j.payload.error?g({vertical:"top",horizontal:"center",msg:j.payload.error,severity:"error"}):(n(z()),u(1),g({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),e.jsx(T,{variant:"contained",color:"error",onClick:()=>{n(z())},children:"لغو"})]})}))},children:e.jsx($u,{})})})]})})})]})},ce=({province:o})=>{const[u,n]=c.useState([]),[l,t]=c.useState(0),[C,y]=c.useState(10),[g,F]=c.useState(1),[h,j]=c.useState(!1),f=k(),[r,W]=c.useState(""),d=Bu(s=>s.userSlice.userProfile.key),[Y,M]=c.useState([]),xu=s=>{W(s.target.value)},[,,B,J,D,Z]=c.useContext(E);c.useEffect(()=>{const s=O(new Date).format("YYYY-MM-DD");J(s),Z(s)},[]);const I=async s=>{const a=await _.get(`${o?o+"parent-company-":""}total-internal-transactions/?search=filter&value=${r}&page=${s}&role=${p()}&page_size=${C}${h?`&date1=${B}&date2=${D}`:""}`);n(a.data.results),t(a.data.count)},gu=s=>{I(s),F(s)},vu=s=>{y(s),F(1)};c.useEffect(()=>{I(1)},[f,B,D,C,h]);const Q=async s=>{s.preventDefault(),f(b());try{const a=await _.get(`${o?o+"parent-company-":""}total-internal-transactions/?search=filter&value=${r}&role=${p()}&page=${g}&page_size=${C}${h?`&date1=${B}&date2=${D}`:""}`);n(a.data.results),t(a.data.count),f(v())}catch(a){console.error("Error fetching data:",a)}};c.useEffect(()=>{I(1)},[B,D,h,o]);const fu=s=>{var a,w,$;return p()==="AdminX"||p()==="SuperAdmin"||p()==="ProvinceOperator"?[(a=s==null?void 0:s.guildsShare)==null?void 0:a.toLocaleString(),(w=s==null?void 0:s.companyShare)==null?void 0:w.toLocaleString(),($=s==null?void 0:s.otherShare)==null?void 0:$.toLocaleString()]:[]},ju=()=>p()==="AdminX"||p()==="SuperAdmin"||p()==="ProvinceOperator"?["سهم صنف (﷼)","سهم شرکت (﷼)","سهم دامپزشک (﷼)"]:[];return c.useEffect(()=>{const s=u==null?void 0:u.map((a,w)=>{var $,m,uu,eu,ru,au,nu;return[g===1?w+1:w+C*(g-1)+1,`${(a==null?void 0:a.payerType)==="kill_house"?`کشتارگاه / کشتارکن ${($=a==null?void 0:a.killHouse)==null?void 0:$.name}`:(a==null?void 0:a.payerType)==="chain_company"?`شرکت زنجیره ${(m=a==null?void 0:a.chainCompany)==null?void 0:m.name}`:`خریدار (${(uu=a==null?void 0:a.outProvincePoultryRequestBuyer)!=null&&uu.unitName?(eu=a==null?void 0:a.outProvincePoultryRequestBuyer)==null?void 0:eu.unitName:"-"})`}`,Eu(a==null?void 0:a.date),p()==="SuperAdmin"?e.jsxs(i,{container:!0,xs:12,alignItems:"center",children:[(a==null?void 0:a.transactionType)==="wage-gateway-auto"?"آنلاین":(a==null?void 0:a.transactionType)==="correspondence"?"مکاتبات":"دستی",e.jsx(H,{"aria-label":"delete",color:"primary",onClick:()=>{f(L({title:"ویرایش نوع پرداخت",content:e.jsx(Ou,{fetchApiData:I,item:a})}))},children:e.jsx(U,{})})]}):(a==null?void 0:a.transactionType)==="wage-gateway-auto"?"آنلاین":(a==null?void 0:a.transactionType)==="correspondence"?"مکاتبات":"دستی",a==null?void 0:a.refId,a==null?void 0:a.orderId,`${(ru=a==null?void 0:a.payerInfo)==null?void 0:ru.fullname} (${(au=a==null?void 0:a.payerInfo)==null?void 0:au.mobile})`,a==null?void 0:a.cardHolderPan,a==null?void 0:a.transactionAmount.toLocaleString(),(nu=a==null?void 0:a.unionShare)==null?void 0:nu.toLocaleString(),...fu(a),a!=null&&a.image&&(p()==="AdminX"||p()==="SuperAdmin")?e.jsxs(i,{mt:1,children:[e.jsx(su,{src:a==null?void 0:a.image}),e.jsx(tu,{isSingular:!0,item:a,updateTable:I},a.key)]}):p()==="ParentCompany"?e.jsx(su,{src:a==null?void 0:a.image}):e.jsx(tu,{isSingular:!0,item:a,updateTable:I},a.key),p()==="SuperAdmin"||p()==="AdminX"?e.jsxs(i,{container:!0,xs:12,alignItems:"center",children:[a!=null&&a.description?a==null?void 0:a.description:"-"," ",e.jsx(H,{"aria-label":"delete",color:"primary",onClick:()=>{f(L({title:"ویرایش توضیحات",content:e.jsx(Yu,{fetchApiData:I,item:a})}))},children:e.jsx(U,{})})]}):a!=null&&a.description?a==null?void 0:a.description:"-",e.jsx(qu,{item:a,fetchApiData:I},w)]});M(s)},[u]),e.jsxs(i,{container:!0,justifyContent:"end",children:[e.jsx(i,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,width:"100%",children:e.jsxs(i,{container:!0,alignItems:"center",gap:hu.SMALL,children:[p()==="AdminX"&&e.jsx(T,{variant:"contained",onClick:()=>{f(V({title:"ایجاد تراکنش",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:e.jsx(Au,{fetchApiData:I})}))},children:"ایجاد تراکنش"}),e.jsxs(i,{container:!0,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},children:[e.jsx(i,{children:e.jsx(Su,{control:e.jsx(Tu,{checked:h,onChange:()=>j(!h),color:"primary"})})}),e.jsx(i,{children:e.jsx(K,{disabled:!h,label:"از تاریخ",id:"date",renderInput:s=>e.jsx(A,{size:"small",style:{width:"160px"},...s}),value:B,onChange:s=>{J(O(s).format("YYYY-MM-DD"))}})}),e.jsx(i,{children:e.jsx(K,{disabled:!h,label:"تا تاریخ",id:"date",renderInput:s=>e.jsx(A,{size:"small",style:{width:"160px"},...s}),value:D,onChange:s=>{Z(O(s).format("YYYY-MM-DD"))}})})]}),e.jsxs("form",{onSubmit:Q,children:[e.jsx(A,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:xu}),e.jsx(T,{type:"submit",onClick:Q,endIcon:e.jsx(Du,{}),children:"جستجو"})]}),e.jsx(i,{children:e.jsx(X,{title:"خروجی اکسل",children:e.jsx("a",{href:`${o||_.defaults.baseURL}payment_transactions_province_excel/?role=${p()}&key=${d}${h?`&date1=${B}&date2=${D}`:""}`,rel:"noreferrer",children:e.jsx(T,{color:"success",children:e.jsx(wu,{size:32})})})})})]})}),e.jsx(Nu,{data:Y,columns:["ردیف","ماهیت تراکنش","تاریخ پرداخت","نوع پرداخت","شماره پیگیری","شماره درخواست","پرداخت کننده","شماره کارت","مبلغ کل","سهم اتحادیه (﷼)",...ju(),"تصویر تراکنش","توضیحات",...p()==="AdminX"?["عملیات"]:[]],handlePageChange:gu,totalRows:l,page:g,perPage:C,handlePerRowsChange:vu,title:p()==="ParentCompany"?"تراکنش ها":"ثبت تراکنش ها"})]})};export{Ou as P,Yu as a,se as b,ce as c,le as d,te as p}; diff --git a/build/assets/PspActiveSession-DQjcq8bm.js b/build/assets/PspActiveSession-DQjcq8bm.js new file mode 100644 index 0000000..b27f8f8 --- /dev/null +++ b/build/assets/PspActiveSession-DQjcq8bm.js @@ -0,0 +1 @@ +import{j as e,al as H,ak as R,B as K}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./react-vendor-CmFgShSM.js";import{u as Q}from"./redux-vendor-B7uoacJt.js";import{p as Y,_ as Z,G as p,S as T,X as d,L,j as _,h as f}from"./index-CeyyVc1v.js";import{R as m}from"./index.esm-Bu7XMDZU.js";import{R as uu}from"./ResponsiveTable-w7hk7Uq8.js";const ru=()=>{const[t,i]=a.useState([]),[v,G]=a.useState(0),[r,N]=a.useState(10),[h,k]=a.useState(""),[c,A]=a.useState(1),[z,B]=a.useState([]),[g,M]=a.useState([]),[C,O]=a.useState(""),o=Q(),V=async()=>{try{o(L());const s=await _.get(`/get_all_pos_company/?role=${d()}`);M(s.data),o(f())}catch(s){console.error("Error fetching companies:",s),o(f())}},l=async s=>{let u;o(L());let n=`report-pos-device_session/?search=filter&value=${h}&role=${d()}&page=${s}&page_size=${r}`;C&&(n+=`&company=${C}`),u=await _.get(n),o(f()),i(u.data.results),G(u.data.count)},W=s=>{l(s),A(s)},J=s=>{N(s),A(1)},U=s=>{k(s.target.value)};a.useEffect(()=>{const s=t==null?void 0:t.map((u,n)=>{var x,y,S,j,I,b,D,E,F,P,$,w;return[c===1?n+1:n+r*(c-1)+1,(x=u==null?void 0:u.pos)==null?void 0:x.posCompany,`${(S=(y=u==null?void 0:u.pos)==null?void 0:y.userInfo)==null?void 0:S.type} (${(I=(j=u==null?void 0:u.pos)==null?void 0:j.userInfo)==null?void 0:I.name})`,`${(D=(b=u==null?void 0:u.pos)==null?void 0:b.userInfo)==null?void 0:D.fullname} (${(F=(E=u==null?void 0:u.pos)==null?void 0:E.userInfo)==null?void 0:F.mobile})`,($=(P=u==null?void 0:u.pos)==null?void 0:P.userInfo)==null?void 0:$.nationalCode,(w=u==null?void 0:u.pos)==null?void 0:w.posId,u==null?void 0:u.password,u==null?void 0:u.name,Y(u==null?void 0:u.sessionCreateDate),Z(u==null?void 0:u.sessionLastSeenDate),u!=null&&u.active?"فعال":"غیرفعال"]});B(s)},[t]),a.useEffect(()=>{V(),l(1)},[o]),a.useEffect(()=>{l(c)},[C,r]);const X=async s=>{s.preventDefault(),l(1)},q=e.jsx(p,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,mb:1,padding:2,width:"100%",children:e.jsxs(p,{container:!0,width:"100%",alignItems:"center",justifyContent:"start",gap:T.SMALL,children:[d()!=="PosCompany"&&e.jsx(H,{size:"small",style:{minWidth:210},disablePortal:!0,id:"session",options:g?g.map(s=>({data:s,label:`${s==null?void 0:s.name}`})):[],onChange:(s,u)=>{var n;O((n=u==null?void 0:u.data)==null?void 0:n.key)},renderInput:s=>e.jsx(R,{fullWidth:!0,...s,label:"انتخاب شرکت psp"})}),e.jsxs(p,{container:!0,alignItems:"center",gap:T.SMALL,children:[e.jsx(R,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},value:h,onChange:U}),e.jsx(K,{type:"submit",onClick:X,endIcon:e.jsx(m,{}),children:"جستجو"})]})]})});return e.jsxs(p,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[q,e.jsx(uu,{data:z,columns:["ردیف","شرکت پرداختی","نام واحد","نام شخص","کدملی","کلید اتصال","کلمه عبور امنیتی","نام دستگاه","اولین ورود","آخرین بازدید","وضعیت"],handlePageChange:W,totalRows:v,page:c,perPage:r,handlePerRowsChange:J,title:"نشست های فعال"})]})};export{ru as P}; diff --git a/build/assets/PspCompany-DFqxFNI1.js b/build/assets/PspCompany-DFqxFNI1.js new file mode 100644 index 0000000..3f42bab --- /dev/null +++ b/build/assets/PspCompany-DFqxFNI1.js @@ -0,0 +1 @@ +import{j as u,ag as bu,av as ku,aw as Mu,ax as W,aU as Nu,ak as L,B as I,i as K,$ as Bu,T as k,d as V,b5 as vu,I as G,b as X,a9 as eu,b0 as Su,al as _u,an as zu,ao as Uu,aq as Au,b4 as Wu,ap as Vu,ah as Gu,ai as pu,aj as xu,aA as ju}from"./mui-vendor-CkIVaoQP.js";import{G as p,S as T,ia as ru,ib as su,ic as tu,X as P,id as au,ie as nu,ig as lu,L as B,j as R,h as M,A as q,u as Eu,c as wu,M as ou,C as J,r as Q,p as Y,N as H,m as gu,ih as Hu,O as Z,b as fu,c5 as qu,ii as Yu,ij as Xu,ik as Ju,il as Ku,im as Qu,io as Zu}from"./index-CeyyVc1v.js";import{B as u0}from"./BackButton-Crzr7NMa.js";import{N as yu}from"./NavLink-D2GD_ItM.js";import{L as Fu}from"./LinkItem-DT6qswcs.js";import{p as e0,q as r0}from"./index.esm-BY9chGNa.js";import{f as Pu,r as c}from"./react-vendor-CmFgShSM.js";import{a as uu,u as z,f as s0}from"./redux-vendor-B7uoacJt.js";import{R as Du,a as t0}from"./index.esm-Bu7XMDZU.js";import{R as Tu}from"./ResponsiveTable-w7hk7Uq8.js";import{C as a0}from"./CreateGuilds-CCT3R9v5.js";import{d as Ou}from"./Tune-D4M2CAhp.js";import{d as n0}from"./Edit-CqBj1Y2L.js";import{A as l0}from"./AdvancedTable-BYmmBtmq.js";import{S as o0}from"./SimpleTable-DBAoNnCU.js";import{d as c0}from"./Info-CZK82--l.js";import{d as i0}from"./Delete-C5MyLelE.js";import{A as d0}from"./index-9Ymn_7Kv.js";import{d as C0}from"./Add--yVWBJhC.js";import{P as h0}from"./PspActiveSession-DQjcq8bm.js";import{L as A0}from"./LabelField-B6eRSoQP.js";import"./iconBase-BEJYyZsk.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./Person-Q1IHBezR.js";import"./Phone-Dv2y8iMM.js";import"./Badge-u1S44abW.js";import"./Cake-CkaTUHNX.js";import"./Business-J-mGuLnc.js";import"./CheckCircle-zgBvZQ-b.js";import"./Done-Dp5awdte.js";import"./DialogAlert-BfXcr-Kr.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";const p0=()=>{const{pathname:e}=Pu();return u.jsxs(p,{container:!0,gap:T.SMALL,p:T.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",children:[u.jsx(yu,{to:P()==="PosCompany"?ru:P()==="SuperAdmin"?su:P()==="AdminX"?tu:"",active:P()==="PosCompany"?e===ru:P()==="SuperAdmin"?e===su:P()==="AdminX"?e===tu:null,children:u.jsx(Fu,{icon:u.jsx(e0,{size:30,color:"#244CCC"}),title:"دستگاه ها"})}),u.jsx(yu,{to:P()==="PosCompany"?au:P()==="SuperAdmin"?nu:P()==="AdminX"?lu:null,active:P()==="PosCompany"?e===au:P()==="SuperAdmin"?e===nu:P()==="AdminX"?e===lu:null,children:u.jsx(Fu,{icon:u.jsx(r0,{size:30,color:"#244CCC"}),title:"نشست های فعال"})})]})},x0=uu("PSP_SUBMIT_GUILD_CONDITION",async(e,{dispatch:d})=>{try{d(B());const{data:x,status:o}=await R.put("total_guilds_for_companies/0/",e);return d(M()),{data:x,status:o}}catch(x){return d(M()),{error:x.response.data.result}}}),j0=({item:e,updateTable:d})=>{const[x]=c.useContext(q),o=z(),r=Eu({initialValues:{condition:e.condition?e.condition:"مرجوع شده",description:e.descriptionCondition?e.descriptionCondition:""},validationSchema:wu({description:ou().required("این فیلد اجباری است!").typeError("لطفا توضیحات را وارد کنید.")})});return c.useEffect(()=>{r.validateForm()},[]),u.jsxs(p,{container:!0,justifyContent:"center",alignItems:"center",children:[u.jsx(p,{xs:12,children:u.jsxs(bu,{sx:{minWidth:310},children:[u.jsx(ku,{id:"demo-simple-select-label",children:"وضعیت"}),u.jsxs(Mu,{className:"fullWidthSelect",sx:{minWidth:"100%"},fullWidth:!0,labelId:"demo-simple-select-label",id:"condition",label:"وضعیت",value:r.values.condition,error:r.touched.condition?!!r.errors.condition:null,onChange:g=>{r.setFieldValue("condition",g.target.value)},onBlur:r.handleBlur,children:[u.jsx(W,{value:"مرجوع شده",children:"مرجوع شده"}),u.jsx(W,{value:"در انتظار تعریف ترمینال",children:"در انتظار تعریف ترمینال"}),u.jsx(W,{value:"در انتظار تایید شاپرک",children:"در انتظار تایید شاپرک"}),u.jsx(W,{value:"در انتظار نصب",children:"در انتظار نصب"}),u.jsx(W,{value:"نصب شده",children:"نصب شده"}),u.jsx(W,{value:"غیر قابل نصب",children:"غیر قابل نصب"}),u.jsx(W,{value:"جمع آوری شده",children:"جمع آوری شده"})]}),u.jsx(Nu,{children:r.touched.condition&&r.errors.condition?r.errors.condition:null})]})}),u.jsx(p,{xs:12,children:u.jsx(L,{id:"description",name:"description",label:"توضیحات",variant:"outlined",multiline:!0,rows:4,fullWidth:!0,margin:"normal",value:r.values.description,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.description&&r.errors.description?r.errors.description:null,error:r.touched.description&&!!r.errors.description})}),u.jsx(p,{children:u.jsx(I,{disabled:!r.isValid,variant:"contained",onClick:()=>{o(x0({guild_key:e.key,condition:r.values.condition,description_condition:r.values.description})).then(g=>{o(J()),d(),g.error?x({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},children:e.descriptionCondition?"ویرایش وضعیت":"ثبت وضعیت"})})]})},g0=uu("PSP_CHANGE_POS_ACTIVE_STATE",async(e,{dispatch:d})=>{try{d(B());const{data:x,status:o}=await R.put("/pos-machine/0/",e);return d(M()),{data:x,status:o}}catch(x){return d(M()),{error:x.response.data.result}}});var cu={},f0=K;Object.defineProperty(cu,"__esModule",{value:!0});var Iu=cu.default=void 0,y0=f0(Q()),F0=u;Iu=cu.default=(0,y0.default)((0,F0.jsx)("path",{d:"M20 2H4c-1.11 0-2 .89-2 2v11c0 1.11.89 2 2 2h4v5l4-2 4 2v-5h4c1.11 0 2-.89 2-2V4c0-1.11-.89-2-2-2m0 13H4v-2h16zm0-5H4V4h16z"}),"CardMembership");const m0=uu("PSP_REMOVE_SESSION",async(e,{dispatch:d})=>{d(B());const{data:x,status:o}=await R.delete("pos_register_session_inspection/0/?session_key="+e);return d(M()),{data:x,status:o}}),b0=({item:e,updateTable:d})=>{var _,m,f;const x=z(),[o]=c.useContext(q),[r,g]=c.useState(!1),[C,w]=c.useState(null),y=a=>{x(Z({title:"آیا مطمئن هستید؟",content:u.jsxs(p,{container:!0,spacing:2,justifyContent:"center",children:[u.jsx(p,{item:!0,children:u.jsx(I,{variant:"contained",color:"error",onClick:()=>{x(m0(a)).then(A=>{var F,l;if((F=A.payload)!=null&&F.error)o({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"});else{d(),x(J());let s=(l=C==null?void 0:C.posSessions)==null?void 0:l.findIndex(v=>v.key===a);C==null||C.posSessions.splice(s,1),o({vertical:"top",horizontal:"center",msg:"نشست با موفقیت حذف شد",severity:"success"})}})},sx:{mx:1},children:"تایید حذف"})}),u.jsx(p,{item:!0,children:u.jsx(I,{variant:"outlined",onClick:()=>x(J()),sx:{mx:1},children:"انصراف"})})]})}))},S=Bu(),D=e==null?void 0:e.guildPos.map((a,A)=>{var F,l,s,v;return[A+1,a.receiverNumber||"-",a.terminalNumber||"-",a.serial||"-",a.posId||"-",a.password||"-",a.posCompany||"-",((F=a==null?void 0:a.posSessions)==null?void 0:F.length)>0?Y((l=a.posSessions[0])==null?void 0:l.sessionCreateDate):"-",((s=a==null?void 0:a.posSessions)==null?void 0:s.length)>0?Y((v=a.posSessions[0])==null?void 0:v.sessionLastSeenDate):"-",u.jsxs(k,{justifyContent:"center",variant:"body2",color:a.posStatus?"success.main":"error.main",sx:{display:"flex",alignItems:"center",gap:.5},children:[a!=null&&a.posStatus?"در حال استفاده":"خاموش",u.jsx(c0,{fontSize:"small"})]},A),u.jsx(I,{disabled:!(a!=null&&a.posSessions.length),size:"small",variant:"outlined",color:"info",startIcon:u.jsx(Iu,{}),onClick:()=>{w(a),g(!0)},sx:{borderRadius:2,px:2,py:.5,textTransform:"none"},children:"نمایش نشست‌ها"},A),u.jsx(V,{title:a!=null&&a.active?"غیرفعال کردن":"فعال کردن",placement:"bottom-start",children:u.jsx(vu,{size:"small",checked:a.active,color:a.active?"success":"default",onChange:()=>{x(g0({pos_key:a.key,active:!a.active})).then(O=>{d(),x(H({top:!1,bottom:!1,content:null})),O.error?o({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})}})},A)]}),$=(m=(_=C==null?void 0:C.posSessions)==null?void 0:_.sort((a,A)=>{const F=new Date(a.sessionLastSeenDate||a.sessionCreateDate).getTime();return new Date(A.sessionLastSeenDate||A.sessionCreateDate).getTime()-F}))==null?void 0:m.map((a,A)=>{const F=new Date;F.setDate(F.getDate()-7);const s=new Date(a.sessionLastSeenDate||a.sessionCreateDate)>F;return[A+1,a.name||"-",a.serial||"-",u.jsx(k,{color:s?"success.main":"text.primary",children:Y(a.sessionCreateDate||"-")},`create-${A}`),u.jsx(k,{color:s?"success.main":"text.primary",children:Y(a.sessionLastSeenDate||"-")},`lastseen-${A}`),u.jsx(p,{container:!0,justifyContent:"center",children:u.jsx(V,{title:"حذف نشست",children:u.jsx(G,{color:"error",onClick:()=>{y(a.key)},children:u.jsx(i0,{})})})},A)]});return u.jsx(X,{children:u.jsx(d0,{mode:"wait",children:r?u.jsx(gu.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3},children:u.jsx(eu,{elevation:0,sx:{p:3,borderRadius:4},children:u.jsxs(p,{xs:12,container:!0,justifyContent:"center",children:[u.jsxs(p,{xs:12,container:!0,alignItems:"center",justifyContent:"space-between",sx:{mb:3},children:[u.jsx(I,{variant:"outlined",color:"primary",onClick:()=>{g(!1)},startIcon:u.jsx(Hu,{}),sx:{borderRadius:2,px:3,textTransform:"none"},children:"بازگشت به لیست"}),u.jsxs(k,{variant:"body1",sx:{color:"text.primary"},children:[u.jsx(X,{component:"span",color:"primary.main",children:"نشست‌های فعال دستگاه"})," ",C==null?void 0:C.receiverNumber]})]}),u.jsx(p,{xs:12,container:!0,justifyContent:"center",children:u.jsx(eu,{elevation:0,sx:{width:"100%",p:2,borderRadius:4,backgroundColor:S.palette.grey[50]},children:u.jsx(o0,{name:"نشست های فعال",columns:["ردیف","نشست های فعال ","سریال","تاریخ ایجاد","آخرین بازدید","عملیات"],data:$})})})]})})},"detail"):u.jsx(gu.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3},children:u.jsx(eu,{children:u.jsx(l0,{name:u.jsx(p,{container:!0,alignItems:"center",gap:2,sx:{mb:3},children:u.jsxs(p,{container:!0,gap:1,alignItems:"center",children:[u.jsx(k,{variant:"body1",fontWeight:"bold",color:"primary",children:"اطلاعات دستگاه‌های POS"}),u.jsxs(k,{variant:"caption",color:"text.secondary",children:["(",((f=e==null?void 0:e.guildPos)==null?void 0:f.length)||0," دستگاه ثبت شده)"]})]})}),columns:["ردیف","شماره پذیرنده","شماره ترمینال","سریال دستگاه","کلید اتصال","کلمه عبور امنیتی","نام دستگاه","اولین ورود","آخرین بازدید","وضعیت","نشست‌ها","فعال/غیرفعال"],data:D||[],sx:{"& .MuiTableCell-root":{py:1.5},"& .MuiTableHead-root":{backgroundColor:S.palette.grey[100]}}})})},"table")})})},v0=uu("PSP_SUBMIT_POS",async(e,{dispatch:d})=>{d(B());const{data:x,status:o}=await R.post("pos-machine/",e);return d(M()),{data:x,status:o}}),S0=({item:e,updateTable:d})=>{const[x]=c.useContext(q),o=z(),r=Eu({initialValues:{reciver:"",terminal:"",serial:"",password:""},validationSchema:wu({reciver:fu().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),terminal:fu().required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!"),password:ou().matches(/^\d{4}$/,"پسورد باید یک عدد 4 رقمی باشد").typeError("لطفا یک عدد 4 رقمی وارد کنید."),serial:ou()})});return c.useEffect(()=>{r.validateForm()},[]),u.jsxs(p,{gap:T.SMALL,container:!0,xs:12,children:[u.jsx(L,{id:"reciver",label:"شماره پذیرنده",variant:"outlined",sx:{width:"100%"},value:r.values.reciver,error:r.touched.reciver?!!r.errors.reciver:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.reciver&&r.errors.reciver?r.errors.reciver:null}),u.jsx(L,{id:"terminal",label:"شماره ترمینال",variant:"outlined",sx:{width:"100%"},value:r.values.terminal,error:r.touched.terminal?!!r.errors.terminal:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.terminal&&r.errors.terminal?r.errors.terminal:null}),u.jsx(L,{id:"serial",name:"serial",label:"شماره سریال دستگاه",variant:"outlined",value:r.values.serial,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.serial&&r.errors.serial?r.errors.serial:null,error:r.touched.serial&&!!r.errors.serial}),u.jsx(L,{id:"password",name:"password",label:"کلمه عبور مدیریتی",variant:"outlined",value:r.values.password,onChange:g=>{const C=g.target.value.replace(/\D/g,"").slice(0,4);r.setFieldValue("password",C)},onBlur:r.handleBlur,helperText:r.touched.password&&r.errors.password?r.errors.password:null,error:r.touched.password&&!!r.errors.password,inputProps:{maxLength:4}}),u.jsx(I,{disabled:!r.isValid,fullWidth:!0,variant:"contained",onClick:()=>{o(B()),o(v0({guild_key:e.key,receiver_number:r.values.reciver,terminal_number:r.values.terminal,password:r.values.password,serial:r.values.serial})).then(g=>{g.error?x({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),d(),o(H({right:!1,bottom:!1,content:null})))})},children:"ثبت"})]})},_0=({item:e,updateTable:d})=>{const[x,o]=c.useState(null),r=z(),g=S=>{o(S.currentTarget)},C=()=>{o(null)},w=!!x,y=w?"popover":void 0;return u.jsxs("div",{children:[u.jsx(G,{"aria-describedby":y,color:"primary",onClick:g,sx:{padding:"8px"},children:u.jsx(Ou,{fontSize:"medium"})}),u.jsx(Su,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:y,open:w,anchorEl:x,onClose:C,children:u.jsx(X,{sx:{padding:"16px",minWidth:"50px"},children:u.jsxs(p,{container:!0,direction:"column",spacing:2,alignItems:"center",children:[(e==null?void 0:e.numberOfPos)>0&&u.jsx(p,{item:!0,children:u.jsx(V,{title:"مشاهده جزییات دستگاه‌های POS",placement:"right",children:u.jsx(G,{disabled:(e==null?void 0:e.provinceAcceptState)!=="accepted",color:"primary",onClick:()=>{C(),r(H({title:"جزئیات کارتخوان",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(b0,{item:e,updateTable:d})}))},children:u.jsx(qu,{size:24})})})}),u.jsx(p,{item:!0,children:u.jsx(V,{title:"ثبت دستگاه POS جدید",placement:"right",children:u.jsx(G,{disabled:(e==null?void 0:e.provinceAcceptState)!=="accepted",color:"secondary",sx:{fontSize:"1.5rem",width:"48px",height:"48px","&:hover":{backgroundColor:"rgba(156, 39, 176, 0.08)"}},onClick:()=>{C(),r(H({title:"ایجاد دستگاه",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(S0,{item:e,updateTable:d})}))},children:u.jsx(C0,{size:24})})})}),u.jsx(p,{item:!0,children:u.jsx(V,{title:e!=null&&e.condition?"ویرایش وضعیت صنف":"ثبت وضعیت صنف",placement:"right",children:u.jsx(G,{disabled:(e==null?void 0:e.provinceAcceptState)!=="accepted",color:"success",sx:{fontSize:"1.5rem",width:"48px",height:"48px","&:hover":{backgroundColor:"rgba(46, 125, 50, 0.08)"}},onClick:()=>{C(),r(Z({title:"ثبت توضیحات",content:u.jsx(j0,{item:e,updateTable:d})}))},children:u.jsx(n0,{size:24})})})})]})})})]})},E0=()=>{var O;const[e,d]=c.useState([]),[x,o]=c.useState(0),[r,g]=c.useState(10),[C,w]=c.useState(""),[y,S]=c.useState(1),[D,$]=c.useState([]),_=z(),m=s0(i=>i.userSlice),f=async i=>{let t;_(B()),t=await R.get(`total_guilds_for_companies/?search=filter&value=${C}&role=${P()}&page=${i}&page_size=${r}`),_(M()),d(t.data.results),o(t.data.count)},a=i=>{f(i),S(i)},A=i=>{g(i),S(1)},F=()=>{f(y!==0?y:1)},l=i=>{w(i.target.value)};c.useEffect(()=>{const i=e==null?void 0:e.map((t,N)=>{var h,j,n,E,b,U,hu;return[y===1?N+1:N+r*(y-1)+1,t.guildsId,t==null?void 0:t.guildsName,`${(h=t==null?void 0:t.user)==null?void 0:h.fullname} (${(j=t==null?void 0:t.user)==null?void 0:j.mobile})`,(n=t==null?void 0:t.user)==null?void 0:n.nationalId,t==null?void 0:t.typeActivity,t==null?void 0:t.areaActivity,`${(E=t==null?void 0:t.user)==null?void 0:E.province}/${(b=t==null?void 0:t.user)==null?void 0:b.city}/${(U=t==null?void 0:t.user)!=null&&U.address?(hu=t==null?void 0:t.user)==null?void 0:hu.address:""}`,t!=null&&t.steward?"می باشد":"نمی باشد",(t==null?void 0:t.provinceAcceptState)==="accepted"?"تایید شده":(t==null?void 0:t.provinceAcceptState)==="rejected"?"رد شده":"در انتظار تایید",`${(t==null?void 0:t.condition)||"توضیحاتی وجود ندارد"} (${t==null?void 0:t.descriptionCondition})`,u.jsx(_0,{selectedAge1:null,selectedAge2:null,updateTable:F,item:t},"4")]});$(i)},[e]),c.useEffect(()=>{f(1)},[_,r]);const s=async i=>{i.preventDefault(),_(B());try{const t=await R.get(`total_guilds_for_companies/?role=${P()}&search=filter&value=${C}`);d(t.data.results),o(t.data.count),_(M())}catch(t){console.error("Error fetching data:",t)}},v=u.jsx(p,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,mb:1,padding:2,width:"100%",children:u.jsxs(p,{container:!0,width:"100%",alignItems:"center",justifyContent:"space-between",gap:T.SMALL,children:[u.jsx("form",{onSubmit:s,children:u.jsxs(p,{container:!0,alignItems:"center",gap:T.SMALL,children:[u.jsx(L,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:l}),u.jsx(I,{type:"submit",onClick:s,endIcon:u.jsx(Du,{}),children:"جستجو"}),u.jsx(V,{title:"خروجی اکسل",children:u.jsx("a",{href:`${R.defaults.baseURL}pos_excel/?&key=${(O=m==null?void 0:m.userProfile)==null?void 0:O.key}`,rel:"noreferrer",children:u.jsx(I,{color:"success",children:u.jsx(t0,{size:32})})})})]})}),u.jsx(p,{container:!0,alignItems:"center",gap:T.SMALL,children:u.jsx(V,{title:"ثبت صنف جدید",placement:"top",children:u.jsx(I,{variant:"contained",onClick:()=>{_(Z({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت واحد جدید",size:window.innerWidth<=600?"small":"auto",content:u.jsx(a0,{updateTable:F})}))},children:"ثبت صنف جدید"})})})]})});return u.jsxs(p,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[v,u.jsx(Tu,{data:D,columns:["ردیف","شناسه صنف","نام واحد صنفی","نام شخص/شرکت","کدملی","نوع فعالیت","حوزه فعالیت","آدرس","مباشر","وضعیت احراز","توضیحات شرکت psp","عملیات"],handlePageChange:a,totalRows:x,page:y,perPage:r,handlePerRowsChange:A,title:"مدیریت اصناف"})]})};var iu={},w0=K;Object.defineProperty(iu,"__esModule",{value:!0});var $u=iu.default=void 0,P0=w0(Q()),mu=u;$u=iu.default=(0,P0.default)([(0,mu.jsx)("circle",{cx:"9",cy:"8",r:"4"},"0"),(0,mu.jsx)("path",{d:"M9 14c-2.67 0-8 1.34-8 4v1c0 .55.45 1 1 1h14c.55 0 1-.45 1-1v-1c0-2.66-5.33-4-8-4m11-4V7h-2v3h-3v2h3v3h2v-3h3v-2z"},"1")],"PersonAddAlt1Rounded");var du={},D0=K;Object.defineProperty(du,"__esModule",{value:!0});var Lu=du.default=void 0,T0=D0(Q()),O0=u;Lu=du.default=(0,T0.default)((0,O0.jsx)("path",{d:"m6.14 11.86-2.78 2.79c-.19.2-.19.51 0 .71l2.78 2.79c.31.32.85.09.85-.35V16H13c.55 0 1-.45 1-1s-.45-1-1-1H6.99v-1.79c0-.45-.54-.67-.85-.35m14.51-3.21-2.78-2.79c-.31-.32-.85-.09-.85.35V8H11c-.55 0-1 .45-1 1s.45 1 1 1h6.01v1.79c0 .45.54.67.85.35l2.78-2.79c.2-.19.2-.51.01-.7"}),"SwapHorizRounded");var Cu={},I0=K;Object.defineProperty(Cu,"__esModule",{value:!0});var Ru=Cu.default=void 0,$0=I0(Q()),L0=u;Ru=Cu.default=(0,$0.default)((0,L0.jsx)("path",{d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1"}),"AddRounded");const R0=async e=>await R.get(`/guilds/?role=${e}&page_size=1000&psp_pos=true`),k0=async()=>await R.get("/kill_house/?psp=true"),M0=async e=>await R.put("/new-pos-machine/0/",e),N0=()=>{const[e,d]=c.useState([]),[x,o]=c.useState(0),[r,g]=c.useState(10),[C,w]=c.useState(""),[y,S]=c.useState(1),[D,$]=c.useState([]),[_,m]=c.useState([]),[f,a]=c.useState(""),A=z(),F=async()=>{try{A(B());const j=await R.get(`/get_all_pos_company/?role=${P()}`);m(j.data),A(M())}catch(j){console.error("Error fetching companies:",j),A(M())}},l=async j=>{try{A(B());let n=`/new-pos-machine/?search=filter&value=${C}&role=${P()}&page=${j}&page_size=${r}`;f&&(n+=`&company=${f}`);const E=await R.get(n);d(E.data.results),o(E.data.count)}catch(n){console.error("Error fetching devices:",n)}finally{A(M())}},s=j=>{l(j),S(j)},v=j=>{g(j),S(1)},O=j=>{w(j.target.value)};c.useEffect(()=>{const j=e==null?void 0:e.map((n,E)=>{const b=(n==null?void 0:n.owner)||{},U=!!(n!=null&&n.owner);return[y===1?E+1:E+r*(y-1)+1,(n==null?void 0:n.companyName)||"-",(n==null?void 0:n.serial)??"-",(n==null?void 0:n.receiverNumber)??"-",(n==null?void 0:n.terminalNumber)??"-",(n==null?void 0:n.password)??"-",(n==null?void 0:n.posId)??"-",b!=null&&b.unitName?`${b==null?void 0:b.unitName}`:"-",b!=null&&b.fullname?`${b==null?void 0:b.fullname} (${(b==null?void 0:b.mobile)??"-"})`:"-",(b==null?void 0:b.licenseNumber)??"-",n!=null&&n.createDate?Y(n==null?void 0:n.createDate):"-",n!=null&&n.active?"فعال":"غیرفعال",u.jsx(B0,{device:n,hasOwner:U,onOwnerAssigned:()=>{l(y)}},(n==null?void 0:n.id)||`device-${E}`)]});$(j)},[e,y,r]),c.useEffect(()=>{F(),l(1)},[A]),c.useEffect(()=>{l(y)},[f,r]);const i=async j=>{j.preventDefault(),l(1)},t=()=>{S(1),l(1)},N=()=>{const j=window.innerWidth<=600;A(H({title:"ایجاد دستگاه",right:!j,bottom:j,content:u.jsx(U0,{onSuccess:t})}))},h=u.jsx(p,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,mb:1,padding:2,width:"100%",children:u.jsxs(p,{container:!0,width:"100%",alignItems:"center",justifyContent:"space-between",gap:T.SMALL,children:[u.jsxs(p,{container:!0,alignItems:"center",gap:T.SMALL,xs:12,md:"auto",children:[P()!=="PosCompany"&&u.jsx(_u,{size:"small",style:{minWidth:210},disablePortal:!0,id:"session",options:_?_.map(j=>({data:j,label:`${j==null?void 0:j.name}`})):[],onChange:(j,n)=>{var E;a((E=n==null?void 0:n.data)==null?void 0:E.key)},renderInput:j=>u.jsx(L,{fullWidth:!0,...j,label:"انتخاب شرکت psp"})}),u.jsxs(p,{container:!0,alignItems:"center",gap:T.SMALL,children:[u.jsx(L,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},value:C,onChange:O}),u.jsx(I,{type:"submit",onClick:i,endIcon:u.jsx(Du,{}),children:"جستجو"})]})]}),u.jsx(p,{container:!0,justifyContent:"flex-end",xs:12,md:"auto",children:u.jsx(I,{variant:"contained",startIcon:u.jsx(Ru,{}),onClick:N,children:"ایجاد دستگاه"})})]})});return u.jsxs(p,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[h,u.jsx(Tu,{data:D,columns:["ردیف","شرکت پرداختی","شماره سریال","شماره پذیرنده","شماره ترمینال","کلمه عبور امنیتی","کلید پوز","نام واحد","مالک","کدملی","تاریخ ایجاد","فعال / غیرفعال","عملیات"],handlePageChange:s,totalRows:x,page:y,perPage:r,handlePerRowsChange:v,title:"مدیریت دستگاه ها"})]})},B0=({device:e,hasOwner:d,onOwnerAssigned:x})=>{const[o,r]=c.useState(null),[g]=c.useState(!1),[C,w]=c.useState(!!(e!=null&&e.active)),y=z(),[S]=c.useContext(q);c.useEffect(()=>{w(!!(e!=null&&e.active))},[e==null?void 0:e.active]);const D=v=>{r(v.currentTarget)},$=()=>{r(null)},_=()=>{$(),y(Z({title:d?"تغییر مالک":"افزودن مالک",width:"auto",content:u.jsx(z0,{device:e,onSuccess:x})}))},m=!!o,f=m?"device-operations-popover":void 0,a=d?"تغییر مالک":"افزودن مالک",A=d?Lu:$u,F=d?"warning.main":"success.main",l=(e==null?void 0:e.key)||(e==null?void 0:e.id),s=async v=>{if(v.stopPropagation(),v.preventDefault(),!l){S({vertical:"top",horizontal:"center",severity:"error",msg:"شناسه دستگاه یافت نشد."});return}};return u.jsxs(u.Fragment,{children:[u.jsx(G,{"aria-describedby":f,color:"primary",onClick:D,size:"small",children:u.jsx(Ou,{fontSize:"small"})}),u.jsx(Su,{id:f,open:m,anchorEl:o,onClose:$,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsxs(zu,{sx:{minWidth:160,p:0},children:[u.jsxs(Uu,{sx:{px:2,py:1,display:"flex",alignItems:"center",gap:1},children:[u.jsx(Au,{primary:"وضعیت دستگاه",secondary:C?"فعال":"غیرفعال"}),u.jsx(vu,{edge:"end",color:"success",checked:C,onChange:s,disabled:g||!l})]}),u.jsxs(Wu,{onClick:_,children:[u.jsx(Vu,{sx:{minWidth:36,color:F},children:u.jsx(A,{fontSize:"small"})}),u.jsx(Au,{primary:a,primaryTypographyProps:{sx:{color:F}}})]})]})})]})},z0=({device:e,onSuccess:d})=>{const x=z(),[o]=c.useContext(q),[r,g]=c.useState([]),[C,w]=c.useState(null),[y,S]=c.useState(!1),[D,$]=c.useState(!1),[_,m]=c.useState(""),[f,a]=c.useState("guild");c.useEffect(()=>{let l=!0;return(async()=>{var v,O;S(!0),m(""),w(null);try{let i;if(f==="kill_house"?i=await k0():i=await R0(P()),l){const t=Array.isArray((v=i==null?void 0:i.data)==null?void 0:v.results)?(O=i==null?void 0:i.data)==null?void 0:O.results:Array.isArray(i==null?void 0:i.data)?i==null?void 0:i.data:[];let N;f==="kill_house"?N=t.map(h=>{const j=h!=null&&h.killer?"کشتارکن":"کشتارگاه",n=(h==null?void 0:h.unitName)||(h==null?void 0:h.fullname)||"-",E=h!=null&&h.mobile?` (${h.mobile})`:"";return{...h,label:`${n}${E}`,meta:j,group:""}}):N=t.map(h=>{var b,U;const j=h!=null&&h.steward?"مباشر":"صنف",n=(h==null?void 0:h.guildsName)||((b=h==null?void 0:h.user)==null?void 0:b.fullname)||"-",E=(U=h==null?void 0:h.user)!=null&&U.mobile?` (${h.user.mobile})`:"";return{...h,label:`${n}${E}`,meta:j,group:""}}),g(N),w(N.find(h=>{var j,n,E;return((j=h==null?void 0:h.user)==null?void 0:j.mobile)===((n=e==null?void 0:e.owner)==null?void 0:n.mobile)||(h==null?void 0:h.mobile)===((E=e==null?void 0:e.owner)==null?void 0:E.mobile)}))}}catch{l&&m("دریافت لیست مالک‌ها با خطا مواجه شد.")}finally{l&&S(!1)}})(),()=>{l=!1}},[f]);const A=()=>{x(J())},F=async()=>{var l,s,v,O;if(C){if(!(e!=null&&e.key)&&!(e!=null&&e.id)){o({vertical:"top",horizontal:"center",severity:"error",msg:"شناسه دستگاه یافت نشد. لطفاً دوباره تلاش کنید."});return}$(!0);try{let i;f==="kill_house"?i="kill_house":i=C!=null&&C.steward?"Steward":"Guilds";const t={key:(e==null?void 0:e.key)||(e==null?void 0:e.id),owner_type:i,owner_key:C==null?void 0:C.key};await M0(t),o({vertical:"top",horizontal:"center",severity:"success",msg:"مالک با موفقیت ثبت شد."}),d&&d(),A()}catch(i){o({vertical:"top",horizontal:"center",severity:"error",msg:((s=(l=i==null?void 0:i.response)==null?void 0:l.data)==null?void 0:s.result)||((O=(v=i==null?void 0:i.response)==null?void 0:v.data)==null?void 0:O.detail)||"ثبت مالک با خطا مواجه شد."})}finally{$(!1)}}};return u.jsxs(p,{container:!0,direction:"column",gap:T.SMALL,width:"100%",alignItems:"stretch",children:[u.jsxs(k,{variant:"body2",children:["دستگاه انتخاب شده: ",(e==null?void 0:e.serial)||(e==null?void 0:e.posId)||"-"]}),u.jsx(A0,{label:"ماهیت مالک",children:u.jsx(bu,{children:u.jsxs(Gu,{row:!0,sx:{gap:2},value:f,onChange:l=>a(l.target.value),children:[u.jsx(pu,{value:"guild",control:u.jsx(xu,{}),label:"صنف / مباشر"}),u.jsx(pu,{value:"kill_house",control:u.jsx(xu,{}),label:"کشتارگاه / کشتارکن"})]})})}),y?u.jsx(p,{container:!0,justifyContent:"center",children:u.jsx(ju,{size:24})}):u.jsx(_u,{disablePortal:!0,fullWidth:!0,size:"small",options:r,value:C,groupBy:l=>(l==null?void 0:l.group)||"",loading:y,loadingText:"در حال دریافت...",noOptionsText:"موردی یافت نشد.",onChange:(l,s)=>w(s),isOptionEqualToValue:(l,s)=>(l==null?void 0:l.key)===(s==null?void 0:s.key),getOptionLabel:l=>(l==null?void 0:l.label)||"",renderOption:(l,s)=>{var v,O;return c.createElement("li",{...l,key:s==null?void 0:s.key},u.jsx(p,{container:!0,direction:"column",children:f==="kill_house"?u.jsxs(u.Fragment,{children:[u.jsx(k,{variant:"body2",fontWeight:600,children:`${(s==null?void 0:s.unitName)||(s==null?void 0:s.fullname)||""}${s!=null&&s.mobile?` (${s.mobile})`:""}`}),u.jsx(k,{variant:"caption",color:"text.secondary",children:`${(s==null?void 0:s.meta)||""}${s!=null&&s.city?` | ${s.city}`:""}`.replace(/^ \| /,"")})]}):u.jsxs(u.Fragment,{children:[u.jsx(k,{variant:"body2",fontWeight:600,children:`${(s==null?void 0:s.guildsName)||""}${(v=s==null?void 0:s.user)!=null&&v.mobile?` (${s.user.mobile})`:""}`}),u.jsx(k,{variant:"caption",color:"text.secondary",children:`${(s==null?void 0:s.typeActivity)||""}${s!=null&&s.areaActivity?` | ${s.areaActivity}`:""}${(O=s==null?void 0:s.user)!=null&&O.city?` | ${s.user.city}`:""}${s!=null&&s.licenseNumber?` | شناسه : ${s.licenseNumber}`:""}`.replace(/^ \| /,"")})]})}))},renderInput:l=>u.jsx(L,{...l,label:"انتخاب مالک",placeholder:"نام یا شماره تماس",InputProps:{...l.InputProps,endAdornment:u.jsxs(u.Fragment,{children:[y?u.jsx(ju,{color:"inherit",size:16}):null,l.InputProps.endAdornment]})}})}),_&&u.jsx(k,{variant:"caption",color:"error",children:_}),u.jsxs(p,{container:!0,justifyContent:"flex-end",gap:T.SMALL,children:[u.jsx(I,{variant:"outlined",color:"primary",onClick:A,disabled:D,children:"انصراف"}),u.jsx(I,{variant:"contained",onClick:F,disabled:!C||D||y,children:D?"در حال ثبت...":"ثبت"})]})]})},U0=({onSuccess:e})=>{const d=z(),[x]=c.useContext(q),[o,r]=c.useState({receiver_number:"",terminal_number:"",password:"",serial:""}),[g,C]=c.useState({}),[w,y]=c.useState(!1),S=()=>{d(H({right:!1,bottom:!1,content:null}))},D=m=>{const{name:f,value:a}=m.target;r(A=>({...A,[f]:a})),g[f]&&C(A=>({...A,[f]:""}))},$=()=>{var f,a,A,F;const m={};return(f=o.receiver_number)!=null&&f.trim()||(m.receiver_number="وارد کردن شماره پذیرنده الزامی است."),(a=o.terminal_number)!=null&&a.trim()||(m.terminal_number="وارد کردن شماره ترمینال الزامی است."),(A=o.password)!=null&&A.trim()||(m.password="وارد کردن رمز عبور الزامی است."),(F=o.serial)!=null&&F.trim()||(m.serial="وارد کردن سریال دستگاه الزامی است."),C(m),Object.keys(m).length===0},_=async m=>{var f,a,A,F;if(m.preventDefault(),!!$()){y(!0);try{await R.post("/new-pos-machine/",{receiver_number:o.receiver_number.trim(),terminal_number:o.terminal_number.trim(),password:o.password.trim(),serial:o.serial.trim()}),x({vertical:"top",horizontal:"center",severity:"success",msg:"دستگاه با موفقیت ایجاد شد."}),e&&e(),S()}catch(l){x({vertical:"top",horizontal:"center",severity:"error",msg:((a=(f=l==null?void 0:l.response)==null?void 0:f.data)==null?void 0:a.result)||((F=(A=l==null?void 0:l.response)==null?void 0:A.data)==null?void 0:F.detail)||"ایجاد دستگاه با خطا مواجه شد."})}finally{y(!1)}}};return u.jsxs(p,{component:"form",onSubmit:_,container:!0,direction:"column",gap:T.SMALL,width:"100%",autoComplete:"off",xs:12,children:[u.jsx(L,{label:"سریال دستگاه",name:"serial",value:o.serial,onChange:D,fullWidth:!0,error:!!g.serial,helperText:g.serial}),u.jsx(L,{label:"شماره پذیرنده",name:"receiver_number",value:o.receiver_number,onChange:D,fullWidth:!0,error:!!g.receiver_number,helperText:g.receiver_number}),u.jsx(L,{label:"شماره ترمینال",name:"terminal_number",value:o.terminal_number,onChange:D,fullWidth:!0,error:!!g.terminal_number,helperText:g.terminal_number}),u.jsx(L,{label:"رمز عبور",name:"password",value:o.password,onChange:D,fullWidth:!0,error:!!g.password,helperText:g.password}),u.jsxs(p,{container:!0,justifyContent:"justify-between",gap:T.SMALL,mt:T.SMALL,xs:12,children:[u.jsx(I,{variant:"outlined",color:"primary",style:{width:"46%"},onClick:S,disabled:w,children:"انصراف"}),u.jsx(I,{style:{width:"46%"},variant:"contained",type:"submit",disabled:w,children:w?"در حال ثبت...":"ثبت"})]})]})},v6=()=>{const{pathname:e}=Pu();return u.jsx(u.Fragment,{children:u.jsx(X,{display:"flex",justifyContent:"center",children:u.jsxs(p,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[[Yu,Xu,Ju].includes(e)?u.jsx(p,{justifyContent:"center",my:T.MEDIUM,children:u.jsx(p0,{})}):u.jsx(u0,{}),u.jsx(p,{container:!0,justifyContent:"space-between",gap:T.SMALL,children:u.jsxs(p,{xs:12,children:[[Ku,Qu,Zu].includes(e)&&u.jsx(E0,{}),[au,nu,lu].includes(e)&&u.jsx(h0,{}),[ru,su,tu].includes(e)&&u.jsx(N0,{})]})})]})})})};export{v6 as default}; diff --git a/build/assets/PublishedWithChanges-C8kvr_m4.js b/build/assets/PublishedWithChanges-C8kvr_m4.js new file mode 100644 index 0000000..7f807ec --- /dev/null +++ b/build/assets/PublishedWithChanges-C8kvr_m4.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},i=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,o=i(a()),s=t;u=e.default=(0,o.default)((0,s.jsx)("path",{d:"m17.66 9.53-7.07 7.07-4.24-4.24 1.41-1.41 2.83 2.83 5.66-5.66zM4 12c0-2.33 1.02-4.42 2.62-5.88L9 8.5v-6H3l2.2 2.2C3.24 6.52 2 9.11 2 12c0 5.19 3.95 9.45 9 9.95v-2.02c-3.94-.49-7-3.86-7-7.93m18 0c0-5.19-3.95-9.45-9-9.95v2.02c3.94.49 7 3.86 7 7.93 0 2.33-1.02 4.42-2.62 5.88L15 15.5v6h6l-2.2-2.2c1.96-1.82 3.2-4.41 3.2-7.3"}),"PublishedWithChanges");export{u as d}; diff --git a/build/assets/ReceiptLong-Dxpx4wPx.js b/build/assets/ReceiptLong-Dxpx4wPx.js new file mode 100644 index 0000000..9208a82 --- /dev/null +++ b/build/assets/ReceiptLong-Dxpx4wPx.js @@ -0,0 +1 @@ +import{i as t,j as a}from"./mui-vendor-CkIVaoQP.js";import{r as o}from"./index-CeyyVc1v.js";var e={},v=t;Object.defineProperty(e,"__esModule",{value:!0});var i=e.default=void 0,u=v(o()),r=a;i=e.default=(0,u.default)([(0,r.jsx)("path",{d:"M19.5 3.5 18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2v14H3v3c0 1.66 1.34 3 3 3h12c1.66 0 3-1.34 3-3V2zM19 19c0 .55-.45 1-1 1s-1-.45-1-1v-3H8V5h11z"},"0"),(0,r.jsx)("path",{d:"M9 7h6v2H9zm7 0h2v2h-2zm-7 3h6v2H9zm7 0h2v2h-2z"},"1")],"ReceiptLong");export{i as d}; diff --git a/build/assets/Refresh-DkAX1rkD.js b/build/assets/Refresh-DkAX1rkD.js new file mode 100644 index 0000000..b559e23 --- /dev/null +++ b/build/assets/Refresh-DkAX1rkD.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var s=e.default=void 0,u=o(a()),i=t;s=e.default=(0,u.default)((0,i.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");export{s as d}; diff --git a/build/assets/RequestsAwaitingInspections-C8DP5FQL.js b/build/assets/RequestsAwaitingInspections-C8DP5FQL.js new file mode 100644 index 0000000..d2cb996 --- /dev/null +++ b/build/assets/RequestsAwaitingInspections-C8DP5FQL.js @@ -0,0 +1 @@ +import{j as s,I as T,aJ as H,T as U,ak as v}from"./mui-vendor-CkIVaoQP.js";import{u as L,r as o}from"./react-vendor-CmFgShSM.js";import{A as N}from"./AdvancedTable-BYmmBtmq.js";import{d as P}from"./Plagiarism-BiXORbzo.js";import{f as G,u as Q}from"./redux-vendor-B7uoacJt.js";import{A as B,a9 as w,fa as W,Q as i,G as j,S as Y,W as q,X as J,fb as X}from"./index-CeyyVc1v.js";const $=()=>{const{awaitingPaymentRequests:a}=G(u=>u.generalSlice),M=L(),[k,R]=o.useState([]),S=window.location.pathname.split("/")[1],[,,t,E,n,r]=o.useContext(B);o.useEffect(()=>{const u=w(new Date).format("YYYY-MM-DD");E(u),r(u)},[]);const b=Q();return o.useEffect(()=>{b(W({selectedDate1:t,selectedDate2:n}))},[t,n]),o.useEffect(()=>{const u="/"+S+"/file/",I=a==null?void 0:a.map((e,l)=>{var c,p,d,A,y,C,f,x,F,g,D;return[l+1,(d=(p=(c=e.provinceCheckInfo)==null?void 0:c.killHouseAssignment)==null?void 0:p.killHouseRequest)==null?void 0:d.barCode,i(new Date((A=e==null?void 0:e.poultryRequest)==null?void 0:A.sendDate),"yyyy/MM/dd"),i(new Date(e==null?void 0:e.factorDate),"yyyy/MM/dd"),(y=e==null?void 0:e.poultryRequest)==null?void 0:y.poultryName,(F=(x=(f=(C=e.provinceCheckInfo)==null?void 0:C.killHouseAssignment)==null?void 0:f.killHouseRequest)==null?void 0:x.killRequest)==null?void 0:F.killHouse.name,e.provinceCheckInfo.killHouseAssignment.netWeight.toLocaleString()+" کیلوگرم",((D=(g=e.provinceCheckInfo)==null?void 0:g.killHouseAssignment)==null?void 0:D.realQuantity.toLocaleString())+" قطعه",e.totalPrice.toLocaleString()+" ﷼",s.jsx(T,{"aria-label":"delete",color:"primary",onClick:()=>{var h;return M(u+((h=e==null?void 0:e.poultryRequest)==null?void 0:h.poultryRequestId))},children:s.jsx(P,{})},l)]});R(I)},[a]),s.jsx(H,{children:s.jsx(N,{name:s.jsxs(j,{container:!0,alignItems:"center",gap:Y.SMALL,children:[s.jsx(j,{container:!0,gap:Y.TINY,children:s.jsx(U,{children:"درخواست های در انتظار پرداخت"})}),s.jsxs(j,{container:!0,gap:Y.SMALL,children:[s.jsx(j,{children:s.jsx(q,{label:"از تاریخ",id:"date",renderInput:u=>s.jsx(v,{style:{width:"160px"},...u}),value:t,onChange:u=>{E(w(u).format("YYYY-MM-DD"))}})}),s.jsx(j,{children:s.jsx(q,{label:"تا تاریخ",id:"date",renderInput:u=>s.jsx(v,{style:{width:"160px"},...u}),value:n,onChange:u=>{r(w(u).format("YYYY-MM-DD"))}})})]})]}),columns:["ردیف","بارکد","تاریخ کشتار","تاریخ صدور فاکتور","مرغدار","کشتارگاه","وزن","تعداد","مبلغ کل فاکتور","مشاهده"],data:k})})},m=()=>{const{awaitingInspectionRequests:a}=G(r=>r.generalSlice),M=L(),[k,R]=o.useState([]),S=window.location.pathname.split("/")[1],t=Q(),E=J();o.useEffect(()=>{t(X(E+"&inspector"))},[]),o.useEffect(()=>{const r="/"+S+"/file/",b=a==null?void 0:a.map((u,I)=>{var e,l,c,p,d,A,y,C,f,x,F,g;return[I+1,u.orderCode,i(new Date(u.createDate),"yyyy/MM/dd"),i(new Date(u.sendDate),"yyyy/MM/dd"),(l=(e=u==null?void 0:u.process)==null?void 0:e.poultry)==null?void 0:l.poultryName,(p=(c=u==null?void 0:u.process)==null?void 0:c.poultry)==null?void 0:p.poultryMobile,(A=(d=u==null?void 0:u.process)==null?void 0:d.poultry)==null?void 0:A.poultryCity,(C=(y=u==null?void 0:u.process)==null?void 0:y.poultry)==null?void 0:C.poultryProvince,(x=(f=u==null?void 0:u.process)==null?void 0:f.poultry)==null?void 0:x.age,(g=(F=u==null?void 0:u.process)==null?void 0:F.poultry)==null?void 0:g.poultryQuantity,s.jsx(T,{"aria-label":"delete",color:"primary",onClick:()=>{var D,h;return M(r+((h=(D=u==null?void 0:u.process)==null?void 0:D.poultry)==null?void 0:h.poultryRequestId))},children:s.jsx(P,{})},u==null?void 0:u.orderCode)]});R(b)},[a]);const[n]=o.useState(["ردیف","کد سفارش","تاریخ ثبت درخواست","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","استان","سن مرغ","تعداد","مشاهده"]);return s.jsx(H,{children:s.jsx(N,{expandable:!0,name:"درخواست های در انتظار بررسی بازرس",columns:n,data:k})})};export{$ as R,m as a}; diff --git a/build/assets/ResponsiveTable-w7hk7Uq8.js b/build/assets/ResponsiveTable-w7hk7Uq8.js new file mode 100644 index 0000000..931c055 --- /dev/null +++ b/build/assets/ResponsiveTable-w7hk7Uq8.js @@ -0,0 +1,5 @@ +import{i as L,j as t,b as Pe,T as C,I as Ie,bs as S,a3 as s,ak as fe,b0 as Je,B as De,am as Qe,ai as Ze,aX as _e,aV as je,aY as $e,a9 as et,aZ as tt,a_ as nt,d as be,c2 as it,a$ as rt,aW as Q,ag as ve,av as ke,aw as Se,ax as m,bq as me}from"./mui-vendor-CkIVaoQP.js";import{r as g}from"./react-vendor-CmFgShSM.js";import{r as O,G as I,k as at,m as Z,fq as st}from"./index-CeyyVc1v.js";import{d as dt}from"./FilterAlt-scT0HEUg.js";import{s as ct}from"./styled-components.browser.esm-gS9mh05b.js";var _={},lt=L;Object.defineProperty(_,"__esModule",{value:!0});var Ve=_.default=void 0,xt=lt(O()),ut=t;Ve=_.default=(0,xt.default)((0,ut.jsx)("path",{d:"M19 7H9c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2m0 2v2H9V9zm-6 6v-2h2v2zm2 2v2h-2v-2zm-4-2H9v-2h2zm6-2h2v2h-2zm-8 4h2v2H9zm8 2v-2h2v2zM6 17H5c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2v1h-2V5H5v10h1z"}),"TableView");const ot="5.7.4",ht=29.9700012207031,At=0,pt=75.0000030548126,gt=266,yt=266,ft="Comp 1",jt=0,bt=[{id:"image_0",w:38,h:38,u:"",p:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmBAMAAABaE/SdAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAACXBIWXMAAAABAAAAAQBPJcTWAAAALVBMVEVHcEzzXHTyWnLzWXDzWXLyWnLyWnLxW3LyWnL//v781dv1g5X0dYn5t8L2jp5j9zpmAAAACHRSTlMAQWAroOTGcMVbXa4AAACPSURBVCjPY2DACtgzOhAgxQAkxBzRgQxaQGIWHajAASgWgSbWCDQNTaijlYGBDV2sw4CBA8a8A2MIwMW6Zw2MWA8WsY4XWMQ6KBA7gcXeuVjU3cFnngGmGDCcMcSasIg5YIqB4hdNrEUAJqaAmlo4IMZiiClgiqErA4kpYIphKAOKYShjYMVUxsBswEAMAADsu/0qA5pP3wAAAABJRU5ErkJggg==",e:1},{id:"image_1",w:73,h:71,u:"",p:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAABHCAMAAAB8p5qeAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAdVBMVEVHcExTVWxNUGVcYXZjaH5VWW1HSV7a7P9BQ1dqcIVCRFhLTWJHSV5ER1tQUmlNT2WHkaVMTF9vdYqlscVNTmRISl/O3/JcYHZJTGGWobVMTmS2xdhGR1xDRVpNT2RGSF1XWnB6gZXQ4/VNUGVPUmfF1ehdYHci4ka3AAAAJ3RSTlMAvPjy7/X8sv7r9tzm78XQ2A/pySZht9uP0FDBOb52qufftummu82Kdd2xAAADHklEQVRYw9XY23qjIBAA4IgieCZ4iKdoTLTv/4id0bZrthXQ9GJ3bvt9fwZmkKGn038S57orxwRjLPP2BWaM4zj5jCAIyvqQ0wETXy4OhI1xAyq4due9To6M8xH2Ytn0Ada+vLLRii+e5zhSpM2dMTY11WBTm9JHGPY70sot682DqCa2jnSgEGEYGO99Z1nAyOrO/o4JLUgrN4UwIfHdwWg8SoghNUMyZRtRDISSKDKg6hma2HZUBLPKtFWDPZJKaKaiKNBU8DzqIcYEUqWu/m/SS5kuJFLKXjhblvSEFmIFdV3/qqmblHe9xCrXjfxWnZKsmEl46qRq05Tg5IDkb3dCCYUzS4kxClKn3O/JUBKq5bWwuMEQYg0ub7uZzBfHGHF93m5vk0FXfobDOe82Jek1xpLgPt86Mbjh9x0SV0ieNIZYCtJVkdNvSd4OqdLkNP3KPmEXmNduUEjdrn6yQao3e/xi8pn7CIA2ezyDa0XuKd3muTvFsflGSUXpYKNi4+UVLkjb12cNkjMZ94CvuPLG2HGEcUq96rrD6asxbCbeKq9gSGq4GxWOR5ZqNqjjxGB9BUHpEscqqsT1VbobGCHqXBIVdY4ToFI9RISDlGJ+zZLk5tiVDnIbBtQtSRRUDZRtb257Sjl2AGY9U4GW+nmFxeC6CC05i3ner5UFDGCO/z5rFoLMjvv5l3SmOtWImASQFnVE8zSOkyUh8qdNgKLwnlE9WuCNgmM8taWAZ0IlBg8ZuMC5f/NWxzyFh0MYqibFdgTrMWMwgGO4cH1D9BZ8D58oqqEWK3w8yIPgVAnh+1Gf4XT8RDU2UurHTJb34UcgFPb5edlFPAdrCn/pqnsXtXlX9n3fdXW2KshMfXVcQ42on2uLlHym/IMUnE57RTlYjmt2hIrxHMjiq2dt7JCoPUx5TxR82Q9RPVB0TXHNJbF9Dnrs3BV144r73YByitUUxPmRTZ+p8ItaoPx0OkiFISV2Mz+JXoGAuoYhIbR5GZqpCA64cN0XIaSiaP5yvQot1PwFfBXCyxY+XL5y3DCn8FP6O/86a9v29G/HO1j/Y1S5TQboAAAAAElFTkSuQmCC",e:1},{id:"image_2",w:135,h:111,u:"",p:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIcAAABvCAMAAADxLiPXAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAACXBIWXMAAAABAAAAAQBPJcTWAAAATlBMVEVHcEyRmKeRl6Z0fo5weoplcYJUY3R+h5eJkaFtd4SMlqNpdIVsd4d6g5OOlaSQl6deanyPlqWRmKft7e3m5+ikqbWYn63FyM/Y2d20uML3wTkVAAAAEnRSTlMA7l/ZwXA97f0aMpuvhJu7VtIT1ptLAAAEqElEQVRo3uWbi5KjIBBFo5k8MDEPn5P//9FFwAjaQDeCbu1aU1NTU4oHuFwabA6Hf+a6/ZR/AcXpUlXV5bQzxXmgGK7jeUcKdhwQrj9X8ZvthSHff+c88q/bLhTl8O5KtYJsmR1kIuSpq+Il/nHZVibFBaj+STTQkW0tz6Uc7lKwG1HIt92herMfQVhuJ8+z01CSC1aq8fiiKHgjeQITTlpfU51/x9yZztfYg1LLZL4m5Uno9SS+lstCXzTLje1rSp707o7qa6M8Wfiz5dbyTOZrqo9fa4pY72t5nMqs9DX2DpRnVF9jz3B5xvM1Jc+Igz/I1/L18ozga8U10eRA87VcyjPFtC197Y1rjaxKFu9KuVYPPMYQ+8VvjaFfOhQI4xht03dV/EBG2FnVNz3/nSO8q23quu5Fk1zjaVXa+2csO/didMOtdd18qoiBjJzu2l9RdP3xgXAP7dS9nKSNJVg5TKaSfSAP4+a6/hUyqe4xbKPqtYIFSOHAMO/mXdmtlom00U9jFszbOivs/jXDUOScJFQmclppm3mxjRUExpgEy4J9q/2FirWADBifGrxGwQb6Vm8vNWOQjVowJsHe6L7V9Y2t0IYX+mZLjLZ2XGRf03zLVTsTRLp57bxIvmb6Fhbk6+bOSwkW4WsL33KBPCE39zzWonzt7pLnrER98n2i2DXBOhdosG+5dPeA3dz/oMPXbL7lB7H5l0+wBc23nCC5mlU+DeVJm6+5fcvV0/m4YKI+3AK+NsZbpCqJxn3KIZhntC7VJuKS4ltLCiG2aZaRa0hak5iCxfkWVJfMiIdkk9CKmQSL9q1l3z4YEAQRm3UU7OVKb04ljMKycCHWaZyI6cJYdom2NxnQJEomIcKwm3LxJg9h1TWU0WYRxmGp14aKQXjGLgyzSUiuJmI7PnjxIE5hHAKHsIx1+YDJkSBS1siQm2VIf1YhNy/4gAIZOxG7kSC/UXuH8Bj5DxwIECmMd0niuPuH8HcBIji8IKMwTiSOsxjCLluY1kGSww0ihVFyYRA5fK6mLccUhwNEn93JHM7ARF8Vjhw2EHN2p3M4XM1YnH45YJCZY4Rw2AITc408cQAgCxMP4oBdbbZU1zjmIICJB3IAgcl8x0DnMEDk7P42TTyYYx6YLDYuDA4NBJ7dwznMIbzcPzE5RhDb7L6GQwtMgG2cGYcEsc7uqzi+QxjaTZpzyA8Fttl9JYcKTDpgU2vBIUCyEp7d13KoJgH21pYch/xhDfsIHHyx/LJ9sgO2+AAO17YEnoOviiz7YEUOVHMHDvD6HzhuyThuJA7K93gKh9gXwH6/YLTv8XgOlYaB3qmnfY9HcwSkpVC+xyM5AtN08N/jURwr0pawFUBwrEzjwnWol2N9Whsqz8jHESXND5Fn5OaIlvboLcjFETUN1NOwdo7YabFuoVk5EqQJuwaehSNR2rTdiECOhGnktgoCHInT6uEOX3CkP2YADoA5x22LYxeAIZgcG6RrW16kc2yUvg42/MSxYTo/IMQvx6bHG5YDU3FsftxjblSCY5fjL6avDRv3ex0H0gXBf3Y8HqUNkGrf42KaYex7fO7ra7sfJ/z3rj/8USnvgCbE4wAAAABJRU5ErkJggg==",e:1}],vt=[{ddd:0,ind:1,ty:4,nm:"Shape Layer 1",sr:1,ks:{o:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:32,s:[100]},{t:41.0000016699642,s:[0]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[125.5,135.5,0],ix:2,l:2},a:{a:0,k:[0,0,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{a:1,k:[{i:{x:[.667,.667],y:[1,1]},o:{x:[.333,.333],y:[0,0]},t:0,s:[55,11]},{i:{x:[.667,.667],y:[1,1]},o:{x:[.333,.333],y:[0,0]},t:15,s:[45,7]},{i:{x:[.667,.667],y:[1,1]},o:{x:[.333,.333],y:[0,0]},t:30,s:[55,11]},{i:{x:[.667,.667],y:[1,1]},o:{x:[.333,.333],y:[0,0]},t:45,s:[45,7]},{t:60.0000024438501,s:[59,14]}],ix:2},p:{a:0,k:[0,0],ix:3},nm:"Ellipse Path 1",mn:"ADBE Vector Shape - Ellipse",hd:!1},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:0,ix:5},lc:1,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.827450980392,.827450980392,.827450980392,1],ix:4},o:{a:0,k:50,ix:5},r:1,bm:0,nm:"Fill 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[83,60],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Ellipse 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:75.0000030548126,st:0,bm:0},{ddd:0,ind:2,ty:2,nm:"Error Icon",refId:"image_0",sr:1,ks:{o:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:33,s:[0]},{t:48.0000019550801,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:33,s:[168.234,106.021,0],to:[1.833,-5.333,0],ti:[-1.833,5.333,0]},{t:48.0000019550801,s:[179.234,74.021,0]}],ix:2,l:2},a:{a:0,k:[18.707,18.707,0],ix:1,l:2},s:{a:1,k:[{i:{x:[.667,.667,.667],y:[1,1,1]},o:{x:[.333,.333,.333],y:[0,0,0]},t:33,s:[20,20,100]},{t:48.0000019550801,s:[100,100,100]}],ix:6,l:2}},ao:0,ip:31.0000012626559,op:75.0000030548126,st:31.0000012626559,bm:0},{ddd:0,ind:3,ty:2,nm:"Search Icon",refId:"image_1",sr:1,ks:{o:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:32,s:[100]},{t:41.0000016699642,s:[0]}],ix:11},r:{a:0,k:0,ix:10},p:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:0,s:[180.298,138.638,0],to:[0,0,0],ti:[0,0,0]},{i:{x:.667,y:1},o:{x:.333,y:0},t:15,s:[181.298,106.263,0],to:[0,0,0],ti:[0,0,0]},{i:{x:.667,y:1},o:{x:.333,y:0},t:30,s:[180.298,147.638,0],to:[0,0,0],ti:[0,0,0]},{i:{x:.667,y:1},o:{x:.333,y:0},t:45,s:[181.298,106.263,0],to:[0,0,0],ti:[0,0,0]},{t:60.0000024438501,s:[180.298,147.638,0]}],ix:2,l:2},a:{a:0,k:[36.205,35.348,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,ip:0,op:75.0000030548126,st:0,bm:0},{ddd:0,ind:4,ty:2,nm:"Box Icon",refId:"image_2",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:1,k:[{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:0,s:[0]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:3,s:[2]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:6,s:[0]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:9,s:[-2]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:12,s:[0]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:15,s:[2]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:18,s:[0]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:21,s:[-2]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:24,s:[0]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:27,s:[2]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:30,s:[0]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:33,s:[-2]},{t:36.0000014663101,s:[0]}],ix:10},p:{a:0,k:[133,139,0],ix:2,l:2},a:{a:0,k:[67.471,55.221,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,ip:0,op:75.0000030548126,st:0,bm:0}],kt=[],St={v:ot,fr:ht,ip:At,op:pt,w:gt,h:yt,nm:ft,ddd:jt,assets:bt,layers:vt,markers:kt};var $={},mt=L;Object.defineProperty($,"__esModule",{value:!0});var Be=$.default=void 0,It=mt(O()),Vt=t;Be=$.default=(0,It.default)((0,Vt.jsx)("path",{d:"M19.79 5.61C20.3 4.95 19.83 4 19 4H6.83l7.97 7.97zM2.81 2.81 1.39 4.22 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-2.17l5.78 5.78 1.41-1.41z"}),"FilterAltOff");var ee={},Bt=L;Object.defineProperty(ee,"__esModule",{value:!0});var Me=ee.default=void 0,Mt=Bt(O()),Et=t;Me=ee.default=(0,Mt.default)((0,Et.jsx)("path",{fillRule:"evenodd",d:"M3 3v8h8V3zm6 6H5V5h4zm-6 4v8h8v-8zm6 6H5v-4h4zm4-16v8h8V3zm6 6h-4V5h4zm-6 4v8h8v-8zm6 6h-4v-4h4z"}),"GridView");var te={},wt=L;Object.defineProperty(te,"__esModule",{value:!0});var Ee=te.default=void 0,Ft=wt(O()),Tt=t;Ee=te.default=(0,Ft.default)((0,Tt.jsx)("path",{d:"M11.71 17.99C8.53 17.84 6 15.22 6 12c0-3.31 2.69-6 6-6 3.22 0 5.84 2.53 5.99 5.71l-2.1-.63C15.48 9.31 13.89 8 12 8c-2.21 0-4 1.79-4 4 0 1.89 1.31 3.48 3.08 3.89zM22 12c0 .3-.01.6-.04.9l-1.97-.59c.01-.1.01-.21.01-.31 0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8c.1 0 .21 0 .31-.01l.59 1.97c-.3.03-.6.04-.9.04-5.52 0-10-4.48-10-10S6.48 2 12 2s10 4.48 10 10m-3.77 4.26L22 15l-10-3 3 10 1.26-3.77 4.27 4.27 1.98-1.98z"}),"AdsClick");const we=({columns:c,data:F,isDashboard:V,allColors:y,customColors:o})=>{const[W,X]=g.useState([]),z=d=>{if(y)return y.color;{const r=o!=null&&o.find(h=>h.name===(d==null?void 0:d.name))?o==null?void 0:o.find(h=>h.name===(d==null?void 0:d.name)):o==null?void 0:o.find(h=>h.rest===!0);return r?r.color:V?"#f4c3c3":o!=null&&o.length?"#f6e58d":null}},H=d=>{X(r=>r.includes(d)?r.filter(h=>h!==d):[...r,d])};function l(d){const r=String(d),h=r==null?void 0:r.replace(/,/g,""),E=Number(h);return isNaN(E)?!0:E>=0}const U=d=>{if(y!=null&&y.text)return y.text;const r=z(d);return!r||r==="black"||r==="blue"||r==="red"||r==="brown"||r==="green"?"white":"black"};return t.jsx(I,{xs:12,container:!0,justifyContent:"center",style:{width:"100%"},children:t.jsx(I,{container:!0,xs:12,spacing:1,justifyContent:"space-between",style:{width:"100%"},children:F==null?void 0:F.map((d,r)=>{var b,f;let h=0;const E=W.includes(r);return t.jsx(I,{xs:F.length===1?12:6,children:t.jsxs(Pe,{display:"flex",flexDirection:"column",border:1,borderRadius:3,style:{width:"100%",borderColor:"darkgray"},children:[d.slice(0,8+((b=c.filter(x=>(x==null?void 0:x.visible)===!1))==null?void 0:b.length)).map((x,u)=>{var p,B,w,T;return((p=c[u])==null?void 0:p.visible)&&t.jsxs(I,{borderRadius:u===0?"11px 11px 0px 0px":0,alignItems:"center",justifyContent:"space-between",display:"flex",xs:12,sx:{backgroundColor:h++%2===0?V?"white":"#daeef0":"white",borderStyle:"solid",borderWidth:"1px",borderColor:"darkgray",padding:0},children:[t.jsx(I,{item:!0,xs:5,sx:{backgroundColor:z(c[u])||(V?"#c23616":"#547687"),borderRadius:"4px 0 0 4px",paddingY:"8px"},children:t.jsx(C,{sx:{fontSize:((w=(B=c[u])==null?void 0:B.name)==null?void 0:w.length)<=15?13:10,color:U(c[u])},children:`${(T=c[u])==null?void 0:T.name}`})}),t.jsx(I,{item:!0,xs:7,style:{fontSize:12,width:"100%",color:l(x)?"black":"red",lineBreak:"anywhere"},children:l(x)?x:String(x).replace("-","")+"-‌ ‌"})]},u)}),E&&((f=d.slice(8))==null?void 0:f.map((x,u)=>{var p,B,w,T;return((p=c[u+8])==null?void 0:p.visible)&&t.jsxs(I,{alignItems:"center",justifyContent:"space-between",display:"flex",xs:12,sx:{backgroundColor:h++%2===0?V?"white":"#daeef0":"white",borderStyle:"solid",borderWidth:"1px",borderColor:"darkgray",padding:0},children:[t.jsx(I,{item:!0,xs:5,sx:{backgroundColor:z(c[u+8])||(V?"#c23616":"#547687"),borderRadius:"4px 0 0 4px",paddingY:"8px"},children:t.jsx(C,{sx:{fontSize:((w=(B=c[u+8])==null?void 0:B.name)==null?void 0:w.length)<=15?13:10,color:U(c[u+8])},children:`${(T=c[u+8])==null?void 0:T.name}`})}),t.jsx(I,{item:!0,xs:7,style:{fontSize:12,width:"100%",color:l(x)?"black":"red",lineBreak:"anywhere"},children:l(x)?x:String(x).replace("-","")+"-‌ ‌"})]},u+8)})),d.length>8&&t.jsx(Ie,{onClick:()=>H(r),children:t.jsx(at,{sx:{transform:E?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s"}})})]})},r)})})})};we.propTypes={columns:S.any,data:S.any,ignore:S.array};const zt=({columns:c,data:F,title:V,paginated:y=!1,handlePageChange:o,handlePerRowsChange:W,totalRows:X,page:z,perPage:H,customColors:l,noPagination:U,changed:d,isDashboard:r,noSearch:h,operation:E,allColors:b,activeRows:f,customWidth:x,ignoreTextsLength:u,CustomColumnsColor:p,hasSum:B,hasSumColumn:w})=>{const ne=`${window.location.pathname}_${c.length}_columnsVisibility${V}${c.join(" ")}`,ie=()=>{var n;const e=localStorage.getItem(ne);return e&&((n=JSON.parse(e))==null?void 0:n.length)===(c==null?void 0:c.length)&&!d?JSON.parse(e):c.map(i=>({name:i,visible:!0}))};g.useEffect(()=>{ae(ie())},[c]);function K(e){const n=String(e),i=n==null?void 0:n.replace(/,/g,""),a=Number(i);return isNaN(a)?!0:a>=0}const[Y,Fe]=g.useState(10),[re,P]=g.useState(1),[J,Te]=g.useState(""),[q,ze]=g.useState(null),[v,ae]=g.useState(ie()),[j,He]=g.useState({key:null,direction:"asc"});g.useEffect(()=>{localStorage.setItem(ne,JSON.stringify(v))},[v]);const Ue=e=>{const n=j.key===e&&j.direction==="asc"?"desc":"asc";He({key:e,direction:n})},R=[...F||[]].sort((e,n)=>{if(j.key===null)return 0;const i=String(e[j.key]),a=String(n[j.key]),k=!isNaN(i.replace(/,/g,"")),M=!isNaN(a.replace(/,/g,""));if(k&&M){const N=parseFloat(i.replace(/,/g,"")),G=parseFloat(a.replace(/,/g,""));return j.direction==="asc"?N-G:G-N}return typeof i=="string"&&typeof a=="string"?j.direction==="asc"?i.localeCompare(a,"fa",{sensitivity:"base"}):a.localeCompare(i,"fa",{sensitivity:"base"}):k?j.direction==="asc"?-1:1:M?j.direction==="asc"?1:-1:0}).filter(e=>e.some(n=>{var i,a;return(a=(i=n==null?void 0:n.toString())==null?void 0:i.toLowerCase())==null?void 0:a.includes(J.toLowerCase())}));g.useEffect(()=>{P(1)},[J]);const Ye=Math.ceil((R==null?void 0:R.length)/Y),se=(re-1)*Y,Re=se+Y,A=y?R.slice(se,Re):R,Ne=e=>{const n=[...v];n[e].visible=!n[e].visible,ae(n)},[de,ce]=g.useState(null),Ce=e=>{ce(e.currentTarget)},le=()=>{ce(null)},xe=!!de,ue=xe?"simple-popover":void 0,[oe,he]=g.useState(!1),Xe=e=>{Fe(e.target.value,P(1))},Ae=()=>{he(!1)},pe=()=>{he(!0)},qe={hidden:{opacity:0},visible:{opacity:1}},Ge=()=>t.jsx(Z.span,{style:{display:"inline-flex"},initial:"hidden",animate:"visible",transition:{staggerChildren:1.5,repeat:1/0},children:[".",".","."].map((e,n)=>t.jsx(Z.span,{variants:qe,transition:{duration:1.5},children:e},n))}),Le=t.jsxs(s,{container:!0,alignItems:"center",justifyContent:"space-between",xs:12,style:{width:"85vw"},children:[t.jsx(s,{gap:2,alignItems:"center",children:t.jsxs(s,{container:!0,gap:2,alignItems:"center",children:[r?t.jsx(Me,{sx:{color:"#c23616"}}):t.jsx(Ve,{sx:{color:"#547687"}}),t.jsx(C,{style:{fontSize:"16px",color:r?"#c23616":"black"},variant:"body2",children:V})]})}),t.jsx(s,{gap:2,alignItems:"center",justifyContent:"center",children:t.jsxs(s,{container:!0,gap:1,alignItems:"center",children:[t.jsx(s,{item:!0,children:E}),y&&!h&&t.jsx(s,{item:!0,children:t.jsx(fe,{size:"small",type:"search",variant:"standard",placeholder:"جستجو...",value:J,onChange:e=>Te(e.target.value)})}),t.jsx(s,{item:!0,children:!r&&t.jsx(Ie,{onClick:Ce,"aria-describedby":ue,color:v.filter(e=>(e==null?void 0:e.visible)===!1).length?"error":"primary",children:v.filter(e=>(e==null?void 0:e.visible)===!1).length?t.jsx(dt,{}):t.jsx(Be,{})})}),t.jsx(s,{container:!0,xs:4,children:t.jsx(Je,{id:ue,open:xe,anchorEl:de,onClose:le,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:t.jsxs(s,{container:!0,width:"300px",p:3,children:[t.jsxs(s,{container:!0,xs:12,justifyContent:"space-between",alignItems:"center",children:[t.jsx(C,{variant:"body1",color:"primary",children:"فیلتر ستون ها"}),t.jsx(De,{color:"error",onClick:()=>{le()},children:"بازگشت"})]}),t.jsx(Qe,{style:{width:"100%"}}),v.map((e,n)=>t.jsx(s,{container:!0,alignItems:"center",gap:1,children:t.jsx(Ze,{style:{color:e.visible?"black":"red"},control:t.jsx(_e,{size:"small",checked:e.visible,onChange:()=>Ne(n)}),label:e.name},n)},n))]})})})]})})]}),Oe=ct(Q)` + font-weight: bold; + background: ${({bgColor:e})=>`${e} !important`}; + color: ${({bgColor:e,textColor:n})=>`${n||(r?"white":b?b==null?void 0:b.text:e==="black"||e==="blue"||e==="red"||e==="brown"||e==="green"?"white":"black")} !important`}; + `,We=e=>{if(p){const i=p==null?void 0:p.find(a=>e==null?void 0:e.name.includes(a.key));if(i)return i.color}const n=l!=null&&l.find(i=>i.name===(e==null?void 0:e.name))?l==null?void 0:l.find(i=>i.name===(e==null?void 0:e.name)):l==null?void 0:l.find(i=>i.rest===!0);return n?n.color:b?b.color:r?"#c23616":l!=null&&l.length?"#f6e58d":null},Ke=e=>{const n=/^\d{4}\/\d{2}\/\d{2}$/,i=typeof e=="string"&&e.replace(/,/g,"").length>14;if(typeof e=="string"&&(n.test(e)||i))return 0;if(typeof e=="string"){const a=parseFloat(e.replace(/,/g,""));return isNaN(a)?0:a}return typeof e=="number"?e:0},D=e=>{let n=!1;const i=A.reduce((a,k)=>{const M=Ke(k[e]);return M!==null?(n=!0,a+M):a},0);return n?i:null},ge=Z(je),ye={active:{backgroundColor:B?["rgba(176, 84, 237, 0.8)","rgba(176, 84, 237, 0.6)","rgba(176, 84, 237, 0.8)"]:["rgb(234, 137, 130, 0.6)","rgb(234, 137, 130, 0.4)","rgb(234, 137, 130, 0.6)"],transition:{duration:3,repeat:1/0,ease:"easeInOut"}}};return t.jsxs(t.Fragment,{children:[Le,t.jsx(s,{id:"startoftable",display:{xs:"none",sm:"grid"},style:{width:x||"85vw"},children:t.jsx($e,{component:et,sx:{maxHeight:"70vh",overflow:"auto"},children:t.jsxs(tt,{"aria-label":"simple table",stickyHeader:!0,children:[t.jsx(nt,{children:t.jsx(je,{children:v.filter(e=>e.visible).map((e,n)=>{var a,k,M,N;const i=D(n);return t.jsx(be,{title:`مجموع: ${parseInt(D(n)).toLocaleString()}`,arrow:!0,placement:"top",disableHoverListener:i===0||r||(e==null?void 0:e.name)==="ردیف"||((a=e==null?void 0:e.name)==null?void 0:a.includes("موبایل"))||((k=e==null?void 0:e.name)==null?void 0:k.includes("حساب"))||((M=e==null?void 0:e.name)==null?void 0:M.includes("شماره"))||(A==null?void 0:A.length)===1,slots:{transition:it},children:t.jsxs(Oe,{bgColor:We(e),textColor:((N=p==null?void 0:p.find(G=>e==null?void 0:e.name.includes(G.key)))==null?void 0:N.text)||null,onClick:()=>Ue(n),style:{cursor:"pointer"},children:[e==null?void 0:e.name,j.key===n&&!r&&(j.direction==="asc"?" 🔻":" 🔺")]},n)},n)})})}),t.jsxs(rt,{children:[A==null?void 0:A.map((e,n)=>t.jsx(ge,{style:{background:f&&f[n]?"rgb(249 218 218)":n%2===0?r?"white":"#daeef0":"white",borderStyle:f&&f[n]?"solid":"none",borderWidth:f&&f[n]?"1px":"none"},variants:ye,initial:"initial",animate:f&&f[n]?"active":"inactive",children:e==null?void 0:e.map((i,a)=>{var k;return((k=v[a])==null?void 0:k.visible)&&t.jsx(Q,{children:t.jsx(s,{container:!0,justifyContent:"center",alignItems:"center",xs:12,style:{color:K(i)?"black":"red"},children:t.jsx(s,{style:{textAlign:"center"},children:K(i)?typeof i=="string"&&!u&&i.length>30?t.jsxs(be,{title:i,placement:"top",children:[t.jsx("span",{children:i.slice(0,30)+" ... "}),t.jsx(Ee,{color:"primary",fontSize:"5px"})]}):((i==null?void 0:i.toString())==="NaN"||!i)&&i!==0?"-":i:String(i).replace("-","")+"-‌ ‌"})})},a)})},n)),B&&t.jsx(ge,{style:{background:"#2c3e50",borderStyle:"none",borderWidth:"none"},variants:ye,initial:"initial",animate:"active",children:v.filter(e=>e.visible).map((e,n)=>{const i=D(n);return t.jsx(Q,{children:t.jsx(s,{container:!0,justifyContent:"center",alignItems:"center",xs:12,style:{color:"white"},children:t.jsx(s,{style:{textAlign:"center"},children:(e==null?void 0:e.name)==="ردیف"?(A==null?void 0:A.length)+1:(e==null?void 0:e.name)===w?"مجموع":K(i)?i==null?void 0:i.toLocaleString():String(i).replace("-","")+"-‌ ‌"})})},n)})})]})]})})}),!(A!=null&&A.length)&&t.jsxs(s,{container:!0,xs:12,mt:2,mb:2,justifyContent:"center",children:[!r&&!U&&t.jsx(s,{width:"120px",alignSelf:"center",children:t.jsx(st,{animationData:St,loop:!0})}),t.jsx(s,{xs:12,justifyContent:"center",container:!0,children:t.jsx(C,{children:r?t.jsxs(t.Fragment,{children:["در حال دریافت اطلاعات ","‌‌",t.jsx(Ge,{})]}):"داده ای دریافت نشد!"})})]}),t.jsx(s,{display:{xs:"grid",sm:"none"},style:{width:"100%"},children:t.jsx(we,{columns:v,data:A,paginated:y,isDashboard:r,allColors:b,customColors:l})}),!U&&t.jsx(s,{container:!0,mt:2,children:y?t.jsxs(s,{container:!0,mb:2,justifyContent:"center",xs:12,alignItems:"center",gap:2,children:[t.jsxs(ve,{sx:{width:80},children:[t.jsx(ke,{id:"demo-controlled-open-select-label",children:"تعداد"}),t.jsxs(Se,{size:"small",labelId:"demo-controlled-open-select-label",id:"demo-controlled-open-select",open:oe,onClose:Ae,onOpen:pe,value:Y,label:"Age",onChange:Xe,children:[t.jsx(m,{value:10,children:"10"}),t.jsx(m,{value:20,children:"20"}),t.jsx(m,{value:40,children:"40"}),t.jsx(m,{value:100,children:"100"}),t.jsx(m,{value:1e3,children:"همه"})]})]}),Y!==1e3&&t.jsx(me,{count:Ye,page:re,variant:"outlined",onChange:(e,n)=>P(n)})]}):t.jsxs(s,{container:!0,mb:2,justifyContent:"center",xs:12,alignItems:"center",gap:2,children:[t.jsxs(ve,{sx:{width:80},children:[t.jsx(ke,{id:"demo-controlled-open-select-label",children:"تعداد"}),t.jsxs(Se,{size:"small",labelId:"demo-controlled-open-select-label",id:"demo-controlled-open-select",open:oe,onClose:Ae,onOpen:pe,value:H,label:"Age",onChange:e=>{W(e.target.value)},children:[t.jsx(m,{value:10,children:"10"}),t.jsx(m,{value:20,children:"20"}),t.jsx(m,{value:40,children:"40"}),t.jsx(m,{value:100,children:"100"})]})]}),t.jsx(me,{count:Math.ceil(X/H),page:z,variant:"outlined",onChange:(e,n)=>o(n)}),t.jsx(s,{container:!0,justifyContent:"center",alignItems:"center",gap:1,sx:{maxWidth:"65px"},children:t.jsx(fe,{size:"small",type:"search",variant:"standard",placeholder:"برو به...",value:q,onChange:e=>ze(e.target.value),onKeyDown:e=>{e.key==="Enter"&&parseInt(q)<=Math.ceil(X/H)&&parseInt(q)>0&&o(parseInt(q))}})})]})})]})};zt.propTypes={columns:S.arrayOf(S.string).isRequired,data:S.arrayOf(S.arrayOf(S.any)).isRequired,title:S.string.isRequired,paginated:S.bool};export{zt as R}; diff --git a/build/assets/ReturnPurchases-B5_lL37U.js b/build/assets/ReturnPurchases-B5_lL37U.js new file mode 100644 index 0000000..c940836 --- /dev/null +++ b/build/assets/ReturnPurchases-B5_lL37U.js @@ -0,0 +1 @@ +import{j as r,I as Du,b0 as Iu,d as cu,B as I,ab as wu,br as Mu,ad as _u,c3 as Nu,a4 as Pu,ak as ou,b2 as Bu,b3 as Eu,b as Uu}from"./mui-vendor-CkIVaoQP.js";import{L as Cu,j as w,h as M,A as lu,G as A,S,p as Hu,_ as nu,X as q,v as tu,W as ku}from"./index-CeyyVc1v.js";import{B as Ou}from"./BackButton-Crzr7NMa.js";import{r as o}from"./react-vendor-CmFgShSM.js";import{R as au}from"./ResponsiveTable-w7hk7Uq8.js";import{a as Tu,R as Wu}from"./index.esm-Bu7XMDZU.js";import{a as vu,u as Lu,f as qu}from"./redux-vendor-B7uoacJt.js";import{d as Yu}from"./CheckCircle-zgBvZQ-b.js";import{d as Ku}from"./Tune-D4M2CAhp.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./iconBase-BEJYyZsk.js";const Qu=vu("ACTIVATE_RETURNED_REQUEST",async(l,{dispatch:s})=>{var c,F;try{s(Cu());const{data:t,status:p}=await w.put("return-province-kill-requests/",{key:l.key,trash:!1,return_trash:!1});return s(M()),{data:t,status:p}}catch(t){return s(M()),{error:((F=(c=t.response)==null?void 0:c.data)==null?void 0:F.result)||t.message}}}),bu=vu("ACTIVATE_RETURNED_CARGO",async(l,{dispatch:s})=>{var c,F;try{s(Cu());const{data:t,status:p}=await w.put("return-kill-house-requests/0/",{key:l.key,trash:!1,return_trash:!1});return s(M()),{data:t,status:p}}catch(t){return s(M()),{error:((F=(c=t.response)==null?void 0:c.data)==null?void 0:F.result)||t.message}}}),$u=({item:l,updateTable:s,type:c="allocated"})=>{const F=Lu(),[t,p]=o.useState(null),[$,d]=o.useState(!1),[E]=o.useContext(lu),x=h=>{p(h.currentTarget)},R=()=>{p(null)},e=()=>{d(!0)},i=()=>{d(!1)},g=!!t,y=g?"popover":void 0,u=()=>{i(),F((c==="cargo"?bu:Qu)({key:l==null?void 0:l.key})).then(C=>{var a;(a=C.payload)!=null&&a.error||C.error?E({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(R(),s(),E({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})};return r.jsxs("div",{children:[r.jsx(Du,{"aria-describedby":y,variant:"contained",color:"primary",onClick:x,children:r.jsx(Ku,{})}),r.jsx(Iu,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:y,open:g,anchorEl:t,onClose:R,children:r.jsx("div",{style:{padding:"20px"},children:r.jsx(A,{container:!0,direction:"column",children:r.jsx(cu,{title:"فعال کردن",placement:"left-start",children:r.jsx(I,{"aria-label":"activate",color:"success",variant:"text",onClick:e,startIcon:r.jsx(Yu,{}),children:"فعال کردن"})})})})}),r.jsxs(wu,{open:$,onClose:i,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[r.jsx(Mu,{id:"alert-dialog-title",children:"تایید فعال سازی"}),r.jsx(_u,{children:r.jsx(Nu,{id:"alert-dialog-description",children:"آیا از فعال سازی این تخصیص بازگشتی اطمینان دارید؟"})}),r.jsx(Pu,{children:r.jsxs(A,{container:!0,gap:S.TINY,justifyContent:"center",xs:12,children:[r.jsx(I,{variant:"outlined",color:"error",onClick:i,children:"انصراف"}),r.jsx(I,{variant:"contained",color:"success",onClick:u,autoFocus:!0,children:"تایید"})]})})]})]})},zu=({data:l,page:s,perPage:c,totalRows:F,handlePageChange:t,handlePerRowsChange:p,textValue:$,updateTable:d})=>{const[E,x]=o.useState(),[,,R,,e]=o.useContext(lu),i=qu(y=>y.userSlice.userProfile.key);o.useEffect(()=>{const y=l==null?void 0:l.map((u,h)=>{var k,D,j,T,v;let C="";u.state==="pending"?C="در انتظار تایید":u.state==="accepted"?C="تایید شده":u.state==="rejected"&&(C="رد شده");let a="";u!=null&&u.market?a="پنل معاملات":u!=null&&u.directBuying?a="خرید مستقیم":u!=null&&u.warehouse?a="انبار":a="اتحادیه";const f=[s===1?h+1:h+c*(s-1)+1,(u==null?void 0:u.orderCode)||"-",a,u==null?void 0:u.poultryUnitName,`${u==null?void 0:u.poultryFullname} (${u==null?void 0:u.poultryMobile})`,u==null?void 0:u.poultryCity,Hu(u==null?void 0:u.killingDate),(k=u==null?void 0:u.poultryRequestQuantity)==null?void 0:k.toLocaleString(),nu(u==null?void 0:u.createDate),(u==null?void 0:u.killhouseUser.name)||"-",(u==null?void 0:u.killhouseUser.city)||"-",((D=u==null?void 0:u.poultryAmount)==null?void 0:D.toLocaleString())+" ﷼",((j=u==null?void 0:u.killHousePrice)==null?void 0:j.toLocaleString())+" ﷼",(T=u==null?void 0:u.quantity)==null?void 0:T.toLocaleString(),C,(u==null?void 0:u.firstCarAllocatedQuantity)>0?"دارد":"ندارد",((u==null?void 0:u.quantity)-(u==null?void 0:u.totalKilledQuantity)).toLocaleString(),(u!=null&&u.returner?`${u==null?void 0:u.returner.fullname} (${(v=u==null?void 0:u.returner)==null?void 0:v.mobile})`:"سیستم")+" "+nu(u==null?void 0:u.modifyDate)];return["AdminX","SuperAdmin"].includes(q())&&((u==null?void 0:u.returnTrash)===!0?f.push(r.jsx($u,{item:u,updateTable:d},`operation-${u==null?void 0:u.key}`)):f.push("-")),f});x(y)},[l,s,c]);const g=["ردیف","کدسفارش","نوع درخواست","نام فارم","نام مرغدار","شهر مرغدار","تاریخ کشتار","تعداد درخواست","تاریخ ثبت تخصیص","نام کشتارگاه","شهر کشتارگاه","قیمت مرغدار","قیمت کشتارگاه","تعداد تخصیص","وضعیت تایید","وضعیت تخصیص ماشین","مانده قابل تخصیص","برگشت دهنده"];return["AdminX","SuperAdmin"].includes(q())&&g.push("عملیات"),r.jsxs(A,{container:!0,justifyContent:"end",alignItems:"center",mb:S.MEDIUM,mt:S.SMALL,children:[r.jsx(A,{children:r.jsx(cu,{title:"خروجی اکسل",children:r.jsx("a",{href:`${w.defaults.baseURL}return_province_request_excel/?role=${q()}&date1=${R}&date2=${e}&search=filter&value=${$}&key=${i}`,rel:"noreferrer",children:r.jsx(I,{color:"success",children:r.jsx(Tu,{size:32})})})})}),r.jsx(au,{title:"تخصیص‌های بازگشتی",columns:g,data:E,handlePageChange:t,totalRows:F,page:s,perPage:c,handlePerRowsChange:p})]})},Gu=({data:l,page:s,perPage:c,totalRows:F,handlePageChange:t,handlePerRowsChange:p,textValue:$,updateTable:d})=>{const[E,x]=o.useState(),[,,R,,e]=o.useContext(lu),i=qu(y=>y.userSlice.userProfile.key);o.useEffect(()=>{const y=l==null?void 0:l.map((u,h)=>{var D,j,T,v,su,_,N,P,B,U,H,O,W,Y,K,Q,b,z,G,X,V,J,Z,m,uu,eu,n,L,ru,Au,Fu,pu,gu,yu,fu,du,hu,xu,Ru,ju,Su,iu;let C="";u.state==="pending"?C="در انتظار تایید":u.state==="accepted"?C="تایید شده":u.state==="rejected"&&(C="رد شده");let a="";(D=u==null?void 0:u.poultryRequest)!=null&&D.market?a="پنل معاملات":(j=u==null?void 0:u.poultryRequest)!=null&&j.directBuying?a="خرید مستقیم":u!=null&&u.warehouse?a="انبار":a="اتحادیه";let f="";(T=u==null?void 0:u.poultryRequest)!=null&&T.freezing?f="انجماد":(v=u==null?void 0:u.poultryRequest)!=null&&v.export?f="صادرات":f="عادی";const k=[s===1?h+1:h+c*(s-1)+1,(u==null?void 0:u.barCode)||"-",((su=u==null?void 0:u.poultryRequest)==null?void 0:su.orderCode)||"-",a,f,((N=(_=u==null?void 0:u.poultryRequest)==null?void 0:_.poultry)==null?void 0:N.unitName)||"-",`${((U=(B=(P=u==null?void 0:u.poultryRequest)==null?void 0:P.poultry)==null?void 0:B.user)==null?void 0:U.fullname)||"-"} (${((W=(O=(H=u==null?void 0:u.poultryRequest)==null?void 0:H.poultry)==null?void 0:O.user)==null?void 0:W.mobile)||"-"})`,((b=(Q=(K=(Y=u==null?void 0:u.poultryRequest)==null?void 0:Y.poultry)==null?void 0:K.address)==null?void 0:Q.city)==null?void 0:b.name)||"-",(z=u==null?void 0:u.killRequest)!=null&&z.reciveDate?nu((G=u==null?void 0:u.killRequest)==null?void 0:G.reciveDate):"-",(X=u==null?void 0:u.quantity)==null?void 0:X.toLocaleString(),u!=null&&u.createDate?nu(u==null?void 0:u.createDate):"-",((V=u==null?void 0:u.killhouseUser)==null?void 0:V.name)||((J=u==null?void 0:u.killer)==null?void 0:J.name)||"-",((eu=(uu=(m=(Z=u==null?void 0:u.killhouseUser)==null?void 0:Z.killHouseOperator)==null?void 0:m.user)==null?void 0:uu.city)==null?void 0:eu.name)||((Au=(ru=(L=(n=u==null?void 0:u.killer)==null?void 0:n.killHouseOperator)==null?void 0:L.user)==null?void 0:ru.city)==null?void 0:Au.name)||"-",((pu=(Fu=u==null?void 0:u.weightInfo)==null?void 0:Fu.weight)==null?void 0:pu.toLocaleString())||"-",((yu=(gu=u==null?void 0:u.weightInfo)==null?void 0:gu.indexWeight)==null?void 0:yu.toLocaleString())||"-",(fu=u==null?void 0:u.acceptedRealQuantity)==null?void 0:fu.toLocaleString(),(du=u==null?void 0:u.acceptedRealWeight)==null?void 0:du.toLocaleString(),((xu=(hu=u==null?void 0:u.poultryRequest)==null?void 0:hu.amount)==null?void 0:xu.toLocaleString())+" ﷼"||"-",((ju=(Ru=u==null?void 0:u.weightInfo)==null?void 0:Ru.killHousePrice)==null?void 0:ju.toLocaleString())+" ﷼"||"-",C,((Su=u==null?void 0:u.car)==null?void 0:Su.pelak)||"-",((iu=u==null?void 0:u.car)==null?void 0:iu.driverName)||"-",u!=null&&u.nonReceipt?"دارد":"ندارد",(u==null?void 0:u.nonReceiptMessage)||"-",(u!=null&&u.nonReceipt&&(u!=null&&u.mainNonReceipt)?"کاربر":"سیستم")+" "+nu(u==null?void 0:u.modifyDate)];return["AdminX","SuperAdmin"].includes(q())&&((u==null?void 0:u.returnTrash)===!0?k.push(r.jsx($u,{item:u,updateTable:d,type:"cargo"},`operation-${u==null?void 0:u.key}`)):k.push("-")),k});x(y)},[l,s,c]);const g=["ردیف","کد بار","کدسفارش","نوع درخواست","نوع کشتار","نام فارم","نام مرغدار","شهر مرغدار","تاریخ درخواست کشتار","تعداد بار","تاریخ ثبت بار","نام کشتارگاه","شهر کشتارگاه","وزن","میانگین وزنی","تعداد نهایی","وزن نهایی","قیمت مرغدار","قیمت کشتارگاه","وضعیت تایید","پلاک خودرو","نام راننده","عدم دریافت","پیام عدم دریافت","نوع برگشت"];return["AdminX","SuperAdmin"].includes(q())&&g.push("عملیات"),r.jsxs(A,{container:!0,alignItems:"center",justifyContent:"end",children:[r.jsx(A,{children:r.jsx(cu,{title:"خروجی اکسل",children:r.jsx("a",{href:`${w.defaults.baseURL}return_kill_house_request_excel/?role=${q()}&date1=${R}&date2=${e}&search=filter&value=${$}&key=${i}`,rel:"noreferrer",children:r.jsx(I,{color:"success",children:r.jsx(Tu,{size:32})})})})}),r.jsx(au,{title:"بارهای بازگشتی",columns:g,data:E,handlePageChange:t,totalRows:F,page:s,perPage:c,handlePerRowsChange:p})]})},Xu=()=>{var N,P,B,U,H,O,W,Y,K,Q,b,z,G,X,V,J,Z,m,uu,eu;const l=Lu(),[s,c]=o.useState(0),[F,t]=o.useState([]),[p,$]=o.useState(0),[d,E]=o.useState(10),[x,R]=o.useState(1),[e,i]=o.useState({}),[,,g,y,u,h]=o.useContext(lu),[C,a]=o.useState("");o.useEffect(()=>{const n=tu(new Date).format("YYYY-MM-DD");y(n),h(n)},[]);const f=async()=>{try{const n=await w.get(`return-requests-dashboard/?role=${q()}&date1=${g}&date2=${u}`);i(n.data)}catch(n){console.error("Error fetching dashboard data:",n)}},k=n=>{a(n.target.value)},D=(n,L)=>{c(L),R(1)},j=async n=>{l(Cu());try{const L=s===0?"return-province-kill-requests":"return-kill-house-requests",ru=await w.get(`${L}/?role=${q()}&date1=${g}&date2=${u}&search=filter&value=${C}&page_size=${d}&page=${n}`);t(ru.data.results),$(ru.data.count),l(M())}catch(L){console.error("Error fetching data:",L),l(M())}},T=n=>{j(n),R(n)},v=n=>{E(n),R(1)};o.useEffect(()=>{j(1),f()},[g,u,d,s]);const su=()=>{j(x),f()},_=()=>{j(x),f()};return r.jsxs(A,{children:[r.jsxs(A,{container:!0,justifyContent:"center",alignItems:"center",gap:S.SMALL,children:[r.jsx(A,{style:{width:160},children:r.jsx(ku,{label:"از تاریخ",renderInput:n=>r.jsx(ou,{...n}),value:g,onChange:n=>{y(tu(n).format("YYYY-MM-DD"))}})}),r.jsx(A,{style:{width:160},children:r.jsx(ku,{label:"تا تاریخ",renderInput:n=>r.jsx(ou,{...n}),value:u,onChange:n=>{h(tu(n).format("YYYY-MM-DD"))}})}),r.jsxs(A,{container:!0,alignItems:"center",gap:S.SMALL,children:[r.jsx(ou,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:k}),r.jsx(I,{type:"submit",onClick:su,endIcon:r.jsx(Wu,{}),children:"جستجو"})]})]}),r.jsx(A,{mb:S.MEDIUM,mt:S.MEDIUM,children:r.jsx(au,{noPagination:!0,isDashboard:!0,columns:["تعداد کل تخصیصات","تعداد تخصیصات بازگشتی کاربر","تعداد تخصیصات بازگشتی سیستم","حجم کل تخصیصات","حجم تخصیصات بازگشتی کاربر","حجم تخصیصات بازگشتی سیستم","وزن کل تخصیصات","وزن بازگشتی کاربر","وزن بازگشتی سیستم","تعداد کل بارها","تعداد بارهای عدم وصول","تعداد بارهای بازگشتی سیستمی ","حجم کل بارها","حجم بارهای عدم وصول","حجم بارهای بازگشتی سیستمی ","وزن کل بارها","وزن بارهای عدم وصول","وزن بارهای بازگشتی سیستمی ","وزن خریدهای بازگشتی با کارمزد","کارمزد خریدهای بازگشتی"],data:[[((N=e==null?void 0:e.provinceKillRequestTotalCount)==null?void 0:N.toLocaleString())||"0",((P=e==null?void 0:e.provinceKillRequestTotalOperatorReturnCount)==null?void 0:P.toLocaleString())||"0",((B=e==null?void 0:e.provinceKillRequestTotalSystemReturnCount)==null?void 0:B.toLocaleString())||"0",((U=e==null?void 0:e.provinceKillRequestTotalQuantity)==null?void 0:U.toLocaleString())||"0",((H=e==null?void 0:e.provinceKillRequestTotalOperatorReturnQuantity)==null?void 0:H.toLocaleString())||"0",((O=e==null?void 0:e.provinceKillRequestTotalSystemReturnQuantity)==null?void 0:O.toLocaleString())||"0",((W=e==null?void 0:e.provinceKillRequestTotalWeight)==null?void 0:W.toLocaleString())||"0",((Y=e==null?void 0:e.provinceKillRequestTotalOperatorReturnWeight)==null?void 0:Y.toLocaleString())||"0",((K=e==null?void 0:e.provinceKillRequestTotalSystemReturnWeight)==null?void 0:K.toLocaleString())||"0",((Q=e==null?void 0:e.killHouseRequestTotalCount)==null?void 0:Q.toLocaleString())||"0",((b=e==null?void 0:e.killHouseRequestTotalNonReceiptCount)==null?void 0:b.toLocaleString())||"0",((z=e==null?void 0:e.killHouseRequestTotalSystemReturnCount)==null?void 0:z.toLocaleString())||"0",((G=e==null?void 0:e.killHouseRequestTotalQuantity)==null?void 0:G.toLocaleString())||"0",((X=e==null?void 0:e.killHouseRequestTotalNonReceiptQuantity)==null?void 0:X.toLocaleString())||"0",((V=e==null?void 0:e.killHouseRequestTotalSystemReturnQuantity)==null?void 0:V.toLocaleString())||"0",((J=e==null?void 0:e.killHouseRequestTotalWeight)==null?void 0:J.toLocaleString())||"0",((Z=e==null?void 0:e.killHouseRequestTotalNonReceiptWeight)==null?void 0:Z.toLocaleString())||"0",((m=e==null?void 0:e.killHouseRequestTotalSystemReturnWeight)==null?void 0:m.toLocaleString())||"0",((uu=e==null?void 0:e.totalReturnWeightWithWage)==null?void 0:uu.toLocaleString())||"0",((eu=e==null?void 0:e.totalReturnWage)==null?void 0:eu.toLocaleString())||"0"]],title:"خلاصه اطلاعات"})}),r.jsx(A,{container:!0,justifyContent:"center",alignItems:"center",mb:S.SMALL,mt:S.LARGE,children:r.jsxs(Bu,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:s,onChange:D,children:[r.jsx(Eu,{label:"تخصیص‌های بازگشتی"}),r.jsx(Eu,{label:"بارهای بازگشتی"})]})}),s===0&&r.jsx(zu,{data:F,page:x,perPage:d,totalRows:p,handlePageChange:T,handlePerRowsChange:v,textValue:C,updateTable:_}),s===1&&r.jsx(Gu,{data:F,page:x,perPage:d,totalRows:p,handlePageChange:T,handlePerRowsChange:v,textValue:C,updateTable:_})]})},c6=()=>r.jsx(r.Fragment,{children:r.jsx(Uu,{display:"flex",justifyContent:"center",children:r.jsxs(A,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[r.jsx(Ou,{}),r.jsx(A,{container:!0,justifyContent:"space-between",gap:S.SMALL,children:r.jsx(A,{xs:12,children:r.jsx(Xu,{})})})]})})});export{c6 as default}; diff --git a/build/assets/Save-nlxmeU5w.js b/build/assets/Save-nlxmeU5w.js new file mode 100644 index 0000000..58a651c --- /dev/null +++ b/build/assets/Save-nlxmeU5w.js @@ -0,0 +1 @@ +import{i as r,j as a}from"./mui-vendor-CkIVaoQP.js";import{r as t}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(t()),v=a;u=e.default=(0,i.default)((0,v.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"}),"Save");export{u as d}; diff --git a/build/assets/Search-Dek2fED1.js b/build/assets/Search-Dek2fED1.js new file mode 100644 index 0000000..5419db2 --- /dev/null +++ b/build/assets/Search-Dek2fED1.js @@ -0,0 +1 @@ +import{i as r,j as a}from"./mui-vendor-CkIVaoQP.js";import{r as t}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(t()),l=a;u=e.default=(0,i.default)((0,l.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search");export{e as S,u as d}; diff --git a/build/assets/SelectCheck-CAe89SYT.js b/build/assets/SelectCheck-CAe89SYT.js new file mode 100644 index 0000000..f2f4cfd --- /dev/null +++ b/build/assets/SelectCheck-CAe89SYT.js @@ -0,0 +1 @@ +import{j as n,ag as d,av as j,aw as v,ax as I,aq as E,bj as C,p as l}from"./mui-vendor-CkIVaoQP.js";import{r as c}from"./react-vendor-CmFgShSM.js";const L=48,M=8,k={PaperProps:{style:{maxHeight:L*4.5+M,width:280}}},O=({label:o,id:y,options:r,error:i,onBlur:g,onChange:m,size:b,value:S,width:t,defaultValue:s})=>{s=s||[];const[a,x]=c.useState(s);t=t||280;const h=e=>{const{target:{value:p}}=e;x(typeof p=="string"?p.split(","):p)};c.useEffect(()=>{m(a)},[a]),c.useEffect(()=>{s!=null&&s.length&&x(a)},[s]);const T=r==null?void 0:r.map(e=>e.value),u=r==null?void 0:r.map(e=>e.label);return n.jsx("div",{children:n.jsxs(d,{sx:{width:t},size:b,children:[n.jsx(j,{id:"demo-multiple-checkbox-label",children:o}),n.jsx(v,{labelId:"demo-multiple-checkbox-label",id:y,multiple:!0,value:a,onChange:h,input:n.jsx(C,{label:o}),renderValue:e=>(e==null?void 0:e.map(P=>u[T.indexOf(P)])).join(", "),MenuProps:k,error:i,onBlur:g,children:r==null?void 0:r.map(e=>n.jsx(I,{value:e.value,style:{display:"flex",padding:0},children:n.jsx(E,{style:{backgroundColor:(a==null?void 0:a.indexOf(e.value))>-1?"lightgray":"initial",padding:8},primary:e.label})},e.label))})]})})};O.propTypes={label:l.PropTypes.string,id:l.PropTypes.string,options:l.PropTypes.array,error:l.PropTypes.any,onBlur:l.PropTypes.any,onChange:l.PropTypes.any,size:l.PropTypes.any};export{O as S}; diff --git a/build/assets/Send-CA1iNvJP.js b/build/assets/Send-CA1iNvJP.js new file mode 100644 index 0000000..a9e2be6 --- /dev/null +++ b/build/assets/Send-CA1iNvJP.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(a()),d=t;u=e.default=(0,i.default)((0,d.jsx)("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"}),"Send");export{u as d}; diff --git a/build/assets/SendMassage-DcwNiFfb.js b/build/assets/SendMassage-DcwNiFfb.js new file mode 100644 index 0000000..97515f6 --- /dev/null +++ b/build/assets/SendMassage-DcwNiFfb.js @@ -0,0 +1 @@ +import{j as u,T as b,ak as N,d as Y,B as T,bf as te,ai as O,aX as M,bg as re,a3 as F,ag as Q,av as Z,aw as uu,ax as m,ah as ne,aj as Su,I as K,b0 as Au,b5 as Wu,am as se,an as ae,b4 as Ru,ap as bu,aq as Fu,b as vu,s as $u,ar as oe,a9 as le}from"./mui-vendor-CkIVaoQP.js";import{L as S,j as E,h as v,A as U,V as mu,c as tu,M as q,cs as ie,u as ru,G as h,S as P,ct as ce,C as eu,b as au,O as J,X as _,N as Xu,p as Ce,cu as de,cv as he,cw as pe,cx as Tu,cy as Pu,cz as cu,cA as Ou,cB as Nu,cC as Cu,cD as xe,cE as ge,cF as Iu,cG as wu,cH as ku,cI as du,cJ as Mu,cK as Du,cL as hu,cM as pu,cN as Bu,cO as xu,cP as Uu,cQ as gu,cR as zu,cS as Vu}from"./index-CeyyVc1v.js";import{L as X}from"./LinkItem-DT6qswcs.js";import{r as C,f as ve,k as H}from"./react-vendor-CmFgShSM.js";import{S as Lu}from"./SelectCheck-CAe89SYT.js";import{a as R,u as z,f as Ae}from"./redux-vendor-B7uoacJt.js";import{d as me}from"./Add--yVWBJhC.js";import{d as je}from"./Refresh-DkAX1rkD.js";import{a as Ee,R as Hu}from"./index.esm-Bu7XMDZU.js";import{A as fe}from"./AdvancedTable-BYmmBtmq.js";import{e as Gu,f as lu,g as _e,h as ye}from"./index.esm-BY9chGNa.js";import{B as Se}from"./BackButton-Crzr7NMa.js";import{a as Re}from"./get-announcement-5NHhejXl.js";import{g as be}from"./getRoleList-CoZzcy9u.js";import{P as Yu}from"./PageTable-C16Ol94B.js";import{d as ju}from"./Tune-D4M2CAhp.js";import{d as Fe}from"./PublishedWithChanges-C8kvr_m4.js";import{d as Ku}from"./Edit-CqBj1Y2L.js";import{d as Ju}from"./Delete-C5MyLelE.js";import{R as Te}from"./ResponsiveTable-w7hk7Uq8.js";import"./iconBase-BEJYyZsk.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./FilterAlt-scT0HEUg.js";const Pe=["Admin","CityOperator","Poultry","ProvinceOperator","ProvinceFinancial","KillHouse","KillHouseVet","VetFarm","Driver","ProvinceInspector","VetSupervisor","Jahad","ProvincialGovernment"],Oe=R("PROVINCE_GET_USERS_BY_ROLES_SERVICE",async(e,{dispatch:t})=>{try{t(S());const{data:r,status:s}=await E.get("diageram",{params:e});return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data}}}),Ne=R("PROVINCE_SEND_SMS_SERVICE",async(e,{dispatch:t})=>{try{t(S());const{data:r,status:s}=await E.post("sms/",e);return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data}}});function Ie(){const e=z(),[t]=C.useContext(U),[r,s]=C.useState([]),[i,n]=C.useState([]),[a,x]=C.useState([]);C.useEffect(()=>{if(r.length){const g=r.map(k=>({label:k.fullname,value:k.key}));n(g)}},[r]);const[d]=C.useState(Pe.map((g,k)=>({label:mu(g),value:g}))),l=tu().shape({selectedRoles:ie().required("لطفا نقش را انتخاب کنید"),inputText:q().required("لطفا متن پیامک را وارد کنید")}),o=ru({initialValues:{selectedRoles:[],inputText:""},validationSchema:l,onSubmit:()=>{e(Ne({user:a,message:o.values.inputText,role:o.values.selectedRoles})).then(g=>{g.payload.status===200&&t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})}});C.useEffect(()=>{o.validateForm()},[]);const y=g=>{const k=/[آ-ی]/.test(g);let I=0;return k?I=A(g)*980:I=A(g)*1320,o.values.selectedRoles.length?a.length>0?I*a.length+" ریال":I*i.length+" ریال":"نامشخص (پیامک برای کل کاربران ارسال میشود) "},A=g=>{const k=[160,146,153,153],I=[70,64,67,67],L=/[آ-ی]/.test(g)?I:k;let W=g.length,G=0;for(;W>0;){const j=L[G]||L[L.length-1];if(W>=j)W-=j,G++;else{G++;break}}return G};return C.useEffect(()=>{o.values.selectedRoles.length&&e(Oe({role:o.values.selectedRoles.join(",")})).then(g=>s(g.payload.data))},[o.values.selectedRoles]),u.jsxs(h,{container:!0,mx:P.SMALL,justifyContent:"space-between",children:[u.jsx(h,{item:!0,xs:12,sm:12,md:4,lg:3,direction:"column",alignItems:"start",gap:P.SMALL,children:u.jsx(h,{children:u.jsxs("form",{style:{display:"flex",alignItems:"start",flexDirection:"column",gap:P.LARGE},onSubmit:o.handleSubmit,children:[u.jsxs(h,{children:[u.jsx(Lu,{name:"selectedOption",label:"انتخاب نقش",onChange:g=>o.setFieldValue("selectedRoles",g),options:d}),o.errors.selectedOption&&u.jsx(b,{variant:"caption",color:g=>g.palette.grey.A700,children:o.errors.selectedOption})]}),!!i.length&&u.jsxs(h,{container:!0,direction:"column",alignItems:"start",children:[u.jsx(h,{children:u.jsx(Lu,{name:"slaughterHousesListForSelect",label:"انتخاب کاربر",onChange:g=>x(g),options:i})}),u.jsxs(h,{container:!0,gap:P.TINY,mt:P.SMALL,children:[u.jsx(h,{item:!0,children:u.jsx(b,{variant:"button",color:"red",children:"تعداد کاربر انتخابی:"})}),u.jsx(h,{item:!0,mb:P.SMALL,children:u.jsx(b,{variant:"caption",color:g=>g.palette.grey.A700,children:a.length>0?a.length:"همه"})})]})]}),u.jsx(h,{container:!0,children:u.jsxs(h,{container:!0,direction:"column",alignItems:"start",children:[u.jsx(h,{children:u.jsx(N,{style:{width:"280px"},id:"inputText",name:"inputText",label:"متن پیامک را وارد کنید",multiline:!0,rows:10,value:o.values.inputText,onChange:o.handleChange})}),o.errors.inputText&&u.jsx(b,{mt:P.TINY,variant:"caption",color:g=>g.palette.grey.A700,children:o.errors.inputText}),u.jsxs(h,{container:!0,direction:"row",alignItems:"start",gap:P.LARGE,children:[u.jsxs(h,{container:!0,gap:P.TINY,children:[u.jsx(h,{item:!0,children:u.jsx(b,{variant:"button",color:"red",children:"تعداد کاراکتر:"})}),u.jsx(h,{item:!0,mb:P.SMALL,children:u.jsx(b,{variant:"caption",color:g=>g.palette.grey.A700,children:o.values.inputText.length})})]}),u.jsxs(h,{container:!0,gap:P.TINY,children:[u.jsx(h,{item:!0,children:u.jsx(b,{variant:"button",color:"red",children:"تعداد پیامک:"})}),u.jsx(h,{item:!0,mb:P.SMALL,children:u.jsx(b,{variant:"caption",color:g=>g.palette.grey.A700,children:A(o.values.inputText)})})]})]}),u.jsx(h,{children:u.jsx(Y,{title:"در صورتی که کاربری انتخاب نکنید پیغام برای همه کاربران نقش ارسال میشود",placement:"left",children:u.jsx(T,{disabled:!o.isValid,variant:"contained",type:"submit",children:"ارسال پیامک"})})})]})})]})})}),u.jsxs(h,{item:!0,container:!0,direction:"column",alignItems:"start",gap:P.SMALL,xs:12,sm:12,md:7,lg:8,children:[u.jsxs(h,{container:!0,xs:12,sm:12,md:12,lg:12,gap:"20px",alignItems:"center",justifyContent:"start",children:[u.jsxs(h,{children:[u.jsx(b,{sx:{marginRight:"5px"},variant:"v2",color:"green",children:"مانده حساب:"}),u.jsx(b,{variant:"caption",color:g=>g.palette.grey.A700,children:"230,000 ریال"})]}),u.jsxs(h,{children:[u.jsx(b,{sx:{marginRight:"5px"},variant:"v2",color:"red",children:"محاسبه تقریبی هزینه پیام:"}),u.jsxs(b,{variant:"caption",color:g=>g.palette.grey.A700,children:[y(o.values.inputText).toLocaleString()," "]})]}),u.jsxs(h,{xs:12,sm:12,md:12,container:!0,justifyContent:"space-between",children:[u.jsxs(h,{container:!0,justifyContent:"start",gap:P.TINY,children:[u.jsx(T,{component:"a",href:"http://sahandsms.com/OnlineCharge/OnlineCharge.aspx",target:"_blank",startIcon:u.jsx(me,{}),variant:"contained",size:"small",type:"submit",children:"شارژ کیف پول"}),u.jsx(T,{component:"a",href:"http://sahandsms.com/OnlineCharge/OnlineCharge.aspx",startIcon:u.jsx(Ee,{}),variant:"contained",size:"small",type:"submit",color:"success",children:"خروجی اکسل"})]}),u.jsx(h,{children:u.jsx(T,{startIcon:u.jsx(je,{}),variant:"contained",size:"small",type:"submit",color:"success",children:"بروزرسانی پیام ها"})})]})]}),u.jsx(fe,{name:"پیام های ارسال شده",columns:["نقش","نام و نام خانوادگی","تلفن","متن پیام","تاریخ ارسال","وضعیت"]})]})]})}const we=R("PROVINCE_SMS_LINCENSE_SERVICE",async(e,{dispatch:t})=>{try{t(S());const{data:r,status:s}=await E.post("sms_license/",e);return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data}}});function ke(){const[e]=C.useContext(U),[t,r]=C.useState({hatching:!1,poultry_request:!1,city_approval:!1,province_approval:!1,kill_request:!1,province_kill_request:!1,farm_veterinarian_approval:!1,kill_house_house_veterinarian_approval:!1,assingment_information:!1,confirmation_of_assingment_information:!1,invoice_payment:!1,invoice_payment_confirmation:!1,inspector_approval:!1,kill_house_request:!1}),s=z(),i=x=>{r({...t,[x.target.name]:x.target.checked})},{provinceGetSmsLincense:n}=Ae(x=>x.provinceSlice);C.useEffect(()=>{s(ce())},[]),C.useEffect(()=>{var x,d,l,c,o,y,A,g,k,I,$,L,W,G;n!=null&&n.length&&r({hatching:(x=n[0])==null?void 0:x.hatching,poultry_request:(d=n[0])==null?void 0:d.poultryRequest,city_approval:(l=n[0])==null?void 0:l.cityApproval,province_approval:(c=n[0])==null?void 0:c.provinceApproval,kill_request:(o=n[0])==null?void 0:o.killRequest,province_kill_request:(y=n[0])==null?void 0:y.provinceKillRequest,farm_veterinarian_approval:(A=n[0])==null?void 0:A.farmVeterinarianApproval,kill_house_house_veterinarian_approval:(g=n[0])==null?void 0:g.killHouseHouseVeterinarianApproval,assingment_information:(k=n[0])==null?void 0:k.assingmentInformation,confirmation_of_assingment_information:(I=n[0])==null?void 0:I.confirmationOfAssingmentInformation,invoice_payment:($=n[0])==null?void 0:$.invoicePayment,invoice_payment_confirmation:(L=n[0])==null?void 0:L.invoicePaymentConfirmation,inspector_approval:(W=n[0])==null?void 0:W.inspectorApproval,kill_house_request:(G=n[0])==null?void 0:G.killHouseRequest})},[n]);const a=x=>{x.preventDefault(),s(we(t)).then(d=>{e({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})};return u.jsxs(h,{container:!0,direction:"column",alignItems:"start",gap:P.SMALL,children:[u.jsx(h,{children:u.jsx(b,{children:"با تغییر دادن این سطوح، می‌توانید تنظیم کنید که کاربران شما پیامک‌های خودکار را در چه زمان‌هایی دریافت کنند."})}),u.jsx(h,{children:u.jsx("form",{onSubmit:a,children:u.jsxs(te,{children:[u.jsx(O,{control:u.jsx(M,{checked:t.hatching,onChange:i,name:"hatching"}),label:"جوجه ریزی مرغدار"}),u.jsx(O,{control:u.jsx(M,{checked:t.poultry_request,onChange:i,name:"poultry_request"}),label:"درخواست کشتار مرغدار"}),u.jsx(O,{control:u.jsx(M,{checked:t.city_approval,onChange:i,name:"city_approval"}),label:"تاییدیه شهرستان"}),u.jsx(O,{control:u.jsx(M,{checked:t.province_approval,onChange:i,name:"province_approval"}),label:"تاییدیه استان"}),u.jsx(O,{control:u.jsx(M,{checked:t.kill_request,onChange:i,name:"kill_request"}),label:"درخواست کشتار کشتارگاه"}),u.jsx(O,{control:u.jsx(M,{checked:t.province_kill_request,onChange:i,name:"province_kill_request"}),label:"تخصیص استان"}),u.jsx(O,{control:u.jsx(M,{checked:t.farm_veterinarian_approval,onChange:i,name:"farm_veterinarian_approval"}),label:"تاییدیه دامپزشک فارم"}),u.jsx(O,{control:u.jsx(M,{checked:t.kill_house_request,onChange:i,name:"kill_house_request"}),label:"تخصیص کشتارگاه"}),u.jsx(O,{control:u.jsx(M,{checked:t.kill_house_house_veterinarian_approval,onChange:i,name:"kill_house_house_veterinarian_approval"}),label:"تاییدیه دامپزشک"}),u.jsx(O,{control:u.jsx(M,{checked:t.assingment_information,onChange:i,name:"assingment_information"}),label:"ورود اطلاعات بار"}),u.jsx(O,{control:u.jsx(M,{checked:t.confirmation_of_assingment_information,onChange:i,name:"confirmation_of_assingment_information"}),label:"تاییدیه اطلاعات بار/صدور فاکتور"}),u.jsx(O,{control:u.jsx(M,{checked:t.invoice_payment,onChange:i,name:"invoice_payment"}),label:"پرداخت فاکتور"}),u.jsx(O,{control:u.jsx(M,{checked:t.invoice_payment_confirmation,onChange:i,name:"invoice_payment_confirmation"}),label:"تاییدیه پرداخت فاکتور"}),u.jsx(O,{control:u.jsx(M,{checked:t.inspector_approval,onChange:i,name:"inspector_approval"}),label:"تاییدیه بازرس"}),u.jsx(h,{children:u.jsx(T,{type:"submit",variant:"contained",children:"ثبت"})})]})})})]})}const Me=R("PROVINCE_SMS_ANNOUNCEMENT",async(e,{dispatch:t})=>{t(S());const{data:r,status:s}=await E.put("announcements/0/",e);return t(v()),{data:r,status:s}}),De=()=>{const[e]=C.useContext(U),[t,r]=C.useState(0),[s,i]=C.useState([]),n=o=>{r(o.target.value)},a=z();C.useEffect(()=>{a(Re()).then(o=>{var y,A;i(o.payload.data),c.setFieldValue("status",((y=o.payload.data[0])==null?void 0:y.active)===!0?"true":"false"),c.setFieldValue("announcement",(A=o.payload.data[0])==null?void 0:A.description)})},[]);const x={status:"",announcement:""},d=tu().shape({status:q().required("لطفا وضعیت را انتخاب کنید"),announcement:q().when("status",{is:"true",then:q().required("لطفا متن اعلان را وارد کنید!")})});C.useEffect(()=>{s.length&&(c.setFieldValue("status",s[t].active===!0?"true":"false"),s[t].description?c.setFieldValue("announcement",s[t].description):c.setFieldValue("announcement",""))},[t]);const c=ru({initialValues:x,validationSchema:d,onSubmit:o=>{a(Me({active:o.status==="true",description:o.announcement,key:s[t].key})).then(y=>{y.error?e({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):e({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})}});return u.jsx(re,{maxWidth:"md",children:u.jsx("div",{style:{backgroundColor:"#ffffff",padding:"20px",borderRadius:"4px",boxShadow:"0px 4px 10px rgba(0, 0, 0, 0.1)",transition:"box-shadow 0.3s ease",":hover":{boxShadow:"0px 8px 20px rgba(0, 0, 0, 0.2)"}},children:u.jsx("form",{onSubmit:c.handleSubmit,children:u.jsxs(F,{container:!0,spacing:3,children:[u.jsx(F,{container:!0,item:!0,xs:12,alignItems:"center",children:u.jsx(F,{item:!0,xs:12,sm:6,children:u.jsxs(Q,{children:[u.jsx(Z,{id:"demo-simple-select-label",children:"مقصد"}),u.jsxs(uu,{labelId:"demo-simple-select-label",id:"demo-simple-select",value:t,label:"مقصد",onChange:n,size:"small",children:[u.jsx(m,{value:0,children:"کشتارگاه"}),u.jsx(m,{value:1,children:"شهرستان"})]})]})})}),u.jsx(F,{item:!0,xs:12,children:u.jsxs(ne,{row:!0,"aria-label":"status",name:"status",value:c.values.status,onChange:c.handleChange,children:[u.jsx(O,{value:"true",control:u.jsx(Su,{}),label:"فعال"}),u.jsx(O,{value:"false",control:u.jsx(Su,{}),label:"غیر فعال"})]})}),c.values.status==="true"&&u.jsx(F,{item:!0,xs:12,children:u.jsx(N,{id:"announcement",name:"announcement",label:"متن اعلان",multiline:!0,rows:4,fullWidth:!0,variant:"outlined",value:c.values.announcement,onChange:c.handleChange,error:c.touched.announcement&&!!c.errors.announcement,helperText:c.touched.announcement&&c.errors.announcement})}),u.jsx(F,{item:!0,xs:12,children:u.jsx(T,{type:"submit",variant:"contained",color:"primary",style:{marginTop:"16px"},children:"ثبت"})})]})})})})},Be=R("PROVINCE_SEND_REPORT_GET_TIMES",async(e,{dispatch:t})=>{t(S());const{data:r,status:s}=await E.get("report-submission/");return t(v()),{data:r,status:s}});R("PROVINCE_SEND_REPORT_GET_POSITIONS",async(e,{dispatch:t})=>{t(S());const{data:r,status:s}=await E.get("user-position/");return t(v()),{data:r,status:s}});const Ue=R("PROVINCE_UPDATE_SEND_TIME",async(e,{dispatch:t})=>{try{t(S());const{data:r,status:s}=await E.put("report-submission/0/",e);return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data.result}}}),qu=R("PROVINCE_UPDATE_REPORT_STATUS",async(e,{dispatch:t})=>{try{t(S());const{data:r,status:s}=await E.put("user-reports/0/",e);return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data.result}}}),ze=R("PROVINCE_UPDATE_SUBMIT_REPORT",async(e,{dispatch:t})=>{try{t(S());const{data:r,status:s}=await E.post("user-reports/",e);return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data.result}}}),Ve=R("PROVINCE_SEND_REPORT_GET_REPORTS",async(e,{dispatch:t})=>{t(S());const{data:r,status:s}=await E.get("reports/");return t(v()),{data:r,status:s}}),Le=({fetchApiData:e})=>{const[t]=C.useContext(U),r=z(),[s,i]=C.useState(12),[n,a]=C.useState("روزانه");C.useEffect(()=>{r(Be()).then(l=>{var c,o,y,A;i((o=(c=l.payload)==null?void 0:c.data)==null?void 0:o.hour),a((A=(y=l==null?void 0:l.payload)==null?void 0:y.data)==null?void 0:A.type)})},[]);const x=l=>{i(l.target.value)},d=l=>{a(l.target.value)};return u.jsxs(h,{xs:12,container:!0,gap:2,children:[u.jsxs(Q,{fullWidth:!0,children:[u.jsx(Z,{id:"demo-simple-select-label",children:"ارسال"}),u.jsxs(uu,{labelId:"demo-simple-select-label",label:"ارسال",value:n,onChange:d,children:[u.jsx(m,{value:"روزانه",children:"روزانه"}),u.jsx(m,{value:"یک روز در میان",children:"یک روز در میان"})]})]}),u.jsxs(Q,{fullWidth:!0,children:[u.jsx(Z,{id:"demo-simple-select-label",children:"ساعت"}),u.jsxs(uu,{labelId:"demo-simple-select-label",label:"ساعت",value:s,onChange:x,children:[u.jsx(m,{value:1,children:"1"}),u.jsx(m,{value:2,children:"2"}),u.jsx(m,{value:3,children:"3"}),u.jsx(m,{value:4,children:"4"}),u.jsx(m,{value:5,children:"5"}),u.jsx(m,{value:6,children:"6"}),u.jsx(m,{value:7,children:"7"}),u.jsx(m,{value:8,children:"8"}),u.jsx(m,{value:9,children:"9"}),u.jsx(m,{value:10,children:"10"}),u.jsx(m,{value:11,children:"11"}),u.jsx(m,{value:12,children:"12"}),u.jsx(m,{value:13,children:"13"}),u.jsx(m,{value:14,children:"14"}),u.jsx(m,{value:15,children:"15"}),u.jsx(m,{value:16,children:"16"}),u.jsx(m,{value:17,children:"17"}),u.jsx(m,{value:18,children:"18"}),u.jsx(m,{value:19,children:"19"}),u.jsx(m,{value:20,children:"20"}),u.jsx(m,{value:21,children:"21"}),u.jsx(m,{value:22,children:"22"}),u.jsx(m,{value:23,children:"23"}),u.jsx(m,{value:24,children:"24"})]})]}),u.jsx(T,{variant:"contained",fullWidth:!0,onClick:()=>{r(Ue({type:n,hour:s})).then(l=>{l.payload.error?t({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),e(1),r(eu()))})},children:"ثبت"})]})},Ge=({fetchApiData:e})=>{const[t,r]=C.useState([]),[s,i]=C.useState(),[n]=C.useContext(U),a=z(),x=d=>{const{target:{value:l}}=d;r(typeof l=="string"?l.split(","):l)};return C.useEffect(()=>{a(Ve()).then(d=>{i(d.payload.data)})},[a]),u.jsxs(h,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(Q,{fullWidth:!0,children:[u.jsx(Z,{id:"demo-simple-select-label",children:"گزارش"}),u.jsx(uu,{labelId:"demo-simple-select-label",label:"گزارش",value:t,onChange:x,multiple:!0,children:s==null?void 0:s.map((d,l)=>u.jsx(m,{value:d==null?void 0:d.key,children:d==null?void 0:d.title},l))})]}),u.jsx(T,{variant:"contained",fullWidth:!0,disabled:!(t!=null&&t.length),onClick:()=>{a(ze({reports_list:t})).then(d=>{d.payload.error?n({vertical:"top",horizontal:"center",msg:d.payload.error,severity:"error"}):(n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),e(1),a(eu()))})},children:"ثبت"})]})},qe=R("PROVINCE_SEND_REPORT_NEW_USER",async(e,{dispatch:t})=>{try{t(S());const{data:r,status:s}=await E.post("reports-users/",e);return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data.result}}}),Qu=R("PROVINCE_SEND_REPORT_EDIT_USER",async(e,{dispatch:t})=>{try{t(S());const{data:r,status:s}=await E.put("reports-users/0/",e);return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data.result}}}),We=R("PROVINCE_DELETE_USER_REPORT",async(e,{dispatch:t})=>{try{t(S());const{data:r,status:s}=await E.delete("reports-users/"+e+"/");return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data.result}}}),Zu=({fetchApiData:e,isEdit:t,item:r})=>{var d;const s=z(),[i]=C.useContext(U),n=tu({firstname:q().required("این فیلد اجباری است"),lastname:q().required("این فیلد اجباری است"),mobile:au().required("این فیلد اجباری است!").typeError("لطفا اعداد انگلیسی وارد کنید!").test("len","شماره تلفن باید 11 رقم باشد!",(l,c)=>c.originalValue&&c.originalValue.length===11),post:q().required("این فیلد اجباری است"),city:q().required("این فیلد اجباری است")}),a=ru({initialValues:{firstname:r!=null&&r.firstname?r==null?void 0:r.firstname:"",lastname:r!=null&&r.lastname?r==null?void 0:r.lastname:"",mobile:r!=null&&r.mobile?r==null?void 0:r.mobile:"",post:r!=null&&r.position?r==null?void 0:r.position:"",city:r!=null&&r.city?r==null?void 0:r.city:""},validationSchema:n,onSubmit:l=>{t?s(Qu({user_key:r==null?void 0:r.key,firstname:l.firstname,lastname:l.lastname,mobile:l.mobile,position:l.post,city:l.city})).then(c=>{c.payload.error?i({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(i({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),s(eu()),e(1))}):s(qe({firstname:l.firstname,lastname:l.lastname,mobile:l.mobile,position:l.post,city:l.city})).then(c=>{c.payload.error?i({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(i({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),s(eu()),e(1))})}}),x=l=>{a.setFieldValue("post",l.target.value)};return u.jsxs(F,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:1,children:[u.jsx(N,{fullWidth:!0,id:"firstname",name:"firstname",label:"نام",value:a.values.firstname,onChange:a.handleChange,error:a.touched.firstname&&!!a.errors.firstname,helperText:a.touched.firstname&&a.errors.firstname,onBlur:a.handleBlur}),u.jsx(N,{fullWidth:!0,id:"lastname",name:"lastname",label:"نام خانوادگی",value:a.values.lastname,onChange:a.handleChange,error:a.touched.lastname&&!!a.errors.lastname,helperText:a.touched.lastname&&a.errors.lastname,onBlur:a.handleBlur}),u.jsx(N,{id:"mobile",label:"شماره تلفن",variant:"outlined",sx:{width:"100%"},value:a.values.mobile,error:a.touched.mobile?!!a.errors.mobile:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.mobile&&a.errors.mobile?a.errors.mobile:null}),u.jsx(N,{id:"city",label:"شهر",variant:"outlined",sx:{width:"100%"},value:a.values.city,error:a.touched.city?!!a.errors.city:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.city&&a.errors.city?a.errors.city:null}),u.jsxs(Q,{fullWidth:!0,children:[u.jsx(Z,{id:"demo-simple-select-label",children:"سمت"}),u.jsx(uu,{labelId:"demo-simple-select-label",label:"سمت",value:a.values.post,onChange:x,children:(d=be())==null?void 0:d.map((l,c)=>u.jsx(m,{value:l==null?void 0:l.role,children:l==null?void 0:l.translation},c))})]}),u.jsx(T,{color:"primary",variant:"contained",fullWidth:!0,type:"submit",onClick:a.handleSubmit,children:"ثبت"})]})},$e=({item:e,fetchApiData:t})=>{const[r,s]=C.useState(null),[i]=C.useContext(U),n=z(),a=c=>{s(c.currentTarget)},x=()=>{s(null)},d=!!r,l=d?"popover":void 0;return u.jsxs(h,{container:!0,children:[u.jsx(K,{"aria-describedby":l,variant:"contained",color:"primary",onClick:a,children:u.jsx(ju,{})}),u.jsx(Au,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:l,open:d,anchorEl:r,onClose:x,children:u.jsxs(h,{gap:1,style:{padding:"20px",display:"flex",flexDirection:"column"},children:[u.jsx(T,{size:"small",color:"primary",variant:"contained",onClick:()=>n(J({title:"ویرایش عضو",content:u.jsx(Zu,{fetchApiData:t,item:e,isEdit:!0})})),children:"ویرایش"}),u.jsx(T,{size:"small",color:"error",variant:"contained",onClick:()=>{n(We(e==null?void 0:e.id)).then(c=>{c.payload.error?i({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(i({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(1))})},children:"حذف"}),u.jsx(O,{control:u.jsx(Wu,{defaultChecked:e==null?void 0:e.active,onClick:()=>{n(Qu({user_key:e==null?void 0:e.key,active:!(e!=null&&e.active)})).then(c=>{c.payload.error?i({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(i({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(1))})}}),label:e!=null&&e.active?"فعال":"غیر فعال"})]})})]})},Xe=()=>{const e=z(),[t,r]=C.useState([]),[s,i]=C.useState(!1),[n,a]=C.useState(0),[x,d]=C.useState(10),[l,c]=C.useState(""),[o]=C.useContext(U),y=p=>{c(p.target.value)},A=async(p,f)=>{i(!0);const B=await E.get(`reports-users/?search=filter&value=${f}&page=${p}&role=${_()}&page_size=${x}`);r(B.data.results),a(B.data.count),i(!1)},g=p=>{A(p,l)},k=async(p,f)=>{i(!0);const B=await E.get(`reports-users/?search=filter&value=${l}&page=${f}&role=${_()}&page_size=${p}`);r(B.data.results),a(B.data.count),d(p),i(!1)};C.useEffect(()=>{A(1)},[]);const I=async p=>{p.preventDefault(),i(!0);try{const f=await E.get(`reports-users/?search=filter&value=${l}&role=${_()}`);r(f.data.results),a(f.data.count)}catch(f){console.error("Error fetching data:",f)}finally{i(!1)}};let $=[{name:"عملیات",selector:(p,f)=>u.jsx($e,{item:p,fetchApiData:A}),sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"ردیف",selector:(p,f)=>f+1,sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"وضعیت",selector:(p,f)=>p!=null&&p.active?"فعال":"غیر فعال",sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"نام و نام خانوادگی",selector:(p,f)=>(p==null?void 0:p.firstname)+" "+(p==null?void 0:p.lastname),sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"موبایل",selector:(p,f)=>p==null?void 0:p.mobile,sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"شهر",selector:(p,f)=>p==null?void 0:p.city,sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"سمت",selector:(p,f)=>mu(p==null?void 0:p.position),sortable:!1,wrap:!0,allowOverflow:!0,center:!0}];const[L,W]=C.useState(!1),G=p=>{var f;e(qu({report_key:(f=p==null?void 0:p.report)==null?void 0:f.key,active:L})).then(B=>{B.payload.error?o({vertical:"top",horizontal:"center",msg:B.payload.error,severity:"error"}):(o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),A(1))})},[j,D]=C.useState([]);return C.useEffect(()=>{var p,f;if(t!=null&&t.length){const B=(f=(p=t[0])==null?void 0:p.userReports)==null?void 0:f.map((w,ou)=>{var nu,su;return{name:u.jsxs(h,{container:!0,direction:"column",alignItems:"center",children:[u.jsx(Y,{placement:"top",title:(nu=w==null?void 0:w.report)==null?void 0:nu.description,children:u.jsx(b,{variant:"body2",children:(su=w==null?void 0:w.report)==null?void 0:su.title})}),u.jsx(Y,{placement:"right",title:"فعال / غیر فعال برای همه",children:u.jsx(K,{color:"primary",onClick:()=>{W(!L,G(w))},children:u.jsx(Fe,{})})})]}),selector:(V,iu)=>{var Eu;return u.jsx(M,{checked:(Eu=V==null?void 0:V.userReports[ou])==null?void 0:Eu.active,name:"item1",onClick:()=>{var fu,_u;e(qu({user_report_key:(fu=V==null?void 0:V.userReports[ou])==null?void 0:fu.key,active:!((_u=V==null?void 0:V.userReports[ou])!=null&&_u.active)})).then(yu=>{yu.payload.error?o({vertical:"top",horizontal:"center",msg:yu.payload.error,severity:"error"}):(o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),A(1))})}})},sortable:!1,wrap:!0,allowOverflow:!0,center:!0}});D(B)}},[t]),u.jsxs(h,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mt:2,mb:2,children:[u.jsxs(h,{container:!0,justifyContent:"space-between",xs:12,alignItems:"center",style:{width:"100%"},children:[u.jsxs(h,{container:!0,gap:2,alignItems:"center",children:[u.jsx(T,{variant:"contained",onClick:()=>e(J({title:"گزارش جدید",content:u.jsx(Ge,{fetchApiData:A})})),children:"گزارش جدید"}),u.jsx(T,{variant:"contained",onClick:()=>e(J({title:"ثبت عضو جدید",content:u.jsx(Zu,{fetchApiData:A})})),children:"ثبت عضو"})]}),u.jsx(T,{variant:"contained",onClick:()=>e(J({title:"زمان ارسال",content:u.jsx(Le,{fetchApiData:A})})),children:"زمان ارسال"})]}),u.jsx(se,{style:{width:"100%",margin:"30px"}}),u.jsx(h,{xs:12,children:u.jsx(Yu,{title:u.jsxs(h,{container:!0,gap:2,alignItems:"center",mb:2,children:[u.jsx(b,{variant:"body1",children:"لیست گزارشات"}),u.jsxs("form",{onSubmit:I,children:[u.jsx(N,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:y}),u.jsx(T,{type:"submit",onClick:I,endIcon:u.jsx(Hu,{}),children:"جستجو"})]})]}),columns:[...$,...j],data:t,progressPending:s,pagination:!0,paginationServer:!0,paginationTotalRows:n,onChangeRowsPerPage:k,onChangePage:g})})]})},He=R("PROVINCE_UPDATE_MOBILE_MESSAGES_ACTIVE_SERVICE",async(e,{dispatch:t})=>{try{t(S());const{data:r,status:s}=await E.put("moving-text-with-role/0/",e);return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data.result}}}),ue=R("PROVINCE_UPDATE_MOBILE_MESSAGES_ACTIVE_TEXT_SERVICE",async(e,{dispatch:t})=>{try{t(S());const{data:r,status:s}=await E.put("moving-text/0/",e);return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data.result}}}),Ye=R("PROVINCE_UPDATE_SUBMIT_MOVING_TEXT",async(e,{dispatch:t})=>{try{t(S());const{data:r,status:s}=await E.post("moving-text/",e);return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data.result}}}),Ke=R("PROVINCE_DELETE_MOVING_TEXT",async(e,{dispatch:t})=>{t(S());const{data:r,status:s}=await E.delete("moving-text/"+e+"/");return t(v()),{data:r,status:s}}),ee=({fetchApiData:e,item:t,isEdit:r})=>{const[s]=C.useContext(U),i=z(),n=ru({initialValues:{movingText:t!=null&&t.movingText?t==null?void 0:t.movingText:""},validationSchema:tu({movingText:q().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!")})});return C.useEffect(()=>{n.validateForm()},[]),u.jsxs(h,{xs:12,container:!0,direction:"column",gap:2,children:[u.jsx(N,{id:"movingText",label:"متن متحرک",multiline:!0,rows:5,variant:"outlined",sx:{width:"100%",height:"100%"},value:n.values.movingText,error:n.touched.movingText?!!n.errors.movingText:null,onChange:n.handleChange,onBlur:n.handleBlur,helperText:n.touched.movingText&&n.errors.movingText?n.errors.movingText:null}),u.jsx(h,{children:u.jsx(T,{fullWidth:!0,variant:"contained",disabled:!n.isValid,onClick:()=>{r?i(ue({moving_text:n.values.movingText,moving_text_key:t==null?void 0:t.key})).then(a=>{a.payload.error?s({vertical:"top",horizontal:"center",msg:a.payload.error,severity:"error"}):(s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),i(eu()),e(1))}):i(Ye({moving_text:n.values.movingText})).then(a=>{a.payload.error?s({vertical:"top",horizontal:"center",msg:a.payload.error,severity:"error"}):(s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),i(eu()),e(1))})},children:"ویرایش توضیحات"})})]})},Je=({item:e,fetchApiData:t})=>{var c;const r=z(),[s]=C.useContext(U),[i,n]=C.useState(null),a=o=>{n(o.currentTarget)},x=()=>{n(null)},d=!!i,l=d?"popover":void 0;return u.jsxs("div",{children:[u.jsx(K,{"aria-describedby":l,variant:"contained",color:"primary",onClick:a,children:u.jsx(ju,{})}),u.jsx(Au,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:l,open:d,anchorEl:i,onClose:x,children:u.jsx("div",{style:{padding:"20px"},children:u.jsxs(h,{container:!0,direction:"column",children:[u.jsx(Y,{title:((c=e.ProvinceInspector)==null?void 0:c.trash)===!0?"فعالسازی متن":"غیر فعال کردن متن",placement:"right",children:u.jsx(O,{size:"small",label:e.active===!0?"فعال":" غیر فعال",control:u.jsx(Wu,{size:"small",checked:e==null?void 0:e.active,onClick:()=>{r(ue({moving_text_key:e==null?void 0:e.key,active:!(e!=null&&e.active)})).then(o=>{o.payload.error?s({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(1))})}})})}),u.jsx(Y,{title:"ویرایش",placement:"right",children:u.jsx(K,{color:"primary",onClick:()=>{x(),r(J({title:"ویرایش متن متحرک",content:u.jsx(ee,{fetchApiData:t,item:e,isEdit:!0})}))},children:u.jsx(Ku,{})})}),u.jsx(Y,{title:"حذف متن",placement:"right",children:u.jsx(K,{"aria-label":"delete",color:"error",onClick:()=>{r(Ke(e==null?void 0:e.id)).then(o=>{o.payload.error?s({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است",severity:"error"}):(t(1),s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:u.jsx(Ju,{})})})]})})})]})},Qe=()=>{const[e]=C.useContext(U),[t,r]=C.useState([]),[s,i]=C.useState(!1),[n,a]=C.useState(0),[x,d]=C.useState(10),[l,c]=C.useState(""),o=j=>{c(j.target.value)},y=z(),A=async(j,D)=>{i(!0);const p=await E.get(`moving-text/?search=filter&value=${D}&page=${j}&page_size=${x}`);r(p.data.results),a(p.data.count),i(!1)},g=j=>{A(j,l)},k=async(j,D)=>{i(!0);const p=await E.get(`moving-text/?search=filter&value=${l}&page=${D}&page_size=${j}`);r(p.data.results),a(p.data.count),d(j),i(!1)};C.useEffect(()=>{A(1)},[]);const I=async j=>{j.preventDefault(),i(!0);try{const D=await E.get(`moving-text/?search=filter&value=${l}`);r(D.data.results),a(D.data.count)}catch(D){console.error("Error fetching data:",D)}finally{i(!1)}};C.useEffect(()=>{A(1)},[]);const $=[{name:"ردیف",selector:(j,D)=>D+1,sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"60px"},{name:"عملیات",selector:j=>u.jsx(Je,{fetchApiData:A,item:j}),sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"وضعیت",selector:j=>j!=null&&j.active?"فعال":"غیر فعال",sortable:!0,wrap:!0,allowOverflow:!0,center:!0},{name:"متن",selector:j=>j==null?void 0:j.movingText,sortable:!0,wrap:!0,allowOverflow:!0,center:!0}],[L,W]=C.useState([]);C.useEffect(()=>{var j,D;if(t!=null&&t.length){const p=(D=(j=t[0])==null?void 0:j.roles)==null?void 0:D.map((f,B)=>({name:u.jsx(b,{variant:"body2",children:mu(f==null?void 0:f.role)}),selector:(w,ou)=>{var nu;return u.jsx(M,{checked:(nu=w==null?void 0:w.roles[B])==null?void 0:nu.active,name:"item1",onClick:()=>{var su,V;y(He({moving_text_role_key:(su=w==null?void 0:w.roles[B])==null?void 0:su.key,active:!((V=w==null?void 0:w.roles[B])!=null&&V.active)})).then(iu=>{iu.payload.error?e({vertical:"top",horizontal:"center",msg:iu.payload.error,severity:"error"}):(e({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),A(1))})}})},sortable:!1,wrap:!0,allowOverflow:!0,center:!0}));W(p)}},[t]);const G=u.jsx(h,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,children:u.jsxs(h,{container:!0,alignItems:"center",gap:P.SMALL,children:[u.jsx(b,{children:"متن متحرک "}),u.jsxs("form",{onSubmit:I,children:[u.jsx(N,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:o}),u.jsx(T,{type:"submit",onClick:I,endIcon:u.jsx(Hu,{}),children:"جستجو"})]})]})});return u.jsxs(h,{alignItems:"center",justifyContent:"center",mt:4,children:[u.jsx(h,{container:!0,children:u.jsx(T,{variant:"contained",onClick:()=>{y(J({title:"ثبت متن متحرک",content:u.jsx(ee,{fetchApiData:A})}))},children:"متن جدید"})}),u.jsx(Yu,{title:G,columns:[...$,...L],data:t,progressPending:s,pagination:!0,paginationServer:!0,paginationTotalRows:n,onChangeRowsPerPage:k,onChangePage:g})]})},Ze=R("GET_AGE_MESSAGES",async(e,{dispatch:t})=>{t(S());const{data:r,status:s}=await E.get("age-notification-poultry/");return t(v()),{data:r,status:s}}),u6=R("EDIT_AGE_MESSAGES",async(e,{dispatch:t})=>{try{t(S());const{data:r,status:s}=await E.put("age-notification-poultry/0/",e);return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data.result}}}),e6=R("SUBMIT_AGE_MESSAGES",async(e,{dispatch:t})=>{try{t(S());const{data:r,status:s}=await E.post("age-notification-poultry/",e);return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data.result}}}),t6=R("DELETE_AGE_MESSAGES",async(e,{dispatch:t})=>{t(S());try{const{data:r,status:s}=await E.delete("age-notification-poultry/0/?notif_key="+e);return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data.result}}}),r6=({item:e,fetchData:t})=>{const[r]=C.useContext(U),s=z(),i=tu({ageRange:au().required("بازه سنی ضروری است").max(99,"عدد دورقمی وارد کنید!"),lossPercent:au().required("درصد افت ضروری است").max(99,"عدد دورقمی وارد کنید!"),message:q().required("پیغام ضروری است").max(500,"حداکثر 500 کاراکتر")}),n=ru({initialValues:{ageRange:e==null?void 0:e.poultryAge,message:e==null?void 0:e.message,lossPercent:e==null?void 0:e.lossesPercent},validationSchema:i,onSubmit:a=>{s(u6({message:a.message,poultry_age:a.ageRange,losses_percent:a.lossPercent,notif_key:e==null?void 0:e.key})).then(x=>{x.payload.error?r({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):(t(),s(Xu({right:!1,bottom:!1,content:null})),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}});return u.jsx("form",{onSubmit:n.handleSubmit,children:u.jsxs(F,{container:!0,justifyContent:"center",alignItems:"center",xs:12,gap:2,children:[u.jsx(F,{item:!0,xs:12,children:u.jsx(N,{fullWidth:!0,id:"ageRange",name:"ageRange",label:"بازه سنی",variant:"outlined",value:n.values.ageRange,onChange:n.handleChange,onBlur:n.handleBlur,error:n.touched.ageRange&&!!n.errors.ageRange,helperText:n.touched.ageRange&&n.errors.ageRange})}),u.jsx(F,{item:!0,xs:12,children:u.jsx(N,{fullWidth:!0,id:"lossPercent",name:"lossPercent",label:"درصد افت",variant:"outlined",value:n.values.lossPercent,onChange:n.handleChange,onBlur:n.handleBlur,error:n.touched.lossPercent&&!!n.errors.lossPercent,helperText:n.touched.lossPercent&&n.errors.lossPercent})}),u.jsx(F,{item:!0,xs:12,children:u.jsx(N,{fullWidth:!0,multiline:!0,rows:5,id:"message",name:"message",label:"پیغام",variant:"outlined",value:n.values.message,onChange:n.handleChange,onBlur:n.handleBlur,error:n.touched.message&&!!n.errors.message,helperText:n.touched.message&&n.errors.message})}),u.jsx(F,{item:!0,xs:12,children:u.jsx(T,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,children:"ثبت"})})]})})},n6=()=>{const[e,t]=C.useState([]),[r]=C.useContext(U),s=z(),i=tu({ageRange:au().required("بازه سنی ضروری است").max(99,"عدد دورقمی وارد کنید!"),lossPercent:au().required("درصد افت ضروری است").max(99,"عدد دورقمی وارد کنید!"),message:q().required("پیغام ضروری است").max(500,"حداکثر 500 کاراکتر")}),n=ru({initialValues:{ageRange:"",message:"",lossPercent:""},validationSchema:i,onSubmit:(d,{resetForm:l})=>{s(e6({message:d.message,poultry_age:d.ageRange,losses_percent:d.lossPercent})).then(c=>{c.payload.error?r({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(a(),l(),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}),a=()=>{s(Ze()).then(d=>{var c;const l=(c=d.payload.data)==null?void 0:c.map((o,y)=>[y+1,Ce(o==null?void 0:o.createDate),o==null?void 0:o.lossesPercent,o==null?void 0:o.poultryAge,o==null?void 0:o.message,u.jsx(F,{justifyContent:"center",alignItems:"center",children:u.jsx(x,{item:o,onDelete:()=>{s(t6(o==null?void 0:o.key)).then(A=>{A.payload.error?r({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"}):(a(),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},onEdit:()=>{s(Xu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ویرایش خریدار",content:u.jsx(r6,{isEdit:!0,item:o,fetchData:a})}))}})},y)]);t(l)})},x=({onDelete:d,onEdit:l})=>{const[c,o]=C.useState(null),y=!!c,A=$=>{o($.currentTarget)},g=()=>{o(null)},k=()=>{d(),g()},I=()=>{l(),g()};return u.jsxs(F,{children:[u.jsx(Y,{title:"تنظیمات",children:u.jsx(K,{color:"primary",className:"avicultureActiveRequestsBtn",onClick:A,children:u.jsx(ju,{})})}),u.jsx(Au,{open:y,anchorEl:c,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsxs(ae,{sx:{minWidth:140,p:1},children:[u.jsxs(Ru,{onClick:I,sx:{py:1},children:[u.jsx(bu,{children:u.jsx(Ku,{color:"primary"})}),u.jsx(Fu,{primary:u.jsx(b,{variant:"body2",color:"textPrimary",children:"ویرایش"})})]}),u.jsxs(Ru,{onClick:k,sx:{py:1},children:[u.jsx(bu,{children:u.jsx(Ju,{color:"error"})}),u.jsx(Fu,{primary:u.jsx(b,{variant:"body2",color:"textPrimary",children:"حذف"})})]})]})})]})};return C.useEffect(()=>{a()},[s]),u.jsx("form",{onSubmit:n.handleSubmit,children:u.jsxs(F,{container:!0,justifyContent:"space-between",xs:12,spacing:2,children:[u.jsxs(F,{container:!0,spacing:2,xs:12,sm:6,children:[u.jsx(F,{item:!0,xs:6,children:u.jsx(N,{fullWidth:!0,id:"ageRange",name:"ageRange",label:"بازه سنی",variant:"outlined",value:n.values.ageRange,onChange:n.handleChange,onBlur:n.handleBlur,error:n.touched.ageRange&&!!n.errors.ageRange,helperText:n.touched.ageRange&&n.errors.ageRange})}),u.jsx(F,{item:!0,xs:6,children:u.jsx(N,{fullWidth:!0,id:"lossPercent",name:"lossPercent",label:"درصد افت",variant:"outlined",value:n.values.lossPercent,onChange:n.handleChange,onBlur:n.handleBlur,error:n.touched.lossPercent&&!!n.errors.lossPercent,helperText:n.touched.lossPercent&&n.errors.lossPercent})}),u.jsx(F,{item:!0,xs:12,children:u.jsx(N,{fullWidth:!0,multiline:!0,rows:5,id:"message",name:"message",label:"پیغام",variant:"outlined",value:n.values.message,onChange:n.handleChange,onBlur:n.handleBlur,error:n.touched.message&&!!n.errors.message,helperText:n.touched.message&&n.errors.message})}),u.jsx(F,{item:!0,xs:12,children:u.jsx(T,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,children:"ثبت"})})]}),u.jsx(F,{container:!0,spacing:2,xs:12,sm:6,children:u.jsx(Te,{title:"پیغام بازه سنی",paginated:!0,columns:["ردیف","تاریخ ثبت","درصد افت","بازه سنی","متن پیام","عملیات"],data:e})})]})})},s6=R("PROVINCE_SUBMIT_DASHBOARD_NEWS_SERVICE",async(e,{dispatch:t})=>{try{t(S());const{data:r,status:s}=await E.post("dashboard_notification/",e);return t(v()),{data:r,status:s}}catch(r){return t(v()),{error:r.response.data.result}}}),a6=[{id:1,role:"AdminX",name:"ادمین ایکس"},{id:2,role:"SuperAdmin",name:"ادمین کل"},{id:3,role:"ProvinceOperator",name:"مدیر اجرایی"}],o6=$u(le)(({theme:e})=>({padding:e.spacing(4),borderRadius:e.shape.borderRadius*2,boxShadow:e.shadows[4],maxWidth:800,margin:"0 auto"})),l6=$u(T)(({theme:e})=>({marginTop:e.spacing(3),padding:e.spacing(1.5),fontSize:"1rem"})),i6=()=>{const[e,t]=C.useState({title:"",text:"",status:"",selectedRoles:[]}),r=z(),[s]=C.useContext(U),i=x=>{const{name:d,value:l}=x.target;t(c=>({...c,[d]:l}))},n=x=>{const d=x.target.value;t(l=>({...l,selectedRoles:Array.isArray(d)?d:[d]}))},a=()=>{const x={role:e.selectedRoles.map(d=>d.role),title:e.title,text:e.text,status:e.status};r(s6(x)).then(d=>{d.error?s({vertical:"top",horizontal:"center",msg:d.error,severity:"error"}):(s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t({title:"",text:"",status:"",selectedRoles:[]}))})};return u.jsx(vu,{sx:{padding:3},children:u.jsxs(o6,{children:[u.jsx(b,{variant:"h5",gutterBottom:!0,sx:{mb:3,fontWeight:600},children:"ایجاد اطلاعیه جدید"}),u.jsxs(h,{container:!0,spacing:3,children:[u.jsx(h,{item:!0,xs:12,children:u.jsx(N,{fullWidth:!0,label:"عنوان",name:"title",value:e.title,onChange:i,variant:"outlined",size:"small"})}),u.jsx(h,{item:!0,xs:12,children:u.jsx(N,{fullWidth:!0,label:"متن توضیحات خبر",name:"text",value:e.text,onChange:i,variant:"outlined",multiline:!0,rows:6,size:"small"})}),u.jsx(h,{item:!0,xs:12,sm:6,children:u.jsx(N,{fullWidth:!0,label:"وضعیت",name:"status",value:e.status,onChange:i,variant:"outlined",size:"small",placeholder:"مثلاً: فوری، عادی، اطلاعیه"})}),u.jsx(h,{item:!0,xs:12,sm:6,children:u.jsxs(Q,{fullWidth:!0,size:"small",children:[u.jsx(Z,{id:"roles-label",children:"نقش ها"}),u.jsx(uu,{labelId:"roles-label",id:"roles-select",multiple:!0,value:e.selectedRoles,onChange:n,renderValue:x=>u.jsx(vu,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:x.map(d=>u.jsx(oe,{label:d.name,size:"small"},d.id))}),children:a6.map(x=>u.jsx(m,{value:x,children:x.name},x.id))})]})}),u.jsx(h,{item:!0,xs:12,sx:{textAlign:"left"},children:u.jsx(l6,{onClick:a,color:"primary",variant:"contained",disabled:!e.title||!e.text||!e.status||e.selectedRoles.length===0,children:"ثبت اطلاعیه"})})]})]})})},M6=()=>{const{pathname:e}=ve();return u.jsx(u.Fragment,{children:u.jsx(vu,{display:"flex",justifyContent:"center",children:u.jsxs(h,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[e===de||e===he||e===pe?u.jsxs(h,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",my:P.MEDIUM,children:[u.jsx(h,{mb:P.SMALL,children:u.jsx(b,{variant:"h5",color:"textSecondary",children:"پیامک ها"})}),u.jsxs(h,{container:!0,gap:P.SMALL,xs:12,justifyContent:"center",children:[u.jsx(H,{to:_()==="SuperAdmin"?Tu:_()==="AdminX"?Pu:cu,active:e===cu?"true":null,children:u.jsx(X,{icon:u.jsx(Gu,{size:30,color:"#244CCC"}),title:"ارسال پیامک",description:"ارسال پیامک برای نقش ها و کاربران مختلف"})}),u.jsx(H,{to:_()==="SuperAdmin"?Ou:_()==="AdminX"?Nu:Cu,active:e===Cu?"true":null,children:u.jsx(X,{icon:u.jsx(lu,{size:30,color:"#244CCC"}),title:"مدیریت پیامک اطلاع رسانی",description:"تعیین گزینه های اطلاع رسانی برای نقش ها و مراحل مختلف"})}),u.jsx(H,{to:_()==="SuperAdmin"?xe:_()==="AdminX"?ge:Iu,active:e===Iu?"true":null,children:u.jsx(X,{icon:u.jsx(lu,{size:30,color:"#244CCC"}),title:"مدیریت پیام های سیستمی",description:"تعیین گزینه های اطلاع رسانی برای نقش ها و مراحل مختلف"})}),u.jsx(H,{to:_()==="SuperAdmin"?wu:_()==="AdminX"?ku:du,active:e===du?"true":null,children:u.jsx(X,{icon:u.jsx(lu,{size:30,color:"#244CCC"}),title:"اعلانات",description:"تعیین گزینه های اطلاع رسانی برای نقش ها و مراحل مختلف"})}),_()==="SuperAdmin"&&u.jsx(H,{to:_()==="SuperAdmin"?Mu:_()==="AdminX"?Du:hu,active:e===hu?"true":null,children:u.jsx(X,{icon:u.jsx(lu,{size:30,color:"#244CCC"}),title:"گزارش دهی",description:"تعیین گزینه های اطلاع رسانی برای نقش ها و مراحل مختلف"})}),(_()==="SuperAdmin"||_()==="AdminX")&&u.jsx(H,{to:_()==="SuperAdmin"?pu:Bu,active:e===pu?"true":null,children:u.jsx(X,{icon:u.jsx(_e,{size:30,color:"#244CCC"}),title:"پیغام متحرک"})}),(_()==="SuperAdmin"||_()==="AdminX")&&u.jsx(H,{to:_()==="SuperAdmin"?xu:Uu,active:e===xu?"true":null,children:u.jsx(X,{icon:u.jsx(Gu,{size:30,color:"#244CCC"}),title:"پیغام بازه سنی"})}),(_()==="SuperAdmin"||_()==="AdminX")&&u.jsx(H,{to:_()==="SuperAdmin"?gu:_()==="AdminX"?zu:Vu,active:e===gu?"true":null,children:u.jsx(X,{icon:u.jsx(ye,{size:30,color:"#244CCC"}),title:"اطلاعیه داشبورد"})})]})]}):u.jsx(Se,{}),(e===cu||e===Tu||e===Pu)&&u.jsx(Ie,{}),(e===Cu||e===Ou||e===Nu)&&u.jsx(ke,{}),(e===du||e===wu||e===ku)&&u.jsx(De,{}),(e===hu||e===Mu||e===Du)&&u.jsx(Xe,{}),(e===pu||e===Bu)&&u.jsx(Qe,{}),(e===xu||e===Uu)&&u.jsx(n6,{}),(e===gu||e===zu||e===Vu)&&u.jsx(i6,{})]})})})};export{M6 as default}; diff --git a/build/assets/SenfInventoryPage-BGQA4pLz.js b/build/assets/SenfInventoryPage-BGQA4pLz.js new file mode 100644 index 0000000..7b5fe77 --- /dev/null +++ b/build/assets/SenfInventoryPage-BGQA4pLz.js @@ -0,0 +1 @@ +import{j as u,ak as x,aa as M,B as j,T as v,am as P,ai as m,aX as Y,ag as $,ah as K,aj as I,b as X}from"./mui-vendor-CkIVaoQP.js";import{G as n,S as g,lg as S,L as J,j as Q,h as V,A as b,u as D,c as O,X as w,lh as N,li as T,jw as L,lj as k,C as E,b as y,M as G,V as H,p as Z,O as z,W as uu,a9 as eu,lk as au}from"./index-CeyyVc1v.js";import{B as ru}from"./BackButton-Crzr7NMa.js";import{V as su}from"./index.esm-CjWvmHks.js";import{L as tu}from"./LinkItem-DT6qswcs.js";import{N as nu}from"./NavLink-D2GD_ItM.js";import{f as W,r as d}from"./react-vendor-CmFgShSM.js";import{a as ou,u as B,f as lu}from"./redux-vendor-B7uoacJt.js";import{S as cu}from"./SimpleTable-DBAoNnCU.js";import{A as iu}from"./AdvancedTable-BYmmBtmq.js";import{g as U}from"./guild-allocated-stock-operation-BiIjKHlL.js";import"./iconBase-BEJYyZsk.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const Cu=()=>{const{pathname:a}=W();return u.jsx(n,{container:!0,gap:g.SMALL,p:g.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",style:{placeContent:"baseline"},children:u.jsx(nu,{to:S,active:a===S?"true":null,children:u.jsx(tu,{icon:u.jsx(su,{size:30,color:"#244CCC"}),title:"موجودی انبار"})})})},du=ou("GUILD_UPDATE_ALLOCATED_STOCK_SERVICE",async(a,{dispatch:o})=>{o(J());try{const{data:c,status:l}=await Q.put("steward-allocation/0/",a);return o(V()),{data:c,status:l}}catch(c){return o(V()),{error:c.response.data.result}}}),hu=O().shape({quantity:y().required("وارد کردن تعداد اجباری است"),weight:y().required("وارد کردن وزن اجباری است")}),gu=({item:a})=>{const[o]=d.useContext(b),[,,c]=d.useContext(b),l=B(),s=D({initialValues:{quantity:a==null?void 0:a.receiverRealNumberOfCarcasses,weight:a==null?void 0:a.receiverRealWeightOfCarcasses},validationSchema:hu,onSubmit:t=>{l(du({steward:!0,allocation_key:a.key,receiver_real_number_of_carcasses:Number(t.quantity),receiver_real_weight_of_carcasses:Number(t.weight)})).then(h=>{h.payload.error?o({vertical:"top",horizontal:"center",msg:h.payload.error,severity:"error"}):(w()==="senf"?(l(N({date:c})),l(T({date:c}))):(l(L({date:c})),l(k({date:c}))),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),l(E()))})}});return d.useEffect(()=>{s.validateForm()},[]),d.useEffect(()=>{const t=s.values.weight/a.indexWeight;s.setFieldValue("quantity",t.toFixed(0))},[s.values.weight]),u.jsx(n,{container:!0,direction:"column",width:"100%",children:u.jsx("form",{onSubmit:s.handleSubmit,children:u.jsxs(n,{container:!0,gap:g.SMALL,children:[u.jsx(x,{id:"weight",name:"weight",label:"وزن واقعی تحویلی",InputProps:{endAdornment:u.jsx(M,{position:"end",children:"کیلوگرم"})},value:s.values.weight,onChange:s.handleChange,error:s.touched.weight&&s.errors.weight,helperText:s.touched.weight&&s.errors.weight}),u.jsx(x,{id:"quantity",name:"quantity",label:"تعداد واقعی تحویلی",disabled:!0,InputProps:{endAdornment:u.jsx(M,{position:"end",children:"قطعه"})},value:s.values.quantity,onChange:s.handleChange,error:s.touched.quantity&&s.errors.quantity,helperText:s.touched.quantity&&s.errors.quantity}),u.jsx(j,{type:"submit",fullWidth:!0,variant:"contained",children:"ثبت"})]})})})},pu=({item:a})=>{const o=B(),[,,c]=d.useContext(b),[l]=d.useContext(b),[s,t]=d.useState("option1"),h=C=>{t(C.target.value)},p={authCode:""},e=O({authCode:G().required("کداحراز اجباری است")}),i=D({initialValues:p,validationSchema:e,onSubmit:C=>{}}),[A,F]=d.useState(!1),_=()=>{F(!A)},r=D({initialValues:{number:"",weight:""},validationSchema:O({number:y().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),weight:y().required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!")})});return d.useEffect(()=>{i.validateForm(),r.validateForm()},[]),u.jsxs(n,{container:!0,width:"100%",direction:"column",justifyContent:"space-between",gap:g.TINY,children:[u.jsxs(n,{container:!0,justifyContent:"space-around",children:[u.jsxs(v,{variant:"caption",children:["وزن تخصیصی: ",a.weightOfCarcasses.toLocaleString()," کیلوگرم"]}),u.jsxs(v,{variant:"caption",children:["تعداد تخصیصی: ",a.numberOfCarcasses.toLocaleString()," قطعه"]})]}),u.jsx(P,{}),u.jsxs(n,{container:!0,spacing:1,alignItems:"center",children:[u.jsx(n,{item:!0,children:u.jsx(m,{control:u.jsx(Y,{size:"small",checked:A,onChange:_}),label:"ثبت تعداد واقعی تحویلی"})}),u.jsxs(n,{container:!0,xs:12,spacing:1,children:[u.jsx(n,{item:!0,xs:6,children:u.jsx(x,{id:"weight",size:"small",label:"وزن",variant:"outlined",disabled:!A,onChange:r.handleChange,onBlur:r.handleBlur,value:r.values.weight,error:r.touched.weight&&!!r.errors.weight,helperText:r.touched.weight?r.errors.weight:""})}),u.jsx(n,{item:!0,xs:6,children:u.jsx(x,{id:"number",size:"small",label:"تعداد",variant:"outlined",disabled:!A,onChange:r.handleChange,onBlur:r.handleBlur,value:r.values.number,error:r.touched.number&&!!r.errors.number,helperText:r.touched.number?r.errors.number:""})})]})]}),u.jsx($,{component:"fieldset",children:u.jsxs(K,{row:!0,"aria-label":"radio-buttons-group",name:"radio-buttons-group",value:s,onChange:h,style:{justifyContent:"space-between",flexDirection:"row"},children:[u.jsx(m,{value:"option1",control:u.jsx(I,{}),label:"تحویل بار با کداحراز"}),u.jsx(m,{value:"option2",control:u.jsx(I,{}),label:"تحویل بار بدون کداحراز"})]})}),s==="option1"&&u.jsx(x,{fullWidth:!0,id:"authCode",name:"authCode",label:"کداحراز",variant:"outlined",margin:"normal",onChange:i.handleChange,onBlur:i.handleBlur,value:i.values.authCode,error:i.touched.authCode&&!!i.errors.authCode,helperText:i.touched.authCode?i.errors.authCode:""}),u.jsx(j,{disabled:(s==="option1"?!i.isValid:!1)||(A?!r.isValid:!1),variant:"contained",onClick:()=>{let C={};i.values.authCode?w()==="senf"?C={guild_check_allocation:!0,receiver_real_number_of_carcasses:r.values.number?r.values.number:a.numberOfCarcasses,receiver_real_weight_of_carcasses:r.values.weight?r.values.weight:a.weightOfCarcasses,allocation_key:a.key,registration_code:Number(i.values.authCode),state:"accepted"}:C={steward_check_allocation:!0,allocation_key:a.key,receiver_real_number_of_carcasses:r.values.number?r.values.number:a.numberOfCarcasses,receiver_real_weight_of_carcasses:r.values.weight?r.values.weight:a.weightOfCarcasses,registration_code:Number(i.values.authCode),state:"accepted"}:w()==="senf"?C={guild_check_allocation:!0,allocation_key:a.key,receiver_real_number_of_carcasses:r.values.number?r.values.number:a.numberOfCarcasses,receiver_real_weight_of_carcasses:r.values.weight?r.values.weight:a.weightOfCarcasses,state:"accepted"}:C={steward_check_allocation:!0,allocation_key:a.key,receiver_real_number_of_carcasses:r.values.number?r.values.number:a.numberOfCarcasses,receiver_real_weight_of_carcasses:r.values.weight?r.values.weight:a.weightOfCarcasses,state:"accepted"},o(U(C)).then(f=>{f.payload.error?l({vertical:"top",horizontal:"center",msg:f.payload.error,severity:"error"}):(w()==="senf"?(o(N({date:c})),o(T({date:c}))):(o(L({date:c})),o(k({date:c}))),l({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(E()))})},children:"تحویل بار"}),u.jsx(j,{variant:"contained",color:"error",onClick:()=>{o(U({steward_check_allocation:!0,allocation_key:a.key,state:"rejected"})).then(C=>{C.payload.error?l({vertical:"top",horizontal:"center",msg:C.payload.error,severity:"error"}):(o(L({date:c})),o(k({date:c})),l({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(E()))})},children:"رد بار"})]})},Au=()=>{const a=B(),[o,c]=d.useState([]),[,,l,s]=d.useContext(b),{senfGetInventoryStock:t,senfGetInventoryAllocated:h}=lu(p=>p.generalSlice);return d.useEffect(()=>{a(N({date:l})),a(T({date:l}))},[l]),d.useEffect(()=>{if((h==null?void 0:h.length)>0){const p=h==null?void 0:h.map((e,R)=>{var A,F,_,r,C,f,q;let i="";return(e==null?void 0:e.receiverState)==="accepted"?i="تحویل گرفته شده":(e==null?void 0:e.receiverState)==="rejected"?i="رد شده":i="در انتظار تحویل",[R+1,`${H((A=e==null?void 0:e.seller)==null?void 0:A.sellerRole)} - ${(F=e==null?void 0:e.seller)==null?void 0:F.sellerName} (${(_=e==null?void 0:e.seller)==null?void 0:_.sellerMobile})`,Z(e.createDate),((r=e==null?void 0:e.numberOfCarcasses)==null?void 0:r.toLocaleString())+" قطعه",((C=e==null?void 0:e.weightOfCarcasses)==null?void 0:C.toLocaleString())+" کیلوگرم",u.jsxs(n,{container:!0,direction:"column",children:[(e==null?void 0:e.receiverRealNumberOfCarcasses)&&u.jsxs(u.Fragment,{children:[u.jsx(v,{variant:"caption",children:((f=e==null?void 0:e.receiverRealNumberOfCarcasses)==null?void 0:f.toLocaleString())+" قطعه"}),u.jsx(v,{variant:"caption",children:((q=e==null?void 0:e.receiverRealWeightOfCarcasses)==null?void 0:q.toLocaleString())+" کیلوگرم"})]}),(e==null?void 0:e.receiverState)==="pending"&&u.jsx(n,{children:u.jsx(j,{onClick:()=>{a(z({title:"ثبت/ویرایش تعداد و وزن تحویلی",content:u.jsx(gu,{item:e})}))},children:e!=null&&e.receiverRealNumberOfCarcasses?"ویرایش":"ثبت"})})]},e.key),u.jsx(n,{container:!0,direction:"column",gap:g.SMALL,children:e.receiverState==="pending"?u.jsx(j,{onClick:()=>{a(z({title:"ثبت تحویل بار",content:u.jsx(pu,{item:e})}))},children:"تحویل بار"}):i},e.key)]});c(p)}},[h]),u.jsxs(n,{container:!0,direction:"column",gap:g.SMALL,children:[u.jsx(n,{children:u.jsx(cu,{name:u.jsx(n,{container:!0,gap:g.SMALL,alignItems:"center",justifyContent:"space-between",children:u.jsxs(n,{container:!0,gap:g.SMALL,alignItems:"center",children:[u.jsx(v,{children:"موجودی انبار"}),u.jsx(uu,{label:"تاریخ",id:"date",renderInput:p=>u.jsx(x,{style:{width:"160px"},...p}),value:l,onChange:p=>{s(eu(p).format("YYYY-MM-DD"))}})]})}),columns:["تعداد بار تخصیصی","وزن لاشه تخصیصی","حجم لاشه تخصیصی","وزن لاشه تحویلی","حجم لاشه تحویلی"],data:[[t==null?void 0:t.barQuantity,(t==null?void 0:t.weightOfCarcasses)+" کیلوگرم",(t==null?void 0:t.numberOfCarcasses)+" قطعه",(t==null?void 0:t.realWeightOfCarcasses)+" کیلوگرم",(t==null?void 0:t.realNumberOfCarcasses)+" قطعه"]]})}),u.jsx(n,{children:u.jsx(iu,{name:"بارهای اختصاصی",columns:["ردیف","فروشنده","تاریخ تخصیص","تعداد تخصیص","وزن تخصیص","تعداد/وزن واقعی تحویلی","عملیات"],data:o})})]})},Nu=()=>{const{pathname:a}=W();return u.jsx(u.Fragment,{children:u.jsx(X,{display:"flex",justifyContent:"center",children:u.jsxs(n,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[a===au?u.jsxs(n,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",my:g.MEDIUM,children:[u.jsx(n,{container:!0,alignItems:"center",gap:g.SMALL,children:u.jsx(n,{children:u.jsx(v,{variant:"h6",children:"مدیریت انبار"})})}),u.jsx(Cu,{})]}):u.jsx(ru,{}),a.includes(S)&&u.jsx(Au,{})]})})})};export{Nu as default}; diff --git a/build/assets/Settings-BckUi175.js b/build/assets/Settings-BckUi175.js new file mode 100644 index 0000000..3afd914 --- /dev/null +++ b/build/assets/Settings-BckUi175.js @@ -0,0 +1 @@ +import{i as t,j as r}from"./mui-vendor-CkIVaoQP.js";import{r as c}from"./index-CeyyVc1v.js";var e={},l=t;Object.defineProperty(e,"__esModule",{value:!0});var a=e.default=void 0,i=l(c()),o=r;a=e.default=(0,i.default)((0,o.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");export{a as d}; diff --git a/build/assets/ShowImage-CqhU2hmk.js b/build/assets/ShowImage-CqhU2hmk.js new file mode 100644 index 0000000..58b66a0 --- /dev/null +++ b/build/assets/ShowImage-CqhU2hmk.js @@ -0,0 +1 @@ +import{i as y,j as o,B as R,b as c,at as k,d as p,I as a}from"./mui-vendor-CkIVaoQP.js";import{r as x}from"./react-vendor-CmFgShSM.js";import{d as g}from"./Download-DQ-VVIaV.js";import{d as w}from"./Close-_jAEIgMD.js";import{r as F,m as E}from"./index-CeyyVc1v.js";var i={},I=y;Object.defineProperty(i,"__esModule",{value:!0});var m=i.default=void 0,S=I(F()),_=o;m=i.default=(0,S.default)((0,_.jsx)("path",{d:"M15.55 5.55 11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m3.89-2.42 1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48"}),"RotateRight");const A=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg"],q=({src:e,size:n})=>{const[f,s]=x.useState(!1),[h,b]=x.useState(0),C=()=>s(!0),u=()=>s(!1),l=()=>{if(!(!e||typeof e!="string"))try{const t=document.createElement("a");t.href=e;const r=e.split("/").pop()||"document";t.download=r,t.click()}catch(t){console.error("Error downloading file:",t)}},v=()=>{b(t=>t+90)},d=()=>{if(!e||typeof e!="string")return"";try{const t=e.split("/").pop();if(!t||typeof t!="string")return"";const r=t.lastIndexOf(".");return r===-1?"":t.substring(r+1).toLowerCase()}catch(t){return console.error("Error getting file extension:",t),""}},j=()=>{if(!e||typeof e!="string")return!1;const t=d();return A.includes(`.${t}`)};if(!e||typeof e!="string")return"-";if(!j()){const t=d(),r=t?`دانلود سند ${t}`:"دانلود سند";return o.jsx(R,{size:"small",variant:"contained",startIcon:o.jsx(g,{}),onClick:l,sx:{textTransform:"none",fontSize:"0.8rem",padding:"5px 10px"},children:r})}return o.jsxs("div",{children:[o.jsx(c,{component:"img",src:e,alt:"thumbnail",sx:{width:n||"50px",height:n||"50px",cursor:"pointer",borderRadius:"10px"},onClick:C}),o.jsx(k,{open:f,onClose:u,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsxs(E.div,{initial:{scale:0},animate:{scale:1},exit:{scale:0},transition:{duration:.3},style:{position:"relative"},children:[o.jsx(c,{component:"img",src:e,alt:"full-size",sx:{maxWidth:"90vw",maxHeight:"90vh",minWidth:"40vw",minHeight:"40vh",borderRadius:"10px",transform:`rotate(${h}deg)`,transition:"transform 0.3s"}}),o.jsx(p,{title:"جهت دانلود تصویر کلید کنید",placement:"right",children:o.jsx(a,{color:"primary",onClick:l,sx:{position:"absolute",top:16,right:16,backgroundColor:"rgba(255, 255, 255, 0.7)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},boxShadow:"0 2px 10px rgba(0, 0, 0, 0.2)",borderRadius:"50%"},children:o.jsx(g,{})})}),o.jsx(p,{title:"چرخش تصویر",placement:"right",children:o.jsx(a,{color:"default",onClick:v,sx:{position:"absolute",bottom:16,right:16,backgroundColor:"rgba(255, 255, 255, 0.7)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},boxShadow:"0 2px 10px rgba(0, 0, 0, 0.2)",borderRadius:"50%"},children:o.jsx(m,{})})}),o.jsx(a,{color:"secondary",onClick:u,sx:{position:"absolute",top:16,left:16,backgroundColor:"rgba(255, 255, 255, 0.7)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},boxShadow:"0 2px 10px rgba(0, 0, 0, 0.2)",borderRadius:"50%"},children:o.jsx(w,{})})]})})]})};export{q as S}; diff --git a/build/assets/SimpleTable-DBAoNnCU.js b/build/assets/SimpleTable-DBAoNnCU.js new file mode 100644 index 0000000..d8ed811 --- /dev/null +++ b/build/assets/SimpleTable-DBAoNnCU.js @@ -0,0 +1 @@ +import{j as n,d as T,aI as g,p as s}from"./mui-vendor-CkIVaoQP.js";import{M as E}from"./index-CIfb_iLp.js";import{r as i}from"./react-vendor-CmFgShSM.js";const w=({columns:d,data:u,name:f,responsive:A,cssClass:m,headerColor:x,rowColors:p})=>{const[r,C]=i.useState(u);i.useEffect(()=>{C(u)},[u]),i.useEffect(()=>{const o=u==null?void 0:u.map(e=>e==null?void 0:e.map(t=>!t&&t!==0?"":t));C(o)},[u]);const y={viewColumns:!1,search:!1,sort:!1,pagination:!1,filter:!1,print:!1,download:!1,selectableRowsHeader:!1,selectableRowsHideCheckboxes:!0,responsive:A||"vertical",fixedHeader:!0,tableBodyMaxHeight:{xs:"auto",md:"70vh"},setRowProps:(o,e)=>({style:p?{backgroundColor:p[e%p.length]}:{}}),textLabels:{body:{noMatch:"داده ای جهت نمایش موجود نیست!",toolTip:"مرتب سازی",columnHeaderTooltip:o=>`مرتب سازی بر اساس ${o.label}`},pagination:{next:"صفحه بعد",previous:"صفحه قبل",rowsPerPage:"تعداد سطر در هر صفحه:",displayRows:"تعداد کل نتایج: "},toolbar:{search:"جستجو",downloadCsv:"دانلود CSV",print:"پرینت",viewColumns:"نمایش سطون ها",filterTable:"فیلتر جدول"},filter:{all:"همه",title:"فیلترها",reset:"پاکسازی"},viewColumns:{title:"نمایش ستون ها",titleAria:"نمایش/بستن ستون های جدول"},selectedRows:{text:"سطر انتخاب شده است",delete:"پاک کردن",deleteAria:"پاک کردن سطرهای انتخاب شده"}}},F=d.map((o,e)=>({name:o,options:{customHeadRender:t=>{let a=0;r==null||r.forEach(b=>{let l=b[e];if(typeof l=="string"){const h=l.replace(/,/g,"");l=parseFloat(h)}isNaN(l)||(a+=l)});const c=a&&!isNaN(a)?`مجموع: ${a.toLocaleString()}`:"";return n.jsx(T,{title:c,arrow:!0,placement:"top",children:n.jsx("th",{style:{backgroundColor:x||"#e3e3e3",fontSize:"14px",padding:"10px",textAlign:"center",cursor:c?"help":"default"},children:t.name},t.index)})}}}));return n.jsx(g,{className:`simple-table ${m}`,width:"100%",children:n.jsx(E,{title:f,data:r,columns:F,options:y})})};w.propTypes={columns:s.PropTypes.any,data:s.PropTypes.any,name:s.PropTypes.any,expandable:s.PropTypes.bool,responsive:s.PropTypes.any,headerColor:s.PropTypes.string,rowColors:s.PropTypes.string};export{w as S}; diff --git a/build/assets/SlaghterEnterBarInfo-uCfcHEct.js b/build/assets/SlaghterEnterBarInfo-uCfcHEct.js new file mode 100644 index 0000000..fed4eda --- /dev/null +++ b/build/assets/SlaghterEnterBarInfo-uCfcHEct.js @@ -0,0 +1 @@ +import{j as u,b as I,bh as j,T as l,am as Tu,ak as R,B as gu,I as $,b0 as Iu,d as pu,b5 as Mu,a3 as qu,b2 as Pu,b3 as w}from"./mui-vendor-CkIVaoQP.js";import{L as k,j as _,h as E,c as Ou,M as Nu,u as Bu,G as i,S as D,Q as ju,A as yu,N as Vu,O as Yu,X as h,C as Wu,v as T,js as Gu,W as Au}from"./index-CeyyVc1v.js";import{r as o}from"./react-vendor-CmFgShSM.js";import{a as Hu,b as Uu,E as zu,S as Qu}from"./SlaughterManageBars-CW9paHF2.js";import{a as fu,u as bu}from"./redux-vendor-B7uoacJt.js";import{V as Ku}from"./VetFarmEditTrafficCode-D3hZa5p9.js";import{R as xu}from"./ResponsiveTable-w7hk7Uq8.js";import{R as Xu}from"./index.esm-Bu7XMDZU.js";import{d as Ju}from"./Tune-D4M2CAhp.js";import{d as Zu}from"./Edit-CqBj1Y2L.js";import{d as mu}from"./ReceiptLong-Dxpx4wPx.js";import{S as u6}from"./SlaughterEnterNoneReciept-Cle0J4bf.js";const e6=fu("SLAUGHTER_PERMISSION_TO_VET_SERVICE",async(t,{dispatch:a})=>{a(k());const{data:n,status:s}=await _.post("allow_kill_house_vet/",t);return a(E()),{data:n,status:s}}),a6=({handleSubmit:t,item:a})=>{var d,p,A,C,b,y,x,f,g;const n=Ou({message:Nu().required("پیام الزامی است")}),s=Bu({initialValues:{message:""},validationSchema:n,onSubmit:L=>{t(L)}});return u.jsx(i,{container:!0,gap:D.SMALL,direction:"column",children:u.jsxs(I,{component:"form",onSubmit:s.handleSubmit,sx:{p:2,minWidth:300},children:[u.jsxs(i,{container:!0,spacing:2,sx:{mb:3},children:[u.jsx(i,{item:!0,xs:6,children:u.jsxs(j,{spacing:1,children:[u.jsxs(j,{direction:"row",spacing:2,children:[u.jsx(l,{variant:"body2",children:"کدبار:"}),u.jsx(l,{variant:"body2",children:(a==null?void 0:a.barCode)||"-"})]}),u.jsxs(j,{direction:"row",spacing:1,children:[u.jsx(l,{variant:"body2",children:"تاریخ کشتار:"}),u.jsx(l,{variant:"body2",children:a!=null&&a.poultryRequest.sendDate?ju(new Date(a==null?void 0:a.poultryRequest.sendDate),"yyyy/MM/dd"):"-"})]}),u.jsxs(j,{direction:"row",spacing:1,children:[u.jsx(l,{variant:"body2",children:"خریدار:"}),u.jsx(l,{variant:"body2",children:`${(d=a.killhouseUser)==null?void 0:d.name}(${(C=(A=(p=a.killhouseUser)==null?void 0:p.killHouseOperator)==null?void 0:A.user)==null?void 0:C.mobile})`})]})]})}),u.jsxs(i,{item:!0,xs:6,children:[u.jsx(j,{spacing:1,children:u.jsxs(j,{direction:"row",spacing:1,children:[u.jsx(l,{variant:"body2",children:"مرغدار:"}),u.jsx(l,{variant:"body2",children:`${(y=(b=a.poultryRequest)==null?void 0:b.poultry)==null?void 0:y.unitName}`})]})}),u.jsxs(j,{direction:"row",spacing:2,children:[u.jsx(l,{variant:"body2",children:" کد سفارش:"}),u.jsx(l,{variant:"body2",children:a==null?void 0:a.poultryRequest.orderCode})]}),u.jsxs(j,{direction:"row",spacing:2,children:[u.jsx(l,{variant:"body2",children:"تعداد اولیه:"}),u.jsxs(l,{variant:"body2",children:[(x=a.quantity)==null?void 0:x.toLocaleString()," (قطعه)"]})]}),u.jsxs(j,{direction:"row",spacing:2,children:[u.jsx(l,{variant:"body2",children:"وزن :"}),u.jsxs(l,{variant:"body2",children:[(g=(f=a==null?void 0:a.weightInfo)==null?void 0:f.weight)==null?void 0:g.toLocaleString()," (کیلوگرم)"]})]})]})]}),u.jsx(Tu,{sx:{mt:1,mb:2}}),u.jsx(R,{name:"message",label:"پیام (اجباری)",multiline:!0,rows:4,value:s.values.message,onChange:s.handleChange,onBlur:s.handleBlur,error:s.touched.message&&!!s.errors.message,helperText:s.touched.message&&s.errors.message,variant:"outlined",fullWidth:!0,sx:{mb:2}}),u.jsx(gu,{fullWidth:!0,variant:"contained",color:"primary",type:"submit",disabled:!s.isValid||s.isSubmitting,children:"ثبت"})]})})},r6=fu("SLAUGHTER_UPDATE_NONE_RECIPT",async(t,{dispatch:a})=>{try{a(k());const{data:n,status:s}=await _.put("kill_house_request/0/",t);return a(E()),{data:n,status:s}}catch(n){return a(E()),{error:n.response.data.result}}}),t6=({item:t,updateTable:a})=>{const n=bu(),[s]=o.useContext(yu),[d,p]=o.useState(null),A=f=>{p(f.currentTarget)},C=()=>{p(null)},b=!!d,y=b?"popover":void 0,x=f=>{n(r6({non_receipt:!0,main_non_receipt:!0,non_receipt_message:f.message,key:t.key,role:h()})).then(g=>{n(Wu()),g.payload.error?s({vertical:"top",horizontal:"center",msg:g.payload.error,severity:"error"}):(C(),a(),s({vertical:"top",horizontal:"center",msg:"عملیات عدم وصول با موفقیت انجام شد.",severity:"success"}))})};return u.jsxs(i,{children:[u.jsx($,{"aria-describedby":y,variant:"contained",color:"primary",onClick:A,children:u.jsx(Ju,{})}),u.jsx(Iu,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:y,open:b,anchorEl:d,onClose:C,children:u.jsxs(i,{style:{padding:"20px"},container:!0,direction:"column",children:[u.jsx(pu,{title:"ورود اطلاعات بار",placement:"right",children:u.jsx($,{color:"primary",disabled:(t==null?void 0:t.documentStatus)==="بدون مشکل"||(t==null?void 0:t.documentStatus)==="بدون مشکل فاقد کیفیت",onClick:()=>{C(),n(Vu({title:"انجام عملیات",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Hu,{item:t,updateTable:a})}))},children:u.jsx(Zu,{})})}),u.jsx(pu,{title:"عدم وصول",placement:"right",children:u.jsx($,{disabled:(t==null?void 0:t.allocatedQuantity)>0,onClick:()=>{C(),n(Yu({title:"عدم وصول",content:u.jsx(a6,{handleSubmit:x,item:t})}))},"aria-label":"delete",color:"primary",children:u.jsx(mu,{})})})]})})]})},s6=()=>{var O,N,B,V,Y;const[,,t,a,n,s]=o.useContext(yu),[d,p]=o.useState(!1),[A,C]=o.useState([]),[b,y]=o.useState(0),[x,f]=o.useState(10),[g,L]=o.useState(""),[Su,M]=o.useState(1),[Fu,vu]=o.useState([]),S=bu();o.useEffect(()=>{const r=T(new Date).format("YYYY-MM-DD");a(r),s(r)},[]),o.useEffect(()=>{h()==="KillHouse"&&S(Gu()).then(r=>{var e,F;(e=r.payload.data)!=null&&e.length?p((F=r.payload.data[0])==null?void 0:F.allow):p(!1)})},[]);const v=async r=>{let e;S(k()),e=await _.get(`kill_house_request_complete_information/?search=filter&value=${g}&role=${h()}&date1=${t}&date2=${n}&page=${r}&page_size=${x}`),S(E()),C(e.data.results),y(e.data.count)},Eu=r=>{v(r),M(r)},Du=r=>{f(r),M(1)},q=async r=>{r.preventDefault(),S(k());try{const e=await _.get(`kill_house_request_complete_information/?role=${h()}&search=filter&value=${g}&date1=${t}&date2=${n}&page=1&page_size=${x}`);C(e.data.results),y(e.data.count),S(E())}catch(e){console.error("Error fetching data:",e)}},wu=()=>{P(),v(1)},Ru=r=>{L(r.target.value)},ku=r=>{a(r)},_u=r=>{s(r)};o.useEffect(()=>{v(1)},[]),o.useEffect(()=>{v(1),P()},[t,n,x]);const Lu=()=>{S(e6({allow:!d})),p(!d)};o.useEffect(()=>{const r=A==null?void 0:A.map((e,F)=>{var W,G,H,U,z,Q,K,X,J,Z,m,uu,eu,au,ru,tu,su,nu,ou,lu,cu,iu,du,Cu,hu;return[u.jsx(t6,{item:e,updateTable:wu},F),u.jsx(l,{style:{fontSize:"13px",color:e!=null&&e.trash?"red":"black"},children:e.barCode},F),u.jsx(Ku,{updateTable:v,killHouseRequestKey:e.key,trafficCode:e==null?void 0:e.trafficCode,isEditable:h()==="ProvinceOperator"||h()==="SuperAdmin"||h()==="VetSupervisor"||e.trash!==!0&&e.assignmentStateArchive==="pending"&&!(e!=null&&e.clearanceCode)&&(h()==="VetFarm"||h()==="CityVet")},F),e!=null&&e.poultryRequest.sendDate?ju(new Date(e==null?void 0:e.poultryRequest.sendDate),"yyyy/MM/dd"):"-",`${(W=e.killhouseUser)==null?void 0:W.name} (${(U=(H=(G=e.killhouseUser)==null?void 0:G.killHouseOperator)==null?void 0:H.user)==null?void 0:U.mobile})`,e!=null&&e.killer?`${(z=e==null?void 0:e.killer)==null?void 0:z.name} (${(X=(K=(Q=e==null?void 0:e.killer)==null?void 0:Q.killHouseOperator)==null?void 0:K.user)==null?void 0:X.mobile})`:"-",`${(Z=(J=e.poultryRequest)==null?void 0:J.poultry)==null?void 0:Z.unitName} (${(uu=(m=e.poultryRequest.poultry)==null?void 0:m.user)==null?void 0:uu.mobile})`,(eu=e==null?void 0:e.poultryRequest)==null?void 0:eu.age,(au=e.quantity)==null?void 0:au.toLocaleString(),(tu=(ru=e==null?void 0:e.weightInfo)==null?void 0:ru.weight)==null?void 0:tu.toLocaleString(),`${e.addCar.driver.typeCar} ${e.addCar.driver.pelak}`,`${e.addCar.driver.driverName} (${e.addCar.driver.driverMobile})`,((nu=(su=e==null?void 0:e.poultryRequest)==null?void 0:su.amount)==null?void 0:nu.toLocaleString())+" ﷼",((lu=(ou=e==null?void 0:e.weightInfo)==null?void 0:ou.killHousePrice)==null?void 0:lu.toLocaleString())+" ﷼",(cu=e.vetAcceptedRealQuantity)==null?void 0:cu.toLocaleString(),(iu=e.vetAcceptedRealWeight)==null?void 0:iu.toLocaleString(),e==null?void 0:e.poultryRequest.orderCode,(du=e==null?void 0:e.barDocumentStatus)!=null&&du.title?(Cu=e==null?void 0:e.barDocumentStatus)==null?void 0:Cu.title:"-",e==null?void 0:e.finalBarState,(hu=e==null?void 0:e.poultryRequest)!=null&&hu.freezing?"انجماد":"عادی"]});vu(r)},[A]);const[c,$u]=o.useState([]),P=()=>{S(Uu({selectedDate1:t,selectedDate2:n,text:g})).then(r=>{$u(r.payload.data)})};return u.jsxs(I,{width:"100%",children:[h()==="KillHouse"&&u.jsx(i,{container:!0,alignItems:"end",justifyContent:"center",children:u.jsxs(i,{container:!0,alignItems:"center",xs:12,justifyContent:"end",children:[u.jsx(i,{children:u.jsx(l,{color:"gray",children:"دسترسی دامپزشک برای وارد کردن اطلاعات بار"})}),u.jsx(i,{children:u.jsx(Mu,{checked:d,onChange:Lu,name:"switch-state",inputProps:{"aria-label":"switch with state"}})})]})}),u.jsxs(i,{container:!0,alignItems:"center",gap:D.SMALL,xs:12,children:[u.jsx(i,{style:{width:"150px"},children:u.jsx(Au,{label:"از تاریخ",id:"date",renderInput:r=>u.jsx(R,{...r}),value:t,onChange:r=>{ku(T(r).format("YYYY-MM-DD"))}})}),u.jsx(i,{style:{width:"150px"},children:u.jsx(Au,{label:"تا تاریخ",id:"date",renderInput:r=>u.jsx(R,{...r}),value:n,onChange:r=>{_u(T(r).format("YYYY-MM-DD"))}})}),u.jsxs("form",{onSubmit:q,children:[u.jsx(R,{autoComplete:"off",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:Ru}),u.jsx(gu,{type:"submit",onClick:q,endIcon:u.jsx(Xu,{}),children:"جستجو"})]})]}),u.jsxs(i,{container:!0,justifyContent:"center",gap:D.SMALL,xs:12,mt:2,children:[u.jsx(i,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(xu,{noPagination:!0,columns:["تعداد بار","مجموع تعداد اولیه","مجموع وزن اولیه (کیلوگرم)","مجموع تعداد تحویلی دامپزشک","مجموع وزن تحویلی دامپزشک (کیلوگرم)"],data:[[(O=c==null?void 0:c.lenKillHouseRequest)==null?void 0:O.toLocaleString(),(N=c==null?void 0:c.firstQuantity)==null?void 0:N.toLocaleString(),(B=c==null?void 0:c.firstWeight)==null?void 0:B.toLocaleString(),(V=c==null?void 0:c.vetAcceptedRealQuantity)==null?void 0:V.toLocaleString(),(Y=c==null?void 0:c.vetAcceptedRealWeight)==null?void 0:Y.toLocaleString()]],title:"خلاصه اطلاعات",isDashboard:!0})}),u.jsx(xu,{data:Fu,columns:["عملیات","کدبار","کدبهداشتی حمل و نقل","تاریخ کشتار","خریدار","کشتارکن اختصاصی","مرغدار","سن مرغ","تعداد اولیه","وزن اولیه بار(کیلوگرم)","ماشین","راننده","قیمت مرغدار","قیمت کشتارگاه","تحویلی دامپزشک (قطعه)","وزن تحویلی دامپزشک(کیلوگرم)","کد سفارش کشتار","وضعیت سند","وضعیت بار","نوع کشتار"],handlePageChange:Eu,totalRows:b,page:Su,perPage:x,handlePerRowsChange:Du,title:"درخواست های در انتظار وارد کردن اطلاعات بار"})]})]})},j6=()=>{const[t,a]=o.useState(0),n=(s,d)=>{a(d)};return u.jsxs(qu,{container:!0,direction:"column",alignItems:"center",justifyContent:"space-between",gap:D.SMALL,mt:D.MEDIUM,width:"100%",children:[u.jsx(I,{sx:{borderBottom:1,borderColor:"divider"},children:u.jsxs(Pu,{value:t,onChange:n,"aria-label":"basic tabs example",children:[u.jsx(w,{label:"وارد کردن اطلاعات بار"}),u.jsx(w,{label:"وارد کردن تک سندی بار"}),u.jsx(w,{label:"بارهای تکمیل شده"}),u.jsx(w,{label:"عدم وصول"})]})}),t===0&&u.jsx(s6,{}),t===1&&u.jsx(zu,{}),t===2&&u.jsx(Qu,{}),t===3&&u.jsx(u6,{})]})};export{j6 as S}; diff --git a/build/assets/SlaughterActiveRequests-9ZnaAVlL.js b/build/assets/SlaughterActiveRequests-9ZnaAVlL.js new file mode 100644 index 0000000..c178fd3 --- /dev/null +++ b/build/assets/SlaughterActiveRequests-9ZnaAVlL.js @@ -0,0 +1 @@ +import{j as a,I as E,a3 as r,aJ as M,T as Y,ak as p}from"./mui-vendor-CkIVaoQP.js";import{A as v,v as o,g5 as S,Q as g,g6 as b,u as I,c as T,M as k,b as w,S as l,W as y}from"./index-CeyyVc1v.js";import{A as q}from"./AdvancedTable-BYmmBtmq.js";import{f as L,u as R}from"./redux-vendor-B7uoacJt.js";import{u as U,r as t}from"./react-vendor-CmFgShSM.js";import{d as G}from"./Plagiarism-BiXORbzo.js";const H=()=>{const A=U(),[x,f]=t.useState([]),{slaughterActiveRequests:s}=L(u=>u.slaughterSlice),[,,n,d,c,C]=t.useContext(v);t.useEffect(()=>{const u=o(new Date).format("YYYY-MM-DD");d(u),C(u)},[]);const m=R();t.useEffect(()=>{m(S({selectedDate1:n,selectedDate2:c}))},[n,c]),t.useEffect(()=>{const u=s==null?void 0:s.filter((e,i)=>e.provinceKillState!=="rejected"),F="orderCode",j=[...new Map(u==null?void 0:u.map(e=>[e[F],e])).values()].map((e,i)=>[i+1,e.orderCode,g(new Date(e==null?void 0:e.sendDate),"yyyy/MM/dd"),e.poultryName,e.poultryMobile,e.city,e.province,e.age,e.mainQuantity+" قطعه",a.jsx(E,{"aria-label":"delete",color:"primary",onClick:()=>A(b+e.poultryReqId),children:a.jsx(G,{})},i)]);f(j)},[s]);const[h]=t.useState(["ردیف","کد سفارش","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","استان","سن مرغ","تعداد","مشاهده"]),D=I({initialValues:{capacity:"",recieveTime:"",recieveDate:o(Date()).format("YYYY-MM-DD hh:mm:ss")},validationSchema:T({capacity:w().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),recieveTime:k().required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!")})});return t.useEffect(()=>{D.validateForm()},[]),a.jsx(r,{container:!0,alignItems:"center",justifyContent:"space-between",gap:l.SMALL,mt:l.MEDIUM,children:a.jsx(M,{sx:{width:"100%"},children:a.jsx(q,{name:a.jsxs(r,{container:!0,alignItems:"center",gap:l.SMALL,children:[a.jsx(r,{children:a.jsx(Y,{children:"درخواست های فعال"})}),a.jsx(r,{children:a.jsx(y,{label:"از تاریخ",id:"date",renderInput:u=>a.jsx(p,{style:{width:"160px"},...u}),value:n,onChange:u=>{d(o(u).format("YYYY-MM-DD"))}})}),a.jsx(r,{children:a.jsx(y,{label:"تا تاریخ",id:"date",renderInput:u=>a.jsx(p,{style:{width:"160px"},...u}),value:c,onChange:u=>{C(o(u).format("YYYY-MM-DD"))}})})]}),columns:h,data:x})})})};export{H as S}; diff --git a/build/assets/SlaughterAgentShare-DjSsZVvD.js b/build/assets/SlaughterAgentShare-DjSsZVvD.js new file mode 100644 index 0000000..485c2a2 --- /dev/null +++ b/build/assets/SlaughterAgentShare-DjSsZVvD.js @@ -0,0 +1 @@ +import{j as e,d as cu,B as z,ak as K,T as Lu,b as Uu}from"./mui-vendor-CkIVaoQP.js";import{r as i,j as xu,f as qu}from"./react-vendor-CmFgShSM.js";import{A as Au,eo as Yu,ep as $u,j as G,G as t,S as h,W as lu,v as gu,L as Su,h as U,eq as Zu,p as Hu,a9 as iu,X as V,er as Ju,es as fu,et as Fu,O as Vu,u as Xu,C as hu,c as Ru,b as Pu,eu as Du,ev as zu,ek as Bu}from"./index-CeyyVc1v.js";import{u as q,f as Cu,a as ju}from"./redux-vendor-B7uoacJt.js";import{a as tu}from"./index.esm-Bu7XMDZU.js";import{R as du}from"./ResponsiveTable-w7hk7Uq8.js";import{A as mu}from"./AdvancedTable-BYmmBtmq.js";import{N as Qu}from"./NumberFormatCustom-DwWPj40N.js";import{S as Gu}from"./SimpleTable-DBAoNnCU.js";import{S as u6}from"./SlaughterManageInventoryAllocationOperations-Bla8JB6Q.js";import{B as s6}from"./BackButton-Crzr7NMa.js";import"./iconBase-BEJYyZsk.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";import"./Tune-D4M2CAhp.js";import"./Edit-CqBj1Y2L.js";import"./CheckCircleOutline-Ci9-hVKX.js";import"./SlaughterAllocateToGuild-Dfz5LRq5.js";import"./slaughter-get-guilds-for-allocate-B6OrhhMj.js";import"./toBase64-BzgTOHsW.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./province-policy-upload-image-CRJ-U4Kc.js";import"./LabelField-B6eRSoQP.js";const e6=()=>{var d,g,Q,S,j,H,E,b,_,O,v,p,f,o,r,y,N;const[,,l,a,c,L]=i.useContext(Au),C=q(),[A,x]=i.useState([]),{getProvinceBuyersAllocations:u,totalReportDailyBroadCast:s}=Cu(F=>F.provinceSlice);return i.useEffect(()=>{C(Yu({selectedDate1:l,selectedDate2:c})),C($u({selectedDate1:l,selectedDate2:c}))},[l,c]),i.useEffect(()=>{C(Yu({selectedDate1:l,selectedDate2:c})),C($u({selectedDate1:l,selectedDate2:c}))},[]),i.useEffect(()=>{const F=u==null?void 0:u.map((n,T)=>{var W,k,I,M,w,Y,$,P,D,Z,J,X,R,B,m,uu,su,eu,nu,ru,au,ou,Eu,bu,_u,Ou,vu,pu,yu,Nu,Tu,Wu,ku,Iu,Mu,wu;return[T+1,(W=n==null?void 0:n.informations)==null?void 0:W.buyers,(k=n==null?void 0:n.informations)==null?void 0:k.city,(I=n==null?void 0:n.informations)==null?void 0:I.numberOfSteward.toLocaleString(),(M=n==null?void 0:n.informations)==null?void 0:M.numberOfGuild.toLocaleString(),(Y=(w=n==null?void 0:n.informations)==null?void 0:w.incomingWeightOfColdHouse)==null?void 0:Y.toLocaleString(),(P=($=n==null?void 0:n.informations)==null?void 0:$.incomingQuantityOfColdHouse)==null?void 0:P.toLocaleString(),(Z=(D=n==null?void 0:n.informations)==null?void 0:D.totalPreColdWeight)==null?void 0:Z.toLocaleString(),(X=(J=n==null?void 0:n.informations)==null?void 0:J.totalPreColdQuantity)==null?void 0:X.toLocaleString(),(B=(R=n==null?void 0:n.informations)==null?void 0:R.totalNumberOfFreeCarcasses)==null?void 0:B.toLocaleString(),(uu=(m=n==null?void 0:n.informations)==null?void 0:m.totalFreeWeightOfCarcasses)==null?void 0:uu.toLocaleString(),(eu=(su=n==null?void 0:n.informations)==null?void 0:su.totalWeightOfCarcasses)==null?void 0:eu.toLocaleString(),(ru=(nu=n==null?void 0:n.informations)==null?void 0:nu.totalNumberOfCarcasses)==null?void 0:ru.toLocaleString(),(ou=(au=n==null?void 0:n.informations)==null?void 0:au.finalTotalWeightOfCarcasses)==null?void 0:ou.toLocaleString(),(bu=(Eu=n==null?void 0:n.informations)==null?void 0:Eu.finalTotalNumberOfCarcasses)==null?void 0:bu.toLocaleString(),(Ou=(_u=n==null?void 0:n.informations)==null?void 0:_u.totalAllocatedWeight)==null?void 0:Ou.toLocaleString(),(pu=(vu=n==null?void 0:n.informations)==null?void 0:vu.totalAllocatedQuantity)==null?void 0:pu.toLocaleString(),(Nu=(yu=n==null?void 0:n.informations)==null?void 0:yu.totalAcceptedAllocatedWeight)==null?void 0:Nu.toLocaleString(),(Wu=(Tu=n==null?void 0:n.informations)==null?void 0:Tu.totalAcceptedAllocatedQuantity)==null?void 0:Wu.toLocaleString(),(Iu=(ku=n==null?void 0:n.informations)==null?void 0:ku.totalRemainQuantity)==null?void 0:Iu.toLocaleString(),(wu=(Mu=n==null?void 0:n.informations)==null?void 0:Mu.totalRemainWeight)==null?void 0:wu.toLocaleString(),e.jsx(cu,{title:"خروجی اکسل",children:e.jsx("a",{href:`${G.defaults.baseURL}Broadcast_management/?date1=${l}&date2=${c}&kill_house_key=${n==null?void 0:n.key}`,rel:"noreferrer",children:e.jsx(z,{color:"success",children:e.jsx(tu,{size:24})})})},T)]});x(F)},[u]),e.jsxs(t,{children:[e.jsxs(t,{container:!0,alignItems:"center",justifyContent:"start",gap:h.SMALL,mt:h.TINY,mb:h.SMALL,children:[e.jsx(t,{style:{width:160},children:e.jsx(lu,{label:"از تاریخ",renderInput:F=>e.jsx(K,{...F}),value:l,onChange:F=>{a(gu(F).format("YYYY-MM-DD"))}})}),e.jsx(t,{style:{width:160},children:e.jsx(lu,{label:"تا تاریخ",renderInput:F=>e.jsx(K,{...F}),value:c,onChange:F=>{L(gu(F).format("YYYY-MM-DD"))}})}),e.jsx(cu,{title:"خروجی اکسل",children:e.jsx("a",{href:A!=null&&A.length?`${G.defaults.baseURL}all_inventory_excel/?date1=${l}&date2=${c}`:"#",rel:"noreferrer",children:e.jsx(z,{disabled:!(A!=null&&A.length),color:"success",children:e.jsx(tu,{size:32})})})})]}),e.jsx(t,{mb:h.SMALL,isDashboard:!0,children:e.jsx(du,{noPagination:!0,isDashboard:!0,title:"خلاصه اطلاعات",columns:["تعداد خریداران","وزن ورودی از سردخانه","تعداد ورودی از سردخانه","تعداد پیش سرد","وزن پیش سرد","وزن خرید خارج از استان","تعداد خرید خارج از استان","وزن بارهای امروز","تعداد بارهای امروز","وزن کل انبار","تعداد کل انبار","وزن توزیع شده","تعداد توزیع شده","وزن توزیع تحویل شده","تعداد توزیع تحویل شده","وزن مانده در انبار","تعداد مانده در انبار","تعداد مباشر تخصیصی","تعداد صنف تخصیصی"],data:[[(d=s==null?void 0:s.buyers)==null?void 0:d.toLocaleString(),(g=s==null?void 0:s.incomingWeightOfColdHouse)==null?void 0:g.toLocaleString(),(Q=s==null?void 0:s.incomingQuantityOfColdHouse)==null?void 0:Q.toLocaleString(),(S=s==null?void 0:s.totalPreColdQuantity)==null?void 0:S.toLocaleString(),(j=s==null?void 0:s.totalPreColdWeight)==null?void 0:j.toLocaleString(),(H=s==null?void 0:s.totalFreeWeightOfCarcasses)==null?void 0:H.toLocaleString(),(E=s==null?void 0:s.totalNumberOfFreeCarcasses)==null?void 0:E.toLocaleString(),(b=s==null?void 0:s.totalWeightOfCarcasses)==null?void 0:b.toLocaleString(),(_=s==null?void 0:s.totalNumberOfCarcasses)==null?void 0:_.toLocaleString(),(O=s==null?void 0:s.finalTotalWeightOfCarcasses)==null?void 0:O.toLocaleString(),(v=s==null?void 0:s.finalTotalNumberOfCarcasses)==null?void 0:v.toLocaleString(),(p=s==null?void 0:s.totalAllocatedWeight)==null?void 0:p.toLocaleString(),(f=s==null?void 0:s.totalAllocatedQuantity)==null?void 0:f.toLocaleString(),(o=s==null?void 0:s.totalAcceptedAllocatedWeight)==null?void 0:o.toLocaleString(),(r=s==null?void 0:s.totalAcceptedAllocatedQuantity)==null?void 0:r.toLocaleString(),(y=s==null?void 0:s.totalRemainQuantity)==null?void 0:y.toLocaleString(),(N=s==null?void 0:s.totalRemainWeight)==null?void 0:N.toLocaleString(),s==null?void 0:s.numberOfSteward.toLocaleString(),s==null?void 0:s.numberOfGuild.toLocaleString()]]})}),e.jsx(t,{container:!0,alignItems:"center",justifyContent:"start",gap:h.SMALL,mt:h.MEDIUM}),e.jsx(du,{paginated:!0,title:"جزئیات پخش",columns:["ردیف","خریدار","شهرستان","تعداد مباشر تخصیصی","تعداد صنف تخصیصی","وزن ورودی از سردخانه","تعداد ورودی از سردخانه","وزن پیش سرد","تعداد پیش سرد","تعداد خرید خارج از استان","وزن خرید خارج از استان","وزن بارهای امروز","تعداد بارهای امروز","وزن کل انبار","تعداد کل انبار","وزن توزیع شده","تعداد توزیع شده","وزن توزیع تحویل شده","تعداد توزیع تحویل شده","تعداد مانده در انبار","وزن مانده در انبار","جزئیات"],data:A})]})},Ku=ju("PROVINCE_BUYER_REAL_CARCASSES_SERVICE",async(l,{dispatch:a})=>{try{a(Su());const{data:c,status:L}=await G.put("automatic-steward-allocation/0/",l);return a(U()),{data:c,status:L}}catch(c){return a(U()),{error:c.response.data.result}}}),n6=ju("PROVINCE_AUTOMATIC_STEWARD_ALLOCATION_SERVICE",async(l,{dispatch:a})=>{try{a(Su());const{data:c,status:L}=await G.put("automatic-steward-allocation/0/",l);return a(U()),{data:c,status:L}}catch(c){return a(U()),{error:c.response.data.result}}}),r6=ju("PROVINCE_UPDATE_ALLOCATE_STEWARDS_SERVICE",async(l,{dispatch:a})=>{try{a(Su());const{data:c,status:L}=await G.post("first-automatic-steward-allocation/",l);return a(U()),{data:c,status:L}}catch(c){return a(U()),{error:c.response.data.result}}}),a6=()=>{const l=q(),{id:a}=xu(),[c,L]=i.useState([]),{slaughterManageInventoryAllocations:C}=Cu(x=>x.slaughterSlice),[,,A]=i.useContext(Au);return i.useEffect(()=>{l(Zu({kill_house_key:a,date:A}))},[]),i.useEffect(()=>{const x=C==null?void 0:C.map((u,s)=>{var Q,S,j,H,E,b,_,O,v,p,f,o,r,y,N,F,n,T,W,k,I,M,w,Y,$,P,D;let d,g;return u.sellerType==="guilds"?g="صنف":u.sellerType==="steward"&&(g="مباشر"),u.sellType==="free"?d="آزاد":u.type==="manual"?d="اختصاصی (دستی)":d="اختصاصی (اتوماتیک)",[s+1,u!=null&&u.guilds?(Q=u==null?void 0:u.guilds)==null?void 0:Q.guildsId:(j=(S=u==null?void 0:u.steward)==null?void 0:S.guilds)==null?void 0:j.guildsId,Hu(u.date),g,d,u!=null&&u.guilds?(H=u==null?void 0:u.guilds)==null?void 0:H.guildsName:(b=(E=u==null?void 0:u.steward)==null?void 0:E.guilds)==null?void 0:b.guildsName,u!=null&&u.guilds?(_=u==null?void 0:u.guilds)==null?void 0:_.user.fullname:(v=(O=u==null?void 0:u.steward)==null?void 0:O.guilds)==null?void 0:v.user.fullname,u!=null&&u.guilds?(p=u==null?void 0:u.guilds)==null?void 0:p.user.nationalId:(o=(f=u==null?void 0:u.steward)==null?void 0:f.guilds)==null?void 0:o.user.nationalId,u!=null&&u.guilds?(r=u==null?void 0:u.guilds)==null?void 0:r.user.mobile:(N=(y=u==null?void 0:u.steward)==null?void 0:y.guilds)==null?void 0:N.user.mobile,u!=null&&u.guilds?(F=u==null?void 0:u.guilds)==null?void 0:F.typeActivity:(T=(n=u==null?void 0:u.steward)==null?void 0:n.guilds)==null?void 0:T.typeActivity,u!=null&&u.guilds?(W=u==null?void 0:u.guilds)==null?void 0:W.areaActivity:(I=(k=u==null?void 0:u.steward)==null?void 0:k.guilds)==null?void 0:I.areaActivity,u!=null&&u.guilds?(M=u==null?void 0:u.guilds)==null?void 0:M.licenseNumber:(Y=(w=u==null?void 0:u.steward)==null?void 0:w.guilds)==null?void 0:Y.licenseNumber,u!=null&&u.guilds?($=u==null?void 0:u.guilds)==null?void 0:$.address.city.name:(D=(P=u==null?void 0:u.steward)==null?void 0:P.guilds)==null?void 0:D.address.city.name,u==null?void 0:u.numberOfCarcasses,u==null?void 0:u.weightOfCarcasses,u!=null&&u.loggedRegistrationCode?u.loggedRegistrationCode:"-",e.jsx(u6,{item:u},s)]});L(x)},[C]),e.jsx(t,{width:"100%",children:e.jsx(Gu,{name:e.jsx(t,{container:!0,alignItems:"center",gap:h.SMALL,justifyContent:"space-between",children:e.jsx(Lu,{children:"مدیریت کل تخصیصات"})}),columns:["ردیف","شناسه صنف","تاریخ ثبت","ماهیت","نوع تخصیص","نام واحد صنفی","نام شخص/شرکت","کدملی","موبایل","نوع فعالیت","حوزه فعالیت","شماره مجوز","شهرستان","حجم لاشه","وزن لاشه","کداحراز","عملیات"],data:c})})},o6=()=>{var E,b,_,O,v,p;const l=q();let a=iu(new Date).format("YYYY-MM-DD");const{id:c,date:L}=xu(),[C,A]=i.useState(iu(new Date).format("YYYY-MM-DD"));V()==="KillHouse"?a=C:a=L;const[x,u]=i.useState([]),{getProvinceBuyerStewardAllocation:s,provinceGetTotalReportAgentShare:d}=Cu(f=>f.provinceSlice),{slaughterUpdatedInventoryStock:g}=Cu(f=>f.slaughterSlice),Q=()=>{l(Fu({date:a,kill_house_key:c}))};i.useEffect(()=>{l(Ju({date:a,kill_house_key:c})),V()==="KillHouse"&&l(r6({kill_house_key:c,date:a})).then(()=>{l(fu({date:a,killHouseKey:c})).then(()=>{l(Fu({date:a,kill_house_key:c}))})}),V()==="ProvinceOperator"&&l(fu({date:a,killHouseKey:c})).then(()=>{l(Fu({date:a,kill_house_key:c}))})},[a]);const S=()=>{l(fu({date:a,killHouseKey:c}))};i.useEffect(()=>{const f=s==null?void 0:s.map(o=>{var r,y,N,F,n,T,W,k,I,M,w,Y,$,P,D;return[o.steward.guilds.guildsId,o.steward.guilds.steward?"مباشر":"صنف",o.steward.guilds.guildsName,o.steward.guilds.user.fullname,(N=(y=(r=o.steward)==null?void 0:r.guilds)==null?void 0:y.user)==null?void 0:N.mobile,`${(n=(F=o.steward)==null?void 0:F.guilds)==null?void 0:n.typeActivity}/${(W=(T=o.steward)==null?void 0:T.guilds)==null?void 0:W.areaActivity}`,(I=(k=o.steward)==null?void 0:k.guilds)==null?void 0:I.licenseNumber,(w=(M=o.steward)==null?void 0:M.guilds)==null?void 0:w.address.city.name,e.jsxs(t,{container:!0,direction:"column",children:[e.jsx(t,{children:`${(Y=o==null?void 0:o.numberOfCarcasses)==null?void 0:Y.toLocaleString()} قطعه`}),e.jsx(t,{children:`${($=o==null?void 0:o.weightOfCarcasses)==null?void 0:$.toLocaleString()} کیلوگرم`})]},o.key),e.jsxs(t,{container:!0,direction:"column",children:[o.state==="accepted"&&e.jsxs(e.Fragment,{children:[e.jsx(t,{children:`${(P=o==null?void 0:o.realNumberOfCarcasses)==null?void 0:P.toLocaleString()} قطعه`}),e.jsx(t,{children:`${(D=o==null?void 0:o.realWeightOfCarcasses)==null?void 0:D.toLocaleString()} کیلوگرم`})]}),!o.systemRegistrationCode&&e.jsx(t,{children:e.jsx(z,{onClick:()=>{l(Vu({title:"ویرایش تعداد / وزن لاشه",content:e.jsx(l6,{realWeightOfCarcasses:o.realWeightOfCarcasses,realNumberOfCarcasses:o.realNumberOfCarcasses,item:o,updateTable:S},o.key)}))},children:o.state==="accepted"?"ویرایش":"وارد کردن اطلاعات"})})]},o.key),e.jsx(C6,{loggedRegistrationCode:o.loggedRegistrationCode,item:o,updateTable:S,updateInventory:Q},o.key)]});u(f)},[s]);const[j,H]=i.useState(new Date(a));return i.useEffect(()=>{const f=new Date(j);f.setDate(new Date(a).getDate()-1),H(f)},[a]),e.jsxs(t,{container:!0,alignItems:"center",justifyContent:"start",gap:h.SMALL,children:[e.jsx(t,{container:!0,alignItems:"center",justifyContent:"start",gap:h.SMALL,children:V()==="KillHouse"&&e.jsx(lu,{label:"تاریخ",id:"date",renderInput:f=>e.jsx(K,{style:{width:"150px"},...f}),value:a,onChange:f=>{A(iu(f).format("YYYY-MM-DD"))}})}),e.jsx(t,{width:"100%",children:e.jsx(Gu,{name:e.jsxs(t,{container:!0,alignItems:"center",children:[e.jsxs(Lu,{children:["سهم بندی برای تاریخ کشتار مورخ ",Hu(j)," ",d!=null&&d.killer?"کشتارکن":"کشتارگاه"," ",d==null?void 0:d.name]}),e.jsx(cu,{title:"خروجی اکسل",children:e.jsx("a",{href:`${G.defaults.baseURL}Broadcast_management/?date=${L}&kill_house_key=${c}`,rel:"noreferrer",children:e.jsx(z,{color:"success",children:e.jsx(tu,{size:32})})})})]}),columns:["حجم لاشه ها","وزن لاشه ها (کیلوگرم)","حجم لاشه تخصیص داده شده","وزن تخصیص داده شده (کیلوگرم)","حجم لاشه قابل تخصیص","وزن قابل تخصیص (کیلوگرم)"],data:[[(E=g==null?void 0:g.totalNumberOfCarcasses)==null?void 0:E.toLocaleString(),(b=g==null?void 0:g.totalWeightOfCarcasses)==null?void 0:b.toLocaleString(),(_=g==null?void 0:g.allocatedTotalNumberOfCarcasses)==null?void 0:_.toLocaleString(),(O=g==null?void 0:g.allocatedTotalWeightOfCarcasses)==null?void 0:O.toLocaleString(),(v=g==null?void 0:g.remainTotalNumberOfCarcasses)==null?void 0:v.toLocaleString(),(p=g==null?void 0:g.remainTotalWeightOfCarcasses)==null?void 0:p.toLocaleString()]]})}),(V()==="ProvinceOperator"||V()==="SuperAdmin")&&e.jsx(a6,{}),V()==="KillHouse"&&e.jsx(mu,{name:e.jsx(t,{container:!0,alignItems:"center",gap:h.SMALL}),columns:["شناسه صنف","ماهیت","نام واحد صنفی","نام شخص/شرکت","موبایل","نوع/حوزه فعالیت","شماره مجوز","شهرستان","تعداد/وزن لاشه پیشنهادی","تعداد/وزن لاشه تحویلی","کداحراز"],data:x})]})},c6=Ru({number1:Pu().required("این فیلد اجباری است"),number2:Pu().required("این فیلد اجباری است")}),l6=({updateTable:l,item:a})=>{const c=q(),[L]=i.useContext(Au),C=Xu({initialValues:{number1:a.realNumberOfCarcasses,number2:a.realWeightOfCarcasses},validationSchema:c6,onSubmit:A=>{}});return i.useEffect(()=>{C.validateForm()},[]),e.jsxs(t,{container:!0,direction:"column",width:"100%",gap:h.SMALL,children:[e.jsx(Qu,{label:"وزن (کیلوگرم)",id:"number2",allowLeadingZeros:!0,thousandSeparator:",",onChange:C.handleChange,onBlur:C.handleBlur,value:C.values.number2,error:C.touched.number2&&!!C.errors.number2,helperText:C.touched.number2&&C.errors.number2}),e.jsx(Qu,{label:"تعداد",id:"number1",allowLeadingZeros:!0,thousandSeparator:",",onChange:C.handleChange,onBlur:C.handleBlur,value:C.values.number1,error:C.touched.number1&&!!C.errors.number1,helperText:C.touched.number1&&C.errors.number1}),e.jsx(z,{variant:"contained",disabled:!C.isValid,onClick:()=>{c(Ku({confirm_information:!0,steward_allocation_key:a.key,real_number_of_carcasses:Number(C.values.number1),real_weight_of_carcasses:Number(C.values.number2)})).then(A=>{c(hu()),A.payload.error?L({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"}):(l(),L({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت"})]})},C6=({loggedRegistrationCode:l,item:a,updateTable:c,updateInventory:L})=>{const C=q(),[A]=i.useContext(Au),[x,u]=i.useState(l),s=d=>{u(d.target.value)};return console.log(a.systemRegistrationCode,"zzzz"),e.jsx(t,{container:!0,width:"100%",flexWrap:"nowrap",alignItems:"center",justifyContent:"center",children:a.systemRegistrationCode?e.jsxs(t,{children:[e.jsx(K,{value:x,size:"small",onChange:s,style:{width:"85px"},disabled:a==null?void 0:a.finalRegistration}),!(a!=null&&a.finalRegistration)&&e.jsx(z,{size:"small",onClick:()=>{C(Ku({enter_registration_code:!0,steward_allocation_key:a.key,logged_registration_code:x,role:V()})).then(d=>{d.payload.error?A({vertical:"top",horizontal:"center",msg:d.payload.error,severity:"error"}):(c(),A({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت"})]}):e.jsx(z,{disabled:a.state!=="accepted",onClick:()=>{C(Vu({title:"ارسال کداحراز",content:e.jsxs(t,{container:!0,gap:h.SMALL,children:[e.jsx(Lu,{children:"در صورت ارسال کداحراز انجام هیچگونه عملیاتی مانند حذف و ویرایش امکان پذیر نمی باشد."}),e.jsxs(t,{container:!0,direction:"column",gap:h.TINY,width:"100%",children:[e.jsx(z,{fullWidth:!0,variant:"contained",onClick:()=>{C(n6({send_registration_code:!0,steward_allocation_list:[a.key]})).then(d=>{d.payload.error?A({vertical:"top",horizontal:"center",msg:d.payload.error,severity:"error"}):(C(hu()),c(),L(),A({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),e.jsx(z,{fullWidth:!0,color:"error",variant:"contained",onClick:()=>{C(hu())},children:"لغو"})]})]})}))},children:"ارسال کداحراز"})})},t6=()=>{var d,g,Q,S,j,H,E,b,_,O,v,p,f;const[,,l,a,c,L]=i.useContext(Au),C=q(),[A,x]=i.useState([]),{getProvinceStewardAllocations:u,totalReportStewardDailyBroadCast:s}=Cu(o=>o.provinceSlice);return i.useEffect(()=>{C(Du({selectedDate1:l,selectedDate2:c})),C(zu({selectedDate1:l,selectedDate2:c}))},[l,c]),i.useEffect(()=>{C(Du({selectedDate1:l,selectedDate2:c})),C(zu({selectedDate1:l,selectedDate2:c}))},[]),i.useEffect(()=>{const o=u==null?void 0:u.map((r,y)=>{var N,F,n,T,W,k,I,M,w,Y,$,P,D,Z,J,X,R,B,m,uu,su,eu,nu,ru,au,ou;return[y+1,(N=r==null?void 0:r.informations)==null?void 0:N.buyers,(F=r==null?void 0:r.informations)==null?void 0:F.city,(T=(n=r==null?void 0:r.informations)==null?void 0:n.totalFreeWeightOfCarcasses)==null?void 0:T.toLocaleString(),(k=(W=r==null?void 0:r.informations)==null?void 0:W.totalNumberOfFreeCarcasses)==null?void 0:k.toLocaleString(),(M=(I=r==null?void 0:r.informations)==null?void 0:I.totalWeightOfCarcasses)==null?void 0:M.toLocaleString(),(Y=(w=r==null?void 0:r.informations)==null?void 0:w.totalNumberOfCarcasses)==null?void 0:Y.toLocaleString(),(P=($=r==null?void 0:r.informations)==null?void 0:$.finalTotalWeightOfCarcasses)==null?void 0:P.toLocaleString(),(Z=(D=r==null?void 0:r.informations)==null?void 0:D.finalTotalNumberOfCarcasses)==null?void 0:Z.toLocaleString(),(X=(J=r==null?void 0:r.informations)==null?void 0:J.totalAllocatedWeight)==null?void 0:X.toLocaleString(),(B=(R=r==null?void 0:r.informations)==null?void 0:R.totalAllocatedQuantity)==null?void 0:B.toLocaleString(),(uu=(m=r==null?void 0:r.informations)==null?void 0:m.totalAcceptedAllocatedWeight)==null?void 0:uu.toLocaleString(),(eu=(su=r==null?void 0:r.informations)==null?void 0:su.totalAcceptedAllocatedQuantity)==null?void 0:eu.toLocaleString(),(ru=(nu=r==null?void 0:r.informations)==null?void 0:nu.totalRemainQuantity)==null?void 0:ru.toLocaleString(),(ou=(au=r==null?void 0:r.informations)==null?void 0:au.totalRemainWeight)==null?void 0:ou.toLocaleString(),e.jsx(cu,{title:"خروجی اکسل",children:e.jsx("a",{href:`${G.defaults.baseURL}steward_ware_house_total_report_daily_detail_excel/?date1=${l}&date2=${c}&key=${r==null?void 0:r.key}`,rel:"noreferrer",children:e.jsx(z,{color:"success",children:e.jsx(tu,{size:24})})})},y)]});x(o)},[u]),e.jsxs(t,{children:[e.jsxs(t,{container:!0,alignItems:"center",justifyContent:"start",gap:h.SMALL,mt:h.TINY,mb:h.SMALL,children:[e.jsx(t,{style:{width:160},children:e.jsx(lu,{label:"از تاریخ",renderInput:o=>e.jsx(K,{...o}),value:l,onChange:o=>{a(gu(o).format("YYYY-MM-DD"))}})}),e.jsx(t,{style:{width:160},children:e.jsx(lu,{label:"تا تاریخ",renderInput:o=>e.jsx(K,{...o}),value:c,onChange:o=>{L(gu(o).format("YYYY-MM-DD"))}})}),e.jsx(cu,{title:"خروجی اکسل",children:e.jsx("a",{href:A!=null&&A.length?`${G.defaults.baseURL}steward_ware_house_total_report_daily_excel/?date1=${l}&date2=${c}`:"#",rel:"noreferrer",children:e.jsx(z,{disabled:!(A!=null&&A.length),color:"success",children:e.jsx(tu,{size:32})})})})]}),e.jsx(t,{isDashboard:!0,mb:h.SMALL,children:e.jsx(du,{title:"خلاصه اطلاعات",noPagination:!0,isDashboard:!0,columns:["تعداد خریداران","وزن خرید خارج از استان","تعداد خرید خارج از استان","وزن بارهای امروز","تعداد بارهای امروز","وزن کل انبار","تعداد کل انبار","وزن توزیع شده","تعداد توزیع شده","وزن توزیع تحویل شده","تعداد توزیع تحویل شده","وزن مانده در انبار","تعداد مانده در انبار","تعداد صنف تخصیصی"],data:[[(d=s==null?void 0:s.buyers)==null?void 0:d.toLocaleString(),(g=s==null?void 0:s.totalFreeWeightOfCarcasses)==null?void 0:g.toLocaleString(),(Q=s==null?void 0:s.totalNumberOfFreeCarcasses)==null?void 0:Q.toLocaleString(),(S=s==null?void 0:s.totalWeightOfCarcasses)==null?void 0:S.toLocaleString(),(j=s==null?void 0:s.totalNumberOfCarcasses)==null?void 0:j.toLocaleString(),(H=s==null?void 0:s.finalTotalWeightOfCarcasses)==null?void 0:H.toLocaleString(),(E=s==null?void 0:s.finalTotalNumberOfCarcasses)==null?void 0:E.toLocaleString(),(b=s==null?void 0:s.totalAllocatedWeight)==null?void 0:b.toLocaleString(),(_=s==null?void 0:s.totalAllocatedQuantity)==null?void 0:_.toLocaleString(),(O=s==null?void 0:s.totalAcceptedAllocatedWeight)==null?void 0:O.toLocaleString(),(v=s==null?void 0:s.totalAcceptedAllocatedQuantity)==null?void 0:v.toLocaleString(),(p=s==null?void 0:s.totalRemainQuantity)==null?void 0:p.toLocaleString(),(f=s==null?void 0:s.totalRemainWeight)==null?void 0:f.toLocaleString(),s==null?void 0:s.numberOfGuild.toLocaleString()]]})}),e.jsx(t,{container:!0,alignItems:"center",justifyContent:"start",gap:h.SMALL,mt:h.MEDIUM}),e.jsx(du,{title:"جزئیات پخش",paginated:!0,columns:["ردیف","خریدار","شهرستان","وزن خرید خارج از استان","تعداد خرید خارج از استان","وزن بارهای امروز","تعداد بارهای امروز","وزن کل انبار","تعداد کل انبار","وزن توزیع شده","تعداد توزیع شده","وزن توزیع تحویل شده","تعداد توزیع تحویل شده","وزن مانده در انبار","تعداد مانده در انبار","جزئیات"],data:A})]})},P6=()=>{const l=xu(),a=l==null?void 0:l.id,{pathname:c}=qu();return e.jsx(Uu,{display:"flex",justifyContent:"center",children:e.jsxs(t,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,mt:h.SMALL,children:[e.jsx(s6,{}),c===Bu?e.jsx(t6,{}):e.jsxs(e.Fragment,{children:[!a&&e.jsx(e6,{}),a&&e.jsx(o6,{})]})]})})};export{P6 as default}; diff --git a/build/assets/SlaughterAllocateToGuild-Dfz5LRq5.js b/build/assets/SlaughterAllocateToGuild-Dfz5LRq5.js new file mode 100644 index 0000000..5361f5c --- /dev/null +++ b/build/assets/SlaughterAllocateToGuild-Dfz5LRq5.js @@ -0,0 +1 @@ +import{a as Zu,u as Uu}from"./redux-vendor-B7uoacJt.js";import{L as Hu,j as Vu,h as Tu,e8 as E,v as g,A as Xu,X as Ju,fF as Qu,c as Ku,M as ou,fI as Iu,b as gu,u as ue,G as T,W as ee,S as fu,N as Mu,C as te,fH as re}from"./index-CeyyVc1v.js";import{j as t,b as nu,ak as J,I as xu,c6 as se,b0 as ae,aJ as Pu,c7 as le,T as z,C as oe,a3 as X,al as Yu,ag as pu,ah as Au,ai as L,aj as $,aX as ne,aa as Ru,B as Nu}from"./mui-vendor-CkIVaoQP.js";import{r as l}from"./react-vendor-CmFgShSM.js";import{N as yu}from"./NumberFormatCustom-DwWPj40N.js";import{c as ie,s as ce,a as de}from"./slaughter-get-guilds-for-allocate-B6OrhhMj.js";import{I as he,f as Ce}from"./toBase64-BzgTOHsW.js";import{a as me}from"./province-policy-upload-image-CRJ-U4Kc.js";import{L as bu}from"./LabelField-B6eRSoQP.js";const je=Zu("SLAUGHTER_INVENTORY_FINAL_SUBMIT_SERVICE",async(y,{dispatch:x})=>{x(Hu());try{const{data:b,status:G}=await Vu.put("steward-allocation/0/",y);return x(Tu()),{data:b,status:G}}catch(b){return x(Tu()),{error:b.response.data.result}}}),ge=({onDateSelect:y,dayData:x={},selectedDate:b=null,label:G="انتخاب تاریخ",className:iu="",disableToday:cu=!1,maxGregorianDate:O=null,customDateFilter:D=null})=>{const[a,n]=l.useState(new E),[M,Q]=l.useState([]),[q,N]=l.useState(null),f=l.useRef(null),K=!!q,I=()=>{N(f.current)},Z=()=>{N(null)},uu=["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],P=["ش","ی","د","س","چ","پ","ج"],eu=s=>x[s]||null,k=s=>{const c=s.format("YYYY/MM/DD");if(D)return D(s,c,x);const j=new E,Y=new E().subtract("day",2),w=new E().subtract("day",1),v=j.format("YYYY/MM/DD"),C=Y.format("YYYY/MM/DD"),m=w.format("YYYY/MM/DD"),S=cu?!1:c===v;let _=!1;if(O){const h=s.toDate?s.toDate():new Date;_=g(h).isAfter(g(O),"day")}const W=x[c]!==void 0&&(x[c].active===void 0||x[c].active===!0);return!_&&(S||c===C||c===m||W)};l.useEffect(()=>{(()=>{const c=[],j=a.year(),Y=a.month(),w=a.daysInMonth();let C=new E([j,Y,1]).day();C>=1&&C<=7&&(C=C-1),C=C%7;for(let m=0;m{s&&s.isEnabled&&!s.hasZeroValue&&y&&(y(s),Z())},ru=()=>{const s=new E([a.year(),a.month()+1,1]);n(s)},du=()=>{const s=new E([a.year(),a.month()-1,1]);n(s)},U=s=>b&&b===s,su=s=>s==null?"":s.toLocaleString("fa-IR"),hu=()=>{if(!b)return"";const s=M.find(c=>c&&c.formattedDate===b);return s?`${s.day.toLocaleString("fa-IR")} ${uu[s.date.month()-1]}`:b};return t.jsxs(nu,{className:iu,sx:{width:"100%"},children:[t.jsx(J,{ref:f,fullWidth:!0,value:hu(),onClick:I,label:G,placeholder:"انتخاب تاریخ...",size:"medium",InputProps:{readOnly:!0,startAdornment:t.jsx(xu,{size:"small",onClick:I,children:t.jsx(se,{fontSize:"small"})})},sx:{cursor:"pointer",width:"100%",fontSize:{xs:"13px",sm:"16px"}}}),t.jsx(ae,{open:K,anchorEl:q,onClose:Z,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:t.jsxs(Pu,{elevation:3,sx:{p:{xs:1,sm:2},borderRadius:3,backgroundColor:"#fff",maxWidth:500,width:"99%"},children:[t.jsxs(nu,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:{xs:1,sm:2},pb:{xs:1,sm:2},borderBottom:"2px solid #f0f0f0"},children:[t.jsx(xu,{onClick:du,size:"small",children:t.jsx(le,{})}),t.jsxs(z,{variant:"h6",sx:{fontWeight:"bold",color:"#333",fontSize:{xs:"16px",sm:"20px"}},children:[uu[a.month()-1]," ",a.year()]}),t.jsx(xu,{onClick:ru,size:"small",children:t.jsx(oe,{})})]}),t.jsx(X,{container:!0,spacing:{xs:.5,sm:1},sx:{mb:{xs:.5,sm:1}},children:P.map((s,c)=>t.jsx(X,{item:!0,xs:12/7.3,children:t.jsx(nu,{sx:{textAlign:"center",fontWeight:"bold",color:"#666",fontSize:{xs:"12px",sm:"14px"},py:{xs:.5,sm:1}},children:s})},c))}),t.jsx(X,{container:!0,spacing:{xs:.5,sm:1},children:M.map((s,c)=>{if(!s)return t.jsx(X,{item:!0,xs:12/7.3,children:t.jsx(nu,{sx:{aspectRatio:"1/1"}})},`empty-${c}`);const j=eu(s.formattedDate),Y=U(s.formattedDate);let w="#fff",v="#e0e0e0",C=1,m="pointer";return!s.isEnabled||s.hasZeroValue?(w="#f5f5f5",v="#d0d0d0",C=s.hasZeroValue?.4:.25,m="not-allowed"):Y&&(w="#e3f2fd",v="#1976d2"),s.isToday&&s.isEnabled&&!s.hasZeroValue&&(v="#ff9800"),t.jsx(X,{item:!0,xs:12/7.3,children:t.jsxs(Pu,{onClick:()=>tu(s),sx:{aspectRatio:"1/1",cursor:m,transition:"all 0.2s ease",backgroundColor:w,border:{xs:`1.5px solid ${v}`,sm:`2px solid ${v}`},display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",p:{xs:.5,sm:1},gap:{xs:.25,sm:.5},opacity:C,"&:hover":s.isEnabled&&!s.hasZeroValue?{transform:"scale(1.05)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",backgroundColor:"#f5f5f5"}:{}},children:[t.jsx(z,{variant:"body1",sx:{fontWeight:"bold",fontSize:{xs:"16px",sm:"20px"},color:s.isToday?"#ff9800":"#333",lineHeight:1.2},children:s.day.toLocaleString("fa-IR")}),j&&j.value1!==void 0&&t.jsx(z,{variant:"caption",sx:{fontSize:{xs:"10px",sm:"13px"},color:"#1976d2",fontWeight:"600",lineHeight:1.2},children:su(j.value1)})]})},c)})})]})})]})},Se=({item:y,key:x,sellerType:b,buyerType:G,allocationType:iu,sellType:cu,updateTable:O,fetchApiData:D,editData:a,priceInfo:n,coldHouseKey:M,coldHouseItemKey:Q,killHouseAllocation:q,disableFreeOptions:N=!1})=>{var Eu;const f=Uu(),[K,I]=l.useState([]),[Z,uu]=l.useState([]),[P,eu]=l.useState("governmental"),[k,tu]=l.useState("true"),[ru,du]=l.useState(null),[U]=l.useContext(Xu),[su,hu]=l.useState(a!=null&&a.image?[{data_url:a.image}]:[]),[s,c]=l.useState("own"),[j,Y]=l.useState(1),[w,v]=l.useState(!1),[C,m]=l.useState(!1),[S,_]=l.useState(null),[V,W]=l.useState({}),[h,au]=l.useState(null),[d,Cu]=l.useState(null),[H,Wu]=l.useState({governmental:[],free:[]}),[p,Lu]=l.useState(g(new Date).format("YYYY-MM-DD")),[wu,mu]=l.useState(null),$u=u=>{c(u.target.value),ju({key:"",item:"",buyerType:"",allocationType:""})},zu=u=>{const r=u.target.value;eu(r)},Gu=u=>{const r=u.target.value;tu(r),r==="false"&&e.setFieldValue("price","")},Ou=u=>{if(u&&u.formattedDate){_(u.formattedDate);const r=V[u.formattedDate];if(r&&r.originalDay&&au(r.originalDay),r&&(r.amount!==void 0||r.value1!==void 0)){const i=r.amount!==void 0?r.amount:r.value1,F=Number(typeof i=="string"?i.replace(/,/g,""):i);Cu(Number.isFinite(F)?F:null)}else Cu(null)}},vu=l.useCallback(u=>{if(!Array.isArray(u))return{};const r={};return u.forEach(i=>{if(i.day&&i.amount!==void 0){const R=new E(new Date(i.day)).format("YYYY/MM/DD"),B=i.amount,A=Number(typeof B=="string"?B.replace(/,/g,""):B);r[R]={value1:A,originalDay:i.day,active:i.active===!0}}}),r},[]),lu=l.useCallback(u=>{const r=vu(u);W(r)},[vu]),Fu=l.useCallback(async()=>{try{const u=await Vu.get("/kill-house-remain-weight/",{params:{date:p}});if(u.data){Wu({governmental:u.data.governmental||[],free:u.data.free||[]});const r=P==="governmental"?u.data.governmental:u.data.free;lu(r)}}catch(u){console.error("Error fetching calendar data:",u)}},[P,lu,p]),[o,ju]=l.useState({key:x,item:y,buyerType:G,allocationType:iu});l.useEffect(()=>{Ju()==="Steward"&&c("free"),Fu()},[Fu]),l.useEffect(()=>{if(H.governmental.length>0||H.free.length>0){const u=P==="governmental"?H.governmental:H.free;lu(u),_(null),au(null),Cu(null)}},[P,H,lu]),l.useEffect(()=>{f(me()).then(u=>{var r;(r=u.payload)!=null&&r.data&&Y(u.payload.data.killHouseAllocation)}),a||(f(Qu()).then(u=>{I(u.payload.data)}),y||f(ie({free:s==="free"})).then(u=>{uu(u.payload.data)}))},[f,s]);const Du=Ku({mobile:ou().when([],{is:()=>!a,then:u=>u.required("شماره موبایل الزامی است").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),otherwise:u=>u.notRequired()}),weight:gu().required("این فیلد اجباری است!").integer("عدد باید صحیح باشد!").min(1,"یک مقدار مثبت وارد کنید!").test("max-production-date-amount",`وزن نمی‌تواند بیشتر از موجودی تاریخ تولید (${(d==null?void 0:d.toLocaleString())||0} کیلوگرم) باشد!`,function(u){return!d||d===null?!0:u<=d}),price:gu().required("این فیلد اجباری است!").min(1,"یک مقدار مثبت وارد کنید!"),wholePrice:gu().required("این فیلد اجباری است!").min(1,"یک مقدار مثبت وارد کنید!"),date:Iu().test("date-not-before-production","تاریخ نمی‌تواند قبل از تاریخ تولید باشد",function(u){return!h||!u?!0:g(u).isSameOrAfter(g(h),"day")}),...q&&{image:ou().when([],{is:()=>(!a||w)&&j>0,then:ou().required("عکس الزامی است"),otherwise:ou().notRequired()})}}),qu=u=>{var r;u[0]?(e.setFieldValue("image",Ce((r=u[0])==null?void 0:r.data_url)),v(!0)):(e.setFieldValue("image",""),v(!0)),hu(u)},e=ue({initialValues:{mobile:"",weight:(a==null?void 0:a.realWeightOfCarcasses)||"",wholePrice:(a==null?void 0:a.totalAmount)||"",price:(a==null?void 0:a.amount)||"",image:(a==null?void 0:a.image)||"",date:p},validationSchema:Du});l.useEffect(()=>{e.validateForm()},[d,h]),l.useEffect(()=>{e.setFieldValue("date",p)},[p]),l.useEffect(()=>{(n==null?void 0:n.active)===!1&&tu("false")},[n==null?void 0:n.active]),l.useEffect(()=>{k==="true"&&(n!=null&&n.active)&&e.setFieldValue("price",n==null?void 0:n.killHousePrice)},[k]),l.useEffect(()=>{k==="true"&&(n!=null&&n.active)?e.values.weight&&e.setFieldValue("wholePrice",(n==null?void 0:n.killHousePrice)*e.values.weight):e.values.weight&&e.values.price&&e.setFieldValue("wholePrice",e.values.price*e.values.weight)},[e.values.price,e.values.weight,k]);const Su=()=>{f(te()),U({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),f(re()),f(Mu({right:!1,bottom:!1,left:!1,content:null})),O&&O(),D&&D()};return t.jsxs(T,{container:!0,xs:12,direction:"column",justifyContent:"center",alignItems:"flex-start",gap:1.8,children:[!a&&t.jsx(ee,{label:"تاریخ ثبت توزیع",id:"date",renderInput:u=>t.jsx(J,{fullWidth:!0,...u,error:!!wu||u.error,helperText:wu||u.helperText}),shouldDisableDate:u=>{const r=g(u),i=g();return!r.isSame(i,"day")},value:p,onChange:u=>{if(!u){mu(null);return}const r=g(u),i=g(),F=g().subtract(1,"day");if(!(r.isSame(i,"day")||r.isSame(F,"day"))){mu("تنها امکان انتخاب «امروز» یا «دیروز» وجود دارد.");return}mu(null),Lu(g(u).format("YYYY-MM-DD"))}}),!a&&!M&&t.jsx(T,{xs:12,container:!0,children:t.jsx(Yu,{fullWidth:!0,disablePortal:!0,id:"hatching",options:K?K.map(u=>({data:u,label:`${u.name}`})):[],onChange:(u,r)=>{du(r.data)},renderInput:u=>t.jsx(J,{fullWidth:!0,...u,label:"انتخاب محصول"})})}),!a&&t.jsx(bu,{label:"خریداران",children:t.jsx(pu,{fullWidth:!0,children:t.jsxs(Au,{row:!0,"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:s,onChange:$u,sx:{justifyContent:"space-between"},children:[t.jsx(L,{value:"own",control:t.jsx($,{}),label:"صنوف اختصاصی"}),t.jsx(L,{value:"free",control:t.jsx($,{}),label:"صنوف آزاد",disabled:N})]})})}),!y&&!a&&t.jsx(T,{xs:12,container:!0,children:t.jsx(Yu,{fullWidth:!0,disablePortal:!0,id:"hatching",options:Z?Z.map(u=>{var r,i;return{data:u,label:`${u!=null&&u.steward?"مباشر":"صنف"} ${u==null?void 0:u.guildsName} ${(r=u==null?void 0:u.user)==null?void 0:r.fullname} (${(i=u==null?void 0:u.user)==null?void 0:i.mobile})`}}):[],onChange:(u,r)=>{var F,R,B,A,ku,_u,Bu;ju({item:r==null?void 0:r.data,key:(F=r==null?void 0:r.data)==null?void 0:F.key,allocationType:(R=r==null?void 0:r.data)!=null&&R.steward?"killhouse_steward":"killhouse_guild",buyerType:(B=r==null?void 0:r.data)!=null&&B.steward?"Steward":"Guild"}),e.setFieldValue("mobile",(ku=(A=r==null?void 0:r.data)==null?void 0:A.user)==null?void 0:ku.mobile),e.setFieldTouched("mobile",!0,!1),e.validateField("mobile"),new RegExp(/^09\d{9}$/).test((Bu=(_u=r==null?void 0:r.data)==null?void 0:_u.user)==null?void 0:Bu.mobile)||m(!0)},renderInput:u=>t.jsx(J,{fullWidth:!0,...u,label:"انتخاب مباشر / صنف"})})}),!y&&!a&&t.jsxs(T,{container:!0,xs:12,alignItems:"center",justifyContent:"center",p:1,gap:fu.TINY,sx:{border:2,borderColor:"#e6e6e6",borderRadius:2},children:[t.jsxs(z,{variant:"caption",color:"error",children:[t.jsx(ne,{sx:{ml:-1.25},checked:C,onChange:()=>m(!C)}),"از این قسمت میتوانید تلفن مباشر/صنف را ویرایش کنید."]}),(o==null?void 0:o.key)&&C&&t.jsx(J,{fullWidth:!0,id:"mobile",value:e.values.mobile,error:e.touched.mobile?!!e.errors.mobile:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.mobile&&e.errors.mobile?e.errors.mobile:null,label:"موبایل",autoComplete:"current-password",variant:"outlined"})]}),!y&&!a&&(n==null?void 0:n.active)!==!1&&t.jsx(bu,{label:"نوع فروش",children:t.jsx(pu,{fullWidth:!0,children:t.jsxs(Au,{row:!0,"aria-labelledby":"segment-type-radio-group",name:"segmentType",value:k,onChange:Gu,sx:{justifyContent:"space-between"},children:[t.jsx(L,{value:!0,control:t.jsx($,{}),label:"قیمت دولتی"}),t.jsx(L,{value:!1,control:t.jsx($,{}),label:"قیمت آزاد",disabled:N})]})})}),!y&&!a&&t.jsx(bu,{label:"نوع انبار",children:t.jsx(pu,{fullWidth:!0,children:t.jsxs(Au,{row:!0,"aria-labelledby":"segment-type-radio-group",name:"segmentType",value:P,onChange:zu,sx:{justifyContent:"space-between"},children:[t.jsx(L,{value:"governmental",control:t.jsx($,{}),label:"دولتی"}),t.jsx(L,{value:"free",control:t.jsx($,{}),label:"آزاد",disabled:N})]})})}),t.jsxs(T,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:fu.TINY,sx:{width:"100%"},direction:"column",children:[t.jsx(ge,{onDateSelect:Ou,dayData:V,selectedDate:S,maxGregorianDate:p,label:`تاریخ تولید گوشت ${d!==null?`(موجودی: ${d==null?void 0:d.toLocaleString()} کیلوگرم)`:""}`}),h&&p&&g(h).isAfter(g(p),"day")&&t.jsx(z,{sx:{color:"#d32f2f",fontSize:"0.75rem",marginTop:"4px",marginRight:"14px",textAlign:"right"},children:"تاریخ تولید نمی‌تواند بعد از تاریخ انتخابی باشد"})]}),t.jsx(yu,{allowLeadingZeros:!0,thousandSeparator:",",decimalScale:0,allowNegative:!1,fullWidth:!0,id:"weight",label:"وزن لاشه",variant:"outlined",value:e.values.weight,error:!d&&!h?!0:e.touched.weight?!!e.errors.weight:d&&e.values.weight>d,onChange:u=>{const r=u.target.value;if(r===""||r===null||r===void 0){e.setFieldValue("weight","");return}const i=Math.floor(Number(r));i>0?e.setFieldValue("weight",i):i===0&&e.setFieldValue("weight","")},onBlur:e.handleBlur,helperText:!d&&!h?"لطفاً ابتدا تاریخ تولید را انتخاب کنید!":e.touched.weight&&e.errors.weight?e.errors.weight:null,disabled:!d&&!h,sx:{"& .MuiFormHelperText-root":{color:d&&e.values.weight>d?"error.main":void 0}}}),t.jsx(yu,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"price",label:"قیمت هر کیلوگرم",variant:"outlined",InputProps:{endAdornment:t.jsx(Ru,{position:"start",children:"ریال"})},value:e.values.price,error:e.touched.price?!!e.errors.price:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.price&&e.errors.price?e.errors.price:null,disabled:k==="true"&&(n==null?void 0:n.active)}),t.jsx(yu,{disabled:!0,allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"wholePrice",label:"هزینه کل",variant:"outlined",InputProps:{endAdornment:t.jsx(Ru,{position:"start",children:"ریال"})},value:e.values.wholePrice,error:e.touched.wholePrice?!!e.errors.wholePrice:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.wholePrice&&e.errors.wholePrice?e.errors.wholePrice:null}),(q||a&&a.image)&&t.jsxs(T,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[t.jsx(he,{onChange:qu,images:su,maxNumber:1,title:"بارگزاری سند"}),e.touched.image&&!!e.errors.image&&t.jsx(z,{color:"error",children:"ثبت تصویر الزامی است"})]}),t.jsxs(T,{container:!0,xs:12,spacing:fu.SMALL,children:[t.jsx(T,{xs:6,children:t.jsx(Nu,{variant:"contained",fullWidth:!0,disabled:a?!e.isValid:!e.isValid||(M?!1:!ru)||!((Eu=o==null?void 0:o.item)!=null&&Eu.key)||!h||h&&p&&g(h).isAfter(g(p),"day"),onClick:()=>{var r,i,F,R,B;let u={};Q?u={allocation_key:Q,number_of_carcasses:0,weight_of_carcasses:e.values.weight,amount:e.values.price,total_amount:e.values.wholePrice,distribution_type:"web",...w&&{image:e.values.image}}:a?u={allocation_key:a==null?void 0:a.key,number_of_carcasses:0,weight_of_carcasses:e.values.weight,amount:e.values.price,total_amount:e.values.wholePrice,distribution_type:"web",...w&&{image:e.values.image}}:(u={seller_type:b,buyer_type:o==null?void 0:o.buyerType,guild_key:(o==null?void 0:o.buyerType)==="Guild"?(r=o==null?void 0:o.item)==null?void 0:r.key:null,steward_key:(o==null?void 0:o.buyerType)==="Steward"?(i=o==null?void 0:o.item)==null?void 0:i.key:null,kill_house_key:(o==null?void 0:o.buyerType)==="KillHouse"?(F=o==null?void 0:o.item)==null?void 0:F.key:null,cold_house_key:M||null,product_key:M?null:ru.key,type:"manual",allocation_type:M?"ColdHouse":o==null?void 0:o.allocationType,number_of_carcasses:0,weight_of_carcasses:e.values.weight,sell_type:cu,amount:e.values.price,total_amount:e.values.wholePrice,approved_price_status:k==="true",quota:P,date:p,production_date:h,distribution_type:"web",...((B=(R=o==null?void 0:o.item)==null?void 0:R.user)==null?void 0:B.mobile)!==e.values.mobile?{interface_number:e.values.mobile}:{},...su.length>0&&{image:e.values.image}},u=Object.fromEntries(Object.entries(u).filter(([,A])=>A!==null))),a?f(de(u)).then(A=>{A.payload.error?U({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"}):Su()}):f(ce(u)).then(A=>{A.payload.error?U({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"}):Su()})},children:a?"ویرایش":"ثبت"})}),t.jsx(T,{xs:6,children:t.jsx(Nu,{fullWidth:!0,variant:"outlined",color:"primary",onClick:()=>{f(Mu({right:!1,bottom:!1,content:null}))},children:"انصراف"})})]})]})};export{ge as M,Se as S,je as s}; diff --git a/build/assets/SlaughterComplaints-7R6Gs51u.js b/build/assets/SlaughterComplaints-7R6Gs51u.js new file mode 100644 index 0000000..a236eb5 --- /dev/null +++ b/build/assets/SlaughterComplaints-7R6Gs51u.js @@ -0,0 +1 @@ +import{j as e,b as q,aL as b,aM as L,T as w,aN as B,am as f,ar as E,B as v}from"./mui-vendor-CkIVaoQP.js";import{X as M,L as G,jI as K,jJ as Q,h as U,p as i,G as r,S as x,k as _,N as J}from"./index-CeyyVc1v.js";import{r as t}from"./react-vendor-CmFgShSM.js";import{u as O,f as S}from"./redux-vendor-B7uoacJt.js";import{S as g}from"./SimpleTable-DBAoNnCU.js";import{T as P}from"./Timer-DHCbB9tg.js";import{g as j,S as X}from"./getRemainedSeconds-D4cLRaa6.js";import{A as $}from"./AdvancedTable-BYmmBtmq.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";import"./toBase64-BzgTOHsW.js";import"./PublishedWithChanges-C8kvr_m4.js";const Cu=()=>{const[T,k]=t.useState(),[y,D]=t.useState(!1),N=()=>{D(!y)},F=O(),{slaughterHouseComplaints:a}=S(u=>u.slaughterSlice),W=M(),{slaughterHouseRegisteredComplaints:A}=S(u=>u.slaughterSlice);t.useEffect(()=>{F(G()),F(K()),F(Q()).then(u=>{F(U())})},[]),t.useEffect(()=>{const u=A==null?void 0:A.map((s,h)=>{var c,d;return[s.title,s.description?s.description:"بدون توضیحات",i(s==null?void 0:s.createDate),s.state==="pending"?"در حال بررسی":s.state==="accepted"?"تایید شده":"رد شده",s.percent,(c=s.image)!=null&&c.length?(d=s.image)==null?void 0:d.map((l,n)=>[e.jsx(r,{display:"inline-flex",children:e.jsx("a",{href:l,alt:"دانلود",children:e.jsx("img",{src:l,width:"80",height:"80",alt:"دانلود",style:{marginRight:"10px",borderRadius:"5px"}})})},`SlaughterPaymentFactorImage${n}`)]):"بدون پیوست"]});k(u)},[A]);const[o,R]=t.useState([]),[C,H]=t.useState([]);return t.useEffect(()=>{R(a==null?void 0:a.filter(u=>j(u.protestTime)>0)),H(a==null?void 0:a.filter(u=>j(u.protestTime)<1))},[a]),e.jsx(e.Fragment,{children:e.jsx(q,{display:"flex",justifyContent:"center",children:e.jsx(r,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:e.jsxs(r,{container:!0,justifyContent:"space-between",gap:x.SMALL,children:[e.jsxs(r,{xs:12,mt:x.MEDIUM,children:[e.jsxs(b,{xs:12,expanded:y,onChange:N,children:[e.jsx(L,{expandIcon:e.jsx(_,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:e.jsx(w,{children:"شکایات ثبت شده"})}),e.jsx(B,{children:e.jsx(r,{children:e.jsx($,{columns:[" موضوع"," توضیحات"," تاریخ ثبت"," وضعیت","درصد تلفات","پیوست تصویر"],data:T})})})]}),e.jsxs(r,{xs:12,mt:x.MEDIUM,children:[(o==null?void 0:o.length)>0&&e.jsx(f,{children:e.jsx(E,{label:"بارهای تخصیص یافته"})}),o==null?void 0:o.map((u,s)=>{var n,p;let h=j(u.protestTime);const c=(n=u.cellType)!=null&&n.cash?"نقدی":null,d=(p=u==null?void 0:u.cellType)!=null&&p.credit?"زمان دار":null,l=[c,d].filter(I=>I).join(" یا ");return e.jsxs(e.Fragment,{children:[e.jsx(g,{name:"کد سفارش",columns:["کد سفارش","نام مرغدار","تلفن","تاریخ درخواست کشتار","استان","شهرستان","تاریخ جوجه ریزی","تعداد","جمع تلفات","وزن تقریبی هر مرغ","سن مرغ","نژاد","نحوه فروش"],data:[[u.orderCode,u.fullName,u.mobile,i(u==null?void 0:u.sendDate),u.province,u.city,i(u==null?void 0:u.hatchingDate),u.totalQuantity,u.losses,u.indexWeight,u.age,u.chickenBreed,l]]},s),e.jsx(g,{name:"خودروهای دارای کد بار",columns:["کشتارگاه","نام راننده","ماشین","نوع خرید","سند خودرو بدون بار","سند خودرو با بار","تعداد","وزن بار","میانگین وزن","مهلت ثبت شکایت","عملیات"],data:[[u.killHouse,u.driverName,u.car,u.buyType==="cash"?"نقد":"نسیه",e.jsx("a",{href:u.killHouseImageWithoutLoad,alt:"دانلود سند خودرو بدون بار",children:e.jsx("img",{src:u.killHouseImageWithoutLoad,width:"50",height:"50",alt:"بدون بار",className:"images-file"})},"provinceKillRequests"),e.jsx("a",{href:u.killHouseImageWithLoad,alt:"دانلود سند خودرو بدون بار",children:e.jsx("img",{src:u.killHouseImageWithLoad,width:"50",height:"50",alt:"بدون بار",className:"images-file"})},"provinceKillRequests"),u.killHouseRequestQuantity,u.killHouseNetWeight,Math.round(u.killHouseNetWeight/u.killHouseRequestQuantity*100)/100,e.jsx(P,{seconds:h},s),e.jsx(v,{disabled:h<1,className:"avicultureNewRequestBtn",variant:"contained",onClick:()=>{F(J({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت شکایت جدید",content:e.jsx(X,{barKey:u.killHouseAssignmentKey,role:W})}))},children:"ثبت شکایت"},"test"),u.averageWeight]]},s)]})})]})]}),e.jsxs(r,{xs:12,children:[(C==null?void 0:C.length)>0&&e.jsx(f,{children:e.jsx(E,{label:"بارهای بایگانی شده"})}),C==null?void 0:C.map((u,s)=>{var l,n;const h=(l=u.cellType)!=null&&l.cash?"نقدی":null,c=(n=u==null?void 0:u.cellType)!=null&&n.credit?"زمان دار":null,d=[h,c].filter(p=>p).join(" یا ");return e.jsxs(e.Fragment,{children:[e.jsx(g,{name:"کد سفارش",columns:["کد سفارش","نام مرغدار","تلفن","تاریخ درخواست کشتار","استان","شهرستان","تاریخ جوجه ریزی","تعداد","جمع تلفات","وزن تقریبی هر مرغ","سن مرغ","نژاد","نحوه فروش"],data:[[u.orderCode,u.fullName,u.mobile,i(u==null?void 0:u.sendDate),u.province,u.city,i(u==null?void 0:u.hatchingDate),u.totalQuantity,u.losses,u.indexWeight,u.age,u.chickenBreed,d]]},s),e.jsx(g,{name:"خودروهای دارای کد بار",columns:["کشتارگاه","نام راننده","ماشین","نوع خرید","سند خودرو بدون بار","سند خودرو با بار","تعداد","وزن بار","میانگین وزن"],data:[[u.killHouse,u.driverName,u.car,u.buyType==="cash"?"نقد":"نسیه",e.jsx("a",{href:u.killHouseImageWithoutLoad,alt:"دانلود سند خودرو بدون بار",children:e.jsx("img",{src:u.killHouseImageWithoutLoad,width:"50",height:"50",alt:"بدون بار",className:"images-file"})},"provinceKillRequests"),e.jsx("a",{href:u.killHouseImageWithLoad,alt:"دانلود سند خودرو بدون بار",children:e.jsx("img",{src:u.killHouseImageWithLoad,width:"50",height:"50",alt:"بدون بار",className:"images-file"})},"provinceKillRequests"),u.killHouseRequestQuantity,u.killHouseNetWeight,Math.round(u.killHouseNetWeight/u.killHouseRequestQuantity*100)/100]]},s)]})})]})]})})})})};export{Cu as default}; diff --git a/build/assets/SlaughterEnterNoneReciept-Cle0J4bf.js b/build/assets/SlaughterEnterNoneReciept-Cle0J4bf.js new file mode 100644 index 0000000..62bebc4 --- /dev/null +++ b/build/assets/SlaughterEnterNoneReciept-Cle0J4bf.js @@ -0,0 +1 @@ +import{j as u,T as n,ag as fu,av as Bu,aw as Mu,ax as xu,B as f,b as Su,bh as l,am as Ru,bi as Nu,ah as Tu,ai as gu,aj as ju,aU as zu,ak as _,i as Ou,I as Vu,b0 as Pu,d as I}from"./mui-vendor-CkIVaoQP.js";import{r as p}from"./react-vendor-CmFgShSM.js";import{a as N,u as T,f as Wu}from"./redux-vendor-B7uoacJt.js";import{L as $,j as E,X as j,h as b,A as q,G as d,S as L,g0 as Hu,fX as Uu,g1 as Gu,C as B,N as Yu,c as Eu,M,u as ku,Q as z,r as Xu,O as Fu,p as Ku,W as yu,v as vu}from"./index-CeyyVc1v.js";import{V as Qu}from"./VetFarmEditTrafficCode-D3hZa5p9.js";import{d as Ju}from"./Tune-D4M2CAhp.js";import{d as Zu}from"./ReceiptLong-Dxpx4wPx.js";import{R as mu,a as u6}from"./index.esm-Bu7XMDZU.js";import{R as e6}from"./ResponsiveTable-w7hk7Uq8.js";import{S as bu}from"./ShowImage-CqhU2hmk.js";const r6=N("VET_FARM_CANCEL_BAR_SERVICE",async(o,{dispatch:r})=>{r($());try{const{data:a,status:s}=await E.delete("kill_house_request/0/?delete_bar&",{params:{kill_house_request_key:o.kill_house_request_key,message:o.message,role:j()}});return r(b()),{data:a,status:s}}catch(a){return r(b()),{error:a.response.data.result}}}),v6=({killHouseRequestKey:o,updateTable:r})=>{const a=T(),[s,,A,,i]=p.useContext(q),[c,C]=p.useState(null),x=h=>{C(h.target.value)};return u.jsxs(d,{container:!0,direction:"column",width:"100%",gap:L.SMALL,children:[u.jsx(n,{color:"error",children:"در صورت لغو بار کل اطلاعات حذف گردیده و تعداد مرغ تخصیصی به جوجه ریزی مرغدار برمیگردد."}),u.jsx(d,{style:{width:"100%"},children:u.jsxs(fu,{children:[u.jsx(Bu,{id:"my-select-label",children:"دلیل لغو بار"}),u.jsxs(Mu,{value:c,onChange:x,label:"دلیل لغو بار",children:[u.jsx(xu,{value:"عدم ارسال راننده توسط کشتارگاه",children:"عدم ارسال راننده توسط کشتارگاه"}),u.jsx(xu,{value:"عدم تحویل بار توسط مرغدار",children:"عدم تحویل بار توسط مرغدار"})]})]})}),u.jsx(f,{disabled:!c,variant:"contained",onClick:()=>{a(r6({kill_house_request_key:o,message:c})).then(h=>{h.payload.status?(s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),r(),a(Hu({selectedDate1:A,selectedDate2:i})),a(Uu({selectedDate1:A,selectedDate2:i})),a(Gu({selectedDate1:A,selectedDate2:i}))):s({vertical:"top",horizontal:"center",msg:h.payload.result,severity:"error"})}),a(B()),a(Yu({right:!1,bottom:!1,top:!1,content:null,size:null}))},children:"ثبت"})]})},s6=N("SLAUGHTER_NENE_RECIEPT_SERVICE",async(o,{dispatch:r})=>{try{r($());const{data:a,status:s}=await E.put("non-receipt-request/0/",o);return r(b()),{data:a,status:s}}catch(a){return r(b()),{error:a.response.data.result}}}),a6=({handleSubmit:o,item:r})=>{var A,i,c,C,x,h,F,v,g;const a=Eu({state:M().required("لطفا یک گزینه را انتخاب کنید"),message:M().required("پیام الزامی است")}),s=ku({initialValues:{state:"accepted",message:""},validationSchema:a,onSubmit:y=>{o(y)}});return u.jsx(d,{container:!0,gap:L.SMALL,direction:"column",children:u.jsxs(Su,{component:"form",onSubmit:s.handleSubmit,sx:{p:2,minWidth:300},children:[u.jsxs(d,{container:!0,spacing:2,sx:{mb:3},children:[u.jsx(d,{item:!0,xs:6,children:u.jsxs(l,{spacing:1,children:[u.jsxs(l,{direction:"row",spacing:2,children:[u.jsx(n,{variant:"body2",children:"کدبار:"}),u.jsx(n,{children:(r==null?void 0:r.barCode)||"-"})]}),u.jsxs(l,{direction:"row",spacing:1,children:[u.jsx(n,{variant:"body2",children:"تاریخ کشتار:"}),u.jsx(n,{children:r!=null&&r.poultryRequest.sendDate?z(new Date(r==null?void 0:r.poultryRequest.sendDate),"yyyy/MM/dd"):"-"})]}),u.jsx(l,{spacing:1,children:u.jsxs(l,{direction:"row",spacing:2,children:[u.jsx(n,{variant:"body2",children:"مرغدار:"}),u.jsx(n,{children:`${(i=(A=r.poultryRequest)==null?void 0:A.poultry)==null?void 0:i.unitName}`})]})})]})}),u.jsxs(d,{item:!0,xs:6,children:[u.jsxs(l,{direction:"row",spacing:2,children:[u.jsx(n,{variant:"body2",children:"خریدار:"}),u.jsx(n,{children:`${(c=r.killhouseUser)==null?void 0:c.name} (${(h=(x=(C=r.killhouseUser)==null?void 0:C.killHouseOperator)==null?void 0:x.user)==null?void 0:h.mobile})`})]}),u.jsxs(l,{direction:"row",spacing:2,children:[u.jsx(n,{variant:"body2",children:" کد سفارش:"}),u.jsx(n,{children:r==null?void 0:r.poultryRequest.orderCode})]}),u.jsxs(l,{direction:"row",spacing:2,children:[u.jsx(n,{variant:"body2",children:"تعداد اولیه:"}),u.jsxs(n,{children:[(F=r.quantity)==null?void 0:F.toLocaleString()," (قطعه)"]})]}),u.jsxs(l,{direction:"row",spacing:2,children:[u.jsx(n,{variant:"body2",children:"وزن :"}),u.jsxs(n,{children:[(g=(v=r==null?void 0:r.weightInfo)==null?void 0:v.weight)==null?void 0:g.toLocaleString()," (کیلوگرم)"]})]})]})]}),u.jsx(Ru,{sx:{mt:1,mb:2}}),u.jsxs(fu,{component:"fieldset",error:s.touched.state&&!!s.errors.state,fullWidth:!0,sx:{mb:2},children:[u.jsx(Nu,{component:"legend",children:"وضعیت"}),u.jsxs(Tu,{row:!0,name:"state",value:s.values.state,onChange:s.handleChange,onBlur:s.handleBlur,children:[u.jsx(gu,{value:"accepted",control:u.jsx(ju,{}),label:"تایید"}),u.jsx(gu,{value:"rejected",control:u.jsx(ju,{}),label:"رد"})]}),s.touched.state&&s.errors.state&&u.jsx(zu,{children:s.errors.state})]}),u.jsx(_,{name:"message",label:"پیام (اجباری)",multiline:!0,rows:4,value:s.values.message,onChange:s.handleChange,onBlur:s.handleBlur,error:s.touched.message&&!!s.errors.message,helperText:s.touched.message&&s.errors.message,variant:"outlined",fullWidth:!0,sx:{mb:2}}),u.jsx(f,{fullWidth:!0,variant:"contained",color:"primary",type:"submit",disabled:!s.isValid||s.isSubmitting,children:"ثبت"})]})})};var O={},n6=Ou;Object.defineProperty(O,"__esModule",{value:!0});var Du=O.default=void 0,o6=n6(Xu()),t6=u;Du=O.default=(0,o6.default)((0,t6.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8z"}),"Restore");const l6=({handleSubmit:o,item:r})=>{var A,i,c,C,x,h,F,v,g;const a=Eu({message:M().required("پیام الزامی است")}),s=ku({initialValues:{message:""},validationSchema:a,onSubmit:y=>{o(y)}});return u.jsx(d,{container:!0,gap:L.SMALL,direction:"column",children:u.jsxs(Su,{component:"form",onSubmit:s.handleSubmit,sx:{p:2,minWidth:300},children:[u.jsxs(d,{container:!0,spacing:2,sx:{mb:3},children:[u.jsx(d,{item:!0,xs:6,children:u.jsxs(l,{spacing:1,children:[u.jsxs(l,{direction:"row",spacing:2,children:[u.jsx(n,{variant:"body2",children:"کدبار:"}),u.jsx(n,{variant:"body2",children:(r==null?void 0:r.barCode)||"-"})]}),u.jsxs(l,{direction:"row",spacing:1,children:[u.jsx(n,{variant:"body2",children:"تاریخ کشتار:"}),u.jsx(n,{variant:"body2",children:r!=null&&r.poultryRequest.sendDate?z(new Date(r==null?void 0:r.poultryRequest.sendDate),"yyyy/MM/dd"):"-"})]}),u.jsxs(l,{direction:"row",spacing:1,children:[u.jsx(n,{variant:"body2",children:"خریدار:"}),u.jsx(n,{variant:"body2",children:`${(A=r.killhouseUser)==null?void 0:A.name}(${(C=(c=(i=r.killhouseUser)==null?void 0:i.killHouseOperator)==null?void 0:c.user)==null?void 0:C.mobile})`})]})]})}),u.jsxs(d,{item:!0,xs:6,children:[u.jsx(l,{spacing:1,children:u.jsxs(l,{direction:"row",spacing:2,children:[u.jsx(n,{variant:"body2",children:"مرغدار:"}),u.jsx(n,{variant:"body2",children:`${(h=(x=r.poultryRequest)==null?void 0:x.poultry)==null?void 0:h.unitName}`})]})}),u.jsxs(l,{direction:"row",spacing:2,children:[u.jsx(n,{variant:"body2",children:" کد سفارش:"}),u.jsx(n,{variant:"body2",children:r==null?void 0:r.poultryRequest.orderCode})]}),u.jsxs(l,{direction:"row",spacing:2,children:[u.jsx(n,{variant:"body2",children:"تعداد اولیه:"}),u.jsxs(n,{variant:"body2",children:[(F=r.quantity)==null?void 0:F.toLocaleString()," (قطعه)"]})]}),u.jsxs(l,{direction:"row",spacing:2,children:[u.jsx(n,{variant:"body2",children:"وزن :"}),u.jsxs(n,{variant:"body2",children:[(g=(v=r==null?void 0:r.weightInfo)==null?void 0:v.weight)==null?void 0:g.toLocaleString()," (کیلوگرم)"]})]})]})]}),u.jsx(Ru,{sx:{mt:1,mb:2}}),u.jsx(_,{name:"message",label:"پیام (اجباری)",multiline:!0,rows:4,value:s.values.message,onChange:s.handleChange,onBlur:s.handleBlur,error:s.touched.message&&!!s.errors.message,helperText:s.touched.message&&s.errors.message,variant:"outlined",fullWidth:!0,sx:{mb:2}}),u.jsx(f,{fullWidth:!0,variant:"contained",color:"primary",type:"submit",disabled:!s.isValid||s.isSubmitting,children:"ثبت"})]})})},c6=N("SLAUGHTER_NONE_RECIEPT_BACK_SERVICE",async(o,{dispatch:r})=>{try{r($());const{data:a,status:s}=await E.put("non-receipt-request-return/0/",o);return r(b()),{data:a,status:s}}catch(a){return r(b()),{error:a.response.data.result}}}),d6=({item:o,updateTable:r})=>{const a=T(),[s]=p.useContext(q),[A,i]=p.useState(null),c=g=>{i(g.currentTarget)},C=()=>{i(null)},x=!!A,h=x?"popover":void 0,F=g=>{a(s6({key:o==null?void 0:o.key,role:j(),state:g.state,message:g.message})).then(y=>{a(B()),y.payload.error?s({vertical:"top",horizontal:"center",msg:y.payload.error,severity:"error"}):(C(),r(),s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},v=g=>{a(c6({key:o==null?void 0:o.key,non_receipt:!1,non_receipt_return:!0,non_receipt_return_message:g.message})).then(y=>{a(B()),y.payload.error?s({vertical:"top",horizontal:"center",msg:y.payload.error,severity:"error"}):(C(),r(),s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})};return u.jsxs(d,{children:[u.jsx(Vu,{"aria-describedby":h,variant:"contained",color:"primary",onClick:c,children:u.jsx(Ju,{})}),u.jsx(Pu,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:h,open:x,anchorEl:A,onClose:C,children:u.jsxs(d,{style:{padding:"10px",width:"200px"},container:!0,direction:"column",alignItems:"flex-start",children:[["ProvinceOperator","SuperAdmin","AdminX"].includes(j())&&u.jsx(I,{title:"تایید / رد عدم وصول کشتارگاه",placement:"left-start",children:u.jsx(f,{disabled:(o==null?void 0:o.nonReceiptState)!=="pending",size:"small",color:"primary",startIcon:u.jsx(Zu,{fontSize:"small"}),onClick:()=>{C(),a(Fu({title:"تایید / رد عدم وصول کشتارگاه",content:u.jsx(a6,{handleSubmit:F,item:o})}))},children:u.jsx(n,{variant:"body2",textAlign:"left",fontWeight:600,children:"تایید / رد عدم وصول کشتارگاه"})})}),u.jsx(I,{title:"برگشت عدم وصول",placement:"left-start",children:u.jsx(f,{disabled:o==null?void 0:o.registrationCode,size:"small",color:"error",startIcon:u.jsx(Du,{fontSize:"small"}),onClick:()=>{C(),a(Fu({title:"برگشت عدم وصول",content:u.jsx(l6,{handleSubmit:v,item:o})}))},children:u.jsx(n,{variant:"body2",textAlign:"left",fontWeight:600,children:"برگشت عدم وصول"})})})]})})]})},b6=()=>{const o=Wu(t=>t.userSlice.userProfile.key),[r]=p.useContext(q),[a,s]=p.useState([]),[A,i]=p.useState(0),[c,C]=p.useState(10),[x,h]=p.useState(""),[F,v]=p.useState(1),[g,y]=p.useState([]),k=T(),wu=t=>{h(t.target.value)},[,,D,_u,w,$u]=p.useContext(q),S=async t=>{let e;k($()),e=await E.get(`non-receipt-request/?search=filter&value=${x}&role=${j()}&date1=${D}&date2=${w}&page=${t}&page_size=${c}`),k(b()),s(e.data.results),i(e.data.count),k(b())},qu=t=>{S(t),v(t)},Lu=t=>{v(1),C(t,S(1))},Iu=()=>{S(1)};p.useEffect(()=>{S(1)},[]);const V=async t=>{t.preventDefault(),k($());try{const e=await E.get(`non-receipt-request/?search=filter&value=${x}&role=${j()}&date1=${D}&date2=${w}&page=1&page_size=${c}`);s(e.data.results),i(e.data.count),k(b())}catch(e){console.error("Error fetching data:",e)}};return p.useEffect(()=>{S(1)},[D,w,c]),p.useEffect(()=>{const t=a==null?void 0:a.map((e,R)=>{var P,W,H,U,G,Y,X,K,Q,J,Z,m,uu,eu,ru,su,au,nu,ou,tu,lu,cu,du,iu,Cu,hu,pu,Au;return[F===1?R+1:R+c*(F-1)+1,u.jsx(bu,{src:(P=e==null?void 0:e.assignmentInfo)==null?void 0:P.imageWithoutBar},R),u.jsx(bu,{src:(W=e==null?void 0:e.assignmentInfo)==null?void 0:W.imageWithBar},R),e==null?void 0:e.barCode,u.jsx(Qu,{updateTable:S,killHouseRequestKey:e.key,trafficCode:e==null?void 0:e.trafficCode,isEditable:j()==="ProvinceOperator"||j()==="SuperAdmin"||j()==="AdminX"||j()==="Supporter"||j()==="VetSupervisor"||e.trash!==!0&&e.assignmentStateArchive==="pending"&&!(e!=null&&e.clearanceCode)&&(j()==="VetFarm"||j()==="CityVet")},R),((H=e==null?void 0:e.amount)==null?void 0:H.toLocaleString())+" ﷼",e!=null&&e.poultryRequest.sendDate?z(new Date(e==null?void 0:e.poultryRequest.sendDate),"yyyy/MM/dd"):"-",`${(U=e.killhouseUser)==null?void 0:U.name} (${(X=(Y=(G=e.killhouseUser)==null?void 0:G.killHouseOperator)==null?void 0:Y.user)==null?void 0:X.mobile})`,e!=null&&e.killer?`${(K=e==null?void 0:e.killer)==null?void 0:K.name} (${(Z=(J=(Q=e==null?void 0:e.killer)==null?void 0:Q.killHouseOperator)==null?void 0:J.user)==null?void 0:Z.mobile})`:"-",`${(uu=(m=e.poultryRequest)==null?void 0:m.poultry)==null?void 0:uu.unitName} (${(ru=(eu=e.poultryRequest.poultry)==null?void 0:eu.user)==null?void 0:ru.mobile})`,(su=e==null?void 0:e.poultryRequest)==null?void 0:su.age,(au=e.quantity)==null?void 0:au.toLocaleString(),(ou=(nu=e==null?void 0:e.weightInfo)==null?void 0:nu.weight)==null?void 0:ou.toLocaleString(),((lu=(tu=e==null?void 0:e.poultryRequest)==null?void 0:tu.amount)==null?void 0:lu.toLocaleString())+" ﷼",((du=(cu=e==null?void 0:e.weightInfo)==null?void 0:cu.killHousePrice)==null?void 0:du.toLocaleString())+" ﷼",`${e.addCar.driver.typeCar} ${e.addCar.driver.pelak}`,`${e.addCar.driver.driverName} (${e.addCar.driver.driverMobile})`,(iu=e.vetAcceptedRealQuantity)==null?void 0:iu.toLocaleString(),(Cu=e.vetAcceptedRealWeight)==null?void 0:Cu.toLocaleString(),e==null?void 0:e.poultryRequest.orderCode,(hu=e==null?void 0:e.poultryRequest)!=null&&hu.freezing?"انجماد":(pu=e==null?void 0:e.poultryRequest)!=null&&pu.export?"صادرات":"عادی",(Au=e==null?void 0:e.poultryRequest)!=null&&Au.freeSaleInProvince?"آزاد":"دولتی",(e==null?void 0:e.nonReceiptState)==="accepted"?"تایید شده":(e==null?void 0:e.nonReceiptState)==="rejected"?"رد شده":"درانتظار تایید",e==null?void 0:e.nonReceiptMessage,Ku(e==null?void 0:e.nonReceiptCheckDate)||"-",e!=null&&e.nonReceiptChecker&&(e!=null&&e.nonReceiptCheckerMobile)?`${e.nonReceiptChecker}(${e.nonReceiptCheckerMobile})`:"-",e==null?void 0:e.message,u.jsx(d6,{item:e,updateTable:Iu},R)]});y(t)},[a]),u.jsxs(d,{container:!0,justifyContent:"center",children:[u.jsx(d,{container:!0,alignItems:"start",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,children:u.jsxs(d,{container:!0,alignItems:"center",gap:L.SMALL,children:[u.jsx(d,{children:u.jsx(yu,{label:"از تاریخ",renderInput:t=>u.jsx(_,{...t,style:{width:"160px"},size:"small"}),value:D,onChange:t=>{_u(vu(t).format("YYYY-MM-DD"))}})}),u.jsx(d,{children:u.jsx(yu,{label:"تا تاریخ",renderInput:t=>u.jsx(_,{...t,style:{width:"160px"},size:"small"}),value:w,onChange:t=>{$u(vu(t).format("YYYY-MM-DD"))}})}),u.jsxs("form",{onSubmit:V,children:[u.jsx(_,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:wu}),u.jsx(f,{type:"submit",onClick:V,endIcon:u.jsx(mu,{}),children:"جستجو"})]}),u.jsx(I,{title:"خروجی اکسل",children:u.jsx(f,{color:"success",onClick:()=>{r({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const t=`${E.defaults.baseURL}non_receipt_request_excel/?role=${j()}&key=${o}&search=filter&value=${x}&date1=${D}&date2=${w}`;window.location.href=t},children:u.jsx(u6,{size:32})})})]})}),u.jsx(e6,{data:g,columns:["ردیف","بارنامه خالی","بارنامه پر","کدبار","کد بهداشتی حمل و نقل","قیمت مرغ زنده‌ی بار","تاریخ کشتار","خریدار","کشتارکن اختصاصی","مرغدار","سن مرغ","تعداد اولیه","وزن اولیه بار (کیلوگرم)","قیمت مرغدار","قیمت کشتارگاه","ماشین","راننده","تحویلی دامپزشک (قطعه)","وزن تحویلی دامپزشک (کیلوگرم)","کدسفارش کشتار","نوع کشتار","نوع فروش","وضعیت عدم وصول","توضیحات کشتارگاه","تاریخ (تایید / رد)","بررسی کننده","توضیحات بررسی کننده","عملیات"],handlePageChange:qu,totalRows:A,page:F,perPage:c,handlePerRowsChange:Lu,title:"عدم وصول"})]})};export{b6 as S,v6 as V}; diff --git a/build/assets/SlaughterFreeBuy-DL-UuT_T.js b/build/assets/SlaughterFreeBuy-DL-UuT_T.js new file mode 100644 index 0000000..6ee0e92 --- /dev/null +++ b/build/assets/SlaughterFreeBuy-DL-UuT_T.js @@ -0,0 +1 @@ +import{j as t,b as o}from"./mui-vendor-CkIVaoQP.js";import{f as i}from"./react-vendor-CmFgShSM.js";import{G as m,jD as p,jK as e}from"./index-CeyyVc1v.js";import{B as s}from"./BackButton-Crzr7NMa.js";import{S as n}from"./SlaughterFreeBuyBars-CobAAajK.js";import"./redux-vendor-B7uoacJt.js";import"./ResponsiveTable-w7hk7Uq8.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./toBase64-BzgTOHsW.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./Delete-C5MyLelE.js";import"./slaughter-get-provinces-CSWL-EuK.js";import"./CarPelak-BYFY8OXg.js";import"./Tune-D4M2CAhp.js";import"./EditOutlined-n5ie2Fmu.js";import"./DeleteOutlineOutlined-G071NcE9.js";import"./ShowImage-CqhU2hmk.js";import"./Download-DQ-VVIaV.js";import"./Close-_jAEIgMD.js";import"./index.esm-Bu7XMDZU.js";import"./iconBase-BEJYyZsk.js";import"./ChechClearanceCode-lPasOZZ_.js";import"./Pageview-TRcW_9jm.js";import"./Edit-CqBj1Y2L.js";import"./AddCircleOutline-C8LXM-k8.js";const Y=()=>{const{pathname:r}=i();return t.jsx(t.Fragment,{children:t.jsx(o,{display:"flex",justifyContent:"center",children:t.jsxs(m,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[t.jsx(s,{}),(r===p||r===e)&&t.jsx(n,{})]})})})};export{Y as default}; diff --git a/build/assets/SlaughterFreeBuyBars-CobAAajK.js b/build/assets/SlaughterFreeBuyBars-CobAAajK.js new file mode 100644 index 0000000..1d21767 --- /dev/null +++ b/build/assets/SlaughterFreeBuyBars-CobAAajK.js @@ -0,0 +1 @@ +import{j as e,ah as Yu,ai as Cu,aj as hu,al as m,ak as v,ag as d6,bi as C6,T as S,B as x,aa as z,i as mu,I as ju,b0 as h6,an as p6,ao as _u,b4 as xu,ap as Fu,a3 as y6,d as bu,b2 as v6,b3 as Gu}from"./mui-vendor-CkIVaoQP.js";import{r as C}from"./react-vendor-CmFgShSM.js";import{g2 as g6,L as N,j as R,h as w,A as ru,u as yu,v as uu,N as Su,c as au,G as y,S as I,M as F,fF as A6,g3 as _6,b as P,C as M,fH as u6,O as eu,r as e6,fl as x6,p as k,X as b,W as Ku}from"./index-CeyyVc1v.js";import{a as lu,u as tu,f as Uu}from"./redux-vendor-B7uoacJt.js";import{R as pu}from"./ResponsiveTable-w7hk7Uq8.js";import{I as F6,f as b6}from"./toBase64-BzgTOHsW.js";import{a as Xu,s as j6}from"./slaughter-get-provinces-CSWL-EuK.js";import{C as S6}from"./CarPelak-BYFY8OXg.js";import{d as f6}from"./Tune-D4M2CAhp.js";import{d as E6}from"./EditOutlined-n5ie2Fmu.js";import{d as B6}from"./DeleteOutlineOutlined-G071NcE9.js";import{S as Qu}from"./ShowImage-CqhU2hmk.js";import{R as w6,a as T6}from"./index.esm-Bu7XMDZU.js";import{C as Ju}from"./ChechClearanceCode-lPasOZZ_.js";import{d as I6}from"./Delete-C5MyLelE.js";function L6(u){return new D6(u)}class D6{constructor(l){this.type="lazy",this.__isYupSchema__=!0,this.__inputType=void 0,this.__outputType=void 0,this._resolve=(a,n={})=>{let o=this.builder(a,n);if(!g6(o))throw new TypeError("lazy() functions must return a valid schema");return o.resolve(n)},this.builder=l}resolve(l){return this._resolve(l.value,l)}cast(l,a){return this._resolve(l,a).cast(l,a)}validate(l,a,n){return this._resolve(l,a).validate(l,a,n)}validateSync(l,a){return this._resolve(l,a).validateSync(l,a)}validateAt(l,a,n){return this._resolve(a,n).validateAt(l,a,n)}validateSyncAt(l,a,n){return this._resolve(a,n).validateSyncAt(l,a,n)}describe(){return null}isValid(l,a){return this._resolve(l,a).isValid(l,a)}isValidSync(l,a){return this._resolve(l,a).isValidSync(l,a)}}const r6=lu("SLAUGHTER_DELETE_INVENTORY_FREE_BAR_SERVICE",async(u,{dispatch:l})=>{l(N());try{const{data:a,status:n}=await R.delete("kill_house_free_bar/0/?key="+u);return l(w()),{data:a,status:n}}catch(a){return l(w()),{error:a.response.data.result}}}),fu=lu("SLAUGHTER_EDIT_FREE_SALE_SERVICE",async(u,{dispatch:l})=>{l(N());try{const{data:a,status:n}=await R.put("kill_house_free_bar/0/",u);return l(w()),{data:a,status:n}}catch(a){return l(w()),{error:a.response.data.result}}}),W6=lu("SLAUGHTER_SUBMIT_FREE_SALE_SERVICE",async(u,{dispatch:l})=>{l(N());try{const{data:a,status:n}=await R.post("kill_house_free_bar/",u);return l(w()),{data:a,status:n}}catch(a){return l(w()),{error:a.response.data.result}}}),$6=au().shape({poultry_name:F().required("نام مرغدار الزامی است"),poultry_mobile:F().required("شماره موبایل مرغدار الزامی است").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),province:F().required("استان الزامی است"),city:F().required("شهر الزامی است"),clearance_code:F().required("کد قرنطینه الزامی است"),quantity:P().required("تعداد الزامی است").min(1,"تعداد باید بیشتر از 0 باشد"),live_weight:P().required("وزن الزامی است").min(.01,"وزن باید بیشتر از 0 باشد"),bar_image:F().required("عکس بار الزامی است")}),R6=au().shape({poultry_name:F().required("نام مرغدار الزامی است"),poultry_mobile:F().required("شماره موبایل مرغدار الزامی است").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),province:F().required("استان الزامی است"),city:F().required("شهر الزامی است"),clearance_code:F().required("کد قرنطینه الزامی است"),bar_image:F().required("عکس بار الزامی است"),number_of_carcasses:P().required("حجم لاشه الزامی است").min(1,"حجم لاشه باید بیشتر از 0 باشد"),weight_of_carcasses:P().required("وزن لاشه الزامی است").min(.01,"وزن باید بیشتر از 0 باشد")}),N6=au().shape({driverName:F(),driverMobile:F().min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد")}),a6=({formik:u,cities:l,provinces:a,isEdit:n,item:o})=>e.jsxs(e.Fragment,{children:[e.jsx(m,{fullWidth:!0,disablePortal:!0,id:"province",options:a.map(i=>({id:i.name,label:i.name})),value:u.values.province?{id:u.values.province,label:u.values.province}:null,onChange:(i,s)=>{u.setFieldValue("province",s?s.id:""),u.setFieldValue("city","")},renderInput:i=>e.jsx(v,{...i,label:"استان را انتخاب کنید",error:u.touched.province&&!!u.errors.province,helperText:u.touched.province&&u.errors.province})}),n&&e.jsxs(S,{variant:"caption",color:"error",children:["استان: ",u.values.province]}),e.jsx(m,{fullWidth:!0,disablePortal:!0,id:"city",disabled:!u.values.province,options:l.map(i=>({id:i.name,label:i.name})),value:u.values.city?{id:u.values.city,label:u.values.city}:null,onChange:(i,s)=>{u.setFieldValue("city",s?s.id:"")},renderInput:i=>e.jsx(v,{...i,label:"شهر را انتخاب کنید",error:u.touched.city&&!!u.errors.city,helperText:u.touched.city&&u.errors.city})}),n&&e.jsxs(S,{variant:"caption",color:"error",children:["شهر: ",u.values.city]})]}),P6=({formik:u,cities:l,provinces:a,isEdit:n,item:o})=>e.jsxs(e.Fragment,{children:[e.jsx(v,{id:"poultry_name",name:"poultry_name",label:"نام مرغدار",value:u.values.poultry_name,onChange:u.handleChange,onBlur:u.handleBlur,error:u.touched.poultry_name&&!!u.errors.poultry_name,helperText:u.touched.poultry_name&&u.errors.poultry_name}),e.jsx(v,{id:"poultry_mobile",name:"poultry_mobile",label:"تلفن مرغداری",value:u.values.poultry_mobile,onChange:u.handleChange,onBlur:u.handleBlur,error:u.touched.poultry_mobile&&!!u.errors.poultry_mobile,helperText:u.touched.poultry_mobile&&u.errors.poultry_mobile}),e.jsx(a6,{formik:u,cities:l,provinces:a,isEdit:n,item:o}),e.jsx(v,{id:"clearance_code",name:"clearance_code",label:"کد قرنطینه",disabled:n&&(o==null?void 0:o.registerType)==="automatic",value:u.values.clearance_code,onChange:i=>u.setFieldValue("clearance_code",i.target.value.toUpperCase()),onBlur:u.handleBlur,error:u.touched.clearance_code&&!!u.errors.clearance_code,helperText:u.touched.clearance_code&&u.errors.clearance_code}),e.jsx(v,{id:"quantity",name:"quantity",label:"حجم زنده",InputProps:{endAdornment:e.jsx(z,{position:"end",children:"قطعه"})},value:u.values.quantity,onChange:u.handleChange,onBlur:u.handleBlur,error:u.touched.quantity&&!!u.errors.quantity,helperText:u.touched.quantity&&u.errors.quantity}),e.jsx(v,{id:"live_weight",name:"live_weight",label:"وزن بار زنده",InputProps:{endAdornment:e.jsx(z,{position:"end",children:"کیلوگرم"})},value:u.values.live_weight,onChange:u.handleChange,onBlur:u.handleBlur,error:u.touched.live_weight&&!!u.errors.live_weight,helperText:u.touched.live_weight&&u.errors.live_weight})]}),O6=({formik:u,cities:l,provinces:a,isEdit:n,item:o})=>e.jsxs(e.Fragment,{children:[e.jsx(v,{id:"poultry_name",name:"poultry_name",label:"نام فروشنده",value:u.values.poultry_name,onChange:u.handleChange,onBlur:u.handleBlur,error:u.touched.poultry_name&&!!u.errors.poultry_name,helperText:u.touched.poultry_name&&u.errors.poultry_name}),e.jsx(v,{id:"poultry_mobile",name:"poultry_mobile",label:"تلفن فروشنده",value:u.values.poultry_mobile,onChange:u.handleChange,onBlur:u.handleBlur,error:u.touched.poultry_mobile&&!!u.errors.poultry_mobile,helperText:u.touched.poultry_mobile&&u.errors.poultry_mobile}),e.jsx(a6,{formik:u,cities:l,provinces:a,isEdit:n,item:o}),e.jsx(v,{id:"clearance_code",name:"clearance_code",label:"کد قرنطینه",value:u.values.clearance_code,onChange:i=>u.setFieldValue("clearance_code",i.target.value.toUpperCase()),onBlur:u.handleBlur,error:u.touched.clearance_code&&!!u.errors.clearance_code,helperText:u.touched.clearance_code&&u.errors.clearance_code}),e.jsx(v,{id:"weight_of_carcasses",name:"weight_of_carcasses",label:"وزن لاشه",InputProps:{endAdornment:e.jsx(z,{position:"end",children:"کیلوگرم"})},value:u.values.weight_of_carcasses,onChange:u.handleChange,onBlur:u.handleBlur,error:u.touched.weight_of_carcasses&&!!u.errors.weight_of_carcasses,helperText:u.touched.weight_of_carcasses&&u.errors.weight_of_carcasses}),e.jsx(v,{id:"number_of_carcasses",name:"number_of_carcasses",label:"حجم تقریبی لاشه",InputProps:{endAdornment:e.jsx(z,{position:"end",children:"قطعه"})},value:u.values.number_of_carcasses,onChange:u.handleChange,onBlur:u.handleBlur,error:u.touched.number_of_carcasses&&!!u.errors.number_of_carcasses,helperText:u.touched.number_of_carcasses&&u.errors.number_of_carcasses})]}),q6=({formikDriver:u,driverPelak:l,setDriverPelak:a})=>e.jsxs(e.Fragment,{children:[e.jsx(S6,{width:"100%",handleChange:(n,o,i,s)=>{a([n,o,i,s])}}),e.jsx(v,{label:"نام و نام خانوادگی راننده",name:"driverName",value:u.values.driverName,onChange:u.handleChange,error:u.touched.driverName&&!!u.errors.driverName,helperText:u.touched.driverName&&u.errors.driverName,fullWidth:!0}),e.jsx(v,{label:"تلفن راننده",name:"driverMobile",value:u.values.driverMobile,onChange:u.handleChange,onBlur:u.handleBlur,error:u.touched.driverMobile&&!!u.errors.driverMobile,helperText:u.touched.driverMobile&&u.errors.driverMobile,fullWidth:!0})]}),l6=({item:u,updateTable:l})=>{const a=tu(),[n]=C.useContext(ru),[o,i]=C.useState(u?(u==null?void 0:u.buyType)==="live"?"alive":"carcasses":"alive"),[s,f]=C.useState("today"),[_,A]=C.useState(null),[O,L]=C.useState(null),[H,j]=C.useState([]),[W,vu]=C.useState([]),[nu,V]=C.useState([]),[g,su]=C.useState([]),[c,gu]=C.useState([]),[ou,D]=C.useState([]),h=yu({initialValues:{buyType:u?(u==null?void 0:u.buyType)==="live"?"alive":"carcasses":"alive",poultry_name:u?u.poultryName:"",poultry_mobile:u?u.poultryMobile:"",province:u?u.province:"",city:u?u.city:"",clearance_code:u?u.barClearanceCode:"",quantity:u?u.quantity:"",live_weight:u?u.liveWeight:"",bar_image:u?" ":"",number_of_carcasses:u?u.numberOfCarcasses:"",weight_of_carcasses:u?u.weightOfCarcasses:""},validationSchema:L6(t=>t.buyType==="alive"?$6:R6),onSubmit:async t=>{try{const p={driver_name:T.values.driverName,driver_mobile:T.values.driverMobile,poultry_name:t.poultry_name,poultry_mobile:t.poultry_mobile,province:t.province,city:t.city,...t.clearance_code!==(u==null?void 0:u.barClearanceCode)&&{bar_clearance_code:t.clearance_code},bar_image:t.bar_image,killer_key:O||null,date:s==="today"?uu(new Date).format("YYYY-MM-DD"):uu(new Date).add(1,"days").format("YYYY-MM-DD"),buy_type:t.buyType==="alive"?"live":"carcass",product_key:_==null?void 0:_.key,car:ou.join(" "),...t.buyType==="alive"?{quantity:Number(t.quantity),live_weight:Number(t.live_weight)}:{number_of_carcasses:t.number_of_carcasses,weight_of_carcasses:t.weight_of_carcasses}},q=u?await a(fu({...p,key:u.key})):await a(W6(p));q.payload.error?n({vertical:"top",horizontal:"center",msg:q.payload.error,severity:"error"}):(a(Su({right:!1,bottom:!1,content:null})),l(),n({vertical:"top",horizontal:"center",msg:u?"اطلاعات با موفقیت ویرایش شد":"اطلاعات خرید شما با موفقیت ثبت شد",severity:"success"}))}catch{n({vertical:"top",horizontal:"center",msg:"خطا در ارسال اطلاعات",severity:"error"})}},validateOnMount:!0}),T=yu({initialValues:{driverName:(u==null?void 0:u.driverName)||"",driverMobile:(u==null?void 0:u.driverMobile)||""},validationSchema:N6}),cu=t=>{i(t.target.value),h.setFieldValue("buyType",t.target.value)},iu=t=>{f(t.target.value)},Au=t=>{var p;t[0]&&h.setFieldValue("bar_image",b6((p=t[0])==null?void 0:p.data_url)),gu(t)};return C.useEffect(()=>{(async()=>{try{const[p,q,du]=await Promise.all([a(A6()),a(_6()),a(j6())]);if(j(p.payload.data||[]),vu(q.payload.data||[]),V(du.payload.data||[]),u!=null&&u.province){const $=await a(Xu(u.province));su($.payload.data||[])}}catch(p){console.error(p)}})()},[a,u]),C.useEffect(()=>{h.values.province&&a(Xu(h.values.province)).then(t=>{su(t.payload.data||[])})},[h.values.province,a]),e.jsx(y,{container:!0,direction:"column",justifyContent:"center",gap:2,children:(u==null?void 0:u.registerType)!=="automatic"?e.jsxs(y,{container:!0,direction:"column",justifyContent:"center",gap:2,children:[e.jsxs(Yu,{value:o,onChange:cu,row:!0,"aria-labelledby":"buy-type-radio-group",name:"buy-type-radio-group",children:[e.jsx(Cu,{disabled:!!u,value:"alive",control:e.jsx(hu,{}),label:"مرغ زنده"}),e.jsx(Cu,{disabled:!!u,value:"carcasses",control:e.jsx(hu,{}),label:"لاشه"})]}),!u&&e.jsx(y,{xs:12,container:!0,gap:2,children:e.jsx(m,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"product-select",options:H.map(t=>({data:t,label:t.name})),onChange:(t,p)=>A(p==null?void 0:p.data),renderInput:t=>e.jsx(v,{fullWidth:!0,...t,label:"انتخاب محصول"})})}),!!W.length&&e.jsx(m,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"killer-select",options:W.map(t=>({data:t.key,label:`${t.name} (${t==null?void 0:t.phone})`})),onChange:(t,p)=>L(p==null?void 0:p.data),renderInput:t=>e.jsx(v,{fullWidth:!0,...t,label:"انتخاب کشتارکن (اختیاری)"})}),e.jsxs("form",{onSubmit:h.handleSubmit,style:{display:"flex",flexDirection:"column",gap:I.LARGE},children:[o==="alive"?e.jsx(P6,{formik:h,cities:g,provinces:nu,isEdit:!!u,item:u}):e.jsx(O6,{formik:h,cities:g,provinces:nu,isEdit:!!u,item:u}),e.jsx(q6,{formikDriver:T,driverPelak:ou,setDriverPelak:D}),o==="alive"&&e.jsxs(d6,{children:[e.jsx(C6,{id:"inventory-date-radio-group",children:"تاریخ ورود به انبار"}),e.jsxs(Yu,{value:s,onChange:iu,row:!0,"aria-labelledby":"inventory-date-radio-group",name:"inventory-date-radio-group",children:[e.jsx(Cu,{value:"today",control:e.jsx(hu,{}),label:"امروز"}),e.jsx(Cu,{value:"tomorrow",control:e.jsx(hu,{}),label:"فردا"})]})]}),e.jsx(F6,{onChange:Au,images:c,maxNumber:1,title:"تصویر بار"}),h.touched.bar_image&&!!h.errors.bar_image&&e.jsx(S,{color:"error",children:"ثبت تصویر بار الزامی است"}),e.jsx(x,{type:"submit",fullWidth:!0,variant:"contained",color:"primary",disabled:!h.isValid,children:"ثبت"})]})]}):e.jsxs(y,{container:!0,direction:"column",justifyContent:"center",gap:2,children:[e.jsx(m,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"killer-select-automatic",options:W.map(t=>({data:t.key,label:`${t.name} (${t==null?void 0:t.phone})`})),onChange:(t,p)=>L(p==null?void 0:p.data),renderInput:t=>e.jsx(v,{fullWidth:!0,...t,label:"انتخاب کشتارکن (اختیاری)"})}),e.jsx(v,{id:"quantity",name:"quantity",disabled:(u==null?void 0:u.registerType)==="automatic",label:"حجم زنده",InputProps:{endAdornment:e.jsx(z,{position:"end",children:"قطعه"})},value:h.values.quantity,onChange:h.handleChange,onBlur:h.handleBlur,error:h.touched.quantity&&!!h.errors.quantity,helperText:h.touched.quantity&&h.errors.quantity}),e.jsx(v,{id:"live_weight",name:"live_weight",disabled:(u==null?void 0:u.registerType)==="automatic",label:"وزن بار زنده",InputProps:{endAdornment:e.jsx(z,{position:"end",children:"کیلوگرم"})},value:h.values.live_weight,onChange:h.handleChange,onBlur:h.handleBlur,error:h.touched.live_weight&&!!h.errors.live_weight,helperText:h.touched.live_weight&&h.errors.live_weight}),e.jsx(x,{onClick:h.handleSubmit,type:"button",fullWidth:!0,variant:"contained",color:"primary",disabled:!h.isValid,children:"ثبت"})]})})},M6=({item:u,updateTable:l})=>{var _;const[a,n]=C.useState("0"),[o]=C.useContext(ru),i=tu(),s=yu({initialValues:{realNumber:u.numberOfCarcasses?u.numberOfCarcasses:"",realWeight:u.weightOfCarcasses?u.weightOfCarcasses:""},validationSchema:au({realNumber:P().typeError("لطفا فیلد را به درستی وارد کنید.!").required("این فیلد اجباری است!"),realWeight:P().typeError("لطفا فیلد را به درستی وارد کنید.!").required("این فیلد اجباری است!")})});C.useEffect(()=>{let A=(u==null?void 0:u.liveWeight)-s.values.realWeight;A<(u==null?void 0:u.liveWeight)?n((A/(u==null?void 0:u.liveWeight)*100).toPrecision(4)):n(0),s.setFieldValue("realNumber",Math.round(s.values.realWeight/1.5))},[s.values.realWeight]);const f=()=>{i(eu({title:"عملیات با موفقیت انجام شد",content:e.jsx(e.Fragment,{children:e.jsxs(y,{container:!0,gap:I.SMALL,justifyContent:"center",children:[e.jsx(S,{variant:"body2",color:"secondary",children:"جهت ویرایش میتوانید حداکثر تا پایان امروز یا قبل از اولین تخصیص اقدام کنید."}),e.jsx(x,{variant:"outlined",onClick:()=>{i(M())},children:"متوجه شدم"})]})})}))};return C.useEffect(()=>{s.validateForm()},[]),e.jsx(e.Fragment,{children:e.jsxs(y,{xs:12,container:!0,spacing:I.SMALL,alignItems:"center",justifyContent:"center",children:[e.jsxs(y,{container:!0,xs:12,gap:I.TINY,children:[e.jsx(y,{container:!0,xs:12,gap:I.SMALL,justifyContent:"center",children:e.jsxs(S,{color:"primary",variant:"body2",children:["وزن بار زنده: ",(_=u==null?void 0:u.liveWeight)==null?void 0:_.toLocaleString()," کیلوگرم"]})}),e.jsx(v,{fullWidth:!0,id:"realWeight",size:"small",label:"وزن لاشه",variant:"outlined",value:s.values.realWeight,error:s.touched.realWeight?!!s.errors.realWeight:null,onChange:s.handleChange,onBlur:s.handleBlur,helperText:s.touched.realWeight&&s.errors.realWeight?s.errors.realWeight:null}),e.jsx(v,{fullWidth:!0,id:"realNumber",size:"small",label:"حجم لاشه",variant:"outlined",value:s.values.realNumber,error:s.touched.realNumber?!!s.errors.realNumber:null,onChange:s.handleChange,onBlur:s.handleBlur,helperText:s.touched.realNumber&&s.errors.realNumber?s.errors.realNumber:null})]}),e.jsxs(y,{container:!0,xs:12,gap:4,alignItems:"center",mt:2,justifyContent:"space-between",children:[e.jsxs(y,{children:[e.jsxs(S,{variant:"body1",color:"primary",children:["افت: ",a>0?a:0,"%"]}),(a>30||a<20)&&e.jsx(S,{variant:"body2",color:"error",children:"درصد افت باید بین 20 تا 30 درصد باشد!"})]}),e.jsx(y,{children:e.jsx(x,{disabled:!s.isValid||a>30||a<20,size:"small",variant:"outlined",onClick:()=>{i(N()),i(fu({key:u==null?void 0:u.key,number_of_carcasses:Number(s.values.realNumber),weight_of_carcasses:Number(s.values.realWeight),ware_house:!0,weight_loss:parseFloat(a)})).then(A=>{A.payload.error?o({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"}):(i(M()),l(1),f(),i(u6()))})},children:"ثبت"})})]})]})})};var Eu={},V6=mu;Object.defineProperty(Eu,"__esModule",{value:!0});var t6=Eu.default=void 0,z6=V6(e6()),Zu=e;t6=Eu.default=(0,z6.default)([(0,Zu.jsx)("path",{d:"M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2m-1 18H5V9h14zm1-13H4V4h16z"},"0"),(0,Zu.jsx)("path",{d:"M9 12h6v2H9z"},"1")],"Inventory2Outlined");const ku=({item:u,updateTable:l,barState:a,type:n})=>{const o=tu(),[i,s]=C.useState(null),f=W=>{s(W.currentTarget)},_=()=>{s(null)},A=!!i,O=A?"popover":void 0,L=()=>(u==null?void 0:u.buyType)==="live"?!u.weightOfCarcasses&&!a:!1,H=()=>n==="carcass"||(u==null?void 0:u.buyType)!=="live"?!0:!a&&!u.weightOfCarcasses,j=(u==null?void 0:u.registerType)==="automatic"?!1:u.weightOfCarcasses&&!a&&(u==null?void 0:u.buyType)==="live";return e.jsxs("div",{children:[e.jsx(ju,{disabled:j,"aria-describedby":O,variant:"contained",color:"primary",onClick:f,children:e.jsx(f6,{})}),e.jsx(h6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:O,open:A,anchorEl:i,onClose:_,children:e.jsxs(p6,{sx:{p:1},children:[(L()||(u==null?void 0:u.registerType)==="automatic")&&e.jsx(_u,{disablePadding:!0,children:e.jsxs(xu,{sx:{color:"primary.main"},onClick:()=>{_(),o(Su({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ویرایش بار آزاد",content:e.jsx(l6,{item:u,updateTable:l})}))},children:[e.jsx(Fu,{sx:{minWidth:36,color:"inherit"},children:e.jsx(E6,{fontSize:"small"})}),e.jsx(S,{variant:"body2",children:"ویرایش"})]})}),a&&(u==null?void 0:u.registerType)==="manual"&&e.jsx(_u,{disablePadding:!0,children:e.jsxs(xu,{sx:{color:"success.main"},onClick:()=>{_(),o(eu({title:"ثبت اطلاعات لاشه ورودی به انبار",content:e.jsx(M6,{item:u,updateTable:l,IsEdit:a==="entered"})}))},children:[e.jsx(Fu,{sx:{minWidth:36,color:"inherit"},children:e.jsx(t6,{fontSize:"small"})}),e.jsx(S,{variant:"body2",children:a==="entered"?"ویرایش":"ورود به انبار"})]})}),H()&&(u==null?void 0:u.registerType)!=="automatic"&&e.jsx(_u,{disablePadding:!0,children:e.jsxs(xu,{sx:{color:"error.main"},onClick:()=>{_(),o(r6(u.key)).then(()=>{l(),o(u6())})},children:[e.jsx(Fu,{sx:{minWidth:36,color:"inherit"},children:e.jsx(B6,{fontSize:"small"})}),e.jsx(S,{variant:"body2",color:"inherit",children:"حذف"})]})})]})})]})},H6=au({weight:P().positive("عدد مثبت وارد کنید"),amount:P().positive("عدد مثبت وارد کنید")}),Y6=({item:u,updateTable:l})=>{const a=tu(),[n]=C.useContext(ru),o=yu({initialValues:{weight:"",amount:""},validationSchema:H6}),i=s=>{a(fu({key:u==null?void 0:u.key,kill_house_vet_state:s,kill_house_vet_quantity:parseInt(o.values.amount),kill_house_vet_weight:parseInt(o.values.weight)})).then(f=>{a(M()),l(1),f.payload.error?n({vertical:"top",horizontal:"center",msg:f.payload.error,severity:"error"}):n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})};return e.jsxs(y6,{container:!0,gap:I.SMALL,justifyContent:"center",children:[e.jsx(v,{fullWidth:!0,id:"amount",name:"amount",label:"حجم",value:o.values.amount,onChange:o.handleChange,error:o.touched.amount&&!!o.errors.amount,helperText:o.touched.amount&&o.errors.amount}),e.jsx(v,{fullWidth:!0,id:"weight",name:"weight",label:"وزن",value:o.values.weight,onChange:o.handleChange,error:o.touched.weight&&!!o.errors.weight,helperText:o.touched.weight&&o.errors.weight}),e.jsx(x,{variant:"contained",disabled:!o.isValid,onClick:()=>{i("accepted")},children:"تایید"}),e.jsx(x,{color:"error",variant:"outlined",onClick:()=>{i("rejected")},disabled:!o.isValid,children:"رد"})]})},G6=lu("VET_FARM_GET_OUT_PROVINCE_DASHBOARD",async(u,{dispatch:l})=>{l(N());const{data:a,status:n}=await R.get("dashboard_kill_house_free_bar",{params:{...u}});return l(w()),{data:a,status:n}}),K6=lu("SLAUGHTER_EDIT_RETURN_ENTERED_FREE_BAR_SERVICE",async(u,{dispatch:l})=>{l(N());try{const{data:a,status:n}=await R.put("kill_house_free_bar/0/",u);return l(w()),{data:a,status:n}}catch(a){return l(w()),{error:a.response.data.result}}});var Bu={},U6=mu;Object.defineProperty(Bu,"__esModule",{value:!0});var n6=Bu.default=void 0,X6=U6(e6()),Q6=e;n6=Bu.default=(0,X6.default)((0,Q6.jsx)("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8"}),"Undo");const d0=({isBarManagemen:u})=>{var Tu,Iu,Lu,Du,Wu,$u,Ru,Nu,Pu,Ou,qu,Mu,Vu;const[l,a]=C.useState(0),[n,o]=C.useState([]),[i,s]=C.useState([]),[f,_]=C.useState(0),[A,O]=C.useState(10),[L,H]=C.useState(""),[j,W]=C.useState(1),[vu,nu]=C.useState([]),[V]=C.useContext(ru),g=tu(),su=Uu(d=>d.userSlice.userProfile.key),[c,gu]=C.useState([]),ou=(d,E)=>{a(E)},[,,D,h,T,cu]=C.useContext(ru),iu=()=>{g(G6({date1:D,date2:T,search:"filter",role:b(),value:L,type:l===0?"live":"carcass"})).then(d=>{gu(d.payload.data)})};C.useEffect(()=>{const d=uu(new Date).format("YYYY-MM-DD");h(d),cu(d)},[]);const Au=d=>{H(d.target.value)},{inventorySelectedKillHouse:t}=Uu(d=>d.slaughterSlice);C.useEffect(()=>{g(x6())},[]);const p=async d=>{g(N());const E=await R.get(`kill_house_free_bar/?type=${l===0?"live":"carcass"}&search=filter&value=${L}&role=${b()}&date1=${D}&date2=${T}&page=${d}&page_size=${A}&date_type=buy`);iu(),g(w()),s(E.data.results),_(E.data.count)},q=d=>{p(d),W(d)},du=d=>{O(d),W(1)},$=()=>{p(j!==0?j:1)};C.useEffect(()=>{p(1)},[]),C.useEffect(()=>{const d=i==null?void 0:i.map((r,B)=>{var Y,G,K,U,X,Q,J,Z;return[j===1?B+1:B+A*(j-1)+1,(r==null?void 0:r.registerType)==="automatic"?"سیستمی":"دستی",(r==null?void 0:r.barCode)||"-",k(r.createDate),`${(Y=r==null?void 0:r.killHouse)==null?void 0:Y.name} (${(U=(K=(G=r==null?void 0:r.killHouse)==null?void 0:G.killHouseOperator)==null?void 0:K.user)==null?void 0:U.mobile})`,r!=null&&r.exclusiveKiller?`${(X=r==null?void 0:r.exclusiveKiller)==null?void 0:X.name} (${(Z=(J=(Q=r==null?void 0:r.exclusiveKiller)==null?void 0:Q.killHouseOperator)==null?void 0:J.user)==null?void 0:Z.mobile})`:"-",r.buyType==="live"?"مرغ زنده":"لاشه",r.poultryName,`${r.province}/${r.city}`,e.jsx(Ju,{clearanceCode:r==null?void 0:r.barClearanceCode},r==null?void 0:r.key),r.car||"-",(r==null?void 0:r.driverName)||"-",(r==null?void 0:r.driverMobile)||"-",k(r.date),r.numberOfCarcasses.toLocaleString(),r.weightOfCarcasses.toLocaleString(),e.jsx(Qu,{src:r.barImage},B),e.jsx(e.Fragment,{children:b()==="KillHouse"?e.jsx(ku,{item:r,inventoryKey:r==null?void 0:r.key,updateTable:$},r.key):e.jsx(x,{variant:"outlined",disabled:(r==null?void 0:r.killHouseVetState)!=="pending",size:"small",onClick:()=>{g(eu({title:"تایید / رد",content:e.jsx(Y6,{item:r,updateTable:$})}))},children:"تایید / رد"})})]});nu(d);const E=r=>b()==="AdminX"||b()==="SuperAdmin"?[e.jsx(bu,{title:"بازگشت بار",placement:"top",disableHoverListener:!(r!=null&&r.weightOfCarcasses&&(r==null?void 0:r.enteredMessage)==="ورود به انبار مجازی"),children:e.jsx("span",{children:e.jsx(ju,{color:"primary",size:"small",disabled:!(r!=null&&r.weightOfCarcasses&&(r==null?void 0:r.enteredMessage)==="ورود به انبار مجازی"),onClick:()=>{g(eu({title:"بازگشت بار",content:e.jsxs(y,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[e.jsx(S,{variant:"body2",color:"red",children:"آیا از بازگشت بار از انبار اطمینان دارید؟"}),e.jsxs(y,{container:!0,xs:12,mt:2,justifyContent:"center",alignItems:"center",spacing:2,children:[e.jsx(y,{item:!0,xs:6,children:e.jsx(x,{onClick:()=>{g(K6({key:r.key,return_entered_bar:!0})).then(B=>{B.payload.error?V({vertical:"top",horizontal:"center",msg:B.payload.error,severity:"error"}):(V({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),$(),g(M()))})},variant:"contained",color:"error",fullWidth:!0,children:"تایید"})}),e.jsx(y,{item:!0,xs:6,children:e.jsx(x,{variant:"contained",color:"primary",fullWidth:!0,onClick:()=>g(M()),children:"لغو"})})]})]})}))},children:e.jsx(n6,{fontSize:"small"})})})},r)]:[],i6=i==null?void 0:i.map((r,B)=>{var Y,G,K,U,X,Q,J,Z,zu;return[j===1?B+1:B+A*(j-1)+1,(r==null?void 0:r.registerType)==="automatic"?"سیستمی":"دستی",(r==null?void 0:r.barCode)||"-",k(r.createDate),k(r.registerDate)||"-",`${(Y=r==null?void 0:r.killHouse)==null?void 0:Y.name} (${(U=(K=(G=r==null?void 0:r.killHouse)==null?void 0:G.killHouseOperator)==null?void 0:K.user)==null?void 0:U.mobile})`,r!=null&&r.exclusiveKiller?`${(X=r==null?void 0:r.exclusiveKiller)==null?void 0:X.name} (${(Z=(J=(Q=r==null?void 0:r.exclusiveKiller)==null?void 0:Q.killHouseOperator)==null?void 0:J.user)==null?void 0:Z.mobile})`:"-",r.buyType==="live"?"مرغ زنده":"لاشه",r.poultryName,`${r.province}/${r.city}`,e.jsx(Ju,{bar_key:r==null?void 0:r.key,register_type:r==null?void 0:r.registerType,clearanceCode:r==null?void 0:r.barClearanceCode},B),r.car||"-",(r==null?void 0:r.driverName)||"-",(r==null?void 0:r.driverMobile)||"-",r.quantity.toLocaleString(),r.liveWeight.toLocaleString(),k(r.date),r.numberOfCarcasses.toLocaleString(),r.weightOfCarcasses.toLocaleString(),(zu=r==null?void 0:r.poultry)==null?void 0:zu.age,r.weightOfCarcasses?"ورود به انبار":"در انتظار ورود به انبار",e.jsx(Qu,{src:r.barImage},B),...E(r),e.jsx(e.Fragment,{children:b()==="KillHouse"?e.jsx(ku,{item:r,inventoryKey:r==null?void 0:r.key,updateTable:$},r.key):u&&b()==="AdminX"&&e.jsx(bu,{title:"حذف بار",placement:"top",children:e.jsx(ju,{color:"error",size:"small",onClick:()=>{g(eu({title:"حذف بار",content:e.jsxs(y,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[e.jsx(S,{variant:"body2",color:"red",children:"آیا از حذف بار اطمینان دارید؟"}),e.jsxs(y,{container:!0,xs:12,mt:2,justifyContent:"center",alignItems:"center",spacing:2,children:[e.jsx(y,{item:!0,xs:6,children:e.jsx(x,{onClick:()=>{g(r6(r.key)).then(Hu=>{Hu.payload.error?V({vertical:"top",horizontal:"center",msg:Hu.payload.error,severity:"error"}):(V({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),$(),g(M()))})},variant:"contained",color:"error",fullWidth:!0,children:"تایید"})}),e.jsx(y,{item:!0,xs:6,children:e.jsx(x,{variant:"contained",color:"primary",fullWidth:!0,onClick:()=>g(M()),children:"لغو"})})]})]})}))},children:e.jsx(I6,{fontSize:"small"})})})})]});o(i6)},[i]),C.useEffect(()=>{p(1)},[D,T,A,l]);const wu=async d=>{d.preventDefault(),g(N());try{const E=await R.get(`kill_house_free_bar/?type=${l===0?"live":"carcass"}&role=${b()}&search=filter&value=${L}&date1=${D}&date2=${T}&page=1&page_size=${A}&date_type=buy`);s(E.data.results),_(E.data.count),iu(),g(w())}catch(E){console.error("Error fetching data:",E)}},s6=()=>{let d=[];return u&&b()==="AdminX"?d=["حذف"]:u?d=[]:d=["عملیات"],d},o6=()=>b()==="AdminX"||b()==="SuperAdmin"?["بازگشت از انبار"]:[],c6=e.jsx(pu,{data:n,columns:["ردیف","نوع بار","کد بار","تاریخ خرید","تاریخ ثبت در سامانه","خریدار","کشتارکن","محصول","فروشنده","استان/شهر","کدقرنطینه","پلاک ماشین","نام راننده","تلفن راننده","حجم زنده","وزن زنده (کیلوگرم)","تاریخ ورود به انبار","حجم لاشه","وزن لاشه (کیلوگرم)","سن مرغ","وضعیت","بارنامه",...o6(),...s6()],handlePageChange:q,totalRows:f,page:j,perPage:A,handlePerRowsChange:du,title:"بار زنده خرید خارج استان"});return e.jsxs(y,{container:!0,direction:"column",flexWrap:"nowrap",mt:I.SMALL,xs:12,children:[e.jsx(y,{container:!0,justifyContent:"center",alignItems:"center",my:I.SMALL,children:e.jsxs(v6,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:l,onChange:ou,children:[e.jsx(Gu,{label:"زنده"}),e.jsx(Gu,{label:"لاشه"})]})}),e.jsxs(y,{container:!0,mt:I.MEDIUM,alignItems:"center",justifyContent:"center",gap:2,children:[e.jsx("form",{onSubmit:wu,children:e.jsxs(y,{container:!0,alignItems:"center",gap:I.SMALL,children:[b()==="KillHouse"&&!u&&t&&e.jsx(x,{variant:"contained",onClick:()=>{g(Su({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت اطلاعات خرید",content:e.jsx(l6,{selectedDate:D,updateTable:$})}))},children:"ثبت اطلاعات خرید"}),e.jsx(v,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:Au}),e.jsx(x,{type:"submit",onClick:wu,endIcon:e.jsx(w6,{}),children:"جستجو"}),e.jsx(y,{children:e.jsx(Ku,{label:"از تاریخ",id:"date",renderInput:d=>e.jsx(v,{style:{width:"160px"},...d}),value:D,onChange:d=>{h(uu(d).format("YYYY-MM-DD"))}})}),e.jsx(y,{children:e.jsx(Ku,{label:"تا تاریخ",id:"date",renderInput:d=>e.jsx(v,{style:{width:"160px"},...d}),value:T,onChange:d=>{cu(uu(d).format("YYYY-MM-DD"))}})}),e.jsx(bu,{title:"خروجی اکسل",children:e.jsx(x,{color:"success",onClick:()=>{const d=`${R.defaults.baseURL}kill_house_free_bar_excel/?role=${b()}&key=${su}&date1=${D}&date2=${T}&type=${l===0?"live":"carcass"}&search=filter&value=${L}&date_type=buy`;window.location.href=d},children:e.jsx(T6,{size:32})})})]})}),e.jsx(y,{container:!0,mt:2,mb:4,isDashboard:!0,children:l===0?e.jsx(pu,{noPagination:!0,columns:["تعداد کل بارهای زنده","حجم کل بارهای زنده","وزن کل بارهای زنده","تعداد کل بارها وارد شده به انبار","حجم کل بارهای زنده وارد شده به انبار","وزن کل بارهای زنده وارد شده به انبار","وزن لاشه بارهای وارد شده به انبار","تعداد کل بارها وارد نشده به انبار","حجم کل بارهای زنده وارد نشده به انبار","وزن کل بارهای زنده وارد نشده به انبار"],data:[[(Tu=c==null?void 0:c.totalBars)==null?void 0:Tu.toLocaleString(),(Iu=c==null?void 0:c.totalBarsQuantity)==null?void 0:Iu.toLocaleString(),(Lu=c==null?void 0:c.totalBarsLiveWeight)==null?void 0:Lu.toLocaleString(),(Du=c==null?void 0:c.enteredTotalBars)==null?void 0:Du.toLocaleString(),(Wu=c==null?void 0:c.enteredTotalBarsQuantity)==null?void 0:Wu.toLocaleString(),($u=c==null?void 0:c.enteredTotalBarsLiveWeight)==null?void 0:$u.toLocaleString(),(Ru=c==null?void 0:c.enteredTotalBarsWeightOfCarcasses)==null?void 0:Ru.toLocaleString(),(Nu=c==null?void 0:c.notEnteredTotalBars)==null?void 0:Nu.toLocaleString(),(Pu=c==null?void 0:c.notEnteredTotalBarsQuantity)==null?void 0:Pu.toLocaleString(),(Ou=c==null?void 0:c.notEnteredTotalBarsLiveWeight)==null?void 0:Ou.toLocaleString()]],customColors:[{name:"وزن لاشه بارهای وارد شده به انبار",color:"green"}],title:"خلاصه اطلاعات"}):e.jsx(pu,{noPagination:!0,isDashboard:!0,columns:["تعداد کل بارها","حجم لاشه","وزن لاشه"],data:[[(qu=c==null?void 0:c.totalBars)==null?void 0:qu.toLocaleString(),(Mu=c==null?void 0:c.totalBarsNumberOfCarcasses)==null?void 0:Mu.toLocaleString(),(Vu=c==null?void 0:c.totalBarsWeightOfCarcasses)==null?void 0:Vu.toLocaleString()]],title:"خلاصه اطلاعات"})}),l===0?e.jsx(e.Fragment,{children:c6}):e.jsx(pu,{data:vu,columns:u?["ردیف","نوع بار","کد بار","تاریخ خرید","خریدار","کشتارکن","محصول","فروشنده","استان/شهر","کدقرنطینه","پلاک ماشین","نام راننده","تلفن راننده","تاریخ ورود به انبار","حجم لاشه","وزن لاشه (کیلوگرم)","بارنامه"]:["ردیف","نوع بار","کد بار","تاریخ خرید","خریدار","کشتارکن","محصول","فروشنده","استان/شهر","کدقرنطینه","پلاک ماشین","نام راننده","تلفن راننده","تاریخ ورود به انبار","حجم لاشه","وزن لاشه (کیلوگرم)","بارنامه","عملیات"],handlePageChange:q,totalRows:f,page:j,perPage:A,handlePerRowsChange:du,title:"بار لاشه خرید خارج استان"})]})]})};export{d0 as S,l6 as a,M6 as b,Y6 as c,ku as d,r6 as s,G6 as v}; diff --git a/build/assets/SlaughterHouseDispenserDashboard-JLw8VA3Q.js b/build/assets/SlaughterHouseDispenserDashboard-JLw8VA3Q.js new file mode 100644 index 0000000..396286d --- /dev/null +++ b/build/assets/SlaughterHouseDispenserDashboard-JLw8VA3Q.js @@ -0,0 +1 @@ +import{j as u,b as F6,ak as $,ax as Ru,ag as Eu,bi as H6,ah as u6,ai as Au,aj as vu,B as eu,i as c0,bf as Q0,aX as d6,I as C6,b0 as h6,d as Fu,T as E6,b2 as c6,b3 as yu,am as J0,al as e6,aa as w6,an as k6,b4 as Pu,ap as Lu,aq as Ou,av as T6,aw as R6}from"./mui-vendor-CkIVaoQP.js";import{f as C0,r as n,u as d0,j as W6,b as Y6}from"./react-vendor-CmFgShSM.js";import{X as z,G as i,S as ku,gb as Z0,gc as m0,gd as ue,J as n0,ge as ee,ex as se,ew as le,aq as ae,aC as ne,gf as i0,gg as h0,gh as g0,gi as A0,gj as p0,gk as x0,gl as S0,gm as f0,gn as y0,go as j0,gp as _0,gq as v0,gr as F0,gs as E0,gt as b6,gu as B6,gv as z6,gw as w0,gx as b0,gy as k0,gz as T0,gA as R0,A as ou,b1 as I0,u as s6,c as l6,N as i6,M as gu,b as Du,r as $0,C as $u,c2 as L6,O as Zu,L as au,j as q,h as su,gB as D0,gC as P0,gD as L0,gE as O0,v as X,p as a6,W as tu,fF as re,fH as _6,_ as I6,fI as N0,gF as te,fB as oe,bS as ce,gG as Ce,gH as de,gI as ie,gJ as he,gK as ge,gL as Ae,gM as pe,gN as xe,gO as Se,gP as fe,gQ as ye,gR as je,gS as _e,gT as ve,gU as Fe,gV as Ee,gW as we,gX as be,gY as ke,gZ as Te,g_ as Re,g$ as Ie,h0 as $e}from"./index-CeyyVc1v.js";import{N as n6}from"./NavLink-D2GD_ItM.js";import{L as r6}from"./LinkItem-DT6qswcs.js";import{j as De,k as Pe}from"./index.esm-CjWvmHks.js";import{n as r0,i as Le,o as t0}from"./index.esm-BY9chGNa.js";import{B as Oe}from"./BackButton-Crzr7NMa.js";import{R as Cu}from"./ResponsiveTable-w7hk7Uq8.js";import{u as cu,f as Tu,a as bu}from"./redux-vendor-B7uoacJt.js";import{s as Ne,a as H0}from"./slaughter-house-submit-dispenser-service-AaVrL_nR.js";import{C as He}from"./CarPelak-BYFY8OXg.js";import{d as v6}from"./Tune-D4M2CAhp.js";import{d as W0}from"./Edit-CqBj1Y2L.js";import{R as wu,a as Iu}from"./index.esm-Bu7XMDZU.js";import{d as Y0}from"./Visibility-DeyjG-oI.js";import{s as We}from"./slaughter-sell-carcass-out-province-BsZg6mNm.js";import{p as Ye,a as Be}from"./province-get-dispenser-killhouses-BecKvYyt.js";import{d as B0}from"./ToggleOffOutlined-Ch26Umk7.js";import{d as z0}from"./ToggleOn-pBgb8alR.js";import{d as M6}from"./EditOutlined-n5ie2Fmu.js";import{d as V6}from"./DeleteOutline-DlhNLp0A.js";import{c as ze,s as O6,a as N6,b as M0,d as Me}from"./slaughter-get-guilds-for-allocate-B6OrhhMj.js";import{N as mu}from"./NumberFormatCustom-DwWPj40N.js";import{S as $6}from"./ShowImage-CqhU2hmk.js";import{g as D6}from"./getAllocationType-76F45b0K.js";import{C as V0}from"./ChechClearanceCode-lPasOZZ_.js";import{s as Ve,a as Ue}from"./steward-get-dashboard-service-CaN_8BvO.js";import{s as Ge}from"./steward-sell-out-delete-service-DtW7IkBy.js";import{d as Ke}from"./Delete-C5MyLelE.js";import"./iconBase-BEJYyZsk.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./Download-DQ-VVIaV.js";import"./Close-_jAEIgMD.js";import"./Pageview-TRcW_9jm.js";import"./AddCircleOutline-C8LXM-k8.js";const qe={management:{KillHouse:R0,AdminX:T0,SuperAdmin:k0,default:b0},killhouses:{KillHouse:w0,AdminX:z6,SuperAdmin:B6,default:b6},stewards:{KillHouse:E0,AdminX:F0,SuperAdmin:v0,default:_0},inventory:{AdminX:j0,SuperAdmin:y0,CityPoultry:f0,ProvinceSupervisor:S0,default:x0},distribution:{AdminX:p0,SuperAdmin:A0,ProvinceOperator:g0,CityPoultry:h0,ProvinceSupervisor:i0,default:n0},transactions:{AdminX:ne,SuperAdmin:ae,ProvinceFinancial:le,CityPoultry:se,ProvinceSupervisor:ee,default:n0},stock:{AdminX:ue,SuperAdmin:m0,ProvinceSupervisor:Z0}},t6=(a,o)=>{const t=qe[a];return t[o]||t.default||null},o6=(a,o)=>a===o?"true":null,Xe=()=>{const{pathname:a}=C0(),o=z(),t=o==="KillHouse",d=o==="AdminX",c=["AdminX","SuperAdmin","ProvinceSupervisor"].includes(o),y=t6("management",o),F=t6("killhouses",o),C=t6("stewards",o),A=t6("inventory",o),r=t6("distribution",o),_=t6("transactions",o),I=t6("stock",o);return u.jsxs(i,{container:!0,gap:ku.SMALL,p:ku.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",style:{placeContent:"baseline"},children:[d&&u.jsx(i,{container:!0,direction:"column",style:{width:"100%"},children:u.jsxs(i,{container:!0,gap:ku.SMALL,justifyContent:"center",children:[u.jsx(n6,{to:y,active:o6(a,y),children:u.jsx(r6,{icon:u.jsx(De,{size:30,color:"#244CCC"}),title:"مدیریت توزیع کنندگان",description:"مدیریت توزیع کنندگان"})}),!t&&u.jsx(n6,{to:F,active:o6(a,F),children:u.jsx(r6,{icon:u.jsx(r0,{size:30,color:"#244CCC"}),title:"مدیریت کشتارگاه ها",description:"مدیریت کشتارگاه ها"})}),!t&&u.jsx(n6,{to:C,active:o6(a,C),children:u.jsx(r6,{icon:u.jsx(Pe,{size:30,color:"#244CCC"}),title:"مدیریت مباشرین",description:"مدیریت مباشرین"})})]})}),u.jsx(i,{container:!0,direction:"column",style:{width:"100%"},children:u.jsxs(i,{container:!0,gap:ku.SMALL,justifyContent:"center",children:[!t&&A&&u.jsx(n6,{to:A,active:o6(a,A),children:u.jsx(r6,{icon:u.jsx(r0,{size:30,color:"#244CCC"}),title:"توزیع/فروش کشتارگاه",description:"توزیع/فروش کشتارگاه"})}),!t&&r&&u.jsx(n6,{to:r,active:o6(a,r),children:u.jsx(r6,{icon:u.jsx(Le,{size:30,color:"#244CCC"}),title:" توزیع/فروش مباشر",description:" توزیع/فروش مباشر"})}),!t&&_&&u.jsx(n6,{to:_,active:o6(a,_),children:u.jsx(r6,{icon:u.jsx(t0,{size:30,color:"#244CCC"}),title:"مدیریت انبار صنوف",description:"تراکنش ها"})}),c&&I&&u.jsx(n6,{to:I,active:o6(a,I),children:u.jsx(r6,{icon:u.jsx(t0,{size:30,color:"#244CCC"}),title:"مانده انبار",description:"مانده انبار"})})]})})]})},Qe=l6({mobile:gu().required("این فیلد اجباری است!").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),first_name:gu().required("این فیلد اجباریست!"),last_name:gu().required("این فیلد اجباریست!"),city:gu().required("این فیلد اجباریست!"),national_id:gu().matches(/^\d{10}$/,"کد ملی ده رقمی است!").required("این فیلد اجباریست!"),dispenser_type:gu().required("این فیلد اجباریست!"),limitation_amount:Du().min(0,"عدد مثبت وارد کنید!").required("سقف محدودیت اجباری است"),driver_car_type:gu().when("dispenser_type",{is:"driver",then:gu().required("نوع خودرو اجباری است!")})}),U0=({updateTable:a,isEdit:o,item:t})=>{var _,I,L,w,j,b,k,G,O,T,f,K;const d=cu(),{provinceGetCities:c}=Tu(p=>p.provinceSlice),[y,F]=n.useState([]),C=(p,x,N,V)=>{F([p,x,N,V])},[A]=n.useContext(ou);n.useEffect(()=>{d(I0())},[]);const r=s6({initialValues:{mobile:(_=t==null?void 0:t.user)!=null&&_.mobile?(I=t==null?void 0:t.user)==null?void 0:I.mobile:"",first_name:(L=t==null?void 0:t.user)!=null&&L.firstName?(w=t==null?void 0:t.user)==null?void 0:w.firstName:"",last_name:(j=t==null?void 0:t.user)!=null&&j.lastName?(b=t==null?void 0:t.user)==null?void 0:b.lastName:"",city:(G=(k=t==null?void 0:t.user)==null?void 0:k.city)!=null&&G.cityName?(T=(O=t==null?void 0:t.user)==null?void 0:O.city)==null?void 0:T.cityName:"",national_id:(f=t==null?void 0:t.user)!=null&&f.nationalId?(K=t==null?void 0:t.user)==null?void 0:K.nationalId:"",dispenser_type:t!=null&&t.dispenserType?t==null?void 0:t.dispenserType:"inductor",limitation_amount:t!=null&&t.limitation_amount?t==null?void 0:t.limitation_amount:0,driver_car_type:t!=null&&t.car?t==null?void 0:t.car:""},validationSchema:Qe,onSubmit:p=>{o?d(H0({type:"update-profile",dispenser_key:t==null?void 0:t.key,mobile:p.mobile,first_name:p.first_name,last_name:p.last_name,city:p.city,national_id:p.national_id,dispenser_type:p.dispenser_type,limitation_amount:p.limitation_amount,role:z(),pelak:p.dispenser_type==="driver"?y[0]+" "+y[1]+" "+y[2]+" "+y[3]:null,car:p.driver_car_type?p.driver_car_type:null})).then(x=>{x.payload.error?A({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):(d(i6({right:!1,bottom:!1,content:null})),a(),A({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}):d(Ne({mobile:p.mobile,first_name:p.first_name,last_name:p.last_name,city:p.city,national_id:p.national_id,dispenser_type:p.dispenser_type,limitation_amount:p.limitation_amount,role:z(),pelak:p.dispenser_type==="driver"?y[0]+" "+y[1]+" "+y[2]+" "+y[3]:null,car:p.driver_car_type?p.driver_car_type:null})).then(x=>{x.payload.error?A({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):(d(i6({right:!1,bottom:!1,content:null})),a(),A({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}});return u.jsxs(F6,{component:"form",onSubmit:r.handleSubmit,sx:{display:"flex",flexDirection:"column",gap:2},children:[u.jsx($,{fullWidth:!0,label:"نام",name:"first_name",value:r.values.first_name,onChange:r.handleChange,onBlur:r.handleBlur,error:r.touched.first_name&&!!r.errors.first_name,helperText:r.touched.first_name&&r.errors.first_name}),u.jsx($,{fullWidth:!0,label:"نام خانوادگی",name:"last_name",value:r.values.last_name,onChange:r.handleChange,onBlur:r.handleBlur,error:r.touched.last_name&&!!r.errors.last_name,helperText:r.touched.last_name&&r.errors.last_name}),u.jsx($,{fullWidth:!0,label:"موبایل",name:"mobile",value:r.values.mobile,onChange:r.handleChange,onBlur:r.handleBlur,error:r.touched.mobile&&!!r.errors.mobile,helperText:r.touched.mobile&&r.errors.mobile}),u.jsx($,{select:!0,label:"شهر",variant:"outlined",fullWidth:!0,id:"city",name:"city",value:r.values.city,onChange:r.handleChange,error:r.touched.city&&!!r.errors.city,helperText:r.touched.city&&r.errors.city,children:c==null?void 0:c.map(p=>u.jsx(Ru,{value:p.name,children:p.name},p.id))}),u.jsx($,{fullWidth:!0,label:"کد ملی",name:"national_id",value:r.values.national_id,onChange:r.handleChange,onBlur:r.handleBlur,error:r.touched.national_id&&!!r.errors.national_id,helperText:r.touched.national_id&&r.errors.national_id}),u.jsxs(Eu,{component:"fieldset",children:[u.jsx(H6,{component:"legend",children:"ماهیت"}),u.jsxs(u6,{name:"dispenser_type",value:r.values.dispenser_type,onChange:r.handleChange,children:[u.jsx(Au,{value:"inductor",control:u.jsx(vu,{}),label:"واسطه"}),u.jsx(Au,{value:"salesman",control:u.jsx(vu,{}),label:"فروشنده"}),u.jsx(Au,{value:"driver",control:u.jsx(vu,{}),label:"راننده"})]})]}),r.values.dispenser_type==="driver"&&u.jsxs(u.Fragment,{children:[u.jsx($,{fullWidth:!0,label:"نوع خودرو",name:"driver_car_type",value:r.values.driver_car_type,onChange:r.handleChange,onBlur:r.handleBlur,error:r.touched.driver_car_type&&!!r.errors.driver_car_type,helperText:r.touched.driver_car_type&&r.errors.driver_car_type}),u.jsx(i,{item:!0,xs:12,alignItems:"center",justifyContent:"center",children:u.jsx(He,{width:"100%",handleChange:C,pelakInitial:o?t==null?void 0:t.pelak:""})})]}),u.jsx($,{fullWidth:!0,label:"سقف محدودیت",name:"limitation_amount",type:"number",value:r.values.limitation_amount,onChange:r.handleChange,onBlur:r.handleBlur,error:r.touched.limitation_amount&&!!r.errors.limitation_amount,helperText:r.touched.limitation_amount&&r.errors.limitation_amount}),u.jsx(eu,{color:"primary",variant:"contained",type:"submit",disabled:r.values.dispenser_type==="driver"?!y[1]:!1,children:"ثبت"})]})};var U6={},Je=c0;Object.defineProperty(U6,"__esModule",{value:!0});var G0=U6.default=void 0,Ze=Je($0()),me=u;G0=U6.default=(0,Ze.default)((0,me.jsx)("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2M4 12h4v2H4zm10 6H4v-2h10zm6 0h-4v-2h4zm0-4H10v-2h10z"}),"Subtitles");const us=l6({free_sale:L6(),free_guilds:L6(),free_stewards:L6()}),es=({updateTable:a,item:o})=>{const[t]=n.useContext(ou),d=cu(),c=s6({initialValues:{free_sale:o!=null&&o.freeSale?o==null?void 0:o.freeSale:!1,free_guilds:o!=null&&o.freeGuilds?o==null?void 0:o.freeGuilds:!1,free_stewards:o!=null&&o.freeStewards?o==null?void 0:o.freeStewards:!1},validationSchema:us,onSubmit:y=>{d(H0({dispenser_key:o==null?void 0:o.key,type:"update-acceess-level",free_sale:y.free_sale,free_guilds:y.free_guilds,free_stewards:y.free_stewards})).then(F=>{F.payload.error?t({vertical:"top",horizontal:"center",msg:F.payload.error,severity:"error"}):(d($u()),a(),t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}});return u.jsx(i,{container:!0,xs:12,direction:"column",children:u.jsxs("form",{onSubmit:c.handleSubmit,children:[u.jsxs(Q0,{children:[u.jsx(Au,{control:u.jsx(d6,{id:"free_sale",name:"free_sale",checked:c.values.free_sale,onChange:c.handleChange}),label:"اجازه فروش آزاد"}),u.jsx(Au,{control:u.jsx(d6,{id:"free_guilds",name:"free_guilds",checked:c.values.free_guilds,onChange:c.handleChange}),label:"فروش به اصناف آزاد"}),u.jsx(Au,{control:u.jsx(d6,{id:"free_stewards",name:"free_stewards",checked:c.values.free_stewards,onChange:c.handleChange}),label:"فروش به مباشرین آزاد"})]}),c.touched.free_stewards&&c.errors.free_stewards?u.jsx("div",{style:{color:"red"},children:c.errors.free_stewards}):null,u.jsx(eu,{fullWidth:!0,color:"primary",variant:"contained",type:"submit",sx:{marginTop:2},children:"ویرایش"})]})})},ss=({item:a,updateTable:o})=>{const t=cu(),[d,c]=n.useState(null),y=r=>{c(r.currentTarget)},F=()=>{c(null)},C=!!d,A=C?"popover":void 0;return u.jsxs("div",{children:[u.jsx(C6,{"aria-describedby":A,variant:"contained",color:"primary",onClick:y,children:u.jsx(v6,{})}),u.jsx(h6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:A,open:C,anchorEl:d,onClose:F,children:u.jsx("div",{style:{padding:"10px"},children:u.jsxs(i,{container:!0,direction:"column",gap:1,alignItems:"flex-start",style:{width:180},children:[u.jsx(Fu,{placement:"left",title:"ویرایش توزیع کننده",children:u.jsx(eu,{size:"small",color:"primary",startIcon:u.jsx(W0,{fontSize:"small"}),onClick:()=>{F(),t(i6({title:"ویرایش توزیع کننده",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(U0,{updateTable:o,isEdit:!0,item:a})}))},children:u.jsx(E6,{variant:"body2",fontWeight:600,children:"ویرایش توزیع کننده"})})}),u.jsx(Fu,{placement:"left",title:"تعیین سطح دسترسی توزیع کننده",children:u.jsx(eu,{size:"small",color:"secondary",startIcon:u.jsx(G0,{fontSize:"small"}),onClick:()=>{F(),t(Zu({title:"تعیین سطح دسترسی توزیع کننده",content:u.jsx(es,{updateTable:o,item:a})}))},children:u.jsx(E6,{variant:"body2",fontWeight:600,children:"تعیین سطح دسترسی"})})})]})})})]})},ls=bu("SLAUGHTER_GET_DISPENSERS_DASHBOARD",async(a,{dispatch:o})=>{o(au());const{data:t,status:d}=await q.get("dispenser-dashboard/",{params:{role:z()}});return o(su()),{data:t,status:d}}),as=()=>{var R,D,Y,g,h,M,U;const a=cu(),o=B=>{r(B.target.value)},[t,d]=n.useState([]),[c,y]=n.useState(0),[F,C]=n.useState(10),[A,r]=n.useState(""),[_,I]=n.useState(1),[L,w]=n.useState([]),[j,b]=n.useState(0),[k,G]=n.useState(),O=d0(),T=(B,s)=>{b(s)},f=async B=>{let s;a(au()),s=await q.get(`dispenser/?search=filter&value=${A}&role=${z()}&page=${B}&page_size=${F}`),a(su()),d(s.data.results),y(s.data.count)},K=B=>{f(B),I(B)},p=B=>{C(B),I(1)},x=()=>{f(_!==0?_:1)};n.useEffect(()=>{f(1)},[j]);const N=B=>{let s="";switch(B==null?void 0:B.dispenserType){case"inductor":s="واسطه";break;case"salesman":s="فروشنده";break;case"driver":s=`راننده - ${B==null?void 0:B.car} (${B==null?void 0:B.pelak})`;break}return s};n.useEffect(()=>{const B=t==null?void 0:t.map((s,e)=>{var l,P,W,v,E,H,S,Q,J,Z,m,uu,lu,nu,ru,du,iu,hu;return[_===1?e+1:e+F*_/2+1,N(s),(l=s==null?void 0:s.user)==null?void 0:l.fullname,(P=s==null?void 0:s.user)==null?void 0:P.mobile,(v=(W=s==null?void 0:s.user)==null?void 0:W.city)==null?void 0:v.cityName,(E=s==null?void 0:s.killHouse)==null?void 0:E.name,(H=s==null?void 0:s.limitationAmount)==null?void 0:H.toLocaleString(),s!=null&&s.active?"فعال":"غیر فعال",(Q=(S=s==null?void 0:s.allocationsInfo)==null?void 0:S.numberOfAllocations)==null?void 0:Q.toLocaleString(),(Z=(J=s==null?void 0:s.allocationsInfo)==null?void 0:J.totalWeight)==null?void 0:Z.toLocaleString(),(uu=(m=s==null?void 0:s.allocationsInfo)==null?void 0:m.totalQuantity)==null?void 0:uu.toLocaleString(),(nu=(lu=s==null?void 0:s.allocationsInfo)==null?void 0:lu.numberOfTodayAllocations)==null?void 0:nu.toLocaleString(),(du=(ru=s==null?void 0:s.allocationsInfo)==null?void 0:ru.totalTodayQuantity)==null?void 0:du.toLocaleString(),(hu=(iu=s==null?void 0:s.allocationsInfo)==null?void 0:iu.totalTodayWeight)==null?void 0:hu.toLocaleString(),j===0?u.jsx(ss,{item:s,updateTable:x},e):u.jsx(Fu,{title:"جزئیات",placement:"left",children:u.jsx(C6,{color:"success",onClick:()=>{O(z()==="KillHouse"?`${D0}/${s.key}`:z()==="AdminX"?`${P0}/${s.key}`:z()==="SuperAdmin"?`${L0}/${s.key}`:`${O0}/${s.key}`)},children:u.jsx(Y0,{})})},e)]});w(B)},[t,j]),n.useEffect(()=>{f(1)},[F]),n.useEffect(()=>{j===1&&a(ls()).then(B=>{G(B.payload.data)})},[j]);const V=async B=>{B.preventDefault(),a(au());try{const s=await q.get(`dispenser/?role=${z()}&search=filter&value=${A}&page=1&page_size=${F}`);d(s.data.results),y(s.data.count),a(su())}catch(s){console.error("Error fetching data:",s)}};return u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(c6,{value:j,onChange:T,children:[u.jsx(yu,{label:"توزیع کنندگان",value:0}),u.jsx(yu,{label:"جزئیات پخش",value:1})]}),j===0&&u.jsxs(u.Fragment,{children:[u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(eu,{variant:"contained",onClick:()=>{a(i6({title:"ثبت توزیع کننده جدید",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(U0,{updateTable:x})}))},children:"ثبت توزیع کننده"}),u.jsx(i,{children:u.jsxs("form",{onSubmit:V,children:[u.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:o}),u.jsx(eu,{type:"submit",onClick:V,endIcon:u.jsx(wu,{}),children:"جستجو"})]})})]}),u.jsx(Cu,{data:L,columns:["ردیف","ماهیت توزیع کننده","نام و نام خانوادگی","تلفن","شهر","نام کشتارگاه","سقف محدودیت","وضعیت","تعداد کل تخصیصات","وزن تخصیصات کل","حجم کل","تخصیصات امروز","حجم تخصیصات امروز","وزن امروز","عملیات"],handlePageChange:K,totalRows:c,page:_,perPage:F,handlePerRowsChange:p,title:"مدیریت توزیع کنندگان"})]}),j===1&&u.jsxs(u.Fragment,{children:[u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",children:u.jsx(Cu,{noPagination:!0,data:[[(R=k==null?void 0:k.numberOfDispensers)==null?void 0:R.toLocaleString(),(D=k==null?void 0:k.numberOfAllocations)==null?void 0:D.toLocaleString(),(Y=k==null?void 0:k.totalWeight)==null?void 0:Y.toLocaleString(),(g=k==null?void 0:k.totalQuantity)==null?void 0:g.toLocaleString(),(h=k==null?void 0:k.numberOfTodayAllocations)==null?void 0:h.toLocaleString(),(M=k==null?void 0:k.totalTodayQuantity)==null?void 0:M.toLocaleString(),(U=k==null?void 0:k.totalTodayWeight)==null?void 0:U.toLocaleString()]],columns:["تعداد توزیع کنندگان","تعداد کل تخصیصات","وزن تخصیصات کل","حجم کل","تخصیصات امروز","حجم تخصیصات امروز","وزن امروز"],title:"خلاصه اطلاعات"})}),u.jsx(i,{mt:2,children:u.jsxs("form",{onSubmit:V,children:[u.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:o}),u.jsx(eu,{type:"submit",onClick:V,endIcon:u.jsx(wu,{}),children:"جستجو"})]})})]}),u.jsx(Cu,{data:L,columns:["ردیف","ماهیت توزیع کننده","نام و نام خانوادگی","تلفن","شهر","نام کشتارگاه","سقف محدودیت","وضعیت","تعداد کل تخصیصات","وزن تخصیصات کل","حجم کل","تخصیصات امروز","حجم تخصیصات امروز","وزن امروز","جزئیات"],handlePageChange:K,totalRows:c,page:_,perPage:F,handlePerRowsChange:p,title:"جزئیات پخش توزیع کنندگان"})]})]})},ns=bu("SLAUGHTER_GET_DISPENSERS_DASHBOARD_SERVICE",async(a,{dispatch:o})=>{o(au());const{data:t,status:d}=await q.get("dispenser-allocations-dashboard/",{params:{role:z(),date1:a.date1,date2:a.date2,dispenser_key:a.key}});return o(su()),{data:t,status:d}}),rs=()=>{var R,D,Y,g,h,M,U,B,s;const{key:a}=W6(),[,,o,t,d,c]=n.useContext(ou),y=cu();n.useEffect(()=>{const e=X(new Date).format("YYYY-MM-DD");t(e),c(e)},[]);const F=e=>{j(e.target.value)},[C,A]=n.useState([]),[r,_]=n.useState(0),[I,L]=n.useState(10),[w,j]=n.useState(""),[b,k]=n.useState(1),[G,O]=n.useState([]),[T,f]=n.useState(),K=async e=>{let l;y(au()),l=await q.get(`dispenser-allocations/?search=filter&value=${w}&role=${z()}&date1=${o}&date2=${d}&page=${e}&page_size=${I}&dispenser_key=${a}`),y(su()),A(l.data.results),_(l.data.count)},p=e=>{K(e),k(e)},x=e=>{L(e),k(1)};n.useEffect(()=>{K(1)},[]),n.useEffect(()=>{y(ns({date1:o,date2:d,key:a})).then(e=>{f(e.payload.data)})},[o,d]);const N=e=>{var P,W,v;let l="";switch((P=e==null?void 0:e.dispenser)==null?void 0:P.dispenserType){case"inductor":l="واسطه";break;case"salesman":l="فروشنده";break;case"driver":l=`راننده - ${(W=e==null?void 0:e.dispenser)==null?void 0:W.car} (${(v=e==null?void 0:e.dispenser)==null?void 0:v.pelak})`;break}return l};n.useEffect(()=>{const e=C==null?void 0:C.map((l,P)=>{var E,H,S,Q,J,Z,m,uu,lu,nu,ru,du,iu,hu,pu,xu,Su,fu,ju,_u,Nu,Hu,Wu,Yu,Bu,zu,Mu,Vu,Uu,Gu,Ku,qu,Xu,Qu,Ju;let W,v;return l.sellerType==="guilds"?v="صنف":l.sellerType==="steward"&&(v="مباشر"),l.sellType==="free"?W="آزاد":l.type==="manual"?W="اختصاصی (دستی)":W="اختصاصی (اتوماتیک)",[b===1?P+1:P+I*(b-1)+1,`${(H=(E=l==null?void 0:l.dispenser)==null?void 0:E.user)==null?void 0:H.fullname} (${(Q=(S=l==null?void 0:l.dispenser)==null?void 0:S.user)==null?void 0:Q.mobile})`,N(l),l!=null&&l.guilds?(J=l==null?void 0:l.guilds)==null?void 0:J.guildsId:(m=(Z=l==null?void 0:l.steward)==null?void 0:Z.guilds)==null?void 0:m.guildsId,a6(l.date),v,W,l!=null&&l.guilds?(uu=l==null?void 0:l.guilds)==null?void 0:uu.guildsName:(nu=(lu=l==null?void 0:l.steward)==null?void 0:lu.guilds)==null?void 0:nu.guildsName,l!=null&&l.guilds?(ru=l==null?void 0:l.guilds)==null?void 0:ru.user.fullname:(iu=(du=l==null?void 0:l.steward)==null?void 0:du.guilds)==null?void 0:iu.user.fullname,l!=null&&l.guilds?(hu=l==null?void 0:l.guilds)==null?void 0:hu.user.nationalId:(xu=(pu=l==null?void 0:l.steward)==null?void 0:pu.guilds)==null?void 0:xu.user.nationalId,l!=null&&l.guilds?(Su=l==null?void 0:l.guilds)==null?void 0:Su.user.mobile:(ju=(fu=l==null?void 0:l.steward)==null?void 0:fu.guilds)==null?void 0:ju.user.mobile,l!=null&&l.guilds?(_u=l==null?void 0:l.guilds)==null?void 0:_u.typeActivity:(Hu=(Nu=l==null?void 0:l.steward)==null?void 0:Nu.guilds)==null?void 0:Hu.typeActivity,l!=null&&l.guilds?(Wu=l==null?void 0:l.guilds)==null?void 0:Wu.areaActivity:(Bu=(Yu=l==null?void 0:l.steward)==null?void 0:Yu.guilds)==null?void 0:Bu.areaActivity,l!=null&&l.guilds?(zu=l==null?void 0:l.guilds)==null?void 0:zu.licenseNumber:(Vu=(Mu=l==null?void 0:l.steward)==null?void 0:Mu.guilds)==null?void 0:Vu.licenseNumber,l!=null&&l.guilds?(Ku=(Gu=(Uu=l==null?void 0:l.guilds)==null?void 0:Uu.user)==null?void 0:Gu.city)==null?void 0:Ku.name:(Ju=(Qu=(Xu=(qu=l==null?void 0:l.steward)==null?void 0:qu.guilds)==null?void 0:Xu.user)==null?void 0:Qu.city)==null?void 0:Ju.name,l==null?void 0:l.numberOfCarcasses,l==null?void 0:l.weightOfCarcasses,l!=null&&l.loggedRegistrationCode?l.loggedRegistrationCode:"-",(l==null?void 0:l.receiverState)==="accepted"?"تایید شده":(l==null?void 0:l.receiverState)==="rejected"?"رد شده":"در انتظار تایید"]});O(e)},[C]),n.useEffect(()=>{K(1)},[o,d,I]);const V=async e=>{e.preventDefault(),y(au());try{const l=await q.get(`dispenser-allocations/?role=${z()}&search=filter&value=${w}&date1=${o}&date2=${d}&page=1&page_size=${I}&dispenser_key=${a}`);A(l.data.results),_(l.data.count),y(su())}catch(l){console.error("Error fetching data:",l)}};return u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(i,{children:u.jsx(tu,{label:"از تاریخ",id:"date",renderInput:e=>u.jsx($,{style:{width:"160px"},...e,size:"small"}),value:o,onChange:e=>{t(X(e).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsx(tu,{label:"تا تاریخ",id:"date",renderInput:e=>u.jsx($,{style:{width:"160px"},...e,size:"small"}),value:d,onChange:e=>{c(X(e).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsxs("form",{onSubmit:V,children:[u.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:F}),u.jsx(eu,{type:"submit",onClick:V,endIcon:u.jsx(wu,{}),children:"جستجو"})]})})]}),u.jsx(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",children:u.jsx(Cu,{noPagination:!0,data:[[(R=T==null?void 0:T.numberOfAllocations)==null?void 0:R.toLocaleString(),(D=T==null?void 0:T.totalQuantity)==null?void 0:D.toLocaleString(),(Y=T==null?void 0:T.totalWeight)==null?void 0:Y.toLocaleString(),(g=T==null?void 0:T.numberOfStewardsAllocations)==null?void 0:g.toLocaleString(),(h=T==null?void 0:T.stewardTotalQuantity)==null?void 0:h.toLocaleString(),(M=T==null?void 0:T.stewardTotalWeight)==null?void 0:M.toLocaleString(),(U=T==null?void 0:T.numberOfGuildsAllocations)==null?void 0:U.toLocaleString(),(B=T==null?void 0:T.guildTotalQuantity)==null?void 0:B.toLocaleString(),(s=T==null?void 0:T.guildTotalWeight)==null?void 0:s.toLocaleString()]],columns:["تعداد کل تخصیصات","حجم کل تخصیصات","وزن کل تخصیصات","تعداد مباشرین تختصیص داده شده","حجم تخصیصی به مباشرین","وزن تخصیصی به مباشرین","تعداد اصناف تختصیص داده شده","حجم تخصیصی به اصناف","وزن تخصیصی به اصناف"],title:"خلاصه اطلاعات"})}),u.jsx(Cu,{data:G,columns:["ردیف","توزیع کننده","نوع توزیع کننده","شناسه صنف","تاریخ ثبت","ماهیت","نوع تخصیص","نام واحد صنفی","نام شخص/شرکت","کدملی","موبایل","نوع فعالیت","حوزه فعالیت","شماره مجوز","شهرستان","حجم لاشه","وزن لاشه","کداحراز","وضعیت"],handlePageChange:p,totalRows:r,page:b,perPage:I,handlePerRowsChange:x,title:"اطلاعات توزیع کننده"})]})},ts=()=>u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:"در حال توسعه ..."}),os=()=>{const a=cu(),o=T=>{_(T.target.value)},t=d0(),[d,c]=n.useState([]),[y,F]=n.useState(0),[C,A]=n.useState(10),[r,_]=n.useState(""),[I,L]=n.useState(1),[w,j]=n.useState([]),b=async T=>{let f;a(au()),f=await q.get(`kill-house-distribution-management/?search=filter&value=${r}&role=${z()}&page=${T}&page_size=${C}`),a(su()),c(f.data.results),F(f.data.count)},k=T=>{b(T),L(T)},G=T=>{A(T),L(1)};n.useEffect(()=>{const T=d==null?void 0:d.map((f,K)=>{var p,x,N,V,R,D,Y,g,h,M,U,B,s;return[I===1?K+1:K+C*I/2+1,`${(x=(p=f==null?void 0:f.killHouseOperator)==null?void 0:p.user)==null?void 0:x.fullname} (${(V=(N=f==null?void 0:f.killHouseOperator)==null?void 0:N.user)==null?void 0:V.mobile})`,f==null?void 0:f.name,(Y=(D=(R=f==null?void 0:f.killHouseOperator)==null?void 0:R.user)==null?void 0:D.city)==null?void 0:Y.name,(g=f==null?void 0:f.distributionInfo)==null?void 0:g.stewards.toLocaleString(),(h=f==null?void 0:f.distributionInfo)==null?void 0:h.guilds.toLocaleString(),(M=f==null?void 0:f.distributionInfo)==null?void 0:M.totalDailyWeight.toLocaleString(),(U=f==null?void 0:f.distributionInfo)==null?void 0:U.forceDailyWeight.toLocaleString(),(B=f==null?void 0:f.distributionInfo)==null?void 0:B.optionalDailyWeight.toLocaleString(),(s=f==null?void 0:f.distributionInfo)==null?void 0:s.aveTotalDailyWeight.toLocaleString(),u.jsx(Fu,{placement:"left",children:u.jsx(C6,{color:"success",onClick:()=>{t(z()==="AdminX"?z6+"/"+(f==null?void 0:f.key)+"/"+(f==null?void 0:f.name):z()==="SuperAdmin"?B6+"/"+(f==null?void 0:f.key)+"/"+(f==null?void 0:f.name):z()==="ProvinceOperator"?b6+"/"+(f==null?void 0:f.key)+"/"+(f==null?void 0:f.name):b6+"/"+(f==null?void 0:f.key)+"/"+(f==null?void 0:f.name))},children:u.jsx(Y0,{})})},K)]});j(T)},[d]),n.useEffect(()=>{b(1)},[a,C]);const O=async T=>{T.preventDefault(),a(au());try{const f=await q.get(`kill-house-distribution-management/?role=${z()}&search=filter&value=${r}&page=1&page_size=${C}`);c(f.data.results),F(f.data.count),a(su())}catch(f){console.error("Error fetching data:",f)}};return u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:u.jsx(i,{children:u.jsxs("form",{onSubmit:O,children:[u.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:o}),u.jsx(eu,{type:"submit",onClick:O,endIcon:u.jsx(wu,{}),children:"جستجو"})]})})}),u.jsx(Cu,{data:w,columns:["ردیف","نام خریدار","نام واحد","شهرستان","تعداد مباشر زیرمجموعه","تعداد صنف زیرمجموعه","کل وزن تعهد روزانه","وزن تعهد روزانه/اجباری","وزن تعهد روزانه/اختیاری","میانگین وزن کشتار روزانه","جزئیات"],handlePageChange:k,totalRows:y,page:I,perPage:C,handlePerRowsChange:G,title:"مدیریت کشتارگاه ها"})]})},cs=()=>{var C,A,r,_;const[,,a,o,t,d]=n.useContext(ou),c=cu();n.useEffect(()=>{const I=X(new Date).format("YYYY-MM-DD");o(I),d(I)},[]);const[y,F]=n.useState([]);return n.useEffect(()=>{c(We({selectedDate1:a,selectedDate2:t})).then(I=>{F(I.payload.data)})},[a,t]),u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,mt:2,children:[u.jsx(i,{children:u.jsx(tu,{label:"از تاریخ",id:"date",renderInput:I=>u.jsx($,{style:{width:"160px"},...I,size:"small"}),value:a,onChange:I=>{o(X(I).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsx(tu,{label:"تا تاریخ",id:"date",renderInput:I=>u.jsx($,{style:{width:"160px"},...I,size:"small"}),value:t,onChange:I=>{d(X(I).format("YYYY-MM-DD"))}})})]}),u.jsx(i,{container:!0,xs:12,mt:2,mb:4,isDashboard:!0,children:u.jsx(Cu,{noPagination:!0,isDashboard:!0,columns:["تعداد درخواست فروش","تعداد خریداران","حجم کل لاشه ها","وزن کل لاشه ها"],data:[[(C=y==null?void 0:y.numberOfAllocations)==null?void 0:C.toLocaleString(),(A=y==null?void 0:y.numberOfBuyers)==null?void 0:A.toLocaleString(),(r=y==null?void 0:y.totalNumberOfAllocationCarcasses)==null?void 0:r.toLocaleString(),(_=y==null?void 0:y.totalWeightOfAllocationCarcasses)==null?void 0:_.toLocaleString()]],title:"خلاصه اطلاعات"})})]})},Cs=()=>{const[,,a,o,t,d]=n.useContext(ou),c=cu();n.useEffect(()=>{const p=X(new Date).format("YYYY-MM-DD");o(p),d(p)},[]);const y=p=>{w(p.target.value)},[F,C]=n.useState([]),[A,r]=n.useState(0),[_,I]=n.useState(10),[L,w]=n.useState(""),[j,b]=n.useState(1),[k,G]=n.useState([]),O=async p=>{let x;c(au()),x=await q.get(`base-out-province-carcasses-buyer/?search=filter&value=${L}&role=${z()}&date1=${a}&date2=${t}&page=${p}&page_size=${_}&state=true`),c(su()),C(x.data.results),r(x.data.count)},T=p=>{O(p),b(p)},f=p=>{I(p),b(1)};n.useEffect(()=>{const p=F==null?void 0:F.map((x,N)=>{var V,R,D,Y,g,h,M;return[j===1?N+1:N+_*(j-1)+1,`${x==null?void 0:x.fullname} (${x==null?void 0:x.mobile})`,x==null?void 0:x.unitName,x==null?void 0:x.province,x==null?void 0:x.city,(V=x==null?void 0:x.killHouses)==null?void 0:V.map(U=>U).join(" - "),(D=(R=x==null?void 0:x.requestsInfo)==null?void 0:R.numberOfRequests)==null?void 0:D.toLocaleString(),(g=(Y=x==null?void 0:x.requestsInfo)==null?void 0:Y.totalQuantity)==null?void 0:g.toLocaleString(),(M=(h=x==null?void 0:x.requestsInfo)==null?void 0:h.totalWeight)==null?void 0:M.toLocaleString()]});G(p)},[F]),n.useEffect(()=>{O(1)},[c,a,t,_]);const K=async p=>{p.preventDefault(),c(au());try{const x=await q.get(`base-out-province-carcasses-buyer/?role=${z()}&search=filter&value=${L}&date1=${a}&date2=${t}&page=1&page_size=${_}&state=true`);C(x.data.results),r(x.data.count),c(su())}catch(x){console.error("Error fetching data:",x)}};return u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(i,{children:u.jsx(tu,{label:"از تاریخ",id:"date",renderInput:p=>u.jsx($,{style:{width:"160px"},...p,size:"small"}),value:a,onChange:p=>{o(X(p).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsx(tu,{label:"تا تاریخ",id:"date",renderInput:p=>u.jsx($,{style:{width:"160px"},...p,size:"small"}),value:t,onChange:p=>{d(X(p).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsxs("form",{onSubmit:K,children:[u.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:y}),u.jsx(eu,{type:"submit",onClick:K,endIcon:u.jsx(wu,{}),children:"جستجو"})]})})]}),u.jsx(Cu,{data:k,columns:["ردیف","مشخصات خریدار","نام واحد","استان","شهر","کشتارگاه ها","تعداد درخواست ها","حجم درخواست ها","وزن درخواست ها"],handlePageChange:T,totalRows:A,page:j,perPage:_,handlePerRowsChange:f,title:"خریداران لاشه خارج استان"})]})},ds=()=>{const[a,o]=n.useState(0),t=(F,C)=>{o(C)},[d,c]=n.useState(0),y=(F,C)=>{c(C)};return u.jsxs(i,{container:!0,direction:"column",alignItems:"center",justifyContent:"space-between",gap:ku.SMALL,mt:ku.MEDIUM,width:"100%",children:[u.jsx(F6,{sx:{borderBottom:1,borderColor:"divider"},children:u.jsxs(c6,{value:a,onChange:t,"aria-label":"basic tabs example",children:[u.jsx(yu,{label:"خارج استان"}),u.jsx(yu,{label:"داخل استان"})]})}),u.jsx(J0,{style:{width:"100%"}}),a===0&&u.jsxs(i,{container:!0,direction:"column",alignItems:"center",justifyContent:"space-between",gap:ku.SMALL,width:"100%",children:[u.jsx(F6,{sx:{borderBottom:1,borderColor:"divider"},children:u.jsxs(c6,{className:"insidetabs",size:"small",value:d,onChange:y,"aria-label":"basic tabs example",children:[u.jsx(yu,{label:"فروش"}),u.jsx(yu,{label:"خریداران"})]})}),d===0&&u.jsx(cs,{}),d===1&&u.jsx(Cs,{})]})]})},G6=({dashboardData:a})=>{var o,t,d,c;return u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsx(Cu,{noPagination:!0,title:"اطلاعات کلی",columns:["تعداد توزیع","کل وزن توزیع","وزن توزیع به مباشر","وزن توزیع به صنف"],data:[[(o=a==null?void 0:a.numberOfAllocations)==null?void 0:o.toLocaleString(),(t=a==null?void 0:a.totalWeight)==null?void 0:t.toLocaleString(),(d=a==null?void 0:a.totalStewardWeight)==null?void 0:d.toLocaleString(),(c=a==null?void 0:a.totalGuildWeight)==null?void 0:c.toLocaleString()]]})})},K6=bu("PROVINCE_DISPENSER_SALE_WITHIN_DASHBOARD",async(a,{dispatch:o})=>{o(au());const{data:t,status:d}=await q.get("in-province-allocation-dashboard/?type=KillHouse",{params:{date1:a.selectedDate1,date2:a.selectedDate2,role:z(),kill_house_key:a.kill_house_key||"all",trash:a.trash,return_trash:a.return_trash}});return o(su()),{data:t,status:d}});var q6={},is=c0;Object.defineProperty(q6,"__esModule",{value:!0});var K0=q6.default=void 0,hs=is($0()),gs=u;K0=q6.default=(0,hs.default)((0,gs.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"}),"Replay");const As=({item:a,key:o,sellerType:t,buyerType:d,allocationType:c,sellType:y,fetchApiData:F,editData:C,priceInfo:A,coldHouseKey:r,coldHouseItemKey:_,remainWeight:I,fetchDashboardData:L})=>{var s;const w=cu(),[j,b]=n.useState([]),[k,G]=n.useState([]),[O,T]=n.useState(null),[f]=n.useContext(ou),[K,p]=n.useState("own"),x=e=>{p(e.target.value),Y({key:"",item:"",buyerType:"",allocationType:""})},[N,V]=n.useState(A!=null&&A.active?"true":"false"),R=e=>{V(e.target.value),e.target.value==="false"&&h.setFieldValue("price","")},[D,Y]=n.useState({key:o,item:a,buyerType:d,allocationType:c});n.useEffect(()=>{z()==="Steward"&&p("free")},[]),n.useEffect(()=>{C||(w(re()).then(e=>{b(e.payload.data)}),a||w(ze({free:K==="free"})).then(e=>{G(e.payload.data)}))},[w,K]);const g=l6({weight:Du().required("این فیلد اجباری است!").min(1,"یک مقدار مثبت وارد کنید!"),price:Du().required("این فیلد اجباری است!").min(1,"یک مقدار مثبت وارد کنید!"),wholePrice:Du().required("این فیلد اجباری است!").min(1,"یک مقدار مثبت وارد کنید!")}),h=s6({initialValues:{weight:(C==null?void 0:C.realWeightOfCarcasses)||"",wholePrice:(C==null?void 0:C.totalAmount)||"",price:(C==null?void 0:C.amount)||""},validationSchema:g});n.useEffect(()=>{h.validateForm()},[]),n.useEffect(()=>{N==="false"?h.values.weight&&h.values.price&&h.setFieldValue("wholePrice",h.values.price*h.values.weight):A!=null&&A.active&&h.values.weight&&h.setFieldValue("wholePrice",(A==null?void 0:A.killHousePrice)*h.values.weight)},[h.values.price,h.values.weight,N]),n.useEffect(()=>{A!=null&&A.active&&N==="true"&&h.setFieldValue("price",A==null?void 0:A.killHousePrice)},[N]);const M=()=>{w($u()),f({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),w(_6()),L(),F(1)},[U,B]=n.useState(X(new Date).format("YYYY-MM-DD"));return u.jsxs(i,{container:!0,xs:12,direction:"column",justifyContent:"center",alignItems:"center",gap:1,children:[!C&&u.jsx(tu,{label:"تاریخ",id:"date",renderInput:e=>u.jsx($,{fullWidth:!0,...e}),value:U,onChange:e=>{B(X(e).format("YYYY-MM-DD"))}}),!C&&!r&&u.jsx(i,{xs:12,container:!0,children:u.jsx(e6,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"hatching",options:j?j.map(e=>({data:e,label:`${e.name}`})):[],onChange:(e,l)=>{T(l.data)},renderInput:e=>u.jsx($,{fullWidth:!0,...e,label:"انتخاب محصول"})})}),!C&&u.jsx(Eu,{children:u.jsxs(u6,{row:!0,"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:K,onChange:x,children:[u.jsx(Au,{value:"own",control:u.jsx(vu,{}),label:"صنوف اختصاصی"}),u.jsx(Au,{value:"free",control:u.jsx(vu,{}),label:"صنوف آزاد"})]})}),!a&&!C&&u.jsx(i,{xs:12,container:!0,children:u.jsx(e6,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"hatching",options:k?k.map(e=>{var l,P;return{data:e,label:`${e!=null&&e.steward?"مباشر":"صنف"} ${e==null?void 0:e.guildsName} ${(l=e==null?void 0:e.user)==null?void 0:l.fullname} (${(P=e==null?void 0:e.user)==null?void 0:P.mobile})`}}):[],onChange:(e,l)=>{var P,W,v;Y({item:l==null?void 0:l.data,key:(P=l==null?void 0:l.data)==null?void 0:P.key,allocationType:(W=l==null?void 0:l.data)!=null&&W.steward?"killhouse_steward":"killhouse_guild",buyerType:(v=l==null?void 0:l.data)!=null&&v.steward?"Steward":"Guild"})},renderInput:e=>u.jsx($,{fullWidth:!0,...e,label:"انتخاب مباشر / صنف"})})}),u.jsx(mu,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"weight",label:"وزن لاشه",variant:"outlined",value:h.values.weight,error:h.touched.weight&&!!h.errors.weight,helperText:h.touched.weight&&h.errors.weight,onChange:h.handleChange,onBlur:h.handleBlur}),(A==null?void 0:A.active)&&u.jsx(Eu,{children:u.jsxs(u6,{row:!0,"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:N,onChange:R,children:[u.jsx(Au,{value:"true",control:u.jsx(vu,{}),label:"قیمت مصوب"}),u.jsx(Au,{value:"false",control:u.jsx(vu,{}),label:"قیمت آزاد"})]})}),u.jsx(mu,{disabled:(A==null?void 0:A.active)&&N==="true",allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"price",label:"قیمت هر کیلوگرم",variant:"outlined",InputProps:{endAdornment:u.jsx(w6,{position:"start",children:"ریال"})},value:h.values.price,error:h.touched.price?!!h.errors.price:null,onChange:h.handleChange,onBlur:h.handleBlur,helperText:h.touched.price&&h.errors.price?h.errors.price:null}),u.jsx(mu,{disabled:!0,allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"wholePrice",label:"هزینه کل",variant:"outlined",InputProps:{endAdornment:u.jsx(w6,{position:"start",children:"ریال"})},value:h.values.wholePrice,error:h.touched.wholePrice?!!h.errors.wholePrice:null,onChange:h.handleChange,onBlur:h.handleBlur,helperText:h.touched.wholePrice&&h.errors.wholePrice?h.errors.wholePrice:null}),u.jsx(eu,{variant:"contained",fullWidth:!0,disabled:C?!h.isValid:!h.isValid||(r?!1:!O)||!((s=D==null?void 0:D.item)!=null&&s.key),onClick:()=>{var l,P,W;let e={};_?e={allocation_key:_,number_of_carcasses:0,weight_of_carcasses:h.values.weight,amount:h.values.price,total_amount:h.values.wholePrice}:C?e={allocation_key:C==null?void 0:C.key,number_of_carcasses:0,weight_of_carcasses:h.values.weight,amount:h.values.price,total_amount:h.values.wholePrice}:(e={seller_type:t,buyer_type:D==null?void 0:D.buyerType,guild_key:(D==null?void 0:D.buyerType)==="Guild"?(l=D==null?void 0:D.item)==null?void 0:l.key:null,steward_key:(D==null?void 0:D.buyerType)==="Steward"?(P=D==null?void 0:D.item)==null?void 0:P.key:null,kill_house_key:(D==null?void 0:D.buyerType)==="KillHouse"?(W=D==null?void 0:D.item)==null?void 0:W.key:null,cold_house_key:r||null,product_key:r?null:O.key,type:"manual",allocation_type:r?"ColdHouse":D==null?void 0:D.allocationType,number_of_carcasses:0,weight_of_carcasses:h.values.weight,sell_type:y,amount:h.values.price,total_amount:h.values.wholePrice,approved_price_status:N==="true",date:U},e=Object.fromEntries(Object.entries(e).filter(([v,E])=>E!==null))),C?w(N6(e)).then(v=>{v.payload.error?f({vertical:"top",horizontal:"center",msg:v.payload.error,severity:"error"}):M()}):w(O6(e)).then(v=>{v.payload.error?f({vertical:"top",horizontal:"center",msg:v.payload.error,severity:"error"}):M()})},children:"ثبت"})]})},q0=({fetchApiData:a,item:o,fetchData:t,updateTable:d,priceInfo:c,fetchDashboardData:y,isAccepted:F})=>{const[C,A]=n.useState(null),r=cu(),[_]=n.useContext(ou),I=O=>{A(O.currentTarget)},L=()=>{A(null)},w=()=>{L(),r(Zu({title:"ویرایش تخصیص",content:u.jsx(As,{fetchData:t,updateTable:d,fetchApiData:a,editData:o,priceInfo:c,fetchDashboardData:y})}))},j=()=>{r(Zu({title:"آیا مطمئن هستید؟",content:u.jsxs(i,{container:!0,children:[u.jsx(eu,{variant:"contained",onClick:()=>{r(M0({steward_allocation_key:o.key})).then(O=>{O.payload.error?_({vertical:"top",horizontal:"center",msg:O.payload.error,severity:"error"}):(r($u()),a(1),A(null),_({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),u.jsx(eu,{onClick:()=>{r($u())},children:"لغو"})]})}))},b=()=>{r(Zu({title:"آیا مطمئن هستید؟",content:u.jsxs(i,{container:!0,children:[u.jsx(eu,{variant:"contained",onClick:()=>{r(Me({key:o.key})).then(O=>{O.payload.error?_({vertical:"top",horizontal:"center",msg:O.payload.error,severity:"error"}):(r($u()),a(1),A(null),_({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),u.jsx(eu,{onClick:()=>{r($u())},children:"لغو"})]})}))},k=!!C,G=k?"popover":void 0;return u.jsxs(i,{container:!0,children:[u.jsx(C6,{disabled:((o==null?void 0:o.receiverState)==="accepted"||(o==null?void 0:o.loggedRegistrationCode))&&!z()==="SuperAdmin"&&!z()==="AdminX","aria-describedby":G,variant:"contained",color:"primary",onClick:I,children:u.jsx(v6,{})}),u.jsx(h6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:G,open:k,anchorEl:C,onClose:L,children:u.jsx(k6,{sx:{py:0},children:F?u.jsxs(u.Fragment,{children:[u.jsxs(Pu,{onClick:w,children:[u.jsx(Lu,{children:u.jsx(M6,{fontSize:"small",color:"primary"})}),u.jsx(Ou,{primary:"ویرایش",primaryTypographyProps:{variant:"body2",color:"primary"}})]}),u.jsxs(Pu,{onClick:j,children:[u.jsx(Lu,{children:u.jsx(V6,{fontSize:"small",color:"error"})}),u.jsx(Ou,{primary:"حذف",primaryTypographyProps:{variant:"body2",color:"error"}})]})]}):u.jsxs(Pu,{onClick:b,children:[u.jsx(Lu,{children:u.jsx(K0,{fontSize:"small",color:"error"})}),u.jsx(Ou,{primary:"برگشت",primaryTypographyProps:{variant:"body2",color:"error"}})]})})})]})},P6=bu("PROVINCE-DISPENSER-KILL-HOUSE-SERVICE",async(a,{dispatch:o})=>{o(au());const{data:t,status:d}=await q.get("kill_house/?total-exclude-exclusive-killers=true");return o(su()),{data:t,status:d}}),ps=({priceInfo:a})=>{const o=cu(),[,,t,d,c,y]=n.useContext(ou),[F,C]=n.useState([]),[A]=n.useContext(ou),r=Tu(s=>s.userSlice.userProfile.key),[_,I]=n.useState([]),[L,w]=n.useState(0),[j,b]=n.useState(10),[k,G]=n.useState(""),[O,T]=n.useState(1),[f,K]=n.useState([]),[p,x]=n.useState([]),[N,V]=n.useState(null),R=async s=>{o(au());try{const e=await q.get(`/in-province-allocation/?search=filter&value=${k}&role=${z()}&date1=${t}&date2=${c}&trash=false&page=${s||1}&page_size=${j}&type=KillHouse${N?`&kill_house_key=${N}`:"&kill_house_key=all"}`);I(e.data.results),w(e.data.count)}catch(e){console.error("Error fetching data:",e)}finally{o(su())}},D=()=>{o(P6()).then(s=>{x(s.payload.data)})},Y=s=>{R(s),T(s)},g=s=>{G(s.target.value)},h=s=>{var e,l,P,W,v,E,H,S,Q,J,Z,m,uu,lu,nu,ru,du,iu,hu,pu,xu,Su,fu,ju,_u;if(!s)return"-";switch(s==null?void 0:s.allocationType){case"killhouse_killhouse":return`${((e=s==null?void 0:s.toKillHouse)==null?void 0:e.name)||"-"} - ${((W=(P=(l=s==null?void 0:s.toKillHouse)==null?void 0:l.killHouseOperator)==null?void 0:P.user)==null?void 0:W.fullname)||"-"} (${((H=(E=(v=s==null?void 0:s.toKillHouse)==null?void 0:v.killHouseOperator)==null?void 0:E.user)==null?void 0:H.mobile)||"-"})`;case"killhouse_steward":return`${((S=s==null?void 0:s.toSteward)==null?void 0:S.guildsName)||"-"} - ${((J=(Q=s==null?void 0:s.toSteward)==null?void 0:Q.user)==null?void 0:J.fullname)||"-"} (${((m=(Z=s==null?void 0:s.toSteward)==null?void 0:Z.user)==null?void 0:m.mobile)||"-"})`;case"killhouse_guild":return`${((uu=s==null?void 0:s.toGuilds)==null?void 0:uu.guildsName)||"-"} - ${((nu=(lu=s==null?void 0:s.toGuilds)==null?void 0:lu.user)==null?void 0:nu.fullname)||"-"} (${((du=(ru=s==null?void 0:s.toGuilds)==null?void 0:ru.user)==null?void 0:du.mobile)||"-"})`;case"ColdHouse":return`${((iu=s==null?void 0:s.toColdHouse)==null?void 0:iu.name)||"-"}`;default:return`${((hu=s==null?void 0:s.toKillHouse)==null?void 0:hu.name)||"-"} - ${((Su=(xu=(pu=s==null?void 0:s.toKillHouse)==null?void 0:pu.killHouseOperator)==null?void 0:xu.user)==null?void 0:Su.fullname)||"-"} (${((_u=(ju=(fu=s==null?void 0:s.toKillHouse)==null?void 0:fu.killHouseOperator)==null?void 0:ju.user)==null?void 0:_u.mobile)||"-"})`}},M=s=>{b(s),T(1)},U=()=>{o(K6({search:"filter",role:z(),selectedDate1:t,selectedDate2:c,kill_house_key:N||"all",trash:!1})).then(s=>{C(s.payload.data)})};n.useEffect(()=>{const s=_==null?void 0:_.map((e,l)=>{var P,W,v,E,H,S,Q,J,Z,m,uu,lu,nu,ru;return[O===1?l+1:l+j*(O-1)+1,e!=null&&e.date?I6(e==null?void 0:e.date):"-",e!=null&&e.productionDate?a6(e==null?void 0:e.productionDate):"-",(e==null?void 0:e.distributionType)==="web"?"سایت":(e==null?void 0:e.distributionType)==="app"?"موبایل":(e==null?void 0:e.distributionType)==="pos"?"پوز":e==null?void 0:e.distributionType,D6(e),`${(E=(v=(W=(P=e==null?void 0:e.killHouse)==null?void 0:P.killHouseOperator)==null?void 0:W.user)==null?void 0:v.fullname)==null?void 0:E.toLocaleString()} ${(S=(H=e==null?void 0:e.killHouse)==null?void 0:H.name)==null?void 0:S.toLocaleString()} ${((m=(Z=(J=(Q=e==null?void 0:e.killHouse)==null?void 0:Q.killHouseOperator)==null?void 0:J.user)==null?void 0:Z.mobile)==null?void 0:m.toLocaleString())||"-"}`,h(e),(e==null?void 0:e.sellType)==="exclusive"?"اختصاصی":"آزاد",(e==null?void 0:e.quota)==="governmental"?"دولتی":(e==null?void 0:e.quota)==="free"?"آزاد":"-",e!=null&&e.approvedPriceStatus?"دولتی":"آزاد",(((uu=e==null?void 0:e.amount)==null?void 0:uu.toLocaleString())||"0")+" ریال",(((lu=e==null?void 0:e.totalAmount)==null?void 0:lu.toLocaleString())||"0")+" ریال",((nu=e==null?void 0:e.weightOfCarcasses)==null?void 0:nu.toLocaleString())||"0",((ru=e==null?void 0:e.reciverWeightOfCarcasses)==null?void 0:ru.toLocaleString())||"0",(e==null?void 0:e.loggedRegistrationCode)||"-",e!=null&&e.registrationCode?"ارسال شده":"ارسال نشده",u.jsx($6,{src:e==null?void 0:e.image},l),(e==null?void 0:e.receiverState)==="accepted"||e!=null&&e.loggedRegistrationCode?"تایید شده":(e==null?void 0:e.receiverState)==="rejected"?"رد شده":e!=null&&e.activeExpireDateTime&&!(e!=null&&e.loggedRegistrationCode)?"در انتظار ورود کد احراز":"در انتظار تایید",u.jsx(q0,{item:e,fetchApiData:R,priceInfo:a,fetchDashboardData:U,isAccepted:!0},l)]});K(s)},[_,O,j,a]),n.useEffect(()=>{R(1),U()},[o,t,c,j,N]),n.useEffect(()=>{D()},[o]);const B=async s=>{s.preventDefault(),R(1),U()};return u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,mt:2,children:[u.jsx(i,{container:!0,width:"100%",isDashboard:!0,children:u.jsx(G6,{dashboardData:F})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(i,{children:u.jsx(tu,{label:"از تاریخ",renderInput:s=>u.jsx($,{...s,style:{width:"160px"},size:"small"}),value:t,onChange:s=>{d(X(s).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsx(tu,{label:"تا تاریخ",renderInput:s=>u.jsx($,{...s,style:{width:"160px"},size:"small"}),value:c,onChange:s=>{y(X(s).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsxs("form",{onSubmit:B,style:{marginRight:"16px"},children:[u.jsxs(Eu,{size:"small",style:{width:200},children:[u.jsx(T6,{id:"killhouse-select-label",children:"کشتارگاه"}),u.jsxs(R6,{labelId:"killhouse-select-label",value:N||"all",onChange:s=>V(s.target.value==="all"?null:s.target.value),label:"کشتارگاه",children:[u.jsx(Ru,{value:"all",children:"همه کشتارگاه‌ها"}),p.map(s=>u.jsxs(Ru,{value:s.key,children:[s.shopType," ",s.shopName]},s.key))]})]}),u.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250,marginRight:"16px"},onChange:g,value:k}),u.jsx(eu,{type:"submit",endIcon:u.jsx(wu,{}),children:"جستجو"})]})}),u.jsx(Fu,{title:"خروجی اکسل",children:u.jsx(eu,{color:"success",onClick:()=>{A({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const s=`${q.defaults.baseURL}steward_allocation_excel/?role=${z()}&key=${r}&search=filter&value=${k}&date1=${t}&date2=${c}&trash=false&type=KillHouse${N?`&kill_house_key=${N}`:"&kill_house_key=all"}`;window.location.href=s},children:u.jsx(Iu,{size:32})})})]}),u.jsx(Cu,{data:f,columns:["ردیف","تاریخ ثبت","تاریخ تولید گوشت","ثبت شده","نوع تخصیص","مشخصات فروشنده","مشخصات خریدار","فروش","سهمیه","نوع فروش","قیمت هر کیلو","قیمت کل","وزن تخصیصی","وزن تایید شده","کداحراز","وضعیت کد احراز","سند","وضعیت","عملیات"],handlePageChange:Y,totalRows:L,page:O,perPage:j,handlePerRowsChange:M,title:"تخصیصات صورت گرفته"})]})})},xs=({priceInfo:a})=>{const o=cu(),[,,t,d,c,y]=n.useContext(ou),[F,C]=n.useState([]),[A]=n.useContext(ou),r=Tu(s=>s.userSlice.userProfile.key),[_,I]=n.useState([]),[L,w]=n.useState(0),[j,b]=n.useState(10),[k,G]=n.useState(""),[O,T]=n.useState(1),[f,K]=n.useState([]),[p,x]=n.useState([]),[N,V]=n.useState(null),R=async s=>{o(au());try{const e=await q.get(`/in-province-allocation/?search=filter&value=${k}&role=${z()}&date1=${t}&date2=${c}&trash=true&page=${s||1}&page_size=${j}&type=KillHouse${N?`&kill_house_key=${N}`:"&kill_house_key=all"}`);I(e.data.results),w(e.data.count)}catch(e){console.error("Error fetching data:",e)}finally{o(su())}},D=()=>{o(P6()).then(s=>{x(s.payload.data)})},Y=s=>{R(s),T(s)},g=s=>{G(s.target.value)},h=s=>{var e,l,P,W,v,E,H,S,Q,J,Z,m,uu,lu,nu,ru,du,iu,hu,pu,xu,Su,fu,ju,_u;if(!s)return"-";switch(s==null?void 0:s.allocationType){case"killhouse_killhouse":return`${((e=s==null?void 0:s.toKillHouse)==null?void 0:e.name)||"-"} - ${((W=(P=(l=s==null?void 0:s.toKillHouse)==null?void 0:l.killHouseOperator)==null?void 0:P.user)==null?void 0:W.fullname)||"-"} (${((H=(E=(v=s==null?void 0:s.toKillHouse)==null?void 0:v.killHouseOperator)==null?void 0:E.user)==null?void 0:H.mobile)||"-"})`;case"killhouse_steward":return`${((S=s==null?void 0:s.toSteward)==null?void 0:S.guildsName)||"-"} - ${((J=(Q=s==null?void 0:s.toSteward)==null?void 0:Q.user)==null?void 0:J.fullname)||"-"} (${((m=(Z=s==null?void 0:s.toSteward)==null?void 0:Z.user)==null?void 0:m.mobile)||"-"})`;case"killhouse_guild":return`${((uu=s==null?void 0:s.toGuilds)==null?void 0:uu.guildsName)||"-"} - ${((nu=(lu=s==null?void 0:s.toGuilds)==null?void 0:lu.user)==null?void 0:nu.fullname)||"-"} (${((du=(ru=s==null?void 0:s.toGuilds)==null?void 0:ru.user)==null?void 0:du.mobile)||"-"})`;case"ColdHouse":return`${((iu=s==null?void 0:s.toColdHouse)==null?void 0:iu.name)||"-"}`;default:return`${((hu=s==null?void 0:s.toKillHouse)==null?void 0:hu.name)||"-"} - ${((Su=(xu=(pu=s==null?void 0:s.toKillHouse)==null?void 0:pu.killHouseOperator)==null?void 0:xu.user)==null?void 0:Su.fullname)||"-"} (${((_u=(ju=(fu=s==null?void 0:s.toKillHouse)==null?void 0:fu.killHouseOperator)==null?void 0:ju.user)==null?void 0:_u.mobile)||"-"})`}},M=s=>{b(s),T(1)},U=()=>{o(K6({search:"filter",role:z(),selectedDate1:t,selectedDate2:c,kill_house_key:N||"all",trash:!0})).then(s=>{C(s.payload.data)})};n.useEffect(()=>{const s=_==null?void 0:_.map((e,l)=>{var P,W,v,E,H,S,Q,J,Z,m,uu,lu,nu,ru;return[O===1?l+1:l+j*(O-1)+1,e!=null&&e.date?I6(e==null?void 0:e.date):"-",e!=null&&e.productionDate?a6(e==null?void 0:e.productionDate):"-",(e==null?void 0:e.distributionType)==="web"?"سایت":(e==null?void 0:e.distributionType)==="app"?"موبایل":(e==null?void 0:e.distributionType)==="pos"?"پوز":e==null?void 0:e.distributionType,D6(e),`${(E=(v=(W=(P=e==null?void 0:e.killHouse)==null?void 0:P.killHouseOperator)==null?void 0:W.user)==null?void 0:v.fullname)==null?void 0:E.toLocaleString()} ${(S=(H=e==null?void 0:e.killHouse)==null?void 0:H.name)==null?void 0:S.toLocaleString()} ${((m=(Z=(J=(Q=e==null?void 0:e.killHouse)==null?void 0:Q.killHouseOperator)==null?void 0:J.user)==null?void 0:Z.mobile)==null?void 0:m.toLocaleString())||"-"}`,h(e),(e==null?void 0:e.sellType)==="exclusive"?"اختصاصی":"آزاد",(e==null?void 0:e.quota)==="governmental"?"دولتی":(e==null?void 0:e.quota)==="free"?"آزاد":"-",e!=null&&e.approvedPriceStatus?"دولتی":"آزاد",(((uu=e==null?void 0:e.amount)==null?void 0:uu.toLocaleString())||"0")+" ریال",(((lu=e==null?void 0:e.totalAmount)==null?void 0:lu.toLocaleString())||"0")+" ریال",((nu=e==null?void 0:e.weightOfCarcasses)==null?void 0:nu.toLocaleString())||"0",((ru=e==null?void 0:e.reciverWeightOfCarcasses)==null?void 0:ru.toLocaleString())||"0",(e==null?void 0:e.loggedRegistrationCode)||"-",e!=null&&e.registrationCode?"ارسال شده":"ارسال نشده",u.jsx($6,{src:e==null?void 0:e.image},l),"حذف (احراز نشده)",u.jsx(q0,{item:e,fetchApiData:R,priceInfo:a,fetchDashboardData:U},l)]});K(s)},[_,O,j,a]),n.useEffect(()=>{R(1),U()},[o,t,c,j,N]),n.useEffect(()=>{D()},[o]);const B=async s=>{s.preventDefault(),R(1),U()};return u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,mt:2,children:[u.jsx(i,{container:!0,width:"100%",isDashboard:!0,children:u.jsx(G6,{dashboardData:F})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(i,{children:u.jsx(tu,{label:"از تاریخ",renderInput:s=>u.jsx($,{...s,style:{width:"160px"},size:"small"}),value:t,onChange:s=>{d(X(s).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsx(tu,{label:"تا تاریخ",renderInput:s=>u.jsx($,{...s,style:{width:"160px"},size:"small"}),value:c,onChange:s=>{y(X(s).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsxs("form",{onSubmit:B,style:{marginRight:"16px"},children:[u.jsxs(Eu,{size:"small",style:{width:200},children:[u.jsx(T6,{id:"killhouse-select-label",children:"کشتارگاه"}),u.jsxs(R6,{labelId:"killhouse-select-label",value:N||"all",onChange:s=>V(s.target.value==="all"?null:s.target.value),label:"کشتارگاه",children:[u.jsx(Ru,{value:"all",children:"همه کشتارگاه‌ها"}),p.map(s=>u.jsxs(Ru,{value:s.key,children:[s.shopType," ",s.shopName]},s.key))]})]}),u.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250,marginRight:"16px"},onChange:g,value:k}),u.jsx(eu,{type:"submit",endIcon:u.jsx(wu,{}),children:"جستجو"})]})}),u.jsx(Fu,{title:"خروجی اکسل",children:u.jsx(eu,{color:"success",onClick:()=>{A({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const s=`${q.defaults.baseURL}steward_allocation_excel/?role=${z()}&key=${r}&search=filter&value=${k}&date1=${t}&date2=${c}&trash=true&type=KillHouse${N?`&kill_house_key=${N}`:"&kill_house_key=all"}`;window.location.href=s},children:u.jsx(Iu,{size:32})})})]}),u.jsx(Cu,{data:f,columns:["ردیف","تاریخ ثبت","تاریخ تولید گوشت","ثبت شده","نوع تخصیص","مشخصات فروشنده","مشخصات خریدار","فروش","سهمیه","نوع فروش","قیمت هر کیلو","قیمت کل","وزن تخصیصی","وزن تایید شده","کداحراز","وضعیت کد احراز","سند","وضعیت","عملیات"],handlePageChange:Y,totalRows:L,page:O,perPage:j,handlePerRowsChange:M,title:"تخصیصات حذف شده"})]})})},Ss=({priceInfo:a})=>{const o=cu(),[,,t,d,c,y]=n.useContext(ou),[F,C]=n.useState([]),[A]=n.useContext(ou),r=Tu(s=>s.userSlice.userProfile.key),[_,I]=n.useState([]),[L,w]=n.useState(0),[j,b]=n.useState(10),[k,G]=n.useState(""),[O,T]=n.useState(1),[f,K]=n.useState([]),[p,x]=n.useState([]),[N,V]=n.useState(null),R=async s=>{o(au());try{const e=await q.get(`/in-province-allocation/?search=filter&value=${k}&role=${z()}&date1=${t}&date2=${c}&trash=false&return_trash=true&page=${s||1}&page_size=${j}&type=KillHouse${N?`&kill_house_key=${N}`:"&kill_house_key=all"}`);I(e.data.results),w(e.data.count)}catch(e){console.error("Error fetching data:",e)}finally{o(su())}},D=()=>{o(P6()).then(s=>{x(s.payload.data)})},Y=s=>{R(s),T(s)},g=s=>{G(s.target.value)},h=s=>{var e,l,P,W,v,E,H,S,Q,J,Z,m,uu,lu,nu,ru,du,iu,hu,pu,xu,Su,fu,ju,_u;if(!s)return"-";switch(s==null?void 0:s.allocationType){case"killhouse_killhouse":return`${((e=s==null?void 0:s.toKillHouse)==null?void 0:e.name)||"-"} - ${((W=(P=(l=s==null?void 0:s.toKillHouse)==null?void 0:l.killHouseOperator)==null?void 0:P.user)==null?void 0:W.fullname)||"-"} (${((H=(E=(v=s==null?void 0:s.toKillHouse)==null?void 0:v.killHouseOperator)==null?void 0:E.user)==null?void 0:H.mobile)||"-"})`;case"killhouse_steward":return`${((S=s==null?void 0:s.toSteward)==null?void 0:S.guildsName)||"-"} - ${((J=(Q=s==null?void 0:s.toSteward)==null?void 0:Q.user)==null?void 0:J.fullname)||"-"} (${((m=(Z=s==null?void 0:s.toSteward)==null?void 0:Z.user)==null?void 0:m.mobile)||"-"})`;case"killhouse_guild":return`${((uu=s==null?void 0:s.toGuilds)==null?void 0:uu.guildsName)||"-"} - ${((nu=(lu=s==null?void 0:s.toGuilds)==null?void 0:lu.user)==null?void 0:nu.fullname)||"-"} (${((du=(ru=s==null?void 0:s.toGuilds)==null?void 0:ru.user)==null?void 0:du.mobile)||"-"})`;case"ColdHouse":return`${((iu=s==null?void 0:s.toColdHouse)==null?void 0:iu.name)||"-"}`;default:return`${((hu=s==null?void 0:s.toKillHouse)==null?void 0:hu.name)||"-"} - ${((Su=(xu=(pu=s==null?void 0:s.toKillHouse)==null?void 0:pu.killHouseOperator)==null?void 0:xu.user)==null?void 0:Su.fullname)||"-"} (${((_u=(ju=(fu=s==null?void 0:s.toKillHouse)==null?void 0:fu.killHouseOperator)==null?void 0:ju.user)==null?void 0:_u.mobile)||"-"})`}},M=s=>{b(s),T(1)},U=()=>{o(K6({search:"filter",role:z(),selectedDate1:t,selectedDate2:c,kill_house_key:N||"all",trash:!1,return_trash:!0})).then(s=>{C(s.payload.data)})};n.useEffect(()=>{const s=_==null?void 0:_.map((e,l)=>{var P,W,v,E,H,S,Q,J,Z,m,uu,lu,nu,ru;return[O===1?l+1:l+j*(O-1)+1,e!=null&&e.date?I6(e==null?void 0:e.date):"-",e!=null&&e.productionDate?a6(e==null?void 0:e.productionDate):"-",(e==null?void 0:e.distributionType)==="web"?"سایت":(e==null?void 0:e.distributionType)==="app"?"موبایل":(e==null?void 0:e.distributionType)==="pos"?"پوز":e==null?void 0:e.distributionType,D6(e),`${(E=(v=(W=(P=e==null?void 0:e.killHouse)==null?void 0:P.killHouseOperator)==null?void 0:W.user)==null?void 0:v.fullname)==null?void 0:E.toLocaleString()} ${(S=(H=e==null?void 0:e.killHouse)==null?void 0:H.name)==null?void 0:S.toLocaleString()} ${((m=(Z=(J=(Q=e==null?void 0:e.killHouse)==null?void 0:Q.killHouseOperator)==null?void 0:J.user)==null?void 0:Z.mobile)==null?void 0:m.toLocaleString())||"-"}`,h(e),(e==null?void 0:e.sellType)==="exclusive"?"اختصاصی":"آزاد",(e==null?void 0:e.quota)==="governmental"?"دولتی":(e==null?void 0:e.quota)==="free"?"آزاد":"-",e!=null&&e.approvedPriceStatus?"دولتی":"آزاد",(((uu=e==null?void 0:e.amount)==null?void 0:uu.toLocaleString())||"0")+" ریال",(((lu=e==null?void 0:e.totalAmount)==null?void 0:lu.toLocaleString())||"0")+" ریال",((nu=e==null?void 0:e.weightOfCarcasses)==null?void 0:nu.toLocaleString())||"0",((ru=e==null?void 0:e.reciverWeightOfCarcasses)==null?void 0:ru.toLocaleString())||"0",(e==null?void 0:e.loggedRegistrationCode)||"-",e!=null&&e.registrationCode?"ارسال شده":"ارسال نشده",u.jsx($6,{src:e==null?void 0:e.image},l),"برگشت خورده"]});K(s)},[_,O,j,a]),n.useEffect(()=>{R(1),U()},[o,t,c,j,N]),n.useEffect(()=>{D()},[o]);const B=async s=>{s.preventDefault(),R(1),U()};return u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,mt:2,children:[u.jsx(i,{container:!0,width:"100%",isDashboard:!0,children:u.jsx(G6,{dashboardData:F})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(i,{children:u.jsx(tu,{label:"از تاریخ",renderInput:s=>u.jsx($,{...s,style:{width:"160px"},size:"small"}),value:t,onChange:s=>{d(X(s).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsx(tu,{label:"تا تاریخ",renderInput:s=>u.jsx($,{...s,style:{width:"160px"},size:"small"}),value:c,onChange:s=>{y(X(s).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsxs("form",{onSubmit:B,style:{marginRight:"16px"},children:[u.jsxs(Eu,{size:"small",style:{width:200},children:[u.jsx(T6,{id:"killhouse-select-label",children:"کشتارگاه"}),u.jsxs(R6,{labelId:"killhouse-select-label",value:N||"all",onChange:s=>V(s.target.value==="all"?null:s.target.value),label:"کشتارگاه",children:[u.jsx(Ru,{value:"all",children:"همه کشتارگاه‌ها"}),p.map(s=>u.jsxs(Ru,{value:s.key,children:[s.shopType," ",s.shopName]},s.key))]})]}),u.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250,marginRight:"16px"},onChange:g,value:k}),u.jsx(eu,{type:"submit",endIcon:u.jsx(wu,{}),children:"جستجو"})]})}),u.jsx(Fu,{title:"خروجی اکسل",children:u.jsx(eu,{color:"success",onClick:()=>{A({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const s=`${q.defaults.baseURL}steward_allocation_excel/?role=${z()}&key=${r}&return_trash=true&search=filter&value=${k}&date1=${t}&date2=${c}&trash=false&type=KillHouse${N?`&kill_house_key=${N}`:"&kill_house_key=all"}`;window.location.href=s},children:u.jsx(Iu,{size:32})})})]}),u.jsx(Cu,{data:f,columns:["ردیف","تاریخ ثبت","تاریخ تولید گوشت","ثبت شده","نوع تخصیص","مشخصات فروشنده","مشخصات خریدار","فروش","سهمیه","نوع فروش","قیمت هر کیلو","قیمت کل","وزن تخصیصی","وزن تایید شده","کداحراز","وضعیت کد احراز","سند","وضعیت"],handlePageChange:Y,totalRows:L,page:O,perPage:j,handlePerRowsChange:M,title:"تخصیصات برگشت خورده"})]})})},fs=()=>{const[a,o]=n.useState(0),t=(d,c)=>{o(c)};return u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsxs(c6,{value:a,onChange:t,"aria-label":"simple tabs example",scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,children:[u.jsx(yu,{label:"تایید شده"}),u.jsx(yu,{label:"حذف شده"}),u.jsx(yu,{label:"برگشت خورده"})]})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"center",children:[a===0&&u.jsx(ps,{}),a===1&&u.jsx(xs,{}),a===2&&u.jsx(Ss,{})]})]})},ys=({dashboardData:a})=>{var o,t,d;return u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsx(Cu,{noPagination:!0,title:"اطلاعات کلی",columns:["تعداد فروش","خریدار","وزن کل لاشه ها"],data:[[(o=a==null?void 0:a.numberOfAllocations)==null?void 0:o.toLocaleString(),(t=a==null?void 0:a.numberOfBuyers)==null?void 0:t.toLocaleString(),(d=a==null?void 0:a.totalWeightOfAllocationCarcasses)==null?void 0:d.toLocaleString()]]})})},js=bu("PROVINCE_DISPENSER_SALE_WITHOUT_DASHBOARD",async(a,{dispatch:o})=>{o(au());const{data:t,status:d}=await q.get("dashboard_kill_house_free_sale_bar",{params:{date1:a.selectedDate1,date2:a.selectedDate2,role:z(),kill_house_key:a.kill_house_key||"all"}});return o(su()),{data:t,status:d}}),_s=({editData:a,fetchData:o,fetchApiData:t,fetchDashboardData:d})=>{const c=cu(),[y]=n.useContext(ou),F=l6({weight:Du().required("این فیلد اجباری است!").min(1,"یک مقدار مثبت وارد کنید!"),quarantineCode:gu().required("کد قرنطینه الزامی است"),date:N0().required("تاریخ الزامی است")}),C=s6({initialValues:{weight:(a==null?void 0:a.realWeightOfCarcasses)||"",quarantineCode:(a==null?void 0:a.clearanceCode)||"",date:a!=null&&a.date?X(a.date):X()},validationSchema:F,enableReinitialize:!0}),A=()=>{c($u()),y({vertical:"top",horizontal:"center",msg:"وزن با موفقیت ویرایش شد.",severity:"success"}),c(te()),t(1),d()};return u.jsxs(i,{container:!0,xs:12,direction:"column",justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(mu,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"weight",label:"وزن لاشه (کیلوگرم)",variant:"outlined",value:C.values.weight,error:C.touched.weight&&!!C.errors.weight,onChange:C.handleChange,onBlur:C.handleBlur,helperText:C.touched.weight&&C.errors.weight?C.errors.weight:null}),u.jsx($,{fullWidth:!0,id:"quarantineCode",label:"کد قرنطینه",variant:"outlined",value:C.values.quarantineCode,error:C.touched.quarantineCode&&!!C.errors.quarantineCode,onChange:C.handleChange,onBlur:C.handleBlur,helperText:C.touched.quarantineCode&&C.errors.quarantineCode?C.errors.quarantineCode:null}),u.jsx(tu,{label:"تاریخ",id:"date",value:C.values.date,onChange:r=>{C.setFieldValue("date",r)},onBlur:()=>C.setFieldTouched("date",!0),renderInput:r=>u.jsx($,{...r,error:C.touched.date&&!!C.errors.date,helperText:C.touched.date&&C.errors.date,fullWidth:!0})}),u.jsx(eu,{variant:"contained",fullWidth:!0,disabled:!C.isValid||C.isSubmitting,onClick:()=>{const r={key:a==null?void 0:a.key,weight_of_carcasses:C.values.weight,quarantineCode:C.values.quarantineCode,date:X(C.values.date).format("YYYY-MM-DD HH:mm:ss")};c(Ve(r)).then(_=>{_.payload.error?y({vertical:"top",horizontal:"center",msg:_.payload.error,severity:"error"}):(A(),o())})},children:"ثبت"})]})},vs=bu("PROVINCE_DELETE_ALLOCATED_SERVICE",async(a,{dispatch:o})=>{o(au());const{data:t,status:d}=await q.delete("kill_house_free_sale_bar/0/",{params:{key:a.key}});return o(su()),{data:t,status:d}}),Fs=({fetchApiData:a,item:o,fetchData:t,updateTable:d,priceInfo:c,fetchDashboardData:y})=>{const[F,C]=n.useState(null),A=cu(),r=b=>{C(b.currentTarget)},_=()=>{C(null)},I=()=>{_(),A(Zu({title:"ویرایش تخصیص",content:u.jsx(_s,{fetchData:t,updateTable:d,fetchApiData:a,fetchDashboardData:y,editData:o,priceInfo:c})}))},L=()=>{A(vs({key:o.key})).then(()=>{y(),a(1),C(null)})},w=!!F,j=w?"popover":void 0;return u.jsxs(i,{container:!0,children:[u.jsx(C6,{disabled:o==null?void 0:o.registrationCode,"aria-describedby":j,variant:"contained",color:"primary",onClick:r,children:u.jsx(v6,{})}),u.jsx(h6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:j,open:w,anchorEl:F,onClose:_,children:u.jsxs(k6,{sx:{py:0},children:[u.jsxs(Pu,{onClick:I,children:[u.jsx(Lu,{children:u.jsx(M6,{fontSize:"small",color:"primary"})}),u.jsx(Ou,{primary:"ویرایش",primaryTypographyProps:{variant:"body2",color:"primary"}})]}),u.jsxs(Pu,{disabled:o==null?void 0:o.registrationCode,onClick:L,children:[u.jsx(Lu,{children:u.jsx(V6,{fontSize:"small",color:"error"})}),u.jsx(Ou,{primary:"حذف",primaryTypographyProps:{variant:"body2",color:o!=null&&o.registrationCode?"text.secondary":"error"}})]})]})})]})},Es=({updateTable:a,priceInfo:o,remainWeight:t})=>{const d=cu(),[,,c,y,F,C]=n.useContext(ou),A=e=>{k(e.target.value)},[r,_]=n.useState([]),[I,L]=n.useState(0),[w,j]=n.useState(10),[b,k]=n.useState(""),[G,O]=n.useState(1),[T,f]=n.useState([]),[K,p]=n.useState([]),x=Tu(e=>e.userSlice.userProfile.key),[N]=n.useContext(ou),[V,R]=n.useState([]),[D,Y]=n.useState(null),g=async e=>{d(au());try{const l=await q.get(`kill_house_free_sale_bar/?search=filter&value=${b}&role=${z()}&date1=${c}&date2=${F}&page=${e||1}&page_size=${w}&type=dashboard${D?`&kill_house_key=${D}`:"&kill_house_key=all"}`);_(l.data.results),L(l.data.count)}catch(l){console.error("Error fetching data:",l)}finally{d(su())}},h=()=>{d(js({search:"filter",role:z(),selectedDate1:c,selectedDate2:F})).then(e=>{var l;p((l=e.payload)==null?void 0:l.data)})},M=e=>{j(e),O(1)};n.useEffect(()=>{const e=r==null?void 0:r.map((l,P)=>{var W,v,E,H,S,Q,J,Z,m,uu;return[G===1?P+1:P+w*(G-1)+1,a6(l==null?void 0:l.date)||"-",`${(E=(v=(W=l==null?void 0:l.killHouse)==null?void 0:W.killHouseOperator)==null?void 0:v.user)==null?void 0:E.fullname} ${(H=l==null?void 0:l.killHouse)==null?void 0:H.name} ${((J=(Q=(S=l==null?void 0:l.killHouse)==null?void 0:S.killHouseOperator)==null?void 0:Q.user)==null?void 0:J.mobile)||"-"}`,`${l==null?void 0:l.buyerName} (${l==null?void 0:l.buyerMobile})`,l!=null&&l.buyer?`${(Z=l==null?void 0:l.buyer)==null?void 0:Z.unitName}`:`${l==null?void 0:l.buyerName}`,l==null?void 0:l.province,l==null?void 0:l.city,(l==null?void 0:l.clearanceCode)&&u.jsx(V0,{clearanceCode:l==null?void 0:l.clearanceCode}),(m=l==null?void 0:l.quarantineWeightOfCarcasses)==null?void 0:m.toLocaleString(),(uu=l==null?void 0:l.weightOfCarcasses)==null?void 0:uu.toLocaleString(),u.jsx(Fs,{item:l,fetchApiData:g,fetchDashboardData:h,priceInfo:o},P)]});f(e)},[r,G,w,o]);const U=()=>{d(P6()).then(e=>{R(e.payload.data)})},B=e=>{g(e),O(e)};n.useEffect(()=>{g(1),h(),U()},[d,c,F,w,D]);const s=async e=>{e.preventDefault(),g(1),h()};return u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,mt:4,children:[u.jsx(i,{container:!0,width:"100%",isDashboard:!0,children:u.jsx(ys,{dashboardData:K,fetchDashboardData:h})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(i,{children:u.jsx(tu,{label:"از تاریخ",renderInput:e=>u.jsx($,{...e,style:{width:"160px"},size:"small"}),value:c,onChange:e=>{y(X(e).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsx(tu,{label:"تا تاریخ",renderInput:e=>u.jsx($,{...e,style:{width:"160px"},size:"small"}),value:F,onChange:e=>{C(X(e).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsxs("form",{onSubmit:s,style:{marginRight:"16px"},children:[u.jsxs(Eu,{size:"small",style:{width:200},children:[u.jsx(T6,{id:"killhouse-select-label",children:"کشتارگاه"}),u.jsxs(R6,{labelId:"killhouse-select-label",value:D||"all",onChange:e=>Y(e.target.value==="all"?null:e.target.value),label:"کشتارگاه",children:[u.jsx(Ru,{value:"all",children:"همه کشتارگاه‌ها"}),V==null?void 0:V.map(e=>u.jsxs(Ru,{value:e==null?void 0:e.key,children:[e==null?void 0:e.shopType," ",e==null?void 0:e.shopName]},e==null?void 0:e.key))]})]}),u.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250,marginRight:"16px"},onChange:A,value:b}),u.jsx(eu,{type:"submit",endIcon:u.jsx(wu,{}),children:"جستجو"})]})}),u.jsx(Fu,{title:"خروجی اکسل",children:u.jsx(eu,{color:"success",onClick:()=>{N({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const e=`${q.defaults.baseURL}free_sale_out_province_excel/?role=${z()}&key=${x}&search=filter&value=${b} &date1=${c}&date2=${F}&type`;window.location.href=e},children:u.jsx(Iu,{size:32})})})]}),u.jsx(Cu,{data:T,columns:["ردیف","تاریخ","مشخصات فروشنده","مشخصات خریدار","نام واحد","استان","شهر","کد قرنطینه","وزن استعلامی","وزن لاشه","عملیات"],handlePageChange:B,totalRows:I,page:G,perPage:w,handlePerRowsChange:M,title:"فروش به خارج استان"})]})})},ws=()=>{var V,R,D;const[a,o]=n.useState([]),[t,d]=n.useState([]),[c,y]=n.useState(0),[F,C]=n.useState(10),[A,r]=n.useState(""),[_,I]=n.useState(1),[L,w]=n.useState([]),[,,j,b,k,G]=n.useContext(ou),O=cu(),T=()=>{O(Ue({value:A,date1:j,date2:k,role:z()})).then(Y=>{w(Y.payload.data)})};n.useEffect(()=>{const Y=X(new Date).format("YYYY-MM-DD");b(Y),G(Y)},[]);const f=async Y=>{O(au());const g=await q.get(`kill-house-segmentation-info/?search=filter&value=${A}&date1=${j}&date2=${k}&page=${Y}&page_size=${F}&role=${z()}`);T(),O(su()),o(g.data.results),y(g.data.count)},K=Y=>{f(Y),I(Y)},p=Y=>{C(Y),I(1)},x=Y=>{r(Y.target.value)};n.useEffect(()=>{f(1)},[]),n.useEffect(()=>{const Y=a==null?void 0:a.map((g,h)=>{var M,U,B,s,e,l,P,W,v,E,H,S;return[_===1?h+1:h+F*(_-1)+1,g==null?void 0:g.name,(U=(M=g==null?void 0:g.info)==null?void 0:M.totalCount)==null?void 0:U.toLocaleString(),(s=(B=g==null?void 0:g.info)==null?void 0:B.totalWeight)==null?void 0:s.toLocaleString(),(l=(e=g==null?void 0:g.info)==null?void 0:e.totalSelfCount)==null?void 0:l.toLocaleString(),(W=(P=g==null?void 0:g.info)==null?void 0:P.totalSelfWeight)==null?void 0:W.toLocaleString(),(E=(v=g==null?void 0:g.info)==null?void 0:v.totalOtherCount)==null?void 0:E.toLocaleString(),(S=(H=g==null?void 0:g.info)==null?void 0:H.totalOtherWeight)==null?void 0:S.toLocaleString()]});d(Y)},[a]),n.useEffect(()=>{f(1)},[j,k,F]);const N=async Y=>{Y.preventDefault(),O(au());try{const g=await q.get(`kill-house-segmentation-info/?search=filter&value=${A}&date1=${j}&date2=${k}&page=${_}&role=${z()}`);o(g.data.results),y(g.data.count),T(),O(su())}catch(g){console.error("Error fetching data:",g)}};return u.jsx(i,{container:!0,direction:"column",flexWrap:"nowrap",mt:ku.SMALL,children:u.jsxs(i,{xs:12,container:!0,alignItems:"center",gap:ku.SMALL,justifyContent:"flex-start",children:[u.jsx(i,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(Cu,{noPagination:!0,isDashboard:!0,columns:["وزن کل (کیلوگرم)","وزن قطعه بندی","وزن تخصیصی به قطعه بندها"],data:[[((V=L==null?void 0:L.totalWeight)==null?void 0:V.toLocaleString())||"0",((R=L==null?void 0:L.totalSelfWeight)==null?void 0:R.toLocaleString())||"0",((D=L==null?void 0:L.totalOtherWeight)==null?void 0:D.toLocaleString())||"0"]],title:"خلاصه اطلاعات"})}),u.jsx("form",{children:u.jsxs(i,{container:!0,alignItems:"center",gap:ku.SMALL,children:[u.jsx($,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:x}),u.jsx(eu,{type:"submit",onClick:N,endIcon:u.jsx(wu,{}),children:"جستجو"}),u.jsx(i,{children:u.jsx(tu,{label:"از تاریخ",id:"date",renderInput:Y=>u.jsx($,{style:{width:"160px"},...Y}),value:j,onChange:Y=>b(X(Y).format("YYYY-MM-DD"))})}),u.jsx(i,{children:u.jsx(tu,{label:"تا تاریخ",id:"date",renderInput:Y=>u.jsx($,{style:{width:"160px"},...Y}),value:k,onChange:Y=>G(X(Y).format("YYYY-MM-DD"))})})]})}),u.jsx(Cu,{data:t,columns:["ردیف","کشتارگاه","تعداد تخصیصات","وزن کل تخصیصات (کیلوگرم)","تعداد قطعه بندی","وزن قطعه بندی (کیلوگرم)","تعداد تخصیصات به قطعه بند","وزن تخصیصات به قطعه بند (کیلوگرم)"],handlePageChange:K,totalRows:c,page:_,perPage:F,handlePerRowsChange:p,title:"قطعه بندی"})]})})},bs=()=>{const[,,a,o,t,d]=n.useContext(ou),c=cu();n.useEffect(()=>{const p=X(new Date).format("YYYY-MM-DD");o(p),d(p)},[]);const y=p=>{w(p.target.value)},[F,C]=n.useState([]),[A,r]=n.useState(0),[_,I]=n.useState(10),[L,w]=n.useState(""),[j,b]=n.useState(1),[k,G]=n.useState([]),O=async p=>{let x;c(au()),x=await q.get(`kill-house-cold-house-allocations-info/?search=filter&value=${L}&role=${z()}&date1=${a}&date2=${t}&page=${p}&page_size=${_}`),c(su()),C(x.data.results),r(x.data.count)},T=p=>{O(p),b(p)},f=p=>{I(p),b(1)};n.useEffect(()=>{const p=F==null?void 0:F.map((x,N)=>{var V,R,D,Y,g,h,M,U,B,s,e,l;return[j===1?N+1:N+_*(j-1)+1,x==null?void 0:x.name,(R=(V=x==null?void 0:x.info)==null?void 0:V.totalAllocationsCount)==null?void 0:R.toLocaleString(),(Y=(D=x==null?void 0:x.info)==null?void 0:D.totalAllocationsWeight)==null?void 0:Y.toLocaleString(),(h=(g=x==null?void 0:x.info)==null?void 0:g.totalSelfAllocationsCount)==null?void 0:h.toLocaleString(),(U=(M=x==null?void 0:x.info)==null?void 0:M.totalSelfAllocationsWeight)==null?void 0:U.toLocaleString(),(s=(B=x==null?void 0:x.info)==null?void 0:B.totalOtherAllocationsCount)==null?void 0:s.toLocaleString(),(l=(e=x==null?void 0:x.info)==null?void 0:e.totalOtherAllocationsWeight)==null?void 0:l.toLocaleString()]});G(p)},[F]),n.useEffect(()=>{O(1)},[c,a,t,_]);const K=async p=>{p.preventDefault(),c(au());try{const x=await q.get(`kill-house-cold-house-allocations-info/?role=${z()}&search=filter&value=${L}&date1=${a}&date2=${t}&page=1&page_size=${_}`);C(x.data.results),r(x.data.count),c(su())}catch(x){console.error("Error fetching data:",x)}};return u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(i,{children:u.jsx(tu,{label:"از تاریخ",id:"date",renderInput:p=>u.jsx($,{style:{width:"160px"},...p,size:"small"}),value:a,onChange:p=>{o(X(p).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsx(tu,{label:"تا تاریخ",id:"date",renderInput:p=>u.jsx($,{style:{width:"160px"},...p,size:"small"}),value:t,onChange:p=>{d(X(p).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsxs("form",{onSubmit:K,children:[u.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:y}),u.jsx(eu,{type:"submit",onClick:K,endIcon:u.jsx(wu,{}),children:"جستجو"})]})})]}),u.jsx(Cu,{data:k,columns:["ردیف","کشتارگاه","تعداد تخصیصات","وزن کل تخصیصات (کیلوگرم)","تعداد تخصیصات به خود","وزن تخصیصات به خود (کیلوگرم)","تعداد تخصیصات به دیگری","وزن تخصیصات به دیگری (کیلوگرم)"],handlePageChange:T,totalRows:A,page:j,perPage:_,handlePerRowsChange:f,title:"انجماد"})]})},ks=()=>{var G,O,T,f,K,p,x,N,V,R,D,Y,g,h;const[a,o]=n.useState([]),[t,d]=n.useState(!1),[c,y]=n.useState([]),[F]=n.useContext(ou),[C,A]=n.useState(0),r=(M,U)=>{A(U)},_=cu(),I=()=>{C===0&&_(Ye({selectedDate1:t?w:null,selectedDate2:t?b:null})).then(M=>{y(M.payload.data)})},L=()=>{C===0&&_(Be(t?{selectedDate1:w,selectedDate2:b}:{})).then(M=>{var B,s;const U=(s=(B=M.payload)==null?void 0:B.data)==null?void 0:s.map((e,l)=>{var P,W,v,E,H,S,Q,J,Z,m,uu,lu,nu,ru,du,iu,hu,pu,xu,Su,fu,ju,_u,Nu,Hu,Wu,Yu,Bu,zu,Mu,Vu,Uu,Gu,Ku,qu,Xu,Qu,Ju,g6,A6,p6,x6,S6,f6,y6,j6,Q6,J6,Z6,m6,u0,e0,s0;return[l+1,`${(W=(P=e==null?void 0:e.killHouseOperator)==null?void 0:P.user)==null?void 0:W.fullname} (${(E=(v=e==null?void 0:e.killHouseOperator)==null?void 0:v.user)==null?void 0:E.mobile})`,`${e!=null&&e.killer?"کشتارکن":"کشتارگاه"} (${e==null?void 0:e.name})`,(Q=(S=(H=e==null?void 0:e.killHouseOperator)==null?void 0:H.user)==null?void 0:S.city)==null?void 0:Q.name,(Z=(J=e==null?void 0:e.wareHouseInfo)==null?void 0:J.productRemainWeight)==null?void 0:Z.toLocaleString(),(uu=(m=e==null?void 0:e.wareHouseInfo)==null?void 0:m.totalGovernmentalRemainWeight)==null?void 0:uu.toLocaleString(),(nu=(lu=e==null?void 0:e.wareHouseInfo)==null?void 0:lu.totalFreeRemainWeight)==null?void 0:nu.toLocaleString(),(du=(ru=e==null?void 0:e.wareHouseInfo)==null?void 0:ru.warehouseTotalEnteredCarcassesWeight)==null?void 0:du.toLocaleString(),(hu=(iu=e==null?void 0:e.wareHouseInfo)==null?void 0:iu.totalSell)==null?void 0:hu.toLocaleString(),(xu=(pu=e==null?void 0:e.wareHouseInfo)==null?void 0:pu.totalBars)==null?void 0:xu.toLocaleString(),(fu=(Su=e==null?void 0:e.wareHouseInfo)==null?void 0:Su.warehouseTotalQuantity)==null?void 0:fu.toLocaleString(),(_u=Math.floor((ju=e==null?void 0:e.wareHouseInfo)==null?void 0:ju.warehouseTotalWeight))==null?void 0:_u.toLocaleString(),(Hu=(Nu=e==null?void 0:e.wareHouseInfo)==null?void 0:Nu.warehouseTotalEnteredBars)==null?void 0:Hu.toLocaleString(),(Yu=(Wu=e==null?void 0:e.wareHouseInfo)==null?void 0:Wu.totalGovernmentalInputWeight)==null?void 0:Yu.toLocaleString(),(zu=(Bu=e==null?void 0:e.wareHouseInfo)==null?void 0:Bu.totalFreeInputWeight)==null?void 0:zu.toLocaleString(),(Vu=(Mu=e==null?void 0:e.wareHouseInfo)==null?void 0:Mu.totalKillHouseAllocationsWeight)==null?void 0:Vu.toLocaleString(),(Gu=(Uu=e==null?void 0:e.wareHouseInfo)==null?void 0:Uu.totalKillHouseFreeSale_barCarcassesWeight)==null?void 0:Gu.toLocaleString(),(qu=(Ku=e==null?void 0:e.wareHouseInfo)==null?void 0:Ku.totalKillHouseSegmentationsWeight)==null?void 0:qu.toLocaleString(),(Qu=(Xu=e==null?void 0:e.wareHouseInfo)==null?void 0:Xu.totalKillHouseColdHouseAllocationsWeight)==null?void 0:Qu.toLocaleString(),(g6=(Ju=e==null?void 0:e.wareHouseInfo)==null?void 0:Ju.totalGovernmentalOutputWeight)==null?void 0:g6.toLocaleString(),(p6=(A6=e==null?void 0:e.wareHouseInfo)==null?void 0:A6.totalFreeOutputWeight)==null?void 0:p6.toLocaleString(),(S6=(x6=e==null?void 0:e.wareHouseInfo)==null?void 0:x6.lastTotalRemainWeight)==null?void 0:S6.toLocaleString(),(y6=(f6=e==null?void 0:e.wareHouseInfo)==null?void 0:f6.lastTotalGovernmentalRemainWeight)==null?void 0:y6.toLocaleString(),(Q6=(j6=e==null?void 0:e.wareHouseInfo)==null?void 0:j6.lastTotalFreeRemainWeight)==null?void 0:Q6.toLocaleString(),(Z6=(J6=e==null?void 0:e.wareHouseInfo)==null?void 0:J6.warehouseTotalNotEnteredBars)==null?void 0:Z6.toLocaleString(),(u0=(m6=e==null?void 0:e.wareHouseInfo)==null?void 0:m6.warehouseTotalNotEnteredBarsQuantity)==null?void 0:u0.toLocaleString(),(s0=(e0=e==null?void 0:e.wareHouseInfo)==null?void 0:e0.warehouseTotalNotEnteredBarsWeight)==null?void 0:s0.toLocaleString(),u.jsx(Fu,{title:"خروجی اکسل",children:u.jsx(eu,{color:"success",size:"small",onClick:()=>{var l0,a0;F({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const X0=`${q.defaults.baseURL}kill_house_inventory_data/?&role=KillHouse&key=${(a0=(l0=e==null?void 0:e.killHouseOperator)==null?void 0:l0.user)==null?void 0:a0.key}${t?`&date1=${w}&date2=${b}`:""}`;window.location.href=X0},children:u.jsx(Iu,{size:24})})},l)]});o(U)})},[w,j]=n.useState(X(new Date).format("YYYY-MM-DD")),[b,k]=n.useState(X(new Date).format("YYYY-MM-DD"));return n.useEffect(()=>{I(),L()},[w,b,t,C]),u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",children:[u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mt:2,children:u.jsx(i,{container:!0,justifyContent:"center",alignItems:"center",mb:ku.MEDIUM,xs:12,children:u.jsxs(c6,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,onChange:r,value:C,children:[u.jsx(yu,{label:"اطلاعات جامع"}),u.jsx(yu,{label:"توزیع به داخل استان"}),u.jsx(yu,{label:"فروش به خارج استان"}),u.jsx(yu,{label:"قطعه بندی"}),u.jsx(yu,{label:"سردخانه"})]})})}),C===0&&u.jsxs(u.Fragment,{children:[u.jsx(Cu,{title:"اطلاعات کلی انبار",noPagination:!0,columns:["حجم بار زنده (قطعه)","وزن بار زنده (کیلوگرم)","لاشه ورودی به انبار (کیلوگرم)","لاشه دولتی (کیلوگرم)","لاشه آزاد (کیلوگرم)","لاشه توزیع شده داخل استان (کیلوگرم)","لاشه توزیع شده خارج استان (کیلوگرم)","وزن قطعه بندی (کیلوگرم)","وزن انجماد (کیلوگرم)","کل وزن دولتی فروش رفته","کل وزن آزاد فروش رفته","مانده دولتی (کیلوگرم)","مانده آزاد (کیلوگرم)","مانده انبار (کیلوگرم)"],data:[[(G=c==null?void 0:c.warehouseTotalQuantity)==null?void 0:G.toLocaleString(),(O=c==null?void 0:c.warehouseTotalWeight)==null?void 0:O.toLocaleString(),(T=c==null?void 0:c.warehouseTotalEnteredCarcassesWeight)==null?void 0:T.toLocaleString(),(f=c==null?void 0:c.totalGovernmentalInputWeight)==null?void 0:f.toLocaleString(),(K=c==null?void 0:c.totalFreeInputWeight)==null?void 0:K.toLocaleString(),(p=c==null?void 0:c.totalKillHouseAllocationsWeight)==null?void 0:p.toLocaleString(),(x=c==null?void 0:c.totalKillHouseFreeSaleBarCarcassesWeight)==null?void 0:x.toLocaleString(),(N=c==null?void 0:c.segmentationsWeight)==null?void 0:N.toLocaleString(),(V=c==null?void 0:c.coldHouseAllocationsWeight)==null?void 0:V.toLocaleString(),(R=c==null?void 0:c.totalGovernmentalOutputWeight)==null?void 0:R.toLocaleString(),(D=c==null?void 0:c.totalFreeOutputWeight)==null?void 0:D.toLocaleString(),(Y=c==null?void 0:c.totalGovernmentalRemainWeight)==null?void 0:Y.toLocaleString(),(g=c==null?void 0:c.totalFreeRemainWeight)==null?void 0:g.toLocaleString(),(h=c==null?void 0:c.productRemainWeight)==null?void 0:h.toLocaleString()]]}),u.jsxs(i,{container:!0,mt:2,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray"},gap:1,children:[u.jsx(i,{container:!0,justifyContent:"center",alignItems:"center",children:u.jsx(d6,{icon:u.jsx(B0,{}),checkedIcon:u.jsx(z0,{}),checked:t,onChange:()=>d(!t),color:"primary",size:"large"})}),u.jsx(i,{children:u.jsx(tu,{disabled:!t,label:"از تاریخ",id:"date",renderInput:M=>u.jsx($,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...M}),value:w,onChange:M=>{j(X(M).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsx(tu,{disabled:!t,label:"تا تاریخ",id:"date",renderInput:M=>u.jsx($,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...M}),value:b,onChange:M=>{k(X(M).format("YYYY-MM-DD"))}})})]}),u.jsx(Fu,{title:"خروجی اکسل",children:u.jsx(eu,{color:"success",onClick:()=>{F({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const M=`${q.defaults.baseURL}all_kill_house_inventory_data/?${t?`date1=${w}&date2=${b}`:""}`;window.location.href=M},children:u.jsx(Iu,{size:32})})}),u.jsx(Fu,{title:"توزیع کامل استان",children:u.jsx(eu,{color:"error",onClick:()=>{F({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const M=`${q.defaults.baseURL}all_distribution_province/?${t?`date1=${w}&date2=${b}`:""}`;window.location.href=M},children:u.jsx(Iu,{size:32})})}),u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mt:2,children:u.jsx(Cu,{title:"انبار و توزیع",paginated:!0,columns:["ردیف","خریدار","ماهیت","شهر","مانده انبار فعلی","مانده دولتی","مانده آزاد","کل وزن ورودی به انبار(لاشه)","وزن فروش رفته (لاشه)","تعداد کل بارها","حجم کل بارها(قطعه)","وزن کل بارها","بارهای ورودی به انبار","وزن دولتی ورود به انبار","وزن آزاد ورود به انبار","وزن فروش به داخل","وزن فروش به خارج","وزن قطعه بندی","وزن انجماد","وزن فروش دولتی","وزن فروش آزاد","انبار گذشته","انبار دولتی گذشته","انبار آزاد گذشته","بارهای وارد نشده به انبار(زنده)","حجم وارد نشده به انبار(زنده)","وزن وارد نشده به انبار(زنده)","خروجی اکسل"],data:a})})]}),C===1&&u.jsx(fs,{}),C===2&&u.jsx(Es,{}),C===3&&u.jsx(ws,{}),C===4&&u.jsx(bs,{})]})},Ts=bu("GET_STEWARDS_GUILDS_SERVICE",async(a,{dispatch:o})=>{o(au());const{data:t,status:d}=await q.get("real-guilds/",{params:{role:z(),...a}});return o(su()),{data:t,status:d}}),Rs=bu("ADD_STEWARDS_GUILDS_SERVICE",async(a,{dispatch:o})=>{try{o(au());const{data:t,status:d}=await q.put("real-guilds/0/",a);return o(su()),{data:t,status:d}}catch(t){return o(su()),{error:t.response.data.result}}}),Is=bu("CREATE_STEWARDS_GUILDS_SERVICE",async(a,{dispatch:o})=>{try{o(au());const{data:t,status:d}=await q.post("real-guilds/",a);return o(su()),{data:t,status:d}}catch(t){return o(su()),{error:t.response.data.result}}}),$s=({killHousekey:a,updateTable:o,type:t})=>{const d=cu(),[c]=n.useContext(ou),[y,F]=n.useState([]),[C,A]=n.useState("forced"),[r,_]=n.useState("steward"),I=b=>{A(b.target.value)},L=b=>{_(b.target.value)};n.useEffect(()=>{d(Ts({role_type:"KillHouse",key:a,type:r})).then(b=>{F(b.payload.data)})},[d,r]);const w=l6({steward_key:gu(),allocation_limit:Du().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!")}),j=s6({initialValues:{steward_key:"",allocation_limit:""},validationSchema:w});return n.useEffect(()=>{j.validateForm()},[]),u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(i,{children:u.jsx(Eu,{children:u.jsxs(u6,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:r,onChange:L,row:!0,sx:{alignItems:"center"},children:[u.jsx(Au,{value:"steward",control:u.jsx(vu,{}),label:"مباشرین"}),u.jsx(Au,{value:"guild",control:u.jsx(vu,{}),label:"اصناف"})]})})}),u.jsx(i,{item:!0,xs:12,children:u.jsx(e6,{style:{width:"100%"},options:y?y.map(b=>{var k;return{id:b.key,label:`${b.guildsName} (${(k=b.user)==null?void 0:k.mobile}) / نوع فعالیت: ${b.typeActivity} / حوزه فعالیت: ${b.areaActivity}`,item:b}}):[],value:j.values.guild,onChange:(b,k)=>{j.setFieldValue("steward_key",k==null?void 0:k.id),j.validateForm()},error:j.touched.guild&&!!j.errors.guild,helperText:j.touched.guild&&j.errors.guild,getOptionLabel:b=>b.label,renderInput:b=>u.jsx($,{...b,label:`انتخاب ${r==="steward"?"مباشر":"صنف"}`,variant:"outlined"})})}),u.jsx(i,{item:!0,xs:12,children:u.jsx($,{fullWidth:!0,id:"allocation_limit",label:"وزن تعهد روزانه",variant:"outlined",sx:{width:"100%"},value:j.values.allocation_limit,error:j.touched.allocation_limit?!!j.errors.allocation_limit:null,onChange:j.handleChange,onBlur:j.handleBlur,helperText:j.touched.allocation_limit&&j.errors.allocation_limit?j.errors.allocation_limit:null})}),u.jsx(i,{children:u.jsx(Eu,{children:u.jsxs(u6,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:C,onChange:I,row:!0,sx:{alignItems:"center"},children:[u.jsxs(H6,{id:"demo-radio-buttons-group-label",children:["نوع تعهد: ","‌‌‌‌‌ ‌"]}),u.jsx(Au,{value:"forced",control:u.jsx(vu,{}),label:"اجباری"}),u.jsx(Au,{value:"optional",control:u.jsx(vu,{}),label:"اختیاری"})]})})}),u.jsx(i,{container:!0,xs:12,children:u.jsx(eu,{fullWidth:!0,variant:"contained",disabled:!j.isValid,onClick:()=>{d(Rs({guilds_key:j.values.steward_key,choose:!0,type:t,owner_key:a,allocation_limit:j.values.allocation_limit,allocation_type:C,choose_type:r})).then(b=>{b.payload.error?c({vertical:"top",horizontal:"center",msg:b.payload.error,severity:"error"}):(o(),c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),d($u()))})},children:"ثبت"})})]})},Ds=l6({mobile:gu().required("شماره موبایل الزامی است").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),first_name:gu().required("نام الزامی است"),last_name:gu().required("نام خانوادگی الزامی است"),national_id:gu().required("کدملی الزامی است"),postal_code:gu().required("کدپستی الزامی است"),city:gu().required("شهر الزامی است"),address:gu().required("آدرس الزامی است"),guilds_id:gu().required("شناسه انجمن الزامی است"),license_number:gu().required("شماره مجوز الزامی است"),guilds_name:gu().required("نام انجمن الزامی است"),type_activity:gu().required("نوع فعالیت الزامی است"),area_activity:gu().required("حوزه فعالیت الزامی است"),allocation_limit:gu().required("این فیلد الزامی است")}),Ps=({killHousekey:a,type:o,updateTable:t,item:d})=>{const c=cu(),[y]=n.useContext(ou),{provinceGetCities:F,provinceGetAreActivity:C,provinceTypeActivity:A}=Tu(w=>w.provinceSlice),r=s6({initialValues:{mobile:d?d.user.mobile:"",first_name:d?d.user.firstName:"",last_name:d?d.user.lastName:"",city:d?d.address.city.name:"",address:d?d.address.address:"",guilds_id:d?d.guildsId:"",license_number:d?d.licenseNumber:"",postal_code:d?d.address.postalCode:"",guilds_name:d?d.guildsName:"",type_activity:d?d.typeActivity:"",area_activity:d?d.areaActivity:"",steward:d?d.steward:!1,national_id:d?d.user.nationalId:"",allocation_limit:d?d.allocation_limit:""},validationSchema:Ds,onSubmit:w=>{c(Is({...w,role:z(),allocation_type:_,owner_key:a,role_type:o})).then(j=>{j.payload.error?y({vertical:"top",horizontal:"center",msg:j.payload.error,severity:"error"}):(t(),c(i6({right:!1,bottom:!1,content:null})),y({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}});n.useEffect(()=>{c(I0()),c(oe()),c(ce())},[]);const[_,I]=n.useState("forced"),L=w=>{I(w.target.value)};return u.jsx("form",{onSubmit:r.handleSubmit,children:u.jsxs(i,{container:!0,gap:ku.SMALL,children:[u.jsx($,{label:"نام",variant:"outlined",fullWidth:!0,id:"first_name",name:"first_name",value:r.values.first_name,onChange:r.handleChange,error:r.touched.first_name&&!!r.errors.first_name,helperText:r.touched.first_name&&r.errors.first_name}),u.jsx($,{label:"نام خانوادگی",variant:"outlined",fullWidth:!0,id:"last_name",name:"last_name",value:r.values.last_name,onChange:r.handleChange,error:r.touched.last_name&&!!r.errors.last_name,helperText:r.touched.last_name&&r.errors.last_name}),u.jsx($,{label:"کدملی",variant:"outlined",fullWidth:!0,id:"national_id",name:"national_id",value:r.values.national_id,onChange:r.handleChange,error:r.touched.national_id&&!!r.errors.national_id,helperText:r.touched.national_id&&r.errors.national_id}),u.jsx($,{label:"تلفن",variant:"outlined",fullWidth:!0,id:"mobile",name:"mobile",value:r.values.mobile,onChange:r.handleChange,error:r.touched.mobile&&!!r.errors.mobile,helperText:r.touched.mobile&&r.errors.mobile}),u.jsx($,{select:!0,label:"شهر",variant:"outlined",fullWidth:!0,id:"city",name:"city",value:r.values.city,onChange:r.handleChange,error:r.touched.city&&!!r.errors.city,helperText:r.touched.city&&r.errors.city,children:F==null?void 0:F.map(w=>u.jsx(Ru,{value:w.name,children:w.name},w.id))}),u.jsx($,{label:"کدپستی",variant:"outlined",fullWidth:!0,id:"postal_code",name:"postal_code",value:r.values.postal_code,onChange:r.handleChange,error:r.touched.postal_code&&!!r.errors.postal_code,helperText:r.touched.postal_code&&r.errors.postal_code}),u.jsx($,{label:"آدرس",variant:"outlined",fullWidth:!0,id:"address",name:"address",value:r.values.address,onChange:r.handleChange,error:r.touched.address&&!!r.errors.address,helperText:r.touched.address&&r.errors.address}),u.jsx($,{label:"نام واحد صنفی",variant:"outlined",fullWidth:!0,id:"guilds_name",name:"guilds_name",value:r.values.guilds_name,onChange:r.handleChange,error:r.touched.guilds_name&&!!r.errors.guilds_name,helperText:r.touched.guilds_name&&r.errors.guilds_name}),u.jsx($,{select:!0,label:"نوع فعالیت",variant:"outlined",fullWidth:!0,id:"type_activity",name:"type_activity",value:r.values.type_activity,onChange:r.handleChange,error:r.touched.type_activity&&!!r.errors.type_activity,helperText:r.touched.type_activity&&r.errors.type_activity,children:A==null?void 0:A.map(w=>u.jsx(Ru,{value:w.title,children:w.title},w.title))}),u.jsx($,{select:!0,label:"حوزه فعالیت",variant:"outlined",fullWidth:!0,id:"area_activity",name:"area_activity",value:r.values.area_activity,onChange:r.handleChange,error:r.touched.area_activity&&!!r.errors.area_activity,helperText:r.touched.area_activity&&r.errors.area_activity,children:C==null?void 0:C.map(w=>u.jsx(Ru,{value:w.title,children:w.title},w.title))}),u.jsx($,{label:"شناسه صنف",variant:"outlined",fullWidth:!0,id:"guilds_id",name:"guilds_id",value:r.values.guilds_id,onChange:r.handleChange,error:r.touched.guilds_id&&!!r.errors.guilds_id,helperText:r.touched.guilds_id&&r.errors.guilds_id}),u.jsx($,{label:"شماره مجوز",variant:"outlined",fullWidth:!0,id:"license_number",name:"license_number",value:r.values.license_number,onChange:r.handleChange,error:r.touched.license_number&&!!r.errors.license_number,helperText:r.touched.license_number&&r.errors.license_number}),u.jsx(i,{item:!0,xs:12,children:u.jsx($,{fullWidth:!0,id:"allocation_limit",label:"وزن تعهد روزانه",variant:"outlined",sx:{width:"100%"},value:r.values.allocation_limit,error:r.touched.allocation_limit?!!r.errors.allocation_limit:null,onChange:r.handleChange,onBlur:r.handleBlur,helperText:r.touched.allocation_limit&&r.errors.allocation_limit?r.errors.allocation_limit:null})}),u.jsx(i,{xs:12,item:!0,children:u.jsxs(Eu,{children:[u.jsx(H6,{id:"demo-radio-buttons-group-label",children:"نوع تعهد"}),u.jsxs(u6,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:_,onChange:L,children:[u.jsx(Au,{value:"forced",control:u.jsx(vu,{}),label:"اجباری"}),u.jsx(Au,{value:"optional",control:u.jsx(vu,{}),label:"اختیاری"})]})]})}),z()!=="Guilds"&&u.jsx(Au,{control:u.jsx(d6,{name:"steward",checked:r.values.steward,onChange:r.handleChange,label:"مباشر"}),label:"مباشر"}),r.errors.steward&&u.jsx("div",{children:r.errors.steward}),u.jsx(eu,{color:"primary",fullWidth:!0,variant:"contained",type:"submit",children:"ثبت"})]})})},o0=({type:a,roleType:o})=>{const t=cu(),d=g=>{w(g.target.value)},{key:c,name:y}=W6(),[F,C]=n.useState([]),[A,r]=n.useState(0),[_,I]=n.useState(10),[L,w]=n.useState(""),[j,b]=n.useState(1),[k,G]=n.useState([]),O=async g=>{let h;t(au()),h=await q.get(`total-guilds-distribution-management/?search=filter&value=${L}&role=${z()}&page=${g}&page_size=${_}${o&&"&role_type="+o}${a&&"&type="+a}&key=${c}`),t(su()),C(h.data.results),r(h.data.count)},T=g=>{O(g),b(g)},f=g=>{I(g),b(1)},K=()=>{O(j!==0?j:1)};n.useEffect(()=>{const g=F==null?void 0:F.map((h,M)=>{var U,B,s,e,l,P,W,v,E;return[j===1?M+1:M+_*(j-1)+1,h==null?void 0:h.guildsName,`${(U=h==null?void 0:h.user)==null?void 0:U.fullname} (${(B=h==null?void 0:h.user)==null?void 0:B.mobile})`,h==null?void 0:h.city,(s=h==null?void 0:h.userLevel)!=null&&s.length?(e=h==null?void 0:h.userLevel)==null?void 0:e.map((H,S)=>u.jsx(E6,{variant:"body2",children:H==null?void 0:H.faTitle},S)):"-",h==null?void 0:h.typeActivity,h==null?void 0:h.areaActivity,((l=h==null?void 0:h.generalInfos)==null?void 0:l.selfTotalAllocationType)==="forced"?"اجباری":"اختیاری",(W=(P=h==null?void 0:h.generalInfos)==null?void 0:P.inputTotalAllocationLimit)==null?void 0:W.toLocaleString(),(E=(v=h==null?void 0:h.generalInfos)==null?void 0:v.outputTotalAllocationLimit)==null?void 0:E.toLocaleString()]});G(g)},[F]),n.useEffect(()=>{O(1)},[t,_]);const p=async g=>{g.preventDefault(),t(au());try{const h=await q.get(`total-guilds-distribution-management/?role=${z()}&search=filter&value=${L}&page=1&page_size=${_}`);C(h.data.results),r(h.data.count),t(su())}catch(h){console.error("Error fetching data:",h)}},[x,N]=Y6.useState(null),V=g=>{N(g.currentTarget)},R=()=>{N(null)},D=!!x,Y=D?"simple-popover":void 0;return u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,mt:2,children:[u.jsx(eu,{"aria-describedby":Y,variant:"contained",onClick:V,sx:{backgroundColor:"#6200ea",fontSize:"16px",fontWeight:"500",textTransform:"none","&:hover":{backgroundColor:"#3700b3"}},children:"افزودن مباشر/ صنف به کشتارگاه"}),u.jsx(h6,{id:Y,open:D,anchorEl:x,onClose:R,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},sx:{borderRadius:"12px",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)","& .MuiPaper-root":{borderRadius:"12px",padding:"16px"}},children:u.jsxs(i,{container:!0,direction:"column",spacing:2,sx:{width:"240px"},children:[u.jsx(i,{item:!0,children:u.jsx(eu,{onClick:()=>{R(),t(i6({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ایجاد و تخصیص مباشر/ صنف ",content:u.jsx(Ps,{updateTable:K,killHousekey:c,type:"KillHouse"})}))},fullWidth:!0,variant:"contained",sx:{backgroundColor:"#6200ea",color:"#ffffff",borderRadius:"8px",padding:"10px",fontSize:"14px",fontWeight:"500",textTransform:"none","&:hover":{backgroundColor:"#3700b3"}},children:"افزودن مباشر/ صنف"})}),u.jsx(i,{item:!0,children:u.jsx(eu,{onClick:()=>{R(),t(Zu({title:"تخصیص مباشر/ صنف ",content:u.jsx($s,{updateTable:K,killHousekey:c,type:"KillHouse"})}))},fullWidth:!0,variant:"outlined",sx:{borderColor:"#6200ea",color:"#6200ea",borderRadius:"8px",padding:"10px",fontSize:"14px",fontWeight:"500",textTransform:"none","&:hover":{borderColor:"#3700b3",backgroundColor:"rgba(98, 0, 234, 0.08)"}},children:"انتخاب مباشر/ صنف"})})]})}),u.jsx(i,{children:u.jsxs("form",{onSubmit:p,children:[u.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:d}),u.jsx(eu,{type:"submit",onClick:p,endIcon:u.jsx(wu,{}),children:"جستجو"})]})})]}),u.jsx(Cu,{data:k,columns:["ردیف","نام واحد","کاربر","شهر","سطح فعالیت","نوع فعالیت","حوزه فعالیت","نوع تعهد","وزن تعهد دریافتی","وزن تعهد تخصیصی"],handlePageChange:T,totalRows:A,page:j,perPage:_,handlePerRowsChange:f,title:a==="steward"?`مباشرین ${o==="KillHouse"&&"کشتارگاه "} ${y}`:`اصناف ${o==="KillHouse"&&"کشتارگاه "} ${y}`})]})},Ls=({key:a,name:o})=>{const[t,d]=Y6.useState("0"),c=(y,F)=>{d(F)};return u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsxs(c6,{value:t,onChange:c,"aria-label":"secondary tabs example",children:[u.jsx(yu,{value:"0",label:"مباشرین"}),u.jsx(yu,{value:"1",label:"اصناف"})]}),t==="0"&&u.jsx(o0,{type:"steward",roleType:"KillHouse"}),t==="1"&&u.jsx(o0,{type:"guild",roleType:"KillHouse"})]})},Os=({dashboardData:a})=>{var o,t,d;return u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsx(Cu,{noPagination:!0,title:"اطلاعات کلی",columns:["تعداد فروش","خریدار","وزن کل لاشه ها"],data:[[(o=a==null?void 0:a.numberOfBars)==null?void 0:o.toLocaleString(),(t=a==null?void 0:a.numberOfBuyers)==null?void 0:t.toLocaleString(),(d=a==null?void 0:a.barsWeight)==null?void 0:d.toLocaleString()]]})})},Ns=bu("PROVINCE_DISPENSER_SALE_WITHOUT_DASHBOARD",async(a,{dispatch:o,rejectWithValue:t})=>{var d;try{o(au());const{data:c,status:y}=await q.get("steward_free_sale_bar_dashboard/",{params:{date1:a.selectedDate1,date2:a.selectedDate2,role:z(),steward_key:a.steward_key||"all"}});return o(su()),{data:c,status:y}}catch(c){return o(su()),t(((d=c==null?void 0:c.response)==null?void 0:d.data)||{message:"ارتباط با سرور برقرار نشد."})}}),X6=bu("PROVINCE-DISPENSER-STEWARD-SERVICE",async(a,{dispatch:o})=>{o(au());const{data:t,status:d}=await q.get("get_all_guilds/");return o(su()),{data:t,status:d}}),Hs=bu("PROVINCE_EDIT_DISPENSER__STEWARD_SALE_OUT_SERVICE",async(a,{dispatch:o})=>{o(au());try{const{data:t,status:d}=await q.put("steward_free_sale_bar/0/",a);return o(su()),{data:t,status:d}}catch(t){return o(su()),{error:t.response.data.result}}}),Ws=({editData:a,fetchData:o,fetchApiData:t,fetchDashboardData:d})=>{const c=cu(),[y]=n.useContext(ou),F=l6({weight:Du().min(1,"یک مقدار مثبت وارد کنید!"),quarantineCode:gu(),date:N0()}),C=s6({initialValues:{weight:(a==null?void 0:a.weightOfCarcasses)||"",quarantineCode:(a==null?void 0:a.clearanceCode)||"",date:a!=null&&a.date?X(a.date):X()},validationSchema:F,enableReinitialize:!0}),A=()=>{c($u()),y({vertical:"top",horizontal:"center",msg:"وزن با موفقیت ویرایش شد.",severity:"success"}),c(_6()),t(1),d()};return u.jsxs(i,{container:!0,xs:12,direction:"column",justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(mu,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"weight",label:"وزن لاشه (کیلوگرم)",variant:"outlined",value:C.values.weight,error:C.touched.weight&&!!C.errors.weight,onChange:C.handleChange,onBlur:C.handleBlur,helperText:C.touched.weight&&C.errors.weight?C.errors.weight:null}),u.jsx($,{fullWidth:!0,id:"quarantineCode",label:"کد قرنطینه",variant:"outlined",value:C.values.quarantineCode,error:C.touched.quarantineCode&&!!C.errors.quarantineCode,onChange:C.handleChange,onBlur:C.handleBlur,helperText:C.touched.quarantineCode&&C.errors.quarantineCode?C.errors.quarantineCode:null}),u.jsx(tu,{label:"تاریخ",id:"date",value:C.values.date,onChange:r=>{C.setFieldValue("date",r)},onBlur:()=>C.setFieldTouched("date",!0),renderInput:r=>u.jsx($,{...r,error:C.touched.date&&!!C.errors.date,helperText:C.touched.date&&C.errors.date,fullWidth:!0})}),u.jsx(eu,{variant:"contained",fullWidth:!0,disabled:!C.isValid||C.isSubmitting,onClick:()=>{const r={key:a==null?void 0:a.key,weight_of_carcasses:C.values.weight,quarantineCode:C.values.quarantineCode,date:X(C.values.date).format("YYYY-MM-DD HH:mm:ss")};c(Hs(r)).then(_=>{_.payload.error?y({vertical:"top",horizontal:"center",msg:_.payload.error,severity:"error"}):(A(),o())})},children:"ثبت"})]})},Ys=({fetchApiData:a,item:o,fetchData:t,updateTable:d,priceInfo:c,fetchDashboardData:y,remainWeight:F})=>{const[C,A]=n.useState(null),r=cu(),_=k=>{A(k.currentTarget)},I=()=>{A(null)},L=()=>{I(),r(Zu({title:"ویرایش تخصیص",content:u.jsx(Ws,{fetchDashboardData:y,fetchData:t,updateTable:d,fetchApiData:a,editData:o,priceInfo:c,remainWeight:F})}))},w=()=>{I(),r(Ge(o==null?void 0:o.key)).then(()=>{r(_6()),a(1),A(null)})},j=!!C,b=j?"popover":void 0;return u.jsxs(i,{container:!0,children:[u.jsx(C6,{disabled:o==null?void 0:o.registrationCode,"aria-describedby":b,variant:"contained",color:"primary",onClick:_,children:u.jsx(v6,{})}),u.jsx(h6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:b,open:j,anchorEl:C,onClose:I,children:u.jsxs(k6,{sx:{py:0},children:[u.jsxs(Pu,{onClick:L,children:[u.jsx(Lu,{children:u.jsx(M6,{fontSize:"small",color:"primary"})}),u.jsx(Ou,{primary:"ویرایش",primaryTypographyProps:{variant:"body2",color:"primary"}})]}),u.jsxs(Pu,{disabled:o==null?void 0:o.registrationCode,onClick:w,children:[u.jsx(Lu,{children:u.jsx(V6,{fontSize:"small",color:"error"})}),u.jsx(Ou,{primary:"حذف",primaryTypographyProps:{variant:"body2",color:o!=null&&o.registrationCode?"text.secondary":"error"}})]})]})})]})},Bs=({priceInfo:a})=>{const{slaughterProducts:o}=Tu(s=>s.slaughterSlice||{}),t=cu(),[,,d,c,y,F]=n.useContext(ou),C=s=>{b(s.target.value)},[A,r]=n.useState([]),[_,I]=n.useState(0),[L,w]=n.useState(10),[j,b]=n.useState(""),[k,G]=n.useState(1),[O,T]=n.useState([]),[f,K]=n.useState([]),[p,x]=n.useState([]),[N,V]=n.useState(null),R=Tu(s=>{var e,l;return(l=(e=s.userSlice)==null?void 0:e.userProfile)==null?void 0:l.key}),[D]=n.useContext(ou),Y=async s=>{var e,l;t(au());try{const P=await q.get(`steward_free_sale_bar/?search=filter&value=${j}&role=${z()}&date1=${d}&date2=${y}&page=${s||1}&page_size=${L}&type=dashboard${N?`&steward_key=${N}`:"&steward_key=all"}`);r(((e=P.data)==null?void 0:e.results)||[]),I(((l=P.data)==null?void 0:l.count)||0)}catch(P){console.error("Error fetching data:",P)}finally{t(su())}},g=()=>{t(X6()).then(s=>{var e;x(((e=s==null?void 0:s.payload)==null?void 0:e.data)||[])})},h=()=>{t(Ns({search:"filter",role:z(),selectedDate1:d,selectedDate2:y,steward_key:N||"all"})).then(s=>{var e;K(((e=s==null?void 0:s.payload)==null?void 0:e.data)||[])})},M=s=>{Y(s),G(s)},U=s=>{w(s),G(1)};n.useEffect(()=>{const s=Array.isArray(A)?A.map((e,l)=>{var P,W,v,E,H,S,Q,J,Z,m,uu,lu;return[k===1?l+1:l+L*(k-1)+1,e!=null&&e.date?I6(e==null?void 0:e.date):"-",e!=null&&e.productionDate?a6(e==null?void 0:e.productionDate):"-",(e==null?void 0:e.distributionType)==="web"?"سایت":(e==null?void 0:e.distributionType)==="app"?"موبایل":(e==null?void 0:e.distributionType)==="pos"?"پوز":e==null?void 0:e.distributionType,`${(W=(P=e==null?void 0:e.steward)==null?void 0:P.guildsName)==null?void 0:W.toLocaleString()} ${(H=(E=(v=e==null?void 0:e.steward)==null?void 0:v.user)==null?void 0:E.fullname)==null?void 0:H.toLocaleString()} ${((J=(Q=(S=e==null?void 0:e.steward)==null?void 0:S.user)==null?void 0:Q.mobile)==null?void 0:J.toLocaleString())||"-"}`,`${e==null?void 0:e.buyerName} (${e==null?void 0:e.buyerMobile})`,e!=null&&e.buyer?`${(Z=e==null?void 0:e.buyer)==null?void 0:Z.unitName}`:`${e==null?void 0:e.buyerName}`,e==null?void 0:e.province,e==null?void 0:e.city,(e==null?void 0:e.clearanceCode)&&u.jsx(V0,{clearanceCode:e==null?void 0:e.clearanceCode}),(m=e==null?void 0:e.quarantineWeightOfCarcasses)==null?void 0:m.toLocaleString(),(uu=e==null?void 0:e.weightOfCarcasses)==null?void 0:uu.toLocaleString(),u.jsx(Ys,{fetchDashboardData:h,item:e,fetchApiData:Y,priceInfo:a,remainWeight:((lu=o[0])==null?void 0:lu.totalRemainWeight)||0},l)]}):[];T(s)},[A,k,L,a,o]),n.useEffect(()=>{Y(1),h(),g()},[t,d,y,L,N]);const B=async s=>{s.preventDefault(),Y(1),h()};return u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,mt:4,children:[u.jsx(i,{container:!0,width:"100%",isDashboard:!0,children:u.jsx(Os,{dashboardData:f,fetchDashboardData:h})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(i,{children:u.jsx(tu,{label:"از تاریخ",renderInput:s=>u.jsx($,{...s,style:{width:"160px"},size:"small"}),value:d,onChange:s=>{c(X(s).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsx(tu,{label:"تا تاریخ",renderInput:s=>u.jsx($,{...s,style:{width:"160px"},size:"small"}),value:y,onChange:s=>{F(X(s).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsxs("form",{onSubmit:B,style:{marginRight:"16px"},children:[u.jsx(Eu,{size:"small",style:{width:200},children:u.jsx(e6,{options:p,getOptionLabel:s=>{var e;return`(${s==null?void 0:s.guildsName}) ${(e=s==null?void 0:s.user)==null?void 0:e.fullname}`},value:N&&Array.isArray(p)&&p.find(s=>(s==null?void 0:s.key)===N)||null,onChange:(s,e)=>{V(e?e.key:null)},renderInput:s=>u.jsx($,{...s,label:"مباشرین",size:"small",placeholder:"جستجوی مباشرین"}),noOptionsText:"مباشری یافت نشد",isOptionEqualToValue:(s,e)=>(s==null?void 0:s.key)===(e==null?void 0:e.key)})}),u.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250,marginRight:"16px"},onChange:C,value:j}),u.jsx(eu,{type:"submit",endIcon:u.jsx(wu,{}),children:"جستجو"})]})}),u.jsx(Fu,{title:"خروجی اکسل",children:u.jsx(eu,{color:"success",onClick:()=>{D({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const s=`${q.defaults.baseURL}steward_free_sale_out_province_excel/?role=${z()}&key=${R}&search=filter&value=${j} &date1=${d}&date2=${y}&type=Steward`;window.location.href=s},children:u.jsx(Iu,{size:32})})})]}),u.jsx(Cu,{data:O,columns:["ردیف","تاریخ","تاریخ تولید گوشت","ثبت شده","مشخصات فروشنده","مشخصات خریدار","نام واحد","استان","شهر","کد قرنطینه","وزن استعلامی","وزن لاشه","عملیات"],handlePageChange:M,totalRows:_,page:k,perPage:L,handlePerRowsChange:U,title:"فروش به خارج استان"})]})})},zs=({dashboardData:a})=>{var o,t,d,c;return u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsx(Cu,{noPagination:!0,title:"اطلاعات کلی",columns:["تعداد توزیع","کل وزن توزیع","وزن توزیع به مباشر","وزن توزیع به صنف"],data:[[(o=a==null?void 0:a.numberOfAllocations)==null?void 0:o.toLocaleString(),(t=a==null?void 0:a.totalWeight)==null?void 0:t.toLocaleString(),(d=a==null?void 0:a.totalStewardWeight)==null?void 0:d.toLocaleString(),(c=a==null?void 0:a.totalGuildWeight)==null?void 0:c.toLocaleString()]]})})},Ms=bu("PROVINCE_DISPENSER_SALE_WITHIN_DASHBOARD",async(a,{dispatch:o})=>{o(au());const{data:t,status:d}=await q.get("in-province-allocation-dashboard/?type=Steward",{params:{date1:a.selectedDate1,date2:a.selectedDate2,role:z(),steward_key:a.steward_key||"all"}});return o(su()),{data:t,status:d}}),Vs=({item:a,key:o,sellerType:t,buyerType:d,allocationType:c,sellType:y,fetchApiData:F,editData:C,priceInfo:A,coldHouseKey:r,coldHouseItemKey:_,fetchDashboardData:I})=>{var B;const L=cu(),[w,j]=n.useState([]),[b,k]=n.useState([]),[G,O]=n.useState(null),[T]=n.useContext(ou),[f,K]=n.useState("own"),p=s=>{K(s.target.value),D({key:"",item:"",buyerType:"",allocationType:""})},[x,N]=n.useState(A!=null&&A.active?"true":"false"),V=s=>{N(s.target.value),s.target.value==="false"&&g.setFieldValue("price","")},[R,D]=n.useState({key:o,item:a,buyerType:d,allocationType:c});n.useEffect(()=>{z()==="Steward"&&K("free")},[]),n.useEffect(()=>{C||(L(O6()).then(s=>{j(s.payload.data)}),a||L(N6({free:f==="free"})).then(s=>{k(s.payload.data)}))},[L,f]);const Y=l6({weight:Du().required("این فیلد اجباری است!").min(1,"یک مقدار مثبت وارد کنید!"),price:Du().required("این فیلد اجباری است!").min(1,"یک مقدار مثبت وارد کنید!"),wholePrice:Du().required("این فیلد اجباری است!").min(1,"یک مقدار مثبت وارد کنید!")}),g=s6({initialValues:{weight:(C==null?void 0:C.realWeightOfCarcasses)||"",wholePrice:(C==null?void 0:C.totalAmount)||"",price:(C==null?void 0:C.amount)||""},validationSchema:Y});n.useEffect(()=>{g.validateForm()},[]),n.useEffect(()=>{x==="false"?g.values.weight&&g.values.price&&g.setFieldValue("wholePrice",g.values.price*g.values.weight):A!=null&&A.active&&g.values.weight&&g.setFieldValue("wholePrice",(A==null?void 0:A.killHousePrice)*g.values.weight)},[g.values.price,g.values.weight,x]),n.useEffect(()=>{A!=null&&A.active&&x==="true"&&g.setFieldValue("price",A==null?void 0:A.killHousePrice)},[x]);const h=()=>{L($u()),T({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),L(_6()),I(),F(1)},[M,U]=n.useState(X(new Date).format("YYYY-MM-DD"));return u.jsxs(i,{container:!0,xs:12,direction:"column",justifyContent:"center",alignItems:"center",gap:1,children:[!C&&u.jsx(tu,{label:"تاریخ",id:"date",renderInput:s=>u.jsx($,{fullWidth:!0,...s}),value:M,onChange:s=>{U(X(s).format("YYYY-MM-DD"))}}),!C&&!r&&u.jsx(i,{xs:12,container:!0,children:u.jsx(e6,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"hatching",options:w?w.map(s=>({data:s,label:`${s.name}`})):[],onChange:(s,e)=>{O(e.data)},renderInput:s=>u.jsx($,{fullWidth:!0,...s,label:"انتخاب محصول"})})}),!C&&u.jsx(Eu,{children:u.jsxs(u6,{row:!0,"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:f,onChange:p,children:[u.jsx(Au,{value:"own",control:u.jsx(vu,{}),label:"صنوف اختصاصی"}),u.jsx(Au,{value:"free",control:u.jsx(vu,{}),label:"صنوف آزاد"})]})}),!a&&!C&&u.jsx(i,{xs:12,container:!0,children:u.jsx(e6,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"hatching",options:b?b.map(s=>{var e,l;return{data:s,label:`${s!=null&&s.steward?"مباشر":"صنف"} ${s==null?void 0:s.guildsName} ${(e=s==null?void 0:s.user)==null?void 0:e.fullname} (${(l=s==null?void 0:s.user)==null?void 0:l.mobile})`}}):[],onChange:(s,e)=>{var l,P,W;D({item:e==null?void 0:e.data,key:(l=e==null?void 0:e.data)==null?void 0:l.key,allocationType:(P=e==null?void 0:e.data)!=null&&P.steward?"killhouse_steward":"killhouse_guild",buyerType:(W=e==null?void 0:e.data)!=null&&W.steward?"Steward":"Guild"})},renderInput:s=>u.jsx($,{fullWidth:!0,...s,label:"انتخاب مباشر / صنف"})})}),u.jsx(mu,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"weight",label:"وزن لاشه",variant:"outlined",value:g.values.weight,error:g.touched.weight&&!!g.errors.weight,onChange:g.handleChange,onBlur:g.handleBlur,helperText:g.touched.weight&&g.errors.weight?g.errors.weight:null}),(A==null?void 0:A.active)&&u.jsx(Eu,{children:u.jsxs(u6,{row:!0,"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:x,onChange:V,children:[u.jsx(Au,{value:"true",control:u.jsx(vu,{}),label:"قیمت مصوب"}),u.jsx(Au,{value:"false",control:u.jsx(vu,{}),label:"قیمت آزاد"})]})}),u.jsx(mu,{disabled:(A==null?void 0:A.active)&&x==="true",allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"price",label:"قیمت هر کیلوگرم",variant:"outlined",InputProps:{endAdornment:u.jsx(w6,{position:"start",children:"ریال"})},value:g.values.price,error:g.touched.price?!!g.errors.price:null,onChange:g.handleChange,onBlur:g.handleBlur,helperText:g.touched.price&&g.errors.price?g.errors.price:null}),u.jsx(mu,{disabled:!0,allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"wholePrice",label:"هزینه کل",variant:"outlined",InputProps:{endAdornment:u.jsx(w6,{position:"start",children:"ریال"})},value:g.values.wholePrice,error:g.touched.wholePrice?!!g.errors.wholePrice:null,onChange:g.handleChange,onBlur:g.handleBlur,helperText:g.touched.wholePrice&&g.errors.wholePrice?g.errors.wholePrice:null}),u.jsx(eu,{variant:"contained",fullWidth:!0,disabled:C?!g.isValid:!g.isValid||(r?!1:!G)||!((B=R==null?void 0:R.item)!=null&&B.key),onClick:()=>{var e,l,P;let s={};_?s={allocation_key:_,number_of_carcasses:0,weight_of_carcasses:g.values.weight,amount:g.values.price,total_amount:g.values.wholePrice}:C?s={allocation_key:C==null?void 0:C.key,number_of_carcasses:0,weight_of_carcasses:g.values.weight,amount:g.values.price,total_amount:g.values.wholePrice}:(s={seller_type:t,buyer_type:R==null?void 0:R.buyerType,guild_key:(R==null?void 0:R.buyerType)==="Guild"?(e=R==null?void 0:R.item)==null?void 0:e.key:null,steward_key:(R==null?void 0:R.buyerType)==="Steward"?(l=R==null?void 0:R.item)==null?void 0:l.key:null,kill_house_key:(R==null?void 0:R.buyerType)==="KillHouse"?(P=R==null?void 0:R.item)==null?void 0:P.key:null,cold_house_key:r||null,product_key:r?null:G.key,type:"manual",allocation_type:r?"ColdHouse":R==null?void 0:R.allocationType,number_of_carcasses:0,weight_of_carcasses:g.values.weight,sell_type:y,amount:g.values.price,total_amount:g.values.wholePrice,approved_price_status:x==="true",date:M},s=Object.fromEntries(Object.entries(s).filter(([W,v])=>v!==null))),C?L(N6(s)).then(W=>{W.payload.error?T({vertical:"top",horizontal:"center",msg:W.payload.error,severity:"error"}):h()}):L(O6(s)).then(W=>{W.payload.error?T({vertical:"top",horizontal:"center",msg:W.payload.error,severity:"error"}):h()})},children:"ثبت"})]})},Us=({fetchApiData:a,item:o,fetchData:t,updateTable:d,priceInfo:c,fetchDashboardData:y})=>{const[F,C]=n.useState(null),A=cu(),r=b=>{C(b.currentTarget)},_=()=>{C(null)},I=()=>{_(),A(Zu({title:"ویرایش تخصیص",content:u.jsx(Vs,{fetchData:t,updateTable:d,fetchApiData:a,editData:o,priceInfo:c,fetchDashboardData:y})}))},L=()=>{A(M0({steward_allocation_key:o.key})).then(()=>{A(_6()),a(1),C(null)})},w=!!F,j=w?"popover":void 0;return u.jsxs(i,{container:!0,children:[u.jsx(C6,{size:"small","aria-describedby":j,variant:"contained",color:"primary",onClick:r,children:u.jsx(v6,{})}),u.jsx(h6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:j,open:w,anchorEl:F,onClose:_,children:u.jsxs(k6,{sx:{minWidth:140,p:.5},children:[u.jsxs(Pu,{onClick:()=>{_(),I()},sx:{borderRadius:1,mb:.25,py:.5},children:[u.jsx(Lu,{sx:{minWidth:32},children:u.jsx(W0,{fontSize:"small"})}),u.jsx(Ou,{primary:"ویرایش",primaryTypographyProps:{sx:{fontSize:"0.82rem",fontWeight:600}}})]}),u.jsxs(Pu,{onClick:()=>{_(),L()},sx:{borderRadius:1,py:.5},children:[u.jsx(Lu,{sx:{minWidth:32},children:u.jsx(Ke,{fontSize:"small"})}),u.jsx(Ou,{primary:"حذف",primaryTypographyProps:{sx:{fontSize:"0.82rem",fontWeight:600}}})]})]})})]})},Gs=({priceInfo:a})=>{const{slaughterProducts:o}=Tu(e=>e.slaughterSlice),t=cu(),[,,d,c,y,F]=n.useContext(ou),[C,A]=n.useState([]),[r]=n.useContext(ou),_=Tu(e=>e.userSlice.userProfile.key),[I,L]=n.useState([]),[w,j]=n.useState(0),[b,k]=n.useState(10),[G,O]=n.useState(""),[T,f]=n.useState(1),[K,p]=n.useState([]),[x,N]=n.useState([]),[V,R]=n.useState(null),D=async e=>{t(au());try{const l=await q.get(`/in-province-allocation/?search=filter&value=${G}&role=${z()}&date1=${d}&date2=${y}&page=${e||1}&page_size=${b}&type=Steward${V?`&steward_key=${V}`:"&steward_key=all"}`);L(l.data.results),j(l.data.count)}catch(l){console.error("Error fetching data:",l)}finally{t(su())}},Y=()=>{t(X6()).then(e=>{N(e.payload.data)})},g=e=>{D(e),f(e)},h=e=>{O(e.target.value)},M=e=>{var l,P,W,v,E,H,S,Q,J,Z,m,uu,lu,nu,ru,du,iu,hu;if(!e)return"-";switch(e==null?void 0:e.allocationType){case"steward_steward":return`${((l=e==null?void 0:e.toSteward)==null?void 0:l.guildsName)||"-"} - ${((W=(P=e==null?void 0:e.toSteward)==null?void 0:P.user)==null?void 0:W.fullname)||"-"} (${((E=(v=e==null?void 0:e.toSteward)==null?void 0:v.user)==null?void 0:E.mobile)||"-"})`;case"steward_guild":return`${((H=e==null?void 0:e.toGuilds)==null?void 0:H.guildsName)||"-"} - ${((Q=(S=e==null?void 0:e.toGuilds)==null?void 0:S.user)==null?void 0:Q.fullname)||"-"} (${((Z=(J=e==null?void 0:e.toGuilds)==null?void 0:J.user)==null?void 0:Z.mobile)||"-"})`;case"ColdHouse":return`${((m=e==null?void 0:e.toColdHouse)==null?void 0:m.name)||"-"}`;default:return`${((uu=e==null?void 0:e.toKillHouse)==null?void 0:uu.name)||"-"} - ${((ru=(nu=(lu=e==null?void 0:e.toKillHouse)==null?void 0:lu.killHouseOperator)==null?void 0:nu.user)==null?void 0:ru.fullname)||"-"} (${((hu=(iu=(du=e==null?void 0:e.toKillHouse)==null?void 0:du.killHouseOperator)==null?void 0:iu.user)==null?void 0:hu.mobile)||"-"})`}},U=e=>{k(e),f(1)},B=()=>{t(Ms({search:"filter",role:z(),selectedDate1:d,selectedDate2:y,steward_key:V||"all"})).then(e=>{A(e.payload.data)})};n.useEffect(()=>{const e=I==null?void 0:I.map((l,P)=>{var W,v,E,H,S,Q,J,Z,m,uu,lu,nu,ru,du,iu,hu,pu,xu,Su,fu;return[T===1?P+1:P+b*(T-1)+1,a6(l==null?void 0:l.date)||"-",D6(l),l!=null&&l.steward?`${(v=(W=l==null?void 0:l.steward)==null?void 0:W.guildsName)==null?void 0:v.toLocaleString()} ${(S=(H=(E=l==null?void 0:l.steward)==null?void 0:E.user)==null?void 0:H.fullname)==null?void 0:S.toLocaleString()} ${((Z=(J=(Q=l==null?void 0:l.steward)==null?void 0:Q.user)==null?void 0:J.mobile)==null?void 0:Z.toLocaleString())||"-"}`:`${(uu=(m=l==null?void 0:l.guilds)==null?void 0:m.guildsName)==null?void 0:uu.toLocaleString()} ${(ru=(nu=(lu=l==null?void 0:l.guilds)==null?void 0:lu.user)==null?void 0:nu.fullname)==null?void 0:ru.toLocaleString()} ${((hu=(iu=(du=l==null?void 0:l.guilds)==null?void 0:du.user)==null?void 0:iu.mobile)==null?void 0:hu.toLocaleString())||"-"}`,M(l),(l==null?void 0:l.sellType)==="exclusive"?"اختصاصی":"آزاد",(((pu=l==null?void 0:l.amount)==null?void 0:pu.toLocaleString())||"0")+" ریال",(((xu=l==null?void 0:l.totalAmount)==null?void 0:xu.toLocaleString())||"0")+" ریال",((Su=l==null?void 0:l.weightOfCarcasses)==null?void 0:Su.toLocaleString())||"0",((fu=l==null?void 0:l.reciverWeightOfCarcasses)==null?void 0:fu.toLocaleString())||"0",(l==null?void 0:l.registrationCode)||"-",l!=null&&l.registrationCode?"ارسال شده":"ارسال نشده",u.jsx($6,{src:l==null?void 0:l.image},P),(l==null?void 0:l.receiverState)==="accepted"?"تایید شده":(l==null?void 0:l.receiverState)==="rejected"?"رد شده":"در انتظار تایید",u.jsx(Us,{item:l,fetchApiData:D,priceInfo:a,fetchDashboardData:B},P)]});p(e)},[I,T,b,a,o]),n.useEffect(()=>{D(1),B(),Y()},[t,d,y,b,V]);const s=async e=>{e.preventDefault(),D(1),B()};return u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,mt:4,children:[u.jsx(i,{container:!0,width:"100%",isDashboard:!0,children:u.jsx(zs,{dashboardData:C})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(i,{children:u.jsx(tu,{label:"از تاریخ",renderInput:e=>u.jsx($,{...e,style:{width:"160px"},size:"small"}),value:d,onChange:e=>{c(X(e).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsx(tu,{label:"تا تاریخ",renderInput:e=>u.jsx($,{...e,style:{width:"160px"},size:"small"}),value:y,onChange:e=>{F(X(e).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsxs("form",{onSubmit:s,style:{marginRight:"16px"},children:[u.jsx(Eu,{size:"small",style:{width:200},children:u.jsx(e6,{options:x,getOptionLabel:e=>{var l;return`(${e==null?void 0:e.guildsName}) ${(l=e==null?void 0:e.user)==null?void 0:l.fullname}`},value:V&&x.find(e=>e.key===V)||null,onChange:(e,l)=>{R(l?l.key:null)},renderInput:e=>u.jsx($,{...e,label:"مباشرین",size:"small",placeholder:"جستجوی مباشرین"}),noOptionsText:"مباشری یافت نشد",isOptionEqualToValue:(e,l)=>e.key===l.key})}),u.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250,marginRight:"16px"},onChange:h,value:G}),u.jsx(eu,{type:"submit",endIcon:u.jsx(wu,{}),children:"جستجو"})]})}),u.jsx(Fu,{title:"خروجی اکسل",children:u.jsx(eu,{color:"success",onClick:()=>{r({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const e=`${q.defaults.baseURL}steward_allocation_excel/?role=${z()}&key=${_}&search=filter&value=${G}&date1=${d}&date2=${y}&type=Steward${V?`&steward_key=${V}`:"&steward_key=all"}`;window.location.href=e},children:u.jsx(Iu,{size:32})})})]}),u.jsx(Cu,{data:K,columns:["ردیف","تاریخ ثبت","نوع تخصیص","مشخصات فروشنده","مشخصات خریدار","نوع فروش","قیمت هر کیلو","قیمت کل","وزن تخصیصی","وزن تایید شده","کداحراز","وضعیت کد احراز","سند","وضعیت","عملیات"],handlePageChange:g,totalRows:w,page:T,perPage:b,handlePerRowsChange:U,title:"تخصیصات صورت گرفته"})]})})},Ks=bu("PROVINCE_GET_DISPENSER_KILLHOUSES_DASHBOARD_SERVICE",async(a,{dispatch:o})=>{o(au());const{data:t,status:d}=await q.get("total-steward-dashboard",{params:{role:z(),date1:a.selectedDate1?a.selectedDate1:null,date2:a.selectedDate2?a.selectedDate2:null}});return o(su()),{data:t,status:d}}),qs=bu("PROVINCE_DISPENSER_SEGMENTATION_DASHBOARD",async(a,{dispatch:o})=>{o(au());const{data:t,status:d}=await q.get("segmentation-dashboard",{params:{date1:a.selectedDate1,date2:a.selectedDate2,role:z(),steward_key:a.steward_key||"all"}});return o(su()),{data:t,status:d}}),Xs=({updateTable:a,priceInfo:o,remainWeight:t})=>{var l,P,W;const{slaughterProducts:d}=Tu(v=>v.slaughterSlice),c=cu(),[,,y,F,C,A]=n.useContext(ou),r=v=>{G(v.target.value)},[_,I]=n.useState([]),[L,w]=n.useState(0),[j,b]=n.useState(10),[k,G]=n.useState(""),[O,T]=n.useState(1),[f,K]=n.useState([]),[p,x]=n.useState([]),[N,V]=n.useState([]),[R,D]=n.useState(null),Y=Tu(v=>v.userSlice.userProfile.key),[g]=n.useContext(ou),h=async v=>{c(au());try{const E=await q.get(`app-segmentation/?search=filter&value=${k}&role=${z()}&date1=${y}&date2=${C}&page=${v||1}&page_size=${j}&type=dashboard${R?`&steward_key=${R}`:"&steward_key=all"}`);I(E.data.results),w(E.data.count)}catch(E){console.error("Error fetching data:",E)}finally{c(su())}},M=()=>{c(X6()).then(v=>{V(v.payload.data)})},U=()=>{c(qs({search:"filter",role:z(),selectedDate1:y,selectedDate2:C,steward_key:R||"all"})).then(v=>{x(v.payload.data)})},B=v=>{h(v),T(v)},s=v=>{b(v),T(1)};n.useEffect(()=>{const v=_==null?void 0:_.map((E,H)=>{var S,Q,J,Z,m,uu;return[O===1?H+1:H+j*(O-1)+1,E!=null&&E.toGuild?"قطعه بند":"مباشر",`${(S=E==null?void 0:E.buyer)==null?void 0:S.fullname}(${(Q=E==null?void 0:E.buyer)==null?void 0:Q.mobile})`,E!=null&&E.toGuild?`${(Z=(J=E==null?void 0:E.toGuild)==null?void 0:J.user)==null?void 0:Z.fullname}(${(uu=(m=E==null?void 0:E.toGuild)==null?void 0:m.user)==null?void 0:uu.mobile})`:"-",a6(E==null?void 0:E.date),E==null?void 0:E.weight,(E==null?void 0:E.quota)==="governmental"?"دولتی":(E==null?void 0:E.quota)==="free"?"آزاد":"-",(E==null?void 0:E.saleType)==="governmental"?"دولتی":(E==null?void 0:E.saleType)==="free"?"آزاد":"-"]});K(v)},[_,O,j,o,d]),n.useEffect(()=>{h(1),U(),M()},[c,y,C,j,R]);const e=async v=>{v.preventDefault(),h(1),U()};return u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsxs(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,mt:4,children:[u.jsx(i,{container:!0,width:"100%",isDashboard:!0,children:u.jsx(Cu,{noPagination:!0,isDashboard:!0,columns:["وزن کل (کیلوگرم)","وزن قطعه بندی","وزن تخصیصی به قطعه بندها"],data:[[((l=p==null?void 0:p.totalWeight)==null?void 0:l.toLocaleString())||"0",((P=p==null?void 0:p.totalSelfWeight)==null?void 0:P.toLocaleString())||"0",((W=p==null?void 0:p.totalOtherWeight)==null?void 0:W.toLocaleString())||"0"]],title:"خلاصه اطلاعات"})}),u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(i,{children:u.jsx(tu,{label:"از تاریخ",renderInput:v=>u.jsx($,{...v,style:{width:"160px"},size:"small"}),value:y,onChange:v=>{F(X(v).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsx(tu,{label:"تا تاریخ",renderInput:v=>u.jsx($,{...v,style:{width:"160px"},size:"small"}),value:C,onChange:v=>{A(X(v).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsxs("form",{onSubmit:e,style:{marginRight:"16px"},children:[u.jsx(Eu,{size:"small",style:{width:200},children:u.jsx(e6,{options:N,getOptionLabel:v=>{var E;return`(${v==null?void 0:v.guildsName}) ${(E=v==null?void 0:v.user)==null?void 0:E.fullname}`},value:R&&N.find(v=>v.key===R)||null,onChange:(v,E)=>{D(E?E.key:null)},renderInput:v=>u.jsx($,{...v,label:"مباشرین",size:"small",placeholder:"جستجوی مباشرین"}),noOptionsText:"مباشری یافت نشد",isOptionEqualToValue:(v,E)=>v.key===E.key})}),u.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250,marginRight:"16px"},onChange:r,value:k}),u.jsx(eu,{type:"submit",endIcon:u.jsx(wu,{}),children:"جستجو"})]})}),u.jsx(Fu,{title:"خروجی اکسل",children:u.jsx(eu,{color:"success",onClick:()=>{g({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const v=`${q.defaults.baseURL}steward_free_sale_out_province_excel/?role=${z()}&key=${Y}&search=filter&value=${k} &date1=${y}&date2=${C}&type=Steward`;window.location.href=v},children:u.jsx(Iu,{size:32})})})]}),u.jsx(Cu,{data:f,columns:["ردیف","ماهیت","مباشر","تخصیص به قطعه بند","تاریخ ","وزن (کیلوگرم)","سهمیه","نوع فروش"],handlePageChange:B,totalRows:L,page:O,perPage:j,handlePerRowsChange:s,title:"قطعه بندی"})]})})},Qs=()=>{var g,h,M,U,B,s,e,l,P,W,v,E;const[a,o]=n.useState([]),[t,d]=n.useState(!1),[c,y]=n.useState([]),[F]=n.useContext(ou),[C,A]=n.useState(0),[r,_]=n.useState(1),[I,L]=n.useState(0),[w,j]=n.useState(10),[b,k]=n.useState([]),G=Tu(H=>H.userSlice.userProfile.key),[,,O,T,f,K]=n.useContext(ou),p=(H,S)=>{A(S)},x=cu(),N=async H=>{x(au());try{const S=await q.get(`/total-steward-dashboard-detail/?&role=${z()}&page=${H}&page_size=${w}${t?`&date1=${O}&date2=${f}`:""}`);o(S.data.results),L(S.data.count)}catch(S){console.error("Error fetching data:",S)}finally{x(su())}},V=()=>{x(Ks({selectedDate1:t?O:null,selectedDate2:t?f:null})).then(H=>{y(H.payload.data)})},R=()=>{const H=a==null?void 0:a.map((S,Q)=>{var J,Z,m,uu,lu,nu,ru,du,iu,hu,pu,xu,Su,fu,ju,_u,Nu,Hu,Wu,Yu,Bu,zu,Mu,Vu,Uu,Gu,Ku,qu,Xu,Qu,Ju,g6,A6,p6,x6,S6,f6,y6,j6;return[r===1?Q+1:Q+w*(r-1)+1,`${(Z=(J=S==null?void 0:S.user)==null?void 0:J.fullname)==null?void 0:Z.toLocaleString()} ${(uu=(m=S==null?void 0:S.user)==null?void 0:m.mobile)==null?void 0:uu.toLocaleString()}`,`${S!=null&&S.steward?"مباشر":"صنف"} `,((nu=(lu=S==null?void 0:S.address)==null?void 0:lu.city)==null?void 0:nu.name)||((ru=S==null?void 0:S.user)==null?void 0:ru.cityName),(iu=(du=S==null?void 0:S.wareHouseInfo)==null?void 0:du.totalBarsWeight)==null?void 0:iu.toLocaleString(),(pu=(hu=S==null?void 0:S.wareHouseInfo)==null?void 0:hu.totalEnteredBarsWeight)==null?void 0:pu.toLocaleString(),(Su=(xu=S==null?void 0:S.wareHouseInfo)==null?void 0:xu.totalOutputWeight)==null?void 0:Su.toLocaleString(),(ju=(fu=S==null?void 0:S.wareHouseInfo)==null?void 0:fu.totalRemainWeight)==null?void 0:ju.toLocaleString(),(Nu=(_u=S==null?void 0:S.wareHouseInfo)==null?void 0:_u.totalRemainGovernmentalWeight)==null?void 0:Nu.toLocaleString(),(Wu=(Hu=S==null?void 0:S.wareHouseInfo)==null?void 0:Hu.totalRemainFreeWeight)==null?void 0:Wu.toLocaleString(),(Bu=(Yu=S==null?void 0:S.wareHouseInfo)==null?void 0:Yu.inputBarsWeight)==null?void 0:Bu.toLocaleString(),(Mu=(zu=S==null?void 0:S.wareHouseInfo)==null?void 0:zu.freeBarsWeight)==null?void 0:Mu.toLocaleString(),(Uu=(Vu=S==null?void 0:S.wareHouseInfo)==null?void 0:Vu.inProvinceBarsWeight)==null?void 0:Uu.toLocaleString(),(Ku=(Gu=S==null?void 0:S.wareHouseInfo)==null?void 0:Gu.outProvinceBarsWeight)==null?void 0:Ku.toLocaleString(),(Xu=(qu=S==null?void 0:S.wareHouseInfo)==null?void 0:qu.totalOutputGovernmentalWeight)==null?void 0:Xu.toLocaleString(),(Ju=(Qu=S==null?void 0:S.wareHouseInfo)==null?void 0:Qu.totalOutputFreeWeight)==null?void 0:Ju.toLocaleString(),(A6=(g6=S==null?void 0:S.wareHouseInfo)==null?void 0:g6.lastTotalRemainWeight)==null?void 0:A6.toLocaleString(),(x6=(p6=S==null?void 0:S.wareHouseInfo)==null?void 0:p6.lastTotalRemainGovernmentalWeight)==null?void 0:x6.toLocaleString(),(f6=(S6=S==null?void 0:S.wareHouseInfo)==null?void 0:S6.lastTotalRemainFreeWeight)==null?void 0:f6.toLocaleString(),(j6=(y6=S==null?void 0:S.wareHouseInfo)==null?void 0:y6.segmentationsWeight)==null?void 0:j6.toLocaleString()]});k(H)};n.useEffect(()=>{C===0&&(N(r),V())},[C]),n.useEffect(()=>{C===0&&(N(r),V())},[x,O,f,w,t]),n.useEffect(()=>{C===0&&R()},[a,w]);const D=H=>{C===0&&(N(H),_(H))},Y=H=>{C===0&&(j(H),_(1))};return u.jsxs(i,{container:!0,xs:12,justifyContent:"start",alignItems:"center",children:[u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mt:2,children:u.jsx(i,{container:!0,justifyContent:"center",alignItems:"center",mb:ku.MEDIUM,xs:12,children:u.jsxs(c6,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,onChange:p,value:C,children:[u.jsx(yu,{label:"اطلاعات جامع"}),u.jsx(yu,{label:"توزیع به داخل استان"}),u.jsx(yu,{label:"فروش به خارج استان"}),u.jsx(yu,{label:"قطعه بندی"})]})})}),C===0&&u.jsxs(u.Fragment,{children:[u.jsx(Cu,{changed:!0,title:"اطلاعات کلی انبار",noPagination:!0,columns:["وزن کل بار ها (کیلوگرم)","وزن وارد شده به انبار (کیلوگرم)","وزن دولتی (کیلوگرم)","وزن آزاد (کیلوگرم)","وزن توزیع شده داخل استان (کیلوگرم)","وزن توزیع شده خارج استان (کیلوگرم)","وزن قطعه بندی","کل وزن فروش رفته دولتی","کل وزن فروش رفته آزاد","مانده انبار (کیلوگرم)","مانده انبار دولتی (کیلوگرم)","مانده انبار آزاد (کیلوگرم)"],data:[[(g=c==null?void 0:c.totalBarsWeight)==null?void 0:g.toLocaleString(),(h=c==null?void 0:c.totalEnteredBarsWeight)==null?void 0:h.toLocaleString(),(M=c==null?void 0:c.totalGovernmentalInputWeight)==null?void 0:M.toLocaleString(),(U=c==null?void 0:c.totalFreeInputWeight)==null?void 0:U.toLocaleString(),(B=c==null?void 0:c.inProvinceBarsWeight)==null?void 0:B.toLocaleString(),(s=c==null?void 0:c.outProvinceBarsWeight)==null?void 0:s.toLocaleString(),(e=c==null?void 0:c.segmentationsWeight)==null?void 0:e.toLocaleString(),(l=c==null?void 0:c.totalGovernmentalOutputWeight)==null?void 0:l.toLocaleString(),(P=c==null?void 0:c.totalFreeOutputWeight)==null?void 0:P.toLocaleString(),(W=c==null?void 0:c.totalRemainWeight)==null?void 0:W.toLocaleString(),(v=c==null?void 0:c.totalGovernmentalRemainWeight)==null?void 0:v.toLocaleString(),(E=c==null?void 0:c.totalFreeRemainWeight)==null?void 0:E.toLocaleString()]]}),u.jsxs(i,{mt:2,container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(d6,{icon:u.jsx(B0,{}),checkedIcon:u.jsx(z0,{}),checked:t,onChange:()=>d(!t),color:"primary",size:"large"}),u.jsx(i,{children:u.jsx(tu,{disabled:!t,label:"از تاریخ",id:"date",renderInput:H=>u.jsx($,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...H}),value:O,onChange:H=>{T(X(H).format("YYYY-MM-DD"))}})}),u.jsx(i,{children:u.jsx(tu,{disabled:!t,label:"تا تاریخ",id:"date",renderInput:H=>u.jsx($,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...H}),value:f,onChange:H=>{K(X(H).format("YYYY-MM-DD"))}})})]}),u.jsx(Fu,{title:"خروجی اکسل",children:u.jsx(eu,{color:"success",onClick:()=>{F({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const H=`${q.defaults.baseURL}total_steward_dashboard_excel/?key=${G}${t?`&date1=${O}&date2=${f}`:""}`;window.location.href=H},children:u.jsx(Iu,{size:32})})}),u.jsx(i,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mt:2,children:u.jsx(Cu,{title:"انبار و توزیع",columns:["ردیف","خریدار","ماهیت","شهر","وزن کل بارها","کل وزن ورودی به انبار","کل وزن فروش رفته","مانده انبار فعلی","مانده انبار دولتی (کیلوگرم)","مانده انبار آزاد (کیلوگرم)","وزن بار درون استان","وزن لاشه خرید خارج استان","وزن فروش داخل استان","وزن فروش خارج استان","کل وزن فروش رفته دولتی","کل وزن فروش رفته آزاد","مانده انبار گذشته","مانده انبار گذشته دولتی","مانده انبار گذشته آزاد","وزن فطعه بندی"],handlePageChange:D,data:b,totalRows:I,page:r,perPage:w,handlePerRowsChange:Y})})]}),C===1&&u.jsx(Gs,{}),C===2&&u.jsx(Bs,{}),C===3&&u.jsx(Xs,{})]})},Js=()=>u.jsx(i,{justifyContent:"center",my:ku.MEDIUM,children:u.jsx(i,{children:u.jsx(E6,{variant:"h6",children:"داشبورد مدیریت توزیع"})})}),Zs=a=>{const o=[R0,T0,b0,k0,Ce,de],t=[P0,D0,O0,L0,ge,Ae],d=[E0,F0,v0,_0,pe,xe],c=[w0,z6,B6,b6,Se,fe],y=[ye,je,_e,ve,Fe],F=[j0,y0,x0,f0,Ee,S0],C=[p0,A0,g0,h0,ie,he,i0];return o.includes(a)?u.jsx(as,{}):C.includes(a)?u.jsx(Qs,{}):t.some(A=>a.includes(A))?u.jsx(rs,{}):d.some(A=>a.includes(A))?u.jsx(ts,{}):c.some(A=>a.includes(A))?u.jsx(os,{}):y.some(A=>a.includes(A))?u.jsx(ds,{}):F.some(A=>a.includes(A))?u.jsx(ks,{}):null},ms=()=>{const{pathname:a}=C0(),{key:o,name:t}=W6(),d=[we,be,ke,Te,Re,Ie,$e].includes(a);return u.jsx(F6,{display:"flex",justifyContent:"center",children:u.jsxs(i,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[d?u.jsxs(u.Fragment,{children:[u.jsx(Js,{}),u.jsx(Xe,{})]}):u.jsx(Oe,{}),!o&&Zs(a),o&&u.jsx(Ls,{name:t},o)]})})},Nl=Y6.memo(ms);export{Nl as default}; diff --git a/build/assets/SlaughterHouseVet-BNaV_ELx.js b/build/assets/SlaughterHouseVet-BNaV_ELx.js new file mode 100644 index 0000000..a8762f5 --- /dev/null +++ b/build/assets/SlaughterHouseVet-BNaV_ELx.js @@ -0,0 +1 @@ +import{j as u,aO as cu,aP as iu,aQ as du,aR as Cu,aS as xu,aT as hu,T as r,ak as f,B as q,p as pu,I as R,b as H,a9 as J,am as d,bl as Au,bm as X,aL as ju,aM as Fu,aN as gu,ar as Z}from"./mui-vendor-CkIVaoQP.js";import{G as s,S as i,jK as uu,kV as V,kW as O,j as yu,L as $,h as K,A as nu,g0 as ru,N as I,O as fu,a9 as b,Q as k,_ as Eu,kX as eu,W as L,X as Su,jI as bu,jJ as Du,p as Tu,k as vu,kY as Mu,kZ as mu}from"./index-CeyyVc1v.js";import{N as Y}from"./NavLink-D2GD_ItM.js";import{L as W}from"./LinkItem-DT6qswcs.js";import{a as Lu,V as tu}from"./index.esm-CjWvmHks.js";import{f as lu,r as c,u as ku}from"./react-vendor-CmFgShSM.js";import{d as wu}from"./Settings-BckUi175.js";import{d as su}from"./Plagiarism-BiXORbzo.js";import{a as Nu,u as P,f as z}from"./redux-vendor-B7uoacJt.js";import{d as Ru}from"./Edit-CqBj1Y2L.js";import{V as _u}from"./SlaughterEnterNoneReciept-Cle0J4bf.js";import{A as Hu}from"./index-9Ymn_7Kv.js";import{R as au}from"./ResponsiveTable-w7hk7Uq8.js";import{B as Iu}from"./BackButton-Crzr7NMa.js";import{S as _}from"./SimpleTable-DBAoNnCU.js";import{T as Bu}from"./Timer-DHCbB9tg.js";import{g as U,S as Yu}from"./getRemainedSeconds-D4cLRaa6.js";import{A as Wu}from"./AdvancedTable-BYmmBtmq.js";import{S as Uu}from"./SlaghterEnterBarInfo-uCfcHEct.js";import"./iconBase-BEJYyZsk.js";import"./VetFarmEditTrafficCode-D3hZa5p9.js";import"./Tune-D4M2CAhp.js";import"./ReceiptLong-Dxpx4wPx.js";import"./index.esm-Bu7XMDZU.js";import"./ShowImage-CqhU2hmk.js";import"./Download-DQ-VVIaV.js";import"./Close-_jAEIgMD.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./index-CIfb_iLp.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";import"./toBase64-BzgTOHsW.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./SlaughterManageBars-CW9paHF2.js";import"./resizeImage-Csf2MO3w.js";import"./AddCircleOutline-C8LXM-k8.js";import"./isValidIndexWeight-C_ik-uYa.js";import"./getDocumentStates-BlCrMUIj.js";import"./NumberFormatCustom-DwWPj40N.js";import"./FileUploader-DT5gIVb3.js";import"./CloudUpload-BlIgB_r9.js";import"./CheckCircle-zgBvZQ-b.js";const qu=()=>{const{pathname:l}=lu();return u.jsx(s,{container:!0,gap:i.SMALL,p:i.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",style:{placeContent:"baseline"},children:u.jsx(s,{container:!0,direction:"column",style:{width:"100%"},children:u.jsxs(s,{container:!0,gap:i.SMALL,justifyContent:"center",children:[u.jsx(Y,{to:uu,active:l===uu?"true":null,children:u.jsx(W,{icon:u.jsx(Lu,{size:30,color:"#244CCC"}),title:"بارهای خارج استان",description:"درخواست های در انتظار عملیات وارد کردن اطلاعات بارهای دریافتی"})}),u.jsx(Y,{to:V,active:l===V?"true":null,children:u.jsx(W,{icon:u.jsx(tu,{size:30,color:"#244CCC"}),title:"بارهای جدید"})}),u.jsx(Y,{to:O,active:l===O?"true":null,children:u.jsx(W,{icon:u.jsx(tu,{size:30,color:"#244CCC"}),title:"وارد کردن اطلاعات بار"})})]})})})},Vu=Nu("SLAUGHTER_HOUSE_VET_SEND_CHECK_REQUEST",async(l,{dispatch:C})=>{try{const{data:p,status:w}=await yu.post("vet_check/",l);return C($()),{data:p,status:w}}catch(p){return C(K()),{error:p.response.data.result}}});function G({item:l}){const C=P(),[p,,w,,N]=c.useContext(nu),[h,A]=c.useState(l.quantity),[D,T]=c.useState(),F=o=>{A(o.target.value)},g=o=>{T(o.target.value)};return u.jsxs(cu,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(iu,{children:[u.jsx(du,{color:"secondary"}),u.jsx(Cu,{})]}),u.jsxs(s,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(s,{container:!0,alignItems:"center",children:[u.jsx(s,{children:u.jsx(xu,{variant:"body1",fontWeight:"bold",color:"secondary",children:"انجام عملیات"})}),u.jsx(s,{children:u.jsx(hu,{color:"textSecondary",children:u.jsx(r,{variant:"body2",children:"در این مرحله درخواست را بررسی و تایید کنید."})})})]}),u.jsx(s,{container:!0,gap:i.SMALL,children:u.jsx(Hu,{children:u.jsxs(s,{container:!0,gap:i.SMALL,mt:i.SMALL,mx:i.SMALL,children:[u.jsx(s,{children:u.jsx(f,{label:"تعداد واقعی تحویلی",variant:"outlined",type:"number",value:h,onChange:F})}),u.jsx(s,{children:u.jsx(f,{label:"وزن واقعی بار",variant:"outlined",type:"number",value:D,onChange:g})}),u.jsx(q,{variant:"contained",onClick:()=>{C($()),C(Vu({kill_house_request_key:l.killHouseRequestKey,state:"accepted",accepted_real_quantity:Number(D)&&Number(h)?Number(h):0,accepted_real_weight:Number(h)&&Number(D)?Number(D):0})).then(o=>{C(K()),o.payload.error?p({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(C(ru({selectedDate1:w,selectedDate2:N})),C(I({right:!1,bottom:!1,top:!1,content:null,size:null})),p({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تحویل بار"}),u.jsx(q,{variant:"contained",color:"error",onClick:()=>{C(fu({title:"عملیات لغو بار",content:u.jsx(_u,{killHouseRequestKey:l.killHouseRequestKey})}))},children:"عدم وصول"})]})})})]})]})}G.propTypes={file:pu.PropTypes.any};const Ou=()=>{const l=ku(),C=P(),[p,w]=c.useState([]),[N,h]=c.useState([]),[A,D]=c.useState([]),[T,F]=c.useState([]),[,,g,o,v,t]=c.useContext(nu);c.useEffect(()=>{const a=b(new Date).format("YYYY-MM-DD");o(a),t(a)},[]);const{newRequests:n}=z(a=>a.slaughterHouseVetSlice);c.useEffect(()=>{C(ru({selectedDate1:g,selectedDate2:v}))},[g,v]),c.useEffect(()=>{var Q;const a=n==null?void 0:n.filter(e=>e.vetState==="pending").map((e,x)=>{var j;return[x+1,e.barcod,e.clearanceCode?e.clearanceCode:"ندارد",e.killHouseName,k(new Date(e==null?void 0:e.sendDate),"yyyy/MM/dd"),Eu(e==null?void 0:e.createDate),`${e.poultryName} (${e.poultryMobile})`,e.killPlace,e.poultryCity,e.age,`${e.driverName} (${e.driverMobile})`,e.typeCar,e.pelak,e.chickenBreed,(j=e==null?void 0:e.quantity)==null?void 0:j.toLocaleString(),e.indexWeight,(e.indexWeight*(e==null?void 0:e.quantity)).toLocaleString(),u.jsx(R,{color:"primary",onClick:()=>{C(I({title:"انجام عملیات تخلیه",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(G,{item:e})}))},children:u.jsx(Ru,{})},x)]});w(a);const S=(Q=n==null?void 0:n.filter(e=>e.vetState==="accepted"))==null?void 0:Q.map((e,x)=>{var j;return[x+1,e.barcod,e.clearanceCode?e.clearanceCode:"ندارد",e.killHouseName,k(new Date(e==null?void 0:e.sendDate),"yyyy/MM/dd"),e.poultryName,e.poultryMobile,e.poultryCity,e==null?void 0:e.age,((j=e==null?void 0:e.quantity)==null?void 0:j.toLocaleString())+" قطعه",e.driverName,e.typeCar,e.pelak,e.chickenBreed,e.indexWeight,u.jsx(R,{color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>l(eu+e.poultryRequestId),children:u.jsx(su,{})},x)]});D(S);const B=n==null?void 0:n.filter(e=>e.vetState==="pending").map((e,x)=>{var j;return u.jsx(s,{item:!0,xs:6,children:u.jsxs(H,{component:J,style:{width:"100%",padding:"12px",borderRadius:"8px",boxShadow:"0 2px 5px rgba(0, 0, 0, 0.1)",marginBottom:"10px",display:"flex",flexDirection:"column"},children:[u.jsxs(r,{style:{fontSize:"14px",marginBottom:"8px"},children:["کد بار: ",e.barcod]}),u.jsx(d,{}),u.jsxs(r,{style:{fontSize:"14px",marginBottom:"8px"},children:["کدرهگیری: ",e.clearanceCode?e.clearanceCode:"ندارد"]}),u.jsx(d,{}),u.jsx(d,{}),u.jsxs(r,{style:{fontSize:"14px",marginBottom:"8px"},children:["تاریخ کشتار: ",k(new Date(e==null?void 0:e.sendDate),"yyyy/MM/dd")]}),u.jsx(d,{}),u.jsxs(r,{style:{fontSize:"14px",marginBottom:"8px"},children:["مرغدار:",u.jsx("br",{}),`${e.poultryName} (${e.poultryMobile})`]}),u.jsx(d,{}),u.jsxs(r,{style:{fontSize:"14px",marginBottom:"8px"},children:["سن مرغ: ",e.age]}),u.jsx(d,{}),u.jsxs(r,{style:{fontSize:"14px",marginBottom:"8px"},children:["تعداد: ",(j=e==null?void 0:e.quantity)==null?void 0:j.toLocaleString()]}),u.jsx(d,{}),u.jsx(R,{color:"primary",style:{marginTop:"8px"},onClick:()=>{C(I({title:"انجام عملیات تخصیص",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(G,{item:e})}))},children:u.jsx(wu,{})},x)]},x)},x)});h(B);const ou=n==null?void 0:n.filter(e=>e.vetState==="accepted").map((e,x)=>{var j;return u.jsx(s,{item:!0,xs:6,children:u.jsxs(H,{component:J,style:{width:"100%",padding:"12px",borderRadius:"8px",boxShadow:"0 2px 5px rgba(0, 0, 0, 0.1)",marginBottom:"10px",display:"flex",flexDirection:"column"},children:[u.jsxs(r,{style:{fontSize:"14px",marginBottom:"8px"},children:["کد بار: ",e.barcod]}),u.jsx(d,{}),u.jsxs(r,{style:{fontSize:"14px",marginBottom:"8px"},children:["کدرهگیری: ",e.clearanceCode?e.clearanceCode:"ندارد"]}),u.jsx(d,{}),u.jsxs(r,{style:{fontSize:"14px",marginBottom:"8px"},children:["خریدار: ",e.killHouseName]}),u.jsx(d,{}),u.jsxs(r,{style:{fontSize:"14px",marginBottom:"8px"},children:["تاریخ کشتار: ",k(new Date(e==null?void 0:e.sendDate),"yyyy/MM/dd")]}),u.jsx(d,{}),u.jsxs(r,{style:{fontSize:"14px",marginBottom:"8px"},children:["مرغدار:",u.jsx("br",{}),`${e.poultryName} (${e.poultryMobile})`]}),u.jsx(d,{}),u.jsxs(r,{style:{fontSize:"14px",marginBottom:"8px"},children:["سن مرغ: ",e.age]}),u.jsx(d,{}),u.jsxs(r,{style:{fontSize:"14px",marginBottom:"8px"},children:["تعداد: ",(j=e==null?void 0:e.quantity)==null?void 0:j.toLocaleString()]}),u.jsx(d,{}),u.jsx(R,{color:"primary",className:"avicultureActiveRequestsBtn",onClick:()=>l(eu+e.poultryRequestId),children:u.jsx(su,{})},x)]},x)},x)});F(ou)},[n]);const[E,M]=c.useState("active"),m=(a,S)=>{S&&M(S)},y=window.innerWidth<=600;return u.jsx(s,{xs:12,container:!0,gap:i.MEDIUM,direction:"column",children:u.jsx(s,{gap:i.SMALL,justifyContent:{xs:"center",lg:"space-between"},alignSelf:"center",alignItems:"center",direction:{xs:"column",lg:"row"},xs:12,children:u.jsxs(s,{container:!0,xs:12,alignItems:"end",direction:"column",children:[u.jsx(s,{container:!0,children:u.jsxs(Au,{color:"primary",value:E,exclusive:!0,onChange:m,"aria-label":"Platform",children:[u.jsx(X,{value:"active",children:"بارها"}),u.jsx(X,{value:"archive",children:"بایگانی"})]})}),E==="active"&&u.jsx(s,{width:"100%",className:"avicultureActiveRequestsView",container:!0,children:y?u.jsxs(s,{container:!0,xs:12,spacing:4,justifyContent:"space-between",children:[u.jsxs(s,{container:!0,alignItems:"center",gap:i.SMALL,justifyContent:"center",marginBottom:2,children:[u.jsx(s,{xs:12,children:u.jsx(r,{children:"بارهای جدید"})}),u.jsx(s,{children:u.jsx(L,{label:"از تاریخ",id:"date",renderInput:a=>u.jsx(f,{style:{width:"160px"},...a}),value:g,onChange:a=>{o(b(a).format("YYYY-MM-DD"))}})}),u.jsx(s,{children:u.jsx(L,{label:"تا تاریخ",id:"date",renderInput:a=>u.jsx(f,{style:{width:"160px"},...a}),value:v,onChange:a=>{t(b(a).format("YYYY-MM-DD"))}})})]}),N]}):u.jsx(au,{title:u.jsxs(s,{container:!0,alignItems:"center",gap:i.SMALL,mb:2,children:[u.jsx(s,{children:u.jsx(r,{children:"بارهای جدید"})}),u.jsx(s,{children:u.jsx(L,{label:"از تاریخ",id:"date",renderInput:a=>u.jsx(f,{style:{width:"160px"},...a}),value:g,onChange:a=>{o(b(a).format("YYYY-MM-DD"))}})}),u.jsx(s,{children:u.jsx(L,{label:"تا تاریخ",id:"date",renderInput:a=>u.jsx(f,{style:{width:"160px"},...a}),value:v,onChange:a=>{t(b(a).format("YYYY-MM-DD"))}})})]}),columns:["ردیف","کد بار","کدرهگیری سامانه قرنطینه","خریدار","تاریخ کشتار","تاریخ ثبت خودرو","مرغدار","محل کشتار","شهر","سن مرغ","راننده","ماشین","پلاک","نژاد","تعداد (قطعه)","میانگین وزن","وزن تقریبی بار (کیلوگرم)","عملیات"],data:p,paginated:!0})}),E==="archive"&&u.jsx(s,{xs:12,className:"avicultureActiveRequestsView",children:y?u.jsxs(s,{container:!0,xs:12,spacing:4,justifyContent:"space-between",children:[u.jsxs(s,{container:!0,alignItems:"center",gap:i.SMALL,justifyContent:"center",marginBottom:2,children:[u.jsx(s,{xs:12,children:u.jsx(r,{children:"بایگانی"})}),u.jsx(s,{children:u.jsx(L,{label:"از تاریخ",id:"date",renderInput:a=>u.jsx(f,{style:{width:"160px"},...a}),value:g,onChange:a=>{o(b(a).format("YYYY-MM-DD"))}})}),u.jsx(s,{children:u.jsx(L,{label:"تا تاریخ",id:"date",renderInput:a=>u.jsx(f,{style:{width:"160px"},...a}),value:v,onChange:a=>{t(b(a).format("YYYY-MM-DD"))}})})]}),T]}):u.jsx(au,{title:u.jsxs(s,{container:!0,alignItems:"center",gap:i.SMALL,mb:2,children:[u.jsx(s,{children:u.jsx(r,{children:"بایگانی"})}),u.jsx(s,{children:u.jsx(L,{label:"از تاریخ",id:"date",renderInput:a=>u.jsx(f,{style:{width:"160px"},...a}),value:g,onChange:a=>{o(b(a).format("YYYY-MM-DD"))}})}),u.jsx(s,{children:u.jsx(L,{label:"تا تاریخ",id:"date",renderInput:a=>u.jsx(f,{style:{width:"160px"},...a}),value:v,onChange:a=>{t(b(a).format("YYYY-MM-DD"))}})})]}),columns:["ردیف","کد بار","کدرهگیری سامانه قرنطینه","خریدار","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","سن مرغ","تعداد","راننده","ماشین","پلاک","نژاد","میانگین وزن","مشاهده"],data:A,paginated:!0})})]})})})},zu=()=>{const[l,C]=c.useState(),[p,w]=c.useState(!1),N=()=>{w(!p)},h=P(),{slaughterHouseComplaints:A}=z(t=>t.slaughterSlice),D=Su(),{slaughterHouseRegisteredComplaints:T}=z(t=>t.slaughterSlice);c.useEffect(()=>{h($()),h(bu()),h(Du()).then(t=>{h(K())})},[]),c.useEffect(()=>{const t=T==null?void 0:T.map((n,E)=>{var M,m;return[n.title,n.description?n.description:"بدون توضیحات",Tu(n==null?void 0:n.createDate),n.state==="pending"?"در حال بررسی":n.state==="accepted"?"تایید شده":"رد شده",n.percent,(M=n.image)!=null&&M.length?(m=n.image)==null?void 0:m.map((y,a)=>[u.jsx(s,{display:"inline-flex",children:u.jsx("a",{href:y,alt:"دانلود",children:u.jsx("img",{src:y,width:"80",height:"80",alt:"دانلود",style:{marginRight:"10px",borderRadius:"5px"}})})},`SlaughterPaymentFactorImage${a}`)]):"بدون پیوست"]});C(t)},[T]);const[F,g]=c.useState([]),[o,v]=c.useState([]);return c.useEffect(()=>{g(A==null?void 0:A.filter(t=>U(t.protestTime)>0)),v(A==null?void 0:A.filter(t=>U(t.protestTime)<1))},[A]),u.jsx(u.Fragment,{children:u.jsx(H,{display:"flex",justifyContent:"center",children:u.jsx(s,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsxs(s,{container:!0,justifyContent:"space-between",gap:i.SMALL,children:[u.jsxs(s,{xs:12,mt:i.MEDIUM,children:[u.jsxs(ju,{xs:12,expanded:p,onChange:N,children:[u.jsx(Fu,{expandIcon:u.jsx(vu,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:u.jsx(r,{children:"شکایات ثبت شده"})}),u.jsx(gu,{children:u.jsx(s,{children:u.jsx(Wu,{columns:[" موضوع"," توضیحات"," تاریخ ثبت"," وضعیت","درصد تلفات","پیوست تصویر"],data:l})})})]}),u.jsxs(s,{xs:12,mt:i.MEDIUM,children:[(F==null?void 0:F.length)>0&&u.jsx(d,{children:u.jsx(Z,{label:"بارهای تخصیص یافته"})}),F==null?void 0:F.map((t,n)=>{var a,S;let E=U(t.protestTime);const M=(a=t.cellType)!=null&&a.cash?"نقدی":null,m=(S=t==null?void 0:t.cellType)!=null&&S.credit?"زمان دار":null,y=[M,m].filter(B=>B).join(" یا ");return u.jsxs(u.Fragment,{children:[u.jsx(_,{name:"کد سفارش",columns:["کد سفارش","نام مرغدار","تلفن","تاریخ درخواست کشتار","استان","شهرستان","تاریخ جوجه ریزی","تعداد","جمع تلفات","وزن تقریبی هر مرغ","سن مرغ","نژاد","نحوه فروش"],data:[[t.orderCode,t.fullName,t.mobile,k(new Date(t==null?void 0:t.sendDate),"yyyy/MM/dd"),t.province,t.city,k(new Date(t==null?void 0:t.hatchingDate),"yyyy/MM/dd"),t.totalQuantity,t.losses,t.indexWeight,t.age,t.chickenBreed,y]]},n),u.jsx(_,{name:"خودروهای دارای کد بار",columns:["کشتارگاه","نام راننده","ماشین","نوع خرید","سند خودرو بدون بار","سند خودرو با بار","تعداد","وزن بار","میانگین وزن","مهلت ثبت شکایت","عملیات"],data:[[t.killHouse,t.driverName,t.car,t.buyType==="cash"?"نقد":"نسیه",u.jsx("a",{href:t.killHouseImageWithoutLoad,alt:"دانلود سند خودرو بدون بار",children:u.jsx("img",{src:t.killHouseImageWithoutLoad,width:"50",height:"50",alt:"بدون بار",className:"images-file"})},"provinceKillRequests"),u.jsx("a",{href:t.killHouseImageWithLoad,alt:"دانلود سند خودرو بدون بار",children:u.jsx("img",{src:t.killHouseImageWithLoad,width:"50",height:"50",alt:"بدون بار",className:"images-file"})},"provinceKillRequests"),t.killHouseRequestQuantity,t.killHouseNetWeight,Math.round(t.killHouseNetWeight/t.killHouseRequestQuantity*100)/100,u.jsx(Bu,{seconds:E},n),u.jsx(q,{disabled:E<1,className:"avicultureNewRequestBtn",variant:"contained",onClick:()=>{h(I({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت شکایت جدید",content:u.jsx(Yu,{barKey:t.killHouseAssignmentKey,role:D})}))},children:"ثبت شکایت"},"test"),t.averageWeight]]},n)]})})]})]}),u.jsxs(s,{xs:12,children:[(o==null?void 0:o.length)>0&&u.jsx(d,{children:u.jsx(Z,{label:"بارهای بایگانی شده"})}),o==null?void 0:o.map((t,n)=>{var y,a;const E=(y=t.cellType)!=null&&y.cash?"نقدی":null,M=(a=t==null?void 0:t.cellType)!=null&&a.credit?"زمان دار":null,m=[E,M].filter(S=>S).join(" یا ");return u.jsxs(u.Fragment,{children:[u.jsx(_,{name:"کد سفارش",columns:["کد سفارش","نام مرغدار","تلفن","تاریخ درخواست کشتار","استان","شهرستان","تاریخ جوجه ریزی","تعداد","جمع تلفات","وزن تقریبی هر مرغ","سن مرغ","نژاد","نحوه فروش"],data:[[t.orderCode,t.fullName,t.mobile,k(new Date(t==null?void 0:t.sendDate),"yyyy/MM/dd"),t.province,t.city,k(new Date(t==null?void 0:t.hatchingDate),"yyyy/MM/dd"),t.totalQuantity,t.losses,t.indexWeight,t.age,t.chickenBreed,m]]},n),u.jsx(_,{name:"خودروهای دارای کد بار",columns:["کشتارگاه","نام راننده","ماشین","نوع خرید","سند خودرو بدون بار","سند خودرو با بار","تعداد","وزن بار","میانگین وزن"],data:[[t.killHouse,t.driverName,t.car,t.buyType==="cash"?"نقد":"نسیه",u.jsx("a",{href:t.killHouseImageWithoutLoad,alt:"دانلود سند خودرو بدون بار",children:u.jsx("img",{src:t.killHouseImageWithoutLoad,width:"50",height:"50",alt:"بدون بار",className:"images-file"})},"provinceKillRequests"),u.jsx("a",{href:t.killHouseImageWithLoad,alt:"دانلود سند خودرو بدون بار",children:u.jsx("img",{src:t.killHouseImageWithLoad,width:"50",height:"50",alt:"بدون بار",className:"images-file"})},"provinceKillRequests"),t.killHouseRequestQuantity,t.killHouseNetWeight,Math.round(t.killHouseNetWeight/t.killHouseRequestQuantity*100)/100]]},n)]})})]})]})})})})},_6=()=>{const{pathname:l}=lu();return u.jsx(u.Fragment,{children:u.jsx(H,{display:"flex",justifyContent:"center",children:u.jsxs(s,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[l===Mu?u.jsxs(s,{justifyContent:"center",my:i.MEDIUM,children:[u.jsx(s,{children:u.jsx(r,{variant:"h6",children:"داشبورد (دامپزشک کشتارگاه)"})}),u.jsx(qu,{})]}):u.jsx(Iu,{}),u.jsx(s,{container:!0,justifyContent:"space-between",gap:i.SMALL,children:u.jsxs(s,{xs:12,children:[l===V&&u.jsx(Ou,{}),l===O&&u.jsx(Uu,{}),l===mu&&u.jsx(zu,{})]})})]})})})};export{_6 as default}; diff --git a/build/assets/SlaughterInventoryPage-CLOKxd-H.js b/build/assets/SlaughterInventoryPage-CLOKxd-H.js new file mode 100644 index 0000000..b583122 --- /dev/null +++ b/build/assets/SlaughterInventoryPage-CLOKxd-H.js @@ -0,0 +1 @@ +import{j as u,T as V,ag as $u,ah as Yu,ai as gu,aj as Su,ak as z,B as J,d as Du,I as wu,aX as u6,av as S6,aw as b6,ax as Vu,b0 as E6,b2 as e6,b3 as Iu,al as Hu,c9 as V6,an as H6,ao as Gu,b4 as Ku,ap as Qu,aq as Zu,b as Fu,aJ as U6,b1 as G6,aa as K6,am as Q6}from"./mui-vendor-CkIVaoQP.js";import{L as su,j as tu,h as ru,A as vu,u as Uu,c as Ru,b as ku,G as l,S as Q,C as c6,fH as _u,O as Wu,v as G,X as eu,p as ju,W as iu,N as du,fl as D6,jv as Z6,cq as qu,M as hu,fF as Xu,e8 as J6,dn as w6,dp as _6,fT as Ou,fI as X6,jw as m6,jx as u0,_ as L6,dh as T6,j9 as Ju,ju as e0,jy as i6,jz as a0,jA as d6,jB as t0,jC as C6,bT as h6,jD as g6,jE as p6,jt as r0,jF as n0}from"./index-CeyyVc1v.js";import{B as Eu}from"./BackButton-Crzr7NMa.js";import{r,f as s0}from"./react-vendor-CmFgShSM.js";import{a as a6,d as l0,S as o0}from"./SlaughterSellCarcass-D_Twt9ez.js";import{a as Nu,u as lu,f as Mu}from"./redux-vendor-B7uoacJt.js";import{R as cu}from"./ResponsiveTable-w7hk7Uq8.js";import{p as c0}from"./province-policy-drop-limit-BQ-Lqckd.js";import{d as i0}from"./Settings-BckUi175.js";import{R as Lu,a as k6}from"./index.esm-Bu7XMDZU.js";import{a as $6,b as d0,s as C0,c as I6,d as h0,v as g0,S as p0}from"./SlaughterFreeBuyBars-CobAAajK.js";import{S as R6}from"./ShowImage-CqhU2hmk.js";import{d as x0}from"./ToggleOffOutlined-Ch26Umk7.js";import{d as A0}from"./ToggleOn-pBgb8alR.js";import{d as f0}from"./SystemUpdateAlt-Bu3pObDi.js";import{C as W6}from"./ChechClearanceCode-lPasOZZ_.js";import{d as N6}from"./Tune-D4M2CAhp.js";import{d as B6}from"./Search-Dek2fED1.js";import{s as y0,a as F0,g as j0,b as v0,c as S0,S as b0,d as E0,e as D0,f as w0,h as _0,i as P6}from"./StewardSegmentOperation-B4ydd22p.js";import{s as L0,a as T0}from"./slaughter-get-provinces-CSWL-EuK.js";import{L as O6}from"./LabelField-B6eRSoQP.js";import{d as Y6}from"./Edit-CqBj1Y2L.js";import{s as x6}from"./slaughter-sell-carcass-out-province-BsZg6mNm.js";import{N as mu}from"./NumberFormatCustom-DwWPj40N.js";import{M as k0,S as $0}from"./SlaughterAllocateToGuild-Dfz5LRq5.js";import{s as M6,g as I0,a as R0}from"./steward-get-dashboard-service-CaN_8BvO.js";import{d as z6}from"./Delete-C5MyLelE.js";import{d as W0}from"./Send-CA1iNvJP.js";import{d as A6}from"./Info-CZK82--l.js";import{I as N0,f as B0}from"./toBase64-BzgTOHsW.js";import{d as P0}from"./Add--yVWBJhC.js";import{d as O0}from"./CheckCircle-zgBvZQ-b.js";import{a as Y0}from"./province-policy-upload-image-CRJ-U4Kc.js";import{d as M0}from"./Visibility-DeyjG-oI.js";import{a as z0}from"./SlaughterManageInventoryAllocationOperations-Bla8JB6Q.js";import{N as Bu}from"./NavLink-D2GD_ItM.js";import{L as Pu}from"./LinkItem-DT6qswcs.js";import"./guild-allocated-stock-operation-BiIjKHlL.js";import"./getProvinceName-BujSmyBy.js";import"./slaughter-get-guilds-for-allocate-B6OrhhMj.js";import"./Sms-DasNClAG.js";import"./getAllocationType-76F45b0K.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./iconBase-BEJYyZsk.js";import"./CarPelak-BYFY8OXg.js";import"./EditOutlined-n5ie2Fmu.js";import"./DeleteOutlineOutlined-G071NcE9.js";import"./Download-DQ-VVIaV.js";import"./Close-_jAEIgMD.js";import"./Pageview-TRcW_9jm.js";import"./AddCircleOutline-C8LXM-k8.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./CheckCircleOutline-Ci9-hVKX.js";const q0=Nu("SLAUGHTER_SUBMIT_REAL_INVENTORY",async(e,{dispatch:n})=>{n(su());try{const{data:a,status:E}=await tu.put("ware-house-accept-kill-house-request/0/",e);return n(ru()),{data:a,status:E}}catch(a){return n(ru()),{error:a.response.data.result}}}),V0=({item:e,updateTable:n})=>{var F,I,c;const[a,E]=r.useState("weight"),[h,f]=r.useState("0"),[x,D]=r.useState({min:0,max:100}),d=b=>{E(b.target.value)},[j,v]=r.useState(e!=null&&e.killer?"killer":"self"),Y=b=>{v(b.target.value)},[k]=r.useContext(vu),T=lu();r.useEffect(()=>{T(c0()).then(b=>{var p;(p=b.payload)!=null&&p.data&&D({min:parseFloat(b.payload.data.killHouseLimitPercentDown),max:parseFloat(b.payload.data.killHouseLimitPercentUp)})})},[]);const y=Uu({initialValues:{realNumber:e!=null&&e.acceptedRealQuantity?e==null?void 0:e.acceptedRealQuantity:"",realWeight:e!=null&&e.wareHouseAcceptedRealWeight?e==null?void 0:e.wareHouseAcceptedRealWeight:0},validationSchema:Ru({realNumber:ku().typeError("لطفا فیلد را به درستی وارد کنید.!").required("این فیلد اجباری است!").min(0,"مقدار نمی‌تواند منفی باشد"),realWeight:ku().typeError("لطفا فیلد را به درستی وارد کنید.!").required("این فیلد اجباری است!").min(0,"مقدار نمی‌تواند منفی باشد")})}),w=Uu({initialValues:{lossWeight:""},validationSchema:Ru({lossWeight:ku().typeError("لطفا فیلد را به درستی وارد کنید.!").required("این فیلد اجباری است!").min(x.min,`درصد افت باید بین ${x.min} تا ${x.max} درصد باشد!`).max(x.max,`درصد افت باید بین ${x.min} تا ${x.max} درصد باشد!`)})});r.useEffect(()=>{if(a==="weight")if(e!=null&&e.acceptedRealWeight&&y.values.realWeight){const p=(e.acceptedRealWeight-y.values.realWeight)/e.acceptedRealWeight*100;f(p.toFixed(2))}else f(0);else if(e!=null&&e.acceptedRealWeight&&w.values.lossWeight){const b=e.acceptedRealWeight/100*w.values.lossWeight;f((e.acceptedRealWeight-b).toFixed(2))}else f(0)},[y.values.realWeight,w.values.lossWeight,a,e]);const B=()=>a==="weight"?h>=x.min&&h<=x.max:w.isValid,M=()=>a==="weight"?y.isValid&&B():w.isValid,L=()=>{if(!M())return;const b=a==="weight"?{input_type:"input_weight",ware_house_accepted_real_quantity:parseInt(y.values.realNumber),ware_house_accepted_real_weight:parseInt(y.values.realWeight),kill_house_request_key:e==null?void 0:e.key,loss_percent:parseFloat(h)}:{input_type:"loss_weight",loss_percent:parseInt(w.values.lossWeight),kill_house_request_key:e==null?void 0:e.key};T(q0({...b,...e!=null&&e.killer?{input_warehouse:j}:{}})).then(p=>{p.payload.error?k({vertical:"top",horizontal:"center",msg:p.payload.error,severity:"error"}):(T(c6()),n(),T(_u()),g())})},g=()=>{T(Wu({title:"عملیات با موفقیت انجام شد",content:u.jsx(u.Fragment,{children:u.jsxs(l,{container:!0,gap:Q.SMALL,justifyContent:"center",children:[u.jsx(V,{variant:"body2",color:"secondary",children:"جهت ویرایش میتوانید حداکثر تا پایان امروز یا قبل از اولین تخصیص اقدام کنید."}),u.jsx(J,{variant:"outlined",onClick:()=>{T(c6())},children:"متوجه شدم"})]})})}))};return u.jsx(u.Fragment,{children:u.jsxs(l,{xs:12,container:!0,spacing:Q.SMALL,alignItems:"center",justifyContent:"center",children:[u.jsxs(l,{container:!0,xs:12,gap:Q.TINY,children:[u.jsxs(l,{container:!0,xs:12,gap:Q.SMALL,justifyContent:"center",children:[(e==null?void 0:e.killer)&&u.jsxs(V,{color:"primary",variant:"body2",children:["کشتارکن: ",(F=e==null?void 0:e.killer)==null?void 0:F.name]}),u.jsxs(V,{color:"primary",variant:"body2",children:["کد بار: ",e.barCode]}),u.jsxs(V,{color:"primary",variant:"body2",children:["حجم بار: ",(I=e==null?void 0:e.acceptedRealQuantity)==null?void 0:I.toLocaleString()]}),u.jsxs(V,{color:"primary",variant:"body2",children:["وزن بار: ",(c=e==null?void 0:e.acceptedRealWeight)==null?void 0:c.toLocaleString()]})]}),u.jsx($u,{children:u.jsxs(Yu,{"aria-labelledby":"demo-radio-buttons-group-label",defaultValue:"بر اساس وزن ورودی",name:"radio-buttons-group",value:a,onChange:d,row:!0,children:[u.jsx(gu,{value:"weight",control:u.jsx(Su,{}),label:"بر اساس وزن ورودی"}),u.jsx(gu,{value:"loss",control:u.jsx(Su,{}),label:"بر اساس درصد افت"})]})}),a==="weight"?u.jsxs(u.Fragment,{children:[u.jsx(z,{fullWidth:!0,id:"realWeight",size:"small",label:"وزن لاشه",variant:"outlined",value:y.values.realWeight,error:y.touched.realWeight?!!y.errors.realWeight:null,onChange:y.handleChange,onBlur:y.handleBlur,helperText:y.touched.realWeight&&y.errors.realWeight?y.errors.realWeight:null}),u.jsx(z,{fullWidth:!0,id:"realNumber",size:"small",label:"حجم لاشه",variant:"outlined",value:y.values.realNumber,error:y.touched.realNumber?!!y.errors.realNumber:null,onChange:y.handleChange,onBlur:y.handleBlur,helperText:y.touched.realNumber&&y.errors.realNumber?y.errors.realNumber:null})]}):u.jsx(z,{fullWidth:!0,id:"lossWeight",size:"small",label:"درصد افت",variant:"outlined",value:w.values.lossWeight,error:w.touched.lossWeight?!!w.errors.lossWeight:null,onChange:w.handleChange,onBlur:w.handleBlur,helperText:w.touched.lossWeight&&w.errors.lossWeight?w.errors.lossWeight:null})]}),(e==null?void 0:e.killer)&&u.jsx(l,{mt:2,xs:12,container:!0,justifyContent:"start",p:1,sx:{borderStyle:"solid",borderWidth:"1px",borderColor:"red",borderRadius:"15px"},children:u.jsx($u,{children:u.jsxs(Yu,{"aria-labelledby":"demo-radio-buttons-group-label",defaultValue:j,name:"radio-buttons-group",value:j,onChange:Y,row:!0,children:[u.jsx(gu,{value:"self",control:u.jsx(Su,{color:"error"}),label:"ورود به انبار کشتارگاه"}),u.jsx(gu,{value:"killer",control:u.jsx(Su,{color:"error"}),label:"ورود به انبار کشتارکن"})]})})}),u.jsxs(l,{container:!0,xs:12,gap:4,alignItems:"center",mt:2,justifyContent:"space-between",children:[u.jsx(l,{children:a==="weight"?u.jsxs(l,{container:!0,gap:2,alignItems:"center",children:[u.jsxs(V,{variant:"body1",color:"primary",children:["افت: ",h>0?h:0,"%"]}),!B()&&u.jsxs(V,{variant:"body2",color:"error",children:["درصد افت باید بین ",x.min," تا ",x.max," درصد باشد!"]})]}):u.jsxs(V,{variant:"body1",color:"primary",children:["وزن: ",h]})}),u.jsx(l,{children:u.jsx(J,{disabled:!M(),size:"small",variant:"outlined",onClick:L,children:"ثبت"})})]})]})})},f6=({type:e})=>{const[n,a]=r.useState(G(new Date).format("YYYY-MM-DD")),[E,h]=r.useState(G(new Date).format("YYYY-MM-DD")),f=lu(),x=P=>{B(P.target.value)},[D,d]=r.useState(e==="entered"),[j,v]=r.useState([]),[Y,k]=r.useState(0),[T,y]=r.useState(10),[w,B]=r.useState(""),[M,L]=r.useState(1),[g,F]=r.useState([]),[I,c]=r.useState("all"),b=r.useCallback(async P=>{f(su());const o=await tu.get(`bars_for_kill_house/?search=filter&value=${w}&role=${eu()}${D?`&date1=${n}&date2=${E}`:""}&page=${P}&page_size=${T}&type=${e}"a=${I}`);f(ru()),v(o.data.results),k(o.data.count)},[w,D,n,E,T,e,I,f,v,k]),p=P=>{b(P),L(P)},t=P=>{y(P),L(1)},q=()=>{b(M!==0?M:1)};r.useEffect(()=>{const P=j==null?void 0:j.map((o,_)=>{var s,i,Z,A,$,H,au,K,X,m,ou,uu,S,C,N,U,O,R,Cu,pu,xu,Au,fu,yu,nu,bu,Tu,zu,t6,r6,n6,s6,l6,o6;return[M===1?_+1:_+T*(M-1)+1,o==null?void 0:o.barCode,ju((s=o==null?void 0:o.poultryRequest)==null?void 0:s.date),`${(i=o==null?void 0:o.poultryRequest)==null?void 0:i.poultryName} (${(Z=o==null?void 0:o.poultryRequest)==null?void 0:Z.poultryMobile}) - ${(A=o==null?void 0:o.poultryRequest)==null?void 0:A.poultryUserName}`,($=o==null?void 0:o.poultryRequest)==null?void 0:$.poultryCity,`${(H=o==null?void 0:o.killhouseUser)!=null&&H.killer?"کشتارکن":"کشتارگاه"} ${(au=o==null?void 0:o.killhouseUser)==null?void 0:au.name} (${(m=(X=(K=o==null?void 0:o.killhouseUser)==null?void 0:K.killHouseOperator)==null?void 0:X.user)==null?void 0:m.mobile})`,(ou=o==null?void 0:o.poultryRequest)==null?void 0:ou.poultryReqOrderCode,o!=null&&o.freezing?"انجماد":o!=null&&o.export?"صادرات":"عادی",o!=null&&o.killer?`${(uu=o==null?void 0:o.killer)==null?void 0:uu.name} (${(N=(C=(S=o==null?void 0:o.killer)==null?void 0:S.killHouseOperator)==null?void 0:C.user)==null?void 0:N.mobile})`:"-",(U=o==null?void 0:o.poultryRequest)!=null&&U.freeSaleInProvince?"آزاد":"دولتی",(O=o==null?void 0:o.poultryRequest)==null?void 0:O.chickenBreed,`${(Cu=(R=o==null?void 0:o.addCar)==null?void 0:R.driver)==null?void 0:Cu.driverName}/${(xu=(pu=o==null?void 0:o.addCar)==null?void 0:pu.driver)==null?void 0:xu.typeCar}`,(fu=(Au=o==null?void 0:o.addCar)==null?void 0:Au.driver)!=null&&fu.healthCode?(nu=(yu=o==null?void 0:o.addCar)==null?void 0:yu.driver)==null?void 0:nu.healthCode:"-",o!=null&&o.clearanceCode?o==null?void 0:o.clearanceCode:"-",(bu=o==null?void 0:o.acceptedRealQuantity)==null?void 0:bu.toLocaleString(),(Tu=o==null?void 0:o.acceptedRealWeight)==null?void 0:Tu.toLocaleString(),(zu=o==null?void 0:o.weightInfo)==null?void 0:zu.state,o==null?void 0:o.wareHouseAcceptedRealQuantity.toLocaleString(),o==null?void 0:o.wareHouseAcceptedRealWeight.toLocaleString(),(t6=o==null?void 0:o.weightInfo)!=null&&t6.weightLoss?((n6=(r6=o==null?void 0:o.weightInfo)==null?void 0:r6.weightLoss)==null?void 0:n6.toFixed(2))+"%":"0%",(s6=o==null?void 0:o.weightInfo)!=null&&s6.inputLoss?((o6=(l6=o==null?void 0:o.weightInfo)==null?void 0:l6.inputLoss)==null?void 0:o6.toFixed(2))+"%":"0%",o!=null&&o.dateOfWareHouse?ju(o==null?void 0:o.dateOfWareHouse):"-",u.jsx(Du,{title:"ورود بار به انبار",children:u.jsx(wu,{size:"small",color:"primary",onClick:()=>{f(Wu({title:"ثبت موجودی واقعی",content:u.jsx(V0,{updateTable:q,item:o})}))},children:u.jsx(i0,{fontSize:"small"})})},_)]});F(P)},[j]),r.useEffect(()=>{b(1)},[b]);const W=async P=>{P.preventDefault(),f(su());try{const o=await tu.get(`bars_for_kill_house/?role=${eu()}&search=filter&value=${w}${D?`&date1=${n}&date2=${E}`:""}&page=1&page_size=${T}&type=${e}"a=${I}`);v(o.data.results),k(o.data.count),f(ru())}catch(o){console.error("Error fetching data:",o)}};return u.jsxs(l,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(l,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsxs(l,{container:!0,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},children:[e==="notentered"&&u.jsx(l,{children:u.jsx(gu,{control:u.jsx(u6,{checked:D,onChange:()=>d(!D),color:"primary"})})}),u.jsx(l,{children:u.jsx(iu,{disabled:!D,label:"از تاریخ",id:"date",renderInput:P=>u.jsx(z,{size:"small",style:{width:"160px"},...P}),value:n,onChange:P=>{a(G(P).format("YYYY-MM-DD"))}})}),u.jsx(l,{children:u.jsx(iu,{disabled:!D,label:"تا تاریخ",id:"date",renderInput:P=>u.jsx(z,{size:"small",style:{width:"160px"},...P}),value:E,onChange:P=>{h(G(P).format("YYYY-MM-DD"))}})})]}),u.jsx(l,{children:u.jsxs($u,{size:"small",style:{minWidth:150},children:[u.jsx(S6,{children:"نوع فروش"}),u.jsxs(b6,{value:I,onChange:P=>c(P.target.value),label:"نوع فروش",children:[u.jsx(Vu,{value:"all",children:"همه"}),u.jsx(Vu,{value:"governmental",children:"دولتی"}),u.jsx(Vu,{value:"free",children:"آزاد"})]})]})}),u.jsx(l,{children:u.jsxs("form",{onSubmit:W,children:[u.jsx(z,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:x}),u.jsx(J,{type:"submit",onClick:W,endIcon:u.jsx(Lu,{}),children:"جستجو"})]})})]}),u.jsx(cu,{data:g,columns:["ردیف","کدبار","تاریخ کشتار","مرغدار","شهر مرغدار","خریدار","کدسفارش","کشتار","کشتارکن","فروش","نژاد","راننده/نوع خودرو","کدبهداشتی حمل و نقل","کدرهگیری سامانه قرنطینه","حجم بار (قطعه)","وزن بار (کیلوگرم)","وضعیت","حجم لاشه","وزن لاشه","درصد افت در لحظه","درصد افت ورود به انبار","تاریخ ورود به انبار","عملیات"],handlePageChange:p,totalRows:Y,page:M,perPage:T,handlePerRowsChange:t,title:e==="entered"?"وارد شده به انبار (کشتار داخل استان)":"در انتظار ورود به انبار (کشتار داخل استان)"})]})},H0=({item:e,updateTable:n,barState:a,type:E})=>{const h=lu(),[f,x]=r.useState(null),D=T=>{x(T.currentTarget)},d=()=>{x(null)},j=!!f,v=j?"popover":void 0,Y=()=>E==="carcass"||(e==null?void 0:e.buyType)!=="live"?!0:!a&&!e.weightOfCarcasses,k=(e==null?void 0:e.registerType)==="automatic"?!1:e.weightOfCarcasses&&!a&&(e==null?void 0:e.buyType)==="live";return u.jsxs("div",{children:[u.jsx(wu,{disabled:k,"aria-describedby":v,variant:"contained",color:"primary",onClick:D,children:u.jsx(N6,{})}),u.jsx(E6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:v,open:j,anchorEl:f,onClose:d,children:u.jsx("div",{style:{padding:"20px"},children:u.jsxs(l,{container:!0,direction:"column",children:[a==="entered"&&(e==null?void 0:e.registerType)==="automatic"&&u.jsx(J,{onClick:()=>{d(),h(du({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ویرایش بار آزاد",content:u.jsx($6,{item:e,updateTable:n})}))},children:"ویرایش"}),(a==="entered"?(e==null?void 0:e.registerType)!=="automatic":!0)&&u.jsx(J,{onClick:()=>{d(),h(Wu({title:"ثبت اطلاعات لاشه ورودی به انبار",content:u.jsx(d0,{item:e,updateTable:n,IsEdit:a==="entered"})}))},children:a==="entered"?"ویرایش":"ورود به انبار"}),Y()&&(e==null?void 0:e.registerType)!=="automatic"&&u.jsx(J,{color:"error",onClick:()=>{d(),h(C0(e.key)).then(()=>{n(),h(_u())})},children:"حذف"})]})})})]})},y6=({title:e,barState:n,fetchDashboardData:a,withDate:E,selectedDate1:h,selectedDate2:f,searchValue:x})=>{const D=lu(),[d]=r.useContext(vu);r.useEffect(()=>{D(D6())},[]);const[j,v]=r.useState([]),[Y,k]=r.useState(0),[T,y]=r.useState(10),[w,B]=r.useState(1),[M,L]=r.useState([]),g=async p=>{let t;D(su());try{t=await tu.get(`kill_house_free_bar/?type=live&role=${eu()}&page=${p}&page_size=${T}&bar_state=${n}&date_type=input${E?`&date1=${h}&date2=${f}`:""}${x?`&search=filter&value=${x}`:""}`),v(t.data.results),k(t.data.count)}catch(q){console.error("Error fetching data:",q)}finally{D(ru())}},F=p=>{g(p),B(p)},I=p=>{y(p),B(1)},c=()=>{g(w!==0?w:1),a()};r.useEffect(()=>{g(1)},[T,E,h,f,x]),r.useEffect(()=>{const p=j==null?void 0:j.map((t,q)=>{var W,P,o,_,s,i,Z,A;return[w===1?q+1:q+T*(w-1)+1,(t==null?void 0:t.barCode)||"-",(t==null?void 0:t.registerType)==="automatic"?"سیستمی":"دستی",ju(t.createDate),`${(W=t==null?void 0:t.killHouse)==null?void 0:W.name} (${(_=(o=(P=t==null?void 0:t.killHouse)==null?void 0:P.killHouseOperator)==null?void 0:o.user)==null?void 0:_.mobile})`,t!=null&&t.exclusiveKiller?`${(s=t==null?void 0:t.exclusiveKiller)==null?void 0:s.name} (${(A=(Z=(i=t==null?void 0:t.exclusiveKiller)==null?void 0:i.killHouseOperator)==null?void 0:Z.user)==null?void 0:A.mobile})`:"-",t.buyType==="live"?"مرغ زنده":"لاشه",t.poultryName,`${t.province}/${t.city}`,u.jsx(W6,{clearanceCode:t.barClearanceCode},q),t.quantity.toLocaleString(),t.liveWeight.toLocaleString(),ju(t.date),t.numberOfCarcasses.toLocaleString(),t.weightOfCarcasses.toLocaleString(),t!=null&&t.weightLoss?(t==null?void 0:t.weightLoss)+"%":"-",u.jsx(R6,{src:t.barImage},q),u.jsx(u.Fragment,{children:eu()==="KillHouse"?u.jsx(H0,{item:t,inventoryKey:t==null?void 0:t.key,updateTable:c,barState:n},t.key):u.jsx(J,{variant:"outlined",disabled:(t==null?void 0:t.killHouseVetState)!=="pending",size:"small",onClick:()=>{D(Wu({title:"تایید / رد",content:u.jsx(I6,{item:t,updateTable:c})}))},children:"تایید / رد"})})]});L(p)},[j,w,T]);const b=Mu(p=>p.userSlice.userProfile.key);return u.jsx(l,{container:!0,justifyContent:"flex-end",mt:2,mb:2,children:u.jsx(l,{container:!0,mt:Q.MEDIUM,alignItems:"end",gap:2,justifyContent:"flex-end",children:u.jsx(cu,{operation:u.jsx(l,{children:u.jsx(Du,{title:"خروجی اکسل",placement:"top",children:u.jsx(wu,{color:"primary",onClick:()=>{d({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const p=`${tu.defaults.baseURL}kill_house_free_bar_excel/?role=${eu()}&key=${b}&type=live&bar_state=${n}${E?`&date1=${h}&date2=${f}`:""}`;window.location.href=p},children:u.jsx(f0,{})})})}),data:M,columns:["ردیف","کد بار","نوع بار","تاریخ خرید","خریدار","کشتارکن","محصول","فروشنده","استان/شهر","کدقرنطینه","حجم زنده","وزن زنده (کیلوگرم)","تاریخ ورود به انبار","حجم لاشه","وزن لاشه (کیلوگرم)","درصد افت","بارنامه","عملیات"],handlePageChange:F,totalRows:Y,page:w,perPage:T,handlePerRowsChange:I,title:e})})})},U0=()=>{var A,$,H,au,K,X,m,ou,uu,S,C,N,U;const e=lu(),[n,a]=r.useState(0),E=(O,R)=>{a(R)},[,,h,f,x,D]=r.useContext(vu);r.useEffect(()=>{const O=G(new Date).format("YYYY-MM-DD");f(O),D(O)},[]);const d=O=>{B(O.target.value)};r.useEffect(()=>{e(D6())},[]);const[j,v]=r.useState([]),[Y,k]=r.useState(0),[T,y]=r.useState(10),[w,B]=r.useState(""),[M,L]=r.useState(1),[g,F]=r.useState([]),[I,c]=r.useState(!1),[b,p]=r.useState(""),t=async O=>{let R;e(su()),R=await tu.get(`kill_house_free_bar/?type=${n===0?"live":"carcass"}&dashboard=true&search=filter&value=${b}&role=${eu()}${I?`&date1=${h}&date2=${x}`:""}&page=${O}&page_size=${T}&date_type=input`),e(ru()),v(R.data.results),k(R.data.count)},q=O=>{t(O),L(O)},W=O=>{y(O),L(1)},P=()=>{t(M!==0?M:1),o()},o=()=>{e(g0({search:"filter",role:eu(),value:b,type:n===0?"live":"carcass",...I&&{date1:h,date2:x}})).then(O=>{Z(O.payload.data)})};r.useEffect(()=>{t(M!==0?M:1),o()},[I,h,x,T,n,b]),r.useEffect(()=>{const O=j==null?void 0:j.map((R,Cu)=>{var pu,xu,Au,fu,yu,nu,bu,Tu;return[M===1?Cu+1:Cu+T*(M-1)+1,(R==null?void 0:R.barCode)||"-",ju(R.createDate),`${(pu=R==null?void 0:R.killHouse)==null?void 0:pu.name} (${(fu=(Au=(xu=R==null?void 0:R.killHouse)==null?void 0:xu.killHouseOperator)==null?void 0:Au.user)==null?void 0:fu.mobile})`,R!=null&&R.exclusiveKiller?`${(yu=R==null?void 0:R.exclusiveKiller)==null?void 0:yu.name} (${(Tu=(bu=(nu=R==null?void 0:R.exclusiveKiller)==null?void 0:nu.killHouseOperator)==null?void 0:bu.user)==null?void 0:Tu.mobile})`:"-",R.buyType==="live"?"مرغ زنده":"لاشه",R.poultryName,`${R.province}/${R.city}`,R.barClearanceCode,R.numberOfCarcasses.toLocaleString(),R.weightOfCarcasses.toLocaleString(),u.jsx(R6,{src:R.barImage},Cu),u.jsx(u.Fragment,{children:eu()==="KillHouse"?u.jsx(h0,{item:R,inventoryKey:R==null?void 0:R.key,updateTable:P,type:"carcass"},R.key):u.jsx(J,{variant:"outlined",disabled:(R==null?void 0:R.killHouseVetState)!=="pending",size:"small",onClick:()=>{e(Wu({title:"تایید / رد",content:u.jsx(I6,{item:R,updateTable:P})}))},children:"تایید / رد"})})]});F(O)},[j]);const _=async O=>{O.preventDefault(),p(w)},s=Mu(O=>O.userSlice.userProfile.key),[i,Z]=r.useState([]);return u.jsxs(l,{container:!0,direction:"column",flexWrap:"nowrap",children:[u.jsx(l,{container:!0,justifyContent:"center",alignItems:"center",children:u.jsxs(e6,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:n,onChange:E,children:[u.jsx(Iu,{label:"زنده"}),u.jsx(Iu,{label:"لاشه"})]})}),n===0&&u.jsx(l,{mt:2,container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:u.jsxs(l,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(u6,{icon:u.jsx(x0,{}),checkedIcon:u.jsx(A0,{}),checked:I,onChange:()=>{c(!I),t(1)},color:"primary",size:"large"}),u.jsx(l,{children:u.jsx(iu,{disabled:!I,label:"از تاریخ",id:"date",renderInput:O=>u.jsx(z,{size:"small",style:{width:"160px"},...O}),value:h,onChange:O=>{f(G(O).format("YYYY-MM-DD"))}})}),u.jsx(l,{children:u.jsx(iu,{disabled:!I,label:"تا تاریخ",id:"date",renderInput:O=>u.jsx(z,{size:"small",style:{width:"160px"},...O}),value:x,onChange:O=>{D(G(O).format("YYYY-MM-DD"))}})}),u.jsx(l,{children:u.jsxs("form",{onSubmit:_,children:[u.jsx(z,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},value:w,onChange:d}),u.jsx(J,{type:"submit",onClick:_,endIcon:u.jsx(Lu,{}),children:"جستجو"})]})})]})}),u.jsxs(l,{container:!0,mt:Q.MEDIUM,alignItems:"center",justifyContent:"center",gap:2,children:[u.jsx(l,{container:!0,alignItems:"center",gap:Q.SMALL,justifyContent:"start",xs:12,children:u.jsx(J,{variant:"contained",onClick:()=>{e(du({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت اطلاعات خرید",content:u.jsx($6,{inventoryKey:"slaughterGetInventoryStockData?.key",selectedDate:h,updateTable:P})}))},children:"ثبت اطلاعات خرید"})}),u.jsx(l,{container:!0,mb:4,isDashboard:!0,children:n===0?u.jsx(cu,{noPagination:!0,columns:["تعداد کل بارهای زنده","حجم کل بارهای زنده","وزن کل بارهای زنده","تعداد کل بارها وارد شده به انبار","حجم کل بارهای زنده وارد شده به انبار","وزن کل بارهای زنده وارد شده به انبار","وزن لاشه بارهای وارد شده به انبار","تعداد کل بارها وارد نشده به انبار","حجم کل بارهای زنده وارد نشده به انبار","وزن کل بارهای زنده وارد نشده به انبار"],data:[[(A=i==null?void 0:i.totalBars)==null?void 0:A.toLocaleString(),($=i==null?void 0:i.totalBarsQuantity)==null?void 0:$.toLocaleString(),(H=i==null?void 0:i.totalBarsLiveWeight)==null?void 0:H.toLocaleString(),(au=i==null?void 0:i.enteredTotalBars)==null?void 0:au.toLocaleString(),(K=i==null?void 0:i.enteredTotalBarsQuantity)==null?void 0:K.toLocaleString(),(X=i==null?void 0:i.enteredTotalBarsLiveWeight)==null?void 0:X.toLocaleString(),(m=i==null?void 0:i.enteredTotalBarsWeightOfCarcasses)==null?void 0:m.toLocaleString(),(ou=i==null?void 0:i.notEnteredTotalBars)==null?void 0:ou.toLocaleString(),(uu=i==null?void 0:i.notEnteredTotalBarsQuantity)==null?void 0:uu.toLocaleString(),(S=i==null?void 0:i.notEnteredTotalBarsLiveWeight)==null?void 0:S.toLocaleString()]],customColors:[{name:"وزن لاشه بارهای وارد شده به انبار",color:"green"}],title:"خلاصه اطلاعات"}):u.jsx(cu,{noPagination:!0,isDashboard:!0,columns:["تعداد کل بارها","حجم لاشه","وزن لاشه"],data:[[(C=i==null?void 0:i.totalBars)==null?void 0:C.toLocaleString(),(N=i==null?void 0:i.totalBarsNumberOfCarcasses)==null?void 0:N.toLocaleString(),(U=i==null?void 0:i.totalBarsWeightOfCarcasses)==null?void 0:U.toLocaleString()]],title:"خلاصه اطلاعات"})}),n===0?u.jsxs(u.Fragment,{children:[u.jsx(y6,{title:"بار زنده در انتظار ورود به انبار (خارج استان)",barState:"notentered",fetchDashboardData:o,searchValue:b,withDate:I,selectedDate1:h,selectedDate2:x}),u.jsx(y6,{title:"بار زنده وارد شده به انبار (خارج استان)",barState:"entered",fetchDashboardData:o,searchValue:b,withDate:I,selectedDate1:h,selectedDate2:x})]}):u.jsxs(u.Fragment,{children:[u.jsx("form",{onSubmit:_,children:u.jsxs(l,{container:!0,alignItems:"center",gap:Q.SMALL,children:[u.jsx(z,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},value:w,onChange:d}),u.jsx(J,{type:"submit",onClick:_,endIcon:u.jsx(Lu,{}),children:"جستجو"}),u.jsx(l,{children:u.jsx(iu,{label:"از تاریخ",id:"date",renderInput:O=>u.jsx(z,{style:{width:"160px"},...O}),value:h,onChange:O=>{f(G(O).format("YYYY-MM-DD"))},disabled:!I})}),u.jsx(l,{children:u.jsx(iu,{label:"تا تاریخ",id:"date",renderInput:O=>u.jsx(z,{style:{width:"160px"},...O}),value:x,onChange:O=>{D(G(O).format("YYYY-MM-DD"))},disabled:!I})}),u.jsx(Du,{title:"خروجی اکسل",children:u.jsx(J,{color:"success",onClick:()=>{const O=`${tu.defaults.baseURL}kill_house_free_bar_excel/?role=${eu()}&key=${s}${I?`&date1=${h}&date2=${x}`:""}&type=${n===0?"live":"carcass"}&search=filter&value=${b}&date_type=input`;window.location.href=O},children:u.jsx(k6,{size:32})})})]})}),u.jsx(cu,{data:g,columns:["ردیف","کد بار","تاریخ خرید","خریدار","کشتارکن","محصول","فروشنده","استان/شهر","کدقرنطینه","حجم لاشه","وزن لاشه (کیلوگرم)","بارنامه","عملیات"],handlePageChange:q,totalRows:Y,page:M,perPage:T,handlePerRowsChange:W,title:"بار لاشه خرید خارج استان"})]})]})]})},G0=()=>{var x,D,d,j,v,Y,k,T,y,w;const[e,n]=r.useState("0"),[a,E]=r.useState([]),h=(B,M)=>{n(M)},f=lu();return r.useEffect(()=>{f(Z6()).then(B=>{E(B.payload.data)})},[f]),u.jsxs(l,{container:!0,xs:12,justifyContent:"end",alignItems:"center",children:[u.jsx(l,{container:!0,width:"100%",isDashboard:!0,children:u.jsx(a6,{})}),u.jsx(l,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mt:2,children:u.jsxs(e6,{value:e,onChange:h,textColor:"secondary",indicatorColor:"secondary","aria-label":"secondary tabs example",children:[u.jsx(Iu,{value:"0",label:"بارهای داخل استان"}),u.jsx(Iu,{value:"1",label:"خریدهای خارج استان"})]})}),e==="0"&&u.jsx(l,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsxs(l,{container:!0,justifyContent:"start",alignItems:"center",xs:12,children:[u.jsx(cu,{title:"اطلاعات کلی بارها",noPagination:!0,data:[[(x=a==null?void 0:a.totalBars)==null?void 0:x.toLocaleString(),(D=a==null?void 0:a.totalBarsQuantity)==null?void 0:D.toLocaleString(),(d=a==null?void 0:a.totalBarsWeight)==null?void 0:d.toLocaleString(),(j=a==null?void 0:a.totalEnteredBars)==null?void 0:j.toLocaleString(),(v=a==null?void 0:a.totalEnteredBarsWeight)==null?void 0:v.toLocaleString(),(Y=a==null?void 0:a.totalEnteredBarsCarcasses)==null?void 0:Y.toLocaleString(),(k=a==null?void 0:a.totalEnteredBarsCarcassesWeight)==null?void 0:k.toLocaleString(),(T=a==null?void 0:a.totalNotEnteredBars)==null?void 0:T.toLocaleString(),(y=a==null?void 0:a.totalNotEnteredBarsQuantity)==null?void 0:y.toLocaleString(),(w=a==null?void 0:a.totalNotEnteredKillHouseRequestsWeight)==null?void 0:w.toLocaleString()]],columns:["تعداد کل بارها","حجم کل بارها (قطعه)","وزن کل بارها (کیلوگرم)","تعداد کل بارهای وارد شده","وزن کل بارهای وارد شده","حجم کل لاشه وارد شده (قطعه)","وزن کل لاشه وارد شده (کیلوگرم)","تعداد کل بارهای وارد نشده","حجم کل بار وارد نشده (قطعه)","وزن کل بار وارد نشده (کیلوگرم)"],allColors:{color:"#f3bda3",text:"#332a3d"}}),u.jsx(l,{container:!0,mt:Q.MEDIUM,mb:Q.MEDIUM,children:u.jsx(f6,{type:"notentered"})}),u.jsx(l,{container:!0,mt:Q.MEDIUM,mb:Q.MEDIUM,children:u.jsx(f6,{type:"entered"})})]})}),e==="1"&&u.jsx(l,{container:!0,mt:Q.MEDIUM,mb:Q.MEDIUM,children:u.jsx(U0,{})})]})},K0=()=>u.jsx(l,{container:!0,alignItems:"center",justifyContent:"center",direction:"column",xs:12,children:u.jsx(G0,{})}),F6=Nu("PROVINCE_GET_NATIONAL_DOCUMENTS_SERVICE",async(e,{dispatch:n})=>{var a,E,h;n(su());try{const{data:f,status:x}=await tu.get(`https://pay.rasadyar.com/national-documents?info=${e.info}&type=${e.type}`,{timeout:3e4});return n(ru()),{data:f,status:x}}catch(f){if(n(ru()),f.code==="ECONNABORTED"||f.message.includes("timeout"))return qu("زمان درخواست به پایان رسید. لطفا دوباره تلاش کنید.","error"),{error:"زمان درخواست به پایان رسید. لطفا دوباره تلاش کنید."};if(((a=f.response)==null?void 0:a.status)===500)return qu("خطای سرور رخ داده است. لطفا بعدا تلاش کنید.","error"),{error:"خطای سرور رخ داده است. لطفا بعدا تلاش کنید."};if(!f.response)return qu("خطا در برقراری ارتباط با سرور. لطفا اتصال اینترنت خود را بررسی کنید.","error"),{error:"خطا در برقراری ارتباط با سرور. لطفا اتصال اینترنت خود را بررسی کنید."};const x=((h=(E=f.response)==null?void 0:E.data)==null?void 0:h.result)||"خطا در دریافت اطلاعات";return qu(x,"error"),{error:x}}}),Q0=(e,n)=>{if(!e||typeof e!="string"||!n||n.length===0)return"";const a=e.replace(/\u200c/g," ").replace(/\s+/g," ").trim(),h=a.split(/\s+/).slice(0,2).join(" "),f=n.find(x=>{const D=x.name||"";return D.includes(h)||h.includes(D)||a.includes(D)});return f?f.name:""},j6=({updateTable:e,isEdit:n,data:a,defaultPersonType:E,defaultNationalCode:h})=>{const[f]=r.useContext(vu),[x,D]=r.useState(null),[d,j]=r.useState(!1),[v,Y]=r.useState(!1),[k,T]=r.useState({}),y=lu(),[w,B]=r.useState([]),[M,L]=r.useState([]),g=Uu({initialValues:{mobile:"",firstName:"",lastName:"",unitName:"",province:"",city:"",nationalId:""},validationSchema:Ru({mobile:hu().required("این فیلد اجباری است!").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),firstName:hu().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),lastName:hu().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),unitName:hu().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),province:hu().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),city:hu().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),nationalId:hu().required("این فیلد اجباری است!").matches(/^\d{10,11}$/,"شناسه باید 10 یا 11 رقم و فقط عدد باشد")}),validateOnMount:!0}),F=Uu({initialValues:{personType:E||"real",nationalCode:h||""},validationSchema:Ru({personType:hu().oneOf(["real","legal"]).required(),nationalCode:hu().required("این فیلد اجباری است!").when("personType",{is:"real",then:c=>c.length(10,"کد ملی باید 10 رقم باشد").matches(/^\d{10}$/,"کد ملی باید فقط شامل اعداد باشد"),otherwise:c=>c.length(11,"شناسه ملی حقوقی باید 11 رقم باشد").matches(/^\d{11}$/,"شناسه ملی حقوقی باید فقط شامل اعداد باشد")})}),validateOnMount:!0});r.useEffect(()=>{g.validateForm()},[]),r.useEffect(()=>{n&&(a!=null&&a.buyer)&&(a.buyer.isRealPerson===!1&&F.setFieldValue("personType","legal",!1),a.buyer.nationalCode||a.buyer.parentLegalPersonNationalCode&&F.setFieldValue("nationalCode",a.buyer.parentLegalPersonNationalCode,!1))},[n,a]),r.useEffect(()=>{if(x){g.setValues({mobile:x.mobile||"",firstName:x.firstName||"",lastName:x.lastName||"",unitName:x.unitName||"",province:x.province||"",city:x.city||"",nationalId:x.nationalId||""});const b=["nationalId","mobile","firstName","lastName","unitName","city"].reduce((p,t)=>{const q=x[t];return p[t]=!!(q&&q!==""),p},{});b.province=!1,T(b),setTimeout(()=>{g.validateForm()},1)}},[x]),r.useEffect(()=>{n&&(g.setValues({mobile:a.mobile||"",firstName:a.firstName||"",lastName:a.lastName||"",unitName:a.unitName||"",province:a.province||"",city:a.city||"",nationalId:a.national_id||a.nationalId||""}),T({}),setTimeout(()=>{g.validateForm()},1))},[n]),r.useEffect(()=>{y(L0()).then(c=>{B(c.payload.data)})},[]),r.useEffect(()=>{g.values.province&&L([],y(T0(g.values.province)).then(c=>{L(c.payload.data)}))},[g.values.province]);const I=async()=>{var q,W,P,o,_,s,i,Z,A,$;if(!F.isValid||v)return;const c=F.values.nationalCode,b=F.values.personType;Y(!0),j(!1),D(null),T({});let p=null,t=null;try{if(b==="legal"){const m=`https://pay.rasadyar.com/national-documents?info=${encodeURIComponent(c)}&type=unit`,uu=await(await fetch(m)).json();if(uu!=null&&uu.status&&(uu!=null&&uu.data)){const S=uu.data,C=Q0(S.address||"",w),N={mobile:"",firstName:S.name||"",lastName:S.name||"",unitName:S.name||"",province:S.state||C||"",city:"",nationalId:S.nationalCode||c};D(N),F.setFieldValue("nationalCode",N.nationalId||c),f({vertical:"top",horizontal:"center",msg:"اطلاعات حقوقی با موفقیت دریافت شد.",severity:"success"})}else j(!0),g.setFieldValue("nationalId",c),T({}),f({vertical:"top",horizontal:"center",msg:"اطلاعات حقوقی برای این شناسه یافت نشد، لطفا اطلاعات را به صورت دستی ثبت کنید.",severity:"warning"});return}const H=await y(F6({info:c,type:"person"}));(q=H.payload)!=null&&q.error?f({vertical:"top",horizontal:"center",msg:H.payload.error,severity:"error"}):(P=(W=H.payload)==null?void 0:W.data)!=null&&P.status&&((_=(o=H.payload)==null?void 0:o.data)!=null&&_.data)?p=H.payload.data.data:f({vertical:"top",horizontal:"center",msg:"اطلاعات فردی یافت نشد.",severity:"warning"});const au=await y(F6({info:c,type:"guild"}));if((s=au.payload)!=null&&s.error)f({vertical:"top",horizontal:"center",msg:au.payload.error,severity:"error"});else if((Z=(i=au.payload)==null?void 0:i.data)!=null&&Z.status&&(($=(A=au.payload)==null?void 0:A.data)!=null&&$.data)){const m=au.payload.data.data,ou=Array.isArray(m)?m:[m];if(ou.length>0){const uu=ou.findIndex(S=>S.licenseStatus==="فعال/صادر شده");t=ou[uu!==-1?uu:0]}else f({vertical:"top",horizontal:"center",msg:"اطلاعات صنفی برای این کد ملی یافت نشد.",severity:"warning"})}else f({vertical:"top",horizontal:"center",msg:"اطلاعات صنفی برای این کد ملی یافت نشد.",severity:"warning"});if(!p&&!t){j(!0),g.setFieldValue("nationalId",c),T({}),f({vertical:"top",horizontal:"center",msg:"اطلاعاتی برای این کد ملی یافت نشد، لطفا اطلاعات را به صورت دستی ثبت کنید.",severity:"warning"});return}const K=(t==null?void 0:t.layerTwo)||{},X={mobile:K.mobilenumber||(p==null?void 0:p.mobile)||K.phonenumber||"",firstName:(p==null?void 0:p.firstName)||"",lastName:(p==null?void 0:p.lastName)||"",unitName:(t==null?void 0:t.title)||K.corporationName||K.unionName||"",province:(t==null?void 0:t.state)||"",city:(t==null?void 0:t.city)||"",nationalId:(p==null?void 0:p.nationalId)||K.nationalcode||(t==null?void 0:t.nationalId)||c};D(X),F.setFieldValue("nationalCode",X.nationalId||c),f({vertical:"top",horizontal:"center",msg:"اطلاعات با موفقیت دریافت شد.",severity:"success"})}finally{Y(!1)}};return u.jsxs(l,{container:!0,justifyContent:"space-between",alignItems:"center",xs:12,direction:"column",gap:2,children:[u.jsxs(l,{container:!0,xs:12,children:[u.jsx(O6,{label:"نوع شخص",children:u.jsxs(Yu,{row:!0,name:"personType",value:F.values.personType,onChange:c=>{const b=c.target.value;F.setFieldValue("personType",b),D(null),j(!1),T({}),g.resetForm({values:{mobile:"",firstName:"",lastName:"",unitName:"",province:"",city:"",nationalId:""}})},children:[u.jsx(gu,{value:"real",control:u.jsx(Su,{}),label:"حقیقی"}),u.jsx(gu,{value:"legal",control:u.jsx(Su,{}),label:"حقوقی"})]})}),u.jsxs(V,{mt:2,children:["استعلام ",F.values.personType==="legal"?"شناسه ملی حقوقی":"کد ملی"]}),u.jsxs(l,{mt:Q.SMALL,display:"flex",width:1,children:[u.jsx(z,{fullWidth:!0,id:"nationalCode",name:"nationalCode",label:F.values.personType==="legal"?"شناسه ملی حقوقی":"کد ملی",variant:"outlined",value:F.values.nationalCode,error:!!(F.touched.nationalCode&&F.errors.nationalCode),onChange:F.handleChange,onBlur:F.handleBlur,helperText:F.touched.nationalCode&&F.errors.nationalCode,inputProps:{maxLength:F.values.personType==="legal"?11:10}}),u.jsx(wu,{disabled:!F.isValid||v,"aria-label":"search",color:"primary",onClick:I,children:u.jsx(B6,{})})]})]}),x||d||n?u.jsxs(l,{container:!0,justifyContent:"space-between",alignItems:"start",xs:12,direction:"column",gap:2,children:[u.jsx(z,{fullWidth:!0,id:"nationalId",name:"nationalId",label:F.values.personType==="legal"?"شناسه ملی حقوقی":"کد ملی",disabled:!0,variant:"outlined",value:F.values.personType==="legal"?F.values.nationalCode:g.values.nationalId,onChange:g.handleChange,onBlur:g.handleBlur,helperText:g.touched.nationalId&&g.errors.nationalId,InputProps:{readOnly:!!k.nationalId}}),u.jsx(z,{fullWidth:!0,id:"mobile",label:"شماره موبایل",variant:"outlined",value:g.values.mobile,onChange:g.handleChange,onBlur:g.handleBlur,error:!!g.errors.mobile,helperText:g.errors.mobile}),u.jsx(z,{fullWidth:!0,id:"firstName",label:"نام",variant:"outlined",value:g.values.firstName,onChange:g.handleChange,onBlur:g.handleBlur,helperText:g.touched.firstName&&g.errors.firstName,disabled:!!k.firstName,InputProps:{readOnly:!!k.firstName},error:!!g.errors.firstName}),u.jsx(z,{fullWidth:!0,id:"lastName",label:"نام خانوادگی",variant:"outlined",value:g.values.lastName,onChange:g.handleChange,onBlur:g.handleBlur,helperText:g.touched.lastName&&g.errors.lastName,disabled:!!k.lastName,InputProps:{readOnly:!!k.lastName},error:!!g.errors.lastName}),u.jsx(z,{fullWidth:!0,id:"unitName",label:"نام واحد",variant:"outlined",value:g.values.unitName,onChange:g.handleChange,onBlur:g.handleBlur,helperText:g.touched.unitName&&g.errors.unitName,disabled:!!k.unitName,InputProps:{readOnly:!!k.unitName},error:!!g.errors.unitName}),u.jsx(Hu,{style:{width:"100%"},disablePortal:!0,id:"province",options:w?w.map(c=>({id:c.name,label:c.name})):[],disabled:!!k.province,isOptionEqualToValue:(c,b)=>c.id===b.id,onChange:(c,b)=>{g.setFieldValue("province",b?b.id:""),g.setFieldValue("city","")},value:g.values.province?{id:g.values.province,label:g.values.province}:null,renderInput:c=>u.jsx(z,{...c,label:"استان را انتخاب کنید"})}),!d&&u.jsxs(V,{variant:"caption",color:"error",children:["استان: ",g.values.province]}),u.jsx(Hu,{minWidth:210,style:{width:"100%"},disabled:!g.values.province||!!k.city,disablePortal:!0,id:"city",options:M?M.map(c=>({id:c.name,label:c.name})):[],isOptionEqualToValue:(c,b)=>c.id===b.id,onChange:(c,b)=>{g.setFieldValue("city",b?b.id:"")},value:g.values.city?{id:g.values.city,label:g.values.city}:null,renderInput:c=>u.jsx(z,{...c,label:"شهر را انتخاب کنید"})}),!d&&u.jsxs(V,{variant:"caption",color:"error",children:["شهر: ",g.values.city]})]}):u.jsx(V,{variant:"body2",color:"text.secondary",children:"برای نمایش فرم، ابتدا استعلام کد ملی را انجام دهید."}),(x||d||n)&&u.jsx(l,{container:!0,xs:12,children:u.jsx(J,{fullWidth:!0,variant:"contained",disabled:!g.isValid,onClick:()=>{n?y(y0({buyer_key:a==null?void 0:a.key,mobile:g.values.mobile,first_name:g.values.firstName,last_name:g.values.lastName,unit_name:g.values.unitName,city:g.values.city,province:g.values.province,national_id:g.values.nationalId})).then(c=>{e(),c.payload.error?f({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(y(du({right:!1,bottom:!1,content:null})),f({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}):y(F0({mobile:g.values.mobile,first_name:g.values.firstName,last_name:g.values.lastName,unit_name:g.values.unitName,city:g.values.city,province:g.values.province,national_id:F.values.personType==="legal"?null:g.values.nationalId,...F.values.personType==="legal"&&{isRealPerson:!1,info_value:F.values.nationalCode}})).then(c=>{e(),c.payload.error?f({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(y(du({right:!1,bottom:!1,content:null})),f({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:n?"ویرایش":"ثبت"})})]})},Z0=()=>{const e=I=>{j(I.target.value)},n=lu(),[a,E]=r.useState([]),[h,f]=r.useState(0),[x,D]=r.useState(10),[d,j]=r.useState(""),[v,Y]=r.useState(1),[k,T]=r.useState([]),[y,w]=r.useState("real"),B=async I=>{n(su());const c=await tu.get(`out-province-carcasses-buyer/?search=filter&value=${d}&role=${eu()}&page=${I}&page_size=${x}&state=buyer-list&type=${y}`);n(ru()),E(c.data.results),f(c.data.count)},M=I=>{B(I),Y(I)},L=I=>{D(I),Y(1)},g=()=>{B(v!==0?v:1)};r.useEffect(()=>{const I=a==null?void 0:a.map((c,b)=>{var W,P,o,_,s,i,Z,A,$,H,au,K,X;const p=[v===1?b+1:b+x*(v-1)+1],t=`${c==null?void 0:c.fullname} (${c==null?void 0:c.mobile})`,q=u.jsx(wu,{color:"primary",onClick:()=>{var m,ou;n(du({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(j6,{updateTable:g,isEdit:!0,data:c,defaultPersonType:(m=c==null?void 0:c.buyer)!=null&&m.parentLegalPersonNationalCode?"legal":"real",defaultNationalCode:(ou=c==null?void 0:c.buyer)==null?void 0:ou.nationalCode}),title:"ویرایش خریدار"}))},children:u.jsx(Y6,{})},b);return y==="real"?[...p,t,c==null?void 0:c.unitName,c==null?void 0:c.province,c==null?void 0:c.city,(P=(W=c==null?void 0:c.requestsInfo)==null?void 0:W.numberOfRequests)==null?void 0:P.toLocaleString(),(_=(o=c==null?void 0:c.requestsInfo)==null?void 0:o.totalQuantity)==null?void 0:_.toLocaleString(),(i=(s=c==null?void 0:c.requestsInfo)==null?void 0:s.totalWeight)==null?void 0:i.toLocaleString(),q]:[...p,c==null?void 0:c.unitName,(Z=c==null?void 0:c.buyer)==null?void 0:Z.parentLegalPersonNationalCode,c==null?void 0:c.province,c==null?void 0:c.city,($=(A=c==null?void 0:c.requestsInfo)==null?void 0:A.numberOfRequests)==null?void 0:$.toLocaleString(),(au=(H=c==null?void 0:c.requestsInfo)==null?void 0:H.totalQuantity)==null?void 0:au.toLocaleString(),(X=(K=c==null?void 0:c.requestsInfo)==null?void 0:K.totalWeight)==null?void 0:X.toLocaleString(),q]});T(I)},[a,y,v,x,n]),r.useEffect(()=>{B(1)},[n,x,y]);const F=async I=>{I.preventDefault(),n(su());try{const c=await tu.get(`out-province-carcasses-buyer/?role=${eu()}&search=filter&value=${d}&page=1&page_size=${x}&state=buyer-list&type=${y}`);E(c.data.results),f(c.data.count),n(ru())}catch(c){console.error("Error fetching data:",c)}};return u.jsxs(l,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(l,{container:!0,justifyContent:"center",alignItems:"center",gap:2,xs:12,children:u.jsx($u,{children:u.jsxs(Yu,{style:{display:"flex",justifyContent:"center"},row:!0,"aria-labelledby":"person-type-radio-group",name:"personType",value:y,onChange:I=>{const c=I.target.value;w(c),Y(1)},children:[u.jsx(gu,{value:"real",control:u.jsx(Su,{}),label:"حقیقی"}),u.jsx(gu,{value:"legal",control:u.jsx(Su,{}),label:"حقوقی"})]})})}),u.jsxs(l,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(J,{variant:"contained",onClick:()=>{n(du({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(j6,{updateTable:g}),title:"افزودن خریدار"}))},children:"افزودن خریدار"}),u.jsx(l,{children:u.jsxs("form",{onSubmit:F,children:[u.jsx(z,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:e}),u.jsx(J,{type:"submit",onClick:F,endIcon:u.jsx(Lu,{}),children:"جستجو"})]})})]}),u.jsx(cu,{data:k,columns:y==="real"?["ردیف","مشخصات خریدار","نام واحد","استان","شهر","تعداد درخواست ها","حجم تقریبی (قطعه)","وزن (کیلوگرم)","ویرایش"]:["ردیف","نام واحد","شناسه حقوقی","استان","شهر","تعداد درخواست ها","حجم تقریبی (قطعه)","وزن (کیلوگرم)","ویرایش"],handlePageChange:M,totalRows:h,page:v,perPage:x,handlePerRowsChange:L,title:"خریداران لاشه خارج استان"})]})},J0=Nu("SLAUGHTER_GET_BUYERS_CARCASS",async(e,{dispatch:n})=>{n(su());const{data:a,status:E}=await tu.get("out-province-carcasses-buyer/",{params:{role:eu()}});return n(ru()),{data:a,status:E}}),X0=Nu("SLAUGHTER_SUBMIT_CARCASS_OUT_PROVINCE_SELL",async(e,{dispatch:n})=>{try{const{data:a,status:E}=await tu.post("kill_house_free_sale_bar/",e);return n(su()),{data:a,status:E}}catch(a){return n(ru()),{error:a.response.data.result}}}),m0=(e,n)=>Ru({weight_of_carcasses:ku().required("وزن لاشه‌ها الزامی است").integer("عدد باید صحیح باشد!").positive("وزن باید عددی مثبت باشد").test("max-production-date-amount",`وزن نمی‌تواند بیشتر از موجودی تاریخ تولید (${(e==null?void 0:e.toLocaleString())||0} کیلوگرم) باشد!`,function(a){return!e||e===null?!0:a<=e}),clearance_code:hu().required("کد قرنطینه الزامی است").matches(/^(?=.*[A-Z])(?=.*\d)[A-Z0-9]+$/,"کد قرنطینه باید ترکیبی از حروف بزرگ انگلیسی و عدد باشد"),date:X6().required("تاریخ الزامی است").test("date-not-before-production","تاریخ نمی‌تواند قبل از تاریخ تولید باشد",function(a){return!n||!a?!0:G(a).isSameOrAfter(G(n),"day")})}),q6=({updateTable:e,fetchItems:n,isInventory:a})=>{const[E,h]=r.useState([]),[f,x]=r.useState(null),[D]=r.useState("free"),[d,j]=r.useState("governmental"),v=lu(),[Y]=r.useContext(vu),[k,T]=r.useState(null),[y,w]=r.useState({}),[B,M]=r.useState(null),[L,g]=r.useState(null),[F,I]=r.useState({governmental:[],free:[]}),c=r.useRef(null);r.useEffect(()=>{v(J0()).then(A=>{h(A.payload.data)})},[v]);const[b,p]=r.useState([]),[t,q]=r.useState(null);r.useEffect(()=>{v(Xu()).then(A=>{p(A.payload.data)})},[]);const W=A=>{const $=A.target.value;if(j($),$==="governmental"&&c.current){const H=G(new Date).format("YYYY-MM-DD");c.current.setFieldValue("date",H),i(H),Z(H)}},P=A=>{if(A&&A.formattedDate){T(A.formattedDate);const $=y[A.formattedDate];$&&$.originalDay&&M($.originalDay),$&&$.value1!==void 0?g($.value1):g(null)}},o=r.useCallback(A=>{if(!Array.isArray(A))return{};const $={};return A.forEach(H=>{if(H.day&&H.amount!==void 0){const K=new J6(new Date(H.day)).format("YYYY/MM/DD");$[K]={value1:H.amount,originalDay:H.day,active:H.active===!0}}}),$},[]),_=r.useCallback(A=>{const $=o(A);w($)},[o]),[s,i]=r.useState(G(new Date).format("YYYY-MM-DD")),Z=r.useCallback(async(A=s)=>{try{const $=await tu.get("/kill-house-remain-weight/",{params:{date:A}});if($.data){I({governmental:$.data.governmental||[],free:$.data.free||[]});const H=d==="governmental"?$.data.governmental:$.data.free;_(H)}}catch($){console.error("Error fetching calendar data:",$)}},[d,_,s]);return r.useEffect(()=>{Z(s)},[Z,s]),r.useEffect(()=>{if(d==="governmental"&&c.current){const A=G(new Date).format("YYYY-MM-DD");c.current.setFieldValue("date",A),i(A),Z(A)}},[d,Z]),r.useEffect(()=>{if(F.governmental.length>0||F.free.length>0){const A=d==="governmental"?F.governmental:F.free;_(A),T(null),M(null),g(null)}},[d,F,_]),u.jsx(l,{container:!0,gap:Q.SMALL,direction:"column",display:"flex",children:u.jsxs(l,{container:!0,gap:Q.SMALL,direction:"column",children:[u.jsx(l,{minWidth:210,children:u.jsx(Hu,{disablePortal:!0,id:"combo-box-demo",getOptionDisabled:A=>A.disabled,options:E?E.map(A=>({id:A==null?void 0:A.key,label:`${A==null?void 0:A.fullname} (${A.mobile}) / استان ${A.province} / شهر ${A.city}`,item:A})):[],onChange:(A,$)=>{x($==null?void 0:$.id)},renderInput:A=>u.jsx(z,{...A,label:"انتخاب خریدار"})})}),f&&u.jsxs(u.Fragment,{children:[u.jsx(l,{xs:12,container:!0,children:u.jsx(Hu,{fullWidth:!0,disablePortal:!0,id:"hatching",options:b?b.map(A=>({data:A,label:`${A.name}`})):[],onChange:(A,$)=>{q($.data)},renderInput:A=>u.jsx(z,{fullWidth:!0,...A,label:"انتخاب محصول"})})}),u.jsx(w6,{innerRef:c,initialValues:{weight_of_carcasses:"",clearance_code:"",date:G(new Date).format("YYYY-MM-DD")},validationSchema:m0(L,B),onSubmit:A=>{v(X0({buyer_key:f,number_of_carcasses:Math.round((A==null?void 0:A.weight_of_carcasses)/(t==null?void 0:t.weightAverage))||0,weight_of_carcasses:parseInt(A.weight_of_carcasses),date:A.date,clearance_code:A.clearance_code,product_key:t==null?void 0:t.key,sale_type:D,quota:d,production_date:B,distribution_type:"web"})).then($=>{$.payload.error?Y({vertical:"top",horizontal:"center",msg:$.payload.error,severity:"error"}):(a?n():e(),v(_u()),v(du({right:!1,bottom:!1,content:null})),Y({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:({values:A,errors:$,touched:H,setFieldValue:au})=>u.jsx(_6,{children:u.jsxs(l,{container:!0,gap:Q.SMALL,direction:"column",children:[u.jsx(l,{item:!0,children:u.jsx(z,{disabled:!0,label:"حجم تقریبی",value:Math.round((A==null?void 0:A.weight_of_carcasses)/(t==null?void 0:t.weightAverage))||0,InputProps:{readOnly:!0}})}),u.jsx(O6,{label:"نوع انبار",children:u.jsx($u,{fullWidth:!0,children:u.jsxs(Yu,{row:!0,"aria-labelledby":"segment-type-radio-group",name:"segmentType",value:d,onChange:W,sx:{justifyContent:"space-between"},children:[u.jsx(gu,{value:"governmental",control:u.jsx(Su,{}),label:"دولتی"}),u.jsx(gu,{value:"free",control:u.jsx(Su,{}),label:"آزاد"})]})})}),u.jsx(l,{children:u.jsx(iu,{label:"تاریخ",disabled:d==="governmental",value:G(A.date),onChange:K=>{const X=G(K).format("YYYY-MM-DD");au("date",X),i(X),Z(X)},renderInput:K=>u.jsx(z,{...K,fullWidth:!0,size:"small",error:H.date&&!!$.date,helperText:H.date&&$.date})})}),u.jsx(l,{item:!0,children:u.jsx(Ou,{name:"clearance_code",as:z,label:"کد قرنطینه",fullWidth:!0,onChange:K=>au("clearance_code",K.target.value.toUpperCase()),error:H.clearance_code&&!!$.clearance_code,helperText:H.clearance_code&&$.clearance_code})}),u.jsxs(l,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:Q.TINY,sx:{width:"100%"},direction:"column",children:[u.jsx(k0,{onDateSelect:P,dayData:y,selectedDate:k,maxGregorianDate:A.date,label:`تاریخ تولید گوشت ${L!==null?`(موجودی: ${L==null?void 0:L.toLocaleString()} کیلوگرم)`:""}`}),B&&A.date&&G(B).isAfter(G(A.date),"day")&&u.jsx(V,{sx:{color:"#d32f2f",fontSize:"0.75rem",marginTop:"4px",marginRight:"14px",textAlign:"right"},children:"تاریخ تولید نمی‌تواند بعد از تاریخ انتخابی باشد"})]}),u.jsx(l,{item:!0,children:u.jsx(Ou,{name:"weight_of_carcasses",children:({field:K,form:X,meta:m})=>u.jsx(mu,{allowLeadingZeros:!0,thousandSeparator:",",decimalScale:0,allowNegative:!1,fullWidth:!0,id:"weight_of_carcasses",label:"وزن لاشه‌ها",variant:"outlined",value:K.value,error:m.touched&&!!m.error||L&&K.value>L,onChange:ou=>{const uu=ou.target.value;if(uu===""||uu===null||uu===void 0){X.setFieldValue("weight_of_carcasses","");return}const S=Math.floor(Number(uu));S>0?X.setFieldValue("weight_of_carcasses",S):S===0&&X.setFieldValue("weight_of_carcasses","")},onBlur:K.onBlur,helperText:L&&K.value>L?`وزن نمی‌تواند بیشتر از موجودی تاریخ تولید (${L==null?void 0:L.toLocaleString()} کیلوگرم) باشد!`:m.touched&&m.error})})}),u.jsxs(l,{container:!0,spacing:Q.SMALL,children:[u.jsx(l,{xs:6,children:u.jsx(J,{fullWidth:!0,type:"submit",variant:"contained",disabled:!t||!B||L&&A.weight_of_carcasses>L||B&&A.date&&G(A.date).isBefore(G(B),"day"),children:"ثبت"})}),u.jsx(l,{xs:6,children:u.jsx(J,{fullWidth:!0,variant:"outlined",color:"primary",onClick:()=>{v(du({right:!1,bottom:!1,content:null}))},children:"انصراف"})})]})]})})})]})]})})},ue=({item:e,fetchApiData:n})=>{const a=lu(),[E]=r.useContext(vu),[h,f]=r.useState((e==null?void 0:e.loggedRegistrationCode)||""),x=()=>{var D,d;a(M6({key:e==null?void 0:e.key,register_code:parseInt(h),role:eu(),date:e==null?void 0:e.date,buyer_name:e==null?void 0:e.buyerName,buyer_mobile:e==null?void 0:e.buyerMobile,province:e==null?void 0:e.province,city:e==null?void 0:e.city,clearance_code:e==null?void 0:e.clearanceCode,number_of_carcasses:e==null?void 0:e.numberOfCarcasses,quarantine_weight_of_carcasses:e==null?void 0:e.quarantineWeightOfCarcasses,weight_of_carcasses:e==null?void 0:e.weightOfCarcasses,quota:e==null?void 0:e.quota,sale_type:e==null?void 0:e.saleType,...((D=e==null?void 0:e.buyer)==null?void 0:D.key)&&{buyer_key:(d=e==null?void 0:e.buyer)==null?void 0:d.key}})).then(j=>{j.payload.error?E({vertical:"top",horizontal:"center",msg:j.payload.error,severity:"error"}):(E({vertical:"top",horizontal:"center",msg:"کد احراز با موفقیت ثبت شد.",severity:"success"}),n())})};return u.jsxs(l,{container:!0,direction:"row",alignItems:"center",justifyContent:"flex-start",gap:1,sx:{position:"relative"},children:[u.jsx(z,{value:h,size:"small",onChange:D=>f(D.target.value),style:{minWidth:"150px"},disabled:e==null?void 0:e.loggedRegistrationCode,placeholder:"کد احراز",inputProps:{inputMode:"numeric",pattern:"[0-9]*"},type:"number"}),!(e!=null&&e.loggedRegistrationCode)&&h&&u.jsx(J,{size:"small",variant:"contained",color:"primary",onClick:x,sx:{position:"absolute",right:"0",minWidth:"40px",width:"40px",height:"38px"},children:u.jsx(V6,{})})]})},ee=Nu("SLAUGHTER_DELETE_OUT_OF_PROVINCE_SELL",async(e,{dispatch:n})=>{n(su());try{const{data:a,status:E}=await tu.delete(`kill_house_free_sale_bar/0/?key=${e}`);return n(ru()),{data:a,status:E}}catch(a){return n(ru()),{error:a}}}),ae=Ru().shape({quarantineCode:hu().required("کد قرنطینه الزامی است"),carcassCount:ku().required("حجم لاشه الزامی است"),carcassWeight:ku().required("وزن لاشه الزامی است"),date:hu().required("تاریخ الزامی است")}),te=({fetchItems:e,isEdit:n,item:a,selectedDate:E,stewardKey:h})=>{const f=lu(),[x]=r.useContext(vu),D={quarantineCode:(a==null?void 0:a.clearanceCode)||"",carcassCount:(a==null?void 0:a.numberOfCarcasses)||"",carcassWeight:(a==null?void 0:a.weightOfCarcasses)||"",date:(a==null?void 0:a.date)||G().format("YYYY-MM-DD HH:mm:ss")};return u.jsx(l,{children:u.jsx(w6,{initialValues:D,validationSchema:ae,onSubmit:d=>{const j={...d,date:d.date,number_of_carcasses:d.carcassCount,weight_of_carcasses:d.carcassWeight};d.quarantineCode!==(a==null?void 0:a.quarantineCode)&&(j.quarantineCode=d.quarantineCode);const v=h?n?I0({key:a==null?void 0:a.key,...j}):j0({steward_key:h,...j}):n?M6({key:a==null?void 0:a.key,driver_mobile:d.driverPhone,...j}):v0({driver_mobile:d.driverPhone,...j});f(v).then(Y=>{Y.payload.error?x({vertical:"top",horizontal:"center",msg:Y.payload.error,severity:"error"}):(h?f(m6({date:d.date})):e(),h&&f(u0({date:d.date,steward_key:h})),f(_u()),f(du({right:!1,bottom:!1,content:null})),x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:({errors:d,touched:j,setFieldValue:v,values:Y})=>u.jsx(_6,{children:u.jsxs(l,{container:!0,spacing:1,justifyContent:"center",alignItems:"center",children:[u.jsx(l,{item:!0,xs:12,children:u.jsx(Ou,{as:z,name:"quarantineCode",label:"کد قرنطینه",fullWidth:!0,error:j.quarantineCode&&!!d.quarantineCode,helperText:j.quarantineCode&&d.quarantineCode})}),u.jsx(l,{item:!0,xs:12,children:u.jsx(Ou,{as:z,name:"carcassCount",label:"حجم لاشه",type:"number",fullWidth:!0,error:j.carcassCount&&!!d.carcassCount,helperText:j.carcassCount&&d.carcassCount})}),u.jsx(l,{item:!0,xs:12,children:u.jsx(iu,{label:"تاریخ",value:G(Y.date),onChange:k=>{const T=G(k).format("YYYY-MM-DD HH:mm:ss");v("date",T)},renderInput:k=>u.jsx(z,{...k,fullWidth:!0,error:j.date&&!!d.date,helperText:j.date&&d.date})})}),u.jsx(l,{item:!0,xs:12,children:u.jsx(Ou,{as:z,name:"carcassWeight",label:"وزن لاشه",type:"number",fullWidth:!0,error:j.carcassWeight&&!!d.carcassWeight,helperText:j.carcassWeight&&d.carcassWeight})}),u.jsx(l,{item:!0,xs:12,children:u.jsx(J,{variant:"contained",fullWidth:!0,type:"submit",children:n?"ویرایش":"ثبت"})})]})})})})},re=Nu("SLAUGHTER_RESEND_OUT_PROVINCE_REGISTRATION_CODE",async(e,{dispatch:n})=>{var a,E;n(su());try{const{data:h,status:f}=await tu.post("send_again_sms_kill_house_free_sale_bar/",e);return n(ru()),{data:h,status:f}}catch(h){return n(ru()),{error:((E=(a=h.response)==null?void 0:a.data)==null?void 0:E.result)||"خطا در ارسال مجدد کد"}}}),ne=({item:e,updateTable:n,fetchApiData:a,page:E})=>{const h=lu(),[f]=r.useContext(vu),[x,D]=r.useState(null),d=w=>{D(w.currentTarget)},j=()=>{D(null)},v=()=>{j(),h(du({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ویرایش فروش خارج از استان",content:u.jsx(te,{fetchItems:n,isEdit:!0,item:e})}))},Y=()=>{j(),h(ee(e==null?void 0:e.key)).then(w=>{w.payload.error?f({vertical:"top",horizontal:"center",msg:w.payload.data.result,severity:"error"}):(n(),h(_u()),f({vertical:"top",horizontal:"center",msg:w.payload.data.result,severity:"success"}))})},k=()=>{j(),h(re({key:e==null?void 0:e.key})).then(w=>{w.payload.error?f({vertical:"top",horizontal:"center",msg:w.payload.error,severity:"error"}):(f({vertical:"top",horizontal:"center",msg:"کد با موفقیت ارسال شد.",severity:"success"}),a(E))})},T=!!x,y=T?"popover":void 0;return u.jsxs("div",{children:[u.jsx(wu,{"aria-describedby":y,variant:"contained",color:"primary",onClick:d,children:u.jsx(N6,{})}),u.jsx(E6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:y,open:T,anchorEl:x,onClose:j,children:u.jsxs(H6,{sx:{py:1,minWidth:130},children:[u.jsx(Du,{title:"ویرایش",placement:"left-start",children:u.jsx(Gu,{disablePadding:!0,children:u.jsxs(Ku,{onClick:v,children:[u.jsx(Qu,{sx:{minWidth:36},children:u.jsx(Y6,{color:"primary"})}),u.jsx(Zu,{primary:u.jsx(V,{variant:"body2",color:"primary",children:"ویرایش"})})]})})}),u.jsx(Du,{title:"حذف",placement:"left-start",children:u.jsx(Gu,{disablePadding:!0,children:u.jsxs(Ku,{onClick:Y,children:[u.jsx(Qu,{sx:{minWidth:36},children:u.jsx(z6,{color:"error"})}),u.jsx(Zu,{primary:u.jsx(V,{variant:"body2",color:"error",children:"حذف"})})]})})}),(e==null?void 0:e.systemRegistrationCode)&&(e==null?void 0:e.registrationCode)&&!(e!=null&&e.loggedRegistrationCode)&&u.jsx(Du,{title:"ارسال مجدد کد",placement:"left-start",children:u.jsx(Gu,{disablePadding:!0,children:u.jsxs(Ku,{onClick:k,children:[u.jsx(Qu,{sx:{minWidth:36},children:u.jsx(W0,{color:"success"})}),u.jsx(Zu,{primary:u.jsx(V,{variant:"body2",color:"success",children:"ارسال مجدد کد"})})]})})})]})})]})},se=()=>{var q,W,P,o;const[,,e,n,a,E]=r.useContext(vu),h=lu();r.useEffect(()=>{const _=G(new Date).format("YYYY-MM-DD");n(_),E(_)},[]);const f=_=>{T(_.target.value)},[x,D]=r.useState([]),[d,j]=r.useState(0),[v,Y]=r.useState(10),[k,T]=r.useState(""),[y,w]=r.useState(1),[B,M]=r.useState([]),L=async _=>{h(su());const s=await tu.get(`kill_house_free_sale_bar/?search=filter&value=${k}&role=${eu()}&date1=${e}&date2=${a}&page=${_}&page_size=${v}&type=dashboard`);h(ru()),D(s.data.results),j(s.data.count)},g=_=>{L(_),w(_)},F=Mu(_=>_.userSlice.userProfile.key),I=_=>{Y(_),w(1)},c=()=>{L(y!==0?y:1)};r.useEffect(()=>{const _=x==null?void 0:x.map((s,i)=>{var Z,A,$;return[y===1?i+1:i+v*(y-1)+1,s!=null&&s.date?L6(s==null?void 0:s.date):"-",s!=null&&s.productionDate?ju(s==null?void 0:s.productionDate):"-",((s==null?void 0:s.distributionType)==="web"?"سایت":(s==null?void 0:s.distributionType)==="app"?"موبایل":(s==null?void 0:s.distributionType)==="pos"?"پوز":s==null?void 0:s.distributionType)||"-",`${s==null?void 0:s.buyerName} (${s==null?void 0:s.buyerMobile})`,s!=null&&s.buyer?`${(Z=s==null?void 0:s.buyer)==null?void 0:Z.unitName}`:`${s==null?void 0:s.buyerName}`,s==null?void 0:s.province,s==null?void 0:s.city,(s==null?void 0:s.clearanceCode)&&u.jsx(W6,{clearanceCode:s==null?void 0:s.clearanceCode}),(A=s==null?void 0:s.quarantineWeightOfCarcasses)==null?void 0:A.toLocaleString(),($=s==null?void 0:s.weightOfCarcasses)==null?void 0:$.toLocaleString(),(s==null?void 0:s.quota)==="governmental"?"دولتی":(s==null?void 0:s.quota)==="free"?"آزاد":"-",(s==null?void 0:s.saleType)==="governmental"?"دولتی":(s==null?void 0:s.saleType)==="free"?"آزاد":"-",s!=null&&s.systemRegistrationCode?s!=null&&s.loggedRegistrationCode?"تایید شده":s!=null&&s.registrationCode?u.jsx(ue,{item:s,fetchApiData:()=>L(y)},i):"-":"-",u.jsx(ne,{item:s,updateTable:c,fetchApiData:L,page:y},i)]});M(_)},[x,y]),r.useEffect(()=>{L(1)},[h,e,a,v]);const b=async _=>{_.preventDefault(),h(su());try{const s=await tu.get(`kill_house_free_sale_bar/?role=${eu()}&search=filter&value=${k}&date1=${e}&date2=${a}&page=1&page_size=${v}&type=dashboard`);D(s.data.results),j(s.data.count),h(ru())}catch(s){console.error("Error fetching data:",s)}h(x6({selectedDate1:e,selectedDate2:a})).then(s=>{t(s.payload.data)})},[p,t]=r.useState([]);return r.useEffect(()=>{h(x6({selectedDate1:e,selectedDate2:a})).then(_=>{t(_.payload.data)})},[e,a]),u.jsxs(l,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(l,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,mt:2,children:[u.jsx(l,{children:u.jsx(iu,{label:"از تاریخ",id:"date",renderInput:_=>u.jsx(z,{style:{width:"160px"},..._,size:"small"}),value:e,onChange:_=>{n(G(_).format("YYYY-MM-DD"))}})}),u.jsx(l,{children:u.jsx(iu,{label:"تا تاریخ",id:"date",renderInput:_=>u.jsx(z,{style:{width:"160px"},..._,size:"small"}),value:a,onChange:_=>{E(G(_).format("YYYY-MM-DD"))}})}),u.jsx(l,{children:u.jsxs("form",{onSubmit:b,children:[u.jsx(z,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:f}),u.jsx(J,{type:"submit",onClick:b,endIcon:u.jsx(Lu,{}),children:"جستجو"})]})}),u.jsx(Du,{title:"خروجی اکسل",children:u.jsx("a",{href:`${tu.defaults.baseURL}kill_house_free_sale_bar_information_for_excel_excel/?key=${F}&role=${eu()}&date1=${e}&date2=${a}`,rel:"noreferrer",children:u.jsx(J,{color:"success",children:u.jsx(k6,{size:32})})})})]}),u.jsx(l,{container:!0,xs:12,mt:2,mb:4,isDashboard:!0,children:u.jsx(cu,{noPagination:!0,isDashboard:!0,columns:["تعداد فروش","خریدار","حجم لاشه ها (تقریبی)","وزن کل لاشه ها"],data:[[(q=p==null?void 0:p.numberOfAllocations)==null?void 0:q.toLocaleString(),(W=p==null?void 0:p.numberOfBuyers)==null?void 0:W.toLocaleString(),(P=p==null?void 0:p.totalNumberOfAllocationCarcasses)==null?void 0:P.toLocaleString(),(o=p==null?void 0:p.totalWeightOfAllocationCarcasses)==null?void 0:o.toLocaleString()]],title:"خلاصه اطلاعات"})}),u.jsx(l,{container:!0,xs:12,children:u.jsx(J,{variant:"contained",onClick:()=>{h(du({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,size:{xs:"100%",sm:"350px"},content:u.jsx(q6,{updateTable:c}),title:"ثبت اطلاعات فروش"}))},children:"ثبت اطلاعات فروش"})}),u.jsx(cu,{data:B,columns:["ردیف","تاریخ","تاریخ تولید گوشت","ثبت شده","مشخصات خریدار","نام واحد","استان","شهر","کد قرنطینه","وزن استعلامی","وزن لاشه","سهمیه","نوع فروش","کد احراز","عملیات"],handlePageChange:g,totalRows:d,page:y,perPage:v,handlePerRowsChange:I,title:"فروش لاشه به خارج استان"})]})},le=()=>{const e=lu(),[n,a]=r.useState(0),E=(f,x)=>{a(x)},h=()=>{e(_u()),e(T6())};return r.useEffect(()=>{h()},[e]),u.jsxs(l,{container:!0,direction:"column",alignItems:"center",justifyContent:"space-between",gap:Q.SMALL,mt:Q.MEDIUM,width:"100%",children:[u.jsx(l,{container:!0,width:"100%",isDashboard:!0,children:u.jsx(a6,{})}),u.jsxs(l,{container:!0,direction:"column",alignItems:"center",justifyContent:"space-between",gap:Q.SMALL,mb:Q.SMALL,width:"100%",children:[u.jsx(Fu,{sx:{borderBottom:1,borderColor:"divider"},children:u.jsxs(e6,{className:"insidetabs",size:"small",value:n,onChange:E,"aria-label":"basic tabs example",children:[u.jsx(Iu,{label:"فروش"}),u.jsx(Iu,{label:"خریداران"})]})}),n===0&&u.jsx(se,{fetchData:h}),n===1&&u.jsx(Z0,{})]})]})},oe=()=>{var K,X,m,ou,uu;const[e,n]=r.useState(),[a,E]=r.useState(),[h,f]=r.useState([]),[x,D]=r.useState(!1),[d,j]=r.useState([]),[v,Y]=r.useState([]),[k,T]=r.useState([]),[y,w]=r.useState(""),[B,M]=r.useState([]),[L,g]=r.useState([]),[F,I]=r.useState({killHouseAllocation:!0}),[c]=r.useContext(vu),b=r.useRef([]),p=r.useRef([]),t=r.useRef([]),q=lu(),[W,P]=r.useState({active:!1,killHousePrice:0,stewardPrice:0,guildPrice:0}),o=()=>{const S=eu();return S==="KillHouse"?W.killHousePrice:S==="Steward"?W.stewardPrice:S==="Guilds"?W.guildPrice:0};r.useEffect(()=>{b.current=b.current.slice(0,(v==null?void 0:v.length)||0),p.current=p.current.slice(0,(v==null?void 0:v.length)||0),t.current=t.current.slice(0,(v==null?void 0:v.length)||0)},[v]),r.useEffect(()=>{if(y){const S=k.filter(C=>C.some(N=>String(N).toLowerCase().includes(y.toLowerCase())));M(S)}else M(k)},[y,k]);const _=(S,C,N)=>{if(S.key==="Enter"){if(S.preventDefault(),N==="price"){const U=[...h];U[C]=Number(S.target.value.replace(/,/g,"")),f(U),p.current[C]&&p.current[C].focus()}else if(N==="weight"){const U=[...d];U[C]=Number(S.target.value.replace(/,/g,"")),j(U),F!=null&&F.killHouseAllocation||L[C]?t.current[C]&&t.current[C].focus():s(C)}}},s=S=>{var C,N;if(W!=null&&W.active){let U=S+1;for(;U=v.length&&p.current[0]&&((C=p.current[0])==null||C.focus())}else{let U=S+1;for(;U=v.length&&b.current[0]&&((N=b.current[0])==null||N.focus())}},i=()=>{q(Y0()).then(S=>{var C;(C=S.payload)!=null&&C.data&&I(S.payload.data)})},Z=async()=>{q(E0({role:eu()})).then(S=>{P(S.payload.data)})},A=async()=>{q(su());try{const S=await tu.get(`commonly-used/?search=filter&value=&role=${eu()}&page=1&page_size=10000`);D(!0),Y(S.data.results||[])}catch(S){console.error(S)}finally{q(ru())}},$=(S,C)=>{var U;const N=[...L];N[C]=S[0]?{...S[0],base64:B0((U=S[0])==null?void 0:U.data_url)}:null,g(N),(F!=null&&F.killHouseAllocation&&S[0]||!(F!=null&&F.killHouseAllocation))&&s(C)};r.useEffect(()=>{const S=v==null?void 0:v.map((C,N)=>{var O,R,Cu,pu,xu,Au,fu,yu;const U=parseInt(W!=null&&W.active?o():h[N])*parseInt(d[N]);return[N+1,(O=C==null?void 0:C.guild)!=null&&O.steward?"مباشر":"صنف",`${(R=C==null?void 0:C.guild)==null?void 0:R.guildsName}/${(pu=(Cu=C==null?void 0:C.guild)==null?void 0:Cu.user)==null?void 0:pu.fullname}/${(Au=(xu=C==null?void 0:C.guild)==null?void 0:xu.user)==null?void 0:Au.city}/${(yu=(fu=C==null?void 0:C.guild)==null?void 0:fu.user)==null?void 0:yu.mobile}`,C!=null&&C.exclusive?"اختصاصی":"آزاد",u.jsx(mu,{allowLeadingZeros:!0,thousandSeparator:",",size:"small",label:"قیمت",disabled:W==null?void 0:W.active,value:W!=null&&W.active?o():h[N]||"",onKeyDown:nu=>_(nu,N,"price"),inputRef:nu=>b.current[N]=nu,variant:"outlined",style:{width:100}},`price-${N}`),u.jsx(mu,{allowLeadingZeros:!0,thousandSeparator:",",size:"small",label:"وزن",value:d[N]||"",onKeyDown:nu=>{_(nu,N,"weight")},inputRef:nu=>p.current[N]=nu,variant:"outlined",style:{width:100}},`weight-${N}`),isNaN(U)?"وارد نشده! ":(U==null?void 0:U.toLocaleString())+" ریال",u.jsxs("div",{style:{width:150},children:[u.jsx(N0,{onChange:nu=>$(nu,N),images:L[N]?[L[N]]:[],maxNumber:1,title:"بارگزاری سند",required:F==null?void 0:F.killHouseAllocation,inputRef:nu=>t.current[N]=nu}),(F==null?void 0:F.killHouseAllocation)&&!L[N]&&u.jsx(V,{variant:"caption",color:"error",children:"تصویر الزامی است"})]},N),u.jsx(wu,{color:"error",children:u.jsx(z6,{onClick:()=>H(C.key)})},N)]});T(S),M(S)},[v,h,d,W,L,F]),r.useEffect(()=>{A(),Z(),i(),q(Xu()).then(S=>{E(S.payload.data)})},[]),r.useEffect(()=>{const S=a==null?void 0:a.map(C=>{var N;return[C==null?void 0:C.name,(N=C==null?void 0:C.totalRemainWeight)==null?void 0:N.toLocaleString()]});n(S)},[a]);const H=S=>{q(S0(S)).then(C=>{C.payload.error?c({vertical:"top",horizontal:"center",msg:C.payload.error,severity:"error"}):(c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),A())})},au=()=>{const S=v==null?void 0:v.map((C,N)=>{var Cu,pu,xu,Au,fu,yu,nu,bu;const U=W!=null&&W.active?o():h[N],O=d[N];if(!U||!O||F!=null&&F.killHouseAllocation&&!L[N])return null;let R={seller_type:"KillHouse",buyer_type:(Cu=C==null?void 0:C.guild)!=null&&Cu.steward?"Steward":"Guild",guild_key:(pu=C==null?void 0:C.guild)!=null&&pu.steward?null:(xu=C==null?void 0:C.guild)==null?void 0:xu.key,steward_key:(Au=C==null?void 0:C.guild)!=null&&Au.steward?(fu=C==null?void 0:C.guild)==null?void 0:fu.key:null,product_key:(yu=a[0])==null?void 0:yu.key,type:"manual",allocation_type:(nu=C==null?void 0:C.guild)!=null&&nu.steward?"killhouse_steward":"killhouse_guild",number_of_carcasses:0,weight_of_carcasses:O,sell_type:"free",amount:U,total_amount:U*O,approved_price_status:W==null?void 0:W.active,date:G(new Date).format("YYYY-MM-DD")};return L[N]&&(R.image=(bu=L[N])==null?void 0:bu.base64),Object.fromEntries(Object.entries(R).filter(([Tu,zu])=>zu!==null))}).filter(Boolean);if(S.length===0){c({vertical:"top",horizontal:"center",msg:"لطفا حداقل یک رکورد معتبر با عکس وارد کنید",severity:"error"});return}q(D0(S)).then(C=>{C.payload.error?c({vertical:"top",horizontal:"center",msg:C.payload.error,severity:"error"}):(c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),f([]),j([]),g([]),A(),Z(),i(),q(Xu()).then(N=>{E(N.payload.data)}))})};return u.jsxs(l,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsx(l,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsx(cu,{noPagination:!0,title:"موجودی انبار",columns:["محصول","مانده انبار (کیلوگرم)"],data:e,customColors:[{name:"محصول",color:"red"}]})}),u.jsxs(l,{xs:12,container:!0,spacing:2,mt:2,alignItems:"center",justifyContent:"space-between",children:[u.jsx(l,{item:!0,xs:12,md:"auto",children:u.jsx(J,{variant:"contained",startIcon:u.jsx(P0,{}),sx:{borderRadius:3,px:3},onClick:()=>{q(du({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(b0,{updateTable:A}),title:"افزودن"}))},children:"افزودن مباشر/صنف"})}),u.jsx(l,{item:!0,xs:12,md:!0,children:u.jsx(U6,{variant:"outlined",sx:{borderRadius:3,boxShadow:1},children:u.jsx(G6,{children:u.jsxs(l,{container:!0,spacing:2,alignItems:"center",justifyContent:"space-between",children:[u.jsxs(l,{item:!0,children:[u.jsx(V,{variant:"subtitle2",children:"مجموع وزن وارد شده"}),u.jsx(V,{variant:"body1",color:"text.secondary",children:d!=null&&d.length?d.reduce((S,C)=>S+C,0).toLocaleString():"۰"})]}),u.jsxs(l,{item:!0,children:[u.jsx(V,{variant:"subtitle2",children:"وزن باقیمانده"}),u.jsx(V,{variant:"body1",color:d!=null&&d.length&&a&&(d==null?void 0:d.reduce((S,C)=>S+C,0))>((K=a[0])==null?void 0:K.totalRemainWeight)?"error":"text.secondary",children:((X=a==null?void 0:a[0])==null?void 0:X.totalRemainWeight)!==void 0?d!=null&&d.length?(((m=a[0])==null?void 0:m.totalRemainWeight)-d.reduce((S,C)=>S+C,0)).toLocaleString():(ou=a[0])==null?void 0:ou.totalRemainWeight.toLocaleString():"۰"})]}),u.jsx(l,{item:!0,children:u.jsx(J,{variant:"contained",color:"success",startIcon:u.jsx(O0,{}),sx:{borderRadius:3,px:3},onClick:au,disabled:d.length?d.reduce((S,C)=>S+C,0)>((uu=a[0])==null?void 0:uu.totalRemainWeight)||(F==null?void 0:F.killHouseAllocation)&&v.some((S,C)=>h[C]&&d[C]&&(!L[C]||!L[C].base64)):!0,children:"ثبت"})})]})})})})]}),u.jsxs(l,{container:!0,xs:12,mt:2,gap:1,sx:{userSelect:"none"},children:[u.jsx(A6,{color:"error"}),u.jsx(V,{variant:"body1",color:"error",children:"پس از وارد کردن هر مقدار، کلید Enter را فشار دهید!"})]}),u.jsxs(l,{container:!0,xs:12,mt:2,gap:1,sx:{userSelect:"none"},children:[u.jsx(A6,{color:"primary"}),u.jsx(V,{variant:"body1",color:"primary",children:"صرفا تخصیصاتی که هر دو مقدار قیمت و وزن آنها را وارد کنید ثبت خواهند شد."})]}),u.jsx(l,{container:!0,xs:12,mt:2,children:u.jsx(z,{fullWidth:!0,variant:"outlined",placeholder:"جستجو...",value:y,onChange:S=>w(S.target.value),InputProps:{startAdornment:u.jsx(K6,{position:"start",children:u.jsx(B6,{})})},sx:{mb:2}})}),B!=null&&B.length?u.jsx(l,{container:!0,xs:12,gap:1,mt:2,mb:2,children:B==null?void 0:B.map((S,C)=>u.jsxs(l,{container:!0,xs:12,sx:{p:2,pl:5,borderRadius:2,backgroundColor:C%2===0?"#fef6f0":"#ffffff",boxShadow:"0 2px 6px rgba(0,0,0,0.05)",position:"relative",flexDirection:"row",gap:2,alignItems:"center"},children:[u.jsx(Fu,{sx:{position:"absolute",top:12,left:12,backgroundColor:"#fb8c00",width:28,height:28,borderRadius:"50%",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.8rem",fontWeight:700,boxShadow:"0 1px 4px rgba(0,0,0,0.2)"},children:S[0]}),u.jsxs(l,{item:!0,sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(V,{variant:"caption",color:"text.secondary",sx:{minWidth:64},children:"ماهیت:"}),u.jsx(V,{variant:"body2",fontSize:"0.8rem",children:S[1]})]}),u.jsxs(l,{item:!0,sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(V,{variant:"caption",color:"text.secondary",sx:{minWidth:64},children:"خریدار:"}),u.jsx(V,{variant:"body2",fontSize:"0.8rem",children:S[2]})]}),u.jsxs(l,{item:!0,sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(V,{variant:"caption",color:"text.secondary",sx:{minWidth:64},children:"نوع فروش:"}),u.jsx(V,{variant:"body2",fontSize:"0.8rem",children:S[3]})]}),u.jsxs(l,{item:!0,sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(V,{variant:"caption",color:"text.secondary",children:"قیمت هرکیلو:"}),u.jsx(V,{variant:"body2",fontSize:"0.8rem",children:S[4]})]}),u.jsxs(l,{item:!0,sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(V,{variant:"caption",color:"text.secondary",children:"وزن لاشه:"}),u.jsx(V,{variant:"body2",fontSize:"0.8rem",children:S[5]})]}),u.jsxs(l,{item:!0,sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(V,{variant:"caption",color:"text.secondary",sx:{minWidth:64},children:"قیمت کل:"}),u.jsx(V,{variant:"body2",fontSize:"0.8rem",children:S[6]})]}),u.jsx(l,{item:!0,sx:{display:"flex",alignItems:"center",gap:.5},children:S[7]}),u.jsx(l,{item:!0,sx:{display:"flex",alignItems:"center",gap:.5},children:S[8]}),u.jsx(l,{item:!0,children:!(W!=null&&W.active)&&(!h[C]||!d[C])&&(h[C]||d[C])&&u.jsx(V,{variant:"caption",color:"error",children:"لطفا همه موارد را وارد کنید و کلید Enter را بزنید"})})]},C))}):u.jsx(V,{mt:4,children:x?"موردی یافت نشد!":y?"نتیجه‌ای یافت نشد":"در حال بارگزاری..."})]})},ce=()=>{var P,o,_;const[e,n]=r.useState([]),[a,E]=r.useState([]),[h,f]=r.useState([]),[x,D]=r.useState(0),[d,j]=r.useState(10),[v,Y]=r.useState(""),[k,T]=r.useState(1),[y,w]=r.useState([]),[,,B,M,L,g]=r.useContext(vu),F=lu(),I=()=>{F(R0({value:v,date1:B,date2:L,role:eu()})).then(s=>{w(s.payload.data)})};r.useEffect(()=>{const s=G(new Date).format("YYYY-MM-DD");M(s),g(s)},[]);const c=async s=>{F(su());const i=await tu.get(`app-segmentation/?search=filter&value=${v}&date1=${B}&date2=${L}&page=${s}&page_size=${d}&role=${eu()}`);I(),F(ru()),n(i.data.results),D(i.data.count)},b=s=>{c(s),T(s)},p=()=>{c(k)},t=s=>{j(s),T(1)},q=s=>{Y(s.target.value)};r.useEffect(()=>{c(1),F(w0()).then(s=>{E(s.payload.data)})},[]),r.useEffect(()=>{const s=e==null?void 0:e.map((i,Z)=>{var A,$,H,au,K,X,m;return[k===1?Z+1:Z+d*(k-1)+1,i!=null&&i.productionDate?L6(i==null?void 0:i.productionDate):"-",(i==null?void 0:i.distributionType)==="web"?"سایت":(i==null?void 0:i.distributionType)==="app"?"موبایل":(i==null?void 0:i.distributionType)==="pos"?"پوز":(i==null?void 0:i.distributionType)||"-",`${(A=i==null?void 0:i.buyer)==null?void 0:A.fullname}(${($=i==null?void 0:i.buyer)==null?void 0:$.mobile})`,i!=null&&i.toGuild?`به قطعه بند - ${(au=(H=i==null?void 0:i.toGuild)==null?void 0:H.user)==null?void 0:au.fullname}(${(X=(K=i==null?void 0:i.toGuild)==null?void 0:K.user)==null?void 0:X.mobile})`:"قطعه بندی توسط کشتارگاه",i!=null&&i.date?ju(i==null?void 0:i.date):"-",i==null?void 0:i.weight,(i==null?void 0:i.quota)==="governmental"?"دولتی":(i==null?void 0:i.quota)==="free"?"آزاد":"-",(i==null?void 0:i.saleType)==="governmental"?"دولتی":(i==null?void 0:i.saleType)==="free"?"آزاد":"-",u.jsx(_0,{item:i,productKey:(m=a==null?void 0:a[0])==null?void 0:m.key,updateTable:p},Z)]});f(s)},[e]),r.useEffect(()=>{c(1)},[B,L,d]);const W=async s=>{s.preventDefault(),F(su());try{const i=await tu.get(`app-segmentation/?search=filter&value=${v}&date1=${B}&date2=${L}&page=${k}&role=${eu()}`);n(i.data.results),D(i.data.count),I(),F(ru())}catch(i){console.error("Error fetching data:",i)}};return u.jsx(l,{container:!0,direction:"column",flexWrap:"nowrap",children:u.jsxs(l,{xs:12,container:!0,alignItems:"center",gap:Q.SMALL,justifyContent:"flex-start",children:[u.jsx(l,{container:!0,mb:4,isDashboard:!0,children:u.jsx(cu,{noPagination:!0,isDashboard:!0,columns:["وزن کل (کیلوگرم)","وزن قطعه بندی","وزن تخصیصی به قطعه بندها"],data:[[((P=y==null?void 0:y.totalWeight)==null?void 0:P.toLocaleString())||"0",((o=y==null?void 0:y.totalSelfWeight)==null?void 0:o.toLocaleString())||"0",((_=y==null?void 0:y.totalOtherWeight)==null?void 0:_.toLocaleString())||"0"]],title:"خلاصه اطلاعات"})}),u.jsx("form",{children:u.jsxs(l,{container:!0,alignItems:"center",gap:Q.SMALL,children:[u.jsx(J,{variant:"contained",onClick:()=>{var s;F(du({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت قطعه بندی",size:{xs:"100%",sm:"380px"},content:u.jsx(P6,{updateTable:p,productKey:(s=a==null?void 0:a[0])==null?void 0:s.key})}))},children:"ثبت قطعه بندی"}),u.jsx(z,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:q}),u.jsx(J,{type:"submit",onClick:W,endIcon:u.jsx(Lu,{}),children:"جستجو"}),u.jsx(l,{children:u.jsx(iu,{label:"از تاریخ",id:"date",renderInput:s=>u.jsx(z,{style:{width:"160px"},...s}),value:B,onChange:s=>M(G(s).format("YYYY-MM-DD"))})}),u.jsx(l,{children:u.jsx(iu,{label:"تا تاریخ",id:"date",renderInput:s=>u.jsx(z,{style:{width:"160px"},...s}),value:L,onChange:s=>g(G(s).format("YYYY-MM-DD"))})})]})}),u.jsx(cu,{data:h,columns:["ردیف","تاریخ تولید گوشت","ثبت شده","کشتارگاه","تخصیص","تاریخ ","وزن (کیلوگرم)","سهمیه","نوع فروش","عملیات"],handlePageChange:b,totalRows:x,page:k,perPage:d,handlePerRowsChange:t,title:"قطعه بندی"})]})})},ie=()=>{const[e,n]=r.useState(G(new Date).format("YYYY-MM-DD")),[a,E]=r.useState(G(new Date).format("YYYY-MM-DD")),h=lu(),f=p=>{w(p.target.value)},[x,D]=r.useState(!0),[d,j]=r.useState([]),[v,Y]=r.useState(0),[k,T]=r.useState(10),[y,w]=r.useState(""),[B,M]=r.useState(1),[L,g]=r.useState([]),F=r.useCallback(async p=>{let t;h(su()),t=await tu.get(`orders_for_kill_house/?search=filter&value=${y}&role=${eu()}${x?`&date1=${e}&date2=${a}`:""}&page=${p}&page_size=${k}`),h(ru()),j(t.data.results),Y(t.data.count)},[y,x,e,a,k,h]),I=p=>{F(p),M(p)},c=p=>{T(p),M(1)};r.useEffect(()=>{const p=d==null?void 0:d.map((t,q)=>{var W,P;return[B===1?q+1:q+k*(B-1)+1,t==null?void 0:t.orderCode,ju(t==null?void 0:t.date),t==null?void 0:t.customerName,t==null?void 0:t.customerMobile,t==null?void 0:t.customerCity,t==null?void 0:t.productType,(W=t==null?void 0:t.quantity)==null?void 0:W.toLocaleString(),(P=t==null?void 0:t.weight)==null?void 0:P.toLocaleString(),t==null?void 0:t.status,t!=null&&t.deliveryDate?ju(t==null?void 0:t.deliveryDate):"-",u.jsx(Du,{title:"مشاهده جزئیات",children:u.jsx(wu,{size:"small",color:"primary",onClick:()=>{var o,_;h(Wu({title:"جزئیات سفارش",content:u.jsxs(l,{container:!0,gap:2,children:[u.jsxs(l,{xs:12,children:[u.jsx("strong",{children:"کد سفارش:"})," ",t==null?void 0:t.orderCode]}),u.jsxs(l,{xs:12,children:[u.jsx("strong",{children:"مشتری:"})," ",t==null?void 0:t.customerName]}),u.jsxs(l,{xs:12,children:[u.jsx("strong",{children:"تلفن:"})," ",t==null?void 0:t.customerMobile]}),u.jsxs(l,{xs:12,children:[u.jsx("strong",{children:"شهر:"})," ",t==null?void 0:t.customerCity]}),u.jsxs(l,{xs:12,children:[u.jsx("strong",{children:"نوع محصول:"})," ",t==null?void 0:t.productType]}),u.jsxs(l,{xs:12,children:[u.jsx("strong",{children:"حجم:"})," ",(o=t==null?void 0:t.quantity)==null?void 0:o.toLocaleString()," ","قطعه"]}),u.jsxs(l,{xs:12,children:[u.jsx("strong",{children:"وزن:"})," ",(_=t==null?void 0:t.weight)==null?void 0:_.toLocaleString()," ","کیلوگرم"]}),u.jsxs(l,{xs:12,children:[u.jsx("strong",{children:"وضعیت:"})," ",t==null?void 0:t.status]}),u.jsxs(l,{xs:12,children:[u.jsx("strong",{children:"تاریخ ثبت:"})," ",ju(t==null?void 0:t.date)]}),(t==null?void 0:t.deliveryDate)&&u.jsxs(l,{xs:12,children:[u.jsx("strong",{children:"تاریخ تحویل:"})," ",ju(t==null?void 0:t.deliveryDate)]})]})}))},children:u.jsx(M0,{fontSize:"small"})})},q)]});g(p)},[d]),r.useEffect(()=>{F(1)},[F]);const b=async p=>{p.preventDefault(),h(su());try{const t=await tu.get(`orders_for_kill_house/?role=${eu()}&search=filter&value=${y}${x?`&date1=${e}&date2=${a}`:""}&page=1&page_size=${k}`);j(t.data.results),Y(t.data.count),h(ru())}catch(t){console.error("Error fetching data:",t)}};return u.jsxs(l,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(l,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsxs(l,{container:!0,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},children:[u.jsx(l,{children:u.jsx(gu,{control:u.jsx(u6,{checked:x,onChange:()=>D(!x),color:"primary"})})}),u.jsx(l,{children:u.jsx(iu,{disabled:!x,label:"از تاریخ",id:"date",renderInput:p=>u.jsx(z,{size:"small",style:{width:"160px"},...p}),value:e,onChange:p=>{n(G(p).format("YYYY-MM-DD"))}})}),u.jsx(l,{children:u.jsx(iu,{disabled:!x,label:"تا تاریخ",id:"date",renderInput:p=>u.jsx(z,{size:"small",style:{width:"160px"},...p}),value:a,onChange:p=>{E(G(p).format("YYYY-MM-DD"))}})})]}),u.jsx(l,{children:u.jsxs("form",{onSubmit:b,children:[u.jsx(z,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:f}),u.jsx(J,{type:"submit",onClick:b,endIcon:u.jsx(Lu,{}),children:"جستجو"})]})})]}),u.jsx(cu,{data:L,columns:["ردیف","کد سفارش","تاریخ ثبت","نام مشتری","شماره تماس","شهر","نوع محصول","حجم (قطعه)","وزن (کیلوگرم)","وضعیت","تاریخ تحویل","عملیات"],handlePageChange:I,totalRows:v,page:B,perPage:k,handlePerRowsChange:c,title:"سفارشات کشتارگاه"})]})},v6=[{value:"inProvinceSale",label:"توزیع/ فروش درون استان",description:"ثبت توزیع و فروش لاشه داخل استان"},{value:"coldStorage",label:"انتقال به سردخانه",description:"ثبت انتقال لاشه به سردخانه"},{value:"outProvinceSale",label:"فروش خارج استان",description:"ثبت فروش لاشه به خارج از استان"},{value:"segmentation",label:"قطعه بندی",description:"ثبت قطعه بندی لاشه"}],de=({updateTable:e,priceInfo:n,slaughterProducts:a,fetchApiData:E})=>{const[h,f]=r.useState(""),x=j=>{f(j.target.value)},D=()=>{var v,Y;const j={updateTable:e,priceInfo:n,remainWeight:(v=a==null?void 0:a[0])==null?void 0:v.totalRemainWeight,fetchApiData:E};switch(h){case"inProvinceSale":return u.jsx($0,{...j,sellerType:"KillHouse",sellType:"exclusive",killHouseAllocation:!0});case"coldStorage":return u.jsx(z0,{...j,sellerType:"KillHouse",sellType:"free",killHouseAllocation:!1});case"outProvinceSale":return u.jsx(q6,{updateTable:e});case"segmentation":return u.jsx(P6,{updateTable:e,productKey:(Y=a==null?void 0:a[0])==null?void 0:Y.key});default:return null}},d=v6.find(j=>j.value===h);return u.jsxs(l,{container:!0,direction:"column",gap:Q.MEDIUM,width:"100%",children:[u.jsxs($u,{fullWidth:!0,children:[u.jsx(S6,{id:"operation-select-label",children:"انتخاب عملیات"}),u.jsx(b6,{labelId:"operation-select-label",id:"operation-select",value:h,label:"انتخاب عملیات",onChange:x,children:v6.map(j=>u.jsx(Vu,{value:j.value,children:j.label},j.value))})]}),d&&u.jsxs(u.Fragment,{children:[u.jsx(Q6,{}),u.jsxs(l,{container:!0,direction:"column",gap:Q.TINY,children:[u.jsx(V,{variant:"h6",color:"primary",children:d.label}),u.jsx(V,{variant:"body2",color:"textSecondary",children:d.description})]})]}),u.jsx(Fu,{sx:{width:"100%"},children:D()})]})},Ce=({priceInfo:e})=>{var f,x,D,d,j,v,Y,k,T,y,w,B,M,L,g,F;const{distributionInfo:n,slaughterProducts:a}=Mu(I=>I.slaughterSlice),E=lu(),h=()=>{E(_u())};return u.jsxs(l,{container:!0,width:"100%",gap:Q.SMALL,mb:2,children:[u.jsx(J,{disabled:!a,variant:"contained",color:"primary",size:"large",onClick:()=>{E(du({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت عملیات",size:window.innerWidth<=600?"auto":450,content:u.jsx(de,{updateTable:h,priceInfo:e,slaughterProducts:a})}))},children:"ثبت عملیات"}),u.jsx(a6,{}),u.jsx(cu,{title:"اطلاعات پخش",noPagination:!0,isDashboard:!0,data:[[(f=n==null?void 0:n.totalGovernmentalInputWeight)==null?void 0:f.toLocaleString(),(x=n==null?void 0:n.totalFreeInputWeight)==null?void 0:x.toLocaleString(),(D=n==null?void 0:n.totalGovernmentalOutputWeight)==null?void 0:D.toLocaleString(),(d=n==null?void 0:n.totalFreeOutputWeight)==null?void 0:d.toLocaleString(),(j=n==null?void 0:n.totalKillHouseAllocationsWeight)==null?void 0:j.toLocaleString(),(v=n==null?void 0:n.totalKillHouseFreeSale_barCarcassesWeight)==null?void 0:v.toLocaleString(),(Y=n==null?void 0:n.segmentationsWeight)==null?void 0:Y.toLocaleString(),(k=n==null?void 0:n.coldHouseAllocationsWeight)==null?void 0:k.toLocaleString(),(T=n==null?void 0:n.totalGovernmentalRemainWeight)==null?void 0:T.toLocaleString(),(y=n==null?void 0:n.totalFreeRemainWeight)==null?void 0:y.toLocaleString()]],columns:["وزن دولتی (کیلوگرم)","وزن آزاد (کیلوگرم)","فروش دولتی (کیلوگرم)","فروش آزاد (کیلوگرم)","فروش و توزیع داخل استان (کیلوگرم)","فروش و توزیع خارج استان (کیلوگرم)","وزن قطعه بندی (کیلوگرم)","وزن انجماد (کیلوگرم)","مانده دولتی (کیلوگرم)"," مانده آزاد (کیلوگرم)"]}),u.jsx(cu,{title:"تعهدات",noPagination:!0,isDashboard:!0,data:[[(w=n==null?void 0:n.totalCommitmentSellingInProvinceGovernmentalWeight)==null?void 0:w.toLocaleString(),(B=n==null?void 0:n.totalSellingInProvinceGovernmentalWeight)==null?void 0:B.toLocaleString(),(M=n==null?void 0:n.totalCommitmentSellingInProvinceGovernmentalRemainWeight)==null?void 0:M.toLocaleString(),(L=n==null?void 0:n.totalCommitmentSellingInProvinceFreeWeight)==null?void 0:L.toLocaleString(),(g=n==null?void 0:n.totalSellingInProvinceFreeWeight)==null?void 0:g.toLocaleString(),(F=n==null?void 0:n.totalCommitmentSellingInProvinceFreeRemainWeight)==null?void 0:F.toLocaleString()]],columns:["تعهد دولتی توزیع داخل استان","توزیع دولتی داخل استان","باقیمانده تعهد دولتی توزیع داخل استان","تعهد آزاد توزیع داخل استان","توزیع آزاد داخل استان","باقیمانده تعهد آزاد توزیع داخل استان"],allColors:{color:"green",text:"#332a3d"}})]})},ha=()=>{const{pathname:e}=s0(),n=lu(),{distributionInfo:a,priceInfo:E}=Mu(h=>h.slaughterSlice);return r.useEffect(()=>{e===Ju&&(n(_u()),n(T6()))},[e]),u.jsxs(u.Fragment,{children:[u.jsx(Fu,{display:"flex",justifyContent:"center",children:e===Ju&&u.jsxs(l,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsx(Eu,{}),u.jsx(Ce,{priceInfo:E})]})}),(e===Ju||e===e0)&&u.jsxs(l,{container:!0,gap:Q.SMALL,p:Q.SMALL,justifyContent:"center",mt:Q.MEDIUM,xs:12,alignItems:"center",width:"900px",mx:"auto",children:[u.jsx(Bu,{to:i6,children:u.jsx(Pu,{icon:u.jsx(a0,{sx:{fontSize:30,color:"#244CCC"}}),title:"ورود به انبار"})}),u.jsx(Bu,{to:d6,children:u.jsx(Pu,{icon:u.jsx(t0,{sx:{fontSize:30,color:"#244CCC"}}),title:"فروش داخل استان"})}),u.jsx(Bu,{to:C6,children:u.jsx(Pu,{icon:u.jsx(h6,{sx:{fontSize:30,color:"#244CCC"}}),title:"فروش به خارج استان"})}),u.jsx(Bu,{to:g6,children:u.jsx(Pu,{icon:u.jsx(h6,{sx:{fontSize:30,color:"#244CCC"}}),title:"خرید خارج از استان"})}),u.jsx(Bu,{to:p6,children:u.jsx(Pu,{icon:u.jsx(l0,{sx:{fontSize:30,color:"#244CCC"}}),title:"قطعه بندی"})})]}),e.includes(i6)&&u.jsx(Fu,{display:"flex",justifyContent:"center",children:u.jsxs(l,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsx(Eu,{}),u.jsx(K0,{})]})}),e.includes(C6)&&u.jsx(Fu,{display:"flex",justifyContent:"center",children:u.jsxs(l,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsx(Eu,{}),u.jsx(le,{})]})}),e.includes(r0)&&u.jsx(Fu,{display:"flex",justifyContent:"center",children:u.jsxs(l,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsx(Eu,{}),u.jsx(oe,{})]})}),e.includes(d6)&&u.jsx(Fu,{display:"flex",justifyContent:"center",children:u.jsxs(l,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsx(Eu,{}),u.jsx(o0,{distributionInfo:a})]})}),e.includes(p6)&&u.jsx(Fu,{display:"flex",justifyContent:"center",children:u.jsxs(l,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsx(Eu,{}),u.jsx(ce,{})]})}),e.includes(n0)&&u.jsx(Fu,{display:"flex",justifyContent:"center",children:u.jsxs(l,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsx(Eu,{}),u.jsx(ie,{})]})}),e.includes(g6)&&u.jsx(Fu,{display:"flex",justifyContent:"center",children:u.jsxs(l,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsx(Eu,{}),u.jsx(p0,{})]})})]})};export{ha as default}; diff --git a/build/assets/SlaughterManageBars-B2jDKFOF.js b/build/assets/SlaughterManageBars-B2jDKFOF.js new file mode 100644 index 0000000..4c01c6c --- /dev/null +++ b/build/assets/SlaughterManageBars-B2jDKFOF.js @@ -0,0 +1 @@ +import{j as r,T as Wu,ak as L,B as hu,d as I,I as gu,bq as Gu,b2 as Ku,b3 as k,b as zu}from"./mui-vendor-CkIVaoQP.js";import{L as Fu,j as S,X as l,h as ju,A as Qu,a9 as _,G as n,S as p,W as xu,Q as R,O as Au}from"./index-CeyyVc1v.js";import{r as s}from"./react-vendor-CmFgShSM.js";import{a as Xu,f as Ju,u as Zu}from"./redux-vendor-B7uoacJt.js";import{d as vu}from"./Delete-C5MyLelE.js";import{R as mu,a as ue}from"./index.esm-Bu7XMDZU.js";import{P as ee}from"./PageTable-C16Ol94B.js";import{S as re}from"./SimpleTable-DBAoNnCU.js";import{V as yu,S as te}from"./SlaughterEnterNoneReciept-Cle0J4bf.js";import{V as ae}from"./VetFarmEditTrafficCode-D3hZa5p9.js";import{V as le}from"./VetFarmDeletedBars-DqBCKO-S.js";import{P as oe}from"./ProvinceBarDifference-CBv5I_nz.js";import{C as se}from"./ChechClearanceCode-lPasOZZ_.js";import{R as ne}from"./ResponsiveTable-w7hk7Uq8.js";import"./iconBase-BEJYyZsk.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Tune-D4M2CAhp.js";import"./ReceiptLong-Dxpx4wPx.js";import"./ShowImage-CqhU2hmk.js";import"./Download-DQ-VVIaV.js";import"./aviculture-get-hatching-data-DsjDNd82.js";import"./toBase64-BzgTOHsW.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./resizeImage-Csf2MO3w.js";import"./Edit-CqBj1Y2L.js";import"./Pageview-TRcW_9jm.js";import"./AddCircleOutline-C8LXM-k8.js";import"./FilterAlt-scT0HEUg.js";const bu=Xu("SLAUGHTER_BAR_DASHBOARD_SERVICE",async(C,{dispatch:g})=>{g(Fu());const{data:d,status:$}=await S.get("dashboarad_bar_for_kill_house",{params:{role:l(),date1:C.selectedDate1,date2:C.selectedDate2,filter:"search",value:C.textValue}});return g(ju()),{data:d,status:$}}),ce=()=>{var Y,H,N,W,G,K,z,Q,X,J;const[,,C,g,d,$]=s.useContext(Qu);s.useEffect(()=>{const u=_(new Date).format("YYYY-MM-DD");g(u),$(u)},[]);const Su=Ju(u=>u.userSlice.userProfile.key),[x,$u]=s.useState(0),ku=(u,e)=>{$u(e)},f=Zu(),[Ru,Du]=s.useState([]),[i,D]=s.useState([]),[Ou,w]=s.useState(!1),[T,O]=s.useState(0),[E,Eu]=s.useState(10),[a,P]=s.useState([]),h=async u=>{w(!0);const e=await S.get(`kill_house_request_bar_management/?check&search=filter&value=${A}&role=${l()}&date1=${C}&date2=${d}&page=${u}&page_size=${E}`);D(e.data.results),O(e.data.count),w(!1),f(ju())},[Mu,Lu]=s.useState(0),Iu=(u,e)=>{f(Fu()),Lu(e),h(e+1)},_u=u=>{h(u)},Tu=async(u,e)=>{w(!0);const t=await S.get(`kill_house_request_bar_management/?check&search=filter&value=${A}&role=${l()}&date1=${C}&date2=${d}&page=${e}&page_size=${u}`);D(t.data.results),O(t.data.count),Eu(u),w(!1)};s.useEffect(()=>{h(1)},[]);const q=!(l()==="ProvinceOperator"||l()==="CityVet"),V=[{name:"کدبار",selector:u=>u.barCode,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"100px"},{name:"خریدار",selector:u=>{var e,t,o,c;return`${(e=u.killhouseUser)==null?void 0:e.name} (${(c=(o=(t=u.killhouseUser)==null?void 0:t.killHouseOperator)==null?void 0:o.user)==null?void 0:c.mobile})`},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"کشتارکن اختصاصی",selector:u=>{var e,t,o,c;return u!=null&&u.killer?`${(e=u==null?void 0:u.killer)==null?void 0:e.name} (${(c=(o=(t=u==null?void 0:u.killer)==null?void 0:t.killHouseOperator)==null?void 0:o.user)==null?void 0:c.mobile})`:"-"},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"ماشین",selector:u=>`${u.addCar.driver.typeCar} ${u.addCar.driver.pelak}`,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"100px"},{name:"راننده",selector:u=>`${u.addCar.driver.driverName} (${u.addCar.driver.driverMobile})`,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"کد بهداشتی حمل و نقل",selector:u=>u==null?void 0:u.trafficCode,sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"قیمت مرغ زنده‌ی بار",selector:u=>{var e;return((e=u==null?void 0:u.amount)==null?void 0:e.toLocaleString())+" ﷼"},sortable:!1,wrap:!0,allowOverflow:!0,center:!0},{name:"نژاد",selector:u=>u.poultryRequest.chickenBreed,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"50px"},{name:"تعداد اولیه",selector:u=>{var e;return(e=u.quantity)==null?void 0:e.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"50px"},{name:"وزن اولیه بار (کیلوگرم)",selector:u=>{var e,t;return(t=(e=u==null?void 0:u.weightInfo)==null?void 0:e.weight)==null?void 0:t.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"70px"},{name:"میانگین وزن اولیه (کیلوگرم)",selector:u=>{var e,t;return(t=(e=u==null?void 0:u.weightInfo)==null?void 0:e.indexWeight)==null?void 0:t.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"70px"},{name:"قیمت مرغدار",selector:u=>{var e,t;return((t=(e=u==null?void 0:u.poultryRequest)==null?void 0:e.amount)==null?void 0:t.toLocaleString())+" ﷼"},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"قیمت کشتارگاه",selector:u=>{var e,t;return((t=(e=u==null?void 0:u.weightInfo)==null?void 0:e.killHousePrice)==null?void 0:t.toLocaleString())+" ﷼"},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"مرغدار",selector:u=>{var e,t,o,c;return`${(t=(e=u.poultryRequest)==null?void 0:e.poultry)==null?void 0:t.unitName} (${(c=(o=u.poultryRequest.poultry)==null?void 0:o.user)==null?void 0:c.mobile})`},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"دامپزشک فارم",selector:u=>{var e,t,o,c,v,y,b,F,j;return(o=(t=(e=u==null?void 0:u.vetFarm)==null?void 0:e.vet)==null?void 0:t.user)!=null&&o.fullname?((y=(v=(c=u==null?void 0:u.vetFarm)==null?void 0:c.vet)==null?void 0:v.user)==null?void 0:y.fullname)+`(${(j=(F=(b=u==null?void 0:u.vetFarm)==null?void 0:b.vet)==null?void 0:F.user)==null?void 0:j.mobile})`:"فاقد دامپزشک"},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"100px"},{name:"کدرهگیری سامانه قرنطینه",selector:u=>{var e,t,o;return r.jsx(r.Fragment,{children:l()==="VetFarm"||l()==="ProvinceOperator"||l()==="CityVet"||l()==="VetSupervisor"?r.jsx(r.Fragment,{children:(e=u==null?void 0:u.registerar)!=null&&e.date?`${R(new Date((t=u==null?void 0:u.registerar)==null?void 0:t.date),"yyyy/MM/dd")} ${(o=u==null?void 0:u.registerar)==null?void 0:o.name}`:""}):u!=null&&u.clearanceCode?(u==null?void 0:u.clearanceCode)&&r.jsx(se,{clearanceCode:u==null?void 0:u.clearanceCode}):"-"})},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"200px"},{name:"محل کشتار",selector:u=>`${u.killPlace}`,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"شهر",selector:u=>u.poultryRequest.poultry.address.city.name,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"تاریخ کشتار",selector:u=>u!=null&&u.poultryRequest.sendDate?R(new Date(u==null?void 0:u.poultryRequest.sendDate),"yyyy/MM/dd"):"-",sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"کدسفارش کشتار",selector:u=>u==null?void 0:u.poultryRequest.orderCode,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"70px"},{name:"تعداد نهایی",selector:u=>{var e;return(e=u.acceptedRealQuantity)==null?void 0:e.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"50px"},{name:"وزن نهایی بار (کیلوگرم)",selector:u=>{var e;return(e=u==null?void 0:u.acceptedRealWeight)==null?void 0:e.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"70px"},{name:"میانگین وزن نهایی (کیلوگرم)",selector:u=>{var e,t;return(t=(e=u==null?void 0:u.weightInfo)==null?void 0:e.finalIndexWeight)==null?void 0:t.toLocaleString()},sortable:!0,wrap:!0,allowOverflow:!0,center:!0,width:"70px"},{name:"وضعیت",selector:u=>{let e="";return u.vetState==="accepted"?e="تایید تخلیه":u.vetState==="pending"&&(e="در انتظار تخلیه"),e},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"90px"},{name:"عملیات",selector:u=>r.jsx(n,{children:r.jsx(I,{title:"لغو بار",children:r.jsx(gu,{disabled:q,color:"error",onClick:()=>{f(Au({title:"لغو بار",content:r.jsx(yu,{updateTable:M,killHouseRequestKey:u.key})}))},children:r.jsx(vu,{})})})},u.barCode),sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"70px"}],Pu=u=>{g(u)},qu=u=>{$(u)};s.useEffect(()=>{h(1)},[C,d,E]);const[A,Vu]=s.useState(""),Bu=u=>{Vu(u.target.value)};s.useEffect(()=>{h(1),f(bu({selectedDate1:C,selectedDate2:d,textValue:A})).then(u=>{P(u.payload.data)})},[f,C,d]);const B=async u=>{u.preventDefault(),w(!0);try{const e=await S.get(`kill_house_request_bar_management/?check&role=${l()}&search=filter&value=${A}&date1=${C}&date2=${d}&page=1&page_size=${E}`);D(e.data.results),O(e.data.count),f(bu({selectedDate1:C,selectedDate2:d,textValue:A})).then(t=>{P(t.payload.data)})}catch(e){console.error("Error fetching data:",e)}finally{w(!1)}},M=()=>{h(1)},U=r.jsx(n,{container:!0,alignItems:"start",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,children:r.jsxs(n,{container:!0,alignItems:"center",gap:p.SMALL,children:[r.jsx(Wu,{children:"مدیریت بارها"}),r.jsx(n,{style:{width:"150px"},children:r.jsx(xu,{label:"از تاریخ",id:"date",renderInput:u=>r.jsx(L,{...u}),value:C,onChange:u=>{Pu(_(u).format("YYYY-MM-DD"))}})}),r.jsx(n,{style:{width:"150px"},children:r.jsx(xu,{label:"تا تاریخ",id:"date",renderInput:u=>r.jsx(L,{...u}),value:d,onChange:u=>{qu(_(u).format("YYYY-MM-DD"))}})}),r.jsxs("form",{onSubmit:B,children:[r.jsx(L,{autoComplete:"off",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:Bu}),r.jsx(hu,{type:"submit",onClick:B,endIcon:r.jsx(mu,{}),children:"جستجو"})]}),r.jsx(I,{title:"خروجی اکسل",children:r.jsx("a",{href:`${S.defaults.baseURL}bar_excel/?start=${C}&end=${d}&key=${Su}&role=${l()}`,rel:"noreferrer",children:r.jsx(hu,{disabled:!((H=(Y=i[0])==null?void 0:Y.killhouseUser)!=null&&H.key),color:"success",children:r.jsx(ue,{size:32})})})})]})}),Uu=u=>{let e="";return u.vetState==="accepted"?e="تایید تخلیه":u.vetState==="pending"&&(e="در انتظار تخلیه"),e},Yu=V.map(u=>u.name),Hu=window.innerWidth<=600;s.useEffect(()=>{const u=i==null?void 0:i.map((e,t)=>{var o,c,v,y,b,F,j,Z,m,uu,eu,ru,tu,au,lu,ou,su,nu,cu,Cu,du,pu,fu,iu,wu;return[e.barCode,`${(o=e.killhouseUser)==null?void 0:o.name} (${(y=(v=(c=e.killhouseUser)==null?void 0:c.killHouseOperator)==null?void 0:v.user)==null?void 0:y.mobile})`,`${e.addCar.driver.typeCar} ${e.addCar.driver.pelak}`,`${e.addCar.driver.driverName} (${e.addCar.driver.driverMobile})`,r.jsx(ae,{updateTable:M,killHouseRequestKey:e.key,trafficCode:e==null?void 0:e.trafficCode,isEditable:l()==="VetFarm"||l()==="ProvinceOperator"||l()==="KillHouseVet"||l()==="KillHouse"||l()==="CityVet"||l()==="VetSupervisor"},t),e.poultryRequest.chickenBreed,(b=e.quantity)==null?void 0:b.toLocaleString(),(j=(F=e==null?void 0:e.weightInfo)==null?void 0:F.weight)==null?void 0:j.toLocaleString(),(m=(Z=e==null?void 0:e.weightInfo)==null?void 0:Z.indexWeight)==null?void 0:m.toLocaleString(),`${(eu=(uu=e.poultryRequest)==null?void 0:uu.poultry)==null?void 0:eu.unitName} (${(tu=(ru=e.poultryRequest.poultry)==null?void 0:ru.user)==null?void 0:tu.mobile})`,(ou=(lu=(au=e==null?void 0:e.vetFarm)==null?void 0:au.vet)==null?void 0:lu.user)!=null&&ou.fullname?((cu=(nu=(su=e==null?void 0:e.vetFarm)==null?void 0:su.vet)==null?void 0:nu.user)==null?void 0:cu.fullname)+`(${(pu=(du=(Cu=e==null?void 0:e.vetFarm)==null?void 0:Cu.vet)==null?void 0:du.user)==null?void 0:pu.mobile})`:"فاقد دامپزشک",r.jsx(r.Fragment,{children:l()==="VetFarm"||l()==="ProvinceOperator"||l()==="CityVet"||l()==="VetSupervisor"?r.jsx(r.Fragment,{children:(fu=e==null?void 0:e.registerar)!=null&&fu.date?`${R(new Date((iu=e==null?void 0:e.registerar)==null?void 0:iu.date),"yyyy/MM/dd")} ${(wu=e==null?void 0:e.registerar)==null?void 0:wu.name}`:""}):e!=null&&e.clearanceCode?e==null?void 0:e.clearanceCode:"-"}),`${e.killPlace}`,e.poultryRequest.poultry.address.city.name,e!=null&&e.poultryRequest.sendDate?R(new Date(e==null?void 0:e.poultryRequest.sendDate),"yyyy/MM/dd"):"-",e==null?void 0:e.poultryRequest.orderCode,Uu(e),r.jsx(n,{children:r.jsx(I,{title:"لغو بار",children:r.jsx(gu,{disabled:q,color:"error",onClick:()=>{f(Au({title:"لغو بار",content:r.jsx(yu,{updateTable:M,killHouseRequestKey:e.key})}))},children:r.jsx(vu,{})})})},e.barCode)]});Du(u)},[i]);const Nu=r.jsxs(Ku,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:x,onChange:ku,children:[r.jsx(k,{label:"اطلاعات بارها",value:0}),r.jsx(k,{label:"بارهای حذف شده",value:1}),r.jsx(k,{label:"اختلاف کشتار",value:2}),r.jsx(k,{label:"عدم وصول",value:3})]});return r.jsxs(n,{container:!0,direction:"column",flexWrap:"nowrap",mt:p.SMALL,children:[r.jsx(n,{container:!0,justifyContent:"center",mb:p.MEDIUM,children:Nu}),x===0&&r.jsxs(n,{container:!0,mt:p.MEDIUM,alignItems:"center",justifyContent:"center",children:[r.jsx(n,{container:!0,mt:2,mb:4,isDashboard:!0,children:r.jsx(ne,{noPagination:!0,isDashboard:!0,columns:["تعداد بار","تعداداولیه بار","وزن اولیه بار","میانگین وزن اولیه","تعداد بار های دارای کد قرنطینه","تعداد نهایی بار","وزن نهایی بار","میانگین وزن نهایی "],data:[[(N=a==null?void 0:a.count)==null?void 0:N.toLocaleString(),(W=a==null?void 0:a.firstQuantity)==null?void 0:W.toLocaleString(),(G=a==null?void 0:a.firstWeight)==null?void 0:G.toLocaleString(),(K=a==null?void 0:a.firstIndexWeight)==null?void 0:K.toLocaleString(),(z=a==null?void 0:a.clearanceCodeCount)==null?void 0:z.toLocaleString(),(Q=a==null?void 0:a.acceptedRealQuantity)==null?void 0:Q.toLocaleString(),(X=a==null?void 0:a.acceptedRealWeight)==null?void 0:X.toLocaleString(),(J=a==null?void 0:a.finalIndexWeight)==null?void 0:J.toLocaleString()]],title:"خلاصه اطلاعات"})}),Hu?r.jsxs(n,{container:!0,justifyContent:"center",gap:p.SMALL,children:[U,r.jsx(re,{columns:Yu,data:Ru}),r.jsx(Gu,{count:Math.ceil(T/10),page:Mu+1,variant:"outlined",onChange:(u,e)=>{Iu(u,e-1)}})]}):r.jsx(ee,{title:U,columns:V,data:i,progressPending:Ou,pagination:!0,paginationServer:!0,paginationTotalRows:T,onChangeRowsPerPage:Tu,onChangePage:_u})]}),x===1&&r.jsx(n,{mt:p.MEDIUM,children:r.jsx(le,{})}),x===2&&r.jsx(n,{mt:p.MEDIUM,children:r.jsx(oe,{})}),x===3&&r.jsx(n,{mt:p.MEDIUM,children:r.jsx(te,{})})]})},Ue=()=>r.jsx(r.Fragment,{children:r.jsx(zu,{display:"flex",justifyContent:"center",children:r.jsx(n,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:r.jsx(ce,{})})})});export{Ue as default}; diff --git a/build/assets/SlaughterManageBars-CW9paHF2.js b/build/assets/SlaughterManageBars-CW9paHF2.js new file mode 100644 index 0000000..5313a1d --- /dev/null +++ b/build/assets/SlaughterManageBars-CW9paHF2.js @@ -0,0 +1 @@ +import{j as u,T as g,d as Lu,I as Vu,ak as O,B as U,ag as Pu,av as $6,aw as T6,ax as V6,i as Hu,p as su,aO as u0,aP as e0,aQ as r0,aR as t0,aS as a0,aT as n0,bi as o0,ah as s0,ai as zu,aj as k6,aA as l0,$ as c0,b0 as C0,K as i0,b as Mu,aX as d0}from"./mui-vendor-CkIVaoQP.js";import{L as $,j as D,h as B,A as uu,X as v,C as lu,O as m,G as c,S as W,v as cu,Q as Ou,W as $u,du as z6,u as Ku,r as Uu,c as M6,b as ku,M as Nu,N as N6,f$ as h0,_ as p0}from"./index-CeyyVc1v.js";import{r as C,b as L6}from"./react-vendor-CmFgShSM.js";import{I as P6,f as H6}from"./toBase64-BzgTOHsW.js";import{a as eu,u as Q,f as Wu}from"./redux-vendor-B7uoacJt.js";import{r as O6}from"./resizeImage-Csf2MO3w.js";import{S as qu}from"./ShowImage-CqhU2hmk.js";import{V as K6,v as A0}from"./VetFarmEditTrafficCode-D3hZa5p9.js";import{R as U6,a as Qu}from"./index.esm-Bu7XMDZU.js";import{R as Tu}from"./ResponsiveTable-w7hk7Uq8.js";import{d as Q6}from"./Edit-CqBj1Y2L.js";import{d as g0}from"./AddCircleOutline-C8LXM-k8.js";import{i as Y6}from"./isValidIndexWeight-C_ik-uYa.js";import{V as F0}from"./SlaughterEnterNoneReciept-Cle0J4bf.js";import{g as x0}from"./getDocumentStates-BlCrMUIj.js";import{d as y0}from"./Tune-D4M2CAhp.js";import{d as f0}from"./Delete-C5MyLelE.js";import{S as v0}from"./SimpleTable-DBAoNnCU.js";import{N as Du}from"./NumberFormatCustom-DwWPj40N.js";import{F as j0}from"./FileUploader-DT5gIVb3.js";const W6=eu("KILL_HOUSE_ASSIGNMENT_INFORMATION_AGGREGATE_LOAD_SERVICE",async(e,{dispatch:n})=>{try{n($());const{data:s,status:a}=await D.put("kill_house_assignment_information_aggregate_load/0/",e);return n(B()),{data:s,status:a}}catch(s){return n(B()),{error:s.response.data.result}}}),D6=({isSingular:e,item:n,updateTable:s})=>{var w;const a=Q(),[i]=C.useContext(uu),[d,x]=C.useState([]),[h,j]=C.useState(),{slaughterGetAggregateLoadInformation:b}=Wu(F=>F.slaughterSlice),p=(F,f)=>{var _;if(F[0]){const I=(_=F[0])==null?void 0:_.file;O6(I,T=>{const l=H6(T);j(l)})}x(F)};return C.useEffect(()=>{h&&(e?a(W6({image:h,bar_key:n.key,role:v()})).then(F=>{var f,_;j(null),x([]),a(lu()),F.payload.error?i({vertical:"top",horizontal:"center",msg:F.payload.error,severity:"error"}):(i({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),(f=n==null?void 0:n.assingmentInformation)!=null&&f.realQuantity&&((_=n==null?void 0:n.assingmentInformation)!=null&&_.carWeightWithLoadImage)&&a(m({title:"بار به تب مدیریت بارها منتقل شد."})),s(1))}):a(W6({image:h,bar_keys:b==null?void 0:b.map(F=>F.key),role:v()})).then(F=>{var f,_;j(null),x([]),a(lu()),F.payload.error?i({vertical:"top",horizontal:"center",msg:F.payload.error,severity:"error"}):(i({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),s(1),(f=n==null?void 0:n.assingmentInformation)!=null&&f.realQuantity&&((_=n==null?void 0:n.assingmentInformation)!=null&&_.carWeightWithLoadImage)&&a(m({title:"بار به تب مدیریت بارها منتقل شد."})))}))},[h,d]),u.jsxs(c,{width:"100%",children:[!e&&u.jsxs(c,{container:!0,gap:W.TINY,mb:W.SMALL,children:[u.jsx(g,{color:"error",children:"نکته:"}),u.jsx(g,{children:"این سند برای تمامی بارهایی که فاقد سند هستند ثبت خواهد شد."})]}),u.jsx(c,{mt:W.SMALL,children:u.jsx(P6,{onChange:p,images:d,maxNumber:1,showImages:!1,title:(w=n==null?void 0:n.assingmentInformation)!=null&&w.carWeightWithLoadImage?"ویرایش":"ثبت"})})]})},S0=eu("SALUGHTER_AGGREGATE_QUANTITY_SERVICE",async(e,{dispatch:n})=>{try{n($());const{data:s,status:a}=await D.post("kill_house_assignment_information_aggregate_load/",e);return n(B()),{data:s,status:a}}catch(s){return n(B()),{error:s.response.data.result}}}),_0=eu("PROVINCE_GET_LOAD_INFO_DASHBOARD",async(e,{dispatch:n})=>{try{n($());const{data:s,status:a}=await D.get("dashboard_enter_load_information",{params:{date1:e.selectedDate1,date2:e.selectedDate2,role:v(),filter:"search",value:e.text?e.text:""}});return n(B()),{data:s,status:a}}catch(s){return n(B()),{error:s.response.data}}}),ce=()=>{var E,V,z,o,M;const e=Wu(S=>S.userSlice.userProfile.key),[n,s]=C.useState([]),[a,i]=C.useState(0),[d,x]=C.useState(10),[h,j]=C.useState(""),[b,p]=C.useState(1),[w,F]=C.useState([]),f=Q(),_=S=>{j(S.target.value)},[,,I,T,l,q]=C.useContext(uu);C.useEffect(()=>{const S=cu(new Date).format("YYYY-MM-DD");T(S),q(S)},[]);const k=async S=>{f($());const t=await D.get(`kill_house_request_aggregate_load/?check&search=filter&value=${h}&role=${v()}&date1=${I}&date2=${l}&page=${S}&page_size=${d}`);f(B()),s(t.data.results),i(t.data.count),f(B())},L=S=>{k(S),p(S)},P=S=>{p(1),x(S,k(1))};C.useEffect(()=>{k(1)},[]);const X=async S=>{S.preventDefault(),f($());try{const t=await D.get(`kill_house_request_aggregate_load/?check&role=${v()}&search=filter&value=${h}&date1=${I}&date2=${l}&page=1&page_size=${d}`);s(t.data.results),i(t.data.count),f(B())}catch(t){console.error("Error fetching data:",t)}};C.useEffect(()=>{k(1)},[I,l,d]);const[R,y]=C.useState([]);return C.useEffect(()=>{f(_0({selectedDate1:I,selectedDate2:l,text:h})).then(S=>{y(S.payload.data)})},[I,l]),C.useEffect(()=>{const S=n==null?void 0:n.map((t,N)=>{var K,ru,tu,au,Y,nu,Z,ou,J,G,Cu,iu,du,hu,pu,Au,A,r,H,gu,Fu,xu,yu,fu,vu,ju,Su,_u,wu,Eu,bu,Ru,Iu,Bu;return[b===1?N+1:N+d*(b-1)+1,(K=t==null?void 0:t.assignmentInfo)!=null&&K.realQuantity?u.jsxs(c,{container:!0,direction:"column",children:[u.jsxs(c,{children:[(tu=(ru=t==null?void 0:t.assignmentInfo)==null?void 0:ru.realQuantity)==null?void 0:tu.toLocaleString()," قطعه"]}),u.jsxs(c,{children:[(Y=(au=t==null?void 0:t.assignmentInfo)==null?void 0:au.netWeight)==null?void 0:Y.toLocaleString()," کیلوگرم"]}),u.jsx(Lu,{title:"ویرایش اطلاعات بار",placement:"top",children:u.jsx(Vu,{color:"primary",onClick:()=>{f(m({title:"ثبت اطلاعات بار",content:u.jsx(q6,{item:t,selectedDate:I,fetchApiData:k})}))},size:"small",children:u.jsx(Q6,{fontSize:"small"})},t.key)})]}):u.jsx(Lu,{title:"ثبت اطلاعات بار",placement:"top",children:u.jsx(Vu,{color:"primary",onClick:()=>{f(m({title:"ثبت اطلاعات بار",content:u.jsx(q6,{item:t,selectedDate:I,fetchApiData:k})}))},size:"small",children:u.jsx(g0,{fontSize:"small"})},t.key)}),u.jsx(u.Fragment,{children:(nu=t==null?void 0:t.assingmentInformation)!=null&&nu.carWeightWithLoadImage?u.jsxs(c,{children:[u.jsx(qu,{src:(Z=t==null?void 0:t.assingmentInformation)==null?void 0:Z.carWeightWithLoadImage}),u.jsx(D6,{isSingular:!0,item:t,updateTable:k},t.key)]}):u.jsx(D6,{isSingular:!0,item:t,updateTable:k},t.key)}),u.jsx(qu,{src:(ou=t==null?void 0:t.assignmentInfo)==null?void 0:ou.imageWithoutBar},N),u.jsx(qu,{src:(J=t==null?void 0:t.assignmentInfo)==null?void 0:J.imageWithBar},N),u.jsx(g,{style:{fontSize:"13px",color:t!=null&&t.trash?"red":"black"},children:t.barCode},N),u.jsx(u.Fragment,{children:u.jsx(K6,{updateTable:k,killHouseRequestKey:t.key,trafficCode:t==null?void 0:t.trafficCode,isEditable:v()==="ProvinceOperator"||v()==="SuperAdmin"||v()==="AdminX"||v()==="Supporter"||v()==="VetSupervisor"||t.trash!==!0&&t.assignmentStateArchive==="pending"&&!(t!=null&&t.clearanceCode)&&(v()==="VetFarm"||v()==="CityVet")})}),((G=t==null?void 0:t.amount)==null?void 0:G.toLocaleString())+" ﷼",t!=null&&t.poultryRequest.sendDate?Ou(new Date(t==null?void 0:t.poultryRequest.sendDate),"yyyy/MM/dd"):"-",`${(Cu=t.killhouseUser)==null?void 0:Cu.name} (${(hu=(du=(iu=t.killhouseUser)==null?void 0:iu.killHouseOperator)==null?void 0:du.user)==null?void 0:hu.mobile})`,t!=null&&t.killer?`${(pu=t==null?void 0:t.killer)==null?void 0:pu.name} (${(r=(A=(Au=t==null?void 0:t.killer)==null?void 0:Au.killHouseOperator)==null?void 0:A.user)==null?void 0:r.mobile})`:"-",`${(gu=(H=t.poultryRequest)==null?void 0:H.poultry)==null?void 0:gu.unitName} (${(xu=(Fu=t.poultryRequest.poultry)==null?void 0:Fu.user)==null?void 0:xu.mobile})`,(yu=t==null?void 0:t.poultryRequest)==null?void 0:yu.age,(fu=t.quantity)==null?void 0:fu.toLocaleString(),(ju=(vu=t==null?void 0:t.weightInfo)==null?void 0:vu.weight)==null?void 0:ju.toLocaleString(),((_u=(Su=t==null?void 0:t.poultryRequest)==null?void 0:Su.amount)==null?void 0:_u.toLocaleString())+" ﷼",((Eu=(wu=t==null?void 0:t.weightInfo)==null?void 0:wu.killHousePrice)==null?void 0:Eu.toLocaleString())+" ﷼",`${t.addCar.driver.typeCar} ${t.addCar.driver.pelak}`,`${t.addCar.driver.driverName} (${t.addCar.driver.driverMobile})`,(bu=t.vetAcceptedRealQuantity)==null?void 0:bu.toLocaleString(),(Ru=t.vetAcceptedRealWeight)==null?void 0:Ru.toLocaleString(),t==null?void 0:t.poultryRequest.orderCode,t==null?void 0:t.finalBarState,(Iu=t==null?void 0:t.poultryRequest)!=null&&Iu.freezing?"انجماد":(Bu=t==null?void 0:t.poultryRequest)!=null&&Bu.export?"صادرات":"عادی"]});F(S)},[n]),u.jsxs(c,{container:!0,justifyContent:"center",children:[u.jsx(c,{container:!0,alignItems:"start",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,children:u.jsxs(c,{container:!0,alignItems:"center",gap:W.SMALL,children:[u.jsx(c,{children:u.jsx($u,{label:"از تاریخ",id:"date",renderInput:S=>u.jsx(O,{size:"small",style:{width:"160px"},...S}),value:I,onChange:S=>{T(cu(S).format("YYYY-MM-DD"))}})}),u.jsx(c,{children:u.jsx($u,{label:"تا تاریخ",id:"date",renderInput:S=>u.jsx(O,{size:"small",style:{width:"160px"},...S}),value:l,onChange:S=>{q(cu(S).format("YYYY-MM-DD"))}})}),u.jsxs("form",{onSubmit:X,children:[u.jsx(O,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:_}),u.jsx(U,{type:"submit",onClick:X,endIcon:u.jsx(U6,{}),children:"جستجو"})]}),!!(n!=null&&n.length)&&u.jsx(c,{children:u.jsx(Lu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${D.defaults.baseURL}bar_excel/?start=${I}&end=${l}&role=${v()}&state=bar_pending&key=${e}&search=filter&value=${h}`,rel:"noreferrer",children:u.jsx(U,{color:"success",children:u.jsx(Qu,{size:32})})})})})]})}),u.jsx(c,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(Tu,{noPagination:!0,isDashboard:!0,columns:["تعداد بار","مجموع تعداد اولیه","مجموع وزن اولیه (کیلوگرم)","مجموع تعداد تحویلی دامپزشک","مجموع وزن تحویلی دامپزشک (کیلوگرم)"],data:[[(E=R==null?void 0:R.lenKillHouseRequest)==null?void 0:E.toLocaleString(),(V=R==null?void 0:R.firstQuantity)==null?void 0:V.toLocaleString(),(z=R==null?void 0:R.firstWeight)==null?void 0:z.toLocaleString(),(o=R==null?void 0:R.vetAcceptedRealQuantity)==null?void 0:o.toLocaleString(),(M=R==null?void 0:R.vetAcceptedRealWeight)==null?void 0:M.toLocaleString()]],title:"خلاصه اطلاعات"})}),u.jsx(Tu,{data:w,columns:["ردیف","تعداد/وزن خالص","سند","بارنامه خالی","بارنامه پر","کدبار","کد بهداشتی حمل و نقل","قیمت مرغ زنده‌ی بار","تاریخ کشتار","خریدار","کشتارکن اختصاصی","مرغدار","سن مرغ","تعداد اولیه","وزن اولیه بار (کیلوگرم)","قیمت مرغدار","قیمت کشتارگاه","ماشین","راننده","تحویلی دامپزشک (قطعه)","وزن تحویلی دامپزشک (کیلوگرم)","کدسفارش کشتار","وضعیت بار","نوع کشتار"],handlePageChange:L,totalRows:a,page:b,perPage:d,handlePerRowsChange:P,title:"وارد کردن اطلاعات بار"})]})},q6=({item:e,fetchApiData:n})=>{const[s]=C.useContext(uu),{weightRange:a}=Wu(x=>x.provinceSlice);C.useEffect(()=>{i(z6())},[]);const i=Q(),d=Ku({initialValues:{quantity:"",weight:""},onSubmit:x=>{var h,j,b,p,w;((h=e==null?void 0:e.killhouseUser)==null?void 0:h.maximumLoadVolumeReduction)!==0&&d.values.quantity<(e==null?void 0:e.acceptedRealQuantity)*(1-((j=e==null?void 0:e.killhouseUser)==null?void 0:j.maximumLoadVolumeReduction)/100)||((b=e==null?void 0:e.killhouseUser)==null?void 0:b.maximumLoadVolumeIncrease)!==0&&d.values.quantity>(e==null?void 0:e.acceptedRealQuantity)*(1+((p=e==null?void 0:e.killhouseUser)==null?void 0:p.maximumLoadVolumeIncrease)/100)?s({vertical:"top",horizontal:"center",msg:"حجم وارد شده با مجوز حداکثر افزایش/کاهش ورود اطلاعات بار مطابقت ندارد!",severity:"error"}):v()!=="SuperAdmin"&&v()!=="AdminX"&&!Y6(a,(w=e==null?void 0:e.poultryRequest)==null?void 0:w.age,parseInt(d.values.weight)/parseInt(d.values.quantity))?s({vertical:"top",horizontal:"center",msg:"میانگین وزنی با احراز سنی مطابقت ندارد. لطفا با اتحادیه تماس بگیرید.",severity:"error"}):i(S0({kill_house_request_key:e.key,role:v(),net_weight:x.weight,exploited_carcass:0,real_quantity:x.quantity})).then(F=>{F.payload.error?s({vertical:"top",horizontal:"center",msg:F.payload.error,severity:"error"}):(s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),i(lu()),n(1))})},validate:x=>{const h={};return/^\d+$/.test(x.weight)||(h.weight="لطفا عدد وارد کنید"),/^\d+$/.test(x.quantity)||(h.quantity="لطفا عدد وارد کنید"),h}});return u.jsx("form",{onSubmit:d.handleSubmit,children:u.jsxs(c,{container:!0,gap:W.SMALL,alignItems:"center",justifyContent:"center",children:[u.jsx(O,{label:"وزن خالص (کیلوگرم)",variant:"outlined",fullWidth:!0,type:"text",name:"weight",id:"weight",onChange:d.handleChange,onBlur:d.handleBlur,value:d.values.weight,error:d.touched.weight&&!!d.errors.weight,helperText:d.touched.weight&&d.errors.weight}),u.jsx(O,{label:"تعداد واقعی (قطعه)",variant:"outlined",fullWidth:!0,type:"text",name:"quantity",id:"quantity",onChange:d.handleChange,onBlur:d.handleBlur,value:d.values.quantity,error:d.touched.quantity&&!!d.errors.quantity,helperText:d.touched.quantity&&d.errors.quantity}),u.jsx(U,{type:"submit",fullWidth:!0,variant:"contained",children:"ثبت"})]})})},w0=({item:e,updateTable:n})=>{var F,f;const[s,a]=C.useState((F=e==null?void 0:e.barDocumentStatus)!=null&&F.key?(f=e==null?void 0:e.barDocumentStatus)==null?void 0:f.key:""),[i,d]=C.useState(e!=null&&e.description?e==null?void 0:e.description:""),[x]=C.useContext(uu),h=Q(),j=_=>{a(_.target.value)},b=_=>{d(_.target.value)},[p,w]=C.useState([]);return C.useEffect(()=>{h(x0()).then(_=>{w(_.payload.data)})},[]),u.jsxs(c,{container:!0,xs:12,gap:2,children:[u.jsxs(Pu,{fullWidth:!0,children:[u.jsx($6,{id:"document-state-label",children:"وضعیت سند"}),u.jsx(T6,{labelId:"document-state-label",id:"document-state-select",value:s,label:"وضعیت سند",onChange:j,children:p==null?void 0:p.map((_,I)=>u.jsx(V6,{value:_==null?void 0:_.key,children:_==null?void 0:_.title},I))})]}),u.jsx(O,{fullWidth:!0,label:"توضیحات",multiline:!0,rows:4,value:i,onChange:b,variant:"outlined"}),u.jsx(c,{xs:12,children:u.jsx(U,{fullWidth:!0,variant:"contained",color:"primary",onClick:()=>{h(A0({key:e==null?void 0:e.key,bar_document_status_key:s,bar_document_description:i,role:v()})).then(_=>{x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),n(1),h(lu())})},children:"ثبت"})})]})};var Yu={},E0=Hu;Object.defineProperty(Yu,"__esModule",{value:!0});var G6=Yu.default=void 0,b0=E0(Uu()),R0=u;G6=Yu.default=(0,b0.default)((0,R0.jsx)("path",{d:"M18 13v7H4V6h5.02c.05-.71.22-1.38.48-2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-5zm-1.5 5h-11l2.75-3.53 1.96 2.36 2.75-3.54zm2.8-9.11c.44-.7.7-1.51.7-2.39C20 4.01 17.99 2 15.5 2S11 4.01 11 6.5s2.01 4.5 4.49 4.5c.88 0 1.7-.26 2.39-.7L21 13.42 22.42 12zM15.5 9C14.12 9 13 7.88 13 6.5S14.12 4 15.5 4 18 5.12 18 6.5 16.88 9 15.5 9"}),"ImageSearch");const I0=eu("SLAUGHTER_ENTER_BAR_WEIGHT",async(e,{dispatch:n})=>{try{n($());const{data:s,status:a}=await D.post("kill_house_assignment_information/",e);return n(B()),{data:s,status:a}}catch(s){return n(B()),{error:s.response.data.result}}}),B0=eu("SLAUGHTER_UPDATE_BAR_WEIGHT",async(e,{dispatch:n})=>{try{n($());const{data:s,status:a}=await D.put("kill_house_assignment_information/0/",e);return n(B()),{data:s,status:a}}catch(s){return n(B()),{error:s.response.data.result}}}),k0=eu("SLAUGHTER_GET_EXCLUSIVE_KILLERS",async(e,{dispatch:n})=>{n($());const{data:s,status:a}=await D.get("kill_house/?exclusive-killers=true");return n(B()),{data:s,status:a}}),X6=({data:e,reqKey:n,isRejected:s,item:a,realNumber:i,updateTable:d})=>{const[x]=C.useContext(uu),[h,j]=L6.useState([]),[b,p]=L6.useState(null),{weightRange:w}=Wu(y=>y.provinceSlice),F=y=>{var E;if(j(y),l.setFieldValue("weightWithBarImg",""),p(null),y[0]){const V=(E=y[0])==null?void 0:E.file;O6(V,z=>{const o=H6(z);p(o),l.setFieldValue("weightWithBarImg",o)})}else l.setFieldValue("weightWithBarImg","")},[f,_]=C.useState(0),I=Q();let T=0;const l=Ku({initialValues:{weightWithoutBar:"",weightWithBar:"",weightWithBarImg:"",loadRealNumber:a.acceptedRealQuantity?a.acceptedRealQuantity:i,exploitedCarcass:0},validationSchema:M6({weightWithoutBar:ku().min(0,"عدد منفی وارد نکنید!").required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),weightWithBar:ku().test("len","وزن با بار باید بیشتر از وزن بدون بار باشد!",(y,E)=>E.originalValue&&E.originalValue>T).required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!"),weightWithBarImg:Nu().required("این فیلد اجباری است!"),loadRealNumber:ku().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),exploitedCarcass:ku().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!")})});T=Number(l.values.weightWithoutBar),C.useEffect(()=>{l.validateForm()},[]),C.useEffect(()=>{var y,E;(s||a)&&(l.setFieldValue("weightWithoutBar",(y=a.assignmentInfo)==null?void 0:y.carWeightWithoutLoad),l.setFieldValue("weightWithBar",(E=a.assignmentInfo)==null?void 0:E.carWeightWithLoad))},[]),C.useEffect(()=>{const y=Number(l.values.weightWithoutBar),E=Number(l.values.weightWithBar);E&&(y{I(k0()).then(y=>{k(y.payload.data)})},[]);const X=y=>{P(y==null?void 0:y.target.value)},R=v()!=="KillHouse"?"ثبت اطلاعات بجای کشتارگاه":"ثبت اطلاعات";return u.jsxs(c,{container:!0,direction:"column",children:[u.jsx(c,{children:u.jsx(v0,{columns:["کدبار","مرغداری","تعداد تخصیصی (قطعه)","تعداد تحویلی (قطعه)","وزن تحویلی (کیلوگرم)","میانگین وزن تحویلی هر قطعه (کیلوگرم)","سن","تاریخ کشتار","کشتارکن اختصاصی"],data:e})}),u.jsxs(c,{container:!0,direction:"column",alignItems:"start",my:W.SMALL,gap:W.SMALL,children:[u.jsxs(c,{container:!0,gap:W.TINY,children:[u.jsxs(g,{variant:"body2",color:"primary",fontWeight:"bold",children:["اطلاعات بار با کدبار ",e[0][0]," را وارد کنید."]}),(s||a.assignmentInfo)&&u.jsx(g,{variant:"body2",color:"error",fontWeight:"bold",children:"توجه: حتما باید اطلاعات جدید دوباره وارد گردد. (سند ماشین و وزن ماشین)"}),s&&u.jsx(u.Fragment,{children:u.jsxs(g,{variant:"body2",color:"error",fontWeight:"bold",children:["(","اطلاعات بار توسط واحد مالی استان رد شده است.",")"]})})]}),u.jsx(c,{container:!0,direction:"column",gap:W.SMALL,children:u.jsxs(c,{container:!0,gap:W.SMALL,alignItems:"normal",children:[u.jsxs(c,{container:!0,direction:"column",children:[u.jsx(Du,{allowLeadingZeros:!0,thousandSeparator:",",id:"weightWithoutBar",label:"وزن ماشین بدون بار باسکول شده",variant:"outlined",value:l.values.weightWithoutBar,error:l.touched.weightWithoutBar?!!l.errors.weightWithoutBar:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.weightWithoutBar&&l.errors.weightWithoutBar?l.errors.weightWithoutBar:null}),u.jsx(P6,{onChange:F,images:h,maxNumber:1,title:"بارگذاری سند"}),a.assignmentInfo.imageWithBar&&u.jsxs(c,{container:!0,direction:"column",alignItems:"center",mt:W.SMALL,children:[u.jsx("a",{href:a.assignmentInfo.imageWithBar,children:u.jsx("img",{src:a.assignmentInfo.imageWithBar,width:"100",height:"100",alt:"killHouseImageWithLoad"})}),u.jsx(g,{variant:"caption",children:"سند ماشین با بار بارگذاری شده"})]})]}),u.jsx(c,{container:!0,direction:"column",children:u.jsx(Du,{allowLeadingZeros:!0,thousandSeparator:",",id:"weightWithBar",label:"وزن ماشین با بار باسکول شده",variant:"outlined",value:l.values.weightWithBar,error:l.touched.weightWithBar?!!l.errors.weightWithBar:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.weightWithBar&&l.errors.weightWithBar?l.errors.weightWithBar:null})}),u.jsx(c,{container:!0,direction:"column",children:u.jsx(Du,{allowLeadingZeros:!0,thousandSeparator:",",style:{width:130},id:"loadRealNumber",label:"تعداد واقعی بارگیری",variant:"outlined",value:l.values.loadRealNumber,error:l.touched.loadRealNumber?!!l.errors.loadRealNumber:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.loadRealNumber&&l.errors.loadRealNumber?l.errors.loadRealNumber:null})}),u.jsx(c,{container:!0,direction:"column",children:u.jsx(Du,{disabled:!0,allowLeadingZeros:!0,thousandSeparator:",",style:{width:150},id:"exploitedCarcass",label:"لاشه استحصالی",variant:"outlined",value:l.values.exploitedCarcass,error:l.touched.exploitedCarcass?!!l.errors.exploitedCarcass:null,onChange:l.handleChange,onBlur:l.handleBlur,helperText:l.touched.exploitedCarcass&&l.errors.exploitedCarcass?l.errors.exploitedCarcass:null})}),u.jsxs(c,{container:!0,direction:"column",children:[u.jsx(g,{color:y=>y.palette.grey.A700,variant:"caption",children:"وزن بار وارد شده"}),u.jsxs(g,{variant:"button",children:[f," کیلوگرم "]})]}),(q==null?void 0:q.length)>1&&u.jsxs(c,{container:!0,direction:"column",gap:1,alignItems:"center",children:[u.jsxs(Pu,{children:[u.jsx($6,{id:"demo-simple-select-label",children:"انتخاب کشتارکن"}),u.jsx(T6,{label:"کشتارکن",value:L,onChange:X,children:q==null?void 0:q.map((y,E)=>u.jsx(V6,{value:y==null?void 0:y.key,children:y==null?void 0:y.name},E))})]}),u.jsx(c,{children:u.jsx(g,{sx:{fontSize:"12px"},color:"red",children:"ویرایش کشتارکن اختصاصی (اختیاری)"})})]}),u.jsx(c,{container:!0,direction:"column",alignItems:"center",children:u.jsx(U,{variant:"contained",disabled:!l.isValid,onClick:()=>{var E,V,z,o,M,S;const y=t=>{t.payload.error?x({vertical:"top",horizontal:"center",msg:t.payload.error,severity:"error"}):(l.setFieldValue("weightWithBar",""),l.setFieldValue("weightWithoutBar",""),p(null),j([]),x({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),I(N6({right:!1,top:!1,bottom:!1,content:null,size:null})),d(1))};if(((E=a==null?void 0:a.killhouseUser)==null?void 0:E.maximumLoadVolumeReduction)!==0&&l.values.loadRealNumber<(a==null?void 0:a.acceptedRealQuantity)*(1-((V=a==null?void 0:a.killhouseUser)==null?void 0:V.maximumLoadVolumeReduction)/100)||((z=a==null?void 0:a.killhouseUser)==null?void 0:z.maximumLoadVolumeIncrease)!==0&&l.values.loadRealNumber>(a==null?void 0:a.acceptedRealQuantity)*(1+((o=a==null?void 0:a.killhouseUser)==null?void 0:o.maximumLoadVolumeIncrease)/100))x({vertical:"top",horizontal:"center",msg:"حجم وارد شده با مجوز حداکثر افزایش/کاهش ورود اطلاعات بار مطابقت ندارد!",severity:"error"});else if(v()!=="SuperAdmin"&&v()!=="AdminX"&&!Y6(w,(M=a==null?void 0:a.poultryRequest)==null?void 0:M.age,parseInt(f)/parseInt(l.values.loadRealNumber)))x({vertical:"top",horizontal:"center",msg:"میانگین وزنی با احراز سنی مطابقت ندارد. لطفا با اتحادیه تماس بگیرید.",severity:"error"});else if(s||((S=a.assignmentInfo)==null?void 0:S.assignmentState)===!0){const t={car_weight_with_load:l.values.weightWithBar,car_weight_without_load:l.values.weightWithoutBar,car_with_load_image:b,key:a.assignmentInfo.assignmentKey,real_quantity:l.values.loadRealNumber,exploited_carcass:l.values.exploitedCarcass,role:v(),killer_key:L||null};I(B0(t)).then(y)}else{const t={car_weight_with_load:l.values.weightWithBar,car_weight_without_load:l.values.weightWithoutBar,car_with_load_image:b,real_quantity:l.values.loadRealNumber,exploited_carcass:l.values.exploitedCarcass,kill_house_request_key:n,role:v(),killer_key:L||null};t.kill_house_check_key||delete t.kill_house_check_key,I(I0(t)).then(y)}},children:R})})]})})]})]})};X6.propTypes={data:su.PropTypes.array,reqKey:su.PropTypes.string,checkKey:su.PropTypes.string,isRejected:su.PropTypes.bool,item:su.PropTypes.any,realNumber:su.PropTypes.any};const Z6=({item:e,updateTable:n})=>{var d,x,h,j,b,p,w,F,f;const s=Q(),a=(e==null?void 0:e.acceptedRealWeight)/(e==null?void 0:e.acceptedRealQuantity),i=[[e.barCode,`${(x=(d=e.poultryRequest)==null?void 0:d.poultry)==null?void 0:x.unitName} (${(j=(h=e.poultryRequest.poultry)==null?void 0:h.user)==null?void 0:j.mobile})`,e.quantity.toLocaleString(),e!=null&&e.acceptedRealQuantity?(b=e==null?void 0:e.acceptedRealQuantity)==null?void 0:b.toLocaleString():"وارد نشده",e!=null&&e.acceptedRealWeight?(p=e==null?void 0:e.acceptedRealWeight)==null?void 0:p.toLocaleString():"وارد نشده",a?a.toFixed(2):"وارد نشده",(w=e==null?void 0:e.poultryRequest)==null?void 0:w.age,Ou(new Date((F=e==null?void 0:e.poultryRequest)==null?void 0:F.sendDate),"yyyy/MM/dd"),(f=e==null?void 0:e.killer)==null?void 0:f.name]];return C.useEffect(()=>{s(z6())},[]),u.jsxs(u0,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(e0,{children:[u.jsx(r0,{color:"secondary"}),u.jsx(t0,{})]}),u.jsxs(c,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(c,{container:!0,children:[u.jsx(c,{children:u.jsx(a0,{variant:"body1",fontWeight:"bold",color:"secondary",children:"انجام عملیات"})}),u.jsx(c,{children:u.jsx(n0,{color:"textSecondary",children:u.jsx(g,{variant:"body2",children:"در این مرحله اطلاعات مربوط به وزن و سند باسکول را وارد نمایید."})})})]}),u.jsx(c,{container:!0,direction:"column",justifyContent:"space-between",children:u.jsx(c,{children:u.jsx(X6,{data:i,realNumber:e.quantity,reqKey:e.key,isRejected:e!=null&&e.assignmentInfo?(e==null?void 0:e.assignmentInfo.state)==="rejected":null,item:e,updateTable:n})})})]})]})};Z6.propTypes={file:su.PropTypes.object};var Gu={},L0=Hu;Object.defineProperty(Gu,"__esModule",{value:!0});var J6=Gu.default=void 0,W0=L0(Uu()),D0=u;J6=Gu.default=(0,W0.default)((0,D0.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"DeleteForever");const q0=eu("VET_FARM_DELETE_BAR",async(e,{dispatch:n})=>{n($());try{const{data:s,status:a}=await D.delete("delete-bar/0/",{params:e});return n(B()),{data:s,status:a}}catch(s){return n(B()),{error:s.response.data.result}}}),$0=({updateTable:e,item:n})=>{const s=Q(),[a]=C.useContext(uu);return u.jsxs(c,{container:!0,xs:12,justifyContent:"center",children:[u.jsx(g,{variant:"body2",color:"error",children:"پس از حذف امکان بازگشت تغییرات مقدور نیست!"}),u.jsxs(c,{container:!0,gap:W.SMALL,xs:12,mt:2,justifyContent:"center",children:[u.jsx(U,{color:"error",variant:"contained",onClick:()=>{if(!(n!=null&&n.barCode)){a({vertical:"top",horizontal:"center",msg:"کد بار یافت نشد!",severity:"error"});return}s($()),s(q0({bar_code:n.barCode})).then(i=>{var d,x,h,j,b;if(i!=null&&i.error||(d=i==null?void 0:i.payload)!=null&&d.error){const p=((x=i.payload)==null?void 0:x.error)||((h=i.error)==null?void 0:h.message)||"",w=p.includes("500")||((j=i.error)==null?void 0:j.status)===500||((b=i.error)==null?void 0:b.statusCode)===500;a(w?{vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}:{vertical:"top",horizontal:"center",msg:p||"مشکلی در حذف بار پیش آمده است!",severity:"error"})}else e&&typeof e=="function"&&e(),s(lu()),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})}).catch(i=>{var j;console.error("Error deleting bar:",i);const d=(i==null?void 0:i.message)||"",x=(j=i==null?void 0:i.response)==null?void 0:j.status,h=d.includes("500")||x===500;a({vertical:"top",horizontal:"center",msg:h?"مشکلی در دریافت اطلاعات پیش آمده است!":"مشکلی در حذف بار پیش آمده است!",severity:"error"})}).finally(()=>{s(B())})},children:"بله"}),u.jsx(U,{variant:"outlined",onClick:()=>{s(lu())},children:"خیر"})]})]})};var Xu={},T0=Hu;Object.defineProperty(Xu,"__esModule",{value:!0});var m6=Xu.default=void 0,V0=T0(Uu()),z0=u;m6=Xu.default=(0,V0.default)((0,z0.jsx)("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-1 9h-4v4h-2v-4H9V9h4V5h2v4h4z"}),"LibraryAdd");const M0=eu("VET-FARM_SAVE_PRICE_SERVICE",async(e,{dispatch:n})=>{n($());try{const{data:s,status:a}=await D.put("kill_house_request_pricing/0/",e);return n(B()),{data:s,status:a}}catch(s){return n(B()),{error:s.response.data.result}}}),N0=({item:e,updateTable:n})=>{const[s]=C.useContext(uu),[a,i]=C.useState([]),[d,x]=C.useState(!1),h=Q(),j=!!(e!=null&&e.priceRegisterDate),b=w=>{i(w)},p=Ku({initialValues:{key:e.key||"",price:(e==null?void 0:e.price)||"",description:(e==null?void 0:e.description)||"",settlementType:(e==null?void 0:e.settlement_type)||"cash"},validationSchema:M6({price:ku().required("لطفا قیمت را وارد کنید").typeError("لطفا یک عدد معتبر وارد کنید").min(0,"قیمت نمی‌تواند منفی باشد"),description:Nu().required("این فیلد اجباری است!").min(10,"توضیحات باید حداقل ۱۰ کاراکتر باشد").max(500,"توضیحات نمی‌تواند بیشتر از ۵۰۰ کاراکتر باشد"),settlementType:Nu().required("نوع تسویه الزامی است")}),onSubmit:w=>{x(!0);const F=new FormData;F.append("key",e==null?void 0:e.key),F.append("settlement_type",w.settlementType),F.append("price",w.price),F.append("description",w.description),a.forEach(f=>{F.append("file",f)}),h(M0(F)).then(f=>{f.payload.error?s({vertical:"top",horizontal:"center",msg:f.payload.error,severity:"error"}):(x(!1),n(),h(lu()),s({vertical:"top",horizontal:"center",msg:j?"ویرایش با موفقیت انجام شد.":"ثبت با موفقیت انجام شد.",severity:"success"}))})}});return C.useEffect(()=>{j&&p.setValues({key:(e==null?void 0:e.key)||"",price:e.price||"",description:e.description||"",settlementType:e.settlement_type||"cash"}),p.validateForm()},[e]),u.jsx("form",{onSubmit:p.handleSubmit,children:u.jsxs(c,{container:!0,spacing:2,justifyContent:"center",alignItems:"center",children:[u.jsx(c,{item:!0,xs:12,children:u.jsxs(Pu,{component:"fieldset",fullWidth:!0,children:[u.jsx(o0,{component:"legend",children:"نوع تسویه"}),u.jsxs(s0,{row:!0,"aria-label":"payment-type",name:"settlementType",value:p.values.settlementType,onChange:p.handleChange,children:[u.jsx(zu,{value:"cash",control:u.jsx(k6,{}),label:"نقدی"}),u.jsx(zu,{value:"term",control:u.jsx(k6,{}),label:"مدت دار"})]})]})}),u.jsx(c,{item:!0,xs:12,children:u.jsx(O,{fullWidth:!0,id:"price",name:"price",label:"قیمت (ریال)",variant:"outlined",type:"number",InputProps:{inputProps:{min:0,step:1e3}},value:p.values.price,error:p.touched.price&&!!p.errors.price,onChange:p.handleChange,onBlur:p.handleBlur,helperText:p.touched.price&&p.errors.price})}),u.jsx(c,{item:!0,xs:12,children:u.jsx(O,{multiline:!0,minRows:3,maxRows:6,fullWidth:!0,id:"description",name:"description",label:"توضیحات",variant:"outlined",value:p.values.description,error:p.touched.description&&!!p.errors.description,onChange:p.handleChange,onBlur:p.handleBlur,helperText:p.touched.description&&p.errors.description})}),u.jsxs(c,{item:!0,xs:12,children:[u.jsx(g,{color:"textSecondary",gutterBottom:!0,children:j?"فایل‌های موجود:":"لطفا فایل‌های مورد نیاز را آپلود کنید"}),u.jsx(g,{color:"error",gutterBottom:!0,children:j?"توجه: آپلود فایل جدید باعث جایگزینی فایل‌های قبلی می‌شود":"حداکثر حجم هر فایل: 5MB"}),u.jsx(j0,{onChange:b})]}),u.jsx(c,{item:!0,xs:12,children:u.jsx(U,{type:"submit",fullWidth:!0,variant:"contained",color:"primary",disabled:!p.isValid||d,startIcon:d?u.jsx(l0,{size:20}):null,children:d?"در حال ارسال...":j?"ویرایش قیمت ":"ثبت گزارش قیمت"})})]})})},P0=({item:e,updateTable:n,isComplete:s})=>{var o;const a=Q(),[i,d]=C.useState(null),x=c0(),h=v(),j=h==="SuperAdmin",b=h==="Supporter",p=h==="ProvinceOperator",w=h==="CityVet",F=h==="VetFarm",f=h==="AdminX",_=j||b,I=f||j||b,T=e.assignmentStateArchive==="pending"&&e.trash!==!0&&!F,l=j||b||p||w,q=!F,k=s,L=!s&&I,P=!s,X=()=>u.jsx(Mu,{component:"span",sx:{display:"flex",alignItems:"center"},children:u.jsx(Qu,{size:20,color:x.palette.success.main})}),R=({title:M,IconComponent:S,colorKey:t,onClick:N,disabled:K=!1,hidden:ru=!1,componentProps:tu,placement:au="left"})=>{var J;if(ru)return null;const Y=((J=x.palette[t])==null?void 0:J.main)??x.palette.primary.main,nu=i0(Y,.1),Z=()=>{K||N==null||N()},ou=G=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),Z())};return u.jsx(c,{item:!0,children:u.jsx(Lu,{title:M,placement:au,children:u.jsx("span",{style:{width:"100%",display:"block"},children:u.jsxs(Mu,{role:"button",tabIndex:0,onClick:Z,onKeyDown:ou,...tu,sx:{display:"flex",alignItems:"center",gap:1.5,px:1.5,py:1,borderRadius:1,cursor:K?"not-allowed":"pointer",opacity:K?.4:1,transition:"background-color 0.2s ease",textDecoration:"none","&:hover":{backgroundColor:K?"transparent":nu}},children:[u.jsx(S,{sx:{color:Y}}),u.jsx(g,{variant:"body2",sx:{color:Y,fontWeight:500},children:M})]})})})})},y=M=>{d(M.currentTarget)},E=()=>{d(null)},V=!!i,z=V?"popover":void 0;return u.jsxs(c,{container:!0,children:[u.jsx(Vu,{"aria-describedby":z,variant:"contained",color:"primary",onClick:y,children:u.jsx(y0,{})}),u.jsx(C0,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:z,open:V,anchorEl:i,onClose:E,children:u.jsx(c,{style:{padding:"10px 6px"},children:u.jsxs(c,{container:!0,direction:"column",spacing:1,children:[R({title:"ثبت وضعیت سند",IconComponent:G6,colorKey:"primary",hidden:!_,disabled:((o=e.assignmentInfo)==null?void 0:o.assignmentState)===!1,onClick:()=>{E(),a(m({title:"ثبت وضعیت سند",content:u.jsx(w0,{item:e,updateTable:n})}))}}),R({title:"ورود اطلاعات بار",IconComponent:Q6,colorKey:"primary",hidden:!k,placement:"right",onClick:()=>{E(),a(N6({title:"انجام عملیات تخصیص",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Z6,{updateTable:n,item:e})}))}}),R({title:"لغو بار",IconComponent:f0,colorKey:"error",hidden:!T,disabled:l,onClick:()=>{E(),a(m({title:"لغو بار",content:u.jsx(F0,{updateTable:n,killHouseRequestKey:e.key})}))}}),R({title:"حذف کامل بار",IconComponent:J6,colorKey:"error",hidden:!L,disabled:e==null?void 0:e.trash,onClick:()=>{E(),a(m({title:"آیا از حذف بار اطمینان دارید؟",content:u.jsx($0,{updateTable:n,item:e})}))}}),R({title:"خروجی اکسل",IconComponent:X,colorKey:"success",hidden:!P,placement:"left",onClick:()=>E(),componentProps:{component:"a",href:`${D.defaults.baseURL}bar_for_each_persion_excel/?code=${e.barCode}`,rel:"noreferrer",target:"_blank"}}),R({title:e!=null&&e.priceRegisterDate?"ویرایش گزارش قیمت":"ثبت گزارش قیمت",IconComponent:m6,colorKey:"primary",hidden:!q,placement:"left-start",onClick:()=>{E(),a(m({title:e!=null&&e.priceRegisterDate?"ویرایش گزارش قیمت":"ثبت گزارش قیمت",content:u.jsx(N0,{updateTable:n,item:e})}))}})]})})})]})},Ce=()=>{var t,N,K,ru,tu,au,Y,nu,Z,ou,J,G,Cu,iu,du,hu,pu,Au;const[,,e,n,s,a]=C.useContext(uu),[i,d]=C.useState(!1),x=()=>{d(!i)},[h,j]=C.useState([]),[b,p]=C.useState(0),[w,F]=C.useState(10),[f,_]=C.useState(""),[I,T]=C.useState(1),[l,q]=C.useState([]),k=Wu(A=>A.userSlice.userProfile.key),L=Q();C.useEffect(()=>{const A=cu(new Date).format("YYYY-MM-DD");n(A),a(A)},[]);const P=async A=>{let r;L($()),r=await D.get(`kill_house_assignment_information/?search=filter&value=${f}&role=${v()}&date1=${e}&date2=${s}&page=${A||1}&page_size=${w}&without_bar_document=${i}`),L(B()),j(r.data.results),p(r.data.count)},X=A=>{P(A),T(A)},R=A=>{F(A),T(1)};C.useEffect(()=>{P(1)},[]);const y=async A=>{A.preventDefault(),L($());try{const r=await D.get(`kill_house_assignment_information/?role=${v()}&search=filter&value=${f}&date1=${e}&date2=${s}&page=1&page_size=${w}&without_bar_document=${i}`);j(r.data.results),p(r.data.count),L(B())}catch(r){console.error("Error fetching data:",r)}},E=A=>{_(A.target.value)},V=A=>{n(A)},z=A=>{a(A)},[o,M]=C.useState([]);C.useEffect(()=>{L(h0({selectedDate1:e,selectedDate2:s,textValue:f,hasDocumentState:i})).then(A=>{M(A.payload.data)})},[e,s,i]),C.useEffect(()=>{P(1)},[e,s,i,w]);const S=A=>{let r="";return A!=null&&A.wareHouseConfirmation?r="ورود به انبار":(A==null?void 0:A.assignmentStateArchive)!=="pending"?r="ثبت اطلاعات بار":A.trash===!0?r="حذف شده":A.vetState==="accepted"?r="تایید تخلیه":A.vetState==="pending"&&(r="در انتظار تخلیه"),r};return C.useEffect(()=>{const A=h==null?void 0:h.map((r,H)=>{var gu,Fu,xu,yu,fu,vu,ju,Su,_u,wu,Eu,bu,Ru,Iu,Bu,Zu,Ju,mu,u6,e6,r6,t6,a6,n6,o6,s6,l6,c6,C6,i6,d6,h6,p6,A6,g6,F6,x6,y6,f6,v6,j6,S6,_6,w6,E6,b6,R6,I6,B6;return[I===1?H+1:H+w*(I-1)+1,u.jsx(P0,{item:r,updateTable:P,isComplete:!0},H),u.jsx(g,{style:{fontSize:"13px",color:r!=null&&r.trash?"red":"black"},children:S(r)},H),u.jsx(g,{style:{fontSize:"13px",color:r!=null&&r.trash?"red":"black"},children:r.barCode},H),p0(r.createDate),(gu=r==null?void 0:r.poultryRequest)!=null&&gu.freezing?"انجماد":(Fu=r==null?void 0:r.poultryRequest)!=null&&Fu.export?"صادرات":"عادی",u.jsx(g,{variant:"body2",color:(xu=r==null?void 0:r.barDocumentStatus)!=null&&xu.isError?"error":"primary",children:(yu=r==null?void 0:r.barDocumentStatus)!=null&&yu.title?(fu=r==null?void 0:r.barDocumentStatus)==null?void 0:fu.title:"-"},H),u.jsx(qu,{src:(vu=r==null?void 0:r.assignmentInfo)==null?void 0:vu.imageWithBar},H),(ju=r.acceptedRealQuantity)==null?void 0:ju.toLocaleString(),(Su=r==null?void 0:r.acceptedRealWeight)==null?void 0:Su.toLocaleString(),(wu=(_u=r==null?void 0:r.weightInfo)==null?void 0:_u.finalIndexWeight)==null?void 0:wu.toLocaleString(),`${(Eu=r.killhouseUser)==null?void 0:Eu.name} (${(Iu=(Ru=(bu=r.killhouseUser)==null?void 0:bu.killHouseOperator)==null?void 0:Ru.user)==null?void 0:Iu.mobile})`,r!=null&&r.killer?`${(Bu=r==null?void 0:r.killer)==null?void 0:Bu.name} (${(mu=(Ju=(Zu=r==null?void 0:r.killer)==null?void 0:Zu.killHouseOperator)==null?void 0:Ju.user)==null?void 0:mu.mobile})`:"-",`${(r6=(e6=(u6=r.poultryRequest)==null?void 0:u6.poultry)==null?void 0:e6.user)==null?void 0:r6.fullname} (${(a6=(t6=r.poultryRequest.poultry)==null?void 0:t6.user)==null?void 0:a6.mobile})`,`${(o6=(n6=r.poultryRequest)==null?void 0:n6.poultry)==null?void 0:o6.unitName}`,(s6=r==null?void 0:r.poultryRequest)==null?void 0:s6.age,(l6=r.quantity)==null?void 0:l6.toLocaleString(),(C6=(c6=r==null?void 0:r.weightInfo)==null?void 0:c6.weight)==null?void 0:C6.toLocaleString(),u.jsx(c,{children:u.jsx(K6,{updateTable:P,killHouseRequestKey:r.key,trafficCode:r==null?void 0:r.trafficCode,isEditable:((i6=r==null?void 0:r.killer)==null?void 0:i6.key)&&(v()==="KillHouse"||v()==="AdminX"||v()==="VetFarm"||v()==="ProvinceOperator"||v()==="KillHouseVet"||v()==="SuperAdmin"||v()==="Supporter")})},H),((d6=r==null?void 0:r.amount)==null?void 0:d6.toLocaleString())+" ﷼",r!=null&&r.clearanceCode?r==null?void 0:r.clearanceCode:"-",r!=null&&r.quarantineQuantity?r==null?void 0:r.quarantineQuantity:r!=null&&r.quarantineCodeState?(r==null?void 0:r.quarantineCodeState)==="contradiction"?"مغایرت کد رهگیری":(r==null?void 0:r.quarantineCodeState)==="noclearance"?"فاقد کد رهگیری":(r==null?void 0:r.quarantineCodeState)==="merge"?"ادغام":"عدم تایید راهداری":"-",`${r.addCar.driver.typeCar} ${r.addCar.driver.pelak}`,`${r.addCar.driver.driverName} (${r.addCar.driver.driverMobile})`,r.poultryRequest.chickenBreed,(p6=(h6=r==null?void 0:r.weightInfo)==null?void 0:h6.indexWeight)==null?void 0:p6.toLocaleString(),((g6=(A6=r==null?void 0:r.poultryRequest)==null?void 0:A6.amount)==null?void 0:g6.toLocaleString())+" ﷼",((x6=(F6=r==null?void 0:r.weightInfo)==null?void 0:F6.killHousePrice)==null?void 0:x6.toLocaleString())+" ﷼",(v6=(f6=(y6=r==null?void 0:r.vetFarm)==null?void 0:y6.vet)==null?void 0:f6.user)!=null&&v6.fullname?((_6=(S6=(j6=r==null?void 0:r.vetFarm)==null?void 0:j6.vet)==null?void 0:S6.user)==null?void 0:_6.fullname)+`(${(b6=(E6=(w6=r==null?void 0:r.vetFarm)==null?void 0:w6.vet)==null?void 0:E6.user)==null?void 0:b6.mobile})`:"فاقد دامپزشک",`${r.killPlace}`,r.poultryRequest.poultry.address.city.name,r!=null&&r.poultryRequest.sendDate?Ou(new Date(r==null?void 0:r.poultryRequest.sendDate),"yyyy/MM/dd"):"-",r==null?void 0:r.poultryRequest.orderCode,(R6=r==null?void 0:r.wareHouseAcceptedRealQuantity)==null?void 0:R6.toLocaleString(),(I6=r==null?void 0:r.wareHouseAcceptedRealWeight)==null?void 0:I6.toLocaleString(),(B6=r==null?void 0:r.weightLoss)==null?void 0:B6.toLocaleString()]});q(A)},[h]),u.jsx(Mu,{width:"100%",mt:2,children:u.jsx(c,{display:"flex",alignItems:"center",justifyContent:"center",direction:"row",gap:W.SMALL,children:u.jsxs(c,{container:!0,justifyContent:"center",gap:W.SMALL,xs:12,children:[u.jsxs(c,{container:!0,alignItems:"center",gap:W.SMALL,xs:12,children:[u.jsx(c,{style:{width:"150px"},children:u.jsx($u,{label:"از تاریخ",id:"date",renderInput:A=>u.jsx(O,{...A}),value:e,onChange:A=>{V(cu(A).format("YYYY-MM-DD"))}})}),u.jsx(c,{style:{width:"150px"},children:u.jsx($u,{label:"تا تاریخ",id:"date",renderInput:A=>u.jsx(O,{...A}),value:s,onChange:A=>{z(cu(A).format("YYYY-MM-DD"))}})}),u.jsxs("form",{onSubmit:y,children:[u.jsx(O,{autoComplete:"off",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:E}),u.jsx(U,{type:"submit",onClick:y,endIcon:u.jsx(U6,{}),children:"جستجو"})]}),!!(h!=null&&h.length)&&u.jsx(c,{children:u.jsx(Lu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${D.defaults.baseURL}bar_excel/?start=${e}&end=${s}&state=completed&role=${v()}&key=${k}&search=filter&value=${f}`,rel:"noreferrer",children:u.jsx(U,{color:"success",children:u.jsx(Qu,{size:32})})})})}),(v()==="SuperAdmin"||v()==="Supporter"||v()==="AdminX")&&u.jsx(zu,{control:u.jsx(d0,{checked:i,onChange:x,name:"item4"}),label:"بدون وضعیت سند"})]}),u.jsx(c,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(Tu,{title:"خلاصه اطلاعات",noPagination:!0,isDashboard:!0,columns:["تعداد بارها","حجم بارها","وزن بارها","میانگین وزن","کمترین سن ","بیشترین سن ","میانگین سنی","بارهای دارای کد قرنطینه","حجم بارهای دارای کد قرنطینه","بارهای احراز شده از قرنطینه","حجم بارهای احراز شده از قرنطینه","بارهای فاقد کد قرنطینه","حجم بارهای فاقد کد قرنطینه","بارهایی که در قرنطینه و رصدیار اختلاف دارند","بارهای تکمیل شده کشتارگاه","حجم نهایی در کشتارگاه ","وزن نهایی در کشتارگاه","تعداد بار ورودی به انبار","حجم لاشه های انبار","وزن لاشه های انبار","درصد افت بار انبار"],data:[[u.jsx(g,{variant:"caption",style:{color:"blue"},children:(t=o==null?void 0:o.lenKillRequest)==null?void 0:t.toLocaleString()},"1"),u.jsx(g,{variant:"caption",children:(N=o==null?void 0:o.killRequestQuantity)==null?void 0:N.toLocaleString()},"1"),u.jsx(g,{variant:"caption",style:{color:"blue"},children:(K=o==null?void 0:o.killRequestWeight)==null?void 0:K.toLocaleString()},"1"),u.jsx(g,{variant:"caption",children:o==null?void 0:o.avgWeight},"1"),u.jsx(g,{variant:"caption",style:{color:"blue"},children:o==null?void 0:o.minAge},"1"),u.jsx(g,{variant:"caption",children:o==null?void 0:o.maxAge},"1"),u.jsx(g,{variant:"caption",style:{color:"blue"},children:o==null?void 0:o.avgAge},"1"),u.jsx(g,{variant:"caption",children:(ru=o==null?void 0:o.lenKillRequestHasCode)==null?void 0:ru.toLocaleString()},"1"),u.jsx(g,{variant:"caption",style:{color:"blue"},children:(tu=o==null?void 0:o.quantityOfKillRequestHasCode)==null?void 0:tu.toLocaleString()},"1"),u.jsx(g,{variant:"caption",children:(au=o==null?void 0:o.lenKillRequestHasQuarantine)==null?void 0:au.toLocaleString()},"1"),u.jsx(g,{variant:"caption",style:{color:"blue"},children:(Y=o==null?void 0:o.quantityOfKillRequestHasQuarantine)==null?void 0:Y.toLocaleString()},"1"),u.jsx(g,{variant:"caption",children:(nu=o==null?void 0:o.lenKillRequestHasNotCode)==null?void 0:nu.toLocaleString()},"1"),u.jsx(g,{variant:"caption",style:{color:"blue"},children:(Z=o==null?void 0:o.quantityOfKillRequestHasNotCode)==null?void 0:Z.toLocaleString()},"1"),u.jsx(g,{variant:"caption",children:(ou=o==null?void 0:o.differenceBar)==null?void 0:ou.toLocaleString()},"1"),u.jsx(g,{variant:"caption",style:{color:"blue"},children:(J=o==null?void 0:o.lenCompleteWithKillHouse)==null?void 0:J.toLocaleString()},"1"),u.jsx(g,{variant:"caption",children:(G=o==null?void 0:o.quantityFinalKillHouse)==null?void 0:G.toLocaleString()},"1"),u.jsx(g,{variant:"caption",style:{color:"blue"},children:(Cu=o==null?void 0:o.weightFinalKillHouse)==null?void 0:Cu.toLocaleString()},"1"),u.jsx(g,{variant:"caption",children:(iu=o==null?void 0:o.wareHouseBars)==null?void 0:iu.toLocaleString()},"1"),u.jsx(g,{variant:"caption",style:{color:"blue"},children:(du=o==null?void 0:o.wareHouseBarsQuantity)==null?void 0:du.toLocaleString()},"1"),u.jsx(g,{variant:"caption",children:(hu=o==null?void 0:o.wareHouseBarsWeight)==null?void 0:hu.toLocaleString()},"1"),u.jsx(g,{variant:"caption",style:{color:"blue"},children:(Au=(pu=o==null?void 0:o.wareHouseBarsWeightLose)==null?void 0:pu.toFixed(2))==null?void 0:Au.toLocaleString()},"1")]]})}),u.jsx(Tu,{data:l,columns:["ردیف","عملیات","وضعیت","کدبار","تاریخ ثبت خودرو","نوع کشتار","وضعیت سند","سند (بارنامه)","تعداد نهایی","وزن نهایی بار (کیلوگرم)","میانگین وزن نهایی (کیلوگرم)","خریدار","کشتارکن اختصاصی","مشخصات مرغدار","نام فارم","سن مرغ","تعداد اولیه","وزن اولیه بار (کیلوگرم)","کد بهداشتی حمل و نقل","قیمت مرغ زنده‌ی بار","کدرهگیری سامانه قرنطینه","تعداد در قرنطینه","ماشین","راننده","نژاد","میانگین وزن اولیه (کیلوگرم)","قیمت مرغدار","قیمت کشتارگاه","دامپزشک فارم","محل کشتار","شهر","تاریخ کشتار","کدسفارش کشتار","حجم لاشه","وزن لاشه","درصد افت"],handlePageChange:X,totalRows:b,page:I,perPage:w,handlePerRowsChange:R,title:"بارهای تکمیل شده"})]})})})};export{ce as E,Ce as S,P0 as V,Z6 as a,_0 as b,k0 as s}; diff --git a/build/assets/SlaughterManageDispensers-CeviUzsS.js b/build/assets/SlaughterManageDispensers-CeviUzsS.js new file mode 100644 index 0000000..b18ed78 --- /dev/null +++ b/build/assets/SlaughterManageDispensers-CeviUzsS.js @@ -0,0 +1 @@ +import{i as Q,j as u,ak as z,B as P,T as G,b as I,a3 as L}from"./mui-vendor-CkIVaoQP.js";import{r as s}from"./react-vendor-CmFgShSM.js";import{r as Z,L as uu,j as eu,h as w,A as su,b1 as cu,O as tu,u as du,c as Cu,X as au,C as k,M as xu,G as i,S as N,bT as hu,p as mu,W as X,v as Y}from"./index-CeyyVc1v.js";import{a as lu,u as ru}from"./redux-vendor-B7uoacJt.js";import{B as vu}from"./BackButton-Crzr7NMa.js";import{d as q}from"./Person-Q1IHBezR.js";import{d as R}from"./Badge-u1S44abW.js";import{d as W}from"./Business-J-mGuLnc.js";import{a as yu,s as pu}from"./slaughter-house-submit-dispenser-service-AaVrL_nR.js";import{R as _u}from"./ResponsiveTable-w7hk7Uq8.js";import{R as Au}from"./index.esm-Bu7XMDZU.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./iconBase-BEJYyZsk.js";var J={},ju=Q;Object.defineProperty(J,"__esModule",{value:!0});var ou=J.default=void 0,fu=ju(Z()),gu=u;ou=J.default=(0,fu.default)((0,gu.jsx)("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday");var U={},Fu=Q;Object.defineProperty(U,"__esModule",{value:!0});var iu=U.default=void 0,bu=Fu(Z()),Su=u;iu=U.default=(0,bu.default)((0,Su.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 3c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6m7 13H5v-.23c0-.62.28-1.2.76-1.58C7.47 15.82 9.64 15 12 15s4.53.82 6.24 2.19c.48.38.76.97.76 1.58z"}),"AccountBox");const Eu=lu("SLAUGHTER_GET_DISPENSER_USER_INFO_SERVICE",async(a,{dispatch:l})=>{var e,v,p,m,h,C;try{l(uu());const{data:c,status:j}=await eu.get(`get_dispenser_user_info/?national_code=${a}`);return l(w()),c&&c.status===!1?{error:c.errorDescription||"خطا در دریافت اطلاعات"}:{data:c,status:j}}catch(c){return l(w()),{error:((v=(e=c.response)==null?void 0:e.data)==null?void 0:v.errorDescription)||((m=(p=c.response)==null?void 0:p.data)==null?void 0:m.result)||((C=(h=c.response)==null?void 0:h.data)==null?void 0:C.message)||"خطا در دریافت اطلاعات"}}}),y=({icon:a,label:l,value:e,iconSx:v})=>u.jsxs(I,{display:"flex",alignItems:v?"flex-start":"center",gap:1,px:1.5,py:.5,bgcolor:"#f5f5f5",borderRadius:1,children:[u.jsx(a,{color:"action",sx:v}),u.jsxs(I,{children:[u.jsx(G,{variant:"caption",color:"text.secondary",children:l}),u.jsx(G,{variant:"body1",children:e||"-"})]})]}),Nu=()=>Cu({mobile:xu().required("شماره همراه الزامی است").matches(/^09\d{9}$/,"شماره تلفن باید با 09 شروع شود و 11 رقم باشد")}),Du=({formik:a,userInfo:l})=>u.jsx("form",{onSubmit:a.handleSubmit,children:u.jsxs(i,{container:!0,gap:N.SMALL,p:2,children:[u.jsx(i,{item:!0,xs:12,children:u.jsx(G,{variant:"h6",style:{fontSize:"16px"},gutterBottom:!0,children:"اطلاعات توزیع کننده"})}),l&&u.jsxs(i,{container:!0,spacing:2,xs:12,mb:2,children:[u.jsx(i,{item:!0,xs:12,children:u.jsx(G,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,sx:{mb:1},children:"اطلاعات شخصی"})}),u.jsx(i,{item:!0,xs:12,md:4,children:u.jsx(y,{icon:R,label:"کد ملی",value:l.nationalCode||a.values.national_id})}),l.fatherName&&u.jsx(i,{item:!0,xs:12,md:4,children:u.jsx(y,{icon:q,label:"نام پدر",value:l.fatherName})}),l.birthDate&&u.jsx(i,{item:!0,xs:12,md:4,children:u.jsx(y,{icon:ou,label:"تاریخ تولد",value:l.birthDate})}),l.gender!==void 0&&u.jsx(i,{item:!0,xs:12,md:4,children:u.jsx(y,{icon:iu,label:"جنسیت",value:l.gender?"مرد":"زن"})}),l.identityNo&&l.identityNo!=="0"&&u.jsx(i,{item:!0,xs:12,md:4,children:u.jsx(y,{icon:R,label:"شماره شناسنامه",value:l.identityNo})}),l.identitySeries&&u.jsx(i,{item:!0,xs:12,md:4,children:u.jsx(y,{icon:R,label:"سری شناسنامه",value:l.identitySeries})}),l.identitySerial&&u.jsx(i,{item:!0,xs:12,md:4,children:u.jsx(y,{icon:R,label:"سریال شناسنامه",value:l.identitySerial})})]}),u.jsxs(i,{container:!0,spacing:2,xs:12,children:[u.jsx(i,{item:!0,xs:12,md:6,children:u.jsxs(i,{container:!0,direction:"column",gap:N.SMALL,children:[u.jsx(i,{item:!0,xs:12,children:u.jsx(y,{icon:q,label:"نام",value:a.values.first_name})}),u.jsx(i,{item:!0,xs:12,children:u.jsx(y,{icon:q,label:"نام خانوادگی",value:a.values.last_name})}),u.jsx(i,{item:!0,xs:12,children:u.jsx(z,{label:"شماره همراه",variant:"outlined",fullWidth:!0,id:"mobile",name:"mobile",value:a.values.mobile,onChange:a.handleChange,onBlur:a.handleBlur,error:!!a.errors.mobile,helperText:a.errors.mobile,inputProps:{maxLength:11}})})]})}),u.jsx(i,{item:!0,xs:12,md:6,children:u.jsxs(i,{container:!0,direction:"column",gap:N.SMALL,children:[u.jsx(i,{item:!0,xs:12,children:u.jsx(y,{icon:hu,label:"شهر",value:a.values.city})}),u.jsx(i,{item:!0,xs:12,children:u.jsx(y,{icon:W,label:"نوع توزیع کننده",value:a.values.dispenser_type==="inductor"?"واسطه":a.values.dispenser_type==="salesman"?"فروشنده":a.values.dispenser_type==="driver"?"راننده":a.values.dispenser_type})}),a.values.dispenser_type==="driver"&&u.jsxs(u.Fragment,{children:[u.jsx(i,{item:!0,xs:12,children:u.jsx(y,{icon:W,label:"نوع خودرو",value:a.values.driver_car_type})}),a.values.pelak&&u.jsx(i,{item:!0,xs:12,children:u.jsx(y,{icon:R,label:"پلاک خودرو",value:a.values.pelak})})]}),u.jsx(i,{item:!0,xs:12,children:u.jsx(y,{icon:W,label:"سقف محدودیت",value:a.values.limitation_amount||0})})]})})]}),u.jsx(i,{item:!0,xs:12,mt:2,children:u.jsx(P,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,disabled:!a.isValid,children:"ثبت"})})]})}),Lu=({onInquiry:a,nationalCode:l,setNationalCode:e})=>u.jsxs(i,{container:!0,gap:N.SMALL,p:2,children:[u.jsx(i,{item:!0,xs:12,children:u.jsx(z,{label:"کد ملی",variant:"outlined",fullWidth:!0,value:l,onChange:v=>e(v.target.value),placeholder:"کد ملی 10 رقمی را وارد کنید",inputProps:{maxLength:10}})}),u.jsx(i,{item:!0,xs:12,children:u.jsx(P,{color:"primary",fullWidth:!0,variant:"contained",onClick:a,disabled:!l||l.length!==10,children:"استعلام"})})]}),nu=({onClose:a,updateTable:l,dispenser:e,initialUserData:v,initialUserInfo:p,initialNationalCode:m})=>{var B,D,T,n,r,A,f;const h=ru(),[C]=s.useContext(su),[c,j]=s.useState(m||((B=e==null?void 0:e.user)==null?void 0:B.nationalId)||(e==null?void 0:e.national_id)||""),[t,M]=s.useState(v||(e?{national_id:((D=e==null?void 0:e.user)==null?void 0:D.nationalId)||"",first_name:((T=e==null?void 0:e.user)==null?void 0:T.firstName)||"",last_name:((n=e==null?void 0:e.user)==null?void 0:n.lastName)||"",city:((A=(r=e==null?void 0:e.user)==null?void 0:r.city)==null?void 0:A.cityName)||"",mobile:((f=e==null?void 0:e.user)==null?void 0:f.mobile)||"",dispenser_type:(e==null?void 0:e.dispenserType)||"inductor",limitation_amount:(e==null?void 0:e.limitation_amount)||0,driver_car_type:(e==null?void 0:e.car)||"",pelak:(e==null?void 0:e.pelak)||""}:null)),[O,_]=s.useState(!!e),[V,g]=s.useState([]),[E,F]=s.useState(p||null),b=s.useRef(!!v);s.useEffect(()=>{h(cu()).then(x=>{g(x.payload.data||[])})},[h]),s.useEffect(()=>{if(t&&!b.current&&!e){b.current=!0;const x=window.innerWidth>600,o=t,d=E,S=c;h(tu({title:"ثبت توزیع کننده جدید",content:u.jsx(nu,{onClose:a,updateTable:l,initialUserData:o,initialUserInfo:d,initialNationalCode:S}),size:x?600:300}))}},[t,h,a,l,e,E,c]);const $=s.useCallback(()=>{if(!c||c.length!==10){C({vertical:"top",horizontal:"center",msg:"لطفا کد ملی 10 رقمی معتبر وارد کنید",severity:"error"});return}h(Eu(c)).then(x=>{if(x.payload.error)_(!1),F(null),C({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"});else if(x.payload.data){const o=x.payload.data;if(o.status===!0&&o.data){const d=o.data;_(!0),F(d),console.log(d),M({national_id:d.nationalCode||c,first_name:d.firstName||"",last_name:d.lastName||"",city:d.city||"",mobile:"",dispenser_type:"inductor",limitation_amount:0}),C({vertical:"top",horizontal:"center",msg:"اطلاعات با موفقیت دریافت شد",severity:"success"})}else if(o.status===!1)_(!1),F(null),C({vertical:"top",horizontal:"center",msg:o.errorDescription||"خطا در دریافت اطلاعات",severity:"error"});else{const d=o.data||o;d&&d.nationalCode?(_(!0),F(d),M({national_id:d.nationalCode||c,first_name:d.firstName||"",last_name:d.lastName||"",city:d.city||"",mobile:"",dispenser_type:"inductor",limitation_amount:0}),C({vertical:"top",horizontal:"center",msg:"اطلاعات با موفقیت دریافت شد",severity:"success"})):(_(!1),F(null),C({vertical:"top",horizontal:"center",msg:"خطا در دریافت اطلاعات",severity:"error"}))}}})},[h,c,C]),H=du({initialValues:{national_id:(t==null?void 0:t.national_id)||(t==null?void 0:t.nationalCode)||(t==null?void 0:t.nationalId)||"",first_name:(t==null?void 0:t.first_name)||"",last_name:(t==null?void 0:t.last_name)||"",city:(t==null?void 0:t.city)||"",mobile:(t==null?void 0:t.mobile)||"",dispenser_type:(t==null?void 0:t.dispenser_type)||"inductor",limitation_amount:(t==null?void 0:t.limitation_amount)||0,driver_car_type:(t==null?void 0:t.driverCarType)||(t==null?void 0:t.car)||"",pelak:(t==null?void 0:t.pelak)||""},validationSchema:Nu(),enableReinitialize:!0,onSubmit:x=>{const o=E,d={nationalCode:x.national_id||"",firstName:x.first_name||"",lastName:x.last_name||"",fatherName:(o==null?void 0:o.fatherName)||null,gender:(o==null?void 0:o.gender)!==void 0?o.gender:null,isLive:(o==null?void 0:o.isLive)!==void 0?o.isLive:!0,identityNo:(o==null?void 0:o.identityNo)||null,birthDate:(o==null?void 0:o.birthDate)||null,city:x.city||(o==null?void 0:o.city)||"",mobile:x.mobile,role:au()};e!=null&&e.key?h(yu({type:"update-profile",dispenser_key:e.key,...d})).then(S=>{S.payload.error?C({vertical:"top",horizontal:"center",msg:S.payload.error,severity:"error"}):(C({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),l&&l(),h(k()))}):h(pu(d)).then(S=>{S.payload.error?C({vertical:"top",horizontal:"center",msg:S.payload.error,severity:"error"}):(C({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),l&&l(),h(k()))})}});return!t&&!e?u.jsx(Lu,{onInquiry:$,nationalCode:c,setNationalCode:j}):u.jsx(Du,{formik:H,cities:V,userInfo:E})},K=lu("SLAUGHTER_GET_DISPENSER_INFO_SERVICE",async(a,{dispatch:l})=>{var e,v,p;try{l(uu());const{data:m,status:h}=await eu.get("dispenser-info/",{params:{role:au(),search:a.search||"filter",value:a.value||"",page:a.page||1,page_size:a.page_size||10,...a.date_from&&{date_from:a.date_from},...a.date_to&&{date_to:a.date_to}}});return l(w()),{data:m,status:h}}catch(m){return l(w()),{error:((v=(e=m.response)==null?void 0:e.data)==null?void 0:v.result)||((p=m.response)==null?void 0:p.data)||"خطا در دریافت اطلاعات"}}}),Wu=()=>{const a=ru(),[l,e]=s.useState([]),[v,p]=s.useState(0),[m,h]=s.useState(10),[C,c]=s.useState(""),[j,t]=s.useState(1),[M,O]=s.useState([]),[_,V]=s.useState(null),[g,E]=s.useState(null),F=n=>c(n.target.value),b=async n=>{var A,f;const r=await a(K({search:"filter",value:C,page:n,page_size:m,..._&&{date_from:Y(_).format("YYYY-MM-DD")},...g&&{date_to:Y(g).format("YYYY-MM-DD")}}));if(r.payload.error)console.error("Error fetching data:",r.payload.error),e([]),p(0);else{e(((A=r.payload.data)==null?void 0:A.results)||[]);const x=Number((f=r.payload.data)==null?void 0:f.count)||0;p(x)}},$=n=>{b(n),t(n)},H=n=>{h(Number(n)),t(1)},B=()=>{b(j!==0?j:1)};s.useEffect(()=>{if(!l||!Array.isArray(l)){O([]);return}const n=l.map((r,A)=>[j===1?A+1:A+m*(j-1)+1,(r==null?void 0:r.nationalId)||"-",(r==null?void 0:r.firstName)||"-",(r==null?void 0:r.lastName)||"-",(r==null?void 0:r.mobile)||"-",(r==null?void 0:r.city)||"-",(r==null?void 0:r.province)||"-",(r==null?void 0:r.active)!==void 0?r.active?"فعال":"غیرفعال":"-",r!=null&&r.createDate?mu(r.createDate):"-"]);O(n)},[l,j,m]),s.useEffect(()=>{b(1),t(1)},[m]),s.useEffect(()=>{b(1)},[]);const D=async n=>{var A,f;n.preventDefault(),t(1);const r=await a(K({search:"filter",value:C,page:1,page_size:m,..._&&{date_from:Y(_).format("YYYY-MM-DD")},...g&&{date_to:Y(g).format("YYYY-MM-DD")}}));if(r.payload.error)console.error("Error fetching data:",r.payload.error),e([]),p(0);else{e(((A=r.payload.data)==null?void 0:A.results)||[]);const x=Number((f=r.payload.data)==null?void 0:f.count)||0;p(x)}},T=()=>{a(tu({title:"ثبت توزیع کننده جدید",content:u.jsx(nu,{onClose:()=>a(k()),updateTable:B}),size:300}))};return u.jsx(I,{display:"flex",justifyContent:"center",children:u.jsxs(L,{container:!0,xs:12,sm:12,md:10,lg:10,children:[u.jsx(L,{item:!0,xs:12,children:u.jsx(vu,{})}),u.jsxs(L,{container:!0,item:!0,gap:N.SMALL,children:[u.jsx(P,{variant:"contained",color:"primary",onClick:T,children:"ثبت توزیع کننده جدید"}),u.jsx("form",{onSubmit:D,children:u.jsxs(L,{container:!0,alignItems:"center",gap:N.SMALL,children:[u.jsx(z,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:200},value:C,onChange:F}),u.jsx(X,{label:"از تاریخ",value:_,onChange:n=>{V(n)},renderInput:n=>u.jsx(z,{...n,size:"small",style:{width:160}})}),u.jsx(X,{label:"تا تاریخ",value:g,onChange:n=>{E(n)},renderInput:n=>u.jsx(z,{...n,size:"small",style:{width:160}})}),u.jsx(P,{type:"submit",onClick:D,endIcon:u.jsx(Au,{}),children:"جستجو"})]})})]}),u.jsx(L,{item:!0,xs:12,mt:2,children:u.jsx(_u,{title:"توزیع کنندگان",columns:["ردیف","کد ملی","نام","نام خانوادگی","شماره همراه","شهر","استان","وضعیت","تاریخ ایجاد"],customWidth:"100%",data:M,handlePageChange:$,totalRows:v,page:j,perPage:m,handlePerRowsChange:H})})]})})};export{Wu as default}; diff --git a/build/assets/SlaughterManageInventoryAllocationOperations-Bla8JB6Q.js b/build/assets/SlaughterManageInventoryAllocationOperations-Bla8JB6Q.js new file mode 100644 index 0000000..d9c89e3 --- /dev/null +++ b/build/assets/SlaughterManageInventoryAllocationOperations-Bla8JB6Q.js @@ -0,0 +1 @@ +import{j as e,ak as $,al as X,ag as uu,ah as eu,ai as L,aj as P,T as au,B as S,I as fu,b0 as mu,an as xu,b4 as vu,ap as Au,aq as Fu}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./react-vendor-CmFgShSM.js";import{d as Su}from"./Tune-D4M2CAhp.js";import{d as bu}from"./Edit-CqBj1Y2L.js";import{d as ju}from"./CheckCircleOutline-Ci9-hVKX.js";import{d as wu}from"./Delete-C5MyLelE.js";import{A as ru,e8 as ku,j as Du,c as Eu,b as _u,v as d,u as Bu,fF as Tu,fG as Lu,G as h,W as Pu,C as b,fH as ou,O as G,S as tu}from"./index-CeyyVc1v.js";import{u as lu}from"./redux-vendor-B7uoacJt.js";import{M as Mu,S as Yu,s as zu}from"./SlaughterAllocateToGuild-Dfz5LRq5.js";import{s as Wu,a as Ou,b as $u}from"./slaughter-get-guilds-for-allocate-B6OrhhMj.js";import{N as Gu}from"./NumberFormatCustom-DwWPj40N.js";import{L as Nu}from"./LabelField-B6eRSoQP.js";const Ru=({sellerType:m,fetchData:n,sellType:j,updateTable:w,fetchApiData:k,editData:r,priceInfo:y,remainWeight:g})=>{const p=lu(),[v,D]=a.useState([]),[i,M]=a.useState(null),[E,Y]=a.useState([]),[x,c]=a.useState(null),[f,nu]=a.useState("governmental"),[N,su]=a.useState((y==null?void 0:y.active)!==!1),[z]=a.useContext(ru),[iu,R]=a.useState(null),[V,cu]=a.useState({}),[_,H]=a.useState(null),[l,W]=a.useState(null),[A,du]=a.useState({governmental:[],free:[]}),I=a.useCallback(u=>{if(!Array.isArray(u))return{};const t={};return u.forEach(o=>{if(o.day&&o.amount!==void 0){const Q=new ku(new Date(o.day)).format("YYYY/MM/DD");t[Q]={value1:o.amount,originalDay:o.day,active:o.active===!0}}}),t},[]),B=a.useCallback(u=>{const t=I(u);cu(t)},[I]),F=a.useCallback(async u=>{try{const t=await Du.get("/kill-house-remain-weight/",{params:{date:u}});if(t.data){du({governmental:t.data.governmental||[],free:t.data.free||[]});const o=f==="governmental"?t.data.governmental:t.data.free;B(o)}}catch(t){console.error("Error fetching calendar data:",t)}},[f,B]),Cu=u=>{if(u&&u.formattedDate){R(u.formattedDate);const t=V[u.formattedDate];if(t&&t.originalDay){const o=t.originalDay;if(C&&d(o).isAfter(d(C),"day")){Z("تاریخ تولید نمی‌تواند بعد از تاریخ انتخابی باشد");return}Z(null),H(o)}t&&t.value1!==void 0?W(t.value1):W(null)}},hu=a.useCallback(()=>Eu({weight:_u().required("این فیلد اجباری است!").integer("عدد باید صحیح باشد!").min(1,"یک مقدار مثبت وارد کنید!").max(g+((r==null?void 0:r.realWeightOfCarcasses)||0),"وزن وارد شده بیش از موجودی انبار است!").test("max-production-date-amount",`وزن نمی‌تواند بیشتر از موجودی تاریخ تولید (${(l==null?void 0:l.toLocaleString())||0} کیلوگرم) باشد!`,function(u){return!l||l===null?!0:u<=l})}),[g,r,l])(),[C,gu]=a.useState(d(new Date).format("YYYY-MM-DD")),[q,O]=a.useState(null),[K,Z]=a.useState(null),s=Bu({initialValues:{weight:(r==null?void 0:r.realWeightOfCarcasses)||""},validationSchema:hu}),J=()=>{p(b()),z({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),p(ou()),k(),w()},pu=u=>{const t=u.target.value;nu(t)},yu=u=>{const t=u.target.value;su(t)};return a.useEffect(()=>{r||(p(Tu()).then(u=>{D(u.payload.data)}),p(Lu()).then(u=>{Y(u.payload.data)})),F(C)},[p,r,F,C]),a.useEffect(()=>{F(C)},[C,F]),a.useEffect(()=>{if(A.governmental.length>0||A.free.length>0){const u=f==="governmental"?A.governmental:A.free;B(u),R(null),H(null),W(null)}},[f,A,B]),a.useEffect(()=>{s.validateForm()},[l]),e.jsxs(h,{container:!0,xs:12,direction:"column",justifyContent:"center",alignItems:"center",gap:1,children:[!r&&e.jsx(Pu,{label:"تاریخ",id:"date",renderInput:u=>e.jsx($,{fullWidth:!0,...u,error:!!q||u.error,helperText:q||u.helperText}),shouldDisableDate:u=>{const t=d(u),o=d(),T=d().subtract(1,"day");return!(t.isSame(o,"day")||t.isSame(T,"day"))},value:C,onChange:u=>{if(!u){O(null);return}const t=d(u),o=d(),T=d().subtract(1,"day");if(!(t.isSame(o,"day")||t.isSame(T,"day"))){O("تنها امکان انتخاب «امروز» یا «دیروز» وجود دارد.");return}O(null);const U=d(u).format("YYYY-MM-DD");gu(U),F(U)}}),!r&&e.jsx(h,{xs:12,container:!0,children:e.jsx(X,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"hatching",options:v?v.map(u=>({data:u,label:`${u.name}`})):[],onChange:(u,t)=>{M(t.data)},renderInput:u=>e.jsx($,{fullWidth:!0,...u,label:"انتخاب محصول"})})}),!r&&e.jsx(h,{xs:12,container:!0,children:e.jsx(X,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"hatching",options:E?E.map(u=>({data:u,label:`${u.name}`})):[],onChange:(u,t)=>{var o;c((o=t.data)==null?void 0:o.key)},renderInput:u=>e.jsx($,{fullWidth:!0,...u,label:"انتخاب سردخانه"})})}),!r&&(y==null?void 0:y.active)&&e.jsx(uu,{children:e.jsxs(eu,{row:!0,"aria-labelledby":"segment-type-radio-group",name:"segmentType",value:N,onChange:yu,children:[e.jsx(L,{value:!0,control:e.jsx(P,{}),label:"قیمت دولتی"}),e.jsx(L,{value:!1,control:e.jsx(P,{}),label:"قیمت آزاد"})]})}),!r&&e.jsx(h,{my:1,xs:12,children:e.jsx(Nu,{label:"نوع انبار",children:e.jsx(uu,{children:e.jsxs(eu,{row:!0,"aria-labelledby":"segment-type-radio-group",name:"segmentType",value:f,onChange:pu,children:[e.jsx(L,{value:"governmental",control:e.jsx(P,{}),label:"دولتی"}),e.jsx(L,{value:"free",control:e.jsx(P,{}),label:"آزاد"})]})})})}),!r&&e.jsxs(h,{style:{width:"100%"},container:!0,xs:12,lg:3,justifyContent:"center",alignItems:"center",mb:3,mt:2,gap:1,children:[e.jsx(Mu,{onDateSelect:Cu,dayData:V,selectedDate:iu,maxGregorianDate:C,label:`تاریخ تولید گوشت ${l!==null?`(موجودی: ${l==null?void 0:l.toLocaleString()} کیلوگرم)`:""}`}),K&&e.jsx(au,{sx:{color:"#d32f2f",fontSize:"0.75rem",marginTop:"4px",marginRight:"14px",textAlign:"right"},children:K})]}),e.jsx(Gu,{allowLeadingZeros:!0,thousandSeparator:",",decimalScale:0,allowNegative:!1,fullWidth:!0,id:"weight",disabled:g<1,label:"وزن لاشه",variant:"outlined",value:s.values.weight,error:g<1?!0:s.touched.weight?!!s.errors.weight:l&&s.values.weight>l,onChange:u=>{const t=u.target.value;if(t===""||t===null||t===void 0){s.setFieldValue("weight","");return}const o=Math.floor(Number(t));o>0?s.setFieldValue("weight",o):o===0&&s.setFieldValue("weight","")},onBlur:s.handleBlur,helperText:g<1?"موجودی انبار خالی است!":l&&s.values.weight>l?`وزن نمی‌تواند بیشتر از موجودی تاریخ تولید (${l==null?void 0:l.toLocaleString()} کیلوگرم) باشد!`:s.touched.weight&&s.errors.weight?s.errors.weight:null}),e.jsx(S,{variant:"contained",fullWidth:!0,disabled:r?!s.isValid:!s.isValid||!i||!x||!_||l&&s.values.weight>l||_&&C&&d(_).isAfter(d(C),"day"),onClick:()=>{let u={};r?u={weight_of_carcasses:s.values.weight,allocation_key:r==null?void 0:r.key,distribution_type:"web"}:u={seller_type:m,product_key:i.key,type:"manual",number_of_carcasses:0,weight_of_carcasses:s.values.weight,approved_price_status:N==="true",quota:f,sell_type:j,buyer_type:"ColdHouse",cold_house_key:x,allocation_type:"ColdHouse",date:C,production_date:_,distribution_type:"web"},r?p(Ou(u)).then(t=>{t.payload.error?z({vertical:"top",horizontal:"center",msg:t.payload.error,severity:"error"}):J()}):p(Wu(u)).then(t=>{t.payload.error?z({vertical:"top",horizontal:"center",msg:t.payload.error,severity:"error"}):J()})},children:"ثبت"})]})},ae=({fetchApiData:m,item:n,priceInfo:j,remainWeight:w})=>{const[k,r]=a.useState(null),y=c=>{r(c.currentTarget)},g=()=>{r(null)},p=!!k,v=p?"popover":void 0,[D]=a.useContext(ru),i=lu(),M=()=>{g(),i(G({title:"ویرایش تخصیص",content:(n==null?void 0:n.allocationType)==="ColdHouse"?e.jsx(Ru,{fetchApiData:m,editData:n,priceInfo:j,remainWeight:w}):e.jsx(Yu,{fetchApiData:m,editData:n,priceInfo:j,remainWeight:w})}))},E=()=>{g(),i(G({title:"ثبت نهایی",content:e.jsxs(h,{container:!0,gap:tu.SMALL,children:[e.jsx(au,{children:"در صورت ثبت نهایی انجام هیچگونه عملیاتی مانند حذف و ویرایش امکان پذیر نمی باشد."}),e.jsxs(h,{container:!0,direction:"column",gap:tu.TINY,width:"100%",children:[e.jsx(S,{fullWidth:!0,variant:"contained",onClick:()=>{i(zu({steward_allocation_list:[n==null?void 0:n.key]})).then(c=>{i(b()),c.payload.error?D({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(m(1),D({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),e.jsx(S,{fullWidth:!0,color:"error",variant:"contained",onClick:()=>{i(b())},children:"لغو"})]})]})}))},Y=()=>{g(),i(G({title:"آیا مطمئن هستید؟",content:e.jsxs(h,{container:!0,spacing:2,children:[e.jsx(h,{item:!0,children:e.jsx(S,{variant:"contained",color:"error",onClick:()=>{i($u({steward_allocation_key:n.key})).then(()=>{i(b()),i(ou()),m(1)})},children:"تایید"})}),e.jsx(h,{item:!0,children:e.jsx(S,{onClick:()=>{i(b())},children:"لغو"})})]})}))},x=[{key:"edit",label:"ویرایش",icon:bu,color:"primary.main",action:M}];return n!=null&&n.registrationCode||x.push({key:"finalSubmit",label:"تایید نهایی",icon:ju,color:"info.main",action:E}),n!=null&&n.registrationCode||x.push({key:"delete",label:"حذف",icon:wu,color:"error.main",action:Y}),e.jsxs(h,{container:!0,children:[e.jsx(fu,{size:"small",disabled:n==null?void 0:n.registrationCode,"aria-describedby":v,variant:"contained",color:"primary",onClick:y,children:e.jsx(Su,{})}),e.jsx(mu,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:v,open:p,anchorEl:k,onClose:g,children:e.jsx(xu,{sx:{minWidth:160,p:.5},children:x.map(c=>{const f=c.icon;return e.jsxs(vu,{onClick:c.action,sx:{borderRadius:1,mb:.25,py:.5,"&:last-of-type":{mb:0}},children:[e.jsx(Au,{sx:{minWidth:32,color:c.color},children:e.jsx(f,{fontSize:"small"})}),e.jsx(Fu,{primary:c.label,primaryTypographyProps:{sx:{color:c.color,fontSize:"0.82rem",fontWeight:600}}})]},c.key)})})})]})};export{ae as S,Ru as a}; diff --git a/build/assets/SlaughterMorgue-G6AVluZe.js b/build/assets/SlaughterMorgue-G6AVluZe.js new file mode 100644 index 0000000..dea4d09 --- /dev/null +++ b/build/assets/SlaughterMorgue-G6AVluZe.js @@ -0,0 +1 @@ +import{j as u,I as fu,b0 as l6,B as O,ak as N,al as hu,ag as Zu,ah as Xu,ai as U,aj as J,aa as Ju,T as u6,d as t6,aX as r6,b2 as a6,b3 as Ku,b as n6}from"./mui-vendor-CkIVaoQP.js";import{r as a,j as e6,u as c6}from"./react-vendor-CmFgShSM.js";import{L as du,j as K,X as I,h as Cu,A as Su,G as g,O as Au,fF as d6,c as C6,M as gu,b as pu,u as i6,v as m,W as ju,C as Fu,fH as h6,p as g6,S as yu,dh as p6,fG as x6,jG as A6,jH as j6}from"./index-CeyyVc1v.js";import{R as Q}from"./ResponsiveTable-w7hk7Uq8.js";import{a as o6,u as D,f as Qu}from"./redux-vendor-B7uoacJt.js";import{R as F6,a as y6}from"./index.esm-Bu7XMDZU.js";import{d as s6}from"./Tune-D4M2CAhp.js";import{b as f6,e as S6,c as v6,s as w6,a as k6}from"./slaughter-get-guilds-for-allocate-B6OrhhMj.js";import{S as b6,s as _6}from"./SlaughterAllocateToGuild-Dfz5LRq5.js";import{N as xu}from"./NumberFormatCustom-DwWPj40N.js";import{I as E6,f as T6}from"./toBase64-BzgTOHsW.js";import{a as $6}from"./province-policy-upload-image-CRJ-U4Kc.js";import{B as H6}from"./BackButton-Crzr7NMa.js";import{d as P6}from"./Visibility-DeyjG-oI.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./iconBase-BEJYyZsk.js";import"./LabelField-B6eRSoQP.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./Delete-C5MyLelE.js";const B6=o6("SLAUGHTER_GET_MORGUE_DASHBOARD",async(x,{dispatch:l})=>{l(du());const{data:y,status:C}=await K.get("total-cold-house-dashboard-roles/",{params:{role:I()}});return l(Cu()),{data:y,status:C}}),L6=o6("SLAUGHTER_GET_MORGUES",async(x,{dispatch:l})=>{l(du());const{data:y,status:C}=await K.get("kill-house-cold-houses/",{params:{role:I()}});return l(Cu()),{data:y,status:C}}),G6=({fetchApiData:x,item:l,fetchData:y,updateTable:C,priceInfo:E,remainWeight:f})=>{const[A,w]=a.useState(null),h=v=>{w(v.currentTarget)},t=()=>{w(null)},n=!!A,S=n?"popover":void 0,[k]=a.useContext(Su),p=D();return u.jsxs(g,{container:!0,children:[u.jsx(fu,{disabled:l==null?void 0:l.registrationCode,"aria-describedby":S,variant:"contained",color:"primary",onClick:h,children:u.jsx(s6,{})}),u.jsx(l6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:S,open:n,anchorEl:A,onClose:t,children:u.jsx("div",{style:{padding:"20px",display:"flex",flexDirection:"column"},children:u.jsxs(g,{container:!0,direction:"column",gap:1,children:[u.jsx(O,{variant:"outlined",onClick:()=>{t(),p(Au({title:"ویرایش تخصیص",content:u.jsx(b6,{updateTable:y,fetchApiData:x,sellerType:"ColdHouse",sellType:"exclusive",coldHouseItemKey:l==null?void 0:l.key,priceInfo:E,editData:l,remainWeight:f})}))},children:"ویرایش"}),u.jsx(O,{size:"small",disabled:l==null?void 0:l.registrationCode,variant:"outlined",color:"error",onClick:()=>{t(),p(f6({steward_allocation_key:l.key})).then(v=>{v.error?k({vertical:"top",horizontal:"center",msg:v.payload.error,severity:"error"}):(x(1),y(),C(),k({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"حذف"})]})})})]})},R6=({item:x,key:l,sellerType:y,fetchData:C,buyerType:E,allocationType:f,sellType:A,updateTable:w,fetchApiData:h,editData:t,priceInfo:n,coldHouseKey:S,coldHouseItemKey:k,remainWeight:p,killHouseAllocation:v})=>{var X;const i=D(),[$,b]=a.useState([]),[B,L]=a.useState([]),[M,G]=a.useState([]),[W,j]=a.useState(null),[Y]=a.useContext(Su),[_,iu]=a.useState(n!=null&&n.active?"true":"false"),[uu,eu]=a.useState(t!=null&&t.image?[{data_url:t.image}]:[]),[R,ou]=a.useState("own"),[su,lu]=a.useState(1),[d,e]=a.useState(!1),tu=o=>{ou(o.target.value),V({key:"",item:"",buyerType:"",allocationType:""})},z=o=>{iu(o.target.value),o.target.value==="false"&&s.setFieldValue("price","")},[c,V]=a.useState({key:l,item:x,buyerType:E,allocationType:f});a.useEffect(()=>{I()==="Steward"&&ou("free")},[]),a.useEffect(()=>{i($6()).then(o=>{var r;(r=o.payload)!=null&&r.data&&lu(o.payload.data.killHouseAllocation)}),t||(i(d6()).then(o=>{b(o.payload.data)}),x||(R==="cold"&&i(S6()).then(o=>{G(o.payload.data)}),i(v6({free:R==="free"})).then(o=>{L(o.payload.data)})))},[i,R]);const ru=C6({weight:pu().required("این فیلد اجباری است!").min(1,"یک مقدار مثبت وارد کنید!").max(t?p+(t==null?void 0:t.realWeightOfCarcasses):p,"وزن وارد شده بیش از موجودی انبار است!"),price:pu().required("این فیلد اجباری است!").min(1,"یک مقدار مثبت وارد کنید!"),wholePrice:pu().required("این فیلد اجباری است!").min(1,"یک مقدار مثبت وارد کنید!"),...v&&{image:gu().when([],{is:()=>(!t||d)&&su>0,then:gu().required("عکس الزامی است"),otherwise:gu().notRequired()})}}),au=o=>{var r;o[0]?(s.setFieldValue("image",T6((r=o[0])==null?void 0:r.data_url)),e(!0)):(s.setFieldValue("image",""),e(!0)),eu(o)},s=i6({initialValues:{weight:(t==null?void 0:t.realWeightOfCarcasses)||"",wholePrice:(t==null?void 0:t.totalAmount)||"",price:(t==null?void 0:t.amount)||"",image:(t==null?void 0:t.image)||""},validationSchema:ru});a.useEffect(()=>{s.validateForm()},[]),a.useEffect(()=>{_==="false"?s.values.weight&&s.values.price&&s.setFieldValue("wholePrice",s.values.price*s.values.weight):n!=null&&n.active&&s.values.weight&&s.setFieldValue("wholePrice",(n==null?void 0:n.killHousePrice)*s.values.weight)},[s.values.price,s.values.weight,_]),a.useEffect(()=>{n!=null&&n.active&&_==="true"&&s.setFieldValue("price",n==null?void 0:n.killHousePrice)},[_]);const q=()=>{i(Fu()),Y({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),i(h6()),h&&h(1),w&&w(),C&&C(1)},[Z,nu]=a.useState(m(new Date).format("YYYY-MM-DD"));return u.jsxs(g,{container:!0,xs:12,direction:"column",justifyContent:"center",alignItems:"center",gap:1,children:[!t&&u.jsx(ju,{label:"تاریخ",id:"date",renderInput:o=>u.jsx(N,{fullWidth:!0,...o}),value:Z,onChange:o=>{nu(m(o).format("YYYY-MM-DD"))}}),!t&&!S&&u.jsx(g,{xs:12,container:!0,children:u.jsx(hu,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"hatching",options:$?$.map(o=>({data:o,label:`${o.name}`})):[],onChange:(o,r)=>{j(r.data)},renderInput:o=>u.jsx(N,{fullWidth:!0,...o,label:"انتخاب محصول"})})}),!t&&u.jsx(Zu,{children:u.jsxs(Xu,{row:!0,"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:R,onChange:tu,children:[u.jsx(U,{value:"own",control:u.jsx(J,{}),label:"صنوف اختصاصی"}),u.jsx(U,{value:"free",control:u.jsx(J,{}),label:"صنوف آزاد"}),u.jsx(U,{value:"cold",control:u.jsx(J,{}),label:"انتقال به سردخانه"})]})}),!x&&!t&&R!=="cold"&&u.jsx(g,{xs:12,container:!0,children:u.jsx(hu,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"hatching",options:B?B.map(o=>{var r,F;return{data:o,label:`${o!=null&&o.steward?"مباشر":"صنف"} ${o==null?void 0:o.guildsName} ${(r=o==null?void 0:o.user)==null?void 0:r.fullname} (${(F=o==null?void 0:o.user)==null?void 0:F.mobile})`}}):[],onChange:(o,r)=>{var F,H,P;V({item:r==null?void 0:r.data,key:(F=r==null?void 0:r.data)==null?void 0:F.key,allocationType:(H=r==null?void 0:r.data)!=null&&H.steward?"killhouse_steward":"killhouse_guild",buyerType:(P=r==null?void 0:r.data)!=null&&P.steward?"Steward":"Guild"})},renderInput:o=>u.jsx(N,{fullWidth:!0,...o,label:"انتخاب مباشر / صنف"})})}),!x&&!t&&R==="cold"&&u.jsx(g,{xs:12,container:!0,children:u.jsx(hu,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"hatching",options:M?M.map(o=>{var r,F,H,P,T;return{data:o,label:`سردخانه ${o==null?void 0:o.name} (${((F=(r=o==null?void 0:o.steward)==null?void 0:r.user)==null?void 0:F.mobile)||((T=(P=(H=o==null?void 0:o.killHouse)==null?void 0:H.killHouseOperator)==null?void 0:P.user)==null?void 0:T.mobile)})`}}):[],onChange:(o,r)=>{var F;V({item:r==null?void 0:r.data,key:(F=r==null?void 0:r.data)==null?void 0:F.key,allocationType:"ColdHouse",buyerType:"ColdHouse"})},renderInput:o=>u.jsx(N,{fullWidth:!0,...o,label:"انتخاب سردخانه"})})}),u.jsx(xu,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"weight",label:"وزن لاشه",variant:"outlined",value:s.values.weight,error:s.touched.weight&&!!s.errors.weight||p<=0,helperText:p<=0?"موجودی انبار کافی نیست":s.touched.weight&&s.errors.weight,onChange:s.handleChange,onBlur:s.handleBlur,disabled:p<1,sx:{"& .MuiFormHelperText-root":{color:p&&s.values.weight>p?"error.main":void 0}}}),(n==null?void 0:n.active)&&u.jsx(Zu,{children:u.jsxs(Xu,{row:!0,"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:_,onChange:z,children:[u.jsx(U,{value:"true",control:u.jsx(J,{}),label:"قیمت مصوب"}),u.jsx(U,{value:"false",control:u.jsx(J,{}),label:"قیمت آزاد"})]})}),u.jsx(xu,{disabled:(n==null?void 0:n.active)&&_==="true",allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"price",label:"قیمت هر کیلوگرم",variant:"outlined",InputProps:{endAdornment:u.jsx(Ju,{position:"start",children:"ریال"})},value:s.values.price,error:s.touched.price?!!s.errors.price:null,onChange:s.handleChange,onBlur:s.handleBlur,helperText:s.touched.price&&s.errors.price?s.errors.price:null}),u.jsx(xu,{disabled:!0,allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"wholePrice",label:"هزینه کل",variant:"outlined",InputProps:{endAdornment:u.jsx(Ju,{position:"start",children:"ریال"})},value:s.values.wholePrice,error:s.touched.wholePrice?!!s.errors.wholePrice:null,onChange:s.handleChange,onBlur:s.handleBlur,helperText:s.touched.wholePrice&&s.errors.wholePrice?s.errors.wholePrice:null}),(v||t&&t.image)&&u.jsxs(u.Fragment,{children:[u.jsx(E6,{onChange:au,images:uu,maxNumber:1,title:"بارگزاری سند"}),s.touched.image&&!!s.errors.image&&u.jsx(u6,{color:"error",children:"ثبت تصویر الزامی است"})]}),u.jsx(O,{variant:"contained",fullWidth:!0,disabled:t?!s.isValid:!s.isValid||(S?!1:!W)||!((X=c==null?void 0:c.item)!=null&&X.key),onClick:()=>{var r,F,H,P;let o={};k?o={allocation_key:k,number_of_carcasses:0,weight_of_carcasses:s.values.weight,amount:s.values.price,total_amount:s.values.wholePrice,...d&&{image:s.values.image}}:t?o={allocation_key:t==null?void 0:t.key,number_of_carcasses:0,weight_of_carcasses:s.values.weight,amount:s.values.price,total_amount:s.values.wholePrice,...d&&{image:s.values.image}}:(o={seller_type:y,buyer_type:c==null?void 0:c.buyerType,other_cold_house_key:(c==null?void 0:c.buyerType)==="ColdHouse"?(r=c==null?void 0:c.item)==null?void 0:r.key:null,guild_key:(c==null?void 0:c.buyerType)==="Guild"?(F=c==null?void 0:c.item)==null?void 0:F.key:null,steward_key:(c==null?void 0:c.buyerType)==="Steward"?(H=c==null?void 0:c.item)==null?void 0:H.key:null,kill_house_key:(c==null?void 0:c.buyerType)==="KillHouse"?(P=c==null?void 0:c.item)==null?void 0:P.key:null,cold_house_key:S||null,product_key:S?null:W.key,type:"manual",allocation_type:c==null?void 0:c.allocationType,number_of_carcasses:0,weight_of_carcasses:s.values.weight,sell_type:R==="cold"?"free":A,amount:s.values.price,total_amount:s.values.wholePrice,approved_price_status:_==="true",date:Z,...uu.length>0&&{image:s.values.image}},o=Object.fromEntries(Object.entries(o).filter(([T,cu])=>cu!==null))),t?i(k6(o)).then(T=>{T.payload.error?Y({vertical:"top",horizontal:"center",msg:T.payload.error,severity:"error"}):q()}):i(w6(o)).then(T=>{T.payload.error?Y({vertical:"top",horizontal:"center",msg:T.payload.error,severity:"error"}):q()})},children:"ثبت"})]})},Du=({selectedDate1:x,selectedDate2:l,title:y,type:C,withDate:E,coldHouseKey:f,getDashboardsData:A,remainWeight:w})=>{const h=D(),t=Qu(d=>d.userSlice.userProfile.key),[n]=a.useContext(Su),S=d=>{M(d.target.value)},{priceInfo:k}=Qu(d=>d.slaughterSlice),[p,v]=a.useState([]),[i,$]=a.useState(0),[b,B]=a.useState(10),[L,M]=a.useState(""),[G,W]=a.useState(1),[j,Y]=a.useState([]),_=async d=>{let e;h(du()),e=await K.get(`steward-allocation/?search=filter&value=${L}&role=${I()}${E?`&date1=${x}&date2=${l}`:""}&page=${d}&page_size=${b}&cold_house=true&type=${C}&cold_house_key=${f}`),h(p6()),h(Cu()),v(e.data.results),$(e.data.count)},iu=d=>{_(d),W(d)},uu=d=>{B(d),W(1)},eu=()=>{_(G!==0?G:1)},R=d=>d!=null&&d.systemRegistrationCode?[u.jsx(fu,{disabled:!0,"aria-label":"disabled-button",color:"primary",children:u.jsx(s6,{})},d)]:[u.jsx(G6,{fetchData:eu,fetchApiData:A,item:d,priceInfo:k,remainWeight:w},d)],ou=()=>C==="output"?["عملیات"]:[],su=y==="بارهای خارج شده";a.useEffect(()=>{const d=p==null?void 0:p.map((e,tu)=>{var c,V,ru,au,s,q,Z,nu,X,o,r,F,H,P,T,cu,vu,wu,ku,bu,_u,Eu,Tu,$u,Hu,Pu,Bu,Lu,Gu,Ru,Ou,Wu,Mu,Yu,zu,Nu,Vu,Uu,mu,Iu,qu;let z;switch(e==null?void 0:e.receiverState){case"pending":z="در انتظار تایید";break;case"accepted":z="تایید شده";break;case"rejected":z="رد شده";break;default:z="-"}return console.log(e),[G===1?tu+1:tu+b*(G-1)+1,g6(e==null?void 0:e.date),su?e!=null&&e.toGuilds?"سردخانه به صنف":e!=null&&e.otherColdHouse?"سردخانه به سردخانه":e!=null&&e.toSteward?"سردخانه به مباشر":"-":`${e!=null&&e.killHouse?"کشتارگاه":"سردخانه"} به سردخانه`,su?e!=null&&e.toGuilds?`${(c=e==null?void 0:e.toGuilds)==null?void 0:c.guildsName} ( ${(ru=(V=e==null?void 0:e.toGuilds)==null?void 0:V.user)==null?void 0:ru.fullname} ${(s=(au=e==null?void 0:e.toGuilds)==null?void 0:au.user)==null?void 0:s.mobile})`:e!=null&&e.otherColdHouse?(q=e==null?void 0:e.otherColdHouse)!=null&&q.steward?`${(X=(nu=(Z=e==null?void 0:e.otherColdHouse)==null?void 0:Z.steward)==null?void 0:nu.user)==null?void 0:X.fullname} (${(F=(r=(o=e==null?void 0:e.otherColdHouse)==null?void 0:o.steward)==null?void 0:r.user)==null?void 0:F.mobile})`:`${(P=(H=e==null?void 0:e.otherColdHouse)==null?void 0:H.killHouse)==null?void 0:P.name} (${(wu=(vu=(cu=(T=e==null?void 0:e.otherColdHouse)==null?void 0:T.killHouse)==null?void 0:cu.killHouseOperator)==null?void 0:vu.user)==null?void 0:wu.fullname} ${(Eu=(_u=(bu=(ku=e==null?void 0:e.otherColdHouse)==null?void 0:ku.killHouse)==null?void 0:bu.killHouseOperator)==null?void 0:_u.user)==null?void 0:Eu.mobile})`:`${(Tu=e==null?void 0:e.toSteward)==null?void 0:Tu.guildsName} (${(Hu=($u=e==null?void 0:e.toSteward)==null?void 0:$u.user)==null?void 0:Hu.fullname}${(Bu=(Pu=e==null?void 0:e.toSteward)==null?void 0:Pu.user)==null?void 0:Bu.mobile})`:e!=null&&e.killHouse?`${(Lu=e.toColdHouse)==null?void 0:Lu.name} (${(Wu=(Ou=(Ru=(Gu=e.toColdHouse)==null?void 0:Gu.killHouse)==null?void 0:Ru.killHouseOperator)==null?void 0:Ou.user)==null?void 0:Wu.mobile})`:`${(Mu=e==null?void 0:e.otherColdHouse)==null?void 0:Mu.name} ${(Vu=(Nu=(zu=(Yu=e==null?void 0:e.otherColdHouse)==null?void 0:Yu.killHouse)==null?void 0:zu.killHouseOperator)==null?void 0:Nu.user)==null?void 0:Vu.mobile}`,(e==null?void 0:e.sellType)==="exclusive"?"اختصاصی":"آزاد",((Uu=e==null?void 0:e.amount)==null?void 0:Uu.toLocaleString())+" ریال",((mu=e==null?void 0:e.totalAmount)==null?void 0:mu.toLocaleString())+" ریال",(Iu=e==null?void 0:e.realWeightOfCarcasses)==null?void 0:Iu.toLocaleString(),(qu=e==null?void 0:e.loggedRegistrationCode)==null?void 0:qu.toLocaleString(),(e==null?void 0:e.systemRegistrationCode)===!0?"کد احراز ارسال شده":"در انتظار ارسال کد احراز",z,...R(e)]});Y(d)},[p]),a.useEffect(()=>{_(1)},[h,x,l,b,E]);const lu=async d=>{d.preventDefault(),h(du());try{const e=await K.get(`steward-allocation/?role=${I()}&search=filter&value=${L}${E?`&date1=${x}&date2=${l}`:""}&page=1&page_size=${b}&cold_house=true&type=${C}&cold_house_key=${f}`);v(e.data.results),$(e.data.count),h(Cu())}catch(e){console.error("Error fetching data:",e)}};return u.jsxs(g,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(g,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(O,{variant:"contained",onClick:()=>{h(Au({title:"ثبت توزیع/ فروش سرد خانه",content:u.jsx(R6,{updateTable:A,sellerType:"ColdHouse",sellType:"exclusive",fetchApiData:_,coldHouseKey:f,remainWeight:w})}))},children:"ثبت توزیع/ فروش"}),C==="output"&&u.jsx(O,{disabled:!j.length,variant:"outlined",onClick:()=>{h(Au({title:"ثبت نهایی",content:u.jsxs(g,{container:!0,gap:yu.SMALL,children:[u.jsx(u6,{children:"در صورت ثبت نهایی انجام هیچگونه عملیاتی مانند حذف و ویرایش امکان پذیر نمی باشد."}),u.jsxs(g,{container:!0,direction:"column",gap:yu.TINY,width:"100%",children:[u.jsx(O,{fullWidth:!0,variant:"contained",onClick:()=>{h(_6({steward_allocation_list:p.map(d=>d.key)})).then(d=>{h(Fu()),d.payload.error?n({vertical:"top",horizontal:"center",msg:d.payload.error,severity:"error"}):(eu(),_(1),n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),u.jsx(O,{fullWidth:!0,color:"error",variant:"contained",onClick:()=>{h(Fu())},children:"لغو"})]})]})}))},children:"تایید نهایی (یکجا)"}),u.jsx(g,{children:u.jsxs("form",{onSubmit:lu,children:[u.jsx(N,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:S}),u.jsx(O,{type:"submit",onClick:lu,endIcon:u.jsx(F6,{}),children:"جستجو"})]})}),u.jsx(t6,{title:"خروجی اکسل",children:u.jsx(O,{color:"success",onClick:()=>{n({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const d=`${K.defaults.baseURL}cold_house_excel/?role=${I()}&key=${t}&type=${C}${E?`&date1=${x}&date2=${l}`:""}&cold_house_key=${f}&cold_house=true`;window.location.href=d},children:u.jsx(y6,{size:32})})})]}),u.jsx(Q,{data:j,columns:["ردیف","تاریخ ثبت","نوع تخصیص","مشخصات خریدار","نوع فروش","قیمت هر کیلو","قیمت کل","وزن تخصیصی","کد احراز","وضعیت کد احراز","وضعیت",...ou()],handlePageChange:iu,totalRows:i,page:G,perPage:b,handlePerRowsChange:uu,title:y})]})},O6=()=>{var $,b,B,L,M,G,W;const x=D(),[l,y]=a.useState([]),[C,E]=a.useState([]),{key:f}=e6(),[A,w]=a.useState(!1),[h,t]=a.useState(m(new Date).format("YYYY-MM-DD")),[n,S]=a.useState(m(new Date).format("YYYY-MM-DD")),k=()=>{x(x6({dashboard:!0,cold_house_key:f})).then(j=>{y(j.payload.data)}),x(A6({date1:A?h:null,date2:A?n:null,cold_house_key:f})).then(j=>{E(j.payload.data)})};a.useEffect(()=>{k()},[x,A,h,n]);const[p,v]=a.useState(0),i=(j,Y)=>{v(Y)};return u.jsx(u.Fragment,{children:u.jsxs(g,{container:!0,direction:"column",justifyContent:"center",xs:12,children:[u.jsxs(g,{container:!0,justifyContent:"space-between",gap:yu.SMALL,children:[u.jsx(Q,{noPagination:!0,columns:["وزن کل","وزن خارج شده","وزن باقیمانده"],data:[[($=l==null?void 0:l.totalInputWeight)==null?void 0:$.toLocaleString(),(b=l==null?void 0:l.totalAllocatedWeight)==null?void 0:b.toLocaleString(),(B=l==null?void 0:l.totalRemainWeight)==null?void 0:B.toLocaleString()]],title:"موجودی سردخانه",isDashboard:!0}),u.jsx(Q,{noPagination:!0,columns:["تعداد کل بارهای وارد شده","وزن کل بارهای وارد شده","تعداد کل بارهای خارج شده","وزن کل بارهای خارج شده"],data:[[(L=C==null?void 0:C.totalInputBars)==null?void 0:L.toLocaleString(),(M=C==null?void 0:C.totalInputBarsWeight)==null?void 0:M.toLocaleString(),(G=C==null?void 0:C.totalOutputBars)==null?void 0:G.toLocaleString(),(W=C==null?void 0:C.totalOutputBarsWeight)==null?void 0:W.toLocaleString()]],title:"خلاصه اطلاعات",isDashboard:!0})]}),u.jsx(g,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,width:"100%",children:u.jsxs(g,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},children:[u.jsx(g,{children:u.jsx(U,{control:u.jsx(r6,{checked:A,onChange:()=>w(!A),color:"primary"})})}),u.jsx(g,{children:u.jsx(ju,{disabled:!A,label:"از تاریخ",id:"date",renderInput:j=>u.jsx(N,{size:"small",style:{width:"160px"},...j}),value:h,onChange:j=>{t(m(j).format("YYYY-MM-DD"))}})}),u.jsx(g,{children:u.jsx(ju,{disabled:!A,label:"تا تاریخ",id:"date",renderInput:j=>u.jsx(N,{size:"small",style:{width:"160px"},...j}),value:n,onChange:j=>{S(m(j).format("YYYY-MM-DD"))}})})]})}),u.jsxs(g,{container:!0,xs:12,justifyContent:"center",children:[u.jsxs(a6,{sx:{mb:2},value:p,onChange:i,"aria-label":"simple tabs example",children:[u.jsx(Ku,{value:0,label:"بارهای خارج شده"}),u.jsx(Ku,{value:1,label:"بارهای وارد شده"})]}),p===0&&u.jsx(Du,{selectedDate1:h,selectedDate2:n,title:"بارهای خارج شده",type:"output",withDate:A,coldHouseKey:f,getDashboardsData:k,remainWeight:l==null?void 0:l.totalRemainWeight}),p===1&&u.jsx(Du,{selectedDate1:h,selectedDate2:n,title:"بارهای وارد شده",type:"input",withDate:A,coldHouseKey:f,getDashboardsData:k})]})]})})},l0=()=>{var w,h,t,n;const x=D(),[l,y]=a.useState([]),[C,E]=a.useState([]),f=c6(),{key:A}=e6();return a.useEffect(()=>{A||(x(B6()).then(S=>{y(S.payload.data)}),x(L6()).then(S=>{var p,v;const k=(v=(p=S.payload.data)==null?void 0:p.coldHouses)==null?void 0:v.map((i,$)=>{var b,B,L;return[$+1,i==null?void 0:i.name,(b=i==null?void 0:i.totalInputWeight)==null?void 0:b.toLocaleString(),(B=i==null?void 0:i.totalAllocatedWeight)==null?void 0:B.toLocaleString(),(L=i==null?void 0:i.totalRemainWeight)==null?void 0:L.toLocaleString(),u.jsx(fu,{color:"success",onClick:()=>{f(j6+"/"+(i==null?void 0:i.key))},children:u.jsx(P6,{})},$)]});E(k)}))},[x,A]),u.jsx(u.Fragment,{children:u.jsx(n6,{display:"flex",justifyContent:"center",children:u.jsx(g,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:A?u.jsxs(g,{container:!0,justifyContent:"start",alignItems:"center",xs:12,children:[u.jsx(H6,{}),u.jsx(O6,{})]}):u.jsxs(g,{container:!0,justifyContent:"space-between",alignItems:"center",children:[u.jsx(g,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(Q,{noPagination:!0,isDashboard:!0,columns:["تعداد سردخانه ها","وزن تخصیص داده شده","کل وزن وارد شده","وزن باقیمانده"],data:[[(w=l==null?void 0:l.totalColdHouses)==null?void 0:w.toLocaleString(),(h=l==null?void 0:l.totalAllocatedWeight)==null?void 0:h.toLocaleString(),(t=l==null?void 0:l.totalInputWeight)==null?void 0:t.toLocaleString(),(n=l==null?void 0:l.totalRemainWeight)==null?void 0:n.toLocaleString()]],title:"خلاصه اطلاعات"})}),u.jsx(g,{container:!0,xs:12,justifyContent:"center",alignItems:"cented",children:u.jsx(Q,{title:"سردخانه ها",paginated:!0,columns:["ردیف","نام سردخانه","وزن وارد شده","وزن خارج شده","وزن باقیمانده","نمایش"],data:C})})]})})})})};export{l0 as default}; diff --git a/build/assets/SlaughterPayFeesGateway-BhtyiEES.js b/build/assets/SlaughterPayFeesGateway-BhtyiEES.js new file mode 100644 index 0000000..6dd818a --- /dev/null +++ b/build/assets/SlaughterPayFeesGateway-BhtyiEES.js @@ -0,0 +1 @@ +import{j as e,bt as R,T as P}from"./mui-vendor-CkIVaoQP.js";import{r as n}from"./react-vendor-CmFgShSM.js";import{a as p,u as S}from"./redux-vendor-B7uoacJt.js";import{j as d,X as f,G as A,S as g}from"./index-CeyyVc1v.js";const j=p("SLAUGHTER_PAYMENT_REF_ID",async(t,{dispatch:o})=>{const{data:a,status:s}=await d.post("wage_payment/",t);return{data:a,status:s}}),w=p("PROVINCE_PAYMENT_REF_ID",async(t,{dispatch:o})=>{const{data:a,status:s}=await d.post("wage-payment-total/",t);return{data:a,status:s}}),k=p("PROVINCE_PAYMENT_REF_ID_WAGES",async(t,{dispatch:o})=>{const{data:a,status:s}=await d.post(`https://${t.backend}backend.rasadyar.com/wage-payment-with-link/`,t.data);return{data:a,status:s}}),b=({amount:t,user_key:o,amountWithTax:a,isZarinPal:s,isPayment:E,isPaymentData:_,backend:x})=>{const i=S(),l=n.useRef(),[h,I]=n.useState(),[c,m]=n.useState(),y=()=>{l.current.submit()};return n.useEffect(()=>{s?i(w({role:f(),total_amount:parseInt(t)})).then(r=>{var u;m((u=r.payload.data)==null?void 0:u.token)}):E?i(k({data:_,backend:x})).then(r=>{var u;m((u=r.payload.data)==null?void 0:u.token)}):i(j({role:f(),kill_house_key:o,payment_type:"auto",amount:parseInt(t),amount_with_tax:parseInt(a)})).then(r=>{I(r.payload.data.refId)})},[]),n.useEffect(()=>{h&&y()},[h]),n.useEffect(()=>{c&&y()},[c]),e.jsxs(A,{container:!0,direction:"column",width:"100%",gap:g.TINY,children:[e.jsx(R,{style:{width:"100%"}}),e.jsx(P,{textAlign:"center",children:"در حال انتقال به درگاه پرداخت..."}),e.jsx("div",{style:{display:"none"},children:e.jsxs("form",{ref:l,action:"https://sep.shaparak.ir/OnlinePG/OnlinePG",method:"post",children:[e.jsx("input",{type:"hidden",name:"Token",value:c}),e.jsx("input",{name:"GetMethod",type:"text",value:""}),e.jsx("input",{type:"submit",value:"Submit"})]})})]})};export{b as S}; diff --git a/build/assets/SlaughterPayProvinceFactorForm-QExXum_R.js b/build/assets/SlaughterPayProvinceFactorForm-QExXum_R.js new file mode 100644 index 0000000..e0a9458 --- /dev/null +++ b/build/assets/SlaughterPayProvinceFactorForm-QExXum_R.js @@ -0,0 +1 @@ +import{j as u,T as l,bs as P,p as x,b as F,co as O,aa as T,ak as B,I as G,B as I,aO as V,aP as q,aQ as W,aR as z,aS as $,aT as Y,ah as Z,ai as R,aj as k}from"./mui-vendor-CkIVaoQP.js";import{r as h}from"./react-vendor-CmFgShSM.js";import{G as a,S as d,j as _,A as v,L as Q,X as N,h$ as X,i0 as J,N as H,h as K,u as uu,c as eu,b as au}from"./index-CeyyVc1v.js";import{a as w,u as tu}from"./redux-vendor-B7uoacJt.js";import{d as ru}from"./Add--yVWBJhC.js";import{d as nu}from"./Delete-C5MyLelE.js";import{N as D}from"./NumberFormatCustom-DwWPj40N.js";const M=({cardNumber:e,expirationDate:r,bankName:i,bankUser:p})=>u.jsxs("div",{style:{border:"1px solid #d9d9d9",borderRadius:"10px",padding:"20px",backgroundColor:"#f0f0f0",width:"350px"},children:[u.jsxs("div",{style:{display:"flex",justifyContent:"space-between",flexDirection:"row"},children:[u.jsxs("div",{children:[u.jsx(l,{variant:"body2",children:"اطلاعات بانکی جهت واریز مبلغ"}),u.jsx(l,{variant:"h6",fontWeight:"bold",children:i})]}),u.jsx("div",{children:u.jsx("img",{src:"https://fs.noorgram.ir/xen/2020/12/953_f6253f3c48b7e2a782b3526bf4b80fbd.png",alt:"Visa",width:"50px"})})]}),u.jsx("div",{style:{fontSize:"18px",marginTop:"40px"},children:u.jsxs(l,{children:["شماره کارت ",e]})}),u.jsx("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"20px"},children:u.jsxs(l,{children:[u.jsx("div",{style:{fontSize:"14px"},children:p}),u.jsx("div",{style:{fontSize:"18px"},children:r})]})})]});M.propTypes={cardNumber:P.string.isRequired,expirationDate:P.string.isRequired};const U=({card:e,shaba:r,info:i,price:p,priceText:j,bankName:n,bankUser:s})=>u.jsx(a,{container:!0,alignItems:"start",pl:d.SMALL,gap:d.SMALL,mt:d.SMALL,children:u.jsx(a,{children:u.jsx(M,{bankName:"بانک "+n,bankUser:s,cardNumber:e,expirationDate:"IR"+r})})});U.propTypes={card:x.PropTypes.string,shaba:x.PropTypes.string,info:x.PropTypes.string,price:x.PropTypes.any,priceText:x.PropTypes.any};const su=()=>{const[e,r]=h.useState(null),[i,p]=h.useState(null),j=n=>{const s=n.target.files[0];if(s){const c=new FileReader;c.onload=()=>{r(s),p(c.result)},c.readAsDataURL(s)}};return u.jsxs(F,{children:[u.jsx(l,{children:"سند:"}),u.jsx(O,{type:"file",accept:"image/*",onChange:j}),e&&u.jsx(F,{mt:2,children:u.jsx("img",{src:i,alt:"img",width:"200px",style:{borderRadius:"10px"}})})]})},iu=w("SLAUGHTER_UPDATE_PAY_PROVINCE_FACTOR",async e=>{const{data:r,status:i}=await _.put("kill_house_factor_province/0/",e);return{data:r,status:i}}),du=w("SLAUGHTER_PAY_PROVINCE_FACTOR",async e=>{const{data:r,status:i}=await _.post("kill_house_factor_province/",e);return{data:r,status:i}}),ou=({provinceFactorToKillHouse:e,price:r,isRejected:i,barCode:p,killHouseFactorToProvince:j})=>{var b;const n=tu(),[,,s,,c]=h.useContext(v),[m]=h.useContext(v),[y,A]=h.useState([{id:11,paymentId:"",doc:"",amount:""},{id:22,paymentId:"",doc:"",amount:""}]),f=y.reduce((t,o)=>t+Number(o.amount),0);return u.jsx(a,{container:!0,children:u.jsxs(a,{container:!0,alignItems:"start",children:[u.jsx(a,{children:u.jsx(U,{card:e==null?void 0:e.card,shaba:e==null?void 0:e.shaba,info:e==null?void 0:e.nameOfBankUser,price:r,priceText:e==null?void 0:e.totalAmountChar,bankName:e==null?void 0:e.bankName,bankUser:e==null?void 0:e.nameOfBankUser})}),u.jsxs(a,{container:!0,direction:"column",gap:d.SMALL,mt:d.SMALL,pl:d.SMALL,children:[u.jsxs(a,{children:[u.jsxs(a,{container:!0,gap:d.MEDIUM,children:[u.jsxs(a,{children:[u.jsx(l,{variant:"body2",color:"primary",children:"مبلغ قابل پرداخت"}),u.jsxs(l,{variant:"body2",color:"error",fontWeight:"bold",children:[f?(Number(r)-f).toLocaleString():(b=Number(r))==null?void 0:b.toLocaleString()," ","ریال"]})]}),u.jsxs(a,{children:[u.jsx(l,{variant:"body2",color:"primary",children:"شناسه پرداخت"}),u.jsx(l,{variant:"body2",color:"error",fontWeight:"bold",children:p})]})]}),u.jsx(a,{children:u.jsx(l,{variant:"body1",fontWeight:"bold"})})]}),u.jsxs(a,{container:!0,direction:"column",alignItems:"center",gap:d.SMALL,children:[y.sort((t,o)=>t.id-o.id).map((t,o)=>u.jsxs(a,{container:!0,alignItems:"center",gap:d.SMALL,children:[u.jsxs(l,{children:[o+1,"."]}),u.jsx(a,{children:u.jsx(D,{allowLeadingZeros:!0,thousandSeparator:",",InputProps:{endAdornment:u.jsx(T,{position:"end",children:"ریال"})},label:"مبلغ پرداخت شده",value:t.amount,onChange:C=>{A(g=>{const S=t.id;return[...g.filter(L=>L.id!==S),{...t,id:t.id,amount:C.target.value}]})}})}),u.jsx(a,{children:u.jsx(B,{label:"شناسه واریز",value:t.paymentId,onChange:C=>{A(g=>{const S=t.id;return[...g.filter(L=>L.id!==S),{...t,id:t.id,paymentId:C.target.value}]})}})}),u.jsx(a,{children:u.jsx(su,{})}),u.jsx(a,{children:u.jsx(G,{"aria-label":"delete",color:"error",onClick:()=>{A(C=>{const g=t.id;return C.filter(E=>E.id!==g)})},children:u.jsx(nu,{})})})]},o)),u.jsxs(I,{color:"primary","aria-label":"Add",onClick:()=>{A(t=>[...t,{id:Date.now()}])},children:[u.jsx(ru,{}),"افزودن سند"]}),u.jsx(a,{children:u.jsx(I,{variant:"contained",onClick:()=>{n(Q());const t=o=>{o.error?m({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(n(X({selectedDate1:s,selectedDate2:c})),n(J({selectedDate1:s,selectedDate2:c})),n(H({right:!1,bottom:!1,top:!1,content:null,size:null})),m({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})),n(K())};if(i){const o={role:N()};n(iu(o)).then(t)}else{const o={role:N()};n(du(o)).then(t)}},children:"ثبت"})})]})]})]})})},lu=({provinceFactorToKillHouse:e,price:r,isRejected:i,barCode:p,killHouseFactorToProvince:j})=>{const[n,s]=h.useState("");return u.jsxs(a,{container:!0,gap:d.SMALL,mt:d.SMALL,alignItems:"center",children:[u.jsx(a,{children:u.jsx(D,{allowLeadingZeros:!0,thousandSeparator:",",id:"outlined-basic",label:"مبلغ برای پرداخت را وارد کنید",variant:"outlined",InputProps:{endAdornment:u.jsx(T,{position:"end",children:"ریال"})},value:n,onChange:c=>s(c.target.value)})}),u.jsx(a,{children:u.jsx(I,{variant:"contained",children:"ارسال به درگاه پرداخت"})})]})},cu=({factorKey:e,price:r,provinceFactorToKillHouse:i,killHouseFactorToProvince:p,isRejected:j,barCode:n,item:s})=>{const c=uu({initialValues:{paymentId:""},validationSchema:eu({paymentId:au().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!")})});h.useEffect(()=>{c.validateForm()},[]),h.useEffect(()=>{j&&c.setFieldValue("paymentId",p.paymentCode)},[]);let m="";(s==null?void 0:s.factorPersonType)==="union"?m="اتحادیه":m="مرغدار";const[y,A]=h.useState("option1"),f=b=>{A(b.target.value)};return u.jsxs(V,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(q,{children:[u.jsx(W,{color:"secondary"}),u.jsx(z,{})]}),u.jsxs(a,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(a,{container:!0,children:[u.jsx(a,{children:u.jsxs($,{variant:"body1",fontWeight:"bold",color:"secondary",children:["انجام عملیات - پرداخت به ",m]})}),u.jsx(a,{children:u.jsx(Y,{color:"textSecondary",children:u.jsx(a,{container:!0,gap:d.SMALL,children:u.jsx(l,{variant:"body2",display:"flex",gap:d.SMALL,children:"در این مرحله مبلغ را پرداخت کنید و شناسه پرداخت را وارد و سند آن را بارگذاری کنید."})})})})]}),u.jsx(a,{children:u.jsxs(Z,{"aria-labelledby":"radio-group-label",name:"radio-buttons-group",value:y,onChange:f,children:[u.jsx(R,{value:"bank-gateway",control:u.jsx(k,{}),label:"پرداخت از طریق درگاه پرداخت"}),u.jsx(R,{value:"manual-payment",control:u.jsx(k,{}),label:"ثبت سند پرداخت"})]})}),u.jsxs(a,{children:[y==="bank-gateway"&&u.jsx(lu,{}),y==="manual-payment"&&u.jsx(ou,{price:r,provinceFactorToKillHouse:i,barCode:n,isRejected:j,killHouseFactorToProvince:p})]})]})]})};cu.propTypes={factorKey:x.PropTypes.string,price:x.PropTypes.any,provinceFactorToKillHouse:x.PropTypes.any,killHouseFactorToProvince:x.PropTypes.any,isRejected:x.PropTypes.any};export{cu as S,du as s}; diff --git a/build/assets/SlaughterRequestsPage-DSn1nwnQ.js b/build/assets/SlaughterRequestsPage-DSn1nwnQ.js new file mode 100644 index 0000000..7e2711a --- /dev/null +++ b/build/assets/SlaughterRequestsPage-DSn1nwnQ.js @@ -0,0 +1,2 @@ +import{j as u,T as I,ao as W6,ap as e6,aq as t6,a3 as W,ag as wu,av as Ou,aw as qu,ax as Cu,ak as N,ai as I0,aX as M0,aU as Xu,B as G,d as Yu,I as ou,aJ as D0,p as vu,aO as r6,aP as n6,aQ as a6,aR as o6,aS as l6,aT as s6,am as N6,i as $6,al as Pu,b0 as i6,an as z6,b4 as K6,b as c6,b2 as d6,b3 as Zu,aA as U6,aa as V6}from"./mui-vendor-CkIVaoQP.js";import{A as Q,$ as G6,u as _u,c as fu,v as J,c2 as Q6,M as bu,b as Tu,X as xu,af as C6,L as cu,fl as h6,h as X,aZ as X6,S as k,Q as Bu,W as uu,j1 as p0,O as Iu,C as Ru,N as hu,a9 as Eu,p as iu,G as v,j2 as A0,j3 as f0,j4 as x0,j5 as g0,j6 as y0,j7 as v0,j8 as F0,j9 as B0,ey as Z6,ja as H0,jb as O0,jc as q0,jd as j0,g5 as Mu,g6 as Uu,a1 as J6,j as Su,m as ue,je as Ju,a5 as b0,n as w0,r as ee,jf as P0,jg as u0,t as p6,_ as A6,o as te,l as re,h$ as ne,i0 as ae,jh as oe,ji as E0,jj as f6,jk as x6,fn as c0,fm as le,jl as se,jm as ie,jn as ce,jo as de,jp as Ce,jq as he,jr as pe}from"./index-CeyyVc1v.js";import{d as o0}from"./Delete-C5MyLelE.js";import{u as lu,f as Fu,a as Lu}from"./redux-vendor-B7uoacJt.js";import{r as p,f as g6,u as Vu,b as P,j as y6}from"./react-vendor-CmFgShSM.js";import{s as Ae,a as fe}from"./slaughter-new-request-CTd5pQEl.js";import{D as xe}from"./DialogAlert-BfXcr-Kr.js";import{d as ge}from"./Done-Dp5awdte.js";import{N as e0}from"./NumberFormatCustom-DwWPj40N.js";import{C as ye}from"./CustomCard-B-6dDbAN.js";import{R as Wu}from"./ResponsiveTable-w7hk7Uq8.js";import{N as ku}from"./NavLink-D2GD_ItM.js";import{L as Du}from"./LinkItem-DT6qswcs.js";import{a as Y0,b as ve,d as Fe,e as je,f as be}from"./index.esm-BcDC8KuM.js";import{F as d0,v as Ee,d as Se}from"./index.esm-BY9chGNa.js";import{L as C0}from"./LineWithText-BpnpjRWf.js";import{a as ke}from"./index.esm-CjWvmHks.js";import{S as De}from"./SlaughterActiveRequests-9ZnaAVlL.js";import{A as Hu}from"./AdvancedTable-BYmmBtmq.js";import{d as Nu}from"./Plagiarism-BiXORbzo.js";import{d as $u}from"./Edit-CqBj1Y2L.js";import{A as we}from"./index-9Ymn_7Kv.js";import{d as v6}from"./PictureAsPdf-oEJEta1d.js";import{l as _e}from"./ChickenLogo-BK6_Z2uq.js";import{d as W0,S as me}from"./SlaughterSellCarcass-D_Twt9ez.js";import{a as Te,c as Re}from"./province-policy-get-slaughter-buying-price-status-XGKC4dNm.js";import{d as F6}from"./Tune-D4M2CAhp.js";import{d as Le}from"./AddCircleOutline-C8LXM-k8.js";import{s as Ie}from"./SlaughterManageBars-CW9paHF2.js";import{S as Me}from"./SlaghterEnterBarInfo-uCfcHEct.js";import{S as N0,s as Be}from"./SlaughterPayProvinceFactorForm-QExXum_R.js";import{S as $0}from"./SimpleTable-DBAoNnCU.js";import{B as He}from"./BackButton-Crzr7NMa.js";import{I as Oe,f as qe}from"./toBase64-BzgTOHsW.js";import{s as Pe,b as Ye,c as We,E as Ne,a as $e,P as ze}from"./EnterAuthCodeDirectBuy-zD0YV5ZE.js";import{R as Ke,a as Ue}from"./index.esm-Bu7XMDZU.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./iconBase-BEJYyZsk.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./SlaughterAllocateToGuild-Dfz5LRq5.js";import"./slaughter-get-guilds-for-allocate-B6OrhhMj.js";import"./province-policy-upload-image-CRJ-U4Kc.js";import"./LabelField-B6eRSoQP.js";import"./SlaughterManageInventoryAllocationOperations-Bla8JB6Q.js";import"./CheckCircleOutline-Ci9-hVKX.js";import"./ShowImage-CqhU2hmk.js";import"./Download-DQ-VVIaV.js";import"./guild-allocated-stock-operation-BiIjKHlL.js";import"./getProvinceName-BujSmyBy.js";import"./Sms-DasNClAG.js";import"./getAllocationType-76F45b0K.js";import"./SystemUpdateAlt-Bu3pObDi.js";import"./resizeImage-Csf2MO3w.js";import"./VetFarmEditTrafficCode-D3hZa5p9.js";import"./isValidIndexWeight-C_ik-uYa.js";import"./SlaughterEnterNoneReciept-Cle0J4bf.js";import"./ReceiptLong-Dxpx4wPx.js";import"./getDocumentStates-BlCrMUIj.js";import"./FileUploader-DT5gIVb3.js";import"./CloudUpload-BlIgB_r9.js";import"./CheckCircle-zgBvZQ-b.js";import"./Add--yVWBJhC.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./DoneOutline-DQzOHpRS.js";import"./ThumbUpAlt-HKYD-o6a.js";import"./aviculture-get-hatching-data-DsjDNd82.js";import"./province-get-sell-for-freezing-status-ieuVFEgW.js";import"./ProvinceSettlementPdfKillRequest-ChEooZGT.js";const Ve=()=>{var f,Y,H,_,a,C,L;const[e]=p.useContext(Q),t=lu(),[,r]=G6(),{profile:n,slaughterGetKillerKillhouses:i}=Fu(b=>b.slaughterSlice),[,,A,,h]=p.useContext(Q),o=_u({initialValues:{capacity:"",recieveTime:"",selectedKillhouse:"",selectedKillerKillhouse:"",race:"آرین",sellType:{cash:!0,haveTime:!1},weightType:{under2AndHalf:!1,over2AndHalf:!1},recieveDate:J(Date()).format("YYYY-MM-DD hh:mm:ss"),isAccepted:xu()==="ProvinceOperator",indexWeight:2.7},validationSchema:fu({capacity:Tu().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),selectedKillhouse:bu().required("این فیلد اجباری است!"),selectedKillerKillhouse:(f=n==null?void 0:n.killHouseOperator)!=null&&f.killer?bu().required("این فیلد اجباری است!"):bu(),recieveTime:bu().required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!"),sellType:fu().test("sellType","نحوه فروش را انتخاب کنید!",(b,g)=>g.originalValue&&Object.values(g.originalValue).some(D=>D===!0)).required("این فیلد اجباری است!"),isAccepted:Q6().test("req","باید تعهد نامه را بپذیرید!",(b,g)=>g.originalValue&&g.originalValue===!0).required("این فیلد اجباری است!")})}),c=o.values.capacity*1e3,y=u.jsxs(u.Fragment,{children:[u.jsxs(I,{variant:"body1",children:["اینجانب ",r.fullname," موافقت خود را نسبت به موارد ذکر شده اعلام می نمایم."]}),u.jsxs(W6,{children:[u.jsx(e6,{children:u.jsx(ge,{})}),u.jsx(t6,{primary:`بر اساس این توافق نامه در صورت لغو کشتار ${o.values.capacity} قطعه + مرغ ${c} ریال جریمه خواهم شد.`})]})]});p.useEffect(()=>{t(C6()),t(cu()),t(h6()).then(b=>{t(X())}),o.validateForm()},[]);const[d,s]=p.useState(!0),x=b=>{s(b.target.checked)},[l,S]=p.useState(!1),w=b=>{S(b.target.checked)},{provincePrices:T}=Fu(b=>b.provinceSlice),E=T!=null&&T.length?((H=(Y=T[0])==null?void 0:Y.liveChickenPrice)==null?void 0:H.toLocaleString())+" ﷼":"نامشخص",m=T!=null&&T.length?(_=T[0])==null?void 0:_.createDate:Date();return p.useEffect(()=>{t(X6())},[]),u.jsx(u.Fragment,{children:u.jsxs(W,{className:"slaughter-new-request-form",container:!0,gap:k.SMALL,direction:"column",flex:"1",justifyContent:"space-between",children:[u.jsx(ye,{title:"قیمت روز مرغ",value:E+" - "+Bu(new Date(m),"yyyy/MM/dd")}),u.jsxs(W,{container:!0,direction:"column",gap:k.SMALL,children:[u.jsxs(wu,{fullWidth:!0,error:o.errors.selectedOption&&o.touched.selectedOption,children:[u.jsxs(Ou,{children:[(a=n==null?void 0:n.killHouseOperator)!=null&&a.killer?"کشتارکن":"محل کشتار"," را انتخاب کنید"]}),u.jsx(qu,{label:"محل کشتار را انتخاب کنید",id:"selectedKillhouse",name:"selectedKillhouse",value:o.values.selectedKillhouse,onChange:o.handleChange,onBlur:o.handleBlur,children:(C=n==null?void 0:n.killHouse)==null?void 0:C.map(b=>u.jsx(Cu,{value:b.key,children:b.name},b))}),o.errors.selectedOption&&o.touched.selectedOption&&u.jsx("div",{children:o.errors.selectedOption})]}),((L=n==null?void 0:n.killHouseOperator)==null?void 0:L.killer)&&u.jsxs(wu,{fullWidth:!0,error:o.errors.selectedKillerKillhouse&&o.touched.selectedKillerKillhouse,children:[u.jsx(Ou,{children:"کشتارگاه را انتخاب کنید"}),u.jsx(qu,{label:"کشتارگاه را انتخاب کنید",id:"selectedKillerKillhouse",name:"selectedKillerKillhouse",value:o.values.selectedKillerKillhouse,onChange:o.handleChange,onBlur:o.handleBlur,children:i==null?void 0:i.map(b=>u.jsx(Cu,{value:b.key,children:b.name},b))}),o.errors.selectedKillerKillhouse&&o.touched.selectedKillerKillhouse&&u.jsx("div",{children:o.errors.selectedKillerKillhouse})]}),u.jsx(W,{children:u.jsx(e0,{allowLeadingZeros:!0,thousandSeparator:",",id:"capacity",fullWidth:!0,label:"حجم کشتار را در روز به قطعه وارد کنید",variant:"outlined",value:o.values.capacity,error:o.touched.capacity?!!o.errors.capacity:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.capacity&&o.errors.capacity?o.errors.capacity:null})}),u.jsx(W,{children:u.jsxs(wu,{fullWidth:!0,sx:{minWidth:210},children:[u.jsx(Ou,{children:"بازه زمانی دریافت مرغ مرغدار"}),u.jsxs(qu,{id:"recieveTime",value:o.values.recieveTime,label:"بازه زمانی دریافت مرغ مرغدار",onChange:b=>{o.setFieldValue("recieveTime",b.target.value)},children:[u.jsx(Cu,{value:"12 - 14",children:"12 - 14"}),u.jsx(Cu,{value:"14 - 16",children:"14 - 16"}),u.jsx(Cu,{value:"16 - 18",children:"16 - 18"}),u.jsx(Cu,{value:"18 - 20",children:"18 - 20"}),u.jsx(Cu,{value:"20 - 22",children:"20 - 22"}),u.jsx(Cu,{value:"22 - 24",children:"22 - 24"})]})]})}),u.jsx(W,{children:u.jsx(uu,{label:"تاریخ کشتار",id:"recieveDate",renderInput:b=>u.jsx(N,{...b}),value:o.values.recieveDate,error:o.touched.recieveDate?!!o.errors.recieveDate:null,onChange:b=>{o.setFieldValue("recieveDate",J(b).format("YYYY-MM-DD hh:mm:ss"))},onBlur:o.handleBlur,helperText:o.touched.recieveDate&&o.errors.recieveDate?o.errors.recieveDate:null})})]}),u.jsx(I0,{control:u.jsx(M0,{checked:l,onChange:w,color:"primary"}),label:"تعیین نژاد/وزن مرغ"}),l&&u.jsxs(W,{container:!0,direction:"column",gap:k.TINY,children:[u.jsxs(wu,{fullWidth:!0,children:[u.jsx(Ou,{id:"demo-simple-select-label",children:"نژاد مرغ"}),u.jsxs(qu,{labelId:"demo-simple-select-label",id:"race",label:"نژاد مرغ",value:o.values.race,error:o.touched.race?!!o.errors.race:null,onChange:b=>{o.setFieldValue("race",b.target.value)},onBlur:o.handleBlur,children:[u.jsx(Cu,{value:"آرین",children:"آرین"}),u.jsx(Cu,{value:"راس",children:"راس"}),u.jsx(Cu,{value:"آربراکرز (آپلاس)",children:"آربراکرز (آپلاس)"}),u.jsx(Cu,{value:"کاب",children:"کاب"}),u.jsx(Cu,{value:"هوبارد",children:"هوبارد"}),u.jsx(Cu,{value:"ترکیبی",children:"ترکیبی"}),u.jsx(Cu,{value:"وارداتی",children:"وارداتی"})]}),u.jsx(Xu,{children:o.touched.race&&o.errors.race?o.errors.race:null})]}),u.jsx(W,{children:u.jsx(e0,{allowLeadingZeros:!0,thousandSeparator:",",id:"indexWeight",fullWidth:!0,label:"وزن مرغ",variant:"outlined",value:o.values.indexWeight,error:o.touched.indexWeight?!!o.errors.indexWeight:null,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.indexWeight&&o.errors.indexWeight?o.errors.indexWeight:null})})]}),u.jsxs(W,{children:[xu()!=="ProvinceOperator"&&u.jsx(xe,{title:"تعهد نامه",content:y,actions:u.jsxs(W,{container:!0,justifyContent:"end",gap:k.TINY,children:[u.jsx(G,{variant:"outlined",color:"error",onClick:()=>{o.setFieldValue("isAccepted",!1)},children:"رد"}),u.jsx(G,{variant:"contained",color:"success",onClick:()=>{o.setFieldValue("isAccepted",!0)},children:"موافقم"})]}),btnTitle:"با تعهد نامه موافق هستم!",isAccepted:o.values.isAccepted}),u.jsx(W,{children:u.jsx(I0,{style:{fontSize:"10px"},control:u.jsx(M0,{checked:d,onChange:x}),label:u.jsx(Yu,{title:"5000 تومان",arrow:!0,children:u.jsx(I,{variant:"caption",children:"مایل به دریافت پیامک اطلاع رسانی هستم!"})})})})]}),u.jsx(W,{container:!0,mt:k.SMALL,justifyContent:"center",children:u.jsx(G,{fullWidth:!0,variant:"contained",component:"label",disabled:!o.isValid,size:"large",onClick:()=>{t(cu()),t(Ae({kill_capacity:o.values.capacity,recive_time:o.values.recieveTime,recive_date:o.values.recieveDate,low_weight:o.values.weightType.under2AndHalf,high_weight:o.values.weightType.over2AndHalf,Index_weight:l?o.values.indexWeight:2.7,chicken_breed:l?o.values.race:"تعیین نشده",cash:o.values.sellType.cash,credit:o.values.sellType.haveTime,sms_payment:d,kill_house_key:o.values.selectedKillhouse,killer_kill_house_key:o.values.selectedKillerKillhouse?o.values.selectedKillerKillhouse:null,role:xu()})).then(b=>{t(X()),b.payload.error?e({vertical:"top",horizontal:"center",msg:b.payload.error,severity:"error"}):(t(p0({selectedDate1:A,selectedDate2:h})),t(Iu({title:b.payload.data.result,content:u.jsx(G,{variant:"contained",onClick:()=>{t(Ru())},color:"primary",children:"تایید"})})),e({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(hu({right:!1,bottom:!1,content:null})))})},children:"ثبت درخواست"})})]})})},Ge=()=>{const[e,t]=p.useState([]),{slaughterRequests:r}=Fu(d=>d.slaughterSlice),n=lu(),[i]=p.useContext(Q),[,,A,h,o,c]=p.useContext(Q);p.useEffect(()=>{const d=Eu(new Date).format("YYYY-MM-DD");h(d),c(d)},[]),p.useEffect(()=>{n(p0({selectedDate1:A,selectedDate2:o}))},[A,o]),p.useEffect(()=>{const d=r==null?void 0:r.map((s,x)=>{var S,w;let l;return s.state==="archive"?l="بایگانی شده":s.provinceState==="pending"?l="در انتظار تایید استان":s.provinceState==="accepted"?l="تایید شده توسط استان":s.provinceState==="rejected"&&(l="رد شده توسط استان"),[x+1,s.killHouse.name,iu(s==null?void 0:s.createDate),s.provinceQuantity?s.provinceQuantity.toLocaleString():(S=s.killCapacity)==null?void 0:S.toLocaleString(),s.provinceQuantity?(w=s.killCapacity)==null?void 0:w.toLocaleString():0,s.reciveTime,iu(s==null?void 0:s.reciveDate),l,u.jsx(ou,{"aria-label":"delete",color:"error",onClick:()=>{n(Iu({title:"آیا مطمئن هستید؟",content:u.jsxs(W,{container:!0,alignItems:"center",justifyContent:"center",children:[u.jsx(G,{variant:"contained",onClick:()=>{n(cu()),n(fe({id:s.id})).then(T=>{n(Ru()),n(X()),T.error?T.error.message.includes("403")?i({vertical:"top",horizontal:"center",msg:"این درخواست از سمت استان پذیرفته شده و قابل حذف نمی باشد!",severity:"error"}):i({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):n(p0({selectedDate1:A,selectedDate2:o})).then(E=>{i({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})})},children:"تایید"}),u.jsx(G,{onClick:()=>{n(Ru())},children:"لغو"})]})}))},children:u.jsx(o0,{})},x)]});t(d)},[r]);const[y]=p.useState(["ردیف","نام کشتارگاه","تاریخ ایجاد درخواست","تعداد درخواست اولیه","تعداد مورد تایید","زمان دریافت","تاریخ درخواستی کشتار","وضعیت","حذف درخواست"]);return u.jsx(u.Fragment,{children:u.jsxs(W,{xs:12,container:!0,alignItems:"center",gap:k.SMALL,justifyContent:"flex-start",children:[u.jsx(G,{className:"new-request-form-button",variant:"contained",onClick:()=>{n(hu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Ve,{}),title:"ثبت درخواست کشتار"}))},children:"ثبت درخواست کشتار جدید"}),u.jsx(W,{children:u.jsx(uu,{label:"از تاریخ",id:"date",renderInput:d=>u.jsx(N,{style:{width:"160px"},...d}),value:A,onChange:d=>{h(Eu(d).format("YYYY-MM-DD"))}})}),u.jsx(W,{children:u.jsx(uu,{label:"تا تاریخ",id:"date",renderInput:d=>u.jsx(N,{style:{width:"160px"},...d}),value:o,onChange:d=>{c(Eu(d).format("YYYY-MM-DD"))}})}),u.jsx(Wu,{title:"درخواست های ثبت شده",columns:y,data:e,paginated:!0})]})})},Qe=({hasPermission:e})=>{const{pathname:t}=g6();return u.jsxs(v,{container:!0,gap:k.SMALL,p:k.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",style:{placeContent:"baseline"},children:[e&&u.jsxs(u.Fragment,{children:[u.jsxs(v,{container:!0,direction:"column",style:{width:"100%"},children:[u.jsx(v,{children:u.jsx(C0,{text:"درخواست ها"})}),u.jsxs(v,{container:!0,gap:k.SMALL,justifyContent:"center",children:[u.jsx(ku,{to:A0,active:t===A0?"true":null,children:u.jsx(Du,{icon:u.jsx(Y0,{size:30,color:"#244CCC"}),title:"ثبت درخواست",description:"مدیریت و ثبت درخواست های کشتار"})}),u.jsx(ku,{to:f0,active:t===f0?"true":null,children:u.jsx(Du,{icon:u.jsx(Y0,{size:30,color:"#244CCC"}),title:"خرید مستقیم"})}),u.jsx(ku,{to:x0,active:t===x0?"true":null,children:u.jsx(Du,{icon:u.jsx(ve,{size:30,color:"#244CCC"}),title:"صادرات"})}),u.jsx(ku,{to:g0,active:t===g0?"true":null,children:u.jsx(Du,{icon:u.jsx(Fe,{size:30,color:"#244CCC"}),title:u.jsxs(v,{container:!0,direction:"column",children:[u.jsx(I,{variant:"caption",children:"سفارش های دریافت شده"}),u.jsx(I,{variant:"caption",children:"(در انتظار تایید)"})]}),description:"مشاهد درخواست های در انتظار تایید اتحادیه"})}),u.jsx(ku,{to:y0,active:t===y0?"true":null,children:u.jsx(Du,{icon:u.jsx(ke,{size:30,color:"#244CCC"}),title:"تخصیصات",description:"مشاهده و تخصیص درخواست ها"})})]})]}),u.jsxs(v,{container:!0,direction:"column",style:{width:"100%"},children:[u.jsx(v,{children:u.jsx(C0,{text:"بار ها"})}),u.jsxs(v,{container:!0,justifyContent:"center",gap:k.SMALL,children:[u.jsx(ku,{to:v0,active:t===v0?"true":null,children:u.jsx(Du,{icon:u.jsx(je,{size:30,color:"#244CCC"}),title:"تخصیص خودرو",description:"اختصاص خودرو به درخواست"})}),u.jsx(ku,{to:F0,active:t===F0?"true":null,children:u.jsx(Du,{icon:u.jsx(d0,{size:30,color:"#244CCC"}),title:"وارد کردن اطلاعات بار",description:"درخواست های در انتظار عملیات وارد کردن اطلاعات بارهای دریافتی"})}),u.jsx(ku,{to:B0,active:t===B0?"true":null,children:u.jsx(Du,{icon:u.jsx(Ee,{size:30,color:"#244CCC"}),title:"انبار و توزیع",description:"درخواست های در انتظار عملیات وارد کردن اطلاعات بارهای دریافتی"})})]})]})]}),!e&&u.jsxs(v,{container:!0,justifyContent:"center",alignItems:"center",xs:12,gap:1,children:[u.jsx(Z6,{color:"primary"}),u.jsx(I,{color:"secondary",variant:"body1",children:"بدلیل عدم پرداخت تعرفه ، امکان استفاده از خدمات سامانه را ندارید!"})]}),u.jsxs(v,{container:!0,direction:"column",style:{width:"100%"},children:[u.jsx(v,{children:u.jsx(C0,{text:"مالی"})}),u.jsxs(v,{container:!0,justifyContent:"center",gap:k.SMALL,children:[u.jsx(ku,{to:H0,active:t===H0?"true":null,children:u.jsx(Du,{icon:u.jsx(d0,{size:30,color:"#244CCC"}),title:"مدیریت تعرفه ها"})}),u.jsx(ku,{to:O0,active:t===O0?"true":null,children:u.jsx(Du,{icon:u.jsx(be,{size:30,color:"#244CCC"}),title:"کیف پول"})}),u.jsx(ku,{to:q0,active:t===q0?"true":null,children:u.jsx(Du,{icon:u.jsx(Se,{size:30,style:{color:"#4285F4"},color:"#244CCC"}),title:"مدیریت تراکنش ها"})}),u.jsx(ku,{to:j0,active:t===j0?"true":null,children:u.jsx(Du,{icon:u.jsx(d0,{size:30,color:"#244CCC"}),title:"مدیریت فاکتورها",description:"درخواست های در پرداخت"})})]})]})]})},Xe=()=>{const e=Vu(),[,,t,r,n,i]=p.useContext(Q);p.useEffect(()=>{const s=J(new Date).format("YYYY-MM-DD");r(s),i(s)},[]);const[A,h]=p.useState([]),{slaughterActiveRequests:o}=Fu(s=>s.slaughterSlice),c=lu();p.useEffect(()=>{c(Mu({selectedDate1:t,selectedDate2:n}))},[t,n]),p.useEffect(()=>{const s=o==null?void 0:o.filter((l,S)=>l.provinceKillState==="rejected"),x=s==null?void 0:s.map((l,S)=>[S+1,l.orderCode,Bu(new Date(l==null?void 0:l.sendDate),"yyyy/MM/dd"),l.poultryName,l.poultryMobile,l.city,l.province,l.age,l.quantity,u.jsx(ou,{"aria-label":"delete",color:"primary",onClick:()=>e(Uu+l.poultryReqId),children:u.jsx(Nu,{})},S)]);h(x)},[o]);const[y]=p.useState(["ردیف","کد سفارش","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","استان","سن مرغ","تعداد","مشاهده"]),d=_u({initialValues:{capacity:"",recieveTime:"",recieveDate:J(Date()).format("YYYY-MM-DD hh:mm:ss")},validationSchema:fu({capacity:Tu().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),recieveTime:bu().required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!")})});return p.useEffect(()=>{d.validateForm()},[]),u.jsx(W,{container:!0,alignItems:"center",justifyContent:"space-between",gap:k.SMALL,mt:k.MEDIUM,children:u.jsx(D0,{sx:{width:"100%"},children:u.jsx(Hu,{name:u.jsxs(W,{container:!0,alignItems:"center",gap:k.SMALL,children:[u.jsx(W,{children:u.jsx(I,{children:"درخواست های رد شده"})}),u.jsx(W,{children:u.jsx(uu,{label:"از تاریخ",id:"date",renderInput:s=>u.jsx(N,{style:{width:"160px"},...s}),value:t,onChange:s=>{r(J(s).format("YYYY-MM-DD"))}})}),u.jsx(W,{children:u.jsx(uu,{label:"تا تاریخ",id:"date",renderInput:s=>u.jsx(N,{style:{width:"160px"},...s}),value:n,onChange:s=>{i(J(s).format("YYYY-MM-DD"))}})})]}),columns:y,data:A})})})},Ze=()=>{const e=Vu(),t=lu(),[r,n]=p.useState([]),{avicultureRequests:i}=Fu(d=>d.avicultureSlice),[,,A,h,o,c]=p.useContext(Q);p.useEffect(()=>{const d=Eu(new Date).format("YYYY-MM-DD");h(d),c(d)},[]),p.useEffect(()=>{t(cu()),t(J6({selectedDate1:A,selectedDate2:o})).then(()=>{t(X())})},[A,o]),p.useEffect(()=>{const d=i==null?void 0:i.filter((x,l)=>x.inspector!=null),s=d==null?void 0:d.map((x,l)=>{var S,w,T,E,m,f,Y,H,_,a,C,L;return[l+1,x.orderCode,iu(x==null?void 0:x.createDate),iu(x==null?void 0:x.sendDate),(w=(S=x==null?void 0:x.process)==null?void 0:S.poultry)==null?void 0:w.poultryName,(E=(T=x==null?void 0:x.process)==null?void 0:T.poultry)==null?void 0:E.poultryMobile,(f=(m=x==null?void 0:x.process)==null?void 0:m.poultry)==null?void 0:f.poultryCity,(H=(Y=x==null?void 0:x.process)==null?void 0:Y.poultry)==null?void 0:H.poultryProvince,(a=(_=x==null?void 0:x.process)==null?void 0:_.poultry)==null?void 0:a.age,(L=(C=x==null?void 0:x.process)==null?void 0:C.poultry)==null?void 0:L.poultryQuantity,u.jsx(ou,{"aria-label":"delete",color:"primary",onClick:()=>{var b,g;return e(Uu+((g=(b=x==null?void 0:x.process)==null?void 0:b.poultry)==null?void 0:g.poultryRequestId))},children:u.jsx(Nu,{})},l)]});n(s)},[i]);const[y]=p.useState(["ردیف","کد سفارش","تاریخ ثبت درخواست","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","استان","سن مرغ","تعداد","مشاهده"]);return u.jsx(D0,{children:u.jsx(Hu,{name:u.jsxs(v,{container:!0,alignItems:"center",gap:k.SMALL,children:[u.jsx(v,{children:u.jsx(I,{children:"درخواست های بایگانی شده"})}),u.jsx(v,{children:u.jsx(uu,{label:"از تاریخ",id:"date",renderInput:d=>u.jsx(N,{style:{width:"160px"},...d}),value:A,onChange:d=>{h(Eu(d).format("YYYY-MM-DD"))}})}),u.jsx(v,{children:u.jsx(uu,{label:"تا تاریخ",id:"date",renderInput:d=>u.jsx(N,{style:{width:"160px"},...d}),value:o,onChange:d=>{c(Eu(d).format("YYYY-MM-DD"))}})})]}),expandable:!0,columns:y,data:r})})};var Je={attributes:!0,characterData:!0,subtree:!0,childList:!0};function ut(e,t,r=Je){p.useEffect(()=>{if(e.current){const n=new MutationObserver(t);return n.observe(e.current,r),()=>{n.disconnect()}}},[t,r])}var j6=function(){if(typeof Map<"u")return Map;function e(t,r){var n=-1;return t.some(function(i,A){return i[0]===r?(n=A,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(r,n){var i=e(this.__entries__,r);~i?this.__entries__[i][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,i=e(n,r);~i&&n.splice(i,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var i=0,A=this.__entries__;i0},e.prototype.connect_=function(){!S0||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ot?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!S0||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,i=at.some(function(A){return!!~n.indexOf(A)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),b6=function(e,t){for(var r=0,n=Object.keys(t);r"u"||!(Element instanceof Object))){if(!(t instanceof zu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)||(r.set(t,new At(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof zu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)&&(r.delete(t),r.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&t.activeObservations_.push(r)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new ft(n.target,n.broadcastRect())});this.callback_.call(t,r,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),S6=typeof WeakMap<"u"?new WeakMap:new j6,k6=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=lt.getInstance(),n=new xt(t,r,this);S6.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){k6.prototype[e]=function(){var t;return(t=S6.get(this))[e].apply(t,arguments)}});var gt=function(){return typeof t0.ResizeObserver<"u"?t0.ResizeObserver:k6}(),yt=({mutationObservables:e,resizeObservables:t,refresh:r})=>{const[n,i]=p.useState(0),A=p.useRef(document.documentElement||document.body);function h(c){const y=Array.from(c);for(const d of y)if(e){if(!d.attributes)continue;e.find(x=>d.matches(x))&&r(!0)}}function o(c){const y=Array.from(c);for(const d of y)if(t){if(!d.attributes)continue;t.find(x=>d.matches(x))&&i(n+1)}}return ut(A,c=>{for(const y of c)y.addedNodes.length!==0&&(h(y.addedNodes),o(y.addedNodes)),y.removedNodes.length!==0&&(h(y.removedNodes),o(y.removedNodes))},{childList:!0,subtree:!0}),p.useEffect(()=>{if(!t)return;const c=new gt(()=>{r()});for(const y of t){const d=document.querySelector(y);d&&c.observe(d)}return()=>{c.disconnect()}},[t,n]),null},vt=yt;function Qu(e){let t=D6;return e&&(t=e.getBoundingClientRect()),t}function Ft(e,t){const[r,n]=p.useState(D6),i=p.useCallback(()=>{e!=null&&e.current&&n(Qu(e==null?void 0:e.current))},[e==null?void 0:e.current]);return p.useEffect(()=>(i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)),[e==null?void 0:e.current,t]),r}var D6={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function jt(e,t){return new Promise(r=>{if(!(e instanceof Element))throw new TypeError("Argument 1 must be an Element");let n=0,i=null;const A=Object.assign({behavior:"smooth"},t);e.scrollIntoView(A),requestAnimationFrame(h);function h(){const o=e==null?void 0:e.getBoundingClientRect().top;if(o===i){if(n++>2)return r(null)}else n=0,i=o;requestAnimationFrame(h)}})}function Gu(e){return e<0?0:e}function bt(e){return typeof e=="object"&&e!==null?{thresholdX:e.x||0,thresholdY:e.y||0}:{thresholdX:e||0,thresholdY:e||0}}function s0(){const e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return{w:e,h:t}}function Et({top:e,right:t,bottom:r,left:n,threshold:i}){const{w:A,h}=s0(),{thresholdX:o,thresholdY:c}=bt(i);return e<0&&r-e>h?!0:e>=0+c&&n>=0+o&&r<=h-c&&t<=A-o}var K0=(e,t)=>e>t,U0=(e,t)=>e>t;function St(e,t=[]){const r=(n,i)=>t.includes(n)?1:t.includes(i)?-1:0;return Object.keys(e).map(n=>({position:n,value:e[n]})).sort((n,i)=>i.value-n.value).sort((n,i)=>r(n.position,i.position)).filter(n=>n.value>0).map(n=>n.position)}var h0=10;function k0(e=h0){return Array.isArray(e)?e.length===1?[e[0],e[0],e[0],e[0]]:e.length===2?[e[1],e[0],e[1],e[0]]:e.length===3?[e[0],e[1],e[2],e[1]]:e.length>3?[e[0],e[1],e[2],e[3]]:[h0,h0]:[e,e,e,e]}var kt={maskWrapper:()=>({opacity:.7,left:0,top:0,position:"fixed",zIndex:99999,pointerEvents:"none",color:"#000"}),svgWrapper:({windowWidth:e,windowHeight:t,wpt:r,wpl:n})=>({width:e,height:t,left:Number(n),top:Number(r),position:"fixed"}),maskArea:({x:e,y:t,width:r,height:n})=>({x:e,y:t,width:r,height:n,fill:"black",rx:0}),maskRect:({windowWidth:e,windowHeight:t,maskID:r})=>({x:0,y:0,width:e,height:t,fill:"currentColor",mask:`url(#${r})`}),clickArea:({windowWidth:e,windowHeight:t,clipID:r})=>({x:0,y:0,width:e,height:t,fill:"currentcolor",pointerEvents:"auto",clipPath:`url(#${r})`}),highlightedArea:({x:e,y:t,width:r,height:n})=>({x:e,y:t,width:r,height:n,pointerEvents:"auto",fill:"transparent",display:"none"})};function Dt(e){return(t,r)=>{const n=kt[t](r),i=e[t];return i?i(n,r):n}}var wt=({padding:e=10,wrapperPadding:t=0,onClick:r,onClickHighlighted:n,styles:i={},sizes:A,className:h,highlightedAreaClassName:o,maskId:c,clipId:y})=>{const d=c||V0("mask__"),s=y||V0("clip__"),x=Dt(i),[l,S,w,T]=k0(e),[E,m,f,Y]=k0(t),{w:H,h:_}=s0(),a=Gu((A==null?void 0:A.width)+T+S),C=Gu((A==null?void 0:A.height)+l+w),L=Gu((A==null?void 0:A.top)-l-E),b=Gu((A==null?void 0:A.left)-T-Y),g=H-Y-m,D=_-E-f,$=x("maskArea",{x:b,y:L,width:a,height:C}),eu=x("highlightedArea",{x:b,y:L,width:a,height:C});return P.createElement("div",{style:x("maskWrapper",{}),onClick:r,className:h},P.createElement("svg",{width:g,height:D,xmlns:"http://www.w3.org/2000/svg",style:x("svgWrapper",{windowWidth:g,windowHeight:D,wpt:E,wpl:Y})},P.createElement("defs",null,P.createElement("mask",{id:d},P.createElement("rect",{x:0,y:0,width:g,height:D,fill:"white"}),P.createElement("rect",{style:$,rx:$.rx?1:void 0})),P.createElement("clipPath",{id:s},P.createElement("polygon",{points:`0 0, 0 ${D}, ${b} ${D}, ${b} ${L}, ${b+a} ${L}, ${b+a} ${L+C}, ${b} ${L+C}, ${b} ${D}, ${g} ${D}, ${g} 0`}))),P.createElement("rect",{style:x("maskRect",{windowWidth:g,windowHeight:D,maskID:d})}),P.createElement("rect",{style:x("clickArea",{windowWidth:g,windowHeight:D,top:L,left:b,width:a,height:C,clipID:s})}),P.createElement("rect",{style:eu,className:o,onClick:n,rx:eu.rx?1:void 0})))},_t=wt;function V0(e){return e+Math.random().toString(36).substring(2,16)}var mt=Object.defineProperty,n0=Object.getOwnPropertySymbols,w6=Object.prototype.hasOwnProperty,_6=Object.prototype.propertyIsEnumerable,G0=(e,t,r)=>t in e?mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Q0=(e,t)=>{for(var r in t||(t={}))w6.call(t,r)&&G0(e,r,t[r]);if(n0)for(var r of n0(t))_6.call(t,r)&&G0(e,r,t[r]);return e},Tt=(e,t)=>{var r={};for(var n in e)w6.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&n0)for(var n of n0(e))t.indexOf(n)<0&&_6.call(e,n)&&(r[n]=e[n]);return r},Rt={popover:()=>({position:"fixed",maxWidth:353,backgroundColor:"#fff",padding:"24px 30px",boxShadow:"0 0.5em 3em rgba(0, 0, 0, 0.3)",color:"inherit",zIndex:1e5,transition:"transform 0.3s",top:0,left:0})};function Lt(e){return(t,r)=>{const n=Rt[t](r),i=e[t];return i?i(n,r):n}}var It=e=>{var t=e,{children:r,position:n="bottom",padding:i=10,styles:A={},sizes:h,refresher:o}=t,c=Tt(t,["children","position","padding","styles","sizes","refresher"]);const y=p.useRef(null),d=p.useRef(""),s=p.useRef(""),x=p.useRef(""),{w:l,h:S}=s0(),w=Lt(A),T=Ft(y,o),{width:E,height:m}=T,[f,Y,H,_]=k0(i),a=(h==null?void 0:h.left)-_,C=(h==null?void 0:h.top)-f,L=(h==null?void 0:h.right)+Y,b=(h==null?void 0:h.bottom)+H,g=n&&typeof n=="function"?n({width:E,height:m,windowWidth:l,windowHeight:S,top:C,left:a,right:L,bottom:b,x:h.x,y:h.y},T):n,D={left:a,right:l-L,top:C,bottom:S-b},$=(q,F,z)=>{switch(q){case"top":return D.top>m+H;case"right":return F?!1:D.right>E+_;case"bottom":return z?!1:D.bottom>m+f;case"left":return D.left>E+Y;default:return!1}},eu=(q,F,z)=>{const R=St(D,z?["right","left"]:F?["top","bottom"]:[]);for(let U=0;U{if(Array.isArray(q)){const Z=K0(q[0],l),su=U0(q[1],S);return d.current="custom",[Z?l/2-E/2:q[0],su?S/2-m/2:q[1]]}const F=K0(a+E,l),z=U0(b+m,S),R=F?Math.min(a,l-E):Math.max(a,0),U=z?m>D.bottom?Math.max(b-m,0):Math.max(C,0):C;z&&m>D.bottom?s.current="bottom":s.current="top",F?x.current="left":x.current="right";const tu={top:[R-_,C-m-H],right:[L+_,U-f],bottom:[R-_,b+f],left:[a-E-Y,U-f],center:[l/2-E/2,S/2-m/2]};return q==="center"||$(q,F,z)&&!F&&!z?(d.current=q,tu[q]):eu(tu,F,z)})(g);return P.createElement("div",Q0({className:"reactour__popover",style:Q0({transform:`translate(${Math.round(B[0])}px, ${Math.round(B[1])}px)`},w("popover",{position:d.current,verticalAlign:s.current,horizontalAlign:x.current,helperRect:T,targetRect:h})),ref:y},c),r)},Mt=It,Bt=Object.defineProperty,Ht=Object.defineProperties,Ot=Object.getOwnPropertyDescriptors,a0=Object.getOwnPropertySymbols,m6=Object.prototype.hasOwnProperty,T6=Object.prototype.propertyIsEnumerable,X0=(e,t,r)=>t in e?Bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Au=(e,t)=>{for(var r in t||(t={}))m6.call(t,r)&&X0(e,r,t[r]);if(a0)for(var r of a0(t))T6.call(t,r)&&X0(e,r,t[r]);return e},_0=(e,t)=>Ht(e,Ot(t)),Ku=(e,t)=>{var r={};for(var n in e)m6.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&a0)for(var n of a0(e))t.indexOf(n)<0&&T6.call(e,n)&&(r[n]=e[n]);return r},qt={bottom:0,height:0,left:0,right:0,top:0,width:0,windowWidth:0,windowHeight:0,x:0,y:0};function Pt(e,t={block:"center",behavior:"smooth",inViewThreshold:0}){const[r,n]=p.useState(!1),[i,A]=p.useState(!1),[h,o]=p.useState(!1),[c,y]=p.useState(null),[d,s]=p.useState(qt),x=(e==null?void 0:e.selector)instanceof Element?e==null?void 0:e.selector:document.querySelector(e==null?void 0:e.selector),l=p.useCallback(()=>{const w=Z0(x,e==null?void 0:e.highlightedSelectors,e==null?void 0:e.bypassElem),{hasHighligtedElems:T}=w,E=Ku(w,["hasHighligtedElems"]);Object.entries(d).some(([m,f])=>E[m]!==f)&&s(E)},[x,e==null?void 0:e.highlightedSelectors,d]);p.useEffect(()=>(l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)),[x,e==null?void 0:e.highlightedSelectors,c]),p.useEffect(()=>{!Et(_0(Au({},d),{threshold:t.inViewThreshold}))&&x&&(n(!0),jt(x,t).then(()=>{i||y(Date.now())}).finally(()=>{n(!1)}))},[d]);const S=p.useCallback(()=>{A(!0);const w=Z0(x,e==null?void 0:e.highlightedSelectors,e==null?void 0:e.bypassElem),{hasHighligtedElems:T}=w,E=Ku(w,["hasHighligtedElems"]);o(T),s(E),A(!1)},[x,e==null?void 0:e.highlightedSelectors,d]);return{sizes:d,transition:r,target:x,observableRefresher:S,isHighlightingObserved:h}}function Z0(e,t=[],r=!0){let n=!1;const{w:i,h:A}=s0();if(!t)return _0(Au({},Qu(e)),{windowWidth:i,windowHeight:A,hasHighligtedElems:!1});let h=Qu(e),o={bottom:0,height:0,left:i,right:0,top:A,width:0};for(const y of t){const d=document.querySelector(y);if(!d||d.style.display==="none"||d.style.visibility==="hidden")continue;const s=Qu(d);n=!0,r||!e?(s.topo.right&&(o.right=s.right),s.bottom>o.bottom&&(o.bottom=s.bottom),s.lefth.right&&(h.right=s.right),s.bottom>h.bottom&&(h.bottom=s.bottom),s.left0&&o.height>0:!1;return{left:(c?o:h).left,top:(c?o:h).top,right:(c?o:h).right,bottom:(c?o:h).bottom,width:(c?o:h).width,height:(c?o:h).height,windowWidth:i,windowHeight:A,hasHighligtedElems:n,x:h.x,y:h.y}}var Yt=({disableKeyboardNavigation:e,setCurrentStep:t,currentStep:r,setIsOpen:n,stepsLength:i,disable:A,rtl:h,clickProps:o,keyboardHandler:c})=>{function y(d){if(d.stopPropagation(),e===!0||A)return;let s,x,l;e&&(s=e.includes("esc"),x=e.includes("right"),l=e.includes("left"));function S(){t(Math.min(r+1,i-1))}function w(){t(Math.max(r-1,0))}c&&typeof c=="function"?c(d,o,{isEscDisabled:s,isRightDisabled:x,isLeftDisabled:l}):(d.keyCode===27&&!s&&(d.preventDefault(),n(!1)),d.keyCode===39&&!x&&(d.preventDefault(),h?w():S()),d.keyCode===37&&!l&&(d.preventDefault(),h?S():w()))}return p.useEffect(()=>(window.addEventListener("keydown",y,!1),()=>{window.removeEventListener("keydown",y)}),[A,t,r]),null},Wt=Yt,Nt={badge:()=>({position:"absolute",fontFamily:"monospace",background:"var(--reactour-accent,#007aff)",height:"1.875em",lineHeight:2,paddingLeft:"0.8125em",paddingRight:"0.8125em",fontSize:"1em",borderRadius:"1.625em",color:"white",textAlign:"center",boxShadow:"0 0.25em 0.5em rgba(0, 0, 0, 0.3)",top:"-0.8125em",left:"-0.8125em"}),controls:()=>({display:"flex",marginTop:24,alignItems:"center",justifyContent:"space-between"}),navigation:()=>({counterReset:"dot",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"}),button:({disabled:e})=>({display:"block",padding:0,border:0,background:"none",cursor:e?"not-allowed":"pointer"}),arrow:({disabled:e})=>({color:e?"#caccce":"#646464",width:16,height:12,flex:"0 0 16px"}),dot:({current:e,disabled:t,showNumber:r})=>({counterIncrement:"dot",width:8,height:8,border:e?"0":"1px solid #caccce",borderRadius:"100%",padding:0,display:"block",margin:4,transition:"opacity 0.3s, transform 0.3s",cursor:t?"not-allowed":"pointer",transform:`scale(${e?1.25:1})`,color:e?"var(--reactour-accent, #007aff)":"#caccce",background:e?"var(--reactour-accent, #007aff)":"none"}),close:({disabled:e})=>({position:"absolute",top:22,right:22,width:9,height:9,"--rt-close-btn":e?"#caccce":"#5e5e5e","--rt-close-btn-disabled":e?"#caccce":"#000"}),svg:()=>({display:"block"})};function i0(e){return(t,r)=>{const n=Nt[t](r),i=e[t];return i?i(n,r):n}}var $t=({styles:e={},children:t})=>{const r=i0(e);return P.createElement("span",{style:r("badge",{})},t)},zt=$t,Kt=e=>{var t=e,{styles:r={},onClick:n,disabled:i}=t,A=Ku(t,["styles","onClick","disabled"]);const h=i0(r);return P.createElement("button",Au({className:"reactour__close-button",style:Au(Au({},h("button",{})),h("close",{disabled:i})),onClick:n},A),P.createElement("svg",{viewBox:"0 0 9.1 9.1","aria-hidden":!0,role:"presentation",style:Au({},h("svg",{}))},P.createElement("path",{fill:"currentColor",d:"M5.9 4.5l2.8-2.8c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0L4.5 3.1 1.7.3C1.3-.1.7-.1.3.3c-.4.4-.4 1 0 1.4l2.8 2.8L.3 7.4c-.4.4-.4 1 0 1.4.2.2.4.3.7.3s.5-.1.7-.3L4.5 6l2.8 2.8c.3.2.5.3.8.3s.5-.1.7-.3c.4-.4.4-1 0-1.4L5.9 4.5z"})))},Ut=Kt,Vt=({content:e,setCurrentStep:t,transition:r,isHighlightingObserved:n,currentStep:i,setIsOpen:A})=>typeof e=="function"?e({setCurrentStep:t,transition:r,isHighlightingObserved:n,currentStep:i,setIsOpen:A}):e,Gt=Vt,Qt=({styles:e={},steps:t,setCurrentStep:r,currentStep:n,setIsOpen:i,nextButton:A,prevButton:h,disableDots:o,hideDots:c,hideButtons:y,disableAll:d,rtl:s,Arrow:x=R6})=>{const l=t.length,S=i0(e),w=({onClick:T,kind:E="next",children:m,hideArrow:f})=>{function Y(){d||(T&&typeof T=="function"?T():r(E==="next"?Math.min(n+1,l-1):Math.max(n-1,0)))}return P.createElement("button",{style:S("button",{kind:E,disabled:d||(E==="next"?l-1===n:n===0)}),onClick:Y,"aria-label":`Go to ${E} step`},f?null:P.createElement(x,{styles:e,inverted:s?E==="prev":E==="next",disabled:d||(E==="next"?l-1===n:n===0)}),m)};return P.createElement("div",{style:S("controls",{}),dir:s?"rtl":"ltr"},y?null:h&&typeof h=="function"?h({Button:w,setCurrentStep:r,currentStep:n,stepsLength:l,setIsOpen:i,steps:t}):P.createElement(w,{kind:"prev"}),c?null:P.createElement("div",{style:S("navigation",{})},Array.from({length:l},(T,E)=>E).map(T=>{var E;return P.createElement("button",{style:S("dot",{current:T===n,disabled:o||d}),onClick:()=>{!o&&!d&&r(T)},key:`navigation_dot_${T}`,"aria-label":((E=t[T])==null?void 0:E.navDotAriaLabel)||`Go to step ${T+1}`})})),y?null:A&&typeof A=="function"?A({Button:w,setCurrentStep:r,currentStep:n,stepsLength:l,setIsOpen:i,steps:t}):P.createElement(w,null))},Xt=Qt,R6=({styles:e={},inverted:t=!1,disabled:r})=>{const n=i0(e);return P.createElement("svg",{viewBox:"0 0 18.4 14.4",style:n("arrow",{inverted:t,disabled:r})},P.createElement("path",{d:t?"M17 7.2H1M10.8 1L17 7.2l-6.2 6.2":"M1.4 7.2h16M7.6 1L1.4 7.2l6.2 6.2",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeMiterlimit:"10"}))},Zt={Badge:zt,Close:Ut,Content:Gt,Navigation:Xt,Arrow:R6},Jt=e=>Au(Au({},Zt),e),ur=({styles:e,components:t={},badgeContent:r,accessibilityOptions:n,disabledActions:i,onClickClose:A,steps:h,setCurrentStep:o,currentStep:c,transition:y,isHighlightingObserved:d,setIsOpen:s,nextButton:x,prevButton:l,disableDotsNavigation:S,rtl:w,showPrevNextButtons:T=!0,showCloseButton:E=!0,showNavigation:m=!0,showBadge:f=!0,showDots:Y=!0,meta:H,setMeta:_,setSteps:a})=>{const C=h[c],{Badge:L,Close:b,Content:g,Navigation:D,Arrow:$}=Jt(t),eu=r&&typeof r=="function"?r({currentStep:c,totalSteps:h.length,transition:y}):c+1;function pu(){i||(A&&typeof A=="function"?A({setCurrentStep:o,setIsOpen:s,currentStep:c,steps:h,meta:H,setMeta:_,setSteps:a}):s(!1))}return P.createElement(P.Fragment,null,f?P.createElement(L,{styles:e},eu):null,E?P.createElement(b,{styles:e,"aria-label":n==null?void 0:n.closeButtonAriaLabel,disabled:i,onClick:pu}):null,P.createElement(g,{content:C==null?void 0:C.content,setCurrentStep:o,currentStep:c,transition:y,isHighlightingObserved:d,setIsOpen:s}),m?P.createElement(D,{setCurrentStep:o,currentStep:c,setIsOpen:s,steps:h,styles:e,"aria-hidden":!(n!=null&&n.showNavigationScreenReaders),nextButton:x,prevButton:l,disableDots:S,hideButtons:!T,hideDots:!Y,disableAll:i,rtl:w,Arrow:$}):null)},er=ur,tr=e=>{var t=e,{currentStep:r,setCurrentStep:n,setIsOpen:i,steps:A=[],setSteps:h,styles:o={},scrollSmooth:c,afterOpen:y,beforeClose:d,padding:s=10,position:x,onClickMask:l,onClickHighlighted:S,keyboardHandler:w,className:T="reactour__popover",maskClassName:E="reactour__mask",highlightedMaskClassName:m,clipId:f,maskId:Y,disableInteraction:H,disableKeyboardNavigation:_,inViewThreshold:a,disabledActions:C,setDisabledActions:L,disableWhenSelectorFalsy:b,rtl:g,accessibilityOptions:D={closeButtonAriaLabel:"Close Tour",showNavigationScreenReaders:!0},ContentComponent:$,Wrapper:eu,meta:pu,setMeta:B,onTransition:q=()=>"center"}=t,F=Ku(t,["currentStep","setCurrentStep","setIsOpen","steps","setSteps","styles","scrollSmooth","afterOpen","beforeClose","padding","position","onClickMask","onClickHighlighted","keyboardHandler","className","maskClassName","highlightedMaskClassName","clipId","maskId","disableInteraction","disableKeyboardNavigation","inViewThreshold","disabledActions","setDisabledActions","disableWhenSelectorFalsy","rtl","accessibilityOptions","ContentComponent","Wrapper","meta","setMeta","onTransition"]),z;const R=A[r],U=Au(Au({},o),R==null?void 0:R.styles),{sizes:tu,transition:Z,observableRefresher:su,isHighlightingObserved:du,target:gu}=Pt(R,{block:"center",behavior:c?"smooth":"auto",inViewThreshold:a});p.useEffect(()=>(y&&typeof y=="function"&&y(gu),()=>{d&&typeof d=="function"&&d(gu)}),[]);const{maskPadding:mu,popoverPadding:j,wrapperPadding:O}=nr((z=R==null?void 0:R.padding)!=null?z:s),V={setCurrentStep:n,setIsOpen:i,currentStep:r,setSteps:h,steps:A,setMeta:B,meta:pu};function ru(){C||(l&&typeof l=="function"?l(V):i(!1))}const nu=typeof(R==null?void 0:R.stepInteraction)=="boolean"?!(R!=null&&R.stepInteraction):H?typeof H=="boolean"?H:H(V):!1;p.useEffect(()=>(R!=null&&R.action&&typeof(R==null?void 0:R.action)=="function"&&(R==null||R.action(gu)),(R==null?void 0:R.disableActions)!==void 0&&L(R==null?void 0:R.disableActions),()=>{R!=null&&R.actionAfter&&typeof(R==null?void 0:R.actionAfter)=="function"&&(R==null||R.actionAfter(gu))}),[R]);const au=Z?q:R!=null&&R.position?R==null?void 0:R.position:x,ju=eu||P.Fragment;return R?P.createElement(ju,null,P.createElement(vt,{mutationObservables:R==null?void 0:R.mutationObservables,resizeObservables:R==null?void 0:R.resizeObservables,refresh:su}),P.createElement(Wt,{setCurrentStep:n,currentStep:r,setIsOpen:i,stepsLength:A.length,disableKeyboardNavigation:_,disable:C,rtl:g,clickProps:V,keyboardHandler:w}),(!b||gu)&&P.createElement(_t,{sizes:Z?ar:tu,onClick:ru,styles:Au({highlightedArea:yu=>_0(Au({},yu),{display:nu?"block":"none"})},U),padding:Z?0:mu,highlightedAreaClassName:m,className:E,onClickHighlighted:yu=>{yu.preventDefault(),yu.stopPropagation(),S&&S(yu,V)},wrapperPadding:O,clipId:f,maskId:Y}),(!b||gu)&&P.createElement(Mt,{sizes:tu,styles:U,position:au,padding:j,"aria-labelledby":D==null?void 0:D.ariaLabelledBy,className:T,refresher:r},$?P.createElement($,Au({styles:U,setCurrentStep:n,currentStep:r,setIsOpen:i,steps:A,accessibilityOptions:D,disabledActions:C,transition:Z,isHighlightingObserved:du,rtl:g},F)):P.createElement(er,Au({styles:U,setCurrentStep:n,currentStep:r,setIsOpen:i,steps:A,setSteps:h,accessibilityOptions:D,disabledActions:C,transition:Z,isHighlightingObserved:du,rtl:g,meta:pu,setMeta:B},F)))):null},rr=tr;function nr(e){return typeof e=="object"&&e!==null?{maskPadding:e.mask,popoverPadding:e.popover,wrapperPadding:e.wrapper}:{maskPadding:e,popoverPadding:e,wrapperPadding:0}}var ar={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0},or={isOpen:!1,setIsOpen:()=>!1,currentStep:0,setCurrentStep:()=>0,steps:[],setSteps:()=>[],setMeta:()=>"",disabledActions:!1,setDisabledActions:()=>!1,components:{}},lr=P.createContext(or),sr=e=>{var t=e,{children:r,defaultOpen:n=!1,startAt:i=0,steps:A,setCurrentStep:h,currentStep:o}=t,c=Ku(t,["children","defaultOpen","startAt","steps","setCurrentStep","currentStep"]);const[y,d]=p.useState(n),[s,x]=p.useState(i),[l,S]=p.useState(A),[w,T]=p.useState(""),[E,m]=p.useState(!1),f=Au({isOpen:y,setIsOpen:d,currentStep:o||s,setCurrentStep:h&&typeof h=="function"?h:x,steps:l,setSteps:S,disabledActions:E,setDisabledActions:m,meta:w,setMeta:T},c);return P.createElement(lr.Provider,{value:f},r,y?P.createElement(rr,Au({},f)):null)};const ir=[{selector:".new-request-form-button",content:({goTo:e,inDOM:t})=>u.jsx("div",{children:"برای ثبت درخواست کشتار اینجا کلیک کنید."})},{selector:".slaughter-submited-requests",content:({goTo:e,inDOM:t})=>u.jsx("div",{children:"درخواست های ثبت شده خود را در این قسمت مشاهده می کنید."})},{selector:".slaughter-archived-requests",content:({goTo:e,inDOM:t})=>u.jsx("div",{children:"درخواست های بایگانی شده شما در این قسمت نمایش داده می شود."})}],J0=Lu("CHECK_REQUEST_BY_SLAUGHTER",async e=>{const{data:t,status:r}=await Su.post("kill_house_check_request/",e);return{data:t,status:r}});function L6({reqKey:e,poultryRequestKey:t}){const[r]=p.useContext(Q),[n,i]=p.useState(!1),A=lu(),{id:h}=y6(),[,,o,,c]=p.useContext(Q),y=_u({initialValues:{rejectText:""},validationSchema:fu({rejectText:bu().required("این فیلد اجباری است!").typeError("لطفا دلیل خود را بیان کنید.")})}),d=xu()==="ProvinceOperator"?"ثبت اطلاعات بجای کشتارگاه":"ثبت اطلاعات و ارسال به استان",s=xu()==="ProvinceOperator"?"رد اطلاعات بجای کشتارگاه":"رد اطلاعات و پیام به استان";return u.jsx(v,{children:u.jsx(v,{container:!0,gap:k.SMALL,padding:k.SMALL,children:u.jsx(we,{children:n?u.jsx(ue.div,{animate:{x:-10,opacity:1},transition:{duration:.3},initial:{opacity:0},exit:{opacity:0},children:u.jsxs(v,{flexDirection:"column",container:!0,gap:k.SMALL,children:[u.jsx(v,{children:u.jsx(N,{multiline:!0,rows:4,fullWidth:!0,id:"rejectText",label:"پیام خود را وارد کنید",variant:"outlined",value:y.values.rejectText,error:y.touched.rejectText?!!y.errors.rejectText:null,onChange:y.handleChange,onBlur:y.handleBlur,helperText:y.touched.rejectText&&y.errors.rejectText?y.errors.rejectText:null})}),u.jsxs(v,{container:!0,gap:k.SMALL,children:[u.jsx(v,{children:u.jsx(G,{variant:"outlined",color:"secondary",onClick:()=>{i(!1)},children:"لغو"})}),u.jsx(v,{children:u.jsx(G,{variant:"outlined",onClick:()=>{A(cu()),A(J0({message:y.values.rejectText,province_kill_request_key:e,state:"rejected"})).then(x=>{A(X()),x.error?r({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(A(hu({right:!1,bottom:!1,top:!1,content:null})),A(Ju({id:h})),i(!1),A(b0({key:t})),A(Mu({selectedDate1:o,selectedDate2:c})),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"رد اطلاعات و پیام به استان"})})]})]})}):u.jsxs(v,{container:!0,gap:k.SMALL,children:[u.jsx(G,{variant:"outlined",color:"secondary",onClick:()=>{i(!0)},children:s}),u.jsx(G,{variant:"outlined",onClick:()=>{A(cu()),A(J0({province_kill_request_key:e,state:"accepted",role:xu()})).then(x=>{A(X()),x.error?r({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(A(hu({right:!1,bottom:!1,top:!1,content:null})),A(Ju({id:h})),A(b0({key:t})),A(Mu({selectedDate1:o,selectedDate2:c})),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),A(Iu({title:"عملیات با موفقیت انجام شد.",content:u.jsxs(v,{container:!0,direction:"column",gap:k.MEDIUM,alignItems:"center",justifyContent:"center",children:[u.jsx(v,{children:u.jsx(I,{color:"green",children:"پرونده به کارتابل (تخصیص خودرو) انتقال پیدا کرد."})}),u.jsx(v,{children:u.jsx(G,{variant:"contained",color:"success",onClick:()=>{A(Ru())},children:"تایید"})})]})})))})},children:d})]})})})})}L6.propTypes={reqKey:vu.PropTypes.string,poultryRequestKey:vu.PropTypes.string};const I6=({item:e})=>u.jsx(u.Fragment,{children:u.jsxs(r6,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(n6,{children:[u.jsx(a6,{color:"secondary"}),u.jsx(o6,{})]}),u.jsxs(v,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(v,{container:!0,children:[u.jsx(v,{children:u.jsx(l6,{variant:"body1",fontWeight:"bold",color:"secondary",children:"انجام عملیات"})}),u.jsx(v,{children:u.jsx(s6,{color:"textSecondary",children:u.jsx(I,{variant:"body2",children:"در این مرحله تخصیص را تایید یا رد کنید."})})})]}),u.jsx(v,{children:u.jsx(v,{container:!0,direction:"column",alignItems:"start",mt:k.TINY,children:u.jsx(L6,{reqKey:e.provinceKillReqKey,poultryRequestKey:e.poultryReqKey},e.provinceKillReqKey)},e.date.valueOf())})]})]})});I6.propTypes={item:vu.PropTypes.object,i:vu.PropTypes.any,poultryRequestKey:vu.PropTypes.any};const cr=()=>{const e=Vu(),[t,r]=p.useState([]),{slaughterActiveRequests:n}=Fu(s=>s.slaughterSlice),i=lu(),[,,A,h,o,c]=p.useContext(Q);p.useEffect(()=>{const s=J(new Date).format("YYYY-MM-DD");h(s),c(s)},[]),p.useEffect(()=>{i(Mu({selectedDate1:A,selectedDate2:o}))},[A,o]),p.useEffect(()=>{const s=n==null?void 0:n.filter(l=>l.provinceKillState==="pending"),x=s==null?void 0:s.map((l,S)=>[S+1,l.orderCode,l!=null&&l.freezing?"انجماد":l!=null&&l.export?"صادرات":"عادی",(l==null?void 0:l.freeSaleInProvince)===!1?"دولتی":"آزاد",Bu(new Date(l==null?void 0:l.sendDate),"yyyy/MM/dd"),`${l.poultryName} (${l.poultryMobile})`,`${l.killHouseName} (${l.killHouseMobile})`,l.city,l.province,l.age,l.mainQuantity.toLocaleString()+" قطعه",l.amount.toLocaleString()+" ﷼",l.chickenBreed,l.indexWeight+" کیلوگرم",u.jsx(ou,{color:"primary",onClick:()=>{i(hu({title:"انجام عملیات تخصیص",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(I6,{item:l,i:S})}))},children:u.jsx($u,{})},S),u.jsx(ou,{"aria-label":"delete",color:"primary",onClick:()=>e(Uu+l.poultryReqId),children:u.jsx(Nu,{})},S)]);r(x)},[n]);const[y]=p.useState(["ردیف","کد سفارش","کشتار","فروش","تاریخ درخواست","مرغدار","خریدار","شهر","استان","سن مرغ","تعداد","قیمت مرغ زنده","نژاد","میانگین وزن","عملیات","مشاهده"]),d=_u({initialValues:{capacity:"",recieveTime:"",recieveDate:J(Date()).format("YYYY-MM-DD hh:mm:ss")},validationSchema:fu({capacity:Tu().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),recieveTime:bu().required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!")})});return p.useEffect(()=>{d.validateForm()},[]),u.jsxs(W,{container:!0,direction:"column",gap:k.SMALL,mt:k.MEDIUM,children:[u.jsxs(W,{container:!0,alignItems:"center",gap:k.SMALL,children:[u.jsx(uu,{label:"از تاریخ",id:"date",renderInput:s=>u.jsx(N,{style:{width:"160px"},...s}),value:A,onChange:s=>{h(J(s).format("YYYY-MM-DD"))}}),u.jsx(uu,{label:"تا تاریخ",id:"date",renderInput:s=>u.jsx(N,{style:{width:"160px"},...s}),value:o,onChange:s=>{c(J(s).format("YYYY-MM-DD"))}})]}),u.jsx(Wu,{title:"درخواست های در انتظار تایید",columns:y,data:t,paginated:!0})]})},dr=()=>{const e=Fu(t=>t.userSlice.userPath);return e==="https://check.rasadyaar.ir"||e.includes("localhost")?"خرم آباد، مطهری، شرکت آرتامهر آرتان":e==="https://mabackend.rasadyar.com/"?"مرودشت، رو به روی شبکه دامپزشکی شهرستان اراک، اتحادیه مرغداران استان مرکزی":e==="https://arbackend.rasadyar.com/"?"آدرس : اردبیل، شهرک کارشناسان ،جنب ساختمان نظام مهندسی، ساختمان فرهنگ، طبقه دوم تلفن : 33749254 تلفاکس : 33749253 ":e==="https://habackend.rasadyar.com/"?"همدان، بلوار آیت اله مدنی، کوچه امامزاده یحیی یک تلفن: 081 32523689 ":e==="https://shabackend.rasadyar.com/"?"تبریز خیابان راه آهن نبش کوی اشکان ساختمان ۱۴ طبقه دوم تلفن: 041 34502363":e==="https://ghabackend.rasadyar.com/"?"آدرس استان آذربایجان غربی":e==="https://bubackend.rasadyar.com/"?"بوشهر، خيابان امام خمينی، جنب مديريت برق، ساختمان رضايي، طبقه 3":"آدرس تست"},K={page:{width:"210mm",margin:"0 auto",display:"flex",flexDirection:"column",position:"relative",direction:"rtl",fontFamily:"nazanin",fontWeight:"bold"},logo:{width:"60px",height:"auto",marginBottom:"10px"},contentContainer:{display:"flex",justifyContent:"space-between",marginTop:"20px",marginLeft:"20px",marginRight:"30px"},contentInLine:{display:"flex",flexDirection:"column",alignItems:"center"},mainTitle:{fontFamily:"nazanin",fontSize:11,pAlign:"center",fontWeight:"bolder"},watermarkContainer:{position:"fixed",top:450,left:0,right:30,bottom:0,justifyContent:"center",alignItems:"center",opacity:.2,zIndex:-1},watermarkp:{fontSize:100,fontWeight:"bolder",color:"grey",transform:"rotate(-45deg)",left:"50%"},title:{fontSize:12,fontWeight:"bolder",pAlign:"center"},titleTopic:{marginTop:"10px",fontSize:12,fontWeight:"bolder",pAlign:"center"},firsttitle:{fontSize:14,fontWeight:"bolder",marginLeft:"20px",pAlign:"center"},options:{padding:"10px",marginTop:"15px",display:"flex",flexDirection:"column",alignItems:"flex-start"},divider:{width:"100%",height:"2px",backgroundColor:"red",marginBottom:15},divider2:{width:"100%",height:"1px",background:"repeating-linear-gradient(90deg, transparent, transparent 5px, #f00 5px, #f00 10px)"},pTitleContainer:{margin:"15px",textAlign:"justify",textJustify:"inter-word",fontSize:"20px"},footer:{pageBreakAfter:"always",position:"fixed",left:0,bottom:0,width:"100%"},centerText:{fontSize:"20px",alignSelf:"center",textAlign:"center"},cutIcon:{zIndex:2,transform:"rotate(180deg)",opacity:"60%"}},m0=p.forwardRef((e,t)=>{const{date:r}=e,{amount:n}=e,{breeder:i}=e,{buyer:A}=e,h=w0(),o=dr();return u.jsxs("div",{style:K.page,ref:t,children:[u.jsxs("div",{style:K.contentContainer,children:[u.jsxs("div",{style:K.contentInLine,children:[u.jsx("img",{alt:"logo",src:_e,style:K.logo}),u.jsx("span",{style:K.mainTitle,children:"اتحادیه شرکتهاي تعاونی کشاورزي"}),u.jsxs("span",{style:K.title,children:["مرغداران "," ‌"," ",h]}),u.jsx("span",{style:K.title,children:"ثبت : 5203 تاسیس : 1383"})]}),u.jsx("div",{children:u.jsx("span",{style:K.firsttitle,children:"بسمه تعالی"})}),u.jsxs("div",{style:K.options,children:[u.jsx("span",{style:K.title,children:"شماره: "}),u.jsxs("span",{style:K.titleTopic,children:["تاریخ: ",iu(r)]})]})]}),u.jsx("div",{style:K.watermarkContainer,children:u.jsx("p",{style:K.watermarkp,children:"سامانه رصدیار "})}),u.jsx("hr",{style:K.divider}),u.jsx("p",{style:K.centerText,children:u.jsx("strong",{children:"تاییدیه خریدار"})}),u.jsxs("p",{style:K.pTitleContainer,children:["این حواله در تاریخ "," ‌"," ",iu(r)," جهت بارگیري تعداد"," ",n.toLocaleString()," قطعه مرغ زنده تحویل مرغداري ",i," گردید.",u.jsx("br",{}),u.jsx("br",{}),u.jsx("br",{})]}),u.jsx("span",{style:K.centerText,children:u.jsx("span",{style:K.centerText,children:u.jsxs("strong",{children:["امضا خریدار آقا/خانم ",A]})})}),u.jsx("br",{}),u.jsx("br",{}),u.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",justifyItems:"center",marginBottom:15},children:[u.jsx(W0,{style:K.cutIcon}),u.jsx("div",{style:K.divider2})]}),u.jsxs("p",{style:K.pTitleContainer,children:["مطابق برگ باسکول پیوستی، خروج تعداد ",n.toLocaleString()," قطعه به وزن ......................... کیلوگرم در تاریخ "," ‌",iu(r)," از مرغداري آقا/خانم"," ‌",i," ‌"," مورد تایید اینجانب می باشد.",u.jsx("br",{}),u.jsx("br",{}),u.jsx("br",{})]}),u.jsx("span",{style:K.centerText,children:u.jsxs("strong",{children:["امضا خریدار آقا/خانم ",A]})}),u.jsx("br",{}),u.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",justifyItems:"center",marginBottom:15},children:[u.jsx(W0,{style:K.cutIcon}),u.jsx("div",{style:K.divider2})]}),u.jsx("p",{style:K.centerText,children:u.jsx("strong",{children:"تاییدیه مرغداری"})}),u.jsxs("p",{style:K.pTitleContainer,children:["مطابق برگ باسکول پیوستی، خروج تعداد ",n.toLocaleString()," قطعه به وزن ......................... کیلوگرم توسط آقا/خانم "," ‌",A," ‌"," مورد تائید اینجانب "," ‌",i," ‌"," مالک / نماینده قانونی مرغداری "," ‌",i," ‌"," باشد."]}),u.jsx("br",{}),u.jsx("span",{style:K.centerText,children:u.jsxs("strong",{children:["مهر و امضا ",i," "," ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌"," ","اثر انگشت"]})}),u.jsx("br",{}),u.jsxs("div",{style:K.footer,children:[u.jsx("div",{style:K.divider}),u.jsx("p",{style:{fontSize:13,padding:"10px",marginRight:"10px"},children:o})]})]})});m0.displayName="SlaughterSendKillerInvoice";m0.propTypes={item:vu.PropTypes.any};const Cr=Lu("SLAUGHTER_EDIT_CHICKEN_PRICE_SERVICE",async(e,{dispatch:t})=>{t(cu());try{const{data:r,status:n}=await Su.put("province_kill_request/0/",e);return t(X()),{data:r,status:n}}catch(r){return t(X()),{error:r.response.data.result}}}),M6=({fetchData:e,item:t})=>{const r=lu(),[n]=p.useContext(Q),i=_u({initialValues:{chickenPrice:""},validationSchema:fu({chickenPrice:Tu().required("این فیلد اجباری است!").positive("مقدار مثبت وارد کنید!").typeError("لطفا عدد وارد کنید!").min(t!=null&&t.freeSaleInProvince?4e5:(t==null?void 0:t.amount)/100*40,t!=null&&t.freeSaleInProvince?"حداقل قیمت قابل ثبت چهل هزار تومان است!":"اختلاف قیمت وارد شده و قیمت مرغدار باید کمتر از شصت درصد باشد!").max(t!=null&&t.freeSaleInProvince?2e6:(t==null?void 0:t.amount)/100*60+(t==null?void 0:t.amount),t!=null&&t.freeSaleInProvince?"قیمت متعارف وارد کنید!":"اختلاف قیمت وارد شده و قیمت مرغدار باید کمتر از شصت درصد باشد!")}),onSubmit:A=>{r(Cr({province_kill_request_key:t==null?void 0:t.provinceKillReqKey,kill_house_price:A.chickenPrice,role:xu()})).then(h=>{h.payload.error?n({vertical:"top",horizontal:"center",msg:h.payload.error,severity:"error"}):(n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),r(Ru()),e())})}});return u.jsxs("form",{onSubmit:i.handleSubmit,children:[u.jsx(I,{variant:"body1",color:"primary",mb:1,children:"اطلاعات سفارش"}),u.jsx(N6,{style:{width:"100%"}}),u.jsxs(v,{container:!0,xs:12,gap:1,mt:1,children:[u.jsx(I,{variant:"body2",style:{color:"gray"},children:"نام مرغدار:"}),u.jsx(I,{variant:"body2",color:"primary",children:`${t.poultryName} (${t.poultryMobile})`})]}),u.jsxs(v,{container:!0,xs:12,gap:1,children:[u.jsx(I,{variant:"body2",style:{color:"gray"},children:"قیمت مرغدار:"}),u.jsx(I,{variant:"body2",color:"primary",children:t.amount.toLocaleString()+" ﷼"})]}),u.jsxs(v,{container:!0,xs:12,gap:1,children:[u.jsx(I,{variant:"body2",style:{color:"gray"},children:"میانگین وزنی:"}),u.jsx(I,{variant:"body2",color:"primary",children:(t==null?void 0:t.indexWeight)+" کیلوگرم"})]}),u.jsxs(v,{container:!0,xs:12,gap:1,children:[u.jsx(I,{variant:"body2",style:{color:"gray"},children:"حجم تخصیص:"}),u.jsx(I,{variant:"body2",color:"primary",children:t.mainQuantity.toLocaleString()+" قطعه"})]}),u.jsx(N,{style:{minWidth:"350px"},fullWidth:!0,id:"chickenPrice",name:"chickenPrice",label:"قیمت خرید هر کیلو مرغ زنده را ثبت کنید",value:i.values.chickenPrice,onChange:i.handleChange,error:i.touched.chickenPrice&&!!i.errors.chickenPrice,helperText:i.touched.chickenPrice&&i.errors.chickenPrice,margin:"normal"}),u.jsx(G,{color:"primary",variant:"contained",fullWidth:!0,type:"submit",children:"ثبت"})]})};var T0={},hr=$6;Object.defineProperty(T0,"__esModule",{value:!0});var B6=T0.default=void 0,pr=hr(ee()),Ar=u;B6=T0.default=(0,pr.default)((0,Ar.jsx)("path",{d:"M14 12c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2m-2-9c-4.97 0-9 4.03-9 9H0l4 4 4-4H5c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.51 0-2.91-.49-4.06-1.3l-1.42 1.44C8.04 20.3 9.94 21 12 21c4.97 0 9-4.03 9-9s-4.03-9-9-9"}),"SettingsBackupRestore");const fr=Lu("SLAUGHTER_DELETE_ALLOCATED_BACK_KILL_REQUEST_SERVICE",async(e,{dispatch:t})=>{t(cu());try{const{data:r,status:n}=await Su.delete(`province_kill_request/0/?return_allocation_quantity=true&province_kill_request_key=${e.provinceKillRequestKey}`,e);return t(X()),{data:r,status:n}}catch(r){return t(X()),{error:r.response.data.result}}}),xr=Lu("SLAUGHTER_REMOVE_ALLOCATE_CAR_SERVICE",async(e,{dispatch:t})=>{t(cu());try{const{data:r,status:n}=await Su.delete("kill_house_request/0/",{params:{kill_house_request_key:e}});return t(X()),{data:r,status:n}}catch(r){return t(X()),{error:r.response.data.result}}}),gr=Lu("SLAUGHTER_EDIT_ALLOCATED_CAR_SERVICE",async(e,{dispatch:t})=>{var r,n;t(cu());try{const{data:i,status:A}=await Su.put("kill_house_requests/0/",e);return t(X()),{data:i,status:A}}catch(i){return t(X()),{error:((n=(r=i.response)==null?void 0:r.data)==null?void 0:n.result)||i.message}}}),H6=(e,t,r)=>{const n=lu(),[i,A]=p.useState([]);return p.useEffect(()=>{e?n(P0({id:e,killHouseKey:t,killRequestKey:r})).then(h=>A(h.payload.data)):n(P0()).then(h=>A(h.payload.data))},[]),i||[]},O6=({item:e,updateTable:t,poultryRequestKey:r,killHouseKey:n,killRequestKey:i})=>{const A=lu(),[h]=p.useContext(Q),o=H6(r,n,i),c=_u({initialValues:{car:null,trafficCode:(e==null?void 0:e.trafficCode)||"",amount:(e==null?void 0:e.barAmount)||""},validationSchema:fu({car:fu().nullable(),trafficCode:bu(),amount:Tu().positive("قیمت باید عدد مثبت باشد").nullable()})});p.useEffect(()=>{c.validateForm()},[]),p.useEffect(()=>{if(o&&e){const d=o.find(s=>s.key===e.carKey);d&&c.setFieldValue("car",d)}},[o,e]);const y=()=>{var s;if(!c.values.car&&!c.values.trafficCode&&!c.values.amount){h({vertical:"top",horizontal:"center",msg:"لطفا حداقل یکی از فیلدها را پر کنید",severity:"error"});return}const d={key:e==null?void 0:e.killHouseRequestKey};c.values.car||c.values.trafficCode?((s=c.values.car)!=null&&s.key&&c.values.car.key!==(e==null?void 0:e.carKey)&&(d.car_key=c.values.car.key),c.values.trafficCode&&c.values.trafficCode!==(e==null?void 0:e.trafficCode)&&(d.traffic_code=c.values.trafficCode),c.values.amount&&c.values.amount!==(e==null?void 0:e.barAmount)&&(d.amount=c.values.amount)):c.values.amount&&(d.amount=c.values.amount),A(gr(d)).then(x=>{var l;(l=x.payload)!=null&&l.error?h({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):(h({vertical:"top",horizontal:"center",msg:"ویرایش با موفقیت انجام شد",severity:"success"}),A(Ru()),t&&t())})};return u.jsxs(v,{container:!0,direction:"column",gap:k.SMALL,sx:{width:{xs:"300px",md:"400px"},p:2},children:[u.jsxs(wu,{fullWidth:!0,children:[u.jsx(Pu,{options:o||[],getOptionLabel:d=>{if(d){const s=d.type==="exclusive"?"اختصاصی":"اجاره ای";return`${d.driverName} (${d.driverMobile}) ${d.typeCar} پلاک ${d.pelak} (${s})`}return""},value:c.values.car,onChange:(d,s)=>{c.setFieldValue("car",s),s!=null&&s.healthCode&&c.setFieldValue("trafficCode",s.healthCode)},onBlur:c.handleBlur,renderInput:d=>u.jsx(N,{...d,label:"انتخاب خودرو و راننده (اختیاری)",error:c.touched.car?!!c.errors.car:null})}),u.jsx(Xu,{children:c.touched.car&&c.errors.car?c.errors.car:null})]}),u.jsx(wu,{fullWidth:!0,children:u.jsx(N,{id:"trafficCode",label:"کد حمل و نقل (اختیاری)",value:c.values.trafficCode,error:c.touched.trafficCode?!!c.errors.trafficCode:null,onChange:c.handleChange,onBlur:c.handleBlur,helperText:c.touched.trafficCode&&c.errors.trafficCode?c.errors.trafficCode:null,variant:"outlined"})}),u.jsx(wu,{fullWidth:!0,children:u.jsx(N,{id:"amount",name:"amount",label:"قیمت (اختیاری)",type:"number",value:c.values.amount,error:c.touched.amount?!!c.errors.amount:null,onChange:c.handleChange,onBlur:c.handleBlur,helperText:c.touched.amount&&c.errors.amount?c.errors.amount:null,variant:"outlined"})}),u.jsx(G,{variant:"contained",color:"primary",onClick:y,disabled:!c.values.car&&!c.values.trafficCode&&!c.values.amount,fullWidth:!0,children:"ثبت تغییرات"})]})};O6.propTypes={item:vu.PropTypes.object.isRequired,updateTable:vu.PropTypes.func,poultryRequestKey:vu.PropTypes.string,killHouseKey:vu.PropTypes.string,killRequestKey:vu.PropTypes.string};const yr=Lu("POST_SLAUGHTER_CAR_ALLOCATION",async(e,{dispatch:t})=>{try{const{data:r,status:n}=await Su.post("kill_house_request/",e);return t(cu()),{data:r,status:n}}catch(r){return t(X()),{error:r.response.data.result}}}),q6=({poultryRequestKey:e,provinceAllocationLimit:t,killRequestKey:r,killHouseKey:n,killHouseCheckKey:i,indexWeight:A,item:h})=>{const o={},[c]=p.useContext(Q),y=H6(e,n,r),[,,d,,s]=p.useContext(Q),[x,l]=p.useState(!1),S=()=>{m(Te()).then(g=>{l(g.payload.data)})};p.useEffect(()=>{S()},[]);const{id:w}=y6(),T=xu()==="ProvinceOperator"?"ثبت اطلاعات خودرو بجای کشتارگاه":"ثبت اطلاعات خودرو",E=()=>x!=null&&x.allow?x==null?void 0:x.limitation:3100,m=lu(),f=_u({initialValues:{quantity:"",car:"",realCar:"",shippingCode:""},validationSchema:fu({quantity:Tu().typeError("لطفا ظرفیت را به عدد وارد کنید!").required("این فیلد اجباری است!").min(1,"یک مقدار مجاز وارد کنید!").max(E(),`حداکثر میزان تخصیص به ماشین ${E()} قطعه میباشد`),shippingCode:bu().required("این فیلد اجباری است!"),car:fu().required("این فیلد اجباری است!"),realCar:fu()})});p.useEffect(()=>{f.validateForm()},[]),p.useEffect(()=>{o.killHouseWinner&&f.setFieldValue("selectedRequest","not required")},[]),p.useEffect(()=>{o.killHouseWinner&&f.setFieldValue("selectedRequest","not required")},[]);const[Y]=p.useState(!1),[H,_]=p.useState(),[a,C]=p.useState();p.useEffect(()=>{h!=null&&h.exclusiveKiller&&m(Ie()).then(g=>{_(g.payload.data)})},[]);const L=g=>{C(g==null?void 0:g.target.value)},b=()=>H&&H.length>0?a&&f.isValid:f.isValid;return u.jsx(u.Fragment,{children:u.jsxs(r6,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(n6,{children:[u.jsx(a6,{color:"secondary"}),u.jsx(o6,{})]}),u.jsxs(v,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(v,{container:!0,children:[u.jsx(v,{children:u.jsx(l6,{variant:"body1",fontWeight:"bold",color:"secondary",children:"انجام عملیات"})}),u.jsx(v,{children:u.jsx(s6,{color:"textSecondary",children:u.jsx(I,{variant:"body2"})})})]}),u.jsx(v,{container:!0,justifyContent:"space-between",children:u.jsxs(v,{container:!0,alignItems:"start",direction:"column",gap:k.SMALL,mt:k.SMALL,children:[u.jsxs(v,{container:!0,gap:k.SMALL,children:[u.jsx(v,{xs:12,children:u.jsx(I,{sx:{fontSize:"12px"},color:"secondary",children:"خودرو دارای کد بهداشتی حمل"})}),u.jsxs(v,{container:!0,direction:"column",alignItems:"start",children:[u.jsxs(wu,{sx:{width:"300px"},children:[u.jsx(Pu,{options:y||[],getOptionLabel:g=>{if(g){const D=g.type==="exclusive"?"اختصاصی":"اجاره ای";return`${g.driverName} (${g.driverMobile}) ${g.typeCar} پلاک ${g.pelak} (${D})`}return""},value:f.values.car,onChange:(g,D)=>{f.setFieldValue("car",D),f.setFieldValue("shippingCode",D?D.healthCode:"")},onBlur:f.handleBlur,renderInput:g=>u.jsx(N,{...g,label:"انتخاب خودرو و راننده",error:f.touched.car?!!f.errors.car:null})}),u.jsx(Xu,{children:f.touched.car&&f.errors.car?f.errors.car:null})]}),Y&&u.jsxs(wu,{sx:{width:"300px"},children:[u.jsx(Pu,{options:y||[],getOptionLabel:g=>{if(g){const D=g.type==="exclusive"?"اختصاصی":"اجاره ای";return`${g.driverName} (${g.driverMobile}) ${g.typeCar} پلاک ${g.pelak} ظرفیت ${g.capocity} قطعه (${D})`}return""},value:f.values.realCar,onChange:(g,D)=>{f.setFieldValue("realCar",D)},onBlur:f.handleBlur,renderInput:g=>u.jsx(N,{...g,label:"انتخاب خودرو و راننده",error:f.touched.car?!!f.errors.realCar:null})}),u.jsx(Xu,{children:f.touched.realCar&&f.errors.realCar?f.errors.realCar:null})]}),(H==null?void 0:H.length)>0&&u.jsxs(u.Fragment,{children:[u.jsx(v,{xs:12,children:u.jsx(I,{sx:{fontSize:"12px"},color:"red",mb:1,mt:1,children:"انتخاب کشتارکن جهت تخصیص"})}),u.jsxs(wu,{children:[u.jsx(Ou,{id:"demo-simple-select-label",children:"انتخاب کشتارکن (اجباری)"}),u.jsx(qu,{label:"کشتارکن",value:a,onChange:L,children:H==null?void 0:H.map((g,D)=>u.jsx(Cu,{value:g==null?void 0:g.key,children:g==null?void 0:g.name},D))})]})]}),u.jsx(v,{container:!0,textAlign:"start",direction:"column",mt:k.TINY,children:y.filter(g=>g.busy).map((g,D)=>{const $=`راننده ${g.driverName} ${g.typeCar} با پلاک ${g.pelak} جهت حمل بار کشتارگاه دیگری رزرو شده است.`;return u.jsx(v,{children:u.jsx(I,{variant:"caption",children:$})},"car"+D)})})]}),u.jsx(v,{children:u.jsx(N,{allowLeadingZeros:!0,thousandSeparator:",",id:"shippingCode",label:"کد بهداشتی حمل و نقل",value:f.values.shippingCode,error:f.touched.shippingCode?!!f.errors.shippingCode:null,onChange:f.handleChange,onBlur:f.handleBlur,helperText:f.touched.shippingCode&&f.errors.shippingCode?f.errors.shippingCode:null,variant:"outlined"})}),u.jsxs(v,{children:[u.jsx(N,{allowLeadingZeros:!0,thousandSeparator:",",id:"quantity",label:"ظرفیت (قطعه)",value:f.values.quantity,error:f.touched.quantity?!!f.errors.quantity:null,onChange:f.handleChange,onBlur:f.handleBlur,helperText:f.touched.quantity&&f.errors.quantity?f.errors.quantity:null,autoComplete:"current-password",variant:"outlined"}),u.jsxs(v,{container:!0,mt:k.TINY,gap:k.TINY,alignItems:"center",children:[u.jsx(I,{color:g=>g.palette.grey.A700,variant:"caption",children:"ظرفیت مجاز ماشین:"}),u.jsxs(I,{variant:"button",children:[E()," قطعه"]})]}),u.jsxs(v,{container:!0,mt:k.TINY,gap:k.TINY,alignItems:"center",children:[u.jsx(I,{color:g=>g.palette.grey.A700,variant:"caption",children:"باقی مانده:"}),u.jsxs(I,{variant:"button",children:[t-Number(f.values.quantity)>=0?t-Number(f.values.quantity):0," ","قطعه"]})]}),u.jsxs(v,{container:!0,mt:k.TINY,gap:k.TINY,alignItems:"center",children:[u.jsx(I,{color:g=>g.palette.grey.A700,variant:"caption",children:"مازاد:"}),u.jsxs(I,{variant:"button",children:[Number(f.values.quantity)>t?Math.abs(Number(f.values.quantity)-t):0," ","قطعه"]})]}),u.jsxs(v,{container:!0,mt:k.TINY,gap:k.TINY,alignItems:"center",children:[u.jsx(I,{color:g=>g.palette.grey.A700,variant:"caption",children:"وزن تقریبی هرقطعه مرغ:"}),u.jsxs(I,{variant:"button",children:[A.toLocaleString()," کیلوگرم"]})]})]}),u.jsx(v,{container:!0,alignItems:"start",gap:k.SMALL,children:u.jsxs(v,{container:!0,mt:k.TINY,gap:k.TINY,alignItems:"center",children:[u.jsx(I,{color:g=>g.palette.grey.A700,children:"="}),u.jsx(I,{color:g=>g.palette.grey.A700,variant:"caption",children:"وزن تقریبی بار:"}),u.jsxs(I,{variant:"button",children:[(Number(f.values.quantity)*A).toLocaleString()," ","کیلوگرم"]})]})})]}),u.jsx(v,{container:!0,children:u.jsx(G,{size:"large",variant:"contained",disabled:!b(),onClick:()=>{m(cu());let g={};o.killHouseWinner?g={winner_key:o.killHouseWinner.killHouseWinnerKey,quantity:Number(f.values.quantity),killer_key:a||null,car:{id:f.values.car.id,key:f.values.car.key,driver_name:f.values.car.driverName,driver_mobile:f.values.car.driverMobile,name:f.values.car.name,type_car:f.values.car.typeCar,type_weight:f.values.car.typeWeight,pelak:f.values.car.pelak,capocity:f.values.car.capocity,weight_without_load:f.values.car.weightWithoutLoad,health_code:f.values.car.helathCode}}:g={killer_key:a||null,kill_house_check_key:i,quantity:Number(f.values.quantity),traffic_code:f.values.shippingCode,real_car_key:f.values.realCar.key,role:xu(),car:{id:f.values.car.id,key:f.values.car.key,driver_name:f.values.car.driverName,driver_mobile:f.values.car.driverMobile,name:f.values.car.name,type_car:f.values.car.typeCar,type_weight:f.values.car.typeWeight,pelak:f.values.car.pelak,capocity:f.values.car.capocity,weight_without_load:f.values.car.weightWithoutLoad,health_code:f.values.car.helathCode}},m(yr(g)).then(D=>{m(X()),D.payload.error?c({vertical:"top",horizontal:"center",msg:D.payload.error,severity:"error"}):(m(X()),m(Mu({isCar:!0,selectedDate1:d,selectedDate2:s})),m(u0({selectedDate1:d,selectedDate2:s})),m(Ju({id:w})),m(b0({key:e})),m(Ju()),m(hu({right:!1,bottom:!1,top:!1,content:null})),c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:T})})]})})]})]})})};q6.propTypes={file:vu.PropTypes.object,provinceAllocationLimit:vu.PropTypes.any};const u6=({item:e,updateTable:t,isAllocatedCar:r=!1,selectedDate1:n,selectedDate2:i,submitStatus:A})=>{const[h,o]=p.useState(null),[c,,y,,d]=p.useContext(Q),s=lu(),x=n||y,l=i||d,S=g=>{o(g.currentTarget)},w=()=>{o(null)},T=Vu(),E=!!h,m=E?"popover":void 0,f=()=>{s(xr(e.killHouseRequestKey)).then(g=>{var D;(D=g.payload)!=null&&D.error?c({vertical:"top",horizontal:"center",msg:g.payload.error,severity:"error"}):(c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),s(Ru()),s(Mu({isCar:!0,selectedDate1:x,selectedDate2:l})),s(u0({selectedDate1:x,selectedDate2:l})),t&&t())})},Y=()=>{w(),s(Iu({title:"تایید حذف",content:u.jsxs(v,{container:!0,direction:"column",gap:k.SMALL,sx:{p:2,minWidth:"300px"},children:[u.jsx(I,{variant:"body1",children:"آیا از حذف تخصیص این خودرو اطمینان دارید؟"}),u.jsxs(v,{container:!0,gap:k.SMALL,justifyContent:"space-between",xs:12,children:[u.jsx(G,{variant:"outlined",color:"secondary",onClick:()=>s(Ru()),children:"انصراف"}),u.jsx(G,{variant:"contained",color:"error",onClick:f,children:"حذف"})]})]})}))},H=()=>{s(Iu({title:"ویرایش خودرو و کد حمل",content:u.jsx(O6,{item:e,updateTable:()=>{s(Mu({isCar:!0,selectedDate1:x,selectedDate2:l})),s(u0({selectedDate1:x,selectedDate2:l})),t&&t()},poultryRequestKey:e==null?void 0:e.poultryReqKey,killHouseKey:e==null?void 0:e.killHouseKey,killRequestKey:e==null?void 0:e.killRequestKey})})),w()},_=()=>{T(Uu+e.poultryReqId)},a=()=>{s(fr({provinceKillRequestKey:e==null?void 0:e.provinceKillRequestKey,returnAllocationQuantity:!0})).then(g=>{g.error?c({vertical:"top",horizontal:"center",msg:g.error,severity:"error"}):(t&&t(),c({vertical:"top",horizontal:"center",msg:"عملیات برگشت تخصیص با موفقیت انجام شد.",severity:"success"}))})},C=()=>{A===!0&&(e==null?void 0:e.killHousePrice)===0?s(Iu({title:"ثبت قیمت مرغ زنده",content:u.jsx(M6,{item:e,fetchData:t})})):s(hu({title:"انجام عملیات تخصیص",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(q6,{indexWeight:e.indexWeight,killHouseName:e.killHouseName,killHouseCheckKey:e.killHouseCheckKey,killHouseKey:e.killHouseKey,killRequestKey:e.killRequestKey,poultryRequestKey:e.poultryReqKey,provinceAllocationLimit:e.remainQuantity||0,item:e})}))},L=[];if(!r){const g=A===!0&&((e==null?void 0:e.killHousePrice)||0)===0;L.push({key:"register",label:"ثبت خودرو",color:g?"error.main":"primary.main",icon:Le,action:C}),L.push({key:"viewFile",label:"مشاهده پرونده",color:"primary.main",icon:Nu,action:_});const D=(e==null?void 0:e.allocatedQuantity)>0;L.push({key:"return",label:"برگشت تخصیص",color:D?"text.disabled":"warning.main",icon:B6,action:a,disabled:D})}r&&(L.push({key:"editAllocated",label:"ویرایش خودرو و کد حمل",color:"info.main",icon:$u,action:H}),L.push({key:"deleteAllocated",label:"حذف تخصیص خودرو",color:"error.main",icon:o0,action:Y}));const b=g=>{g.disabled||(w(),g.action())};return u.jsxs(v,{container:!0,children:[u.jsx(ou,{size:"small","aria-describedby":m,variant:"contained",color:"primary",onClick:S,children:u.jsx(F6,{})}),u.jsx(i6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:m,open:E,anchorEl:h,onClose:w,children:u.jsx(z6,{sx:{minWidth:150,p:.5},children:L.map(g=>{const D=g.icon,$=g.disabled?"text.disabled":g.color;return u.jsxs(K6,{disabled:g.disabled,onClick:()=>b(g),sx:{borderRadius:1,mb:.25,py:.5,"&:last-of-type":{mb:0}},children:[u.jsx(e6,{sx:{color:$,minWidth:32},children:u.jsx(D,{fontSize:"small"})}),u.jsx(t6,{primary:g.label,primaryTypographyProps:{sx:{color:$,fontSize:"0.82rem",fontWeight:600}}})]},g.key)})})})]})},vr=()=>{const e=p.useRef(),[t,r]=p.useState(),[n,i]=p.useState([]),[A,h]=p.useState([]),{slaughterActiveRequests:o,slaughterGetAllocatedCars:c}=Fu(a=>a.slaughterSlice),y=w0(),d=lu(),[,,s,x,l,S]=p.useContext(Q),[w,T]=p.useState(),E=()=>{d(Mu({isCar:!0,selectedDate1:s,selectedDate2:l})),d(u0({selectedDate1:s,selectedDate2:l})),d(Re()).then(a=>{T(a.payload.data.allow)})};p.useEffect(()=>{E()},[s,l]);const m=p6.useReactToPrint({content:()=>e.current,documentTitle:"حواله خرید"}),f=()=>{E()},Y=a=>{r(a)};p.useEffect(()=>{const a=o==null?void 0:o.map((C,L)=>{var b;return[L+1,C.orderCode,C!=null&&C.freezing?"انجماد":C!=null&&C.export?"صادرات":"عادی",C!=null&&C.freeSaleInProvince?"آزاد":"دولتی",C!=null&&C.directBuying?"خرید مستقیم":"اتحادیه",Bu(new Date(C==null?void 0:C.sendDate),"yyyy/MM/dd"),`${C.poultryName} (${C.poultryMobile})`,`${C.killHouseName} (${C.killHouseMobile})`,`${C.province}/${C.city}`,C.age,C.indexWeight,C==null?void 0:C.totalWeight.toLocaleString(),C.mainQuantity.toLocaleString()+" قطعه",C.amount.toLocaleString()+" ﷼",C.allocatedQuantity.toLocaleString()+" قطعه",C.remainQuantity.toLocaleString()+" قطعه",(C==null?void 0:C.killHousePrice)>0?u.jsxs(W,{container:!0,alignItems:"center",gap:1,children:[((b=C==null?void 0:C.killHousePrice)==null?void 0:b.toLocaleString())+" ریال",iu(C==null?void 0:C.sendDate)===iu(new Date)?u.jsx(ou,{size:"small",color:"primary",onClick:()=>{d(Iu({title:"ویرایش قیمت مرغ زنده",content:u.jsx(M6,{item:C,fetchData:E})}))},children:u.jsx($u,{fontSize:"small"})}):null]},L):u.jsx("span",{children:"0"},L),u.jsx(u6,{updateTable:f,item:C,submitStatus:w},L)]});i(a)},[o,w]),p.useEffect(()=>{const a=c==null?void 0:c.filter(C=>C.vetState==="pending").map((C,L)=>{var b,g,D,$;return[L+1,C==null?void 0:C.orderCode,C==null?void 0:C.barcod,C!=null&&C.freezing?"انجماد":C!=null&&C.export?"صادرات":"عادی",C!=null&&C.freeSaleInProvince?"آزاد":"دولتی",iu(C==null?void 0:C.sendDate),A6(C==null?void 0:C.killHouseCreateDate),`${C==null?void 0:C.poultryName} (${C.poultryMobile})`,`${C==null?void 0:C.killHouseName} (${C.killHouseMobile})`,C!=null&&C.killer?`${(b=C==null?void 0:C.killer)==null?void 0:b.killerName} (${(g=C==null?void 0:C.killer)==null?void 0:g.killerMobile})`:"-",C==null?void 0:C.driverName,C==null?void 0:C.typeCar,C==null?void 0:C.pelak,(C==null?void 0:C.acceptedRealQuantity.toLocaleString())+" قطعه",C==null?void 0:C.acceptedRealWeight.toLocaleString(),((D=C==null?void 0:C.amount)==null?void 0:D.toLocaleString())+" ﷼",C==null?void 0:C.trafficCode,(($=C==null?void 0:C.barAmount)==null?void 0:$.toLocaleString())+" ﷼",u.jsxs(W,{container:!0,gap:1,children:[u.jsx(u6,{item:C,updateTable:f,isAllocatedCar:!0,selectedDate1:s,selectedDate2:l},L),y==="استان اردبیل"?u.jsx(Yu,{title:"خروجی PDF",children:u.jsx(ou,{onClick:()=>{m(),Y(C)},size:"large","aria-label":"pdf",color:"success",children:u.jsx(v6,{})})}):null]},L)]});h(a)},[c]);const[H]=p.useState(["ردیف","کد سفارش","کشتار","فروش","درخواست","تاریخ کشتار","مرغدار","خریدار","استان/شهر","سن","میانگین وزن","وزن کل (کیلوگرم)","تعداد","قیمت مرغدار","تخصیص به خودرو","مانده قابل تخصیص","قیمت کشتارگاه","عملیات"]),_=_u({initialValues:{capacity:"",recieveTime:"",recieveDate:J(Date()).format("YYYY-MM-DD hh:mm:ss")},validationSchema:fu({capacity:Tu().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),recieveTime:bu().required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!")})});return p.useEffect(()=>{_.validateForm()},[]),u.jsxs(W,{container:!0,alignItems:"center",justifyContent:"space-between",gap:k.SMALL,mt:k.MEDIUM,children:[t&&u.jsx("div",{style:{visibility:"hidden",position:"absolute"},children:u.jsx(m0,{ref:e,date:s,amount:t==null?void 0:t.quantity,breeder:t==null?void 0:t.poultryName,buyer:t==null?void 0:t.killHouseName})}),u.jsxs(W,{container:!0,alignItems:"center",gap:k.SMALL,children:[u.jsx(W,{children:u.jsx(uu,{label:"از تاریخ",id:"date",renderInput:a=>u.jsx(N,{style:{width:"160px"},...a}),value:s,onChange:a=>{x(J(a).format("YYYY-MM-DD"))}})}),u.jsx(W,{children:u.jsx(uu,{label:"تا تاریخ",id:"date",renderInput:a=>u.jsx(N,{style:{width:"160px"},...a}),value:l,onChange:a=>{S(J(a).format("YYYY-MM-DD"))}})})]}),u.jsx(Wu,{paginated:!0,title:"در انتظار تخصیص خودرو",columns:H,data:n}),u.jsx(Wu,{title:"خودروهای تخصیص داده شده",paginated:!0,columns:["ردیف","کد سفارش","کد بار","کشتار","فروش","تاریخ کشتار","تاریخ ثبت خودرو","مرغدار","خریدار","کشتارکن اختصاصی","راننده","ماشین","پلاک","تعداد","وزن (کیلوگرم)","قیمت مرغ زنده","کد حمل و نقل","قیمت مرغ زنده‌ی بار","عملیات"],data:A})]})},M={page:{width:"210mm",margin:"0 auto",display:"flex",flexDirection:"column",position:"relative",direction:"rtl",fontFamily:"nazanin",fontWeight:"bold"},container:{width:"95%",alignSelf:"center",pageBreakInside:"avoid"},invoiceTable:{width:"100%",borderCollapse:"collapse",alignSelf:"center",marginBottom:"2px"},tableCell:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:11},tableHeader:{backgroundColor:"rgba(211, 211, 211, 0.3)",pageBreakAfter:"auto"},headerRow:{backgroundColor:"rgba(211, 211, 211, 0.3)",color:"black",pageBreakInside:"avoid",pageBreakAfter:"auto"},logo:{width:"60px",height:"auto",marginBottom:"10px"},contentContainer:{display:"flex",justifyContent:"space-between",marginTop:"20px",marginLeft:"100px",marginRight:"30px"},contentInLine:{display:"flex",flexDirection:"column",alignItems:"center"},mainTitle:{fontFamily:"nazanin",fontSize:11,pAlign:"center",fontWeight:"bolder"},signature:{display:"flex",flexDirection:"column",alignItems:"flex-end",marginLeft:"20px"},watermarkContainer:{position:"fixed",top:450,left:0,right:30,bottom:0,justifyContent:"center",alignItems:"center",opacity:.2,zIndex:-1},watermarkp:{fontSize:100,fontWeight:"bolder",color:"grey",transform:"rotate(-45deg)",left:"50%"},title:{fontSize:12,fontWeight:"bolder",pAlign:"center"},titleTopic:{marginTop:"10px",fontSize:12,fontWeight:"bolder",pAlign:"center"},firsttitle:{fontSize:14,fontWeight:"bolder",marginLeft:"40px",pAlign:"center"},options:{marginLeft:"50px",padding:"10px",marginTop:"15px",display:"flex",flexDirection:"column",alignItems:"flex-start"},divider:{width:"100%",height:"2px",backgroundColor:"red",marginBottom:15},tableHeaderCell:{backgroundColor:"rgba(211, 211, 211, 0.3)",fontSize:10,border:"1px solid #000",padding:"4px",textAlign:"center",fontWeight:"bold"}},R0=p.forwardRef((e,t)=>{var A,h,o,c,y,d,s,x,l,S,w,T,E,m,f,Y,H,_,a;const{item:r}=e,n=w0(),i=te();return u.jsxs("div",{style:M.page,ref:t,children:[u.jsxs("div",{style:M.contentContainer,children:[u.jsxs("div",{style:M.contentInLine,children:[u.jsx("img",{alt:"logo",src:re,style:M.logo}),u.jsx("span",{style:M.mainTitle,children:"اتحادیه سراسری تعاونی‌های کشاورزی پرورش دهندگان مرغ گوشتی ایران"}),u.jsxs("span",{style:M.title,children:["اتحادیه شرکت های تعاونی کشاورزی مرغداران "," ‌"," ",n]})]}),u.jsx("div",{children:u.jsx("span",{style:M.firsttitle,children:"بسمه تعالی"})}),u.jsxs("div",{style:M.options,children:[u.jsx("span",{style:M.title,children:"شماره:"}),u.jsx("span",{style:M.titleTopic,children:"تاریخ:"})]})]}),u.jsx("hr",{style:M.divider}),u.jsx("strong",{style:{fontSize:"20px",textAlign:"center"},children:"فاکتور فروش"}),u.jsx("br",{}),u.jsxs("div",{style:M.container,children:[u.jsx("table",{style:{...M.invoiceTable,marginBottom:"5px"},children:u.jsx("tbody",{children:u.jsxs("tr",{children:[u.jsx("td",{style:{...M.tableCell,width:"3%",backgroundColor:"grey"},children:u.jsxs("span",{style:{writingMode:"vertical-lr",textOrientation:"mixed",fontSize:14,fontWeight:"bold",color:"white"},children:["خریدار"," "]})}),u.jsxs("td",{style:{...M.tableCell,width:"90%",textAlign:"right"},children:[" ‌"," ‌",(d=(y=(c=(o=(h=(A=r==null?void 0:r.provinceCheckInfo)==null?void 0:A.killHouseAssignment)==null?void 0:h.killHouseRequest)==null?void 0:o.killhouseUser)==null?void 0:c.killHouseOperator)==null?void 0:y.user)==null?void 0:d.fullname]})]})})}),u.jsx("table",{style:{...M.invoiceTable,marginBottom:"5px"},children:u.jsx("tbody",{children:u.jsxs("tr",{children:[u.jsx("td",{style:{...M.tableCell,width:"3%",backgroundColor:"grey"},children:u.jsxs("span",{style:{writingMode:"vertical-lr",textOrientation:"mixed",fontSize:14,fontWeight:"bold",color:"white"},children:["فروشنده"," "]})}),u.jsxs("td",{style:{...M.tableCell,width:"90%",textAlign:"right"},children:[" ‌"," ‌","اتحادیه شرکت های تعاونی کشاورزی مرغداران "," ‌"," ",n]})]})})}),u.jsxs("table",{style:M.invoiceTable,children:[u.jsx("tr",{children:u.jsxs("table",{style:M.invoiceTable,children:[u.jsx("thead",{style:M.tableHeader,children:u.jsxs("tr",{style:M.headerRow,children:[u.jsx("th",{style:M.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:M.tableHeaderCell,children:"شرح"}),u.jsx("th",{style:M.tableHeaderCell,children:"وزن (کیلوگرم)"}),u.jsx("th",{style:M.tableHeaderCell,children:"قیمت مرغ زنده (کیلوگرم)"}),u.jsx("th",{style:M.tableHeaderCell,children:"قیمت کل (ریال)"})]})}),u.jsx("tbody",{children:u.jsxs("tr",{children:[u.jsx("td",{style:M.tableCell,children:"1"}),u.jsxs("td",{style:M.tableCell,children:["بار شماره",(l=(x=(s=r==null?void 0:r.provinceCheckInfo)==null?void 0:s.killHouseAssignment)==null?void 0:x.killHouseRequest)==null?void 0:l.barCode,"مرغداری :"," ",`${(S=r==null?void 0:r.poultryRequest)==null?void 0:S.poultryName} (${(w=r==null?void 0:r.poultryRequest)==null?void 0:w.poultryUserMobile})`]}),u.jsx("td",{style:M.tableCell,children:(T=r==null?void 0:r.provinceFactorToKillHouse.netWeight)==null?void 0:T.toLocaleString()}),u.jsx("td",{style:M.tableCell,children:((E=r==null?void 0:r.factorFee)==null?void 0:E.toLocaleString())+" ﷼"}),u.jsx("td",{style:M.tableCell,children:((f=(m=r==null?void 0:r.provinceFactorToKillHouse)==null?void 0:m.totalFactorAmount)==null?void 0:f.toLocaleString())+" ﷼"})]})})]})}),u.jsx("tr",{children:u.jsxs("table",{style:M.invoiceTable,children:[u.jsx("thead",{style:M.tableHeader,children:u.jsxs("tr",{style:M.headerRow,children:[u.jsx("th",{colSpan:4,style:M.tableHeaderCell,children:"جمع فاکتور"}),u.jsx("th",{style:M.tableHeaderCell,children:((H=(Y=r==null?void 0:r.provinceFactorToKillHouse)==null?void 0:Y.totalFactorAmount)==null?void 0:H.toLocaleString())+" ﷼"})]})}),u.jsxs("tbody",{style:M.tableCell,children:[u.jsxs("tr",{children:[u.jsx("td",{colSpan:3}),u.jsx("td",{style:M.tableCell,children:"تخفیف"}),u.jsx("td",{style:M.tableCell,children:"0"})]}),u.jsxs("tr",{children:[u.jsx("td",{colSpan:3}),u.jsx("td",{style:M.tableCell,children:"مالیات"}),u.jsx("td",{style:M.tableCell,children:"0"})]}),u.jsxs("tr",{children:[u.jsx("td",{colSpan:3}),u.jsx("td",{style:M.tableCell,children:"عوارض"}),u.jsx("td",{style:M.tableCell,children:"0"})]}),u.jsxs("tr",{children:[u.jsx("td",{style:M.tableCell,colSpan:3,children:"مبلغ قابل پرداخت (ریال)"}),u.jsx("td",{colSpan:2,style:M.tableCell,children:((a=(_=r==null?void 0:r.provinceFactorToKillHouse)==null?void 0:_.totalFactorAmount)==null?void 0:a.toLocaleString())+" ﷼"})]})]})]})})]}),u.jsx("div",{style:{flexDirection:"row",marginTop:"20px"},children:u.jsx("div",{style:M.signature,children:u.jsxs("div",{style:M.contentInLine,children:[u.jsx("span",{style:M.title,children:i}),u.jsxs("span",{style:M.title,children:["مدیرعامل اتحادیه مرغداران"," ‌",n]})]})})}),u.jsx("div",{style:M.watermarkContainer,children:u.jsx("p",{style:M.watermarkp,children:"سامانه رصدیار "})})]})]})});R0.displayName="SlaughterNewFactorFile";R0.propTypes={item:vu.PropTypes.any};const Fr=()=>{const e=Vu(),[t,r]=p.useState([]),[n,i]=p.useState([]),{slaughterGetPayFactorRequests:A,slaughterGetPaiedFactors:h}=Fu(_=>_.slaughterSlice),o=lu(),[,,c,y,d,s]=p.useContext(Q);p.useEffect(()=>{const _=J(new Date).format("YYYY-MM-DD");y(_),s(_)},[]),p.useEffect(()=>{o(ne({selectedDate1:c,selectedDate2:d})),o(ae({selectedDate1:c,selectedDate2:d}))},[c,d]),p.useEffect(()=>{const _=h==null?void 0:h.map((a,C)=>{var b,g,D,$,eu,pu,B,q,F,z,R,U,tu,Z,su,du,gu,mu;let L="";return a.state==="accepted"?L="تایید شده":a.state==="rejected"?L="رد شده":a.state==="pending"&&(L="در انتظار تایید"),[C+1,(b=a==null?void 0:a.provinceFactor)==null?void 0:b.factorBarCode,(B=(pu=(eu=($=(D=(g=a==null?void 0:a.provinceFactor)==null?void 0:g.provinceCheckInfo)==null?void 0:D.killHouseAssignment)==null?void 0:$.killHouseRequest)==null?void 0:eu.killRequest)==null?void 0:pu.killHouse)==null?void 0:B.name,(su=(Z=(tu=(U=(R=(z=(F=(q=a==null?void 0:a.provinceFactor)==null?void 0:q.provinceCheckInfo)==null?void 0:F.killHouseAssignment)==null?void 0:z.killHouseRequest)==null?void 0:R.killRequest)==null?void 0:U.killHouse)==null?void 0:tu.killHouseOperator)==null?void 0:Z.user)==null?void 0:su.mobile,iu((du=a==null?void 0:a.provinceFactor)==null?void 0:du.createDate),iu(a==null?void 0:a.createDate),((mu=(gu=a==null?void 0:a.provinceFactor)==null?void 0:gu.totalPrice)==null?void 0:mu.toLocaleString())+" ﷼",Number(a==null?void 0:a.paymentCode),L,u.jsx("a",{href:a.factorImage,children:u.jsx("img",{src:a.factorImage,width:"50",height:"50",alt:"بدون بار",className:"images-file"})},"provinceKillRequests"),u.jsx(ou,{disabled:a.state==="accepted",color:"primary",onClick:()=>{var j,O,V,ru,nu,au,ju,yu,L0;o(hu({title:"انجام عملیات تایید / رد درخواست",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(N0,{factorKey:a.key,price:(j=a==null?void 0:a.provinceFactor)==null?void 0:j.totalPrice,provinceFactorToKillHouse:(O=a==null?void 0:a.provinceFactor)==null?void 0:O.provinceFactorToKillHouse,isRejected:((ru=(V=a==null?void 0:a.provinceFactor)==null?void 0:V.killHouseFactorToProvince)==null?void 0:ru.factorState)==="rejected",killHouseFactorToProvince:(nu=a==null?void 0:a.provinceFactor)==null?void 0:nu.killHouseFactorToProvince,barCode:(L0=(yu=(ju=(au=a==null?void 0:a.provinceFactor)==null?void 0:au.provinceCheckInfo)==null?void 0:ju.killHouseAssignment)==null?void 0:yu.killHouseRequest)==null?void 0:L0.barCode},`SlaughterPayProvinceFactorForm${C}`)}))},children:u.jsx($u,{})},C),u.jsx(ou,{"aria-label":"delete",color:"primary",onClick:()=>{var j,O;e(oe+((O=(j=a==null?void 0:a.provinceFactor)==null?void 0:j.poultryRequest)==null?void 0:O.poultryRequestId))},children:u.jsx(Nu,{})},C)]});i(_)},[h]),p.useEffect(()=>{const _=A==null?void 0:A.filter(a=>a.paidState!=="paid").map((a,C)=>{var D,$,eu,pu,B,q,F,z,R;const L=`${a.provinceInputAmount?(D=a.provinceInputAmount)==null?void 0:D.toLocaleString():"نامشخص"} ﷼ (شرح: ${a!=null&&a.reason?a==null?void 0:a.reason:"نامشخص"})`;let b=a.provinceInputAmountType;b==="plus"?b=u.jsxs(I,{variant:"caption",children:["اضافه شد: ",L]}):b=u.jsxs(I,{variant:"caption",children:["کسر شد: ",L]});const g=u.jsxs(I,{variant:"caption",children:["کسر شد: ",(($=a.killHouseFactorPaymentRemain)==null?void 0:$.toLocaleString())+" ﷼"]});return[C+1,(B=(pu=(eu=a.provinceCheckInfo)==null?void 0:eu.killHouseAssignment)==null?void 0:pu.killHouseRequest)==null?void 0:B.barCode,Bu(new Date((q=a==null?void 0:a.poultryRequest)==null?void 0:q.sendDate),"yyyy/MM/dd"),`${a.poultryRequest.poultryName} (${a.poultryRequest.poultryUserMobile})`,a.provinceFactorToKillHouse.killPlace,(F=a.provinceFactorToKillHouse.realQuantity)==null?void 0:F.toLocaleString(),(z=a.provinceFactorToKillHouse.netWeight)==null?void 0:z.toLocaleString(),Bu(new Date(a==null?void 0:a.factorDate),"yyyy/MM/dd"),((R=a.provinceFactorToKillHouse.totalFactorAmount)==null?void 0:R.toLocaleString())+" ﷼",u.jsx(Yu,{title:"خروجی PDF",children:u.jsx(ou,{onClick:()=>{H(a)},size:"large","aria-label":"delete",color:"success",children:u.jsx(v6,{})})},C),u.jsx(ou,{color:"primary",onClick:()=>{var U,tu,Z,su,du,gu,mu,j,O,V,ru,nu,au,ju,yu;o(hu({title:"انجام عملیات پرداخت فاکتور",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsxs(W,{container:!0,width:"100%",children:[u.jsxs(W,{width:"100%",children:[u.jsx($0,{name:"اطلاعات فاکتور",columns:["کد بار","تاریخ کشتار","مرغدار","محل کشتار","تعداد واقعی","وزن خالص بار (کیلوگرم)","سند بدون بار","سند با بار"],data:[[a.provinceCheckInfo.killHouseAssignment.killHouseRequest.barCode,(U=a==null?void 0:a.poultryRequest)!=null&&U.sendDate?Bu(new Date((tu=a==null?void 0:a.poultryRequest)==null?void 0:tu.sendDate),"yyyy/MM/dd"):"",`${a.poultryRequest.poultryUserName} (${a.poultryRequest.poultryUserMobile})`,a.provinceFactorToKillHouse.killPlace,(Z=a.provinceFactorToKillHouse.realQuantity)==null?void 0:Z.toLocaleString(),((su=a.provinceFactorToKillHouse.netWeight)==null?void 0:su.toLocaleString())+" کیلوگرم",u.jsx("a",{href:a.provinceCheckInfo.killHouseAssignment.carWeightWithoutLoadImage,children:u.jsx("img",{alt:"vvv",width:"50",src:a.provinceCheckInfo.killHouseAssignment.carWeightWithoutLoadImage})},"ddd"),u.jsx("a",{href:a.provinceCheckInfo.killHouseAssignment.carWeightWithLoadImage,children:u.jsx("img",{alt:"vvv",width:"50",src:a.provinceCheckInfo.killHouseAssignment.carWeightWithLoadImage})},"ddd")]]}),u.jsx($0,{name:"اطلاعات فاکتور",columns:["قیمت مرغ زنده (کیلوگرم)","مبلغ خالص بار","سهم مرغدار","سهم استان","هزینه پیامک اطلاع رسانی","مبلغ کسر/اضافه","واریزی فاکتور اولیه","مبلغ فاکتور نهایی"],data:[[((du=a.factorFee)==null?void 0:du.toLocaleString())+" ﷼",((gu=a.provinceFactorToKillHouse.realAmountFactor)==null?void 0:gu.toLocaleString())+" ﷼",((mu=a.provinceFactorToKillHouse.poultryShare)==null?void 0:mu.toLocaleString())+" ﷼",((j=a.provinceFactorToKillHouse.provinceShare)==null?void 0:j.toLocaleString())+" ﷼",(au=(nu=(ru=(V=(O=a.provinceFactorToKillHouse.item)==null?void 0:O.provinceCheckInfo)==null?void 0:V.killHouseAssignment)==null?void 0:ru.killHouseRequest)==null?void 0:nu.killRequest)!=null&&au.smsPayment?"دارد - 50000 ﷼":"ندارد",b,g,((ju=a==null?void 0:a.totalPrice)==null?void 0:ju.toLocaleString())+" ﷼"]]})]}),u.jsx(N0,{factorKey:a.key,price:a.totalPrice,item:a,provinceFactorToKillHouse:a.provinceFactorToKillHouse,isRejected:((yu=a==null?void 0:a.killHouseFactorToProvince)==null?void 0:yu.factorState)==="rejected",killHouseFactorToProvince:a.killHouseFactorToProvince,barCode:a.provinceCheckInfo.killHouseAssignment.killHouseRequest.barCode},`SlaughterPayProvinceFactorForm${C}`)]})}))},children:u.jsx($u,{})},C),u.jsx(ou,{"aria-label":"delete",color:"primary",onClick:()=>e(Uu+a.poultryReqId),children:u.jsx(Nu,{})},C)]});r(_)},[A]);const[x]=p.useState(["ردیف","کد بار","تاریخ کشتار","مرغدار","محل کشتار","تعداد واقعی","وزن خالص (کیلوگرم)","تاریخ صدور فاکتور","مبلغ نهایی فاکتور","دانلود فاکتور","عملیات","مشاهده"]),l=_u({initialValues:{capacity:"",recieveTime:"",recieveDate:J(Date()).format("YYYY-MM-DD hh:mm:ss")},validationSchema:fu({capacity:Tu().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),recieveTime:bu().required("این فیلد اجباری است!").typeError("لطفا وزن را وارد کنید!")})});p.useEffect(()=>{l.validateForm()},[]);const[S,w]=p.useState(0),T=(_,a)=>{w(a)},[E,m]=p.useState(),f=p.useRef(),Y=p6.useReactToPrint({content:()=>f.current,documentTitle:"فاکتور پرداخت",onAfterPrint:()=>{m(null)}}),H=_=>{m(_)};return p.useEffect(()=>{E&&Y()},[E,Y]),u.jsxs(W,{container:!0,alignItems:"center",justifyContent:"center",gap:k.SMALL,mt:k.MEDIUM,children:[u.jsx("div",{style:{visibility:"hidden",position:"absolute"},children:u.jsx(R0,{ref:f,item:E})}),u.jsx(W,{children:u.jsx(c6,{sx:{borderBottom:1,borderColor:"divider"},children:u.jsxs(d6,{value:S,onChange:T,"aria-label":"basic tabs example",children:[u.jsx(Zu,{label:"فاکتور های جدید"}),u.jsx(Zu,{label:"فاکتورهای پرداخت شده"})]})})}),u.jsxs(D0,{sx:{width:"100%"},children:[S===0&&u.jsx(Hu,{name:u.jsxs(W,{container:!0,alignItems:"center",gap:k.SMALL,children:[u.jsx(W,{xs:12,sm:12,md:12,lg:2,children:u.jsx(I,{children:"فاکتورهای در انتظار پرداخت"})}),u.jsx(W,{children:u.jsx(uu,{label:"از تاریخ",id:"date",renderInput:_=>u.jsx(N,{style:{width:"160px"},..._}),value:c,onChange:_=>{y(J(_).format("YYYY-MM-DD"))}})}),u.jsx(W,{children:u.jsx(uu,{label:"تا تاریخ",id:"date",renderInput:_=>u.jsx(N,{style:{width:"160px"},..._}),value:d,onChange:_=>{s(J(_).format("YYYY-MM-DD"))}})})]}),columns:x,data:t}),S===1&&u.jsx(Hu,{name:u.jsxs(W,{container:!0,alignItems:"center",gap:k.SMALL,children:[u.jsx(W,{xs:12,sm:12,md:12,lg:2,children:u.jsx(I,{children:"فاکتورهای پرداخت شده"})}),u.jsx(W,{children:u.jsx(uu,{label:"از تاریخ",id:"date",renderInput:_=>u.jsx(N,{style:{width:"160px"},..._}),value:c,onChange:_=>{y(J(_).format("YYYY-MM-DD"))}})}),u.jsx(W,{children:u.jsx(uu,{label:"تا تاریخ",id:"date",renderInput:_=>u.jsx(N,{style:{width:"160px"},..._}),value:d,onChange:_=>{s(J(_).format("YYYY-MM-DD"))}})})]}),columns:["ردیف","شناسه فاکتور","کشتارگاه","تلفن کشتارگاه","تاریخ صدور فاکتور","تاریخ پرداخت فاکتور","مبلغ فاکتور نهایی","شناسه پرداخت","وضعیت","سند پرداختی","ویرایش سند پرداخت","مشاهده"],data:n})]})]})},jr=Lu("SLAUGHTER_PAY_FACTOR_SERVICE",async(e,{dispatch:t})=>{t(cu());const{data:r,status:n}=await Su.post("kill_request_factor_payment/",e);return t(X()),{data:r,status:n}}),br=fu({paymentCode:bu().required("This field is required")}),P6=({factorKey:e,isFinalFactor:t})=>{const[r,n]=P.useState(),[i,A]=P.useState([]),h=lu(),[o]=p.useContext(Q),[,,c,,y]=p.useContext(Q),d=_u({initialValues:{paymentCode:"",doc:"",amount:""},validationSchema:br,onSubmit:x=>{t?h(Be({key:e,factor_image:x.doc,payment_code:x.paymentCode,role:xu()})).then(l=>{h(E0({selectedDate1:c,selectedDate2:y})),h(f6()),h(hu({right:!1,bottom:!1,content:null})),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})}):h(jr({factor_key:e,image:x.doc,payment_code:x.paymentCode,amount:x.amount})).then(l=>{h(hu({right:!1,bottom:!1,content:null})),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})}}),s=(x,l)=>{var S;x[0]&&n(qe((S=x[0])==null?void 0:S.data_url)),A(x)};return p.useEffect(()=>{d.setFieldValue("doc",r)},[r]),u.jsx("div",{children:u.jsxs("form",{onSubmit:d.handleSubmit,children:[u.jsx(N,{label:"شناسه پرداخت",name:"paymentCode",variant:"outlined",margin:"normal",fullWidth:!0,error:d.touched.paymentCode&&!!d.errors.paymentCode,helperText:d.touched.paymentCode&&d.errors.paymentCode,value:d.values.paymentCode,onChange:d.handleChange}),!t&&u.jsx(e0,{allowLeadingZeros:!0,thousandSeparator:",",label:"مبلغ واریزی (ریال)",id:"amount",variant:"outlined",margin:"normal",fullWidth:!0,error:d.touched.amount&&!!d.errors.amount,helperText:d.touched.amount&&d.errors.amount,value:d.values.amount,onChange:d.handleChange}),u.jsx(v,{mb:k.SMALL,children:u.jsx(Oe,{onChange:s,images:i,maxNumber:1,title:"بارگذاری سند"})}),u.jsx(G,{fullWidth:!0,type:"submit",variant:"contained",color:"primary",children:"ثبت"})]})})},Er=Lu("SLAUGHTER_DELETE_FACTOR_SERVICE",async(e,{dispatch:t})=>{t(cu());try{const{data:r,status:n}=await Su.put("kill_request_factor/0/",e);return t(X()),{data:r,status:n}}catch(r){return t(X()),{error:r.response.data.result}}}),Sr=()=>{const e=lu(),[t]=p.useContext(Q),[,,r,n,i,A]=p.useContext(Q);p.useEffect(()=>{const s=Eu(new Date).format("YYYY-MM-DD");n(s),A(s)},[]);const{slaughterFactors:h}=Fu(s=>s.slaughterSlice),[o,c]=p.useState([]),[y,d]=p.useState([]);return p.useEffect(()=>{const s=h==null?void 0:h.filter(l=>l.state==="pending").map(l=>{var w,T,E,m,f,Y,H,_,a,C;let S;switch(l.state){case"pending":S="در انتظار پرداخت";break;case"paid":S="پرداخت شده";break;case"unpaid":S="پرداخت نشده";break;default:S="در انتظار پرداخت"}return[(T=(w=l==null?void 0:l.killRequest)==null?void 0:w.slaughterHouse)!=null&&T.name?(m=(E=l==null?void 0:l.killRequest)==null?void 0:E.slaughterHouse)==null?void 0:m.name:(Y=(f=l==null?void 0:l.killRequest)==null?void 0:f.killHouse)==null?void 0:Y.name,iu(l==null?void 0:l.createDate),(H=l==null?void 0:l.killRequest)==null?void 0:H.IndexWeight,l.killRequest.oldChickenBreed?l.killRequest.oldChickenBreed:(_=l==null?void 0:l.killRequest)==null?void 0:_.chickenBreed,l.killRequest.chickenBreed,l.killRequest.provinceQuantity?l.killRequest.provinceQuantity.toLocaleString():(a=l.killRequest.killCapacity)==null?void 0:a.toLocaleString(),l.killRequest.provinceQuantity?(C=l.killRequest.killCapacity)==null?void 0:C.toLocaleString():0,(l==null?void 0:l.amount.toLocaleString())+" ﷼",(l==null?void 0:l.minimumAmount.toLocaleString())+" ﷼",S,u.jsx(ou,{disabled:l.state==="paid",color:"primary",onClick:()=>{e(hu({title:"پرداخت فاکتور",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(P6,{factorKey:l.key})}))},children:u.jsx(x6,{})},"ee"),u.jsx(ou,{disabled:l.paidState==="paid",color:"error",onClick:()=>{e(Iu({title:"لغو سفارش",content:u.jsxs(v,{container:!0,direction:"column",alignItems:"center",justifyContent:"center",width:"100%",gap:k.SMALL,children:[u.jsx(v,{children:u.jsx(I,{children:"در صورت لغو فاکتور درخواست اولیه شما هم لغو می گردد."})}),u.jsx(v,{children:u.jsx(G,{variant:"contained",color:"error",onClick:()=>{e(Er({state:"cancel",factor_key:l.key})).then(L=>{L.payload.error?(e(Ru()),t({vertical:"top",horizontal:"center",msg:L.payload.error,severity:"error"})):(e(E0({selectedDate1:r,selectedDate2:i})),e(Ru()),t({vertical:"top",horizontal:"center",msg:"سفارش با موفقیت لغو شد.",severity:"success"}))})},children:"لغو سفارش"})})]})}))},children:u.jsx(o0,{})},"ee")]});c(s);const x=h==null?void 0:h.filter(l=>l.state==="paid"||l.state==="unpaid").map(l=>{var w,T,E,m,f,Y,H,_,a,C;let S;switch(l.state){case"pending":S="در انتظار پرداخت";break;case"paid":S="پرداخت شده";break;case"unpaid":S="پرداخت نشده";break;default:S="در انتظار پرداخت"}return[(T=(w=l==null?void 0:l.killRequest)==null?void 0:w.slaughterHouse)!=null&&T.name?(m=(E=l==null?void 0:l.killRequest)==null?void 0:E.slaughterHouse)==null?void 0:m.name:(Y=(f=l==null?void 0:l.killRequest)==null?void 0:f.killHouse)==null?void 0:Y.name,iu(l==null?void 0:l.createDate),(H=l==null?void 0:l.killRequest)==null?void 0:H.IndexWeight,l.killRequest.oldChickenBreed?l.killRequest.oldChickenBreed:(_=l==null?void 0:l.killRequest)==null?void 0:_.chickenBreed,l.killRequest.chickenBreed,l.killRequest.provinceQuantity?l.killRequest.provinceQuantity.toLocaleString():(a=l.killRequest.killCapacity)==null?void 0:a.toLocaleString(),l.killRequest.provinceQuantity?(C=l.killRequest.killCapacity)==null?void 0:C.toLocaleString():0,(l==null?void 0:l.amount.toLocaleString())+" ﷼",(l==null?void 0:l.minimumAmount.toLocaleString())+" ﷼",S]});d(x)},[h]),p.useEffect(()=>{e(E0({selectedDate1:r,selectedDate2:i}))},[r,i]),u.jsxs(v,{container:!0,flex:1,children:[u.jsx(v,{width:"100%",children:u.jsx(Hu,{name:u.jsxs(v,{container:!0,alignItems:"center",gap:k.SMALL,children:[u.jsx(v,{children:u.jsx(I,{children:"فاکتور همراه با ثبت درخواست کشتار"})}),u.jsx(v,{children:u.jsx(uu,{label:"از تاریخ",id:"date",renderInput:s=>u.jsx(N,{style:{width:"160px"},...s}),value:r,onChange:s=>{n(Eu(s).format("YYYY-MM-DD"))}})}),u.jsx(v,{children:u.jsx(uu,{label:"تا تاریخ",id:"date",renderInput:s=>u.jsx(N,{style:{width:"160px"},...s}),value:i,onChange:s=>{A(Eu(s).format("YYYY-MM-DD"))}})})]}),columns:["کاربر","تاریخ درخواست","وزن","نژاد درخواستی","نژاد تایید شده","تعداد درخواستی","تعداد تایید شده","مبلغ پیش فاکتور","حداقل پرداختی (70%)","وضعیت","پرداخت","لغو سفارش"],data:o})}),u.jsx(v,{width:"100%",children:u.jsx(Hu,{name:"بایگانی",columns:["کاربر","تاریخ درخواست","وزن","نژاد درخواستی","نژاد تایید شده","تعداد درخواستی","تعداد تایید شده","مبلغ پیش فاکتور","حداقل پرداختی (70%)","وضعیت"],data:y})})]})},kr=()=>{const e=lu(),{slaughterFinalFactors:t}=Fu(c=>c.slaughterSlice),[,,r,n,i,A]=p.useContext(Q);p.useEffect(()=>{const c=Eu(new Date).format("YYYY-MM-DD");n(c),A(c)},[]);const[h,o]=p.useState([]);return p.useEffect(()=>{const c=t==null?void 0:t.map(y=>{let d;switch(y.paidState){case"pending":d="در انتظار پرداخت";break;case"paid":d="پرداخت شده";break;default:d="در انتظار پرداخت"}return[y==null?void 0:y.factorBarCode,d,(y==null?void 0:y.factorFee.toLocaleString())+" ﷼",(y==null?void 0:y.totalPrice.toLocaleString())+" ﷼",y==null?void 0:y.totalWeight,u.jsx(ou,{disabled:y.paidState==="paid",color:"primary",onClick:()=>{e(hu({title:"پرداخت فاکتور",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(P6,{factorKey:y.key,isFinalFactor:!0})}))},children:u.jsx(x6,{})},"ee")]});o(c)},[t]),p.useEffect(()=>{e(f6({selectedDate1:r,selectedDate2:i}))},[r,i]),u.jsx(v,{container:!0,flex:1,children:u.jsx(v,{width:"100%",children:u.jsx(Hu,{name:u.jsxs(v,{container:!0,alignItems:"center",gap:k.SMALL,children:[u.jsx(v,{children:u.jsx(I,{children:"فاکتور نهایی"})}),u.jsx(v,{children:u.jsx(uu,{label:"از تاریخ",id:"date",renderInput:c=>u.jsx(N,{style:{width:"160px"},...c}),value:r,onChange:c=>{n(Eu(c).format("YYYY-MM-DD"))}})}),u.jsx(v,{children:u.jsx(uu,{label:"تا تاریخ",id:"date",renderInput:c=>u.jsx(N,{style:{width:"160px"},...c}),value:i,onChange:c=>{A(Eu(c).format("YYYY-MM-DD"))}})})]}),columns:["کدبار","وضعیت","قیمت هرکیلو","قابل پرداخت","وزن","پرداخت"],data:h})})})},Dr=Lu("SLAUGHTER_GET_EXPORT_ALLOW_STATE",async(e,{dispatch:t})=>{t(cu());const{data:r,status:n}=await Su.get("allow_direct_buying/",{params:{role:xu()}});return t(X()),{data:r,status:n}}),wr=Lu("SLAUGHTER_GET_COUNTRIES",async(e,{dispatch:t})=>{t(cu());const{data:r,status:n}=await Su.get("get_country/");return t(X()),{data:r,status:n}}),Y6=({edit:e,updateTable:t,item:r})=>{var b,g,D,$,eu,pu,B,q,F,z,R,U,tu,Z,su,du,gu,mu;const[n,i]=p.useState(1),[A,h]=p.useState(1),o=lu(),[c]=p.useContext(Q),[y,d]=p.useState(0),[s,x]=p.useState(!1),[l,S]=p.useState([]),[w,T]=p.useState(r!=null&&r.exportCountry?r==null?void 0:r.exportCountry:""),{slaughterGetPoultries:E,slaughterGetKillerKillhouses:m,slaughterGetKillhouses:f}=Fu(j=>j.slaughterSlice);p.useEffect(()=>{o(c0()),o(C6()),o(h6()),o(le()),o(wr()).then(j=>{S(j.payload.data)})},[]);const Y={killhouse:null,killerPlace:null,poultry:null,killDate:r?new Date(r.createDate):new Date,numberForBuy:r?r.killCapacity:null,indexWeight:r?r.IndexWeight:""},H=j=>{var O,V,ru,nu,au,ju;o(Ye({kill_capacity:j.numberForBuy,recive_time:"12 - 14",recive_date:j.killDate,low_weight:!1,high_weight:!1,Index_weight:j.indexWeight,chicken_breed:(nu=(ru=(V=(O=a==null?void 0:a.values)==null?void 0:O.poultry)==null?void 0:V.item)==null?void 0:ru.hatchingAge)==null?void 0:nu.breed,cash:!0,credit:!1,sms_payment:!1,kill_house_key:j.killhouse,killer_kill_house_key:j.killerPlace?j.killerPlace:null,role:xu(),poultry_key:(ju=(au=a==null?void 0:a.values)==null?void 0:au.poultry)==null?void 0:ju.value,export_status:!0,export_country:w})).then(yu=>{yu.payload.error?c({vertical:"top",horizontal:"center",msg:yu.payload.error,severity:"error"}):(t(),c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(hu({right:!1,bottom:!1,left:!1,content:null})))})};p.useEffect(()=>{var j,O,V,ru,nu,au;r&&d(((O=(j=r==null?void 0:r.poultry)==null?void 0:j.lastHatchingDiffrentRequestQuantity)==null?void 0:O.leftExportQuantity)===null?(ru=(V=r.poultry)==null?void 0:V.lastHatchingDiffrentRequestQuantity)==null?void 0:ru.lastHatchingRemainQuantity:(au=(nu=r==null?void 0:r.poultry)==null?void 0:nu.lastHatchingDiffrentRequestQuantity)==null?void 0:au.leftExportQuantity)},[]);const _=fu().shape({killhouse:bu().typeError("این فیلد الزامی است").required("این فیلد الزامی است"),poultry:fu("").typeError("این فیلد الزامی است").required("این فیلد الزامی است"),numberForBuy:Tu().typeError("لطفا عدد وارد کنید").max(y,"تعداد بیش از حد مجاز است").required("لطفا عدد وارد کنید").positive("لطفا عدد وارد کنید").integer("لطفا عدد وارد کنید"),indexWeight:Tu().typeError("لطفا عدد وارد کنید").required("لطفا عدد وارد کنید").positive("لطفا عدد وارد کنید")}),a=_u({initialValues:Y,validationSchema:_,onSubmit:H});p.useEffect(()=>{var V,ru,nu,au;let j=a.values.indexWeight;const O=(au=(nu=(ru=(V=a.values)==null?void 0:V.indexWeight)==null?void 0:ru.toString())==null?void 0:nu.split("."))==null?void 0:au.join("");a.values.indexWeight&&O.length<=3&&(O.length===2&&(j=O[0]+"."+O[1]),O.length===3&&(j=O[0]+"."+O[1]+O[2])),isNaN(Number.parseFloat(j))?a.setFieldValue("indexWeight",""):a.setFieldValue("indexWeight",Number.parseFloat(j))},[a.values.indexWeight]);const C=async j=>{j.preventDefault(),o(c0({min_age:n||1,max_age:A||1}))},L=async j=>{j.preventDefault(),i(1),h(1),o(c0())};return u.jsx("form",{onSubmit:a.handleSubmit,children:u.jsxs(v,{container:!0,direction:"column",gap:k.SMALL,children:[!e&&u.jsxs(u.Fragment,{children:[f!=null&&f.length?u.jsx(Pu,{id:"killhouse",disableClearable:!0,options:f==null?void 0:f.map(j=>({label:(j!=null&&j.killer?"کشتارکن":"کشتارگاه")+" "+j.name,value:j.key,killer:j.killer,item:j,disabled:j.allowDirectBuying})),getOptionDisabled:j=>!j.disabled,getOptionLabel:j=>j.label,onChange:(j,O)=>{x(O.killer),a.setFieldValue("killhouse",O.value)},onBlur:a.handleBlur,renderInput:j=>u.jsx(N,{...j,label:"انتخاب کشتارگاه/کشتارکن",variant:"outlined",error:a.touched.killhouse&&!!a.errors.killhouse,helperText:a.touched.killhouse&&a.errors.killhouse})}):u.jsx(U6,{}),s&&u.jsx(Pu,{id:"killerPlace",disableClearable:!0,options:m==null?void 0:m.map(j=>({label:"کشتارگاه "+j.name,value:j.key})),getOptionLabel:j=>j.label,onChange:(j,O)=>a.setFieldValue("killerPlace",O.value),onBlur:a.handleBlur,renderInput:j=>u.jsx(N,{...j,label:"انتخاب محل کشتار",variant:"outlined",error:a.touched.killerPlace&&!!a.errors.killerPlace,helperText:a.touched.killerPlace&&a.errors.killerPlace})}),u.jsxs(v,{container:!0,alignItems:"center",gap:k.SMALL,style:{padding:"10px",border:"1px solid #bbb",borderRadius:"10px"},children:[u.jsx(v,{style:{width:"70px"},children:u.jsx(N,{fullWidth:!0,size:"small",label:"از سن",id:"outlined-controlled",value:n,onChange:j=>{i(j.target.value)}})}),u.jsx(v,{style:{width:"70px"},children:u.jsx(N,{fullWidth:!0,size:"small",label:"تا سن",id:"outlined-controlled",value:A,onChange:j=>{h(j.target.value)}})}),u.jsxs(v,{display:"grid",alignItems:"center",children:[u.jsx(G,{disabled:n>A||n<1||A<1,onClick:C,children:"جستجو"}),u.jsx(G,{color:"error",onClick:L,children:"حذف فیلتر"})]})]}),E!=null&&E.length?u.jsx(Pu,{id:"poultry",disableClearable:!0,options:E==null?void 0:E.map(j=>{var O,V;return{label:`${j.unitName} (${j.user.fullname}) سن: ${(O=j.lastHatchingDiffrentRequestQuantity)==null?void 0:O.age} روز / نژاد: ${(V=j.lastHatchingDiffrentRequestQuantity)==null?void 0:V.breed}`,value:j.key,item:j}}),getOptionLabel:j=>j.label,onChange:(j,O)=>{var V,ru,nu,au,ju;a.setFieldValue("poultry",O),d(((ru=(V=O==null?void 0:O.item)==null?void 0:V.lastHatchingDiffrentRequestQuantity)==null?void 0:ru.leftExportQuantity)===null?(nu=O.item)==null?void 0:nu.lastHatchingRemainQuantity:(ju=(au=O==null?void 0:O.item)==null?void 0:au.lastHatchingDiffrentRequestQuantity)==null?void 0:ju.leftExportQuantity)},onBlur:a.handleBlur,renderInput:j=>u.jsx(N,{...j,label:"انتخاب مرغداری",variant:"outlined",error:a.touched.poultry&&!!a.errors.poultry,helperText:a.touched.poultry&&a.errors.poultry})}):u.jsx(I,{color:"error",variant:"body2",children:"موردی یافت نشد!"}),a.values.poultry&&u.jsxs(v,{container:!0,direction:"column",justifyContent:"space-between",children:[u.jsxs(v,{container:!0,gap:k.TINY,children:[u.jsx(I,{children:"نام و نام خانوادگی:"}),u.jsx(I,{children:(g=(b=a==null?void 0:a.values)==null?void 0:b.poultry)==null?void 0:g.item.user.fullname})]}),u.jsxs(v,{container:!0,gap:k.TINY,children:[u.jsx(I,{children:"تلفن:"}),u.jsx(I,{children:($=(D=a==null?void 0:a.values)==null?void 0:D.poultry)==null?void 0:$.item.user.mobile})]}),u.jsxs(v,{container:!0,gap:k.TINY,children:[u.jsx(I,{children:"آدرس:"}),u.jsx(I,{children:`${(pu=(eu=a==null?void 0:a.values)==null?void 0:eu.poultry)==null?void 0:pu.item.address.province.name} - ${(q=(B=a==null?void 0:a.values)==null?void 0:B.poultry)==null?void 0:q.item.address.city.name} - ${(z=(F=a==null?void 0:a.values)==null?void 0:F.poultry)==null?void 0:z.item.address.address}`})]}),u.jsxs(v,{container:!0,gap:k.TINY,children:[u.jsx(I,{children:"سن جوجه:"}),u.jsxs(I,{children:[(Z=(tu=(U=(R=a==null?void 0:a.values)==null?void 0:R.poultry)==null?void 0:U.item)==null?void 0:tu.lastHatchingDiffrentRequestQuantity)==null?void 0:Z.age," ","روز"]})]}),u.jsxs(v,{container:!0,gap:k.TINY,children:[u.jsx(I,{children:"مانده در سالن:"}),u.jsxs(I,{children:[(mu=(gu=(du=(su=a==null?void 0:a.values)==null?void 0:su.poultry)==null?void 0:du.item)==null?void 0:gu.lastHatchingRemainQuantity)==null?void 0:mu.toLocaleString()," ","قطعه"]})]}),u.jsxs(v,{container:!0,gap:k.TINY,children:[u.jsx(I,{color:"error",children:" مانده قابل صادرات:"}),u.jsxs(I,{color:"error",children:[y==null?void 0:y.toLocaleString()," قطعه"]})]})]})]}),u.jsx(uu,{fullWidth:!0,label:"تاریخ کشتار",id:"killDate",renderInput:j=>u.jsx(N,{...j}),value:a.values.killDate,error:a.touched.killDate?!!a.errors.killDate:null,onChange:j=>{a.setFieldValue("killDate",Eu(j).format("YYYY-MM-DD hh:mm:ss"))},onBlur:a.handleBlur,helperText:a.touched.killDate&&a.errors.killDate?a.errors.killDate:null}),u.jsx(e0,{allowLeadingZeros:!0,thousandSeparator:",",id:"numberForBuy",name:"numberForBuy",label:"قطعه",variant:"outlined",value:a.values.numberForBuy,onChange:a.handleChange,onBlur:a.handleBlur,error:a.touched.numberForBuy&&!!a.errors.numberForBuy,helperText:a.touched.numberForBuy&&a.errors.numberForBuy}),u.jsx(N,{id:"indexWeight",name:"indexWeight",label:"میانگین وزنی",variant:"outlined",value:a.values.indexWeight,onChange:a.handleChange,onBlur:a.handleBlur,InputProps:{endAdornment:u.jsx(V6,{position:"end",children:"کیلوگرم"})},error:a.touched.indexWeight&&!!a.errors.indexWeight,helperText:a.touched.indexWeight&&a.errors.indexWeight}),u.jsxs(wu,{children:[u.jsx(Ou,{id:"hour-label",children:"کشور مقصد"}),u.jsx(qu,{labelId:"hour-label",label:"کشور مقصد",id:"hour-select",value:w,onChange:j=>T(j.target.value),children:l==null?void 0:l.map(j=>u.jsx(Cu,{value:j.fa,children:j.fa},j.fa))})]}),!e&&u.jsx(G,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,disabled:!w,children:"ثبت"}),e&&u.jsx(G,{disabled:!a.values.numberForBuy||!a.values.killDate||!a.values.indexWeight||a.values.numberForBuy>y||!w,variant:"contained",color:"primary",fullWidth:!0,onClick:()=>{o(Pe({role:xu(),kill_capacity:a.values.numberForBuy,recive_date:a.values.killDate,Index_weight:a.values.indexWeight,kill_request_key:r.key,remain_quantity:a.values.numberForBuy,export_status:!0})).then(j=>{var O,V;(O=j==null?void 0:j.payload)!=null&&O.error?c({vertical:"top",horizontal:"center",msg:(V=j==null?void 0:j.payload)==null?void 0:V.error,severity:"error"}):(t(),c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(hu({right:!1,bottom:!1,left:!1,content:null})))})},children:"ثبت ویرایش"})]})})},_r=({item:e,updateTable:t})=>{const r=lu(),[n,i]=p.useState(null),[A]=p.useContext(Q),h=d=>{i(d.currentTarget)},o=()=>{i(null)},c=!!n,y=c?"popover":void 0;return u.jsxs(v,{container:!0,children:[u.jsx(ou,{"aria-describedby":y,variant:"contained",color:"primary",onClick:h,children:u.jsx(F6,{})}),u.jsx(i6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:y,open:c,anchorEl:n,onClose:o,children:u.jsx("div",{style:{padding:"20px",display:"flex",flexDirection:"column"},children:u.jsxs(v,{container:!0,direction:"column",children:[u.jsx(Yu,{title:"ویرایش",placement:"right",children:u.jsx(ou,{color:"primary",onClick:()=>{o(),r(hu({title:"ویرایش درخواست صادرات",content:u.jsx(Y6,{updateTable:t,edit:!0,item:e}),right:!(window.innerWidth<=600),bottom:window.innerWidth<=600}))},children:u.jsx($u,{})})}),u.jsx(Yu,{title:"حذف",children:u.jsx(ou,{color:"error",onClick:()=>{r(We(e.key)).then(d=>{d.error?A({vertical:"top",horizontal:"center",msg:d.error,severity:"error"}):(t(),A({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:u.jsx(o0,{})})})]})})})]})},mr=()=>{const e=lu(),[t,r]=p.useState();p.useEffect(()=>{e(Dr()).then(B=>{r(B.payload.data)})},[]);const[n,i]=p.useState(0),A=(B,q)=>{i(q)},[,,h,o,c,y]=p.useContext(Q);p.useEffect(()=>{const B=J(new Date).format("YYYY-MM-DD");o(B),y(B)},[]);const d=B=>{m(B.target.value)},[s,x]=p.useState([]),[l,S]=p.useState(0),[w,T]=p.useState(10),[E,m]=p.useState(""),[f,Y]=p.useState(1),[H,_]=p.useState([]),[a,C]=p.useState([]),L=async B=>{let q;e(cu()),q=await Su.get(`kill_request/?export=true&type=${n===0?"pending":"archive"}&search=filter&value=${E}&role=${xu()}&date1=${h}&date2=${c}&page=${B}&page_size=${w}`),e(X()),x(q.data.results),S(q.data.count)},b=B=>{L(B),Y(B)},g=B=>{T(B),Y(1)},D=()=>{L(f!==0?f:1)};p.useEffect(()=>{L(1)},[]);const $=B=>{let q="";return B.exportState==="pending"?q="در انتظار تایید":B.exportState==="rejected"?q="رد شده":B.exportState==="accepted"?q="تایید شده":B.exportState==="deleted"&&(q="حذف شده"),q};p.useEffect(()=>{const B=s==null?void 0:s.map((F,z)=>{var R,U,tu,Z,su,du;return[f===1?z+1:z+w*(f-1)+1,iu(F==null?void 0:F.createDate),iu(F.reciveDate),`${F.killHouse.name} (${F.killHouse.killHouseOperator.user.mobile})`,F!=null&&F.slaughterHouse?(R=F==null?void 0:F.slaughterHouse)==null?void 0:R.name:(U=F==null?void 0:F.killHouse)==null?void 0:U.name,F==null?void 0:F.exportCountry,`${(Z=(tu=F==null?void 0:F.poultry)==null?void 0:tu.userprofile)==null?void 0:Z.fullName} (${(du=(su=F==null?void 0:F.poultry)==null?void 0:su.userprofile)==null?void 0:du.mobile})`,F.killCapacity,F.IndexWeight,(F.IndexWeight*F.killCapacity).toLocaleString(),u.jsx(u.Fragment,{children:F!=null&&F.inputDirectBuyingCode?F==null?void 0:F.inputDirectBuyingCode:u.jsx(G,{onClick:()=>{e(Iu({title:"ثبت کد احراز",content:u.jsx(Ne,{item:F,updateTable:D})}))},children:"ثبت کداحراز"})}),$(F),n===0?u.jsx(_r,{updateTable:D,item:F},z):"-"]});_(B);const q=s==null?void 0:s.map((F,z)=>{var R,U,tu,Z,su,du;return[f===1?z+1:z+w*(f-1)+1,iu(F==null?void 0:F.createDate),iu(F.reciveDate),`${F.killHouse.name} (${F.killHouse.killHouseOperator.user.mobile})`,F!=null&&F.slaughterHouse?(R=F==null?void 0:F.slaughterHouse)==null?void 0:R.name:(U=F==null?void 0:F.killHouse)==null?void 0:U.name,F==null?void 0:F.exportCountry,`${(Z=(tu=F==null?void 0:F.poultry)==null?void 0:tu.userprofile)==null?void 0:Z.fullName} (${(du=(su=F==null?void 0:F.poultry)==null?void 0:su.userprofile)==null?void 0:du.mobile})`,F.killCapacity,F.IndexWeight,(F.IndexWeight*F.killCapacity).toLocaleString(),$(F),F!=null&&F.acceptRejectDate?A6(F==null?void 0:F.acceptRejectDate):"-",F==null?void 0:F.directBuyingMessage]});C(q)},[s]),p.useEffect(()=>{L(1)},[h,c,w,n]);const eu=async B=>{B.preventDefault(),e(cu());try{const q=await Su.get(`kill_request/?export=true&type=${n===0?"pending":"archive"}&role=${xu()}&search=filter&value=${E}&date1=${h}&date2=${c}&page=1&page_size=${w}`);x(q.data.results),S(q.data.count),e(X())}catch(q){console.error("Error fetching data:",q)}},pu=Fu(B=>B.userSlice.userProfile.key);return u.jsxs(v,{container:!0,direction:"column",flexWrap:"nowrap",mt:k.SMALL,children:[u.jsx(v,{container:!0,justifyContent:"center",alignItems:"center",my:k.SMALL,children:u.jsxs(d6,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:n,onChange:A,children:[u.jsx(Zu,{label:"درخواست های جدید"}),u.jsx(Zu,{label:"بایگانی"})]})}),u.jsxs(v,{container:!0,mt:k.MEDIUM,alignItems:"center",justifyContent:"center",gap:2,children:[u.jsx(G,{variant:"contained",disabled:!(t!=null&&t.exportStatus),onClick:()=>{e(hu({title:"ثبت درخواست صادرات",content:u.jsx(Y6,{updateTable:D}),right:!(window.innerWidth<=600),bottom:window.innerWidth<=600}))},children:"ثبت درخواست صادرات"}),u.jsx("form",{onSubmit:eu,children:u.jsxs(v,{container:!0,alignItems:"center",gap:k.SMALL,children:[u.jsx(N,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:d}),u.jsx(G,{type:"submit",onClick:eu,endIcon:u.jsx(Ke,{}),children:"جستجو"}),u.jsx(v,{children:u.jsx(uu,{label:"از تاریخ",id:"date",renderInput:B=>u.jsx(N,{style:{width:"160px"},...B}),value:h,onChange:B=>{o(J(B).format("YYYY-MM-DD"))}})}),u.jsx(v,{children:u.jsx(uu,{label:"تا تاریخ",id:"date",renderInput:B=>u.jsx(N,{style:{width:"160px"},...B}),value:c,onChange:B=>{y(J(B).format("YYYY-MM-DD"))}})}),n===1&&u.jsx(v,{children:u.jsx(Yu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${Su.defaults.baseURL}export_kill_house_excel/?date1=${h}&date2=${c}&role=${xu()}&key=${pu}`,rel:"noreferrer",children:u.jsx(G,{color:"success",children:u.jsx(Ue,{size:32})})})})})]})}),n===0?u.jsx(Wu,{data:H,columns:["ردیف","تاریخ ثبت درخواست","تاریخ کشتار","خریدار","محل کشتار","کشور مقصد","مرغدار (تلفن)","تعداد درخواست (قطعه)","میانگین وزنی (کیلوگرم)","وزن کل (کیلوگرم)","کد احراز","وضعیت","عملیات"],handlePageChange:b,totalRows:l,page:f,perPage:w,handlePerRowsChange:g,title:"صادرات"}):u.jsx(Wu,{data:a,columns:["ردیف","تاریخ ثبت درخواست","تاریخ کشتار","خریدار","محل کشتار","کشور مقصد","مرغدار (تلفن)","تعداد درخواست (قطعه)","میانگین وزنی (کیلوگرم)","وزن کل (کیلوگرم)","وضعیت","تاریخ تایید/رد","دلیل رد"],handlePageChange:b,totalRows:l,page:f,perPage:w,handlePerRowsChange:g,title:"بایگانی صادرات"})]})]})},Gn=()=>{const{pathname:e}=g6(),{slaughterPermissionState:t}=Fu(r=>r.slaughterSlice);return u.jsx(u.Fragment,{children:u.jsx(c6,{display:"flex",justifyContent:"center",children:u.jsxs(v,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[e===se?u.jsxs(v,{justifyContent:"center",my:k.MEDIUM,children:[u.jsx(v,{children:u.jsx(I,{variant:"h6",children:"صفحه مدیریت درخواست های کشتارگاه"})}),u.jsx(Qe,{hasPermission:t})]}):u.jsx(He,{}),u.jsxs(v,{container:!0,justifyContent:"space-between",gap:k.SMALL,children:[u.jsxs(v,{xs:12,children:[e===A0&&u.jsx(sr,{steps:ir,disableDotsNavigation:!0,showButtons:!1,children:u.jsx(Ge,{})}),e===ie&&u.jsx(De,{}),e===g0&&u.jsx(cr,{}),e===v0&&u.jsx(vr,{}),e===ce&&u.jsx(Xe,{})," ",e===de&&u.jsx(Ze,{}),e===F0&&u.jsx(Me,{}),e===Ce&&u.jsx(me,{}),e===j0&&u.jsx(Fr,{}),e===he&&u.jsx(Sr,{}),e===pe&&u.jsx(kr,{}),e===f0&&u.jsx($e,{}),e===x0&&u.jsx(mr,{})]}),e===y0&&u.jsx(ze,{})]})]})})})};export{Gn as default}; diff --git a/build/assets/SlaughterSellCarcass-D_Twt9ez.js b/build/assets/SlaughterSellCarcass-D_Twt9ez.js new file mode 100644 index 0000000..543d92c --- /dev/null +++ b/build/assets/SlaughterSellCarcass-D_Twt9ez.js @@ -0,0 +1 @@ +import{i as Iu,j as a,ak as L,B as p,I as Eu,b0 as Wu,an as Yu,b4 as Ou,ap as Hu,aq as Mu,T as B,d as Pu,ah as zu,ai as yu,aj as Du}from"./mui-vendor-CkIVaoQP.js";import{r as Nu,A as K,u as Bu,c as Gu,X as $,G as n,M as Ku,L as m,j as U,h as V,v as w,_ as Uu,p as Vu,N as qu,O as G,jt as Ju,W as q,S as J,C as W,fH as bu,j9 as Xu,ju as Qu,dh as Zu}from"./index-CeyyVc1v.js";import{r as d,u as mu,f as u6}from"./react-vendor-CmFgShSM.js";import{u as Y,a as e6,f as X}from"./redux-vendor-B7uoacJt.js";import{R as ku}from"./ResponsiveTable-w7hk7Uq8.js";import{S as a6,s as r6}from"./SlaughterAllocateToGuild-Dfz5LRq5.js";import{S as o6,a as s6}from"./SlaughterManageInventoryAllocationOperations-Bla8JB6Q.js";import{R as n6}from"./index.esm-Bu7XMDZU.js";import{S as t6}from"./ShowImage-CqhU2hmk.js";import{g as l6}from"./guild-allocated-stock-operation-BiIjKHlL.js";import{u as c6}from"./getProvinceName-BujSmyBy.js";import{b as C6}from"./slaughter-get-guilds-for-allocate-B6OrhhMj.js";import{d as d6}from"./Tune-D4M2CAhp.js";import{d as i6}from"./Delete-C5MyLelE.js";import{d as h6}from"./Sms-DasNClAG.js";import{g as A6}from"./getAllocationType-76F45b0K.js";import{d as g6}from"./SystemUpdateAlt-Bu3pObDi.js";var uu={},p6=Iu;Object.defineProperty(uu,"__esModule",{value:!0});var F6=uu.default=void 0,x6=p6(Nu()),f6=a;F6=uu.default=(0,x6.default)((0,f6.jsx)("path",{d:"M9.64 7.64c.23-.5.36-1.05.36-1.64 0-2.21-1.79-4-4-4S2 3.79 2 6s1.79 4 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1zM6 8c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2m0 12c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2m6-7.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5.5.22.5.5-.22.5-.5.5M19 3l-6 6 2 2 7-7V3z"}),"ContentCut");const v6=Gu({verificationCode:Ku().required("کد احراز الزامی است").matches(/^\d+$/,"کد احراز باید فقط شامل اعداد باشد")}),j6=({item:t,fetchApiData:o})=>{const c=Y(),[i]=d.useContext(K),r=Bu({initialValues:{verificationCode:""},validationSchema:v6,onSubmit:b=>{c(l6({steward_allocation_key:t==null?void 0:t.key,logged_registration_code:b.verificationCode,role:$()})).then(A=>{A.payload.error?i({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"}):(i({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o())})}});return a.jsx(n,{container:!0,xs:12,justifyContent:"center",alignItems:"center",direction:"column",children:a.jsx("form",{onSubmit:r.handleSubmit,style:{width:"100%"},children:a.jsxs(n,{container:!0,xs:12,direction:"column",children:[a.jsx(L,{sx:{minWidth:"120px"},size:"small",fullWidth:!0,id:"verificationCode",name:"verificationCode",label:"کد احراز",inputMode:"numeric",value:r.values.verificationCode,onChange:r.handleChange,onBlur:r.handleBlur,error:r.touched.verificationCode&&!!r.errors.verificationCode,helperText:r.touched.verificationCode&&r.errors.verificationCode,variant:"outlined"}),a.jsx(p,{size:"small",type:"submit",color:"primary",disabled:!r.isValid,children:"ارسال"})]})})})},S6=e6("SLAUGHTER_SEND_SMS_AGAIN_SERVICE",async(t,{dispatch:o})=>{o(m());try{const{data:c,status:i}=await U.post("send_again_sms_steward_allocation/",t);return o(V()),{data:c,status:i}}catch(c){return o(V()),{error:c.response.data.result}}}),y6=({updateTable:t,priceInfo:o})=>{const c=c6(),{slaughterProducts:i}=X(e=>e.slaughterSlice),r=Y(),b=mu(),[,,A,_,l,s]=d.useContext(K);d.useEffect(()=>{const e=w(new Date).format("YYYY-MM-DD");_(e),s(e)},[]);const C=e=>{M(e.target.value)},[g,x]=d.useState([]),[O,T]=d.useState(0),[f,H]=d.useState(10),[I,M]=d.useState(""),[Q,eu]=d.useState(1),[wu,_u]=d.useState([]),[P]=d.useContext(K),v=async e=>{r(m());const u=await U.get(`steward-allocation/?search=filter&value=${I}&role=${$()}&date1=${A}&date2=${l}&page=${e||1}&page_size=${f}`);r(V()),x(u.data.results),T(u.data.count)},Ru=e=>{v(e),eu(e)},Lu=e=>{var F,j,S,y,D,k,E,R,Z,z,h,N,ru,ou,su,nu,tu,lu,cu,Cu,du,iu,hu,Au,gu,pu,Fu,xu,fu,vu,ju,Su;let u=`${(F=e==null?void 0:e.toKillHouse)==null?void 0:F.name} - ${(y=(S=(j=e==null?void 0:e.toKillHouse)==null?void 0:j.killHouseOperator)==null?void 0:S.user)==null?void 0:y.fullname} (${(E=(k=(D=e==null?void 0:e.toKillHouse)==null?void 0:D.killHouseOperator)==null?void 0:k.user)==null?void 0:E.mobile})`;switch(e==null?void 0:e.allocationType){case"killhouse_killhouse":u=`${(R=e==null?void 0:e.toKillHouse)==null?void 0:R.name} - ${(h=(z=(Z=e==null?void 0:e.toKillHouse)==null?void 0:Z.killHouseOperator)==null?void 0:z.user)==null?void 0:h.fullname} (${(ou=(ru=(N=e==null?void 0:e.toKillHouse)==null?void 0:N.killHouseOperator)==null?void 0:ru.user)==null?void 0:ou.mobile})`;break;case"killhouse_steward":u=`${(su=e==null?void 0:e.toSteward)==null?void 0:su.guildsName} - ${(tu=(nu=e==null?void 0:e.toSteward)==null?void 0:nu.user)==null?void 0:tu.fullname} (${(cu=(lu=e==null?void 0:e.toSteward)==null?void 0:lu.user)==null?void 0:cu.mobile})`;break;case"killhouse_guild":u=`${(Cu=e==null?void 0:e.toGuilds)==null?void 0:Cu.guildsName} - ${(iu=(du=e==null?void 0:e.toGuilds)==null?void 0:du.user)==null?void 0:iu.fullname} (${(Au=(hu=e==null?void 0:e.toGuilds)==null?void 0:hu.user)==null?void 0:Au.mobile})`;break;case"ColdHouse":u=`${(gu=e==null?void 0:e.toColdHouse)==null?void 0:gu.name}`;break;default:u=`${(pu=e==null?void 0:e.toKillHouse)==null?void 0:pu.name} - ${(fu=(xu=(Fu=e==null?void 0:e.toKillHouse)==null?void 0:Fu.killHouseOperator)==null?void 0:xu.user)==null?void 0:fu.fullname} (${(Su=(ju=(vu=e==null?void 0:e.toKillHouse)==null?void 0:vu.killHouseOperator)==null?void 0:ju.user)==null?void 0:Su.mobile})`;break}return u},$u=e=>{H(e),eu(1)};d.useEffect(()=>{const e=g==null?void 0:g.map((u,F)=>{var j,S,y,D,k,E,R;return[Q===1?F+1:F+f*(Q-1)+1,u!=null&&u.date?Uu(u==null?void 0:u.date):"-",u!=null&&u.productionDate?Vu(u==null?void 0:u.productionDate):"-",((u==null?void 0:u.distributionType)==="web"?"سایت":(u==null?void 0:u.distributionType)==="app"?"موبایل":(u==null?void 0:u.distributionType)==="pos"?"پوز":u==null?void 0:u.distributionType)||"-",A6(u),Lu(u),(u==null?void 0:u.interfaceNumber)||"-",(u==null?void 0:u.sellType)==="exclusive"?"اختصاصی":"آزاد",((j=u==null?void 0:u.amount)==null?void 0:j.toLocaleString())+" ریال",((S=u==null?void 0:u.totalAmount)==null?void 0:S.toLocaleString())+" ریال",(y=u==null?void 0:u.realNumberOfCarcasses)==null?void 0:y.toLocaleString(),(D=u==null?void 0:u.realWeightOfCarcasses)==null?void 0:D.toLocaleString(),(k=u==null?void 0:u.receiverRealNumberOfCarcasses)==null?void 0:k.toLocaleString(),(E=u==null?void 0:u.receiverRealWeightOfCarcasses)==null?void 0:E.toLocaleString(),(u==null?void 0:u.receiverState)==="accepted"?"تایید شده":u!=null&&u.loggedRegistrationCode?u.loggedRegistrationCode:u!=null&&u.registrationCode?a.jsx(j6,{fetchApiData:v,item:u},F):"-",u!=null&&u.registrationCode?"ارسال شده":"ارسال نشده",a.jsx(t6,{src:u.image},F),(u==null?void 0:u.quota)==="governmental"?"دولتی":(u==null?void 0:u.quota)==="free"?"آزاد":"-",u!=null&&u.approvedPriceStatus?"دولتی":"آزاد",(u==null?void 0:u.receiverState)==="accepted"||u!=null&&u.loggedRegistrationCode?"تایید شده":(u==null?void 0:u.receiverState)==="rejected"?"رد شده":u!=null&&u.activeExpireDateTime&&!(u!=null&&u.loggedRegistrationCode)&&(u!=null&&u.registrationCode)?"در انتظار ورود کد احراز":"در انتظار تایید",(u==null?void 0:u.receiverState)==="pending"&&(u!=null&&u.activeExpireDateTime)&&!(u!=null&&u.loggedRegistrationCode)&&(u!=null&&u.registrationCode)?a.jsx(Tu,{item:u,fetchApiData:v,updateTable:t},`pending-ops-${u.key}`):a.jsx(o6,{item:u,fetchApiData:v,priceInfo:o,remainWeight:(R=i[0])==null?void 0:R.totalRemainWeight},F)]});_u(e)},[g]),d.useEffect(()=>{v(1)},[r,A,l,f]);const Tu=({item:e,fetchApiData:u,updateTable:F})=>{const[j,S]=d.useState(null),y=!!j,D=y?`pending-popover-${e.key}`:void 0,k=h=>{S(h.currentTarget)},E=()=>{S(null)},z=[{key:"delete",label:"حذف",icon:i6,color:"error.main",action:()=>{r(G({title:"آیا مطمئن هستید؟",content:a.jsxs(n,{container:!0,spacing:2,children:[a.jsx(n,{item:!0,children:a.jsx(p,{variant:"contained",color:"error",onClick:()=>{r(C6({steward_allocation_key:e.key})).then(()=>{r(W()),r(bu()),u(1)})},children:"تایید"})}),a.jsx(n,{item:!0,children:a.jsx(p,{onClick:()=>{r(W())},children:"لغو"})})]})}))}},{key:"resend",label:"ارسال مجدد کد",icon:h6,color:"primary.main",action:()=>{r(S6({key:e.key})).then(h=>{h.payload.error?P({vertical:"top",horizontal:"center",msg:h.payload.error,severity:"error"}):(F(),P({vertical:"top",horizontal:"center",msg:"کد با موفقیت ارسال شد.",severity:"success"}))})}}];return a.jsxs(n,{container:!0,justifyContent:"center",children:[a.jsx(Eu,{size:"small",color:"primary","aria-describedby":D,onClick:k,children:a.jsx(d6,{})}),a.jsx(Wu,{id:D,open:y,anchorEl:j,onClose:E,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:a.jsx(Yu,{sx:{minWidth:160,p:.5},children:z.map(h=>{const N=h.icon;return a.jsxs(Ou,{onClick:()=>{E(),h.action()},sx:{borderRadius:1,mb:.25,py:.5,"&:last-of-type":{mb:0}},children:[a.jsx(Hu,{sx:{minWidth:32,color:h.color},children:a.jsx(N,{fontSize:"small"})}),a.jsx(Mu,{primary:h.label,primaryTypographyProps:{sx:{color:h.color,fontSize:"0.82rem",fontWeight:600}}})]},h.key)})})})]})},au=async e=>{e.preventDefault(),r(m());try{const u=await U.get(`steward-allocation/?role=${$()}&search=filter&value=${I}&date1=${A}&date2=${l}&page=1&page_size=${f}`);x(u.data.results),T(u.data.count),r(V())}catch(u){console.error("Error fetching data:",u)}};return a.jsxs(n,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[a.jsxs(n,{container:!0,xs:12,my:2,gap:2,children:[a.jsx(p,{disabled:!i,variant:"contained",onClick:()=>{r(qu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت توزیع/ فروش درون استان",size:{xs:"100%"},content:a.jsx(a6,{updateTable:t,sellerType:"KillHouse",sellType:"exclusive",fetchApiData:v,priceInfo:o,killHouseAllocation:!0})}))},children:"ثبت توزیع/ فروش"}),a.jsx(p,{disabled:!i,variant:"contained",onClick:()=>{var e;r(G({title:"انتقال به سردخانه",content:a.jsx(s6,{updateTable:t,sellerType:"KillHouse",sellType:"free",fetchApiData:v,priceInfo:o,remainWeight:(e=i[0])==null?void 0:e.totalRemainWeight,killHouseAllocation:!1})}))},children:"انتقال به سردخانه"}),a.jsx(p,{disabled:!0,variant:"contained",color:"success",onClick:()=>{b(Ju)},children:"لیست روزانه"})]}),a.jsxs(n,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,mt:4,children:[a.jsxs(n,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[a.jsx(n,{children:a.jsx(q,{label:"از تاریخ",id:"date",renderInput:e=>a.jsx(L,{style:{width:"160px"},...e,size:"small"}),value:A,onChange:e=>{_(w(e).format("YYYY-MM-DD"))}})}),a.jsx(n,{children:a.jsx(q,{label:"تا تاریخ",id:"date",renderInput:e=>a.jsx(L,{style:{width:"160px"},...e,size:"small"}),value:l,onChange:e=>{s(w(e).format("YYYY-MM-DD"))}})}),a.jsx(n,{children:a.jsxs("form",{onSubmit:au,children:[a.jsx(L,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:C}),a.jsx(p,{type:"submit",onClick:au,endIcon:a.jsx(n6,{}),children:"جستجو"})]})}),a.jsx(p,{variant:"outlined",onClick:()=>{r(G({title:"ثبت نهایی",content:a.jsxs(n,{container:!0,gap:1,children:[c==="hamedan"?a.jsxs(n,{container:!0,gap:J.SMALL,children:[a.jsx(B,{color:"error",variant:"body2",children:"لطفاً توجه داشته باشید:"}),a.jsx(B,{color:"error",variant:"body2",children:"درصورتی‌که کد احراز ظرف مدت ۱۰ دقیقه وارد نشود، ثبت‌نام شما به‌طور خودکار حذف خواهد شد."}),a.jsx(B,{color:"error",variant:"body2",children:"درصورت استفاده از شماره واسط برای ثبت کد احراز، مسئولیت صحت و تأیید شماره بر عهده کشتارگاه خواهد بود."})]}):a.jsx(B,{children:"در صورت ثبت نهایی انجام هیچگونه عملیاتی مانند حذف و ویرایش امکان پذیر نمی باشد."}),a.jsxs(n,{container:!0,direction:"column",gap:J.TINY,width:"100%",children:[a.jsx(p,{fullWidth:!0,variant:"contained",onClick:()=>{r(r6({steward_allocation_list:g.map(e=>e.key)})).then(e=>{r(W()),e.payload.error?P({vertical:"top",horizontal:"center",msg:e.payload.error,severity:"error"}):(t(),v(1),P({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),a.jsx(p,{fullWidth:!0,color:"error",variant:"contained",onClick:()=>{r(W())},children:"لغو"})]})]})}))},children:"تایید نهایی (یکجا)"})]}),a.jsx(ku,{data:wu,columns:["ردیف","تاریخ توزیع","تاریخ تولید گوشت","ثبت شده","نوع تخصیص","مشخصات خریدار","شماره واسط","تخصیص","قیمت هر کیلو","قیمت کل","حجم تخصیصی","وزن تخصیصی","حجم تایید شده","وزن تایید شده","کداحراز","وضعیت کد احراز","سند","سهمیه","نوع فروش","وضعیت","عملیات"],handlePageChange:Ru,totalRows:O,page:Q,perPage:f,handlePerRowsChange:$u,title:"تخصیصات صورت گرفته"})]})]})},D6=()=>{const{slaughterProducts:t,distributionInfo:o}=X(l=>l.slaughterSlice),[c,i]=d.useState(),{pathname:r}=u6(),b=Y(),A=l=>{var s,C,g,x;return $()==="KillHouse"?[(s=l==null?void 0:l.totalGovernmentalCarcassesWeight)==null?void 0:s.toLocaleString(),(C=l==null?void 0:l.provinceFreeCarcassesWeight)==null?void 0:C.toLocaleString()]:[(g=l==null?void 0:l.receiveGovernmentalCarcassesWeight)==null?void 0:g.toLocaleString(),(x=l==null?void 0:l.receiveFreeCarcassesWeight)==null?void 0:x.toLocaleString()]};d.useEffect(()=>{const l=t==null?void 0:t.map((s,C)=>{var g,x,O,T,f,H,I,M;return[C+1,s==null?void 0:s.name,...A(s),(g=s==null?void 0:s.freeBuyingCarcassesWeight)==null?void 0:g.toLocaleString(),(x=s==null?void 0:s.totalCarcassesWeight)==null?void 0:x.toLocaleString(),(O=s==null?void 0:s.realAllocatedWeight)==null?void 0:O.toLocaleString(),(T=s==null?void 0:s.totalRemainWeight)==null?void 0:T.toLocaleString(),(f=o==null?void 0:o.totalGovernmentalRemainWeight)==null?void 0:f.toLocaleString(),(H=o==null?void 0:o.totalFreeRemainWeight)==null?void 0:H.toLocaleString(),(I=o==null?void 0:o.totalGovernmentalInputWeight)==null?void 0:I.toLocaleString(),(M=o==null?void 0:o.totalFreeInputWeight)==null?void 0:M.toLocaleString()]});i(l)},[t,o]);const _=()=>r===Xu||r===Qu?[]:["مانده دولتی (کیلوگرم)"," مانده آزاد (کیلوگرم)","وزن دولتی (کیلوگرم)","وزن آزاد (کیلوگرم)"];return a.jsx(n,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:a.jsx(ku,{noPagination:(c==null?void 0:c.length)===1,paginated:!(c!=null&&c.length)===1,operation:a.jsx(n,{container:!0,children:$()==="KillHouse"&&a.jsx(Pu,{title:"خروجی اکسل",placement:"top",children:a.jsx(Eu,{color:"primary",onClick:()=>{b(G({title:"دریافت خروجی اکسل",content:a.jsx(E6,{})}))},children:a.jsx(g6,{})})})}),title:"موجودی انبار",columns:["ردیف","نام محصول","وزن خریدهای دولتی داخل استان (کیلوگرم)","وزن خریدهای آزاد داخل استان (کیلوگرم)","وزن خریدهای خارج استان (کیلوگرم)","کل ورودی به انبار (کیلوگرم)","کل فروش (کیلوگرم)","مانده انبار (کیلوگرم)",..._()],data:c,customColors:[{name:"ردیف",color:"red"},{name:"نام محصول",color:"red"},{name:"کل ورودی به انبار (کیلوگرم)",color:"red"},{name:"وزن خریدهای دولتی داخل استان (کیلوگرم)",color:"red"},{name:"وزن خریدهای آزاد داخل استان (کیلوگرم)",color:"red"},{name:"وزن خریدهای خارج استان (کیلوگرم)",color:"red"},{name:"کل فروش (کیلوگرم)",color:"red"},{name:"مانده انبار (کیلوگرم)",color:"green"}]})})},E6=()=>{const[t,o]=d.useState("withdate"),c=C=>{o(C.target.value)},i=X(C=>C.userSlice.userProfile.key),[r,b]=d.useState(w(new Date).format("YYYY-MM-DD")),[A,_]=d.useState(w(new Date).format("YYYY-MM-DD")),l=Y(),[s]=d.useContext(K);return a.jsxs(n,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[a.jsxs(zu,{row:!0,"aria-labelledby":"radio-group-label",name:"radio-buttons-group",value:t,onChange:c,children:[a.jsx(yu,{value:"withdate",control:a.jsx(Du,{}),label:"دانلود بر اساس بازه"}),a.jsx(yu,{value:"nodate",control:a.jsx(Du,{}),label:"دانلود کلی"})]}),t==="withdate"&&a.jsxs(n,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[a.jsx(n,{children:a.jsx(q,{label:"از تاریخ",id:"date",renderInput:C=>a.jsx(L,{style:{width:"160px"},...C}),value:r,onChange:C=>{b(w(C).format("YYYY-MM-DD"))}})}),a.jsx(n,{children:a.jsx(q,{label:"تا تاریخ",id:"date",renderInput:C=>a.jsx(L,{style:{width:"160px"},...C}),value:A,onChange:C=>{_(w(C).format("YYYY-MM-DD"))}})})]}),a.jsx(p,{fullWidth:!0,variant:"contained",onClick:()=>{l(W()),s({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const C=`${U.defaults.baseURL}kill_house_inventory_data/?role=${$()}&key=${i}${t==="withdate"?`&date1=${r}&date2=${A}`:""}`;window.location.href=C},children:"دانلود فایل اکسل"})]})},B6=()=>{const t=Y(),{priceInfo:o}=X(i=>i.slaughterSlice),c=()=>{t(bu()),t(Zu())};return d.useEffect(()=>{c()},[t]),a.jsxs(n,{container:!0,direction:"column",alignItems:"center",justifyContent:"space-between",gap:J.SMALL,mt:J.MEDIUM,xs:12,children:[a.jsx(n,{container:!0,isDashboard:!0,xs:12,children:a.jsx(D6,{})}),a.jsx(y6,{updateTable:c,priceInfo:o})]})};export{B6 as S,D6 as a,F6 as d}; diff --git a/build/assets/Slaughters-Drh8o5nL.js b/build/assets/Slaughters-Drh8o5nL.js new file mode 100644 index 0000000..31eef3f --- /dev/null +++ b/build/assets/Slaughters-Drh8o5nL.js @@ -0,0 +1 @@ +import{j as u,T as C,d as g,I as F,b as H}from"./mui-vendor-CkIVaoQP.js";import{G as t,S as o,dG as v,dH as y,dF as N,X as s,dJ as B,dK as V,dI as x,dD as z,dE as k,dC as L,c0 as Y,c1 as b,b$ as j,dR as K,dS as Q,dQ as m,dy as $,dz as G,dB as q,dA as M,dX as R,dY as l,dZ as c,af as w,d_ as J,d$ as Z,e0 as W,e1 as uu,e2 as eu,e3 as su}from"./index-CeyyVc1v.js";import{S as ru}from"./SlaughterActiveRequests-9ZnaAVlL.js";import{B as tu}from"./BackButton-Crzr7NMa.js";import{N as n}from"./NavLink-D2GD_ItM.js";import{L as i}from"./LinkItem-DT6qswcs.js";import{V as _,e as nu,b as iu,f as ou}from"./index.esm-CjWvmHks.js";import{I as Eu}from"./index.esm-fCjAhNPc.js";import{f as S,u as au,r as A}from"./react-vendor-CmFgShSM.js";import{d as _u}from"./Visibility-DeyjG-oI.js";import{u as Au,f as Cu}from"./redux-vendor-B7uoacJt.js";import{R as Ru}from"./ResponsiveTable-w7hk7Uq8.js";import"./AdvancedTable-BYmmBtmq.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";import"./Plagiarism-BiXORbzo.js";import"./iconBase-BEJYyZsk.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const lu=()=>{const{pathname:e}=S();return u.jsxs(t,{container:!0,gap:o.SMALL,p:o.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",alignItems:"center",children:[u.jsx(n,{to:s()==="SuperAdmin"?v:s()==="AdminX"?y:N,active:e===N?"true":null,children:u.jsx(i,{icon:u.jsx(_,{size:30,color:"#244CCC"}),title:"خریداران"})}),(s()==="SuperAdmin"||s()==="AdminX")&&u.jsx(n,{to:s()==="SuperAdmin"?B:s()==="AdminX"?V:x,active:e===x?"true":null,children:u.jsx(i,{icon:u.jsx(_,{size:30,color:"#244CCC"}),title:"مجوز خرید"})}),u.jsx(n,{to:s()==="SuperAdmin"?z:s()==="AdminX"?k:L,active:e===L?"true":null,children:u.jsx(i,{icon:u.jsx(_,{size:30,color:"#244CCC"}),title:"دسترسی خودرو"})}),u.jsx(n,{to:s()==="SuperAdmin"?Y:s()==="AdminX"?b:j,active:e===j?"true":null,children:u.jsx(i,{icon:u.jsx(Eu,{size:30,color:"#244CCC"}),title:"مجوزهای توزیع"})}),u.jsx(n,{to:s()==="SuperAdmin"?K:s()==="AdminX"?Q:m,active:e===m?"true":null,children:u.jsx(i,{icon:u.jsx(_,{size:30,color:"#244CCC"}),title:"مجوز ثبت صنف به کشتارگاه ها"})}),(s()==="AdminX"||s()==="SuperAdmin")&&u.jsx(n,{to:s()==="SuperAdmin"?$:G,active:e===G?"true":null,children:u.jsx(i,{icon:u.jsx(nu,{size:30,color:"#244CCC"}),title:"پنل معاملاتی"})}),(s()==="AdminX"||s()==="SuperAdmin")&&u.jsx(n,{to:s()==="SuperAdmin"?q:M,active:e===M?"true":null,children:u.jsx(i,{icon:u.jsx(iu,{size:30,color:"#244CCC"}),title:"مدیریت توزیع"})}),(s()==="AdminX"||s()==="SuperAdmin")&&u.jsx(n,{to:s()==="SuperAdmin"?R:s()==="AdminX"?l:s()==="ProvinceOperator"?c:null,active:e===R||e===l||e===c?"true":null,children:u.jsx(i,{icon:u.jsx(ou,{size:30,color:"#244CCC"}),title:"پایش خریداران"})})]})};function cu(){const e=Au(),U=au(),{pathname:O}=S(),[P,f]=A.useState(),{slaughterGetKillerKillhouses:E}=Cu(a=>a.slaughterSlice),h=()=>O.split("/").filter(Boolean)[0]||"";return A.useEffect(()=>{e(w())},[e]),A.useEffect(()=>{const a=E==null?void 0:E.map((r,D)=>{var d,T,I,p;const X=h();return[D+1,r!=null&&r.killer?"کشتارکن":"کشتارگاه",u.jsx(t,{alignItems:"center",justifyContent:"center",children:u.jsx(C,{variant:"caption",children:r==null?void 0:r.name})},r.key),u.jsx(t,{container:!0,alignItems:"center",justifyContent:"center",children:u.jsxs(C,{variant:"caption",children:[(T=(d=r==null?void 0:r.killHouseOperator)==null?void 0:d.user)==null?void 0:T.fullname," (",(p=(I=r==null?void 0:r.killHouseOperator)==null?void 0:I.user)==null?void 0:p.mobile,")"]})},r.key),(r==null?void 0:r.uniqueIdentifier)&&u.jsx(g,{title:"مشاهده جزییات",children:u.jsx(F,{size:"small",color:"primary",onClick:()=>{U(`/${X}/poultries/${r.uniqueIdentifier}?from=KillHouse`)},children:u.jsx(_u,{fontSize:"small"})})},r.key)]});f(a)},[E,U,O]),u.jsx(t,{mt:o.SMALL,children:u.jsx(Ru,{paginated:!0,title:"خریداران",columns:["ردیف","ماهیت","نام واحد","نام و نام خانوادگی (تلفن)","مشاهده جزییات"],data:P})})}const Hu=()=>{const{pathname:e}=S();return u.jsx(u.Fragment,{children:u.jsx(H,{display:"flex",justifyContent:"center",children:u.jsxs(t,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[e===J||e===Z||e===W?u.jsxs(t,{justifyContent:"center",my:o.MEDIUM,children:[u.jsx(t,{children:u.jsx(C,{variant:"h6",children:"مدیریت خریداران"})}),u.jsx(lu,{})]}):u.jsx(tu,{}),u.jsx(t,{container:!0,justifyContent:"space-between",gap:o.SMALL,children:u.jsxs(t,{xs:12,children:[(e===uu||e===eu||e===su)&&u.jsx(ru,{}),(e===c||e===R||e===l)&&u.jsx(cu,{})]})})]})})})};export{Hu as default}; diff --git a/build/assets/Sms-DasNClAG.js b/build/assets/Sms-DasNClAG.js new file mode 100644 index 0000000..0eb9d6b --- /dev/null +++ b/build/assets/Sms-DasNClAG.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(a()),s=t;u=e.default=(0,i.default)((0,s.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M9 11H7V9h2zm4 0h-2V9h2zm4 0h-2V9h2z"}),"Sms");export{u as d}; diff --git a/build/assets/StewardInventoryPage-CK0n2VdV.js b/build/assets/StewardInventoryPage-CK0n2VdV.js new file mode 100644 index 0000000..8d140b2 --- /dev/null +++ b/build/assets/StewardInventoryPage-CK0n2VdV.js @@ -0,0 +1 @@ +import{j as u,I as $u,B as z,aJ as Z6,b1 as Q6,T as m,ak as k,aa as a6,b as F6,d as u6,ah as Ou,ai as fu,aj as Au,a3 as Bu,ag as Vu,b0 as v6,aL as J6,aM as X6,aN as u0,al as bu,c9 as e0,b2 as r0,b3 as $6,aX as a0}from"./mui-vendor-CkIVaoQP.js";import{G as d,S as J,l9 as C6,la as h6,lb as g6,lc as p6,ld as x6,A as hu,fF as o6,N as cu,X as eu,L as tu,j as uu,h as H,v as N,_ as y6,p as d6,W as vu,O as l6,ju as f6,C as t6,u as Yu,c as Du,M as I,fH as P6,k as t0,b as Wu,e8 as N6,dn as I6,dp as O6,fT as e6,le as Mu,fI as n0,jw as s0,jx as o0,dh as l0,lf as Y6}from"./index-CeyyVc1v.js";import{B as c0}from"./BackButton-Crzr7NMa.js";import{f as j6,r as n,u as d0}from"./react-vendor-CmFgShSM.js";import{u as au,f as qu,a as Su}from"./redux-vendor-B7uoacJt.js";import{V as Qu}from"./index.esm-CjWvmHks.js";import{L as Ju}from"./LinkItem-DT6qswcs.js";import{N as Xu}from"./NavLink-D2GD_ItM.js";import{R as yu}from"./ResponsiveTable-w7hk7Uq8.js";import{d as L6}from"./Info-CZK82--l.js";import{d as b6}from"./Search-Dek2fED1.js";import{d as i0}from"./Add--yVWBJhC.js";import{d as C0}from"./CheckCircle-zgBvZQ-b.js";import{d as M6}from"./Delete-C5MyLelE.js";import{c as h0,S as g0,d as p0,e as x0,f as z6,h as f0,i as A0,g as F0,b as v0,s as V6,j as y0,a as j0}from"./StewardSegmentOperation-B4ydd22p.js";import{N as r6}from"./NumberFormatCustom-DwWPj40N.js";import{R as n6,a as b0}from"./index.esm-Bu7XMDZU.js";import{a as S0,g as q6}from"./steward-get-dashboard-service-CaN_8BvO.js";import{d as w0}from"./SystemUpdateAlt-Bu3pObDi.js";import{S as _0,s as E0,M as G6}from"./SlaughterAllocateToGuild-Dfz5LRq5.js";import{d as S6}from"./Tune-D4M2CAhp.js";import{g as D0}from"./guild-allocated-stock-operation-BiIjKHlL.js";import{b as k0,c as T0,s as B0,a as W0}from"./slaughter-get-guilds-for-allocate-B6OrhhMj.js";import{g as $0}from"./getAllocationType-76F45b0K.js";import{S as L0}from"./ShowImage-CqhU2hmk.js";import{s as w6,a as _6}from"./slaughter-get-provinces-CSWL-EuK.js";import{f as A6,I as m6}from"./toBase64-BzgTOHsW.js";import{C as R0}from"./ChechClearanceCode-lPasOZZ_.js";import{L as s6}from"./LabelField-B6eRSoQP.js";import{s as P0}from"./steward-sell-out-delete-service-DtW7IkBy.js";import{d as H6}from"./Edit-CqBj1Y2L.js";import{d as N0}from"./Send-CA1iNvJP.js";import{a as I0}from"./province-policy-upload-image-CRJ-U4Kc.js";import"./iconBase-BEJYyZsk.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./EditOutlined-n5ie2Fmu.js";import"./DeleteOutlineOutlined-G071NcE9.js";import"./Download-DQ-VVIaV.js";import"./Close-_jAEIgMD.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./Pageview-TRcW_9jm.js";import"./AddCircleOutline-C8LXM-k8.js";const O0=()=>{const{pathname:r}=j6();return u.jsxs(d,{container:!0,gap:J.SMALL,p:J.SMALL,direction:{xs:"row",md:"row"},justifyContent:"center",xs:12,alignItems:"center",children:[u.jsx(Xu,{to:C6,active:r===C6?"true":null,children:u.jsx(Ju,{icon:u.jsx(Qu,{size:30,color:"#244CCC"}),title:"ورود به انبار"})}),u.jsx(Xu,{to:h6,active:r===h6?"true":null,children:u.jsx(Ju,{icon:u.jsx(Qu,{size:30,color:"#244CCC"}),title:"فروش داخل استان"})}),u.jsx(Xu,{to:g6,active:r===g6?"true":null,children:u.jsx(Ju,{icon:u.jsx(Qu,{size:30,color:"#244CCC"}),title:"خرید خارج استان"})}),u.jsx(Xu,{to:p6,active:r===p6?"true":null,children:u.jsx(Ju,{icon:u.jsx(Qu,{size:30,color:"#244CCC"}),title:"فروش به خارج استان"})}),u.jsx(Xu,{to:x6,active:r===x6?"true":null,children:u.jsx(Ju,{icon:u.jsx(Qu,{size:30,color:"#244CCC"}),title:"قطعه بندی"})})]})},Y0=()=>{var f,j,i,su,w;const[r,a]=n.useState(),[t,v]=n.useState(),[p,c]=n.useState([]),[D,S]=n.useState(!1),[l,C]=n.useState([]),[A,T]=n.useState([]),[g,o]=n.useState([]),[h,x]=n.useState(""),[W,R]=n.useState([]),[Y]=n.useContext(hu),$=n.useRef([]),E=n.useRef([]),q=au(),[B,U]=n.useState({active:!1,killHousePrice:0,stewardPrice:0,guildPrice:0}),M=()=>{const F=eu();return F==="KillHouse"?B.killHousePrice:F==="Steward"?B.stewardPrice:F==="Guilds"?B.guildPrice:0};n.useEffect(()=>{$.current=$.current.slice(0,(A==null?void 0:A.length)||0),E.current=E.current.slice(0,(A==null?void 0:A.length)||0)},[A]),n.useEffect(()=>{if(h){const F=g.filter(e=>e.some(s=>String(s).toLowerCase().includes(h.toLowerCase())));R(F)}else R(g)},[h,g]);const X=(F,e,s)=>{var L,Z;if(F.key==="Enter"){if(F.preventDefault(),s==="price"){const V=[...p];V[e]=Number(F.target.value.replace(/,/g,"")),c(V),E.current[e]&&E.current[e].focus()}else if(s==="weight"){const V=[...l];if(V[e]=Number(F.target.value.replace(/,/g,"")),C(V),B!=null&&B.active){let Q=e+1;for(;Q=A.length&&E.current[0]&&((L=E.current[0])==null||L.focus())}else{let Q=e+1;for(;Q=A.length&&$.current[0]&&((Z=$.current[0])==null||Z.focus())}}}},ou=async()=>{q(p0({role:eu()})).then(F=>{U(F.payload.data)})},nu=async F=>{q(tu());try{const e=await uu.get(`commonly-used/?search=filter&value=&role=${eu()}&page=1&page_size=10000`);S(!0),T(e.data.results||[])}catch(e){console.error(e)}finally{q(H())}};n.useEffect(()=>{const F=A==null?void 0:A.map((e,s)=>{var Z,V,Q,G,gu,du,Fu,ru;const L=parseInt(B!=null&&B.active?M():p[s])*parseInt(l[s]);return[s+1,(Z=e==null?void 0:e.guild)!=null&&Z.steward?"مباشر":"صنف",`${(V=e==null?void 0:e.guild)==null?void 0:V.guildsName}/${(G=(Q=e==null?void 0:e.guild)==null?void 0:Q.user)==null?void 0:G.fullname}/${(du=(gu=e==null?void 0:e.guild)==null?void 0:gu.user)==null?void 0:du.city}/${(ru=(Fu=e==null?void 0:e.guild)==null?void 0:Fu.user)==null?void 0:ru.mobile}`,e!=null&&e.exclusive?"اختصاصی":"آزاد",u.jsx(r6,{allowLeadingZeros:!0,thousandSeparator:",",size:"small",label:"قیمت",disabled:B==null?void 0:B.active,value:B!=null&&B.active?M():p[s]||"",onKeyDown:iu=>X(iu,s,"price"),inputRef:iu=>$.current[s]=iu,variant:"outlined",style:{width:100}},`price-${s}`),u.jsx(r6,{allowLeadingZeros:!0,thousandSeparator:",",size:"small",label:"وزن",value:l[s]||"",onKeyDown:iu=>{X(iu,s,"weight")},inputRef:iu=>E.current[s]=iu,variant:"outlined",style:{width:100}},`weight-${s}`),isNaN(L)?"وارد نشده! ":(L==null?void 0:L.toLocaleString())+" ریال",u.jsx($u,{color:"error",children:u.jsx(M6,{onClick:()=>lu(e.key)})},s)]});o(F),R(F)},[A,p,l,B]),n.useEffect(()=>{nu(),ou(),q(o6()).then(F=>{v(F.payload.data)})},[]),n.useEffect(()=>{const F=t==null?void 0:t.map((e,s)=>{var L;return[e==null?void 0:e.name,(L=e==null?void 0:e.totalRemainWeight)==null?void 0:L.toLocaleString()]});a(F)},[t]);const lu=F=>{q(h0(F)).then(e=>{e.payload.error?Y({vertical:"top",horizontal:"center",msg:e.payload.error,severity:"error"}):(Y({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),nu())})},P=()=>{const e=(A==null?void 0:A.map((s,L)=>{var Q,G,gu,du,Fu,ru;const Z=B!=null&&B.active?M():p[L];let V={seller_type:"Steward",buyer_type:(Q=s==null?void 0:s.guild)!=null&&Q.steward?"Steward":"Guild",guild_key:(G=s==null?void 0:s.guild)!=null&&G.steward?null:(gu=s==null?void 0:s.guild)==null?void 0:gu.key,steward_key:(du=s==null?void 0:s.guild)!=null&&du.steward?(Fu=s==null?void 0:s.guild)==null?void 0:Fu.key:null,product_key:(ru=t[0])==null?void 0:ru.key,type:"manual",allocation_type:s!=null&&s.steward?"steward_steward":"steward_guild",number_of_carcasses:0,weight_of_carcasses:l[L]||null,sell_type:"free",amount:Z||null,total_amount:Z*l[L],approved_price_status:B==null?void 0:B.active,date:N(new Date).format("YYYY-MM-DD")};return V=Object.fromEntries(Object.entries(V).filter(([iu,_u])=>_u!==null)),V})).filter(s=>s.total_amount>1&&(s==null?void 0:s.amount)&&(s==null?void 0:s.weight_of_carcasses));q(x0(e)).then(s=>{s.payload.error?Y({vertical:"top",horizontal:"center",msg:s.payload.error,severity:"error"}):(Y({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),c([]),C([]),nu(),ou(),q(o6()).then(L=>{v(L.payload.data)}))})};return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsx(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsx(yu,{noPagination:!0,title:"موجودی انبار",columns:["محصول","مانده انبار (کیلوگرم)"],data:r,customColors:[{name:"محصول",color:"red"}]})}),u.jsxs(d,{xs:12,container:!0,spacing:2,mt:2,alignItems:"center",justifyContent:"space-between",children:[u.jsx(d,{item:!0,xs:12,md:"auto",children:u.jsx(z,{variant:"contained",startIcon:u.jsx(i0,{}),sx:{borderRadius:3,px:3},onClick:()=>{q(cu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(g0,{updateTable:nu}),title:"افزودن"}))},children:"افزودن مباشر/صنف"})}),u.jsx(d,{item:!0,xs:12,md:!0,children:u.jsx(Z6,{variant:"outlined",sx:{borderRadius:3,boxShadow:1},children:u.jsx(Q6,{children:u.jsxs(d,{container:!0,spacing:2,alignItems:"center",justifyContent:"space-between",children:[u.jsxs(d,{item:!0,children:[u.jsx(m,{variant:"subtitle2",children:"مجموع وزن وارد شده"}),u.jsx(m,{variant:"body1",color:"text.secondary",children:l!=null&&l.length?l.reduce((F,e)=>F+e,0).toLocaleString():"۰"})]}),u.jsxs(d,{item:!0,children:[u.jsx(m,{variant:"subtitle2",children:"وزن باقیمانده"}),u.jsx(m,{variant:"body1",color:l!=null&&l.length&&t&&(l==null?void 0:l.reduce((F,e)=>F+e,0))>((f=t[0])==null?void 0:f.totalRemainWeight)?"error":"text.secondary",children:((j=t==null?void 0:t[0])==null?void 0:j.totalRemainWeight)!==void 0?l!=null&&l.length?(((i=t[0])==null?void 0:i.totalRemainWeight)-l.reduce((F,e)=>F+e,0)).toLocaleString():(su=t[0])==null?void 0:su.totalRemainWeight.toLocaleString():"۰"})]}),u.jsx(d,{item:!0,children:u.jsx(z,{variant:"contained",color:"success",startIcon:u.jsx(C0,{}),sx:{borderRadius:3,px:3},onClick:P,disabled:l.length?l.reduce((F,e)=>F+e,0)>((w=t[0])==null?void 0:w.totalRemainWeight):!0,children:"ثبت"})})]})})})})]}),u.jsxs(d,{container:!0,xs:12,mt:2,gap:1,sx:{userSelect:"none"},children:[u.jsx(L6,{color:"error"}),u.jsx(m,{variant:"body1",color:"error",children:"پس از وارد کردن هر مقدار، کلید Enter را فشار دهید!"})]}),u.jsxs(d,{container:!0,xs:12,mt:2,gap:1,sx:{userSelect:"none"},children:[u.jsx(L6,{color:"primary"}),u.jsx(m,{variant:"body1",color:"primary",children:"صرفا تخصیصاتی که هر دو مقدار قیمت و وزن آنها را وارد کنید ثبت خواهند شد."})]}),u.jsx(d,{container:!0,xs:12,mt:2,children:u.jsx(k,{fullWidth:!0,variant:"outlined",placeholder:"جستجو...",value:h,onChange:F=>x(F.target.value),InputProps:{startAdornment:u.jsx(a6,{position:"start",children:u.jsx(b6,{})})},sx:{mb:2}})}),W!=null&&W.length?u.jsx(d,{container:!0,xs:12,gap:1,mt:2,mb:2,children:W==null?void 0:W.map((F,e)=>u.jsxs(d,{container:!0,xs:12,sx:{p:2,pl:5,borderRadius:2,backgroundColor:e%2===0?"#fef6f0":"#ffffff",boxShadow:"0 2px 6px rgba(0,0,0,0.05)",position:"relative",flexDirection:"row",gap:2,alignItems:"center"},children:[u.jsx(F6,{sx:{position:"absolute",top:12,left:12,backgroundColor:"#fb8c00",width:28,height:28,borderRadius:"50%",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.8rem",fontWeight:700,boxShadow:"0 1px 4px rgba(0,0,0,0.2)"},children:F[0]}),u.jsxs(d,{item:!0,sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(m,{variant:"caption",color:"text.secondary",sx:{minWidth:64},children:"ماهیت:"}),u.jsx(m,{variant:"body2",fontSize:"0.8rem",children:F[1]})]}),u.jsxs(d,{item:!0,sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(m,{variant:"caption",color:"text.secondary",sx:{minWidth:64},children:"خریدار:"}),u.jsx(m,{variant:"body2",fontSize:"0.8rem",children:F[2]})]}),u.jsxs(d,{item:!0,sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(m,{variant:"caption",color:"text.secondary",sx:{minWidth:64},children:"نوع فروش:"}),u.jsx(m,{variant:"body2",fontSize:"0.8rem",children:F[3]})]}),u.jsxs(d,{item:!0,sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(m,{variant:"caption",color:"text.secondary",children:"قیمت هرکیلو:"}),u.jsx(m,{variant:"body2",fontSize:"0.8rem",children:F[4]})]}),u.jsxs(d,{item:!0,sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(m,{variant:"caption",color:"text.secondary",children:"وزن لاشه:"}),u.jsx(m,{variant:"body2",fontSize:"0.8rem",children:F[5]})]}),u.jsxs(d,{item:!0,sx:{display:"flex",alignItems:"center",gap:.5},children:[u.jsx(m,{variant:"caption",color:"text.secondary",sx:{minWidth:64},children:"قیمت کل:"}),u.jsx(m,{variant:"body2",fontSize:"0.8rem",children:F[6]})]}),u.jsx(d,{item:!0,sx:{display:"flex",alignItems:"center",gap:.5},children:F[7]}),u.jsx(d,{item:!0,children:!(B!=null&&B.active)&&(!p[e]||!l[e])&&(p[e]||l[e])&&u.jsx(m,{variant:"caption",color:"error",children:"لطفا همه موارد را وارد کنید و کلید Enter را بزنید"})})]},e))}):u.jsx(m,{mt:4,children:D?"موردی یافت نشد!":h?"نتیجه‌ای یافت نشد":"در حال بارگزاری..."})]})},M0=()=>{var lu,P,f;const[r,a]=n.useState([]),[t,v]=n.useState([]),[p,c]=n.useState([]),[D,S]=n.useState(0),[l,C]=n.useState(10),[A,T]=n.useState(""),[g,o]=n.useState(1),[h,x]=n.useState([]),[,,W,R,Y,$]=n.useContext(hu),E=au(),q=()=>{E(S0({value:A,date1:W,date2:Y})).then(j=>{x(j.payload.data)})};n.useEffect(()=>{const j=N(new Date).format("YYYY-MM-DD");R(j),$(j)},[]);const B=async j=>{E(tu());const i=await uu.get(`app-segmentation/?search=filter&value=${A}&date1=${W}&date2=${Y}&page=${j}&page_size=${l}&role=${eu()}`);q(),E(H()),a(i.data.results),S(i.data.count)};n.useEffect(()=>{B(1)},[W,Y,l]);const U=j=>{B(j),o(j)},M=()=>{B(g)},X=j=>{C(j),o(1)},ou=j=>{T(j.target.value)};n.useEffect(()=>{B(1),E(z6()).then(j=>{v(j.payload.data)})},[]),n.useEffect(()=>{const j=r==null?void 0:r.map((i,su)=>{var w,F,e,s,L,Z,V;return[g===1?su+1:su+l*(g-1)+1,i!=null&&i.toGuild?"قطعه بند":"مباشر",`${(w=i==null?void 0:i.buyer)==null?void 0:w.fullname}(${(F=i==null?void 0:i.buyer)==null?void 0:F.mobile})`,i!=null&&i.toGuild?`${(s=(e=i==null?void 0:i.toGuild)==null?void 0:e.user)==null?void 0:s.fullname}(${(Z=(L=i==null?void 0:i.toGuild)==null?void 0:L.user)==null?void 0:Z.mobile})`:"-",i!=null&&i.date?y6(i==null?void 0:i.date):"-",i!=null&&i.productionDate?d6(i==null?void 0:i.productionDate):"-",(i==null?void 0:i.distributionType)==="web"?"سایت":(i==null?void 0:i.distributionType)==="app"?"موبایل":(i==null?void 0:i.distributionType)==="pos"?"پوز":(i==null?void 0:i.distributionType)||"-",i==null?void 0:i.weight,(i==null?void 0:i.quota)==="governmental"?"دولتی":(i==null?void 0:i.quota)==="free"?"آزاد":"-",(i==null?void 0:i.saleType)==="governmental"?"دولتی":(i==null?void 0:i.saleType)==="free"?"آزاد":"-",u.jsx(f0,{item:i,productKey:(V=t==null?void 0:t[0])==null?void 0:V.key,updateTable:M},su)]});c(j)},[r]),n.useEffect(()=>{B(1)},[W,Y,l]);const nu=async j=>{j.preventDefault(),E(tu());try{const i=await uu.get(`app-segmentation/?search=filter&value=${A}&date1=${W}&date2=${Y}&page=${g}&role=${eu()}`);a(i.data.results),S(i.data.count),q(),E(H())}catch(i){console.error("Error fetching data:",i)}};return u.jsx(d,{container:!0,direction:"column",flexWrap:"nowrap",mt:J.SMALL,children:u.jsxs(d,{xs:12,container:!0,alignItems:"center",gap:J.SMALL,justifyContent:"flex-start",children:[u.jsx(d,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(yu,{noPagination:!0,isDashboard:!0,columns:["وزن کل (کیلوگرم)","وزن قطعه بندی","وزن تخصیصی به قطعه بندها"],data:[[((lu=h==null?void 0:h.totalWeight)==null?void 0:lu.toLocaleString())||"0",((P=h==null?void 0:h.totalSelfWeight)==null?void 0:P.toLocaleString())||"0",((f=h==null?void 0:h.totalOtherWeight)==null?void 0:f.toLocaleString())||"0"]],title:"خلاصه اطلاعات"})}),u.jsx("form",{children:u.jsxs(d,{container:!0,alignItems:"center",gap:J.SMALL,children:[u.jsx(z,{variant:"contained",onClick:()=>{var j;E(cu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت ",width:{xs:"100%",sm:"360px"},content:u.jsx(A0,{updateTable:M,productKey:(j=t==null?void 0:t[0])==null?void 0:j.key})}))},children:"ثبت قطعه بندی"}),u.jsx(k,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:ou}),u.jsx(z,{type:"submit",onClick:nu,endIcon:u.jsx(n6,{}),children:"جستجو"}),u.jsx(d,{children:u.jsx(vu,{label:"از تاریخ",id:"date",renderInput:j=>u.jsx(k,{style:{width:"160px"},...j}),value:W,onChange:j=>R(N(j).format("YYYY-MM-DD"))})}),u.jsx(d,{children:u.jsx(vu,{label:"تا تاریخ",id:"date",renderInput:j=>u.jsx(k,{style:{width:"160px"},...j}),value:Y,onChange:j=>$(N(j).format("YYYY-MM-DD"))})})]})}),u.jsx(yu,{data:p,columns:["ردیف","ماهیت","مباشر","تخصیص به قطعه بند","تاریخ ","تاریخ تولید گوشت","ثبت شده","وزن (کیلوگرم)","سهمیه","نوع فروش","عملیات"],handlePageChange:U,totalRows:D,page:g,perPage:l,handlePerRowsChange:X,title:"قطعه بندی"})]})})},i6=()=>{const{distributionInfo:r,stewardProducts:a}=qu(l=>l.stewardSlice),[t,v]=n.useState(),{pathname:p}=j6(),c=au(),D=l=>{var C,A,T,g;return eu()==="KillHouse"?[(C=l==null?void 0:l.totalGovernmentalCarcassesWeight)==null?void 0:C.toLocaleString(),(A=l==null?void 0:l.provinceFreeCarcassesWeight)==null?void 0:A.toLocaleString()]:[(T=l==null?void 0:l.receiveGovernmentalCarcassesWeight)==null?void 0:T.toLocaleString(),(g=l==null?void 0:l.receiveFreeCarcassesWeight)==null?void 0:g.toLocaleString()]};n.useEffect(()=>{const l=a==null?void 0:a.map((C,A)=>{var T,g,o,h,x,W,R,Y;return[A+1,C==null?void 0:C.name,...D(C),(T=C==null?void 0:C.freeBuyingCarcassesWeight)==null?void 0:T.toLocaleString(),(g=C==null?void 0:C.totalCarcassesWeight)==null?void 0:g.toLocaleString(),(o=C==null?void 0:C.realAllocatedWeight)==null?void 0:o.toLocaleString(),(h=C==null?void 0:C.totalRemainWeight)==null?void 0:h.toLocaleString(),(x=r==null?void 0:r.totalGovernmentalRemainWeight)==null?void 0:x.toLocaleString(),(W=r==null?void 0:r.totalFreeRemainWeight)==null?void 0:W.toLocaleString(),(R=r==null?void 0:r.totalGovernmentalInputWeight)==null?void 0:R.toLocaleString(),(Y=r==null?void 0:r.totalFreeInputWeight)==null?void 0:Y.toLocaleString()]});v(l)},[a,r]);const S=()=>p===f6?[]:["مانده دولتی (کیلوگرم)"," مانده آزاد (کیلوگرم)","وزن دولتی (کیلوگرم)","وزن آزاد (کیلوگرم)"];return u.jsx(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsx(yu,{noPagination:(t==null?void 0:t.length)===1,paginated:!(t!=null&&t.length)===1,operation:u.jsx(d,{container:!0,children:eu()==="KillHouse"&&u.jsx(u6,{title:"خروجی اکسل",placement:"top",children:u.jsx($u,{color:"primary",onClick:()=>{c(l6({title:"دریافت خروجی اکسل",content:u.jsx(z0,{})}))},children:u.jsx(w0,{})})})}),title:"موجودی انبار",columns:["ردیف","نام محصول","وزن خریدهای دولتی داخل استان (کیلوگرم)","وزن خریدهای آزاد داخل استان (کیلوگرم)","وزن خریدهای خارج استان (کیلوگرم)","کل ورودی به انبار (کیلوگرم)","کل فروش (کیلوگرم)","مانده انبار (کیلوگرم)",...S()],data:t,customColors:[{name:"ردیف",color:"red"},{name:"نام محصول",color:"red"},{name:"کل ورودی به انبار (کیلوگرم)",color:"red"},{name:"وزن خریدهای دولتی داخل استان (کیلوگرم)",color:"red"},{name:"وزن خریدهای آزاد داخل استان (کیلوگرم)",color:"red"},{name:"وزن خریدهای خارج استان (کیلوگرم)",color:"red"},{name:"کل فروش (کیلوگرم)",color:"red"},{name:"مانده انبار (کیلوگرم)",color:"green"}]})})},z0=()=>{const[r,a]=n.useState("withdate"),t=A=>{a(A.target.value)},v=qu(A=>A.userSlice.userProfile.key),[p,c]=n.useState(N(new Date).format("YYYY-MM-DD")),[D,S]=n.useState(N(new Date).format("YYYY-MM-DD")),l=au(),[C]=n.useContext(hu);return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(Ou,{row:!0,"aria-labelledby":"radio-group-label",name:"radio-buttons-group",value:r,onChange:t,children:[u.jsx(fu,{value:"withdate",control:u.jsx(Au,{}),label:"دانلود بر اساس بازه"}),u.jsx(fu,{value:"nodate",control:u.jsx(Au,{}),label:"دانلود کلی"})]}),r==="withdate"&&u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(d,{children:u.jsx(vu,{label:"از تاریخ",id:"date",renderInput:A=>u.jsx(k,{style:{width:"160px"},...A}),value:p,onChange:A=>{c(N(A).format("YYYY-MM-DD"))}})}),u.jsx(d,{children:u.jsx(vu,{label:"تا تاریخ",id:"date",renderInput:A=>u.jsx(k,{style:{width:"160px"},...A}),value:D,onChange:A=>{S(N(A).format("YYYY-MM-DD"))}})})]}),u.jsx(z,{fullWidth:!0,variant:"contained",onClick:()=>{l(t6()),C({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const A=`${uu.defaults.baseURL}kill_house_inventory_data/?role=${eu()}&key=${v}${r==="withdate"?`&date1=${p}&date2=${D}`:""}`;window.location.href=A},children:"دانلود فایل اکسل"})]})},V0=Su("STEWARD_GET_BARS_INFO",async(r,{dispatch:a})=>{a(tu());const{data:t,status:v}=await uu.get("bars_for_kill_house_dashboard/",{params:{role:eu()}});return a(H()),{data:t,status:v}}),q0=({item:r,handleUpdate:a,updateTable:t})=>{const[v]=n.useContext(hu),p=au(),c=Yu({initialValues:{decision:"approve",weight:r==null?void 0:r.realWeightOfCarcasses,volume:r==null?void 0:r.realNumberOfCarcasses,weightLoss:r==null?void 0:r.weightLossOfCarcasses,regCode:"",regState:"with_code"},validationSchema:Du({decision:I().required("انتخاب گزینه الزامی است"),regState:I(),weight:I().when("decision",{is:"approve",then:I().required("وزن الزامی است")}),volume:I().when("decision",{is:"approve",then:I().required("حجم الزامی است")}),weightLoss:I().when("decision",{is:"approve",then:I().required("افت وزن الزامی است")}),regCode:I().matches(/^\d{5}$/,"کد باید یک عدد پنج رقمی باشد").typeError("یک عدد پنج رقمی وارد کنید!").when(["regState","decision"],{is:(S,l)=>S==="with_code"&&l==="approve",then:I().required("کد احراز الزامی است")})}),onSubmit:S=>{const l={check_allocation:!0,allocation_key:r==null?void 0:r.key},C=S.decision==="reject"?{...l,state:"rejected"}:{...l,state:"accepted",...S.regState==="with_code"&&{registration_code:parseInt(S.regCode)},receiver_real_number_of_carcasses:parseInt(S.volume),receiver_real_weight_of_carcasses:parseInt(S.weight),weight_loss_of_carcasses:parseInt(S.weightLoss)};p(D0(C)).then(A=>{A.payload.error?v({vertical:"top",horizontal:"center",msg:A.payload.error,severity:"error"}):(v({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),p(t6()),a(),t&&t())})}}),D=S=>{c.setFieldValue("decision",S.target.value)};return u.jsxs(Bu,{container:!0,spacing:2,justifyContent:"center",alignItems:"center",children:[u.jsxs(Bu,{item:!0,xs:12,children:[u.jsx(Vu,{component:"fieldset",children:u.jsxs(Ou,{fullWidth:!0,row:!0,name:"decision",value:c.values.decision,onChange:D,children:[u.jsx(fu,{value:"approve",control:u.jsx(Au,{}),label:"تایید"}),u.jsx(fu,{value:"reject",control:u.jsx(Au,{}),label:"رد"})]})}),c.touched.decision&&c.errors.decision&&u.jsx("div",{style:{color:"red",fontSize:12},children:c.errors.decision})]}),c.values.decision==="approve"&&u.jsxs(u.Fragment,{children:[u.jsx(Bu,{item:!0,xs:12,children:u.jsx(k,{fullWidth:!0,name:"weight",label:"وزن",value:c.values.weight,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.weight&&!!c.errors.weight,helperText:c.touched.weight&&c.errors.weight})}),u.jsx(Bu,{item:!0,xs:12,children:u.jsx(k,{fullWidth:!0,name:"volume",label:"حجم",value:c.values.volume,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.volume&&!!c.errors.volume,helperText:c.touched.volume&&c.errors.volume})}),u.jsx(Bu,{item:!0,xs:12,children:u.jsx(k,{fullWidth:!0,name:"weightLoss",label:"افت وزن (کیلوگرم)",value:c.values.weightLoss,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.weightLoss&&!!c.errors.weightLoss,helperText:c.touched.weightLoss&&c.errors.weightLoss})}),u.jsxs(Bu,{item:!0,xs:12,children:[u.jsx(Vu,{component:"fieldset",children:u.jsxs(Ou,{fullWidth:!0,row:!0,name:"regState",value:c.values.regState,onChange:S=>{c.setFieldValue("regState",S.target.value)},children:[u.jsx(fu,{value:"with_code",control:u.jsx(Au,{}),label:"با کد احراز"}),u.jsx(fu,{value:"without_code",control:u.jsx(Au,{}),label:"بدون کد احراز"})]})}),c.touched.regState&&c.errors.regState&&u.jsx("div",{style:{color:"red",fontSize:12},children:c.errors.regState})]}),c.values.regState==="with_code"&&u.jsx(Bu,{item:!0,xs:12,children:u.jsx(k,{fullWidth:!0,name:"regCode",label:"کد احراز",value:c.values.regCode,onChange:c.handleChange,onBlur:c.handleBlur,error:c.touched.regCode&&!!c.errors.regCode,helperText:c.touched.regCode&&c.errors.regCode})})]}),u.jsx(Bu,{item:!0,xs:12,children:u.jsx(z,{onClick:c.handleSubmit,type:"submit",variant:"contained",color:c.values.decision==="approve"?"primary":"error",fullWidth:!0,children:"ثبت"})})]})},G0=({item:r,type:a,handleUpdate:t,priceInfo:v,remainWeight:p,updateTable:c})=>{const D=au(),[S,l]=n.useState(!1),[C,A]=n.useState(null),T=h=>{l(!0),A(h.currentTarget)},g=()=>{l(!1),A(null)},o=()=>{g(),D(l6({title:"ویرایش توزیع و فروش محصول",content:u.jsx(_0,{updateTable:t,fetchApiData:c,sellerType:"KillHouse",sellType:"exclusive",priceInfo:v,remainWeight:p,editData:r,item:r})}))};return u.jsxs(d,{children:[u.jsx($u,{variant:"contained",color:"primary",onClick:T,disabled:!a&&(r==null?void 0:r.registrationCode),children:u.jsx(S6,{})}),u.jsx(v6,{open:S,anchorEl:C,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsx("div",{style:{padding:10},children:u.jsxs(d,{container:!0,direction:"column",alignItems:"center",justifyContent:"center",gap:1,children:[a&&u.jsx(z,{size:"small",color:"primary",variant:"outlined",onClick:()=>{g(),D(l6({title:"ویرایش اطلاعات بار",content:u.jsx(q0,{updateTable:c,handleUpdate:t,item:r})}))},children:"تایید / رد"}),!a&&u.jsx(z,{size:"small",color:"primary",variant:"outlined",onClick:o,children:"ویرایش"}),!a&&u.jsx(z,{size:"small",disabled:r==null?void 0:r.registrationCode,variant:"outlined",color:"error",onClick:()=>{g(),D(k0({steward_allocation_key:r.key})).then(h=>{D(P6()),c(1),t()})},children:"حذف"})]})})})]})},c6=n.forwardRef(({type:r,handleUpdate:a,priceInfo:t,remainWeight:v},p)=>{const c=au(),[,,D,S,l,C]=n.useContext(hu);n.useEffect(()=>{const e=N(new Date).format("YYYY-MM-DD");S(e),C(e)},[]);const A=e=>{Y(e.target.value)},[T,g]=n.useState([]),[o,h]=n.useState(0),[x,W]=n.useState(10),[R,Y]=n.useState(""),[$,E]=n.useState(1),[q,B]=n.useState([]),[U]=n.useContext(hu),M=async(e=1)=>{try{c(tu());const s=await uu.get(`steward-allocation/?role=${eu()}&search=filter&value=${R}${r!=="not_entered"?`&date1=${D}&date2=${l}`:""}&page=${e}&page_size=${x}${r?"&type="+r:""}`);c(H()),g(s.data.results||[]),h(s.data.count||0)}catch(s){c(H()),console.error("Error fetching allocations:",s)}},X=()=>{M(1)};n.useImperativeHandle(p,()=>({updateTable:X}));const ou=e=>{M(e),E(e)},nu=e=>{var L,Z,V,Q,G,gu,du,Fu,ru,iu,_u,Lu,Ru,Pu,ku,wu,Eu,O,Tu,Nu,Iu,b,Gu,mu,zu,Hu,y,_,K,Cu,ju,pu,xu,Uu,Ku,Zu,E6,D6,k6,T6,B6,W6;let s=`${(L=e==null?void 0:e.toKillHouse)==null?void 0:L.name} - ${(Q=(V=(Z=e==null?void 0:e.toKillHouse)==null?void 0:Z.killHouseOperator)==null?void 0:V.user)==null?void 0:Q.fullname} (${(du=(gu=(G=e==null?void 0:e.toKillHouse)==null?void 0:G.killHouseOperator)==null?void 0:gu.user)==null?void 0:du.mobile})`;switch(e==null?void 0:e.allocationType){case"steward_killhouse":s=`${(Fu=e==null?void 0:e.toKillHouse)==null?void 0:Fu.name} - ${(_u=(iu=(ru=e==null?void 0:e.toKillHouse)==null?void 0:ru.killHouseOperator)==null?void 0:iu.user)==null?void 0:_u.fullname} (${(Pu=(Ru=(Lu=e==null?void 0:e.toKillHouse)==null?void 0:Lu.killHouseOperator)==null?void 0:Ru.user)==null?void 0:Pu.mobile})`;break;case"steward_steward":s=`${(ku=e==null?void 0:e.toSteward)==null?void 0:ku.guildsName} - ${(Eu=(wu=e==null?void 0:e.toSteward)==null?void 0:wu.user)==null?void 0:Eu.fullname} (${(Tu=(O=e==null?void 0:e.toSteward)==null?void 0:O.user)==null?void 0:Tu.mobile})`;break;case"steward_guild":s=`${(Nu=e==null?void 0:e.toGuilds)==null?void 0:Nu.guildsName} - ${(b=(Iu=e==null?void 0:e.toGuilds)==null?void 0:Iu.user)==null?void 0:b.fullname} (${(mu=(Gu=e==null?void 0:e.toGuilds)==null?void 0:Gu.user)==null?void 0:mu.mobile})`;break;case"ColdHouse":s=`${(zu=e==null?void 0:e.toColdHouse)==null?void 0:zu.name}`;break;case"killhouse_steward":s=`${((Hu=e==null?void 0:e.toSteward)==null?void 0:Hu.guildsName)||"-"} - ${((_=(y=e==null?void 0:e.toSteward)==null?void 0:y.user)==null?void 0:_.fullname)||"-"} (${((Cu=(K=e==null?void 0:e.toSteward)==null?void 0:K.user)==null?void 0:Cu.mobile)||"-"})`;break;case"killhouse_guild":s=`${((ju=e==null?void 0:e.toGuilds)==null?void 0:ju.guildsName)||"-"} - ${((xu=(pu=e==null?void 0:e.toGuilds)==null?void 0:pu.user)==null?void 0:xu.fullname)||"-"} (${((Ku=(Uu=e==null?void 0:e.toGuilds)==null?void 0:Uu.user)==null?void 0:Ku.mobile)||"-"})`;break;default:s=`${(Zu=e==null?void 0:e.toKillHouse)==null?void 0:Zu.name} - ${(k6=(D6=(E6=e==null?void 0:e.toKillHouse)==null?void 0:E6.killHouseOperator)==null?void 0:D6.user)==null?void 0:k6.fullname} (${(W6=(B6=(T6=e==null?void 0:e.toKillHouse)==null?void 0:T6.killHouseOperator)==null?void 0:B6.user)==null?void 0:W6.mobile})`;break}return s},lu=e=>{var L,Z,V,Q,G,gu,du,Fu,ru,iu,_u,Lu,Ru,Pu,ku,wu,Eu,O,Tu,Nu,Iu,b;let s="";switch(console.log(e==null?void 0:e.allocationType),e==null?void 0:e.allocationType){case"steward_guild":case"steward_steward":s=`${e!=null&&e.steward?(Z=(L=e==null?void 0:e.steward)==null?void 0:L.user)==null?void 0:Z.fullname:"-"} (${(Q=(V=e==null?void 0:e.steward)==null?void 0:V.user)==null?void 0:Q.mobile})`;break;case"killhouse_steward":s=`${e!=null&&e.killHouse?(G=e==null?void 0:e.killHouse)==null?void 0:G.name:"-"} (${(Fu=(du=(gu=e==null?void 0:e.killHouse)==null?void 0:gu.killHouseOperator)==null?void 0:du.user)==null?void 0:Fu.fullname} - ${(_u=(iu=(ru=e==null?void 0:e.killHouse)==null?void 0:ru.killHouseOperator)==null?void 0:iu.user)==null?void 0:_u.mobile})`;break;case"killhouse_guild":s=`${e!=null&&e.killHouse?(Lu=e==null?void 0:e.killHouse)==null?void 0:Lu.name:"-"} (${(ku=(Pu=(Ru=e==null?void 0:e.killHouse)==null?void 0:Ru.killHouseOperator)==null?void 0:Pu.user)==null?void 0:ku.fullname} - ${(O=(Eu=(wu=e==null?void 0:e.killHouse)==null?void 0:wu.killHouseOperator)==null?void 0:Eu.user)==null?void 0:O.mobile})`;break;default:s=`${e!=null&&e.steward?(Nu=(Tu=e==null?void 0:e.steward)==null?void 0:Tu.user)==null?void 0:Nu.fullname:"-"} (${(b=(Iu=e==null?void 0:e.steward)==null?void 0:Iu.user)==null?void 0:b.mobile})`;break}return s},P=e=>{W(e),E(1)},f=()=>!r||r==="not_entered"?["عملیات"]:[],j=e=>r==="not_entered"?[]:[e!=null&&e.loggedRegistrationCode?e.loggedRegistrationCode:"-",e!=null&&e.registrationCode?"ارسال شده":"ارسال نشده"],i=()=>r==="not_entered"?[]:["کداحراز","وضعیت کد احراز"],su=e=>{var s,L,Z;return r?r==="not_entered"?[]:[(L=e==null?void 0:e.receiverRealNumberOfCarcasses)==null?void 0:L.toLocaleString(),(Z=e==null?void 0:e.receiverRealWeightOfCarcasses)==null?void 0:Z.toLocaleString()]:[(s=e==null?void 0:e.receiverRealWeightOfCarcasses)==null?void 0:s.toLocaleString()]},w=()=>r?r==="not_entered"?[]:["حجم تایید شده","وزن تایید شده"]:["وزن تایید شده"];n.useEffect(()=>{const e=T==null?void 0:T.map((s,L)=>{var Z,V,Q,G;return[$===1?L+1:L+x*($-1)+1,s!=null&&s.date?y6(s==null?void 0:s.date):"-",s!=null&&s.productionDate?d6(s==null?void 0:s.productionDate):"-",(s==null?void 0:s.distributionType)==="web"?"سایت":(s==null?void 0:s.distributionType)==="app"?"موبایل":(s==null?void 0:s.distributionType)==="pos"?"پوز":(s==null?void 0:s.distributionType)||"-",$0(s),nu(s),lu(s),(s==null?void 0:s.sellType)==="exclusive"?"اختصاصی":"آزاد",((Z=s==null?void 0:s.amount)==null?void 0:Z.toLocaleString())+" ریال",((V=s==null?void 0:s.totalAmount)==null?void 0:V.toLocaleString())+" ریال",(Q=s==null?void 0:s.realWeightOfCarcasses)==null?void 0:Q.toLocaleString(),...su(s),...j(s),(G=s==null?void 0:s.weightLossOfCarcasses)==null?void 0:G.toLocaleString(),(s==null?void 0:s.quota)==="governmental"?"دولتی":(s==null?void 0:s.quota)==="free"?"آزاد":"-",s!=null&&s.approvedPriceStatus?"دولتی":"آزاد",(s==null?void 0:s.receiverState)==="accepted"?"تایید شده":(s==null?void 0:s.receiverState)==="rejected"?"رد شده":"در انتظار تایید",u.jsx(G0,{item:s,updateTable:X,handleUpdate:a,type:r,priceInfo:t,remainWeight:v},L)]});B(e)},[T]),n.useEffect(()=>{M(1)},[c,D,l,x]);const F=async e=>{e.preventDefault(),c(tu());try{const s=await uu.get(`steward-allocation/?role=${eu()}&search=filter&value=${R}${r!=="not_entered"?`&date1=${D}&date2=${l}`:""}&page=${$}&page_size=${x}${r?"&type="+r:""}`);g(s.data.results),h(s.data.count),c(H())}catch(s){console.error("Error fetching data:",s),c(H())}};return u.jsxs(d,{container:!0,justifyContent:"start",alignItems:"center",xs:12,children:[u.jsx(d,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:u.jsxs(d,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[r!=="not_entered"&&u.jsxs(u.Fragment,{children:[u.jsx(d,{children:u.jsx(vu,{label:"از تاریخ",id:"date",renderInput:e=>u.jsx(k,{style:{width:"160px"},...e,size:"small"}),value:D,onChange:e=>{S(N(e).format("YYYY-MM-DD"))}})}),u.jsx(d,{children:u.jsx(vu,{label:"تا تاریخ",id:"date",renderInput:e=>u.jsx(k,{style:{width:"160px"},...e,size:"small"}),value:l,onChange:e=>{C(N(e).format("YYYY-MM-DD"))}})})]}),u.jsx(d,{children:u.jsxs("form",{onSubmit:F,children:[u.jsx(k,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:A}),u.jsx(z,{type:"submit",onClick:F,endIcon:u.jsx(n6,{}),children:"جستجو"})]})}),!(r==="entered"||r==="not_entered")&&u.jsx(z,{variant:"outlined",onClick:()=>{c(l6({title:"ثبت نهایی",content:u.jsxs(d,{container:!0,gap:J.SMALL,children:[u.jsx(m,{children:"در صورت ثبت نهایی انجام هیچگونه عملیاتی مانند حذف و ویرایش امکان پذیر نمی باشد."}),u.jsxs(d,{container:!0,direction:"column",gap:J.TINY,width:"100%",children:[u.jsx(z,{fullWidth:!0,variant:"contained",onClick:()=>{c(E0({steward_allocation_list:T.map(e=>e.key)})).then(e=>{var s;c(t6()),(s=e.payload)!=null&&s.error?U({vertical:"top",horizontal:"center",msg:e.payload.error,severity:"error"}):(X(),a==null||a(),U({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),u.jsx(z,{fullWidth:!0,color:"error",variant:"contained",onClick:()=>{c(t6())},children:"لغو"})]})]})}))},children:"تایید نهایی (یکجا)"})]})}),u.jsx(yu,{data:q,columns:["ردیف","تاریخ ثبت","تاریخ تولید گوشت","ثبت شده","نوع تخصیص","مشخصات خریدار","مشخصات فروشنده","نوع فروش","قیمت هر کیلو","قیمت کل","وزن تخصیصی",...w(),...i(),"افت وزن(کیلوگرم)","سهمیه","نوع فروش","وضعیت",...f()],handlePageChange:ou,totalRows:o,page:$,perPage:x,handlePerRowsChange:P,title:r==="entered"?"وارد شده به انبار":r==="not_entered"?"در انتظار ورود":"تخصیصات صورت گرفته"})]})});c6.displayName="StewardShowAllocations";const m0=()=>{var D,S,l,C,A,T,g,o;const r=au(),[a,t]=n.useState([]),v=n.useRef(),p=n.useRef(),c=()=>{r(V0()).then(h=>{t(h.payload.data)}),v.current&&v.current.updateTable(),p.current&&p.current.updateTable()};return n.useEffect(()=>{c()},[r]),u.jsxs(d,{container:!0,xs:12,justifyContent:"end",alignItems:"center",children:[u.jsx(d,{container:!0,width:"100%",isDashboard:!0,children:u.jsx(i6,{})}),u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mt:2,children:[u.jsx(d,{container:!0,justifyContent:"start",alignItems:"center",xs:12,children:u.jsx(yu,{title:"اطلاعات کلی بارها",noPagination:!0,data:[[(D=a==null?void 0:a.totalBars)==null?void 0:D.toLocaleString(),(S=a==null?void 0:a.totalBarsWeight)==null?void 0:S.toLocaleString(),(l=a==null?void 0:a.totalEnteredBars)==null?void 0:l.toLocaleString(),(C=a==null?void 0:a.totalEnteredBarsWeight)==null?void 0:C.toLocaleString(),(A=a==null?void 0:a.totalNotEnteredBars)==null?void 0:A.toLocaleString(),(T=a==null?void 0:a.totalNotEnteredKillHouseRequestsWeight)==null?void 0:T.toLocaleString(),(g=a==null?void 0:a.totalRejectedBars)==null?void 0:g.toLocaleString(),(o=a==null?void 0:a.totalRejectedBarsWeight)==null?void 0:o.toLocaleString()]],columns:["تعداد کل بارها","وزن کل بارها (کیلوگرم)","تعداد کل بارهای وارد شده","وزن کل بار وارد شده (کیلوگرم)","تعداد کل بارهای وارد نشده","وزن کل بار وارد نشده (کیلوگرم)","تعداد کل بارهای رد شده","وزن کل بارهای رد شده"],allColors:{color:"#f3bda3",text:"#332a3d"}})}),u.jsx(d,{container:!0,xs:12,mt:4,children:u.jsx(c6,{ref:v,type:"not_entered",handleUpdate:c})}),u.jsxs(J6,{sx:{width:"100%",mt:4},children:[u.jsx(X6,{expandIcon:u.jsx(t0,{}),children:u.jsx(m,{children:"بارهای وارد شده"})}),u.jsx(u0,{children:u.jsx(d,{container:!0,xs:12,children:u.jsx(c6,{ref:p,type:"entered",handleUpdate:c})})})]})]})]})},H0=Su("STEWARD-GET-OUT_DASHBOARD_SERVICE",async(r,{dispatch:a})=>{a(tu());const{data:t,status:v}=await uu.get("steward_free_bar_dashboard",{params:{...r}});return a(H()),{data:t,status:v}}),U0=Su("STEWARD_FREE_BAR_SERVICE",async(r,{dispatch:a})=>{var t,v;a(tu());try{const{data:p,status:c}=await uu.post("steward_free_bar/",r);return a(H()),{data:p,status:c}}catch(p){return a(H()),{error:(v=(t=p.response)==null?void 0:t.data)==null?void 0:v.result}}}),K0=Su("STEWARD_EDIT_FREE_BAR_SERVICE",async(r,{dispatch:a})=>{var t,v;a(tu());try{const{data:p,status:c}=await uu.put("steward_free_bar/0/",r);return a(H()),{data:p,status:c}}catch(p){return a(H()),{error:(v=(t=p.response)==null?void 0:t.data)==null?void 0:v.result}}}),Z0=Su("STEWARD_DELETE_FREE_BAR_SERVICE",async(r,{dispatch:a})=>{var t,v;a(tu());try{const{data:p,status:c}=await uu.delete(`steward_free_bar/0/?key=${r}`);return a(H()),{data:p,status:c}}catch(p){return a(H()),{error:((v=(t=p.response)==null?void 0:t.data)==null?void 0:v.result)||"خطا در حذف اطلاعات"}}}),Q0=Du().shape({kill_house_name:I().required("نام فروشنده الزامی است"),kill_house_mobile:I().required("شماره موبایل فروشنده الزامی است").min(11,"شماره موبایل باید دقیقاً 11 رقم باشد").max(11,"شماره موبایل باید دقیقاً 11 رقم باشد"),province:I().required("استان الزامی است"),city:I().required("شهر الزامی است"),bar_image:I().when("$isEdit",{is:!0,then:I(),otherwise:I().required("عکس بار الزامی است")}),number_of_carcasses:Wu().required("حجم لاشه الزامی است").min(1,"حجم لاشه باید بیشتر از 0 باشد"),weight_of_carcasses:Wu().required("وزن لاشه الزامی است").min(.01,"وزن باید بیشتر از 0 باشد"),product_key:I().required("انتخاب محصول الزامی است")}),U6=({updateTable:r,item:a})=>{const t=au(),[v]=n.useContext(hu),[p,c]=n.useState([]),[D,S]=n.useState([]),[l,C]=n.useState([]),[A,T]=n.useState([]);n.useEffect(()=>{g.validateForm(),t(o6()).then(h=>{c(h.payload.data)}),t(w6()).then(h=>{S(h.payload.data)})},[]);const g=Yu({initialValues:{product_key:(a==null?void 0:a.productKey)||"",kill_house_name:(a==null?void 0:a.killHouseName)||"",kill_house_mobile:(a==null?void 0:a.killHouseMobile)||"",province:(a==null?void 0:a.province)||"",city:(a==null?void 0:a.city)||"",bar_image:(a==null?void 0:a.barImage)||"",number_of_carcasses:(a==null?void 0:a.numberOfCarcasses)||"",weight_of_carcasses:(a==null?void 0:a.weightOfCarcasses)||"",date:(a==null?void 0:a.date)||N(new Date).format("YYYY-MM-DD HH:mm:ss"),...(a==null?void 0:a.key)&&{key:a.key}},validationSchema:Q0,onSubmit:h=>{var W,R;a!=null&&a.key&&(A.length&&((W=A[0])!=null&&W.data_url)?h.bar_image=A6((R=A[0])==null?void 0:R.data_url):h.bar_image=a.barImage);const x=Y=>{Y.payload.error?v({vertical:"top",horizontal:"center",msg:Y.payload.error,severity:"error"}):(t(cu({right:!1,bottom:!1,content:null})),r(),v({vertical:"top",horizontal:"center",msg:a!=null&&a.key?"اطلاعات خرید با موفقیت ویرایش شد":"اطلاعات خرید جدید با موفقیت ثبت شد",severity:"success"}),t(cu({right:!1,bottom:!1,content:null})))};a!=null&&a.key?t(K0(h)).then(x):t(U0(h)).then(x)}}),o=h=>{var x;h[0]&&g.setFieldValue("bar_image",A6((x=h[0])==null?void 0:x.data_url)),T(h)};return n.useEffect(()=>{g.values.province&&t(_6(g.values.province)).then(h=>{C(h.payload.data)})},[g.values.province]),n.useEffect(()=>{a!=null&&a.barImage&&T([{data_url:a==null?void 0:a.barImage}])},[a]),u.jsx(d,{container:!0,direction:"column",justifyContent:"center",gap:2,children:u.jsxs(d,{container:!0,direction:"column",justifyContent:"center",gap:2,children:[u.jsx(d,{xs:12,container:!0,gap:2,children:u.jsx(bu,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"product_key",options:p.map(h=>({id:h.key,label:h.name})),value:p.map(h=>({id:h.key,label:h.name})).find(h=>h.id===g.values.product_key)||null,onChange:(h,x)=>{g.setFieldValue("product_key",x?x.id:"")},renderInput:h=>u.jsx(k,{...h,label:"انتخاب محصول",error:g.touched.product_key&&!!g.errors.product_key,helperText:g.touched.product_key&&g.errors.product_key})})}),u.jsxs("form",{onSubmit:g.handleSubmit,style:{display:"flex",flexDirection:"column",gap:J.LARGE},children:[u.jsx(k,{id:"kill_house_name",name:"kill_house_name",label:"نام فروشنده",value:g.values.kill_house_name,onChange:g.handleChange,onBlur:g.handleBlur,error:g.touched.kill_house_name&&!!g.errors.kill_house_name,helperText:g.touched.kill_house_name&&g.errors.kill_house_name}),u.jsx(k,{id:"kill_house_mobile",name:"kill_house_mobile",label:"تلفن فروشنده",value:g.values.kill_house_mobile,onChange:g.handleChange,onBlur:g.handleBlur,error:g.touched.kill_house_mobile&&!!g.errors.kill_house_mobile,helperText:g.touched.kill_house_mobile&&g.errors.kill_house_mobile}),u.jsx(bu,{style:{width:"100%"},disablePortal:!0,id:"province",options:D.map(h=>({id:h.name,label:h.name})),value:g.values.province?{id:g.values.province,label:g.values.province}:null,onChange:(h,x)=>{g.setFieldValue("province",x?x.id:""),g.setFieldValue("city","")},renderInput:h=>u.jsx(k,{...h,label:"استان را انتخاب کنید",error:g.touched.province&&!!g.errors.province,helperText:g.touched.province&&g.errors.province})}),u.jsx(bu,{minWidth:210,style:{width:"100%"},disabled:!g.values.province,disablePortal:!0,id:"city",value:g.values.city?{id:g.values.city,label:g.values.city}:null,options:l?l.map(h=>({id:h.name,label:h.name})):[],onChange:(h,x)=>{g.setFieldValue("city",x?x.id:""),g.setFieldValue("city",x?x.id:"")},renderInput:h=>u.jsx(k,{...h,label:"شهر را انتخاب کنید"})}),u.jsx(k,{id:"number_of_carcasses",name:"number_of_carcasses",label:"حجم لاشه",type:"number",InputProps:{endAdornment:u.jsx(a6,{position:"end",children:"قطعه"})},value:g.values.number_of_carcasses,onChange:g.handleChange,onBlur:g.handleBlur,error:g.touched.number_of_carcasses&&!!g.errors.number_of_carcasses,helperText:g.touched.number_of_carcasses&&g.errors.number_of_carcasses}),u.jsx(k,{id:"weight_of_carcasses",name:"weight_of_carcasses",label:"وزن لاشه",type:"number",InputProps:{endAdornment:u.jsx(a6,{position:"end",children:"کیلوگرم"})},value:g.values.weight_of_carcasses,onChange:g.handleChange,onBlur:g.handleBlur,error:g.touched.weight_of_carcasses&&!!g.errors.weight_of_carcasses,helperText:g.touched.weight_of_carcasses&&g.errors.weight_of_carcasses}),u.jsx(m6,{onChange:o,images:A,maxNumber:1,title:"تصویر بار"}),!A.length&&(a==null?void 0:a.barImage)&&u.jsx(d,{container:!0,justifyContent:"center",children:u.jsx("img",{style:{width:"60px"},alt:"bar",src:a==null?void 0:a.barImage})}),u.jsx(z,{type:"submit",fullWidth:!0,variant:"contained",color:"primary",disabled:!g.isValid,children:a!=null&&a.key?"ویرایش خرید":"ثبت خرید جدید"})]})]})})},J0=({item:r,updateTable:a})=>{const t=au(),[v,p]=n.useState(null),c=A=>{p(A.currentTarget)},D=()=>{p(null)},S=!!v,l=S?"popover":void 0,C=()=>{D(),t(Z0(r.key)).then(()=>{a()})};return u.jsxs("div",{children:[u.jsx($u,{"aria-describedby":l,variant:"contained",color:"primary",onClick:c,children:u.jsx(S6,{})}),u.jsx(v6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:l,open:S,anchorEl:v,onClose:D,children:u.jsx("div",{style:{padding:"20px"},children:u.jsxs(d,{container:!0,direction:"column",gap:1,children:[u.jsx(z,{onClick:()=>{D(),t(cu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ویرایش خرید خارج استان",content:u.jsx(U6,{item:r,updateTable:a})}))},children:"ویرایش"}),u.jsx(z,{color:"error",onClick:C,children:"حذف"})]})})})]})},X0=({isBarManagemen:r})=>{var lu,P,f;const[a,t]=n.useState([]),[v,p]=n.useState([]),[c,D]=n.useState(0),[S,l]=n.useState(10),[C,A]=n.useState(""),[T,g]=n.useState(1),[o,h]=n.useState([]),[,,x,W,R,Y]=n.useContext(hu),$=au(),E=qu(j=>j.userSlice.userProfile.key),q=()=>{$(H0({date1:x,date2:R,search:"filter"})).then(j=>{h(j.payload.data)})};n.useEffect(()=>{const j=N(new Date).format("YYYY-MM-DD");W(j),Y(j)},[]);const B=async j=>{$(tu());const i=await uu.get(`steward_free_bar/?search=filter&value=${C}&date1=${x}&date2=${R}&page=${j}&page_size=${S}&role=${eu()}`);q(),$(H()),t(i.data.results),D(i.data.count)};n.useEffect(()=>{B(1)},[x,R,S]);const U=j=>{B(j),g(j)},M=()=>{q(),B(T)},X=j=>{l(j),g(1)},ou=j=>{A(j.target.value)};n.useEffect(()=>{B(1)},[]),n.useEffect(()=>{const j=a==null?void 0:a.map((i,su)=>{var w,F,e,s,L;return[T===1?su+1:su+S*(T-1)+1,d6(i.createDate),`${i==null?void 0:i.killHouseName} (${i==null?void 0:i.killHouseMobile})`,((F=(w=i==null?void 0:i.product)==null?void 0:w.name)==null?void 0:F.toLocaleString())||"-",(e=i==null?void 0:i.killHouseName)==null?void 0:e.toLocaleString(),`${i==null?void 0:i.city} (${i==null?void 0:i.province})`,((s=i==null?void 0:i.numberOfCarcasses)==null?void 0:s.toLocaleString())||"-",((L=i==null?void 0:i.weightOfCarcasses)==null?void 0:L.toLocaleString())||"-",u.jsx(L0,{src:i==null?void 0:i.barImage},su),u.jsx(J0,{item:i,updateTable:M},su)]});p(j)},[a]),n.useEffect(()=>{B(1)},[x,R,S]);const nu=async j=>{j.preventDefault(),$(tu());try{const i=await uu.get(`steward_free_bar/?search=filter&value=${C}&date1=${x}&date2=${R}&page=${T}&role=${eu()}`);t(i.data.results),D(i.data.count),q(),$(H())}catch(i){console.error("Error fetching data:",i)}};return u.jsx(d,{container:!0,direction:"column",flexWrap:"nowrap",mt:J.SMALL,children:u.jsxs(d,{container:!0,mt:J.MEDIUM,alignItems:"center",justifyContent:"center",gap:2,children:[u.jsx("form",{onSubmit:nu,children:u.jsxs(d,{container:!0,alignItems:"center",gap:J.SMALL,children:[eu()==="Steward"&&!r&&u.jsx(z,{variant:"contained",onClick:()=>{$(cu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت اطلاعات خرید",content:u.jsx(U6,{selectedDate:x,updateTable:M})}))},children:"ثبت اطلاعات خرید"}),u.jsx(k,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:ou}),u.jsx(z,{type:"submit",onClick:nu,endIcon:u.jsx(n6,{}),children:"جستجو"}),u.jsx(d,{children:u.jsx(vu,{label:"از تاریخ",id:"date",renderInput:j=>u.jsx(k,{style:{width:"160px"},...j}),value:x,onChange:j=>W(N(j).format("YYYY-MM-DD"))})}),u.jsx(d,{children:u.jsx(vu,{label:"تا تاریخ",id:"date",renderInput:j=>u.jsx(k,{style:{width:"160px"},...j}),value:R,onChange:j=>Y(N(j).format("YYYY-MM-DD"))})}),u.jsx(u6,{title:"خروجی اکسل",children:u.jsx(z,{color:"success",onClick:()=>{const j=`${uu.defaults.baseURL}kill_house_free_bar_excel/?role=${eu()}&key=${E}&date1=${x}&date2=${R}&type=carcass&search=filter&value=${C}&date_type=buy`;window.location.href=j},children:u.jsx(b0,{size:32})})})]})}),u.jsx(d,{container:!0,mt:2,mb:4,isDashboard:!0,children:u.jsx(yu,{noPagination:!0,isDashboard:!0,columns:["تعداد کل بارها","تعداد کل","وزن کل (کیلوگرم)"],data:[[((lu=o==null?void 0:o.totalBars)==null?void 0:lu.toLocaleString())||"0",((P=o==null?void 0:o.totalQuantity)==null?void 0:P.toLocaleString())||"0",((f=o==null?void 0:o.totalWeight)==null?void 0:f.toLocaleString())||"0"]],title:"خلاصه اطلاعات"})}),u.jsx(yu,{data:v,columns:["ردیف","تاریخ خرید","خریدار","محصول","فروشنده","استان/شهر","حجم لاشه","وزن لاشه (کیلوگرم)","بارنامه","عملیات"],handlePageChange:U,totalRows:c,page:T,perPage:S,handlePerRowsChange:X,title:"خرید های خارج استان"})]})})},R6=Su("SLAUGHTRE_SELL_DASHBOARD",async(r,{dispatch:a})=>{a(tu());const{data:t,status:v}=await uu.get("steward_free_sale_bar_dashboard",{params:{date1:r.selectedDate1,date2:r.selectedDate2,role:eu()}});return a(H()),{data:t,status:v}}),K6=Su("STEWARD_GET_BUYERS_SELL_OUT",async(r,{dispatch:a})=>{a(tu());const{data:t,status:v}=await uu.get("out-province-carcasses-buyer/",{params:{role:eu()}});return a(H()),{data:t,status:v}}),ue=Su("STEWARD_SUBMIT_BUYER_SERVICE",async(r,{dispatch:a})=>{try{a(tu());const{data:t,status:v}=await uu.post("out-province-carcasses-buyer/",{...r});return a(H()),{data:t,status:v}}catch(t){return a(H()),{error:t.response.data.result}}}),ee=Su("STEWARD_SELL_OUT_SUBMIT_SERVICE",async(r,{dispatch:a})=>{try{const{data:t,status:v}=await uu.post("steward_free_sale_bar/",r);return a(tu()),{data:t,status:v}}catch(t){return a(H()),{error:t.response.data.result}}}),re=r=>Du({weight_of_carcasses:Wu().required("وزن لاشه‌ها الزامی است").positive("وزن باید عددی مثبت باشد").test("max-production-date-amount",`وزن نمی‌تواند بیشتر از موجودی تاریخ تولید (${(r==null?void 0:r.toLocaleString())||0} کیلوگرم) باشد!`,function(a){return!r||r===null?!0:a<=r}),clearance_code:I().required("کد قرنطینه الزامی است").matches(/^(?=.*[A-Z])(?=.*\d)[A-Z0-9]+$/,"کد قرنطینه باید ترکیبی از حروف بزرگ انگلیسی و عدد باشد"),date:n0().required("تاریخ الزامی است"),production_date:I().required("تاریخ تولید الزامی است")}),ae=({updateTable:r,fetchItems:a,isInventory:t})=>{const[v,p]=n.useState([]),[c,D]=n.useState(null),[S,l]=n.useState([]),[C,A]=n.useState(null),[T]=n.useState("free"),[g,o]=n.useState("governmental"),[h,x]=n.useState(null),[W,R]=n.useState({}),[Y,$]=n.useState(null),[E,q]=n.useState(null),[B,U]=n.useState(null),M=n.useRef(null),X=au(),[ou]=n.useContext(hu),nu=w=>{var F,e;if(w&&w.formattedDate){x(w.formattedDate);const s=W[w.formattedDate];if(s&&s.originalDay){if((e=(F=M.current)==null?void 0:F.values)!=null&&e.date&&N(s.originalDay).isAfter(N(M.current.values.date),"day")){U("تاریخ تولید نمی‌تواند بعد از تاریخ انتخابی باشد");return}U(null),$(s.originalDay),M.current&&M.current.setFieldValue("production_date",s.originalDay)}s&&s.value1!==void 0?q(s.value1):q(null)}},lu=n.useCallback(w=>{if(!Array.isArray(w))return{};const F={};return w.forEach(e=>{if(e.day&&e.amount!==void 0){const L=new N6(new Date(e.day)).format("YYYY/MM/DD");F[L]={value1:e.amount,originalDay:e.day,active:e.active===!0}}}),F},[]),P=n.useCallback(w=>{const F=lu(w);R(F)},[lu]),[f,j]=n.useState(N(new Date).format("YYYY-MM-DD")),i=n.useCallback(async(w=f)=>{try{const F=await uu.get("/steward-remain-weight/",{params:{date:w}});if(F.data){const e=g==="governmental"?F.data.governmental:F.data.free;P(e||[])}}catch(F){console.error("Error fetching calendar data:",F)}},[g,P,f]);n.useEffect(()=>{X(K6()).then(w=>{l(w.payload.data)})},[]),n.useEffect(()=>{X(z6()).then(w=>{p(w.payload.data)}),i(f)},[f]),n.useEffect(()=>{let w=f;if(g==="governmental"&&M.current){const F=N(new Date).format("YYYY-MM-DD");M.current.setFieldValue("date",F),j(F),w=F}i(w),x(null),$(null),q(null),M.current&&M.current.setFieldValue("production_date","")},[g,f,i]),n.useEffect(()=>{M.current&&M.current.validateForm()},[E]);const su=w=>{const F=w.target.value;if(o(F),F==="governmental"&&M.current){const e=N(new Date).format("YYYY-MM-DD");M.current.setFieldValue("date",e),j(e),i(e)}};return u.jsx(d,{container:!0,gap:J.SMALL,direction:"column",display:"flex",children:u.jsxs(d,{container:!0,gap:J.SMALL,direction:"column",children:[u.jsx(d,{minWidth:210,children:u.jsx(bu,{disablePortal:!0,id:"combo-box-demo",getOptionDisabled:w=>w.disabled,options:S?S.map(w=>({id:w==null?void 0:w.key,label:`${w==null?void 0:w.fullname} (${w.mobile}) / استان ${w.province} / شهر ${w.city}`,item:w})):[],onChange:(w,F)=>{A(F==null?void 0:F.id)},renderInput:w=>u.jsx(k,{...w,label:"انتخاب خریدار"})})}),C&&u.jsxs(u.Fragment,{children:[u.jsx(d,{xs:12,container:!0,children:u.jsx(bu,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"hatching",options:v?v.map(w=>({data:w,label:`${w.name}`})):[],onChange:(w,F)=>{D(F.data)},renderInput:w=>u.jsx(k,{fullWidth:!0,...w,label:"انتخاب محصول"})})}),u.jsx(I6,{innerRef:M,initialValues:{weight_of_carcasses:"",clearance_code:"",date:N(new Date).format("YYYY-MM-DD"),production_date:""},validationSchema:re(E),onSubmit:w=>{X(ee({buyer_key:C,number_of_carcasses:Math.round((w==null?void 0:w.weight_of_carcasses)/(c==null?void 0:c.weightAverage))||0,weight_of_carcasses:parseInt(w.weight_of_carcasses),date:w.date,clearance_code:w.clearance_code,product_key:c==null?void 0:c.key,sale_type:T,quota:g,production_date:w.production_date,distribution_type:"web"})).then(F=>{F.payload.error?ou({vertical:"top",horizontal:"center",msg:F.payload.error,severity:"error"}):(t?a():r(),X(Mu()),X(cu({right:!1,bottom:!1,content:null})),ou({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:({values:w,errors:F,touched:e,setFieldValue:s})=>u.jsx(O6,{children:u.jsxs(d,{container:!0,gap:J.SMALL,direction:"column",children:[u.jsx(d,{item:!0,children:u.jsx(k,{disabled:!0,label:"حجم تقریبی",value:Math.round((w==null?void 0:w.weight_of_carcasses)/(c==null?void 0:c.weightAverage))||0,InputProps:{readOnly:!0}})}),u.jsx(s6,{label:"نوع انبار",children:u.jsx(Vu,{fullWidth:!0,children:u.jsxs(Ou,{row:!0,"aria-labelledby":"segment-type-radio-group",name:"segmentType",value:g,onChange:su,sx:{justifyContent:"space-between"},children:[u.jsx(fu,{value:"governmental",control:u.jsx(Au,{}),label:"انبار دولتی"}),u.jsx(fu,{value:"free",control:u.jsx(Au,{}),label:"انبار آزاد"})]})})}),u.jsx(d,{xs:12,children:u.jsx(vu,{label:"تاریخ",disabled:g==="governmental",value:N(w.date),onChange:L=>{const Z=N(L).format("YYYY-MM-DD");s("date",Z),j(Z),i(Z)},renderInput:L=>u.jsx(k,{fullWidth:!0,...L,size:"small",error:e.date&&!!F.date,helperText:e.date&&F.date})})}),u.jsx(d,{item:!0,children:u.jsx(e6,{name:"clearance_code",as:k,label:"کد قرنطینه",fullWidth:!0,onChange:L=>s("clearance_code",L.target.value.toUpperCase()),error:e.clearance_code&&!!F.clearance_code,helperText:e.clearance_code&&F.clearance_code})}),u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:J.TINY,sx:{width:"100%"},children:[u.jsx(G6,{onDateSelect:nu,dayData:W,selectedDate:h,maxGregorianDate:w.date,label:`تاریخ تولید گوشت ${E!==null?`(موجودی: ${E==null?void 0:E.toLocaleString()} کیلوگرم)`:""}`}),B&&u.jsx(k,{error:!0,helperText:B,sx:{visibility:"hidden",height:0,mt:0,mb:0}})]}),u.jsx(d,{item:!0,children:u.jsx(e6,{name:"weight_of_carcasses",as:k,label:"وزن لاشه‌ها",fullWidth:!0,disabled:!E&&!Y,error:!E&&!Y?!0:e.weight_of_carcasses&&!!F.weight_of_carcasses,helperText:!E&&!Y?"لطفاً ابتدا تاریخ تولید را انتخاب کنید!":e.weight_of_carcasses&&F.weight_of_carcasses})}),u.jsx(d,{item:!0,children:u.jsx(z,{fullWidth:!0,type:"submit",variant:"contained",disabled:!c||!Y,children:"ارسال"})})]})})})]})]})})},te=({item:r,fetchApiData:a})=>{const t=au(),[v]=n.useContext(hu),[p,c]=n.useState((r==null?void 0:r.loggedRegistrationCode)||""),D=()=>{var S,l;t(q6({key:r==null?void 0:r.key,register_code:parseInt(p),role:eu(),date:r==null?void 0:r.date,buyer_name:r==null?void 0:r.buyerName,buyer_mobile:r==null?void 0:r.buyerMobile,province:r==null?void 0:r.province,city:r==null?void 0:r.city,clearance_code:r==null?void 0:r.clearanceCode,number_of_carcasses:r==null?void 0:r.numberOfCarcasses,quarantine_weight_of_carcasses:r==null?void 0:r.quarantineWeightOfCarcasses,weight_of_carcasses:r==null?void 0:r.weightOfCarcasses,...((S=r==null?void 0:r.buyer)==null?void 0:S.key)&&{buyer_key:(l=r==null?void 0:r.buyer)==null?void 0:l.key}})).then(C=>{C.payload.error?v({vertical:"top",horizontal:"center",msg:C.payload.error,severity:"error"}):(v({vertical:"top",horizontal:"center",msg:"کد احراز با موفقیت ثبت شد.",severity:"success"}),a())})};return u.jsxs(d,{container:!0,direction:"row",alignItems:"center",justifyContent:"flex-start",gap:1,sx:{position:"relative"},children:[u.jsx(k,{value:p,size:"small",onChange:S=>c(S.target.value),style:{minWidth:"150px"},disabled:r==null?void 0:r.loggedRegistrationCode,placeholder:"کد احراز",inputProps:{inputMode:"numeric",pattern:"[0-9]*"},type:"number"}),!(r!=null&&r.loggedRegistrationCode)&&p&&u.jsx(z,{size:"small",variant:"contained",color:"primary",onClick:D,sx:{position:"absolute",right:"0",minWidth:"40px",width:"40px",height:"38px"},children:u.jsx(e0,{})})]})},ne=Su("SLAUGHTER_EDIT_BUYER_SERVICE",async(r,{dispatch:a})=>{try{a(tu());const{data:t,status:v}=await uu.put("steward_free_sale_bar/0/",r);return a(H()),{data:t,status:v}}catch(t){return a(H()),{error:t.response.data.result}}}),se=Du().shape({quarantineCode:I().required("کد قرنطینه الزامی است"),carcassCount:Wu().required("حجم لاشه الزامی است"),carcassWeight:Wu().required("وزن لاشه الزامی است"),date:I().required("تاریخ الزامی است")}),oe=({fetchItems:r,isEdit:a,item:t,selectedDate:v,stewardKey:p})=>{const c=au(),[D]=n.useContext(hu),S={quarantineCode:(t==null?void 0:t.clearanceCode)||"",carcassCount:(t==null?void 0:t.numberOfCarcasses)||"0",carcassWeight:(t==null?void 0:t.weightOfCarcasses)||"",date:(t==null?void 0:t.date)||N().format("YYYY-MM-DD HH:mm:ss")};return u.jsx(d,{children:u.jsx(I6,{initialValues:S,validationSchema:se,onSubmit:l=>{const C={...l,date:l.date,number_of_carcasses:l.carcassCount,weight_of_carcasses:l.carcassWeight};l.quarantineCode!==(t==null?void 0:t.quarantineCode)&&(C.quarantineCode=l.quarantineCode);const A=p?a?q6({key:t==null?void 0:t.key,...C}):F0({steward_key:p,...C}):a?ne({key:t==null?void 0:t.key,driver_mobile:l.driverPhone,...C}):v0({driver_mobile:l.driverPhone,...C});c(A).then(T=>{T.payload.error?D({vertical:"top",horizontal:"center",msg:T.payload.error,severity:"error"}):(p?c(s0({date:l.date})):r(),p&&c(o0({date:l.date,steward_key:p})),c(Mu()),c(cu({right:!1,bottom:!1,content:null})),D({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:({errors:l,touched:C,setFieldValue:A,values:T})=>u.jsx(O6,{children:u.jsxs(d,{container:!0,spacing:1,justifyContent:"center",alignItems:"center",children:[u.jsx(d,{item:!0,xs:12,children:u.jsx(e6,{as:k,name:"quarantineCode",label:"کد قرنطینه",fullWidth:!0,error:C.quarantineCode&&!!l.quarantineCode,helperText:C.quarantineCode&&l.quarantineCode})}),u.jsx(d,{item:!0,xs:12,children:u.jsx(e6,{as:k,name:"carcassCount",label:"حجم لاشه",type:"number",fullWidth:!0,error:C.carcassCount&&!!l.carcassCount,helperText:C.carcassCount&&l.carcassCount})}),u.jsx(d,{item:!0,xs:12,children:u.jsx(vu,{label:"تاریخ",value:N(T.date),onChange:g=>{const o=N(g).format("YYYY-MM-DD HH:mm:ss");A("date",o)},renderInput:g=>u.jsx(k,{...g,fullWidth:!0,error:C.date&&!!l.date,helperText:C.date&&l.date})})}),u.jsx(d,{item:!0,xs:12,children:u.jsx(e6,{as:k,name:"carcassWeight",label:"وزن لاشه",type:"number",fullWidth:!0,error:C.carcassWeight&&!!l.carcassWeight,helperText:C.carcassWeight&&l.carcassWeight})}),u.jsx(d,{item:!0,xs:12,children:u.jsx(z,{variant:"contained",fullWidth:!0,type:"submit",children:a?"ویرایش":"ثبت"})})]})})})})},le=Su("STEWARD_RESEND_OUT_PROVINCE_REGISTRATION_CODE",async(r,{dispatch:a})=>{var t,v;a(tu());try{const{data:p,status:c}=await uu.post("send_again_sms_steward_free_sale_bar/",r);return a(H()),{data:p,status:c}}catch(p){return a(H()),{error:((v=(t=p.response)==null?void 0:t.data)==null?void 0:v.result)||"خطا در ارسال مجدد کد"}}}),ce=({item:r,updateTable:a,fetchApiData:t,page:v})=>{const p=au(),[c]=n.useContext(hu),[D,S]=n.useState(!1),[l,C]=n.useState(null),A=R=>{S(!0),C(R.currentTarget)},T=()=>{S(!1),C(null)},g=()=>{T(),p(cu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ویرایش فروش خارج از استان",content:u.jsx(oe,{fetchItems:a,isEdit:!0,item:r})}))},o=()=>{T(),p(P0(r==null?void 0:r.key)).then(R=>{R.payload.error?c({vertical:"top",horizontal:"center",msg:R.payload.data.result,severity:"error"}):(a(),p(Mu()),c({vertical:"top",horizontal:"center",msg:R.payload.data.result,severity:"success"}))})},h=()=>{T(),p(le({key:r==null?void 0:r.key})).then(R=>{R.payload.error?c({vertical:"top",horizontal:"center",msg:R.payload.error,severity:"error"}):(c({vertical:"top",horizontal:"center",msg:"کد با موفقیت ارسال شد.",severity:"success"}),t(v))})},x=!!l,W=x?"popover":void 0;return u.jsxs("div",{children:[u.jsx($u,{"aria-describedby":W,variant:"contained",color:"primary",onClick:A,children:u.jsx(S6,{})}),u.jsx(v6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:W,open:x,anchorEl:l,onClose:T,children:u.jsx("div",{style:{padding:"20px"},children:u.jsxs(d,{container:!0,direction:"column",children:[u.jsx(u6,{title:"ویرایش",placement:"left-start",children:u.jsx(z,{"aria-label":"edit",color:"primary",variant:"text",onClick:g,startIcon:u.jsx(H6,{}),children:"ویرایش"})}),u.jsx(u6,{title:"حذف",placement:"left-start",children:u.jsx(z,{"aria-label":"delete",color:"error",variant:"text",onClick:o,startIcon:u.jsx(M6,{}),children:"حذف"})}),(r==null?void 0:r.systemRegistrationCode)&&(r==null?void 0:r.registrationCode)&&!(r!=null&&r.loggedRegistrationCode)&&u.jsx(u6,{title:"ارسال مجدد کد",placement:"left-start",children:u.jsx(z,{"aria-label":"resend",color:"success",variant:"text",onClick:h,startIcon:u.jsx(N0,{}),children:"ارسال مجدد کد"})})]})})})]})},de=()=>{var X,ou,nu,lu;const[,,r,a,t,v]=n.useContext(hu),p=au();n.useEffect(()=>{const P=N(new Date).format("YYYY-MM-DD");a(P),v(P)},[]);const c=P=>{o(P.target.value)},[D,S]=n.useState([]),[l,C]=n.useState(0),[A,T]=n.useState(10),[g,o]=n.useState(""),[h,x]=n.useState(1),[W,R]=n.useState([]),Y=async P=>{p(tu());const f=await uu.get(`steward_free_sale_bar/?search=filter&value=${g}&role=${eu()}&date1=${r}&date2=${t}&page=${P}&page_size=${A}`);p(H()),S(f.data.results),C(f.data.count)},$=P=>{Y(P),x(P)},E=P=>{T(P),x(1)},q=()=>{Y(h!==0?h:1)};n.useEffect(()=>{const P=D==null?void 0:D.map((f,j)=>{var i,su,w;return[h===1?j+1:j+A*(h-1)+1,f!=null&&f.date?y6(f==null?void 0:f.date):"-",f!=null&&f.productionDate?d6(f==null?void 0:f.productionDate):"-",(f==null?void 0:f.distributionType)==="web"?"سایت":(f==null?void 0:f.distributionType)==="app"?"موبایل":(f==null?void 0:f.distributionType)==="pos"?"پوز":(f==null?void 0:f.distributionType)||"-",`${f==null?void 0:f.buyerName} (${f==null?void 0:f.buyerMobile})`,f!=null&&f.buyer?`${(i=f==null?void 0:f.buyer)==null?void 0:i.unitName}`:`${f==null?void 0:f.buyerName}`,f==null?void 0:f.province,f==null?void 0:f.city,(f==null?void 0:f.clearanceCode)&&u.jsx(R0,{clearanceCode:f==null?void 0:f.clearanceCode}),(su=f==null?void 0:f.quarantineWeightOfCarcasses)==null?void 0:su.toLocaleString(),(w=f==null?void 0:f.weightOfCarcasses)==null?void 0:w.toLocaleString(),f!=null&&f.systemRegistrationCode?f!=null&&f.loggedRegistrationCode?"تایید شده":f!=null&&f.registrationCode?u.jsx(te,{item:f,fetchApiData:()=>Y(h)},j):"-":"-",u.jsx(ce,{item:f,updateTable:q,fetchApiData:Y,page:h},j)]});R(P)},[D,h]),n.useEffect(()=>{Y(1)},[p,r,t,A]);const B=async P=>{P.preventDefault(),p(tu());try{const f=await uu.get(`steward_free_sale_bar/?role=${eu()}&search=filter&value=${g}&date1=${r}&date2=${t}&page=1&page_size=${A}`);S(f.data.results),C(f.data.count),p(H())}catch(f){console.error("Error fetching data:",f)}p(R6({selectedDate1:r,selectedDate2:t})).then(f=>{M(f.payload.data)})},[U,M]=n.useState([]);return n.useEffect(()=>{p(R6({selectedDate1:r,selectedDate2:t})).then(P=>{M(P.payload.data)})},[r,t]),u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(d,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,mt:2,children:[u.jsx(d,{children:u.jsx(vu,{label:"از تاریخ",id:"date",renderInput:P=>u.jsx(k,{style:{width:"160px"},...P,size:"small"}),value:r,onChange:P=>{a(N(P).format("YYYY-MM-DD"))}})}),u.jsx(d,{children:u.jsx(vu,{label:"تا تاریخ",id:"date",renderInput:P=>u.jsx(k,{style:{width:"160px"},...P,size:"small"}),value:t,onChange:P=>{v(N(P).format("YYYY-MM-DD"))}})}),u.jsx(d,{children:u.jsxs("form",{onSubmit:B,children:[u.jsx(k,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:c}),u.jsx(z,{type:"submit",onClick:B,endIcon:u.jsx(n6,{}),children:"جستجو"})]})})]}),u.jsx(d,{container:!0,xs:12,mt:2,mb:4,isDashboard:!0,children:u.jsx(yu,{noPagination:!0,isDashboard:!0,columns:["تعداد فروش","خریدار","حجم لاشه ها (تقریبی)","وزن کل لاشه ها"],data:[[(X=U==null?void 0:U.numberOfBars)==null?void 0:X.toLocaleString(),(ou=U==null?void 0:U.numberOfBuyers)==null?void 0:ou.toLocaleString(),(nu=U==null?void 0:U.barsQuantity)==null?void 0:nu.toLocaleString(),(lu=U==null?void 0:U.barsWeight)==null?void 0:lu.toLocaleString()]],title:"خلاصه اطلاعات"})}),u.jsx(d,{container:!0,xs:12,children:u.jsx(z,{variant:"contained",onClick:()=>{p(cu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(ae,{updateTable:q}),title:"ثبت اطلاعات فروش"}))},children:"ثبت اطلاعات فروش"})}),u.jsx(yu,{data:W,columns:["ردیف","تاریخ","تاریخ تولید گوشت","ثبت شده","مشخصات خریدار","نام واحد","استان","شهر","کد قرنطینه","وزن استعلامی","وزن لاشه","کد احراز","عملیات"],handlePageChange:$,totalRows:l,page:h,perPage:A,handlePerRowsChange:E,title:"فروش لاشه به خارج استان"})]})},ie=({updateTable:r,isEdit:a,data:t})=>{const[v]=n.useContext(hu),[p,c]=n.useState(null),[D,S]=n.useState(!1),l=au(),[C,A]=n.useState([]),[T,g]=n.useState([]),o=Yu({initialValues:{mobile:"",firstName:"",lastName:"",unitName:"",province:"",city:""},validationSchema:Du({mobile:I().required("این فیلد اجباری است!").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),firstName:I().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),lastName:I().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),unitName:I().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),province:I().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),city:I().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!")})}),h=Yu({initialValues:{userInfoCheck:""},validationSchema:Du({userInfoCheck:I().required("این فیلد اجباری است!").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد")}),validateOnMount:!0});return n.useEffect(()=>{o.validateForm()},[]),n.useEffect(()=>{p&&(o.setValues({mobile:p.mobile||"",firstName:p.firstName||"",lastName:p.lastName||"",unitName:p.unitName||"",province:p.province||"",city:p.city||""}),setTimeout(()=>{o.validateForm()},1))},[p]),n.useEffect(()=>{a&&(o.setValues({mobile:t.mobile||"",firstName:t.firstName||"",lastName:t.lastName||"",unitName:t.unitName||"",province:t.province||"",city:t.city||""}),setTimeout(()=>{o.validateForm()},1))},[a]),n.useEffect(()=>{D&&o.setFieldValue("mobile",h.values.userInfoCheck)},[D]),n.useEffect(()=>{l(w6()).then(x=>{A(x.payload.data)})},[]),n.useEffect(()=>{o.values.province&&g([],l(_6(o.values.province)).then(x=>{g(x.payload.data)}))},[o.values.province]),u.jsxs(d,{container:!0,justifyContent:"space-between",alignItems:"center",xs:12,direction:"column",gap:2,children:[!p&&!D&&!a?u.jsxs(d,{container:!0,xs:12,children:[u.jsx(m,{children:"جستجو کاربر"}),u.jsxs(d,{mt:J.SMALL,display:"flex",width:1,children:[u.jsx(k,{fullWidth:!0,id:"userInfoCheck",label:"شماره موبایل",variant:"outlined",value:h.values.userInfoCheck,error:h.touched.userInfoCheck&&!!h.errors.userInfoCheck,onChange:h.handleChange,onBlur:h.handleBlur,helperText:h.touched.userInfoCheck&&h.errors.userInfoCheck}),u.jsx($u,{disabled:!h.isValid,"aria-label":"search",color:"primary",onClick:()=>{l(K6(h.values.userInfoCheck)).then(x=>{l(H()),x.error?(S(!0),v({vertical:"top",horizontal:"center",msg:"خریدار یافت نشد، یک خریدار جدید ثبت کنید!",severity:"error"})):c(x.payload.data)})},children:u.jsx(b6,{})})]})]}):u.jsxs(d,{container:!0,justifyContent:"space-between",alignItems:"start",xs:12,direction:"column",gap:2,children:[u.jsx(k,{fullWidth:!0,id:"mobile",label:"شماره موبایل",variant:"outlined",value:o.values.mobile,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.mobile&&o.errors.mobile}),u.jsx(k,{fullWidth:!0,id:"firstName",label:"نام",variant:"outlined",value:o.values.firstName,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.firstName&&o.errors.firstName}),u.jsx(k,{fullWidth:!0,id:"lastName",label:"نام خانوادگی",variant:"outlined",value:o.values.lastName,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.lastName&&o.errors.lastName}),u.jsx(k,{fullWidth:!0,id:"unitName",label:"نام واحد",variant:"outlined",value:o.values.unitName,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.unitName&&o.errors.unitName}),u.jsx(bu,{style:{width:"100%"},disablePortal:!0,id:"province",options:C?C.map(x=>({id:x.name,label:x.name})):[],onChange:(x,W)=>{o.setFieldValue("province",W?W.id:""),o.setFieldValue("city","")},renderInput:x=>u.jsx(k,{...x,label:"استان را انتخاب کنید"})}),!D&&u.jsxs(m,{variant:"caption",color:"error",children:["استان: ",o.values.province]}),u.jsx(bu,{minWidth:210,style:{width:"100%"},disabled:!o.values.province,disablePortal:!0,id:"city",options:T?T.map(x=>({id:x.name,label:x.name})):[],onChange:(x,W)=>{o.setFieldValue("city",W?W.id:"")},renderInput:x=>u.jsx(k,{...x,label:"شهر را انتخاب کنید"})}),!D&&u.jsxs(m,{variant:"caption",color:"error",children:["شهر: ",o.values.city]})]}),(p||D||a)&&u.jsx(d,{container:!0,xs:12,children:u.jsx(z,{fullWidth:!0,variant:"contained",disabled:!o.isValid,onClick:()=>{a?l(V6({buyer_key:t==null?void 0:t.key,mobile:o.values.mobile,first_name:o.values.firstName,last_name:o.values.lastName,unit_name:o.values.unitName,city:o.values.city,province:o.values.province})).then(x=>{r(),x.payload.error?v({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):(l(cu({right:!1,bottom:!1,content:null})),v({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}):l(ue({role:eu(),mobile:o.values.mobile,first_name:o.values.firstName,last_name:o.values.lastName,unit_name:o.values.unitName,city:o.values.city,province:o.values.province})).then(x=>{r(),x.payload.error?v({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):(l(cu({right:!1,bottom:!1,content:null})),v({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:a?"ویرایش":"ثبت"})})]})},Ce=({updateTable:r,isEdit:a,data:t})=>{const[v]=n.useContext(hu),[p,c]=n.useState(null),[D,S]=n.useState(!1),l=au(),[C,A]=n.useState([]),[T,g]=n.useState([]),o=Yu({initialValues:{mobile:"",firstName:"",lastName:"",unitName:"",province:"",city:""},validationSchema:Du({mobile:I().required("این فیلد اجباری است!").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),firstName:I().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),lastName:I().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),unitName:I().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),province:I().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),city:I().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!")})}),h=Yu({initialValues:{userInfoCheck:""},validationSchema:Du({userInfoCheck:I().required("این فیلد اجباری است!").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد")}),validateOnMount:!0});return n.useEffect(()=>{o.validateForm()},[]),n.useEffect(()=>{p&&(o.setValues({mobile:p.mobile||"",firstName:p.firstName||"",lastName:p.lastName||"",unitName:p.unitName||"",province:p.province||"",city:p.city||""}),setTimeout(()=>{o.validateForm()},1))},[p]),n.useEffect(()=>{a&&(o.setValues({mobile:t.mobile||"",firstName:t.firstName||"",lastName:t.lastName||"",unitName:t.unitName||"",province:t.province||"",city:t.city||""}),setTimeout(()=>{o.validateForm()},1))},[a]),n.useEffect(()=>{D&&o.setFieldValue("mobile",h.values.userInfoCheck)},[D]),n.useEffect(()=>{l(w6()).then(x=>{A(x.payload.data)})},[]),n.useEffect(()=>{o.values.province&&g([],l(_6(o.values.province)).then(x=>{g(x.payload.data)}))},[o.values.province]),u.jsxs(d,{container:!0,justifyContent:"space-between",alignItems:"center",xs:12,direction:"column",gap:2,children:[!p&&!D&&!a?u.jsxs(d,{container:!0,xs:12,children:[u.jsx(m,{children:"جستجو کاربر"}),u.jsxs(d,{mt:J.SMALL,display:"flex",width:1,children:[u.jsx(k,{fullWidth:!0,id:"userInfoCheck",label:"شماره موبایل",variant:"outlined",value:h.values.userInfoCheck,error:h.touched.userInfoCheck&&!!h.errors.userInfoCheck,onChange:h.handleChange,onBlur:h.handleBlur,helperText:h.touched.userInfoCheck&&h.errors.userInfoCheck}),u.jsx($u,{disabled:!h.isValid,"aria-label":"search",color:"primary",onClick:()=>{l(y0(h.values.userInfoCheck)).then(x=>{l(H()),x.error?(S(!0),v({vertical:"top",horizontal:"center",msg:"خریدار یافت نشد، یک خریدار جدید ثبت کنید!",severity:"error"})):c(x.payload.data)})},children:u.jsx(b6,{})})]})]}):u.jsxs(d,{container:!0,justifyContent:"space-between",alignItems:"start",xs:12,direction:"column",gap:2,children:[u.jsx(k,{fullWidth:!0,id:"mobile",label:"شماره موبایل",variant:"outlined",value:o.values.mobile,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.mobile&&o.errors.mobile}),u.jsx(k,{fullWidth:!0,id:"firstName",label:"نام",variant:"outlined",value:o.values.firstName,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.firstName&&o.errors.firstName}),u.jsx(k,{fullWidth:!0,id:"lastName",label:"نام خانوادگی",variant:"outlined",value:o.values.lastName,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.lastName&&o.errors.lastName}),u.jsx(k,{fullWidth:!0,id:"unitName",label:"نام واحد",variant:"outlined",value:o.values.unitName,onChange:o.handleChange,onBlur:o.handleBlur,helperText:o.touched.unitName&&o.errors.unitName}),u.jsx(bu,{style:{width:"100%"},disablePortal:!0,id:"province",options:C?C.map(x=>({id:x.name,label:x.name})):[],onChange:(x,W)=>{o.setFieldValue("province",W?W.id:""),o.setFieldValue("city","")},renderInput:x=>u.jsx(k,{...x,label:"استان را انتخاب کنید"})}),!D&&u.jsxs(m,{variant:"caption",color:"error",children:["استان: ",o.values.province]}),u.jsx(bu,{minWidth:210,style:{width:"100%"},disabled:!o.values.province,disablePortal:!0,id:"city",options:T?T.map(x=>({id:x.name,label:x.name})):[],onChange:(x,W)=>{o.setFieldValue("city",W?W.id:"")},renderInput:x=>u.jsx(k,{...x,label:"شهر را انتخاب کنید"})}),!D&&u.jsxs(m,{variant:"caption",color:"error",children:["شهر: ",o.values.city]})]}),(p||D||a)&&u.jsx(d,{container:!0,xs:12,children:u.jsx(z,{fullWidth:!0,variant:"contained",disabled:!o.isValid,onClick:()=>{a?l(V6({buyer_key:t==null?void 0:t.key,mobile:o.values.mobile,first_name:o.values.firstName,last_name:o.values.lastName,unit_name:o.values.unitName,city:o.values.city,province:o.values.province})).then(x=>{r(),l(Mu()),x.payload.error?v({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):(l(cu({right:!1,bottom:!1,content:null})),v({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}):l(j0({mobile:o.values.mobile,first_name:o.values.firstName,last_name:o.values.lastName,unit_name:o.values.unitName,city:o.values.city,province:o.values.province})).then(x=>{r(),l(Mu()),x.payload.error?v({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):(l(cu({right:!1,bottom:!1,content:null})),v({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:a?"ویرایش":"ثبت"})})]})},he=()=>{const r=$=>{C($.target.value)},a=au(),[t,v]=n.useState([]),[p,c]=n.useState(0),[D,S]=n.useState(10),[l,C]=n.useState(""),[A,T]=n.useState(1),[g,o]=n.useState([]),h=async $=>{let E;a(tu()),E=await uu.get(`out-province-carcasses-buyer/?search=filter&value=${l}&role=${eu()}&page=${$}&page_size=${D}&state=buyer-list`),a(H()),v(E.data.results),c(E.data.count)},x=$=>{h($),T($)},W=$=>{S($),T(1)},R=()=>{h(A!==0?A:1)};n.useEffect(()=>{const $=t==null?void 0:t.map((E,q)=>{var B,U,M,X,ou,nu;return[A===1?q+1:q+D*(A-1)+1,`${E==null?void 0:E.fullname} (${E==null?void 0:E.mobile})`,E==null?void 0:E.unitName,E==null?void 0:E.province,E==null?void 0:E.city,(U=(B=E==null?void 0:E.requestsInfo)==null?void 0:B.numberOfRequests)==null?void 0:U.toLocaleString(),(X=(M=E==null?void 0:E.requestsInfo)==null?void 0:M.totalQuantity)==null?void 0:X.toLocaleString(),(nu=(ou=E==null?void 0:E.requestsInfo)==null?void 0:ou.totalWeight)==null?void 0:nu.toLocaleString(),u.jsx($u,{color:"primary",onClick:()=>{a(cu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(Ce,{updateTable:R,isEdit:!0,data:E}),title:"ویرایش خریدار"}))},children:u.jsx(H6,{})},q)]});o($)},[t]),n.useEffect(()=>{h(1)},[a,D]);const Y=async $=>{$.preventDefault(),a(tu());try{const E=await uu.get(`out-province-carcasses-buyer/?role=${eu()}&search=filter&value=${l}&page=1&page_size=${D}&state=buyer-list`);v(E.data.results),c(E.data.count),a(H())}catch(E){console.error("Error fetching data:",E)}};return u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(d,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(z,{variant:"contained",onClick:()=>{a(cu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(ie,{updateTable:R}),title:"افزودن خریدار"}))},children:"افزودن خریدار"}),u.jsx(d,{children:u.jsxs("form",{onSubmit:Y,children:[u.jsx(k,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:r}),u.jsx(z,{type:"submit",onClick:Y,endIcon:u.jsx(n6,{}),children:"جستجو"})]})})]}),u.jsx(yu,{data:g,columns:["ردیف","مشخصات خریدار","نام واحد","استان","شهر","تعداد درخواست ها","حجم تقریبی (قطعه)","وزن (کیلوگرم)","ویرایش"],handlePageChange:x,totalRows:p,page:A,perPage:D,handlePerRowsChange:W,title:"خریداران لاشه خارج استان"})]})},ge=()=>{const r=au(),[a,t]=n.useState(0),v=(p,c)=>{t(c)};return n.useEffect(()=>{r(Mu())},[r]),u.jsxs(d,{container:!0,direction:"column",alignItems:"center",justifyContent:"space-between",gap:J.SMALL,mt:J.MEDIUM,width:"100%",children:[u.jsx(d,{container:!0,width:"100%",isDashboard:!0,children:u.jsx(i6,{})}),u.jsxs(d,{container:!0,direction:"column",alignItems:"center",justifyContent:"space-between",gap:J.SMALL,mb:J.SMALL,width:"100%",children:[u.jsx(F6,{sx:{borderBottom:1,borderColor:"divider"},children:u.jsxs(r0,{className:"insidetabs",size:"small",value:a,onChange:v,"aria-label":"basic tabs example",children:[u.jsx($6,{label:"فروش"}),u.jsx($6,{label:"خریداران"})]})}),a===0&&u.jsx(de,{}),a===1&&u.jsx(he,{})]})]})},pe=({item:r,key:a,sellerType:t,fetchData:v,buyerType:p,allocationType:c,sellType:D,updateTable:S,fetchApiData:l,editData:C,coldHouseKey:A,coldHouseItemKey:T,killHouseAllocation:g,priceInfo:o})=>{var Hu;const h=au(),[x,W]=n.useState([]),[R,Y]=n.useState([]),[$,E]=n.useState("governmental"),[q,B]=n.useState("true"),[U,M]=n.useState(null),[X]=n.useContext(hu),[ou,nu]=n.useState(C!=null&&C.image?[{data_url:C.image}]:[]),[lu,P]=n.useState("own"),[f,j]=n.useState(1),[i,su]=n.useState(!1),[w,F]=n.useState(!1),[e,s]=n.useState(null),[L,Z]=n.useState({}),[V,Q]=n.useState(null),[G,gu]=n.useState(null),[du,Fu]=n.useState({governmental:[],free:[]}),[ru,iu]=n.useState(N(new Date).format("YYYY-MM-DD")),_u=y=>{P(y.target.value),Tu({key:"",item:"",buyerType:"",allocationType:""})};n.useEffect(()=>{(o==null?void 0:o.active)===!1&&B("false")},[o==null?void 0:o.active]),n.useEffect(()=>{q==="true"&&(o!=null&&o.active)&&b.setFieldValue("price",o==null?void 0:o.killHousePrice)},[q]);const Lu=y=>{const _=y.target.value;E(_)},Ru=y=>{const _=y.target.value;B(_)},Pu=y=>{if(y&&y.formattedDate){s(y.formattedDate);const _=L[y.formattedDate];if(_&&_.originalDay&&Q(_.originalDay),_&&(_.amount!==void 0||_.value1!==void 0)){const K=_.amount!==void 0?_.amount:_.value1,Cu=Number(typeof K=="string"?K.replace(/,/g,""):K);gu(Number.isFinite(Cu)?Cu:null)}else gu(null)}},ku=n.useCallback(y=>{if(!Array.isArray(y))return{};const _={};return y.forEach(K=>{if(K.day&&K.amount!==void 0){const ju=new N6(new Date(K.day)).format("YYYY/MM/DD"),pu=K.amount,xu=Number(typeof pu=="string"?pu.replace(/,/g,""):pu);_[ju]={value1:xu,originalDay:K.day,active:K.active===!0}}}),_},[]),wu=n.useCallback(y=>{const _=ku(y);Z(_)},[ku]),Eu=n.useCallback(async(y=ru)=>{try{const _=await uu.get("/steward-remain-weight/",{params:{date:y}});if(_.data){Fu({governmental:_.data.governmental||[],free:_.data.free||[]});const K=$==="governmental"?_.data.governmental:_.data.free;wu(K||[])}}catch(_){console.error("Error fetching calendar data:",_)}},[$,wu,ru]),[O,Tu]=n.useState({key:a,item:r,buyerType:p,allocationType:c});n.useEffect(()=>{eu()==="Steward"&&P("free")},[]),n.useEffect(()=>{Eu(ru)},[Eu,ru]),n.useEffect(()=>{if(du.governmental.length>0||du.free.length>0){const y=$==="governmental"?du.governmental:du.free;wu(y),s(null),Q(null),gu(null)}},[$,du,wu]),n.useEffect(()=>{h(I0()).then(y=>{var _;(_=y.payload)!=null&&_.data&&j(y.payload.data.killHouseAllocation)}),C||(h(o6()).then(y=>{W(y.payload.data)}),r||h(T0({free:lu==="free"})).then(y=>{Y(y.payload.data)}))},[h,lu]);const Nu=Du({mobile:I().when([],{is:()=>!C,then:y=>y.required("شماره موبایل الزامی است").min(11,"شماره موبایل باید 11 رقم باشد").max(11,"شماره موبایل باید 11 رقم باشد").matches(/^09\d{9}$/,"شماره موبایل باید با 09 شروع شود و 11 رقم باشد"),otherwise:y=>y.notRequired()}),weight:Wu().required("این فیلد اجباری است!").integer("عدد باید صحیح باشد!").min(1,"یک مقدار مثبت وارد کنید!").test("max-production-date-amount",`وزن نمی‌تواند بیشتر از موجودی تاریخ تولید (${(G==null?void 0:G.toLocaleString())||0} کیلوگرم) باشد!`,function(y){return!G||G===null?!0:y<=G+((C==null?void 0:C.realWeightOfCarcasses)||0)}),price:Wu().required("این فیلد اجباری است!").min(1,"یک مقدار مثبت وارد کنید!"),wholePrice:Wu().required("این فیلد اجباری است!").min(1,"یک مقدار مثبت وارد کنید!"),...g&&{image:I().when([],{is:()=>(!C||i)&&f>0,then:I().required("عکس الزامی است"),otherwise:I().notRequired()})}}),Iu=y=>{var _;y[0]?(b.setFieldValue("image",A6((_=y[0])==null?void 0:_.data_url)),su(!0)):(b.setFieldValue("image",""),su(!0)),nu(y)},b=Yu({initialValues:{mobile:"",weight:(C==null?void 0:C.realWeightOfCarcasses)||"",wholePrice:(C==null?void 0:C.totalAmount)||"",price:(C==null?void 0:C.amount)||"",image:(C==null?void 0:C.image)||""},validationSchema:Nu});n.useEffect(()=>{b.validateForm()},[]),n.useEffect(()=>{b.validateForm()},[G]),n.useEffect(()=>{b.values.weight&&b.values.price&&b.setFieldValue("wholePrice",b.values.price*b.values.weight)},[b.values.price,b.values.weight]);const Gu=()=>{h(t6()),X({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),h(P6()),h(cu({right:!1,bottom:!1,left:!1,content:null})),l&&l(1),S&&S(),v&&v(1)},[mu,zu]=n.useState(null);return u.jsxs(d,{container:!0,xs:12,direction:"column",justifyContent:"center",alignItems:"flex-start",gap:1.8,children:[!C&&u.jsx(vu,{label:"تاریخ ثبت توزیع",id:"date",renderInput:y=>u.jsx(k,{fullWidth:!0,...y,error:!!mu||y.error,helperText:mu||y.helperText}),shouldDisableDate:y=>{const _=N(y),K=N(),Cu=N().subtract(1,"day");return!(_.isSame(K,"day")||_.isSame(Cu,"day"))},value:ru,onChange:y=>{if(!y){zu(null);return}const _=N(y),K=N(),Cu=N().subtract(1,"day");if(!(_.isSame(K,"day")||_.isSame(Cu,"day"))){zu("تنها امکان انتخاب «امروز» یا «دیروز» وجود دارد.");return}zu(null);const pu=N(y).format("YYYY-MM-DD");iu(pu),Eu(pu)}}),!C&&!A&&u.jsx(d,{xs:12,container:!0,children:u.jsx(bu,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"hatching",options:x?x.map(y=>({data:y,label:`${y.name}`})):[],onChange:(y,_)=>{M(_.data)},renderInput:y=>u.jsx(k,{fullWidth:!0,...y,label:"انتخاب محصول"})})}),!C&&u.jsx(s6,{label:"خریداران",children:u.jsx(Vu,{fullWidth:!0,children:u.jsxs(Ou,{row:!0,"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:lu,onChange:_u,sx:{justifyContent:"space-between"},children:[u.jsx(fu,{value:"own",control:u.jsx(Au,{}),label:"صنوف اختصاصی"}),u.jsx(fu,{value:"free",control:u.jsx(Au,{}),label:"صنوف آزاد"})]})})}),!r&&!C&&u.jsx(d,{xs:12,container:!0,children:u.jsx(bu,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"hatching",options:R?R.map(y=>{var _,K;return{data:y,label:`${y!=null&&y.steward?"مباشر":"صنف"} ${y==null?void 0:y.guildsName} ${(_=y==null?void 0:y.user)==null?void 0:_.fullname} (${(K=y==null?void 0:y.user)==null?void 0:K.mobile})`}}):[],onChange:(y,_)=>{var Cu,ju,pu,xu,Uu,Ku,Zu;Tu({item:_==null?void 0:_.data,key:(Cu=_==null?void 0:_.data)==null?void 0:Cu.key,allocationType:(ju=_==null?void 0:_.data)!=null&&ju.steward?"steward_steward":"steward_guild",buyerType:(pu=_==null?void 0:_.data)!=null&&pu.steward?"Steward":"Guild"}),b.setFieldValue("mobile",(Uu=(xu=_==null?void 0:_.data)==null?void 0:xu.user)==null?void 0:Uu.mobile),b.setFieldTouched("mobile",!0,!1),b.validateField("mobile"),new RegExp(/^09\d{9}$/).test((Zu=(Ku=_==null?void 0:_.data)==null?void 0:Ku.user)==null?void 0:Zu.mobile)||F(!0)},renderInput:y=>u.jsx(k,{fullWidth:!0,...y,label:"انتخاب مباشر / صنف"})})}),!r&&!C&&u.jsxs(d,{container:!0,xs:12,alignItems:"center",justifyContent:"center",p:1,gap:J.TINY,sx:{border:2,borderColor:"#e6e6e6",borderRadius:2},children:[u.jsxs(m,{variant:"caption",color:"error",children:[u.jsx(a0,{sx:{ml:-1.25},checked:w,onChange:()=>F(!w)}),"از این قسمت میتوانید تلفن مباشر/صنف را ویرایش کنید."]}),(O==null?void 0:O.key)&&w&&u.jsx(k,{fullWidth:!0,id:"mobile",value:b.values.mobile,error:b.touched.mobile?!!b.errors.mobile:null,onChange:b.handleChange,onBlur:b.handleBlur,helperText:b.touched.mobile&&b.errors.mobile?b.errors.mobile:null,label:"موبایل",autoComplete:"current-password",variant:"outlined"})]}),!r&&!C&&(o==null?void 0:o.active)!==!1&&u.jsx(s6,{label:"نوع فروش",children:u.jsx(Vu,{fullWidth:!0,children:u.jsxs(Ou,{row:!0,"aria-labelledby":"segment-type-radio-group",name:"segmentType",value:q,onChange:Ru,sx:{justifyContent:"space-between"},children:[u.jsx(fu,{value:!0,control:u.jsx(Au,{}),label:"قیمت دولتی"}),u.jsx(fu,{value:!1,control:u.jsx(Au,{}),label:"قیمت آزاد"})]})})}),!r&&!C&&u.jsx(s6,{label:"نوع انبار",children:u.jsx(Vu,{fullWidth:!0,children:u.jsxs(Ou,{row:!0,"aria-labelledby":"segment-type-radio-group",name:"segmentType",value:$,onChange:Lu,sx:{justifyContent:"space-between"},children:[u.jsx(fu,{value:"governmental",control:u.jsx(Au,{}),label:"دولتی"}),u.jsx(fu,{value:"free",control:u.jsx(Au,{}),label:"آزاد"})]})})}),u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:J.TINY,sx:{width:"100%"},direction:"column",children:[u.jsx(G6,{onDateSelect:Pu,dayData:L,selectedDate:e,maxGregorianDate:ru,label:`تاریخ تولید گوشت ${G!==null?`(موجودی: ${G==null?void 0:G.toLocaleString()} کیلوگرم)`:""}`}),V&&ru&&N(V).isAfter(N(ru),"day")&&u.jsx(m,{sx:{color:"#d32f2f",fontSize:"0.75rem",marginTop:"4px",marginRight:"14px",textAlign:"right"},children:"تاریخ تولید نمی‌تواند بعد از تاریخ انتخابی باشد"})]}),u.jsx(r6,{allowLeadingZeros:!0,thousandSeparator:",",decimalScale:0,allowNegative:!1,fullWidth:!0,id:"weight",label:"وزن لاشه",variant:"outlined",value:b.values.weight,error:!G&&!V?!0:b.touched.weight?!!b.errors.weight:G&&b.values.weight>G,onChange:y=>{const _=y.target.value;if(_===""||_===null||_===void 0){b.setFieldValue("weight","");return}const K=Math.floor(Number(_));K>0?b.setFieldValue("weight",K):K===0&&b.setFieldValue("weight","")},onBlur:b.handleBlur,helperText:!G&&!V?"لطفاً ابتدا تاریخ تولید را انتخاب کنید!":b.touched.weight&&b.errors.weight?b.errors.weight:null,disabled:!G&&!V,sx:{"& .MuiFormHelperText-root":{color:G&&b.values.weight>G?"error.main":void 0}}}),u.jsx(r6,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"price",label:"قیمت هر کیلوگرم",variant:"outlined",InputProps:{endAdornment:u.jsx(a6,{position:"start",children:"ریال"})},value:b.values.price,error:b.touched.price?!!b.errors.price:null,onChange:b.handleChange,onBlur:b.handleBlur,helperText:b.touched.price&&b.errors.price?b.errors.price:null}),u.jsx(r6,{disabled:!0,allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,id:"wholePrice",label:"هزینه کل",variant:"outlined",InputProps:{endAdornment:u.jsx(a6,{position:"start",children:"ریال"})},value:b.values.wholePrice,error:b.touched.wholePrice?!!b.errors.wholePrice:null,onChange:b.handleChange,onBlur:b.handleBlur,helperText:b.touched.wholePrice&&b.errors.wholePrice?b.errors.wholePrice:null}),(g||C&&C.image)&&u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsx(m6,{onChange:Iu,images:ou,maxNumber:1,title:"بارگزاری سند"}),b.touched.image&&!!b.errors.image&&u.jsx(m,{color:"error",children:"ثبت تصویر الزامی است"})]}),u.jsxs(d,{container:!0,xs:12,spacing:J.SMALL,children:[u.jsx(d,{xs:6,children:u.jsx(z,{variant:"contained",fullWidth:!0,disabled:C?!b.isValid:!b.isValid||(A?!1:!U)||!((Hu=O==null?void 0:O.item)!=null&&Hu.key)||!V||V&&ru&&N(ru).isBefore(N(V),"day"),onClick:()=>{var _,K,Cu,ju,pu;let y={};T?y={allocation_key:T,number_of_carcasses:0,weight_of_carcasses:b.values.weight,amount:b.values.price,total_amount:b.values.wholePrice,distribution_type:"web",...i&&{image:b.values.image}}:C?y={allocation_key:C==null?void 0:C.key,number_of_carcasses:0,weight_of_carcasses:b.values.weight,amount:b.values.price,total_amount:b.values.wholePrice,distribution_type:"web",...i&&{image:b.values.image}}:(y={seller_type:t,buyer_type:O==null?void 0:O.buyerType,guild_key:(O==null?void 0:O.buyerType)==="Guild"?(_=O==null?void 0:O.item)==null?void 0:_.key:null,steward_key:(O==null?void 0:O.buyerType)==="Steward"?(K=O==null?void 0:O.item)==null?void 0:K.key:null,kill_house_key:(O==null?void 0:O.buyerType)==="KillHouse"?(Cu=O==null?void 0:O.item)==null?void 0:Cu.key:null,cold_house_key:A||null,product_key:A?null:U.key,type:"manual",allocation_type:A?"ColdHouse":O==null?void 0:O.allocationType,number_of_carcasses:0,weight_of_carcasses:b.values.weight,sell_type:D,amount:b.values.price,total_amount:b.values.wholePrice,approved_price_status:q==="true",quota:$,date:ru,production_date:V,distribution_type:"web",...((pu=(ju=O==null?void 0:O.item)==null?void 0:ju.user)==null?void 0:pu.mobile)!==b.values.mobile?{interface_number:b.values.mobile}:{},...ou.length>0&&{image:b.values.image}},y=Object.fromEntries(Object.entries(y).filter(([,xu])=>xu!==null))),C?h(W0(y)).then(xu=>{xu.payload.error?X({vertical:"top",horizontal:"center",msg:xu.payload.error,severity:"error"}):Gu()}):h(B0(y)).then(xu=>{xu.payload.error?X({vertical:"top",horizontal:"center",msg:xu.payload.error,severity:"error"}):Gu()})},children:C?"ویرایش":"ثبت"})}),u.jsx(d,{xs:6,children:u.jsx(z,{fullWidth:!0,variant:"outlined",color:"primary",onClick:()=>{h(cu({right:!1,bottom:!1,content:null}))},children:"انصراف"})})]})]})},xe=()=>{var D;const r=au(),a=n.useRef(null),{stewardProducts:t}=qu(S=>S.stewardSlice),v=d0(),{priceInfo:p}=qu(S=>S.slaughterSlice),c=n.useCallback(async()=>{var S,l;r(l0()),(l=(S=a.current)==null?void 0:S.updateTable)==null||l.call(S)},[r]);return n.useEffect(()=>{c()},[c]),u.jsxs(d,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsx(d,{container:!0,width:"100%",isDashboard:!0,children:u.jsx(i6,{})}),u.jsxs(d,{container:!0,xs:12,my:2,gap:2,children:[u.jsx(z,{disabled:!t||t.length===0,variant:"contained",onClick:()=>{r(cu({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت توزیع/ فروش درون استان",size:{xs:"100%",md:"360px"},content:u.jsx(pe,{fetchData:c,sellerType:"Steward",sellType:"exclusive",priceInfo:p})}))},children:"ثبت توزیع/ فروش"}),u.jsx(z,{disabled:!0,variant:"contained",color:"success",onClick:()=>{v(Y6)},children:"لیست روزانه"})]}),u.jsx(d,{container:!0,xs:12,mt:4,children:u.jsx(c6,{ref:a,handleUpdate:c,priceInfo:p,remainWeight:(D=t[0])==null?void 0:D.totalRemainWeight})})]})},sr=()=>{const{pathname:r}=j6(),a=au(),{distributionInfo:t}=qu(v=>v.stewardSlice);return n.useEffect(()=>{r===f6&&a(Mu())},[a,r]),u.jsx(u.Fragment,{children:u.jsx(F6,{display:"flex",justifyContent:"center",children:u.jsxs(d,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[r===f6?u.jsxs(d,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",children:[u.jsx(d,{container:!0,alignItems:"center",gap:J.SMALL,children:u.jsx(d,{children:u.jsx(m,{variant:"h6",children:"مدیریت انبار"})})}),u.jsxs(d,{container:!0,width:"100%",mb:2,gap:J.SMALL,px:J.SMALL,children:[u.jsx(i6,{}),u.jsx(yu,{title:"اطلاعات پخش",noPagination:!0,isDashboard:!0,data:[[((t==null?void 0:t.totalGovernmentalInputWeight)??0).toLocaleString(),((t==null?void 0:t.totalFreeInputWeight)??0).toLocaleString(),((t==null?void 0:t.totalGovernmentalOutputWeight)??0).toLocaleString(),((t==null?void 0:t.totalFreeOutputWeight)??0).toLocaleString(),((t==null?void 0:t.totalStewardInProvinceAllocationsWeight)??0).toLocaleString(),((t==null?void 0:t.totalStewardFreeSaleBarCarcassesWeight)??0).toLocaleString(),((t==null?void 0:t.segmentationsWeight)??0).toLocaleString(),((t==null?void 0:t.totalGovernmentalRemainWeight)??0).toLocaleString(),((t==null?void 0:t.totalFreeRemainWeight)??0).toLocaleString()]],columns:["وزن دولتی (کیلوگرم)","وزن آزاد (کیلوگرم)","فروش دولتی (کیلوگرم)","فروش آزاد (کیلوگرم)","فروش و توزیع داخل استان (کیلوگرم)","فروش و توزیع خارج استان (کیلوگرم)","وزن قطعه بندی (کیلوگرم)","مانده دولتی (کیلوگرم)","مانده آزاد (کیلوگرم)"]}),u.jsx(yu,{title:"تعهدات",noPagination:!0,isDashboard:!0,data:[[((t==null?void 0:t.totalCommitmentSellingInProvinceGovernmentalWeight)??0).toLocaleString(),((t==null?void 0:t.totalSellingInProvinceGovernmentalWeight)??0).toLocaleString(),((t==null?void 0:t.totalCommitmentSellingInProvinceGovernmentalRemainWeight)??0).toLocaleString(),((t==null?void 0:t.totalCommitmentSellingInProvinceFreeWeight)??0).toLocaleString(),((t==null?void 0:t.totalSellingInProvinceFreeWeight)??0).toLocaleString(),((t==null?void 0:t.totalCommitmentSellingInProvinceFreeRemainWeight)??0).toLocaleString()]],columns:["تعهد دولتی توزیع داخل استان","توزیع دولتی داخل استان","باقیمانده تعهد دولتی توزیع داخل استان","تعهد آزاد توزیع داخل استان","توزیع آزاد داخل استان","باقیمانده تعهد آزاد توزیع داخل استان"],allColors:{color:"green",text:"#332a3d"}})]}),u.jsx(O0,{})]}):u.jsx(c0,{}),r.includes(C6)&&u.jsx(m0,{}),r.includes(h6)&&u.jsx(xe,{}),r.includes(g6)&&u.jsx(X0,{}),r.includes(Y6)&&u.jsx(Y0,{}),r.includes(p6)&&u.jsx(ge,{}),r.includes(x6)&&u.jsx(M0,{})]})})})};export{sr as default}; diff --git a/build/assets/StewardSegmentOperation-B4ydd22p.js b/build/assets/StewardSegmentOperation-B4ydd22p.js new file mode 100644 index 0000000..8c56785 --- /dev/null +++ b/build/assets/StewardSegmentOperation-B4ydd22p.js @@ -0,0 +1,3 @@ +import{a as g,u as G}from"./redux-vendor-B7uoacJt.js";import{L as y,j as C,h as i,X as v,A as Q,G as _,S as Z,N as b,u as le,c as ie,e8 as ce,M as P,b as de}from"./index-CeyyVc1v.js";import{j as t,al as K,ak as k,ar as Ce,B as D,ag as V,ah as z,ai as T,aj as L,aa as he,I as ge,b0 as ye,an as me,ao as Y,b4 as H,ap as q,T as X}from"./mui-vendor-CkIVaoQP.js";import{r as l}from"./react-vendor-CmFgShSM.js";import{M as pe}from"./SlaughterAllocateToGuild-Dfz5LRq5.js";import{L as J}from"./LabelField-B6eRSoQP.js";import{d as Se}from"./Tune-D4M2CAhp.js";import{d as fe}from"./EditOutlined-n5ie2Fmu.js";import{d as Ee}from"./DeleteOutlineOutlined-G071NcE9.js";const Ue=g("SLAUGHTER_GET_BUYER_SERVICE",async(a,{dispatch:u})=>{u(y());const{data:e,status:n}=await C.get("base-out-province-carcasses-buyer/?mobile="+a);return u(i()),{data:e,status:n}}),$e=g("SLAUGHTER_SUBMIT_BUYER_SERVICE",async(a,{dispatch:u})=>{try{u(y());const{data:e,status:n}=await C.post("out-province-carcasses-buyer/",a);return u(i()),{data:e,status:n}}catch(e){return u(i()),{error:e.response.data.result}}}),Ne=g("SLAUGHTER_EDIT_BUYER_SERVICE",async(a,{dispatch:u})=>{try{u(y());const{data:e,status:n}=await C.put("out-province-carcasses-buyer/0/",a);return u(i()),{data:e,status:n}}catch(e){return u(i()),{error:e.response.data.result}}}),Me=g("SLAUGHTER_SUBMIT_OUT_OF_PROVINCE_SELL",async(a,{dispatch:u})=>{try{u(y());const{data:e,status:n}=await C.post("kill_house_free_sale_bar/",a);return u(i()),{data:e,status:n}}catch(e){return u(i()),{error:e.response.data.result}}}),We=g("GUILD_SUBMIT_OUT_OF_PROVINCE_SELL",async(a,{dispatch:u})=>{try{u(y());const{data:e,status:n}=await C.post("steward_free_sale_bar/",a);return u(i()),{data:e,status:n}}catch(e){return u(i()),{error:e.response.data.result}}}),Pe=g("SLAUGHTER_GET_PRICE_SERVICE",async(a,{dispatch:u})=>{u(y());const{data:e,status:n}=await C.get("broadcast-price/",{params:{...a}});return u(i()),{data:e,status:n}}),_e=g("SLAUGHTER_GET_GUILDS_FOR_COMMONLY_USED",async(a,{dispatch:u})=>{u(y());const{data:e,status:n}=await C.get("guilds/",{params:{role:v(),commonly_used:!0,...a}});return u(i()),{data:e,status:n}}),we=g("SLAUGHTER_ADD_DAILY_LIST_SERVICE",async(a,{dispatch:u})=>{u(y());const{data:e,status:n}=await C.post("commonly-used/",{role:v(),guild_key_list:a.guild_key_list,...a});return u(i()),{data:e,status:n}}),Ve=g("SUBMIT_BATCH_ALLOCATIONS",async(a,{dispatch:u})=>{u(y());try{return(await C.post("batch-steward-allocation/",{allocations_list:a})).data}finally{u(i())}}),ze=g("SLAUGHTER_DELETE_DAILY_LIST_SERVICE",async(a,{dispatch:u})=>{u(y());const{data:e,status:n}=await C.delete(`commonly-used/0/?commonly_used_key=${a}`);return u(i()),{data:e,status:n}}),Ye=({updateTable:a})=>{const[u]=l.useContext(Q),e=G(),[n,d]=l.useState([]),[m,w]=l.useState([]);l.useEffect(()=>{(async()=>{e(_e()).then(S=>{d(S.payload.data)})})()},[e]);const x=()=>{e(we({guild_key_list:m.map(o=>o.key)})).then(o=>{o.payload.error?u({vertical:"top",horizontal:"center",msg:"خطا در ثبت لیست",severity:"error"}):(u({vertical:"top",horizontal:"center",msg:"لیست با موفقیت ثبت شد.",severity:"success"}),e(b({right:!1,bottom:!1,content:null})),a(1))})},E=o=>{w(S=>S.filter(p=>p.key!==o))};return t.jsxs(_,{container:!0,direction:"column",gap:Z.SMALL,children:[t.jsx(K,{multiple:!0,disablePortal:!0,id:"guilds-select",options:n,renderTags:()=>null,getOptionLabel:o=>{var S,p;return`${o.steward?"مباشر":"صنف"} ${o.name||o.guildsName} + ${((S=o.user)==null?void 0:S.fullname)||""} + (${((p=o.user)==null?void 0:p.mobile)||""})`},onChange:(o,S)=>{w(S)},sx:{width:"250px"},renderInput:o=>t.jsx(k,{...o,fullWidth:!0,label:"انتخاب مباشر / صنف",placeholder:"انتخاب کنید"})}),t.jsx(_,{container:!0,direction:"column",gap:1,children:m.map(o=>t.jsx(Ce,{label:`${o.steward?"مباشر":"صنف"} ${o.name||o.guildsName}`,onDelete:()=>E(o.key),sx:{width:"fit-content"}},o.key))}),t.jsx(D,{variant:"contained",onClick:x,disabled:m.length===0,children:"ثبت"})]})},He=g("STEWRD_GET_OUT_SELL_SERVICE",async(a,{dispatch:u})=>{u(y());const{data:e,status:n}=await C.get("roles-products/?role="+v());return u(i()),{data:e,status:n}}),xe=g("STEWARD_DELETE_SEGMENT",async(a,{dispatch:u})=>{u(y());try{const{data:e,status:n}=await C.delete(`app-segmentation/0/?key=${a}`);return u(i()),{data:e,status:n}}catch(e){return u(i()),{error:e}}}),Ae=g("STEWARD_SUBMIT_SEGMANT",async(a,{dispatch:u})=>{try{u(y());const{data:e,status:n}=await C.post("app-segmentation/",a);return u(i()),{data:e,status:n}}catch(e){return u(i()),{error:e.response.data.result}}}),be=g("STEWARD_GET_SEGMANT_ROLE_SERVICE",async(a,{dispatch:u})=>{u(y());const{data:e,status:n}=await C.get("guilds/?&all=true",{params:{...a}});return u(i()),{data:e,status:n}}),ve=g("STEWARD_EDIT_SEGMENT_SERVICE",async(a,{dispatch:u})=>{var e,n;u(y());try{const{data:d,status:m}=await C.put("app-segmentation/0/",a);return u(i()),{data:d,status:m}}catch(d){return u(i()),{error:(n=(e=d.response)==null?void 0:e.data)==null?void 0:n.result}}}),je=a=>ie().shape({weight:de().required("وزن لاشه الزامی است").min(.01,"وزن باید بیشتر از 0 باشد").test("max-production-date-amount",`وزن نمی‌تواند بیشتر از موجودی تاریخ تولید (${(a==null?void 0:a.toLocaleString())||0} کیلوگرم) باشد!`,function(u){return!a||a===null?!0:u<=a}),product_key:P().when("segmentType",{is:"own",then:P().required("انتخاب کلید الزامی است")})}),Te=({updateTable:a,productKey:u,editData:e,item:n})=>{const d=G(),[m]=l.useContext(Q),[w,x]=l.useState([]),[E,o]=l.useState("own"),[S]=l.useState("free"),[p,ee]=l.useState("governmental"),[B,O]=l.useState(null),[ue,U]=l.useState(null),[$,te]=l.useState({}),[F,N]=l.useState(null),[h,R]=l.useState(null),[A,re]=l.useState({governmental:[],free:[]}),f=le({initialValues:{product_key:u||(e==null?void 0:e.productkey)||"",weight:(e==null?void 0:e.weight)||"",segmentType:e&&e!=null&&e.guildkey?"free":"own"},validationSchema:je(h),onSubmit:r=>{if(e){const s={weight:r.weight,key:n==null?void 0:n.key};d(ve(s)).then(c=>{var I;(I=c.payload)!=null&&I.error?m({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(d(b({right:!1,bottom:!1,content:null})),a(),m({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}else{let s;if(E==="own")s={product_key:r==null?void 0:r.product_key,weight:r.weight,sale_type:S,quota:p,production_date:F,distribution_type:"web"};else{if(!B){m({vertical:"top",horizontal:"center",msg:"لطفا مباشر یا صنف را انتخاب کنید",severity:"error"});return}s={guild_key:B.key,weight:r.weight,product_key:u||"",sale_type:S,quota:p,production_date:F,distribution_type:"web"}}d(Ae(s)).then(c=>{c.payload.error?m({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(d(b({right:!1,bottom:!1,content:null})),a(),m({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}}}),ae=r=>{const s=r.target.value;o(s),f.setFieldValue("segmentType",s)},ne=r=>{const s=r.target.value;ee(s)},se=r=>{if(r&&r.formattedDate){U(r.formattedDate);const s=$[r.formattedDate];s&&s.originalDay&&N(s.originalDay),s&&s.value1!==void 0?R(s.value1):R(null)}},M=l.useCallback(r=>{if(!Array.isArray(r))return{};const s={};return r.forEach(c=>{if(c.day&&c.amount!==void 0){const oe=new ce(new Date(c.day)).format("YYYY/MM/DD");s[oe]={value1:c.amount,originalDay:c.day,active:c.active===!0}}}),s},[]),j=l.useCallback(r=>{const s=M(r);te(s)},[M]),W=l.useCallback(async()=>{try{const r=await C.get(`/${v()==="Steward"?"steward":"kill-house"}-remain-weight/`);if(r.data){re({governmental:r.data.governmental||[],free:r.data.free||[]});const s=p==="governmental"?r.data.governmental:r.data.free;j(s)}}catch(r){console.error("Error fetching calendar data:",r)}},[p,j]);return l.useEffect(()=>{e||d(be({role:v()})).then(r=>{x(r.payload.data)}),W()},[d,e,W]),l.useEffect(()=>{if(A.governmental.length>0||A.free.length>0){const r=p==="governmental"?A.governmental:A.free;j(r),U(null),N(null),R(null)}},[p,A,j]),l.useEffect(()=>{f.validateForm()},[h]),t.jsx(_,{container:!0,direction:"column",justifyContent:"center",gap:2,children:t.jsx(_,{container:!0,direction:"column",justifyContent:"center",gap:2,pt:2,children:t.jsxs("form",{onSubmit:f.handleSubmit,style:{display:"flex",flexDirection:"column",gap:Z.LARGE+4},children:[!e&&t.jsx(J,{label:"قطعه بندی (کاربر)",children:t.jsx(V,{children:t.jsxs(z,{row:!0,"aria-labelledby":"segment-type-radio-group",name:"segmentType",value:E,onChange:ae,sx:{justifyContent:"space-between"},children:[t.jsx(T,{value:"own",control:t.jsx(L,{}),label:"قطعه بندی (کاربر)"}),t.jsx(T,{value:"free",control:t.jsx(L,{}),label:"تخصیص به قطعه بند"})]})})}),!e&&E==="free"&&t.jsx(_,{xs:12,container:!0,children:t.jsx(K,{fullWidth:!0,style:{minWidth:210},disablePortal:!0,id:"steward-select",options:w?w.map(r=>{var s,c;return{data:r,label:`${r!=null&&r.steward?"مباشر":"صنف"} ${r==null?void 0:r.guildsName} ${(s=r==null?void 0:r.user)==null?void 0:s.fullname} (${(c=r==null?void 0:r.user)==null?void 0:c.mobile})`}}):[],onChange:(r,s)=>{var c;O(s?{item:s==null?void 0:s.data,key:(c=s==null?void 0:s.data)==null?void 0:c.key}:null)},renderInput:r=>t.jsx(k,{fullWidth:!0,...r,label:"انتخاب مباشر / صنف",required:E==="free"})})}),!e&&t.jsx(J,{label:"نوع انبار",children:t.jsx(V,{children:t.jsxs(z,{row:!0,"aria-labelledby":"segment-type-radio-group",name:"segmentType",value:p,onChange:ne,sx:{justifyContent:"space-between"},children:[t.jsx(T,{value:"governmental",control:t.jsx(L,{}),label:"دولتی"}),t.jsx(T,{value:"free",control:t.jsx(L,{}),label:"آزاد"})]})})}),!e&&t.jsx(_,{style:{width:"100%"},container:!0,xs:12,lg:3,justifyContent:"center",alignItems:"center",gap:1,children:t.jsx(pe,{onDateSelect:se,dayData:$,selectedDate:ue,label:`تاریخ تولید گوشت ${h!==null?`(موجودی: ${h==null?void 0:h.toLocaleString()} کیلوگرم)`:""}`})}),t.jsx(k,{id:"weight",name:"weight",label:"وزن لاشه",type:"number",InputProps:{endAdornment:t.jsx(he,{position:"end",children:"کیلوگرم"})},value:f.values.weight,onChange:f.handleChange,onBlur:f.handleBlur,error:f.touched.weight&&!!f.errors.weight||h&&f.values.weight>h,helperText:h&&f.values.weight>h?`وزن نمی‌تواند بیشتر از موجودی تاریخ تولید (${h==null?void 0:h.toLocaleString()} کیلوگرم) باشد!`:f.touched.weight&&f.errors.weight,fullWidth:!0}),t.jsxs(_,{container:!0,spacing:2,children:[t.jsx(_,{xs:6,children:t.jsx(D,{type:"submit",fullWidth:!0,variant:"contained",color:"primary",disabled:!e&&(!F||h&&f.values.weight>h),children:e?"ویرایش":"ثبت"})}),t.jsx(_,{xs:6,children:t.jsx(D,{fullWidth:!0,variant:"outlined",color:"primary",onClick:()=>{d(b({right:!1,bottom:!1,content:null}))},children:"انصراف"})})]})]})})})},qe=({item:a,updateTable:u,productKey:e})=>{const n=G(),[d,m]=l.useState(null),w=p=>{m(p.currentTarget)},x=()=>{m(null)},E=!!d,o=E?"popover":void 0,S=()=>{x(),n(xe(a.key)).then(()=>{u()})};return t.jsxs("div",{children:[t.jsx(ge,{"aria-describedby":o,variant:"contained",color:"primary",onClick:w,children:t.jsx(Se,{})}),t.jsx(ye,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:o,open:E,anchorEl:d,onClose:x,children:t.jsxs(me,{sx:{p:1},children:[t.jsx(Y,{disablePadding:!0,children:t.jsxs(H,{sx:{color:"primary.main"},onClick:()=>{x(),n(b({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ویرایش قطعه بندی",content:t.jsx(Te,{item:a,updateTable:u,editData:a,productKey:e})}))},children:[t.jsx(q,{sx:{minWidth:36,color:"inherit"},children:t.jsx(fe,{fontSize:"small"})}),t.jsx(X,{variant:"body2",children:"ویرایش"})]})}),t.jsx(Y,{disablePadding:!0,children:t.jsxs(H,{sx:{color:"error.main"},onClick:S,children:[t.jsx(q,{sx:{minWidth:36,color:"inherit"},children:t.jsx(Ee,{fontSize:"small"})}),t.jsx(X,{variant:"body2",color:"inherit",children:"حذف"})]})})]})})]})};export{Ye as S,$e as a,Me as b,ze as c,Pe as d,Ve as e,He as f,We as g,qe as h,Te as i,Ue as j,Ne as s}; diff --git a/build/assets/SubSectorWage-C6GLWIJC.js b/build/assets/SubSectorWage-C6GLWIJC.js new file mode 100644 index 0000000..2f19073 --- /dev/null +++ b/build/assets/SubSectorWage-C6GLWIJC.js @@ -0,0 +1 @@ +import{j as u,aX as Au,ak as I,d as uu,I as hu,al as E6,ah as F6,ai as a6,aj as r6,B as V,b0 as b6,an as D6,b4 as M6,ap as R6,aq as I6,T as o6,b2 as eu,b3 as X,b as w6}from"./mui-vendor-CkIVaoQP.js";import{f as s6,r as d}from"./react-vendor-CmFgShSM.js";import{G as S,S as H,h8 as lu,h9 as c6,ha as l6,hb as C6,X as L,hc as Cu,hd as i6,he as d6,hf as A6,hg as iu,hh as h6,hi as S6,hj as g6,L as w,j as b,h as M,A as Q,v as P,W as q,u as p6,c as x6,cs as T6,M as ru,b as f6,N as m,O as y6,C as du,p as Su,hk as P6,hl as L6,hm as O6,hn as Y6}from"./index-CeyyVc1v.js";import{B as $6}from"./BackButton-Crzr7NMa.js";import{N as ou}from"./NavLink-D2GD_ItM.js";import{L as su}from"./LinkItem-DT6qswcs.js";import{l as cu}from"./index.esm-CjWvmHks.js";import{R as K}from"./ResponsiveTable-w7hk7Uq8.js";import{a as W,f as tu,u as G}from"./redux-vendor-B7uoacJt.js";import{d as W6}from"./SystemUpdateAlt-Bu3pObDi.js";import{d as gu}from"./ToggleOffOutlined-Ch26Umk7.js";import{d as pu}from"./ToggleOn-pBgb8alR.js";import{I as B6,f as k6}from"./toBase64-BzgTOHsW.js";import{r as U6}from"./resizeImage-Csf2MO3w.js";import{S as nu}from"./ShowImage-CqhU2hmk.js";import{d as j6}from"./Edit-CqBj1Y2L.js";import{d as z6}from"./Tune-D4M2CAhp.js";import{d as N6}from"./Delete-C5MyLelE.js";import{R as xu,a as fu}from"./index.esm-Bu7XMDZU.js";import"./iconBase-BEJYyZsk.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./Download-DQ-VVIaV.js";import"./Close-_jAEIgMD.js";const V6=()=>{const{pathname:a}=s6();return u.jsx(S,{container:!0,gap:H.SMALL,p:H.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",style:{placeContent:"baseline"},children:u.jsx(S,{container:!0,direction:"column",style:{width:"100%"},children:u.jsxs(S,{container:!0,gap:H.SMALL,justifyContent:"center",children:[u.jsx(ou,{to:L()==="ProvinceOperator"?lu:L()==="AdminX"?c6:L()==="SuperAdmin"?l6:C6,active:a===lu?"true":null,children:u.jsx(su,{icon:u.jsx(cu,{size:30,color:"#244CCC"}),title:"سهم تعاونی",description:"سهم تعاونی"})}),u.jsx(ou,{to:L()==="ProvinceOperator"?Cu:L()==="AdminX"?i6:L()==="SuperAdmin"?d6:A6,active:a===Cu?"true":null,children:u.jsx(su,{icon:u.jsx(cu,{size:30,color:"#244CCC"}),title:"سهم دامپزشک فارم",description:"سهم دامپزشک فارم"})}),u.jsx(ou,{to:L()==="ProvinceOperator"?iu:L()==="AdminX"?h6:L()==="SuperAdmin"?S6:g6,active:a===iu?"true":null,children:u.jsx(su,{icon:u.jsx(cu,{size:30,color:"#244CCC"}),title:"سهم صنف",description:"سهم صنف"})})]})})})},H6=W("SUB_SECTOR_CITY_SHARES_DASHBOARD",async(a,{dispatch:n})=>{n(w());const{data:r,status:C}=await b.get("/union-subsector-wage-dashboard",{params:{...a}});return n(M()),{data:r,status:C}}),q6=W("SUB_SECTOR_DEPOSITS_DASHBOARD",async(a,{dispatch:n})=>{n(w());const{data:r,status:C}=await b.get("/union-subsector-transaction-dashboard");return n(M()),{data:r,status:C}}),v6=W("SUB_SECTOR_CITY_SHARES",async(a,{dispatch:n})=>{n(w());const{data:r,status:C}=await b.get("/city-operator-for-sub-sector",{params:{...a}});return n(M()),{data:r,status:C}}),G6=W("SUB_SECTOR_CITY_SHARES",async(a,{dispatch:n})=>{n(w());const{data:r,status:C}=await b.get("/city-operator-for-sub-sector/?operators=true");return n(M()),{data:r,status:C}}),K6=W("CREATE_TRANSACTION",async(a,{dispatch:n})=>{try{n(w());const{data:r,status:C}=await b.post("sub-sector-transactions/",a);return n(M()),{data:r,status:C}}catch(r){return n(M()),{error:r.response.data.result}}}),Q6=W("CREATE_TRANSACTION",async(a,{dispatch:n})=>{try{n(w());const{data:r,status:C}=await b.put("sub-sector-transactions/0/",a);return n(M()),{data:r,status:C}}catch(r){return n(M()),{error:r.response.data.result}}}),X6=W("DELETE_TRANSACTION",async(a,{dispatch:n})=>{n(w());const{data:r,status:C}=await b.delete("sub-sector-transactions/0/",{params:{transaction_key:a}});return n(M()),{data:r,status:C}}),J6=W("SUB_SECTOR_SHARES",async(a,{dispatch:n})=>{n(w());const{data:r,status:C}=await b.get("/sub-sector-wage-type-percentage/?type="+a);return n(M()),{data:r,status:C}}),Z6=W("EDIT_SHARE",async(a,{dispatch:n})=>{try{n(w());const{data:r,status:C}=await b.put("sub-sector-wage-type-percentage/0/",a);return n(M()),{data:r,status:C}}catch(r){return n(M()),{error:r.response.data.result}}}),m6=W("SUB_SECTOR_VETFARM_SHARES_DASHBOARD",async(a,{dispatch:n})=>{n(w());const{data:r,status:C}=await b.get("/vet_dashboard_wage",{params:{...a}});return n(M()),{data:r,status:C}}),u0=W("SUB_SECTOR_VETFARM_SHARES",async(a,{dispatch:n})=>{n(w());const{data:r,status:C}=await b.get("/vet_for_sub_sector",{params:{...a}});return n(M()),{data:r,status:C}}),e0=W("SUB_SECTOR_VET_FARMS_SHARES",async(a,{dispatch:n})=>{n(w());const{data:r,status:C}=await b.get("/vet_for_sub_sector_transaction");return n(M()),{data:r,status:C}}),t0=W("SUB_SECTOR_STEWARD_FARMS_SHARES",async(a,{dispatch:n})=>{n(w());const{data:r,status:C}=await b.get("/city-guild-for-sub-sector-transactions");return n(M()),{data:r,status:C}}),n0=W("SUB_SECTOR_STEWARD_SHARES_DASHBOARD",async(a,{dispatch:n})=>{n(w());const{data:r,status:C}=await b.get("/city-guild-wage-dashboard",{params:{...a}});return n(M()),{data:r,status:C}}),a0=W("SUB_SECTOR_STEWARD_SHARES",async(a,{dispatch:n})=>{n(w());const{data:r,status:C}=await b.get("/city-guild-for-sub-sector");return n(M()),{data:r,status:C}}),r0=()=>{var h,g,x,j,p,_,y,T,B,O,Y,c,e,R,$,k,U,z,N;const a=tu(D=>D.userSlice.userProfile.key),[,,n,r,C,A]=d.useContext(Q),[v,l]=d.useState(!1);d.useEffect(()=>{const D=P(new Date).format("YYYY-MM-DD");r(D),A(D)},[]);const t=G(),[f]=d.useContext(Q),[E,s]=d.useState([]),[o,F]=d.useState([]);return d.useEffect(()=>{t(H6({date1:v?n:null,date2:v?C:null})).then(D=>{F(D.payload.data)}),t(v6({date1:v?n:null,date2:v?C:null})).then(D=>{var J;const Z=(J=D.payload.data)==null?void 0:J.map((i,_6)=>{var ju,vu,_u,Eu,Fu,bu,Du,Mu,Ru,Iu,wu,Tu,Pu,Lu,Ou,Yu,$u,Wu,Bu,ku,Uu,zu,Nu,Vu,Hu,qu,Gu,Ku,Qu,Xu,Ju,Zu,mu,u6,e6,t6,n6;return[_6+1,i==null?void 0:i.unitName,(ju=i==null?void 0:i.user)==null?void 0:ju.city,`${(vu=i==null?void 0:i.user)==null?void 0:vu.fullname} (${(_u=i==null?void 0:i.user)==null?void 0:_u.mobile})`,Math.round((Eu=i==null?void 0:i.wageInfo)==null?void 0:Eu.poultries),Math.round((Fu=i==null?void 0:i.wageInfo)==null?void 0:Fu.hatchings),(Du=Math.round((bu=i==null?void 0:i.wageInfo)==null?void 0:bu.hatchingsQuantity))==null?void 0:Du.toLocaleString(),(Ru=Math.round((Mu=i==null?void 0:i.wageInfo)==null?void 0:Mu.totalProvinceKillRequestsQuantity))==null?void 0:Ru.toLocaleString(),(wu=Math.round((Iu=i==null?void 0:i.wageInfo)==null?void 0:Iu.totalProvinceKillRequestsWeight))==null?void 0:wu.toLocaleString(),(Pu=Math.round((Tu=i==null?void 0:i.wageInfo)==null?void 0:Tu.totalProvinceCarcassesWeight))==null?void 0:Pu.toLocaleString(),(Ou=Math.round((Lu=i==null?void 0:i.wageInfo)==null?void 0:Lu.totalPureInternalProvinceCarcassesWeight))==null?void 0:Ou.toLocaleString(),($u=Math.round((Yu=i==null?void 0:i.wageInfo)==null?void 0:Yu.totalPureExternalProvinceCarcassesWeight))==null?void 0:$u.toLocaleString(),(Bu=Math.round((Wu=i==null?void 0:i.wageInfo)==null?void 0:Wu.outProvincePoultryRequestQuantity))==null?void 0:Bu.toLocaleString(),(Uu=Math.round((ku=i==null?void 0:i.wageInfo)==null?void 0:ku.outProvincePoultryRequestWeight))==null?void 0:Uu.toLocaleString(),(Nu=Math.round((zu=i==null?void 0:i.wageInfo)==null?void 0:zu.totalKilledQuantity))==null?void 0:Nu.toLocaleString(),(Hu=parseFloat((Vu=i==null?void 0:i.wageInfo)==null?void 0:Vu.hatchingKillingPercent))==null?void 0:Hu.toFixed(1),(Gu=Math.round((qu=i==null?void 0:i.wageInfo)==null?void 0:qu.outProvincePoultryRequestAmount))==null?void 0:Gu.toLocaleString(),(Qu=Math.round((Ku=i==null?void 0:i.wageInfo)==null?void 0:Ku.totalPureInternalProvinceCarcassesAmount))==null?void 0:Qu.toLocaleString(),(Ju=Math.round((Xu=i==null?void 0:i.wageInfo)==null?void 0:Xu.totalPureExternalProvinceCarcassesAmount))==null?void 0:Ju.toLocaleString(),(mu=Math.round((Zu=i==null?void 0:i.wageInfo)==null?void 0:Zu.totalWageAmount))==null?void 0:mu.toLocaleString(),(e6=Math.round((u6=i==null?void 0:i.wageInfo)==null?void 0:u6.cityDeposit))==null?void 0:e6.toLocaleString(),(n6=Math.round((t6=i==null?void 0:i.wageInfo)==null?void 0:t6.totalRemainWageAmount))==null?void 0:n6.toLocaleString()]});s(Z)})},[t,n,C,v]),u.jsxs(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",px:{xs:2,md:0},children:[u.jsxs(S,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",mb:{xs:2,md:0},children:[u.jsx(Au,{icon:u.jsx(gu,{}),checkedIcon:u.jsx(pu,{}),checked:v,onChange:()=>l(!v),color:"primary",size:"large"}),u.jsx(S,{children:u.jsx(q,{disabled:!v,label:"از تاریخ",id:"date",renderInput:D=>u.jsx(I,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...D}),value:n,onChange:D=>{r(P(D).format("YYYY-MM-DD"))}})}),u.jsx(S,{children:u.jsx(q,{disabled:!v,label:"تا تاریخ",id:"date",renderInput:D=>u.jsx(I,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...D}),value:C,onChange:D=>{A(P(D).format("YYYY-MM-DD"))}})})]}),u.jsx(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mb:2,children:u.jsx(K,{columns:["تعداد فارم","تعداد کل جوجه ریزی","حجم کل جوجه ریزی","حجم کل کشتار شده داخل استان","وزن کل کشتار شده داخل استان","وزن لاشه کشتار شده داخل استان","وزن کل لاشه توزیع داخل استان","وزن کل لاشه توزیع خارج استان","حجم کل فروش به خارج استان","وزن کل فروش به خارج استان","حجم کل کشتار شده","درصد کشتار شده نسبت به جوجه ریزی","تعرفه زنده خارج استان (اتحادیه)","تعرفه کشتار و توزیع داخل استان (اتحادیه)","تعرفه کشتار و توزیع خارج استان (اتحادیه)","کل تعرفه سهم اتحادیه استان","تعرفه سهم زیر بخش ها","واریزی اتحادیه به زیر بخش ها","مانده تعرفه"],data:[[(h=Math.round(o==null?void 0:o.poultries))==null?void 0:h.toLocaleString(),(g=Math.round(o==null?void 0:o.hatchings))==null?void 0:g.toLocaleString(),(x=Math.round(o==null?void 0:o.hatchingsQuantity))==null?void 0:x.toLocaleString(),(j=Math.round(o==null?void 0:o.totalProvinceKillRequestsQuantity))==null?void 0:j.toLocaleString(),(p=Math.round(o==null?void 0:o.totalProvinceKillRequestsWeight))==null?void 0:p.toLocaleString(),(_=Math.round(o==null?void 0:o.totalProvinceKillRequestsTotalCarcassesWeight))==null?void 0:_.toLocaleString(),(y=Math.round(o==null?void 0:o.totalProvinceKillRequestsCarcassesWeight))==null?void 0:y.toLocaleString(),(T=Math.round(o==null?void 0:o.totalOutSellingProvinceCarcassesWeight))==null?void 0:T.toLocaleString(),(B=Math.round(o==null?void 0:o.outProvincePoultryRequestQuantity))==null?void 0:B.toLocaleString(),(O=Math.round(o==null?void 0:o.outProvincePoultryRequestWeight))==null?void 0:O.toLocaleString(),(Y=Math.round(o==null?void 0:o.totalKilledQuantity))==null?void 0:Y.toLocaleString(),(c=parseFloat(o==null?void 0:o.hatchingKillingPercent))==null?void 0:c.toFixed(1),(e=Math.round(o==null?void 0:o.unionTotalOutSellingProvinceCarcassesPrice))==null?void 0:e.toLocaleString(),(R=Math.round(o==null?void 0:o.totalPureProvinceCarcassesPrice))==null?void 0:R.toLocaleString(),($=Math.round(o==null?void 0:o.outProvincePoultryRequestAmount))==null?void 0:$.toLocaleString(),(k=Math.round(o==null?void 0:o.unionTotalWage))==null?void 0:k.toLocaleString(),(U=Math.round(o==null?void 0:o.cityTotalWage))==null?void 0:U.toLocaleString(),(z=Math.round(o==null?void 0:o.cityDeposit))==null?void 0:z.toLocaleString(),(N=Math.round(o==null?void 0:o.cityTotalRemainWageAmount))==null?void 0:N.toLocaleString()]],noPagination:!0,isDashboard:!0,title:"خلاصه اطلاعات"})}),u.jsx(K,{paginated:!0,operation:u.jsx(S,{children:u.jsx(uu,{title:"خروجی اکسل",placement:"top",children:u.jsx(hu,{color:"primary",onClick:()=>{f({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const D=`${b.defaults.baseURL}sub_section_of_cooperative_share_detail/?key=${a}${v?`&date1=${n}&date2=${C}`:""}`;window.location.href=D},children:u.jsx(W6,{})})})}),columns:["ردیف","تعاونی","شهر","کاربر","تعداد فارم","تعداد کل جوجه ریزی","حجم کل جوجه ریزی","حجم کل کشتار شده داخل استان","وزن کل کشتار شده داخل استان","وزن لاشه کشتار شده داخل استان","وزن لاشه توزیع داخل استان","وزن لاشه توزیع خارج استان","حجم فروش خارج از استان","وزن فروش خارج از استان","حجم کل کشتار شده","درصد کشتار شده نسبت به جوجه ریزی","تعرفه زنده خارج استان","تعرفه کشتار و توزیع داخل استان","تعرفه کشتار و توزیع خارج استان","مجموع تعرفه","واریزی اتحادیه","مانده تعرفه"],data:E,title:"جزئیات تعرفه"})]})},au=({updateTable:a,isEdit:n,item:r,type:C})=>{var F;const[A]=d.useContext(Q),[v,l]=d.useState([]),[t,f]=d.useState([]),E=G();d.useEffect(()=>{n||(C==="city"?E(G6()).then(h=>{f(h.payload.data)}):C==="vet"?E(e0()).then(h=>{f(h.payload.data)}):E(t0()).then(h=>{f(h.payload.data)}))},[]);const s=p6({initialValues:{from_account:n?r==null?void 0:r.fromAccount:"",to_account:n?r==null?void 0:r.toAccount:"",receiver_key:n?"check":"",type:n?r==null?void 0:r.type:"online",amount:n?r==null?void 0:r.amount:"",transaction_image:n?[r==null?void 0:r.image]:"",selectedDate1:n?r==null?void 0:r.createDate:P(new Date).format("YYYY-MM-DD hh:mm:ss")},validationSchema:x6({from_account:ru().required("این فیلد اجباری است!"),to_account:ru().required("این فیلد اجباری است!"),amount:f6().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),receiver_key:ru().required("این فیلد اجباری است!"),transaction_image:T6().required("این فیلد اجباری است!")})}),o=(h,g)=>{if(h.length===0)s.setFieldValue("transaction_image",[]),l([]);else{const x=h.map(j=>new Promise(p=>{const _=j.file;U6(_,y=>{p(k6(y))})}));Promise.all(x).then(j=>{s.setFieldValue("transaction_image",j),l(h)})}};return d.useEffect(()=>{s.validateForm()},[]),u.jsxs(S,{container:!0,xs:12,direction:"column",gap:1,children:[u.jsx(S,{item:!0,xs:12,children:!n&&u.jsx(E6,{style:{width:"100%"},options:t?t.map(h=>{var g,x,j;return{id:h.key,label:C==="city"?`${h.unitName} / ${(g=h.user)==null?void 0:g.fullname} `:`${(x=h.user)==null?void 0:x.fullname} / ${(j=h.user)==null?void 0:j.mobile} `,item:h}}):[],value:s.values.guild,onChange:(h,g)=>{s.setFieldValue("receiver_key",g==null?void 0:g.id),s.validateForm()},error:s.touched.receiver_key&&!!s.errors.receiver_key,helperText:s.touched.receiver_key&&s.errors.receiver_key,getOptionLabel:h=>h.label,renderInput:h=>u.jsx(I,{...h,label:C==="city"?"انتخاب تعاونی":C==="vet"?"انتخاب دامپزشک":"انتخاب صنف پروتئینی",variant:"outlined"})})}),u.jsx(S,{children:u.jsx(q,{label:"تاریخ واریز",id:"date",renderInput:h=>u.jsx(I,{...h,fullWidth:!0}),value:s.values.selectedDate1,onChange:h=>{s.setFieldValue("selectedDate1",P(h).format("YYYY-MM-DD hh:mm:ss"))}})}),u.jsx(S,{children:u.jsx(I,{fullWidth:!0,id:"amount",value:s.values.amount,error:s.touched.amount?!!s.errors.amount:null,onChange:s.handleChange,onBlur:s.handleBlur,helperText:s.touched.amount&&s.errors.amount?s.errors.amount:null,label:"مبلغ",variant:"outlined"})}),u.jsx(S,{children:u.jsx(I,{fullWidth:!0,id:"from_account",value:s.values.from_account,error:s.touched.from_account?!!s.errors.from_account:null,onChange:s.handleChange,onBlur:s.handleBlur,helperText:s.touched.from_account&&s.errors.from_account?s.errors.from_account:null,label:"حساب مبدا",variant:"outlined"})}),u.jsx(S,{children:u.jsx(I,{fullWidth:!0,id:"to_account",value:s.values.to_account,error:s.touched.to_account?!!s.errors.to_account:null,onChange:s.handleChange,onBlur:s.handleBlur,helperText:s.touched.to_account&&s.errors.to_account?s.errors.to_account:null,label:"حساب مقصد",variant:"outlined"})}),u.jsxs(F6,{row:!0,id:"type",name:"type",value:s.values.type,onChange:s.handleChange,children:[u.jsx(a6,{value:"online",control:u.jsx(r6,{}),label:"آنلاین"}),u.jsx(a6,{value:"bank",control:u.jsx(r6,{}),label:"توسط بانک"})]}),u.jsx(B6,{onChange:o,images:v,maxNumber:1,title:"تصویر تراکنش"}),n&&((F=s.values.transaction_image[0])==null?void 0:F.includes("https"))&&u.jsx(S,{container:!0,justifyContent:"center",alignItems:"center",xs:12,children:u.jsx(nu,{src:s.values.transaction_image[0],size:"100px"})}),u.jsx(V,{variant:"contained",disabled:!s.isValid,fullWidth:!0,onClick:()=>{var h;if(n){let g={transaction_key:r==null?void 0:r.key,image:(h=s.values.transaction_image[0])!=null&&h.includes("https")?null:s.values.transaction_image[0],date:s.values.selectedDate1,from_account:s.values.from_account,to_account:s.values.to_account,type:s.values.type,amount:parseInt(s.values.amount)};g=Object.fromEntries(Object.entries(g).filter(([x,j])=>j!==null)),E(Q6(g)).then(x=>{x.payload.error?A({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):(A({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),a(),E(m({right:!1,bottom:!1,content:null})))})}else{let g={role_key:s.values.receiver_key,role_type:C,image:s.values.transaction_image[0],date:s.values.selectedDate1,from_account:s.values.from_account,to_account:s.values.to_account,type:s.values.type,amount:parseInt(s.values.amount)};g=Object.fromEntries(Object.entries(g).filter(([x,j])=>j!==null)),E(K6(g)).then(x=>{x.payload.error?A({vertical:"top",horizontal:"center",msg:x.payload.error,severity:"error"}):(A({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),a(),E(m({right:!1,bottom:!1,content:null})))})}},children:"ثبت"})]})},yu=({item:a,updateTable:n,type:r})=>{const C=G(),[A,v]=d.useState(null),l=g=>{v(g.currentTarget)},t=()=>{v(null)},f=!!A,E=f?"popover":void 0,[s]=d.useContext(Q),o=()=>{t(),C(m({title:"ویرایش واریزی",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(au,{item:a,updateTable:n,isEdit:!0,type:r})}))},F=()=>{t(),C(y6({title:"آیا مطمئن هستید؟",content:u.jsxs(S,{container:!0,children:[u.jsx(V,{variant:"contained",onClick:()=>{C(X6(a==null?void 0:a.key)).then(g=>{n(),g.payload.error?s({vertical:"top",horizontal:"center",msg:g.payload.error,severity:"error"}):(C(du()),s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),u.jsx(V,{onClick:()=>{C(du())},children:"لغو"})]})}))},h=[{key:"edit",label:"ویرایش",color:"primary.main",icon:u.jsx(j6,{sx:{fontSize:{xs:20,md:18}}}),action:o},{key:"delete",label:"حذف",color:"error.main",icon:u.jsx(N6,{sx:{fontSize:{xs:20,md:18}}}),action:F}];return u.jsxs(S,{container:!0,children:[u.jsx(hu,{"aria-describedby":E,variant:"contained",color:"primary",onClick:l,children:u.jsx(z6,{})}),u.jsx(b6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:E,open:f,anchorEl:A,onClose:t,children:u.jsx(D6,{sx:{p:1},children:h.map(g=>u.jsxs(M6,{onClick:g.action,sx:{borderRadius:1,mb:.5,color:g.color,"&:last-of-type":{mb:0}},children:[u.jsx(R6,{sx:{color:g.color,minWidth:36},children:g.icon}),u.jsx(I6,{primary:u.jsx(o6,{sx:{color:g.color,fontWeight:600,fontSize:{xs:"13px",md:"14px"}},children:g.label})})]},g.key))})})]})},o0=()=>{const[,,a,n,r,C]=d.useContext(Q),A=G(),v=tu(c=>c.userSlice.userProfile.key);d.useEffect(()=>{const c=P(new Date).format("YYYY-MM-DD");n(c),C(c)},[]);const l=c=>{g(c.target.value)},[t,f]=d.useState([]),[E,s]=d.useState(0),[o,F]=d.useState(10),[h,g]=d.useState(""),[x,j]=d.useState(1),[p,_]=d.useState([]),y=async c=>{let e;A(w()),e=await b.get(`sub-sector-transactions/?search=filter&value=${h}&role=${L()}&date1=${a}&date2=${r}&page=${c}&page_size=${o}&type=city`),A(M()),f(e.data.results),s(e.data.count)},T=c=>{y(c),j(c)},B=c=>{F(c),j(1)},O=()=>{y(x!==0?x:1)};d.useEffect(()=>{const c=t==null?void 0:t.map((e,R)=>{var $,k,U,z,N,D,Z,J;return[x===1?R+1:R+o*(x-1)+1,($=e==null?void 0:e.cityOperator)==null?void 0:$.unitName,(U=(k=e==null?void 0:e.cityOperator)==null?void 0:k.user)==null?void 0:U.city,`${(N=(z=e==null?void 0:e.cityOperator)==null?void 0:z.user)==null?void 0:N.fullname} (${(Z=(D=e==null?void 0:e.cityOperator)==null?void 0:D.user)==null?void 0:Z.mobile})`,Su(e==null?void 0:e.createDate),e==null?void 0:e.fromAccount,e==null?void 0:e.toAccount,(e==null?void 0:e.type)==="online"?"آنلاین":"توسط بانک",(J=e==null?void 0:e.amount)==null?void 0:J.toLocaleString(),u.jsx(nu,{src:e==null?void 0:e.image},R),u.jsx(yu,{updateTable:O,item:e,type:"city"},R)]});_(c)},[t]),d.useEffect(()=>{y(1)},[A,a,r,o]);const Y=async c=>{c.preventDefault(),A(w());try{const e=await b.get(`sub-sector-transactions/?role=${L()}&search=filter&value=${h}&date1=${a}&date2=${r}&page=1&page_size=${o}&type=city`);f(e.data.results),s(e.data.count),A(M())}catch(e){console.error("Error fetching data:",e)}};return u.jsxs(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(S,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(V,{variant:"contained",onClick:()=>{A(m({title:"ثبت واریزی",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(au,{updateTable:O,type:"city"})}))},children:"ثبت واریزی"}),u.jsx(S,{children:u.jsx(q,{label:"از تاریخ",id:"date",renderInput:c=>u.jsx(I,{style:{width:"160px"},...c,size:"small"}),value:a,onChange:c=>{n(P(c).format("YYYY-MM-DD"))}})}),u.jsx(S,{children:u.jsx(q,{label:"تا تاریخ",id:"date",renderInput:c=>u.jsx(I,{style:{width:"160px"},...c,size:"small"}),value:r,onChange:c=>{C(P(c).format("YYYY-MM-DD"))}})}),u.jsx(S,{children:u.jsxs("form",{onSubmit:Y,children:[u.jsx(I,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:l}),u.jsx(V,{type:"submit",onClick:Y,endIcon:u.jsx(xu,{}),children:"جستجو"})]})}),u.jsx(uu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${b.defaults.baseURL}city_operator_for_sub_sector_excel/?key=${v}&role=${L()}&search=filter&value=${h}&type=city&date1=${a}&date2=${r}`,rel:"noreferrer",children:u.jsx(V,{color:"success",children:u.jsx(fu,{size:32})})})})]}),u.jsx(K,{data:p,columns:["ردیف","تعاونی","شهر","کاربر","تاریخ واریز","شماره حساب مبدا","شماره حساب مقصد","نوع تراکنش","مبلغ تراکنش (ریال)","سند","عملیات"],handlePageChange:T,totalRows:E,page:x,perPage:o,handlePerRowsChange:B,title:"واریزی ها"})]})},s0=()=>{var f,E,s,o,F,h;const a=G(),[n,r]=d.useState(0),C=(g,x)=>{r(x)},[A,v]=d.useState([]),[l,t]=d.useState([]);return d.useEffect(()=>{a(q6()).then(g=>{t(g.payload.data)}),n===0&&a(v6()).then(g=>{var j;const x=(j=g.payload.data)==null?void 0:j.map((p,_)=>{var y,T,B,O,Y,c,e,R,$,k,U,z,N,D,Z,J,i;return[_+1,p==null?void 0:p.unitName,(y=p==null?void 0:p.user)==null?void 0:y.city,`${(T=p==null?void 0:p.user)==null?void 0:T.fullname} (${(B=p==null?void 0:p.user)==null?void 0:B.mobile})`,(Y=Math.round((O=p==null?void 0:p.wageInfo)==null?void 0:O.outProvincePoultryRequestAmount))==null?void 0:Y.toLocaleString(),(e=Math.round((c=p==null?void 0:p.wageInfo)==null?void 0:c.totalPureInternalProvinceCarcassesAmount))==null?void 0:e.toLocaleString(),($=Math.round((R=p==null?void 0:p.wageInfo)==null?void 0:R.totalPureExternalProvinceCarcassesWeight))==null?void 0:$.toLocaleString(),(U=Math.round((k=p==null?void 0:p.wageInfo)==null?void 0:k.totalWageAmount))==null?void 0:U.toLocaleString(),(N=Math.round((z=p==null?void 0:p.wageInfo)==null?void 0:z.numberOfCityDeposit))==null?void 0:N.toLocaleString(),(Z=Math.round((D=p==null?void 0:p.wageInfo)==null?void 0:D.cityDeposit))==null?void 0:Z.toLocaleString(),(i=Math.round((J=p==null?void 0:p.wageInfo)==null?void 0:J.totalRemainWageAmount))==null?void 0:i.toLocaleString()]});v(x)})},[a,n]),u.jsxs(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsx(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mb:2,children:u.jsx(K,{columns:["تعرفه زنده خارج استان","تعرفه کشتار و توزیع داخل استان","تعرفه کشتار و توزیع خارج استان","مجموع تعرفه","واریزی اتحادیه","مانده تعرفه"],data:[[(f=Math.round(l==null?void 0:l.cityOutProvincePoultryRequest))==null?void 0:f.toLocaleString(),(E=Math.round(l==null?void 0:l.cityProvinceKillRequestWage))==null?void 0:E.toLocaleString(),(s=Math.round(l==null?void 0:l.cityOutProvinceOutSellCarcassesWage))==null?void 0:s.toLocaleString(),(o=Math.round(l==null?void 0:l.cityTotalWage))==null?void 0:o.toLocaleString(),(F=Math.round(l==null?void 0:l.cityDeposit))==null?void 0:F.toLocaleString(),(h=Math.round(l==null?void 0:l.cityTotalRemainWageAmount))==null?void 0:h.toLocaleString()]],noPagination:!0,isDashboard:!0,title:"خلاصه اطلاعات"})}),u.jsx(S,{container:!0,justifyContent:"center",alignItems:"center",mb:H.MEDIUM,mt:H.SMALL,xs:12,children:u.jsxs(eu,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:n,onChange:C,children:[u.jsx(X,{label:"اطلاعات کلی"}),u.jsx(X,{label:"واریزی ها"})]})}),n===0&&u.jsx(K,{columns:["ردیف","تعاونی","شهر","کاربر","تعرفه زنده خارج استان","تعرفه کشتار و توزیع داخل استان","تعرفه کشتار و توزیع خارج استان","مجموع تعرفه","تعداد دفعات واریز","مجموع واریزی اتحادیه","مانده تعرفه"],data:A,title:"اطلاعات کلی واریزی ها",paginated:!0}),n===1&&u.jsx(o0,{})]})},c0=({updateTable:a,item:n})=>{const r=G(),[C]=d.useContext(Q),A=p6({initialValues:{percent:n!=null&&n.percent?n==null?void 0:n.percent:""},validationSchema:x6({percent:f6().typeError("لطفا فیلد را به درستی وارد کنید!").max(100,"درصد صحیح وارد کنید").required("این فیلد اجباری است!")})});return d.useEffect(()=>{A.validateForm()},[]),u.jsxs(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsx(I,{id:"percent",label:"درصد سهم تعاونی ها (از سهم اتحادیه)",variant:"outlined",sx:{width:"100%"},value:A.values.percent,error:A.touched.percent?!!A.errors.percent:null,onChange:A.handleChange,onBlur:A.handleBlur,helperText:A.touched.percent&&A.errors.percent?A.errors.percent:null}),u.jsx(V,{disabled:!A.isValid,fullWidth:!0,variant:"contained",onClick:()=>{r(Z6({sub_sector_wage_type_key:n==null?void 0:n.key,percent:A.values.percent})).then(v=>{v.payload.error?C({vertical:"top",horizontal:"center",msg:v.payload.error,severity:"error"}):(a(),r(du()),C({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ویرایش"})]})},l0=()=>{const a=G(),[n,r]=d.useState([]),C=v=>{let l="";switch(v){case"province-kill-request":l="تعرفه کشتار و توزیع داخل استان";break;case"carcasse-sell":l="تعرفه کشتار داخل استان و توزیع خارج استان";break;case"poultry-sell-out-province":l="فروش زنده به خارج استان";break;default:l="تعرفه کشتار و توزیع داخل استان";break}return l},A=()=>{a(J6("city")).then(v=>{const l=v.payload.data.map((t,f)=>{var E,s,o,F,h,g,x,j,p,_,y;return[f+1,C((s=(E=t==null?void 0:t.percentageOfWageType)==null?void 0:E.wageType)==null?void 0:s.enName),(h=(F=(o=t==null?void 0:t.percentageOfWageType)==null?void 0:o.wageType)==null?void 0:F.amount)==null?void 0:h.toLocaleString(),Math.round(((x=(g=t==null?void 0:t.percentageOfWageType)==null?void 0:g.wageType)==null?void 0:x.amount)/100*((y=(_=(p=(j=t==null?void 0:t.percentageOfWageType)==null?void 0:j.wageType)==null?void 0:p.percentages)==null?void 0:_.filter(T=>(T==null?void 0:T.name)==="اتحادیه")[0])==null?void 0:y.percent)),t==null?void 0:t.percent,u.jsx(hu,{color:"primary",size:"small",onClick:()=>{a(y6({title:"ویرایش",content:u.jsx(c0,{updateTable:A,item:t})}))},children:u.jsx(j6,{})},f)]});r(l)})};return d.useEffect(()=>{A()},[a]),u.jsx(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",direction:"column",children:u.jsx(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsx(K,{columns:["ردیف","ماهیت تعرفه","کل تعرفه (ریال)","سهم اتحادیه (ریال)","درصد سهم تعاونی ها (از سهم اتحادیه)","عملیات"],title:"سهم بندی",data:n,paginated:!0})})})},C0=()=>{const[a,n]=d.useState(0),r=(C,A)=>{n(A)};return u.jsxs(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[u.jsx(S,{container:!0,justifyContent:"center",alignItems:"center",mb:H.MEDIUM,mt:H.SMALL,xs:12,children:u.jsxs(eu,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:a,onChange:r,children:[u.jsx(X,{label:"جزئیات تعرفه"}),u.jsx(X,{label:"واریزی ها"}),u.jsx(X,{label:"سهم بندی"})]})}),a===0&&u.jsx(r0,{}),a===1&&u.jsx(s0,{}),a===2&&u.jsx(l0,{})]})},i0=({getParams:a})=>{const n=G(),[r,C]=d.useState([]);return d.useEffect(()=>{n(a0(a())).then(A=>{var l;const v=(l=A.payload.data)==null?void 0:l.map((t,f)=>{var E,s,o,F,h,g,x,j;return[f+1,`${(E=t==null?void 0:t.user)==null?void 0:E.fullname} (${(s=t==null?void 0:t.user)==null?void 0:s.mobile})`,(o=t==null?void 0:t.user)==null?void 0:o.city,Math.round((F=t==null?void 0:t.wageInfo)==null?void 0:F.buyWeight),Math.round((h=t==null?void 0:t.wageInfo)==null?void 0:h.sellWeight),Math.round((g=t==null?void 0:t.wageInfo)==null?void 0:g.totalWage),Math.round((x=t==null?void 0:t.wageInfo)==null?void 0:x.guildDeposit),Math.round((j=t==null?void 0:t.wageInfo)==null?void 0:j.remainWage)]});C(v)})},[n,a]),u.jsx(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsx(K,{paginated:!0,columns:["ردیف","کاربر","شهر","کل وزن دریافتی","کل وزن فروش رفته","مجموع تعرفه (ریال)","واريزی اتحاديه (ریال)","مانده تعرفه (ریال)"],data:r,title:"اتحادیه های پروتتینی"})})},d0=()=>{const[,,a,n,r,C]=d.useContext(Q),A=G(),v=tu(c=>c.userSlice.userProfile.key);d.useEffect(()=>{const c=P(new Date).format("YYYY-MM-DD");n(c),C(c)},[]);const l=c=>{g(c.target.value)},[t,f]=d.useState([]),[E,s]=d.useState(0),[o,F]=d.useState(10),[h,g]=d.useState(""),[x,j]=d.useState(1),[p,_]=d.useState([]),y=async c=>{let e;A(w()),e=await b.get(`sub-sector-transactions/?search=filter&value=${h}&role=${L()}&date1=${a}&date2=${r}&page=${c}&page_size=${o}&type=guild`),A(M()),f(e.data.results),s(e.data.count)},T=c=>{y(c),j(c)},B=c=>{F(c),j(1)},O=()=>{y(x!==0?x:1)};d.useEffect(()=>{const c=t==null?void 0:t.map((e,R)=>{var $,k,U,z,N;return[x===1?R+1:R+o*(x-1)+1,`${(k=($=e==null?void 0:e.cityGuild)==null?void 0:$.user)==null?void 0:k.fullname} (${(z=(U=e==null?void 0:e.cityGuild)==null?void 0:U.user)==null?void 0:z.mobile})`,Su(e==null?void 0:e.createDate),e==null?void 0:e.fromAccount,e==null?void 0:e.toAccount,(e==null?void 0:e.type)==="online"?"آنلاین":"توسط بانک",(N=e==null?void 0:e.amount)==null?void 0:N.toLocaleString(),u.jsx(nu,{src:e==null?void 0:e.image},R),u.jsx(yu,{updateTable:O,item:e,type:"guild"},R)]});_(c)},[t]),d.useEffect(()=>{y(1)},[A,a,r,o]);const Y=async c=>{c.preventDefault(),A(w());try{const e=await b.get(`sub-sector-transactions/?role=${L()}&search=filter&value=${h}&date1=${a}&date2=${r}&page=1&page_size=${o}&type=vet`);f(e.data.results),s(e.data.count),A(M())}catch(e){console.error("Error fetching data:",e)}};return u.jsxs(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(S,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(V,{variant:"contained",onClick:()=>{A(m({title:"ثبت واریزی",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(au,{updateTable:O,type:"guild"})}))},children:"ثبت واریزی"}),u.jsxs(S,{sx:{display:"flex",gap:1},children:[u.jsx(q,{label:"از تاریخ",id:"date",renderInput:c=>u.jsx(I,{style:{width:"160px"},...c,size:"small"}),value:a,onChange:c=>{n(P(c).format("YYYY-MM-DD"))}}),u.jsx(q,{label:"تا تاریخ",id:"date",renderInput:c=>u.jsx(I,{style:{width:"160px"},...c,size:"small"}),value:r,onChange:c=>{C(P(c).format("YYYY-MM-DD"))}})]}),u.jsx(S,{children:u.jsxs("form",{onSubmit:Y,children:[u.jsx(I,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:l}),u.jsx(V,{type:"submit",onClick:Y,endIcon:u.jsx(xu,{}),children:"جستجو"})]})}),u.jsx(uu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${b.defaults.baseURL}guild_for_sub_sector_excel/?key=${v}&role=${L()}&search=filter&value=${h}&type=guild&date1=${a}&date2=${r}`,rel:"noreferrer",children:u.jsx(V,{color:"success",children:u.jsx(fu,{size:32})})})})]}),u.jsx(K,{data:p,columns:["ردیف","کاربر","تاریخ واریز","شماره حساب مبدا","شماره حساب مقصد","نوع تراکنش","مبلغ تراکنش (ریال)","سند","عملیات"],handlePageChange:T,totalRows:E,page:x,perPage:o,handlePerRowsChange:B,title:"واریزی ها"})]})},A0=()=>{var h,g,x,j,p;const[,,a,n,r,C]=d.useContext(Q),[A,v]=d.useState(0),[l,t]=d.useState([]),[f,E]=d.useState(!1),s=G();d.useEffect(()=>{const _=P(new Date).format("YYYY-MM-DD");n(_),C(_)},[]);const o=(_,y)=>{v(y)},F=()=>({date1:f?a:null,date2:f?r:null});return d.useEffect(()=>{s(n0(F())).then(_=>{t(_.payload.data)})},[s,A,a,r,f]),u.jsxs(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",px:{xs:2,md:0},children:[u.jsxs(S,{container:!0,justifyContent:"center",alignItems:"center",mb:H.MEDIUM,mt:H.SMALL,xs:12,children:[u.jsxs(S,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",mb:{xs:2,md:0},children:[u.jsx(Au,{icon:u.jsx(gu,{}),checkedIcon:u.jsx(pu,{}),checked:f,onChange:()=>E(!f),color:"primary",size:"large"}),u.jsx(S,{children:u.jsx(q,{disabled:!f,label:"از تاریخ",id:"date",renderInput:_=>u.jsx(I,{size:"small",sx:{width:{xs:"126px",md:"160px"}},..._}),value:a,onChange:_=>{n(P(_).format("YYYY-MM-DD"))}})}),u.jsx(S,{children:u.jsx(q,{disabled:!f,label:"تا تاریخ",id:"date",renderInput:_=>u.jsx(I,{size:"small",sx:{width:{xs:"126px",md:"160px"}},..._}),value:r,onChange:_=>{C(P(_).format("YYYY-MM-DD"))}})})]}),u.jsx(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mb:2,children:u.jsx(K,{columns:["کل وزن دریافتی","کل وزن فروش رفته","مجموع تعرفه (ریال)","واريزی اتحاديه (ریال)","مانده تعرفه (ریال)"],data:[[(h=Math.round(l==null?void 0:l.buyWeight))==null?void 0:h.toLocaleString(),(g=Math.round(l==null?void 0:l.sellWeight))==null?void 0:g.toLocaleString(),(x=Math.round(l==null?void 0:l.totalWage))==null?void 0:x.toLocaleString(),(j=Math.round(l==null?void 0:l.guildDeposit))==null?void 0:j.toLocaleString(),(p=Math.round(l==null?void 0:l.remainWage))==null?void 0:p.toLocaleString()]],noPagination:!0,isDashboard:!0,title:"خلاصه اطلاعات"})}),u.jsxs(eu,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:A,onChange:o,children:[u.jsx(X,{label:"اطلاعات کلی"}),u.jsx(X,{label:"واریزی ها"})]})]}),A===0&&u.jsx(i0,{getParams:F}),A===1&&u.jsx(d0,{})]})},h0=({getParams:a})=>{const n=G(),[r,C]=d.useState([]);return d.useEffect(()=>{n(u0(a())).then(A=>{var l;const v=(l=A.payload.data)==null?void 0:l.map((t,f)=>{var E,s,o,F,h,g,x,j,p,_,y,T,B,O,Y,c,e,R,$;return[f+1,`${(E=t==null?void 0:t.user)==null?void 0:E.fullname} (${(s=t==null?void 0:t.user)==null?void 0:s.mobile})`,(o=t==null?void 0:t.user)==null?void 0:o.city,Math.round((F=t==null?void 0:t.wageInfo)==null?void 0:F.totalQuantity),Math.round((h=t==null?void 0:t.wageInfo)==null?void 0:h.totalWeight),(x=Math.round((g=t==null?void 0:t.wageInfo)==null?void 0:g.totalPureInternalProvinceCarcassesAmount))==null?void 0:x.toLocaleString(),(p=Math.round((j=t==null?void 0:t.wageInfo)==null?void 0:j.totalPureExternalProvinceCarcassesAmount))==null?void 0:p.toLocaleString(),(y=Math.round((_=t==null?void 0:t.wageInfo)==null?void 0:_.outProvincePoultryRequestAmount))==null?void 0:y.toLocaleString(),(B=Math.round((T=t==null?void 0:t.wageInfo)==null?void 0:T.totalWage))==null?void 0:B.toLocaleString(),(Y=Math.round((O=t==null?void 0:t.wageInfo)==null?void 0:O.numberOfDeposit))==null?void 0:Y.toLocaleString(),(e=Math.round((c=t==null?void 0:t.wageInfo)==null?void 0:c.vetDepositAmount))==null?void 0:e.toLocaleString(),($=Math.round((R=t==null?void 0:t.wageInfo)==null?void 0:R.totalRemainWage))==null?void 0:$.toLocaleString()]});C(v)})},[n,a]),u.jsx(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:u.jsx(K,{paginated:!0,columns:["ردیف","کاربر","شهر","حجم کشتار (دارای کد قرنطینه)","وزن کشتار (دارای کد قرنطینه)","تعرفه کشتارو توزیع داخل استان (ریال)","تعرفه کشتارو توزیع خارج از استان (ریال)","تعرفه فروش به خارج از استان (ریال)","مجموع تعرفه (ریال)","تعداد دفعات واریز","مجموع واریزی اتحادیه (ریال)","مانده تعرفه (ریال)"],data:r,title:"دامپزشکان"})})},S0=()=>{const[,,a,n,r,C]=d.useContext(Q),A=G(),v=tu(c=>c.userSlice.userProfile.key);d.useEffect(()=>{const c=P(new Date).format("YYYY-MM-DD");n(c),C(c)},[]);const l=c=>{g(c.target.value)},[t,f]=d.useState([]),[E,s]=d.useState(0),[o,F]=d.useState(10),[h,g]=d.useState(""),[x,j]=d.useState(1),[p,_]=d.useState([]),y=async c=>{let e;A(w()),e=await b.get(`sub-sector-transactions/?search=filter&value=${h}&role=${L()}&date1=${a}&date2=${r}&page=${c}&page_size=${o}&type=vet`),A(M()),f(e.data.results),s(e.data.count)},T=c=>{y(c),j(c)},B=c=>{F(c),j(1)},O=()=>{y(x!==0?x:1)};d.useEffect(()=>{const c=t==null?void 0:t.map((e,R)=>{var $,k,U,z,N;return[x===1?R+1:R+o*(x-1)+1,`${(k=($=e==null?void 0:e.vet)==null?void 0:$.user)==null?void 0:k.fullname} (${(z=(U=e==null?void 0:e.vet)==null?void 0:U.user)==null?void 0:z.mobile})`,Su(e==null?void 0:e.createDate),e==null?void 0:e.fromAccount,e==null?void 0:e.toAccount,(e==null?void 0:e.type)==="online"?"آنلاین":"توسط بانک",(N=e==null?void 0:e.amount)==null?void 0:N.toLocaleString(),u.jsx(nu,{src:e==null?void 0:e.image},R),u.jsx(yu,{updateTable:O,item:e,type:"vet"},R)]});_(c)},[t]),d.useEffect(()=>{y(1)},[A,a,r,o]);const Y=async c=>{c.preventDefault(),A(w());try{const e=await b.get(`sub-sector-transactions/?role=${L()}&search=filter&value=${h}&date1=${a}&date2=${r}&page=1&page_size=${o}&type=vet`);f(e.data.results),s(e.data.count),A(M())}catch(e){console.error("Error fetching data:",e)}};return u.jsxs(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(S,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsx(V,{variant:"contained",onClick:()=>{A(m({title:"ثبت واریزی",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:u.jsx(au,{updateTable:O,type:"vet"})}))},children:"ثبت واریزی"}),u.jsxs(S,{sx:{display:"flex",gap:1},children:[u.jsx(q,{label:"از تاریخ",id:"date",renderInput:c=>u.jsx(I,{style:{width:"160px"},...c,size:"small"}),value:a,onChange:c=>{n(P(c).format("YYYY-MM-DD"))}}),u.jsx(q,{label:"تا تاریخ",id:"date",renderInput:c=>u.jsx(I,{style:{width:"160px"},...c,size:"small"}),value:r,onChange:c=>{C(P(c).format("YYYY-MM-DD"))}})]}),u.jsx(S,{children:u.jsxs("form",{onSubmit:Y,children:[u.jsx(I,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:l}),u.jsx(V,{type:"submit",onClick:Y,endIcon:u.jsx(xu,{}),children:"جستجو"})]})}),u.jsx(uu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${b.defaults.baseURL}vet_for_sub_sector_excel/?key=${v}&role=${L()}&search=filter&value=${h}&type=vet&date1=${a}&date2=${r}`,rel:"noreferrer",children:u.jsx(V,{color:"success",children:u.jsx(fu,{size:32})})})})]}),u.jsx(K,{data:p,columns:["ردیف","کاربر","تاریخ واریز","شماره حساب مبدا","شماره حساب مقصد","نوع تراکنش","مبلغ تراکنش (ریال)","سند","عملیات"],handlePageChange:T,totalRows:E,page:x,perPage:o,handlePerRowsChange:B,title:"واریزی ها"})]})},g0=()=>{var h,g,x,j,p,_;const[,,a,n,r,C]=d.useContext(Q),[A,v]=d.useState(0),[l,t]=d.useState([]),[f,E]=d.useState(!1),s=G();d.useEffect(()=>{const y=P(new Date).format("YYYY-MM-DD");n(y),C(y)},[]);const o=(y,T)=>{v(T)},F=()=>({date1:f?a:null,date2:f?r:null});return d.useEffect(()=>{s(m6(F())).then(y=>{t(y.payload.data)})},[s,A,a,r,f]),u.jsxs(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",px:{xs:2,md:0},children:[u.jsxs(S,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(Au,{icon:u.jsx(gu,{}),checkedIcon:u.jsx(pu,{}),checked:f,onChange:()=>E(!f),color:"primary",size:"large"}),u.jsx(S,{children:u.jsx(q,{disabled:!f,label:"از تاریخ",id:"date",renderInput:y=>u.jsx(I,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...y}),value:a,onChange:y=>{n(P(y).format("YYYY-MM-DD"))}})}),u.jsx(S,{children:u.jsx(q,{disabled:!f,label:"تا تاریخ",id:"date",renderInput:y=>u.jsx(I,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...y}),value:r,onChange:y=>{C(P(y).format("YYYY-MM-DD"))}})})]}),u.jsxs(S,{container:!0,justifyContent:"center",alignItems:"center",mb:H.MEDIUM,mt:H.SMALL,xs:12,children:[u.jsx(S,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mb:2,children:u.jsx(K,{columns:["تعرفه کشتار و توزيع داخل استان","تعرفه کشتار و توزيع خارج استان","تعرفه فروش به خارج استان","مجموع تعرفه","واريزی اتحاديه","مانده تعرفه"],data:[[(h=Math.round(l==null?void 0:l.totalPureInternalProvinceCarcassesAmount))==null?void 0:h.toLocaleString(),(g=Math.round(l==null?void 0:l.totalPureExternalProvinceCarcassesAmount))==null?void 0:g.toLocaleString(),(x=Math.round(l==null?void 0:l.outProvincePoultryRequestAmount))==null?void 0:x.toLocaleString(),(j=Math.round(l==null?void 0:l.totalWage))==null?void 0:j.toLocaleString(),(p=Math.round(l==null?void 0:l.vetDepositAmount))==null?void 0:p.toLocaleString(),(_=Math.round(l==null?void 0:l.totalRemainWage))==null?void 0:_.toLocaleString()]],noPagination:!0,isDashboard:!0,title:"خلاصه اطلاعات"})}),u.jsxs(eu,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:A,onChange:o,children:[u.jsx(X,{label:"اطلاعات کلی"}),u.jsx(X,{label:"واریزی ها"})]})]}),A===0&&u.jsx(h0,{getParams:F}),A===1&&u.jsx(S0,{})]})},z0=()=>{const{pathname:a}=s6();return u.jsx(u.Fragment,{children:u.jsx(w6,{display:"flex",justifyContent:"center",children:u.jsxs(S,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[a===P6||a===L6||a===O6||a===Y6?u.jsxs(S,{justifyContent:"center",my:H.MEDIUM,children:[u.jsx(S,{children:u.jsx(o6,{variant:"h6",children:"تعرفه زیربخش ها"})}),u.jsx(V6,{})]}):u.jsx($6,{}),u.jsx(S,{container:!0,justifyContent:"space-between",gap:H.SMALL,children:u.jsxs(S,{xs:12,children:[(a===lu||a===C6||a===l6||a===c6)&&u.jsx(C0,{}),(a===Cu||a===A6||a===d6||a===i6)&&u.jsx(g0,{}),(a===iu||a===g6||a===S6||a===h6)&&u.jsx(A0,{})]})})]})})})};export{z0 as default}; diff --git a/build/assets/Support-B9DfdFaF.js b/build/assets/Support-B9DfdFaF.js new file mode 100644 index 0000000..df9966d --- /dev/null +++ b/build/assets/Support-B9DfdFaF.js @@ -0,0 +1 @@ +import{j as u,aI as i,aJ as o,T as n,aK as a,B as c}from"./mui-vendor-CkIVaoQP.js";import{m as r,G as e,S as t}from"./index-CeyyVc1v.js";import{d as l}from"./Phone-Dv2y8iMM.js";import"./react-vendor-CmFgShSM.js";import"./redux-vendor-B7uoacJt.js";const d="/assets/eita-DbmaOKcl.png",p=()=>{const s=r(l);return u.jsx(i,{display:"flex",justifyContent:"center",children:u.jsx(e,{container:!0,direction:"column",justifyContent:"center",my:t.MEDIUM,xs:12,sm:12,md:10,lg:10,children:u.jsx(o,{children:u.jsxs(e,{p:t.MEDIUM,children:[u.jsx(n,{children:"برای تماس با پشتیبانی می توانید از طریق شماره زیر ارتباط برقرار کنید."}),u.jsxs(e,{mt:5,justifyContent:"center",container:!0,gap:t.MEDIUM,children:[u.jsx(e,{children:u.jsx("a",{style:{textDecoration:"none"},href:"tel:02128421237",children:u.jsxs(e,{container:!0,direction:"row",alignItems:"center",children:[u.jsx(s,{color:"success",transition:{duration:1},animate:{x:5,y:0,scale:1,rotate:250},whileHover:{scale:1.2}}),u.jsx(n,{color:"#29952d",ml:2,children:"021-28421237"})]})})}),u.jsx(e,{children:u.jsx("a",{style:{textDecoration:"none"},href:"https://eitaa.com/Drmirani",children:u.jsxs(e,{container:!0,direction:"row",alignItems:"center",children:[u.jsx(r.div,{color:"success",transition:{duration:1},animate:{x:5,y:0,scale:1,rotate:360},whileHover:{scale:1.2},children:u.jsx(e,{sx:{width:25},children:u.jsx(a,{component:"img",height:"25",image:d,alt:"green iguana"})})}),u.jsx(n,{color:"#29952d",ml:2,children:"پیشتیبانی سامانه رصدیار"})]})})})]}),u.jsx(e,{mt:t.MEDIUM,children:u.jsx("a",{href:"https://anydesk.com/en/downloads/windows?dv=win_exe",children:u.jsx(c,{children:"دانلود نرم افزار ANYDESK"})})})]})})})})};export{p as default}; diff --git a/build/assets/SystemUpdateAlt-Bu3pObDi.js b/build/assets/SystemUpdateAlt-Bu3pObDi.js new file mode 100644 index 0000000..8f21258 --- /dev/null +++ b/build/assets/SystemUpdateAlt-Bu3pObDi.js @@ -0,0 +1 @@ +import{i as t,j as r}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},v=t;Object.defineProperty(e,"__esModule",{value:!0});var o=e.default=void 0,u=v(a()),i=r;o=e.default=(0,u.default)((0,i.jsx)("path",{d:"m12 16.5 4-4h-3v-9h-2v9H8zm9-13h-6v1.99h6v14.03H3V5.49h6V3.5H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-14c0-1.1-.9-2-2-2"}),"SystemUpdateAlt");export{o as d}; diff --git a/build/assets/ThumbUpAlt-HKYD-o6a.js b/build/assets/ThumbUpAlt-HKYD-o6a.js new file mode 100644 index 0000000..c20f85b --- /dev/null +++ b/build/assets/ThumbUpAlt-HKYD-o6a.js @@ -0,0 +1 @@ +import{i as r,j as a}from"./mui-vendor-CkIVaoQP.js";import{r as u}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var i=e.default=void 0,v=o(u()),l=a;i=e.default=(0,v.default)((0,l.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20m6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9"}),"DoNotDisturb");var t={},d=r;Object.defineProperty(t,"__esModule",{value:!0});var s=t.default=void 0,c=d(u()),f=a;s=t.default=(0,c.default)((0,f.jsx)("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97z"}),"ThumbUpAlt");export{s as a,i as d}; diff --git a/build/assets/Ticket1-Bni0L83l.png b/build/assets/Ticket1-Bni0L83l.png new file mode 100644 index 0000000..def7b1f Binary files /dev/null and b/build/assets/Ticket1-Bni0L83l.png differ diff --git a/build/assets/Tickets-rkAj5df6.js b/build/assets/Tickets-rkAj5df6.js new file mode 100644 index 0000000..511fbe8 --- /dev/null +++ b/build/assets/Tickets-rkAj5df6.js @@ -0,0 +1,3 @@ +import{j as e,bh as we,ai as $,aX as J,ag as ee,av as ue,aw as te,ax as se,T as A,al as Ae,ak as U,B as T,s as pe,b as G,ar as Re,am as de,d as je,ci as De,i as fe,I as Oe}from"./mui-vendor-CkIVaoQP.js";import{L as B,j as R,h as S,$ as ae,A as ne,u as ge,c as ve,M as Ce,G as r,V as W,m as Be,e8 as ye,r as Fe,cs as Me,hL as Ue,C as re,p as Ve,O as be,S as he,hM as _e,hN as Le,hO as Pe,hP as Ne,hQ as ze,hR as He,hS as Ke,hT as Xe,hU as Ge}from"./index-CeyyVc1v.js";import{r as i,u as Ee,b as We,j as Te,f as qe}from"./react-vendor-CmFgShSM.js";import{B as Ye}from"./BackButton-Crzr7NMa.js";import{I as Qe,f as $e}from"./toBase64-BzgTOHsW.js";import{a as V,u as q}from"./redux-vendor-B7uoacJt.js";import{d as Je}from"./CloudUpload-BlIgB_r9.js";import{d as Ze}from"./Delete-C5MyLelE.js";import{d as eu}from"./DoneAll-BQY85Rt1.js";import{d as uu}from"./Check-CRb6laYC.js";import{S as tu}from"./ShowImage-CqhU2hmk.js";import{d as su}from"./Download-DQ-VVIaV.js";import{R as Z}from"./ResponsiveTable-w7hk7Uq8.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./Close-_jAEIgMD.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const ke=V("GET_TICKET_PERMISSION",async(a,{dispatch:o})=>{o(B());const{data:u,status:n}=await R.get("ticket-permission/",{params:{role:a.role}});return o(S()),{data:u,status:n}}),me=V("GET_TICKET_USERS_FROM_ROLE",async(a,{dispatch:o})=>{o(B());const u=Array.isArray(a.role)?a.role.join(","):a.role,{data:n,status:h}=await R.get("get-user-from-role/",{params:{role:u}});return o(S()),{data:n,status:h}}),xe=V("CREATE_TICKET",async(a,{dispatch:o})=>{o(B());try{const{data:u,status:n}=await R.post("ticket/",a);return o(S()),{data:u,status:n}}catch(u){return o(S()),{error:u.response.data.result}}}),ru=V("CLOSE_TICKET",async(a,{dispatch:o})=>{o(B());const{data:u,status:n}=await R.put("ticket/0/",a);return o(S()),{data:u,status:n}}),au=V("EDIT_TICKET",async(a,{dispatch:o})=>{o(B());try{const{data:u,status:n}=await R.put("ticket/0/",a);return o(S()),{data:u,status:n}}catch(u){return o(S()),{error:u.response.data.result}}}),nu=V("RESPONSE_TICKET",async(a,{dispatch:o})=>{o(B());const{data:u,status:n}=await R.post("message/",a);return o(S()),{data:u,status:n}}),lu=pe("input")({clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:1,overflow:"hidden",position:"absolute",bottom:0,left:0,whiteSpace:"nowrap",width:1}),ou=({id:a,getMessages:o,fetchMessages:u})=>{var P,N,f;const n=()=>p==="CityOperator"||p==="ProvinceOperator"||p==="AdminX"||p==="Supporter"||p==="SuperAdmin",[h]=ae(),[p,x]=i.useState(h[0]),[d,j]=i.useState(n()?"toRole":"toUser"),[E]=i.useContext(ne),m=Ee(),c=q(),v=l=>{x(l.target.value)},[w,D]=i.useState(!1),_=()=>{D(!w)},M=l=>{const t=l.target.files[0];t&&s.setFieldValue("uploadedFile",t)},y=()=>{s.setFieldValue("uploadedFile",null)},s=ge({initialValues:{title:"",text:"",users:[],roles:[],image:"",uploadedFile:null},validationSchema:ve({title:Ce().required("عنوان تیکت ضروری است"),text:Ce().required("متن تیکت ضروری است")}),onSubmit:l=>{}});i.useEffect(()=>{s.validateForm()},[]),i.useEffect(()=>{n()||j("toUser")},[d,p]);const[g,k]=i.useState([]),I=(l,t)=>{var C;l[0]&&s.setFieldValue("image",$e((C=l[0])==null?void 0:C.data_url)),k(l)},[b,z]=i.useState([]),[F,L]=i.useState([]);i.useEffect(()=>{c(ke({role:p})).then(l=>{z(l.payload.data)})},[p]),i.useEffect(()=>{s.values.roles.length&&d==="toUser"?c(me({role:s.values.roles})).then(l=>{L(l.payload.data)}):L([])},[s.values.roles,d]);const H=l=>{l.target.checked&&(j("toRole"),s.setFieldValue("users",[]),s.setFieldValue("roles",[]))},Y=l=>{l.target.checked&&(j("toUser"),s.setFieldValue("roles",[]),s.setFieldValue("users",[]))};return e.jsxs(r,{container:!0,alignItems:"center",justifyContent:"center",gap:2,width:"100%",children:[isNaN(a)&&e.jsxs(r,{container:!0,justifyContent:"center",xs:12,children:[e.jsx(r,{item:!0,xs:12,container:!0,justifyContent:"center",children:e.jsxs(we,{direction:"row",spacing:4,children:[e.jsx($,{control:e.jsx(J,{checked:d==="toRole",onChange:H,disabled:!n()}),label:"ارسال به نقش"}),e.jsx($,{control:e.jsx(J,{checked:d==="toUser",onChange:Y}),label:"ارسال به اشخاص"})]})}),e.jsx(r,{item:!0,xs:12,container:!0,justifyContent:"center",children:(P=b==null?void 0:b.roles)!=null&&P.length&&(d!=="toRole"||n())?e.jsx(r,{item:!0,xs:12,children:e.jsxs(ee,{fullWidth:!0,children:[e.jsx(ue,{id:"role-select-label",children:"انتخاب نقش"}),e.jsx(te,{multiple:d!=="toUser",labelId:"role-select-label",value:s.values.roles,onChange:l=>{s.setFieldValue("roles",l.target.value)},fullWidth:!0,children:b==null?void 0:b.roles.map((l,t)=>e.jsx(se,{value:l,children:W(l)},t))})]})}):e.jsx(A,{variant:"body1",color:"error",children:"نقش انتخابی اجازه ارسال تیکت ندارد!"})}),d==="toUser"&&e.jsx(e.Fragment,{children:F!=null&&F.length?e.jsx(r,{item:!0,xs:12,mt:2,v:!0,children:e.jsx(Ae,{multiple:!0,id:"tags-standard",options:F,getOptionLabel:l=>l.fullname,onChange:(l,t)=>{s.setFieldValue("users",t)},renderInput:l=>e.jsx(U,{...l,variant:"outlined",label:"انتخاب کاربر"})})}):e.jsx(A,{color:"error",variant:"body2",children:"موردی یافت نشد!"})})]}),h.length>1&&isNaN(a)&&e.jsx(r,{item:!0,xs:12,container:!0,justifyContent:"center",children:e.jsxs(ee,{fullWidth:!0,children:[e.jsx(ue,{id:"role-select-label",children:"انتخاب نقش"}),e.jsx(te,{labelId:"role-select-label",value:p,onChange:v,children:h.map((l,t)=>e.jsx(se,{value:l,children:W(l)},t))})]})}),isNaN(a)&&e.jsx(r,{item:!0,xs:12,container:!0,justifyContent:"center",children:e.jsx(U,{id:"title",name:"title",label:"موضوع",value:s.values.title,onChange:s.handleChange,error:s.touched.title&&!!s.errors.title,helperText:s.touched.title&&s.errors.title})}),e.jsx(r,{item:!0,xs:12,container:!0,justifyContent:"center",children:e.jsx(U,{fullWidth:!0,id:"text",name:"text",label:"پیام خود را وارد کنید",multiline:!0,rows:4,value:s.values.text,onChange:s.handleChange,error:s.touched.text&&!!s.errors.text,helperText:s.touched.text&&s.errors.text})}),e.jsxs(r,{item:!0,xs:12,mt:2,children:[e.jsxs(T,{component:"label",variant:"outlined",startIcon:e.jsx(Je,{}),sx:{mb:1},children:["پیوست فایل",e.jsx(lu,{type:"file",onChange:M})]}),s.values.uploadedFile&&e.jsxs(G,{display:"flex",alignItems:"center",mt:1,children:[e.jsx(Re,{label:s.values.uploadedFile.name,onDelete:y,deleteIcon:e.jsx(Ze,{}),variant:"outlined"}),e.jsxs(A,{variant:"caption",ml:1,children:["حجم: ",(s.values.uploadedFile.size/1024/1024).toFixed(2)," ","MB"]})]}),((N=s.values.uploadedFile)==null?void 0:N.size)>5*1024*1024&&e.jsx(A,{color:"error",variant:"body2",children:"حداکثر حجم مجاز جهت ارسال فایل 5 مگابایت است!"})]}),n()&&isNaN(a)&&e.jsx(r,{container:!0,xs:12,children:e.jsx($,{control:e.jsx(J,{disabled:d==="toUser"&&Array.isArray(s.values.users)&&s.values.users.length===1,size:"small",checked:w,onChange:_}),label:"فقط خواندنی"})}),e.jsx(r,{container:!0,justifyContent:"center",style:{marginTop:"16px"},gap:2,children:e.jsx(Qe,{onChange:I,images:g,maxNumber:1,title:"ارسال تصویر"})}),e.jsx(T,{disabled:((f=s.values.uploadedFile)==null?void 0:f.size)>5*1024*1024||(isNaN(a)?d==="toUser"?!s.isValid||!s.values.users.length:!s.isValid||!s.values.roles.length:!s.values.text),onClick:()=>{var l,t;if(isNaN(a))d==="toUser"?c(xe({type_ticket:((l=s.values.users)==null?void 0:l.length)===1?"single":"public",to_user:s.values.users.map(C=>C==null?void 0:C.key),image:s.values.image?s.values.image:null,title:s.values.title,sender:n()?"user":"admin",message:s.values.text,read_only:((t=s.values.users)==null?void 0:t.length)===1?!1:w,role:p})).then(C=>{C.payload.error?E({vertical:"top",horizontal:"center",msg:C.payload.data.result,severity:"error"}):(s.resetForm(),m(-1),E({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}):c(xe({type_ticket:"public",to_role:s.values.roles,image:s.values.image?s.values.image:null,title:s.values.title,sender:n()?"user":"admin",message:s.values.text,read_only:w,role:p})).then(C=>{C.payload.error?E({vertical:"top",horizontal:"center",msg:C.payload.error,severity:"error"}):(s.resetForm(),m(-1),E({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))});else{const C=new FormData;C.append("message",s.values.text),C.append("sender",n()?"user":"admin"),C.append("send_message",!1),C.append("ticket",a),s.values.image&&C.append("image",s.values.image),s.values.uploadedFile&&C.append("file",s.values.uploadedFile),c(nu(C)).then(K=>{K.payload.error?E({vertical:"top",horizontal:"center",msg:K.payload.data.result,severity:"error"}):(s.resetForm(),k([]),u(),o(),E({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})}},color:"primary",variant:"contained",fullWidth:!0,type:"submit",style:{marginTop:"16px"},children:"ارسال"})]})},cu={hidden:{opacity:0,y:10},visible:{opacity:1,y:0,transition:{duration:.3}}},iu=pe(({className:a,...o})=>e.jsx(je,{...o,classes:{popper:a}}))(({theme:a})=>({[`& .${De.tooltip}`]:{backgroundColor:"#f5f5f9",color:"rgba(0, 0, 0, 0.87)",maxWidth:220,fontSize:a.typography.pxToRem(12),border:"1px solid #dadde9"}})),du=a=>a?a.replace(/\*\*\*/g,` +`).trim().split(` +`).map((n,h)=>e.jsxs(We.Fragment,{children:[n,e.jsx("br",{})]},h)):"",Cu=({data:a})=>{const o=u=>{var n,h;return!!((n=u==null?void 0:u.message)!=null&&n.includes("ارجاع داده شد.")&&((h=u==null?void 0:u.message)!=null&&h.includes("تیکت شماره")))};return e.jsx(r,{container:!0,gap:2,children:a==null?void 0:a.map((u,n)=>{var h,p;return e.jsxs(r,{item:!0,xs:12,component:Be.div,variants:cu,initial:"hidden",animate:"visible",sx:{border:"1px ridge gray",borderRadius:"10px",p:2,backgroundColor:o(u)?"#e7b2b2":"background.paper",boxShadow:4},children:[e.jsxs(r,{container:!0,justifyContent:"space-between",alignItems:"center",children:[e.jsx(A,{color:"text.secondary",children:(h=u==null?void 0:u.createdBy)==null?void 0:h.fullname}),e.jsxs(r,{container:!0,alignItems:"center",spacing:1,justifyContent:"flex-start",children:[e.jsx(A,{color:"text.secondary",children:`${new ye(new Date(u==null?void 0:u.createdAt)).format("dddd DD MMMM")} (${new Date(u==null?void 0:u.createdAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})})`}),u!=null&&u.lastSeen?e.jsx(iu,{disableHoverListener:!(u!=null&&u.readBy),title:e.jsxs(r,{container:!0,xs:12,direction:"column",children:[e.jsx(A,{variant:"body1",color:"primary",children:"بازدید شده توسط"}),(p=u==null?void 0:u.readBy)==null?void 0:p.map((x,d)=>e.jsxs(A,{variant:"body2",children:[x==null?void 0:x.fullname," (",x==null?void 0:x.mobile,")"]},d))]}),children:e.jsx(eu,{sx:{marginLeft:"10px"},color:"primary"})}):e.jsx(uu,{sx:{marginLeft:"10px"},color:"error"})]})]}),e.jsx(de,{sx:{my:1}}),e.jsx(A,{color:o(u)?"#202077":"black",mt:1,sx:{textAlign:"left",width:"100%"},children:du(u==null?void 0:u.message)}),((u==null?void 0:u.picture)||(u==null?void 0:u.file))&&e.jsxs(e.Fragment,{children:[e.jsx(de,{sx:{width:"100%",my:2}}),e.jsxs(r,{container:!0,spacing:2,mt:2,justifyContent:"space-between",alignItems:"center",gap:2,children:[(u==null?void 0:u.picture)&&e.jsx(tu,{src:u==null?void 0:u.picture,size:"100px"}),(u==null?void 0:u.file)&&e.jsx(T,{color:"success",onClick:()=>{const x=u==null?void 0:u.file;window.location.href=x},endIcon:e.jsx(su,{}),children:"دانلود فایل پیوست"})]})]})]},n)})})},hu=V("GET_MESSAGES",async(a,{dispatch:o})=>{const{data:u,status:n}=await R.get("message/",{params:{ticket:a.ticket}});return{data:u,status:n}});var le={},xu=fe;Object.defineProperty(le,"__esModule",{value:!0});var Ie=le.default=void 0,Au=xu(Fe()),pu=e;Ie=le.default=(0,Au.default)((0,pu.jsx)("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h9v-2H4V8l8 5 8-5v5h2V6c0-1.1-.9-2-2-2m-8 7L4 6h16zm7 4 4 4-4 4v-3h-4v-2h4z"}),"ForwardToInbox");const ju=({fetchMessages:a,ticket:o})=>{var m;const[u]=ae(),[n]=i.useContext(ne),[h,p]=i.useState([]),x=q(),d=ge({initialValues:{users:"",roles:[]},validationSchema:ve({users:Me().required("حداقل یک کاربر انتخاب کنید!")}),onSubmit:c=>{}}),[j,E]=i.useState([]);return i.useEffect(()=>{x(ke({role:Ue(u)[0]})).then(c=>{E(c.payload.data)})},[]),i.useEffect(()=>{d.values.roles.length&&x(me({role:d.values.roles})).then(c=>{p(c.payload.data)})},[d.values.roles]),i.useEffect(()=>{d.validateForm()},[x]),e.jsxs(r,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,direction:"column",children:[e.jsx(r,{item:!0,xs:12,children:(m=j==null?void 0:j.roles)!=null&&m.length?e.jsx(r,{item:!0,xs:12,children:e.jsxs(ee,{fullWidth:!0,children:[e.jsx(ue,{id:"role-select-label",children:"انتخاب نقش"}),e.jsx(te,{labelId:"role-select-label",value:d.values.roles,onChange:c=>{d.setFieldValue("roles",c.target.value)},fullWidth:!0,children:j==null?void 0:j.roles.map((c,v)=>e.jsx(se,{value:c,children:W(c)},v))})]})}):e.jsx(A,{variant:"body1",color:"error",children:"نقش انتخابی اجازه ارسال تیکت ندارد!"})}),e.jsx(r,{xs:12,children:h!=null&&h.length?e.jsx(r,{item:!0,xs:12,children:e.jsx(Ae,{multiple:!0,id:"tags-standard",options:h,getOptionLabel:c=>`${c.fullname||"-"} (${c.mobile})`,onChange:(c,v)=>{d.setFieldValue("users",v)},renderInput:c=>e.jsx(U,{...c,variant:"outlined",label:"انتخاب کاربر"})})}):e.jsx(A,{color:"error",variant:"body2",children:"موردی یافت نشد!"})}),e.jsx(T,{disabled:!d.isValid,fullWidth:!0,variant:"contained",onClick:()=>{x(au({ticket:o,referred_to:d.values.users.map(c=>c==null?void 0:c.key)})).then(c=>{c.payload.error?n({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(a(),n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),x(re()))})},children:"ارجاع"})]})},fu=()=>{var E,m,c,v,w,D,_,M,y,s;const{create:a,id:o}=Te(),u=q(),[n,h]=i.useState(),[p,x]=i.useState(),d=()=>{u(hu({ticket:o})).then(g=>{h(g.payload.data)})};i.useEffect(()=>{let g;return a==="false"&&(d(),g=setInterval(d,3e3)),()=>{g&&clearInterval(g)}},[u,o,a]),i.useEffect(()=>{var g,k,I,b;n!=null&&n.length?(((k=(g=n[0])==null?void 0:g.ticket)==null?void 0:k.readOnly)===!0||((b=(I=n[0])==null?void 0:I.ticket)==null?void 0:b.status)==="closed")&&x(!1):x(!0)},[n]);const j=g=>{if(g)return!!g.some(k=>{var I,b;return((I=k.message)==null?void 0:I.includes("ارجاع داده شد."))&&((b=k==null?void 0:k.message)==null?void 0:b.includes("تیکت شماره"))})};return e.jsxs(r,{container:!0,xs:12,justifyContent:"center",children:[e.jsx(r,{container:!0,xs:12,children:e.jsx(Ye,{})}),n&&e.jsxs(r,{container:!0,xs:12,justifyContent:"space-between",alignItems:"center",p:2,mb:2,gap:2,direction:{xs:"column",sm:"row"},sx:{borderStyle:"solid",borderWidth:"1px",borderRadius:"30px",backgroundColor:"#e5e5e5"},children:[e.jsxs(r,{container:!0,alignItems:"center",children:[e.jsxs(A,{children:["عنوان: ","‌‌"]}),e.jsx(A,{children:(m=(E=n[0])==null?void 0:E.ticket)==null?void 0:m.title})]}),e.jsxs(r,{container:!0,alignItems:"center",children:[e.jsxs(A,{children:["تاریخ ایجاد: ","‌‌"]}),e.jsx(A,{children:Ve((v=(c=n[0])==null?void 0:c.ticket)==null?void 0:v.createDate)})]}),e.jsxs(r,{container:!0,alignItems:"center",children:[e.jsxs(A,{children:["وضعیت تیکت: ","‌‌"]}),e.jsxs(A,{children:[((D=(w=n[0])==null?void 0:w.ticket)==null?void 0:D.status)==="open"||((M=(_=n[0])==null?void 0:_.ticket)==null?void 0:M.status)==="answered"?"باز":"بسته",j(n)&&" (ارجاع داده شده) ",((s=(y=n[0])==null?void 0:y.ticket)==null?void 0:s.readOnly)&&"(فقط خواندنی)"]})]}),Object.prototype.hasOwnProperty.call(n[0],"readBy")&&e.jsx(r,{container:!0,alignItems:"center",children:e.jsx(T,{variant:"outlined",endIcon:e.jsx(Ie,{}),onClick:()=>{u(be({title:"ارجاع تیکت",content:e.jsx(ju,{fetchMessages:d,ticket:o})}))},children:"ارجاع"})})]}),p&&e.jsx(r,{xs:12,md:4,justifyContent:"center",alignItems:"center",sx:{paddingRight:"17px"},children:e.jsx(ou,{id:o,fetchMessages:d})}),a==="false"&&e.jsx(r,{xs:12,md:8,sx:{marginTop:{xs:2,md:0}},justifyContent:"center",alignItems:"center",children:e.jsx(Cu,{id:o,data:n})})]})};var oe={},gu=fe;Object.defineProperty(oe,"__esModule",{value:!0});var Se=oe.default=void 0,vu=gu(Fe()),yu=e;Se=oe.default=(0,vu.default)((0,yu.jsx)("path",{d:"M16.83 14H18v-2h-3.17l-1-1H18V9h-6.17l-1-1H18V6H8.83l-4-4H20c1.1 0 2 .9 2 2v15.17zM2.1 2.1.69 3.51 2 4.83V16c0 1.1.9 2 2 2h11.17l5.31 5.31 1.41-1.41zM6 9h.17l2 2H6zm0 5v-2h3.17l2 2z"}),"CommentsDisabled");const Fu="/assets/Ticket1-Bni0L83l.png",bu="/assets/ticket2-DITCR3Yi.png",Eu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAVrSURBVHgB7Zy/U9tIFMcfYBjjyvkLzvwFobwZ7EHXXXe57rpz/gJIwQw/CpsGM1DE6a6zr7urQv4CnDHFdSF/QXTddec0QIYB8n2JlNE4tnbX3h9C2s+MRxJaGeurt7tv374Vkcfj8Xg8HjcsUAbY3d2tYVOLj+/u7kanp6eX9AhwJiCLtrCwsLW4uNh8eHiojp/HudH9/X2/0+m8oAxTIgfs7+9vQaA2C4fPxDLRuffxMQsOsYOrq6uzbrc7ooywSJaBeC1supOsLgnOh8fHx/34mMXDplepVP7Hd/Siau8cqwJG4rVlykLAw7E/tRL7TQj64eDg4Bzf2SSHWGsDYTEBbvpctjzavzVYYMj7kUi9lOJcrotr3sTX2MKKBW5vb1chXk/hkn5SCLSXvwvK1/DpslVy9d7Z2VknS1gREO3WFiXcFBGwpG/Vl9s6VOeA5GkuLy+/4+pto500LmB0E23Z8rC2QdL6YFUtmgEWPbZIk0IaF1BVADjRf8b70Y03aT64wznf29t7RgYwKmDkLEv/8HHXZWlpSddN8+94HXkBWjEqIPtuIn8vybjrguMt0ksblrhNGjFdhVWf+CDeiVyXGmkGlvhSZy9tTED2+0hNAFXXZWZKpdJL0oQxAVF9lQRIui6wvnVF10UJPJwAbs4PpAEjAqr2nuOuC9Dd9n0HHtivpAEjAqq6Lre3t6/ifU2uixA8tKekAVNVOJAtyK7LycnJWXys0XVJBQLWSAPaBVTtPS24LkbRLqBi78mB0UF8YMp1mQRGPB9JA9oj0micX8GKnsuWT3YeHG0ul8sDMgDaZY5w84hkHZ9N7rjI4/F4PHOhbU6Ew/boAJ7Bj9tEY82DdekojA3QaYTsc2L3LTq6ga65k7kF5KABRGuZHLuagHthuDKHEHJAczCzgDzkgnC9xybcBPocyJjVImcSkMPjPMumEizNOCP2XTudzpnqhUukCIfFYf5/YLdM+aGMe/qt0WjQcDh8q3KhkoCc04LNMeWXoF6vf7y4uPhH9gLpKsxBTmzeUQFAm/iTbOciFUxgFwWb11QQuH2P7llcVqaQamZBDqjhnqVm74RVOMrL+0BuCOmrQ+6itx8hOrQmykUUWmCUl+eC50dHR2v4PIGL4SJLtSpjhUIBOQ2X7NOHcP34AP5ZFxtlH21e8OA2RWVSBWy329VoXGubfyf87T1Zhqc/RZ1JqoA3NzcuxMsUKysrQdr5VAE5/E0FB+P9Wtp5kYB5GevOjEgD61n6ecMLOCdOFtpwZJjDRyrBTLg1bZqSKuwyvObEAjkbYd5IcBKO4yWzu2ziRECE0rUvJHQ1Ue5EwFKpFJB+nLhcTgSEtbR0LdHikQJPbHHqLjnASSdCX6MrPV7DMeX8YdRpfANl+Xhq3uG0VZ+mSbVA/KjMLCvNKqKRSOEFFBlRqoBwDUIqOPAYwrTzok4kpIIDB312C+TZ+qJXY4T0Un1WoRuDamz97Rn4n5OGZNaHaWj/LueeEwFvyDK8SCe5RDXa/4UsAwGFWQpCPxBfcubASa1GS1S/zINMezWKBYTzMFKZCbiRc54foALBESMEKdZE5aSGchPeoJF7ZO9ZOjemSFYoa32MdDAB4r0oikujss5FOr1tOBz+V6/XP0HEnynfHML6+rKFlfIDOW+u0WhwtQ8on3wXBRKhnKEKSxxwEiJcix8pR1mqnH8Dy1NOHlUWkGFL3NjY+Bu7Tx775DtPBWDkwxNcf9EMaFnmgB/RNPmOAxM4X+YwDofWV1dX+TUnvG7kaQYX24T4XPLw7Pr6uq/rHYRG397GolYqlRoHBzhFwuZwjF2uKBgaIqIyytJLGz0ej8fj8ejgM4nVRa3gahZdAAAAAElFTkSuQmCC",Tu=()=>{const a=Ee(),o=f=>{c(f.target.value)},[u]=ae(),n=()=>!!(u.includes("CityOperator")||u.includes("ProvinceOperator")||u.includes("AdminX")||u.includes("Supporter")||u.includes("SuperAdmin")),[h,p]=i.useState([]),[x,d]=i.useState(0),[j,E]=i.useState(10),[m,c]=i.useState(""),[v,w]=i.useState(1),[D,_]=i.useState([]),[M]=i.useContext(ne),[y,s]=i.useState("0"),[g,k]=i.useState("0"),[I,b]=i.useState([]),z=async f=>{let l;try{F(B());let t=`ticket/?search=filter&value=${m}&page=${f}&page_size=${j}`;y==="0"?t+="&type=single&status=open":y==="1"?t+="&type=public&status=open":y==="2"&&(t+="&status=closed"),l=await R.get(t),F(S()),p(l.data.results),d(l.data.count)}catch{F(S())}},F=q(),L=f=>{z(f),w(f)},H=f=>{E(f),w(1)},Y=()=>{z(v!==0?v:1)};i.useEffect(()=>{z(1)},[F,j,y]),i.useEffect(()=>{let f=[];const l=h==null?void 0:h.map((t,C)=>{var K,ce,ie;return t!=null&&t.unreadMessage?f[C]=!0:f[C]=!1,[v===1?C+1:C+j*v/2+1,t==null?void 0:t.ticketId,t.typeTicket==="single"?"شخصی":"همگانی",`${t!=null&&t.role?W(t==null?void 0:t.role):""} (${(K=t==null?void 0:t.user)==null?void 0:K.fullname})`,t==null?void 0:t.title,`${(t==null?void 0:t.status)==="open"?`باز${(t==null?void 0:t.readOnly)===!0?" (فقط خواندنی)":""}`:(t==null?void 0:t.status)==="answered"?"پاسخ داده شده":"بسته"}`,t.toUser.length?(ce=t==null?void 0:t.toUser)==null?void 0:ce.map((O,Q)=>{var X;return`${O==null?void 0:O.fullname} ${Q+1!==((X=t==null?void 0:t.toUser)==null?void 0:X.length)?" - ":""}`}):(ie=t==null?void 0:t.toRole)==null?void 0:ie.map((O,Q)=>{var X;return`${W(O.name)} ${Q+1!==((X=t==null?void 0:t.toRole)==null?void 0:X.length)?" - ":""}`}),`${new ye(new Date(t==null?void 0:t.createDate)).format("dddd DD MMMM")} (${new Date(t==null?void 0:t.createDate).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})})`,e.jsxs(r,{xs:12,container:!0,justifyContent:"center",alignItems:"center",gap:1,children:[e.jsx(T,{onClick:()=>{a(`${t==null?void 0:t.ticketId}/false`)},children:"مشاهده"}),n()&&e.jsx(je,{placement:"left",title:"بستن تیکت",children:e.jsx(Oe,{disabled:(t==null?void 0:t.status)==="closed",color:"error",onClick:()=>{F(be({title:"از بستن تیکت اطمینان دارید؟",content:e.jsxs(r,{container:!0,justifyContent:"center",alignItems:"center",children:[e.jsx(A,{color:"error",variant:"caption",children:"در صورت بستن تیکت امکان باز کردن مجدد آن وجود ندارد!"}),e.jsxs(r,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mt:2,gap:2,children:[e.jsx(T,{variant:"contained",onClick:()=>{F(ru({ticket:t==null?void 0:t.ticketId})).then(O=>{O.payload.error?M({vertical:"top",horizontal:"center",msg:O.payload.error,severity:"error"}):(M({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),Y(),F(re()))})},children:"تایید"}),e.jsx(T,{onClick:()=>{F(re())},children:"لغو"})]})]})}))},children:e.jsx(Se,{})})})]},C)]});_(l),b(f)},[h]);const P=async f=>{f.preventDefault(),F(B());try{let l=`ticket/?search=filter&value=${m}&page=1&page_size=${j}`;y==="0"?l+="&type=single":y==="1"?l+="&type=public":y==="2"&&(l+="&status=closed");const t=await R.get(l);p(t.data.results),d(t.data.count),F(S())}catch(l){console.error("Error fetching data:",l)}},N=f=>{s(f),k(f)};return e.jsx(e.Fragment,{children:e.jsx(G,{display:"flex",justifyContent:"center",children:e.jsxs(r,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[e.jsxs(r,{container:!0,direction:"column",width:"100%",gap:2,mb:2,children:[e.jsx(G,{display:"flex",justifyContent:"flex-start",width:"100%",sx:{justifyContent:"start",borderBottom:"1px solid #e2dbdb",width:"100%",pb:1,color:"#2D5FFF"},children:e.jsx(A,{sx:{font_size:"16px"},children:"تیکت های من "})}),e.jsx(G,{display:"flex",justifyContent:"flex-start",width:"100%",children:e.jsx(T,{variant:"contained",onClick:()=>a("noid/true"),children:"ثبت تیکت جدید"})})]}),e.jsx(r,{container:!0,xs:12,justifyContent:"center",alignItems:"center"}),e.jsx(r,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mt:2,children:e.jsxs(r,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:4,children:[e.jsxs(r,{container:!0,justifyContent:"center",direction:"column",style:{cursor:"pointer"},onClick:()=>N("0"),gap:1,children:[e.jsx(r,{item:!0,children:e.jsx("img",{src:Fu,alt:"Personal Tickets",width:70,style:{filter:g==="0"?"saturate(100%) invert(22%) sepia(85%) saturate(746%) hue-rotate(200deg)":"none"}})}),e.jsx(r,{item:!0,children:e.jsx(A,{variant:"caption",children:"تیکت های شخصی"})})]}),e.jsxs(r,{container:!0,justifyContent:"center",direction:"column",style:{cursor:"pointer"},onClick:()=>N("1"),gap:1,children:[e.jsx(r,{item:!0,children:e.jsx("img",{src:bu,style:{filter:g==="1"?"saturate(100%) invert(22%) sepia(85%) saturate(746%) hue-rotate(200deg)":"none"},alt:"Public Tickets",width:70})}),e.jsx(r,{item:!0,children:e.jsx(A,{variant:"caption",children:"تیکت های همگانی"})})]}),e.jsxs(r,{container:!0,justifyContent:"center",direction:"column",style:{cursor:"pointer"},onClick:()=>N("2"),gap:1,children:[e.jsx(r,{item:!0,children:e.jsx("img",{src:Eu,alt:"Closed Tickets",width:70,style:{filter:g==="2"?"saturate(100%) invert(22%) sepia(85%) saturate(746%) hue-rotate(200deg)":"none"}})}),e.jsx(r,{item:!0,children:e.jsx(A,{variant:"caption",children:"تیکت‌های بایگانی"})})]})]})}),y==="0"&&e.jsxs(r,{container:!0,xs:12,children:[e.jsx(r,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,mt:4,children:e.jsxs("form",{onSubmit:P,children:[e.jsx(U,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:o}),e.jsx(T,{type:"submit",children:"جستجو"})]})}),e.jsx(r,{container:!0,xs:12,children:e.jsx(Z,{title:"تیکت های شخصی",columns:["ردیف","شماره تیکت","نوع تیکت","سازنده تیکت","عنوان","وضعیت","ارسال شده به","زمان ارسال","عملیات"],allColors:{color:"#142B73",text:"white"},customColors:[{name:"نوع تیکت",color:"#00B88A",text:"white"}],data:D,handlePageChange:L,totalRows:x,page:v,perPage:j,handlePerRowsChange:H,activeRows:I})})]}),y==="1"&&e.jsxs(r,{container:!0,xs:12,children:[e.jsxs(r,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,mt:4,children:[e.jsx(T,{variant:"contained",onClick:()=>{a("noid/true")},children:"ایجاد تیکت"}),e.jsxs("form",{onSubmit:P,children:[e.jsx(U,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:o}),e.jsx(T,{type:"submit",children:"جستجو"})]})]}),e.jsx(r,{container:!0,xs:12,children:e.jsx(Z,{title:"تیکت های همگانی",columns:["ردیف","شماره تیکت","نوع تیکت","سازنده تیکت","عنوان","وضعیت","ارسال شده به","زمان ارسال","عملیات"],allColors:{color:"#142B73",text:"white"},customColors:[{name:"نوع تیکت",color:"#00B88A",text:"white"}],data:D,handlePageChange:L,totalRows:x,page:v,perPage:j,handlePerRowsChange:H,activeRows:I})})]}),y==="2"&&e.jsxs(r,{container:!0,xs:12,children:[e.jsx(r,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,mt:4,children:e.jsxs("form",{onSubmit:P,children:[e.jsx(U,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:o}),e.jsx(T,{type:"submit",children:"جستجو"})]})}),e.jsx(r,{container:!0,xs:12,children:e.jsx(Z,{title:"تیکت‌های بایگانی‌شده",columns:["ردیف","شماره تیکت","نوع تیکت","سازنده تیکت","عنوان","وضعیت","ارسال شده به","زمان ارسال","عملیات"],allColors:{color:"#142B73",text:"white"},customColors:[{name:"نوع تیکت",color:"#00B88A",text:"white"}],data:D,handlePageChange:L,totalRows:x,page:v,perPage:j,handlePerRowsChange:H,activeRows:I})})]})]})})})},Hu=()=>{const{pathname:a}=qe(),{id:o}=Te();return e.jsx(G,{display:"flex",justifyContent:"center",children:e.jsx(r,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:e.jsx(r,{container:!0,justifyContent:"space-between",gap:he.SMALL,children:e.jsx(r,{xs:12,width:"100%",my:he.MEDIUM,children:!o&&a===_e||a===Le||a===Pe||a===Ne||a===ze||a===He||a===Ke||a===Xe||a===Ge?e.jsx(Tu,{}):e.jsx(fu,{})})})})})};export{Hu as default}; diff --git a/build/assets/Timer-DHCbB9tg.js b/build/assets/Timer-DHCbB9tg.js new file mode 100644 index 0000000..0863610 --- /dev/null +++ b/build/assets/Timer-DHCbB9tg.js @@ -0,0 +1 @@ +import{i as v,j as c,T as d,p}from"./mui-vendor-CkIVaoQP.js";import{r as i}from"./react-vendor-CmFgShSM.js";import{r as m,G as C}from"./index-CeyyVc1v.js";const y=a=>{var r=parseInt(a,10),u=Math.floor(r/3600),e=Math.floor(r/60)%60,o=r%60;return[u,e,o].map(t=>t<10?"0"+t:t).filter((t,s)=>t!=="00"||s>0).join(":")},M=a=>{const r=Number(a);var u=Math.floor(r/(3600*24)),e=Math.floor(r%(3600*24)/3600),o=Math.floor(r%3600/60),t=u>0?u+" روز ":"",s=e>0?e+" ساعت ":"",n=o>0?o+" دقیقه ":"";return t+s+n};var l={},h=v;Object.defineProperty(l,"__esModule",{value:!0});var f=l.default=void 0,x=h(m()),j=c;f=l.default=(0,x.default)((0,j.jsx)("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord");const E=({seconds:a,isFilePaymentTime:r})=>{r=r||!1;const[u,e]=i.useState(Math.round(a)),o=()=>{e(n=>n-1)};i.useEffect(()=>(e(a),()=>e(0)),[a]),i.useEffect(()=>{if(u<=0)return;const n=setInterval(o,1e3);return()=>clearInterval(n)},[]);const t=u<=0?"پایان یافته!":y(u),s=u<=0?"پایان یافته!":M(u);return c.jsxs(C,{container:!0,alignItems:"center",justifyContent:"center",children:[c.jsx(f,{color:"error",fontSize:"small",className:"timerIcon"}),c.jsxs(d,{variant:"body2",children:[!r&&t,r&&s]})]})};E.propTypes={seconds:p.PropTypes.any,isFilePaymentTime:p.PropTypes.any};export{E as T}; diff --git a/build/assets/Titr-CVMh0rmV.ttf b/build/assets/Titr-CVMh0rmV.ttf new file mode 100644 index 0000000..1cb9034 Binary files /dev/null and b/build/assets/Titr-CVMh0rmV.ttf differ diff --git a/build/assets/ToggleOff-D4LkiR4X.js b/build/assets/ToggleOff-D4LkiR4X.js new file mode 100644 index 0000000..7da3990 --- /dev/null +++ b/build/assets/ToggleOff-D4LkiR4X.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,f=o(a()),s=t;u=e.default=(0,f.default)((0,s.jsx)("path",{d:"M17 7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h10c2.76 0 5-2.24 5-5s-2.24-5-5-5M7 15c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3"}),"ToggleOff");export{u as d}; diff --git a/build/assets/ToggleOffOutlined-Ch26Umk7.js b/build/assets/ToggleOffOutlined-Ch26Umk7.js new file mode 100644 index 0000000..76308cb --- /dev/null +++ b/build/assets/ToggleOffOutlined-Ch26Umk7.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,s=o(a()),i=t;u=e.default=(0,s.default)((0,i.jsx)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6m0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4M7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"ToggleOffOutlined");export{u as d}; diff --git a/build/assets/ToggleOn-pBgb8alR.js b/build/assets/ToggleOn-pBgb8alR.js new file mode 100644 index 0000000..a718cf6 --- /dev/null +++ b/build/assets/ToggleOn-pBgb8alR.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,s=o(a()),i=t;u=e.default=(0,s.default)((0,i.jsx)("path",{d:"M17 7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h10c2.76 0 5-2.24 5-5s-2.24-5-5-5m0 8c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3"}),"ToggleOn");export{u as d}; diff --git a/build/assets/TradePanel-nvBox6P7.js b/build/assets/TradePanel-nvBox6P7.js new file mode 100644 index 0000000..f914250 --- /dev/null +++ b/build/assets/TradePanel-nvBox6P7.js @@ -0,0 +1 @@ +import{j as u,d as Mu,I as gu,b as Lu,T as Y,ak as X,B as w,ai as a0,b5 as I0,aL as Ju,aM as Xu,aN as Zu,aX as M0,aa as Vu,b0 as B0,ag as P0,av as b0,aw as _0,ax as xu,b2 as Q0,b3 as t0}from"./mui-vendor-CkIVaoQP.js";import{L as pu,j as U,h as H,G as y,O as yu,A as Iu,c as $0,b as mu,u as v0,C as su,S as Uu,b3 as O0,k as u0,X as M,M as N0,_ as e0,p as Pu,g7 as z0,c5 as Y0,N as w0,W as Wu,v as ju,g8 as U0,g9 as G0,ga as J0,ak as X0}from"./index-CeyyVc1v.js";import{B as Z0}from"./BackButton-Crzr7NMa.js";import{r as o,f as V0}from"./react-vendor-CmFgShSM.js";import{a as fu,u as Fu,f as T0}from"./redux-vendor-B7uoacJt.js";import{a as H0,R as s0}from"./index.esm-Bu7XMDZU.js";import{d as m0}from"./Visibility-DeyjG-oI.js";import{p as u6,a as e6}from"./province-policy-edit-trade-time-range-CFotCa7K.js";import{u as a6}from"./getProvinceName-BujSmyBy.js";import{A as t6}from"./AdvancedChart-DTCDh5lM.js";import{R as Eu}from"./ResponsiveTable-w7hk7Uq8.js";import{d as n6}from"./VpnKey-Di_7HUWD.js";import{d as s6}from"./Tune-D4M2CAhp.js";import{d as l6}from"./Edit-CqBj1Y2L.js";import{d as r6}from"./Delete-C5MyLelE.js";import{a as o6,d as c6}from"./ThumbUpAlt-HKYD-o6a.js";import{d as C6}from"./DoneOutline-DQzOHpRS.js";import{P as l0}from"./ProvinceSettlementPdfKillRequest-ChEooZGT.js";import{d as d6}from"./Info-CZK82--l.js";import"./iconBase-BEJYyZsk.js";import"./chart-vendor-sE2SUVPW.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./PictureAsPdf-oEJEta1d.js";const i6=fu("TRADE_PANEL_GET_DEATILS",async(n,{dispatch:i})=>{var C,A;try{i(pu());const{data:r,status:j}=await U.get("direct-buying-poultry-hatching/",{params:n});return i(H()),{data:r,status:j}}catch(r){return i(H()),{error:((A=(C=r.response)==null?void 0:C.data)==null?void 0:A.result)||r.message}}}),q0=({item:n,details_key:i})=>{const C=Fu(),A=async()=>{var r;try{const j=await C(i6({hatching_key:i}));(r=j.payload)!=null&&r.data?C(yu({title:"جزئیات کشتار",content:u.jsxs(Lu,{sx:{p:2},children:[u.jsxs(Y,{variant:"body1",gutterBottom:!0,children:[u.jsx("strong",{children:"کمترین سن کشتار:"})," ",j.payload.data.minAge," روز"]}),u.jsxs(Y,{variant:"body1",gutterBottom:!0,children:[u.jsx("strong",{children:"بیشترین سن کشتار:"})," ",j.payload.data.maxAge," روز"]}),u.jsxs(Y,{variant:"body1",gutterBottom:!0,children:[u.jsx("strong",{children:"سن فعلی:"})," ",j.payload.data.nowAge," روز"]}),u.jsxs(Y,{variant:"body1",gutterBottom:!0,children:[u.jsx("strong",{children:"میانگین وزن در کشتارهای گذشته:"})," ",j.payload.data.avgWeight," کیلوگرم"]}),u.jsxs(Y,{variant:"body1",gutterBottom:!0,children:[u.jsx("strong",{children:"میانگین افت:"})," ",j.payload.data.avgWeightLosse,"%"]}),u.jsxs(Y,{variant:"body1",gutterBottom:!0,children:[u.jsx("strong",{children:"عملکرد در تحویل بار به کشتار:"})," ",j.payload.data.receiveBarsPercent,"%"]})]})})):C(yu({title:"خطا",content:u.jsx(Y,{children:"دیتایی دریافت نشد!"})}))}catch{C(yu({title:"خطا",content:u.jsx(Y,{children:"مشکل در دریافت دیتا از سرور"})}))}};return u.jsx(y,{container:!0,children:u.jsx(Mu,{title:"مشاهده جزئیات",children:u.jsx(gu,{color:"primary",onClick:A,children:u.jsx(m0,{})})})})},A6=fu("PROVINCE_EDIT_MARKET_REQUEST_SERVICE",async(n,{dispatch:i})=>{try{i(pu());const{data:C,status:A}=await U.put("market-requests/0/",n);return i(H()),{data:C,status:A}}catch(C){return i(H()),{error:C.response.data.result}}}),p6=fu("PROVINCE_MARKET_REQUEST_SERVICE",async(n,{dispatch:i})=>{i(pu());try{const{data:C,status:A}=await U.post("market-requests/",n);return i(H()),{data:C,status:A}}catch(C){return i(H()),{error:C.response.data.result}}});function K0({item:n,updateTable:i,isEdit:C=!1}){const[A,r]=o.useState(null),[j,L]=o.useState(!1),T=Fu(),[E]=o.useContext(Iu),v=$0({killCapacity:mu().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!").max(C?1/0:n==null?void 0:n.remainQuantity,"مقدار وارد شده بیشتر از مانده قابل خرید است"),paymentDeadlineDays:mu().when([],{is:()=>A!==null,then:mu().required("این فیلد الزامی است").min(1,"حداقل مقدار باید 1 باشد").max(A,`حداکثر مقدار باید ${A} باشد`),otherwise:mu().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!")})});o.useEffect(()=>{T(u6()).then(h=>{var g,R,t,k;L(!0);const $=(R=(g=h==null?void 0:h.payload)==null?void 0:g.data)==null?void 0:R.paymentDeadline,d=(k=(t=h==null?void 0:h.payload)==null?void 0:t.data)==null?void 0:k.paymentDeadlineDays;$===!0&&d>0&&r(d)})},[T]);const p=a6();o.useEffect(()=>{x.validateForm()},[A,j]);const x=v0({initialValues:{killCapacity:(n==null?void 0:n.killCapacity)||"",paymentDeadlineDays:(n==null?void 0:n.paymentDeadlineDays)||""},validationSchema:v,onSubmit:h=>{const $={recive_time:"12 - 14",kill_capacity:parseInt(h.killCapacity),payment_deadline_days:parseInt(h.paymentDeadlineDays),...C?{key:n.key}:{poultry_request_key:n.key}},d=C?A6:p6,g=p==="test"||p==="hamedan"?30:5;T(d($)).then(R=>{var k;const t=((k=R==null?void 0:R.payload)==null?void 0:k.error)||(R==null?void 0:R.error);t?(T(su()),i&&typeof i=="function"&&i(),E({vertical:"top",horizontal:"center",msg:t,severity:"error"})):(E({vertical:"top",horizontal:"center",msg:`عملیات با موفقیت انجام شد. برای نهایی کردن خرید ${g} دقیقه فرصت دارد در غیر اینصورت خرید شما حذف می شود.`,severity:"success"}),i(),T(su()))}).catch(R=>{var k,s;const t=((s=(k=R==null?void 0:R.response)==null?void 0:k.data)==null?void 0:s.result)||(R==null?void 0:R.message)||"مشکلی پیش آمده است!";T(su()),E({vertical:"top",horizontal:"center",msg:t,severity:"error"})})}});return o.useEffect(()=>()=>{i&&typeof i=="function"&&i()},[]),u.jsxs(y,{xs:12,container:!0,gap:2,children:[u.jsx(X,{name:"killCapacity",label:"تعداد کشتار",variant:"outlined",type:"number",fullWidth:!0,value:x.values.killCapacity,onChange:x.handleChange,onBlur:x.handleBlur,error:x.touched.killCapacity&&!!x.errors.killCapacity,helperText:x.touched.killCapacity&&x.errors.killCapacity}),u.jsx(X,{name:"paymentDeadlineDays",label:A?`حداکثر مهلت تسویه (حداکثر ${A} روز)`:"حداکثر مهلت تسویه (روز)",variant:"outlined",type:"number",fullWidth:!0,value:x.values.paymentDeadlineDays,onChange:x.handleChange,onBlur:x.handleBlur,error:x.touched.paymentDeadlineDays&&!!x.errors.paymentDeadlineDays,helperText:x.touched.paymentDeadlineDays&&x.errors.paymentDeadlineDays}),u.jsx(w,{disabled:!j,fullWidth:!0,type:"submit",variant:"contained",color:"primary",onClick:x==null?void 0:x.handleSubmit,children:C?"ویرایش":"ثبت"})]})}const h6=({item:n,updateTable:i})=>{const C=Fu();return u.jsx(y,{container:!0,direction:"column",gap:Uu.TINY,width:"100%",children:u.jsx(gu,{disabled:!(n!=null&&n.remainQuantity),variant:"contained",color:"primary",onClick:()=>{C(yu({title:"ثبت خرید",content:u.jsx(K0,{item:n,updateTable:i})}))},children:u.jsx(O0,{})})})},g6=({filters:n,updateFilter:i,handleCityChange:C,handleBreedChange:A,handlePriceFilterSubmit:r,handleAgeFilterSubmit:j,cities:L,chickenBreeds:T})=>{const{showRemaining:E,selectedCities:v,selectedBreeds:p,tempMinPrice:x,tempMaxPrice:h,tempMinAge:$,tempMaxAge:d}=n;return u.jsxs(Lu,{sx:{position:"sticky",top:16},children:[u.jsx(Lu,{mb:2,sx:{p:2,border:"1px solid #e0e0e0",borderRadius:2,backgroundColor:"#ffffff"},children:u.jsx(a0,{control:u.jsx(I0,{checked:E,onChange:g=>i("showRemaining",g.target.checked),sx:{width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"2px",transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:"#244CCC",opacity:1,border:0},"& .MuiSwitch-thumb":{color:"#ffffff"}},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"& .MuiSwitch-thumb":{boxShadow:"0 2px 4px rgba(0,0,0,0.2)",width:22,height:22,color:"#ffffff",backgroundColor:"#ffffff"},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:"#e9e9ea",opacity:1,transition:"background-color 300ms"}}}),label:u.jsx(Y,{variant:"body1",sx:{marginLeft:"10px",fontSize:"0.875rem",color:E?"#244CCC":"text.secondary",fontWeight:E?600:400,transition:"color 0.3s ease"},children:"مانده فروش"})})}),u.jsxs(Ju,{defaultExpanded:!0,sx:{mb:2,border:"1px solid #e0e0e0"},children:[u.jsx(Xu,{expandIcon:u.jsx(u0,{}),children:u.jsx(Y,{variant:"subtitle1",sx:{fontWeight:"bold"},children:"نژاد مرغ"})}),u.jsx(Zu,{sx:{p:2},children:u.jsx(Lu,{display:"flex",flexDirection:"column",children:T.map(g=>u.jsx(a0,{control:u.jsx(M0,{checked:p.includes(g),onChange:()=>A(g)}),label:u.jsx(Y,{variant:"body2",children:g})},g))})})]}),u.jsxs(Ju,{defaultExpanded:!0,children:[u.jsx(Xu,{expandIcon:u.jsx(u0,{}),children:u.jsx(Y,{children:"فیلتر شهرها"})}),u.jsx(Zu,{style:{maxHeight:"400px",overflowY:"auto"},children:u.jsx(Lu,{display:"flex",flexDirection:"column",children:L.map(g=>u.jsx(a0,{control:u.jsx(M0,{checked:v.includes(g.name),onChange:()=>C(g.name)}),label:g.name},g.id))})})]}),u.jsxs(Ju,{defaultExpanded:!0,sx:{mb:2,border:"1px solid #e0e0e0"},children:[u.jsx(Xu,{expandIcon:u.jsx(u0,{}),children:u.jsx(Y,{variant:"subtitle1",sx:{fontWeight:"bold"},children:"محدوده قیمت"})}),u.jsx(Zu,{sx:{p:2},children:u.jsxs(Lu,{display:"flex",flexDirection:"column",gap:2,component:"form",onSubmit:g=>{g.preventDefault(),r()},children:[u.jsx(X,{fullWidth:!0,size:"small",label:"حداقل قیمت",type:"number",value:x,onChange:g=>i("tempMinPrice",g.target.value),InputProps:{endAdornment:u.jsx(Vu,{position:"end",children:"ریال"})}}),u.jsx(X,{fullWidth:!0,size:"small",label:"حداکثر قیمت",type:"number",value:h,onChange:g=>i("tempMaxPrice",g.target.value),InputProps:{endAdornment:u.jsx(Vu,{position:"end",children:"ریال"})}}),u.jsx(w,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,children:"اعمال فیلتر"})]})})]}),u.jsxs(Ju,{defaultExpanded:!0,sx:{mb:2,border:"1px solid #e0e0e0"},children:[u.jsx(Xu,{expandIcon:u.jsx(u0,{}),children:u.jsx(Y,{variant:"subtitle1",sx:{fontWeight:"bold"},children:"محدوده سن"})}),u.jsx(Zu,{sx:{p:2},children:u.jsxs(Lu,{display:"flex",flexDirection:"column",gap:2,component:"form",onSubmit:g=>{g.preventDefault(),j()},children:[u.jsx(X,{fullWidth:!0,size:"small",label:"حداقل سن",type:"number",value:$,onChange:g=>i("tempMinAge",g.target.value),InputProps:{endAdornment:u.jsx(Vu,{position:"end",children:"روز"})}}),u.jsx(X,{fullWidth:!0,size:"small",label:"حداکثر سن",type:"number",value:d,onChange:g=>i("tempMaxAge",g.target.value),InputProps:{endAdornment:u.jsx(Vu,{position:"end",children:"روز"})}}),u.jsx(w,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,children:"اعمال فیلتر"})]})})]})]})},y6=fu("TRADE_PANEL_CHART",async(n,{dispatch:i})=>{try{const{data:C,status:A}=await U.get(`/direct-buying-poultry-requests-chart/?role=${M()}`);return{data:C,status:A}}catch(C){return{error:C.response.data}}}),x6=fu("SLAUGHTER_DELETE_FREE_BUY_SERVICE",async(n,{dispatch:i})=>{i(pu());try{const{data:C,status:A}=await U.delete(`market-requests/0/?key=${n}`);return i(H()),{data:C,status:A}}catch(C){return i(H()),{error:C.response.data.result}}}),n0=fu("PROVINCE_MARKET_REQUEST_FINAL_ACCEPT_SERVICE",async(n,{dispatch:i})=>{i(pu());try{const{data:C,status:A}=await U.put("market-requests/0/",n);return i(H()),{data:C,status:A}}catch(C){return i(H()),{error:C.response.data.result}}}),f6=fu("PROVINCE_TRADE_PANEL_ENTER_MARKET_CODE_SERVICE",async(n,{dispatch:i})=>{try{i(pu());const{data:C,status:A}=await U.put("market-requests/0/",n);return i(H()),{data:C,status:A}}catch(C){return i(H()),{error:C.response.data.result}}}),F6=$0({marketCode:N0().required("کد احراز الزامی است").matches(/^[0-9]+$/,"کد احراز باید فقط شامل اعداد باشد")}),k6=({item:n,updateAll:i})=>{const C=Fu(),[A]=o.useContext(Iu),r=v0({initialValues:{marketCode:(n==null?void 0:n.inputMarketCode)||""},validationSchema:F6,onSubmit:j=>{C(f6({key:n==null?void 0:n.key,input_market_code:j.marketCode})).then(L=>{L.payload.error?A({vertical:"top",horizontal:"center",msg:L.payload.error,severity:"error"}):(A({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),C(su()),i())})}});return u.jsxs(y,{container:!0,xs:12,justifyContent:"center",gap:2,direction:"column",children:[u.jsx(X,{size:"small",fullWidth:!0,label:"کد احراز",name:"marketCode",value:r.values.marketCode,onChange:r.handleChange,onBlur:r.handleBlur,error:r.touched.marketCode&&!!r.errors.marketCode,helperText:r.touched.marketCode&&r.errors.marketCode}),u.jsx(w,{onClick:r.handleSubmit,type:"submit",variant:"contained",color:"primary",fullWidth:!0,disabled:!r.isValid,children:"ثبت"})]})},S6=({item:n,updateTable:i,updateTable2:C})=>{const A=Fu(),[r]=o.useContext(Iu),[j,L]=o.useState(null),T=h=>{L(h.currentTarget)},E=()=>{L(null)},v=!!j,p=v?"popover":void 0,x=()=>{i(),C()};return u.jsxs(y,{container:!0,children:[u.jsx(gu,{disabled:M()!=="KillHouse"?(n==null?void 0:n.marketFinalAccept)===!1?!0:n.marketState!=="pending":(n==null?void 0:n.marketFinalAccept)===!1?!1:!((n==null?void 0:n.marketCodeStatus)===!0&&!(n!=null&&n.inputMarketCode)&&n.marketState==="pending"),"aria-describedby":p,variant:"contained",color:"primary",onClick:T,children:u.jsx(s6,{})}),u.jsx(B0,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:p,open:v,anchorEl:j,onClose:E,children:u.jsx("div",{style:{padding:"20px",display:"flex",flexDirection:"column"},children:u.jsxs(y,{container:!0,direction:"column",children:[M()==="KillHouse"&&(n==null?void 0:n.marketCodeStatus)===!0&&!(n!=null&&n.inputMarketCode)&&(n==null?void 0:n.marketFinalAccept)===!0&&u.jsx(Mu,{title:"ورود کد احراز",placement:"right",children:u.jsx(gu,{color:"primary",onClick:()=>{E(),A(yu({title:"ورود کد احراز",content:u.jsx(k6,{item:n,updateAll:x})}))},children:u.jsx(n6,{})})}),M()==="KillHouse"&&!(n!=null&&n.marketFinalAccept)&&u.jsx(Mu,{title:"تایید نهایی",placement:"right",children:u.jsx(gu,{color:"primary",onClick:()=>{E(),A(yu({title:"آیا مطمئن هستید؟",content:u.jsxs(y,{container:!0,children:[u.jsx(w,{variant:"contained",onClick:()=>{A(n0({key:n==null?void 0:n.key,market_final_accept:!0})).then(h=>{var $,d;($=h==null?void 0:h.payload)!=null&&$.error?r({vertical:"top",horizontal:"center",msg:(d=h==null?void 0:h.payload)==null?void 0:d.error,severity:"error"}):(A(su()),x(),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),u.jsx(w,{onClick:()=>{A(su())},children:"لغو"})]})}))},children:u.jsx(o6,{})})}),M()==="KillHouse"&&(n==null?void 0:n.marketFinalAccept)===!1&&u.jsx(Mu,{title:"ویرایش خرید",placement:"right",children:u.jsx(gu,{color:"primary",onClick:()=>{E(),A(yu({title:"ویرایش خرید",content:u.jsx(K0,{item:n,updateTable:x,isEdit:!0},"purchase")}))},children:u.jsx(l6,{})})}),M()==="KillHouse"&&u.jsx(Mu,{title:"حذف",placement:"right",children:u.jsx(gu,{color:"error",onClick:()=>{E(),A(yu({title:"آیا مطمئن هستید؟",content:u.jsxs(y,{container:!0,children:[u.jsx(w,{variant:"contained",onClick:()=>{A(x6(n.key)).then(h=>{h.error?r({vertical:"top",horizontal:"center",msg:h.error,severity:"error"}):(x(),A(su()),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),u.jsx(w,{onClick:()=>{A(su())},children:"لغو"})]})}))},children:u.jsx(r6,{})})}),(M()==="ProvinceOperator"||M()==="SuperAdmin"||M()==="AdminX")&&u.jsx(Mu,{title:"تایید",placement:"right",children:u.jsx(gu,{disabled:M()==="KillHouse"&&(n==null?void 0:n.marketFinalAccept)===!0,color:"primary",onClick:()=>{E(),A(yu({title:"آیا مطمئن هستید؟",content:u.jsxs(y,{container:!0,children:[u.jsx(w,{variant:"contained",onClick:()=>{A(n0({key:n==null?void 0:n.key,check:!0,market_state:"accepted",market_state_message:"تایید"})).then(h=>{var $,d;($=h==null?void 0:h.payload)!=null&&$.error?r({vertical:"top",horizontal:"center",msg:(d=h==null?void 0:h.payload)==null?void 0:d.error,severity:"error"}):(A(su()),x(),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),u.jsx(w,{onClick:()=>{A(su())},children:"لغو"})]})}))},children:u.jsx(C6,{})})}),(M()==="ProvinceOperator"||M()==="SuperAdmin"||M()==="AdminX")&&u.jsx(Mu,{title:"رد",placement:"right",children:u.jsx(gu,{color:"error",onClick:()=>{E(),A(yu({title:"آیا مطمئن هستید؟",content:u.jsxs(y,{container:!0,children:[u.jsx(w,{variant:"contained",onClick:()=>{A(n0({key:n==null?void 0:n.key,check:!0,market_state:"rejected",market_state_message:"رد"})).then(h=>{var $,d;($=h==null?void 0:h.payload)!=null&&$.error?r({vertical:"top",horizontal:"center",msg:(d=h==null?void 0:h.payload)==null?void 0:d.error,severity:"error"}):(A(su()),x(),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"تایید"}),u.jsx(w,{onClick:()=>{A(su())},children:"لغو"})]})}))},children:u.jsx(c6,{})})})]})})})]})},D0=fu("PROVINCE_GET_TRADE_PANEL_MARKET_REQUEST",async(n,{dispatch:i})=>{try{const{data:C,status:A}=await U.get(`kill-house-market-info/?role=${M()}`,{params:n});return{data:C,status:A}}catch(C){return{error:C.response.data.result}}}),W0=fu("PROVINCE_GET_TRADE_PANEL_ADMIN_MARKET_REQUEST",async(n,{dispatch:i})=>{try{const{data:C,status:A}=await U.get("kill-house-market-info-dashboard",{params:n});return{data:C,status:A}}catch(C){return{error:C.response.data.result}}}),L0=({updateTable:n})=>{var ou,nu,cu,Cu,_u,$u,vu,Tu,Hu,du,qu,Ku,ku;const i=Fu(),C=T0(f=>f.userSlice.userProfile.key),[A]=o.useContext(Iu),[r,j]=o.useState([]),[L,T]=o.useState("pending"),[E,v]=o.useState([]),[p,x]=o.useState([]),[h,$]=o.useState([]),[d,g]=o.useState([]),[R,t]=o.useState(0),[k,s]=o.useState(10),[Q,Z]=o.useState(1),W=o.useRef(!1),I=o.useRef(!1),O=o.useRef(!1),G=o.useRef(!1),V=o.useRef(!1),lu=o.useRef(null),J=o.useRef(null),ru=o.useRef(!1),Ru=f=>{J.current=null,m(f),Z(f)},Bu=f=>{s(f),Z(1)},bu=async(f=!1)=>{var a;if(!(!f&&I.current)&&!O.current){O.current=!0,I.current=!0;try{const e=await i(W0());(a=e==null?void 0:e.payload)!=null&&a.data&&g(e.payload.data)}catch(e){console.error("Error fetching dashboard overview:",e),I.current=!1}finally{O.current=!1}}},Du=async(f=!1)=>{var S;const a=M(),e=JSON.stringify({role:a});if(!(!f&&lu.current===e)&&!V.current){V.current=!0,lu.current=e,G.current=!0;try{const c=await i(D0());(S=c==null?void 0:c.payload)!=null&&S.data&&x(c.payload.data)}catch(c){console.error("Error fetching market overview:",c),lu.current=null,G.current=!1}finally{V.current=!1}}},Qu=async(f=Q,a=!1)=>{const e={role:M(),search:"filter",value:"",page:f,page_size:k,type:L},S=JSON.stringify(e);if(!a&&J.current===S||ru.current)return null;ru.current=!0,J.current=S;try{const c=await U.get(`/market-requests/?role=${e.role}&search=${e.search}&value=${e.value}&page=${e.page}&page_size=${e.page_size}&type=${e.type}`);return j(c.data.results),t(c.data.count),c}catch(c){throw console.error("Error fetching market requests:",c),J.current=null,c}finally{ru.current=!1}},m=async(f=Q,a=!1,e=!1,S=!1)=>{try{i(pu()),await Qu(f,S),bu(a),Du(e),i(H())}catch(c){i(H()),console.error("Error fetching data:",c)}},tu=f=>{if(!f||typeof f!="string")return null;try{let a=f.trim();(a.startsWith("'")&&a.endsWith("'")||a.startsWith('"')&&a.endsWith('"'))&&(a=a.slice(1,-1)),a=a.replace(/'/g,'"');const e=JSON.parse(a);return{fullname:(e==null?void 0:e.fullname)||"",mobile:(e==null?void 0:e.mobile)||"",date:(e==null?void 0:e.date)||""}}catch(a){return console.error("Error parsing marketStateMessage:",a),null}},hu=async(f=!1,a=!1,e=!1)=>{if(!W.current)try{W.current=!0,await m(1,f,a,e)}finally{W.current=!1}};return o.useEffect(()=>{bu(!0),Du(!0)},[]),o.useEffect(()=>{const f=r==null?void 0:r.map((a,e)=>{var B,q,K,b,z,uu,eu,au,_,D,iu,Au;const S=tu(a==null?void 0:a.marketStateMessage),c=`${(a==null?void 0:a.marketState)==="deleted"?"حذف شده":(a==null?void 0:a.marketCodeStatus)===!0&&(a==null?void 0:a.marketFinalAccept)===!0&&!(a!=null&&a.inputMarketCode)&&(a==null?void 0:a.marketState)==="pending"?"در انتظار ورود کد احراز":(a==null?void 0:a.marketFinalAccept)===!1?"در انتظار تایید خریدار":(a==null?void 0:a.marketState)==="pending"?"در انتظار تایید استان":(a==null?void 0:a.marketState)==="accepted"?"تایید شده":(a==null?void 0:a.marketState)==="rejected"?"رد شده":(a==null?void 0:a.marketState)==="deleted"?"حذف شده":""}`,l=(a==null?void 0:a.marketState)==="deleted",P=(a==null?void 0:a.marketStateMessage)&&a.marketStateMessage!==null&&a.marketStateMessage!=="",N=l&&S?`${c}${c?" ":""}( ${S.fullname} ${S.mobile}) - ${e0(S.date)}`:l&&!P?`${c}${c?" ":""}(سیستمی)`:c;return[Q===1?e+1:e+k*(Q-1)+1,`${((B=a==null?void 0:a.poultry)==null?void 0:B.unitName)||""}`,`${((q=a==null?void 0:a.poultry)==null?void 0:q.fullname)||""} (${((K=a==null?void 0:a.poultry)==null?void 0:K.mobile)||""})`,((b=a==null?void 0:a.poultry)==null?void 0:b.city)||"",...M()!=="KillHouse"?[`${((z=a==null?void 0:a.killHouse)==null?void 0:z.killer)===!0?"کشتارکن":"کشتارگاه"} ${((uu=a==null?void 0:a.killHouse)==null?void 0:uu.name)||""}`,`${((eu=a==null?void 0:a.killHouse)==null?void 0:eu.fullname)||""} (${((au=a==null?void 0:a.killHouse)==null?void 0:au.mobile)||""})`,((_=a==null?void 0:a.killHouse)==null?void 0:_.city)||""]:[],(a==null?void 0:a.chickenBreed)||"",((iu=(D=a==null?void 0:a.poultryRequest)==null?void 0:D.killingAge)==null?void 0:iu.toLocaleString())||"0",((Au=a==null?void 0:a.killCapacity)==null?void 0:Au.toLocaleString())||"0",Pu(a==null?void 0:a.reciveDate)||"-",a!=null&&a.createDate?z0(a.createDate):"-",(a==null?void 0:a.IndexWeight)||0,Math.round((a==null?void 0:a.IndexWeight)*(a==null?void 0:a.killCapacity)||0).toLocaleString(),a!=null&&a.amount?a.amount.toLocaleString():"0",a!=null&&a.paymentDeadlineDate?Pu(a.paymentDeadlineDate):"-",N,(a==null?void 0:a.marketState)==="accepted"?u.jsx(l0,{pdf_key:a==null?void 0:a.key}):"-",u.jsx(S6,{updateTable:hu,updateTable2:n,item:a},e)]});v(f)},[r,Q,k]),o.useEffect(()=>{J.current=null,hu(!1,!1,!0)},[k,L,n]),o.useEffect(()=>{var f,a,e,S,c,l,P,N,B,q,K,b,z,uu,eu,au,_,D,iu,Au;if(p){let Su;M()==="KillHouse"?Su=[{title:"سهمیه روز شما",data:(a=(f=p==null?void 0:p.info)==null?void 0:f.killHouseTodayShare)==null?void 0:a.toLocaleString()},{title:"حجم خرید موقت",data:(S=(e=p==null?void 0:p.info)==null?void 0:e.killHouseMarketKillRequestsQuantityFirst)==null?void 0:S.toLocaleString()},{title:"حجم خرید نهایی",data:(l=(c=p==null?void 0:p.info)==null?void 0:c.killHouseMarketKillRequestsQuantityFinal)==null?void 0:l.toLocaleString()},{title:"مانده سهمیه",data:(N=(P=p==null?void 0:p.info)==null?void 0:P.killHouseTodayLeftShare)==null?void 0:N.toLocaleString()},{title:"الزام به خرید سبک",data:(q=(B=p==null?void 0:p.info)==null?void 0:B.marketLightShare)==null?void 0:q.toLocaleString()},{title:" حجم خرید سبک توافقی",data:(b=(K=p==null?void 0:p.info)==null?void 0:K.totalKillHouseMarketKillRequestsQuantityAgreementLightWeight)==null?void 0:b.toLocaleString()},{title:"حجم خرید سبک ",data:(uu=(z=p==null?void 0:p.info)==null?void 0:z.totalKillHouseMarketKillRequestsQuantityLightWeight)==null?void 0:uu.toLocaleString()},{title:"حجم خرید سنگین ",data:(au=(eu=p==null?void 0:p.info)==null?void 0:eu.totalKillHouseMarketKillRequestsQuantityHeavyWeight)==null?void 0:au.toLocaleString()},{title:"حجم کل سفارشات",data:(D=(_=p==null?void 0:p.info)==null?void 0:_.totalPoultryRequestsQuantity)==null?void 0:D.toLocaleString()},{title:"کل حجم خریداری شده",data:(Au=(iu=p==null?void 0:p.info)==null?void 0:iu.killHouseMarketKillRequestsQuantity)==null?void 0:Au.toLocaleString()}]:Su=p==null?void 0:p.map((F,Gu)=>{var Ou,Nu,zu,Yu,wu,r0,o0,c0,C0,d0,i0,A0,p0,h0,g0,y0,x0,f0,F0,k0,S0,j0,E0,R0;return[Gu+1,F==null?void 0:F.name,((Nu=(Ou=F==null?void 0:F.info)==null?void 0:Ou.killHouseTodayShare)==null?void 0:Nu.toLocaleString())||"0",((Yu=(zu=F==null?void 0:F.info)==null?void 0:zu.killHouseMarketKillRequestsQuantity)==null?void 0:Yu.toLocaleString())||"0",((r0=(wu=F==null?void 0:F.info)==null?void 0:wu.killHouseMarketKillRequestsQuantityFirst)==null?void 0:r0.toLocaleString())||"0",((c0=(o0=F==null?void 0:F.info)==null?void 0:o0.killHouseMarketKillRequestsQuantityFinal)==null?void 0:c0.toLocaleString())||"0",((d0=(C0=F==null?void 0:F.info)==null?void 0:C0.killHouseMarketKillRequestsQuantityWeight)==null?void 0:d0.toLocaleString())||"0",((A0=(i0=F==null?void 0:F.info)==null?void 0:i0.killHouseMarketKillRequestsQuantityFirstWeight)==null?void 0:A0.toLocaleString())||"0",((h0=(p0=F==null?void 0:F.info)==null?void 0:p0.killHouseMarketKillRequestsQuantityFinalWeight)==null?void 0:h0.toLocaleString())||"0",((y0=(g0=F==null?void 0:F.info)==null?void 0:g0.totalKillHouseMarketKillRequestsQuantityAgreementLightWeight)==null?void 0:y0.toLocaleString())||"0",((f0=(x0=F==null?void 0:F.info)==null?void 0:x0.totalKillHouseMarketKillRequestsQuantityLightWeight)==null?void 0:f0.toLocaleString())||"0",((k0=(F0=F==null?void 0:F.info)==null?void 0:F0.totalKillHouseMarketKillRequestsQuantityHeavyWeight)==null?void 0:k0.toLocaleString())||"0",((j0=(S0=F==null?void 0:F.info)==null?void 0:S0.killHouseTodayLeftShare)==null?void 0:j0.toLocaleString())||"0",((R0=(E0=F==null?void 0:F.info)==null?void 0:E0.marketLightShare)==null?void 0:R0.toLocaleString())||"0"]}),$(Su)}},[p]),u.jsxs(y,{mt:2,children:[M()==="KillHouse"&&u.jsx(y,{mb:2,container:!0,xs:12,p:1.5,gap:1,justifyContent:"center",sx:{border:"1px solid",borderColor:"divider",borderRadius:2,bgcolor:"background.paper",boxShadow:"0 8px 24px rgba(0,0,0,0.08)",backdropFilter:"blur(3px)"},children:h==null?void 0:h.map((f,a)=>{var e;return u.jsxs(y,{container:!0,direction:"column",md:2.2,sx:{px:1,py:.9,borderRadius:1.5,bgcolor:a===4?"#f5f5a6":a>=5&&a<=9?"#e0e7ff87":"primary.light",border:"1px solid",borderColor:"divider",transition:"transform 200ms ease, box-shadow 200ms ease",transform:"translateY(0)",boxShadow:"0 4px 12px rgba(0,0,0,0.06)","&:hover":{boxShadow:"0 10px 28px rgba(0,0,0,0.12)",transform:"translateY(-2px)"}},children:[u.jsx(Y,{variant:"body2",fontWeight:600,color:"text.primary",children:f==null?void 0:f.title}),u.jsxs(Y,{variant:"caption",fontWeight:600,sx:{color:"gray"},children:[(e=f==null?void 0:f.data)==null?void 0:e.toLocaleString()," قطعه"]})]},a)})}),u.jsx(Eu,{operation:u.jsxs(y,{xs:12,container:!0,gap:1,alignItems:"center",direction:"row",children:[u.jsx(y,{children:u.jsx(w,{color:"success",onClick:()=>{A({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const f=`${U.defaults.baseURL}market_requests_excel/?role=${M()}&search=filter&value=&type=${L}&key=${C}`;window.location.href=f},children:u.jsx(H0,{size:24})})}),u.jsx(y,{children:u.jsxs(P0,{children:[u.jsx(b0,{id:"demo-simple-select-label",children:"فیلتر نتایج"}),u.jsxs(_0,{sx:{minWidth:"120px"},size:"small",labelId:"demo-simple-select-label",id:"demo-simple-select",value:L,onChange:f=>T(f.target.value),label:"Age",children:[u.jsx(xu,{value:"pending",children:"در انتظار"}),u.jsx(xu,{value:"accepted",children:"تایید شده"}),u.jsx(xu,{value:"rejected",children:"رد شده"}),u.jsx(xu,{value:"deleted",children:"حذف شده"}),u.jsx(xu,{value:"all",children:"همه سفارشات"})]})]})})]}),title:M()==="KillHouse"?"خریدهای ثبت شده":"سفارشات دریافتی",customWidth:"100%",data:E,columns:["ردیف","فارم","مرغدار","شهر",...M()!=="KillHouse"?["ماهیت خریدار","خریدار","آدرس خریدار"]:[],"نژاد","سن (روز)","تعداد قطعه","تاریخ کشتار","تاریخ ثبت سفارش","میانگین وزنی (کیلوگرم)","وزن تقریبی (کیلوگرم)","مبلغ هر کیلو (ریال)","حداکثر مهلت تسویه","وضعیت","توافق نامه","عملیات"],handlePageChange:Ru,totalRows:R,page:Q,perPage:k,handlePerRowsChange:Bu,customColors:[{rest:!0,color:"green"}]}),M()!=="KillHouse"&&u.jsxs(y,{container:!0,xs:12,mt:2,gap:2,children:[u.jsx(Eu,{isDashboard:!0,title:"خلاصه معاملات",customWidth:"100%",data:[[((ou=d==null?void 0:d.totalPoultryRequestsQuantity)==null?void 0:ou.toLocaleString())||"0",((nu=d==null?void 0:d.killHouseTodayShare)==null?void 0:nu.toLocaleString())||"0",((cu=d==null?void 0:d.killHouseMarketKillRequestsQuantity)==null?void 0:cu.toLocaleString())||"0",((Cu=d==null?void 0:d.killHouseMarketKillRequestsQuantityFirst)==null?void 0:Cu.toLocaleString())||"0",((_u=d==null?void 0:d.killHouseMarketKillRequestsQuantityFinal)==null?void 0:_u.toLocaleString())||"0",(($u=d==null?void 0:d.killHouseMarketKillRequestsQuantityWeight)==null?void 0:$u.toLocaleString())||"0",((vu=d==null?void 0:d.killHouseMarketKillRequestsQuantityFirstWeight)==null?void 0:vu.toLocaleString())||"0",((Tu=d==null?void 0:d.killHouseMarketKillRequestsQuantityFinalWeight)==null?void 0:Tu.toLocaleString())||"0",((Hu=d==null?void 0:d.totalKillHouseMarketKillRequestsQuantityAgreementLightWeight)==null?void 0:Hu.toLocaleString())||"0",((du=d==null?void 0:d.totalKillHouseMarketKillRequestsQuantityLightWeight)==null?void 0:du.toLocaleString())||"0",((qu=d==null?void 0:d.totalKillHouseMarketKillRequestsQuantityHeavyWeight)==null?void 0:qu.toLocaleString())||"0",((Ku=d==null?void 0:d.killHouseTodayLeftShare)==null?void 0:Ku.toLocaleString())||"0","0",((ku=d==null?void 0:d.marketLightShare)==null?void 0:ku.toLocaleString())||"0"]],noPagination:!0,columns:["حجم کل سفارشات (قطعه)","سهمیه روز (قطعه)","کل حجم خریداری شده (قطعه)","حجم خرید موقت (قطعه)","حجم خرید نهایی (قطعه)","کل وزن خریداری شده (کیلوگرم)","وزن خرید موقت (کیلوگرم)","وزن خرید نهایی (کیلوگرم)","حجم خرید سبک توافقی (قطعه)","حجم خرید سبک (قطعه)","حجم خرید سنگین (قطعه)","مانده سهمیه (قطعه)","الزام به خرید سبک (قطعه)"]}),u.jsx(Eu,{title:"گزارش معاملات",customWidth:"100%",data:h,paginated:!0,columns:["ردیف","کشتارگاه","سهمیه روز","کل حجم خریداری شده (قطعه)","حجم خرید موقت (قطعه)","حجم خرید نهایی (قطعه)","کل وزن خریداری شده (کیلوگرم)","وزن خرید موقت (کیلوگرم)","وزن خرید نهایی (کیلوگرم)","حجم خرید سبک توافقی (قطعه)","حجم خرید سبک (قطعه)","حجم خرید سنگین (قطعه)","مانده سهمیه (قطعه)","الزام به خرید سبک (قطعه)"]})]})]})},j6=({req_key:n})=>{const i=Fu(),[C,A]=o.useState([]),[r,j]=o.useState([]),[L,T]=o.useState(0),[E,v]=o.useState(10),[p,x]=o.useState(1),h=R=>{d(R),x(R)},$=R=>{v(R),x(1)},d=async(R=p)=>{try{i(pu());const t=await U.get(`/market-requests/?role=${M()}&search=filter&value=&page=${R}&page_size=${E}&poultry_request_key=${n}`);i(H()),A(t.data.results),T(t.data.count)}catch{i(H())}},g=()=>{d(1)};return o.useEffect(()=>{const R=C==null?void 0:C.map((t,k)=>{var s,Q,Z,W,I,O,G,V,lu,J,ru,Ru;return[p===1?k+1:k+E*(p-1)+1,`${(s=t==null?void 0:t.poultry)==null?void 0:s.unitName}`,`${(Q=t==null?void 0:t.poultry)==null?void 0:Q.fullname} (${(Z=t==null?void 0:t.poultry)==null?void 0:Z.mobile})`,(W=t==null?void 0:t.poultry)==null?void 0:W.city,`${((I=t==null?void 0:t.killHouse)==null?void 0:I.killer)===!0?"کشتارکن":"کشتارگاه"} ${(O=t==null?void 0:t.killHouse)==null?void 0:O.name}`,`${(G=t==null?void 0:t.killHouse)==null?void 0:G.fullname} (${(V=t==null?void 0:t.killHouse)==null?void 0:V.mobile})`,(lu=t==null?void 0:t.killHouse)==null?void 0:lu.city,t==null?void 0:t.chickenBreed,(ru=(J=t==null?void 0:t.poultryRequest)==null?void 0:J.killingAge)==null?void 0:ru.toLocaleString(),(Ru=t==null?void 0:t.killCapacity)==null?void 0:Ru.toLocaleString(),Pu(t==null?void 0:t.reciveDate),e0(t==null?void 0:t.createDate),t==null?void 0:t.IndexWeight,Math.round((t==null?void 0:t.IndexWeight)*(t==null?void 0:t.killCapacity)||0).toLocaleString(),t!=null&&t.amount?t==null?void 0:t.amount.toLocaleString():"0",t!=null&&t.paymentDeadlineDate?Pu(t==null?void 0:t.paymentDeadlineDate):"-",`${(t==null?void 0:t.marketCodeStatus)===!0&&(t==null?void 0:t.marketFinalAccept)===!0&&!(t!=null&&t.inputMarketCode)&&(t==null?void 0:t.marketState)==="pending"?"در انتظار ورود کد احراز":(t==null?void 0:t.marketFinalAccept)===!1?"در انتظار تایید خریدار":(t==null?void 0:t.marketState)==="pending"?"در انتظار تایید استان":(t==null?void 0:t.marketState)==="accepted"?"تایید شده":(t==null?void 0:t.marketState)==="rejected"?"رد شده":(t==null?void 0:t.marketState)==="deleted"?"حذف شده":""}`,(t==null?void 0:t.marketState)==="accepted"?u.jsx(l0,{pdf_key:t==null?void 0:t.key}):"-"]});j(R)},[C]),o.useEffect(()=>{g()},[E]),u.jsx(y,{mt:2,children:u.jsx(Eu,{title:"جزئیات خرید",customWidth:"100%",data:r,columns:["ردیف","فارم","مرغدار","شهر","ماهیت خریدار","خریدار","آدرس خریدار","نژاد","سن (روز)","تعداد قطعه","تاریخ کشتار","تاریخ ثبت سفارش","میانگین وزنی (کیلوگرم)","وزن تقریبی (کیلوگرم)","مبلغ هر کیلو (ریال)","حداکثر مهلت تسویه","وضعیت","توافق نامه"],handlePageChange:h,totalRows:L,page:p,perPage:E,handlePerRowsChange:$,customColors:[{rest:!0,color:"green"}]})})},E6=()=>{const[,,n,i,C,A]=o.useContext(Iu),r=Fu(),[j,L]=o.useState([]),[T,E]=o.useState(0),[v,p]=o.useState(20),[x,h]=o.useState(1),[$,d]=o.useState([]),g=async(k=x)=>{r(pu());try{const s=await U.get(`direct-buying-poultry-requests?page=${k}&page_size=${v}&date1=${n}&date2=${C}`);r(H()),L(s.data.results),E(s.data.count)}catch{r(H())}};o.useEffect(()=>{g(1)},[v,n,C]);const R=k=>{p(k),h(1)},t=k=>{g(k),h(k)};return o.useEffect(()=>{const k=j==null?void 0:j.map((s,Q)=>{var Z,W,I,O,G,V;return[x===1?Q+1:Q+v*(x-1)+1,u.jsx(q0,{details_key:(Z=s==null?void 0:s.age)==null?void 0:Z.hatchingKey},Q),`${(W=s==null?void 0:s.poultry)==null?void 0:W.fullname} (${(I=s==null?void 0:s.poultry)==null?void 0:I.mobile})`,(O=s==null?void 0:s.poultry)==null?void 0:O.city,s==null?void 0:s.chickenBreed,(G=s==null?void 0:s.age)==null?void 0:G.age,s==null?void 0:s.IndexWeight,Pu(s==null?void 0:s.sendDate),s==null?void 0:s.quantity,s!=null&&s.remainQuantity?s==null?void 0:s.remainQuantity.toLocaleString():"0",s!=null&&s.totalAllocated?(V=s==null?void 0:s.totalAllocated)==null?void 0:V.toLocaleString():"0",s!=null&&s.amount?s==null?void 0:s.amount.toLocaleString():"0",u.jsx(gu,{color:"primary",onClick:()=>{r(w0({top:!0,title:"جزئیات خرید",content:u.jsx(j6,{req_key:s==null?void 0:s.key})}))},children:u.jsx(Y0,{})},Q)]});d(k)},[j]),u.jsxs(y,{item:!0,xs:12,mt:2,children:[u.jsxs(y,{container:!0,xs:12,justifyConter:"start",gap:1,children:[u.jsx(y,{children:u.jsx(Wu,{label:"از تاریخ",id:"date",renderInput:k=>u.jsx(X,{style:{width:"160px"},size:"small",...k}),value:n,onChange:k=>{i(ju(k).format("YYYY-MM-DD"))}})}),u.jsx(y,{children:u.jsx(Wu,{label:"تا تاریخ",id:"date",renderInput:k=>u.jsx(X,{style:{width:"160px"},size:"small",...k}),value:C,onChange:k=>{A(ju(k).format("YYYY-MM-DD"))}})})]}),u.jsx(Eu,{title:"لیست اعلام کشتار های مرغداران",data:$,customWidth:"100%",columns:["ردیف","جزئیات","نام و نام خانوادگی (تلفن)","استان / شهر","نژاد","سن جوجه","میانگین وزنی (کیلوگرم) ","تاریخ کشتار","تعداد قطعه","مانده قابل خرید","فروش رفته ","مبلغ هر کیلو (ریال)","جزئیات خرید"],handlePageChange:t,totalRows:T,page:x,perPage:v,handlePerRowsChange:R})]})},R6=()=>{var nu,cu,Cu,_u,$u,vu,Tu,Hu,du,qu,Ku,ku,f;const[,,n,i,C,A]=o.useContext(Iu),[r,j]=o.useState(ju(new Date).format("YYYY-MM-DD")),[L,T]=o.useState(ju(new Date).format("YYYY-MM-DD"));o.useEffect(()=>{const a=ju(new Date).format("YYYY-MM-DD");i(a),A(a)},[]);const E=Fu(),[v,p]=o.useState([]),[x,h]=o.useState("pending"),[$,d]=o.useState([]),[g,R]=o.useState([]),[t,k]=o.useState([]),[s,Q]=o.useState([]),[Z,W]=o.useState(0),[I,O]=o.useState(10),[G,V]=o.useState(1),lu=a=>{tu(a),V(a)},J=a=>{O(a),V(1)},[ru,Ru]=o.useState(""),Bu=a=>{Ru(a.target.value)},[bu,Du]=o.useState(""),Qu=a=>{Du(a.target.value)},m=a=>{a&&a.preventDefault(),E(W0({date1:r,date2:L,search:"filter",value:bu})).then(e=>{Q(e.payload.data)}),E(D0({date1:r,date2:L,search:"filter",value:bu})).then(e=>{R(e.payload.data)})},tu=async(a=G,e)=>{e&&e.preventDefault();try{E(pu());const S=await U.get(`/market-requests/?role=${M()}&search=filter&value=&page=${a}&page_size=${I}&type=${x}&date1=${n}&date2=${C}&search=filter&value=${ru||""}`);E(H()),p(S.data.results),W(S.data.count)}catch{E(H())}},hu=()=>{tu(1),m()},ou=a=>{if(!a||typeof a!="string")return null;try{let e=a.trim();(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))&&(e=e.slice(1,-1)),e=e.replace(/'/g,'"');const S=JSON.parse(e);return{fullname:(S==null?void 0:S.fullname)||"",mobile:(S==null?void 0:S.mobile)||"",date:(S==null?void 0:S.date)||""}}catch(e){return console.error("Error parsing marketStateMessage:",e),null}};return o.useEffect(()=>{const a=v==null?void 0:v.map((e,S)=>{var q,K,b,z,uu,eu,au,_,D,iu,Au,Su;const c=ou(e==null?void 0:e.marketStateMessage),l=`${(e==null?void 0:e.marketState)==="deleted"?"حذف شده":(e==null?void 0:e.marketCodeStatus)===!0&&(e==null?void 0:e.marketFinalAccept)===!0&&!(e!=null&&e.inputMarketCode)&&(e==null?void 0:e.marketState)==="pending"?"در انتظار ورود کد احراز":(e==null?void 0:e.marketFinalAccept)===!1?"در انتظار تایید خریدار":(e==null?void 0:e.marketState)==="pending"?"در انتظار تایید استان":(e==null?void 0:e.marketState)==="accepted"?"تایید شده":(e==null?void 0:e.marketState)==="rejected"?"رد شده":(e==null?void 0:e.marketState)==="deleted"?"حذف شده":""}`,P=(e==null?void 0:e.marketState)==="deleted",N=(e==null?void 0:e.marketStateMessage)&&e.marketStateMessage!==null&&e.marketStateMessage!=="",B=P&&c?`${l}${l?" ":""}( ${c.fullname} ${c.mobile}) - ${e0(c.date)}`:P&&!N?`${l}${l?" ":""}(سیستمی)`:l;return[G===1?S+1:S+I*(G-1)+1,`${((q=e==null?void 0:e.poultry)==null?void 0:q.unitName)||""}`,`${((K=e==null?void 0:e.poultry)==null?void 0:K.fullname)||""} (${((b=e==null?void 0:e.poultry)==null?void 0:b.mobile)||""})`,((z=e==null?void 0:e.poultry)==null?void 0:z.city)||"",...M()!=="KillHouse"?[`${((uu=e==null?void 0:e.killHouse)==null?void 0:uu.killer)===!0?"کشتارکن":"کشتارگاه"} ${((eu=e==null?void 0:e.killHouse)==null?void 0:eu.name)||""}`,`${((au=e==null?void 0:e.killHouse)==null?void 0:au.fullname)||""} (${((_=e==null?void 0:e.killHouse)==null?void 0:_.mobile)||""})`,((D=e==null?void 0:e.killHouse)==null?void 0:D.city)||""]:[],(e==null?void 0:e.chickenBreed)||"",((Au=(iu=e==null?void 0:e.poultryRequest)==null?void 0:iu.killingAge)==null?void 0:Au.toLocaleString())||"0",((Su=e==null?void 0:e.killCapacity)==null?void 0:Su.toLocaleString())||"0",Pu(e==null?void 0:e.reciveDate)||"-",e!=null&&e.createDate?e0(e.createDate):"-",(e==null?void 0:e.IndexWeight)||0,Math.round((e==null?void 0:e.IndexWeight)*(e==null?void 0:e.killCapacity)||0).toLocaleString(),e!=null&&e.amount?e.amount.toLocaleString():"0",e!=null&&e.paymentDeadlineDate?Pu(e.paymentDeadlineDate):"-",B,(e==null?void 0:e.marketState)==="accepted"?u.jsx(l0,{pdf_key:e==null?void 0:e.key}):"-"]});d(a)},[v,G,I]),o.useEffect(()=>{hu()},[I,x,n,C]),o.useEffect(()=>{m()},[r,L]),o.useEffect(()=>{if(g){const a=g==null?void 0:g.map((e,S)=>{var c,l,P,N,B,q,K,b,z,uu,eu,au,_,D,iu,Au,Su,F,Gu,Ou,Nu,zu,Yu,wu;return[S+1,e==null?void 0:e.name,((l=(c=e==null?void 0:e.info)==null?void 0:c.killHouseTodayShare)==null?void 0:l.toLocaleString())||"0",((N=(P=e==null?void 0:e.info)==null?void 0:P.killHouseMarketKillRequestsQuantity)==null?void 0:N.toLocaleString())||"0",((q=(B=e==null?void 0:e.info)==null?void 0:B.killHouseMarketKillRequestsQuantityFirst)==null?void 0:q.toLocaleString())||"0",((b=(K=e==null?void 0:e.info)==null?void 0:K.killHouseMarketKillRequestsQuantityFinal)==null?void 0:b.toLocaleString())||"0",((uu=(z=e==null?void 0:e.info)==null?void 0:z.killHouseMarketKillRequestsQuantityWeight)==null?void 0:uu.toLocaleString())||"0",((au=(eu=e==null?void 0:e.info)==null?void 0:eu.killHouseMarketKillRequestsQuantityFirstWeight)==null?void 0:au.toLocaleString())||"0",((D=(_=e==null?void 0:e.info)==null?void 0:_.killHouseMarketKillRequestsQuantityFinalWeight)==null?void 0:D.toLocaleString())||"0",((Au=(iu=e==null?void 0:e.info)==null?void 0:iu.totalKillHouseMarketKillRequestsQuantityAgreementLightWeight)==null?void 0:Au.toLocaleString())||"0",((F=(Su=e==null?void 0:e.info)==null?void 0:Su.totalKillHouseMarketKillRequestsQuantityLightWeight)==null?void 0:F.toLocaleString())||"0",((Ou=(Gu=e==null?void 0:e.info)==null?void 0:Gu.totalKillHouseMarketKillRequestsQuantityHeavyWeight)==null?void 0:Ou.toLocaleString())||"0",((zu=(Nu=e==null?void 0:e.info)==null?void 0:Nu.killHouseTodayLeftShare)==null?void 0:zu.toLocaleString())||"0",((wu=(Yu=e==null?void 0:e.info)==null?void 0:Yu.marketLightShare)==null?void 0:wu.toLocaleString())||"0"]});k(a)}},[g]),u.jsxs(y,{container:!0,mt:2,children:[u.jsxs(y,{container:!0,gap:Uu.SMALL,children:[u.jsx(y,{children:u.jsxs(P0,{children:[u.jsx(b0,{id:"demo-simple-select-label",children:"فیلتر نتایج"}),u.jsxs(_0,{sx:{minWidth:"120px"},size:"small",labelId:"demo-simple-select-label",id:"demo-simple-select",value:x,onChange:a=>h(a.target.value),label:"Age",children:[u.jsx(xu,{value:"pending",children:"در انتظار"}),u.jsx(xu,{value:"accepted",children:"تایید شده"}),u.jsx(xu,{value:"rejected",children:"رد شده"}),u.jsx(xu,{value:"deleted",children:"حذف شده"}),u.jsx(xu,{value:"all",children:"همه سفارشات"})]})]})}),u.jsx(y,{children:u.jsx(Wu,{label:"از تاریخ",id:"date",renderInput:a=>u.jsx(X,{style:{width:"160px"},size:"small",...a}),value:n,onChange:a=>{i(ju(a).format("YYYY-MM-DD"))}})}),u.jsx(y,{children:u.jsx(Wu,{label:"تا تاریخ",id:"date",renderInput:a=>u.jsx(X,{style:{width:"160px"},size:"small",...a}),value:C,onChange:a=>{A(ju(a).format("YYYY-MM-DD"))}})}),u.jsxs("form",{onSubmit:a=>{tu(1,a)},children:[u.jsx(X,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:Bu}),u.jsx(w,{type:"submit",onSubmit:a=>{tu(1,a)},endIcon:u.jsx(s0,{}),children:"جستجو"})]})]}),u.jsx(Eu,{title:"معاملات گذشته",customWidth:"100%",data:$,columns:["ردیف","فارم","مرغدار","شهر","ماهیت خریدار","خریدار","آدرس خریدار","نژاد","سن (روز)","تعداد قطعه","تاریخ کشتار","تاریخ ثبت سفارش","میانگین وزنی (کیلوگرم)","وزن تقریبی (کیلوگرم)","مبلغ هر کیلو (ریال)","حداکثر مهلت تسویه","وضعیت","توافق نامه"],handlePageChange:lu,totalRows:Z,page:G,perPage:I,handlePerRowsChange:J,customColors:[{rest:!0,color:"green"}]}),u.jsxs(y,{container:!0,gap:Uu.SMALL,children:[u.jsx(y,{children:u.jsx(Wu,{label:"از تاریخ",id:"date",renderInput:a=>u.jsx(X,{style:{width:"160px"},size:"small",...a}),value:r,onChange:a=>{j(ju(a).format("YYYY-MM-DD"))}})}),u.jsx(y,{children:u.jsx(Wu,{label:"تا تاریخ",id:"date",renderInput:a=>u.jsx(X,{style:{width:"160px"},size:"small",...a}),value:L,onChange:a=>{T(ju(a).format("YYYY-MM-DD"))}})}),u.jsxs("form",{onSubmit:a=>{m(a)},children:[u.jsx(X,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:Qu}),u.jsx(w,{type:"submit",onSubmit:a=>{m(a)},endIcon:u.jsx(s0,{}),children:"جستجو"})]})]}),u.jsxs(y,{container:!0,xs:12,mt:2,gap:2,children:[u.jsx(Eu,{isDashboard:!0,title:"خلاصه معاملات",customWidth:"100%",data:[[((nu=s==null?void 0:s.totalPoultryRequestsQuantity)==null?void 0:nu.toLocaleString())||"0",((cu=s==null?void 0:s.killHouseTodayShare)==null?void 0:cu.toLocaleString())||"0",((Cu=s==null?void 0:s.killHouseMarketKillRequestsQuantity)==null?void 0:Cu.toLocaleString())||"0",((_u=s==null?void 0:s.killHouseMarketKillRequestsQuantityFirst)==null?void 0:_u.toLocaleString())||"0",(($u=s==null?void 0:s.killHouseMarketKillRequestsQuantityFinal)==null?void 0:$u.toLocaleString())||"0",((vu=s==null?void 0:s.killHouseMarketKillRequestsQuantityWeight)==null?void 0:vu.toLocaleString())||"0",((Tu=s==null?void 0:s.killHouseMarketKillRequestsQuantityFirstWeight)==null?void 0:Tu.toLocaleString())||"0",((Hu=s==null?void 0:s.killHouseMarketKillRequestsQuantityFinalWeight)==null?void 0:Hu.toLocaleString())||"0",((du=s==null?void 0:s.totalKillHouseMarketKillRequestsQuantityAgreementLightWeight)==null?void 0:du.toLocaleString())||"0",((qu=s==null?void 0:s.totalKillHouseMarketKillRequestsQuantityLightWeight)==null?void 0:qu.toLocaleString())||"0",((Ku=s==null?void 0:s.totalKillHouseMarketKillRequestsQuantityHeavyWeight)==null?void 0:Ku.toLocaleString())||"0",((ku=s==null?void 0:s.killHouseTodayLeftShare)==null?void 0:ku.toLocaleString())||"0",((f=s==null?void 0:s.marketLightShare)==null?void 0:f.toLocaleString())||"0"]],noPagination:!0,columns:["حجم کل سفارشات (قطعه)","سهمیه روز (قطعه)","کل حجم خریداری شده (قطعه)","حجم خرید موقت (قطعه)","حجم خرید نهایی (قطعه)","کل وزن خریداری شده (کیلوگرم)","وزن خرید موقت (کیلوگرم)","وزن خرید نهایی (کیلوگرم)","حجم خرید سبک توافقی (قطعه)","حجم خرید سبک (قطعه)","حجم خرید سنگین (قطعه)","مانده سهمیه (قطعه)","الزام به خرید سبک (قطعه)"]}),u.jsx(Eu,{title:"گزارش معاملات",customWidth:"100%",data:t,paginated:!0,columns:["ردیف","کشتارگاه","سهمیه روز","کل حجم خریداری شده (قطعه)","حجم خرید موقت (قطعه)","حجم خرید نهایی (قطعه)","کل وزن خریداری شده (کیلوگرم)","وزن خرید موقت (کیلوگرم)","وزن خرید نهایی (کیلوگرم)","حجم خرید سبک توافقی (قطعه)","حجم خرید سبک (قطعه)","حجم خرید سنگین (قطعه)","مانده سهمیه (قطعه)","الزام به خرید سبک (قطعه)"]})]}),u.jsx(E6,{})]})},M6=fu("PROVINCE_GET_DIRECT_BUYING_POULTRY_REQUESTS",async(n,{dispatch:i})=>{var C,A;i(pu());try{const{selectedBreeds:r=[],selectedCities:j=[],showRemaining:L=!1,minPrice:T="",maxPrice:E="",minAge:v="",maxAge:p="",textValue:x="",page:h=1,perPage:$=20}=n||{},d=j.length>0?`&city=${j.join(",")}`:"",g=T?`&min_amount=${T}`:"",R=E?`&max_amount=${E}`:"",{data:t,status:k}=await U.get(`direct-buying-poultry-requests?breed=${r.join(",")}${d}&remain=${L}${g}${R}&weight=&min_age=${v}&max_age=${p}&role=${M()}&search=filter&value=${x||""}&page=${h}&page_size=${$}`);return i(H()),{data:t,status:k}}catch(r){return i(H()),{error:((A=(C=r.response)==null?void 0:C.data)==null?void 0:A.result)||r.message}}}),L6=()=>{var e,S;const n=Fu(),i=T0(c=>c.userSlice.userProfile.key),[C,A]=o.useState(),[r,j]=o.useState([]),[L,T]=o.useState([]),[E,v]=o.useState(0),[p,x]=o.useState(20),[h,$]=o.useState(""),[d,g]=o.useState(1),[R,t]=o.useState([]),[k,s]=o.useState([]),Q=["آرین","راس","کاب","*ترکیبی"],Z=o.useRef(!0),W=o.useRef(null),I=o.useRef(!1),[O,G]=o.useState(0),V=(c,l)=>{G(l)},[lu,J]=o.useState({showRemaining:!1,selectedCities:[],selectedBreeds:[],minPrice:"",maxPrice:"",tempMinPrice:"",tempMaxPrice:"",minAge:"",maxAge:"",tempMinAge:"",tempMaxAge:""}),ru=(c,l)=>{J(P=>({...P,[c]:l}))};o.useEffect(()=>{(async()=>{try{const l=await U.get("/cities");s(l.data)}catch(l){console.error("خطا در دریافت اطلاعات",l)}})()},[]);const Ru=c=>{$(c.target.value)},Bu=c=>{J(l=>({...l,selectedCities:l.selectedCities.includes(c)?l.selectedCities.filter(P=>P!==c):[...l.selectedCities,c]}))},bu=c=>{J(l=>({...l,selectedBreeds:l.selectedBreeds.includes(c)?l.selectedBreeds.filter(P=>P!==c):[...l.selectedBreeds,c]}))},Du=()=>{J(c=>({...c,minPrice:c.tempMinPrice,maxPrice:c.tempMaxPrice})),g(1)},Qu=()=>{J(c=>({...c,minAge:c.tempMinAge,maxAge:c.tempMaxAge})),g(1)},{selectedCities:m,selectedBreeds:tu,showRemaining:hu,minPrice:ou,maxPrice:nu,minAge:cu,maxAge:Cu}=lu,_u=m.length>0?`&city=${m.join(",")}`:"",$u=ou?`&min_amount=${ou}`:"",vu=nu?`&max_amount=${nu}`:"",Tu=o.useCallback(async()=>{var l;const c=await n(e6());if((l=c==null?void 0:c.payload)!=null&&l.data){const P=c.payload.data;A({start_time:P.startTime,end_time:P.endTime,allow:P.allow})}},[n]),Hu=o.useCallback(async()=>{var l;const c=await n(y6());(l=c==null?void 0:c.payload)!=null&&l.data&&j(c.payload.data)},[n]),du=o.useCallback(async(c=d,l=h,P=!1)=>{var q,K;const N={selectedBreeds:[...tu].sort().join(","),selectedCities:[...m].sort().join(","),showRemaining:hu,minPrice:ou,maxPrice:nu,minAge:cu,maxAge:Cu,textValue:l,page:c,perPage:p},B=JSON.stringify(N);if(!(!P&&W.current===B)&&!I.current){I.current=!0,W.current=B;try{const b=await n(M6({selectedBreeds:tu,selectedCities:m,showRemaining:hu,minPrice:ou,maxPrice:nu,minAge:cu,maxAge:Cu,textValue:l,page:c,perPage:p}));(q=b==null?void 0:b.payload)!=null&&q.error?(console.error("Error fetching data:",b.payload.error),T([]),v(0)):(K=b==null?void 0:b.payload)!=null&&K.data&&(T(b.payload.data.results||[]),v(b.payload.data.count||0))}finally{I.current=!1}}},[n,tu,m,hu,ou,nu,cu,Cu,h,p]);o.useEffect(()=>{Z.current&&(Z.current=!1,W.current=null,Promise.all([Tu(),Hu(),du(1,h,!0)]))},[]),o.useEffect(()=>{Z.current||(W.current=null,g(1),du(1))},[p,tu,m,hu,ou,nu,cu,Cu,O]);const qu=c=>{x(c),g(1)},Ku=c=>{W.current=null,du(c),g(c)},ku=()=>{W.current=null,du(1)},f=async c=>{c.preventDefault(),W.current=null,g(1),du(1,h)};o.useEffect(()=>{const c=L==null?void 0:L.map((l,P)=>{var N,B,q,K,b,z;return[d===1?P+1:P+p*(d-1)+1,u.jsx(q0,{details_key:(N=l==null?void 0:l.age)==null?void 0:N.hatchingKey},P),`${(B=l==null?void 0:l.poultry)==null?void 0:B.fullname} (${(q=l==null?void 0:l.poultry)==null?void 0:q.mobile})`,(K=l==null?void 0:l.poultry)==null?void 0:K.city,l==null?void 0:l.chickenBreed,(b=l==null?void 0:l.age)==null?void 0:b.age,l==null?void 0:l.IndexWeight,Pu(l==null?void 0:l.sendDate),l==null?void 0:l.quantity,l!=null&&l.remainQuantity?l==null?void 0:l.remainQuantity.toLocaleString():"0",l!=null&&l.totalAllocated?(z=l==null?void 0:l.totalAllocated)==null?void 0:z.toLocaleString():"0",l!=null&&l.amount?l==null?void 0:l.amount.toLocaleString():"0",u.jsx(h6,{item:l,updateTable:ku},P)]});t(c)},[L]);const a=()=>{var c,l,P,N,B,q,K,b,z,uu,eu,au;return[{name:"تعداد کل",data:r==null?void 0:r.map(_=>_==null?void 0:_.totalQuantity)},{name:`بین ${((l=(c=r==null?void 0:r[0])==null?void 0:c.category[0])==null?void 0:l.minValue)||0} تا ${((N=(P=r==null?void 0:r[0])==null?void 0:P.category[0])==null?void 0:N.maxValue)||0}`,data:r==null?void 0:r.map(_=>{var D;return(D=_==null?void 0:_.category[0])==null?void 0:D.quantity})},{name:`بین ${((q=(B=r==null?void 0:r[0])==null?void 0:B.category[1])==null?void 0:q.minValue)||0} تا ${((b=(K=r==null?void 0:r[0])==null?void 0:K.category[1])==null?void 0:b.maxValue)||0}`,data:r==null?void 0:r.map(_=>{var D;return(D=_==null?void 0:_.category[1])==null?void 0:D.quantity})},{name:`بین ${((uu=(z=r==null?void 0:r[0])==null?void 0:z.category[2])==null?void 0:uu.minValue)||0} تا ${((au=(eu=r==null?void 0:r[0])==null?void 0:eu.category[2])==null?void 0:au.maxValue)||0}`,data:r==null?void 0:r.map(_=>{var D;return(D=_==null?void 0:_.category[2])==null?void 0:D.quantity})}]};return u.jsxs(u.Fragment,{children:[M()!=="KillHouse"&&u.jsx(y,{xs:12,container:!0,alignItems:"center",justifyContent:"center",mb:2,children:u.jsxs(Q0,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:O,onChange:V,children:[u.jsx(t0,{label:"اعلام کشتار مرغداران",value:0}),u.jsx(t0,{label:"گزارش معاملات",value:1}),u.jsx(t0,{label:"معاملات گذشته",value:2})]})}),u.jsxs(y,{xs:12,px:1,children:[(C==null?void 0:C.allow)&&u.jsxs(y,{container:!0,xs:12,gap:1,alignItems:"center",justifyContent:"center",children:[u.jsx(d6,{color:"primary"}),u.jsxs(Y,{variant:"body2",color:"error",children:[" ","زمان فعالیت پنل معاملات: از ساعت ",(e=C==null?void 0:C.start_time)==null?void 0:e.slice(0,5)," ","الی ساعت ",(S=C==null?void 0:C.end_time)==null?void 0:S.slice(0,5)]})]}),O===0&&u.jsxs(y,{container:!0,direction:"row",gap:Uu.SMALL,children:[u.jsxs(y,{container:!0,spacing:2,xs:12,children:[u.jsx(y,{xs:12,md:M()==="KillHouse"?5:12,justifyContent:"center",alignItems:"center",height:"400px",children:u.jsx(t6,{title:"درخواست های کشتار بر اساس وزن",type:"bar",group:!0,seperator:r==null?void 0:r.map(c=>c==null?void 0:c.city),info:a()})}),M()==="KillHouse"&&u.jsx(y,{xs:12,md:7,children:u.jsx(L0,{updateTable:ku})})]}),u.jsx(y,{xs:12,children:u.jsx("form",{onSubmit:f,children:u.jsxs(y,{container:!0,alignItems:"center",gap:Uu.SMALL,p:2,children:[u.jsx(X,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:Ru}),u.jsx(w,{type:"submit",onClick:f,endIcon:u.jsx(s0,{}),children:"جستجو"}),u.jsx(Mu,{title:"خروجی اکسل",children:u.jsx("a",{href:`${U.defaults.baseURL}direct_buying_poultry_requests/?key=${i}&breed=${tu.join(",")}${_u}&remain=${hu}${$u}${vu}&weight=&min_age=${cu}&max_age=${Cu}&role=${M()}&search=filter&value=${h||""}&page=${d}&page_size=${p}`,rel:"noreferrer",children:u.jsx(w,{color:"success",children:u.jsx(H0,{size:32})})})})]})})}),u.jsxs(y,{container:!0,spacing:2,sx:{width:"100%"},children:[u.jsx(y,{item:!0,xs:12,md:2,children:u.jsx(g6,{filters:lu,updateFilter:ru,handleCityChange:Bu,handleBreedChange:bu,handlePriceFilterSubmit:Du,handleAgeFilterSubmit:Qu,cities:k,chickenBreeds:Q})}),u.jsx(y,{item:!0,xs:12,md:10,children:u.jsx(Eu,{title:"لیست اعلام کشتار های مرغداران",data:R,customWidth:"100%",columns:["ردیف","جزئیات","نام و نام خانوادگی (تلفن)","استان / شهر","نژاد","سن جوجه","میانگین وزنی (کیلوگرم) ","تاریخ کشتار","تعداد قطعه","مانده قابل خرید","فروش رفته ","مبلغ هر کیلو (ریال)",...M()==="KillHouse"?["خرید"]:[]],handlePageChange:Ku,totalRows:E,page:d,perPage:p,handlePerRowsChange:qu})})]})]}),O===1&&u.jsx(y,{xs:12,children:u.jsx(L0,{updateTable:ku})}),O===2&&u.jsx(y,{xs:12,children:u.jsx(R6,{})})]})]})},V6=()=>{const{pathname:n}=V0();return u.jsx(Lu,{display:"flex",justifyContent:"center",children:u.jsxs(y,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsx(Z0,{}),(n===U0||n===G0||n===J0||n===X0)&&u.jsx(L6,{})]})})};export{V6 as default}; diff --git a/build/assets/Training-Yw94DwCN.js b/build/assets/Training-Yw94DwCN.js new file mode 100644 index 0000000..ffb725b --- /dev/null +++ b/build/assets/Training-Yw94DwCN.js @@ -0,0 +1 @@ +import{j as i,b as a,T as n}from"./mui-vendor-CkIVaoQP.js";import{$ as s,m as o,S as t}from"./index-CeyyVc1v.js";import"./react-vendor-CmFgShSM.js";import"./redux-vendor-B7uoacJt.js";const d=()=>{const[r]=s();return i.jsxs(a,{sx:{backgroundColor:"#f9f9f9",p:3,borderRadius:"20px",m:8},children:[i.jsx(n,{variant:"h5",component:o.div,initial:{scale:.8},animate:{scale:1},transition:{duration:.3},children:"آموزش"}),r.includes("KillHouse")&&i.jsx(a,{display:"flex",flexDirection:"column",alignItems:"center",mt:t.SMALL,p:t.SMALL,gap:t.SMALL,component:o.div,initial:{opacity:0},animate:{opacity:1},transition:{duration:.5,delay:.3},children:i.jsxs(o.video,{controls:!0,controlsList:"nodownload",width:"600",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.5},children:[i.jsx("source",{src:"https://miran.storage.c2.liara.space/1.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]})})]})};export{d as default}; diff --git a/build/assets/Transactions-BSJVJOEU.js b/build/assets/Transactions-BSJVJOEU.js new file mode 100644 index 0000000..cf71d16 --- /dev/null +++ b/build/assets/Transactions-BSJVJOEU.js @@ -0,0 +1 @@ +import{j as u,I as hu,aX as nu,ak as S,B as L,d as ou,b as pu}from"./mui-vendor-CkIVaoQP.js";import{A as z,v as D,aC as gu,aq as fu,ew as Au,ex as ju,J as Su,X as p,G as o,W as M,j as $,L as O,h as U,_ as Du,S as $u}from"./index-CeyyVc1v.js";import{r as n,u as yu,j as ru,f as bu}from"./react-vendor-CmFgShSM.js";import{u as cu}from"./redux-vendor-B7uoacJt.js";import{R as lu,a as du}from"./index.esm-Bu7XMDZU.js";import{R as iu}from"./ResponsiveTable-w7hk7Uq8.js";import{d as Cu}from"./ToggleOffOutlined-Ch26Umk7.js";import{d as xu}from"./ToggleOn-pBgb8alR.js";import{d as Tu}from"./ReceiptLong-Dxpx4wPx.js";import{B as Fu}from"./BackButton-Crzr7NMa.js";import{g as Ru}from"./getPosProviderName-CYVCBpcT.js";import"./iconBase-BEJYyZsk.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";const Eu=()=>{const[,,c,l,C,x]=n.useContext(z),[r,d]=n.useState(!0),[y]=n.useContext(z),g=cu();n.useEffect(()=>{const t=D(new Date).format("YYYY-MM-DD");l(t),x(t)},[]);const b=t=>{W(t.target.value)},_=yu(),[i,N]=n.useState([]),[A,T]=n.useState(0),[f,v]=n.useState(10),[h,W]=n.useState(""),[j,Y]=n.useState(1),[F,k]=n.useState([]),[B,V]=n.useState({anchorEl:null,item:null}),R=async t=>{g(O());const e=await $.get(`pos-machine-transactions/?search=filter&value=${h}&role=${p()}${r?`&date1=${c}&date2=${C}`:""}&page=${t}&page_size=${f}`);g(U()),N(e.data.results),T(e.data.count)},m=t=>{R(t),Y(t)},G=t=>{v(t),Y(1)};n.useEffect(()=>{const t=i==null?void 0:i.map((e,I)=>{var P,w,X,q,J,Q,H,K,Z,uu,eu,tu,au,su;return[j===1?I+1:I+f*(j-1)+1,(e==null?void 0:e.guildsName)||"-",`${(P=e==null?void 0:e.user)==null?void 0:P.fullname} (${(w=e==null?void 0:e.user)==null?void 0:w.mobile})`,((q=(X=e==null?void 0:e.user)==null?void 0:X.city)==null?void 0:q.name)||"-",(e==null?void 0:e.guildsName)||"-",(e==null?void 0:e.licenseNumber)||"-",(Q=(J=e==null?void 0:e.transaction)==null?void 0:J.totalCarcassesWeight)==null?void 0:Q.toLocaleString(),(K=(H=e==null?void 0:e.transaction)==null?void 0:H.realAllocatedWeight)==null?void 0:K.toLocaleString(),(uu=(Z=e==null?void 0:e.transaction)==null?void 0:Z.totalRemainWeight)==null?void 0:uu.toLocaleString(),(tu=(eu=e==null?void 0:e.transaction)==null?void 0:eu.lenTransaction)==null?void 0:tu.toLocaleString(),(su=(au=e==null?void 0:e.transaction)==null?void 0:au.totalPrice)==null?void 0:su.toLocaleString(),u.jsx(u.Fragment,{children:u.jsx(hu,{title:"تراکنش‌ها",color:"primary",onClick:()=>{s(),a(e)},children:u.jsx(Tu,{fontSize:"small"})})})]});k(t)},[i,B]),n.useEffect(()=>{R(1)},[g,c,C,f,r]);const E=async t=>{t.preventDefault(),g(O());try{const e=await $.get(`pos-machine-transactions/?role=${p()}&search=filter&value=${h}${r?`&date1=${c}&date2=${C}`:""}&page=1&page_size=${f}`);N(e.data.results),T(e.data.count),g(U())}catch(e){console.error("Error fetching data:",e)}},s=()=>{V({anchorEl:null,item:null})},a=t=>{const e=r?"on":"off";_(`${p()==="AdminX"?gu:p()==="SuperAdmin"?fu:p()==="ProvinceFinancial"?Au:p()==="CityPoultry"?ju:Su}/${t==null?void 0:t.key}/${t==null?void 0:t.guildsName}?filterDate=${e}`)};return u.jsxs(o,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,px:2,children:[u.jsxs(o,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsxs(o,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(nu,{icon:u.jsx(Cu,{}),checkedIcon:u.jsx(xu,{}),checked:r,onChange:()=>d(!r),color:"primary",size:"large"}),u.jsx(o,{children:u.jsx(M,{disabled:!r,label:"از تاریخ",id:"date",renderInput:t=>u.jsx(S,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...t}),value:c,onChange:t=>{l(D(t).format("YYYY-MM-DD"))}})}),u.jsx(o,{children:u.jsx(M,{disabled:!r,label:"تا تاریخ",id:"date",renderInput:t=>u.jsx(S,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...t}),value:C,onChange:t=>{x(D(t).format("YYYY-MM-DD"))}})})]}),u.jsx(o,{children:u.jsxs("form",{onSubmit:E,children:[u.jsx(S,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:b}),u.jsx(L,{type:"submit",onClick:E,endIcon:u.jsx(lu,{}),children:"جستجو"})]})}),u.jsx(ou,{title:"خروجی اکسل",children:u.jsx(L,{color:"success",onClick:()=>{y({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const t=`${$.defaults.baseURL}all_guilds_transaction_excel/${r?`?date1=${c}&date2=${C}`:""}`;window.location.href=t},children:u.jsx(du,{size:32})})})]}),u.jsx(iu,{data:F,columns:["ردیف","صنف","کاربر","شهر","نام واحد","شناسه مجوز واحد","ورودی به انبار (کیلوگرم)","فروش رفته (کیلوگرم)","مانده انبار (کیلوگرم)","تعداد تراکنش ها","مبلغ تراکنش ها (﷼)","تراکنش‌ها"],handlePageChange:m,totalRows:A,page:j,perPage:f,handlePerRowsChange:G,title:"مدیریت انبار صنوف"})]})},Iu=({name:c})=>{const[,,l,C,x,r]=n.useContext(z),[d,y]=n.useState(!1),[g]=n.useContext(z),{key:b}=ru(),_=bu(),i=cu();n.useEffect(()=>{const s=D(new Date).format("YYYY-MM-DD");C(s),r(s)},[]),n.useEffect(()=>{const a=new URLSearchParams(_.search).get("filterDate");a==="on"?y(!0):a==="off"&&y(!1)},[_.search]);const N=s=>{Y(s.target.value)},[A,T]=n.useState([]),[f,v]=n.useState(0),[h,W]=n.useState(10),[j,Y]=n.useState(""),[F,k]=n.useState(1),[B,V]=n.useState([]),R=async s=>{i(O());const a=await $.get(`details-pos-machine-transactions/?search=filter&value=${j}&role=${p()}${d?`&date1=${l}&date2=${x}`:""}&page=${s}&page_size=${h}&key=${b}`);i(U()),T(a.data.results),v(a.data.count)},m=s=>{R(s),k(s)},G=s=>{W(s),k(1)};n.useEffect(()=>{const s=A==null?void 0:A.map((a,t)=>{var e,I,P,w;return[F===1?t+1:t+h*(F-1)+1,a.paid?"موفق":"ناموفق",Du(a==null?void 0:a.date),(e=a==null?void 0:a.product)==null?void 0:e.name,(I=a==null?void 0:a.currentPrice)==null?void 0:I.toLocaleString(),(P=a==null?void 0:a.weight)==null?void 0:P.toLocaleString(),(w=a==null?void 0:a.price)==null?void 0:w.toLocaleString(),Ru(a==null?void 0:a.posProvider)]});V(s)},[A]),n.useEffect(()=>{R(1)},[i,l,x,h,d]);const E=async s=>{s.preventDefault(),i(O());try{const a=await $.get(`details-pos-machine-transactions/?role=${p()}&search=filter&value=${j}${d?`&date1=${l}&date2=${x}`:""}&page=1&page_size=${h}&key=${b}`);T(a.data.results),v(a.data.count),i(U())}catch(a){console.error("Error fetching data:",a)}};return u.jsxs(o,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[u.jsxs(o,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[u.jsxs(o,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[u.jsx(nu,{icon:u.jsx(Cu,{}),checkedIcon:u.jsx(xu,{}),checked:d,onChange:()=>y(!d),color:"primary",size:"large"}),u.jsx(o,{children:u.jsx(M,{disabled:!d,label:"از تاریخ",id:"date",renderInput:s=>u.jsx(S,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...s}),value:l,onChange:s=>{C(D(s).format("YYYY-MM-DD"))}})}),u.jsx(o,{children:u.jsx(M,{disabled:!d,label:"تا تاریخ",id:"date",renderInput:s=>u.jsx(S,{size:"small",sx:{width:{xs:"126px",md:"160px"}},...s}),value:x,onChange:s=>{r(D(s).format("YYYY-MM-DD"))}})})]}),u.jsx(o,{children:u.jsxs("form",{onSubmit:E,children:[u.jsx(S,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:N}),u.jsx(L,{type:"submit",onClick:E,endIcon:u.jsx(lu,{}),children:"جستجو"})]})}),u.jsx(ou,{title:"خروجی اکسل",children:u.jsx(L,{color:"success",onClick:()=>{g({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const s=`${$.defaults.baseURL}detail_guilds_transaction_excel/?key=${b}${d?`&date1=${l}&date2=${x}`:""}`;window.location.href=s},children:u.jsx(du,{size:32})})})]}),u.jsx(iu,{data:B,columns:["ردیف","وضعیت تراکنش","تاریخ تراکنش","محصول","قیمت واحد","وزن (گرم)","مبلغ","از سرویس"],handlePageChange:m,totalRows:f,page:F,perPage:h,handlePerRowsChange:G,title:`تراکنش های ${c}`})]})},Vu=()=>{const{key:c,name:l}=ru();return u.jsx(u.Fragment,{children:u.jsx(pu,{display:"flex",justifyContent:"center",children:u.jsxs(o,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsx(Fu,{}),u.jsx(o,{container:!0,justifyContent:"space-between",gap:$u.SMALL,children:u.jsx(o,{xs:12,children:c?u.jsx(Iu,{name:l},c):u.jsx(Eu,{})})})]})})})};export{Vu as default}; diff --git a/build/assets/Tune-D4M2CAhp.js b/build/assets/Tune-D4M2CAhp.js new file mode 100644 index 0000000..cf6a433 --- /dev/null +++ b/build/assets/Tune-D4M2CAhp.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as v}from"./index-CeyyVc1v.js";var e={},a=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,o=a(v()),h=t;u=e.default=(0,o.default)((0,h.jsx)("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"}),"Tune");export{u as d}; diff --git a/build/assets/Users-CuH8b--q.js b/build/assets/Users-CuH8b--q.js new file mode 100644 index 0000000..6f11149 --- /dev/null +++ b/build/assets/Users-CuH8b--q.js @@ -0,0 +1 @@ +import{i as U,j as e,a$ as C,aV as d,aW as u,b5 as f,T as j,aZ as g,a_ as m,I as _,A as O,B as S,bn as z,ar as Y,aY as L,a9 as W,b as H}from"./mui-vendor-CkIVaoQP.js";import{r as R,L as K,j as G,h as V,G as s,S as t,e5 as q,V as J,p as $}from"./index-CeyyVc1v.js";import{r as x}from"./react-vendor-CmFgShSM.js";import{a as Z,u as w,f as Q}from"./redux-vendor-B7uoacJt.js";var M={},X=U;Object.defineProperty(M,"__esModule",{value:!0});var T=M.default=void 0,ee=X(R()),ue=e;T=M.default=(0,ee.default)((0,ue.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");var E={},ne=U;Object.defineProperty(E,"__esModule",{value:!0});var P=E.default=void 0,re=ne(R()),se=e;P=E.default=(0,re.default)((0,se.jsx)("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");const ce=Z("PROVINCE_GET_MANAGE_USERS_ROLES_SERVICE",async(h,{dispatch:c})=>{c(K());const{data:n,status:r}=await G.get("system_user_profile/",{params:{all_users:!0,userprofile_key:h.userProfileKey}});return c(V()),{data:n,status:r}}),ie=({row:h,item:c})=>{const{details:n}=c,[r,l]=x.useState(n.active),a=()=>{l(!r)};return e.jsx(C,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:n.address.province.name}),e.jsx(u,{align:"center",children:n.address.city.name}),e.jsx(u,{align:"center",children:n.address.address}),e.jsx(u,{align:"center",children:n.identityDocuments}),e.jsx(u,{align:"center",children:e.jsx(f,{checked:r,onChange:a,color:"primary"})})]},n.name)})},ae=({row:h,item:c})=>{const{details:n}=c;return e.jsx(C,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",component:"th",scope:"row",children:n.unitName}),e.jsx(u,{align:"center",children:n.address.province.name}),e.jsx(u,{align:"center",children:n.address.city.name}),e.jsx(u,{align:"center",children:n.address.address}),e.jsx(u,{align:"center",children:n.identityDocuments}),e.jsx(u,{align:"center",children:n.userBankInfo&&n.userBankInfo.bankName?e.jsxs(s,{container:!0,direction:"column",children:[e.jsxs(s,{children:["نام بانک: ",n.userBankInfo.bankName]}),e.jsxs(s,{children:["شماره کارت: ",n.userBankInfo.card]}),e.jsxs(s,{children:["شماره حساب: ",n.userBankInfo.account]}),e.jsxs(s,{children:["شبا: ",n.userBankInfo.shaba]})]}):"-"})]},n.name)})},le=({row:h,item:c})=>{const{details:n}=c,[r,l]=x.useState(n.active),a=()=>{l(!r)};return e.jsx(C,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:n.driverName}),e.jsx(u,{align:"center",children:n.driverMobile}),e.jsx(u,{align:"center",children:n.typeCar}),e.jsx(u,{align:"center",children:n.capocity.toLocaleString()}),e.jsx(u,{align:"center",children:n.healthCode}),e.jsx(u,{align:"center",children:n.pelak}),e.jsx(u,{align:"center",children:n.userBankInfo&&n.userBankInfo.bankName?e.jsxs(s,{container:!0,direction:"column",children:[e.jsxs(s,{children:["نام بانک: ",n.userBankInfo.bankName]}),e.jsxs(s,{children:["شماره کارت: ",n.userBankInfo.card]}),e.jsxs(s,{children:["شماره حساب: ",n.userBankInfo.account]}),e.jsxs(s,{children:["شبا: ",n.userBankInfo.shaba]})]}):"-"}),e.jsx(u,{align:"center",children:n.identityDocuments}),e.jsx(u,{align:"center",children:"-"}),e.jsx(u,{align:"center",children:e.jsx(f,{checked:r,onChange:a,color:"primary"})})]},n.name)})},te=({row:h,item:c})=>{const{details:n}=c,[r,l]=x.useState(n.vet.active),a=()=>{l(!r)};return e.jsx(C,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:n.vet.address.province.name}),e.jsx(u,{align:"center",children:n.vet.address.city.name}),e.jsx(u,{align:"center",children:n.vet.address.address}),e.jsx(u,{align:"center",children:n.vet.identityDocuments}),e.jsx(u,{align:"center",children:n.killHouse.name}),e.jsx(u,{align:"center",children:n.vet.userBankInfo&&n.vet.userBankInfo.bankName?e.jsxs(s,{container:!0,direction:"column",children:[e.jsxs(s,{children:["نام بانک: ",n.vet.userBankInfo.bankName]}),e.jsxs(s,{children:["شماره کارت: ",n.vet.userBankInfo.card]}),e.jsxs(s,{children:["شماره حساب: ",n.vet.userBankInfo.account]}),e.jsxs(s,{children:["شبا: ",n.vet.userBankInfo.shaba]})]}):"-"}),e.jsx(u,{align:"center",children:e.jsx(f,{checked:r,onChange:a,color:"primary"})})]},n.name)})},de=({row:h,item:c})=>{const{details:n}=c,[r,l]=x.useState(n==null?void 0:n.active),a=()=>{l(!r)};return e.jsx(C,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:n.address.province.name}),e.jsx(u,{align:"center",children:n.address.city.name}),e.jsx(u,{align:"center",children:n.address.address}),e.jsx(u,{align:"center",children:n.identityDocuments}),e.jsx(u,{align:"center",children:n.userBankInfo&&n.userBankInfo.bankName?e.jsxs(s,{container:!0,direction:"column",children:[e.jsxs(s,{children:["نام بانک: ",n.userBankInfo.bankName]}),e.jsxs(s,{children:["شماره کارت: ",n.userBankInfo.card]}),e.jsxs(s,{children:["شماره حساب: ",n.userBankInfo.account]}),e.jsxs(s,{children:["شبا: ",n.userBankInfo.shaba]})]}):"-"}),e.jsx(u,{align:"center",children:e.jsx(f,{checked:r,onChange:a,color:"primary"})})]},n.name)})},oe=({row:h,item:c})=>{const{details:n}=c;return e.jsx(C,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:n.address.province.name}),e.jsx(u,{align:"center",children:n.address.city.name}),e.jsx(u,{align:"center",children:n.address.address}),e.jsx(u,{align:"center",children:n.identityDocuments}),e.jsx(u,{align:"center",children:n.userBankInfo&&n.userBankInfo.bankName?e.jsxs(s,{container:!0,direction:"column",children:[e.jsxs(s,{children:["نام بانک: ",n.userBankInfo.bankName]}),e.jsxs(s,{children:["شماره کارت: ",n.userBankInfo.card]}),e.jsxs(s,{children:["شماره حساب: ",n.userBankInfo.account]}),e.jsxs(s,{children:["شبا: ",n.userBankInfo.shaba]})]}):"-"})]},n.name)})},he=({row:h,item:c})=>{const{details:n}=c,[r,l]=x.useState(n.active),a=()=>{l(!r)};return e.jsx(C,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:n.address.province.name}),e.jsx(u,{align:"center",children:n.address.city.name}),e.jsx(u,{align:"center",children:n.address.address}),e.jsx(u,{align:"center",children:n.identityDocuments}),e.jsx(u,{align:"center",children:e.jsx(f,{checked:r,onChange:a,color:"primary"})})]},n.name)})},xe=({row:h,item:c})=>{const{details:n}=c,[r,l]=x.useState(n.active),a=()=>{l(!r)};return e.jsx(C,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:n.address.province.name}),e.jsx(u,{align:"center",children:n.address.city.name}),e.jsx(u,{align:"center",children:n.address.address}),e.jsx(u,{align:"center",children:n.identityDocuments}),e.jsx(u,{align:"center",children:n.userBankInfo&&n.userBankInfo.bankName?e.jsxs(s,{container:!0,direction:"column",children:[e.jsxs(s,{children:["نام بانک: ",n.userBankInfo.bankName]}),e.jsxs(s,{children:["شماره کارت: ",n.userBankInfo.card]}),e.jsxs(s,{children:["شماره حساب: ",n.userBankInfo.account]}),e.jsxs(s,{children:["شبا: ",n.userBankInfo.shaba]})]}):"-"}),e.jsx(u,{align:"center",children:e.jsx(f,{checked:r,onChange:a,color:"primary"})})]},n.name)})},je=({row:h,item:c})=>{const{details:n}=c,[r,l]=x.useState(n.active),a=()=>{l(!r)};return e.jsx(C,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:n.address.province.name}),e.jsx(u,{align:"center",children:n.address.city.name}),e.jsx(u,{align:"center",children:n.address.address}),e.jsx(u,{align:"center",children:n.identityDocuments}),e.jsx(u,{align:"center",children:n.userBankInfo&&n.userBankInfo.bankName?e.jsxs(s,{container:!0,direction:"column",children:[e.jsxs(s,{children:["نام بانک: ",n.userBankInfo.bankName]}),e.jsxs(s,{children:["شماره کارت: ",n.userBankInfo.card]}),e.jsxs(s,{children:["شماره حساب: ",n.userBankInfo.account]}),e.jsxs(s,{children:["شبا: ",n.userBankInfo.shaba]})]}):"-"}),e.jsx(u,{align:"center",children:e.jsx(f,{checked:r,onChange:a,color:"primary"})})]},n.name)})},ge=({row:h,item:c})=>{const{details:n}=c,[r,l]=x.useState(n.active),a=()=>{l(!r)};return e.jsx(C,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",component:"th",scope:"row",children:n.name}),e.jsx(u,{align:"center",children:n.systemAddress.province.name}),e.jsx(u,{align:"center",children:n.systemAddress.city.name}),e.jsx(u,{align:"center",children:n.systemAddress.address}),e.jsx(u,{align:"center",children:n.capacity.toLocaleString()}),e.jsx(u,{align:"center",children:"-"}),e.jsx(u,{align:"center",children:n.identityDocuments}),e.jsx(u,{align:"center",children:n.killHouseOperator.userBankInfo&&n.killHouseOperator.userBankInfo.bankName?e.jsxs(s,{container:!0,direction:"column",children:[e.jsxs(s,{children:["نام بانک: ",n.killHouseOperator.userBankInfo.bankName]}),e.jsxs(s,{children:["شماره کارت: ",n.killHouseOperator.userBankInfo.card]}),e.jsxs(s,{children:["شماره حساب: ",n.killHouseOperator.userBankInfo.account]}),e.jsxs(s,{children:["شبا: ",n.killHouseOperator.userBankInfo.shaba]})]}):"-"}),e.jsx(u,{align:"center",children:e.jsx(f,{checked:r,onChange:a,color:"primary"})})]},n.name)})},me=({row:h,item:c})=>{const{details:n}=c,[r,l]=x.useState(n.active),a=()=>{l(!r)};return e.jsx(C,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",component:"th",scope:"row",children:n.breedingUniqueId}),e.jsx(u,{align:"center",children:n.unitName}),e.jsx(u,{align:"center",children:n.cityOperator?n.cityOperator:"-"}),e.jsx(u,{align:"center",children:n.address.province.name}),e.jsx(u,{align:"center",children:n.address.city.name}),e.jsx(u,{align:"center",children:n.address.address}),e.jsx(u,{align:"center",children:n.numberOfHalls}),e.jsx(u,{align:"center",children:n.totalCapacity.toLocaleString()}),e.jsx(u,{align:"center",children:"-"}),e.jsx(u,{align:"center",children:n.userBankInfo&&n.userBankInfo.bankName?e.jsxs(s,{container:!0,direction:"column",children:[e.jsxs(s,{children:["نام بانک: ",n.userBankInfo.bankName]}),e.jsxs(s,{children:["شماره کارت: ",n.userBankInfo.card]}),e.jsxs(s,{children:["شماره حساب: ",n.userBankInfo.account]}),e.jsxs(s,{children:["شبا: ",n.userBankInfo.shaba]})]}):"-"}),e.jsx(u,{align:"center",children:e.jsx(f,{checked:r,onChange:a,color:"primary"})})]},n.unitName)})},Ce=({row:h,item:c})=>{const{details:n}=c;return e.jsx(C,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:n.address.province.name}),e.jsx(u,{align:"center",children:n.address.city.name}),e.jsx(u,{align:"center",children:n.address.address}),e.jsx(u,{align:"center",children:n.identityDocuments}),e.jsx(u,{align:"center",children:n.userBankInfo&&n.userBankInfo.bankName?e.jsxs(s,{container:!0,direction:"column",children:[e.jsxs(s,{children:["نام بانک: ",n.userBankInfo.bankName]}),e.jsxs(s,{children:["شماره کارت: ",n.userBankInfo.card]}),e.jsxs(s,{children:["شماره حساب: ",n.userBankInfo.account]}),e.jsxs(s,{children:["شبا: ",n.userBankInfo.shaba]})]}):"-"})]},n.name)})},Ae=({userRoles:h,row:c})=>{const n=w(),[r,l]=x.useState();x.useEffect(()=>{n(ce({userProfileKey:c.userKey})).then(i=>l(i.payload.data))},[]);const a=r==null?void 0:r.filter(i=>i.roleName==="Poultry"),p=r==null?void 0:r.filter(i=>i.roleName==="KillHouse"),k=r==null?void 0:r.filter(i=>i.roleName==="CityOperator"),I=r==null?void 0:r.filter(i=>i.roleName==="ProvinceOperator"),A=r==null?void 0:r.filter(i=>i.roleName==="ProvinceFinancial"),v=r==null?void 0:r.filter(i=>i.roleName==="Driver"),y=r==null?void 0:r.filter(i=>i.roleName==="KillHouseVet"),b=r==null?void 0:r.filter(i=>i.roleName==="VetFarm"),B=r==null?void 0:r.filter(i=>i.roleName==="ProvinceInspector"),F=r==null?void 0:r.filter(i=>i.roleName==="Jahad"),N=r==null?void 0:r.filter(i=>i.roleName==="CityJahad"),D=r==null?void 0:r.filter(i=>i.roleName==="Admin");return e.jsxs(e.Fragment,{children:[!!(a!=null&&a.length)&&e.jsxs(s,{container:!0,gap:t.TINY,my:t.MEDIUM,children:[e.jsx(j,{variant:"body2",fontWeight:"bold",gutterBottom:!0,component:"div",children:"نقش های مرغدار"}),e.jsxs(g,{size:"small","aria-label":"purchases",children:[e.jsx(m,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:"شناسه یکتا"}),e.jsx(u,{align:"center",children:"نام مرغداری"}),e.jsx(u,{align:"center",children:"تعاونی"}),e.jsx(u,{aligrrrn:"center",children:"استان"}),e.jsx(u,{align:"center",children:"شهر"}),e.jsx(u,{align:"center",children:"آدرس"}),e.jsx(u,{align:"center",children:"تعداد سالن"}),e.jsx(u,{align:"center",children:"ظرفیت (قطعه)"}),e.jsx(u,{align:"center",children:"اسناد هویتی"}),e.jsx(u,{align:"center",children:"اطلاعات بانکی"}),e.jsx(u,{align:"center",children:"وضعیت"})]})}),a.map((i,o)=>e.jsx(me,{row:c,item:i},o))]})]}),!!(p!=null&&p.length)&&e.jsxs(s,{container:!0,gap:t.TINY,my:t.MEDIUM,children:[e.jsx(j,{variant:"body2",fontWeight:"bold",gutterBottom:!0,component:"div",children:"نقش کشتارگاه"}),e.jsxs(g,{size:"small","aria-label":"purchases",children:[e.jsx(m,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:"نام کشتارگاه"}),e.jsx(u,{align:"center",children:"استان"}),e.jsx(u,{align:"center",children:"شهر"}),e.jsx(u,{align:"center",children:"آدرس"}),e.jsx(u,{align:"center",children:"ظرفیت"}),e.jsx(u,{align:"center",children:"کشتارکن ها"}),e.jsx(u,{align:"center",children:"اسناد هویتی"}),e.jsx(u,{align:"center",children:"اطلاعات بانکی"}),e.jsx(u,{align:"center",children:"وضعیت"})]})}),p.map((i,o)=>e.jsx(ge,{row:c,item:i},o))]})]}),!!(k!=null&&k.length)&&e.jsxs(s,{container:!0,gap:t.TINY,my:t.MEDIUM,children:[e.jsx(j,{variant:"body2",fontWeight:"bold",gutterBottom:!0,component:"div",children:"نقش شهرستان"}),e.jsxs(g,{size:"small","aria-label":"purchases",children:[e.jsx(m,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:"تعاونی"}),e.jsx(u,{align:"center",children:"استان"}),e.jsx(u,{align:"center",children:"شهر"}),e.jsx(u,{align:"center",children:"آدرس"}),e.jsx(u,{align:"center",children:"اسناد هویتی"}),e.jsx(u,{align:"center",children:"اطلاعات بانکی"})]})}),k.map((i,o)=>e.jsx(ae,{row:c,item:i},o))]})]}),!!(I!=null&&I.length)&&e.jsxs(s,{container:!0,gap:t.TINY,my:t.MEDIUM,children:[e.jsx(j,{variant:"body2",fontWeight:"bold",gutterBottom:!0,component:"div",children:"نقش اپراتور تخصیص"}),e.jsxs(g,{size:"small","aria-label":"purchases",children:[e.jsx(m,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:"استان"}),e.jsx(u,{align:"center",children:"شهر"}),e.jsx(u,{align:"center",children:"آدرس"}),e.jsx(u,{align:"center",children:"اسناد هویتی"}),e.jsx(u,{align:"center",children:"اطلاعات بانکی"})]})}),I.map((i,o)=>e.jsx(Ce,{row:c,item:i},o))]})]}),!!(A!=null&&A.length)&&e.jsxs(s,{container:!0,gap:t.TINY,my:t.MEDIUM,children:[e.jsx(j,{variant:"body2",fontWeight:"bold",gutterBottom:!0,component:"div",children:"نقش اپراتور مالی"}),e.jsxs(g,{size:"small","aria-label":"purchases",children:[e.jsx(m,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:"استان"}),e.jsx(u,{align:"center",children:"شهر"}),e.jsx(u,{align:"center",children:"آدرس"}),e.jsx(u,{align:"center",children:"اسناد هویتی"}),e.jsx(u,{align:"center",children:"اطلاعات بانکی"})]})}),A.map((i,o)=>e.jsx(oe,{row:c,item:i},o))]})]}),!!(v!=null&&v.length)&&e.jsxs(s,{container:!0,gap:t.TINY,my:t.MEDIUM,children:[e.jsx(j,{variant:"body2",fontWeight:"bold",gutterBottom:!0,component:"div",children:"نقش راننده"}),e.jsxs(g,{size:"small","aria-label":"purchases",children:[e.jsx(m,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:"نام و نام خانوادگی"}),e.jsx(u,{align:"center",children:"تلفن راننده"}),e.jsx(u,{align:"center",children:"مدل خودرو"}),e.jsx(u,{align:"center",children:"ظرفیت"}),e.jsx(u,{align:"center",children:"کدبهداشتی"}),e.jsx(u,{align:"center",children:"شماره پلاک"}),e.jsx(u,{align:"center",children:"اطلاعات بانکی"}),e.jsx(u,{align:"center",children:"اسناد هویتی"}),e.jsx(u,{align:"center",children:"زیرمجموعه کشتارگاه"}),e.jsx(u,{align:"center",children:"وضعیت"})]})}),v.map((i,o)=>e.jsx(le,{row:c,item:i},o))]})]}),!!(y!=null&&y.length)&&e.jsxs(s,{container:!0,gap:t.TINY,my:t.MEDIUM,children:[e.jsx(j,{variant:"body2",fontWeight:"bold",gutterBottom:!0,component:"div",children:"نقش دامپزشک کشتارگاه"}),e.jsxs(g,{size:"small","aria-label":"purchases",children:[e.jsx(m,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:"استان"}),e.jsx(u,{align:"center",children:"شهر"}),e.jsx(u,{align:"center",children:"آدرس"}),e.jsx(u,{align:"center",children:"اسناد هویتی"}),e.jsx(u,{align:"center",children:"کشتارگاه زیرمجموعه"}),e.jsx(u,{align:"center",children:"اطلاعات بانکی"}),e.jsx(u,{align:"center",children:"وضعیت"})]})}),y.map((i,o)=>e.jsx(te,{row:c,item:i},o))]})]}),!!(b!=null&&b.length)&&e.jsxs(s,{container:!0,gap:t.TINY,my:t.MEDIUM,children:[e.jsx(j,{variant:"body2",fontWeight:"bold",gutterBottom:!0,component:"div",children:"نقش دامپزشک فارم"}),e.jsxs(g,{size:"small","aria-label":"purchases",children:[e.jsx(m,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:"استان"}),e.jsx(u,{align:"center",children:"شهر"}),e.jsx(u,{align:"center",children:"آدرس"}),e.jsx(u,{align:"center",children:"اسناد هویتی"}),e.jsx(u,{align:"center",children:"اطلاعات بانکی"}),e.jsx(u,{align:"center",children:"وضعیت"})]})}),b.map((i,o)=>e.jsx(de,{row:c,item:i},o))]})]}),!!(B!=null&&B.length)&&e.jsxs(s,{container:!0,gap:t.TINY,my:t.MEDIUM,children:[e.jsx(j,{variant:"body2",fontWeight:"bold",gutterBottom:!0,component:"div",children:"نقش بازرس"}),e.jsxs(g,{size:"small","aria-label":"purchases",children:[e.jsx(m,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:"استان"}),e.jsx(u,{align:"center",children:"شهر"}),e.jsx(u,{align:"center",children:"آدرس"}),e.jsx(u,{align:"center",children:"اسناد هویتی"}),e.jsx(u,{align:"center",children:"وضعیت"})]})}),B.map((i,o)=>e.jsx(he,{row:c,item:i},o))]})]}),!!(F!=null&&F.length)&&e.jsxs(s,{container:!0,gap:t.TINY,my:t.MEDIUM,children:[e.jsx(j,{variant:"body2",fontWeight:"bold",gutterBottom:!0,component:"div",children:"نقش جهاد استان"}),e.jsxs(g,{size:"small","aria-label":"purchases",children:[e.jsx(m,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:"استان"}),e.jsx(u,{align:"center",children:"شهر"}),e.jsx(u,{align:"center",children:"آدرس"}),e.jsx(u,{align:"center",children:"اطلاعات بانکی"}),e.jsx(u,{align:"center",children:"اسناد هویتی"}),e.jsx(u,{align:"center",children:"وضعیت"})]})}),F.map((i,o)=>e.jsx(je,{row:c,item:i},o))]})]}),!!(N!=null&&N.length)&&e.jsxs(s,{container:!0,gap:t.TINY,my:t.MEDIUM,children:[e.jsx(j,{variant:"body2",fontWeight:"bold",gutterBottom:!0,component:"div",children:"نقش جهاد شهرستان"}),e.jsxs(g,{size:"small","aria-label":"purchases",children:[e.jsx(m,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:"استان"}),e.jsx(u,{align:"center",children:"شهر"}),e.jsx(u,{align:"center",children:"آدرس"}),e.jsx(u,{align:"center",children:"اطلاعات بانکی"}),e.jsx(u,{align:"center",children:"اسناد هویتی"}),e.jsx(u,{align:"center",children:"وضعیت"})]})}),N.map((i,o)=>e.jsx(xe,{row:c,item:i},o))]})]}),!!(D!=null&&D.length)&&e.jsxs(s,{container:!0,gap:t.TINY,my:t.MEDIUM,children:[e.jsx(j,{variant:"body2",fontWeight:"bold",gutterBottom:!0,component:"div",children:"نقش ادمین استان"}),e.jsxs(g,{size:"small","aria-label":"purchases",children:[e.jsx(m,{children:e.jsxs(d,{children:[e.jsx(u,{align:"center",children:"استان"}),e.jsx(u,{align:"center",children:"شهر"}),e.jsx(u,{align:"center",children:"آدرس"}),e.jsx(u,{align:"center",children:"اسناد هویتی"}),e.jsx(u,{align:"center",children:"وضعیت"})]})}),D.map((i,o)=>e.jsx(ie,{row:c,item:i},o))]})]})]})};function pe(h){const{row:c}=h,[n,r]=x.useState(!1),[l,a]=x.useState(c.userState),p=()=>{a(!l)};return e.jsxs(e.Fragment,{children:[e.jsxs(d,{sx:{"& > *":{borderBottom:"unset"}},children:[e.jsx(u,{children:e.jsx(_,{"aria-label":"expand row",size:"small",onClick:()=>r(!n),children:n?e.jsx(P,{}):e.jsx(T,{})})}),e.jsxs(u,{component:"th",scope:"row",children:[c.image&&e.jsx(O,{alt:"User Avatar",src:c.image}),c.name]}),e.jsx(u,{align:"center",children:c.nationalCode}),e.jsx(u,{align:"center",children:c.phone}),e.jsx(u,{align:"center",children:c.birthDate}),e.jsx(u,{align:"center",children:c.password}),e.jsx(u,{align:"center",children:c.identityDocuments}),e.jsx(u,{align:"center",children:c.rolesTitle}),e.jsx(u,{align:"center",children:e.jsx(f,{checked:l,onChange:p,color:"primary"})}),e.jsx(u,{align:"center",children:e.jsx(S,{children:"افزودن نقش"})})]}),e.jsx(d,{children:e.jsx(u,{style:{paddingBottom:0,paddingTop:0},colSpan:12,children:e.jsx(z,{in:n,timeout:"auto",unmountOnExit:!0,children:e.jsx(Ae,{userRoles:c.userRoles,row:c})})})})]})}function fe(h,c,n,r,l,a,p,k,I,A,v,y){return{image:h,userRoles:c,userKey:n,name:r,nationalCode:l,phone:a,birthDate:p,password:k,identityDocuments:I,rolesTitle:A,userState:v,rolesData:y}}const ke=()=>{const h=w(),[c,n]=x.useState([]),{provinceGetManageUsers:r}=Q(l=>l.provinceSlice);return x.useEffect(()=>{h(q())},[]),x.useEffect(()=>{const l=r==null?void 0:r.map(a=>{var k,I;const p=(k=a.role)==null?void 0:k.map((A,v)=>e.jsx(Y,{label:J(A.name),variant:"outlined"},A+v));return fe(a.image,(I=a.role)==null?void 0:I.map(A=>A.name),a.key,a.fullname,a.nationalId?a.nationalId:"-",a.mobile,a.birthday?$(a.birthday):"-",a.password,"-",e.jsx(s,{container:!0,gap:t.TINY,children:p}),a.active,a.rolesData)});n(l)},[r]),e.jsxs(e.Fragment,{children:[e.jsxs(s,{container:!0,alignItems:"center",gap:t.SMALL,mt:t.MEDIUM,children:[e.jsx(j,{children:"مدیریت کاربران"}),e.jsx(S,{children:"ایجاد کاربر جدید"})]}),e.jsx(L,{component:W,style:{marginTop:10},children:e.jsxs(g,{"aria-label":"collapsible table",children:[e.jsx(m,{children:e.jsxs(d,{children:[e.jsx(u,{}),e.jsx(u,{children:"نام و نام خانوادگی"}),e.jsx(u,{align:"center",children:"کدملی"}),e.jsx(u,{align:"center",children:"تلفن همراه"}),e.jsx(u,{align:"center",children:"تاریخ تولد"}),e.jsx(u,{align:"center",children:"رمزعبور"}),e.jsx(u,{align:"center",children:"اسناد هویتی"}),e.jsx(u,{align:"center",children:"نقش ها"}),e.jsx(u,{align:"center",children:"وضعیت"}),e.jsx(u,{align:"center",children:"عملیات"})]})}),e.jsx(C,{children:c==null?void 0:c.map(l=>e.jsx(pe,{row:l},l.name))})]})})]})},Be=()=>e.jsx(e.Fragment,{children:e.jsx(H,{display:"flex",justifyContent:"center",children:e.jsx(s,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:e.jsx(s,{container:!0,justifyContent:"space-between",gap:t.SMALL,children:e.jsx(s,{xs:12,children:e.jsx(ke,{})})})})})});export{Be as default}; diff --git a/build/assets/VetFarm-DwS6N0cZ.js b/build/assets/VetFarm-DwS6N0cZ.js new file mode 100644 index 0000000..58ef6ff --- /dev/null +++ b/build/assets/VetFarm-DwS6N0cZ.js @@ -0,0 +1 @@ +import{j as u,T as y,ak as P,B as $,p as W,i as pu,I as gu,b0 as xu,an as Au,ao as G,b4 as H,ap as U,b as fu}from"./mui-vendor-CkIVaoQP.js";import{j as L,A as lu,L as T,N as V,h as F,u as Fu,c as vu,b as yu,M as ou,G as a,S as f,r as mu,X as w,k2 as ju,O as bu,C as Iu,k3 as _u,k4 as Eu}from"./index-CeyyVc1v.js";import{r as i,b as Su,u as Tu,f as Lu}from"./react-vendor-CmFgShSM.js";import{a as q,u as cu}from"./redux-vendor-B7uoacJt.js";import{R as Bu}from"./ResponsiveTable-w7hk7Uq8.js";import{I as ku,f as Ru}from"./toBase64-BzgTOHsW.js";import{d as zu}from"./DeleteOutlineOutlined-G071NcE9.js";import{d as Nu}from"./Visibility-DeyjG-oI.js";import{d as Ou}from"./Tune-D4M2CAhp.js";import{R as Du}from"./index.esm-Bu7XMDZU.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./Delete-C5MyLelE.js";import"./iconBase-BEJYyZsk.js";const iu=q("VET_FARM_NEW_INSPECT",async r=>{const{data:C,status:g}=await L.post("vet_farm_inspection/",r);return{data:C,status:g}}),wu=q("VET_GET_HATCHING",async r=>{const{data:C,status:g}=await L.get("poultry_hatching/?key="+r);return{data:C,status:g}}),Cu=({id:r,hall:C,poultrykey:g,updateTable:m})=>{var h,b,k,R;const n=cu(),[d,B]=i.useState(""),[j,x]=Su.useState([]),M=(o,I)=>{x(o)},[l]=i.useContext(lu);i.useEffect(()=>{n(T()),n(wu(r+"&hall="+C)).then(o=>{o.error?(l({vertical:"top",horizontal:"center",msg:"اطلاعات جوجه ریزی یافت نشد!",severity:"error"}),n(V({right:!1,bottom:!1,content:null}))):(B(o.payload.data),o.payload.data.length||B(null),n(F())),n(F())})},[]);const t=Fu({initialValues:{topic:"",description:"",losses:""},validationSchema:vu({topic:ou().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),description:ou().required("این فیلد اجباری است!").typeError("لطفا فیلد را به درستی وارد کنید!"),losses:yu().typeError("لطفا فیلد را به درستی وارد کنید!")})});return i.useEffect(()=>{t.validateForm()},[]),u.jsx(a,{container:!0,gap:f.SMALL,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:u.jsxs(a,{container:!0,direction:"column",gap:f.SMALL,children:[d&&u.jsxs(u.Fragment,{children:[u.jsxs(a,{sx:{textAlign:"justify"},children:[u.jsx(y,{variant:"body2",mr:f.TINY,color:o=>o.palette.grey.A700,children:"دوره جوجه ریزی"}),u.jsx(y,{variant:"body2",mr:f.TINY,fontWeight:"bold",children:`دوره ${(h=d[0])==null?void 0:h.period} سالن ${(b=d[0])==null?void 0:b.hall} نژاد ${(k=d[0])==null?void 0:k.chickenBreed} باقیمانده ${(R=d[0])==null?void 0:R.leftOver} قطعه`})," "]}),u.jsx(a,{children:u.jsx(P,{id:"losses",label:"درصورت وجود تلفات، مقدار آن را وارد کنید",variant:"outlined",sx:{width:"100%"},value:t.values.losses,error:t.touched.losses?!!t.errors.losses:null,onChange:t.handleChange,onBlur:t.handleBlur,helperText:t.touched.losses&&t.errors.losses?t.errors.losses:null})})]}),u.jsx(a,{children:u.jsx(P,{id:"topic",label:"موضوع",variant:"outlined",sx:{width:"100%"},value:t.values.topic,error:t.touched.topic?!!t.errors.topic:null,onChange:t.handleChange,onBlur:t.handleBlur,helperText:t.touched.topic&&t.errors.topic?t.errors.topic:null})}),u.jsx(a,{children:u.jsx(P,{multiline:!0,rows:4,id:"description",label:"توضیحات",variant:"outlined",sx:{width:"100%"},value:t.values.description,error:t.touched.description?!!t.errors.description:null,onChange:t.handleChange,onBlur:t.handleBlur,helperText:t.touched.description&&t.errors.description?t.errors.description:null})}),u.jsx(y,{children:"پیوست تصویر"}),u.jsx(a,{mb:f.SMALL,children:u.jsx(ku,{id:"image",onChange:M,images:j,maxNumber:4,title:"بارگذاری سند",value:t.values.image,error:t.touched.image?!!t.errors.image:null,onBlur:t.handleBlur,helperText:t.touched.image&&t.errors.image?t.errors.image:null})}),u.jsx(a,{mb:f.SMALL,children:u.jsx($,{disabled:!t.isValid,fullWidth:!0,variant:"contained",onClick:()=>{var I;n(T());const o=j.map(c=>Ru(c.data_url));d?n(iu({key:g,poultry_hatching_key:(I=d[0])==null?void 0:I.key,topic:t.values.topic,description:t.values.description,Losses:t.values.losses?t.values.losses:0,image:o,hall:C,longitude:"1",latitude:"1"})).then(c=>{m(),c.error?c.error.message.includes("400")?l({vertical:"top",horizontal:"center",msg:"امروز برای این سالن بازرسی ثبت شده است!",severity:"error"}):c.error.message.includes("403")?l({vertical:"top",horizontal:"center",msg:"امروز برای مرغداری دیگری بازرسی ثبت شده است!",severity:"error"}):l({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):l({vertical:"top",horizontal:"center",msg:"با موفقیت ثبت شد!",severity:"success"}),n(F()),n(V({right:!1,bottom:!1,content:null}))}):n(iu({key:g,topic:t.values.topic,description:t.values.description,image:o,hall:C,longitude:"1",latitude:"1"})).then(c=>{m(),c.error?c.error.message.includes("400")?l({vertical:"top",horizontal:"center",msg:"امروز برای این سالن بازرسی ثبت شده است!",severity:"error"}):c.error.message.includes("403")?l({vertical:"top",horizontal:"center",msg:"امروز برای مرغداری دیگری بازرسی ثبت شده است!",severity:"error"}):l({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):l({vertical:"top",horizontal:"center",msg:"با موفقیت ثبت شد!",severity:"success"}),n(F()),n(V({right:!1,bottom:!1,content:null}))})},children:"ثبت اطلاعات"})})]})})};Cu.propTypes={id:W.PropTypes.string,hall:W.PropTypes.string,poultrykey:W.PropTypes.string};const Pu=q("VET_FARM_NEW_FARM",async r=>await L.delete("vet_farm/0/?vet_farm_key="+r));var Q={},$u=pu;Object.defineProperty(Q,"__esModule",{value:!0});var du=Q.default=void 0,Vu=$u(mu()),Mu=u;du=Q.default=(0,Vu.default)((0,Mu.jsx)("path",{d:"M3 10h11v2H3zm0-4h11v2H3zm0 8h7v2H3zm17.59-2.07-4.25 4.24-2.12-2.12-1.41 1.41L16.34 19 22 13.34z"}),"PlaylistAddCheckOutlined");const Wu=()=>{const r=cu(),C=Tu(),g=s=>{t(s.target.value)},[m]=i.useContext(lu),[n,d]=i.useState([]),[B,j]=i.useState(0),[x,M]=i.useState(10),[l,t]=i.useState(""),[h,b]=i.useState(1),[k,R]=i.useState([]),o=async s=>{r(T());const e=await L.get(`management_vet_farm/?search=filter&value=${l}&role=${w()}&page=${s}&page_size=${x}`);r(F()),d(e.data.results),j(e.data.count)},I=s=>{o(s),b(s)},c=s=>{M(s),b(1)},Y=()=>{o(h!==0?h:1)},hu=({item:s,index:e})=>{const[p,_]=i.useState(null),z=v=>{_(v.currentTarget)},A=()=>{_(null)},E=!!p,S=E?`vet-farm-actions-${(s==null?void 0:s.key)??e}`:void 0,N=()=>{A(),C(ju+s.key)},O=()=>{A(),r(V({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت اطلاعات بازرسی",content:u.jsx(Cu,{poultrykey:s.key,id:s.poultry.key,hall:s.hall,updateTable:Y})}))},D=()=>{A(),r(bu({title:"سالن را حذف میکنید؟",content:u.jsxs(a,{container:!0,xs:12,justifyContent:"space-around",children:[u.jsx(a,{item:!0,container:!0,xs:3,children:u.jsx($,{fullWidth:!0,color:"error",variant:"contained",onClick:()=>{r(T()),r(Pu(s.key)).then(v=>{Y(),r(F()),v.error.message.includes("403")?m({vertical:"top",horizontal:"center",msg:"برای این فارم قبلا بازرسی ثبت شده است!",severity:"error"}):m({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})})},children:"بله"})}),u.jsx(a,{item:!0,container:!0,xs:3,children:u.jsx($,{fullWidth:!0,variant:"outlined",onClick:()=>{r(Iu())},children:"لغو"})})]})}))};return u.jsxs(u.Fragment,{children:[u.jsx(gu,{"aria-describedby":S,color:"primary",size:"small",onClick:z,children:u.jsx(Ou,{fontSize:"small"})}),u.jsx(xu,{id:S,open:E,anchorEl:p,onClose:A,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsxs(Au,{sx:{p:1},children:[u.jsx(G,{disablePadding:!0,children:u.jsxs(H,{sx:{color:"primary.main"},onClick:N,children:[u.jsx(U,{sx:{minWidth:36,color:"inherit"},children:u.jsx(Nu,{fontSize:"small"})}),u.jsx(y,{variant:"body2",children:"نمایش پرونده"})]})}),u.jsx(G,{disablePadding:!0,children:u.jsxs(H,{sx:{color:"success.main"},onClick:O,children:[u.jsx(U,{sx:{minWidth:36,color:"inherit"},children:u.jsx(du,{fontSize:"small"})}),u.jsx(y,{variant:"body2",children:"ایجاد بازرسی"})]})}),u.jsx(G,{disablePadding:!0,children:u.jsxs(H,{sx:{color:"error.main"},onClick:D,children:[u.jsx(U,{sx:{minWidth:36,color:"inherit"},children:u.jsx(zu,{fontSize:"small"})}),u.jsx(y,{variant:"body2",children:"حذف فارم"})]})})]})})]})};i.useEffect(()=>{const s=n==null?void 0:n.map((e,p)=>{var _,z,A,E,S,N,O,D,v,J,K,Z,uu,eu,tu,ru,su,nu,au;return w()==="VetFarm"?[h===1?p+1:p+x*(h-1)+1,(_=e.poultry)!=null&&_.breedingUniqueId?Number(e.poultry.breedingUniqueId):"-",(z=e.poultry)==null?void 0:z.unitName,(S=(E=(A=e.poultry)==null?void 0:A.address)==null?void 0:E.city)==null?void 0:S.name,e.hall?e.hall:"ندارد",e.inspectionInfo.numberOfInspections?e.inspectionInfo.numberOfInspections:0,e==null?void 0:e.hatchingQuantity,e.vetfarmLosses,e.inspectionInfo.numberOfHatching?"%"+Math.round(e.vetfarmLosses*100/e.inspectionInfo.numberOfHatching):0,u.jsx(hu,{item:e,index:p},(e==null?void 0:e.key)??p)]:[h===1?p+1:p+x*(h-1)+1,e.breedingUniqueId?Number(e.breedingUniqueId):"-",e.unitName,(O=(N=e==null?void 0:e.address)==null?void 0:N.city)==null?void 0:O.name,(D=e==null?void 0:e.hatchingQuantity)!=null&&D.period?(v=e==null?void 0:e.hatchingQuantity)==null?void 0:v.period:"ندارد",(K=(J=e==null?void 0:e.hatchingQuantity)==null?void 0:J.totalQuantity)==null?void 0:K.toLocaleString(),(uu=(Z=e==null?void 0:e.hatchingQuantity)==null?void 0:Z.leftOver)==null?void 0:uu.toLocaleString(),(tu=(eu=e==null?void 0:e.hatchingQuantity)==null?void 0:eu.unionLosses)==null?void 0:tu.toLocaleString(),(su=(ru=e==null?void 0:e.hatchingQuantity)==null?void 0:ru.vetFarmLosses)==null?void 0:su.toLocaleString(),(au=(nu=e==null?void 0:e.hatchingQuantity)==null?void 0:nu.totalLosses)==null?void 0:au.toLocaleString()]});R(s)},[n]),i.useEffect(()=>{o(1)},[r,x]);const X=async s=>{s.preventDefault(),r(T());try{const e=await L.get(`management_vet_farm/?role=${w()}&search=filter&value=${l}&page=1&page_size=${x}`);d(e.data.results),j(e.data.count),r(F())}catch(e){console.error("Error fetching data:",e)}};return u.jsxs(a,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,mt:2,children:[u.jsxs("form",{onSubmit:X,children:[u.jsx(P,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:g}),u.jsx($,{type:"submit",onClick:X,endIcon:u.jsx(Du,{}),children:"جستجو"})]}),u.jsx(Bu,{data:k,columns:w()==="VetFarm"?["ردیف","شناسه یکتا فارم","نام فارم","شهر","سالن","تعداد بازرسی","جوجه ریزی","مجموع تلفات (قطعه)","درصد تلفات","عملیات"]:["ردیف","شناسه یکتا فارم","نام فارم","شهر","دوره جوجه ریزی","تعداد جوجه ریزی","باقیمانده جوجه ریزی","تلفات اعلامی اتحادیه (قطعه)","تلفات اعلامی دامپزشک فارم (قطعه)","تلفات کل (قطعه)"],handlePageChange:I,totalRows:B,page:h,perPage:x,handlePerRowsChange:c,title:"سالن های تحت پوشش"})]})},n0=()=>{const{pathname:r}=Lu();return u.jsx(u.Fragment,{children:u.jsx(fu,{display:"flex",justifyContent:"center",children:u.jsx(a,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsx(a,{container:!0,justifyContent:"space-between",gap:f.SMALL,children:u.jsx(a,{xs:12,children:(r===_u||r===Eu)&&u.jsx(Wu,{})})})})})})};export{n0 as default}; diff --git a/build/assets/VetFarmAggregateBars-CA10Fi1e.js b/build/assets/VetFarmAggregateBars-CA10Fi1e.js new file mode 100644 index 0000000..ec40a00 --- /dev/null +++ b/build/assets/VetFarmAggregateBars-CA10Fi1e.js @@ -0,0 +1 @@ +import{c8 as me,j as i,T as D,ak as B,aa as pe,B as F,c9 as Oe,d as ye,p as ie,I as ce,a3 as j}from"./mui-vendor-CkIVaoQP.js";import{r as p}from"./react-vendor-CmFgShSM.js";import{fZ as ke,L as O,j as N,h as w,A as z,X as x,u as le,G as _,c as we,M as se,S as fe,C as Y,O as Ae,f_ as Fe}from"./index-CeyyVc1v.js";import{a as P,u as K}from"./redux-vendor-B7uoacJt.js";import{d as De}from"./Pageview-TRcW_9jm.js";import{d as xe}from"./Edit-CqBj1Y2L.js";import{d as Ee}from"./AddCircleOutline-C8LXM-k8.js";import{S as Se}from"./SimpleTable-DBAoNnCU.js";import{d as Me}from"./Delete-C5MyLelE.js";function I(r){if(r===null||r===!0||r===!1)return NaN;var e=Number(r);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function T(r,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function A(r){T(1,arguments);var e=Object.prototype.toString.call(r);return r instanceof Date||me(r)==="object"&&e==="[object Date]"?new Date(r.getTime()):typeof r=="number"||e==="[object Number]"?new Date(r):((typeof r=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function je(r,e){T(2,arguments);var t=A(r).getTime(),u=I(e);return new Date(t+u)}var Ue={};function ne(){return Ue}function Ye(r){var e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),r.getTime()-e.getTime()}function Ne(r){return T(1,arguments),r instanceof Date||me(r)==="object"&&Object.prototype.toString.call(r)==="[object Date]"}function Pe(r){if(T(1,arguments),!Ne(r)&&typeof r!="number")return!1;var e=A(r);return!isNaN(Number(e))}function qe(r,e){T(2,arguments);var t=I(e);return je(r,-t)}var We=864e5;function Ie(r){T(1,arguments);var e=A(r),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var u=e.getTime(),a=t-u;return Math.floor(a/We)+1}function ue(r){T(1,arguments);var e=1,t=A(r),u=t.getUTCDay(),a=(u=a.getTime()?t+1:e.getTime()>=o.getTime()?t:t-1}function Re(r){T(1,arguments);var e=Te(r),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var u=ue(t);return u}var Le=6048e5;function $e(r){T(1,arguments);var e=A(r),t=ue(e).getTime()-Re(e).getTime();return Math.round(t/Le)+1}function ae(r,e){var t,u,a,n,o,f,l,s;T(1,arguments);var v=ne(),c=I((t=(u=(a=(n=e==null?void 0:e.weekStartsOn)!==null&&n!==void 0?n:e==null||(o=e.locale)===null||o===void 0||(f=o.options)===null||f===void 0?void 0:f.weekStartsOn)!==null&&a!==void 0?a:v.weekStartsOn)!==null&&u!==void 0?u:(l=v.locale)===null||l===void 0||(s=l.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&t!==void 0?t:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=A(r),y=g.getUTCDay(),b=(y=1&&y<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(c+1,0,y),b.setUTCHours(0,0,0,0);var E=ae(b,e),k=new Date(0);k.setUTCFullYear(c,0,y),k.setUTCHours(0,0,0,0);var R=ae(k,e);return v.getTime()>=E.getTime()?c+1:v.getTime()>=R.getTime()?c:c-1}function Ge(r,e){var t,u,a,n,o,f,l,s;T(1,arguments);var v=ne(),c=I((t=(u=(a=(n=e==null?void 0:e.firstWeekContainsDate)!==null&&n!==void 0?n:e==null||(o=e.locale)===null||o===void 0||(f=o.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&a!==void 0?a:v.firstWeekContainsDate)!==null&&u!==void 0?u:(l=v.locale)===null||l===void 0||(s=l.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&t!==void 0?t:1),g=be(r,e),y=new Date(0);y.setUTCFullYear(g,0,c),y.setUTCHours(0,0,0,0);var b=ae(y,e);return b}var Be=6048e5;function ze(r,e){T(1,arguments);var t=A(r),u=ae(t,e).getTime()-Ge(t,e).getTime();return Math.round(u/Be)+1}function h(r,e){for(var t=r<0?"-":"",u=Math.abs(r).toString();u.length0?u:1-u;return h(t==="yy"?a%100:a,t.length)},M:function(e,t){var u=e.getUTCMonth();return t==="M"?String(u+1):h(u+1,2)},d:function(e,t){return h(e.getUTCDate(),t.length)},a:function(e,t){var u=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return u.toUpperCase();case"aaa":return u;case"aaaaa":return u[0];case"aaaa":default:return u==="am"?"a.m.":"p.m."}},h:function(e,t){return h(e.getUTCHours()%12||12,t.length)},H:function(e,t){return h(e.getUTCHours(),t.length)},m:function(e,t){return h(e.getUTCMinutes(),t.length)},s:function(e,t){return h(e.getUTCSeconds(),t.length)},S:function(e,t){var u=t.length,a=e.getUTCMilliseconds(),n=Math.floor(a*Math.pow(10,u-3));return h(n,t.length)}},G={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ve={G:function(e,t,u){var a=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return u.era(a,{width:"abbreviated"});case"GGGGG":return u.era(a,{width:"narrow"});case"GGGG":default:return u.era(a,{width:"wide"})}},y:function(e,t,u){if(t==="yo"){var a=e.getUTCFullYear(),n=a>0?a:1-a;return u.ordinalNumber(n,{unit:"year"})}return U.y(e,t)},Y:function(e,t,u,a){var n=be(e,a),o=n>0?n:1-n;if(t==="YY"){var f=o%100;return h(f,2)}return t==="Yo"?u.ordinalNumber(o,{unit:"year"}):h(o,t.length)},R:function(e,t){var u=Te(e);return h(u,t.length)},u:function(e,t){var u=e.getUTCFullYear();return h(u,t.length)},Q:function(e,t,u){var a=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return h(a,2);case"Qo":return u.ordinalNumber(a,{unit:"quarter"});case"QQQ":return u.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return u.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return u.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,u){var a=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return h(a,2);case"qo":return u.ordinalNumber(a,{unit:"quarter"});case"qqq":return u.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return u.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return u.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,u){var a=e.getUTCMonth();switch(t){case"M":case"MM":return U.M(e,t);case"Mo":return u.ordinalNumber(a+1,{unit:"month"});case"MMM":return u.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return u.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return u.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,u){var a=e.getUTCMonth();switch(t){case"L":return String(a+1);case"LL":return h(a+1,2);case"Lo":return u.ordinalNumber(a+1,{unit:"month"});case"LLL":return u.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return u.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return u.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,u,a){var n=ze(e,a);return t==="wo"?u.ordinalNumber(n,{unit:"week"}):h(n,t.length)},I:function(e,t,u){var a=$e(e);return t==="Io"?u.ordinalNumber(a,{unit:"week"}):h(a,t.length)},d:function(e,t,u){return t==="do"?u.ordinalNumber(e.getUTCDate(),{unit:"date"}):U.d(e,t)},D:function(e,t,u){var a=Ie(e);return t==="Do"?u.ordinalNumber(a,{unit:"dayOfYear"}):h(a,t.length)},E:function(e,t,u){var a=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return u.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return u.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return u.day(a,{width:"short",context:"formatting"});case"EEEE":default:return u.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,u,a){var n=e.getUTCDay(),o=(n-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return h(o,2);case"eo":return u.ordinalNumber(o,{unit:"day"});case"eee":return u.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return u.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return u.day(n,{width:"short",context:"formatting"});case"eeee":default:return u.day(n,{width:"wide",context:"formatting"})}},c:function(e,t,u,a){var n=e.getUTCDay(),o=(n-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return h(o,t.length);case"co":return u.ordinalNumber(o,{unit:"day"});case"ccc":return u.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return u.day(n,{width:"narrow",context:"standalone"});case"cccccc":return u.day(n,{width:"short",context:"standalone"});case"cccc":default:return u.day(n,{width:"wide",context:"standalone"})}},i:function(e,t,u){var a=e.getUTCDay(),n=a===0?7:a;switch(t){case"i":return String(n);case"ii":return h(n,t.length);case"io":return u.ordinalNumber(n,{unit:"day"});case"iii":return u.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return u.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return u.day(a,{width:"short",context:"formatting"});case"iiii":default:return u.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,u){var a=e.getUTCHours(),n=a/12>=1?"pm":"am";switch(t){case"a":case"aa":return u.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return u.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return u.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return u.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,u){var a=e.getUTCHours(),n;switch(a===12?n=G.noon:a===0?n=G.midnight:n=a/12>=1?"pm":"am",t){case"b":case"bb":return u.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return u.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return u.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return u.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,u){var a=e.getUTCHours(),n;switch(a>=17?n=G.evening:a>=12?n=G.afternoon:a>=4?n=G.morning:n=G.night,t){case"B":case"BB":case"BBB":return u.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return u.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return u.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,u){if(t==="ho"){var a=e.getUTCHours()%12;return a===0&&(a=12),u.ordinalNumber(a,{unit:"hour"})}return U.h(e,t)},H:function(e,t,u){return t==="Ho"?u.ordinalNumber(e.getUTCHours(),{unit:"hour"}):U.H(e,t)},K:function(e,t,u){var a=e.getUTCHours()%12;return t==="Ko"?u.ordinalNumber(a,{unit:"hour"}):h(a,t.length)},k:function(e,t,u){var a=e.getUTCHours();return a===0&&(a=24),t==="ko"?u.ordinalNumber(a,{unit:"hour"}):h(a,t.length)},m:function(e,t,u){return t==="mo"?u.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):U.m(e,t)},s:function(e,t,u){return t==="so"?u.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):U.s(e,t)},S:function(e,t){return U.S(e,t)},X:function(e,t,u,a){var n=a._originalDate||e,o=n.getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return Ce(o);case"XXXX":case"XX":return W(o);case"XXXXX":case"XXX":default:return W(o,":")}},x:function(e,t,u,a){var n=a._originalDate||e,o=n.getTimezoneOffset();switch(t){case"x":return Ce(o);case"xxxx":case"xx":return W(o);case"xxxxx":case"xxx":default:return W(o,":")}},O:function(e,t,u,a){var n=a._originalDate||e,o=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+he(o,":");case"OOOO":default:return"GMT"+W(o,":")}},z:function(e,t,u,a){var n=a._originalDate||e,o=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+he(o,":");case"zzzz":default:return"GMT"+W(o,":")}},t:function(e,t,u,a){var n=a._originalDate||e,o=Math.floor(n.getTime()/1e3);return h(o,t.length)},T:function(e,t,u,a){var n=a._originalDate||e,o=n.getTime();return h(o,t.length)}};function he(r,e){var t=r>0?"-":"+",u=Math.abs(r),a=Math.floor(u/60),n=u%60;if(n===0)return t+String(a);var o=e;return t+String(a)+o+h(n,2)}function Ce(r,e){if(r%60===0){var t=r>0?"-":"+";return t+h(Math.abs(r)/60,2)}return W(r,e)}function W(r,e){var t=e||"",u=r>0?"-":"+",a=Math.abs(r),n=h(Math.floor(a/60),2),o=h(a%60,2);return u+n+t+o}var ve=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},_e=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},He=function(e,t){var u=e.match(/(P+)(p+)?/)||[],a=u[1],n=u[2];if(!n)return ve(e,t);var o;switch(a){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",ve(a,t)).replace("{{time}}",_e(n,t))},Qe={p:_e,P:He},Xe=["D","DD"],Ke=["YY","YYYY"];function Ze(r){return Xe.indexOf(r)!==-1}function Je(r){return Ke.indexOf(r)!==-1}function ge(r,e,t){if(r==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(r==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(r==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(r==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var et=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rt=/^'([^]*?)'?$/,ut=/''/g,at=/[a-zA-Z]/;function nt(r,e,t){var u,a,n,o,f,l,s,v,c,g,y,b,E,k;T(2,arguments);var R=String(e),S=ne(),M=(u=(a=void 0)!==null&&a!==void 0?a:S.locale)!==null&&u!==void 0?u:ke,L=I((n=(o=(f=(l=void 0)!==null&&l!==void 0?l:void 0)!==null&&f!==void 0?f:S.firstWeekContainsDate)!==null&&o!==void 0?o:(s=S.locale)===null||s===void 0||(v=s.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(L>=1&&L<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var $=I((c=(g=(y=(b=void 0)!==null&&b!==void 0?b:void 0)!==null&&y!==void 0?y:S.weekStartsOn)!==null&&g!==void 0?g:(E=S.locale)===null||E===void 0||(k=E.options)===null||k===void 0?void 0:k.weekStartsOn)!==null&&c!==void 0?c:0);if(!($>=0&&$<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!M.localize)throw new RangeError("locale must contain localize property");if(!M.formatLong)throw new RangeError("locale must contain formatLong property");var q=A(r);if(!Pe(q))throw new RangeError("Invalid time value");var Z=Ye(q),J=qe(q,Z),ee={firstWeekContainsDate:L,weekStartsOn:$,locale:M,_originalDate:q},te=R.match(tt).map(function(d){var m=d[0];if(m==="p"||m==="P"){var C=Qe[m];return C(d,M.formatLong)}return d}).join("").match(et).map(function(d){if(d==="''")return"'";var m=d[0];if(m==="'")return ot(d);var C=Ve[m];if(C)return Je(d)&&ge(d,e,String(r)),Ze(d)&&ge(d,e,String(r)),C(J,d,M.localize,ee);if(m.match(at))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return d}).join("");return te}function ot(r){var e=r.match(rt);return e?e[1].replace(ut,"'"):r}const it=P("VET_FARM_CHECK_ALLOCATION",async(r,{dispatch:e})=>{try{e(O());const{data:t,status:u}=await N.post("vet_check_province_kill_request/",r);return e(w()),{data:t,status:u}}catch(t){return e(w()),{error:t.response.data.result}}}),st=P("VET_FARM_EDIT_CODE_ALLOCATION",async(r,{dispatch:e})=>{e(O());try{const{data:t,status:u}=await N.put("vet_check_province_kill_request/0/",r);return e(w()),{data:t,status:u}}catch(t){return e(w()),{error:t.response.data.result}}}),ct=({item:r,updateTable:e,isEditable:t=!0})=>{var l,s,v;const u=K(),[a]=p.useContext(z),n=r!=null&&r.aggregateCode?!(r!=null&&r.clearanceCode):x()==="ProvinceOperator"||x()==="VetSupervisor"||x()==="VetFarm"||x()==="AdminX"||x()==="SuperAdmin"||x()==="Supporter"?!1:!!(r.trash===!0||r!=null&&r.quarantineQuantity),o=le({initialValues:{name:""},validate:c=>{const g={};return c.name||(g.name="این فیلد اجباری است"),/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]+$/.test(c.name)||(g.name="باید شامل اعداد و حروف انگلیسی باشد"),g}});p.useEffect(()=>{o.values.name&&(o.values.name=o.values.name.toUpperCase())},[o.values]),p.useEffect(()=>{o.setFieldValue("name",(r==null?void 0:r.clearanceCode)||"")},[r]),p.useEffect(()=>{o.validateForm()},[]);const f=()=>{r.clearanceCode?u(st({kill_house_request_key:r.key,code:o.values.name,role:x()})).then(c=>{c.payload.error?a({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),e())}):(o.setFieldValue("name",""),u(it({kill_house_request_key:r.key,code:o.values.name,role:x()})).then(c=>{c.payload.error?a({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),e())}))};return t?i.jsxs(i.Fragment,{children:[i.jsxs(_,{container:!0,direction:"row",alignItems:"center",justifyContent:"flex-start",gap:1,mt:1,sx:{position:"relative"},children:[i.jsx(B,{id:"name",size:"small",variant:"outlined",placeholder:"کد قرنطینه",value:o.values.name,onChange:o.handleChange,onBlur:o.handleBlur,error:o.touched.name&&!!o.errors.name,helperText:o.values.name&&o.touched.name&&o.errors.name,style:{minWidth:"200px"},sx:{"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:"primary.main"},"&:hover fieldset":{borderColor:"primary.dark"},"&.Mui-focused fieldset":{borderColor:"primary.main"}}},InputProps:{readOnly:!!n,startAdornment:i.jsx(pe,{position:"start",children:r.clearanceCode&&i.jsx(lt,{clearanceCode:r.clearanceCode})})}}),!n&&i.jsx(F,{size:"small",variant:"contained",color:"primary",onClick:f,disabled:!o.isValid||r.clearanceCode===o.values.name,sx:{position:"absolute",right:"0",top:"0",minWidth:"40px",width:"40px",height:"39px"},children:i.jsx(Oe,{})})]}),((l=r==null?void 0:r.registerar)==null?void 0:l.date)&&i.jsx(D,{variant:"caption",display:"block",children:`${nt(new Date((s=r==null?void 0:r.registerar)==null?void 0:s.date),"yyyy/MM/dd")} ${(v=r==null?void 0:r.registerar)==null?void 0:v.name}`})]}):i.jsx(D,{variant:"body2",children:r!=null&&r.clearanceCode?r.clearanceCode:"-"})},lt=({clearanceCode:r})=>{const e=p.useRef(null),t=()=>{e.current&&e.current.submit()};return i.jsx(_,{container:!0,alignItems:"center",justifyContent:"center",children:i.jsx(ye,{title:"مشاهده گواهینامه",arrow:!0,children:i.jsxs("form",{action:"https://e.ivo.ir/Rahgiri/Gidprnt.aspx",method:"post",target:"_blank",ref:e,style:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:[i.jsx("input",{name:"gid",type:"hidden",value:r}),i.jsx(De,{color:"primary",onClick:t})]})})})};ct.propTypes={item:ie.PropTypes.any,updateTable:ie.PropTypes.any,isEditable:ie.PropTypes.bool};const X=P("VET_FARM_SUBMIT_CONTRADICTS",async r=>{const{data:e,status:t}=await N.put("kill_house_request/0/",r);return{data:e,status:t}}),Ot=({item:r,updateTable:e})=>{const[t]=p.useContext(z),u=K(),a=le({initialValues:{realNumber:""},validationSchema:we({realNumber:se().typeError("لطفا فیلد را به درستی وارد کنید.!").required("این فیلد اجباری است!")})});return i.jsxs(i.Fragment,{children:[i.jsxs(_,{xs:12,container:!0,spacing:fe.SMALL,alignItems:"center",justifyContent:"center",children:[i.jsx(_,{xs:10,children:i.jsx(B,{fullWidth:!0,id:"realNumber",size:"small",label:"مقدار واقعی",variant:"outlined",value:a.values.realNumber,error:a.touched.realNumber?!!a.errors.realNumber:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.realNumber&&a.errors.realNumber?a.errors.realNumber:null})}),i.jsx(_,{xs:2,children:i.jsx(F,{size:"small",variant:"outlined",onClick:()=>{u(O()),u(X({key:r.key,quarantine_quantity:a.values.realNumber})).then(n=>{u(w()),n.payload.error?t({vertical:"top",horizontal:"center",msg:"مشکلی بوجود آمده است!",severity:"error"}):(t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),u(Y()),e())})},children:"ثبت"})})]}),i.jsxs(_,{xs:12,container:!0,gap:fe.SMALL,alignItems:"center",justifyContent:"center",children:[i.jsx(F,{variant:"outlined",onClick:()=>{u(O()),u(X({key:r.key,quarantine_code_state:"noclearance",role:x()})).then(n=>{u(w()),n.payload.error?t({vertical:"top",horizontal:"center",msg:"مشکلی بوجود آمده است!",severity:"error"}):(t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),u(Y()),e())})},children:"فاقد کد رهگیری"}),i.jsx(F,{variant:"outlined",onClick:()=>{u(O()),u(X({key:r.key,quarantine_code_state:"contradiction",role:x()})).then(n=>{u(w()),n.payload.error?t({vertical:"top",horizontal:"center",msg:"مشکلی بوجود آمده است!",severity:"error"}):(t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),u(Y()),e())})},children:"مغایرت کد رهگیری"}),i.jsx(F,{variant:"outlined",onClick:()=>{u(O()),u(X({key:r.key,quarantine_code_state:"notconfirmed",role:x()})).then(n=>{u(w()),n.payload.error?t({vertical:"top",horizontal:"center",msg:"مشکلی بوجود آمده است!",severity:"error"}):(t({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),u(Y()),e())})},children:"عدم تایید راهداری"})]})]})},kt=({code:r,item:e,updateTable:t})=>{const[u]=p.useContext(z),[a,n]=p.useState(!1),[o,f]=p.useState(r),l=K(),s=v=>{f(v.target.value)};return p.useEffect(()=>{f(r),n(!1)},[r]),i.jsx(_,{container:!0,children:a?i.jsx(_,{container:!0,minWidth:"120px",children:i.jsx(B,{variant:"standard",value:o,size:"small",onChange:s,InputProps:{endAdornment:i.jsx(pe,{position:"end",children:i.jsxs(_,{container:!0,width:"50px",children:[i.jsx(D,{style:{cursor:"pointer"},color:"primary",fontWeight:"bold",variant:"caption",onClick:()=>{n(!a),l(O()),l(X({key:e.key,quarantine_quantity:o})).then(v=>{l(w()),v.payload.error?u({vertical:"top",horizontal:"center",msg:"مشکلی بوجود آمده است!",severity:"error"}):(u({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t())})},children:"ثبت"}),i.jsx(D,{style:{cursor:"pointer"},ml:1,color:"error",fontWeight:"bold",variant:"caption",onClick:()=>{n(!a)},children:"لغو"})]})})}})}):i.jsxs(_,{container:!0,alignItems:"center",children:[i.jsx(D,{variant:"caption",color:(e==null?void 0:e.acceptedRealQuantity)!==r?"error":"black",sx:{fontWeight:"800"},children:r==null?void 0:r.toLocaleString()}),(x()==="AdminX"||x()==="SuperAdmin")&&e.trash!==!0&&i.jsx(ce,{"aria-label":"delete",size:"small",color:"primary",onClick:()=>{n(!a)},children:i.jsx(xe,{})})]})})},dt=P("VET_FARM_EDIT_OUT_DRIVER_CODE",async(r,{dispatch:e})=>{e(O());try{const{data:t,status:u}=await N.put("out-province-poultry-requests/0/",r);return e(w()),{data:t,status:u}}catch(t){return e(w()),{error:t.response.data.result}}}),At=({trafficCode:r,item:e})=>{const t=K(),[u]=p.useContext(z),[,,a,,n]=p.useContext(z),o=l=>{t(dt({poultry_request_key:e==null?void 0:e.key,driver_health_code:l})).then(s=>{s.error?u({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(u({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(Fe({selectedDate1:a,selectedDate2:n})),t(Y()))})},f=()=>{t(Ae({title:"ویرایش کد بهداشتی ماشین",size:"auto",content:i.jsx(ft,{initialValue:r||"",onSubmit:o,onCancel:()=>t(Y())})}))};return i.jsxs(_,{container:!0,alignItems:"center",justifyContent:"center",gap:.5,children:[r?i.jsx(D,{variant:"caption",children:r}):null,i.jsx(ye,{title:r?"ویرایش کد بهداشتی ماشین":"ثبت کد بهداشتی ماشین",placement:"top",children:i.jsx(ce,{"aria-label":"edit",size:"small",color:"primary",onClick:f,children:r?i.jsx(xe,{fontSize:"small"}):i.jsx(Ee,{fontSize:"small"})})})]})},ft=({initialValue:r,onSubmit:e,onCancel:t})=>{const[u,a]=p.useState(r);p.useEffect(()=>{a(r)},[r]);const n=()=>{!u||u===r||e(u)};return i.jsxs(_,{container:!0,direction:"column",gap:2,minWidth:260,children:[i.jsx(B,{label:"کد بهداشتی ماشین",value:u,onChange:o=>a(o.target.value),size:"small",fullWidth:!0}),i.jsxs(_,{container:!0,justifyContent:"flex-end",gap:1,xs:12,children:[i.jsx(F,{variant:"contained",color:"primary",onClick:n,disabled:!u||u===r,sx:{flex:1},children:"ثبت"}),i.jsx(F,{variant:"outlined",color:"primary",onClick:t,sx:{flex:1},children:"لغو"})]})]})},Ft=P("VET_OUT_PRO_DASHBOARD",async(r,{dispatch:e})=>{e(O());const{data:t,status:u}=await N.get(`${r.province?r.province+"parent-company-":""}dashboard-out-province-poultry-requests`,{params:{date1:r.selectedDate1,date2:r.selectedDate2,role:x(),filter:"search",value:r.text?r.text:"",state:"accepted"}});return e(w()),{data:t,status:u}}),ht=P("VET_FARM_SUBMIT_AGGREGATE_BARS",async(r,{dispatch:e})=>{e(O());try{const{data:t,status:u}=await N.post("aggregate-vet-check-province-kill-request/",r);return e(w()),{data:t,status:u}}catch(t){return e(w()),{error:t.response.data.result}}}),Ct=P("VET_FARM_SUBMIT_AGGREGATE_BARS",async(r,{dispatch:e})=>{e(O());try{const{data:t,status:u}=await N.put("aggregate-vet-check-province-kill-request/0/",r);return e(w()),{data:t,status:u}}catch(t){return e(w()),{error:t.response.data.result}}}),vt=P("VET_FARM_DELETE_AGGREGATE_BAR",async(r,{dispatch:e})=>{e(O());try{const{data:t,status:u}=await N.delete("vet_check_province_kill_request/0/",{params:r});return e(w()),{data:t,status:u}}catch(t){return e(w()),{error:t.response.data.result}}}),Dt=({bars:r,updateTable:e,canReturn:t,setAggregates:u,toShow:a})=>{var b,E,k,R,S,M,L,$,q,Z,J,ee,te;const[n,o]=p.useState([]),f=K(),[l]=p.useContext(z),[s,v]=p.useState(r);p.useEffect(()=>{var m;let d;!a||!((m=s[0])!=null&&m.aggregateCode)?d=s==null?void 0:s.map((C,re)=>{var V,H,Q;return[re+1,C==null?void 0:C.barCode,(V=C.quantity)==null?void 0:V.toLocaleString(),(Q=(H=C==null?void 0:C.weightInfo)==null?void 0:H.weight)==null?void 0:Q.toLocaleString(),i.jsx(ce,{color:"error",disabled:(s==null?void 0:s.length)<3,onClick:()=>{f(vt({kill_house_request_key:C==null?void 0:C.key})).then(de=>{de.payload.error?l({vertical:"top",horizontal:"center",msg:de.payload.error,severity:"error"}):(v(s==null?void 0:s.filter(oe=>(oe==null?void 0:oe.key)!==(C==null?void 0:C.key))),u([]),e(),l({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:i.jsx(Me,{})},re)]}):d=s==null?void 0:s.map((C,re)=>{var V,H,Q;return[re+1,C==null?void 0:C.barCode,(V=C.quantity)==null?void 0:V.toLocaleString(),(Q=(H=C==null?void 0:C.weightInfo)==null?void 0:H.weight)==null?void 0:Q.toLocaleString()]}),o(d)},[s]);const c=le({initialValues:{clearanceCode:"",trafficCode:""},validationSchema:we({clearanceCode:se().required("این فیلد اجباری است!"),trafficCode:se().required("این فیلد اجباری است!")})});p.useEffect(()=>{c.validateForm()},[]);const g=d=>{const{value:m}=d.target;c.setFieldValue("clearanceCode",m.toUpperCase())},y=c.values.clearanceCode&&c.values.trafficCode||!c.values.clearanceCode&&!c.values.trafficCode;return i.jsxs(j,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[i.jsx(j,{xs:12,children:i.jsxs(D,{variant:"body2",children:["خریدار:"," ",`${(E=(b=s[0])==null?void 0:b.killhouseUser)==null?void 0:E.name} (${(M=(S=(R=(k=s[0])==null?void 0:k.killhouseUser)==null?void 0:R.killHouseOperator)==null?void 0:S.user)==null?void 0:M.mobile})`]})}),i.jsx(j,{xs:12,children:i.jsxs(D,{variant:"body2",children:["مرغدار:"," ",`${(q=($=(L=s[0])==null?void 0:L.poultryRequest)==null?void 0:$.poultry)==null?void 0:q.unitName} (${(ee=(J=(Z=s[0])==null?void 0:Z.poultryRequest.poultry)==null?void 0:J.user)==null?void 0:ee.mobile})`]})}),i.jsx(j,{xs:12,mb:1,children:i.jsxs(D,{variant:"body2",children:["مجموع حجم بار:"," ",s==null?void 0:s.reduce((d,m)=>d+(m==null?void 0:m.quantity),0).toLocaleString()," ","قطعه"]})}),i.jsx(Se,{data:n,columns:!a||!((te=s[0])!=null&&te.aggregateCode)?["ردیف","کد بار","تعداد اولیه","وزن اولیه بار","عملیات"]:["ردیف","کد بار","تعداد اولیه","وزن اولیه بار"]}),!a&&i.jsxs(i.Fragment,{children:[i.jsxs(j,{container:!0,alignItems:"center",xs:12,mt:1,justifyContent:"space-between",spacing:2,children:[i.jsx(j,{item:!0,xs:6,children:i.jsx(B,{size:"small",fullWidth:!0,id:"clearanceCode",name:"clearanceCode",label:"کد قرنطینه",value:c.values.clearanceCode,onChange:g,error:c.touched.clearanceCode&&!!c.errors.clearanceCode,helperText:c.touched.clearanceCode&&c.errors.clearanceCode})}),i.jsx(j,{item:!0,xs:6,children:i.jsx(B,{size:"small",fullWidth:!0,id:"trafficCode",name:"trafficCode",label:"کد حمل",value:c.values.trafficCode,onChange:c.handleChange,error:c.touched.trafficCode&&!!c.errors.trafficCode,helperText:c.touched.trafficCode&&c.errors.trafficCode})})]}),i.jsxs(j,{xs:12,mt:1,gap:1,children:[i.jsx(F,{disabled:t?!c.isValid:!y,fullWidth:!0,color:"primary",variant:"contained",onClick:()=>{f(ht({kill_house_requests_list:s==null?void 0:s.map(d=>d==null?void 0:d.key),role:x(),code:c.values.clearanceCode?c.values.clearanceCode:null,traffic_code:c.values.trafficCode?c.values.trafficCode:null})).then(d=>{d.payload.error?l({vertical:"top",horizontal:"center",msg:d.payload.error,severity:"error"}):(f(Y()),u([]),e(),l({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:c.isValid?"ثبت":"ثبت اولیه"}),t&&i.jsx(F,{style:{marginTop:"5px"},fullWidth:!0,color:"error",variant:"contained",onClick:()=>{var d;f(Ct({kill_house_request_key:(d=s[0])==null?void 0:d.key,role:x(),type:"cancel_aggregate"})).then(m=>{m.payload.error?l({vertical:"top",horizontal:"center",msg:m.payload.error,severity:"error"}):(f(Y()),u([]),e(),l({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"برگشت از ادغام"})]})]})]})};export{At as V,vt as a,Dt as b,ct as c,kt as d,Ot as e,Ft as v}; diff --git a/build/assets/VetFarmAllocations-COn5OrGn.js b/build/assets/VetFarmAllocations-COn5OrGn.js new file mode 100644 index 0000000..15673e7 --- /dev/null +++ b/build/assets/VetFarmAllocations-COn5OrGn.js @@ -0,0 +1 @@ +import{j as t,b as i}from"./mui-vendor-CkIVaoQP.js";import{G as r,S as o}from"./index-CeyyVc1v.js";import{V as m}from"./VetFarmOperation-BbOMvrl-.js";import"./react-vendor-CmFgShSM.js";import"./redux-vendor-B7uoacJt.js";import"./Visibility-DeyjG-oI.js";import"./AddCircleOutline-C8LXM-k8.js";import"./Edit-CqBj1Y2L.js";import"./VetFarmAggregateBars-CA10Fi1e.js";import"./Pageview-TRcW_9jm.js";import"./SimpleTable-DBAoNnCU.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";import"./iconBase-BEJYyZsk.js";import"./index.esm-Bu7XMDZU.js";import"./VetFarmDeletedBars-DqBCKO-S.js";import"./ResponsiveTable-w7hk7Uq8.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./SlaughterManageBars-CW9paHF2.js";import"./toBase64-BzgTOHsW.js";import"./PublishedWithChanges-C8kvr_m4.js";import"./resizeImage-Csf2MO3w.js";import"./ShowImage-CqhU2hmk.js";import"./Download-DQ-VVIaV.js";import"./VetFarmEditTrafficCode-D3hZa5p9.js";import"./isValidIndexWeight-C_ik-uYa.js";import"./SlaughterEnterNoneReciept-Cle0J4bf.js";import"./Tune-D4M2CAhp.js";import"./ReceiptLong-Dxpx4wPx.js";import"./getDocumentStates-BlCrMUIj.js";import"./NumberFormatCustom-DwWPj40N.js";import"./FileUploader-DT5gIVb3.js";import"./CloudUpload-BlIgB_r9.js";import"./CheckCircle-zgBvZQ-b.js";import"./index-9Ymn_7Kv.js";import"./VetFarmSubmitClearanceCode-B4m3TtXY.js";import"./LabelField-B6eRSoQP.js";import"./ChainBarManagement-BxgsJV2X.js";import"./Settings-BckUi175.js";import"./CarPelak-BYFY8OXg.js";import"./SlaughterFreeBuyBars-CobAAajK.js";import"./slaughter-get-provinces-CSWL-EuK.js";import"./EditOutlined-n5ie2Fmu.js";import"./DeleteOutlineOutlined-G071NcE9.js";import"./ChechClearanceCode-lPasOZZ_.js";import"./province-policy-get-aggregate-bar-info-allow-state-CO-Vk47I.js";import"./Refresh-DkAX1rkD.js";import"./free-buying-payment-DH20xTKI.js";import"./ProvinceSettlementPdfKillRequest-ChEooZGT.js";import"./PictureAsPdf-oEJEta1d.js";const mt=()=>t.jsx(i,{display:"flex",justifyContent:"center",children:t.jsx(r,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:t.jsx(r,{container:!0,justifyContent:"space-between",gap:o.SMALL,style:{width:"100%"},children:t.jsx(r,{xs:12,children:t.jsx(m,{})})})})});export{mt as default}; diff --git a/build/assets/VetFarmDeletedBars-DqBCKO-S.js b/build/assets/VetFarmDeletedBars-DqBCKO-S.js new file mode 100644 index 0000000..cc241a8 --- /dev/null +++ b/build/assets/VetFarmDeletedBars-DqBCKO-S.js @@ -0,0 +1 @@ +import{j as a,T as zu,ak as k,B as Du,d as Hu}from"./mui-vendor-CkIVaoQP.js";import{r as o}from"./react-vendor-CmFgShSM.js";import{L as q,j as $,X as l,h as j,A as wu,v as _,V as Iu,Q as iu,G as v,S as Nu,W as xu}from"./index-CeyyVc1v.js";import{a as Yu,f as Bu,u as Gu}from"./redux-vendor-B7uoacJt.js";import{R as Ku,a as Ou}from"./index.esm-Bu7XMDZU.js";import{R as Ru}from"./ResponsiveTable-w7hk7Uq8.js";const Uu=Yu("DELETED_BARS_DASHBOARD",async(A,{dispatch:F})=>{F(q());const{data:b,status:E}=await $.get("dashboard_delete_bar",{params:{date1:A.selectedDate1,date2:A.selectedDate2,role:l()}});return F(j()),{data:b,status:E}}),mu=()=>{const[A,F]=o.useState([]),[b,E]=o.useState(0),[D,Su]=o.useState(10),[i,$u]=o.useState(""),[x,M]=o.useState(1),[s,R]=o.useState([]),[ju,L]=o.useState([]),[T,c]=o.useState(!1),[d,,g,P,p,z]=o.useContext(wu),bu=Bu(e=>{var u,t;return(t=(u=e.userSlice)==null?void 0:u.userProfile)==null?void 0:t.key}),f=Gu();o.useEffect(()=>{const e=_(new Date).format("YYYY-MM-DD");P(e),z(e)},[]);const ku=e=>{$u(e.target.value)},H=async e=>{var u,t,n;if(!T){f(q());try{const r=await $.get(`kill_house_request_bar_management/?check&deleted_requests&search=filter&value=${i}&role=${l()}&date1=${g}&date2=${p}&page=${e}&page_size=${D}`);c(!1),F(((u=r.data)==null?void 0:u.results)||[]),E(((t=r.data)==null?void 0:t.count)||0)}catch(r){console.error("Error fetching data:",r);const h=(r==null?void 0:r.message)||"",y=(n=r==null?void 0:r.response)==null?void 0:n.status;h.includes("500")||y===500?(c(!0),d({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):d({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),F([]),E(0)}finally{f(j())}}},_u=e=>{H(e),M(e)},qu=e=>{Su(e),M(1)};o.useEffect(()=>{T||(H(1),f(Uu({selectedDate1:g,selectedDate2:p})).then(e=>{var u,t,n,r;e!=null&&e.error?((((u=e.error)==null?void 0:u.message)||"").includes("500")||((t=e.error)==null?void 0:t.status)===500||((n=e.error)==null?void 0:n.statusCode)===500?(c(!0),d({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):d({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),R([])):(r=e==null?void 0:e.payload)!=null&&r.data?(c(!1),R(e.payload.data)):R([])}).catch(e=>{var r;console.error("Error fetching dashboard data:",e);const u=(e==null?void 0:e.message)||"",t=(r=e==null?void 0:e.response)==null?void 0:r.status;u.includes("500")||t===500?(c(!0),d({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):d({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),R([])}))},[f,g,p,D]),o.useEffect(()=>{c(!1)},[g,p,i]);const Mu=async e=>{var u,t,n;e.preventDefault(),c(!1),f(q());try{const r=await $.get(`kill_house_request_bar_management/?check&deleted_requests&search=filter&value=${i}&role=${l()}&date1=${g}&date2=${p}&page=1&page_size=${D}`);c(!1),F(((u=r.data)==null?void 0:u.results)||[]),E(((t=r.data)==null?void 0:t.count)||0),f(j())}catch(r){console.error("Error fetching data:",r);const h=(r==null?void 0:r.message)||"",y=(n=r==null?void 0:r.response)==null?void 0:n.status;h.includes("500")||y===500?(c(!0),d({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):d({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),F([]),E(0),f(j())}},Lu=e=>{P(e)},Tu=e=>{z(e)};o.useEffect(()=>{if(!A||!Array.isArray(A)){L([]);return}const e=A.map((u,t)=>{var n,r,h,y,S,w,I,N,Y,B,G,K,O,U,V,Q,W,X,J,Z,m,uu,eu,ru,su,au,tu,ou,nu,lu,cu,Cu,du,Au,Fu,gu,pu,fu,hu,yu,vu,Eu;return[x===1?t+1:t+D*(x-1)+1,(u==null?void 0:u.barCode)||"",(h=(r=(n=u==null?void 0:u.vetFarm)==null?void 0:n.vet)==null?void 0:r.user)!=null&&h.fullname?u.vetFarm.vet.user.fullname+`(${((w=(S=(y=u==null?void 0:u.vetFarm)==null?void 0:y.vet)==null?void 0:S.user)==null?void 0:w.mobile)||""})`:"فاقد دامپزشک",(I=u==null?void 0:u.poultryRequest)!=null&&I.freezing?"انجماد":"عادی",(N=u==null?void 0:u.poultryRequest)!=null&&N.freeSaleInProvince?"آزاد":"دولتی",`${((B=(Y=u==null?void 0:u.addCar)==null?void 0:Y.driver)==null?void 0:B.typeCar)||""} ${((K=(G=u==null?void 0:u.addCar)==null?void 0:G.driver)==null?void 0:K.pelak)||""}`,`${((U=(O=u==null?void 0:u.addCar)==null?void 0:O.driver)==null?void 0:U.driverName)||""} (${((Q=(V=u==null?void 0:u.addCar)==null?void 0:V.driver)==null?void 0:Q.driverMobile)||""})`,`${((W=u==null?void 0:u.killhouseUser)==null?void 0:W.name)||""} (${((Z=(J=(X=u==null?void 0:u.killhouseUser)==null?void 0:X.killHouseOperator)==null?void 0:J.user)==null?void 0:Z.mobile)||""})`,u!=null&&u.killer?`${((m=u.killer)==null?void 0:m.name)||""} (${((ru=(eu=(uu=u.killer)==null?void 0:uu.killHouseOperator)==null?void 0:eu.user)==null?void 0:ru.mobile)||""})`:"-",`${((au=(su=u==null?void 0:u.poultryRequest)==null?void 0:su.poultry)==null?void 0:au.unitName)||""} (${((nu=(ou=(tu=u==null?void 0:u.poultryRequest)==null?void 0:tu.poultry)==null?void 0:ou.user)==null?void 0:nu.mobile)||""})`,((du=(Cu=(cu=(lu=u==null?void 0:u.poultryRequest)==null?void 0:lu.poultry)==null?void 0:cu.address)==null?void 0:Cu.city)==null?void 0:du.name)||"",((Au=u==null?void 0:u.poultryRequest)==null?void 0:Au.age)||"",(u==null?void 0:u.killPlace)||"",(Fu=u==null?void 0:u.poultryRequest)!=null&&Fu.amount?u.poultryRequest.amount.toLocaleString()+" ﷼":"0 ﷼",(gu=u==null?void 0:u.weightInfo)!=null&&gu.killHousePrice?u.weightInfo.killHousePrice.toLocaleString()+" ﷼":"0 ﷼",(pu=u==null?void 0:u.poultryRequest)!=null&&pu.sendDate?(()=>{try{const C=new Date(u.poultryRequest.sendDate);return isNaN(C.getTime())?"-":iu(C,"yyyy/MM/dd")}catch(C){return console.error("Error formatting sendDate:",C),"-"}})():"-",((fu=u==null?void 0:u.poultryRequest)==null?void 0:fu.orderCode)||"",((hu=u==null?void 0:u.poultryRequest)==null?void 0:hu.chickenBreed)||"",u!=null&&u.quantity?u.quantity.toLocaleString():"0",(u==null?void 0:u.trafficCode)||"",u!=null&&u.amount?u.amount.toLocaleString()+" ﷼":"0 ﷼",(u==null?void 0:u.clearanceCode)||"-",u!=null&&u.barRemover?`${((yu=u.barRemover)==null?void 0:yu.fullName)||""} (${Iu((vu=u.barRemover)==null?void 0:vu.role)}) (${(Eu=u.barRemover)!=null&&Eu.date?(()=>{try{const C=new Date(u.barRemover.date);return isNaN(C.getTime())?"-":iu(C,"yyyy/MM/dd")}catch(C){return console.error("Error formatting barRemover date:",C),"-"}})():"-"})`:"-",u!=null&&u.nonReceipt?`(عدم وصول) ${(u==null?void 0:u.message)||""}`:"-"]});L(e)},[A,x,D]);const Pu=a.jsx(v,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,children:a.jsxs(v,{container:!0,alignItems:"center",gap:Nu.SMALL,xs:12,children:[a.jsx(zu,{children:"بارهای حذف شده"}),a.jsx(v,{children:a.jsx(xu,{label:"از تاریخ",id:"date",renderInput:e=>a.jsx(k,{size:"small",...e}),value:g,onChange:e=>{Lu(_(e).format("YYYY-MM-DD"))}})}),a.jsx(v,{children:a.jsx(xu,{label:"تا تاریخ",id:"date",renderInput:e=>a.jsx(k,{size:"small",...e}),value:p,onChange:e=>{Tu(_(e).format("YYYY-MM-DD"))}})}),a.jsx(k,{autoComplete:"off",size:"small",label:"جستجو",variant:"outlined",style:{width:180},onChange:ku}),a.jsx(Du,{endIcon:a.jsx(Ku,{}),type:"submit",onClick:Mu,children:"جستجو"}),(l()==="ProvinceOperator"||l()==="SuperAdmin"||l()==="AdminX"||l()==="Supporter"||l()==="CityJahad"||l()==="CityPoultry"||l()==="KillHouse")&&a.jsx(Hu,{title:"خروجی اکسل",children:a.jsx("a",{href:`${$.defaults.baseURL}bar_excel_trash_true/?start=${g||""}&end=${p||""}&key=${bu||""}&role=${l()}&search=filter&value=${i||""}`,rel:"noreferrer",children:a.jsx(Du,{color:"success",children:a.jsx(Ou,{size:32})})})})]})});return a.jsx(v,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:a.jsxs(v,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[Pu,a.jsx(v,{container:!0,mt:2,mb:4,isDashboard:!0,children:a.jsx(Ru,{noPagination:!0,isDashboard:!0,columns:["تعداد بار","تعداد خریداران","حجم بار","وزن بار","بار های فاقد قرنطینه","بارهای دارای قرنطینه"],data:[[s!=null&&s.lenKillHouseRequest?s.lenKillHouseRequest.toLocaleString():"0",s!=null&&s.lenKillHouse?s.lenKillHouse.toLocaleString():"0",s!=null&&s.firstQuantity?s.firstQuantity.toLocaleString():"0",s!=null&&s.firstWeight?s.firstWeight.toLocaleString():"0",s!=null&&s.lenHasntCode?s.lenHasntCode.toLocaleString():"0",s!=null&&s.lenHasCode?s.lenHasCode.toLocaleString():"0"]],title:"خلاصه اطلاعات"})}),a.jsx(Ru,{data:ju,columns:["ردیف","کدبار","دامپزشک فارم","نوع کشتار","نوع فروش","ماشین","راننده","خریدار","کشتارکن اختصاصی","محل کشتار","مرغدار","سن مرغ","شهر","قیمت مرغدار","قیمت کشتارگاه","تاریخ کشتار","کدسفارش کشتار","نژاد","تعداد","کد بهداشتی حمل و نقل","قیمت مرغ زنده‌ی بار","کدرهگیری سامانه قرنطینه","حذف کننده","دلیل حذف"],handlePageChange:_u,totalRows:b,page:x,perPage:D,handlePerRowsChange:qu,title:"بارهای حذف شده"})]})})};export{mu as V}; diff --git a/build/assets/VetFarmEditTrafficCode-D3hZa5p9.js b/build/assets/VetFarmEditTrafficCode-D3hZa5p9.js new file mode 100644 index 0000000..19278a5 --- /dev/null +++ b/build/assets/VetFarmEditTrafficCode-D3hZa5p9.js @@ -0,0 +1 @@ +import{j as e,T as d,d as h,I as f,ca as y,ak as j,B as p}from"./mui-vendor-CkIVaoQP.js";import{r as i}from"./react-vendor-CmFgShSM.js";import{L as A,j as v,h as m,A as E,G as l,O as T,C as x,X as _}from"./index-CeyyVc1v.js";import{a as g,u as D}from"./redux-vendor-B7uoacJt.js";const F=g("VET_FARM_EDIT_TRAFFIC_CODE_SERVICE",async(t,{dispatch:r})=>{r(A());try{const{data:s,status:u}=await v.put("kill_house_request/0/",t);return r(m()),{data:s,status:u}}catch(s){return r(m()),{error:s.response.data.result}}}),b=({trafficCode:t,killHouseRequestKey:r,updateTable:s,isEditable:u=!0})=>{const a=D(),[n]=i.useContext(E);if(!u)return e.jsx(d,{variant:"body2",sx:{display:"flex",alignItems:"center"},children:t||"-"});const o=()=>{a(T({title:"ویرایش کد حمل و نقل",size:"auto",content:e.jsx(I,{initialValue:t||"",onSubmit:C=>{a(F({key:r,traffic_code:C,role:_()})).then(c=>{c.payload.error?n({vertical:"top",horizontal:"center",msg:c.payload.error,severity:"error"}):(n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),s(),a(x()))})},onCancel:()=>a(x())})}))};return e.jsxs(l,{container:!0,alignItems:"center",justifyContent:"center",gap:.5,sx:{width:"140px"},children:[e.jsx(d,{variant:"body2",children:t||"-"}),e.jsx(h,{title:"ویرایش کد حمل و نقل",placement:"top",children:e.jsx(f,{size:"small",color:"primary","aria-label":"edit",onClick:o,children:e.jsx(y,{fontSize:"small"})})})]})},I=({initialValue:t,onSubmit:r,onCancel:s})=>{const[u,a]=i.useState(t);i.useEffect(()=>{a(t)},[t]);const n=()=>{u&&r(u)};return e.jsxs(l,{container:!0,direction:"column",gap:2,minWidth:260,children:[e.jsx(j,{variant:"outlined",value:u,size:"small",placeholder:"کد حمل و نقل",onChange:o=>a(o.target.value),inputProps:{inputMode:"numeric",pattern:"[0-9]*"},fullWidth:!0}),e.jsxs(l,{container:!0,justifyContent:"flex-end",gap:1,xs:12,children:[e.jsx(p,{size:"small",variant:"contained",color:"primary",onClick:n,disabled:!u||u===t,sx:{flex:1},children:"ثبت"}),e.jsx(p,{size:"small",variant:"outlined",color:"primary",onClick:s,sx:{flex:1},children:"لغو"})]})]})};export{b as V,F as v}; diff --git a/build/assets/VetFarmInspections-C5LeABjH.js b/build/assets/VetFarmInspections-C5LeABjH.js new file mode 100644 index 0000000..393eedc --- /dev/null +++ b/build/assets/VetFarmInspections-C5LeABjH.js @@ -0,0 +1 @@ +import{j as u,I as m,T as r,cl as p,aO as h,aP as j,aQ as C,aR as f,aS as g,b as A}from"./mui-vendor-CkIVaoQP.js";import{k5 as F,G as e,S as a,p as S,q as T,k2 as y}from"./index-CeyyVc1v.js";import{u as E,j as I,r as b,f as D}from"./react-vendor-CmFgShSM.js";import{f as M,u as R}from"./redux-vendor-B7uoacJt.js";import{S as P}from"./SimpleTable-DBAoNnCU.js";import{d as w}from"./NavigateNext-ByUC5RGi.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const L=()=>{const n=E(),{inspectionid:o}=I(),c=o,{vetFarmInspectionHistory:t,pending:l}=M(s=>s.vetFarmSlice),d=R();return b.useEffect(()=>{d(F(c))},[]),u.jsx(u.Fragment,{children:!l&&u.jsxs(e,{mt:a.MEDIUM,children:[u.jsx(e,{container:!0,alignItems:"center",children:u.jsxs(m,{"aria-label":"delete",color:"primary",onClick:()=>n(-1),children:[u.jsx(w,{}),u.jsx(r,{children:"بازگشت"})]})}),u.jsxs(p,{sx:{gap:a.MEDIUM},children:[t==null?void 0:t.map((s,N)=>u.jsx(u.Fragment,{children:u.jsxs(h,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(j,{children:[u.jsx(C,{}),u.jsx(f,{})]}),u.jsxs(e,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsx(e,{container:!0,children:u.jsx(e,{children:u.jsx(g,{children:u.jsxs(r,{variant:"body1",fontWeight:"bold",children:["بازرسی مورخ ",S(s.createDate)," ساعت"," ",T(s.createDate)]})})})}),u.jsx(e,{container:!0,xs:12,children:u.jsx(e,{xs:12,children:u.jsx(P,{columns:["موضوع بازرسی","توضیحات","تلفات","تصویر"],data:[[s.topic,s.description,s.Losses,s.image.length?s.image.map((i,x)=>[u.jsx(e,{display:"inline-flex",children:u.jsx("a",{href:i,alt:"دانلود",children:u.jsx("img",{src:i,width:"80",height:"80",alt:"دانلود",style:{marginRight:"10px",borderRadius:"5px"}})})},`SlaughterPaymentFactorImage${x}`)]):"بدون پیوست"]]})})})]})]})})),!(t!=null&&t.length)&&u.jsx(r,{variant:"body1",component:"span",children:"برای این مرغداری بازرسی ثبت نشده است."})]})]})})},q=()=>{const{pathname:n}=D();return u.jsx(u.Fragment,{children:u.jsx(A,{display:"flex",justifyContent:"center",children:u.jsx(e,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:u.jsx(e,{container:!0,justifyContent:"space-between",gap:a.SMALL,children:u.jsx(e,{xs:12,children:n.includes(y)&&u.jsx(L,{})})})})})})};export{q as default}; diff --git a/build/assets/VetFarmOperation-BbOMvrl-.js b/build/assets/VetFarmOperation-BbOMvrl-.js new file mode 100644 index 0000000..b181b15 --- /dev/null +++ b/build/assets/VetFarmOperation-BbOMvrl-.js @@ -0,0 +1 @@ +import{j as e,T as p,d as m,I as Ru,ak as X,B as ru,a3 as ou,ai as Vu,aX as I0,b2 as q0,b3 as H,ar as H0}from"./mui-vendor-CkIVaoQP.js";import{d as V0}from"./Visibility-DeyjG-oI.js";import{d as T0}from"./AddCircleOutline-C8LXM-k8.js";import{d as Y0}from"./Edit-CqBj1Y2L.js";import{r as d}from"./react-vendor-CmFgShSM.js";import{f as zu,u as Pu,a as N0}from"./redux-vendor-B7uoacJt.js";import{A as _u,v as Tu,p as J,X as o,O as Mu,G as f,W as yu,j as G,L as fu,h as uu,N as W0,S as tu,a9 as $u,fX as Q0,fY as M0,_ as K0,Q as G0}from"./index-CeyyVc1v.js";import{v as X0,V as B0,a as U0,b as z0,c as J0,d as Z0,e as O0}from"./VetFarmAggregateBars-CA10Fi1e.js";import{G as m0}from"./iconBase-BEJYyZsk.js";import{R as Hu,a as Yu}from"./index.esm-Bu7XMDZU.js";import{V as u6}from"./VetFarmDeletedBars-DqBCKO-S.js";import{V as e6,E as a6,S as r6}from"./SlaughterManageBars-CW9paHF2.js";import{V as s6}from"./VetFarmEditTrafficCode-D3hZa5p9.js";import{R as Lu}from"./ResponsiveTable-w7hk7Uq8.js";import{V as n6}from"./VetFarmSubmitClearanceCode-B4m3TtXY.js";import{a as o6}from"./ChainBarManagement-BxgsJV2X.js";import{S as Wu}from"./ShowImage-CqhU2hmk.js";import{S as t6}from"./SlaughterFreeBuyBars-CobAAajK.js";import{a as l6}from"./province-policy-get-aggregate-bar-info-allow-state-CO-Vk47I.js";import{d as c6}from"./Refresh-DkAX1rkD.js";import{S as C6}from"./SimpleTable-DBAoNnCU.js";import{S as d6}from"./SlaughterEnterNoneReciept-Cle0J4bf.js";import{d as A6}from"./Tune-D4M2CAhp.js";import{f as _0}from"./free-buying-payment-DH20xTKI.js";import{P as i6}from"./ProvinceSettlementPdfKillRequest-ChEooZGT.js";function w0(i){return m0({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"title",attr:{},child:[]},{tag:"path",attr:{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zM4.911 7.089h11.456a2.197 2.197 0 0 1 2.165 2.19v5.863a2.213 2.213 0 0 1-2.177 2.178H8.04c-1.174 0-2.04-.99-2.04-2.178v-4.639L4.503 7.905c-.31-.42-.05-.816.408-.816zm3.415 2.19c-.347 0-.68.21-.68.544 0 .334.333.544.68.544h7.905c.346 0 .68-.21.68-.544 0-.334-.334-.545-.68-.545zm0 2.177c-.347 0-.68.21-.68.544 0 .334.333.544.68.544h7.905c.346 0 .68-.21.68-.544 0-.334-.334-.544-.68-.544zm-.013 2.19c-.346 0-.68.21-.68.544 0 .334.334.544.68.544h5.728c.347 0 .68-.21.68-.544 0-.334-.333-.545-.68-.545z"}}]})(i)}const g6=({readOnly:i})=>{var n,su,cu,Cu,du,Au,B,iu;const[b,Y]=d.useState([]),[P,_]=d.useState(0),[N,k]=d.useState(10),[M,eu]=d.useState(""),[Q,l]=d.useState(1),[C,I]=d.useState([]),[w,j]=d.useState([]),[,,E,V,K,q]=d.useContext(_u),lu=zu(x=>x.userSlice.userProfile.key),T=Pu();d.useEffect(()=>{const x=Tu(new Date).format("YYYY-MM-DD");V(x),q(x)},[]);const D=x=>{eu(x.target.value)},R=async x=>{T(fu());const s=await G.get(`out-province-poultry-requests/?search=filter&value=${M}&page=${x}&role=${o()}&page_size=${N}&date1=${E}&date2=${K}&state=accepted`);T(uu()),Y(s.data.results),_(s.data.count)},W=x=>{R(x),l(x)},S=x=>{k(x),l(1)},r=()=>{R(Q!==0?Q:1)};d.useEffect(()=>{R(1),T(X0({selectedDate1:E,selectedDate2:K,text:M})).then(x=>{I(x.payload.data)})},[T,E,K,N]);const $=async x=>{x.preventDefault(),T(fu());try{const s=await G.get(`out-province-poultry-requests/?search=filter&value=${M}&date1=${E}&date2=${K}&state=accepted&role=${o()}`);Y(s.data.results),_(s.data.count),T(uu())}catch(s){console.error("Error fetching data:",s)}};d.useEffect(()=>{const x=b==null?void 0:b.map((s,y)=>{var gu,pu,hu,nu,U,xu,Fu,Z,au,a,u,c,h,t,F,g,L,z,O,ju,Su,bu,Eu,Du,vu;return[Q===1?y+1:y+N*(Q-1)+1,e.jsx(p,{variant:"body2",style:{color:"green"},children:s.outState},y),`${(gu=s==null?void 0:s.registrar)==null?void 0:gu.fullname}`,s.orderCode,(pu=s.buyer)!=null&&pu.firstName?`${(hu=s.buyer)==null?void 0:hu.firstName} ${(nu=s.buyer)==null?void 0:nu.lastName} (${(U=s.buyer)==null?void 0:U.mobile}) / ${s.buyer.province} - ${s.buyer.city}`:`${s.buyerFullname} (${s.buyerMobile}) / ${s.buyerProvince} - ${s.buyerCity}`,s!=null&&s.hasWage?s==null?void 0:s.payerFullname:"-",`${(xu=s.poultry)==null?void 0:xu.unitName} (${s.poultry.user.mobile})`,(Fu=s==null?void 0:s.poultry)==null?void 0:Fu.age,(Z=s==null?void 0:s.IndexWeight)==null?void 0:Z.toLocaleString(),s.quantity.toLocaleString(),(au=Math.floor(s.IndexWeight*s.quantity))==null?void 0:au.toLocaleString(),e.jsx(m,{placement:"top",title:o()==="VetFarm"||o()==="AdminX"?"ثبت کد قرنطینه":"مشاهده کد قرنطینه",children:e.jsx(Ru,{color:"primary",size:"small",onClick:()=>{T(Mu({title:"ثبت کد قرنطینه",size:{xs:"340px",md:"690px"},content:e.jsx(n6,{readOnly:o()==="CityOperator",item:s,updateTable:r},y)}))},children:o()==="VetFarm"||o()==="AdminX"?e.jsx(T0,{fontSize:"small"}):e.jsx(V0,{fontSize:"small"})})},y),((a=s==null?void 0:s.totalSystemQuarantineQuantity)==null?void 0:a.toLocaleString())||"-",i?(u=s==null?void 0:s.outProvinceDriverInfo)==null?void 0:u.driverhealthCode:e.jsx(B0,{item:s,trafficCode:(c=s==null?void 0:s.outProvinceDriverInfo)==null?void 0:c.driverhealthCode},y),((h=s==null?void 0:s.outProvinceDriverInfo)==null?void 0:h.driverCar)||"-",(t=s==null?void 0:s.outProvinceDriverInfo)!=null&&t.driverPelak?(F=s==null?void 0:s.outProvinceDriverInfo)==null?void 0:F.driverPelak:"-",(g=s==null?void 0:s.outProvinceDriverInfo)!=null&&g.driverName?(L=s==null?void 0:s.outProvinceDriverInfo)==null?void 0:L.driverName:"",(z=s==null?void 0:s.outProvinceDriverInfo)!=null&&z.driverMobile?(O=s==null?void 0:s.outProvinceDriverInfo)==null?void 0:O.driverMobile:"",J(s==null?void 0:s.createDate),J(s==null?void 0:s.sendDate),(s==null?void 0:s.totalWageAmount)||"-",(ju=s==null?void 0:s.hatching)==null?void 0:ju.city,(Su=s==null?void 0:s.hatching)==null?void 0:Su.province,(Eu=(bu=s==null?void 0:s.hatching)==null?void 0:bu.leftOver)==null?void 0:Eu.toLocaleString(),(vu=(Du=s==null?void 0:s.hatching)==null?void 0:Du.hatchingQuantity)==null?void 0:vu.toLocaleString()]});j(x)},[b]);const v=e.jsxs(f,{container:!0,gap:2,xs:12,alignItems:"center",children:[e.jsx(f,{children:e.jsx(yu,{label:"از تاریخ",id:"date",renderInput:x=>e.jsx(X,{style:{width:"160px"},...x}),value:E,onChange:x=>{V(Tu(x).format("YYYY-MM-DD"))}})}),e.jsx(f,{children:e.jsx(yu,{label:"تا تاریخ",id:"date",renderInput:x=>e.jsx(X,{style:{width:"160px"},...x}),value:K,onChange:x=>{q(Tu(x).format("YYYY-MM-DD"))}})}),e.jsxs("form",{onSubmit:$,children:[e.jsx(X,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:D}),e.jsx(ru,{type:"submit",onClick:$,endIcon:e.jsx(Hu,{}),children:"جستجو"})]}),e.jsx(f,{children:e.jsx(m,{title:"خروجی اکسل",children:e.jsx("a",{href:`${G.defaults.baseURL}bar_free_excel/?date1=${E}&date2=${K}&state=accepted&role=${o()}&key=${lu}&search=filter&value=${M}`,rel:"noreferrer",children:e.jsx(ru,{color:"success",children:e.jsx(Yu,{size:32})})})})})]});return e.jsx(f,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:e.jsxs(f,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[v,e.jsx(f,{container:!0,mt:2,mb:4,isDashboard:!0,children:e.jsx(Lu,{noPagination:!0,isDashboard:!0,columns:["تعداد بار","مجموع حجم","مجموع وزن","میانگین وزنی","تعداد بار های دارای کد قرنطینه","تعدا بار فاقد کد قرنطینه","مجموع جوجه ریزی","مجموع مانده در سالن"],data:[[(n=C==null?void 0:C.lenBar)==null?void 0:n.toLocaleString(),(su=C==null?void 0:C.quantity)==null?void 0:su.toLocaleString(),(cu=C==null?void 0:C.weight)==null?void 0:cu.toLocaleString(),(Cu=C==null?void 0:C.indexWeight)==null?void 0:Cu.toLocaleString(),(du=C==null?void 0:C.hasCode)==null?void 0:du.toLocaleString(),(Au=C==null?void 0:C.hasntCode)==null?void 0:Au.toLocaleString(),(B=C==null?void 0:C.hatchingQuantity)==null?void 0:B.toLocaleString(),(iu=C==null?void 0:C.leftOver)==null?void 0:iu.toLocaleString()]],title:"خلاصه اطلاعات"})}),e.jsx(Lu,{data:w,columns:["ردیف","وضعیت","ثبت کننده سفارش","کد سفارش","اطلاعات خریدار","پرداخت کننده","مرغدار","سن مرغ","میانگین وزن (کیلوگرم)","تعداد","وزن کل (کیلوگرم)","ثبت کد قرنطینه","تعداد در قرنطینه","کد بهداشتی ماشین","نوع خودرو","پلاک","نام راننده","تلفن راننده","تاریخ ثبت درخواست","تاریخ کشتار","تعرفه","شهر","استان","مانده در سالن","جوجه ریزی اولیه"],handlePageChange:W,totalRows:P,page:Q,perPage:N,handlePerRowsChange:S,title:"درخواست های فروش به خارج استان"})]})})},p6=()=>e.jsx(t6,{isBarManagemen:!0}),h6=N0("ADD_COMMENT_IN_SETTLEMENT_PROVINCE",async(i,{dispatch:b})=>{try{b(fu());const{data:Y,status:P}=await G.put("direct-buying-payment/0/",i);return b(uu()),{data:Y,status:P}}catch(Y){return b(uu()),{error:Y.response.data.result}}});function x6({modal_key:i}){const b=Pu(),[Y,P]=d.useState([]),[_,N]=d.useState({}),[k,M]=d.useState({});d.useEffect(()=>{i&&b(_0(i)).then(l=>{var I;const C=(I=l.payload)==null?void 0:I.data;if(C&&Array.isArray(C)){const w=C.map(E=>({...E,date:J(E.date)}));P(w);const j={};w.forEach(E=>{j[E.key]=E.paymentDeadlineSupporterMessage||""}),N(j)}})},[b,i]);const eu=(l,C)=>{N(I=>({...I,[l]:C}))},Q=l=>{var w;const C=((w=_[l])==null?void 0:w.trim())||"";M(j=>({...j,[l]:!0})),b(h6({key:l,payment_deadline_supporter_message:C})).then(j=>{var E;if(((E=j.payload)==null?void 0:E.status)===200&&i)return b(_0(i)).then(V=>{var q;const K=(q=V.payload)==null?void 0:q.data;if(K&&Array.isArray(K)){const lu=K.map(T=>({...T,date:J(T.date)}));P(lu)}})}).finally(()=>M(j=>({...j,[l]:!1})))};return e.jsx(ou,{sx:{overflowY:"auto",display:"flex",flexDirection:"row",justifyContent:"center",flexWrap:"wrap",gap:"16px",alignItems:"center",padding:"20px"},children:Y.map(l=>{var C;return e.jsx(ou,{sx:{display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid #888888",borderRadius:"20px",padding:"20px",marginTop:"20px",minWidth:"300px"},children:e.jsxs(ou,{mt:2,sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[l.image&&e.jsx(ou,{item:!0,sx:{width:"50px",mb:2},children:e.jsx(Wu,{src:l.image})}),e.jsx(ou,{item:!0,sx:{mx:1,width:"100%"},children:e.jsx(X,{size:"small",fullWidth:!0,variant:"outlined",label:"مبلغ",value:((C=l.amount)==null?void 0:C.toLocaleString())||"",InputProps:{readOnly:!0}})}),l.date&&e.jsx(ou,{mt:2,item:!0,sx:{mx:1,width:"100%"},children:e.jsx(X,{size:"small",fullWidth:!0,variant:"outlined",label:"تاریخ پرداخت",value:l.date,InputProps:{readOnly:!0,style:{fontSize:14}}})}),e.jsx(ou,{mt:2,item:!0,sx:{mx:1,width:"100%"},children:e.jsx(X,{size:"small",fullWidth:!0,variant:"outlined",label:"دیدگاه",multiline:!0,rows:4,value:_[l.key]||"",onChange:I=>eu(l.key,I.target.value),InputProps:{style:{fontSize:14}},sx:{"& .MuiInputBase-root":{height:"auto",alignItems:"flex-start"}}})}),e.jsx(ou,{mt:2,item:!0,sx:{mx:1,width:"100%"},children:e.jsx(ru,{fullWidth:!0,variant:"contained",onClick:()=>Q(l.key),disabled:k[l.key],children:"ثبت"})})]})},l.key)})})}const F6=({item:i,item_key:b,updateTable_data:Y})=>{const P=Pu(),[_,N]=d.useState(null),k=l=>{N(l.currentTarget)},M=()=>{N(null)},Q=!!_?"popover":void 0;return e.jsx(f,{container:!0,children:e.jsx(Ru,{"aria-describedby":Q,variant:"contained",color:"primary",onClick:k,children:e.jsx(A6,{onClick:()=>{M(),P(W0({title:"بارگزاری سند",top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,size:1e3,content:e.jsx(x6,{item:i,modal_key:b,updateTable_modal:Y})}))}})})})},f6=()=>{const i=Pu(),[,,b,Y,P,_]=d.useContext(_u),[N,k]=d.useState([]),[M,eu]=d.useState([]),[Q,l]=d.useState(0),[C,I]=d.useState(10),[w,j]=d.useState(1),[E,V]=d.useState(""),K=zu(S=>S.userSlice.userProfile.key),q=d.useCallback(async()=>{var S,r;i(fu());try{const $=await G.get(`direct-buying-requests/?role=${o()}&status=active"&search=filter&value=${E||""}&date1=${b}&date2=${P}&page=1&page_size=${C}`);i(uu()),eu((S=$==null?void 0:$.data)==null?void 0:S.results),l((r=$==null?void 0:$.data)==null?void 0:r.count)}catch{i(uu())}},[b,P,C,w,E,i]),lu=S=>{I(S),j(1)},T=S=>{q(S,E),j(S)},D=S=>{V(S.target.value)},R=async S=>{var r,$;S.preventDefault(),i(fu());try{const v=await G.get(`direct-buying-requests/?role=${o()}&status=active&date1=${b}&date2=${P}&search=filter&value=${E||""}`);eu((r=v==null?void 0:v.data)==null?void 0:r.results),l(($=v==null?void 0:v.data)==null?void 0:$.count),i(uu())}catch(v){console.error("Error fetching data:",v)}};d.useEffect(()=>{q(1)},[i,b,P,C]);const W=d.useCallback(()=>{q(1)},[q]);return d.useEffect(()=>{const S=M==null?void 0:M.map((r,$)=>{var n,su,cu,Cu,du,Au,B,iu,x,s,y,gu,pu,hu,nu,U,xu,Fu,Z,au,a,u,c,h,t,F,g,L;let v;switch(r==null?void 0:r.paymentDeadlineState){case"pending":v="بارگزاری سند مالی";break;case"checking":v="بررسی مالی اتحادیه";break;case"accepted":v="تایید شده";break;case"rejected":v="برگشت داده شده";break;case"archive":v="بایگانی شده";break;default:v="وضعیت نامشخص"}return[w===1?$+1:$+C*(w-1)+1,J((n=r==null?void 0:r.killRequest)==null?void 0:n.createDate),J((su=r==null?void 0:r.killRequest)==null?void 0:su.reciveDate),`${(Cu=(cu=r==null?void 0:r.killRequest)==null?void 0:cu.killHouse)==null?void 0:Cu.name} (${(Au=(du=r==null?void 0:r.killRequest)==null?void 0:du.killHouse)==null?void 0:Au.mobile})`,`${(iu=(B=r==null?void 0:r.killRequest)==null?void 0:B.poultry)==null?void 0:iu.age}`,(x=r==null?void 0:r.killRequest)!=null&&x.freeDirectBuying?"آزاد":"دولتی",(s=r==null?void 0:r.killRequest)!=null&&s.killHouse?(gu=(y=r==null?void 0:r.killRequest)==null?void 0:y.killHouse)==null?void 0:gu.name:(pu=r==null?void 0:r.killRequest)==null?void 0:pu.slaughterHouse,`${(nu=(hu=r==null?void 0:r.killRequest)==null?void 0:hu.poultry)==null?void 0:nu.fullname} (${(U=r==null?void 0:r.killRequest)==null?void 0:U.poultry.mobile})`,(xu=r==null?void 0:r.generalInfo)==null?void 0:xu.age,`${(Fu=r==null?void 0:r.killRequest)!=null&&Fu.chickenBreed?(Z=r==null?void 0:r.killRequest)==null?void 0:Z.chickenBreed:"-"}`,(au=r==null?void 0:r.totalKilledQuantity)==null?void 0:au.toLocaleString(),(a=r==null?void 0:r.generalInfo)==null?void 0:a.IndexWeight,(u=r==null?void 0:r.totalKilledWeight)==null?void 0:u.toLocaleString(),(h=(c=r==null?void 0:r.killRequest)==null?void 0:c.amount)==null?void 0:h.toLocaleString(),(F=(t=r==null?void 0:r.generalInfo)==null?void 0:t.totalAmount)==null?void 0:F.toLocaleString(),J(r==null?void 0:r.paymentDeadlineDate),r!=null&&r.extensionPaymentDeadlineDate?J(r==null?void 0:r.extensionPaymentDeadlineDate):"-",e.jsx(i6,{pdf_key:(g=r==null?void 0:r.killRequest)==null?void 0:g.key},$),(L=r==null?void 0:r.generalInfo)==null?void 0:L.totalPaidAmount.toLocaleString(),v,r==null?void 0:r.paymentDeadlineCheckerFullname,J(r==null?void 0:r.paymentDeadlineCheckDate),r==null?void 0:r.paymentDeadlineArchiveMessage,e.jsx(F6,{updateTable_data:W,item:r,item_key:r==null?void 0:r.key},`ops-${$}`)]});k(S)},[M]),e.jsx(e.Fragment,{children:e.jsxs(f,{container:!0,lg:12,xs:12,justifyContent:"start",alignItems:"center",children:[e.jsx(f,{container:!0,alignItems:"center",mb:tu.SMALL,gap:tu.SMALL,children:e.jsx("form",{onSubmit:R,children:e.jsxs(f,{container:!0,alignItems:"center",gap:tu.SMALL,children:[e.jsx(X,{size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:D}),e.jsx(ru,{type:"submit",onClick:R,endIcon:e.jsx(Hu,{}),children:"جستجو"}),e.jsxs(f,{container:!0,gap:2,children:[e.jsx(yu,{label:"از تاریخ",id:"date",renderInput:S=>e.jsx(X,{style:{width:"160px"},...S}),value:b,onChange:S=>{Y($u(S).format("YYYY-MM-DD"))}}),e.jsx(yu,{label:"تا تاریخ",id:"date",renderInput:S=>e.jsx(X,{style:{width:"160px"},...S}),value:P,onChange:S=>{_($u(S).format("YYYY-MM-DD"))}})]}),e.jsx(f,{children:e.jsx(m,{title:"خروجی اکسل",children:e.jsx("a",{href:`${G.defaults.baseURL}direct_purchase_excel/?date1=${b}&date2=${P}&role=${o()}&key=${K}`,rel:"noreferrer",children:e.jsx(ru,{color:"success",children:e.jsx(Yu,{size:32})})})})})]})})}),e.jsx(Lu,{data:N,columns:["ردیف","تاریخ ثبت درخواست","تاریخ کشتار","خریدار","نوع خرید","محل کشتار","مرغدار (تلفن)","سن مرغ","سن","نژاد","تعداد درخواست قطعه","میانگین وزنی (کیلوگرم)","وزن کل (کیلوگرم)","قیمت هر کیلو (ریال)","مبلغ کل خرید (ریال)","حداکثر مهلت تسویه","تمدید مهلت تسویه","توافق نامه","مبلغ تسویه (ریال)","وضعیت","بررسی کننده","تاریخ بررسی","گزارش","اسناد"],handlePageChange:T,totalRows:Q,page:w,perPage:C,handlePerRowsChange:lu,title:"تسویه حساب"})]})})},G6=()=>{const[i,b]=d.useState([]),[Y,P]=d.useState(0),[_,N]=d.useState(10),[k,M]=d.useState(0),[eu,Q]=d.useState([]),[l,C]=d.useState([]),[I,w]=d.useState(1),[j,E]=d.useState(!1),[V,K]=d.useState(!1),[q,lu]=d.useState(""),[T,D]=d.useState(!1),R=Pu(),[,,W,S,r,$]=d.useContext(_u),v=zu(a=>a.userSlice),{vetFarmBarsOverview:n}=zu(a=>a.vetFarmSlice);d.useEffect(()=>{const a=$u(new Date).format("YYYY-MM-DD");S(a),$(a)},[]);const su=(a,u)=>{M(u)},cu=()=>{K(!V)},Cu=()=>o()!=="VetFarm"?["گزارش اختلاف فارم"]:[],du=(a,u)=>o()==="VetFarm"?[]:a!=null&&a.priceRegisterDate?[e.jsx(m,{title:"مشاهده گزارش",placement:"top",children:e.jsx(Ru,{color:"primary",size:"small",onClick:()=>{R(W0({top:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"گزارش ",content:e.jsx(C6,{columns:["ثبت کننده ","تاریخ ثبت","ویرایش کننده","تاریخ ویرایش","نوع تسویه","قیمت","توضیحات","سند"],data:[[a==null?void 0:a.priceRegisterar,J(a==null?void 0:a.priceRegisterDate),a==null?void 0:a.priceEditor,J(a==null?void 0:a.priceEditorDate),(a==null?void 0:a.settlementType)==="cash"?"نقدی":"مدت دار",a==null?void 0:a.price,a==null?void 0:a.description,e.jsxs(f,{container:!0,xs:12,justifyContent:"center",gap:1,children:[e.jsx(Wu,{src:a==null?void 0:a.image},u),","]},u)]]})}))},children:e.jsx(V0,{fontSize:"small"})})},u)]:["بدون گزارش"],Au=a=>{let u="",c="default";return a.trash===!0?(u="حذف شده",c="error"):a!=null&&a.wareHouseConfirmation?(u="ورود به انبار",c="success"):(a==null?void 0:a.assignmentStateArchive)!=="pending"?(u="ثبت اطلاعات بار",c="info"):a.vetState==="accepted"?(u="تایید تخلیه",c="success"):a.vetState==="pending"?(u="در انتظار تخلیه",c="warning"):u="نامشخص",e.jsx(H0,{label:u,color:c,size:"small",variant:"outlined",sx:{minWidth:90,justifyContent:"center"}})},B=async a=>{var u,c,h;if(!T){R(fu());try{const t=await G.get(`kill_house_request_bar_management/?check&search=filter&value=${q}&role=${o()}&date1=${W}&date2=${r}&page=${a}&page_size=${_}&without_quarantine_code_state=${V}`);D(!1),b(((u=t.data)==null?void 0:u.results)||[]),P(((c=t.data)==null?void 0:c.count)||0)}catch(t){console.error("Error fetching data:",t);const F=(t==null?void 0:t.message)||"",g=(h=t==null?void 0:t.response)==null?void 0:h.status;F.includes("500")||g===500?(D(!0),y({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):y({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),b([]),P(0)}finally{R(uu())}}},iu=a=>{B(a),w(a)},x=a=>{N(a),w(1)},s=()=>{B(I!==0?I:1)};d.useEffect(()=>{T||(B(I),R(Q0({selectedDate1:W,selectedDate2:r})).then(a=>{var u,c,h;a!=null&&a.error?((((u=a.error)==null?void 0:u.message)||"").includes("500")||((c=a.error)==null?void 0:c.status)===500||((h=a.error)==null?void 0:h.statusCode)===500)&&(D(!0),y({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):D(!1)}).catch(a=>{var t;console.error("Error fetching deleted bars:",a);const u=(a==null?void 0:a.message)||"",c=(t=a==null?void 0:a.response)==null?void 0:t.status;(u.includes("500")||c===500)&&(D(!0),y({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}))}),R(M0({selectedDate1:W,selectedDate2:r,textValue:q,hasDocumentState:V})).then(a=>{var u,c,h;a!=null&&a.error?((((u=a.error)==null?void 0:u.message)||"").includes("500")||((c=a.error)==null?void 0:c.status)===500||((h=a.error)==null?void 0:h.statusCode)===500)&&(D(!0),y({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):D(!1)}).catch(a=>{var t;console.error("Error fetching bars overview:",a);const u=(a==null?void 0:a.message)||"",c=(t=a==null?void 0:a.response)==null?void 0:t.status;(u.includes("500")||c===500)&&(D(!0),y({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}))}))},[W,r,V,_]),d.useEffect(()=>{D(!1)},[W,r,V,q]),d.useEffect(()=>{B(1),R(l6()).then(a=>{var u,c,h,t;a!=null&&a.error?(((((u=a.error)==null?void 0:u.message)||"").includes("500")||((c=a.error)==null?void 0:c.status)===500||((h=a.error)==null?void 0:h.statusCode)===500)&&(D(!0),y({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})),E(!1)):(t=a==null?void 0:a.payload)!=null&&t.data?(D(!1),E(a.payload.data)):E(!1)}).catch(a=>{var t;console.error("Error fetching aggregate status:",a);const u=(a==null?void 0:a.message)||"",c=(t=a==null?void 0:a.response)==null?void 0:t.status;(u.includes("500")||c===500)&&(D(!0),y({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})),E(!1)})},[]),d.useEffect(()=>{if(!i||!Array.isArray(i)){Q([]);return}const a=i.map((u,c)=>{var h,t,F,g,L,z,O,ju,Su,bu,Eu,Du,vu,Nu,Qu,Ku,Gu,Xu,Bu,Uu,Ju,Zu,Ou,mu,u0,e0,a0,r0,s0,n0,o0,t0,l0,c0,C0,d0,A0,i0,g0,p0,h0,x0,F0,f0,y0,j0,S0,b0,E0,D0,v0,k0,R0,$0;return[e.jsxs(f,{id:"merge",container:!0,alignItems:"center",justifyContent:"center",style:{minWidth:o()==="VetFarm"||o()==="AdminX"||o()==="SuperAdmin"?"100px":"50px"},children:[(j==null?void 0:j.allow)&&(o()==="VetFarm"||o()==="AdminX"||o()==="SuperAdmin")&&e.jsx(f,{item:!0,children:u!=null&&u.clearanceCode&&(u!=null&&u.aggregateCode)?e.jsx(Vu,{control:e.jsx(m,{title:"حذف از ادغام",placement:"top",children:e.jsx(Ru,{color:"error",disabled:(i==null?void 0:i.filter(A=>A.aggregateCode===(u==null?void 0:u.aggregateCode)).length)<3,onClick:()=>{R(U0({kill_house_request_key:u==null?void 0:u.key})).then(A=>{var Iu,qu,wu,ku,L0;if(A!=null&&A.error||(Iu=A==null?void 0:A.payload)!=null&&Iu.error){const P0=((qu=A.payload)==null?void 0:qu.error)||((wu=A.error)==null?void 0:wu.message)||"";P0.includes("500")||((ku=A.error)==null?void 0:ku.status)===500||((L0=A.error)==null?void 0:L0.statusCode)===500?(D(!0),y({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):y({vertical:"top",horizontal:"center",msg:P0||"مشکلی در حذف از ادغام پیش آمده است!",severity:"error"})}else D(!1),C([]),s(),y({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})}).catch(A=>{var ku;console.error("Error deleting aggregate bar:",A);const Iu=(A==null?void 0:A.message)||"",qu=(ku=A==null?void 0:A.response)==null?void 0:ku.status;Iu.includes("500")||qu===500?(D(!0),y({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):y({vertical:"top",horizontal:"center",msg:"مشکلی در حذف از ادغام پیش آمده است!",severity:"error"})})},children:e.jsx(c6,{})},c)})}):e.jsx(Vu,{control:e.jsx(I0,{disabled:l.length&&!(((F=(t=(h=l[0])==null?void 0:h.poultryRequest)==null?void 0:t.poultry)==null?void 0:F.unitName)===((L=(g=u==null?void 0:u.poultryRequest)==null?void 0:g.poultry)==null?void 0:L.unitName)&&((O=(z=l[0])==null?void 0:z.killhouseUser)==null?void 0:O.name)===((ju=u==null?void 0:u.killhouseUser)==null?void 0:ju.name))||(u==null?void 0:u.clearanceCode)&&(u==null?void 0:u.aggregateCode),checked:l.filter(A=>(A==null?void 0:A.barCode)===(u==null?void 0:u.barCode)).length>0,onChange:()=>{l.some(A=>(A==null?void 0:A.barCode)===(u==null?void 0:u.barCode))?C(l.filter(A=>(A==null?void 0:A.barCode)!==(u==null?void 0:u.barCode))):u!=null&&u.aggregateCode?C(i==null?void 0:i.filter(A=>(A==null?void 0:A.aggregateCode)===(u==null?void 0:u.aggregateCode))):C([...l,u])},color:"primary"})})}),e.jsx(f,{item:!0,children:I===1?c+1:c+_*I/2+1})]},c),u!=null&&u.aggregateCode?e.jsxs(m,{title:"مشاهده بارها",placement:"top",children:[" ",e.jsx(p,{variant:"body2",color:"primary",style:{cursor:"pointer"},onClick:()=>{au()?y({vertical:"top",horizontal:"center",msg:`فقط بارهای با خریدار و مرغدار یکسان و با مجموع تعداد حداکثر ${j==null?void 0:j.limitation} میتوانید ادغام کنید!`,severity:"error"}):R(Mu({title:"مشاهده بارهای ادغام شده",content:e.jsx(z0,{toShow:!0,setAggregates:C,bars:i==null?void 0:i.filter(A=>(A==null?void 0:A.aggregateCode)===(u==null?void 0:u.aggregateCode))})}))},children:"دارد"})]}):e.jsx(p,{variant:"body2",children:"ندارد"}),Au(u),e.jsxs(p,{style:{fontSize:"13px",color:u!=null&&u.trash?"red":"black"},children:[(u==null?void 0:u.barCode)||"",u!=null&&u.priceRegisterDate?"✉️":""]},c),u!=null&&u.createDate?K0(u.createDate):"-",(Su=u==null?void 0:u.poultryRequest)!=null&&Su.freezing?"انجماد":(bu=u==null?void 0:u.poultryRequest)!=null&&bu.export?"صادرات":"عادی",(Eu=u==null?void 0:u.poultryRequest)!=null&&Eu.freeSaleInProvince?"آزاد":"دولتی",`${((Du=u==null?void 0:u.killhouseUser)==null?void 0:Du.name)||""} (${((Qu=(Nu=(vu=u==null?void 0:u.killhouseUser)==null?void 0:vu.killHouseOperator)==null?void 0:Nu.user)==null?void 0:Qu.mobile)||""})`,u!=null&&u.killer?`${((Ku=u.killer)==null?void 0:Ku.name)||""} (${((Bu=(Xu=(Gu=u.killer)==null?void 0:Gu.killHouseOperator)==null?void 0:Xu.user)==null?void 0:Bu.mobile)||""})`:"-",`${((Zu=(Ju=(Uu=u==null?void 0:u.poultryRequest)==null?void 0:Uu.poultry)==null?void 0:Ju.user)==null?void 0:Zu.fullname)||""} (${((u0=(mu=(Ou=u==null?void 0:u.poultryRequest)==null?void 0:Ou.poultry)==null?void 0:mu.user)==null?void 0:u0.mobile)||""})`,((a0=(e0=u==null?void 0:u.poultryRequest)==null?void 0:e0.poultry)==null?void 0:a0.unitName)||"",u!=null&&u.quantity?u.quantity.toLocaleString():"0",(r0=u==null?void 0:u.weightInfo)!=null&&r0.weight?u.weightInfo.weight.toLocaleString():"0",e.jsx(e.Fragment,{children:e.jsx(s6,{updateTable:s,killHouseRequestKey:u.key,trafficCode:u==null?void 0:u.trafficCode,isEditable:(o()==="ProvinceOperator"||o()==="SuperAdmin"||o()==="VetFarm"||o()==="AdminX"||o()==="CityVet"||o()==="Supporter")&&u.trash!==!0&&u.assignmentStateArchive==="pending"&&!(u!=null&&u.clearanceCode)})}),u!=null&&u.amount?u.amount.toLocaleString()+" ﷼":"0 ﷼",e.jsx(J0,{item:u,updateTable:s,isEditable:o()==="VetFarm"||o()==="ProvinceOperator"||o()==="SuperAdmin"||o()==="CityVet"||o()==="AdminX"||o()==="Supporter"},c),e.jsx(e.Fragment,{children:u!=null&&u.quarantineQuantity?e.jsx(Z0,{code:u==null?void 0:u.quarantineQuantity,updateTable:s,item:u}):e.jsxs(e.Fragment,{children:[(u==null?void 0:u.quarantineCodeState)&&((u==null?void 0:u.quarantineCodeState)==="contradiction"?"مغایرت کد رهگیری":(u==null?void 0:u.quarantineCodeState)==="noclearance"?"فاقد کد رهگیری":(u==null?void 0:u.quarantineCodeState)==="merge"?"ادغام":"عدم تایید راهداری"),(o()==="SuperAdmin"||o()==="AdminX")&&e.jsx(m,{title:u!=null&&u.quarantineCodeState?"ویرایش تعداد ثبت شده در قرنطینه":"ثبت تعداد در قرنطینه",placement:"top",children:e.jsx(Ru,{color:"primary",onClick:()=>{R(Mu({title:"تعداد ثبت شده در قرنطینه",content:e.jsx(O0,{item:u,updateTable:s})}))},children:u!=null&&u.quarantineCodeState?e.jsx(Y0,{fontSize:"small"}):e.jsx(T0,{fontSize:"small"})})})]})}),`${((n0=(s0=u==null?void 0:u.addCar)==null?void 0:s0.driver)==null?void 0:n0.typeCar)||""} ${((t0=(o0=u==null?void 0:u.addCar)==null?void 0:o0.driver)==null?void 0:t0.pelak)||""}`,`${((c0=(l0=u==null?void 0:u.addCar)==null?void 0:l0.driver)==null?void 0:c0.driverName)||""} (${((d0=(C0=u==null?void 0:u.addCar)==null?void 0:C0.driver)==null?void 0:d0.driverMobile)||""})`,((A0=u==null?void 0:u.poultryRequest)==null?void 0:A0.chickenBreed)||"",(i0=u==null?void 0:u.poultryRequest)!=null&&i0.age?u.poultryRequest.age.toLocaleString():"0",(g0=u==null?void 0:u.weightInfo)!=null&&g0.indexWeight?u.weightInfo.indexWeight.toLocaleString():"0",...o()==="VetFarm"?[]:[((p0=u==null?void 0:u.poultryRequest)!=null&&p0.amount?u.poultryRequest.amount.toLocaleString():"0")+" ﷼",((h0=u==null?void 0:u.weightInfo)!=null&&h0.killHousePrice?u.weightInfo.killHousePrice.toLocaleString():"0")+" ﷼",(u!=null&&u.price?u.price.toLocaleString():"0")+"﷼"],(f0=(F0=(x0=u==null?void 0:u.vetFarm)==null?void 0:x0.vet)==null?void 0:F0.user)!=null&&f0.fullname?u.vetFarm.vet.user.fullname+`(${((S0=(j0=(y0=u==null?void 0:u.vetFarm)==null?void 0:y0.vet)==null?void 0:j0.user)==null?void 0:S0.mobile)||""})`:"فاقد دامپزشک",(u==null?void 0:u.killPlace)||"-",((v0=(D0=(E0=(b0=u==null?void 0:u.poultryRequest)==null?void 0:b0.poultry)==null?void 0:E0.address)==null?void 0:D0.city)==null?void 0:v0.name)||"",u!=null&&u.poultryRequest.sendDate?G0(new Date(u==null?void 0:u.poultryRequest.sendDate),"yyyy/MM/dd"):"-",u==null?void 0:u.poultryRequest.orderCode,...o()==="VetFarm"?[]:[e.jsx(p,{variant:"body2",children:u!=null&&u.barDocumentStatus?e.jsx(m,{title:(u==null?void 0:u.barDocumentDescription)||"بدون توضیحات",arrow:!0,placement:"top",children:e.jsx(p,{variant:"body2",sx:{cursor:u!=null&&u.barDocumentDescription?"pointer":"default"},children:((k0=u==null?void 0:u.barDocumentStatus)==null?void 0:k0.title)||"-"})}):e.jsx(p,{variant:"body2",children:"-"})},c),e.jsx(Wu,{src:(R0=u==null?void 0:u.assignmentInfo)==null?void 0:R0.imageWithBar},c),u!=null&&u.acceptedRealQuantity?u.acceptedRealQuantity.toLocaleString():"0",u!=null&&u.acceptedRealWeight?u.acceptedRealWeight.toLocaleString():"0",($0=u==null?void 0:u.weightInfo)!=null&&$0.finalIndexWeight?u.weightInfo.finalIndexWeight.toLocaleString():"0",u!=null&&u.wareHouseAcceptedRealQuantity?u.wareHouseAcceptedRealQuantity.toLocaleString():"0",u!=null&&u.wareHouseAcceptedRealWeight?u.wareHouseAcceptedRealWeight.toLocaleString():"0",u!=null&&u.weightLoss?u.weightLoss.toLocaleString():"0"],...du(u,c),e.jsx(e6,{item:u,updateTable:s},c)]});Q(a)},[i,l]);const[y]=d.useContext(_u),gu=a=>{S(a)},pu=a=>{$(a)},hu=a=>{lu(a.target.value)},nu=async a=>{var u,c,h;a.preventDefault(),D(!1),R(fu());try{const t=await G.get(`kill_house_request_bar_management/?check&role=${o()}&search=filter&value=${q}&date1=${W}&date2=${r}&page=1&page_size=${_}&without_quarantine_code_state=${V}`);D(!1),b(((u=t.data)==null?void 0:u.results)||[]),P(((c=t.data)==null?void 0:c.count)||0),R(uu())}catch(t){console.error("Error fetching data:",t);const F=(t==null?void 0:t.message)||"",g=(h=t==null?void 0:t.response)==null?void 0:h.status;F.includes("500")||g===500?(D(!0),y({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):y({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}),b([]),P(0),R(uu())}R(M0({selectedDate1:W,selectedDate2:r,textValue:q})).then(t=>{var F,g,L;t!=null&&t.error?((((F=t.error)==null?void 0:F.message)||"").includes("500")||((g=t.error)==null?void 0:g.status)===500||((L=t.error)==null?void 0:L.statusCode)===500)&&(D(!0),y({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"})):D(!1)}).catch(t=>{var z;console.error("Error fetching bars overview:",t);const F=(t==null?void 0:t.message)||"",g=(z=t==null?void 0:t.response)==null?void 0:z.status;(F.includes("500")||g===500)&&(D(!0),y({vertical:"top",horizontal:"center",msg:"مشکلی در دریافت اطلاعات پیش آمده است!",severity:"error"}))})};d.useEffect(()=>{k===0&&B(1)},[W,r,V,k]);const U=({pathLink:a,name:u,isSlaughter:c=!1})=>{const h=c?`date1=${W}&date2=${r}`:`start=${W}&end=${r}`;return e.jsxs(f,{container:!0,justifyContent:"center",alignItems:"center",direction:"column",sx:{border:"1px solid #E6E6E6",borderRadius:"8px",padding:"16px",position:"relative",width:"160px",height:"160px",boxSizing:"border-box",cursor:"pointer",backgroundColor:"#FCFCFC","&:hover":{boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.1)",backgroundColor:"#F5F9FF","& .MuiTypography-body2":{color:"#2D5FFF"}}},onClick:()=>{var F;y({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const t=`${G.defaults.baseURL}${a}/?${h}&key=${((F=v==null?void 0:v.userProfile)==null?void 0:F.key)||""}&role=${o()}&search=filter&value=${q||""}`;window.location.href=t},children:[e.jsx(f,{sx:{zIndex:"10",color:"white",width:"60px",height:"60px",position:"absolute",top:"-30px",backgroundColor:"#2D5FFF",borderRadius:"50%","&:hover":{backgroundColor:"#1446E5"}},variant:"contained",size:"large",pt:"10%",children:e.jsx(Yu,{size:24})}),e.jsx(p,{variant:"body2",sx:{textAlign:"center",marginTop:"16px",transition:"color 0.2s ease"},children:u})]})},xu=({openNotif:a})=>{const[u,c]=d.useState(!1),[h,t]=d.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsxs(f,{container:!0,justifyContent:"center",alignItems:"center",direction:"column",sx:{border:"1px solid #E6E6E6",borderRadius:"8px",padding:"16px",position:"relative",width:"160px",height:"160px",boxSizing:"border-box",cursor:"pointer",backgroundColor:"#FCFCFC"},children:[e.jsx(m,{title:"ارسال پیام بارهای خارج استان در ایتا",placement:"top",children:e.jsx(ru,{sx:{width:"60px",position:"absolute",top:"-30px",backgroundColor:"#2D5FFF",border:"1px solid #E6E6E6",borderRadius:"50%","&:hover":{backgroundColor:"#1446E5"}},variant:"contained",color:"error",size:"large",disabled:u,onClick:async()=>{var F;c(!0);try{await G.get("bot_eitaa_free_bar"),a({vertical:"top",horizontal:"center",msg:"پیام با موفقیت ارسال شد!",severity:"success"})}catch(g){console.error("Error sending message:",g);const L=(g==null?void 0:g.message)||"",z=(F=g==null?void 0:g.response)==null?void 0:F.status,O=L.includes("500")||z===500;a({vertical:"top",horizontal:"center",msg:O?"مشکلی در دریافت اطلاعات پیش آمده است!":"مشکلی در ارسال پیام پیش آمده است!",severity:"error"})}finally{c(!1)}},children:e.jsx(w0,{size:40})})}),e.jsx(p,{variant:"body2",sx:{textAlign:"center",marginTop:"16px"},children:"پیام بار خارج استان"})]}),e.jsxs(f,{container:!0,justifyContent:"center",alignItems:"center",direction:"column",sx:{border:"1px solid #E6E6E6",borderRadius:"8px",padding:"16px",position:"relative",width:"160px",height:"160px",boxSizing:"border-box"},children:[e.jsx(m,{title:"ارسال پیام بارهای داخل استان در ایتا",placement:"top",children:e.jsx(ru,{sx:{width:"60px",position:"absolute",top:"-30px",backgroundColor:"#2D5FFF",border:"1px solid #E6E6E6",borderRadius:"50%","&:hover":{backgroundColor:"#1446E5"}},variant:"contained",color:"success",size:"large",disabled:h,onClick:async()=>{var F;t(!0);try{await G.get("bot_eitaa_for_bar"),a({vertical:"top",horizontal:"center",msg:"پیام با موفقیت ارسال شد!",severity:"success"})}catch(g){console.error("Error sending message:",g);const L=(g==null?void 0:g.message)||"",z=(F=g==null?void 0:g.response)==null?void 0:F.status,O=L.includes("500")||z===500;a({vertical:"top",horizontal:"center",msg:O?"مشکلی در دریافت اطلاعات پیش آمده است!":"مشکلی در ارسال پیام پیش آمده است!",severity:"error"})}finally{t(!1)}},children:e.jsx(w0,{size:40})})}),e.jsx(p,{variant:"body2",sx:{textAlign:"center",marginTop:"16px"},children:"پیام بار داخل استان"})]})]})},Fu=e.jsxs(f,{container:!0,justifyContent:"center",spacing:{xs:3,sm:2,md:1,lg:0},gap:"20px",xs:12,children:[o()!=="ProvinceOperator"&&e.jsxs(f,{container:!0,alignItems:"center",justifyContent:"center",gap:2,xs:12,sx:{py:1},mt:3,children:[e.jsx(U,{name:"بارهای داخل استان",pathLink:"bar_excel"}),o()!=="VetFarm"&&o()!=="CityPoultry"&&e.jsx(U,{name:"گزارش جامع",pathLink:"detail_of_killing_excel",isSlaughter:!0}),(o()==="ProvinceOperator"||o()==="ProvinceSupervisor"||o()==="SuperAdmin"||o()==="Supporter"||o()==="AdminX"||o()==="VetSupervisor")&&e.jsx(U,{name:"پایش کشتارگاه",pathLink:"comprehensive_report_of_the_slaughterhouse_excel",isSlaughter:!0}),(o()==="ProvinceOperator"||o()==="ProvinceSupervisor"||o()==="SuperAdmin"||o()==="Supporter"||o()==="AdminX"||o()==="VetSupervisor")&&e.jsx(U,{name:"عملکرد کشتارگاه ها",pathLink:"from_allocation_to_distribution_excel",isSlaughter:!0}),o()!=="CityPoultry"&&o()!=="VetFarm"&&e.jsx(U,{name:"پایش بارها",pathLink:"monitor_loads_excel",isSlaughter:!0}),o()==="ProvinceOperator"&&e.jsx(xu,{openNotif:y})]}),e.jsxs(f,{container:!0,direction:"column",alignItems:"flex-start",gap:tu.SMALL,xs:12,mt:{xs:2,md:0},children:[e.jsx(p,{children:"مدیریت بارها"}),e.jsxs(f,{container:!0,justifyContent:"flex-start",alignItems:"center",direction:"row",style:{width:"100%"},gap:2,children:[e.jsx(yu,{label:"از تاریخ",id:"date",renderInput:a=>e.jsx(X,{sx:{width:"150px"},...a}),value:W,onChange:a=>{gu($u(a).format("YYYY-MM-DD"))}}),e.jsx(yu,{label:"تا تاریخ",id:"date",renderInput:a=>e.jsx(X,{sx:{width:"150px"},...a}),value:r,onChange:a=>{pu($u(a).format("YYYY-MM-DD"))}}),e.jsxs("form",{onSubmit:nu,children:[e.jsx(X,{autoComplete:"off",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:hu}),e.jsx(ru,{type:"submit",onClick:nu,endIcon:e.jsx(Hu,{}),children:"جستجو"})]}),(o()==="SuperAdmin"||o()==="Supporter"||o()==="AdminX")&&e.jsx(Vu,{control:e.jsx(I0,{checked:V,onChange:cu,name:"item4"}),label:"بدون وضعیت قرنطینه"})]})]})]});let Z;o()==="ProvinceOperator"||o()==="SuperAdmin"||o()==="CityOperator"||o()==="AdminX"||o()==="Supporter"?Z=e.jsxs(q0,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:k,onChange:su,children:[e.jsx(H,{label:"کشتار داخل استان",value:0}),e.jsx(H,{label:"وارد کردن اطلاعات بار",value:1}),e.jsx(H,{label:"تحویلی کشتارگاه",value:2}),e.jsx(H,{label:"بارهای حذف شده",value:3}),e.jsx(H,{label:"فروش به خارج استان",value:4}),e.jsx(H,{label:"بارهای زنجیره",value:5}),e.jsx(H,{label:"خرید خارج از استان",value:6}),e.jsx(H,{label:"عدم وصول",value:7}),o()==="Supporter"||o()==="AdminX"&&e.jsx(H,{label:"تسویه حساب",value:8})]}):o()==="LiveStockSupport"?Z=null:Z=e.jsxs(q0,{scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,value:k,onChange:su,children:[e.jsx(H,{label:"کشتار داخل استان",value:0}),e.jsx(H,{label:"بارهای حذف شده",value:3}),(o()==="VetFarm"||o()==="VetSupervisor"||o()==="ProvinceSupervisor")&&e.jsx(H,{label:"فروش به خارج استان",value:4}),(o()==="VetFarm"||o()==="VetSupervisor"||o()==="ProvinceSupervisor")&&e.jsx(H,{label:"بارهای زنجیره",value:5}),!o()==="VetFarm"&&e.jsx(H,{label:"خرید خارج از استان",value:6}),o()!=="KillHouse"&&e.jsx(H,{label:"عدم وصول",value:7})]});const au=()=>(l==null?void 0:l.reduce((a,u)=>a+(u==null?void 0:u.quantity),0))>(j==null?void 0:j.limitation)||!l.every(a=>{var u,c,h,t,F,g,L,z;return((c=(u=a.poultryRequest)==null?void 0:u.poultry)==null?void 0:c.unitName)===((F=(t=(h=l[0])==null?void 0:h.poultryRequest)==null?void 0:t.poultry)==null?void 0:F.unitName)&&((g=a.killhouseUser)==null?void 0:g.name)===((z=(L=l[0])==null?void 0:L.killhouseUser)==null?void 0:z.name)});return e.jsxs(f,{container:!0,direction:"column",flexWrap:"nowrap",mt:tu.SMALL,xs:12,children:[e.jsx(f,{container:!0,justifyContent:"center",mb:tu.MEDIUM,children:Z}),k===0&&e.jsxs(f,{container:!0,alignItems:"center",justifyContent:"center",xs:12,mb:4,px:2,children:[Fu,e.jsx(f,{container:!0,mt:2,isDashboard:!0,children:e.jsx(Lu,{title:"خلاصه اطلاعات",noPagination:!0,isDashboard:!0,columns:["تعداد بار","حجم بار","وزن بار","حجم دولتی","وزن دولتی","حجم آزاد","وزن آزاد","میانگین وزن","کمترین سن ","بیشترین سن ","میانگین سنی","بارهای دارای کد قرنطینه","بارهای فاقد کد قرنطینه","حجم بارهای فاقد کد قرنطینه","بارهای دارای اختلاف","حجم اختلاف بارها","بارهای تحویلی کشتارگاه","حجم نهایی در کشتارگاه ","وزن نهایی در کشتارگاه","تعداد بار ورودی به انبار","حجم بار ورودی به انبار","وزن لاشه","درصد افت بار"],data:[[e.jsx(p,{variant:"caption",style:{color:"blue"},children:n!=null&&n.lenKillRequest?n.lenKillRequest.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",children:n!=null&&n.killRequestQuantity?n.killRequestQuantity.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",style:{color:"blue"},children:n!=null&&n.killRequestWeight?n.killRequestWeight.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",children:n!=null&&n.allGovernmentalQuantity?n.allGovernmentalQuantity.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",children:n!=null&&n.allGovernmentalWeight?n.allGovernmentalWeight.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",children:n!=null&&n.allFreeQuantity?n.allFreeQuantity.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",children:n!=null&&n.allFreeWeight?n.allFreeWeight.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",children:(n==null?void 0:n.avgWeight)||"0"},"1"),e.jsx(p,{variant:"caption",style:{color:"blue"},children:(n==null?void 0:n.minAge)||"0"},"1"),e.jsx(p,{variant:"caption",children:(n==null?void 0:n.maxAge)||"0"},"1"),e.jsx(p,{variant:"caption",style:{color:"blue"},children:(n==null?void 0:n.avgAge)||"0"},"1"),e.jsx(p,{variant:"caption",children:n!=null&&n.lenKillRequestHasCode?n.lenKillRequestHasCode.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",children:n!=null&&n.lenKillRequestHasNotCode?n.lenKillRequestHasNotCode.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",style:{color:"blue"},children:n!=null&&n.quantityOfKillRequestHasNotCode?n.quantityOfKillRequestHasNotCode.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",children:n!=null&&n.differenceBar?n.differenceBar.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",children:n!=null&&n.finalRealQuantity?n.finalRealQuantity.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",style:{color:"blue"},children:n!=null&&n.lenCompleteWithKillHouse?n.lenCompleteWithKillHouse.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",children:n!=null&&n.quantityFinalKillHouse?n.quantityFinalKillHouse.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",style:{color:"blue"},children:n!=null&&n.weightFinalKillHouse?n.weightFinalKillHouse.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",children:n!=null&&n.wareHouseBars?n.wareHouseBars.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",style:{color:"blue"},children:n!=null&&n.wareHouseBarsQuantity?n.wareHouseBarsQuantity.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",children:n!=null&&n.wareHouseBarsWeight?n.wareHouseBarsWeight.toLocaleString():"0"},"1"),e.jsx(p,{variant:"caption",style:{color:"blue"},children:n!=null&&n.wareHouseBarsWeightLose?n.wareHouseBarsWeightLose.toFixed(2).toLocaleString():"0"},"1")]]})}),(j==null?void 0:j.allow)&&(o()==="VetFarm"||o()==="AdminX"||o()==="SuperAdmin")&&e.jsx(f,{id:"merge",container:!0,xs:12,justifyContent:"end",children:e.jsx(ru,{color:au()?"error":"primary",variant:"outlined",disabled:l.some(a=>a==null?void 0:a.clearanceCode)?!0:l.some(a=>a==null?void 0:a.aggregateCode)?!1:(l==null?void 0:l.length)<2,onClick:()=>{au()?y({vertical:"top",horizontal:"center",msg:`فقط بارهای با خریدار و مرغدار یکسان و با مجموع تعداد حداکثر ${j==null?void 0:j.limitation} میتوانید ادغام کنید!`,severity:"error"}):R(Mu({title:l.some(a=>a==null?void 0:a.aggregateCode)&&!l.some(a=>a==null?void 0:a.clearanceCode)?"ورود اطلاعات / لغو ادغام":"ادغام بارها",content:e.jsx(z0,{setAggregates:C,bars:l.some(a=>a==null?void 0:a.aggregateCode)?i==null?void 0:i.filter(a=>{var u;return(a==null?void 0:a.aggregateCode)===((u=l[0])==null?void 0:u.aggregateCode)}):l,updateTable:s,canReturn:l.some(a=>a==null?void 0:a.aggregateCode)&&!l.some(a=>a==null?void 0:a.clearanceCode)})}))},children:l.some(a=>a==null?void 0:a.aggregateCode)&&!l.some(a=>a==null?void 0:a.clearanceCode)?"ورود اطلاعات / لغو ادغام":"ادغام بارها"})}),e.jsx(Lu,{data:eu,columns:["ردیف","ادغام","وضعیت","کدبار","تاریخ ثبت خودرو","کشتار","فروش","خریدار","کشتارکن اختصاصی","مشخصات مرغدار","نام فارم","تعداد اولیه","وزن اولیه بار (کیلوگرم)","کد بهداشتی حمل و نقل","قیمت مرغ زنده‌ی بار","کدرهگیری سامانه قرنطینه","تعداد در قرنطینه","ماشین","راننده","نژاد","سن","میانگین وزن اولیه (کیلوگرم)",...o()==="VetFarm"?[]:["قیمت مرغدار","قیمت کشتارگاه","قیمت تعاونی"],"دامپزشک فارم","محل کشتار","شهر","تاریخ کشتار","کدسفارش کشتار",...o()==="VetFarm"?[]:["وضعیت سند","سند (بارنامه)","تعداد نهایی","وزن نهایی بار (کیلوگرم)","میانگین وزن نهایی (کیلوگرم)","حجم لاشه","وزن لاشه","درصد افت"],...Cu(),"عملیات"],handlePageChange:iu,totalRows:Y,page:I,perPage:_,handlePerRowsChange:x,title:"مدیریت بارها"})]}),k===1&&e.jsx(a6,{}),k===2&&e.jsx(r6,{}),k===3&&e.jsx(f,{mt:tu.MEDIUM,children:e.jsx(u6,{})}),(o()==="ProvinceOperator"||o()==="CityOperator"||o()==="SuperAdmin"||o()==="VetFarm"||o()==="VetSupervisor"||o()==="AdminX"||o()==="Supporter"||o()==="ProvinceSupervisor")&&e.jsx(e.Fragment,{children:k===4&&e.jsx(f,{mt:tu.MEDIUM,children:e.jsx(g6,{readOnly:o()==="VetSupervisor"||o()==="CityOperator"||o()==="ProvinceSupervisor"})})}),k===5&&e.jsx(o6,{}),k===6&&e.jsx(p6,{}),k===7&&e.jsx(d6,{}),k===8&&e.jsx(f6,{})]})};export{G6 as V}; diff --git a/build/assets/VetFarmSubmitClearanceCode-B4m3TtXY.js b/build/assets/VetFarmSubmitClearanceCode-B4m3TtXY.js new file mode 100644 index 0000000..163e608 --- /dev/null +++ b/build/assets/VetFarmSubmitClearanceCode-B4m3TtXY.js @@ -0,0 +1 @@ +import{$ as K,ae as M,j as e,b as q,a3 as l,T as D,a9 as N,ak as d,aa as I,B as E,aA as $,I as Q,bn as X,d as H,p as x}from"./mui-vendor-CkIVaoQP.js";import{r as y}from"./react-vendor-CmFgShSM.js";import{a as b,u as Y}from"./redux-vendor-B7uoacJt.js";import{d as J}from"./Pageview-TRcW_9jm.js";import{d as Z}from"./Edit-CqBj1Y2L.js";import{d as ee}from"./Delete-C5MyLelE.js";import{L as _,j as T,h,A as ue,X as U,C as te}from"./index-CeyyVc1v.js";import{L as re}from"./LabelField-B6eRSoQP.js";const ae=b("VET_FARM_EDIT_OUT_DRIVER_CODE",async(o,{dispatch:r})=>{r(_());try{const{data:a,status:i}=await T.post("poultry-request-quarantine-code/",o);return r(h()),{data:a,status:i}}catch(a){return r(h()),{error:a.response.data.result}}}),se=b("VET_EDIT_QUARANTINE_CODE_SERVICE",async(o,{dispatch:r})=>{r(_());try{const{data:a,status:i}=await T.put("poultry-request-quarantine-code/0/",o);return r(h()),{data:a,status:i}}catch(a){return r(h()),{error:a.response.data.result}}}),ne=b("VET_FARM_GET_QUARANTINE_CODE_SERVICE",async(o,{dispatch:r})=>{r(_());const{data:a,status:i}=await T.get("poultry-request-quarantine-code",{params:o});return r(h()),{data:a,status:i}}),ie=b("VET_FARM_DELETE_QUARANTINE_CODE_SERVICE",async(o,{dispatch:r})=>{r(_());try{const{data:a,status:i}=await T.delete("poultry-request-quarantine-code/0/",{params:o});return r(h()),{data:a,status:i}}catch(a){return r(h()),{error:a.response.data.result}}}),V=({readOnly:o,updateTable:r,item:a})=>{const i=Y(),[c]=y.useContext(ue),O=K(),P=M(O.breakpoints.down("md")),[z,v]=y.useState(null),[F,f]=y.useState([]),[k,W]=y.useState(!1),[n,R]=y.useState({code:"",quantity:"",trafficCode:"",requestCodeKey:""}),p=U()==="VetFarm"||U()==="AdminX",A=()=>{i(ne({poultry_request_key:a==null?void 0:a.key})).then(u=>{var t;(t=u.payload)!=null&&t.data&&f(u.payload.data.map(s=>({...s,requestCodeKey:s.key,isEdit:!1})))})};y.useEffect(()=>{A()},[i,a==null?void 0:a.key]);const S=()=>{if(i(te()),!n.code||!n.quantity){c({vertical:"top",horizontal:"center",msg:"لطفا کد و تعداد را وارد کنید",severity:"error"});return}i(ae({quarantine_code:n.code.toUpperCase(),quarantine_quantity:n.quantity,traffic_code:n.trafficCode||null,poultry_request_key:a==null?void 0:a.key})).then(u=>{var t;u.payload.error?c({vertical:"top",horizontal:"center",msg:u.payload.error,severity:"error"}):(c({vertical:"top",horizontal:"center",msg:"کد با موفقیت ثبت شد",severity:"success"}),A(),f([...F,{quarantineCode:n.code.toUpperCase(),quarantineQuantity:n.quantity,trafficCode:n.trafficCode,requestCodeKey:(t=u.payload)==null?void 0:t.key,isEdit:!1}]),R({code:"",quantity:"",trafficCode:""}),r&&r())})},L=u=>{const t=F[u];if(!t.quarantineCode||!t.quarantineQuantity){c({vertical:"top",horizontal:"center",msg:"لطفا کد و تعداد را وارد کنید",severity:"error"});return}v(u),i(se({request_code_key:t==null?void 0:t.requestCodeKey,quarantine_code:t==null?void 0:t.quarantineCode.toUpperCase(),quarantine_quantity:t==null?void 0:t.quarantineQuantity,traffic_code:(t==null?void 0:t.trafficCode)||null})).then(s=>{s.payload.error?c({vertical:"top",horizontal:"center",msg:s.payload.error||"خطا در ویرایش کد",severity:"error"}):(c({vertical:"top",horizontal:"center",msg:"کد با موفقیت ویرایش شد",severity:"success"}),f(C=>C.map((g,j)=>j===u?{...g,isEdit:!1}:g)),A(),r&&r())}).finally(()=>{v(null)})},B=u=>{const t=F[u];t!=null&&t.requestCodeKey&&(v(u),i(ie({request_code_key:t==null?void 0:t.requestCodeKey})).then(s=>{s.error?c({vertical:"top",horizontal:"center",msg:s.error,severity:"error"}):(c({vertical:"top",horizontal:"center",msg:"کد با موفقیت حذف شد",severity:"success"}),f(C=>C.filter((g,j)=>j!==u)),A(),r&&r())}).finally(()=>{v(null)}))},w=(u,t,s)=>{f(C=>C.map((g,j)=>j===u?{...g,[t]:s}:g))},G=u=>{f(t=>t.map((s,C)=>C===u?{...s,isEdit:!s.isEdit}:s))},m=(u,t)=>{R({...n,[u]:t})};return e.jsxs(q,{sx:{width:{xs:"340px",md:"690px"}},children:[e.jsx(l,{sx:{width:"100%",maxHeight:"400px",overflowY:"auto"},children:F.length>0&&e.jsxs(q,{sx:{mb:3,px:1},children:[e.jsx(D,{variant:"subtitle1",gutterBottom:!0,children:"کدهای ثبت شده:"}),F.map((u,t)=>e.jsx(N,{elevation:2,sx:{p:2,mb:2,border:"1px solid #eee",borderRadius:2},children:e.jsxs(q,{sx:{display:"flex",alignItems:"center",gap:2,flexWrap:"wrap",width:"100%"},children:[e.jsx(d,{label:"کد حمل",size:"small",value:u.trafficCode||"",onChange:s=>w(t,"trafficCode",s.target.value),disabled:!u.isEdit||!p,sx:{width:{xs:"46%",md:"160px"}}}),e.jsx(d,{label:"کد قرنطینه",size:"small",value:u.quarantineCode||"",onChange:s=>w(t,"quarantineCode",s.target.value),disabled:!u.isEdit||!p,InputProps:{startAdornment:e.jsx(I,{position:"start",children:e.jsx(oe,{clearanceCode:u.quarantineCode})})},sx:{width:{xs:"46%",md:"160px"}}}),e.jsx(d,{label:"تعداد",type:"number",size:"small",value:u.quarantineQuantity||"",onChange:s=>w(t,"quarantineQuantity",s.target.value),disabled:!u.isEdit||!p,sx:{width:{xs:"35%",md:"80px"}}}),u.isEdit?e.jsx(E,{variant:"contained",color:"success",onClick:()=>L(t),disabled:z===t||!p,startIcon:z===t?e.jsx($,{size:20}):null,size:"small",children:"ذخیره"}):e.jsxs(q,{sx:{display:"flex",alignItems:"center",gap:1},children:[p&&e.jsx(Q,{color:"primary",onClick:()=>G(t),disabled:o,size:"small",children:e.jsx(Z,{})}),p&&e.jsx(Q,{color:"error",onClick:()=>B(t),disabled:o||z===t,size:"small",children:e.jsx(ee,{})}),e.jsxs(l,{xs:12,sx:{width:"80px",borderStyle:"solid",p:1,borderRadius:"10px",borderWidth:"0px 1px 0px 1px",borderColor:"gray",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[e.jsx(D,{variant:"caption",sx:{color:"gray"},children:"استعلام"}),e.jsx(D,{children:u==null?void 0:u.systemQuarantineQuantity})]})]})]})},t))]})}),p&&!o&&e.jsx(e.Fragment,{children:P?e.jsxs(e.Fragment,{children:[e.jsxs(E,{variant:"text",size:"medium",onClick:()=>W(!k),sx:{justifyContent:"flex-start",fontWeight:"bold"},children:[k?"- ":"+ ","افزودن کد جدید"]}),e.jsx(X,{in:k,children:e.jsx(N,{elevation:2,sx:{p:2,border:"1px solid #eee",borderRadius:2},children:e.jsxs(l,{container:!0,spacing:2,alignItems:"center",xs:12,children:[e.jsx(l,{item:!0,xs:12,md:3.5,children:e.jsx(d,{label:"کد حمل",size:"small",value:n.trafficCode,onChange:u=>m("trafficCode",u.target.value.toUpperCase()),fullWidth:!0})}),e.jsx(l,{item:!0,xs:12,md:3.5,children:e.jsx(d,{label:"کد قرنطینه",size:"small",value:n.code,onChange:u=>m("code",u.target.value.toUpperCase()),fullWidth:!0})}),e.jsx(l,{item:!0,xs:12,md:2.5,children:e.jsx(d,{label:"تعداد",type:"number",size:"small",value:n.quantity,onChange:u=>m("quantity",u.target.value),fullWidth:!0})}),e.jsx(l,{item:!0,xs:12,md:2.5,children:e.jsx(E,{variant:"contained",color:"primary",onClick:S,disabled:!n.code||!n.quantity,size:"small",fullWidth:!0,children:"افزودن"})})]})})})]}):e.jsx(l,{container:!0,xs:12,pt:2,children:e.jsx(re,{label:"افزودن کد جدید",children:e.jsxs(l,{container:!0,spacing:2,alignItems:"center",xs:12,p:1,children:[e.jsx(l,{item:!0,xs:12,md:3.5,children:e.jsx(d,{label:"کد حمل",size:"small",value:n.trafficCode,onChange:u=>m("trafficCode",u.target.value.toUpperCase()),fullWidth:!0})}),e.jsx(l,{item:!0,xs:12,md:3.5,children:e.jsx(d,{label:"کد قرنطینه",size:"small",value:n.code,onChange:u=>m("code",u.target.value.toUpperCase()),fullWidth:!0})}),e.jsx(l,{item:!0,xs:12,md:2.5,children:e.jsx(d,{label:"تعداد",type:"number",size:"small",value:n.quantity,onChange:u=>m("quantity",u.target.value),fullWidth:!0})}),e.jsx(l,{item:!0,xs:12,md:2.5,children:e.jsx(E,{variant:"contained",color:"primary",onClick:S,disabled:!n.code||!n.quantity,size:"small",fullWidth:!0,children:"افزودن"})})]})})})})]})},oe=({clearanceCode:o})=>{const r=y.useRef(null),a=()=>{r.current&&r.current.submit()};return e.jsx(H,{title:"مشاهده گواهینامه",arrow:!0,children:e.jsxs("form",{action:"https://e.ivo.ir/Rahgiri/Gidprnt.aspx",method:"post",target:"_blank",ref:r,style:{cursor:"pointer"},children:[e.jsx("input",{name:"gid",type:"hidden",value:o}),e.jsx(J,{color:"primary",onClick:a})]})})};V.propTypes={item:x.PropTypes.shape({key:x.PropTypes.string,quarantine_code:x.PropTypes.string,quarantine_quantity:x.PropTypes.string,quarantineCodes:x.PropTypes.array}),updateTable:x.PropTypes.func,readOnly:x.PropTypes.bool};V.defaultProps={readOnly:!1,updateTable:()=>{}};export{V}; diff --git a/build/assets/Visibility-DeyjG-oI.js b/build/assets/Visibility-DeyjG-oI.js new file mode 100644 index 0000000..d0cbe95 --- /dev/null +++ b/build/assets/Visibility-DeyjG-oI.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as i}from"./index-CeyyVc1v.js";var e={},a=r;Object.defineProperty(e,"__esModule",{value:!0});var s=e.default=void 0,o=a(i()),u=t;s=e.default=(0,o.default)((0,u.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility");export{s as d}; diff --git a/build/assets/VisorStatics-RjLo9w8U.js b/build/assets/VisorStatics-RjLo9w8U.js new file mode 100644 index 0000000..b6fca7a --- /dev/null +++ b/build/assets/VisorStatics-RjLo9w8U.js @@ -0,0 +1,6 @@ +import{i as We,j as i,b0 as ju,T as P,B as ge,am as bt,ai as Zt,aX as St,ag as Me,av as De,aw as Le,ax as k,I as de,aL as wu,aM as Iu,aN as Tu,ab as Ru,br as Eu,ad as ku,d as In,a3 as M,b as _e,aU as Xe,ak as $,b2 as Pu,b3 as qe,al as Ou}from"./mui-vendor-CkIVaoQP.js";import{r as v,f as Tn,j as Rn}from"./react-vendor-CmFgShSM.js";import{r as He,L as G,j as V,X as _,h as Q,G as b,S as Ce,k as Fu,ez as Mu,p as je,eA as Je,eB as En,eC as kn,eD as Pn,eE as On,eF as Fn,eG as Mn,eH as Dn,eI as Se,eJ as Pt,eK as Ot,eL as Ft,eM as Mt,eN as Dt,eO as Lt,eP as zt,eQ as en,eR as Du,eS as Lu,eT as zu,eU as Nu,eV as Vu,eW as Ln,eX as Bu,eY as Wu,eZ as Hu,e_ as Yu,e$ as Ze,f0 as zn,f1 as Nn,f2 as Vn,A as vt,v as Ne,u as Uu,c as $u,c5 as Xu,M as Ae,b as mt,W as tt,m as qu,f3 as Gu,f4 as Qu,f5 as Ku,f6 as Ju,f7 as Zu,f8 as er,f9 as tr}from"./index-CeyyVc1v.js";import{h as tn}from"./html2canvas.esm-BfYXEYrK.js";import{a as ut,u as ye}from"./redux-vendor-B7uoacJt.js";import{L as Be,C as X,a as rt,b as ot,P as st,c as it,p as Bn,d as at,e as lt,i as we,f as Ie,E as xe,t as H,g as Nt,h as B,j as ct,k as D,l as nr,u as ur,m as ve,R as Wn,n as rr,o as or,D as sr,A as ir,v as Ve,q as Hn,r as Vt,Q as Pe,H as Ge,T as nn,s as Yn,w as ar,x as un,y as At,z as rn,B as lr,F as Un,G as $n,I as cr}from"./chart-vendor-sE2SUVPW.js";import{d as dr}from"./Close-_jAEIgMD.js";import{d as on}from"./Download-DQ-VVIaV.js";import{a as hr,R as Xn}from"./index.esm-Bu7XMDZU.js";import{L as Qe}from"./LinkItem-DT6qswcs.js";import{g as fr,h as gr,e as Cr,i as pr}from"./index.esm-CjWvmHks.js";import{N as Ke}from"./NavLink-D2GD_ItM.js";import{B as yr}from"./BackButton-Crzr7NMa.js";import{R as dt}from"./ResponsiveTable-w7hk7Uq8.js";import{N as xr}from"./NumberFormatCustom-DwWPj40N.js";import{d as br}from"./ArrowDownward-DdOsPC7b.js";import{A as mr}from"./index-9Ymn_7Kv.js";import{A as he}from"./AdvancedChart-DTCDh5lM.js";import{g as Ar}from"./getSamasatProvinces-BvJGUILK.js";import{d as _r}from"./ToggleOffOutlined-Ch26Umk7.js";import{d as Sr}from"./ToggleOn-pBgb8alR.js";import"./iconBase-BEJYyZsk.js";import"./FilterAlt-scT0HEUg.js";import"./styled-components.browser.esm-gS9mh05b.js";var Bt={},vr=We;Object.defineProperty(Bt,"__esModule",{value:!0});var qn=Bt.default=void 0,jr=vr(He()),wr=i;qn=Bt.default=(0,jr.default)((0,wr.jsx)("path",{d:"M22 5v2h-3v3h-2V7h-3V5h3V2h2v3zm-3 14H5V5h6V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6h-2zm-4-6v4h2v-4zm-4 4h2V9h-2zm-2 0v-6H7v6z"}),"Addchart");var Wt={},Ir=We;Object.defineProperty(Wt,"__esModule",{value:!0});var Gn=Wt.default=void 0,Tr=Ir(He()),Rr=i;Gn=Wt.default=(0,Tr.default)((0,Rr.jsx)("path",{d:"M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z"}),"Fullscreen");var Ht={},Er=We;Object.defineProperty(Ht,"__esModule",{value:!0});var Qn=Ht.default=void 0,kr=Er(He()),Pr=i;Qn=Ht.default=(0,kr.default)((0,Pr.jsx)("path",{d:"M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"}),"FullscreenExit");const Or=ut("VISORS_GET_STATICS",async(t,{dispatch:e})=>{e(G());const{data:n,status:u}=await V.get("data_report_percentages",{params:{role:_(),type:t.type}});return e(Q()),{data:n,status:u}});var Yt={},Fr=We;Object.defineProperty(Yt,"__esModule",{value:!0});var Kn=Yt.default=void 0,Mr=Fr(He()),Dr=i;Kn=Yt.default=(0,Mr.default)((0,Dr.jsx)("path",{d:"M12 2c-4.2 0-8 3.22-8 8.2 0 3.32 2.67 7.25 8 11.8 5.33-4.55 8-8.48 8-11.8C20 5.22 16.2 2 12 2m1 13h-2v-2h2zm0-4h-2V6h2z"}),"FmdBad");X.register(rt,ot,st,it,Bn,at,lt);const Lr=()=>{const[t,e]=v.useState(!1),[n,u]=v.useState(null),[o,r]=v.useState(null),[s,a]=v.useState(["hasCodeData","quarantineQuantityData","assignmentStateArchiveData","acceptedAssignmentRealWeightData","hasntCodeData","differenceBarData","wareHouseConfirmationData","wareHouseAcceptedRealWeightData","weightYearData"]),[l,c]=v.useState({hasCodeData:!0,quarantineQuantityData:!0,assignmentStateArchiveData:!0,acceptedAssignmentRealWeightData:!0,hasntCodeData:!0,differenceBarData:!0,wareHouseConfirmationData:!0,wareHouseAcceptedRealWeightData:!0,weightYearData:!0}),g=ye(),[p,C]=v.useState(null),[d,x]=v.useState("threeMonths"),[A,S]=v.useState(""),y=I=>{x(I.target.value)},m=I=>{C(I.currentTarget)},h=()=>{C(null)},j=I=>{r(I)},f=()=>{r(null)},w=I=>{c({...l,[I]:!l[I]})};v.useEffect(()=>{t?g(Or({type:d})).then(I=>{u(I.payload.data)}):u(null)},[t,d]);const O=!!p,F=O?"simple-popover":void 0,E=I=>({labels:d!=="month"?I.map(T=>Mu(T.date)):I.map(T=>je(T.date)),datasets:[{label:"درصد",data:I.map(T=>T.percent),borderColor:"rgba(55, 41, 145, 0.6)",backgroundColor:"rgba(75, 192, 192, 0.2)"}]}),z={scales:{y:{beginAtZero:!0,min:0}}},Y=n?E(n.hasCode):null,J=n?E(n.quarantineQuantity):null,Z=n?E(n.differenceBar):null,ee=n?E(n.assignmentStateArchive):null,te=n?E(n.acceptedAssignmentRealWeight):null,ne=n?E(n.hasntCode):null,ue=n?E(n.wareHouseConfirmation):null,re=n?E(n.wareHouseAcceptedRealWeight):null,oe=n?E(n.weightYear):null,N={hasCodeData:{title:"درصد بارهای دارای کد قرنطینه",data:Y},quarantineQuantityData:{title:"درصد تعداد بارهای احراز شده از قرنطینه",data:J},assignmentStateArchiveData:{title:"درصد تعداد بارهای تکمیل شده کشتارگاه",data:ee},acceptedAssignmentRealWeightData:{title:"درصد وزن نهایی در کشتارگاه نسبت به وزن کل",data:te},hasntCodeData:{title:"درصد بارهای فاقد کد قرنطینه",data:ne},differenceBarData:{title:"درصد بارهای اختلاف دار در قرنطینه و رصدیار",data:Z},wareHouseConfirmationData:{title:"درصد تعداد بارهای ورودی به انبار",data:ue},wareHouseAcceptedRealWeightData:{title:"درصد وزن لاشه ها در انبار نسبت به وزن کل",data:re},weightYearData:{title:"درصد وزن لاشه در انبار نسبت به وزن نهایی در کشتارگاه",data:oe}},se=(I,T)=>{I.dataTransfer.setData("draggedIndex",T)},ie=(I,T)=>{const R=I.dataTransfer.getData("draggedIndex"),L=Array.from(s),[vu]=L.splice(R,1);L.splice(T,0,vu),a(L)},ae=I=>{I.preventDefault()},le=()=>{const I=document.getElementById("screenshot-container");tn(I).then(T=>{const R=document.createElement("a");R.href=T.toDataURL("image/png"),R.download="پایش آماری.png",R.click()})},ce=()=>{const I=document.getElementById("screenshot-single-container");tn(I).then(T=>{const R=document.createElement("a");R.href=T.toDataURL("image/png"),R.download="پایش آماری.png",R.click()})};return i.jsxs(b,{container:!0,xs:12,alignItems:"center",justifyContent:"center",mt:2,children:[i.jsxs(b,{container:!0,xs:12,alignItems:"center",justifyContent:"center",p:2,style:{borderStyle:"solid",borderWidth:"2px",borderColor:"pink",borderRadius:"10px"},children:[i.jsx(b,{container:!0,xs:4,children:i.jsx(ju,{id:F,open:O,anchorEl:p,onClose:h,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:i.jsxs(b,{container:!0,width:"300px",p:3,children:[i.jsxs(b,{container:!0,xs:12,justifyContent:"space-between",alignItems:"center",children:[i.jsx(P,{variant:"body1",color:"primary",children:"انتخاب نمودار"}),i.jsx(ge,{color:"error",onClick:()=>{h()},children:"بازگشت"})]}),i.jsx(bt,{style:{width:"100%"}}),i.jsxs(b,{container:!0,alignItems:"center",gap:1,xs:12,children:[i.jsx(Zt,{control:i.jsx(St,{size:"small",checked:t,onChange:()=>{h(),e(!t)}}),label:"اطلاعات مدیریت بار"}),i.jsx(bt,{style:{width:"100%"}})]})]})})}),i.jsxs(b,{container:!0,alignItems:"center",gap:Ce.SMALL,xs:12,justifyContent:"start",children:[i.jsx(b,{container:!0,gap:Ce.TINY,alignItems:"center",children:i.jsx(P,{children:"پایش آماری"})}),i.jsx(ge,{variant:"contained",onClick:m,"aria-describedby":F,endIcon:i.jsx(qn,{}),children:"انتخاب نمودار"}),i.jsx(b,{container:!0,gap:Ce.SMALL,children:i.jsxs(Me,{fullWidth:!0,style:{minWidth:"150px"},children:[i.jsx(De,{id:"demo-simple-select-label",children:"انتخاب بازه"}),i.jsxs(Le,{size:"small",labelId:"demo-simple-select-label",id:"demo-simple-select",value:d,label:"Age",onChange:y,children:[i.jsx(k,{value:"month",children:"یک ماهه"}),i.jsx(k,{value:"threeMonths",children:"سه ماهه"}),i.jsx(k,{value:"sixMonths",children:"شش ماهه"}),i.jsx(k,{value:"year",children:"سالیانه"})]})]})}),_()==="AdminX"&&i.jsx(b,{children:i.jsx("a",{href:"https://miran.storage.c2.liara.space/%D8%A2%D9%86%D8%A7%D9%84%DB%8C%D8%B2%20%D8%AC%D8%A7%D9%85%D8%B9%20%DA%A9%D8%B4%D8%AA%D8%A7%D8%B1%20%D8%A7%D8%B3%D8%AA%D8%A7%D9%86%20%D9%87%D9%85%D8%AF%D8%A7%D9%86%20%D8%B1%D8%B5%D8%AF%20%DB%8C%D8%A7%D8%B1.xlsx",rel:"noreferrer",children:i.jsx(ge,{color:"success",children:i.jsx(hr,{size:32})})})})]}),i.jsx(b,{container:!0,xs:12,children:t&&i.jsxs(b,{container:!0,alignItems:"center",onClick:()=>{e(!1),u(null)},style:{cursor:"pointer"},children:[i.jsx(de,{color:"error",children:i.jsx(dr,{})})," ",i.jsx(P,{color:"error",variant:"body2",children:"اطلاعات مدیریت بار"})]})}),i.jsx(bt,{style:{width:"100%",marginTop:"20px",marginBottom:"20px"}}),i.jsxs(b,{container:!0,xs:12,mb:2,justifyContent:"space-between",alignItems:"center",children:[i.jsxs(b,{container:!0,alignItems:"center",justifyContent:"start",children:[i.jsx(Kn,{color:"primary"}),i.jsxs(P,{variant:"body2",color:"primary",children:["با کشیدن و رها کردن نمودارها میتوانید ترتیب نمایش آنها را تغییر دهید."," "]})]}),i.jsx(b,{children:i.jsx(de,{onClick:le,color:"primary",disabled:!n,children:i.jsx(on,{})})})]}),n&&i.jsxs(wu,{children:[i.jsx(Iu,{expandIcon:i.jsx(Fu,{}),"aria-controls":"panel1-content",id:"panel1-header",children:i.jsx(P,{variant:"body1",style:{color:"gray"},children:"فیلتر نمودارها"})}),i.jsx(Tu,{children:i.jsx(b,{container:!0,xs:12,children:Object.keys(N).map(I=>i.jsx(b,{item:!0,xs:12,sm:6,style:{display:"flex",alignItems:"center"},children:i.jsx(Zt,{control:i.jsx(St,{size:"small",checked:l[I],onChange:()=>w(I)}),label:N[I].title})},I))})})]})]}),i.jsx(b,{container:!0,spacing:3,xs:12,mt:2,id:"screenshot-container",children:n&&i.jsx(i.Fragment,{children:s.map((I,T)=>{const R=N[I];return l[I]&&i.jsxs(b,{item:!0,xs:12,sm:6,style:{position:"relative"},draggable:!0,onDragStart:L=>se(L,T),onDrop:L=>ie(L,T),onDragOver:ae,onDoubleClick:()=>{S(R.title),j(R.data)},children:[i.jsx(P,{variant:"h6",style:{fontSize:"16px"},children:R.title}),i.jsx(de,{style:{position:"absolute",right:10,top:10,zIndex:1},onClick:()=>{S(R.title),j(R.data)},children:i.jsx(Gn,{})}),i.jsx(Be,{data:R.data,options:z})]},T)})})}),o&&i.jsxs(Ru,{open:!!o,onClose:f,maxWidth:"md",fullWidth:!0,children:[i.jsx(Eu,{children:i.jsxs(b,{container:!0,alignItems:"center",justifyContent:"space-between",xs:12,children:[i.jsx(de,{onClick:f,children:i.jsx(Qn,{})}),i.jsx(b,{children:i.jsx(de,{onClick:ce,disabled:!n,children:i.jsx(on,{})})})]})}),i.jsxs(ku,{id:"screenshot-single-container",children:[i.jsx(b,{container:!0,justifyContent:"center",xs:12,children:i.jsx(P,{variant:"h6",style:{fontSize:"16px"},children:A})}),i.jsx(Be,{data:o})]})]})]})},zr=()=>{const{pathname:t}=Tn();return i.jsx(b,{container:!0,gap:Ce.SMALL,p:Ce.SMALL,direction:{xs:"column",md:"row"},justifyContent:"center",style:{placeContent:"baseline"},children:i.jsx(b,{container:!0,direction:"column",style:{width:"100%"},children:i.jsxs(b,{container:!0,gap:Ce.SMALL,justifyContent:"center",children:[i.jsx(Ke,{to:_()==="AdminX"?Je:_()==="SuperAdmin"?En:_()==="CityOperator"?kn:_()==="ProvinceOperator"?Pn:_()==="VetSupervisor"?On:_()==="Commerce"?Fn:_()==="ProvinceSupervisor"?Mn:_()==="Observatory"?Dn:Je,active:t===Je?"true":null,children:i.jsx(Qe,{icon:i.jsx(fr,{size:30,color:"#244CCC"}),title:"پایش آمار کشتار",description:"پایش آمار کشتار"})}),i.jsx(Ke,{to:_()==="AdminX"?Se:_()==="SuperAdmin"?Pt:_()==="CityOperator"?Ot:_()==="ProvinceOperator"?Ft:_()==="VetSupervisor"?Mt:_()==="Commerce"?Dt:_()==="ProvinceSupervisor"?Lt:_()==="Observatory"?zt:Se,active:t===Se?"true":null,children:i.jsx(Qe,{icon:i.jsx(gr,{size:30,color:"#244CCC"}),title:"پیش بینی موجودی",description:"پیش بینی موجودی"})}),i.jsx(Ke,{to:_()==="AdminX"?en:_()==="SuperAdmin"?Du:_()==="Admin"?Lu:_()==="CityOperator"?zu:_()==="ProvinceOperator"?Nu:_()==="ProvinceFinancial"?Vu:_()==="VetSupervisor"?Ln:_()==="ProvinceInspector"?Bu:_()==="Jahad"?Wu:_()==="Commerce"?Hu:Yu,active:t===en?"true":null,children:i.jsx(Qe,{icon:i.jsx(Cr,{size:30,color:"#244CCC"}),title:"آمار و اطلاعات",description:"آمار و اطلاعات"})}),i.jsx(Ke,{to:_()==="AdminX"?Ze:_()==="SuperAdmin"?zn:_()==="Admin"?Nn:_()==="ProvinceOperator"?Vn:Ze,active:t===Ze?"true":null,children:i.jsx(Qe,{icon:i.jsx(pr,{size:30,color:"#244CCC"}),title:"پایش کشوری",description:"پایش کشوری"})})]})})})},Nr=ut("VISORS_GET_PREDICTION_STATICS_DASHBOARD",async(t,{dispatch:e})=>{e(G());const{data:n,status:u}=await V.get("poultry_hatching_prediction_dashboard",{params:{role:_()}});return e(Q()),{data:n,status:u}}),Vr=ut("VISORS_GET_PREDICTION_STATICS_CHART",async(t,{dispatch:e})=>{e(G());const{data:n,status:u}=await V.get("poultry_hatching_prediction_chart",{params:t});return e(Q()),{data:n,status:u}});/*! +* chartjs-plugin-annotation v3.1.0 +* https://www.chartjs.org/chartjs-plugin-annotation/index + * (c) 2024 chartjs-plugin-annotation Contributors + * Released under the MIT License + */const sn={modes:{point(t,e){return et(t,e,{intersect:!0})},nearest(t,e,n){return Hr(t,e,n)},x(t,e,n){return et(t,e,{intersect:n.intersect,axis:"x"})},y(t,e,n){return et(t,e,{intersect:n.intersect,axis:"y"})}}};function Ut(t,e,n){return(sn.modes[n.mode]||sn.modes.nearest)(t,e,n)}function Br(t,e,n){return n!=="x"&&n!=="y"?t.inRange(e.x,e.y,"x",!0)||t.inRange(e.x,e.y,"y",!0):t.inRange(e.x,e.y,n,!0)}function Wr(t,e,n){return n==="x"?{x:t.x,y:e.y}:n==="y"?{x:e.x,y:t.y}:e}function et(t,e,n){return t.filter(u=>n.intersect?u.inRange(e.x,e.y):Br(u,e,n.axis))}function Hr(t,e,n){let u=Number.POSITIVE_INFINITY;return et(t,e,n).reduce((o,r)=>{const s=r.getCenterPoint(),a=Wr(e,s,n.axis),l=Nt(e,a);return lo._index-r._index).slice(0,1)}function be(t,e,n){const u=Math.cos(n),o=Math.sin(n),r=e.x,s=e.y;return{x:r+u*(t.x-r)-o*(t.y-s),y:s+o*(t.x-r)+u*(t.y-s)}}const Yr=(t,e)=>e>t||t.length>e.length&&t.slice(0,e.length)===e,fe=.001,ht=(t,e,n)=>Math.min(n,Math.max(e,t)),Jn=(t,e)=>t.value>=t.start-e&&t.value<=t.end+e;function Ur(t,e,n){for(const u of Object.keys(t))t[u]=ht(t[u],e,n);return t}function $r(t,e,n,u){return!t||!e||n<=0?!1:Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<=Math.pow(n+u,2)}function Zn(t,{x:e,y:n,x2:u,y2:o},r,{borderWidth:s,hitTolerance:a}){const l=(s+a)/2,c=t.x>=e-l-fe&&t.x<=u+l+fe,g=t.y>=n-l-fe&&t.y<=o+l+fe;return r==="x"?c:(r==="y"||c)&&g}function eu(t,{rect:e,center:n},u,{rotation:o,borderWidth:r,hitTolerance:s}){const a=be(t,n,H(-o));return Zn(a,e,u,{borderWidth:r,hitTolerance:s})}function me(t,e){const{centerX:n,centerY:u}=t.getProps(["centerX","centerY"],e);return{x:n,y:u}}function Xr(t,e,n,u=!0){const o=n.split(".");let r=0;for(const s of e.split(".")){const a=o[r++];if(parseInt(s,10)typeof t=="string"&&t.endsWith("%"),nu=t=>parseFloat(t)/100,uu=t=>ht(nu(t),0,1),Oe=(t,e)=>({x:t,y:e,x2:t,y2:e,width:0,height:0}),qr={box:t=>Oe(t.centerX,t.centerY),doughnutLabel:t=>Oe(t.centerX,t.centerY),ellipse:t=>({centerX:t.centerX,centerY:t.centerX,radius:0,width:0,height:0}),label:t=>Oe(t.centerX,t.centerY),line:t=>Oe(t.x,t.y),point:t=>({centerX:t.centerX,centerY:t.centerY,radius:0,width:0,height:0}),polygon:t=>Oe(t.centerX,t.centerY)};function $t(t,e){return e==="start"?0:e==="end"?t:tu(e)?uu(e)*t:t/2}function K(t,e,n=!0){return typeof e=="number"?e:tu(e)?(n?uu(e):nu(e))*t:t}function Gr(t,e){const{x:n,width:u}=t,o=e.textAlign;return o==="center"?n+u/2:o==="end"||o==="right"?n+u:n}function ru(t,e,{borderWidth:n,position:u,xAdjust:o,yAdjust:r},s){const a=we(s),l=e.width+(a?s.width:0)+n,c=e.height+(a?s.height:0)+n,g=Xt(u),p=an(t.x,l,o,g.x),C=an(t.y,c,r,g.y);return{x:p,y:C,x2:p+l,y2:C+c,width:l,height:c,centerX:p+l/2,centerY:C+c/2}}function Xt(t,e="center"){return we(t)?{x:Ve(t.x,e),y:Ve(t.y,e)}:(t=Ve(t,e),{x:t,y:t})}const ou=(t,e)=>t&&t.autoFit&&e<1;function su(t,e){const n=t.font,u=Ie(n)?n:[n];return ou(t,e)?u.map(function(o){const r=At(o);return r.size=Math.floor(o.size*e),r.lineHeight=o.lineHeight,At(r)}):u.map(o=>At(o))}function iu(t){return t&&(B(t.xValue)||B(t.yValue))}function an(t,e,n=0,u){return t-$t(e,u)+n}function Re(t,e,n){const u=n.init;if(u){if(u===!0)return lu(e,n)}else return;return Qr(t,e,n)}function au(t,e,n){let u=!1;return e.forEach(o=>{ve(t[o])?(u=!0,n[o]=t[o]):B(n[o])&&delete n[o]}),u}function lu(t,e){const n=e.type||"line";return qr[n](t)}function Qr(t,e,n){const u=Vt(n.init,[{chart:t,properties:e,options:n}]);if(u===!0)return lu(e,n);if(we(u))return u}const _t=new Map,Kr=t=>isNaN(t)||t<=0,Jr=t=>t.reduce(function(e,n){return e+=n.string,e},"");function ft(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object HTMLImageElement]"||e==="[object HTMLCanvasElement]"}}function gt(t,{x:e,y:n},u){u&&(t.translate(e,n),t.rotate(H(u)),t.translate(-e,-n))}function W(t,e){if(e&&e.borderWidth)return t.lineCap=e.borderCapStyle||"butt",t.setLineDash(e.borderDash),t.lineDashOffset=e.borderDashOffset,t.lineJoin=e.borderJoinStyle||"miter",t.lineWidth=e.borderWidth,t.strokeStyle=e.borderColor,!0}function Ee(t,e){t.shadowColor=e.backgroundShadowColor,t.shadowBlur=e.shadowBlur,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY}function Ct(t,e){const n=e.content;if(ft(n))return{width:K(n.width,e.width),height:K(n.height,e.height)};const u=su(e),o=e.textStrokeWidth,r=Ie(n)?n:[n],s=r.join()+Jr(u)+o+(t._measureText?"-spriting":"");return _t.has(s)||_t.set(s,no(t,r,u,o)),_t.get(s)}function cu(t,e,n){const{x:u,y:o,width:r,height:s}=e;t.save(),Ee(t,n);const a=W(t,n);t.fillStyle=n.backgroundColor,t.beginPath(),rr(t,{x:u,y:o,w:r,h:s,radius:Ur(or(n.borderRadius),0,Math.min(r,s)/2)}),t.closePath(),t.fill(),a&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore()}function du(t,e,n,u){const o=n.content;if(ft(o)){t.save(),t.globalAlpha=oo(n.opacity,o.style.opacity),t.drawImage(o,e.x,e.y,e.width,e.height),t.restore();return}const r=Ie(o)?o:[o],s=su(n,u),a=n.color,l=Ie(a)?a:[a],c=Gr(e,n),g=e.y+n.textStrokeWidth/2;t.save(),t.textBaseline="middle",t.textAlign=n.textAlign,Zr(t,n)&&uo(t,{x:c,y:g},r,s),ro(t,{x:c,y:g},r,{fonts:s,colors:l}),t.restore()}function Zr(t,e){if(e.textStrokeWidth>0)return t.lineJoin="round",t.miterLimit=2,t.lineWidth=e.textStrokeWidth,t.strokeStyle=e.textStrokeColor,!0}function eo(t,e,n,u){const{radius:o,options:r}=e,s=r.pointStyle,a=r.rotation;let l=(a||0)*Wn;if(ft(s)){t.save(),t.translate(n,u),t.rotate(l),t.drawImage(s,-s.width/2,-s.height/2,s.width,s.height),t.restore();return}Kr(o)||to(t,{x:n,y:u,radius:o,rotation:a,style:s,rad:l})}function to(t,{x:e,y:n,radius:u,rotation:o,style:r,rad:s}){let a,l,c,g;switch(t.beginPath(),r){default:t.arc(e,n,u,0,Yn),t.closePath();break;case"triangle":t.moveTo(e+Math.sin(s)*u,n-Math.cos(s)*u),s+=nn,t.lineTo(e+Math.sin(s)*u,n-Math.cos(s)*u),s+=nn,t.lineTo(e+Math.sin(s)*u,n-Math.cos(s)*u),t.closePath();break;case"rectRounded":g=u*.516,c=u-g,a=Math.cos(s+Pe)*c,l=Math.sin(s+Pe)*c,t.arc(e-a,n-l,g,s-D,s-Ge),t.arc(e+l,n-a,g,s-Ge,s),t.arc(e+a,n+l,g,s,s+Ge),t.arc(e-l,n+a,g,s+Ge,s+D),t.closePath();break;case"rect":if(!o){c=Math.SQRT1_2*u,t.rect(e-c,n-c,2*c,2*c);break}s+=Pe;case"rectRot":a=Math.cos(s)*u,l=Math.sin(s)*u,t.moveTo(e-a,n-l),t.lineTo(e+l,n-a),t.lineTo(e+a,n+l),t.lineTo(e-l,n+a),t.closePath();break;case"crossRot":s+=Pe;case"cross":a=Math.cos(s)*u,l=Math.sin(s)*u,t.moveTo(e-a,n-l),t.lineTo(e+a,n+l),t.moveTo(e+l,n-a),t.lineTo(e-l,n+a);break;case"star":a=Math.cos(s)*u,l=Math.sin(s)*u,t.moveTo(e-a,n-l),t.lineTo(e+a,n+l),t.moveTo(e+l,n-a),t.lineTo(e-l,n+a),s+=Pe,a=Math.cos(s)*u,l=Math.sin(s)*u,t.moveTo(e-a,n-l),t.lineTo(e+a,n+l),t.moveTo(e+l,n-a),t.lineTo(e-l,n+a);break;case"line":a=Math.cos(s)*u,l=Math.sin(s)*u,t.moveTo(e-a,n-l),t.lineTo(e+a,n+l);break;case"dash":t.moveTo(e,n),t.lineTo(e+Math.cos(s)*u,n+Math.sin(s)*u);break}t.fill()}function no(t,e,n,u){t.save();const o=e.length;let r=0,s=u;for(let a=0;a0||o.borderWidth===0)&&(t.moveTo(l.x,l.y),t.lineTo(c.x,c.y)),t.moveTo(g.x,g.y),t.lineTo(p.x,p.y);const C=be({x:n,y:u},e.getCenterPoint(),H(-e.rotation));t.lineTo(C.x,C.y),t.stroke(),t.restore()}function io(t,e){const{x:n,y:u,x2:o,y2:r}=t,s=ao(t,e);let a,l;return e==="left"||e==="right"?(a={x:n+s,y:u},l={x:a.x,y:r}):(a={x:n,y:u+s},l={x:o,y:a.y}),{separatorStart:a,separatorEnd:l}}function ao(t,e){const{width:n,height:u,options:o}=t,r=o.callout.margin+o.borderWidth/2;return e==="right"?n+r:e==="bottom"?u+r:-r}function lo(t,e,n){const{y:u,width:o,height:r,options:s}=t,a=s.callout.start,l=co(e,s.callout);let c,g;return e==="left"||e==="right"?(c={x:n.x,y:u+K(r,a)},g={x:c.x+l,y:c.y}):(c={x:n.x+K(o,a),y:n.y},g={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:g}}function co(t,e){const n=e.side;return t==="left"||t==="top"?-n:n}function ho(t,e){const n=e.position;return hu.includes(n)?n:fo(t,e)}function fo(t,e){const{x:n,y:u,x2:o,y2:r,width:s,height:a,pointX:l,pointY:c,centerX:g,centerY:p,rotation:C}=t,d={x:g,y:p},x=e.start,A=K(s,x),S=K(a,x),y=[n,n+A,n+A,o],m=[u+S,r,u,r],h=[];for(let j=0;j<4;j++){const f=be({x:y[j],y:m[j]},d,H(C));h.push({position:hu[j],distance:Nt(f,{x:l,y:c})})}return h.sort((j,f)=>j.distance-f.distance)[0].position}function go(t,e,n){const{pointX:u,pointY:o}=t,r=e.margin;let s=u,a=o;return n==="left"?s+=r:n==="right"?s-=r:n==="top"?a+=r:n==="bottom"&&(a-=r),t.inRange(s,a)}const ln={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function Te(t,e,n){return e=typeof e=="number"?e:t.parse(e),Hn(e)?t.getPixelForValue(e):n}function pe(t,e,n){const u=e[n];if(u||n==="scaleID")return u;const o=n.charAt(0),r=Object.values(t).filter(s=>s.axis&&s.axis===o);return r.length?r[0].id:o}function fu(t,e){if(t){const n=t.options.reverse,u=Te(t,e.min,n?e.end:e.start),o=Te(t,e.max,n?e.start:e.end);return{start:u,end:o}}}function gu(t,e){const{chartArea:n,scales:u}=t,o=u[pe(u,e,"xScaleID")],r=u[pe(u,e,"yScaleID")];let s=n.width/2,a=n.height/2;return o&&(s=Te(o,e.xValue,o.left+o.width/2)),r&&(a=Te(r,e.yValue,r.top+r.height/2)),{x:s,y:a}}function qt(t,e){const n=t.scales,u=n[pe(n,e,"xScaleID")],o=n[pe(n,e,"yScaleID")];if(!u&&!o)return{};let{left:r,right:s}=u||t.chartArea,{top:a,bottom:l}=o||t.chartArea;const c=cn(u,{min:e.xMin,max:e.xMax,start:r,end:s});r=c.start,s=c.end;const g=cn(o,{min:e.yMin,max:e.yMax,start:l,end:a});return a=g.start,l=g.end,{x:r,y:a,x2:s,y2:l,width:s-r,height:l-a,centerX:r+(s-r)/2,centerY:a+(l-a)/2}}function Cu(t,e){if(!iu(e)){const n=qt(t,e);let u=e.radius;(!u||isNaN(u))&&(u=Math.min(n.width,n.height)/2,e.radius=u);const o=u*2,r=n.centerX+e.xAdjust,s=n.centerY+e.yAdjust;return{x:r-u,y:s-u,x2:r+u,y2:s+u,centerX:r,centerY:s,width:o,height:o,radius:u}}return po(t,e)}function Co(t,e){const{scales:n,chartArea:u}=t,o=n[e.scaleID],r={x:u.left,y:u.top,x2:u.right,y2:u.bottom};return o?yo(o,r,e):xo(n,r,e),r}function pu(t,e){const n=qt(t,e);return n.initProperties=Re(t,n,e),n.elements=[{type:"label",optionScope:"label",properties:Ao(t,n,e),initProperties:n.initProperties}],n}function po(t,e){const n=gu(t,e),u=e.radius*2;return{x:n.x-e.radius+e.xAdjust,y:n.y-e.radius+e.yAdjust,x2:n.x+e.radius+e.xAdjust,y2:n.y+e.radius+e.yAdjust,centerX:n.x+e.xAdjust,centerY:n.y+e.yAdjust,radius:e.radius,width:u,height:u}}function cn(t,e){const n=fu(t,e)||e;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function yo(t,e,n){const u=Te(t,n.value,NaN),o=Te(t,n.endValue,u);t.isHorizontal()?(e.x=u,e.x2=o):(e.y=u,e.y2=o)}function xo(t,e,n){for(const u of Object.keys(ln)){const o=t[pe(t,n,u)];if(o){const{min:r,max:s,start:a,end:l,startProp:c,endProp:g}=ln[u],p=fu(o,{min:n[r],max:n[s],start:o[a],end:o[l]});e[c]=p.start,e[g]=p.end}}}function bo({properties:t,options:e},n,u,o){const{x:r,x2:s,width:a}=t;return yu({start:r,end:s,borderWidth:e.borderWidth},{position:u.x,padding:{start:o.left,end:o.right},adjust:e.label.xAdjust,size:n.width})}function mo({properties:t,options:e},n,u,o){const{y:r,y2:s,height:a}=t;return yu({start:r,end:s,borderWidth:e.borderWidth},{position:u.y,padding:{start:o.top,end:o.bottom},adjust:e.label.yAdjust,size:n.height})}function yu(t,e){const{start:n,end:u,borderWidth:o}=t,{position:r,padding:{start:s,end:a},adjust:l}=e,c=u-o-n-s-a-e.size;return n+o/2+l+$t(c,r)}function Ao(t,e,n){const u=n.label;u.backgroundColor="transparent",u.callout.display=!1;const o=Xt(u.position),r=ct(u.padding),s=Ct(t.ctx,u),a=bo({properties:e,options:n},s,o,r),l=mo({properties:e,options:n},s,o,r),c=s.width+r.width,g=s.height+r.height;return{x:a,y:l,x2:a+c,y2:l+g,width:c,height:g,centerX:a+c/2,centerY:l+g/2,rotation:u.rotation}}const jt=["enter","leave"],Gt=jt.concat("click");function _o(t,e,n){e.listened=au(n,Gt,e.listeners),e.moveListened=!1,jt.forEach(u=>{ve(n[u])&&(e.moveListened=!0)}),(!e.listened||!e.moveListened)&&e.annotations.forEach(u=>{!e.listened&&ve(u.click)&&(e.listened=!0),e.moveListened||jt.forEach(o=>{ve(u[o])&&(e.listened=!0,e.moveListened=!0)})})}function So(t,e,n){if(t.listened)switch(e.type){case"mousemove":case"mouseout":return vo(t,e,n);case"click":return jo(t,e,n)}}function vo(t,e,n){if(!t.moveListened)return;let u;e.type==="mousemove"?u=Ut(t.visibleElements,e,n.interaction):u=[];const o=t.hovered;t.hovered=u;const r={state:t,event:e};let s=dn(r,"leave",o,u);return dn(r,"enter",u,o)||s}function dn({state:t,event:e},n,u,o){let r;for(const s of u)o.indexOf(s)<0&&(r=xu(s.options[n]||t.listeners[n],s,e)||r);return r}function jo(t,e,n){const u=t.listeners,o=Ut(t.visibleElements,e,n.interaction);let r;for(const s of o)r=xu(s.options.click||u.click,s,e)||r;return r}function xu(t,e,n){return Vt(t,[e.$context,n])===!0}const nt=["afterDraw","beforeDraw"];function wo(t,e,n){const u=e.visibleElements;e.hooked=au(n,nt,e.hooks),e.hooked||u.forEach(o=>{e.hooked||nt.forEach(r=>{ve(o.options[r])&&(e.hooked=!0)})})}function hn(t,e,n){if(t.hooked){const u=e.options[n]||t.hooks[n];return Vt(u,[e.$context])}}function Io(t,e,n){const u=Po(t.scales,e,n);let o=fn(e,u,"min","suggestedMin");o=fn(e,u,"max","suggestedMax")||o,o&&ve(e.handleTickRangeOptions)&&e.handleTickRangeOptions()}function To(t,e){for(const n of t)Eo(n,e)}function fn(t,e,n,u){if(Hn(e[n])&&!Ro(t.options,n,u)){const o=t[n]!==e[n];return t[n]=e[n],o}}function Ro(t,e,n){return B(t[e])||B(t[n])}function Eo(t,e){for(const n of["scaleID","xScaleID","yScaleID"]){const u=pe(e,t,n);u&&!e[u]&&ko(t,n)&&console.warn(`No scale found with id '${u}' for annotation '${t.id}'`)}}function ko(t,e){if(e==="scaleID")return!0;const n=e.charAt(0);for(const u of["Min","Max","Value"])if(B(t[n+u]))return!0;return!1}function Po(t,e,n){const u=e.axis,o=e.id,r=u+"ScaleID",s={min:Ve(e.min,Number.NEGATIVE_INFINITY),max:Ve(e.max,Number.POSITIVE_INFINITY)};for(const a of n)a.scaleID===o?gn(a,e,["value","endValue"],s):pe(t,a,r)===o&&gn(a,e,[u+"Min",u+"Max",u+"Value"],s);return s}function gn(t,e,n,u){for(const o of n){const r=t[o];if(B(r)){const s=e.parse(r);u.min=Math.min(u.min,s),u.max=Math.max(u.max,s)}}}class ke extends xe{inRange(e,n,u,o){const{x:r,y:s}=be({x:e,y:n},this.getCenterPoint(o),H(-this.options.rotation));return Zn({x:r,y:s},this.getProps(["x","y","x2","y2"],o),u,this.options)}getCenterPoint(e){return me(this,e)}draw(e){e.save(),gt(e,this.getCenterPoint(),this.options.rotation),cu(e,this,this.options),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,n){return pu(e,n)}}ke.id="boxAnnotation";ke.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance:0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};ke.defaultRoutes={borderColor:"color",backgroundColor:"color"};ke.descriptors={label:{_fallback:!0}};class pt extends xe{inRange(e,n,u,o){return eu({x:e,y:n},{rect:this.getProps(["x","y","x2","y2"],o),center:this.getCenterPoint(o)},u,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(e){return me(this,e)}draw(e){const n=this.options;!n.display||!n.content||(zo(e,this),e.save(),gt(e,this.getCenterPoint(),this.rotation),du(e,this,n,this._fitRatio),e.restore())}resolveElementProperties(e,n){const u=Oo(e,n);if(!u)return{};const{controllerMeta:o,point:r,radius:s}=Mo(e,n,u);let a=Ct(e.ctx,n);const l=Do(a,s);ou(n,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:g,yAdjust:p}=n,C=ru(r,a,{borderWidth:0,position:c,xAdjust:g,yAdjust:p});return{initProperties:Re(e,C,n),...C,...o,rotation:n.rotation,_fitRatio:l}}}pt.id="doughnutLabelAnnotation";pt.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0};pt.defaultRoutes={};function Oo(t,e){return t.getSortedVisibleDatasetMetas().reduce(function(n,u){const o=u.controller;return o instanceof sr&&Fo(t,e,u.data)&&(!n||o.innerRadius=90?u:n},void 0)}function Fo(t,e,n){if(!e.autoHide)return!0;for(let u=0;up,y=S?o+x:s-x,m=Lo(y,g,p,A);return{controllerMeta:{_centerX:g,_centerY:p,_radius:A,_counterclockwise:S,...m},point:d,radius:Math.min(a,Math.min(C.right-C.left,C.bottom-C.top)/2)}}function Do({width:t,height:e},n){const u=Math.sqrt(Math.pow(t,2)+Math.pow(e,2));return n*2/u}function Lo(t,e,n,u){const o=Math.pow(n-t,2),r=Math.pow(u,2),s=e*-2,a=Math.pow(e,2)+o-r,l=Math.pow(s,2)-4*a;if(l<=0)return{_startAngle:0,_endAngle:Yn};const c=(-s-Math.sqrt(l))/2,g=(-s+Math.sqrt(l))/2;return{_startAngle:rn({x:e,y:n},{x:c,y:t}).angle,_endAngle:rn({x:e,y:n},{x:g,y:t}).angle}}function zo(t,e){const{_centerX:n,_centerY:u,_radius:o,_startAngle:r,_endAngle:s,_counterclockwise:a,options:l}=e;t.save();const c=W(t,l);t.fillStyle=l.backgroundColor,t.beginPath(),t.arc(n,u,o,r,s,a),t.closePath(),t.fill(),c&&t.stroke(),t.restore()}class Ye extends xe{inRange(e,n,u,o){return eu({x:e,y:n},{rect:this.getProps(["x","y","x2","y2"],o),center:this.getCenterPoint(o)},u,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(e){return me(this,e)}draw(e){const n=this.options,u=!B(this._visible)||this._visible;!n.display||!n.content||!u||(e.save(),gt(e,this.getCenterPoint(),this.rotation),so(e,this),cu(e,this,n),du(e,No(this),n),e.restore())}resolveElementProperties(e,n){let u;if(iu(n))u=gu(e,n);else{const{centerX:a,centerY:l}=qt(e,n);u={x:a,y:l}}const o=ct(n.padding),r=Ct(e.ctx,n),s=ru(u,r,n,o);return{initProperties:Re(e,s,n),pointX:u.x,pointY:u.y,...s,rotation:n.rotation}}}Ye.id="labelAnnotation";Ye.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};Ye.defaultRoutes={borderColor:"color"};function No({x:t,y:e,width:n,height:u,options:o}){const r=o.borderWidth/2,s=ct(o.padding);return{x:t+s.left+r,y:e+s.top+r,width:n-s.left-s.right-o.borderWidth,height:u-s.top-s.bottom-o.borderWidth}}const Qt=(t,e,n)=>({x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}),wt=(t,e,n)=>Qt(e,n,Math.abs((t-e.y)/(n.y-e.y))).x,Cn=(t,e,n)=>Qt(e,n,Math.abs((t-e.x)/(n.x-e.x))).y,ze=t=>t*t,Vo=(t,e,{x:n,y:u,x2:o,y2:r},s)=>s==="y"?{start:Math.min(u,r),end:Math.max(u,r),value:e}:{start:Math.min(n,o),end:Math.max(n,o),value:t},pn=(t,e,n,u)=>(1-u)*(1-u)*t+2*(1-u)*u*e+u*u*n,It=(t,e,n,u)=>({x:pn(t.x,e.x,n.x,u),y:pn(t.y,e.y,n.y,u)}),yn=(t,e,n,u)=>2*(1-u)*(e-t)+2*u*(n-e),xn=(t,e,n,u)=>-Math.atan2(yn(t.x,e.x,n.x,u),yn(t.y,e.y,n.y,u))+.5*D;class Ue extends xe{inRange(e,n,u,o){const r=(this.options.borderWidth+this.options.hitTolerance)/2;if(u!=="x"&&u!=="y"){const s={mouseX:e,mouseY:n},{path:a,ctx:l}=this;if(a){W(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:g}=this.$context,p=e*g.currentDevicePixelRatio,C=n*g.currentDevicePixelRatio,d=l.isPointInStroke(a,p,C)||Tt(this,s,o);return l.restore(),d}const c=ze(r);return Yo(this,s,c,o)||Tt(this,s,o)}return Bo(this,{mouseX:e,mouseY:n},u,{hitSize:r,useFinalPosition:o})}getCenterPoint(e){return me(this,e)}draw(e){const{x:n,y:u,x2:o,y2:r,cp:s,options:a}=this;if(e.save(),!W(e,a))return e.restore();Ee(e,a);const l=Math.sqrt(Math.pow(o-n,2)+Math.pow(r-u,2));if(a.curve&&s)return Jo(e,this,s,l),e.restore();const{startOpts:c,endOpts:g,startAdjust:p,endAdjust:C}=bu(this),d=Math.atan2(r-u,o-n);e.translate(n,u),e.rotate(d),e.beginPath(),e.moveTo(0+p,0),e.lineTo(l-C,0),e.shadowColor=a.borderShadowColor,e.stroke(),Rt(e,0,p,c),Rt(e,l,-C,g),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,n){const u=Co(e,n),{x:o,y:r,x2:s,y2:a}=u,l=Wo(u,e.chartArea),c=l?Ho({x:o,y:r},{x:s,y:a},e.chartArea):{x:o,y:r,x2:s,y2:a,width:Math.abs(s-o),height:Math.abs(a-r)};if(c.centerX=(s+o)/2,c.centerY=(a+r)/2,c.initProperties=Re(e,c,n),n.curve){const p={x:c.x,y:c.y},C={x:c.x2,y:c.y2};c.cp=Ko(c,n,Nt(p,C))}const g=Uo(e,c,n.label);return g._visible=l,c.elements=[{type:"label",optionScope:"label",properties:g,initProperties:c.initProperties}],c}}Ue.id="lineAnnotation";const bn={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};Ue.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},bn),fill:!1,length:12,start:Object.assign({},bn),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},Ye.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};Ue.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}};Ue.defaultRoutes={borderColor:"color"};function Bo(t,{mouseX:e,mouseY:n},u,{hitSize:o,useFinalPosition:r}){const s=Vo(e,n,t.getProps(["x","y","x2","y2"],r),u);return Jn(s,o)||Tt(t,{mouseX:e,mouseY:n},r,u)}function Wo({x:t,y:e,x2:n,y2:u},{top:o,right:r,bottom:s,left:a}){return!(tr&&n>r||es&&u>s)}function mn({x:t,y:e},n,{top:u,right:o,bottom:r,left:s}){return to&&(e=Cn(o,{x:t,y:e},n),t=o),er&&(t=wt(r,{x:t,y:e},n),e=r),{x:t,y:e}}function Ho(t,e,n){const{x:u,y:o}=mn(t,e,n),{x:r,y:s}=mn(e,t,n);return{x:u,y:o,x2:r,y2:s,width:Math.abs(r-u),height:Math.abs(s-o)}}function Yo(t,{mouseX:e,mouseY:n},u=fe,o){const{x:r,y:s,x2:a,y2:l}=t.getProps(["x","y","x2","y2"],o),c=a-r,g=l-s,p=ze(c)+ze(g),C=p===0?-1:((e-r)*c+(n-s)*g)/p;let d,x;return C<0?(d=r,x=s):C>1?(d=a,x=l):(d=r+C*c,x=s+C*g),ze(e-d)+ze(n-x)<=u}function Tt(t,{mouseX:e,mouseY:n},u,o){const r=t.label;return r.options.display&&r.inRange(e,n,o,u)}function Uo(t,e,n){const u=n.borderWidth,o=ct(n.padding),r=Ct(t.ctx,n),s=r.width+o.width+u,a=r.height+o.height+u;return Xo(e,n,{width:s,height:a,padding:o},t.chartArea)}function $o(t){const{x:e,y:n,x2:u,y2:o}=t,r=Math.atan2(o-n,u-e);return r>D/2?r-D:r0&&(o.w/2+r.left-u.x)/s,c=a>0&&(o.h/2+r.top-u.y)/a;return ht(Math.max(l,c),0,.25)}function Qo(t,e){const{x:n,x2:u,y:o,y2:r}=t,s=Math.min(o,r)-e.top,a=Math.min(n,u)-e.left,l=e.bottom-Math.max(o,r),c=e.right-Math.max(n,u);return{x:Math.min(a,c),y:Math.min(s,l),dx:a<=c?1:-1,dy:s<=l?1:-1}}function _n(t,e){const{size:n,min:u,max:o,padding:r}=e,s=n/2;return n>o-u?(o+u)/2:(u>=t-r-s&&(t=u+r+s),o<=t+r+s&&(t=o-r-s),t)}function bu(t){const e=t.options,n=e.arrowHeads&&e.arrowHeads.start,u=e.arrowHeads&&e.arrowHeads.end;return{startOpts:n,endOpts:u,startAdjust:Sn(t,n),endAdjust:Sn(t,u)}}function Sn(t,e){if(!e||!e.display)return 0;const{length:n,width:u}=e,o=t.options.borderWidth/2,r={x:n,y:u+o};return Math.abs(wt(0,r,{x:0,y:o}))}function Rt(t,e,n,u){if(!u||!u.display)return;const{length:o,width:r,fill:s,backgroundColor:a,borderColor:l}=u,c=Math.abs(e-o)+n;t.beginPath(),Ee(t,u),W(t,u),t.moveTo(c,-r),t.lineTo(e+n,0),t.lineTo(c,r),s===!0?(t.fillStyle=a||l,t.closePath(),t.fill(),t.shadowColor="transparent"):t.shadowColor=u.borderShadowColor,t.stroke()}function Ko(t,e,n){const{x:u,y:o,x2:r,y2:s,centerX:a,centerY:l}=t,c=Math.atan2(s-o,r-u),g=Xt(e.controlPoint,0),p={x:a+K(n,g.x,!1),y:l+K(n,g.y,!1)};return be(p,{x:a,y:l},c)}function vn(t,{x:e,y:n},{angle:u,adjust:o},r){!r||!r.display||(t.save(),t.translate(e,n),t.rotate(u),Rt(t,0,-o,r),t.restore())}function Jo(t,e,n,u){const{x:o,y:r,x2:s,y2:a,options:l}=e,{startOpts:c,endOpts:g,startAdjust:p,endAdjust:C}=bu(e),d={x:o,y:r},x={x:s,y:a},A=xn(d,n,x,0),S=xn(d,n,x,1)-D,y=It(d,n,x,p/u),m=It(d,n,x,1-C/u),h=new Path2D;t.beginPath(),h.moveTo(y.x,y.y),h.quadraticCurveTo(n.x,n.y,m.x,m.y),t.shadowColor=l.borderShadowColor,t.stroke(h),e.path=h,e.ctx=t,vn(t,y,{angle:A,adjust:p},c),vn(t,m,{angle:S,adjust:C},g)}class $e extends xe{inRange(e,n,u,o){const r=this.options.rotation,s=(this.options.borderWidth+this.options.hitTolerance)/2;if(u!=="x"&&u!=="y")return Zo({x:e,y:n},this.getProps(["width","height","centerX","centerY"],o),r,s);const{x:a,y:l,x2:c,y2:g}=this.getProps(["x","y","x2","y2"],o),p=u==="y"?{start:l,end:g}:{start:a,end:c},C=be({x:e,y:n},this.getCenterPoint(o),H(-r));return C[u]>=p.start-s-fe&&C[u]<=p.end+s+fe}getCenterPoint(e){return me(this,e)}draw(e){const{width:n,height:u,centerX:o,centerY:r,options:s}=this;e.save(),gt(e,this.getCenterPoint(),s.rotation),Ee(e,this.options),e.beginPath(),e.fillStyle=s.backgroundColor;const a=W(e,s);e.ellipse(o,r,u/2,n/2,D/2,0,2*D),e.fill(),a&&(e.shadowColor=s.borderShadowColor,e.stroke()),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,n){return pu(e,n)}}$e.id="ellipseAnnotation";$e.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},ke.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};$e.defaultRoutes={borderColor:"color",backgroundColor:"color"};$e.descriptors={label:{_fallback:!0}};function Zo(t,e,n,u){const{width:o,height:r,centerX:s,centerY:a}=e,l=o/2,c=r/2;if(l<=0||c<=0)return!1;const g=H(n||0),p=Math.cos(g),C=Math.sin(g),d=Math.pow(p*(t.x-s)+C*(t.y-a),2),x=Math.pow(C*(t.x-s)-p*(t.y-a),2);return d/Math.pow(l+u,2)+x/Math.pow(c+u,2)<=1.0001}class yt extends xe{inRange(e,n,u,o){const{x:r,y:s,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],o),g=(this.options.borderWidth+this.options.hitTolerance)/2;return u!=="x"&&u!=="y"?$r({x:e,y:n},this.getCenterPoint(o),c/2,g):Jn(u==="y"?{start:s,end:l,value:n}:{start:r,end:a,value:e},g)}getCenterPoint(e){return me(this,e)}draw(e){const n=this.options,u=n.borderWidth;if(n.radius<.1)return;e.save(),e.fillStyle=n.backgroundColor,Ee(e,n);const o=W(e,n);eo(e,this,this.centerX,this.centerY),o&&!ft(n.pointStyle)&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore(),n.borderWidth=u}resolveElementProperties(e,n){const u=Cu(e,n);return u.initProperties=Re(e,u,n),u}}yt.id="pointAnnotation";yt.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};yt.defaultRoutes={borderColor:"color",backgroundColor:"color"};class xt extends xe{inRange(e,n,u,o){if(u!=="x"&&u!=="y")return this.options.radius>=.1&&this.elements.length>1&&ts(this.elements,e,n,o);const r=be({x:e,y:n},this.getCenterPoint(o),H(-this.options.rotation)),s=this.elements.map(c=>u==="y"?c.bY:c.bX),a=Math.min(...s),l=Math.max(...s);return r[u]>=a&&r[u]<=l}getCenterPoint(e){return me(this,e)}draw(e){const{elements:n,options:u}=this;e.save(),e.beginPath(),e.fillStyle=u.backgroundColor,Ee(e,u);const o=W(e,u);let r=!0;for(const s of n)r?(e.moveTo(s.x,s.y),r=!1):e.lineTo(s.x,s.y);e.closePath(),e.fill(),o&&(e.shadowColor=u.borderShadowColor,e.stroke()),e.restore()}resolveElementProperties(e,n){const u=Cu(e,n),{sides:o,rotation:r}=n,s=[],a=2*D/o;let l=r*Wn;for(let c=0;cn!=r.bY>n&&e<(r.bX-a.bX)*(n-a.bY)/(r.bY-a.bY)+a.bX&&(o=!o),r=a}return o}const q={box:ke,doughnutLabel:pt,ellipse:$e,label:Ye,line:Ue,point:yt,polygon:xt};Object.keys(q).forEach(t=>{lr.describe(`elements.${q[t].id}`,{_fallback:"plugins.annotation.common"})});const ns={update:Object.assign},us=Gt.concat(nt),jn=(t,e)=>we(e)?kt(t,e):t,Et=t=>t==="color"||t==="font";function Kt(t="line"){return q[t]?t:(console.warn(`Unknown annotation type: '${t}', defaulting to 'line'`),"line")}function rs(t,e,n,u){const o=ss(t,n.animations,u),r=e.annotations,s=ls(e.elements,r);for(let a=0;ajn(s,o)):n[u]=jn(r,o)}return n}function as(t,e,n,u){return e.$context||(e.$context=Object.assign(Object.create(t.getContext()),{element:e,get elements(){return n.filter(o=>o&&o.options)},id:u.id,type:"annotation"}))}function ls(t,e){const n=e.length,u=t.length;if(un&&t.splice(n,u-n);return t}var cs="3.1.0";const U=new Map,wn=t=>t.type!=="doughnutLabel",ds=Gt.concat(nt);var hs={id:"annotation",version:cs,beforeRegister(){Xr("chart.js","4.0",X.version)},afterRegister(){X.register(q)},afterUnregister(){X.unregister(q)},beforeInit(t){U.set(t,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(t,e,n){const u=U.get(t),o=u.annotations=[];let r=n.annotations;we(r)?Object.keys(r).forEach(s=>{const a=r[s];we(a)&&(a.id=s,o.push(a))}):Ie(r)&&o.push(...r),To(o.filter(wn),t.scales)},afterDataLimits(t,e){const n=U.get(t);Io(t,e.scale,n.annotations.filter(wn).filter(u=>u.display&&u.adjustScaleRange))},afterUpdate(t,e,n){const u=U.get(t);_o(t,u,n),rs(t,u,n,e.mode),u.visibleElements=u.elements.filter(o=>!o.skip&&o.options.display),wo(t,u,n)},beforeDatasetsDraw(t,e,n){Fe(t,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(t,e,n){Fe(t,"afterDatasetsDraw",n.clip)},beforeDatasetDraw(t,e,n){Fe(t,e.index,n.clip)},beforeDraw(t,e,n){Fe(t,"beforeDraw",n.clip)},afterDraw(t,e,n){Fe(t,"afterDraw",n.clip)},beforeEvent(t,e,n){const u=U.get(t);So(u,e.event,n)&&(e.changed=!0)},afterDestroy(t){U.delete(t)},getAnnotations(t){const e=U.get(t);return e?e.elements:[]},_getAnnotationElementsAtEventForMode(t,e,n){return Ut(t,e,n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:t=>!ds.includes(t)&&t!=="init",annotations:{_allKeys:!1,_fallback:(t,e)=>`elements.${q[Kt(e.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Et,_fallback:!0},_indexable:Et}},additionalOptionScopes:[""]};function Fe(t,e,n){const{ctx:u,chartArea:o}=t,r=U.get(t);n&&nr(u,o);const s=fs(r.visibleElements,e).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of s)gs(u,o,r,a);n&&ur(u)}function fs(t,e){const n=[];for(const u of t)if(u.options.drawTime===e&&n.push({element:u,main:!0}),u.elements&&u.elements.length)for(const o of u.elements)o.options.display&&o.options.drawTime===e&&n.push({element:o});return n}function gs(t,e,n,u){const o=u.element;u.main?(hn(n,o,"beforeDraw"),o.draw(t,e),hn(n,o,"afterDraw")):o.draw(t,e)}X.register(hs);const Cs=()=>{const[,,t,e,n,u]=v.useContext(vt),o=ye(),[r,s]=v.useState([]),[a,l]=v.useState([]),[c,g]=v.useState(null),[p]=v.useContext(vt);v.useEffect(()=>{const y=Ne().format("YYYY-MM-DD");e(y),u(y)},[e,u]);const C=y=>(_()==="AdminX"?Se:_()==="SuperAdmin"?Pt:_()==="CityOperator"?Ot:_()==="ProvinceOperator"?Ft:_()==="VetSupervisor"?Mt:_()==="Commerce"?Dt:_()==="ProvinceSupervisor"?Lt:_()==="Observatory"?zt:Se)+(y==null?void 0:y.hatchings.join(",").toString())+"/"+(y==null?void 0:y.date),d=Uu({initialValues:{consumption_limit_type:"",killing_age_external_type:"",killing_age:"",time_frame_type:"all",consumption_limit:"",killing_age_internal_type:""},validationSchema:$u({consumption_limit_type:Ae().required("این گزینه الزامی است").typeError("لطفا فیلد را به درستی پر کنید!"),killing_age_external_type:Ae().required("این گزینه الزامی است").typeError("لطفا فیلد را به درستی پر کنید!"),consumption_limit:mt().required("این گزینه الزامی است").typeError("لطفا فیلد را به درستی پر کنید!"),killing_age:mt().when("killing_age_external_type",{is:"manual",then:mt().required("این گزینه الزامی است").typeError("لطفا فیلد را به درستی پر کنید!")}),ave_kill_age_select:Ae().when("ave_kill_age",{is:"behavior",then:Ae().required("این گزینه الزامی است").typeError("لطفا فیلد را به درستی پر کنید!")}),killing_age_internal_type:Ae().when("killing_age_external_type",{is:"poultry_ave_killing_age",then:Ae().required("این گزینه الزامی است").typeError("لطفا فیلد را به درستی پر کنید!")})}),onSubmit:y=>{let m={consumption_limit_type:y.consumption_limit_type,killing_age_external_type:y.killing_age_external_type,killing_age:y.killing_age_external_type==="manual"?y.killing_age:null,time_frame_type:y.time_frame_type,consumption_limit:y.consumption_limit,killing_age_internal_type:y.killing_age_external_type==="poultry_ave_killing_age"?y.killing_age_internal_type:null,date1:y.time_frame_type==="manual"?t:null,date2:y.time_frame_type==="manual"?n:null,role:_()};m=Object.fromEntries(Object.entries(m).filter(([h,j])=>j!==null)),o(Vr(m)).then(h=>{if(h.payload.error)p({vertical:"top",horizontal:"center",msg:h.payload.error,severity:"error"});else{g(S(h.payload.data,d.values.consumption_limit)),l(h.payload.data);const j=h.payload.data.map((f,w)=>{var O,F,E;return[w+1,je(f==null?void 0:f.date),(O=f==null?void 0:f.poultry)==null?void 0:O.toLocaleString(),(F=f==null?void 0:f.quantity)==null?void 0:F.toLocaleString(),(E=f==null?void 0:f.weight)==null?void 0:E.toLocaleString(),Array.isArray(f==null?void 0:f.age)?f.age.map((z,Y)=>z).join(" - "):f==null?void 0:f.age,i.jsx(In,{placement:"left",title:"جزئیات",children:i.jsx(de,{color:"primary",size:"small",onClick:()=>window.open(C(f),"_blank"),children:i.jsx(Xu,{})})},w)]});s(j)}})}}),x=()=>{let y={consumption_limit_type:d.values.consumption_limit_type,killing_age_external_type:d.values.killing_age_external_type,killing_age:d.values.killing_age_external_type==="manual"?d.values.killing_age:null,time_frame_type:d.values.time_frame_type,consumption_limit:d.values.consumption_limit,killing_age_internal_type:d.values.killing_age_external_type==="poultry_ave_killing_age"?d.values.killing_age_internal_type:null,date1:d.values.time_frame_type==="manual"?t:null,date2:d.values.time_frame_type==="manual"?n:null,role:_()};return y=Object.fromEntries(Object.entries(y).filter(([h,j])=>j!==null)),new URLSearchParams(y).toString()};v.useEffect(()=>{d.validateForm()},[]);const A={scales:{y:{beginAtZero:!0,min:0}},onClick:(y,m)=>{var h;if(m.length>0){const j=(h=m[0])==null?void 0:h.index;let f=C(a[j]);window.open(f,"_blank")}},plugins:{annotation:{annotations:{line1:{type:"line",yMin:d.values.consumption_limit,yMax:d.values.consumption_limit,borderColor:"red",borderWidth:2,borderDash:[5,5],label:{display:!0,content:"حد مصرف",position:"end",backgroundColor:"rgba(255, 99, 132, 0.8)",font:{size:14,weight:"bold"},padding:5}}}}}},S=(y,m)=>y!=null&&y.length?{labels:y==null?void 0:y.map(h=>je(h.date)),datasets:[{label:d.values.consumption_limit_type==="quantity"?"حجم موجودی (قطعه)":"وزن موجودی (کیلوگرم)",data:d.values.consumption_limit_type==="quantity"?y==null?void 0:y.map(h=>h.quantity):y==null?void 0:y.map(h=>h.weight),borderColor:"rgba(75, 192, 192, 1)",backgroundColor:"rgba(75, 192, 192, 0.2)",borderWidth:2,pointRadius:5,pointBackgroundColor:"yellow",pointHoverRadius:7,fill:!0,tension:.4}],annotations:{line1:{type:"line",yMin:m,yMax:m,borderColor:"rgba(255, 99, 132, 1)",borderWidth:3,borderDash:[5,5],label:{enabled:!0,content:"حد مصرف",position:"end",backgroundColor:"rgba(255, 99, 132, 0.8)",font:{size:14,weight:"bold"}}}}}:null;return i.jsxs(M,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",children:[i.jsxs(_e,{width:{xs:"100%",md:"80%"},sx:{p:3,borderRadius:2,boxShadow:2,bgcolor:"background.paper"},children:[i.jsx(P,{variant:"h6",color:"primary",sx:{mb:2,fontWeight:"bold"},children:"پیش بینی موجودی"}),i.jsxs(M,{container:!0,spacing:2,children:[i.jsx(M,{item:!0,xs:12,md:6,children:i.jsxs(Me,{fullWidth:!0,error:d.touched.consume_limit&&!!d.errors.consume_limit,children:[i.jsx(De,{children:"حد مصرف"}),i.jsxs(Le,{size:"small",name:"consumption_limit_type",value:d.values.consumption_limit_type,onChange:d.handleChange,onBlur:d.handleBlur,error:d.touched.consumption_limit_type&&!!d.errors.consumption_limit_type,children:[i.jsx(k,{value:"quantity",children:"قطعه"}),i.jsx(k,{value:"live_weight",children:"وزن زنده"}),i.jsx(k,{value:"carcassses_weight",children:"وزن لاشه"})]}),i.jsx(Xe,{children:d.touched.consumption_limit_type&&d.errors.consumption_limit_type})]})}),i.jsx(M,{item:!0,xs:12,md:6,children:d.values.consumption_limit_type&&i.jsx(xr,{size:"small",allowLeadingZeros:!0,thousandSeparator:",",id:"consumption_limit",name:"consumption_limit",label:d.values.consumption_limit_type==="quantity"?"تعداد (قطعه)":"وزن (کیلوگرم)",variant:"outlined",value:d.values.consumption_limit,onChange:d.handleChange,onBlur:d.handleBlur,error:d.touched.consumption_limit&&!!d.errors.consumption_limit,helperText:d.touched.consumption_limit&&d.errors.consumption_limit})}),i.jsx(M,{item:!0,xs:12,md:6,children:i.jsxs(Me,{fullWidth:!0,error:d.touched.killing_age_external_type&&!!d.errors.killing_age_external_type,children:[i.jsx(De,{children:"میانگین سن کشتار *"}),i.jsxs(Le,{size:"small",name:"killing_age_external_type",value:d.values.killing_age_external_type,onChange:d.handleChange,onBlur:d.handleBlur,children:[i.jsx(k,{value:"poultry_ave_killing_age",children:"رفتار سنی کشتار فارم ها"}),i.jsx(k,{value:"manual",children:"دستی"})]}),i.jsx(Xe,{children:d.touched.killing_age_external_type&&d.errors.killing_age_external_type})]})}),i.jsx(M,{item:!0,xs:12,md:6,children:d.values.killing_age_external_type&&i.jsx(i.Fragment,{children:d.values.killing_age_external_type==="poultry_ave_killing_age"?i.jsxs(Me,{fullWidth:!0,error:d.touched.killing_age_internal_type&&!!d.errors.killing_age_internal_type,children:[i.jsx(De,{children:"رفتار سنی کشتار"}),i.jsxs(Le,{size:"small",name:"killing_age_internal_type",value:d.values.killing_age_internal_type,onChange:d.handleChange,onBlur:d.handleBlur,children:[i.jsx(k,{value:"poultry",children:"بر اساس کشتار فارم ها"}),i.jsx(k,{value:"province",children:"بر اساس میانگین کشتار استانی"})]}),i.jsx(Xe,{children:d.touched.killing_age_internal_type&&d.errors.killing_age_internal_type})]}):i.jsx($,{size:"small",fullWidth:!0,id:"killing_age",label:"سن را وارد کنید",value:d.values.killing_age,onChange:d.handleChange,onBlur:d.handleBlur,error:d.touched.killing_age&&!!d.errors.killing_age,helperText:d.touched.killing_age&&d.errors.killing_age,variant:"outlined"})})}),i.jsx(M,{item:!0,xs:12,md:6,children:i.jsxs(Me,{fullWidth:!0,error:d.touched.time_frame_type&&!!d.errors.time_frame_type,children:[i.jsx(De,{children:"تاریخ پیش بینی *"}),i.jsxs(Le,{size:"small",name:"time_frame_type",value:d.values.time_frame_type,onChange:d.handleChange,onBlur:d.handleBlur,children:[i.jsx(k,{value:"all",children:"بدون بازه زمانی"}),i.jsx(k,{value:"manual",children:"انتخاب بازه زمانی"})]}),i.jsx(Xe,{children:d.touched.time_frame_type&&d.errors.time_frame_type})]})}),d.values.time_frame_type==="manual"&&i.jsxs(i.Fragment,{children:[i.jsx(M,{item:!0,xs:12,md:3,children:i.jsx(tt,{label:"از تاریخ",value:t,onChange:y=>e(Ne(y).format("YYYY-MM-DD")),renderInput:y=>i.jsx($,{size:"small",fullWidth:!0,...y})})}),i.jsx(M,{item:!0,xs:12,md:3,children:i.jsx(tt,{label:"تا تاریخ",value:n,onChange:y=>u(Ne(y).format("YYYY-MM-DD")),renderInput:y=>i.jsx($,{size:"small",fullWidth:!0,...y})})})]})]}),i.jsxs(_e,{sx:{mt:3,display:"flex",justifyContent:"center",gap:"10px"},children:[i.jsx(ge,{disabled:!d.isValid,variant:"contained",color:"primary",sx:{px:4,py:1.5,borderRadius:2},onClick:d.handleSubmit,children:"پیمایش"}),i.jsx(ge,{disabled:!d.isValid,variant:"contained",color:"success",sx:{px:4,py:1.5,borderRadius:2},onClick:()=>{p({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const y=x(),m=`${V.defaults.baseURL}poultry_hatching_prediction_chart_excel/?${y}`;window.location.href=m},children:"خروجی اکسل"})]})]}),i.jsx(M,{container:!0,xs:12,my:2,children:i.jsx(dt,{columns:["ردیف","تاریخ","تعداد مرغداران","حجم (قطعه)","وزن (کیلوگرم)","سن","عملیات"],data:r,title:"داده های تجمیعی",paginated:!0})}),c&&i.jsx(M,{container:!0,justifyContent:"center",xs:12,sx:{p:3,borderRadius:2,boxShadow:2,bgcolor:"background.paper",my:5},children:i.jsx(Be,{data:c,options:A})})]})},ps=()=>{const t=ye(),e=m=>{c(m.target.value)},[n,u]=v.useState([]),[o,r]=v.useState(0),[s,a]=v.useState(10),[l,c]=v.useState(""),[g,p]=v.useState(1),[C,d]=v.useState([]),x=async m=>{let h;t(G()),h=await V.get(`poultry_hatching_prediction/?search=filter&value=${l}&role=${_()}&page=${m}&page_size=${s}`),t(Q()),u(h.data.results),r(h.data.count)},A=m=>{x(m),p(m)},S=m=>{a(m),p(1)};v.useEffect(()=>{const m=n==null?void 0:n.map((h,j)=>{var f,w,O,F,E,z,Y,J,Z,ee,te,ne,ue,re,oe,N,se,ie,ae,le,ce,I,T;return[g===1?j+1:j+s*(g-1)+1,(f=h==null?void 0:h.poultry)==null?void 0:f.unitName,((w=h==null?void 0:h.poultry)==null?void 0:w.fullname)||"-",(F=(O=h==null?void 0:h.poultry)==null?void 0:O.killingAveAge)==null?void 0:F.toLocaleString(),(z=(E=h==null?void 0:h.poultry)==null?void 0:E.realKillingAveWeight)==null?void 0:z.toLocaleString(),(Y=h==null?void 0:h.period)==null?void 0:Y.toLocaleString(),je(h==null?void 0:h.date),(J=h==null?void 0:h.quantity)==null?void 0:J.toLocaleString(),(ee=(Z=h==null?void 0:h.generalInfo)==null?void 0:Z.age)==null?void 0:ee.toLocaleString(),(h==null?void 0:h.chickenBreed)||"-",(ne=(te=h==null?void 0:h.generalInfo)==null?void 0:te.totalQuantity)==null?void 0:ne.toLocaleString(),(re=(ue=h==null?void 0:h.generalInfo)==null?void 0:ue.totalWeight)==null?void 0:re.toLocaleString(),(N=(oe=h==null?void 0:h.generalInfo)==null?void 0:oe.provinceKillRequests)==null?void 0:N.toLocaleString(),(ie=(se=h==null?void 0:h.generalInfo)==null?void 0:se.provinceKillRequestsQuantity)==null?void 0:ie.toLocaleString(),(le=(ae=h==null?void 0:h.generalInfo)==null?void 0:ae.provinceKillRequestsWeight)==null?void 0:le.toLocaleString(),(ce=h==null?void 0:h.leftOver)==null?void 0:ce.toLocaleString(),Math.round(((I=h==null?void 0:h.poultry)==null?void 0:I.realKillingAveWeight)*(h==null?void 0:h.leftOver)).toLocaleString(),Math.round(((T=h==null?void 0:h.poultry)==null?void 0:T.realKillingAveWeight)*(h==null?void 0:h.leftOver)*.75).toLocaleString()]});d(m)},[n]),v.useEffect(()=>{x(1)},[t,s]);const y=async m=>{m.preventDefault(),t(G());try{const h=await V.get(`poultry_hatching_prediction/?role=${_()}&search=filter&value=${l}&page=1&page_size=${s}`);u(h.data.results),r(h.data.count),t(Q())}catch(h){console.error("Error fetching data:",h)}};return i.jsxs(b,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[i.jsx(b,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:i.jsx(b,{children:i.jsxs("form",{onSubmit:y,children:[i.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:e}),i.jsx(ge,{type:"submit",onClick:y,endIcon:i.jsx(Xn,{}),children:"جستجو"})]})})}),i.jsx(dt,{data:C,columns:["ردیف","نام واحد","مالک","میانگین سن کشتار","میانگین وزن کشتار","دوره","تاریخ جوجه ریزی","حجم جوجه ریزی","سن","نژاد","حجم کشتار شده","وزن کشتار شده","تخصیص بدون بار","حجم تخصیص بدون بار","وزن تخصیص بدون بار","مانده سالن (حجم)","مانده سالن (وزن زنده)","مانده سالن (وزن لاشه)"],handlePageChange:A,totalRows:o,page:g,perPage:s,handlePerRowsChange:S,title:"جوجه ریزی های فعال"})]})};var Jt={},ys=We;Object.defineProperty(Jt,"__esModule",{value:!0});var _u=Jt.default=void 0,xs=ys(He()),bs=i;_u=Jt.default=(0,xs.default)((0,bs.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward");const ms=()=>{var r,s,a,l,c,g,p,C,d,x,A,S,y,m;const t=ye(),[e,n]=v.useState([]),[u,o]=v.useState(!1);return v.useEffect(()=>{t(Nr()).then(h=>{n(h.payload.data)})},[t]),i.jsxs(b,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:[i.jsxs(b,{container:!0,mt:2,mb:4,isDashboard:!0,children:[i.jsx(dt,{noPagination:!0,isDashboard:!0,operation:i.jsx(In,{placement:"top",title:"نمایش جوجه ریزی های فعال",children:i.jsx(de,{color:"primary",onClick:()=>{o(!u)},children:u?i.jsx(_u,{}):i.jsx(br,{})})}),columns:["جوجه ریزی های فعال","حجم جوجه ریزی فعال","میانگین سنی","میانگین سن کشتار ","میانگین وزن کشتار ","حجم کشتار","وزن کشتار","تعداد بارها","حجم بارها","وزن بارها","تخصیص بدون بار","حجم تخصیص بدون بار","وزن تخصیص بدون بار","حجم مانده در سالن"],data:[[(r=e==null?void 0:e.hatchings)==null?void 0:r.toLocaleString(),(s=e==null?void 0:e.totalHatchingQuantity)==null?void 0:s.toLocaleString(),(a=e==null?void 0:e.aveNowAge)==null?void 0:a.toLocaleString(),(l=e==null?void 0:e.aveAge)==null?void 0:l.toLocaleString(),(c=e==null?void 0:e.aveWeight)==null?void 0:c.toLocaleString(),(g=e==null?void 0:e.totalQuantity)==null?void 0:g.toLocaleString(),(p=e==null?void 0:e.totalWeight)==null?void 0:p.toLocaleString(),(C=e==null?void 0:e.killHouseRequests)==null?void 0:C.toLocaleString(),(d=e==null?void 0:e.killHouseRequestsQuantity)==null?void 0:d.toLocaleString(),(x=e==null?void 0:e.provinceKillRequestsWeight)==null?void 0:x.toLocaleString(),(A=e==null?void 0:e.provinceKillRequests)==null?void 0:A.toLocaleString(),(S=e==null?void 0:e.provinceKillRequestsQuantity)==null?void 0:S.toLocaleString(),(y=e==null?void 0:e.provinceKillRequestsWeight)==null?void 0:y.toLocaleString(),(m=e==null?void 0:e.totalHatchingLeftOver)==null?void 0:m.toLocaleString()]],title:"خلاصه اطلاعات"}),i.jsx(mr,{children:u&&i.jsx(qu.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3},style:{width:"100%"},children:i.jsx(b,{container:!0,mt:2,justifyContent:"center",alignItems:"center",children:i.jsx(ps,{})})})})]}),i.jsx(Cs,{})]})},As=()=>{const{key:t,date:e}=Rn(),n=ye(),u=j=>{p(j.target.value)},[o,r]=v.useState([]),[s,a]=v.useState(0),[l,c]=v.useState(10),[g,p]=v.useState(""),[C,d]=v.useState(1),[x,A]=v.useState([]),S=async j=>{let f;n(G()),f=await V.get(`poultry_hatching_prediction/?search=filter&value=${g}&role=${_()}&page=${j}&page_size=${l}&hatching_list=${t}`),n(Q()),r(f.data.results),a(f.data.count)},y=j=>{S(j),d(j)},m=j=>{c(j),d(1)};v.useEffect(()=>{const j=o==null?void 0:o.map((f,w)=>{var O,F,E,z,Y,J,Z,ee,te,ne,ue,re,oe,N,se,ie,ae,le,ce,I,T,R,L;return[C===1?w+1:w+l*(C-1)+1,(O=f==null?void 0:f.poultry)==null?void 0:O.unitName,((F=f==null?void 0:f.poultry)==null?void 0:F.fullname)||"-",(z=(E=f==null?void 0:f.poultry)==null?void 0:E.killingAveAge)==null?void 0:z.toLocaleString(),(J=(Y=f==null?void 0:f.poultry)==null?void 0:Y.realKillingAveWeight)==null?void 0:J.toLocaleString(),(Z=f==null?void 0:f.period)==null?void 0:Z.toLocaleString(),je(f==null?void 0:f.date),(ee=f==null?void 0:f.quantity)==null?void 0:ee.toLocaleString(),(ne=(te=f==null?void 0:f.generalInfo)==null?void 0:te.age)==null?void 0:ne.toLocaleString(),(f==null?void 0:f.chickenBreed)||"-",(re=(ue=f==null?void 0:f.generalInfo)==null?void 0:ue.totalQuantity)==null?void 0:re.toLocaleString(),(N=(oe=f==null?void 0:f.generalInfo)==null?void 0:oe.totalWeight)==null?void 0:N.toLocaleString(),(ie=(se=f==null?void 0:f.generalInfo)==null?void 0:se.provinceKillRequests)==null?void 0:ie.toLocaleString(),(le=(ae=f==null?void 0:f.generalInfo)==null?void 0:ae.provinceKillRequestsQuantity)==null?void 0:le.toLocaleString(),(I=(ce=f==null?void 0:f.generalInfo)==null?void 0:ce.provinceKillRequestsWeight)==null?void 0:I.toLocaleString(),(T=f==null?void 0:f.leftOver)==null?void 0:T.toLocaleString(),Math.round(((R=f==null?void 0:f.poultry)==null?void 0:R.realKillingAveWeight)*(f==null?void 0:f.leftOver)).toLocaleString(),Math.round(((L=f==null?void 0:f.poultry)==null?void 0:L.realKillingAveWeight)*(f==null?void 0:f.leftOver)*.75).toLocaleString()]});A(j)},[o]),v.useEffect(()=>{S(1)},[n,l]);const h=async j=>{j.preventDefault(),n(G());try{const f=await V.get(`poultry_hatching_prediction/?role=${_()}&search=filter&value=${g}&page=1&page_size=${l}&hatching_list=${t}`);r(f.data.results),a(f.data.count),n(Q())}catch(f){console.error("Error fetching data:",f)}};return i.jsxs(b,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,mt:2,children:[i.jsx(b,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:i.jsx(b,{children:i.jsxs("form",{onSubmit:h,children:[i.jsx($,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:u}),i.jsx(ge,{type:"submit",onClick:h,endIcon:i.jsx(Xn,{}),children:"جستجو"})]})})}),i.jsx(dt,{data:x,columns:["ردیف","نام واحد","مالک","میانگین سن کشتار","میانگین وزن کشتار","دوره","تاریخ جوجه ریزی","حجم جوجه ریزی","سن","نژاد","حجم کشتار شده","وزن کشتار شده","تخصیص بدون بار","حجم تخصیص بدون بار","وزن تخصیص بدون بار","مانده سالن (حجم)","مانده سالن (وزن زنده)","مانده سالن (وزن لاشه)"],handlePageChange:y,totalRows:s,page:C,perPage:l,handlePerRowsChange:m,title:`جزئیات پایش اطلاعات تاریخ ${je(e)}`})]})},Su=ut("VISORS_GET_NATIONAL_iNFO",async(t,{dispatch:e})=>{e(G());const{data:n,status:u}=await V.get("https://rsibackend.rasadyar.com/app/hatching-analysis-"+t.type,{params:{date1:t.withDate?t.selectedDate1:null,date2:t.withDate?t.selectedDate2:null,province:t.selectedProvince?t.selectedProvince:null}});return e(Q()),{data:n,status:u}});X.register(Un,at,lt,rt,ot,st,it,$n);const _s=({selectedProvince:t,selectedDate1:e,selectedDate2:n,withDate:u})=>{var l,c,g,p,C;const o=ye(),[r,s]=v.useState({});v.useEffect(()=>{o(Su({selectedProvince:t,selectedDate1:e,selectedDate2:n,withDate:u,type:"province"})).then(d=>{s(d.payload.data)})},[o,t,e,n,u]);const a=(d,x)=>{if(d){if(x==="sum-hatching")return[{name:"حجم جوجه ریزی",data:d==null?void 0:d.map(S=>(S==null?void 0:S.chickSum)||0)}];if(x==="average-age")return[{name:"میانگین سنی",data:d==null?void 0:d.map(S=>(S==null?void 0:S.averageAge)||0)}];if(x==="evacuation")return[{name:"درصد تلفات",data:d==null?void 0:d.map(S=>(S==null?void 0:S.evacuationHatching)||0)}];if(x==="leftover")return[{name:"باقیمانده",data:d==null?void 0:d.map(S=>(S==null?void 0:S.leftOver)||0)}];if(x==="sum-transport")return[{name:"حجم کشتار",data:d==null?void 0:d.map(S=>(S==null?void 0:S.goodAmount)||0)}]}else return null};return i.jsx(b,{xs:12,container:!0,justifyContent:"center",alignItems:"center",spacing:4,style:{width:"100%"},children:r&&i.jsxs(i.Fragment,{children:[i.jsx(b,{item:!0,xs:12,justifyContent:"center",alignItems:"center",height:"700px",children:i.jsx(he,{title:"حجم جوجه ریزی",type:"bar",group:!0,seperator:(l=r==null?void 0:r.provinceHatchingSum)==null?void 0:l.map(d=>d.ProvinceName),info:a(r==null?void 0:r.provinceHatchingSum,"sum-hatching")})}),i.jsx(b,{item:!0,xs:6,justifyContent:"center",alignItems:"center",height:"700px",children:i.jsx(he,{title:"میانگین سنی",type:"bar",group:!0,seperator:(c=r==null?void 0:r.provinceNameAverageAge)==null?void 0:c.map(d=>d.ProvinceName),info:a(r==null?void 0:r.provinceNameAverageAge,"average-age")})}),i.jsx(b,{item:!0,xs:6,justifyContent:"center",alignItems:"center",height:"700px",children:i.jsx(he,{title:"درصد تلفات هر استان",type:"bar",group:!0,seperator:(g=r==null?void 0:r.provinceEvacuationHatchingPercent)==null?void 0:g.map(d=>d.ProvinceName),info:a(r==null?void 0:r.provinceEvacuationHatchingPercent,"evacuation")})}),i.jsx(b,{item:!0,xs:12,justifyContent:"center",alignItems:"center",height:"700px",children:i.jsx(he,{title:"حجم باقیمانده",type:"bar",group:!0,seperator:(p=r==null?void 0:r.provinceNameLeftover)==null?void 0:p.map(d=>d.ProvinceName),info:a(r==null?void 0:r.provinceNameLeftover,"leftover")})}),i.jsx(b,{item:!0,xs:12,justifyContent:"center",alignItems:"center",height:"700px",children:i.jsx(he,{title:"مجموع حجم کشتار",type:"line",group:!0,seperator:(C=r==null?void 0:r.provinceSumTransporting)==null?void 0:C.map(d=>d.ProvinceName),info:a(r==null?void 0:r.provinceSumTransporting,"sum-transport")})})]})})};X.register(Un,at,lt,rt,ot,st,it,$n);const Ss=({selectedProvince:t,selectedDate1:e,selectedDate2:n,withDate:u})=>{var C,d;const o=ye(),[r,s]=v.useState({});v.useEffect(()=>{o(Su({selectedProvince:t,selectedDate1:e,selectedDate2:n,withDate:u,type:"pedigree"})).then(x=>{s(x.payload.data)})},[o,t,e,n,u]);const a=x=>{var S,y,m,h,j,f;let A;switch(x){case"average-age":A={labels:(S=r==null?void 0:r.pedigreeNameAverageAge)==null?void 0:S.map(w=>w==null?void 0:w.PedigreeName),chartList:(y=r==null?void 0:r.pedigreeNameAverageAge)==null?void 0:y.map(w=>w==null?void 0:w.averageAge)};break;case"hatching-sum":A={labels:(m=r==null?void 0:r.pedigreeNameHatchingSum)==null?void 0:m.map(w=>w==null?void 0:w.PedigreeName),chartList:(h=r==null?void 0:r.pedigreeNameHatchingSum)==null?void 0:h.map(w=>w==null?void 0:w.chickSum)};break;case"hatching-count":A={labels:(j=r==null?void 0:r.pedigreeNameHatchingCount)==null?void 0:j.map(w=>w==null?void 0:w.PedigreeName),chartList:(f=r==null?void 0:r.pedigreeNameHatchingCount)==null?void 0:f.map(w=>w==null?void 0:w.chickCount)};break}if(x==="hatching-sum"){const w=["rgba(255, 99, 132, 0.7)","rgba(54, 162, 235, 0.7)","rgba(255, 206, 86, 0.7)","rgba(75, 192, 192, 0.7)","rgba(153, 102, 255, 0.7)","rgba(255, 159, 64, 0.7)"];return{labels:A==null?void 0:A.labels,datasets:[{data:A==null?void 0:A.chartList,backgroundColor:w,borderColor:"#fff",borderWidth:2,hoverOffset:10}]}}return{labels:A==null?void 0:A.labels,datasets:[{label:x==="hatching-count"?"تعداد":"سن",data:A==null?void 0:A.chartList,borderColor:"#3A3A3A",backgroundColor:"rgba(16, 185, 129, 0.1)",borderWidth:2,tension:.3,pointRadius:0,pointHoverRadius:6,pointBackgroundColor:"#3A3A3A",pointHoverBackgroundColor:"#3A3A3A",fill:!0}]}},l={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1,rtl:!0,labels:{usePointStyle:!0,padding:20,font:{family:"iranyekan",size:14}}},tooltip:{mode:"index",intersect:!1,backgroundColor:"#1E293B",titleFont:{family:"iranyekan",size:14,weight:"bold"},bodyFont:{family:"iranyekan",size:12},padding:12,cornerRadius:8,displayColors:!0,rtl:!0}},scales:{x:{grid:{display:!1,drawBorder:!1},ticks:{color:"#64748B",font:{family:"iranyekan",size:12}}},y:{grid:{display:!1,drawBorder:!1},ticks:{color:"#64748B",font:{family:"iranyekan",size:11},padding:10}}},interaction:{mode:"nearest",axis:"x",intersect:!1}},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"right",rtl:!0,labels:{usePointStyle:!0,padding:20,font:{family:"iranyekan",size:14}}},tooltip:{backgroundColor:"#1E293B",titleFont:{family:"iranyekan",size:14,weight:"bold"},bodyFont:{family:"iranyekan",size:12},padding:12,cornerRadius:8,displayColors:!0,rtl:!0}},cutout:"70%"},g=x=>{if(x){const A=new Set;return x.forEach(m=>{m.breeds.forEach(h=>{A.add(h.pedigree)})}),Array.from(A).map(m=>{const h=x.map(j=>{const f=j.breeds.find(w=>w.pedigree===m);return f?f.hatchingSum:0});return{name:m,data:h}})}else return null},p=x=>x?[{name:"درصد تلفات نسبت به جوجه ریزی نژاد",data:x==null?void 0:x.map(A=>A.pedigree)},{name:"درصد تلفات نسبت به کل جوجه ریزی",data:x==null?void 0:x.map(A=>A.total)}]:null;return i.jsxs(b,{xs:12,container:!0,justifyContent:"center",alignItems:"center",spacing:4,style:{width:"100%"},children:[i.jsxs(b,{item:!0,xs:12,sm:6,justifyContent:"center",alignItems:"center",children:[i.jsx(P,{mt:2,mb:2,variant:"body2",children:"میانگین سنی کشتار"}),i.jsx(_e,{sx:{p:"24px",borderRadius:2,height:"300px",background:"linear-gradient(180deg,rgba(255, 255, 255, 1) 0%, rgba(230, 250, 245, 1) 50%, rgba(230, 241, 253, 1) 100%)"},children:i.jsx(Be,{data:a("average-age"),options:l})})]}),i.jsxs(b,{item:!0,xs:12,sm:6,justifyContent:"center",alignItems:"center",children:[i.jsx(P,{mt:2,mb:2,variant:"body2",children:"حجم جوجه ریزی"}),i.jsx(_e,{sx:{p:"24px",borderRadius:2,height:"300px",background:"linear-gradient(180deg,rgba(255, 255, 255, 1) 0%, rgba(230, 250, 245, 1) 50%, rgba(230, 241, 253, 1) 100%)"},children:i.jsx(cr,{data:a("hatching-sum"),options:c})})]}),r&&i.jsx(b,{item:!0,xs:12,justifyContent:"center",alignItems:"center",height:"700px",children:i.jsx(he,{title:"جوجه ریزی براساس نژاد",type:"bar",group:!0,seperator:(C=r==null?void 0:r.provinceResult)==null?void 0:C.map(x=>x.province),info:g(r==null?void 0:r.provinceResult)})}),i.jsxs(b,{item:!0,xs:6,justifyContent:"center",alignItems:"center",children:[i.jsx(P,{mt:2,mb:2,variant:"body2",children:"تعداد جوجه ریزی"}),i.jsx(_e,{sx:{p:"24px",borderRadius:2,height:"400px",background:"linear-gradient(180deg,rgba(255, 255, 255, 1) 0%, rgba(230, 250, 245, 1) 50%, rgba(230, 241, 253, 1) 100%)"},children:i.jsx(Be,{data:a("hatching-count"),options:l})})]}),i.jsx(b,{item:!0,xs:6,justifyContent:"center",alignItems:"center",children:i.jsx(b,{item:!0,xs:12,justifyContent:"center",alignItems:"center",height:"700px",children:i.jsx(he,{title:"میزان تلفات به ازای هر نژاد",type:"bar",group:!0,seperator:(d=r==null?void 0:r.pedigreeEvacuationHatchingPercent)==null?void 0:d.map(x=>x.pedigreeName),info:p(r==null?void 0:r.pedigreeEvacuationHatchingPercent)})})})]})};X.register(rt,ot,st,it,Bn,at,lt);const vs=()=>{const[,,t,e,n,u]=v.useContext(vt),[o,r]=v.useState("breed"),[s,a]=v.useState(!1),[l,c]=v.useState(""),g=(C,d)=>{r(d)},p=()=>[{name:"همه"},...Ar()];return i.jsxs(b,{container:!0,xs:12,justifyContent:"center",alignItems:"center",mb:4,children:[i.jsx(b,{container:!0,xs:12,justifyContent:"center",alignItems:"center",children:i.jsxs(Pu,{value:o,onChange:g,"aria-label":"simple tabs example",scrollButtons:"auto",variant:"scrollable",allowScrollButtonsMobile:!0,children:[i.jsx(qe,{value:"breed",label:"نژاد"}),i.jsx(qe,{value:"national",label:"کشور"}),i.jsx(qe,{disabled:!0,value:"killing",label:"کشتار"}),i.jsx(qe,{disabled:!0,value:"age",label:"سن"})]})}),i.jsx(b,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,mt:2,children:i.jsxs(b,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"10px",borderRadius:"15px",borderColor:"#E6F1FD",justifyContent:"left"},alignItems:"center",children:[i.jsx(b,{minWidth:210,children:i.jsx(Ou,{size:"small",disablePortal:!0,id:"hatching",options:p().map(C=>({label:C.name})),onChange:(C,d)=>{d.label!=="همه"?c(d.label):c("")},renderInput:C=>i.jsx($,{...C,label:"انتخاب استان"})})}),i.jsx(b,{container:!0,justifyContent:"center",alignItems:"center",children:i.jsx(St,{icon:i.jsx(_r,{}),checkedIcon:i.jsx(Sr,{}),checked:s,onChange:()=>a(!s),color:"primary",size:"large"})}),i.jsx(b,{children:i.jsx(tt,{disabled:!s,label:"از تاریخ",id:"date",renderInput:C=>i.jsx($,{size:"small",style:{width:"160px"},...C}),value:t,onChange:C=>{e(Ne(C).format("YYYY-MM-DD"))}})}),i.jsx(b,{children:i.jsx(tt,{disabled:!s,label:"تا تاریخ",id:"date",renderInput:C=>i.jsx($,{size:"small",style:{width:"160px"},...C}),value:n,onChange:C=>{u(Ne(C).format("YYYY-MM-DD"))}})})]})}),!1,o==="breed"&&i.jsx(Ss,{selectedProvince:l,selectedDate1:t,selectedDate2:n,withDate:s}),o==="national"&&i.jsx(_s,{selectedProvince:l,selectedDate1:t,selectedDate2:n,withDate:s})]})},Gs=()=>{const{key:t}=Rn(),e=r=>{const s=[Je,kn,Pn,On,Fn,Mn,Dn,En],a=[Se,Ot,Ft,Mt,Dt,Lt,zt,Pt],l=[Ze,zn,Nn,Vn];return s.includes(r)?i.jsx(Lr,{}):l.includes(r)?i.jsx(vs,{}):a.some(c=>r.includes(c))?i.jsx(ms,{}):null},n=()=>i.jsx(b,{justifyContent:"center",my:Ce.MEDIUM,children:i.jsx(b,{children:i.jsx(P,{variant:"h6",children:"داشبورد پایش آماری"})})}),{pathname:u}=Tn(),o=[Gu,Qu,Ku,Ln,Ju,Zu,er,tr].includes(u);return i.jsx(_e,{display:"flex",justifyContent:"center",children:i.jsxs(b,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[o&&!t?i.jsxs(i.Fragment,{children:[i.jsx(n,{}),i.jsx(zr,{})]}):!t&&i.jsx(yr,{}),!t&&e(u),t&&i.jsx(As,{})]})})};export{Gs as default}; diff --git a/build/assets/VpnKey-Di_7HUWD.js b/build/assets/VpnKey-Di_7HUWD.js new file mode 100644 index 0000000..ff2ca00 --- /dev/null +++ b/build/assets/VpnKey-Di_7HUWD.js @@ -0,0 +1 @@ +import{i as r,j as t}from"./mui-vendor-CkIVaoQP.js";import{r as a}from"./index-CeyyVc1v.js";var e={},o=r;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=o(a()),s=t;u=e.default=(0,i.default)((0,s.jsx)("path",{d:"M12.65 10C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H17v4h4v-4h2v-4zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"VpnKey");export{u as d}; diff --git a/build/assets/WagePayment-C-ToCy2g.js b/build/assets/WagePayment-C-ToCy2g.js new file mode 100644 index 0000000..14c042c --- /dev/null +++ b/build/assets/WagePayment-C-ToCy2g.js @@ -0,0 +1 @@ +import{j as e,T as t,am as n,aL as g,aM as F,aN as f,ak as v,aa as E,B as S}from"./mui-vendor-CkIVaoQP.js";import{j as k,r as s}from"./react-vendor-CmFgShSM.js";import{L as w,j as P,h as _,u as D,c as T,b as L,G as r,l as N,k as B,O as G}from"./index-CeyyVc1v.js";import{N as O}from"./num2persian-BIYy8amq.js";import{a as W,u as M}from"./redux-vendor-B7uoacJt.js";import{S as R}from"./SlaughterPayFeesGateway-BhtyiEES.js";import{S as V}from"./SimpleTable-DBAoNnCU.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";const $=W("WAGE_PAYMENT_GET_USER_INFO",async(i,{dispatch:l})=>{l(w());const{data:u,status:y}=await P.get(`https://${i.province}backend.rasadyar.com/get-payer-info/?${i.key}`);return l(_()),{data:u,status:y}}),uu=()=>{var m,h,p,b;const{key:i,province:l}=k(),[u,y]=s.useState(),x=M(),a=D({initialValues:{offer:0},validationSchema:T({offer:L().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!").min(2e5,"حداقل بیست هزار تومان وارد کنید")})});s.useEffect(()=>{i&&x($({province:l,key:`user_gate_way_id=${i}`})).then(o=>{var d,c;y(o.payload.data),((c=(d=o.payload)==null?void 0:d.data)==null?void 0:c.totalAmount)>2e9?a.setFieldValue("offer",2e9):a.setFieldValue("offer",parseInt(Math.ceil(o.payload.data.totalAmount/1e4)*1e4))})},[]),s.useEffect(()=>{a.validateForm()},[]);const[j,C]=s.useState([]);return s.useEffect(()=>{var o;if((u==null?void 0:u.role)==="Poultry"||(u==null?void 0:u.role)==="buyer"){const d=(o=u==null?void 0:u.orderCode)==null?void 0:o.map((c,A)=>[A+1,c]);C(d)}},[u]),e.jsx(r,{container:!0,justifyContent:"center",alignItems:"center",mt:2,children:e.jsxs(r,{xs:12,sm:8,md:4,style:{borderStyle:"solid",borderWidth:"1px",borderRadius:"30px",borderColor:"gray",boxShadow:"0px 5px 10px rgba(0, 0, 0, 0.1)",padding:"20px"},children:[e.jsx(r,{xs:12,children:e.jsx("img",{alt:"logo",src:N,style:{width:"100px",height:"100px",userSelect:"none"}})}),e.jsx(t,{variant:"body1",color:"primary",mb:1,children:"سامانه رصدیار"}),e.jsx(t,{variant:"body1",color:"secondary",mb:2,children:"پنل پرداخت تعرفه"}),e.jsx(n,{}),e.jsxs(r,{container:!0,justifyContent:"space-between",mt:2,mb:2,children:[e.jsx(t,{variant:"body1",color:"primary",children:"نام و نام خانوادگی:"}),e.jsxs(r,{children:[e.jsx(t,{variant:"body1",color:"gray",children:u==null?void 0:u.fullname}),e.jsx(n,{}),e.jsx(t,{variant:"body1",color:"gray",children:u==null?void 0:u.mobile})]})]}),e.jsx(n,{}),(u==null?void 0:u.role)==="Poultry"&&e.jsxs(e.Fragment,{children:[(u==null?void 0:u.orderCode)&&e.jsxs(r,{container:!0,justifyContent:"space-between",mt:2,mb:2,children:[e.jsx(t,{variant:"body1",color:"secondary",children:"کد سفارش:"}),e.jsx(t,{variant:"body1",color:"gray",children:(m=u==null?void 0:u.orderCode)==null?void 0:m.toLocaleString()})]}),e.jsxs(r,{container:!0,justifyContent:"space-between",mt:2,mb:2,children:[e.jsx(t,{variant:"body1",color:"secondary",children:"تعداد سفارشات:"}),e.jsx(t,{variant:"body1",color:"gray",children:(h=u==null?void 0:u.numberOfRequests)==null?void 0:h.toLocaleString()})]}),e.jsxs(r,{container:!0,justifyContent:"space-between",mt:2,mb:2,children:[e.jsx(t,{variant:"body1",color:"secondary",children:"حجم سفارشات:"}),e.jsxs(t,{variant:"body1",color:"gray",children:[(p=u==null?void 0:u.totalQuantity)==null?void 0:p.toLocaleString()," قطعه"]})]}),e.jsxs(r,{container:!0,justifyContent:"space-between",mt:2,mb:2,children:[e.jsx(t,{variant:"body1",color:"secondary",children:"وزن سفارشات:"}),e.jsxs(t,{variant:"body1",color:"gray",children:[(b=u==null?void 0:u.totalWeight)==null?void 0:b.toLocaleString()," کیلوگرم"]})]})]}),((u==null?void 0:u.role)==="Poultry"||(u==null?void 0:u.role)==="buyer")&&e.jsxs(g,{my:2,sx:{borderRadius:"8px",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)",backgroundColor:"#f5f5f5","&:before":{display:"none"}},children:[e.jsx(F,{expandIcon:e.jsx(B,{sx:{color:"#1976d2"}}),"aria-controls":"panel1a-content",sx:{backgroundColor:"#fff"},children:e.jsx(t,{sx:{color:"#1976d2",fontWeight:"bold"},children:"مشاهده سفارشات"})}),e.jsx(f,{sx:{backgroundColor:"#f9f9f9",borderTop:"1px solid #e0e0e0",padding:"8px",transition:"all 0.3s ease-in-out"},children:e.jsx(r,{children:e.jsx(V,{columns:["ردیف","کد سفارش"],data:j})})})]}),e.jsxs(r,{container:!0,justifyContent:"space-between",mt:2,mb:2,style:{fontWeight:"bolder"},children:[e.jsx(t,{variant:"body1",color:"primary",children:"جمع بدهی:"}),e.jsxs(t,{variant:"body1",style:{color:"red",fontWeight:"bolder"},children:[parseInt(Math.ceil((u==null?void 0:u.totalAmount)/1e4)*1e4).toLocaleString()," ","ریال"]})]}),e.jsx(n,{}),e.jsxs(r,{container:!0,justifyContent:"space-between",mt:2,mb:2,children:[e.jsx(t,{variant:"body1",color:"primary",children:"مبلغ تراکنش:"}),e.jsxs(t,{variant:"body1",color:"gray",children:[parseInt(Math.ceil(a.values.offer/1e4)*1e4).toLocaleString()," ","ریال"]})]}),e.jsx(n,{}),e.jsxs(r,{container:!0,justifyContent:"center",mt:2,mb:2,gap:2,children:[e.jsx(v,{id:"offer",label:(u==null?void 0:u.role)==="Poultry"||(u==null?void 0:u.role)==="Buyer"?"مبلغ":"ویرایش مبلغ",InputProps:{endAdornment:e.jsx(E,{position:"end",children:"ریال"}),readOnly:(u==null?void 0:u.role)==="Poultry"||(u==null?void 0:u.role)==="Buyer"},variant:"outlined",sx:{width:"100%"},value:a.values.offer,error:a.touched.offer?!!a.errors.offer:null,onChange:a.handleChange,onBlur:a.handleBlur,helperText:a.touched.offer&&a.errors.offer?a.errors.offer:null}),e.jsxs(t,{variant:"body1",mb:2,sx:{color:"darkcyan"},children:["معادل ",O(a.values.offer/10)," تومان"]}),e.jsx(S,{variant:"contained",fullWidth:!0,disabled:!a.isValid,onClick:()=>{x(G({title:"پرداخت تعرفه از طریق درگاه پرداخت",content:e.jsx(R,{backend:l,isPayment:!0,isPaymentData:{order_codes:u!=null&&u.orderCode?u==null?void 0:u.orderCode:null,role:u==null?void 0:u.role,user_key:u!=null&&u.userKey?u==null?void 0:u.userKey:null,total_amount:a.values.offer}})}))},children:"پرداخت تعرفه - درگاه پرداخت"})]})]})})};export{uu as default}; diff --git a/build/assets/Wallet-C8rTBC_i.js b/build/assets/Wallet-C8rTBC_i.js new file mode 100644 index 0000000..dd76dab --- /dev/null +++ b/build/assets/Wallet-C8rTBC_i.js @@ -0,0 +1 @@ +import{j as u,b as J,T as d,B as C,ak as p,aa as Z,ag as uu,av as eu,aw as tu,ax as B,d as au,bq as su}from"./mui-vendor-CkIVaoQP.js";import{r as n}from"./react-vendor-CmFgShSM.js";import{G as nu}from"./iconBase-BEJYyZsk.js";import{L as ru,j as A,X as b,h as ou,A as lu,v as g,fl as iu,Q as cu,u as du,c as Cu,b as mu,G as s,m as G,O as hu,S as Y,W as N}from"./index-CeyyVc1v.js";import{a as xu,u as pu,f as P}from"./redux-vendor-B7uoacJt.js";import{B as Au}from"./BackButton-Crzr7NMa.js";import{S as ju}from"./SlaughterPayFeesGateway-BhtyiEES.js";import{N as fu}from"./num2persian-BIYy8amq.js";import{S as yu}from"./SimpleTable-DBAoNnCU.js";import{R as gu,a as bu}from"./index.esm-Bu7XMDZU.js";import"./index-CIfb_iLp.js";import"./Close-_jAEIgMD.js";import"./Search-Dek2fED1.js";import"./Delete-C5MyLelE.js";function Fu(r){return nu({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M868 545.5L536.1 163a31.96 31.96 0 0 0-48.3 0L156 545.5a7.97 7.97 0 0 0 6 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z"}}]})(r)}const Su=xu("SLAUGHTER_GET_WALLET_BALANCE",async(r,{dispatch:o})=>{o(ru());const{data:l,status:j}=await A.get("system-wallet/",{params:{role:b(),type:"self"}});return o(ou()),{data:l,status:j}}),Nu=()=>{var k;const[r,o]=n.useState(!1),[l,j]=n.useState(0),[_,z]=n.useState([]),f=pu(),[m,F]=n.useState([]),[V,S]=n.useState(0),[v,W]=n.useState(""),[h,O]=n.useState("completed"),U=e=>{O(e.target.value)},H=e=>{W(e.target.value)},y=P(e=>e.userSlice),q=()=>{o(!0)},[,,i,E,c,D]=n.useContext(lu);n.useEffect(()=>{const e=g(new Date).format("YYYY-MM-DD");E(e),D(e)},[]);const w=async(e,t)=>{const x=await A.get(`transactions/?search=filter&value=${t}&page=${e}&type=wallet&page_size=10&date1=${i}&date2=${c}&state=${h}&role=${b()}`);F(x.data.results),S(x.data.count)};n.useEffect(()=>{w(1)},[i,c,h]);const T=async e=>{e.preventDefault();try{const t=await A.get(`transactions/?search=filter&value=${v}&type=wallet&date1=${i}&date2=${c}&state=${h}&role=${b()}`);F(t.data.results),S(t.data.count)}catch(t){console.error("Error fetching data:",t)}},[K,Q]=n.useState(0),X=(e,t)=>{Q(t),w(t+1,v)};n.useEffect(()=>{f(Su()).then(e=>{var t;j((t=e.payload.data)==null?void 0:t.balance)}),f(iu())},[]),n.useEffect(()=>{const e=m==null?void 0:m.map((t,x)=>{var M,$,R;return[x+1,cu(new Date(t.createDate),"yyyy/MM/dd hh:mm:ss"),t.payer,t.orderId,t.saleReferenceId,t.orderId,t.cardHolderPan,((M=t==null?void 0:t.amount)==null?void 0:M.toLocaleString())+" ﷼",(R=($=t.message)==null?void 0:$.split("_"))==null?void 0:R.join(" ")]});z(e)},[m]);const{inventorySelectedKillHouse:L}=P(e=>e.slaughterSlice),a=du({initialValues:{amount:""},validationSchema:Cu({amount:mu().required("این فیلد اجباری است!").min(1e6,"حداقل مبلغ صد هزار تومان است!").max(181818e4,"جمع مبلغ کل و مالیات نباید از دویست میلیون تومان بیشتر شود!").typeError("لطفا مبلغ را به درستی وارد کنید!")})});n.useEffect(()=>{a.validateForm()},[]);const I=e=>Number(e/10)+Number(e);return u.jsx(s,{xs:12,container:!0,justifyContent:"center",children:u.jsxs(s,{xs:12,sm:12,md:10,lg:10,justifyContent:"center",children:[u.jsx(s,{children:u.jsx(Au,{})}),u.jsx(s,{justifyContent:"center",xs:12,children:u.jsx(G.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.2},children:u.jsxs(J,{p:3,borderRadius:12,boxShadow:3,bgcolor:"background.paper",textAlign:"center",style:{backgroundColor:"aliceblue"},children:[u.jsx(d,{variant:"h4",mb:2,color:"primary",children:"کیف پول"}),u.jsxs(d,{variant:"body1",mb:4,sx:{color:"darkcyan"},children:["موجودی کیف پول: ",l==null?void 0:l.toLocaleString()," ریال"]}),r?u.jsxs(G.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},children:[u.jsx(p,{sx:{mb:2},fullWidth:!0,id:"amount",label:"مبلغ را وارد کنید",value:a.values.amount,error:a.touched.amount?!!a.errors.amount:null,onChange:a.handleChange,onBlur:a.handleBlur,InputProps:{endAdornment:u.jsx(Z,{position:"end",children:"ریال"})},helperText:a.touched.amount&&a.errors.amount?a.errors.amount:null,autoComplete:"current-password",variant:"outlined"}),u.jsxs(s,{container:!0,xs:12,children:[u.jsx(s,{item:!0,xs:12,children:a.values.amount>0&&u.jsxs(d,{variant:"body1",mb:2,sx:{color:"darkcyan"},children:[fu(a.values.amount)," ریال"]})}),u.jsx(s,{item:!0,xs:12,children:a.values.amount>0&&u.jsxs(d,{variant:"body1",mb:2,sx:{color:"red"},children:["با احتساب ده درصد ارزش افزوده:"," ",I(a.values.amount).toLocaleString()," ","ریال"]})})]}),u.jsx(C,{type:"submit",variant:"contained",color:"secondary",sx:{borderRadius:20,textTransform:"none",fontSize:16,color:"white",marginRight:2},onClick:()=>{o(!r)},children:"انصراف"}),u.jsx(C,{disabled:!a.isValid||!L,onClick:()=>{f(hu({title:"واریز به کیف پول از طریق درگاه پرداخت",content:u.jsx(ju,{amount:a.values.amount,amountWithTax:I(a.values.amount),user_key:L})}))},type:"submit",variant:"contained",color:"primary",sx:{borderRadius:20,textTransform:"none",fontSize:16},children:"پرداخت"})]}):u.jsx(C,{variant:"contained",color:"primary",startIcon:u.jsx(Fu,{}),sx:{borderRadius:20,textTransform:"none",fontSize:16},onClick:q,children:"افزایش موجودی"})]})})}),u.jsxs(s,{container:!0,justifyContent:"center",xs:12,mt:2,children:[u.jsx(s,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,width:"100%",children:u.jsxs(s,{container:!0,alignItems:"center",gap:Y.SMALL,children:[u.jsx(d,{children:"تراکنش ها"}),u.jsxs(s,{container:!0,gap:Y.SMALL,children:[u.jsx(s,{children:u.jsxs(uu,{children:[u.jsx(eu,{id:"demo-simple-select-label",children:"نوع تراکنش"}),u.jsxs(tu,{labelId:"demo-simple-select-label",id:"demo-simple-select",value:h,label:"Age",onChange:U,children:[u.jsx(B,{value:"completed",children:"موفق"}),u.jsx(B,{value:"failed",children:"ناموفق"})]})]})}),u.jsx(s,{children:u.jsx(N,{label:"از تاریخ",id:"date",renderInput:e=>u.jsx(p,{style:{width:"160px"},...e}),value:i,onChange:e=>{E(g(e).format("YYYY-MM-DD"))}})}),u.jsx(s,{children:u.jsx(N,{label:"تا تاریخ",id:"date",renderInput:e=>u.jsx(p,{style:{width:"160px"},...e}),value:c,onChange:e=>{D(g(e).format("YYYY-MM-DD"))}})})]}),u.jsxs("form",{onSubmit:T,children:[u.jsx(p,{id:"outlined-basic",size:"small",autoComplete:"off",label:"جستجو",variant:"outlined",style:{width:250},onChange:H}),u.jsx(C,{type:"submit",onClick:T,endIcon:u.jsx(gu,{}),children:"جستجو"})]}),u.jsx(au,{title:"خروجی اکسل",children:u.jsx("a",{href:`${A.defaults.baseURL}wallete_excel/?date1=${i}&date2=${c}&key=${(k=y==null?void 0:y.userProfile)==null?void 0:k.key}`,rel:"noreferrer",children:u.jsx(C,{color:"success",children:u.jsx(bu,{size:32})})})})]})}),u.jsxs(s,{xs:12,container:!0,justifyContent:"center",children:[u.jsx(yu,{columns:["ردیف","تاریخ و زمان","پرداخت کننده","شماره درخواست","شماره پیگیری","کدسفارش","شماره کارت","مبلغ","متن خطا"],data:_}),u.jsx(s,{container:!0,justifyContent:"center",mt:2,children:u.jsx(su,{count:Math.ceil(V/10),page:K+1,variant:"outlined",onChange:(e,t)=>{X(e,t-1)}})})]})]})]})})};export{Nu as default}; diff --git a/build/assets/auto-gcBAg08D.js b/build/assets/auto-gcBAg08D.js new file mode 100644 index 0000000..1ef1818 --- /dev/null +++ b/build/assets/auto-gcBAg08D.js @@ -0,0 +1 @@ +import{C as r,W as e}from"./chart-vendor-sE2SUVPW.js";r.register(...e); diff --git a/build/assets/aviculture-get-hatching-data-DsjDNd82.js b/build/assets/aviculture-get-hatching-data-DsjDNd82.js new file mode 100644 index 0000000..2dabd5a --- /dev/null +++ b/build/assets/aviculture-get-hatching-data-DsjDNd82.js @@ -0,0 +1 @@ +import{a as r}from"./redux-vendor-B7uoacJt.js";import{j as s}from"./index-CeyyVc1v.js";const i=r("VET_GET_HATCHING",async t=>{const{data:a,status:e}=await s.get("poultry_hatching/?key="+t);return{data:a,status:e}}),o=r("VET_GET_HATCHING_FOR_INCREASE",async t=>{const{data:a,status:e}=await s.get("poultry_hatching/?increase=true&key="+t);return{data:a,status:e}});export{i as a,o as b}; diff --git a/build/assets/aviculture-get-unions-C1NoVg85.js b/build/assets/aviculture-get-unions-C1NoVg85.js new file mode 100644 index 0000000..132f602 --- /dev/null +++ b/build/assets/aviculture-get-unions-C1NoVg85.js @@ -0,0 +1 @@ +import{a as r}from"./redux-vendor-B7uoacJt.js";import{j as e,h as n}from"./index-CeyyVc1v.js";const m=r("AVICULTURE_GET_UNIONS",async(a,{dispatch:t})=>{const{data:s,status:o}=await e.get("show_city_operator",{params:a});return t(n()),{data:s,status:o}});export{m as a}; diff --git a/build/assets/chart-vendor-sE2SUVPW.js b/build/assets/chart-vendor-sE2SUVPW.js new file mode 100644 index 0000000..f410e7b --- /dev/null +++ b/build/assets/chart-vendor-sE2SUVPW.js @@ -0,0 +1,78 @@ +var TO=Object.defineProperty;var MO=(r,t,e)=>t in r?TO(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var j=(r,t,e)=>MO(r,typeof t!="symbol"?t+"":t,e);import{r as Wr,b as b0,g as CO}from"./react-vendor-CmFgShSM.js";/*! + * @kurkle/color v0.3.4 + * https://github.com/kurkle/color#readme + * (c) 2024 Jukka Kurkela + * Released under the MIT License + */function ah(r){return r+.5|0}const bn=(r,t,e)=>Math.max(Math.min(r,e),t);function El(r){return bn(ah(r*2.55),0,255)}function En(r){return bn(ah(r*255),0,255)}function Vi(r){return bn(ah(r/2.55)/100,0,1)}function ub(r){return bn(ah(r*100),0,100)}const gr={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},vy=[..."0123456789ABCDEF"],AO=r=>vy[r&15],DO=r=>vy[(r&240)>>4]+vy[r&15],Ph=r=>(r&240)>>4===(r&15),LO=r=>Ph(r.r)&&Ph(r.g)&&Ph(r.b)&&Ph(r.a);function IO(r){var t=r.length,e;return r[0]==="#"&&(t===4||t===5?e={r:255&gr[r[1]]*17,g:255&gr[r[2]]*17,b:255&gr[r[3]]*17,a:t===5?gr[r[4]]*17:255}:(t===7||t===9)&&(e={r:gr[r[1]]<<4|gr[r[2]],g:gr[r[3]]<<4|gr[r[4]],b:gr[r[5]]<<4|gr[r[6]],a:t===9?gr[r[7]]<<4|gr[r[8]]:255})),e}const PO=(r,t)=>r<255?t(r):"";function kO(r){var t=LO(r)?AO:DO;return r?"#"+t(r.r)+t(r.g)+t(r.b)+PO(r.a,t):void 0}const RO=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ID(r,t,e){const i=t*Math.min(e,1-e),n=(a,o=(a+r/30)%12)=>e-i*Math.max(Math.min(o-3,9-o,1),-1);return[n(0),n(8),n(4)]}function EO(r,t,e){const i=(n,a=(n+r/60)%6)=>e-e*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}function OO(r,t,e){const i=ID(r,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)i[n]*=1-t-e,i[n]+=t;return i}function NO(r,t,e,i,n){return r===n?(t-e)/i+(t.5?h/(2-a-o):h/(a+o),l=NO(e,i,n,h,a),l=l*60+.5),[l|0,u||0,s]}function w0(r,t,e,i){return(Array.isArray(t)?r(t[0],t[1],t[2]):r(t,e,i)).map(En)}function T0(r,t,e){return w0(ID,r,t,e)}function BO(r,t,e){return w0(OO,r,t,e)}function zO(r,t,e){return w0(EO,r,t,e)}function PD(r){return(r%360+360)%360}function VO(r){const t=RO.exec(r);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?El(+t[5]):En(+t[5]));const n=PD(+t[2]),a=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=BO(n,a,o):t[1]==="hsv"?i=zO(n,a,o):i=T0(n,a,o),{r:i[0],g:i[1],b:i[2],a:e}}function FO(r,t){var e=S0(r);e[0]=PD(e[0]+t),e=T0(e),r.r=e[0],r.g=e[1],r.b=e[2]}function GO(r){if(!r)return;const t=S0(r),e=t[0],i=ub(t[1]),n=ub(t[2]);return r.a<255?`hsla(${e}, ${i}%, ${n}%, ${Vi(r.a)})`:`hsl(${e}, ${i}%, ${n}%)`}const hb={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},cb={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function HO(){const r={},t=Object.keys(cb),e=Object.keys(hb);let i,n,a,o,s;for(i=0;i>16&255,a>>8&255,a&255]}return r}let kh;function WO(r){kh||(kh=HO(),kh.transparent=[0,0,0,0]);const t=kh[r.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const UO=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function YO(r){const t=UO.exec(r);let e=255,i,n,a;if(t){if(t[7]!==i){const o=+t[7];e=t[8]?El(o):bn(o*255,0,255)}return i=+t[1],n=+t[3],a=+t[5],i=255&(t[2]?El(i):bn(i,0,255)),n=255&(t[4]?El(n):bn(n,0,255)),a=255&(t[6]?El(a):bn(a,0,255)),{r:i,g:n,b:a,a:e}}}function $O(r){return r&&(r.a<255?`rgba(${r.r}, ${r.g}, ${r.b}, ${Vi(r.a)})`:`rgb(${r.r}, ${r.g}, ${r.b})`)}const Id=r=>r<=.0031308?r*12.92:Math.pow(r,1/2.4)*1.055-.055,Lo=r=>r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4);function XO(r,t,e){const i=Lo(Vi(r.r)),n=Lo(Vi(r.g)),a=Lo(Vi(r.b));return{r:En(Id(i+e*(Lo(Vi(t.r))-i))),g:En(Id(n+e*(Lo(Vi(t.g))-n))),b:En(Id(a+e*(Lo(Vi(t.b))-a))),a:r.a+e*(t.a-r.a)}}function Rh(r,t,e){if(r){let i=S0(r);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=T0(i),r.r=i[0],r.g=i[1],r.b=i[2]}}function kD(r,t){return r&&Object.assign(t||{},r)}function fb(r){var t={r:0,g:0,b:0,a:255};return Array.isArray(r)?r.length>=3&&(t={r:r[0],g:r[1],b:r[2],a:255},r.length>3&&(t.a=En(r[3]))):(t=kD(r,{r:0,g:0,b:0,a:1}),t.a=En(t.a)),t}function ZO(r){return r.charAt(0)==="r"?YO(r):VO(r)}class Su{constructor(t){if(t instanceof Su)return t;const e=typeof t;let i;e==="object"?i=fb(t):e==="string"&&(i=IO(t)||WO(t)||ZO(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=kD(this._rgb);return t&&(t.a=Vi(t.a)),t}set rgb(t){this._rgb=fb(t)}rgbString(){return this._valid?$O(this._rgb):void 0}hexString(){return this._valid?kO(this._rgb):void 0}hslString(){return this._valid?GO(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let a;const o=e===a?.5:e,s=2*o-1,l=i.a-n.a,u=((s*l===-1?s:(s+l)/(1+s*l))+1)/2;a=1-u,i.r=255&u*i.r+a*n.r+.5,i.g=255&u*i.g+a*n.g+.5,i.b=255&u*i.b+a*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=XO(this._rgb,t._rgb,e)),this}clone(){return new Su(this.rgb)}alpha(t){return this._rgb.a=En(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ah(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Rh(this._rgb,2,t),this}darken(t){return Rh(this._rgb,2,-t),this}saturate(t){return Rh(this._rgb,1,t),this}desaturate(t){return Rh(this._rgb,1,-t),this}rotate(t){return FO(this._rgb,t),this}}/*! + * Chart.js v4.5.1 + * https://www.chartjs.org + * (c) 2025 Chart.js Contributors + * Released under the MIT License + */function Pi(){}const jO=(()=>{let r=0;return()=>r++})();function It(r){return r==null}function jt(r){if(Array.isArray&&Array.isArray(r))return!0;const t=Object.prototype.toString.call(r);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Rt(r){return r!==null&&Object.prototype.toString.call(r)==="[object Object]"}function ne(r){return(typeof r=="number"||r instanceof Number)&&isFinite(+r)}function ur(r,t){return ne(r)?r:t}function bt(r,t){return typeof r>"u"?t:r}const qO=(r,t)=>typeof r=="string"&&r.endsWith("%")?parseFloat(r)/100:+r/t,RD=(r,t)=>typeof r=="string"&&r.endsWith("%")?parseFloat(r)/100*t:+r;function Zt(r,t,e){if(r&&typeof r.call=="function")return r.apply(e,t)}function Wt(r,t,e,i){let n,a,o;if(jt(r))for(a=r.length,n=0;nr,x:r=>r.x,y:r=>r.y};function QO(r){const t=r.split("."),e=[];let i="";for(const n of t)i+=n,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function tN(r){const t=QO(r);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Wn(r,t){return(vb[t]||(vb[t]=tN(t)))(r)}function M0(r){return r.charAt(0).toUpperCase()+r.slice(1)}const Tu=r=>typeof r<"u",Un=r=>typeof r=="function",db=(r,t)=>{if(r.size!==t.size)return!1;for(const e of r)if(!t.has(e))return!1;return!0};function eN(r){return r.type==="mouseup"||r.type==="click"||r.type==="contextmenu"}const Nt=Math.PI,qt=2*Nt,rN=qt+Nt,wf=Number.POSITIVE_INFINITY,iN=Nt/180,se=Nt/2,na=Nt/4,pb=Nt*2/3,Sn=Math.log10,_i=Math.sign;function Ql(r,t,e){return Math.abs(r-t)n-a).pop(),t}function aN(r){return typeof r=="symbol"||typeof r=="object"&&r!==null&&!(Symbol.toPrimitive in r||"toString"in r||"valueOf"in r)}function _s(r){return!aN(r)&&!isNaN(parseFloat(r))&&isFinite(r)}function oN(r,t){const e=Math.round(r);return e-t<=r&&e+t>=r}function OD(r,t,e){let i,n,a;for(i=0,n=r.length;il&&u=Math.min(t,e)-i&&r<=Math.max(t,e)+i}function A0(r,t,e){e=e||(o=>r[o]1;)a=n+i>>1,e(a)?n=a:i=a;return{lo:n,hi:i}}const Gi=(r,t,e,i)=>A0(r,e,i?n=>{const a=r[n][t];return ar[n][t]A0(r,e,i=>r[i][t]>=e);function hN(r,t,e){let i=0,n=r.length;for(;ii&&r[n-1]>e;)n--;return i>0||n{const i="_onData"+M0(e),n=r[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,value(...a){const o=n.apply(this,a);return r._chartjs.listeners.forEach(s=>{typeof s[i]=="function"&&s[i](...a)}),o}})})}function mb(r,t){const e=r._chartjs;if(!e)return;const i=e.listeners,n=i.indexOf(t);n!==-1&&i.splice(n,1),!(i.length>0)&&(BD.forEach(a=>{delete r[a]}),delete r._chartjs)}function zD(r){const t=new Set(r);return t.size===r.length?r:Array.from(t)}const VD=function(){return typeof window>"u"?function(r){return r()}:window.requestAnimationFrame}();function FD(r,t){let e=[],i=!1;return function(...n){e=n,i||(i=!0,VD.call(window,()=>{i=!1,r.apply(t,e)}))}}function fN(r,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(r,t,i)):r.apply(this,i),t}}const D0=r=>r==="start"?"left":r==="end"?"right":"center",Pe=(r,t,e)=>r==="start"?t:r==="end"?e:(t+e)/2,vN=(r,t,e,i)=>r===(i?"left":"right")?e:r==="center"?(t+e)/2:t;function GD(r,t,e){const i=t.length;let n=0,a=i;if(r._sorted){const{iScale:o,vScale:s,_parsed:l}=r,u=r.dataset&&r.dataset.options?r.dataset.options.spanGaps:null,h=o.axis,{min:c,max:f,minDefined:v,maxDefined:d}=o.getUserBounds();if(v){if(n=Math.min(Gi(l,h,c).lo,e?i:Gi(t,h,o.getPixelForValue(c)).lo),u){const p=l.slice(0,n+1).reverse().findIndex(g=>!It(g[s.axis]));n-=Math.max(0,p)}n=Se(n,0,i-1)}if(d){let p=Math.max(Gi(l,o.axis,f,!0).hi+1,e?0:Gi(t,h,o.getPixelForValue(f),!0).hi+1);if(u){const g=l.slice(p-1).findIndex(y=>!It(y[s.axis]));p+=Math.max(0,g)}a=Se(p,n,i)-n}else a=i-n}return{start:n,count:a}}function HD(r){const{xScale:t,yScale:e,_scaleRanges:i}=r,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return r._scaleRanges=n,!0;const a=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,n),a}const Eh=r=>r===0||r===1,_b=(r,t,e)=>-(Math.pow(2,10*(r-=1))*Math.sin((r-t)*qt/e)),xb=(r,t,e)=>Math.pow(2,-10*r)*Math.sin((r-t)*qt/e)+1,tu={linear:r=>r,easeInQuad:r=>r*r,easeOutQuad:r=>-r*(r-2),easeInOutQuad:r=>(r/=.5)<1?.5*r*r:-.5*(--r*(r-2)-1),easeInCubic:r=>r*r*r,easeOutCubic:r=>(r-=1)*r*r+1,easeInOutCubic:r=>(r/=.5)<1?.5*r*r*r:.5*((r-=2)*r*r+2),easeInQuart:r=>r*r*r*r,easeOutQuart:r=>-((r-=1)*r*r*r-1),easeInOutQuart:r=>(r/=.5)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2),easeInQuint:r=>r*r*r*r*r,easeOutQuint:r=>(r-=1)*r*r*r*r+1,easeInOutQuint:r=>(r/=.5)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2),easeInSine:r=>-Math.cos(r*se)+1,easeOutSine:r=>Math.sin(r*se),easeInOutSine:r=>-.5*(Math.cos(Nt*r)-1),easeInExpo:r=>r===0?0:Math.pow(2,10*(r-1)),easeOutExpo:r=>r===1?1:-Math.pow(2,-10*r)+1,easeInOutExpo:r=>Eh(r)?r:r<.5?.5*Math.pow(2,10*(r*2-1)):.5*(-Math.pow(2,-10*(r*2-1))+2),easeInCirc:r=>r>=1?r:-(Math.sqrt(1-r*r)-1),easeOutCirc:r=>Math.sqrt(1-(r-=1)*r),easeInOutCirc:r=>(r/=.5)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1),easeInElastic:r=>Eh(r)?r:_b(r,.075,.3),easeOutElastic:r=>Eh(r)?r:xb(r,.075,.3),easeInOutElastic(r){return Eh(r)?r:r<.5?.5*_b(r*2,.1125,.45):.5+.5*xb(r*2-1,.1125,.45)},easeInBack(r){return r*r*((1.70158+1)*r-1.70158)},easeOutBack(r){return(r-=1)*r*((1.70158+1)*r+1.70158)+1},easeInOutBack(r){let t=1.70158;return(r/=.5)<1?.5*(r*r*(((t*=1.525)+1)*r-t)):.5*((r-=2)*r*(((t*=1.525)+1)*r+t)+2)},easeInBounce:r=>1-tu.easeOutBounce(1-r),easeOutBounce(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},easeInOutBounce:r=>r<.5?tu.easeInBounce(r*2)*.5:tu.easeOutBounce(r*2-1)*.5+.5};function L0(r){if(r&&typeof r=="object"){const t=r.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function bb(r){return L0(r)?r:new Su(r)}function Pd(r){return L0(r)?r:new Su(r).saturate(.5).darken(.1).hexString()}const dN=["x","y","borderWidth","radius","tension"],pN=["color","borderColor","backgroundColor"];function gN(r){r.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),r.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),r.set("animations",{colors:{type:"color",properties:pN},numbers:{type:"number",properties:dN}}),r.describe("animations",{_fallback:"animation"}),r.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function yN(r){r.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Sb=new Map;function mN(r,t){t=t||{};const e=r+JSON.stringify(t);let i=Sb.get(e);return i||(i=new Intl.NumberFormat(r,t),Sb.set(e,i)),i}function oh(r,t,e){return mN(t,e).format(r)}const WD={values(r){return jt(r)?r:""+r},numeric(r,t,e){if(r===0)return"0";const i=this.chart.options.locale;let n,a=r;if(e.length>1){const u=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(u<1e-4||u>1e15)&&(n="scientific"),a=_N(r,e)}const o=Sn(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:n,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),oh(r,i,l)},logarithmic(r,t,e){if(r===0)return"0";const i=e[t].significand||r/Math.pow(10,Math.floor(Sn(r)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?WD.numeric.call(this,r,t,e):""}};function _N(r,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&r!==Math.floor(r)&&(e=r-Math.floor(r)),e}var Dv={formatters:WD};function xN(r){r.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Dv.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),r.route("scale.ticks","color","","color"),r.route("scale.grid","color","","borderColor"),r.route("scale.border","color","","borderColor"),r.route("scale.title","color","","color"),r.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),r.describe("scales",{_fallback:"scale"}),r.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const lo=Object.create(null),py=Object.create(null);function eu(r,t){if(!t)return r;const e=t.split(".");for(let i=0,n=e.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,n)=>Pd(n.backgroundColor),this.hoverBorderColor=(i,n)=>Pd(n.borderColor),this.hoverColor=(i,n)=>Pd(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return kd(this,t,e)}get(t){return eu(this,t)}describe(t,e){return kd(py,t,e)}override(t,e){return kd(lo,t,e)}route(t,e,i,n){const a=eu(this,t),o=eu(this,i),s="_"+e;Object.defineProperties(a,{[s]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[s],u=o[n];return Rt(l)?Object.assign({},u,l):bt(l,u)},set(l){this[s]=l}}})}apply(t){t.forEach(e=>e(this))}}var Jt=new bN({_scriptable:r=>!r.startsWith("on"),_indexable:r=>r!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[gN,yN,xN]);function SN(r){return!r||It(r.size)||It(r.family)?null:(r.style?r.style+" ":"")+(r.weight?r.weight+" ":"")+r.size+"px "+r.family}function Tf(r,t,e,i,n){let a=t[n];return a||(a=t[n]=r.measureText(n).width,e.push(n)),a>i&&(i=a),i}function wN(r,t,e,i){i=i||{};let n=i.data=i.data||{},a=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(n=i.data={},a=i.garbageCollect=[],i.font=t),r.save(),r.font=t;let o=0;const s=e.length;let l,u,h,c,f;for(l=0;le.length){for(l=0;l0&&r.stroke()}}function Hi(r,t,e){return e=e||.5,!t||r&&r.x>t.left-e&&r.xt.top-e&&r.y0&&a.strokeColor!=="";let l,u;for(r.save(),r.font=n.string,CN(r,a),l=0;l+r||0;function I0(r,t){const e={},i=Rt(t),n=i?Object.keys(t):t,a=Rt(r)?i?o=>bt(r[o],r[t[o]]):o=>r[o]:()=>r;for(const o of n)e[o]=kN(a(o));return e}function YD(r){return I0(r,{top:"y",right:"x",bottom:"y",left:"x"})}function Ja(r){return I0(r,["topLeft","topRight","bottomLeft","bottomRight"])}function ze(r){const t=YD(r);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function de(r,t){r=r||{},t=t||Jt.font;let e=bt(r.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=bt(r.style,t.style);i&&!(""+i).match(IN)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const n={family:bt(r.family,t.family),lineHeight:PN(bt(r.lineHeight,t.lineHeight),e),size:e,style:i,weight:bt(r.weight,t.weight),string:""};return n.string=SN(n),n}function Ol(r,t,e,i){let n,a,o;for(n=0,a=r.length;ne&&s===0?0:s+l;return{min:o(i,-Math.abs(a)),max:o(n,a)}}function Kn(r,t){return Object.assign(Object.create(r),t)}function P0(r,t=[""],e,i,n=()=>r[0]){const a=e||r;typeof i>"u"&&(i=jD("_fallback",r));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:r,_rootScopes:a,_fallback:i,_getTarget:n,override:s=>P0([s,...r],t,a,i)};return new Proxy(o,{deleteProperty(s,l){return delete s[l],delete s._keys,delete r[0][l],!0},get(s,l){return XD(s,l,()=>GN(l,t,r,s))},getOwnPropertyDescriptor(s,l){return Reflect.getOwnPropertyDescriptor(s._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(r[0])},has(s,l){return Mb(s).includes(l)},ownKeys(s){return Mb(s)},set(s,l,u){const h=s._storage||(s._storage=n());return s[l]=h[l]=u,delete s._keys,!0}})}function xs(r,t,e,i){const n={_cacheable:!1,_proxy:r,_context:t,_subProxy:e,_stack:new Set,_descriptors:$D(r,i),setContext:a=>xs(r,a,e,i),override:a=>xs(r.override(a),t,e,i)};return new Proxy(n,{deleteProperty(a,o){return delete a[o],delete r[o],!0},get(a,o,s){return XD(a,o,()=>ON(a,o,s))},getOwnPropertyDescriptor(a,o){return a._descriptors.allKeys?Reflect.has(r,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(r,o)},getPrototypeOf(){return Reflect.getPrototypeOf(r)},has(a,o){return Reflect.has(r,o)},ownKeys(){return Reflect.ownKeys(r)},set(a,o,s){return r[o]=s,delete a[o],!0}})}function $D(r,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:n=t.allKeys}=r;return{allKeys:n,scriptable:e,indexable:i,isScriptable:Un(e)?e:()=>e,isIndexable:Un(i)?i:()=>i}}const EN=(r,t)=>r?r+M0(t):t,k0=(r,t)=>Rt(t)&&r!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function XD(r,t,e){if(Object.prototype.hasOwnProperty.call(r,t)||t==="constructor")return r[t];const i=e();return r[t]=i,i}function ON(r,t,e){const{_proxy:i,_context:n,_subProxy:a,_descriptors:o}=r;let s=i[t];return Un(s)&&o.isScriptable(t)&&(s=NN(t,s,r,e)),jt(s)&&s.length&&(s=BN(t,s,r,o.isIndexable)),k0(t,s)&&(s=xs(s,n,a&&a[t],o)),s}function NN(r,t,e,i){const{_proxy:n,_context:a,_subProxy:o,_stack:s}=e;if(s.has(r))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+r);s.add(r);let l=t(a,o||i);return s.delete(r),k0(r,l)&&(l=R0(n._scopes,n,r,l)),l}function BN(r,t,e,i){const{_proxy:n,_context:a,_subProxy:o,_descriptors:s}=e;if(typeof a.index<"u"&&i(r))return t[a.index%t.length];if(Rt(t[0])){const l=t,u=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const c=R0(u,n,r,h);t.push(xs(c,a,o&&o[r],s))}}return t}function ZD(r,t,e){return Un(r)?r(t,e):r}const zN=(r,t)=>r===!0?t:typeof r=="string"?Wn(t,r):void 0;function VN(r,t,e,i,n){for(const a of t){const o=zN(e,a);if(o){r.add(o);const s=ZD(o._fallback,e,n);if(typeof s<"u"&&s!==e&&s!==i)return s}else if(o===!1&&typeof i<"u"&&e!==i)return null}return!1}function R0(r,t,e,i){const n=t._rootScopes,a=ZD(t._fallback,e,i),o=[...r,...n],s=new Set;s.add(i);let l=Tb(s,o,e,a||e,i);return l===null||typeof a<"u"&&a!==e&&(l=Tb(s,o,a,l,i),l===null)?!1:P0(Array.from(s),[""],n,a,()=>FN(t,e,i))}function Tb(r,t,e,i,n){for(;e;)e=VN(r,t,e,i,n);return e}function FN(r,t,e){const i=r._getTarget();t in i||(i[t]={});const n=i[t];return jt(n)&&Rt(e)?e:n||{}}function GN(r,t,e,i){let n;for(const a of t)if(n=jD(EN(a,r),e),typeof n<"u")return k0(r,n)?R0(e,i,r,n):n}function jD(r,t){for(const e of t){if(!e)continue;const i=e[r];if(typeof i<"u")return i}}function Mb(r){let t=r._keys;return t||(t=r._keys=HN(r._scopes)),t}function HN(r){const t=new Set;for(const e of r)for(const i of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(i);return Array.from(t)}function qD(r,t,e,i){const{iScale:n}=r,{key:a="r"}=this._parsing,o=new Array(i);let s,l,u,h;for(s=0,l=i;str==="x"?"y":"x";function UN(r,t,e,i){const n=r.skip?t:r,a=t,o=e.skip?t:e,s=dy(a,n),l=dy(o,a);let u=s/(s+l),h=l/(s+l);u=isNaN(u)?0:u,h=isNaN(h)?0:h;const c=i*u,f=i*h;return{previous:{x:a.x-c*(o.x-n.x),y:a.y-c*(o.y-n.y)},next:{x:a.x+f*(o.x-n.x),y:a.y+f*(o.y-n.y)}}}function YN(r,t,e){const i=r.length;let n,a,o,s,l,u=bs(r,0);for(let h=0;h!u.skip)),t.cubicInterpolationMode==="monotone")XN(r,n);else{let u=i?r[r.length-1]:r[0];for(a=0,o=r.length;ar.ownerDocument.defaultView.getComputedStyle(r,null);function qN(r,t){return Pv(r).getPropertyValue(t)}const KN=["top","right","bottom","left"];function Qa(r,t,e){const i={};e=e?"-"+e:"";for(let n=0;n<4;n++){const a=KN[n];i[a]=parseFloat(r[t+"-"+a+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const JN=(r,t,e)=>(r>0||t>0)&&(!e||!e.shadowRoot);function QN(r,t){const e=r.touches,i=e&&e.length?e[0]:r,{offsetX:n,offsetY:a}=i;let o=!1,s,l;if(JN(n,a,r.target))s=n,l=a;else{const u=t.getBoundingClientRect();s=i.clientX-u.left,l=i.clientY-u.top,o=!0}return{x:s,y:l,box:o}}function ka(r,t){if("native"in r)return r;const{canvas:e,currentDevicePixelRatio:i}=t,n=Pv(e),a=n.boxSizing==="border-box",o=Qa(n,"padding"),s=Qa(n,"border","width"),{x:l,y:u,box:h}=QN(r,e),c=o.left+(h&&s.left),f=o.top+(h&&s.top);let{width:v,height:d}=t;return a&&(v-=o.width+s.width,d-=o.height+s.height),{x:Math.round((l-c)/v*e.width/i),y:Math.round((u-f)/d*e.height/i)}}function tB(r,t,e){let i,n;if(t===void 0||e===void 0){const a=r&&O0(r);if(!a)t=r.clientWidth,e=r.clientHeight;else{const o=a.getBoundingClientRect(),s=Pv(a),l=Qa(s,"border","width"),u=Qa(s,"padding");t=o.width-u.width-l.width,e=o.height-u.height-l.height,i=Mf(s.maxWidth,a,"clientWidth"),n=Mf(s.maxHeight,a,"clientHeight")}}return{width:t,height:e,maxWidth:i||wf,maxHeight:n||wf}}const wn=r=>Math.round(r*10)/10;function eB(r,t,e,i){const n=Pv(r),a=Qa(n,"margin"),o=Mf(n.maxWidth,r,"clientWidth")||wf,s=Mf(n.maxHeight,r,"clientHeight")||wf,l=tB(r,t,e);let{width:u,height:h}=l;if(n.boxSizing==="content-box"){const f=Qa(n,"border","width"),v=Qa(n,"padding");u-=v.width+f.width,h-=v.height+f.height}return u=Math.max(0,u-a.width),h=Math.max(0,i?u/i:h-a.height),u=wn(Math.min(u,o,l.maxWidth)),h=wn(Math.min(h,s,l.maxHeight)),u&&!h&&(h=wn(u/2)),(t!==void 0||e!==void 0)&&i&&l.height&&h>l.height&&(h=l.height,u=wn(Math.floor(h*i))),{width:u,height:h}}function Cb(r,t,e){const i=t||1,n=wn(r.height*i),a=wn(r.width*i);r.height=wn(r.height),r.width=wn(r.width);const o=r.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${r.height}px`,o.style.width=`${r.width}px`),r.currentDevicePixelRatio!==i||o.height!==n||o.width!==a?(r.currentDevicePixelRatio=i,o.height=n,o.width=a,r.ctx.setTransform(i,0,0,i,0,0),!0):!1}const rB=function(){let r=!1;try{const t={get passive(){return r=!0,!1}};E0()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return r}();function Ab(r,t){const e=qN(r,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Ra(r,t,e,i){return{x:r.x+e*(t.x-r.x),y:r.y+e*(t.y-r.y)}}function iB(r,t,e,i){return{x:r.x+e*(t.x-r.x),y:i==="middle"?e<.5?r.y:t.y:i==="after"?e<1?r.y:t.y:e>0?t.y:r.y}}function nB(r,t,e,i){const n={x:r.cp2x,y:r.cp2y},a={x:t.cp1x,y:t.cp1y},o=Ra(r,n,e),s=Ra(n,a,e),l=Ra(a,t,e),u=Ra(o,s,e),h=Ra(s,l,e);return Ra(u,h,e)}const aB=function(r,t){return{x(e){return r+r+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},oB=function(){return{x(r){return r},setWidth(r){},textAlign(r){return r},xPlus(r,t){return r+t},leftForLtr(r,t){return r}}};function us(r,t,e){return r?aB(t,e):oB()}function JD(r,t){let e,i;(t==="ltr"||t==="rtl")&&(e=r.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),r.prevTextDirection=i)}function QD(r,t){t!==void 0&&(delete r.prevTextDirection,r.canvas.style.setProperty("direction",t[0],t[1]))}function tL(r){return r==="angle"?{between:Mu,compare:sN,normalize:Ee}:{between:Fi,compare:(t,e)=>t-e,normalize:t=>t}}function Db({start:r,end:t,count:e,loop:i,style:n}){return{start:r%e,end:t%e,loop:i&&(t-r+1)%e===0,style:n}}function sB(r,t,e){const{property:i,start:n,end:a}=e,{between:o,normalize:s}=tL(i),l=t.length;let{start:u,end:h,loop:c}=r,f,v;if(c){for(u+=l,h+=l,f=0,v=l;fl(n,_,y)&&s(n,_)!==0,b=()=>s(a,y)===0||l(a,_,y),S=()=>p||x(),w=()=>!p||b();for(let T=h,M=h;T<=c;++T)m=t[T%o],!m.skip&&(y=u(m[i]),y!==_&&(p=l(y,n,a),g===null&&S()&&(g=s(y,n)===0?T:M),g!==null&&w()&&(d.push(Db({start:g,end:T,loop:f,count:o,style:v})),g=null),M=T,_=y));return g!==null&&d.push(Db({start:g,end:c,loop:f,count:o,style:v})),d}function rL(r,t){const e=[],i=r.segments;for(let n=0;nn&&r[a%t].skip;)a--;return a%=t,{start:n,end:a}}function uB(r,t,e,i){const n=r.length,a=[];let o=t,s=r[t],l;for(l=t+1;l<=e;++l){const u=r[l%n];u.skip||u.stop?s.skip||(i=!1,a.push({start:t%n,end:(l-1)%n,loop:i}),t=o=u.stop?l:null):(o=l,s.skip&&(t=l)),s=u}return o!==null&&a.push({start:t%n,end:o%n,loop:i}),a}function hB(r,t){const e=r.points,i=r.options.spanGaps,n=e.length;if(!n)return[];const a=!!r._loop,{start:o,end:s}=lB(e,n,a,i);if(i===!0)return Lb(r,[{start:o,end:s,loop:a}],e,t);const l=ss({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=VD.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const a=i.items;let o=a.length-1,s=!1,l;for(;o>=0;--o)l=a[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),s=!0):(a[o]=a[a.length-1],a.pop());s&&(n.draw(),this._notify(n,i,t,"progress")),a.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,n)=>Math.max(i,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};var Oi=new dB;const Pb="transparent",pB={boolean(r,t,e){return e>.5?t:r},color(r,t,e){const i=bb(r||Pb),n=i.valid&&bb(t||Pb);return n&&n.valid?n.mix(i,e).hexString():t},number(r,t,e){return r+(t-r)*e}};let gB=class{constructor(t,e,i,n){const a=e[i];n=Ol([t.to,n,a,t.from]);const o=Ol([t.from,a,n]);this._active=!0,this._fn=t.fn||pB[t.type||typeof o],this._easing=tu[t.easing]||tu.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],a=i-this._start,o=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=Ol([t.to,e,n,t.from]),this._from=Ol([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,a=this._from,o=this._loop,s=this._to;let l;if(this._active=a!==s&&(o||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(a,s,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n{const a=t[n];if(!Rt(a))return;const o={};for(const s of e)o[s]=a[s];(jt(a.properties)&&a.properties||[n]).forEach(s=>{(s===n||!i.has(s))&&i.set(s,o)})})}_animateOptions(t,e){const i=e.options,n=mB(t,i);if(!n)return[];const a=this._createAnimations(n,i);return i.$shared&&yB(t.options.$animations,i).then(()=>{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,n=[],a=t.$animations||(t.$animations={}),o=Object.keys(e),s=Date.now();let l;for(l=o.length-1;l>=0;--l){const u=o[l];if(u.charAt(0)==="$")continue;if(u==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[u];let c=a[u];const f=i.get(u);if(c)if(f&&c.active()){c.update(f,h,s);continue}else c.cancel();if(!f||!f.duration){t[u]=h;continue}a[u]=c=new gB(f,t,u,h),n.push(c)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return Oi.add(this._chart,i),!0}}function yB(r,t){const e=[],i=Object.keys(t);for(let n=0;n0||!e&&a<0)return n.index}return null}function Ob(r,t){const{chart:e,_cachedMeta:i}=r,n=e._stacks||(e._stacks={}),{iScale:a,vScale:o,index:s}=i,l=a.axis,u=o.axis,h=SB(a,o,i),c=t.length;let f;for(let v=0;ve[i].axis===t).shift()}function MB(r,t){return Kn(r,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function CB(r,t,e){return Kn(r,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function tl(r,t){const e=r.controller.index,i=r.vScale&&r.vScale.axis;if(i){t=t||r._parsed;for(const n of t){const a=n._stacks;if(!a||a[i]===void 0||a[i][e]===void 0)return;delete a[i][e],a[i]._visualValues!==void 0&&a[i]._visualValues[e]!==void 0&&delete a[i]._visualValues[e]}}}const Od=r=>r==="reset"||r==="none",Nb=(r,t)=>t?r:Object.assign({},r),AB=(r,t,e)=>r&&!t.hidden&&t._stacked&&{keys:aL(e,!0),values:null};class Zr{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Rd(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&tl(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(c,f,v,d)=>c==="x"?f:c==="r"?d:v,a=e.xAxisID=bt(i.xAxisID,Ed(t,"x")),o=e.yAxisID=bt(i.yAxisID,Ed(t,"y")),s=e.rAxisID=bt(i.rAxisID,Ed(t,"r")),l=e.indexAxis,u=e.iAxisID=n(l,a,o,s),h=e.vAxisID=n(l,o,a,s);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(s),e.iScale=this.getScaleForId(u),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&mb(this._data,this),t._stacked&&tl(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Rt(e)){const n=this._cachedMeta;this._data=bB(e,n)}else if(i!==e){if(i){mb(i,this);const n=this._cachedMeta;tl(n),n._parsed=[]}e&&Object.isExtensible(e)&&cN(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const a=e._stacked;e._stacked=Rd(e.vScale,e),e.stack!==i.stack&&(n=!0,tl(e),e.stack=i.stack),this._resyncElements(t),(n||a!==e._stacked)&&(Ob(this,e._parsed),e._stacked=Rd(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:a,_stacked:o}=i,s=a.axis;let l=t===0&&e===n.length?!0:i._sorted,u=t>0&&i._parsed[t-1],h,c,f;if(this._parsing===!1)i._parsed=n,i._sorted=!0,f=n;else{jt(n[t])?f=this.parseArrayData(i,n,t,e):Rt(n[t])?f=this.parseObjectData(i,n,t,e):f=this.parsePrimitiveData(i,n,t,e);const v=()=>c[s]===null||u&&c[s]p||c=0;--f)if(!d()){this.updateRangeFromParsed(u,t,v,l);break}}return u}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,a,o;for(n=0,a=e.length;n=0&&tthis.getContext(i,n,e),p=u.resolveNamedOptions(f,v,d,c);return p.$shared&&(p.$shared=l,a[o]=Object.freeze(Nb(p,l))),p}_resolveAnimations(t,e,i){const n=this.chart,a=this._cachedDataOpts,o=`animation-${e}`,s=a[o];if(s)return s;let l;if(n.options.animation!==!1){const h=this.chart.config,c=h.datasetAnimationScopeKeys(this._type,e),f=h.getOptionScopes(this.getDataset(),c);l=h.createResolver(f,this.getContext(t,i,e))}const u=new nL(n,l&&l.animations);return l&&l._cacheable&&(a[o]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Od(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,a=this.getSharedOptions(i),o=this.includeOptions(e,a)||a!==n;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:o}}updateElement(t,e,i,n){Od(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Od(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const a=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[s,l,u]of this._syncList)this[s](l,u);this._syncList=[];const n=i.length,a=e.length,o=Math.min(a,n);o&&this.parse(0,o),a>n?this._insertElements(n,a-n,t):a{for(u.length+=e,s=u.length-1;s>=o;s--)u[s]=u[s-e]};for(l(a),s=t;sn-a))}return r._cache.$bar}function LB(r){const t=r.iScale,e=DB(t,r.type);let i=t._length,n,a,o,s;const l=()=>{o===32767||o===-32768||(Tu(s)&&(i=Math.min(i,Math.abs(o-s)||i)),s=o)};for(n=0,a=e.length;n0?n[r-1]:null,s=rMath.abs(s)&&(l=s,u=o),t[e.axis]=u,t._custom={barStart:l,barEnd:u,start:n,end:a,min:o,max:s}}function oL(r,t,e,i){return jt(r)?kB(r,t,e,i):t[e.axis]=e.parse(r,i),t}function Bb(r,t,e,i){const n=r.iScale,a=r.vScale,o=n.getLabels(),s=n===a,l=[];let u,h,c,f;for(u=e,h=e+i;u=e?1:-1)}function EB(r){let t,e,i,n,a;return r.horizontal?(t=r.base>r.x,e="left",i="right"):(t=r.baseh.controller.options.grouped),a=i.options.stacked,o=[],s=this._cachedMeta.controller.getParsed(e),l=s&&s[i.axis],u=h=>{const c=h._parsed.find(v=>v[i.axis]===l),f=c&&c[h.vScale.axis];if(It(f)||isNaN(f))return!0};for(const h of n)if(!(e!==void 0&&u(h))&&((a===!1||o.indexOf(h.stack)===-1||a===void 0&&h.stack===void 0)&&o.push(h.stack),h.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[bt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const n=this._getStacks(t,i),a=e!==void 0?n.indexOf(e):-1;return a===-1?n.length-1:a}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let a,o;for(a=0,o=e.data.length;a=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:a}=e,o=this.getParsed(t),s=n.getLabelForValue(o.x),l=a.getLabelForValue(o.y),u=o._custom;return{label:i[t]||"",value:"("+s+", "+l+(u?", "+u:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const a=n==="reset",{iScale:o,vScale:s}=this._cachedMeta,{sharedOptions:l,includeOptions:u}=this._getSharedOptions(e,n),h=o.axis,c=s.axis;for(let f=e;fMu(_,s,l,!0)?1:Math.max(x,x*e,b,b*e),d=(_,x,b)=>Mu(_,s,l,!0)?-1:Math.min(x,x*e,b,b*e),p=v(0,u,c),g=v(se,h,f),y=d(Nt,u,c),m=d(Nt+se,h,f);i=(p-y)/2,n=(g-m)/2,a=-(p+y)/2,o=-(g+m)/2}return{ratioX:i,ratioY:n,offsetX:a,offsetY:o}}class Tn extends Zr{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=i;else{let a=l=>+i[l];if(Rt(i[t])){const{key:l="value"}=this._parsing;a=u=>+Wn(i[u],l)}let o,s;for(o=t,s=t+e;o0&&!isNaN(t)?qt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=oh(e._parsed[t],i.options.locale);return{label:n[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,a,o,s,l;if(!t){for(n=0,a=i.data.datasets.length;nt!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),j(Tn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:n,color:a,useBorderRadius:o,borderRadius:s}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,u)=>{const c=t.getDatasetMeta(0).controller.getStyle(u);return{text:l,fillStyle:c.backgroundColor,fontColor:a,hidden:!t.getDataVisibility(u),lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:c.borderWidth,strokeStyle:c.borderColor,textAlign:n,pointStyle:i,borderRadius:o&&(s||c.borderRadius),index:u}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class iu extends Zr{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:a}=e,o=this.chart._animationsDisabled;let{start:s,count:l}=GD(e,n,o);this._drawStart=s,this._drawCount=l,HD(e)&&(s=0,l=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=n;const u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},t),this.updateElements(n,s,l,t)}updateElements(t,e,i,n){const a=n==="reset",{iScale:o,vScale:s,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:h,includeOptions:c}=this._getSharedOptions(e,n),f=o.axis,v=s.axis,{spanGaps:d,segment:p}=this.options,g=_s(d)?d:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||a||n==="none",m=e+i,_=t.length;let x=e>0&&this.getParsed(e-1);for(let b=0;b<_;++b){const S=t[b],w=y?S:{};if(b=m){w.skip=!0;continue}const T=this.getParsed(b),M=It(T[v]),C=w[f]=o.getPixelForValue(T[f],b),D=w[v]=a||M?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,T,l):T[v],b);w.skip=isNaN(C)||isNaN(D)||M,w.stop=b>0&&Math.abs(T[f]-x[f])>g,p&&(w.parsed=T,w.raw=u.data[b]),c&&(w.options=h||this.resolveDataElementOptions(b,S.active?"active":n)),y||this.updateElement(S,b,w,n),x=T}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const a=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,a,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}j(iu,"id","line"),j(iu,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),j(iu,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class nu extends Zr{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=oh(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:a}}parseObjectData(t,e,i,n){return qD.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,n)=>{const a=this.getParsed(n).r;!isNaN(a)&&this.chart.getDataVisibility(n)&&(ae.max&&(e.max=a))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(n/2,0),o=Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0),s=(a-o)/t.getVisibleDatasetCount();this.outerRadius=a-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,i,n){const a=n==="reset",o=this.chart,l=o.options.animation,u=this._cachedMeta.rScale,h=u.xCenter,c=u.yCenter,f=u.getIndexAngle(0)-.5*Nt;let v=f,d;const p=360/this.countVisibleElements();for(d=0;d{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Yr(this.resolveDataElementOptions(t,e).angle||i):0}}j(nu,"id","polarArea"),j(nu,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),j(nu,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map((a,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:n,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Cf extends Tn{}j(Cf,"id","pie"),j(Cf,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class jc extends Zr{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return qD.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],a=e.iScale.getLabels();if(i.points=n,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const s={_loop:!0,_fullLoop:a.length===n.length,options:o};this.updateElement(i,void 0,s,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const a=this._cachedMeta.rScale,o=n==="reset";for(let s=e;s0&&this.getParsed(e-1);for(let x=e;x0&&Math.abs(S[v]-_[v])>y,g&&(w.parsed=S,w.raw=u.data[x]),f&&(w.options=c||this.resolveDataElementOptions(x,b.active?"active":n)),m||this.updateElement(b,x,w,n),_=S}this.updateSharedOptions(c,n,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let s=0;for(let l=e.length-1;l>=0;--l)s=Math.max(s,e[l].size(this.resolveDataElementOptions(l))/2);return s>0&&s}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const a=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,a,o)/2}}j(qc,"id","scatter"),j(qc,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),j(qc,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var VB=Object.freeze({__proto__:null,BarController:ru,BubbleController:Zc,DoughnutController:Tn,LineController:iu,PieController:Cf,PolarAreaController:nu,RadarController:jc,ScatterController:qc});function oa(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class N0{constructor(t){j(this,"options");this.options=t||{}}static override(t){Object.assign(N0.prototype,t)}init(){}formats(){return oa()}parse(){return oa()}format(){return oa()}add(){return oa()}diff(){return oa()}startOf(){return oa()}endOf(){return oa()}}var FB={_date:N0};function GB(r,t,e,i){const{controller:n,data:a,_sorted:o}=r,s=n._cachedMeta.iScale,l=r.dataset&&r.dataset.options?r.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!=="r"&&o&&a.length){const u=s._reversePixels?uN:Gi;if(i){if(n._sharedOptions){const h=a[0],c=typeof h.getRange=="function"&&h.getRange(t);if(c){const f=u(a,t,e-c),v=u(a,t,e+c);return{lo:f.lo,hi:v.hi}}}}else{const h=u(a,t,e);if(l){const{vScale:c}=n._cachedMeta,{_parsed:f}=r,v=f.slice(0,h.lo+1).reverse().findIndex(p=>!It(p[c.axis]));h.lo-=Math.max(0,v);const d=f.slice(h.hi).findIndex(p=>!It(p[c.axis]));h.hi+=Math.max(0,d)}return h}}return{lo:0,hi:a.length-1}}function kv(r,t,e,i,n){const a=r.getSortedVisibleDatasetMetas(),o=e[t];for(let s=0,l=a.length;s{l[o]&&l[o](t[e],n)&&(a.push({element:l,datasetIndex:u,index:h}),s=s||l.inRange(t.x,t.y,n))}),i&&!s?[]:a}var YB={modes:{index(r,t,e,i){const n=ka(t,r),a=e.axis||"x",o=e.includeInvisible||!1,s=e.intersect?Bd(r,n,a,i,o):zd(r,n,a,!1,i,o),l=[];return s.length?(r.getSortedVisibleDatasetMetas().forEach(u=>{const h=s[0].index,c=u.data[h];c&&!c.skip&&l.push({element:c,datasetIndex:u.index,index:h})}),l):[]},dataset(r,t,e,i){const n=ka(t,r),a=e.axis||"xy",o=e.includeInvisible||!1;let s=e.intersect?Bd(r,n,a,i,o):zd(r,n,a,!1,i,o);if(s.length>0){const l=s[0].datasetIndex,u=r.getDatasetMeta(l).data;s=[];for(let h=0;he.pos===t)}function Gb(r,t){return r.filter(e=>sL.indexOf(e.pos)===-1&&e.box.axis===t)}function rl(r,t){return r.sort((e,i)=>{const n=t?i:e,a=t?e:i;return n.weight===a.weight?n.index-a.index:n.weight-a.weight})}function $B(r){const t=[];let e,i,n,a,o,s;for(e=0,i=(r||[]).length;eu.box.fullSize),!0),i=rl(el(t,"left"),!0),n=rl(el(t,"right")),a=rl(el(t,"top"),!0),o=rl(el(t,"bottom")),s=Gb(t,"x"),l=Gb(t,"y");return{fullSize:e,leftAndTop:i.concat(a),rightAndBottom:n.concat(l).concat(o).concat(s),chartArea:el(t,"chartArea"),vertical:i.concat(n).concat(l),horizontal:a.concat(o).concat(s)}}function Hb(r,t,e,i){return Math.max(r[e],t[e])+Math.max(r[i],t[i])}function lL(r,t){r.top=Math.max(r.top,t.top),r.left=Math.max(r.left,t.left),r.bottom=Math.max(r.bottom,t.bottom),r.right=Math.max(r.right,t.right)}function qB(r,t,e,i){const{pos:n,box:a}=e,o=r.maxPadding;if(!Rt(n)){e.size&&(r[n]-=e.size);const c=i[e.stack]||{size:0,count:1};c.size=Math.max(c.size,e.horizontal?a.height:a.width),e.size=c.size/c.count,r[n]+=e.size}a.getPadding&&lL(o,a.getPadding());const s=Math.max(0,t.outerWidth-Hb(o,r,"left","right")),l=Math.max(0,t.outerHeight-Hb(o,r,"top","bottom")),u=s!==r.w,h=l!==r.h;return r.w=s,r.h=l,e.horizontal?{same:u,other:h}:{same:h,other:u}}function KB(r){const t=r.maxPadding;function e(i){const n=Math.max(t[i]-r[i],0);return r[i]+=n,n}r.y+=e("top"),r.x+=e("left"),e("right"),e("bottom")}function JB(r,t){const e=t.maxPadding;function i(n){const a={left:0,top:0,right:0,bottom:0};return n.forEach(o=>{a[o]=Math.max(t[o],e[o])}),a}return i(r?["left","right"]:["top","bottom"])}function Nl(r,t,e,i){const n=[];let a,o,s,l,u,h;for(a=0,o=r.length,u=0;a{typeof p.beforeLayout=="function"&&p.beforeLayout()});const h=l.reduce((p,g)=>g.box.options&&g.box.options.display===!1?p:p+1,0)||1,c=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/h,hBoxMaxHeight:o/2}),f=Object.assign({},n);lL(f,ze(i));const v=Object.assign({maxPadding:f,w:a,h:o,x:n.left,y:n.top},n),d=ZB(l.concat(u),c);Nl(s.fullSize,v,c,d),Nl(l,v,c,d),Nl(u,v,c,d)&&Nl(l,v,c,d),KB(v),Wb(s.leftAndTop,v,c,d),v.x+=v.w,v.y+=v.h,Wb(s.rightAndBottom,v,c,d),r.chartArea={left:v.left,top:v.top,right:v.left+v.w,bottom:v.top+v.h,height:v.h,width:v.w},Wt(s.chartArea,p=>{const g=p.box;Object.assign(g,r.chartArea),g.update(v.w,v.h,{left:0,top:0,right:0,bottom:0})})}};class uL{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class QB extends uL{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Kc="$chartjs",tz={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ub=r=>r===null||r==="";function ez(r,t){const e=r.style,i=r.getAttribute("height"),n=r.getAttribute("width");if(r[Kc]={initial:{height:i,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ub(n)){const a=Ab(r,"width");a!==void 0&&(r.width=a)}if(Ub(i))if(r.style.height==="")r.height=r.width/(t||2);else{const a=Ab(r,"height");a!==void 0&&(r.height=a)}return r}const hL=rB?{passive:!0}:!1;function rz(r,t,e){r&&r.addEventListener(t,e,hL)}function iz(r,t,e){r&&r.canvas&&r.canvas.removeEventListener(t,e,hL)}function nz(r,t){const e=tz[r.type]||r.type,{x:i,y:n}=ka(r,t);return{type:e,chart:t,native:r,x:i!==void 0?i:null,y:n!==void 0?n:null}}function Af(r,t){for(const e of r)if(e===t||e.contains(t))return!0}function az(r,t,e){const i=r.canvas,n=new MutationObserver(a=>{let o=!1;for(const s of a)o=o||Af(s.addedNodes,i),o=o&&!Af(s.removedNodes,i);o&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function oz(r,t,e){const i=r.canvas,n=new MutationObserver(a=>{let o=!1;for(const s of a)o=o||Af(s.removedNodes,i),o=o&&!Af(s.addedNodes,i);o&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Au=new Map;let Yb=0;function cL(){const r=window.devicePixelRatio;r!==Yb&&(Yb=r,Au.forEach((t,e)=>{e.currentDevicePixelRatio!==r&&t()}))}function sz(r,t){Au.size||window.addEventListener("resize",cL),Au.set(r,t)}function lz(r){Au.delete(r),Au.size||window.removeEventListener("resize",cL)}function uz(r,t,e){const i=r.canvas,n=i&&O0(i);if(!n)return;const a=FD((s,l)=>{const u=n.clientWidth;e(s,l),u{const l=s[0],u=l.contentRect.width,h=l.contentRect.height;u===0&&h===0||a(u,h)});return o.observe(n),sz(r,a),o}function Vd(r,t,e){e&&e.disconnect(),t==="resize"&&lz(r)}function hz(r,t,e){const i=r.canvas,n=FD(a=>{r.ctx!==null&&e(nz(a,r))},r);return rz(i,t,n),n}class cz extends uL{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(ez(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Kc])return!1;const i=e[Kc].initial;["height","width"].forEach(a=>{const o=i[a];It(o)?e.removeAttribute(a):e.setAttribute(a,o)});const n=i.style||{};return Object.keys(n).forEach(a=>{e.style[a]=n[a]}),e.width=e.width,delete e[Kc],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),o={attach:az,detach:oz,resize:uz}[e]||hz;n[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:Vd,detach:Vd,resize:Vd}[e]||iz)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return eB(t,e,i,n)}isAttached(t){const e=t&&O0(t);return!!(e&&e.isConnected)}}function fz(r){return!E0()||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas?QB:cz}var $c;let an=($c=class{constructor(){j(this,"x");j(this,"y");j(this,"active",!1);j(this,"options");j(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return _s(this.x)&&_s(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(a=>{n[a]=i[a]&&i[a].active()?i[a]._to:this[a]}),n}},j($c,"defaults",{}),j($c,"defaultRoutes"),$c);function vz(r,t){const e=r.options.ticks,i=dz(r),n=Math.min(e.maxTicksLimit||i,i),a=e.major.enabled?gz(t):[],o=a.length,s=a[0],l=a[o-1],u=[];if(o>n)return yz(t,u,a,o/n),u;const h=pz(a,t,n);if(o>0){let c,f;const v=o>1?Math.round((l-s)/(o-1)):null;for(zh(t,u,h,It(v)?0:s-v,s),c=0,f=o-1;cn)return l}return Math.max(n,1)}function gz(r){const t=[];let e,i;for(e=0,i=r.length;er==="left"?"right":r==="right"?"left":r,$b=(r,t,e)=>t==="top"||t==="left"?r[t]+e:r[t]-e,Xb=(r,t)=>Math.min(t||r,r);function Zb(r,t){const e=[],i=r.length/t,n=r.length;let a=0;for(;ao+s)))return l}function bz(r,t){Wt(r,e=>{const i=e.gc,n=i.length/2;let a;if(n>t){for(a=0;ai?i:e,i=n&&e>i?e:i,{min:ur(e,ur(i,e)),max:ur(i,ur(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Zt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:a,ticks:o}=this.options,s=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=RN(this,a,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s=a||i<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),c=h.widest.width,f=h.highest.height,v=Se(this.chart.width-c,0,this.maxWidth);s=t.offset?this.maxWidth/i:v/(i-1),c+6>s&&(s=v/(i-(t.offset?.5:1)),l=this.maxHeight-il(t.grid)-e.padding-jb(t.title,this.chart.options.font),u=Math.sqrt(c*c+f*f),o=C0(Math.min(Math.asin(Se((h.highest.height+6)/s,-1,1)),Math.asin(Se(l/u,-1,1))-Math.asin(Se(f/u,-1,1)))),o=Math.max(n,Math.min(a,o))),this.labelRotation=o}afterCalculateLabelRotation(){Zt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Zt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:a}}=this,o=this._isVisible(),s=this.isHorizontal();if(o){const l=jb(n,e.options.font);if(s?(t.width=this.maxWidth,t.height=il(a)+l):(t.height=this.maxHeight,t.width=il(a)+l),i.display&&this.ticks.length){const{first:u,last:h,widest:c,highest:f}=this._getLabelSizes(),v=i.padding*2,d=Yr(this.labelRotation),p=Math.cos(d),g=Math.sin(d);if(s){const y=i.mirror?0:g*c.width+p*f.height;t.height=Math.min(this.maxHeight,t.height+y+v)}else{const y=i.mirror?0:p*c.width+g*f.height;t.width=Math.min(this.maxWidth,t.width+y+v)}this._calculatePadding(u,h,g,p)}}this._handleMargins(),s?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:a,padding:o},position:s}=this.options,l=this.labelRotation!==0,u=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,v=0;l?u?(f=n*t.width,v=i*e.height):(f=i*t.height,v=n*e.width):a==="start"?v=e.width:a==="end"?f=t.width:a!=="inner"&&(f=t.width/2,v=e.width/2),this.paddingLeft=Math.max((f-h+o)*this.width/(this.width-h),0),this.paddingRight=Math.max((v-c+o)*this.width/(this.width-c),0)}else{let h=e.height/2,c=t.height/2;a==="start"?(h=0,c=t.height):a==="end"&&(h=e.height,c=0),this.paddingTop=h+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Zt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e({width:o[M]||0,height:s[M]||0});return{first:T(0),last:T(e-1),widest:T(S),highest:T(w),widths:o,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return lN(this._alignToPixels?aa(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ts*n?s/i:l/n:l*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:a,position:o,border:s}=n,l=a.offset,u=this.isHorizontal(),c=this.ticks.length+(l?1:0),f=il(a),v=[],d=s.setContext(this.getContext()),p=d.display?d.width:0,g=p/2,y=function(R){return aa(i,R,p)};let m,_,x,b,S,w,T,M,C,D,L,I;if(o==="top")m=y(this.bottom),w=this.bottom-f,M=m-g,D=y(t.top)+g,I=t.bottom;else if(o==="bottom")m=y(this.top),D=t.top,I=y(t.bottom)-g,w=m+g,M=this.top+f;else if(o==="left")m=y(this.right),S=this.right-f,T=m-g,C=y(t.left)+g,L=t.right;else if(o==="right")m=y(this.left),C=t.left,L=y(t.right)-g,S=m+g,T=this.left+f;else if(e==="x"){if(o==="center")m=y((t.top+t.bottom)/2+.5);else if(Rt(o)){const R=Object.keys(o)[0],N=o[R];m=y(this.chart.scales[R].getPixelForValue(N))}D=t.top,I=t.bottom,w=m+g,M=w+f}else if(e==="y"){if(o==="center")m=y((t.left+t.right)/2);else if(Rt(o)){const R=Object.keys(o)[0],N=o[R];m=y(this.chart.scales[R].getPixelForValue(N))}S=m-g,T=S-f,C=t.left,L=t.right}const P=bt(n.ticks.maxTicksLimit,c),k=Math.max(1,Math.ceil(c/P));for(_=0;_0&&(Ct-=K/2);break}H={left:Ct,top:nt,width:K+W.width,height:q+W.height,color:k.backdropColor}}g.push({label:x,font:M,textOffset:L,options:{rotation:p,color:N,strokeColor:O,strokeWidth:B,textAlign:G,textBaseline:I,translation:[b,S],backdrop:H}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Yr(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:a}}=this.options,o=this._getLabelSizes(),s=t+a,l=o.widest.width;let u,h;return e==="left"?n?(h=this.right+a,i==="near"?u="left":i==="center"?(u="center",h+=l/2):(u="right",h+=l)):(h=this.right-s,i==="near"?u="right":i==="center"?(u="center",h-=l/2):(u="left",h=this.left)):e==="right"?n?(h=this.left+a,i==="near"?u="right":i==="center"?(u="center",h-=l/2):(u="left",h-=l)):(h=this.left+s,i==="near"?u="left":i==="center"?(u="center",h+=l/2):(u="right",h=this.right)):u="right",{textAlign:u,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:a,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,a,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(a=>a.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,o;const s=(l,u,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(e.display)for(a=0,o=n.length;a{this.draw(a)}}]:[{z:i,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let a,o;for(a=0,o=e.length;a{const i=e.split("."),n=i.pop(),a=[r].concat(i).join("."),o=t[e].split("."),s=o.pop(),l=o.join(".");Jt.route(a,n,l,s)})}function Dz(r){return"id"in r&&"defaults"in r}class Lz{constructor(){this.controllers=new Vh(Zr,"datasets",!0),this.elements=new Vh(an,"elements"),this.plugins=new Vh(Object,"plugins"),this.scales=new Vh(sh,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(n=>{const a=i||this._getRegistryForType(n);i||a.isForType(n)||a===this.plugins&&n.id?this._exec(t,a,n):Wt(n,o=>{const s=i||this._getRegistryForType(o);this._exec(t,s,o)})})}_exec(t,e,i){const n=M0(t);Zt(i["before"+n],[],i),e[t](i),Zt(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;ea.filter(s=>!o.some(l=>s.plugin.id===l.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Pz(r){const t={},e=[],i=Object.keys(fi.plugins.items);for(let a=0;a1&&qb(r[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${r}' axis. Please provide 'axis' or 'position' option.`)}function Kb(r,t,e){if(e[t+"AxisID"]===r)return{axis:t}}function zz(r,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===r||i.yAxisID===r);if(e.length)return Kb(r,"x",e[0])||Kb(r,"y",e[0])}return{}}function Vz(r,t){const e=lo[r.type]||{scales:{}},i=t.scales||{},n=yy(r.type,t),a=Object.create(null);return Object.keys(i).forEach(o=>{const s=i[o];if(!Rt(s))return console.error(`Invalid scale configuration for scale: ${o}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=my(o,s,zz(o,r),Jt.scales[s.type]),u=Nz(l,n),h=e.scales||{};a[o]=Jl(Object.create(null),[{axis:l},s,h[l],h[u]])}),r.data.datasets.forEach(o=>{const s=o.type||r.type,l=o.indexAxis||yy(s,t),h=(lo[s]||{}).scales||{};Object.keys(h).forEach(c=>{const f=Oz(c,l),v=o[f+"AxisID"]||f;a[v]=a[v]||Object.create(null),Jl(a[v],[{axis:f},i[v],h[c]])})}),Object.keys(a).forEach(o=>{const s=a[o];Jl(s,[Jt.scales[s.type],Jt.scale])}),a}function vL(r){const t=r.options||(r.options={});t.plugins=bt(t.plugins,{}),t.scales=Vz(r,t)}function dL(r){return r=r||{},r.datasets=r.datasets||[],r.labels=r.labels||[],r}function Fz(r){return r=r||{},r.data=dL(r.data),vL(r),r}const Jb=new Map,pL=new Set;function Fh(r,t){let e=Jb.get(r);return e||(e=t(),Jb.set(r,e),pL.add(e)),e}const nl=(r,t,e)=>{const i=Wn(t,e);i!==void 0&&r.add(i)};class Gz{constructor(t){this._config=Fz(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=dL(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),vL(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Fh(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Fh(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Fh(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Fh(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:a}=this,o=this._cachedScopes(t,i),s=o.get(e);if(s)return s;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(c=>nl(l,t,c))),h.forEach(c=>nl(l,n,c)),h.forEach(c=>nl(l,lo[a]||{},c)),h.forEach(c=>nl(l,Jt,c)),h.forEach(c=>nl(l,py,c))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),pL.has(e)&&o.set(e,u),u}chartOptionScopes(){const{options:t,type:e}=this;return[t,lo[e]||{},Jt.datasets[e]||{},{type:e},Jt,py]}resolveNamedOptions(t,e,i,n=[""]){const a={$shared:!0},{resolver:o,subPrefixes:s}=Qb(this._resolverCache,t,n);let l=o;if(Wz(o,e)){a.$shared=!1,i=Un(i)?i():i;const u=this.createResolver(t,i,s);l=xs(o,i,u)}for(const u of e)a[u]=l[u];return a}createResolver(t,e,i=[""],n){const{resolver:a}=Qb(this._resolverCache,t,i);return Rt(e)?xs(a,e,void 0,n):a}}function Qb(r,t,e){let i=r.get(t);i||(i=new Map,r.set(t,i));const n=e.join();let a=i.get(n);return a||(a={resolver:P0(t,e),subPrefixes:e.filter(s=>!s.toLowerCase().includes("hover"))},i.set(n,a)),a}const Hz=r=>Rt(r)&&Object.getOwnPropertyNames(r).some(t=>Un(r[t]));function Wz(r,t){const{isScriptable:e,isIndexable:i}=$D(r);for(const n of t){const a=e(n),o=i(n),s=(o||a)&&r[n];if(a&&(Un(s)||Hz(s))||o&&jt(s))return!0}return!1}var Uz="4.5.1";const Yz=["top","bottom","left","right","chartArea"];function t1(r,t){return r==="top"||r==="bottom"||Yz.indexOf(r)===-1&&t==="x"}function e1(r,t){return function(e,i){return e[r]===i[r]?e[t]-i[t]:e[r]-i[r]}}function r1(r){const t=r.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Zt(e&&e.onComplete,[r],t)}function $z(r){const t=r.chart,e=t.options.animation;Zt(e&&e.onProgress,[r],t)}function gL(r){return E0()&&typeof r=="string"?r=document.getElementById(r):r&&r.length&&(r=r[0]),r&&r.canvas&&(r=r.canvas),r}const Jc={},i1=r=>{const t=gL(r);return Object.values(Jc).filter(e=>e.canvas===t).pop()};function Xz(r,t,e){const i=Object.keys(r);for(const n of i){const a=+n;if(a>=t){const o=r[n];delete r[n],(e>0||a>t)&&(r[a+e]=o)}}}function Zz(r,t,e,i){return!e||r.type==="mouseout"?null:i?t:r}var gn;let B0=(gn=class{static register(...t){fi.add(...t),n1()}static unregister(...t){fi.remove(...t),n1()}constructor(t,e){const i=this.config=new Gz(e),n=gL(t),a=i1(n);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||fz(n)),this.platform.updateConfig(i);const s=this.platform.acquireContext(n,o.aspectRatio),l=s&&s.canvas,u=l&&l.height,h=l&&l.width;if(this.id=jO(),this.ctx=s,this.canvas=l,this.width=h,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Iz,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=fN(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Jc[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Oi.listen(this,"complete",r1),Oi.listen(this,"progress",$z),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:a}=this;return It(t)?e&&a?a:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return fi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Cb(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return wb(this.canvas,this.ctx),this}stop(){return Oi.stop(this),this}resize(t,e){Oi.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,a),s=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Cb(this,s,!0)&&(this.notifyPlugins("resize",{size:o}),Zt(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Wt(e,(i,n)=>{i.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((o,s)=>(o[s]=!1,o),{});let a=[];e&&(a=a.concat(Object.keys(e).map(o=>{const s=e[o],l=my(o,s),u=l==="r",h=l==="x";return{options:s,dposition:u?"chartArea":h?"bottom":"left",dtype:u?"radialLinear":h?"category":"linear"}}))),Wt(a,o=>{const s=o.options,l=s.id,u=my(l,s),h=bt(s.type,o.dtype);(s.position===void 0||t1(s.position,u)!==t1(o.dposition))&&(s.position=o.dposition),n[l]=!0;let c=null;if(l in i&&i[l].type===h)c=i[l];else{const f=fi.getScale(h);c=new f({id:l,type:h,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(s,t)}),Wt(n,(o,s)=>{o||delete i[s]}),Wt(i,o=>{Ne.configure(this,o,o.options),Ne.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((n,a)=>n.index-a.index),i>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((i,n)=>{e.filter(a=>a===i._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,h=this.data.datasets.length;u{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(e1("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){Wt(this.scales,t=>{Ne.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!db(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:a}of e){const o=i==="_removeElements"?-a:a;Xz(t,n,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=a=>new Set(t.filter(o=>o[0]===a).map((o,s)=>s+","+o.splice(1).join(","))),n=i(0);for(let a=1;aa.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ne.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Wt(this.boxes,n=>{i&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,a)=>{n._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},n=iL(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(n&&Lv(e,n),t.controller.draw(),n&&Iv(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Hi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const a=YB.modes[e];return typeof a=="function"?a(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(a=>a&&a._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=Kn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",a=this.getDatasetMeta(t),o=a.controller._resolveAnimations(void 0,n);Tu(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(a,{visible:i}),this.update(s=>s.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Oi.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,a,o),t[a]=o},n=(a,o,s)=>{a.offsetX=o,a.offsetY=s,this._eventHandler(a)};Wt(this.options.events,a=>i(a,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,u)=>{e.addEventListener(this,l,u),t[l]=u},n=(l,u)=>{t[l]&&(e.removeEventListener(this,l,u),delete t[l])},a=(l,u)=>{this.canvas&&this.resize(l,u)};let o;const s=()=>{n("attach",s),this.attached=!0,this.resize(),i("resize",a),i("detach",o)};o=()=>{this.attached=!1,n("resize",a),this._stop(),this._resize(0,0),i("attach",s)},e.isAttached(this.canvas)?s():o()}unbindEvents(){Wt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Wt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let a,o,s,l;for(e==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+n+"DatasetHoverStyle"]()),s=0,l=t.length;s{const s=this.getDatasetMeta(a);if(!s)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:s.data[o],index:o}});!bf(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const n=this.options.hover,a=(l,u)=>l.filter(h=>!u.some(c=>h.datasetIndex===c.datasetIndex&&h.index===c.index)),o=a(e,t),s=i?t:a(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),s.length&&n.mode&&this.updateHoverStyle(s,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,n)===!1)return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:a}=this,o=e,s=this._getActiveElements(t,n,i,o),l=eN(t),u=Zz(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Zt(a.onHover,[t,s,this],this),l&&Zt(a.onClick,[t,s,this],this));const h=!bf(s,n);return(h||e)&&(this._active=s,this._updateHoverStyles(s,n,e)),this._lastEvent=u,h}_getActiveElements(t,e,i,n){if(t.type==="mouseout")return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,n)}},j(gn,"defaults",Jt),j(gn,"instances",Jc),j(gn,"overrides",lo),j(gn,"registry",fi),j(gn,"version",Uz),j(gn,"getChart",i1),gn);function n1(){return Wt(B0.instances,r=>r._plugins.invalidate())}function jz(r,t,e){const{startAngle:i,x:n,y:a,outerRadius:o,innerRadius:s,options:l}=t,{borderWidth:u,borderJoinStyle:h}=l,c=Math.min(u/o,Ee(i-e));if(r.beginPath(),r.arc(n,a,o-u/2,i+c/2,e-c/2),s>0){const f=Math.min(u/s,Ee(i-e));r.arc(n,a,s+u/2,e-f/2,i+f/2,!0)}else{const f=Math.min(u/2,o*Ee(i-e));if(h==="round")r.arc(n,a,f,e-Nt/2,i+Nt/2,!0);else if(h==="bevel"){const v=2*f*f,d=-v*Math.cos(e+Nt/2)+n,p=-v*Math.sin(e+Nt/2)+a,g=v*Math.cos(i+Nt/2)+n,y=v*Math.sin(i+Nt/2)+a;r.lineTo(d,p),r.lineTo(g,y)}}r.closePath(),r.moveTo(0,0),r.rect(0,0,r.canvas.width,r.canvas.height),r.clip("evenodd")}function qz(r,t,e){const{startAngle:i,pixelMargin:n,x:a,y:o,outerRadius:s,innerRadius:l}=t;let u=n/s;r.beginPath(),r.arc(a,o,s,i-u,e+u),l>n?(u=n/l,r.arc(a,o,l,e+u,i-u,!0)):r.arc(a,o,n,e+se,i-se),r.closePath(),r.clip()}function Kz(r){return I0(r,["outerStart","outerEnd","innerStart","innerEnd"])}function Jz(r,t,e,i){const n=Kz(r.options.borderRadius),a=(e-t)/2,o=Math.min(a,i*t/2),s=l=>{const u=(e-Math.min(a,l))*i/2;return Se(l,0,Math.min(a,u))};return{outerStart:s(n.outerStart),outerEnd:s(n.outerEnd),innerStart:Se(n.innerStart,0,o),innerEnd:Se(n.innerEnd,0,o)}}function Io(r,t,e,i){return{x:e+r*Math.cos(t),y:i+r*Math.sin(t)}}function Df(r,t,e,i,n,a){const{x:o,y:s,startAngle:l,pixelMargin:u,innerRadius:h}=t,c=Math.max(t.outerRadius+i+e-u,0),f=h>0?h+i+e+u:0;let v=0;const d=n-l;if(i){const k=h>0?h-i:0,R=c>0?c-i:0,N=(k+R)/2,O=N!==0?d*N/(N+i):d;v=(d-O)/2}const p=Math.max(.001,d*c-e/Nt)/c,g=(d-p)/2,y=l+g+v,m=n-g-v,{outerStart:_,outerEnd:x,innerStart:b,innerEnd:S}=Jz(t,f,c,m-y),w=c-_,T=c-x,M=y+_/w,C=m-x/T,D=f+b,L=f+S,I=y+b/D,P=m-S/L;if(r.beginPath(),a){const k=(M+C)/2;if(r.arc(o,s,c,M,k),r.arc(o,s,c,k,C),x>0){const B=Io(T,C,o,s);r.arc(B.x,B.y,x,C,m+se)}const R=Io(L,m,o,s);if(r.lineTo(R.x,R.y),S>0){const B=Io(L,P,o,s);r.arc(B.x,B.y,S,m+se,P+Math.PI)}const N=(m-S/f+(y+b/f))/2;if(r.arc(o,s,f,m-S/f,N,!0),r.arc(o,s,f,N,y+b/f,!0),b>0){const B=Io(D,I,o,s);r.arc(B.x,B.y,b,I+Math.PI,y-se)}const O=Io(w,y,o,s);if(r.lineTo(O.x,O.y),_>0){const B=Io(w,M,o,s);r.arc(B.x,B.y,_,y-se,M)}}else{r.moveTo(o,s);const k=Math.cos(M)*c+o,R=Math.sin(M)*c+s;r.lineTo(k,R);const N=Math.cos(C)*c+o,O=Math.sin(C)*c+s;r.lineTo(N,O)}r.closePath()}function Qz(r,t,e,i,n){const{fullCircles:a,startAngle:o,circumference:s}=t;let l=t.endAngle;if(a){Df(r,t,e,i,l,n);for(let u=0;u=Nt&&v===0&&h!=="miter"&&jz(r,t,p),a||(Df(r,t,e,i,p,n),r.stroke())}class Bl extends an{constructor(e){super();j(this,"circumference");j(this,"endAngle");j(this,"fullCircles");j(this,"innerRadius");j(this,"outerRadius");j(this,"pixelMargin");j(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,n){const a=this.getProps(["x","y"],n),{angle:o,distance:s}=ND(a,{x:e,y:i}),{startAngle:l,endAngle:u,innerRadius:h,outerRadius:c,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),v=(this.options.spacing+this.options.borderWidth)/2,d=bt(f,u-l),p=Mu(o,l,u)&&l!==u,g=d>=qt||p,y=Fi(s,h+v,c+v);return g&&y}getCenterPoint(e){const{x:i,y:n,startAngle:a,endAngle:o,innerRadius:s,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:u,spacing:h}=this.options,c=(a+o)/2,f=(s+l+h+u)/2;return{x:i+Math.cos(c)*f,y:n+Math.sin(c)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:n}=this,a=(i.offset||0)/4,o=(i.spacing||0)/2,s=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=n>qt?Math.floor(n/qt):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*a,Math.sin(l)*a);const u=1-Math.sin(Math.min(Nt,n||0)),h=a*u;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Qz(e,this,h,o,s),tV(e,this,h,o,s),e.restore()}}j(Bl,"id","arc"),j(Bl,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),j(Bl,"defaultRoutes",{backgroundColor:"backgroundColor"}),j(Bl,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function yL(r,t,e=t){r.lineCap=bt(e.borderCapStyle,t.borderCapStyle),r.setLineDash(bt(e.borderDash,t.borderDash)),r.lineDashOffset=bt(e.borderDashOffset,t.borderDashOffset),r.lineJoin=bt(e.borderJoinStyle,t.borderJoinStyle),r.lineWidth=bt(e.borderWidth,t.borderWidth),r.strokeStyle=bt(e.borderColor,t.borderColor)}function eV(r,t,e){r.lineTo(e.x,e.y)}function rV(r){return r.stepped?TN:r.tension||r.cubicInterpolationMode==="monotone"?MN:eV}function mL(r,t,e={}){const i=r.length,{start:n=0,end:a=i-1}=e,{start:o,end:s}=t,l=Math.max(n,o),u=Math.min(a,s),h=ns&&a>s;return{count:i,start:l,loop:t.loop,ilen:u(o+(u?s-x:x))%a,_=()=>{p!==g&&(r.lineTo(h,g),r.lineTo(h,p),r.lineTo(h,y))};for(l&&(v=n[m(0)],r.moveTo(v.x,v.y)),f=0;f<=s;++f){if(v=n[m(f)],v.skip)continue;const x=v.x,b=v.y,S=x|0;S===d?(bg&&(g=b),h=(c*h+x)/++c):(_(),r.lineTo(x,b),d=S,c=0,p=g=b),y=b}_()}function _y(r){const t=r.options,e=t.borderDash&&t.borderDash.length;return!r._decimated&&!r._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?nV:iV}function aV(r){return r.stepped?iB:r.tension||r.cubicInterpolationMode==="monotone"?nB:Ra}function oV(r,t,e,i){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,i)&&n.closePath()),yL(r,t.options),r.stroke(n)}function sV(r,t,e,i){const{segments:n,options:a}=t,o=_y(t);for(const s of n)yL(r,a,s.style),r.beginPath(),o(r,t,s,{start:e,end:e+i-1})&&r.closePath(),r.stroke()}const lV=typeof Path2D=="function";function uV(r,t,e,i){lV&&!t.options.segment?oV(r,t,e,i):sV(r,t,e,i)}class Mn extends an{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;jN(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=hB(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],a=this.points,o=rL(this,{property:e,start:n,end:n});if(!o.length)return;const s=[],l=aV(i);let u,h;for(u=0,h=o.length;ut!=="borderDash"&&t!=="fill"});function a1(r,t,e,i){const n=r.options,{[e]:a}=r.getProps([e],i);return Math.abs(t-a)r.replace("rgb(","rgba(").replace(")",", 0.5)"));function xL(r){return xy[r%xy.length]}function bL(r){return o1[r%o1.length]}function gV(r,t){return r.borderColor=xL(t),r.backgroundColor=bL(t),++t}function yV(r,t){return r.backgroundColor=r.data.map(()=>xL(t++)),t}function mV(r,t){return r.backgroundColor=r.data.map(()=>bL(t++)),t}function _V(r){let t=0;return(e,i)=>{const n=r.getDatasetMeta(i).controller;n instanceof Tn?t=yV(e,t):n instanceof nu?t=mV(e,t):n&&(t=gV(e,t))}}function s1(r){let t;for(t in r)if(r[t].borderColor||r[t].backgroundColor)return!0;return!1}function xV(r){return r&&(r.borderColor||r.backgroundColor)}function bV(){return Jt.borderColor!=="rgba(0,0,0,0.1)"||Jt.backgroundColor!=="rgba(0,0,0,0.1)"}var SV={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(r,t,e){if(!e.enabled)return;const{data:{datasets:i},options:n}=r.config,{elements:a}=n,o=s1(i)||xV(n)||a&&s1(a)||bV();if(!e.forceOverride&&o)return;const s=_V(r);i.forEach(s)}};function wV(r,t,e,i,n){const a=n.samples||i;if(a>=e)return r.slice(t,t+e);const o=[],s=(e-2)/(a-2);let l=0;const u=t+e-1;let h=t,c,f,v,d,p;for(o[l++]=r[h],c=0;cv&&(v=d,f=r[m],p=m);o[l++]=f,h=p}return o[l++]=r[u],o}function TV(r,t,e,i){let n=0,a=0,o,s,l,u,h,c,f,v,d,p;const g=[],y=t+e-1,m=r[t].x,x=r[y].x-m;for(o=t;op&&(p=u,f=o),n=(a*n+s.x)/++a;else{const S=o-1;if(!It(c)&&!It(f)){const w=Math.min(c,f),T=Math.max(c,f);w!==v&&w!==S&&g.push({...r[w],x:n}),T!==v&&T!==S&&g.push({...r[T],x:n})}o>0&&S!==v&&g.push(r[S]),g.push(s),h=b,a=0,d=p=u,c=f=v=o}}return g}function SL(r){if(r._decimated){const t=r._data;delete r._decimated,delete r._data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function l1(r){r.data.datasets.forEach(t=>{SL(t)})}function MV(r,t){const e=t.length;let i=0,n;const{iScale:a}=r,{min:o,max:s,minDefined:l,maxDefined:u}=a.getUserBounds();return l&&(i=Se(Gi(t,a.axis,o).lo,0,e-1)),u?n=Se(Gi(t,a.axis,s).hi+1,i,e)-i:n=e-i,{start:i,count:n}}var CV={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(r,t,e)=>{if(!e.enabled){l1(r);return}const i=r.width;r.data.datasets.forEach((n,a)=>{const{_data:o,indexAxis:s}=n,l=r.getDatasetMeta(a),u=o||n.data;if(Ol([s,r.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const h=r.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||r.options.parsing)return;let{start:c,count:f}=MV(l,u);const v=e.threshold||4*i;if(f<=v){SL(n);return}It(o)&&(n._data=u,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let d;switch(e.algorithm){case"lttb":d=wV(u,c,f,i,e);break;case"min-max":d=TV(u,c,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=d})},destroy(r){l1(r)}};function AV(r,t,e){const i=r.segments,n=r.points,a=t.points,o=[];for(const s of i){let{start:l,end:u}=s;u=Rv(l,u,n);const h=by(e,n[l],n[u],s.loop);if(!t.segments){o.push({source:s,target:h,start:n[l],end:n[u]});continue}const c=rL(t,h);for(const f of c){const v=by(e,a[f.start],a[f.end],f.loop),d=eL(s,n,v);for(const p of d)o.push({source:p,target:f,start:{[e]:u1(h,v,"start",Math.max)},end:{[e]:u1(h,v,"end",Math.min)}})}}return o}function by(r,t,e,i){if(i)return;let n=t[r],a=e[r];return r==="angle"&&(n=Ee(n),a=Ee(a)),{property:r,start:n,end:a}}function DV(r,t){const{x:e=null,y:i=null}=r||{},n=t.points,a=[];return t.segments.forEach(({start:o,end:s})=>{s=Rv(o,s,n);const l=n[o],u=n[s];i!==null?(a.push({x:l.x,y:i}),a.push({x:u.x,y:i})):e!==null&&(a.push({x:e,y:l.y}),a.push({x:e,y:u.y}))}),a}function Rv(r,t,e){for(;t>r;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function u1(r,t,e,i){return r&&t?i(r[e],t[e]):r?r[e]:t?t[e]:0}function wL(r,t){let e=[],i=!1;return jt(r)?(i=!0,e=r):e=DV(r,t),e.length?new Mn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function h1(r){return r&&r.fill!==!1}function LV(r,t,e){let n=r[t].fill;const a=[t];let o;if(!e)return n;for(;n!==!1&&a.indexOf(n)===-1;){if(!ne(n))return n;if(o=r[n],!o)return!1;if(o.visible)return n;a.push(n),n=o.fill}return!1}function IV(r,t,e){const i=EV(r);if(Rt(i))return isNaN(i.value)?!1:i;let n=parseFloat(i);return ne(n)&&Math.floor(n)===n?PV(i[0],t,n,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function PV(r,t,e,i){return(r==="-"||r==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function kV(r,t){let e=null;return r==="start"?e=t.bottom:r==="end"?e=t.top:Rt(r)?e=t.getPixelForValue(r.value):t.getBasePixel&&(e=t.getBasePixel()),e}function RV(r,t,e){let i;return r==="start"?i=e:r==="end"?i=t.options.reverse?t.min:t.max:Rt(r)?i=r.value:i=t.getBaseValue(),i}function EV(r){const t=r.options,e=t.fill;let i=bt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function OV(r){const{scale:t,index:e,line:i}=r,n=[],a=i.segments,o=i.points,s=NV(t,e);s.push(wL({x:null,y:t.bottom},i));for(let l=0;l=0;--o){const s=n[o].$filler;s&&(s.line.updateControlPoints(a,s.axis),i&&s.fill&&Hd(r.ctx,s,a))}},beforeDatasetsDraw(r,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=r.getSortedVisibleDatasetMetas();for(let n=i.length-1;n>=0;--n){const a=i[n].$filler;h1(a)&&Hd(r.ctx,a,r.chartArea)}},beforeDatasetDraw(r,t,e){const i=t.meta.$filler;!h1(i)||e.drawTime!=="beforeDatasetDraw"||Hd(r.ctx,i,r.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const d1=(r,t)=>{let{boxHeight:e=t,boxWidth:i=t}=r;return r.usePointStyle&&(e=Math.min(e,t),i=r.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},XV=(r,t)=>r!==null&&t!==null&&r.datasetIndex===t.datasetIndex&&r.index===t.index;class p1 extends an{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Zt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,n)=>t.sort(i,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,n=de(i.font),a=n.size,o=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=d1(i,a);let u,h;e.font=n.string,this.isHorizontal()?(u=this.maxWidth,h=this._fitRows(o,a,s,l)+10):(h=this.maxHeight,u=this._fitCols(o,n,s,l)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:a,maxWidth:o,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],h=n+s;let c=t;a.textAlign="left",a.textBaseline="middle";let f=-1,v=-h;return this.legendItems.forEach((d,p)=>{const g=i+e/2+a.measureText(d.text).width;(p===0||u[u.length-1]+g+2*s>o)&&(c+=h,u[u.length-(p>0?0:1)]=0,v+=h,f++),l[p]={left:0,top:v,row:f,width:g,height:n},u[u.length-1]+=g+s}),c}_fitCols(t,e,i,n){const{ctx:a,maxHeight:o,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],h=o-t;let c=s,f=0,v=0,d=0,p=0;return this.legendItems.forEach((g,y)=>{const{itemWidth:m,itemHeight:_}=ZV(i,e,a,g,n);y>0&&v+_+2*s>h&&(c+=f+s,u.push({width:f,height:v}),d+=f+s,p++,f=v=0),l[y]={left:d,top:v,col:p,width:m,height:_},f=Math.max(f,m),v+=_+s}),c+=f,u.push({width:f,height:v}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:a}}=this,o=us(a,this.left,this.width);if(this.isHorizontal()){let s=0,l=Pe(i,this.left+n,this.right-this.lineWidths[s]);for(const u of e)s!==u.row&&(s=u.row,l=Pe(i,this.left+n,this.right-this.lineWidths[s])),u.top+=this.top+t+n,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+n}else{let s=0,l=Pe(i,this.top+t+n,this.bottom-this.columnSizes[s].height);for(const u of e)u.col!==s&&(s=u.col,l=Pe(i,this.top+t+n,this.bottom-this.columnSizes[s].height)),u.top=l,u.left+=this.left+n,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Lv(t,this),this._draw(),Iv(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:a,labels:o}=t,s=Jt.color,l=us(t.rtl,this.left,this.width),u=de(o.font),{padding:h}=o,c=u.size,f=c/2;let v;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=u.string;const{boxWidth:d,boxHeight:p,itemHeight:g}=d1(o,c),y=function(S,w,T){if(isNaN(d)||d<=0||isNaN(p)||p<0)return;n.save();const M=bt(T.lineWidth,1);if(n.fillStyle=bt(T.fillStyle,s),n.lineCap=bt(T.lineCap,"butt"),n.lineDashOffset=bt(T.lineDashOffset,0),n.lineJoin=bt(T.lineJoin,"miter"),n.lineWidth=M,n.strokeStyle=bt(T.strokeStyle,s),n.setLineDash(bt(T.lineDash,[])),o.usePointStyle){const C={radius:p*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:M},D=l.xPlus(S,d/2),L=w+f;UD(n,C,D,L,o.pointStyleWidth&&d)}else{const C=w+Math.max((c-p)/2,0),D=l.leftForLtr(S,d),L=Ja(T.borderRadius);n.beginPath(),Object.values(L).some(I=>I!==0)?Cu(n,{x:D,y:C,w:d,h:p,radius:L}):n.rect(D,C,d,p),n.fill(),M!==0&&n.stroke()}n.restore()},m=function(S,w,T){uo(n,T.text,S,w+g/2,u,{strikethrough:T.hidden,textAlign:l.textAlign(T.textAlign)})},_=this.isHorizontal(),x=this._computeTitleHeight();_?v={x:Pe(a,this.left+h,this.right-i[0]),y:this.top+h+x,line:0}:v={x:this.left+h,y:Pe(a,this.top+x+h,this.bottom-e[0].height),line:0},JD(this.ctx,t.textDirection);const b=g+h;this.legendItems.forEach((S,w)=>{n.strokeStyle=S.fontColor,n.fillStyle=S.fontColor;const T=n.measureText(S.text).width,M=l.textAlign(S.textAlign||(S.textAlign=o.textAlign)),C=d+f+T;let D=v.x,L=v.y;l.setWidth(this.width),_?w>0&&D+C+h>this.right&&(L=v.y+=b,v.line++,D=v.x=Pe(a,this.left+h,this.right-i[v.line])):w>0&&L+b>this.bottom&&(D=v.x=D+e[v.line].width+h,v.line++,L=v.y=Pe(a,this.top+x+h,this.bottom-e[v.line].height));const I=l.x(D);if(y(I,L,S),D=vN(M,D+d+f,_?D+C:this.right,t.rtl),m(l.x(D),L,S),_)v.x+=C+h;else if(typeof S.text!="string"){const P=u.lineHeight;v.y+=ML(S,P)+h}else v.y+=b}),QD(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=de(e.font),n=ze(e.padding);if(!e.display)return;const a=us(t.rtl,this.left,this.width),o=this.ctx,s=e.position,l=i.size/2,u=n.top+l;let h,c=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),h=this.top+u,c=Pe(t.align,c,this.right-f);else{const d=this.columnSizes.reduce((p,g)=>Math.max(p,g.height),0);h=u+Pe(t.align,this.top,this.bottom-d-t.labels.padding-this._computeTitleHeight())}const v=Pe(s,c,c+f);o.textAlign=a.textAlign(D0(s)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,uo(o,e.text,v,h,i)}_computeTitleHeight(){const t=this.options.title,e=de(t.font),i=ze(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,a;if(Fi(t,this.left,this.right)&&Fi(e,this.top,this.bottom)){for(a=this.legendHitBoxes,i=0;ia.length>o.length?a:o)),t+e.size/2+i.measureText(n).width}function qV(r,t,e){let i=r;return typeof t.text!="string"&&(i=ML(t,e)),i}function ML(r,t){const e=r.text?r.text.length:0;return t*e}function KV(r,t){return!!((r==="mousemove"||r==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(r==="click"||r==="mouseup"))}var JV={id:"legend",_element:p1,start(r,t,e){const i=r.legend=new p1({ctx:r.ctx,options:e,chart:r});Ne.configure(r,i,e),Ne.addBox(r,i)},stop(r){Ne.removeBox(r,r.legend),delete r.legend},beforeUpdate(r,t,e){const i=r.legend;Ne.configure(r,i,e),i.options=e},afterUpdate(r){const t=r.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(r,t){t.replay||r.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(r,t,e){const i=t.datasetIndex,n=e.chart;n.isDatasetVisible(i)?(n.hide(i),t.hidden=!0):(n.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:r=>r.chart.options.color,boxWidth:40,padding:10,generateLabels(r){const t=r.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:n,color:a,useBorderRadius:o,borderRadius:s}}=r.legend.options;return r._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(e?0:void 0),h=ze(u.borderWidth);return{text:t[l.index].label,fillStyle:u.backgroundColor,fontColor:a,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:u.borderColor,pointStyle:i||u.pointStyle,rotation:u.rotation,textAlign:n||u.textAlign,borderRadius:o&&(s||u.borderRadius),datasetIndex:l.index}},this)}},title:{color:r=>r.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:r=>!r.startsWith("on"),labels:{_scriptable:r=>!["generateLabels","filter","sort"].includes(r)}}};class z0 extends an{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=jt(i.text)?i.text.length:1;this._padding=ze(i.padding);const a=n*de(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:n,right:a,options:o}=this,s=o.align;let l=0,u,h,c;return this.isHorizontal()?(h=Pe(s,i,a),c=e+t,u=a-i):(o.position==="left"?(h=i+t,c=Pe(s,n,e),l=Nt*-.5):(h=a-t,c=Pe(s,e,n),l=Nt*.5),u=n-e),{titleX:h,titleY:c,maxWidth:u,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=de(e.font),a=i.lineHeight/2+this._padding.top,{titleX:o,titleY:s,maxWidth:l,rotation:u}=this._drawArgs(a);uo(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:u,textAlign:D0(e.align),textBaseline:"middle",translation:[o,s]})}}function QV(r,t){const e=new z0({ctx:r.ctx,options:t,chart:r});Ne.configure(r,e,t),Ne.addBox(r,e),r.titleBlock=e}var t5={id:"title",_element:z0,start(r,t,e){QV(r,e)},stop(r){const t=r.titleBlock;Ne.removeBox(r,t),delete r.titleBlock},beforeUpdate(r,t,e){const i=r.titleBlock;Ne.configure(r,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Gh=new WeakMap;var e5={id:"subtitle",start(r,t,e){const i=new z0({ctx:r.ctx,options:e,chart:r});Ne.configure(r,i,e),Ne.addBox(r,i),Gh.set(r,i)},stop(r){Ne.removeBox(r,Gh.get(r)),Gh.delete(r)},beforeUpdate(r,t,e){const i=Gh.get(r);Ne.configure(r,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const zl={average(r){if(!r.length)return!1;let t,e,i=new Set,n=0,a=0;for(t=0,e=r.length;ts+l)/i.size,y:n/a}},nearest(r,t){if(!r.length)return!1;let e=t.x,i=t.y,n=Number.POSITIVE_INFINITY,a,o,s;for(a=0,o=r.length;a-1?r.split(` +`):r}function r5(r,t){const{element:e,datasetIndex:i,index:n}=t,a=r.getDatasetMeta(i).controller,{label:o,value:s}=a.getLabelAndValue(n);return{chart:r,label:o,parsed:a.getParsed(n),raw:r.data.datasets[i].data[n],formattedValue:s,dataset:a.getDataset(),dataIndex:n,datasetIndex:i,element:e}}function g1(r,t){const e=r.chart.ctx,{body:i,footer:n,title:a}=r,{boxWidth:o,boxHeight:s}=t,l=de(t.bodyFont),u=de(t.titleFont),h=de(t.footerFont),c=a.length,f=n.length,v=i.length,d=ze(t.padding);let p=d.height,g=0,y=i.reduce((x,b)=>x+b.before.length+b.lines.length+b.after.length,0);if(y+=r.beforeBody.length+r.afterBody.length,c&&(p+=c*u.lineHeight+(c-1)*t.titleSpacing+t.titleMarginBottom),y){const x=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;p+=v*x+(y-v)*l.lineHeight+(y-1)*t.bodySpacing}f&&(p+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let m=0;const _=function(x){g=Math.max(g,e.measureText(x).width+m)};return e.save(),e.font=u.string,Wt(r.title,_),e.font=l.string,Wt(r.beforeBody.concat(r.afterBody),_),m=t.displayColors?o+2+t.boxPadding:0,Wt(i,x=>{Wt(x.before,_),Wt(x.lines,_),Wt(x.after,_)}),m=0,e.font=h.string,Wt(r.footer,_),e.restore(),g+=d.width,{width:g,height:p}}function i5(r,t){const{y:e,height:i}=t;return er.height-i/2?"bottom":"center"}function n5(r,t,e,i){const{x:n,width:a}=i,o=e.caretSize+e.caretPadding;if(r==="left"&&n+a+o>t.width||r==="right"&&n-a-o<0)return!0}function a5(r,t,e,i){const{x:n,width:a}=e,{width:o,chartArea:{left:s,right:l}}=r;let u="center";return i==="center"?u=n<=(s+l)/2?"left":"right":n<=a/2?u="left":n>=o-a/2&&(u="right"),n5(u,r,t,e)&&(u="center"),u}function y1(r,t,e){const i=e.yAlign||t.yAlign||i5(r,e);return{xAlign:e.xAlign||t.xAlign||a5(r,t,e,i),yAlign:i}}function o5(r,t){let{x:e,width:i}=r;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function s5(r,t,e){let{y:i,height:n}=r;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function m1(r,t,e,i){const{caretSize:n,caretPadding:a,cornerRadius:o}=r,{xAlign:s,yAlign:l}=e,u=n+a,{topLeft:h,topRight:c,bottomLeft:f,bottomRight:v}=Ja(o);let d=o5(t,s);const p=s5(t,l,u);return l==="center"?s==="left"?d+=u:s==="right"&&(d-=u):s==="left"?d-=Math.max(h,f)+n:s==="right"&&(d+=Math.max(c,v)+n),{x:Se(d,0,i.width-t.width),y:Se(p,0,i.height-t.height)}}function Hh(r,t,e){const i=ze(e.padding);return t==="center"?r.x+r.width/2:t==="right"?r.x+r.width-i.right:r.x+i.left}function _1(r){return ui([],Ni(r))}function l5(r,t,e){return Kn(r,{tooltip:t,tooltipItems:e,type:"tooltip"})}function x1(r,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?r.override(e):r}const CL={beforeTitle:Pi,title(r){if(r.length>0){const t=r[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?CL[t].call(e,i):n}class Sy extends an{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,a=new nL(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=l5(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,n=Qe(i,"beforeTitle",this,t),a=Qe(i,"title",this,t),o=Qe(i,"afterTitle",this,t);let s=[];return s=ui(s,Ni(n)),s=ui(s,Ni(a)),s=ui(s,Ni(o)),s}getBeforeBody(t,e){return _1(Qe(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return Wt(t,a=>{const o={before:[],lines:[],after:[]},s=x1(i,a);ui(o.before,Ni(Qe(s,"beforeLabel",this,a))),ui(o.lines,Qe(s,"label",this,a)),ui(o.after,Ni(Qe(s,"afterLabel",this,a))),n.push(o)}),n}getAfterBody(t,e){return _1(Qe(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=Qe(i,"beforeFooter",this,t),a=Qe(i,"footer",this,t),o=Qe(i,"afterFooter",this,t);let s=[];return s=ui(s,Ni(n)),s=ui(s,Ni(a)),s=ui(s,Ni(o)),s}_createItems(t){const e=this._active,i=this.chart.data,n=[],a=[],o=[];let s=[],l,u;for(l=0,u=e.length;lt.filter(h,c,f,i))),t.itemSort&&(s=s.sort((h,c)=>t.itemSort(h,c,i))),Wt(s,h=>{const c=x1(t.callbacks,h);n.push(Qe(c,"labelColor",this,h)),a.push(Qe(c,"labelPointStyle",this,h)),o.push(Qe(c,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=a,this.labelTextColors=o,this.dataPoints=s,s}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let a,o=[];if(!n.length)this.opacity!==0&&(a={opacity:0});else{const s=zl[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=g1(this,i),u=Object.assign({},s,l),h=y1(this.chart,i,u),c=m1(i,u,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,a={opacity:1,x:c.x,y:c.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=o,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const a=this.getCaretPosition(t,i,n);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:a}=this,{caretSize:o,cornerRadius:s}=i,{topLeft:l,topRight:u,bottomLeft:h,bottomRight:c}=Ja(s),{x:f,y:v}=t,{width:d,height:p}=e;let g,y,m,_,x,b;return a==="center"?(x=v+p/2,n==="left"?(g=f,y=g-o,_=x+o,b=x-o):(g=f+d,y=g+o,_=x-o,b=x+o),m=g):(n==="left"?y=f+Math.max(l,h)+o:n==="right"?y=f+d-Math.max(u,c)-o:y=this.caretX,a==="top"?(_=v,x=_-o,g=y-o,m=y+o):(_=v+p,x=_+o,g=y+o,m=y-o),b=_),{x1:g,x2:y,x3:m,y1:_,y2:x,y3:b}}drawTitle(t,e,i){const n=this.title,a=n.length;let o,s,l;if(a){const u=us(i.rtl,this.x,this.width);for(t.x=Hh(this,i.titleAlign,i),e.textAlign=u.textAlign(i.titleAlign),e.textBaseline="middle",o=de(i.titleFont),s=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;lm!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,Cu(t,{x:p,y:d,w:u,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Cu(t,{x:g,y:d+1,w:u-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(p,d,u,l),t.strokeRect(p,d,u,l),t.fillStyle=o.backgroundColor,t.fillRect(g,d+1,u-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:a,bodyAlign:o,displayColors:s,boxHeight:l,boxWidth:u,boxPadding:h}=i,c=de(i.bodyFont);let f=c.lineHeight,v=0;const d=us(i.rtl,this.x,this.width),p=function(T){e.fillText(T,d.x(t.x+v),t.y+f/2),t.y+=f+a},g=d.textAlign(o);let y,m,_,x,b,S,w;for(e.textAlign=o,e.textBaseline="middle",e.font=c.string,t.x=Hh(this,g,i),e.fillStyle=i.bodyColor,Wt(this.beforeBody,p),v=s&&g!=="right"?o==="center"?u/2+h:u+2+h:0,x=0,S=n.length;x0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,a=i&&i.y;if(n||a){const o=zl[t.position].call(this,this._active,this._eventPosition);if(!o)return;const s=this._size=g1(this,t),l=Object.assign({},o,this._size),u=y1(e,t,l),h=m1(t,l,u,e);(n._to!==h.x||a._to!==h.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=s.width,this.height=s.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=ze(e.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&s&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,n,e),JD(t,e.textDirection),a.y+=o.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),QD(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:s,index:l})=>{const u=this.chart.getDatasetMeta(s);if(!u)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:u.data[l],index:l}}),a=!bf(i,n),o=this._positionChanged(n,e);(a||o)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,a=this._active||[],o=this._getActiveElements(t,a,e,i),s=this._positionChanged(o,t),l=e||!bf(o,a)||s;return l&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,n){const a=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:n,options:a}=this,o=zl[a.position].call(this,t,e);return o!==!1&&(i!==o.x||n!==o.y)}}j(Sy,"positioners",zl);var u5={id:"tooltip",_element:Sy,positioners:zl,afterInit(r,t,e){e&&(r.tooltip=new Sy({chart:r,options:e}))},beforeUpdate(r,t,e){r.tooltip&&r.tooltip.initialize(e)},reset(r,t,e){r.tooltip&&r.tooltip.initialize(e)},afterDraw(r){const t=r.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(r.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(r.ctx),r.notifyPlugins("afterTooltipDraw",e)}},afterEvent(r,t){if(r.tooltip){const e=t.replay;r.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(r,t)=>t.bodyFont.size,boxWidth:(r,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:CL},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:r=>r!=="filter"&&r!=="itemSort"&&r!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},h5=Object.freeze({__proto__:null,Colors:SV,Decimation:CV,Filler:$V,Legend:JV,SubTitle:e5,Title:t5,Tooltip:u5});const c5=(r,t,e,i)=>(typeof t=="string"?(e=r.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function f5(r,t,e,i){const n=r.indexOf(t);if(n===-1)return c5(r,t,e,i);const a=r.lastIndexOf(t);return n!==a?e:n}const v5=(r,t)=>r===null?null:Se(Math.round(r),0,t);function b1(r){const t=this.getLabels();return r>=0&&re.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}j(wy,"id","category"),j(wy,"defaults",{ticks:{callback:b1}});function d5(r,t){const e=[],{bounds:n,step:a,min:o,max:s,precision:l,count:u,maxTicks:h,maxDigits:c,includeBounds:f}=r,v=a||1,d=h-1,{min:p,max:g}=t,y=!It(o),m=!It(s),_=!It(u),x=(g-p)/(c+1);let b=gb((g-p)/d/v)*v,S,w,T,M;if(b<1e-14&&!y&&!m)return[{value:p},{value:g}];M=Math.ceil(g/b)-Math.floor(p/b),M>d&&(b=gb(M*b/d/v)*v),It(l)||(S=Math.pow(10,l),b=Math.ceil(b*S)/S),n==="ticks"?(w=Math.floor(p/b)*b,T=Math.ceil(g/b)*b):(w=p,T=g),y&&m&&a&&oN((s-o)/a,b/1e3)?(M=Math.round(Math.min((s-o)/b,h)),b=(s-o)/M,w=o,T=s):_?(w=y?o:w,T=m?s:T,M=u-1,b=(T-w)/M):(M=(T-w)/b,Ql(M,Math.round(M),b/1e3)?M=Math.round(M):M=Math.ceil(M));const C=Math.max(yb(b),yb(w));S=Math.pow(10,It(l)?C:l),w=Math.round(w*S)/S,T=Math.round(T*S)/S;let D=0;for(y&&(f&&w!==o?(e.push({value:o}),ws)break;e.push({value:L})}return m&&f&&T!==s?e.length&&Ql(e[e.length-1].value,s,S1(s,x,r))?e[e.length-1].value=s:e.push({value:s}):(!m||T===s)&&e.push({value:T}),e}function S1(r,t,{horizontal:e,minRotation:i}){const n=Yr(i),a=(e?Math.sin(n):Math.cos(n))||.001,o=.75*t*(""+r).length;return Math.min(t/a,o)}class Lf extends sh{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return It(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:a}=this;const o=l=>n=e?n:l,s=l=>a=i?a:l;if(t){const l=_i(n),u=_i(a);l<0&&u<0?s(0):l>0&&u>0&&o(0)}if(n===a){let l=a===0?1:Math.abs(a*.05);s(a+l),t||o(n-l)}this.min=n,this.max=a}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},a=this._range||this,o=d5(n,a);return t.bounds==="ticks"&&OD(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return oh(t,this.chart.options.locale,this.options.ticks.format)}}class Ty extends Lf{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ne(t)?t:0,this.max=ne(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Yr(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}j(Ty,"id","linear"),j(Ty,"defaults",{ticks:{callback:Dv.formatters.numeric}});const Du=r=>Math.floor(Sn(r)),sa=(r,t)=>Math.pow(10,Du(r)+t);function w1(r){return r/Math.pow(10,Du(r))===1}function T1(r,t,e){const i=Math.pow(10,e),n=Math.floor(r/i);return Math.ceil(t/i)-n}function p5(r,t){const e=t-r;let i=Du(e);for(;T1(r,t,i)>10;)i++;for(;T1(r,t,i)<10;)i--;return Math.min(i,Du(r))}function g5(r,{min:t,max:e}){t=ur(r.min,t);const i=[],n=Du(t);let a=p5(t,e),o=a<0?Math.pow(10,Math.abs(a)):1;const s=Math.pow(10,a),l=n>a?Math.pow(10,n):0,u=Math.round((t-l)*o)/o,h=Math.floor((t-l)/s/10)*s*10;let c=Math.floor((u-h)/Math.pow(10,a)),f=ur(r.min,Math.round((l+h+c*Math.pow(10,a))*o)/o);for(;f=10?c=c<15?15:20:c++,c>=20&&(a++,c=2,o=a>=0?1:o),f=Math.round((l+h+c*Math.pow(10,a))*o)/o;const v=ur(r.max,f);return i.push({value:v,major:w1(v),significand:c}),i}class My extends sh{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Lf.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return ne(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ne(t)?Math.max(0,t):null,this.max=ne(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ne(this._userMin)&&(this.min=t===sa(this.min,0)?sa(this.min,-1):sa(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const a=s=>i=t?i:s,o=s=>n=e?n:s;i===n&&(i<=0?(a(1),o(10)):(a(sa(i,-1)),o(sa(n,1)))),i<=0&&a(sa(n,-1)),n<=0&&o(sa(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=g5(e,this);return t.bounds==="ticks"&&OD(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":oh(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Sn(t),this._valueRange=Sn(this.max)-Sn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Sn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}j(My,"id","logarithmic"),j(My,"defaults",{ticks:{callback:Dv.formatters.logarithmic,major:{enabled:!0}}});function Cy(r){const t=r.ticks;if(t.display&&r.display){const e=ze(t.backdropPadding);return bt(t.font&&t.font.size,Jt.font.size)+e.height}return 0}function y5(r,t,e){return e=jt(e)?e:[e],{w:wN(r,t.string,e),h:e.length*t.lineHeight}}function M1(r,t,e,i,n){return r===i||r===n?{start:t-e/2,end:t+e/2}:rn?{start:t-e,end:t}:{start:t,end:t+e}}function m5(r){const t={l:r.left+r._padding.left,r:r.right-r._padding.right,t:r.top+r._padding.top,b:r.bottom-r._padding.bottom},e=Object.assign({},t),i=[],n=[],a=r._pointLabels.length,o=r.options.pointLabels,s=o.centerPointLabels?Nt/a:0;for(let l=0;lt.r&&(s=(i.end-t.r)/a,r.r=Math.max(r.r,t.r+s)),n.startt.b&&(l=(n.end-t.b)/o,r.b=Math.max(r.b,t.b+l))}function x5(r,t,e){const i=r.drawingArea,{extra:n,additionalAngle:a,padding:o,size:s}=e,l=r.getPointPosition(t,i+n+o,a),u=Math.round(C0(Ee(l.angle+se))),h=M5(l.y,s.h,u),c=w5(u),f=T5(l.x,s.w,c);return{visible:!0,x:l.x,y:h,textAlign:c,left:f,top:h,right:f+s.w,bottom:h+s.h}}function b5(r,t){if(!t)return!0;const{left:e,top:i,right:n,bottom:a}=r;return!(Hi({x:e,y:i},t)||Hi({x:e,y:a},t)||Hi({x:n,y:i},t)||Hi({x:n,y:a},t))}function S5(r,t,e){const i=[],n=r._pointLabels.length,a=r.options,{centerPointLabels:o,display:s}=a.pointLabels,l={extra:Cy(a)/2,additionalAngle:o?Nt/n:0};let u;for(let h=0;h270||e<90)&&(r-=t),r}function C5(r,t,e){const{left:i,top:n,right:a,bottom:o}=e,{backdropColor:s}=t;if(!It(s)){const l=Ja(t.borderRadius),u=ze(t.backdropPadding);r.fillStyle=s;const h=i-u.left,c=n-u.top,f=a-i+u.width,v=o-n+u.height;Object.values(l).some(d=>d!==0)?(r.beginPath(),Cu(r,{x:h,y:c,w:f,h:v,radius:l}),r.fill()):r.fillRect(h,c,f,v)}}function A5(r,t){const{ctx:e,options:{pointLabels:i}}=r;for(let n=t-1;n>=0;n--){const a=r._pointLabelItems[n];if(!a.visible)continue;const o=i.setContext(r.getPointLabelContext(n));C5(e,o,a);const s=de(o.font),{x:l,y:u,textAlign:h}=a;uo(e,r._pointLabels[n],l,u+s.lineHeight/2,s,{color:o.color,textAlign:h,textBaseline:"middle"})}}function AL(r,t,e,i){const{ctx:n}=r;if(e)n.arc(r.xCenter,r.yCenter,t,0,qt);else{let a=r.getPointPosition(0,t);n.moveTo(a.x,a.y);for(let o=1;o{const n=Zt(this.options.pointLabels.callback,[e,i],this);return n||n===0?n:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?m5(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){const e=qt/(this._pointLabels.length||1),i=this.options.startAngle||0;return Ee(t*e+Yr(i))}getDistanceFromCenterForValue(t){if(It(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(It(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t{if(c!==0||c===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);const f=this.getContext(c),v=n.setContext(f),d=a.setContext(f);D5(this,v,l,o,d)}}),i.display){for(t.save(),s=o-1;s>=0;s--){const h=i.setContext(this.getPointLabelContext(s)),{color:c,lineWidth:f}=h;!f||!c||(t.lineWidth=f,t.strokeStyle=c,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),u=this.getPointPosition(s,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let a,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const u=i.setContext(this.getContext(l)),h=de(u.font);if(a=this.getDistanceFromCenterForValue(this.ticks[l].value),u.showLabelBackdrop){t.font=h.string,o=t.measureText(s.label).width,t.fillStyle=u.backdropColor;const c=ze(u.backdropPadding);t.fillRect(-o/2-c.left,-a-h.size/2-c.top,o+c.width,h.size+c.height)}uo(t,s.label,0,-a,h,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}j(Vl,"id","radialLinear"),j(Vl,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Dv.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),j(Vl,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),j(Vl,"descriptors",{angleLines:{_fallback:"grid"}});const Ev={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},nr=Object.keys(Ev);function C1(r,t){return r-t}function A1(r,t){if(It(t))return null;const e=r._adapter,{parser:i,round:n,isoWeekday:a}=r._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),ne(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(n&&(o=n==="week"&&(_s(a)||a===!0)?e.startOf(o,"isoWeek",a):e.startOf(o,n)),+o)}function D1(r,t,e,i){const n=nr.length;for(let a=nr.indexOf(r);a=nr.indexOf(e);a--){const o=nr[a];if(Ev[o].common&&r._adapter.diff(n,i,o)>=t-1)return o}return nr[e?nr.indexOf(e):0]}function P5(r){for(let t=nr.indexOf(r)+1,e=nr.length;t=t?e[i]:e[n];r[a]=!0}}function k5(r,t,e,i){const n=r._adapter,a=+n.startOf(t[0].value,i),o=t[t.length-1].value;let s,l;for(s=a;s<=o;s=+n.add(s,1,i))l=e[s],l>=0&&(t[l].major=!0);return t}function I1(r,t,e){const i=[],n={},a=t.length;let o,s;for(o=0;o+t.value))}initOffsets(t=[]){let e=0,i=0,n,a;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?i=a:i=(a-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=Se(e,0,o),i=Se(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,a=n.time,o=a.unit||D1(a.minUnit,e,i,this._getLabelCapacity(e)),s=bt(n.ticks.stepSize,1),l=o==="week"?a.isoWeekday:!1,u=_s(l)||l===!0,h={};let c=e,f,v;if(u&&(c=+t.startOf(c,"isoWeek",l)),c=+t.startOf(c,u?"day":o),t.diff(i,e,o)>1e5*s)throw new Error(e+" and "+i+" are too far apart with stepSize of "+s+" "+o);const d=n.ticks.source==="data"&&this.getDataTimestamps();for(f=c,v=0;f+p)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,a=this._unit,o=e||n[a];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,n){const a=this.options,o=a.ticks.callback;if(o)return Zt(o,[t,e,i],this);const s=a.time.displayFormats,l=this._unit,u=this._majorUnit,h=l&&s[l],c=u&&s[u],f=i[e],v=u&&c&&f&&f.major;return this._adapter.format(t,n||(v?c:h))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?s:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,i=n.length;e=r[i].pos&&t<=r[n].pos&&({lo:i,hi:n}=Gi(r,"pos",t)),{pos:a,time:s}=r[i],{pos:o,time:l}=r[n]):(t>=r[i].time&&t<=r[n].time&&({lo:i,hi:n}=Gi(r,"time",t)),{time:a,pos:s}=r[i],{time:o,pos:l}=r[n]);const u=o-a;return u?s+(l-s)*(t-a)/u:s}class Dy extends Ay{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Wh(e,this.min),this._tableRange=Wh(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],a=[];let o,s,l,u,h;for(o=0,s=t.length;o=e&&u<=i&&n.push(u);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,s=n.length;on-a)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Wh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Wh(this._table,i*this._tableRange+this._minPos,!0)}}j(Dy,"id","timeseries"),j(Dy,"defaults",Ay.defaults);var R5=Object.freeze({__proto__:null,CategoryScale:wy,LinearScale:Ty,LogarithmicScale:My,RadialLinearScale:Vl,TimeScale:Ay,TimeSeriesScale:Dy});const Prt=[VB,pV,h5,R5],DL="label";function P1(r,t){typeof r=="function"?r(t):r&&(r.current=t)}function E5(r,t){const e=r.options;e&&t&&Object.assign(e,t)}function LL(r,t){r.labels=t}function IL(r,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:DL;const i=[];r.datasets=t.map(n=>{const a=r.datasets.find(o=>o[e]===n[e]);return!a||!n.data||i.includes(a)?{...n}:(i.push(a),Object.assign(a,n),a)})}function O5(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:DL;const e={labels:[],datasets:[]};return LL(e,r.labels),IL(e,r.datasets,t),e}function N5(r,t){const{height:e=150,width:i=300,redraw:n=!1,datasetIdKey:a,type:o,data:s,options:l,plugins:u=[],fallbackContent:h,updateMode:c,...f}=r,v=Wr.useRef(null),d=Wr.useRef(null),p=()=>{v.current&&(d.current=new B0(v.current,{type:o,data:O5(s,a),options:l&&{...l},plugins:u}),P1(t,d.current))},g=()=>{P1(t,null),d.current&&(d.current.destroy(),d.current=null)};return Wr.useEffect(()=>{!n&&d.current&&l&&E5(d.current,l)},[n,l]),Wr.useEffect(()=>{!n&&d.current&&LL(d.current.config.data,s.labels)},[n,s.labels]),Wr.useEffect(()=>{!n&&d.current&&s.datasets&&IL(d.current.config.data,s.datasets,a)},[n,s.datasets]),Wr.useEffect(()=>{d.current&&(n?(g(),setTimeout(p)):d.current.update(c))},[n,l,s.labels,s.datasets,c]),Wr.useEffect(()=>{d.current&&(g(),setTimeout(p))},[o]),Wr.useEffect(()=>(p(),()=>g()),[]),b0.createElement("canvas",{ref:v,role:"img",height:e,width:i,...f},h)}const B5=Wr.forwardRef(N5);function Ov(r,t){return B0.register(t),Wr.forwardRef((e,i)=>b0.createElement(B5,{...e,ref:i,type:r}))}const krt=Ov("line",iu),Rrt=Ov("bar",ru),Ert=Ov("doughnut",Tn),Ort=Ov("pie",Cf);/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Ly=function(r,t){return Ly=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Ly(r,t)};function E(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ly(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Iy=function(){return Iy=Object.assign||function(t){for(var e,i=1,n=arguments.length;i"u"&&typeof self<"u"?mt.worker=!0:!mt.hasGlobalWindow||"Deno"in window?(mt.node=!0,mt.svgSupported=!0):F5(navigator.userAgent,mt);function F5(r,t){var e=t.browser,i=r.match(/Firefox\/([\d.]+)/),n=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),a=r.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(r);i&&(e.firefox=!0,e.version=i[1]),n&&(e.ie=!0,e.version=n[1]),a&&(e.edge=!0,e.version=a[1],e.newEdge=+a[1].split(".")[0]>18),o&&(e.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!e.ie&&!e.edge,t.pointerEventsSupported="onpointerdown"in window&&(e.edge||e.ie&&+e.version>=11),t.domSupported=typeof document<"u";var s=document.documentElement.style;t.transform3dSupported=(e.ie&&"transition"in s||e.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),t.transformSupported=t.transform3dSupported||e.ie&&+e.version>=9}var V0=12,PL="sans-serif",Yn=V0+"px "+PL,G5=20,H5=100,W5="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function U5(r){var t={};if(typeof JSON>"u")return t;for(var e=0;e=0)s=o*e.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",n[u]+":0",i[1-l]+":auto",n[1-u]+":auto",""].join("!important;"),r.appendChild(o),e.push(o)}return e}function fF(r,t,e){for(var i=e?"invTrans":"trans",n=t[i],a=t.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var h=r[u].getBoundingClientRect(),c=2*u,f=h.left,v=h.top;o.push(f,v),l=l&&a&&f===a[c]&&v===a[c+1],s.push(r[u].offsetLeft,r[u].offsetTop)}return l&&n?n:(t.srcCoords=o,t[i]=e?R1(s,o):R1(o,s))}function WL(r){return r.nodeName.toUpperCase()==="CANVAS"}var vF=/([&<>"'])/g,dF={"&":"&","<":"<",">":">",'"':""","'":"'"};function Oe(r){return r==null?"":(r+"").replace(vF,function(t,e){return dF[e]})}var pF=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Yd=[],gF=mt.browser.firefox&&+mt.browser.version.split(".")[0]<39;function Oy(r,t,e,i){return e=e||{},i?O1(r,t,e):gF&&t.layerX!=null&&t.layerX!==t.offsetX?(e.zrX=t.layerX,e.zrY=t.layerY):t.offsetX!=null?(e.zrX=t.offsetX,e.zrY=t.offsetY):O1(r,t,e),e}function O1(r,t,e){if(mt.domSupported&&r.getBoundingClientRect){var i=t.clientX,n=t.clientY;if(WL(r)){var a=r.getBoundingClientRect();e.zrX=i-a.left,e.zrY=n-a.top;return}else if(Ey(Yd,r,i,n)){e.zrX=Yd[0],e.zrY=Yd[1];return}}e.zrX=e.zrY=0}function $0(r){return r||window.event}function Sr(r,t,e){if(t=$0(t),t.zrX!=null)return t;var i=t.type,n=i&&i.indexOf("touch")>=0;if(n){var o=i!=="touchend"?t.targetTouches[0]:t.changedTouches[0];o&&Oy(r,o,t,e)}else{Oy(r,t,t,e);var a=yF(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&pF.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function yF(r){var t=r.wheelDelta;if(t)return t;var e=r.deltaX,i=r.deltaY;if(e==null||i==null)return t;var n=Math.abs(i!==0?i:e),a=i>0?-1:i<0?1:e>0?-1:1;return 3*n*a}function Ny(r,t,e,i){r.addEventListener(t,e,i)}function mF(r,t,e,i){r.removeEventListener(t,e,i)}var qi=function(r){r.preventDefault(),r.stopPropagation(),r.cancelBubble=!0};function N1(r){return r.which===2||r.which===3}var _F=function(){function r(){this._track=[]}return r.prototype.recognize=function(t,e,i){return this._doTrack(t,e,i),this._recognize(t)},r.prototype.clear=function(){return this._track.length=0,this},r.prototype._doTrack=function(t,e,i){var n=t.touches;if(n){for(var a={points:[],touches:[],target:e,event:t},o=0,s=n.length;o1&&i&&i.length>1){var a=B1(i)/B1(n);!isFinite(a)&&(a=1),t.pinchScale=a;var o=xF(i);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:r[0].target,event:t}}}}};function or(){return[1,0,0,1,0,0]}function hh(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function Gv(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function bi(r,t,e){var i=t[0]*e[0]+t[2]*e[1],n=t[1]*e[0]+t[3]*e[1],a=t[0]*e[2]+t[2]*e[3],o=t[1]*e[2]+t[3]*e[3],s=t[0]*e[4]+t[2]*e[5]+t[4],l=t[1]*e[4]+t[3]*e[5]+t[5];return r[0]=i,r[1]=n,r[2]=a,r[3]=o,r[4]=s,r[5]=l,r}function ti(r,t,e){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4]+e[0],r[5]=t[5]+e[1],r}function Qn(r,t,e,i){i===void 0&&(i=[0,0]);var n=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5],h=Math.sin(e),c=Math.cos(e);return r[0]=n*c+s*h,r[1]=-n*h+s*c,r[2]=a*c+l*h,r[3]=-a*h+c*l,r[4]=c*(o-i[0])+h*(u-i[1])+i[0],r[5]=c*(u-i[1])-h*(o-i[0])+i[1],r}function Hv(r,t,e){var i=e[0],n=e[1];return r[0]=t[0]*i,r[1]=t[1]*n,r[2]=t[2]*i,r[3]=t[3]*n,r[4]=t[4]*i,r[5]=t[5]*n,r}function bo(r,t){var e=t[0],i=t[2],n=t[4],a=t[1],o=t[3],s=t[5],l=e*o-a*i;return l?(l=1/l,r[0]=o*l,r[1]=-a*l,r[2]=-i*l,r[3]=e*l,r[4]=(i*s-o*n)*l,r[5]=(a*n-e*s)*l,r):null}function UL(r){var t=or();return Gv(t,r),t}const bF=Object.freeze(Object.defineProperty({__proto__:null,clone:UL,copy:Gv,create:or,identity:hh,invert:bo,mul:bi,rotate:Qn,scale:Hv,translate:ti},Symbol.toStringTag,{value:"Module"}));var ct=function(){function r(t,e){this.x=t||0,this.y=e||0}return r.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.set=function(t,e){return this.x=t,this.y=e,this},r.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},r.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},r.prototype.scale=function(t){this.x*=t,this.y*=t},r.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},r.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},r.prototype.dot=function(t){return this.x*t.x+this.y*t.y},r.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},r.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},r.prototype.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},r.prototype.distanceSquare=function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},r.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},r.prototype.transform=function(t){if(t){var e=this.x,i=this.y;return this.x=t[0]*e+t[2]*i+t[4],this.y=t[1]*e+t[3]*i+t[5],this}},r.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},r.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},r.set=function(t,e,i){t.x=e,t.y=i},r.copy=function(t,e){t.x=e.x,t.y=e.y},r.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},r.lenSquare=function(t){return t.x*t.x+t.y*t.y},r.dot=function(t,e){return t.x*e.x+t.y*e.y},r.add=function(t,e,i){t.x=e.x+i.x,t.y=e.y+i.y},r.sub=function(t,e,i){t.x=e.x-i.x,t.y=e.y-i.y},r.scale=function(t,e,i){t.x=e.x*i,t.y=e.y*i},r.scaleAndAdd=function(t,e,i,n){t.x=e.x+i.x*n,t.y=e.y+i.y*n},r.lerp=function(t,e,i,n){var a=1-n;t.x=a*e.x+n*i.x,t.y=a*e.y+n*i.y},r}(),Yh=Math.min,$h=Math.max,la=new ct,ua=new ct,ha=new ct,ca=new ct,al=new ct,ol=new ct,ft=function(){function r(t,e,i,n){i<0&&(t=t+i,i=-i),n<0&&(e=e+n,n=-n),this.x=t,this.y=e,this.width=i,this.height=n}return r.prototype.union=function(t){var e=Yh(t.x,this.x),i=Yh(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=$h(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=$h(t.y+t.height,this.y+this.height)-i:this.height=t.height,this.x=e,this.y=i},r.prototype.applyTransform=function(t){r.applyTransform(this,this,t)},r.prototype.calculateTransform=function(t){var e=this,i=t.width/e.width,n=t.height/e.height,a=or();return ti(a,a,[-e.x,-e.y]),Hv(a,a,[i,n]),ti(a,a,[t.x,t.y]),a},r.prototype.intersect=function(t,e){if(!t)return!1;t instanceof r||(t=r.create(t));var i=this,n=i.x,a=i.x+i.width,o=i.y,s=i.y+i.height,l=t.x,u=t.x+t.width,h=t.y,c=t.y+t.height,f=!(ad&&(d=_,pd&&(d=x,y=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copy=function(t){r.copy(this,t)},r.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},r.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},r.prototype.isZero=function(){return this.width===0||this.height===0},r.create=function(t){return new r(t.x,t.y,t.width,t.height)},r.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},r.applyTransform=function(t,e,i){if(!i){t!==e&&r.copy(t,e);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var n=i[0],a=i[3],o=i[4],s=i[5];t.x=e.x*n+o,t.y=e.y*a+s,t.width=e.width*n,t.height=e.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}la.x=ha.x=e.x,la.y=ca.y=e.y,ua.x=ca.x=e.x+e.width,ua.y=ha.y=e.y+e.height,la.transform(i),ca.transform(i),ua.transform(i),ha.transform(i),t.x=Yh(la.x,ua.x,ha.x,ca.x),t.y=Yh(la.y,ua.y,ha.y,ca.y);var l=$h(la.x,ua.x,ha.x,ca.x),u=$h(la.y,ua.y,ha.y,ca.y);t.width=l-t.x,t.height=u-t.y},r}(),YL="silent";function SF(r,t,e){return{type:r,event:e,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:e.zrX,offsetY:e.zrY,gestureEvent:e.gestureEvent,pinchX:e.pinchX,pinchY:e.pinchY,pinchScale:e.pinchScale,wheelDelta:e.zrDelta,zrByTouch:e.zrByTouch,which:e.which,stop:wF}}function wF(){qi(this.event)}var TF=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.handler=null,e}return t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(Rr),sl=function(){function r(t,e){this.x=t,this.y=e}return r}(),MF=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Xd=new ft(0,0,0,0),$L=function(r){E(t,r);function t(e,i,n,a,o){var s=r.call(this)||this;return s._hovered=new sl(0,0),s.storage=e,s.painter=i,s.painterRoot=a,s._pointerSize=o,n=n||new TF,s.proxy=null,s.setHandlerProxy(n),s._draggingMgr=new lF(s),s}return t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(A(MF,function(i){e.on&&e.on(i,this[i],this)},this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var i=e.zrX,n=e.zrY,a=XL(this,i,n),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=a?new sl(i,n):this.findHover(i,n),u=l.target,h=this.proxy;h.setCursor&&h.setCursor(u?u.cursor:"default"),s&&u!==s&&this.dispatchToElement(o,"mouseout",e),this.dispatchToElement(l,"mousemove",e),u&&u!==s&&this.dispatchToElement(l,"mouseover",e)},t.prototype.mouseout=function(e){var i=e.zrEventControl;i!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",e),i!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:e})},t.prototype.resize=function(){this._hovered=new sl(0,0)},t.prototype.dispatch=function(e,i){var n=this[e];n&&n.call(this,i)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var i=this.proxy;i.setCursor&&i.setCursor(e)},t.prototype.dispatchToElement=function(e,i,n){e=e||{};var a=e.target;if(!(a&&a.silent)){for(var o="on"+i,s=SF(i,e,n);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(i,s),a=a.__hostTarget?a.__hostTarget:a.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(i,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(i,s)}))}},t.prototype.findHover=function(e,i,n){var a=this.storage.getDisplayList(),o=new sl(e,i);if(z1(a,o,e,i,n),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,h=new ft(e-u,i-u,l,l),c=a.length-1;c>=0;c--){var f=a[c];f!==n&&!f.ignore&&!f.ignoreCoarsePointer&&(!f.parent||!f.parent.ignoreCoarsePointer)&&(Xd.copy(f.getBoundingRect()),f.transform&&Xd.applyTransform(f.transform),Xd.intersect(h)&&s.push(f))}if(s.length)for(var v=4,d=Math.PI/12,p=Math.PI*2,g=0;g4)return;this._downPoint=null}this.dispatchToElement(a,r,t)}});function CF(r,t,e){if(r[r.rectHover?"rectContain":"contain"](t,e)){for(var i=r,n=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(t,e))return!1}i.silent&&(n=!0);var s=i.__hostTarget;i=s||i.parent}return n?YL:!0}return!1}function z1(r,t,e,i,n){for(var a=r.length-1;a>=0;a--){var o=r[a],s=void 0;if(o!==n&&!o.ignore&&(s=CF(o,e,i))&&(!t.topTarget&&(t.topTarget=o),s!==YL)){t.target=o;break}}}function XL(r,t,e){var i=r.painter;return t<0||t>i.getWidth()||e<0||e>i.getHeight()}var ZL=32,ll=7;function AF(r){for(var t=0;r>=ZL;)t|=r&1,r>>=1;return r+t}function V1(r,t,e,i){var n=t+1;if(n===e)return 1;if(i(r[n++],r[t])<0){for(;n=0;)n++;return n-t}function DF(r,t,e){for(e--;t>>1,n(a,r[l])<0?s=l:o=l+1;var u=i-o;switch(u){case 3:r[o+3]=r[o+2];case 2:r[o+2]=r[o+1];case 1:r[o+1]=r[o];break;default:for(;u>0;)r[o+u]=r[o+u-1],u--}r[o]=a}}function Zd(r,t,e,i,n,a){var o=0,s=0,l=1;if(a(r,t[e+n])>0){for(s=i-n;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}else{for(s=n+1;ls&&(l=s);var u=o;o=n-l,l=n-u}for(o++;o>>1);a(r,t[e+h])>0?o=h+1:l=h}return l}function jd(r,t,e,i,n,a){var o=0,s=0,l=1;if(a(r,t[e+n])<0){for(s=n+1;ls&&(l=s);var u=o;o=n-l,l=n-u}else{for(s=i-n;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}for(o++;o>>1);a(r,t[e+h])<0?l=h:o=h+1}return l}function LF(r,t){var e=ll,i,n,a=0,o=[];i=[],n=[];function s(v,d){i[a]=v,n[a]=d,a+=1}function l(){for(;a>1;){var v=a-2;if(v>=1&&n[v-1]<=n[v]+n[v+1]||v>=2&&n[v-2]<=n[v]+n[v-1])n[v-1]n[v+1])break;h(v)}}function u(){for(;a>1;){var v=a-2;v>0&&n[v-1]=ll||w>=ll);if(T)break;b<0&&(b=0),b+=2}if(e=b,e<1&&(e=1),d===1){for(y=0;y=0;y--)r[S+y]=r[b+y];r[x]=o[_];return}for(var w=e;;){var T=0,M=0,C=!1;do if(t(o[_],r[m])<0){if(r[x--]=r[m--],T++,M=0,--d===0){C=!0;break}}else if(r[x--]=o[_--],M++,T=0,--g===1){C=!0;break}while((T|M)=0;y--)r[S+y]=r[b+y];if(d===0){C=!0;break}}if(r[x--]=o[_--],--g===1){C=!0;break}if(M=g-Zd(r[m],o,0,g,g-1,t),M!==0){for(x-=M,_-=M,g-=M,S=x+1,b=_+1,y=0;y=ll||M>=ll);if(C)break;w<0&&(w=0),w+=2}if(e=w,e<1&&(e=1),g===1){for(x-=d,m-=d,S=x+1,b=m+1,y=d-1;y>=0;y--)r[S+y]=r[b+y];r[x]=o[_]}else{if(g===0)throw new Error;for(b=x-(g-1),y=0;ys&&(l=s),F1(r,e,e+l,e+a,t),a=l}o.pushRun(e,a),o.mergeRuns(),n-=a,e+=a}while(n!==0);o.forceMergeRuns()}}var hr=1,Fl=2,ts=4,G1=!1;function qd(){G1||(G1=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function H1(r,t){return r.zlevel===t.zlevel?r.z===t.z?r.z2-t.z2:r.z-t.z:r.zlevel-t.zlevel}var IF=function(){function r(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=H1}return r.prototype.traverse=function(t,e){for(var i=0;i0&&(h.__clipPaths=[]),isNaN(h.z)&&(qd(),h.z=0),isNaN(h.z2)&&(qd(),h.z2=0),isNaN(h.zlevel)&&(qd(),h.zlevel=0),this._displayList[this._displayListLen++]=h}var c=t.getDecalElement&&t.getDecalElement();c&&this._updateAndAddDisplayable(c,e,i);var f=t.getTextGuideLine();f&&this._updateAndAddDisplayable(f,e,i);var v=t.getTextContent();v&&this._updateAndAddDisplayable(v,e,i)}},r.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},r.prototype.delRoot=function(t){if(t instanceof Array){for(var e=0,i=t.length;e=0&&this._roots.splice(n,1)},r.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},r.prototype.getRoots=function(){return this._roots},r.prototype.dispose=function(){this._displayList=null,this._roots=null},r}(),Rf;Rf=mt.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(r){return setTimeout(r,16)};var lu={linear:function(r){return r},quadraticIn:function(r){return r*r},quadraticOut:function(r){return r*(2-r)},quadraticInOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},cubicIn:function(r){return r*r*r},cubicOut:function(r){return--r*r*r+1},cubicInOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},quarticIn:function(r){return r*r*r*r},quarticOut:function(r){return 1- --r*r*r*r},quarticInOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},quinticIn:function(r){return r*r*r*r*r},quinticOut:function(r){return--r*r*r*r*r+1},quinticInOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)},sinusoidalIn:function(r){return 1-Math.cos(r*Math.PI/2)},sinusoidalOut:function(r){return Math.sin(r*Math.PI/2)},sinusoidalInOut:function(r){return .5*(1-Math.cos(Math.PI*r))},exponentialIn:function(r){return r===0?0:Math.pow(1024,r-1)},exponentialOut:function(r){return r===1?1:1-Math.pow(2,-10*r)},exponentialInOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)},circularIn:function(r){return 1-Math.sqrt(1-r*r)},circularOut:function(r){return Math.sqrt(1- --r*r)},circularInOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)},elasticIn:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),-(e*Math.pow(2,10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)))},elasticOut:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*r)*Math.sin((r-t)*(2*Math.PI)/i)+1)},elasticInOut:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),(r*=2)<1?-.5*(e*Math.pow(2,10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)):e*Math.pow(2,-10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)*.5+1)},backIn:function(r){var t=1.70158;return r*r*((t+1)*r-t)},backOut:function(r){var t=1.70158;return--r*r*((t+1)*r+t)+1},backInOut:function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)},bounceIn:function(r){return 1-lu.bounceOut(1-r)},bounceOut:function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},bounceInOut:function(r){return r<.5?lu.bounceIn(r*2)*.5:lu.bounceOut(r*2-1)*.5+.5}},Xh=Math.pow,Nn=Math.sqrt,Ef=1e-8,jL=1e-4,W1=Nn(3),Zh=1/3,di=Jn(),Cr=Jn(),cs=Jn();function Dn(r){return r>-Ef&&rEf||r<-Ef}function ve(r,t,e,i,n){var a=1-n;return a*a*(a*r+3*n*t)+n*n*(n*i+3*a*e)}function U1(r,t,e,i,n){var a=1-n;return 3*(((t-r)*a+2*(e-t)*n)*a+(i-e)*n*n)}function Of(r,t,e,i,n,a){var o=i+3*(t-e)-r,s=3*(e-t*2+r),l=3*(t-r),u=r-n,h=s*s-3*o*l,c=s*l-9*o*u,f=l*l-3*s*u,v=0;if(Dn(h)&&Dn(c))if(Dn(s))a[0]=0;else{var d=-l/s;d>=0&&d<=1&&(a[v++]=d)}else{var p=c*c-4*h*f;if(Dn(p)){var g=c/h,d=-s/o+g,y=-g/2;d>=0&&d<=1&&(a[v++]=d),y>=0&&y<=1&&(a[v++]=y)}else if(p>0){var m=Nn(p),_=h*s+1.5*o*(-c+m),x=h*s+1.5*o*(-c-m);_<0?_=-Xh(-_,Zh):_=Xh(_,Zh),x<0?x=-Xh(-x,Zh):x=Xh(x,Zh);var d=(-s-(_+x))/(3*o);d>=0&&d<=1&&(a[v++]=d)}else{var b=(2*h*s-3*o*c)/(2*Nn(h*h*h)),S=Math.acos(b)/3,w=Nn(h),T=Math.cos(S),d=(-s-2*w*T)/(3*o),y=(-s+w*(T+W1*Math.sin(S)))/(3*o),M=(-s+w*(T-W1*Math.sin(S)))/(3*o);d>=0&&d<=1&&(a[v++]=d),y>=0&&y<=1&&(a[v++]=y),M>=0&&M<=1&&(a[v++]=M)}}return v}function KL(r,t,e,i,n){var a=6*e-12*t+6*r,o=9*t+3*i-3*r-9*e,s=3*t-3*r,l=0;if(Dn(o)){if(qL(a)){var u=-s/a;u>=0&&u<=1&&(n[l++]=u)}}else{var h=a*a-4*o*s;if(Dn(h))n[0]=-a/(2*o);else if(h>0){var c=Nn(h),u=(-a+c)/(2*o),f=(-a-c)/(2*o);u>=0&&u<=1&&(n[l++]=u),f>=0&&f<=1&&(n[l++]=f)}}return l}function $n(r,t,e,i,n,a){var o=(t-r)*n+r,s=(e-t)*n+t,l=(i-e)*n+e,u=(s-o)*n+o,h=(l-s)*n+s,c=(h-u)*n+u;a[0]=r,a[1]=o,a[2]=u,a[3]=c,a[4]=c,a[5]=h,a[6]=l,a[7]=i}function JL(r,t,e,i,n,a,o,s,l,u,h){var c,f=.005,v=1/0,d,p,g,y;di[0]=l,di[1]=u;for(var m=0;m<1;m+=.05)Cr[0]=ve(r,e,n,o,m),Cr[1]=ve(t,i,a,s,m),g=On(di,Cr),g=0&&g=0&&u<=1&&(n[l++]=u)}}else{var h=o*o-4*a*s;if(Dn(h)){var u=-o/(2*a);u>=0&&u<=1&&(n[l++]=u)}else if(h>0){var c=Nn(h),u=(-o+c)/(2*a),f=(-o-c)/(2*a);u>=0&&u<=1&&(n[l++]=u),f>=0&&f<=1&&(n[l++]=f)}}return l}function QL(r,t,e){var i=r+e-2*t;return i===0?.5:(r-t)/i}function Pu(r,t,e,i,n){var a=(t-r)*i+r,o=(e-t)*i+t,s=(o-a)*i+a;n[0]=r,n[1]=a,n[2]=s,n[3]=s,n[4]=o,n[5]=e}function t2(r,t,e,i,n,a,o,s,l){var u,h=.005,c=1/0;di[0]=o,di[1]=s;for(var f=0;f<1;f+=.05){Cr[0]=be(r,e,n,f),Cr[1]=be(t,i,a,f);var v=On(di,Cr);v=0&&v=1?1:Of(0,i,a,1,l,s)&&ve(0,n,o,1,s[0])}}}var OF=function(){function r(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||ee,this.ondestroy=t.ondestroy||ee,this.onrestart=t.onrestart||ee,t.easing&&this.setEasing(t.easing)}return r.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),this._paused){this._pausedTime+=e;return}var i=this._life,n=t-this._startTime-this._pausedTime,a=n/i;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=n%i;this._startTime=t-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){this._paused=!1},r.prototype.setEasing=function(t){this.easing=t,this.easingFunc=Q(t)?t:lu[t]||X0(t)},r}(),e2=function(){function r(t){this.value=t}return r}(),NF=function(){function r(){this._len=0}return r.prototype.insert=function(t){var e=new e2(t);return this.insertEntry(e),e},r.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},r.prototype.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},r.prototype.len=function(){return this._len},r.prototype.clear=function(){this.head=this.tail=null,this._len=0},r}(),ch=function(){function r(t){this._list=new NF,this._maxSize=10,this._map={},this._maxSize=t}return r.prototype.put=function(t,e){var i=this._list,n=this._map,a=null;if(n[t]==null){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=i.head;i.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=e:s=new e2(e),s.key=t,i.insertEntry(s),n[t]=s}return a},r.prototype.get=function(t){var e=this._map[t],i=this._list;if(e!=null)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},r.prototype.clear=function(){this._list.clear(),this._map={}},r.prototype.len=function(){return this._list.len()},r}(),Y1={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function qr(r){return r=Math.round(r),r<0?0:r>255?255:r}function BF(r){return r=Math.round(r),r<0?0:r>360?360:r}function ku(r){return r<0?0:r>1?1:r}function Kd(r){var t=r;return t.length&&t.charAt(t.length-1)==="%"?qr(parseFloat(t)/100*255):qr(parseInt(t,10))}function to(r){var t=r;return t.length&&t.charAt(t.length-1)==="%"?ku(parseFloat(t)/100):ku(parseFloat(t))}function Jd(r,t,e){return e<0?e+=1:e>1&&(e-=1),e*6<1?r+(t-r)*e*6:e*2<1?t:e*3<2?r+(t-r)*(2/3-e)*6:r}function Ln(r,t,e){return r+(t-r)*e}function br(r,t,e,i,n){return r[0]=t,r[1]=e,r[2]=i,r[3]=n,r}function zy(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}var r2=new ch(20),jh=null;function ko(r,t){jh&&zy(jh,t),jh=r2.put(r,jh||t.slice())}function Ze(r,t){if(r){t=t||[];var e=r2.get(r);if(e)return zy(t,e);r=r+"";var i=r.replace(/ /g,"").toLowerCase();if(i in Y1)return zy(t,Y1[i]),ko(r,t),t;var n=i.length;if(i.charAt(0)==="#"){if(n===4||n===5){var a=parseInt(i.slice(1,4),16);if(!(a>=0&&a<=4095)){br(t,0,0,0,1);return}return br(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,n===5?parseInt(i.slice(4),16)/15:1),ko(r,t),t}else if(n===7||n===9){var a=parseInt(i.slice(1,7),16);if(!(a>=0&&a<=16777215)){br(t,0,0,0,1);return}return br(t,(a&16711680)>>16,(a&65280)>>8,a&255,n===9?parseInt(i.slice(7),16)/255:1),ko(r,t),t}return}var o=i.indexOf("("),s=i.indexOf(")");if(o!==-1&&s+1===n){var l=i.substr(0,o),u=i.substr(o+1,s-(o+1)).split(","),h=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?br(t,+u[0],+u[1],+u[2],1):br(t,0,0,0,1);h=to(u.pop());case"rgb":if(u.length>=3)return br(t,Kd(u[0]),Kd(u[1]),Kd(u[2]),u.length===3?h:to(u[3])),ko(r,t),t;br(t,0,0,0,1);return;case"hsla":if(u.length!==4){br(t,0,0,0,1);return}return u[3]=to(u[3]),Vy(u,t),ko(r,t),t;case"hsl":if(u.length!==3){br(t,0,0,0,1);return}return Vy(u,t),ko(r,t),t;default:return}}br(t,0,0,0,1)}}function Vy(r,t){var e=(parseFloat(r[0])%360+360)%360/360,i=to(r[1]),n=to(r[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return t=t||[],br(t,qr(Jd(o,a,e+1/3)*255),qr(Jd(o,a,e)*255),qr(Jd(o,a,e-1/3)*255),1),r.length===4&&(t[3]=r[3]),t}function zF(r){if(r){var t=r[0]/255,e=r[1]/255,i=r[2]/255,n=Math.min(t,e,i),a=Math.max(t,e,i),o=a-n,s=(a+n)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+n):u=o/(2-a-n);var h=((a-t)/6+o/2)/o,c=((a-e)/6+o/2)/o,f=((a-i)/6+o/2)/o;t===a?l=f-c:e===a?l=1/3+h-f:i===a&&(l=2/3+c-h),l<0&&(l+=1),l>1&&(l-=1)}var v=[l*360,u,s];return r[3]!=null&&v.push(r[3]),v}}function Nf(r,t){var e=Ze(r);if(e){for(var i=0;i<3;i++)t<0?e[i]=e[i]*(1-t)|0:e[i]=(255-e[i])*t+e[i]|0,e[i]>255?e[i]=255:e[i]<0&&(e[i]=0);return Kr(e,e.length===4?"rgba":"rgb")}}function VF(r){var t=Ze(r);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function uu(r,t,e){if(!(!(t&&t.length)||!(r>=0&&r<=1))){e=e||[];var i=r*(t.length-1),n=Math.floor(i),a=Math.ceil(i),o=t[n],s=t[a],l=i-n;return e[0]=qr(Ln(o[0],s[0],l)),e[1]=qr(Ln(o[1],s[1],l)),e[2]=qr(Ln(o[2],s[2],l)),e[3]=ku(Ln(o[3],s[3],l)),e}}var FF=uu;function Z0(r,t,e){if(!(!(t&&t.length)||!(r>=0&&r<=1))){var i=r*(t.length-1),n=Math.floor(i),a=Math.ceil(i),o=Ze(t[n]),s=Ze(t[a]),l=i-n,u=Kr([qr(Ln(o[0],s[0],l)),qr(Ln(o[1],s[1],l)),qr(Ln(o[2],s[2],l)),ku(Ln(o[3],s[3],l))],"rgba");return e?{color:u,leftIndex:n,rightIndex:a,value:i}:u}}var GF=Z0;function fs(r,t,e,i){var n=Ze(r);if(r)return n=zF(n),t!=null&&(n[0]=BF(t)),e!=null&&(n[1]=to(e)),i!=null&&(n[2]=to(i)),Kr(Vy(n),"rgba")}function Ru(r,t){var e=Ze(r);if(e&&t!=null)return e[3]=ku(t),Kr(e,"rgba")}function Kr(r,t){if(!(!r||!r.length)){var e=r[0]+","+r[1]+","+r[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(e+=","+r[3]),t+"("+e+")"}}function Eu(r,t){var e=Ze(r);return e?(.299*e[0]+.587*e[1]+.114*e[2])*e[3]/255+(1-e[3])*t:0}function HF(){return Kr([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var $1=new ch(100);function Bf(r){if(Y(r)){var t=$1.get(r);return t||(t=Nf(r,-.1),$1.put(r,t)),t}else if(lh(r)){var e=z({},r);return e.colorStops=F(r.colorStops,function(i){return{offset:i.offset,color:Nf(i.color,-.1)}}),e}return r}const WF=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:uu,fastMapToColor:FF,lerp:Z0,lift:Nf,liftColor:Bf,lum:Eu,mapToColor:GF,modifyAlpha:Ru,modifyHSL:fs,parse:Ze,random:HF,stringify:Kr,toHex:VF},Symbol.toStringTag,{value:"Module"}));var zf=Math.round;function Ou(r){var t;if(!r||r==="transparent")r="none";else if(typeof r=="string"&&r.indexOf("rgba")>-1){var e=Ze(r);e&&(r="rgb("+e[0]+","+e[1]+","+e[2]+")",t=e[3])}return{color:r,opacity:t??1}}var X1=1e-4;function In(r){return r-X1}function qh(r){return zf(r*1e3)/1e3}function Fy(r){return zf(r*1e4)/1e4}function UF(r){return"matrix("+qh(r[0])+","+qh(r[1])+","+qh(r[2])+","+qh(r[3])+","+Fy(r[4])+","+Fy(r[5])+")"}var YF={left:"start",right:"end",center:"middle",middle:"middle"};function $F(r,t,e){return e==="top"?r+=t/2:e==="bottom"&&(r-=t/2),r}function XF(r){return r&&(r.shadowBlur||r.shadowOffsetX||r.shadowOffsetY)}function ZF(r){var t=r.style,e=r.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),e[0],e[1]].join(",")}function i2(r){return r&&!!r.image}function jF(r){return r&&!!r.svgElement}function j0(r){return i2(r)||jF(r)}function n2(r){return r.type==="linear"}function a2(r){return r.type==="radial"}function o2(r){return r&&(r.type==="linear"||r.type==="radial")}function Wv(r){return"url(#"+r+")"}function s2(r){var t=r.getGlobalScale(),e=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(e)/Math.log(10)),1)}function l2(r){var t=r.x||0,e=r.y||0,i=(r.rotation||0)*au,n=lt(r.scaleX,1),a=lt(r.scaleY,1),o=r.skewX||0,s=r.skewY||0,l=[];return(t||e)&&l.push("translate("+t+"px,"+e+"px)"),i&&l.push("rotate("+i+")"),(n!==1||a!==1)&&l.push("scale("+n+","+a+")"),(o||s)&&l.push("skew("+zf(o*au)+"deg, "+zf(s*au)+"deg)"),l.join(" ")}var qF=function(){return mt.hasGlobalWindow&&Q(window.btoa)?function(r){return window.btoa(unescape(encodeURIComponent(r)))}:typeof Buffer<"u"?function(r){return Buffer.from(r).toString("base64")}:function(r){return null}}(),Gy=Array.prototype.slice;function Bi(r,t,e){return(t-r)*e+r}function Qd(r,t,e,i){for(var n=t.length,a=0;ai?t:r,a=Math.min(e,i),o=n[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)i.length=o;else for(var l=a;l=1},r.prototype.getAdditiveTrack=function(){return this._additiveTrack},r.prototype.addKeyframe=function(t,e,i){this._needsSort=!0;var n=this.keyframes,a=n.length,o=!1,s=j1,l=e;if(Me(e)){var u=tG(e);s=u,(u===1&&!Mt(e[0])||u===2&&!Mt(e[0][0]))&&(o=!0)}else if(Mt(e)&&!Ss(e))s=Jh;else if(Y(e))if(!isNaN(+e))s=Jh;else{var h=Ze(e);h&&(l=h,s=Gl)}else if(lh(e)){var c=z({},l);c.colorStops=F(e.colorStops,function(v){return{offset:v.offset,color:Ze(v.color)}}),n2(e)?s=Hy:a2(e)&&(s=Wy),l=c}a===0?this.valType=s:(s!==this.valType||s===j1)&&(o=!0),this.discrete=this.discrete||o;var f={time:t,value:l,rawValue:e,percent:0};return i&&(f.easing=i,f.easingFunc=Q(i)?i:lu[i]||X0(i)),n.push(f),f},r.prototype.prepare=function(t,e){var i=this.keyframes;this._needsSort&&i.sort(function(p,g){return p.time-g.time});for(var n=this.valType,a=i.length,o=i[a-1],s=this.discrete,l=Qh(n),u=q1(n),h=0;h=0&&!(o[h].percent<=e);h--);h=f(h,s-2)}else{for(h=c;he);h++);h=f(h-1,s-2)}d=o[h+1],v=o[h]}if(v&&d){this._lastFr=h,this._lastFrP=e;var g=d.percent-v.percent,y=g===0?1:f((e-v.percent)/g,1);d.easingFunc&&(y=d.easingFunc(y));var m=i?this._additiveValue:u?ul:t[l];if((Qh(a)||u)&&!m&&(m=this._additiveValue=[]),this.discrete)t[l]=y<1?v.rawValue:d.rawValue;else if(Qh(a))a===nf?Qd(m,v[n],d[n],y):KF(m,v[n],d[n],y);else if(q1(a)){var _=v[n],x=d[n],b=a===Hy;t[l]={type:b?"linear":"radial",x:Bi(_.x,x.x,y),y:Bi(_.y,x.y,y),colorStops:F(_.colorStops,function(w,T){var M=x.colorStops[T];return{offset:Bi(w.offset,M.offset,y),color:rf(Qd([],w.color,M.color,y))}}),global:x.global},b?(t[l].x2=Bi(_.x2,x.x2,y),t[l].y2=Bi(_.y2,x.y2,y)):t[l].r=Bi(_.r,x.r,y)}else if(u)Qd(m,v[n],d[n],y),i||(t[l]=rf(m));else{var S=Bi(v[n],d[n],y);i?this._additiveValue=S:t[l]=S}i&&this._addToTarget(t)}}},r.prototype._addToTarget=function(t){var e=this.valType,i=this.propName,n=this._additiveValue;e===Jh?t[i]=t[i]+n:e===Gl?(Ze(t[i],ul),Kh(ul,ul,n,1),t[i]=rf(ul)):e===nf?Kh(t[i],t[i],n,1):e===u2&&Z1(t[i],t[i],n,1)},r}(),q0=function(){function r(t,e,i,n){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=e,e&&n){Bv("Can' use additive animation on looped animation.");return}this._additiveAnimators=n,this._allowDiscrete=i}return r.prototype.getMaxTime=function(){return this._maxTime},r.prototype.getDelay=function(){return this._delay},r.prototype.getLoop=function(){return this._loop},r.prototype.getTarget=function(){return this._target},r.prototype.changeTarget=function(t){this._target=t},r.prototype.when=function(t,e,i){return this.whenWithKeys(t,e,xt(e),i)},r.prototype.whenWithKeys=function(t,e,i,n){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,hu(u),n),this._trackKeys.push(s)}l.addKeyframe(t,hu(e[s]),n)}return this._maxTime=Math.max(this._maxTime,t),this},r.prototype.pause=function(){this._clip.pause(),this._paused=!0},r.prototype.resume=function(){this._clip.resume(),this._paused=!1},r.prototype.isPaused=function(){return!!this._paused},r.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},r.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,i=0;i0)){this._started=1;for(var e=this,i=[],n=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,t[n]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},r}();function as(){return new Date().getTime()}var rG=function(r){E(t,r);function t(e){var i=r.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,e=e||{},i.stage=e.stage||{},i}return t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var i=e.getClip();i&&this.addClip(i)},t.prototype.removeClip=function(e){if(e.animation){var i=e.prev,n=e.next;i?i.next=n:this._head=n,n?n.prev=i:this._tail=i,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var i=e.getClip();i&&this.removeClip(i),e.animation=null},t.prototype.update=function(e){for(var i=as()-this._pausedTime,n=i-this._time,a=this._head;a;){var o=a.next,s=a.step(i,n);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=i,e||(this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0;function i(){e._running&&(Rf(i),!e._paused&&e.update())}Rf(i)},t.prototype.start=function(){this._running||(this._time=as(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=as(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=as()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._head;e;){var i=e.next;e.prev=e.next=e.animation=null,e=i}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(e,i){i=i||{},this.start();var n=new q0(e,i.loop);return this.addAnimator(n),n},t}(Rr),iG=300,tp=mt.domSupported,ep=function(){var r=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t=["touchstart","touchend","touchmove"],e={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=F(r,function(n){var a=n.replace("mouse","pointer");return e.hasOwnProperty(a)?a:n});return{mouse:r,touch:t,pointer:i}}(),K1={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},J1=!1;function Uy(r){var t=r.pointerType;return t==="pen"||t==="touch"}function nG(r){r.touching=!0,r.touchTimer!=null&&(clearTimeout(r.touchTimer),r.touchTimer=null),r.touchTimer=setTimeout(function(){r.touching=!1,r.touchTimer=null},700)}function rp(r){r&&(r.zrByTouch=!0)}function aG(r,t){return Sr(r.dom,new oG(r,t),!0)}function h2(r,t){for(var e=t,i=!1;e&&e.nodeType!==9&&!(i=e.domBelongToZr||e!==t&&e===r.painterRoot);)e=e.parentNode;return i}var oG=function(){function r(t,e){this.stopPropagation=ee,this.stopImmediatePropagation=ee,this.preventDefault=ee,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY}return r}(),Gr={mousedown:function(r){r=Sr(this.dom,r),this.__mayPointerCapture=[r.zrX,r.zrY],this.trigger("mousedown",r)},mousemove:function(r){r=Sr(this.dom,r);var t=this.__mayPointerCapture;t&&(r.zrX!==t[0]||r.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",r)},mouseup:function(r){r=Sr(this.dom,r),this.__togglePointerCapture(!1),this.trigger("mouseup",r)},mouseout:function(r){r=Sr(this.dom,r);var t=r.toElement||r.relatedTarget;h2(this,t)||(this.__pointerCapturing&&(r.zrEventControl="no_globalout"),this.trigger("mouseout",r))},wheel:function(r){J1=!0,r=Sr(this.dom,r),this.trigger("mousewheel",r)},mousewheel:function(r){J1||(r=Sr(this.dom,r),this.trigger("mousewheel",r))},touchstart:function(r){r=Sr(this.dom,r),rp(r),this.__lastTouchMoment=new Date,this.handler.processGesture(r,"start"),Gr.mousemove.call(this,r),Gr.mousedown.call(this,r)},touchmove:function(r){r=Sr(this.dom,r),rp(r),this.handler.processGesture(r,"change"),Gr.mousemove.call(this,r)},touchend:function(r){r=Sr(this.dom,r),rp(r),this.handler.processGesture(r,"end"),Gr.mouseup.call(this,r),+new Date-+this.__lastTouchMomenteS||r<-eS}var va=[],Ro=[],np=or(),ap=Math.abs,$i=function(){function r(){}return r.prototype.getLocalTransform=function(t){return r.getLocalTransform(this,t)},r.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},r.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},r.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},r.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},r.prototype.needLocalTransform=function(){return fa(this.rotation)||fa(this.x)||fa(this.y)||fa(this.scaleX-1)||fa(this.scaleY-1)||fa(this.skewX)||fa(this.skewY)},r.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),i=this.transform;if(!(e||t)){i&&(tS(i),this.invTransform=null);return}i=i||or(),e?this.getLocalTransform(i):tS(i),t&&(e?bi(i,t,i):Gv(i,t)),this.transform=i,this._resolveGlobalScaleRatio(i)},r.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(e!=null&&e!==1){this.getGlobalScale(va);var i=va[0]<0?-1:1,n=va[1]<0?-1:1,a=((va[0]-i)*e+i)/va[0]||0,o=((va[1]-n)*e+n)/va[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||or(),bo(this.invTransform,t)},r.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},r.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],n=Math.atan2(t[1],t[0]),a=Math.PI/2+n-Math.atan2(t[3],t[2]);i=Math.sqrt(i)*Math.cos(a),e=Math.sqrt(e),this.skewX=a,this.skewY=0,this.rotation=-n,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=i,this.originX=0,this.originY=0}},r.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||or(),bi(Ro,t.invTransform,e),e=Ro);var i=this.originX,n=this.originY;(i||n)&&(np[4]=i,np[5]=n,bi(Ro,e,np),Ro[4]-=i,Ro[5]-=n,e=Ro),this.setLocalTransform(e)}},r.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},r.prototype.transformCoordToLocal=function(t,e){var i=[t,e],n=this.invTransform;return n&&we(i,i,n),i},r.prototype.transformCoordToGlobal=function(t,e){var i=[t,e],n=this.transform;return n&&we(i,i,n),i},r.prototype.getLineScale=function(){var t=this.transform;return t&&ap(t[0]-1)>1e-10&&ap(t[3]-1)>1e-10?Math.sqrt(ap(t[0]*t[3]-t[2]*t[1])):1},r.prototype.copyTransform=function(t){f2(this,t)},r.getLocalTransform=function(t,e){e=e||[];var i=t.originX||0,n=t.originY||0,a=t.scaleX,o=t.scaleY,s=t.anchorX,l=t.anchorY,u=t.rotation||0,h=t.x,c=t.y,f=t.skewX?Math.tan(t.skewX):0,v=t.skewY?Math.tan(-t.skewY):0;if(i||n||s||l){var d=i+s,p=n+l;e[4]=-d*a-f*p*o,e[5]=-p*o-v*d*a}else e[4]=e[5]=0;return e[0]=a,e[3]=o,e[1]=v*a,e[2]=f*o,u&&Qn(e,e,u),e[4]+=i+h,e[5]+=n+c,e},r.initDefaultProps=function(){var t=r.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0}(),r}(),Ti=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function f2(r,t){for(var e=0;e=0?parseFloat(r)/100*t:parseFloat(r):r}function Ff(r,t,e){var i=t.position||"inside",n=t.distance!=null?t.distance:5,a=e.height,o=e.width,s=a/2,l=e.x,u=e.y,h="left",c="top";if(i instanceof Array)l+=ei(i[0],e.width),u+=ei(i[1],e.height),h=null,c=null;else switch(i){case"left":l-=n,u+=s,h="right",c="middle";break;case"right":l+=n+o,u+=s,c="middle";break;case"top":l+=o/2,u-=n,h="center",c="bottom";break;case"bottom":l+=o/2,u+=a+n,h="center";break;case"inside":l+=o/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=n,u+=s,c="middle";break;case"insideRight":l+=o-n,u+=s,h="right",c="middle";break;case"insideTop":l+=o/2,u+=n,h="center";break;case"insideBottom":l+=o/2,u+=a-n,h="center",c="bottom";break;case"insideTopLeft":l+=n,u+=n;break;case"insideTopRight":l+=o-n,u+=n,h="right";break;case"insideBottomLeft":l+=n,u+=a-n,c="bottom";break;case"insideBottomRight":l+=o-n,u+=a-n,h="right",c="bottom";break}return r=r||{},r.x=l,r.y=u,r.align=h,r.verticalAlign=c,r}var op="__zr_normal__",sp=Ti.concat(["ignore"]),cG=Pr(Ti,function(r,t){return r[t]=!0,r},{ignore:!1}),Eo={},fG=new ft(0,0,0,0),Yv=function(){function r(t){this.id=H0(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return r.prototype._init=function(t){this.attr(t)},r.prototype.drift=function(t,e,i){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=t,n[5]+=e,this.decomposeTransform(),this.markRedraw()},r.prototype.beforeUpdate=function(){},r.prototype.afterUpdate=function(){},r.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},r.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var i=this.textConfig,n=i.local,a=e.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=n?this:null;var u=!1;if(a.copyTransform(e),i.position!=null){var h=fG;i.layoutRect?h.copy(i.layoutRect):h.copy(this.getBoundingRect()),n||h.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Eo,i,h):Ff(Eo,i,h),a.x=Eo.x,a.y=Eo.y,o=Eo.align,s=Eo.verticalAlign;var c=i.origin;if(c&&i.rotation!=null){var f=void 0,v=void 0;c==="center"?(f=h.width*.5,v=h.height*.5):(f=ei(c[0],h.width),v=ei(c[1],h.height)),u=!0,a.originX=-a.x+f+(n?0:h.x),a.originY=-a.y+v+(n?0:h.y)}}i.rotation!=null&&(a.rotation=i.rotation);var d=i.offset;d&&(a.x+=d[0],a.y+=d[1],u||(a.originX=-d[0],a.originY=-d[1]));var p=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),y=void 0,m=void 0,_=void 0;p&&this.canBeInsideText()?(y=i.insideFill,m=i.insideStroke,(y==null||y==="auto")&&(y=this.getInsideTextFill()),(m==null||m==="auto")&&(m=this.getInsideTextStroke(y),_=!0)):(y=i.outsideFill,m=i.outsideStroke,(y==null||y==="auto")&&(y=this.getOutsideFill()),(m==null||m==="auto")&&(m=this.getOutsideStroke(y),_=!0)),y=y||"#000",(y!==g.fill||m!==g.stroke||_!==g.autoStroke||o!==g.align||s!==g.verticalAlign)&&(l=!0,g.fill=y,g.stroke=m,g.autoStroke=_,g.align=o,g.verticalAlign=s,e.setDefaultTextStyle(g)),e.__dirty|=hr,l&&e.dirtyStyle(!0)}},r.prototype.canBeInsideText=function(){return!0},r.prototype.getInsideTextFill=function(){return"#fff"},r.prototype.getInsideTextStroke=function(t){return"#000"},r.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Zy:Xy},r.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),i=typeof e=="string"&&Ze(e);i||(i=[255,255,255,1]);for(var n=i[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(a?0:255)*(1-n);return i[3]=1,Kr(i,"rgba")},r.prototype.traverse=function(t,e){},r.prototype.attrKV=function(t,e){t==="textConfig"?this.setTextConfig(e):t==="textContent"?this.setTextContent(e):t==="clipPath"?this.setClipPath(e):t==="extra"?(this.extra=this.extra||{},z(this.extra,e)):this[t]=e},r.prototype.hide=function(){this.ignore=!0,this.markRedraw()},r.prototype.show=function(){this.ignore=!1,this.markRedraw()},r.prototype.attr=function(t,e){if(typeof t=="string")this.attrKV(t,e);else if(et(t))for(var i=t,n=xt(i),a=0;a0},r.prototype.getState=function(t){return this.states[t]},r.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},r.prototype.clearStates=function(t){this.useState(op,!1,t)},r.prototype.useState=function(t,e,i,n){var a=t===op,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(vt(s,t)>=0&&(e||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(t)),u||(u=this.states&&this.states[t]),!u&&!a){Bv("State "+t+" not exists.");return}a||this.saveCurrentToNormalState(u);var h=!!(u&&u.hoverLayer||n);h&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,u,this._normalState,e,!i&&!this.__inHover&&l&&l.duration>0,l);var c=this._textContent,f=this._textGuide;return c&&c.useState(t,e,i,h),f&&f.useState(t,e,i,h),a?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~hr),u}}},r.prototype.useStates=function(t,e,i){if(!t.length)this.clearStates();else{var n=[],a=this.currentStates,o=t.length,s=o===a.length;if(s){for(var l=0;l0,d);var p=this._textContent,g=this._textGuide;p&&p.useStates(t,e,f),g&&g.useStates(t,e,f),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~hr)}},r.prototype.isSilent=function(){for(var t=this.silent,e=this.parent;!t&&e;){if(e.silent){t=!0;break}e=e.parent}return t},r.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var i=this.currentStates.slice();i.splice(e,1),this.useStates(i)}},r.prototype.replaceState=function(t,e,i){var n=this.currentStates.slice(),a=vt(n,t),o=vt(n,e)>=0;a>=0?o?n.splice(a,1):n[a]=e:i&&!o&&n.push(e),this.useStates(n)},r.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},r.prototype._mergeStates=function(t){for(var e={},i,n=0;n=0&&a.splice(o,1)}),this.animators.push(t),i&&i.animation.addAnimator(t),i&&i.wakeUp()},r.prototype.updateDuringAnimation=function(t){this.markRedraw()},r.prototype.stopAnimation=function(t,e){for(var i=this.animators,n=i.length,a=[],o=0;o0&&e.during&&a[0].during(function(d,p){e.during(p)});for(var f=0;f0||n.force&&!o.length){var T=void 0,M=void 0,C=void 0;if(s){M={},f&&(T={});for(var x=0;x<_;x++){var y=p[x];M[y]=e[y],f?T[y]=i[y]:e[y]=i[y]}}else if(f){C={};for(var x=0;x<_;x++){var y=p[x];C[y]=hu(e[y]),dG(e,i,y)}}var b=new q0(e,!1,!1,c?Dt(d,function(L){return L.targetName===t}):null);b.targetName=t,n.scope&&(b.scope=n.scope),f&&T&&b.whenWithKeys(0,T,p),C&&b.whenWithKeys(0,C,p),b.whenWithKeys(u??500,s?M:i,p).delay(h||0),r.addAnimator(b,t),o.push(b)}}var at=function(r){E(t,r);function t(e){var i=r.call(this)||this;return i.isGroup=!0,i._children=[],i.attr(e),i}return t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(e){return this._children[e]},t.prototype.childOfName=function(e){for(var i=this._children,n=0;n=0&&(n.splice(a,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,i){var n=vt(this._children,e);return n>=0&&this.replaceAt(i,n),this},t.prototype.replaceAt=function(e,i){var n=this._children,a=n[i];if(e&&e!==this&&e.parent!==this&&e!==a){n[i]=e,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var i=this.__zr;i&&i!==e.__zr&&e.addSelfToZr(i),i&&i.refresh()},t.prototype.remove=function(e){var i=this.__zr,n=this._children,a=vt(n,e);return a<0?this:(n.splice(a,1),e.parent=null,i&&e.removeSelfFromZr(i),i&&i.refresh(),this)},t.prototype.removeAll=function(){for(var e=this._children,i=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},r.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},r.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},r.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},r.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},r.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},r.prototype.on=function(t,e,i){return this._disposed||this.handler.on(t,e,i),this},r.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},r.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},r.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e0){if(r<=n)return o;if(r>=a)return s}else{if(r>=n)return o;if(r<=a)return s}else{if(r===n)return o;if(r===a)return s}return(r-n)/l*u+o}function U(r,t){switch(r){case"center":case"middle":r="50%";break;case"left":case"top":r="0%";break;case"right":case"bottom":r="100%";break}return Y(r)?MG(r).match(/%$/)?parseFloat(r)/100*t:parseFloat(r):r==null?NaN:+r}function Qt(r,t,e){return t==null&&(t=10),t=Math.min(Math.max(0,t),y2),r=(+r).toFixed(t),e?r:+r}function fr(r){return r.sort(function(t,e){return t-e}),r}function $r(r){if(r=+r,isNaN(r))return 0;if(r>1e-14){for(var t=1,e=0;e<15;e++,t*=10)if(Math.round(r*t)/t===r)return e}return m2(r)}function m2(r){var t=r.toString().toLowerCase(),e=t.indexOf("e"),i=e>0?+t.slice(e+1):0,n=e>0?e:t.length,a=t.indexOf("."),o=a<0?0:n-1-a;return Math.max(0,o-i)}function K0(r,t){var e=Math.log,i=Math.LN10,n=Math.floor(e(r[1]-r[0])/i),a=Math.round(e(Math.abs(t[1]-t[0]))/i),o=Math.min(Math.max(-n+a,0),20);return isFinite(o)?o:20}function CG(r,t,e){if(!r[t])return 0;var i=_2(r,e);return i[t]||0}function _2(r,t){var e=Pr(r,function(v,d){return v+(isNaN(d)?0:d)},0);if(e===0)return[];for(var i=Math.pow(10,t),n=F(r,function(v){return(isNaN(v)?0:v)/e*i*100}),a=i*100,o=F(n,function(v){return Math.floor(v)}),s=Pr(o,function(v,d){return v+d},0),l=F(n,function(v,d){return v-o[d]});su&&(u=l[c],h=c);++o[h],l[h]=0,++s}return F(o,function(v){return v/i})}function AG(r,t){var e=Math.max($r(r),$r(t)),i=r+t;return e>y2?i:Qt(i,e)}var Ky=9007199254740991;function J0(r){var t=Math.PI*2;return(r%t+t)%t}function Ts(r){return r>-nS&&r=10&&t++,t}function Q0(r,t){var e=$v(r),i=Math.pow(10,e),n=r/i,a;return t?n<1.5?a=1:n<2.5?a=2:n<4?a=3:n<7?a=5:a=10:n<1?a=1:n<2?a=2:n<3?a=3:n<5?a=5:a=10,r=a*i,e>=-20?+r.toFixed(e<0?-e:0):r}function sf(r,t){var e=(r.length-1)*t+1,i=Math.floor(e),n=+r[i-1],a=e-i;return a?n+a*(r[i]-n):n}function Jy(r){r.sort(function(l,u){return s(l,u,0)?-1:1});for(var t=-1/0,e=1,i=0;i=0||a&&vt(a,l)<0)){var u=i.getShallow(l,t);u!=null&&(o[r[s][0]]=u)}}return o}}var JG=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],QG=vo(JG),t3=function(){function r(){}return r.prototype.getAreaStyle=function(t,e){return QG(this,t,e)},r}(),tm=new ch(50);function e3(r){if(typeof r=="string"){var t=tm.get(r);return t&&t.image}else return r}function n_(r,t,e,i,n){if(r)if(typeof r=="string"){if(t&&t.__zrImageSrc===r||!e)return t;var a=tm.get(r),o={hostEl:e,cb:i,cbPayload:n};return a?(t=a.image,!Zv(t)&&a.pending.push(o)):(t=Qr.loadImage(r,lS,lS),t.__zrImageSrc=r,tm.put(r,t.__cachedImgObj={image:t,pending:[o]})),t}else return r;else return t}function lS(){var r=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=o;l++)s-=o;var u=dr(e,t);return u>s&&(e="",u=0),s=r-u,n.ellipsis=e,n.ellipsisWidth=u,n.contentWidth=s,n.containerWidth=r,n}function R2(r,t,e){var i=e.containerWidth,n=e.font,a=e.contentWidth;if(!i){r.textLine="",r.isTruncated=!1;return}var o=dr(t,n);if(o<=i){r.textLine=t,r.isTruncated=!1;return}for(var s=0;;s++){if(o<=a||s>=e.maxIterations){t+=e.ellipsis;break}var l=s===0?i3(t,a,e.ascCharWidth,e.cnCharWidth):o>0?Math.floor(t.length*a/o):0;t=t.substr(0,l),o=dr(t,n)}t===""&&(t=e.placeholder),r.textLine=t,r.isTruncated=!0}function i3(r,t,e,i){for(var n=0,a=0,o=r.length;ad&&u){var p=Math.floor(d/s);h=h||f.length>p,f=f.slice(0,p)}if(r&&a&&c!=null)for(var g=k2(c,n,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),y={},m=0;ms&&cp(e,r.substring(s,u),t,o),cp(e,l[2],t,o,l[1]),s=hp.lastIndex}sn){var I=e.lines.length;S>0?(_.tokens=_.tokens.slice(0,S),y(_,b,x),e.lines=e.lines.slice(0,m+1)):e.lines=e.lines.slice(0,m),e.isTruncated=e.isTruncated||e.lines.length0&&d+i.accumWidth>i.width&&(h=t.split(` +`),u=!0),i.accumWidth=d}else{var p=E2(t,l,i.width,i.breakAll,i.accumWidth);i.accumWidth=p.accumWidth+v,c=p.linesWidths,h=p.lines}}else h=t.split(` +`);for(var g=0;g=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var u3=Pr(",&?/;] ".split(""),function(r,t){return r[t]=!0,r},{});function h3(r){return l3(r)?!!u3[r]:!0}function E2(r,t,e,i,n){for(var a=[],o=[],s="",l="",u=0,h=0,c=0;ce:n+h+v>e){h?(s||l)&&(d?(s||(s=l,l="",u=0,h=u),a.push(s),o.push(h-u),l+=f,u+=v,s="",h=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(h),s=f,h=v)):d?(a.push(l),o.push(u),l=f,u=v):(a.push(f),o.push(v));continue}h+=v,d?(l+=f,u+=v):(l&&(s+=l,l="",u=0),s+=f)}return!a.length&&!s&&(s=r,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(h)),a.length===1&&(h+=n),{accumWidth:h,lines:a,linesWidths:o}}var em="__zr_style_"+Math.round(Math.random()*10),eo={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},jv={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};eo[em]=!0;var hS=["z","z2","invisible"],c3=["invisible"],kr=function(r){E(t,r);function t(e){return r.call(this,e)||this}return t.prototype._init=function(e){for(var i=xt(e),n=0;n1e-4){s[0]=r-e,s[1]=t-i,l[0]=r+e,l[1]=t+i;return}if(tc[0]=pp(n)*e+r,tc[1]=dp(n)*i+t,ec[0]=pp(a)*e+r,ec[1]=dp(a)*i+t,u(s,tc,ec),h(l,tc,ec),n=n%pa,n<0&&(n=n+pa),a=a%pa,a<0&&(a=a+pa),n>a&&!o?a+=pa:nn&&(rc[0]=pp(v)*e+r,rc[1]=dp(v)*i+t,u(s,rc,s),h(l,rc,l))}var Ft={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},ga=[],ya=[],ni=[],ln=[],ai=[],oi=[],gp=Math.min,yp=Math.max,ma=Math.cos,_a=Math.sin,ki=Math.abs,rm=Math.PI,yn=rm*2,mp=typeof Float32Array<"u",hl=[];function _p(r){var t=Math.round(r/rm*1e8)/1e8;return t%2*rm}function a_(r,t){var e=_p(r[0]);e<0&&(e+=yn);var i=e-r[0],n=r[1];n+=i,!t&&n-e>=yn?n=e+yn:t&&e-n>=yn?n=e-yn:!t&&e>n?n=e+(yn-_p(e-n)):t&&e0&&(this._ux=ki(i/Vf/t)||0,this._uy=ki(i/Vf/e)||0)},r.prototype.setDPR=function(t){this.dpr=t},r.prototype.setContext=function(t){this._ctx=t},r.prototype.getContext=function(){return this._ctx},r.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},r.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},r.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Ft.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},r.prototype.lineTo=function(t,e){var i=ki(t-this._xi),n=ki(e-this._yi),a=i>this._ux||n>this._uy;if(this.addData(Ft.L,t,e),this._ctx&&a&&this._ctx.lineTo(t,e),a)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=i*i+n*n;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},r.prototype.bezierCurveTo=function(t,e,i,n,a,o){return this._drawPendingPt(),this.addData(Ft.C,t,e,i,n,a,o),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,a,o),this._xi=a,this._yi=o,this},r.prototype.quadraticCurveTo=function(t,e,i,n){return this._drawPendingPt(),this.addData(Ft.Q,t,e,i,n),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this._xi=i,this._yi=n,this},r.prototype.arc=function(t,e,i,n,a,o){this._drawPendingPt(),hl[0]=n,hl[1]=a,a_(hl,o),n=hl[0],a=hl[1];var s=a-n;return this.addData(Ft.A,t,e,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(t,e,i,n,a,o),this._xi=ma(a)*i+t,this._yi=_a(a)*i+e,this},r.prototype.arcTo=function(t,e,i,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,i,n,a),this},r.prototype.rect=function(t,e,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,i,n),this.addData(Ft.R,t,e,i,n),this},r.prototype.closePath=function(){this._drawPendingPt(),this.addData(Ft.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&t.closePath(),this._xi=e,this._yi=i,this},r.prototype.fill=function(t){t&&t.fill(),this.toStatic()},r.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},r.prototype.len=function(){return this._len},r.prototype.setData=function(t){var e=t.length;!(this.data&&this.data.length===e)&&mp&&(this.data=new Float32Array(e));for(var i=0;ih.length&&(this._expandData(),h=this.data);for(var c=0;c0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},r.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},r.prototype.getBoundingRect=function(){ni[0]=ni[1]=ai[0]=ai[1]=Number.MAX_VALUE,ln[0]=ln[1]=oi[0]=oi[1]=-Number.MAX_VALUE;var t=this.data,e=0,i=0,n=0,a=0,o;for(o=0;oi||ki(_)>n||f===e-1)&&(p=Math.sqrt(m*m+_*_),a=g,o=y);break}case Ft.C:{var x=t[f++],b=t[f++],g=t[f++],y=t[f++],S=t[f++],w=t[f++];p=PF(a,o,x,b,g,y,S,w,10),a=S,o=w;break}case Ft.Q:{var x=t[f++],b=t[f++],g=t[f++],y=t[f++];p=RF(a,o,x,b,g,y,10),a=g,o=y;break}case Ft.A:var T=t[f++],M=t[f++],C=t[f++],D=t[f++],L=t[f++],I=t[f++],P=I+L;f+=1,d&&(s=ma(L)*C+T,l=_a(L)*D+M),p=yp(C,D)*gp(yn,Math.abs(I)),a=ma(P)*C+T,o=_a(P)*D+M;break;case Ft.R:{s=a=t[f++],l=o=t[f++];var k=t[f++],R=t[f++];p=k*2+R*2;break}case Ft.Z:{var m=s-a,_=l-o;p=Math.sqrt(m*m+_*_),a=s,o=l;break}}p>=0&&(u[c++]=p,h+=p)}return this._pathLen=h,h},r.prototype.rebuildPath=function(t,e){var i=this.data,n=this._ux,a=this._uy,o=this._len,s,l,u,h,c,f,v=e<1,d,p,g=0,y=0,m,_=0,x,b;if(!(v&&(this._pathSegLen||this._calculateLength(),d=this._pathSegLen,p=this._pathLen,m=e*p,!m)))t:for(var S=0;S0&&(t.lineTo(x,b),_=0),w){case Ft.M:s=u=i[S++],l=h=i[S++],t.moveTo(u,h);break;case Ft.L:{c=i[S++],f=i[S++];var M=ki(c-u),C=ki(f-h);if(M>n||C>a){if(v){var D=d[y++];if(g+D>m){var L=(m-g)/D;t.lineTo(u*(1-L)+c*L,h*(1-L)+f*L);break t}g+=D}t.lineTo(c,f),u=c,h=f,_=0}else{var I=M*M+C*C;I>_&&(x=c,b=f,_=I)}break}case Ft.C:{var P=i[S++],k=i[S++],R=i[S++],N=i[S++],O=i[S++],B=i[S++];if(v){var D=d[y++];if(g+D>m){var L=(m-g)/D;$n(u,P,R,O,L,ga),$n(h,k,N,B,L,ya),t.bezierCurveTo(ga[1],ya[1],ga[2],ya[2],ga[3],ya[3]);break t}g+=D}t.bezierCurveTo(P,k,R,N,O,B),u=O,h=B;break}case Ft.Q:{var P=i[S++],k=i[S++],R=i[S++],N=i[S++];if(v){var D=d[y++];if(g+D>m){var L=(m-g)/D;Pu(u,P,R,L,ga),Pu(h,k,N,L,ya),t.quadraticCurveTo(ga[1],ya[1],ga[2],ya[2]);break t}g+=D}t.quadraticCurveTo(P,k,R,N),u=R,h=N;break}case Ft.A:var G=i[S++],H=i[S++],W=i[S++],q=i[S++],K=i[S++],nt=i[S++],Ct=i[S++],te=!i[S++],dt=W>q?W:q,rt=ki(W-q)>.001,gt=K+nt,J=!1;if(v){var D=d[y++];g+D>m&&(gt=K+nt*(m-g)/D,J=!0),g+=D}if(rt&&t.ellipse?t.ellipse(G,H,W,q,Ct,K,gt,te):t.arc(G,H,dt,K,gt,te),J)break t;T&&(s=ma(K)*W+G,l=_a(K)*q+H),u=ma(gt)*W+G,h=_a(gt)*q+H;break;case Ft.R:s=u=i[S],l=h=i[S+1],c=i[S++],f=i[S++];var st=i[S++],Ht=i[S++];if(v){var D=d[y++];if(g+D>m){var Et=m-g;t.moveTo(c,f),t.lineTo(c+gp(Et,st),f),Et-=st,Et>0&&t.lineTo(c+st,f+gp(Et,Ht)),Et-=Ht,Et>0&&t.lineTo(c+yp(st-Et,0),f+Ht),Et-=st,Et>0&&t.lineTo(c,f+yp(Ht-Et,0));break t}g+=D}t.rect(c,f,st,Ht);break;case Ft.Z:if(v){var D=d[y++];if(g+D>m){var L=(m-g)/D;t.lineTo(u*(1-L)+s*L,h*(1-L)+l*L);break t}g+=D}t.closePath(),u=s,h=l}}},r.prototype.clone=function(){var t=new r,e=this.data;return t.data=e.slice?e.slice():Array.prototype.slice.call(e),t._len=this._len,t},r.CMD=Ft,r.initDefaultProps=function(){var t=r.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),r}();function _n(r,t,e,i,n,a,o){if(n===0)return!1;var s=n,l=0,u=r;if(o>t+s&&o>i+s||or+s&&a>e+s||at+c&&h>i+c&&h>a+c&&h>s+c||hr+c&&u>e+c&&u>n+c&&u>o+c||ut+u&&l>i+u&&l>a+u||lr+u&&s>e+u&&s>n+u||se||h+un&&(n+=cl);var f=Math.atan2(l,s);return f<0&&(f+=cl),f>=i&&f<=n||f+cl>=i&&f+cl<=n}function zi(r,t,e,i,n,a){if(a>t&&a>i||an?s:0}var un=Ci.CMD,xa=Math.PI*2,m3=1e-4;function _3(r,t){return Math.abs(r-t)t&&u>i&&u>a&&u>s||u1&&x3(),v=ve(t,i,a,s,Tr[0]),f>1&&(d=ve(t,i,a,s,Tr[1]))),f===2?gt&&s>i&&s>a||s=0&&u<=1){for(var h=0,c=be(t,i,a,u),f=0;fe||s<-e)return 0;var l=Math.sqrt(e*e-s*s);Ye[0]=-l,Ye[1]=l;var u=Math.abs(i-n);if(u<1e-4)return 0;if(u>=xa-1e-4){i=0,n=xa;var h=a?1:-1;return o>=Ye[0]+r&&o<=Ye[1]+r?h:0}if(i>n){var c=i;i=n,n=c}i<0&&(i+=xa,n+=xa);for(var f=0,v=0;v<2;v++){var d=Ye[v];if(d+r>o){var p=Math.atan2(s,d),h=a?1:-1;p<0&&(p=xa+p),(p>=i&&p<=n||p+xa>=i&&p+xa<=n)&&(p>Math.PI/2&&p1&&(e||(s+=zi(l,u,h,c,i,n))),g&&(l=a[d],u=a[d+1],h=l,c=u),p){case un.M:h=a[d++],c=a[d++],l=h,u=c;break;case un.L:if(e){if(_n(l,u,a[d],a[d+1],t,i,n))return!0}else s+=zi(l,u,a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case un.C:if(e){if(g3(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],t,i,n))return!0}else s+=b3(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case un.Q:if(e){if(O2(l,u,a[d++],a[d++],a[d],a[d+1],t,i,n))return!0}else s+=S3(l,u,a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case un.A:var y=a[d++],m=a[d++],_=a[d++],x=a[d++],b=a[d++],S=a[d++];d+=1;var w=!!(1-a[d++]);f=Math.cos(b)*_+y,v=Math.sin(b)*x+m,g?(h=f,c=v):s+=zi(l,u,f,v,i,n);var T=(i-y)*x/_+y;if(e){if(y3(y,m,x,b,b+S,w,t,T,n))return!0}else s+=w3(y,m,x,b,b+S,w,T,n);l=Math.cos(b+S)*_+y,u=Math.sin(b+S)*x+m;break;case un.R:h=l=a[d++],c=u=a[d++];var M=a[d++],C=a[d++];if(f=h+M,v=c+C,e){if(_n(h,c,f,c,t,i,n)||_n(f,c,f,v,t,i,n)||_n(f,v,h,v,t,i,n)||_n(h,v,h,c,t,i,n))return!0}else s+=zi(f,c,f,v,i,n),s+=zi(h,v,h,c,i,n);break;case un.Z:if(e){if(_n(l,u,h,c,t,i,n))return!0}else s+=zi(l,u,h,c,i,n);l=h,u=c;break}}return!e&&!_3(u,c)&&(s+=zi(l,u,h,c,i,n)||0),s!==0}function T3(r,t,e){return N2(r,0,!1,t,e)}function M3(r,t,e,i){return N2(r,t,!0,e,i)}var Gf=tt({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},eo),C3={style:tt({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},jv.style)},xp=Ti.concat(["invisible","culling","z","z2","zlevel","parent"]),_t=function(r){E(t,r);function t(e){return r.call(this,e)||this}return t.prototype.update=function(){var e=this;r.prototype.update.call(this);var i=this.style;if(i.decal){var n=this._decalEl=this._decalEl||new t;n.buildPath===t.prototype.buildPath&&(n.buildPath=function(l){e.buildPath(l,e.shape)}),n.silent=!0;var a=n.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s.5?Xy:i>.2?hG:Zy}else if(e)return Zy}return Xy},t.prototype.getInsideTextStroke=function(e){var i=this.style.fill;if(Y(i)){var n=this.__zr,a=!!(n&&n.isDarkMode()),o=Eu(e,0)<$y;if(a===o)return i}},t.prototype.buildPath=function(e,i,n){},t.prototype.pathUpdated=function(){this.__dirty&=~ts},t.prototype.getUpdatedPathProxy=function(e){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},t.prototype.createPathProxy=function(){this.path=new Ci(!1)},t.prototype.hasStroke=function(){var e=this.style,i=e.stroke;return!(i==null||i==="none"||!(e.lineWidth>0))},t.prototype.hasFill=function(){var e=this.style,i=e.fill;return i!=null&&i!=="none"},t.prototype.getBoundingRect=function(){var e=this._rect,i=this.style,n=!e;if(n){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&ts)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),e=o.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=e.clone());if(this.__dirty||n){s.copy(e);var l=i.strokeNoScale?this.getLineScale():1,u=i.lineWidth;if(!this.hasFill()){var h=this.strokeContainThreshold;u=Math.max(u,h??4)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return e},t.prototype.contain=function(e,i){var n=this.transformCoordToLocal(e,i),a=this.getBoundingRect(),o=this.style;if(e=n[0],i=n[1],a.contain(e,i)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),M3(s,l/u,e,i)))return!0}if(this.hasFill())return T3(s,e,i)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=ts,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate("shape",e)},t.prototype.updateDuringAnimation=function(e){e==="style"?this.dirtyStyle():e==="shape"?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(e,i){e==="shape"?this.setShape(i):r.prototype.attrKV.call(this,e,i)},t.prototype.setShape=function(e,i){var n=this.shape;return n||(n=this.shape={}),typeof e=="string"?n[e]=i:z(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&ts)},t.prototype.createStyle=function(e){return uh(Gf,e)},t.prototype._innerSaveToNormal=function(e){r.prototype._innerSaveToNormal.call(this,e);var i=this._normalState;e.shape&&!i.shape&&(i.shape=z({},this.shape))},t.prototype._applyStateObj=function(e,i,n,a,o,s){r.prototype._applyStateObj.call(this,e,i,n,a,o,s);var l=!(i&&a),u;if(i&&i.shape?o?a?u=i.shape:(u=z({},n.shape),z(u,i.shape)):(u=z({},a?this.shape:n.shape),z(u,i.shape)):l&&(u=n.shape),u)if(o){this.shape=z({},this.shape);for(var h={},c=xt(u),f=0;f0},t.prototype.hasFill=function(){var e=this.style,i=e.fill;return i!=null&&i!=="none"},t.prototype.createStyle=function(e){return uh(A3,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){var e=this.style;if(!this._rect){var i=e.text;i!=null?i+="":i="";var n=fh(i,e.font,e.textAlign,e.textBaseline);if(n.x+=e.x||0,n.y+=e.y||0,this.hasStroke()){var a=e.lineWidth;n.x-=a/2,n.y-=a/2,n.width+=a,n.height+=a}this._rect=n}return this._rect},t.initDefaultProps=function(){var e=t.prototype;e.dirtyRectTolerance=10}(),t}(kr);Ms.prototype.type="tspan";var D3=tt({x:0,y:0},eo),L3={style:tt({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},jv.style)};function I3(r){return!!(r&&typeof r!="string"&&r.width&&r.height)}var xe=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.createStyle=function(e){return uh(D3,e)},t.prototype._getSize=function(e){var i=this.style,n=i[e];if(n!=null)return n;var a=I3(i.image)?i.image:this.__image;if(!a)return 0;var o=e==="width"?"height":"width",s=i[o];return s==null?a[e]:a[e]/a[o]*s},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return L3},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||(this._rect=new ft(e.x||0,e.y||0,this.getWidth(),this.getHeight())),this._rect},t}(kr);xe.prototype.type="image";function P3(r,t){var e=t.x,i=t.y,n=t.width,a=t.height,o=t.r,s,l,u,h;n<0&&(e=e+n,n=-n),a<0&&(i=i+a,a=-a),typeof o=="number"?s=l=u=h=o:o instanceof Array?o.length===1?s=l=u=h=o[0]:o.length===2?(s=u=o[0],l=h=o[1]):o.length===3?(s=o[0],l=h=o[1],u=o[2]):(s=o[0],l=o[1],u=o[2],h=o[3]):s=l=u=h=0;var c;s+l>n&&(c=s+l,s*=n/c,l*=n/c),u+h>n&&(c=u+h,u*=n/c,h*=n/c),l+u>a&&(c=l+u,l*=a/c,u*=a/c),s+h>a&&(c=s+h,s*=a/c,h*=a/c),r.moveTo(e+s,i),r.lineTo(e+n-l,i),l!==0&&r.arc(e+n-l,i+l,l,-Math.PI/2,0),r.lineTo(e+n,i+a-u),u!==0&&r.arc(e+n-u,i+a-u,u,0,Math.PI/2),r.lineTo(e+h,i+a),h!==0&&r.arc(e+h,i+a-h,h,Math.PI/2,Math.PI),r.lineTo(e,i+s),s!==0&&r.arc(e+s,i+s,s,Math.PI,Math.PI*1.5)}var os=Math.round;function B2(r,t,e){if(t){var i=t.x1,n=t.x2,a=t.y1,o=t.y2;r.x1=i,r.x2=n,r.y1=a,r.y2=o;var s=e&&e.lineWidth;return s&&(os(i*2)===os(n*2)&&(r.x1=r.x2=Ya(i,s,!0)),os(a*2)===os(o*2)&&(r.y1=r.y2=Ya(a,s,!0))),r}}function z2(r,t,e){if(t){var i=t.x,n=t.y,a=t.width,o=t.height;r.x=i,r.y=n,r.width=a,r.height=o;var s=e&&e.lineWidth;return s&&(r.x=Ya(i,s,!0),r.y=Ya(n,s,!0),r.width=Math.max(Ya(i+a,s,!1)-r.x,a===0?0:1),r.height=Math.max(Ya(n+o,s,!1)-r.y,o===0?0:1)),r}}function Ya(r,t,e){if(!t)return r;var i=os(r*2);return(i+os(t))%2===0?i/2:(i+(e?1:-1))/2}var k3=function(){function r(){this.x=0,this.y=0,this.width=0,this.height=0}return r}(),R3={},wt=function(r){E(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new k3},t.prototype.buildPath=function(e,i){var n,a,o,s;if(this.subPixelOptimize){var l=z2(R3,i,this.style);n=l.x,a=l.y,o=l.width,s=l.height,l.r=i.r,i=l}else n=i.x,a=i.y,o=i.width,s=i.height;i.r?P3(e,i):e.rect(n,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(_t);wt.prototype.type="rect";var pS={fill:"#000"},gS=2,E3={style:tt({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},jv.style)},St=function(r){E(t,r);function t(e){var i=r.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=pS,i.attr(e),i}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){r.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;e0,L=e.width!=null&&(e.overflow==="truncate"||e.overflow==="break"||e.overflow==="breakAll"),I=o.calculatedLineHeight,P=0;P=0&&(P=S[I],P.align==="right");)this._placeToken(P,e,T,y,L,"right",_),M-=P.width,L-=P.width,I--;for(D+=(a-(D-g)-(m-L)-M)/2;C<=I;)P=S[C],this._placeToken(P,e,T,y,D+P.width/2,"center",_),D+=P.width,C++;y+=T}},t.prototype._placeToken=function(e,i,n,a,o,s,l){var u=i.rich[e.styleName]||{};u.text=e.text;var h=e.verticalAlign,c=a+n/2;h==="top"?c=a+e.height/2:h==="bottom"&&(c=a+n-e.height/2);var f=!e.isLineHolder&&bp(u);f&&this._renderBackground(u,i,s==="right"?o-e.width:s==="center"?o-e.width/2:o,c-e.height/2,e.width,e.height);var v=!!u.backgroundColor,d=e.textPadding;d&&(o=SS(o,s,d),c-=e.height/2-d[0]-e.innerHeight/2);var p=this._getOrCreateChild(Ms),g=p.createStyle();p.useStyle(g);var y=this._defaultStyle,m=!1,_=0,x=bS("fill"in u?u.fill:"fill"in i?i.fill:(m=!0,y.fill)),b=xS("stroke"in u?u.stroke:"stroke"in i?i.stroke:!v&&!l&&(!y.autoStroke||m)?(_=gS,y.stroke):null),S=u.textShadowBlur>0||i.textShadowBlur>0;g.text=e.text,g.x=o,g.y=c,S&&(g.shadowBlur=u.textShadowBlur||i.textShadowBlur||0,g.shadowColor=u.textShadowColor||i.textShadowColor||"transparent",g.shadowOffsetX=u.textShadowOffsetX||i.textShadowOffsetX||0,g.shadowOffsetY=u.textShadowOffsetY||i.textShadowOffsetY||0),g.textAlign=s,g.textBaseline="middle",g.font=e.font||Yn,g.opacity=jr(u.opacity,i.opacity,1),mS(g,u),b&&(g.lineWidth=jr(u.lineWidth,i.lineWidth,_),g.lineDash=lt(u.lineDash,i.lineDash),g.lineDashOffset=i.lineDashOffset||0,g.stroke=b),x&&(g.fill=x);var w=e.contentWidth,T=e.contentHeight;p.setBoundingRect(new ft(Hl(g.x,w,g.textAlign),es(g.y,T,g.textBaseline),w,T))},t.prototype._renderBackground=function(e,i,n,a,o,s){var l=e.backgroundColor,u=e.borderWidth,h=e.borderColor,c=l&&l.image,f=l&&!c,v=e.borderRadius,d=this,p,g;if(f||e.lineHeight||u&&h){p=this._getOrCreateChild(wt),p.useStyle(p.createStyle()),p.style.fill=null;var y=p.shape;y.x=n,y.y=a,y.width=o,y.height=s,y.r=v,p.dirtyShape()}if(f){var m=p.style;m.fill=l||null,m.fillOpacity=lt(e.fillOpacity,1)}else if(c){g=this._getOrCreateChild(xe),g.onload=function(){d.dirtyStyle()};var _=g.style;_.image=l.image,_.x=n,_.y=a,_.width=o,_.height=s}if(u&&h){var m=p.style;m.lineWidth=u,m.stroke=h,m.strokeOpacity=lt(e.strokeOpacity,1),m.lineDash=e.borderDash,m.lineDashOffset=e.borderDashOffset||0,p.strokeContainThreshold=0,p.hasFill()&&p.hasStroke()&&(m.strokeFirst=!0,m.lineWidth*=2)}var x=(p||g).style;x.shadowBlur=e.shadowBlur||0,x.shadowColor=e.shadowColor||"transparent",x.shadowOffsetX=e.shadowOffsetX||0,x.shadowOffsetY=e.shadowOffsetY||0,x.opacity=jr(e.opacity,i.opacity,1)},t.makeFont=function(e){var i="";return F2(e)&&(i=[e.fontStyle,e.fontWeight,V2(e.fontSize),e.fontFamily||"sans-serif"].join(" ")),i&&Lr(i)||e.textFont||e.font},t}(kr),O3={left:!0,right:1,center:1},N3={top:1,bottom:1,middle:1},yS=["fontStyle","fontWeight","fontSize","fontFamily"];function V2(r){return typeof r=="string"&&(r.indexOf("px")!==-1||r.indexOf("rem")!==-1||r.indexOf("em")!==-1)?r:isNaN(+r)?V0+"px":r+"px"}function mS(r,t){for(var e=0;e=0,a=!1;if(r instanceof _t){var o=G2(r),s=n&&o.selectFill||o.normalFill,l=n&&o.selectStroke||o.normalStroke;if(Oo(s)||Oo(l)){i=i||{};var u=i.style||{};u.fill==="inherit"?(a=!0,i=z({},i),u=z({},u),u.fill=s):!Oo(u.fill)&&Oo(s)?(a=!0,i=z({},i),u=z({},u),u.fill=Bf(s)):!Oo(u.stroke)&&Oo(l)&&(a||(i=z({},i),u=z({},u)),u.stroke=Bf(l)),i.style=u}}if(i&&i.z2==null){a||(i=z({},i));var h=r.z2EmphasisLift;i.z2=r.z2+(h??Ns)}return i}function W3(r,t,e){if(e&&e.z2==null){e=z({},e);var i=r.z2SelectLift;e.z2=r.z2+(i??z3)}return e}function U3(r,t,e){var i=vt(r.currentStates,t)>=0,n=r.style.opacity,a=i?null:G3(r,["opacity"],t,{opacity:1});e=e||{};var o=e.style||{};return o.opacity==null&&(e=z({},e),o=z({opacity:i?n:a.opacity*.1},o),e.style=o),e}function Sp(r,t){var e=this.states[r];if(this.style){if(r==="emphasis")return H3(this,r,t,e);if(r==="blur")return U3(this,r,e);if(r==="select")return W3(this,r,e)}return e}function po(r){r.stateProxy=Sp;var t=r.getTextContent(),e=r.getTextGuideLine();t&&(t.stateProxy=Sp),e&&(e.stateProxy=Sp)}function AS(r,t){!Z2(r,t)&&!r.__highByOuter&&on(r,H2)}function DS(r,t){!Z2(r,t)&&!r.__highByOuter&&on(r,W2)}function Ki(r,t){r.__highByOuter|=1<<(t||0),on(r,H2)}function Ji(r,t){!(r.__highByOuter&=~(1<<(t||0)))&&on(r,W2)}function Y2(r){on(r,l_)}function u_(r){on(r,U2)}function $2(r){on(r,V3)}function X2(r){on(r,F3)}function Z2(r,t){return r.__highDownSilentOnTouch&&t.zrByTouch}function j2(r){var t=r.getModel(),e=[],i=[];t.eachComponent(function(n,a){var o=o_(a),s=n==="series",l=s?r.getViewOfSeriesModel(a):r.getViewOfComponentModel(a);!s&&i.push(l),o.isBlured&&(l.group.traverse(function(u){U2(u)}),s&&e.push(a)),o.isBlured=!1}),A(i,function(n){n&&n.toggleBlurSeries&&n.toggleBlurSeries(e,!1,t)})}function nm(r,t,e,i){var n=i.getModel();e=e||"coordinateSystem";function a(u,h){for(var c=0;c0){var s={dataIndex:o,seriesIndex:e.seriesIndex};a!=null&&(s.dataType=a),t.push(s)}})}),t}function Bn(r,t,e){$a(r,!0),on(r,po),om(r,t,e)}function q3(r){$a(r,!1)}function Kt(r,t,e,i){i?q3(r):Bn(r,t,e)}function om(r,t,e){var i=ot(r);t!=null?(i.focus=t,i.blurScope=e):i.focus&&(i.focus=null)}var IS=["emphasis","blur","select"],K3={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Ce(r,t,e,i){e=e||"itemStyle";for(var n=0;n1&&(o*=wp(d),s*=wp(d));var p=(n===a?-1:1)*wp((o*o*(s*s)-o*o*(v*v)-s*s*(f*f))/(o*o*(v*v)+s*s*(f*f)))||0,g=p*o*v/s,y=p*-s*f/o,m=(r+e)/2+nc(c)*g-ic(c)*y,_=(t+i)/2+ic(c)*g+nc(c)*y,x=ES([1,0],[(f-g)/o,(v-y)/s]),b=[(f-g)/o,(v-y)/s],S=[(-1*f-g)/o,(-1*v-y)/s],w=ES(b,S);if(lm(b,S)<=-1&&(w=fl),lm(b,S)>=1&&(w=0),w<0){var T=Math.round(w/fl*1e6)/1e6;w=fl*2+T%2*fl}h.addData(u,m,_,o,s,x,w,c,a)}var iH=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,nH=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function aH(r){var t=new Ci;if(!r)return t;var e=0,i=0,n=e,a=i,o,s=Ci.CMD,l=r.match(iH);if(!l)return t;for(var u=0;uP*P+k*k&&(T=C,M=D),{cx:T,cy:M,x0:-h,y0:-c,x1:T*(n/b-1),y1:M*(n/b-1)}}function fH(r){var t;if(V(r)){var e=r.length;if(!e)return r;e===1?t=[r[0],r[0],0,0]:e===2?t=[r[0],r[0],r[1],r[1]]:e===3?t=r.concat(r[2]):t=r}else t=[r,r,r,r];return t}function vH(r,t){var e,i=Wl(t.r,0),n=Wl(t.r0||0,0),a=i>0,o=n>0;if(!(!a&&!o)){if(a||(i=n,n=0),n>i){var s=i;i=n,n=s}var l=t.startAngle,u=t.endAngle;if(!(isNaN(l)||isNaN(u))){var h=t.cx,c=t.cy,f=!!t.clockwise,v=NS(u-l),d=v>Tp&&v%Tp;if(d>Fr&&(v=d),!(i>Fr))r.moveTo(h,c);else if(v>Tp-Fr)r.moveTo(h+i*Bo(l),c+i*ba(l)),r.arc(h,c,i,l,u,!f),n>Fr&&(r.moveTo(h+n*Bo(u),c+n*ba(u)),r.arc(h,c,n,u,l,f));else{var p=void 0,g=void 0,y=void 0,m=void 0,_=void 0,x=void 0,b=void 0,S=void 0,w=void 0,T=void 0,M=void 0,C=void 0,D=void 0,L=void 0,I=void 0,P=void 0,k=i*Bo(l),R=i*ba(l),N=n*Bo(u),O=n*ba(u),B=v>Fr;if(B){var G=t.cornerRadius;G&&(e=fH(G),p=e[0],g=e[1],y=e[2],m=e[3]);var H=NS(i-n)/2;if(_=si(H,y),x=si(H,m),b=si(H,p),S=si(H,g),M=w=Wl(_,x),C=T=Wl(b,S),(w>Fr||T>Fr)&&(D=i*Bo(u),L=i*ba(u),I=n*Bo(l),P=n*ba(l),vFr){var rt=si(y,M),gt=si(m,M),J=ac(I,P,k,R,i,rt,f),st=ac(D,L,N,O,i,gt,f);r.moveTo(h+J.cx+J.x0,c+J.cy+J.y0),M0&&r.arc(h+J.cx,c+J.cy,rt,De(J.y0,J.x0),De(J.y1,J.x1),!f),r.arc(h,c,i,De(J.cy+J.y1,J.cx+J.x1),De(st.cy+st.y1,st.cx+st.x1),!f),gt>0&&r.arc(h+st.cx,c+st.cy,gt,De(st.y1,st.x1),De(st.y0,st.x0),!f))}else r.moveTo(h+k,c+R),r.arc(h,c,i,l,u,!f);if(!(n>Fr)||!B)r.lineTo(h+N,c+O);else if(C>Fr){var rt=si(p,C),gt=si(g,C),J=ac(N,O,D,L,n,-gt,f),st=ac(k,R,I,P,n,-rt,f);r.lineTo(h+J.cx+J.x0,c+J.cy+J.y0),C0&&r.arc(h+J.cx,c+J.cy,gt,De(J.y0,J.x0),De(J.y1,J.x1),!f),r.arc(h,c,n,De(J.cy+J.y1,J.cx+J.x1),De(st.cy+st.y1,st.cx+st.x1),f),rt>0&&r.arc(h+st.cx,c+st.cy,rt,De(st.y1,st.x1),De(st.y0,st.x0),!f))}else r.lineTo(h+N,c+O),r.arc(h,c,n,u,l,f)}r.closePath()}}}var dH=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return r}(),Fe=function(r){E(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new dH},t.prototype.buildPath=function(e,i){vH(e,i)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(_t);Fe.prototype.type="sector";var pH=function(){function r(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return r}(),Bs=function(r){E(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new pH},t.prototype.buildPath=function(e,i){var n=i.cx,a=i.cy,o=Math.PI*2;e.moveTo(n+i.r,a),e.arc(n,a,i.r,0,o,!1),e.moveTo(n+i.r0,a),e.arc(n,a,i.r0,0,o,!0)},t}(_t);Bs.prototype.type="ring";function gH(r,t,e,i){var n=[],a=[],o=[],s=[],l,u,h,c;if(i){h=[1/0,1/0],c=[-1/0,-1/0];for(var f=0,v=r.length;f=2){if(i){var a=gH(n,i,e,t.smoothConstraint);r.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(e?o:o-1);s++){var l=a[s*2],u=a[s*2+1],h=n[(s+1)%o];r.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{r.moveTo(n[0][0],n[0][1]);for(var s=1,c=n.length;swa[1]){if(s=!1,a)return s;var h=Math.abs(wa[0]-Sa[1]),c=Math.abs(Sa[0]-wa[1]);Math.min(h,c)>n.len()&&(h0){var c=h.duration,f=h.delay,v=h.easing,d={duration:c,delay:f||0,easing:v,done:a,force:!!a||!!o,setToFinal:!u,scope:r,during:o};s?t.animateFrom(e,d):t.animateTo(e,d)}else t.stopAnimation(),!s&&t.attr(e),o&&o(1),a&&a()}function At(r,t,e,i,n,a){v_("update",r,t,e,i,n,a)}function $t(r,t,e,i,n,a){v_("enter",r,t,e,i,n,a)}function vs(r){if(!r.__zr)return!0;for(var t=0;tMath.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function VS(r){return!r.isGroup}function AH(r){return r.shape!=null}function mh(r,t,e){if(!r||!t)return;function i(o){var s={};return o.traverse(function(l){VS(l)&&l.anid&&(s[l.anid]=l)}),s}function n(o){var s={x:o.x,y:o.y,rotation:o.rotation};return AH(o)&&(s.shape=z({},o.shape)),s}var a=i(r);t.traverse(function(o){if(VS(o)&&o.anid){var s=a[o.anid];if(s){var l=n(o);o.attr(n(s)),At(o,l,e,ot(o).dataIndex)}}})}function g_(r,t){return F(r,function(e){var i=e[0];i=Uf(i,t.x),i=Yf(i,t.x+t.width);var n=e[1];return n=Uf(n,t.y),n=Yf(n,t.y+t.height),[i,n]})}function uI(r,t){var e=Uf(r.x,t.x),i=Yf(r.x+r.width,t.x+t.width),n=Uf(r.y,t.y),a=Yf(r.y+r.height,t.y+t.height);if(i>=e&&a>=n)return{x:e,y:n,width:i-e,height:a-n}}function Gs(r,t,e){var i=z({rectHover:!0},t),n=i.style={strokeNoScale:!0};if(e=e||{x:-1,y:-1,width:2,height:2},r)return r.indexOf("image://")===0?(n.image=r.slice(8),tt(n,e),new xe(i)):yh(r.replace("path://",""),i,e,"center")}function Ul(r,t,e,i,n){for(var a=0,o=n[n.length-1];a1)return!1;var g=Mp(v,d,h,c)/f;return!(g<0||g>1)}function Mp(r,t,e,i){return r*i-e*t}function DH(r){return r<=1e-6&&r>=-1e-6}function So(r){var t=r.itemTooltipOption,e=r.componentModel,i=r.itemName,n=Y(t)?{formatter:t}:t,a=e.mainType,o=e.componentIndex,s={componentType:a,name:i,$vars:["name"]};s[a+"Index"]=o;var l=r.formatterParamsExtra;l&&A(xt(l),function(h){X(s,h)||(s[h]=l[h],s.$vars.push(h))});var u=ot(r.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:i,option:tt({content:i,encodeHTMLContent:!0,formatterParams:s},n)}}function FS(r,t){var e;r.isGroup&&(e=t(r)),e||r.traverse(t)}function ta(r,t){if(r)if(V(r))for(var e=0;e=0&&s.push(l)}),s}}function ea(r,t){return ht(ht({},r,!0),t,!0)}const FH={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},GH={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var Xf="ZH",m_="EN",ds=m_,cf={},__={},gI=mt.domSupported?function(){var r=(document.documentElement.lang||navigator.language||navigator.browserLanguage||ds).toUpperCase();return r.indexOf(Xf)>-1?Xf:ds}():ds;function x_(r,t){r=r.toUpperCase(),__[r]=new Lt(t),cf[r]=t}function HH(r){if(Y(r)){var t=cf[r.toUpperCase()]||{};return r===Xf||r===m_?it(t):ht(it(t),it(cf[ds]),!1)}else return ht(it(r),it(cf[ds]),!1)}function cm(r){return __[r]}function WH(){return __[ds]}x_(m_,FH);x_(Xf,GH);var b_=1e3,S_=b_*60,gu=S_*60,Dr=gu*24,YS=Dr*365,Yl={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},lc="{yyyy}-{MM}-{dd}",$S={year:"{yyyy}",month:"{yyyy}-{MM}",day:lc,hour:lc+" "+Yl.hour,minute:lc+" "+Yl.minute,second:lc+" "+Yl.second,millisecond:Yl.none},Dp=["year","month","day","hour","minute","second","millisecond"],yI=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function $e(r,t){return r+="","0000".substr(0,t-r.length)+r}function ps(r){switch(r){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return r}}function UH(r){return r===ps(r)}function YH(r){switch(r){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function _h(r,t,e,i){var n=pr(r),a=n[w_(e)](),o=n[gs(e)]()+1,s=Math.floor((o-1)/3)+1,l=n[id(e)](),u=n["get"+(e?"UTC":"")+"Day"](),h=n[Fu(e)](),c=(h-1)%12+1,f=n[nd(e)](),v=n[ad(e)](),d=n[od(e)](),p=h>=12?"pm":"am",g=p.toUpperCase(),y=i instanceof Lt?i:cm(i||gI)||WH(),m=y.getModel("time"),_=m.get("month"),x=m.get("monthAbbr"),b=m.get("dayOfWeek"),S=m.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,p+"").replace(/{A}/g,g+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,$e(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,_[o-1]).replace(/{MMM}/g,x[o-1]).replace(/{MM}/g,$e(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,$e(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,b[u]).replace(/{ee}/g,S[u]).replace(/{e}/g,u+"").replace(/{HH}/g,$e(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,$e(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,$e(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,$e(v,2)).replace(/{s}/g,v+"").replace(/{SSS}/g,$e(d,3)).replace(/{S}/g,d+"")}function $H(r,t,e,i,n){var a=null;if(Y(e))a=e;else if(Q(e))a=e(r.value,t,{level:r.level});else{var o=z({},Yl);if(r.level>0)for(var s=0;s=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(V(a)){var c=r.level==null?0:r.level>=0?r.level:a.length+r.level;c=Math.min(c,a.length-1),a=a[c]}}return _h(new Date(r.value),a,n,i)}function mI(r,t){var e=pr(r),i=e[gs(t)]()+1,n=e[id(t)](),a=e[Fu(t)](),o=e[nd(t)](),s=e[ad(t)](),l=e[od(t)](),u=l===0,h=u&&s===0,c=h&&o===0,f=c&&a===0,v=f&&n===1,d=v&&i===1;return d?"year":v?"month":f?"day":c?"hour":h?"minute":u?"second":"millisecond"}function XS(r,t,e){var i=Mt(r)?pr(r):r;switch(t=t||mI(r,e),t){case"year":return i[w_(e)]();case"half-year":return i[gs(e)]()>=6?1:0;case"quarter":return Math.floor((i[gs(e)]()+1)/4);case"month":return i[gs(e)]();case"day":return i[id(e)]();case"half-day":return i[Fu(e)]()/24;case"hour":return i[Fu(e)]();case"minute":return i[nd(e)]();case"second":return i[ad(e)]();case"millisecond":return i[od(e)]()}}function w_(r){return r?"getUTCFullYear":"getFullYear"}function gs(r){return r?"getUTCMonth":"getMonth"}function id(r){return r?"getUTCDate":"getDate"}function Fu(r){return r?"getUTCHours":"getHours"}function nd(r){return r?"getUTCMinutes":"getMinutes"}function ad(r){return r?"getUTCSeconds":"getSeconds"}function od(r){return r?"getUTCMilliseconds":"getMilliseconds"}function XH(r){return r?"setUTCFullYear":"setFullYear"}function _I(r){return r?"setUTCMonth":"setMonth"}function xI(r){return r?"setUTCDate":"setDate"}function bI(r){return r?"setUTCHours":"setHours"}function SI(r){return r?"setUTCMinutes":"setMinutes"}function wI(r){return r?"setUTCSeconds":"setSeconds"}function TI(r){return r?"setUTCMilliseconds":"setMilliseconds"}function ZH(r,t,e,i,n,a,o,s){var l=new St({style:{text:r,font:t,align:e,verticalAlign:i,padding:n,rich:a,overflow:o?"truncate":null,lineHeight:s}});return l.getBoundingRect()}function T_(r){if(!t_(r))return Y(r)?r:"-";var t=(r+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function M_(r,t){return r=(r||"").toLowerCase().replace(/-(.)/g,function(e,i){return i.toUpperCase()}),t&&r&&(r=r.charAt(0).toUpperCase()+r.slice(1)),r}var To=Fv;function fm(r,t,e){var i="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function n(h){return h&&Lr(h)?h:"-"}function a(h){return!!(h!=null&&!isNaN(h)&&isFinite(h))}var o=t==="time",s=r instanceof Date;if(o||s){var l=o?pr(r):r;if(isNaN(+l)){if(s)return"-"}else return _h(l,i,e)}if(t==="ordinal")return If(r)?n(r):Mt(r)&&a(r)?r+"":"-";var u=Mi(r);return a(u)?T_(u):If(r)?n(r):typeof r=="boolean"?r+"":"-"}var ZS=["a","b","c","d","e","f","g"],Lp=function(r,t){return"{"+r+(t??"")+"}"};function C_(r,t,e){V(t)||(t=[t]);var i=t.length;if(!i)return"";for(var n=t[0].$vars||[],a=0;a':'';var o=e.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:n==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}}function qH(r,t,e){(r==="week"||r==="month"||r==="quarter"||r==="half-year"||r==="year")&&(r=`MM-dd +yyyy`);var i=pr(t),n=e?"getUTC":"get",a=i[n+"FullYear"](),o=i[n+"Month"]()+1,s=i[n+"Date"](),l=i[n+"Hours"](),u=i[n+"Minutes"](),h=i[n+"Seconds"](),c=i[n+"Milliseconds"]();return r=r.replace("MM",$e(o,2)).replace("M",o).replace("yyyy",a).replace("yy",$e(a%100+"",2)).replace("dd",$e(s,2)).replace("d",s).replace("hh",$e(l,2)).replace("h",l).replace("mm",$e(u,2)).replace("m",u).replace("ss",$e(h,2)).replace("s",h).replace("SSS",$e(c,3)),r}function KH(r){return r&&r.charAt(0).toUpperCase()+r.substr(1)}function go(r,t){return t=t||"transparent",Y(r)?r:et(r)&&r.colorStops&&(r.colorStops[0]||{}).color||t}function Zf(r,t){if(t==="_blank"||t==="blank"){var e=window.open();e.opener=null,e.location.href=r}else window.open(r,t)}var ff=A,CI=["left","right","top","bottom","width","height"],Xa=[["width","left","right"],["height","top","bottom"]];function A_(r,t,e,i,n){var a=0,o=0;i==null&&(i=1/0),n==null&&(n=1/0);var s=0;t.eachChild(function(l,u){var h=l.getBoundingRect(),c=t.childAt(u+1),f=c&&c.getBoundingRect(),v,d;if(r==="horizontal"){var p=h.width+(f?-f.x+h.x:0);v=a+p,v>i||l.newline?(a=0,v=p,o+=s+e,s=h.height):s=Math.max(s,h.height)}else{var g=h.height+(f?-f.y+h.y:0);d=o+g,d>n||l.newline?(a+=s+e,o=0,d=g,s=h.width):s=Math.max(s,h.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),r==="horizontal"?a=v+e:o=d+e)})}var io=A_;ut(A_,"vertical");ut(A_,"horizontal");function JH(r,t,e){var i=t.width,n=t.height,a=U(r.left,i),o=U(r.top,n),s=U(r.right,i),l=U(r.bottom,n);return(isNaN(a)||isNaN(parseFloat(r.left)))&&(a=0),(isNaN(s)||isNaN(parseFloat(r.right)))&&(s=i),(isNaN(o)||isNaN(parseFloat(r.top)))&&(o=0),(isNaN(l)||isNaN(parseFloat(r.bottom)))&&(l=n),e=To(e||0),{width:Math.max(s-a-e[1]-e[3],0),height:Math.max(l-o-e[0]-e[2],0)}}function ue(r,t,e){e=To(e||0);var i=t.width,n=t.height,a=U(r.left,i),o=U(r.top,n),s=U(r.right,i),l=U(r.bottom,n),u=U(r.width,i),h=U(r.height,n),c=e[2]+e[0],f=e[1]+e[3],v=r.aspect;switch(isNaN(u)&&(u=i-s-f-a),isNaN(h)&&(h=n-l-c-o),v!=null&&(isNaN(u)&&isNaN(h)&&(v>i/n?u=i*.8:h=n*.8),isNaN(u)&&(u=v*h),isNaN(h)&&(h=u/v)),isNaN(a)&&(a=i-s-u-f),isNaN(o)&&(o=n-l-h-c),r.left||r.right){case"center":a=i/2-u/2-e[3];break;case"right":a=i-u-f;break}switch(r.top||r.bottom){case"middle":case"center":o=n/2-h/2-e[0];break;case"bottom":o=n-h-c;break}a=a||0,o=o||0,isNaN(u)&&(u=i-f-a-(s||0)),isNaN(h)&&(h=n-c-o-(l||0));var d=new ft(a+e[3],o+e[0],u,h);return d.margin=e,d}function sd(r,t,e,i,n,a){var o=!n||!n.hv||n.hv[0],s=!n||!n.hv||n.hv[1],l=n&&n.boundingMode||"all";if(a=a||r,a.x=r.x,a.y=r.y,!o&&!s)return!1;var u;if(l==="raw")u=r.type==="group"?new ft(0,0,+t.width||0,+t.height||0):r.getBoundingRect();else if(u=r.getBoundingRect(),r.needLocalTransform()){var h=r.getLocalTransform();u=u.clone(),u.applyTransform(h)}var c=ue(tt({width:u.width,height:u.height},t),e,i),f=o?c.x-u.x:0,v=s?c.y-u.y:0;return l==="raw"?(a.x=f,a.y=v):(a.x+=f,a.y+=v),a===r&&r.markRedraw(),!0}function QH(r,t){return r[Xa[t][0]]!=null||r[Xa[t][1]]!=null&&r[Xa[t][2]]!=null}function Gu(r){var t=r.layoutMode||r.constructor.layoutMode;return et(t)?t:t?{type:t}:null}function Zn(r,t,e){var i=e&&e.ignoreSize;!V(i)&&(i=[i,i]);var n=o(Xa[0],0),a=o(Xa[1],1);u(Xa[0],r,n),u(Xa[1],r,a);function o(h,c){var f={},v=0,d={},p=0,g=2;if(ff(h,function(_){d[_]=r[_]}),ff(h,function(_){s(t,_)&&(f[_]=d[_]=t[_]),l(f,_)&&v++,l(d,_)&&p++}),i[c])return l(t,h[1])?d[h[2]]=null:l(t,h[2])&&(d[h[1]]=null),d;if(p===g||!v)return d;if(v>=g)return f;for(var y=0;y=0;l--)s=ht(s,n[l],!0);i.defaultOption=s}return i.defaultOption},t.prototype.getReferringComponents=function(e,i){var n=e+"Index",a=e+"Id";return vh(this.ecModel,e,{index:this.get(n,!0),id:this.get(a,!0)},i)},t.prototype.getBoxLayoutParams=function(){var e=this;return{left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")}},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type="component",e.id="",e.name="",e.mainType="",e.subType="",e.componentIndex=0}(),t}(Lt);I2(yt,Lt);Xv(yt);zH(yt);VH(yt,eW);function eW(r){var t=[];return A(yt.getClassesByMainType(r),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=F(t,function(e){return gi(e).main}),r!=="dataset"&&vt(t,"dataset")<=0&&t.unshift("dataset"),t}var DI="";typeof navigator<"u"&&(DI=navigator.platform||"");var zo="rgba(0, 0, 0, 0.2)";const rW={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:zo,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:zo,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:zo,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:zo,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:zo,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:zo,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:DI.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var LI=Z(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Or="original",He="arrayRows",Nr="objectRows",Di="keyedColumns",Vn="typedArray",II="unknown",Si="column",Ys="row",Te={Must:1,Might:2,Not:3},PI=Tt();function iW(r){PI(r).datasetMap=Z()}function kI(r,t,e){var i={},n=L_(t);if(!n||!r)return i;var a=[],o=[],s=t.ecModel,l=PI(s).datasetMap,u=n.uid+"_"+e.seriesLayoutBy,h,c;r=r.slice(),A(r,function(p,g){var y=et(p)?p:r[g]={name:p};y.type==="ordinal"&&h==null&&(h=g,c=d(y)),i[y.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:c,valueWayDim:0});A(r,function(p,g){var y=p.name,m=d(p);if(h==null){var _=f.valueWayDim;v(i[y],_,m),v(o,_,m),f.valueWayDim+=m}else if(h===g)v(i[y],0,m),v(a,0,m);else{var _=f.categoryWayDim;v(i[y],_,m),v(o,_,m),f.categoryWayDim+=m}});function v(p,g,y){for(var m=0;mt)return r[i];return r[e-1]}function OI(r,t,e,i,n,a,o){a=a||r;var s=t(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(n))return u[n];var h=o==null||!i?e:lW(i,o);if(h=h||e,!(!h||!h.length)){var c=h[l];return n&&(u[n]=c),s.paletteIdx=(l+1)%h.length,c}}function uW(r,t){t(r).paletteIdx=0,t(r).paletteNameMap={}}var uc,vl,qS,KS="\0_ec_inner",hW=1,P_=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.init=function(e,i,n,a,o,s){a=a||{},this.option=null,this._theme=new Lt(a),this._locale=new Lt(o),this._optionManager=s},t.prototype.setOption=function(e,i,n){var a=tw(i);this._optionManager.setOption(e,n,a),this._resetOption(null,a)},t.prototype.resetOption=function(e,i){return this._resetOption(e,tw(i))},t.prototype._resetOption=function(e,i){var n=!1,a=this._optionManager;if(!e||e==="recreate"){var o=a.mountOption(e==="recreate");!this.option||e==="recreate"?qS(this,o):(this.restoreData(),this._mergeOption(o,i)),n=!0}if((e==="timeline"||e==="media")&&this.restoreData(),!e||e==="recreate"||e==="timeline"){var s=a.getTimelineOption(this);s&&(n=!0,this._mergeOption(s,i))}if(!e||e==="recreate"||e==="media"){var l=a.getMediaOption(this);l.length&&A(l,function(u){n=!0,this._mergeOption(u,i)},this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,i){var n=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=Z(),u=i&&i.replaceMergeMainTypeMap;iW(this),A(e,function(c,f){c!=null&&(yt.hasClass(f)?f&&(s.push(f),l.set(f,!0)):n[f]=n[f]==null?it(c):ht(n[f],c,!0))}),u&&u.each(function(c,f){yt.hasClass(f)&&!l.get(f)&&(s.push(f),l.set(f,!0))}),yt.topologicalTravel(s,yt.getAllClassMainTypes(),h,this);function h(c){var f=oW(this,c,Bt(e[c])),v=a.get(c),d=v?u&&u.get(c)?"replaceMerge":"normalMerge":"replaceAll",p=M2(v,f,d);BG(p,c,yt),n[c]=null,a.set(c,null),o.set(c,0);var g=[],y=[],m=0,_;A(p,function(x,b){var S=x.existing,w=x.newOption;if(!w)S&&(S.mergeOption({},this),S.optionUpdated({},!1));else{var T=c==="series",M=yt.getClass(c,x.keyInfo.subType,!T);if(!M)return;if(c==="tooltip"){if(_)return;_=!0}if(S&&S.constructor===M)S.name=x.keyInfo.name,S.mergeOption(w,this),S.optionUpdated(w,!1);else{var C=z({componentIndex:b},x.keyInfo);S=new M(w,this,this,C),z(S,C),x.brandNew&&(S.__requireNewView=!0),S.init(w,this,this),S.optionUpdated(null,!0)}}S?(g.push(S.option),y.push(S),m++):(g.push(void 0),y.push(void 0))},this),n[c]=g,a.set(c,y),o.set(c,m),c==="series"&&uc(this)}this._seriesIndices||uc(this)},t.prototype.getOption=function(){var e=it(this.option);return A(e,function(i,n){if(yt.hasClass(n)){for(var a=Bt(i),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!Nu(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,e[n]=a}}),delete e[KS],e},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,i){var n=this._componentsMap.get(e);if(n){var a=n[i||0];if(a)return a;if(i==null){for(var o=0;o=t:e==="max"?r<=t:r===t}function _W(r,t){return r.join(",")===t.join(",")}var zr=A,Hu=et,ew=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Pp(r){var t=r&&r.itemStyle;if(t)for(var e=0,i=ew.length;e=0;g--){var y=r[g];if(s||(d=y.data.rawIndexOf(y.stackedByDimension,v)),d>=0){var m=y.data.getByRawIndex(y.stackResultDimension,d);if(l==="all"||l==="positive"&&m>0||l==="negative"&&m<0||l==="samesign"&&f>=0&&m>0||l==="samesign"&&f<=0&&m<0){f=AG(f,m),p=m;break}}}return i[0]=f,i[1]=p,i})})}var ld=function(){function r(t){this.data=t.data||(t.sourceFormat===Di?{}:[]),this.sourceFormat=t.sourceFormat||II,this.seriesLayoutBy=t.seriesLayoutBy||Si,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var e=this.dimensionsDefine=t.dimensionsDefine;if(e)for(var i=0;ip&&(p=_)}v[0]=d,v[1]=p}},n=function(){return this._data?this._data.length/this._dimSize:0};lw=(t={},t[He+"_"+Si]={pure:!0,appendData:a},t[He+"_"+Ys]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[Nr]={pure:!0,appendData:a},t[Di]={pure:!0,appendData:function(o){var s=this._data;A(o,function(l,u){for(var h=s[u]||(s[u]=[]),c=0;c<(l||[]).length;c++)h.push(l[c])})}},t[Or]={appendData:a},t[Vn]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},t);function a(o){for(var s=0;s=0&&(p=o.interpolatedValue[g])}return p!=null?p+"":""})}},r.prototype.getRawValue=function(t,e){return As(this.getData(e),t)},r.prototype.formatTooltip=function(t,e,i){},r}();function fw(r){var t,e;return et(r)?r.type&&(e=r):t=r,{text:t,frag:e}}function yu(r){return new NW(r)}var NW=function(){function r(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return r.prototype.perform=function(t){var e=this._upstream,i=t&&t.skip;if(this._dirty&&e){var n=this.context;n.data=n.outputData=e.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!i&&(a=this._plan(this.context));var o=h(this._modBy),s=this._modDataCount||0,l=h(t&&t.modBy),u=t&&t.modDataCount||0;(o!==l||s!==u)&&(a="reset");function h(m){return!(m>=1)&&(m=1),m}var c;(this._dirty||a==="reset")&&(this._dirty=!1,c=this._doReset(i)),this._modBy=l,this._modDataCount=u;var f=t&&t.step;if(e?this._dueEnd=e._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var v=this._dueIndex,d=Math.min(f!=null?this._dueIndex+f:1/0,this._dueEnd);if(!i&&(c||v1&&i>0?s:o}};return a;function o(){return t=r?null:lt},gte:function(r,t){return r>=t}},zW=function(){function r(t,e){if(!Mt(e)){var i="";kt(i)}this._opFn=$I[t],this._rvalFloat=Mi(e)}return r.prototype.evaluate=function(t){return Mt(t)?this._opFn(t,this._rvalFloat):this._opFn(Mi(t),this._rvalFloat)},r}(),XI=function(){function r(t,e){var i=t==="desc";this._resultLT=i?1:-1,e==null&&(e=i?"min":"max"),this._incomparable=e==="min"?-1/0:1/0}return r.prototype.evaluate=function(t,e){var i=Mt(t)?t:Mi(t),n=Mt(e)?e:Mi(e),a=isNaN(i),o=isNaN(n);if(a&&(i=this._incomparable),o&&(n=this._incomparable),a&&o){var s=Y(t),l=Y(e);s&&(i=l?t:0),l&&(n=s?e:0)}return in?-this._resultLT:0},r}(),VW=function(){function r(t,e){this._rval=e,this._isEQ=t,this._rvalTypeof=typeof e,this._rvalFloat=Mi(e)}return r.prototype.evaluate=function(t){var e=t===this._rval;if(!e){var i=typeof t;i!==this._rvalTypeof&&(i==="number"||this._rvalTypeof==="number")&&(e=Mi(t)===this._rvalFloat)}return this._isEQ?e:!e},r}();function FW(r,t){return r==="eq"||r==="ne"?new VW(r==="eq",t):X($I,r)?new zW(r,t):null}var GW=function(){function r(){}return r.prototype.getRawData=function(){throw new Error("not supported")},r.prototype.getRawDataItem=function(t){throw new Error("not supported")},r.prototype.cloneRawData=function(){},r.prototype.getDimensionInfo=function(t){},r.prototype.cloneAllDimensionInfo=function(){},r.prototype.count=function(){},r.prototype.retrieveValue=function(t,e){},r.prototype.retrieveValueFromItem=function(t,e){},r.prototype.convertValue=function(t,e){return Fn(t,e)},r}();function HW(r,t){var e=new GW,i=r.data,n=e.sourceFormat=r.sourceFormat,a=r.startIndex,o="";r.seriesLayoutBy!==Si&&kt(o);var s=[],l={},u=r.dimensionsDefine;if(u)A(u,function(p,g){var y=p.name,m={index:g,name:y,displayName:p.displayName};if(s.push(m),y!=null){var _="";X(l,y)&&kt(_),l[y]=m}});else for(var h=0;h65535?qW:KW}function Fo(){return[1/0,-1/0]}function JW(r){var t=r.constructor;return t===Array?r.slice():new t(r)}function pw(r,t,e,i,n){var a=qI[e||"float"];if(n){var o=r[t],s=o&&o.length;if(s!==i){for(var l=new a(i),u=0;ug[1]&&(g[1]=p)}return this._rawCount=this._count=l,{start:s,end:l}},r.prototype._initDataFromProvider=function(t,e,i){for(var n=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=F(o,function(m){return m.property}),h=0;hy[1]&&(y[1]=g)}}!n.persistent&&n.clean&&n.clean(),this._rawCount=this._count=e,this._extent=[]},r.prototype.count=function(){return this._count},r.prototype.get=function(t,e){if(!(e>=0&&e=0&&e=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,i=e[t];if(i!=null&&it)a=o-1;else return o}return-1},r.prototype.indicesOfNearest=function(t,e,i){var n=this._chunks,a=n[t],o=[];if(!a)return o;i==null&&(i=1/0);for(var s=1/0,l=-1,u=0,h=0,c=this.count();h=0&&l<0)&&(s=d,l=v,u=0),v===l&&(o[u++]=h))}return o.length=u,o},r.prototype.getIndices=function(){var t,e=this._indices;if(e){var i=e.constructor,n=this._count;if(i===Array){t=new i(n);for(var a=0;a=c&&m<=f||isNaN(m))&&(l[u++]=p),p++}d=!0}else if(a===2){for(var g=v[n[0]],_=v[n[1]],x=t[n[1]][0],b=t[n[1]][1],y=0;y=c&&m<=f||isNaN(m))&&(S>=x&&S<=b||isNaN(S))&&(l[u++]=p),p++}d=!0}}if(!d)if(a===1)for(var y=0;y=c&&m<=f||isNaN(m))&&(l[u++]=w)}else for(var y=0;yt[C][1])&&(T=!1)}T&&(l[u++]=e.getRawIndex(y))}return uy[1]&&(y[1]=g)}}}},r.prototype.lttbDownSample=function(t,e){var i=this.clone([t],!0),n=i._chunks,a=n[t],o=this.count(),s=0,l=Math.floor(1/e),u=this.getRawIndex(0),h,c,f,v=new(Vo(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));v[s++]=u;for(var d=1;dh&&(h=c,f=x)}D>0&&Ds&&(p=s-h);for(var g=0;gd&&(d=m,v=h+g)}var _=this.getRawIndex(c),x=this.getRawIndex(v);ch-d&&(l=h-d,s.length=l);for(var p=0;pc[1]&&(c[1]=y),f[v++]=m}return a._count=v,a._indices=f,a._updateGetRawIdx(),a},r.prototype.each=function(t,e){if(this._count)for(var i=t.length,n=this._chunks,a=0,o=this.count();al&&(l=c)}return o=[s,l],this._extent[t]=o,o},r.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var i=[],n=this._chunks,a=0;a=0?this._indices[t]:-1},r.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},r.internalField=function(){function t(e,i,n,a){return Fn(e[a],this._dimensions[a])}Ep={arrayRows:t,objectRows:function(e,i,n,a){return Fn(e[i],this._dimensions[a])},keyedColumns:t,original:function(e,i,n,a){var o=e&&(e.value==null?e:e.value);return Fn(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(e,i,n,a){return e[a]}}}(),r}(),KI=function(){function r(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return r.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},r.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},r.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},r.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},r.prototype._createSource=function(){this._setLocalSource([],[]);var t=this._sourceHost,e=this._getUpstreamSourceManagers(),i=!!e.length,n,a;if(hc(t)){var o=t,s=void 0,l=void 0,u=void 0;if(i){var h=e[0];h.prepareSource(),u=h.getSource(),s=u.data,l=u.sourceFormat,a=[h._getVersionSign()]}else s=o.get("data",!0),l=qe(s)?Vn:Or,a=[];var c=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},v=lt(c.seriesLayoutBy,f.seriesLayoutBy)||null,d=lt(c.sourceHeader,f.sourceHeader),p=lt(c.dimensions,f.dimensions),g=v!==f.seriesLayoutBy||!!d!=!!f.sourceHeader||p;n=g?[pm(s,{seriesLayoutBy:v,sourceHeader:d,dimensions:p},l)]:[]}else{var y=t;if(i){var m=this._applyTransform(e);n=m.sourceList,a=m.upstreamSignList}else{var _=y.get("source",!0);n=[pm(_,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(n,a)},r.prototype._applyTransform=function(t){var e=this._sourceHost,i=e.get("transform",!0),n=e.get("fromTransformResult",!0);if(n!=null){var a="";t.length!==1&&yw(a)}var o,s=[],l=[];return A(t,function(u){u.prepareSource();var h=u.getSource(n||0),c="";n!=null&&!h&&yw(c),s.push(h),l.push(u._getVersionSign())}),i?o=ZW(i,s,{datasetIndex:e.componentIndex}):n!=null&&(o=[LW(s[0])]),{sourceList:o,upstreamSignList:l}},r.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),e=0;e1||e>0&&!r.noHeader;return A(r.blocks,function(n){var a=eP(n);a>=t&&(t=a+ +(i&&(!a||ym(n)&&!n.noHeader)))}),t}return 0}function r4(r,t,e,i){var n=t.noHeader,a=n4(eP(t)),o=[],s=t.blocks||[];Ve(!s||V(s)),s=s||[];var l=r.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(X(u,l)){var h=new XI(u[l],null);s.sort(function(p,g){return h.evaluate(p.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}A(s,function(p,g){var y=t.valueFormatter,m=tP(p)(y?z(z({},r),{valueFormatter:y}):r,p,g>0?a.html:0,i);m!=null&&o.push(m)});var c=r.renderMode==="richText"?o.join(a.richText):mm(i,o.join(""),n?e:a.html);if(n)return c;var f=fm(t.header,"ordinal",r.useUTC),v=QI(i,r.renderMode).nameStyle,d=JI(i);return r.renderMode==="richText"?rP(r,f,v)+a.richText+c:mm(i,'
'+Oe(f)+"
"+c,e)}function i4(r,t,e,i){var n=r.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,l=t.name,u=r.useUTC,h=t.valueFormatter||r.valueFormatter||function(x){return x=V(x)?x:[x],F(x,function(b,S){return fm(b,V(v)?v[S]:v,u)})};if(!(a&&o)){var c=s?"":r.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",n),f=a?"":fm(l,"ordinal",u),v=t.valueType,d=o?[]:h(t.value,t.dataIndex),p=!s||!a,g=!s&&a,y=QI(i,n),m=y.nameStyle,_=y.valueStyle;return n==="richText"?(s?"":c)+(a?"":rP(r,f,m))+(o?"":s4(r,d,p,g,_)):mm(i,(s?"":c)+(a?"":a4(f,!s,m))+(o?"":o4(d,p,g,_)),e)}}function mw(r,t,e,i,n,a){if(r){var o=tP(r),s={useUTC:n,renderMode:e,orderMode:i,markupStyleCreator:t,valueFormatter:r.valueFormatter};return o(s,r,0,a)}}function n4(r){return{html:t4[r],richText:e4[r]}}function mm(r,t,e){var i='
',n="margin: "+e+"px 0 0",a=JI(r);return'
'+t+i+"
"}function a4(r,t,e){var i=t?"margin-left:2px":"";return''+Oe(r)+""}function o4(r,t,e,i){var n=e?"10px":"20px",a=t?"float:right;margin-left:"+n:"";return r=V(r)?r:[r],''+F(r,function(o){return Oe(o)}).join("  ")+""}function rP(r,t,e){return r.markupStyleCreator.wrapRichTextStyle(t,e)}function s4(r,t,e,i,n){var a=[n],o=i?10:20;return e&&a.push({padding:[0,0,0,o],align:"right"}),r.markupStyleCreator.wrapRichTextStyle(V(t)?t.join(" "):t,a)}function iP(r,t){var e=r.getData().getItemVisual(t,"style"),i=e[r.visualDrawType];return go(i)}function nP(r,t){var e=r.get("padding");return e??(t==="richText"?[8,10]:10)}var Op=function(){function r(){this.richTextStyles={},this._nextStyleNameId=b2()}return r.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},r.prototype.makeTooltipMarker=function(t,e,i){var n=i==="richText"?this._generateStyleName():null,a=MI({color:e,type:t,renderMode:i,markerId:n});return Y(a)?a:(this.richTextStyles[n]=a.style,a.content)},r.prototype.wrapRichTextStyle=function(t,e){var i={};V(e)?A(e,function(a){return z(i,a)}):z(i,e);var n=this._generateStyleName();return this.richTextStyles[n]=i,"{"+n+"|"+t+"}"},r}();function aP(r){var t=r.series,e=r.dataIndex,i=r.multipleSeries,n=t.getData(),a=n.mapDimensionsAll("defaultedTooltip"),o=a.length,s=t.getRawValue(e),l=V(s),u=iP(t,e),h,c,f,v;if(o>1||l&&!o){var d=l4(s,t,e,a,u);h=d.inlineValues,c=d.inlineValueTypes,f=d.blocks,v=d.inlineValues[0]}else if(o){var p=n.getDimensionInfo(a[0]);v=h=As(n,e,a[0]),c=p.type}else v=h=l?s[0]:s;var g=e_(t),y=g&&t.name||"",m=n.getName(e),_=i?y:m;return _e("section",{header:y,noHeader:i||!g,sortParam:v,blocks:[_e("nameValue",{markerType:"item",markerColor:u,name:_,noName:!Lr(_),value:h,valueType:c,dataIndex:e})].concat(f||[])})}function l4(r,t,e,i,n){var a=t.getData(),o=Pr(r,function(c,f,v){var d=a.getDimensionInfo(v);return c=c||d&&d.tooltip!==!1&&d.displayName!=null},!1),s=[],l=[],u=[];i.length?A(i,function(c){h(As(a,e,c),c)}):A(r,h);function h(c,f){var v=a.getDimensionInfo(f);!v||v.otherDims.tooltip===!1||(o?u.push(_e("nameValue",{markerType:"subItem",markerColor:n,name:v.displayName,value:c,valueType:v.type})):(s.push(c),l.push(v.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var hn=Tt();function cc(r,t){return r.getName(t)||r.getId(t)}var vf="__universalTransitionEnabled",zt=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return t.prototype.init=function(e,i,n){this.seriesIndex=this.componentIndex,this.dataTask=yu({count:h4,reset:c4}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n);var a=hn(this).sourceManager=new KI(this);a.prepareSource();var o=this.getInitialData(e,n);xw(o,this),this.dataTask.context.data=o,hn(this).dataBeforeProcessed=o,_w(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(e,i){var n=Gu(this),a=n?Us(e):{},o=this.subType;yt.hasClass(o)&&(o+="Series"),ht(e,i.getTheme().get(this.subType)),ht(e,this.getDefaultOption()),co(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&Zn(e,a,n)},t.prototype.mergeOption=function(e,i){e=ht(this.option,e,!0),this.fillDataTextStyle(e.data);var n=Gu(this);n&&Zn(this.option,e,n);var a=hn(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(e,i);xw(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,hn(this).dataBeforeProcessed=o,_w(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(e){if(e&&!qe(e))for(var i=["show"],n=0;nthis.getShallow("animationThreshold")&&(i=!1),!!i},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,i,n){var a=this.ecModel,o=I_.prototype.getColorFromPalette.call(this,e,i,n);return o||(o=a.getColorFromPalette(e,i,n)),o},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(e,i){this._innerSelect(this.getData(i),e)},t.prototype.unselect=function(e,i){var n=this.option.selectedMap;if(n){var a=this.option.selectedMode,o=this.getData(i);if(a==="series"||n==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&n.push(o)}return n},t.prototype.isSelected=function(e,i){var n=this.option.selectedMap;if(!n)return!1;var a=this.getData(i);return(n==="all"||n[cc(a,e)])&&!a.getItemModel(e).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[vf])return!0;var e=this.option.universalTransition;return e?e===!0?!0:e&&e.enabled:!1},t.prototype._innerSelect=function(e,i){var n,a,o=this.option,s=o.selectedMode,l=i.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){et(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,h=0;h0&&this._innerSelect(e,i)}},t.registerClass=function(e){return yt.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type="series.__base__",e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol="circle",e.visualStyleAccessPath="itemStyle",e.visualDrawType="fill"}(),t}(yt);re(zt,ud);re(zt,I_);I2(zt,yt);function _w(r){var t=r.name;e_(r)||(r.name=u4(r)||t)}function u4(r){var t=r.getRawData(),e=t.mapDimensionsAll("seriesName"),i=[];return A(e,function(n){var a=t.getDimensionInfo(n);a.displayName&&i.push(a.displayName)}),i.join(" ")}function h4(r){return r.model.getRawData().count()}function c4(r){var t=r.model;return t.setData(t.getRawData().cloneShallow()),f4}function f4(r,t){t.outputData&&r.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function xw(r,t){A(ws(r.CHANGABLE_METHODS,r.DOWNSAMPLE_METHODS),function(e){r.wrapMethod(e,ut(v4,t))})}function v4(r,t){var e=_m(r);return e&&e.setOutputEnd((t||this).count()),t}function _m(r){var t=(r.ecModel||{}).scheduler,e=t&&t.getPipeline(r.uid);if(e){var i=e.currentTask;if(i){var n=i.agentStubMap;n&&(i=n.get(r.uid))}return i}}var Yt=function(){function r(){this.group=new at,this.uid=Ws("viewComponent")}return r.prototype.init=function(t,e){},r.prototype.render=function(t,e,i,n){},r.prototype.dispose=function(t,e){},r.prototype.updateView=function(t,e,i,n){},r.prototype.updateLayout=function(t,e,i,n){},r.prototype.updateVisual=function(t,e,i,n){},r.prototype.toggleBlurSeries=function(t,e,i){},r.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},r}();i_(Yt);Xv(Yt);function Xs(){var r=Tt();return function(t){var e=r(t),i=t.pipelineContext,n=!!e.large,a=!!e.progressiveRender,o=e.large=!!(i&&i.large),s=e.progressiveRender=!!(i&&i.progressiveRender);return(n!==o||a!==s)&&"reset"}}var oP=Tt(),d4=Xs(),Ot=function(){function r(){this.group=new at,this.uid=Ws("viewChart"),this.renderTask=yu({plan:p4,reset:g4}),this.renderTask.context={view:this}}return r.prototype.init=function(t,e){},r.prototype.render=function(t,e,i,n){},r.prototype.highlight=function(t,e,i,n){var a=t.getData(n&&n.dataType);a&&Sw(a,n,"emphasis")},r.prototype.downplay=function(t,e,i,n){var a=t.getData(n&&n.dataType);a&&Sw(a,n,"normal")},r.prototype.remove=function(t,e){this.group.removeAll()},r.prototype.dispose=function(t,e){},r.prototype.updateView=function(t,e,i,n){this.render(t,e,i,n)},r.prototype.updateLayout=function(t,e,i,n){this.render(t,e,i,n)},r.prototype.updateVisual=function(t,e,i,n){this.render(t,e,i,n)},r.prototype.eachRendered=function(t){ta(this.group,t)},r.markUpdateMethod=function(t,e){oP(t).updateMethod=e},r.protoInitialize=function(){var t=r.prototype;t.type="chart"}(),r}();function bw(r,t,e){r&&zu(r)&&(t==="emphasis"?Ki:Ji)(r,e)}function Sw(r,t,e){var i=fo(r,t),n=t&&t.highlightKey!=null?Q3(t.highlightKey):null;i!=null?A(Bt(i),function(a){bw(r.getItemGraphicEl(a),e,n)}):r.eachItemGraphicEl(function(a){bw(a,e,n)})}i_(Ot);Xv(Ot);function p4(r){return d4(r.model)}function g4(r){var t=r.model,e=r.ecModel,i=r.api,n=r.payload,a=t.pipelineContext.progressiveRender,o=r.view,s=n&&oP(n).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,e,i,n),y4[l]}var y4={incrementalPrepareRender:{progress:function(r,t){t.view.incrementalRender(r,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(r,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},jf="\0__throttleOriginMethod",ww="\0__throttleRate",Tw="\0__throttleType";function cd(r,t,e){var i,n=0,a=0,o=null,s,l,u,h;t=t||0;function c(){a=new Date().getTime(),o=null,r.apply(l,u||[])}var f=function(){for(var v=[],d=0;d=0?c():o=setTimeout(c,-s),n=i};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.debounceNextCall=function(v){h=v},f}function Zs(r,t,e,i){var n=r[t];if(n){var a=n[jf]||n,o=n[Tw],s=n[ww];if(s!==e||o!==i){if(e==null||!i)return r[t]=a;n=r[t]=cd(a,e,i==="debounce"),n[jf]=a,n[Tw]=i,n[ww]=e}return n}}function Wu(r,t){var e=r[t];e&&e[jf]&&(e.clear&&e.clear(),r[t]=e[jf])}var Mw=Tt(),Cw={itemStyle:vo(pI,!0),lineStyle:vo(dI,!0)},m4={lineStyle:"stroke",itemStyle:"fill"};function sP(r,t){var e=r.visualStyleMapper||Cw[t];return e||(console.warn("Unknown style type '"+t+"'."),Cw.itemStyle)}function lP(r,t){var e=r.visualDrawType||m4[t];return e||(console.warn("Unknown style type '"+t+"'."),"fill")}var _4={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,t){var e=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=r.getModel(i),a=sP(r,i),o=a(n),s=n.getShallow("decal");s&&(e.setVisual("decal",s),s.dirty=!0);var l=lP(r,i),u=o[l],h=Q(u)?u:null,c=o.fill==="auto"||o.stroke==="auto";if(!o[l]||h||c){var f=r.getColorFromPalette(r.name,null,t.getSeriesCount());o[l]||(o[l]=f,e.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||Q(o.fill)?f:o.fill,o.stroke=o.stroke==="auto"||Q(o.stroke)?f:o.stroke}if(e.setVisual("style",o),e.setVisual("drawType",l),!t.isSeriesFiltered(r)&&h)return e.setVisual("colorFromPalette",!1),{dataEach:function(v,d){var p=r.getDataParams(d),g=z({},o);g[l]=h(p),v.setItemVisual(d,"style",g)}}}},pl=new Lt,x4={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,t){if(!(r.ignoreStyleOnData||t.isSeriesFiltered(r))){var e=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=sP(r,i),a=e.getVisual("drawType");return{dataEach:e.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[i]){pl.option=l[i];var u=n(pl),h=o.ensureUniqueItemVisual(s,"style");z(h,u),pl.option.decal&&(o.setItemVisual(s,"decal",pl.option.decal),pl.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},b4={performRawSeries:!0,overallReset:function(r){var t=Z();r.eachSeries(function(e){var i=e.getColorBy();if(!e.isColorBySeries()){var n=e.type+"-"+i,a=t.get(n);a||(a={},t.set(n,a)),Mw(e).scope=a}}),r.eachSeries(function(e){if(!(e.isColorBySeries()||r.isSeriesFiltered(e))){var i=e.getRawData(),n={},a=e.getData(),o=Mw(e).scope,s=e.visualStyleAccessPath||"itemStyle",l=lP(e,s);a.each(function(u){var h=a.getRawIndex(u);n[h]=u}),i.each(function(u){var h=n[u],c=a.getItemVisual(h,"colorFromPalette");if(c){var f=a.ensureUniqueItemVisual(h,"style"),v=i.getName(u)||u+"",d=i.count();f[l]=e.getColorFromPalette(v,o,d)}})}})}},fc=Math.PI;function S4(r,t){t=t||{},tt(t,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var e=new at,i=new wt({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});e.add(i);var n=new St({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new wt({style:{fill:"none"},textContent:n,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});e.add(a);var o;return t.showSpinner&&(o=new gh({shape:{startAngle:-fc/2,endAngle:-fc/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:fc*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:fc*3/2}).delay(300).start("circularInOut"),e.add(o)),e.resize=function(){var s=n.getBoundingRect().width,l=t.showSpinner?t.spinnerRadius:0,u=(r.getWidth()-l*2-(t.showSpinner&&s?10:0)-s)/2-(t.showSpinner&&s?0:5+s/2)+(t.showSpinner?0:s/2)+(s?0:l),h=r.getHeight()/2;t.showSpinner&&o.setShape({cx:u,cy:h}),a.setShape({x:u-l,y:h-l,width:l*2,height:l*2}),i.setShape({x:0,y:0,width:r.getWidth(),height:r.getHeight()})},e.resize(),e}var uP=function(){function r(t,e,i,n){this._stageTaskMap=Z(),this.ecInstance=t,this.api=e,i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice(),this._allHandlers=i.concat(n)}return r.prototype.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each(function(i){var n=i.overallTask;n&&n.dirty()})},r.prototype.getPerformArgs=function(t,e){if(t.__pipeline){var i=this._pipelineMap.get(t.__pipeline.id),n=i.context,a=!e&&i.progressiveEnabled&&(!n||n.progressiveRender)&&t.__idxInPipeline>i.blockIndex,o=a?i.step:null,s=n&&n.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},r.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},r.prototype.updateStreamModes=function(t,e){var i=this._pipelineMap.get(t.uid),n=t.getData(),a=n.count(),o=i.progressiveEnabled&&e.incrementalPrepareRender&&a>=i.threshold,s=t.get("large")&&a>=t.get("largeThreshold"),l=t.get("progressiveChunkMode")==="mod"?a:null;t.pipelineContext=i.context={progressiveRender:o,modDataCount:l,large:s}},r.prototype.restorePipelines=function(t){var e=this,i=e._pipelineMap=Z();t.eachSeries(function(n){var a=n.getProgressive(),o=n.uid;i.set(o,{id:o,head:null,tail:null,threshold:n.getProgressiveThreshold(),progressiveEnabled:a&&!(n.preventIncremental&&n.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),e._pipe(n,n.dataTask)})},r.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),i=this.api;A(this._allHandlers,function(n){var a=t.get(n.uid)||t.set(n.uid,{}),o="";Ve(!(n.reset&&n.overallReset),o),n.reset&&this._createSeriesStageTask(n,a,e,i),n.overallReset&&this._createOverallStageTask(n,a,e,i)},this)},r.prototype.prepareView=function(t,e,i,n){var a=t.renderTask,o=a.context;o.model=e,o.ecModel=i,o.api=n,a.__block=!t.incrementalPrepareRender,this._pipe(e,a)},r.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},r.prototype.performVisualTasks=function(t,e,i){this._performStageTasks(this._visualHandlers,t,e,i)},r.prototype._performStageTasks=function(t,e,i,n){n=n||{};var a=!1,o=this;A(t,function(l,u){if(!(n.visualType&&n.visualType!==l.visualType)){var h=o._stageTaskMap.get(l.uid),c=h.seriesTaskMap,f=h.overallTask;if(f){var v,d=f.agentStubMap;d.each(function(g){s(n,g)&&(g.dirty(),v=!0)}),v&&f.dirty(),o.updatePayload(f,i);var p=o.getPerformArgs(f,n.block);d.each(function(g){g.perform(p)}),f.perform(p)&&(a=!0)}else c&&c.each(function(g,y){s(n,g)&&g.dirty();var m=o.getPerformArgs(g,n.block);m.skip=!l.performRawSeries&&e.isSeriesFiltered(g.context.model),o.updatePayload(g,i),g.perform(m)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},r.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(i){e=i.dataTask.perform()||e}),this.unfinished=e||this.unfinished},r.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})},r.prototype.updatePayload=function(t,e){e!=="remain"&&(t.context.payload=e)},r.prototype._createSeriesStageTask=function(t,e,i,n){var a=this,o=e.seriesTaskMap,s=e.seriesTaskMap=Z(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?i.eachRawSeries(h):l?i.eachRawSeriesByType(l,h):u&&u(i,n).each(h);function h(c){var f=c.uid,v=s.set(f,o&&o.get(f)||yu({plan:A4,reset:D4,count:I4}));v.context={model:c,ecModel:i,api:n,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:a},a._pipe(c,v)}},r.prototype._createOverallStageTask=function(t,e,i,n){var a=this,o=e.overallTask=e.overallTask||yu({reset:w4});o.context={ecModel:i,api:n,overallReset:t.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=Z(),u=t.seriesType,h=t.getTargetSeries,c=!0,f=!1,v="";Ve(!t.createOnAllSeries,v),u?i.eachRawSeriesByType(u,d):h?h(i,n).each(d):(c=!1,A(i.getSeries(),d));function d(p){var g=p.uid,y=l.set(g,s&&s.get(g)||(f=!0,yu({reset:T4,onDirty:C4})));y.context={model:p,overallProgress:c},y.agent=o,y.__block=c,a._pipe(p,y)}f&&o.dirty()},r.prototype._pipe=function(t,e){var i=t.uid,n=this._pipelineMap.get(i);!n.head&&(n.head=e),n.tail&&n.tail.pipe(e),n.tail=e,e.__idxInPipeline=n.count++,e.__pipeline=n},r.wrapStageHandler=function(t,e){return Q(t)&&(t={overallReset:t,seriesType:P4(t)}),t.uid=Ws("stageHandler"),e&&(t.visualType=e),t},r}();function w4(r){r.overallReset(r.ecModel,r.api,r.payload)}function T4(r){return r.overallProgress&&M4}function M4(){this.agent.dirty(),this.getDownstream().dirty()}function C4(){this.agent&&this.agent.dirty()}function A4(r){return r.plan?r.plan(r.model,r.ecModel,r.api,r.payload):null}function D4(r){r.useClearVisual&&r.data.clearAllVisual();var t=r.resetDefines=Bt(r.reset(r.model,r.ecModel,r.api,r.payload));return t.length>1?F(t,function(e,i){return hP(i)}):L4}var L4=hP(0);function hP(r){return function(t,e){var i=e.data,n=e.resetDefines[r];if(n&&n.dataEach)for(var a=t.start;a0&&v===u.length-f.length){var d=u.slice(0,v);d!=="data"&&(e.mainType=d,e[f.toLowerCase()]=l,h=!0)}}s.hasOwnProperty(u)&&(i[u]=l,h=!0),h||(n[u]=l)})}return{cptQuery:e,dataQuery:i,otherQuery:n}},r.prototype.filter=function(t,e){var i=this.eventInfo;if(!i)return!0;var n=i.targetEl,a=i.packedEvent,o=i.model,s=i.view;if(!o||!s)return!0;var l=e.cptQuery,u=e.dataQuery;return h(l,o,"mainType")&&h(l,o,"subType")&&h(l,o,"index","componentIndex")&&h(l,o,"name")&&h(l,o,"id")&&h(u,a,"name")&&h(u,a,"dataIndex")&&h(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,e.otherQuery,n,a));function h(c,f,v,d){return c[v]==null||f[d||v]===c[v]}},r.prototype.afterTrigger=function(){this.eventInfo=null},r}(),xm=["symbol","symbolSize","symbolRotate","symbolOffset"],Iw=xm.concat(["symbolKeepAspect"]),E4={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,t){var e=r.getData();if(r.legendIcon&&e.setVisual("legendIcon",r.legendIcon),!r.hasSymbolVisual)return;for(var i={},n={},a=!1,o=0;o=0&&ja(l)?l:.5;var u=r.createRadialGradient(o,s,0,o,s,l);return u}function bm(r,t,e){for(var i=t.type==="radial"?j4(r,t,e):Z4(r,t,e),n=t.colorStops,a=0;a0)?null:r==="dashed"?[4*t,2*t]:r==="dotted"?[t]:Mt(r)?[r]:V(r)?r:null}function B_(r){var t=r.style,e=t.lineDash&&t.lineWidth>0&&K4(t.lineDash,t.lineWidth),i=t.lineDashOffset;if(e){var n=t.strokeNoScale&&r.getLineScale?r.getLineScale():1;n&&n!==1&&(e=F(e,function(a){return a/n}),i/=n)}return[e,i]}var J4=new Ci(!0);function Jf(r){var t=r.stroke;return!(t==null||t==="none"||!(r.lineWidth>0))}function Pw(r){return typeof r=="string"&&r!=="none"}function Qf(r){var t=r.fill;return t!=null&&t!=="none"}function kw(r,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var e=r.globalAlpha;r.globalAlpha=t.fillOpacity*t.opacity,r.fill(),r.globalAlpha=e}else r.fill()}function Rw(r,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var e=r.globalAlpha;r.globalAlpha=t.strokeOpacity*t.opacity,r.stroke(),r.globalAlpha=e}else r.stroke()}function Sm(r,t,e){var i=n_(t.image,t.__image,e);if(Zv(i)){var n=r.createPattern(i,t.repeat||"repeat");if(typeof DOMMatrix=="function"&&n&&n.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*au),a.scaleSelf(t.scaleX||1,t.scaleY||1),n.setTransform(a)}return n}}function Q4(r,t,e,i){var n,a=Jf(e),o=Qf(e),s=e.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var h=t.path||J4,c=t.__dirty;if(!i){var f=e.fill,v=e.stroke,d=o&&!!f.colorStops,p=a&&!!v.colorStops,g=o&&!!f.image,y=a&&!!v.image,m=void 0,_=void 0,x=void 0,b=void 0,S=void 0;(d||p)&&(S=t.getBoundingRect()),d&&(m=c?bm(r,f,S):t.__canvasFillGradient,t.__canvasFillGradient=m),p&&(_=c?bm(r,v,S):t.__canvasStrokeGradient,t.__canvasStrokeGradient=_),g&&(x=c||!t.__canvasFillPattern?Sm(r,f,t):t.__canvasFillPattern,t.__canvasFillPattern=x),y&&(b=c||!t.__canvasStrokePattern?Sm(r,v,t):t.__canvasStrokePattern,t.__canvasStrokePattern=x),d?r.fillStyle=m:g&&(x?r.fillStyle=x:o=!1),p?r.strokeStyle=_:y&&(b?r.strokeStyle=b:a=!1)}var w=t.getGlobalScale();h.setScale(w[0],w[1],t.segmentIgnoreThreshold);var T,M;r.setLineDash&&e.lineDash&&(n=B_(t),T=n[0],M=n[1]);var C=!0;(u||c&ts)&&(h.setDPR(r.dpr),l?h.setContext(null):(h.setContext(r),C=!1),h.reset(),t.buildPath(h,t.shape,i),h.toStatic(),t.pathUpdated()),C&&h.rebuildPath(r,l?s:1),T&&(r.setLineDash(T),r.lineDashOffset=M),i||(e.strokeFirst?(a&&Rw(r,e),o&&kw(r,e)):(o&&kw(r,e),a&&Rw(r,e))),T&&r.setLineDash([])}function t6(r,t,e){var i=t.__image=n_(e.image,t.__image,t,t.onload);if(!(!i||!Zv(i))){var n=e.x||0,a=e.y||0,o=t.getWidth(),s=t.getHeight(),l=i.width/i.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=i.width,s=i.height),e.sWidth&&e.sHeight){var u=e.sx||0,h=e.sy||0;r.drawImage(i,u,h,e.sWidth,e.sHeight,n,a,o,s)}else if(e.sx&&e.sy){var u=e.sx,h=e.sy,c=o-u,f=s-h;r.drawImage(i,u,h,c,f,n,a,o,s)}else r.drawImage(i,n,a,o,s)}}function e6(r,t,e){var i,n=e.text;if(n!=null&&(n+=""),n){r.font=e.font||Yn,r.textAlign=e.textAlign,r.textBaseline=e.textBaseline;var a=void 0,o=void 0;r.setLineDash&&e.lineDash&&(i=B_(t),a=i[0],o=i[1]),a&&(r.setLineDash(a),r.lineDashOffset=o),e.strokeFirst?(Jf(e)&&r.strokeText(n,e.x,e.y),Qf(e)&&r.fillText(n,e.x,e.y)):(Qf(e)&&r.fillText(n,e.x,e.y),Jf(e)&&r.strokeText(n,e.x,e.y)),a&&r.setLineDash([])}}var Ew=["shadowBlur","shadowOffsetX","shadowOffsetY"],Ow=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function gP(r,t,e,i,n){var a=!1;if(!i&&(e=e||{},t===e))return!1;if(i||t.opacity!==e.opacity){ar(r,n),a=!0;var o=Math.max(Math.min(t.opacity,1),0);r.globalAlpha=isNaN(o)?eo.opacity:o}(i||t.blend!==e.blend)&&(a||(ar(r,n),a=!0),r.globalCompositeOperation=t.blend||eo.blend);for(var s=0;s0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,i,n){if(!this[Le]){if(this._disposed){this.id;return}var a,o,s;if(et(i)&&(n=i.lazyUpdate,a=i.silent,o=i.replaceMerge,s=i.transition,i=i.notMerge),this[Le]=!0,!this._model||i){var l=new pW(this._api),u=this._theme,h=this._model=new P_;h.scheduler=this._scheduler,h.ssr=this._ssr,h.init(null,null,null,u,this._locale,l)}this._model.setOption(e,{replaceMerge:o},Tm);var c={seriesTransition:s,optionChanged:!0};if(n)this[er]={silent:a,updateParams:c},this[Le]=!1,this.getZr().wakeUp();else{try{Ho(this),cn.update.call(this,null,c)}catch(f){throw this[er]=null,this[Le]=!1,f}this._ssr||this._zr.flush(),this[er]=null,this[Le]=!1,gl.call(this,a),yl.call(this,a)}}},t.prototype.setTheme=function(){},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||mt.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){e=e||{};var i=this._zr.painter;return i.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get("backgroundColor"),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){e=e||{};var i=this._zr.painter;return i.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){if(mt.svgSupported){var e=this._zr,i=e.storage.getDisplayList();return A(i,function(n){n.stopAnimation(null,!0)}),e.painter.toDataURL()}},t.prototype.getDataURL=function(e){if(this._disposed){this.id;return}e=e||{};var i=e.excludeComponents,n=this._model,a=[],o=this;A(i,function(l){n.eachComponent({mainType:l},function(u){var h=o._componentsMap[u.__viewId];h.group.ignore||(a.push(h),h.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return A(a,function(l){l.group.ignore=!1}),s},t.prototype.getConnectedDataURL=function(e){if(this._disposed){this.id;return}var i=e.type==="svg",n=this.group,a=Math.min,o=Math.max,s=1/0;if(iv[n]){var l=s,u=s,h=-s,c=-s,f=[],v=e&&e.pixelRatio||this.getDevicePixelRatio();A(no,function(_,x){if(_.group===n){var b=i?_.getZr().painter.getSvgDom().innerHTML:_.renderToCanvas(it(e)),S=_.getDom().getBoundingClientRect();l=a(S.left,l),u=a(S.top,u),h=o(S.right,h),c=o(S.bottom,c),f.push({dom:b,left:S.left,top:S.top})}}),l*=v,u*=v,h*=v,c*=v;var d=h-l,p=c-u,g=Qr.createCanvas(),y=jy(g,{renderer:i?"svg":"canvas"});if(y.resize({width:d,height:p}),i){var m="";return A(f,function(_){var x=_.left-l,b=_.top-u;m+=''+_.dom+""}),y.painter.getSvgRoot().innerHTML=m,e.connectedBackgroundColor&&y.painter.setBackgroundColor(e.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}else return e.connectedBackgroundColor&&y.add(new wt({shape:{x:0,y:0,width:d,height:p},style:{fill:e.connectedBackgroundColor}})),A(f,function(_){var x=new xe({style:{x:_.left*v-l,y:_.top*v-u,image:_.dom}});y.add(x)}),y.refreshImmediately(),g.toDataURL("image/"+(e&&e.type||"png"))}else return this.getDataURL(e)},t.prototype.convertToPixel=function(e,i){return Fp(this,"convertToPixel",e,i)},t.prototype.convertFromPixel=function(e,i){return Fp(this,"convertFromPixel",e,i)},t.prototype.containPixel=function(e,i){if(this._disposed){this.id;return}var n=this._model,a,o=fu(n,e);return A(o,function(s,l){l.indexOf("Models")>=0&&A(s,function(u){var h=u.coordinateSystem;if(h&&h.containPoint)a=a||!!h.containPoint(i);else if(l==="seriesModels"){var c=this._chartsMap[u.__viewId];c&&c.containPoint&&(a=a||c.containPoint(i,u))}},this)},this),!!a},t.prototype.getVisual=function(e,i){var n=this._model,a=fu(n,e,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?N_(s,l,i):xh(s,i)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e=this;A(C6,function(i){var n=function(a){var o=e.getModel(),s=a.target,l,u=i==="globalout";if(u?l={}:s&&Za(s,function(d){var p=ot(d);if(p&&p.dataIndex!=null){var g=p.dataModel||o.getSeriesByIndex(p.seriesIndex);return l=g&&g.getDataParams(p.dataIndex,p.dataType,s)||{},!0}else if(p.eventData)return l=z({},p.eventData),!0},!0),l){var h=l.componentType,c=l.componentIndex;(h==="markLine"||h==="markPoint"||h==="markArea")&&(h="series",c=l.seriesIndex);var f=h&&c!=null&&o.getComponent(h,c),v=f&&e[f.mainType==="series"?"_chartsMap":"_componentsMap"][f.__viewId];l.event=a,l.type=i,e._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:f,view:v},e.trigger(i,l)}};n.zrEventfulCallAtLast=!0,e._zr.on(i,n,e)}),A(mu,function(i,n){e._messageCenter.on(n,function(a){this.trigger(n,a)},e)}),A(["selectchanged"],function(i){e._messageCenter.on(i,function(n){this.trigger(i,n)},e)}),N4(this._messageCenter,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var e=this.getDom();e&&A2(this.getDom(),G_,"");var i=this,n=i._api,a=i._model;A(i._componentsViews,function(o){o.dispose(a,n)}),A(i._chartsViews,function(o){o.dispose(a,n)}),i._zr.dispose(),i._dom=i._model=i._chartsMap=i._componentsMap=i._chartsViews=i._componentsViews=i._scheduler=i._api=i._zr=i._throttledZrFlush=i._theme=i._coordSysMgr=i._messageCenter=null,delete no[i.id]},t.prototype.resize=function(e){if(!this[Le]){if(this._disposed){this.id;return}this._zr.resize(e);var i=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!i){var n=i.resetOption("media"),a=e&&e.silent;this[er]&&(a==null&&(a=this[er].silent),n=!0,this[er]=null),this[Le]=!0;try{n&&Ho(this),cn.update.call(this,{type:"resize",animation:z({duration:0},e&&e.animation)})}catch(o){throw this[Le]=!1,o}this[Le]=!1,gl.call(this,a),yl.call(this,a)}}},t.prototype.showLoading=function(e,i){if(this._disposed){this.id;return}if(et(e)&&(i=e,e=""),e=e||"default",this.hideLoading(),!!Mm[e]){var n=Mm[e](this._api,i),a=this._zr;this._loadingFX=n,a.add(n)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(e){var i=z({},e);return i.type=mu[e.type],i},t.prototype.dispatchAction=function(e,i){if(this._disposed){this.id;return}if(et(i)||(i={silent:!!i}),!!ev[e.type]&&this._model){if(this[Le]){this._pendingActions.push(e);return}var n=i.silent;Hp.call(this,e,n);var a=i.flush;a?this._zr.flush():a!==!1&&mt.browser.weChat&&this._throttledZrFlush(),gl.call(this,n),yl.call(this,n)}},t.prototype.updateLabelLayout=function(){Hr.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed){this.id;return}var i=e.seriesIndex,n=this.getModel(),a=n.getSeriesByIndex(i);a.appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=function(){Ho=function(c){var f=c._scheduler;f.restorePipelines(c._model),f.prepareStageTasks(),Vp(c,!0),Vp(c,!1),f.plan()},Vp=function(c,f){for(var v=c._model,d=c._scheduler,p=f?c._componentsViews:c._chartsViews,g=f?c._componentsMap:c._chartsMap,y=c._zr,m=c._api,_=0;_f.get("hoverLayerThreshold")&&!mt.node&&!mt.worker&&f.eachSeries(function(g){if(!g.preventUsingHoverLayer){var y=c._chartsMap[g.__viewId];y.__alive&&y.eachRendered(function(m){m.states.emphasis&&(m.states.emphasis.hoverLayer=!0)})}})}function o(c,f){var v=c.get("blendMode")||null;f.eachRendered(function(d){d.isGroup||(d.style.blend=v)})}function s(c,f){if(!c.preventAutoZ){var v=c.get("z")||0,d=c.get("zlevel")||0;f.eachRendered(function(p){return l(p,v,d,-1/0),!0})}}function l(c,f,v,d){var p=c.getTextContent(),g=c.getTextGuideLine(),y=c.isGroup;if(y)for(var m=c.childrenRef(),_=0;_0?{duration:p,delay:v.get("delay"),easing:v.get("easing")}:null;f.eachRendered(function(y){if(y.states&&y.states.emphasis){if(vs(y))return;if(y instanceof _t&&tH(y),y.__dirty){var m=y.prevStates;m&&y.useStates(m)}if(d){y.stateTransition=g;var _=y.getTextContent(),x=y.getTextGuideLine();_&&(_.stateTransition=g),x&&(x.stateTransition=g)}y.__dirty&&n(y)}})}Zw=function(c){return new(function(f){E(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.prototype.getCoordinateSystems=function(){return c._coordSysMgr.getCoordinateSystems()},v.prototype.getComponentByElement=function(d){for(;d;){var p=d.__ecComponentInfo;if(p!=null)return c._model.getComponent(p.mainType,p.index);d=d.parent}},v.prototype.enterEmphasis=function(d,p){Ki(d,p),yr(c)},v.prototype.leaveEmphasis=function(d,p){Ji(d,p),yr(c)},v.prototype.enterBlur=function(d){Y2(d),yr(c)},v.prototype.leaveBlur=function(d){u_(d),yr(c)},v.prototype.enterSelect=function(d){$2(d),yr(c)},v.prototype.leaveSelect=function(d){X2(d),yr(c)},v.prototype.getModel=function(){return c.getModel()},v.prototype.getViewOfComponentModel=function(d){return c.getViewOfComponentModel(d)},v.prototype.getViewOfSeriesModel=function(d){return c.getViewOfSeriesModel(d)},v}(NI))(c)},kP=function(c){function f(v,d){for(var p=0;p=0)){qw.push(e);var a=uP.wrapStageHandler(e,n);a.__prio=t,a.__raw=e,r.push(a)}}function X_(r,t){Mm[r]=t}function O6(r){kL({createCanvas:r})}function VP(r,t,e){var i=SP("registerMap");i&&i(r,t,e)}function N6(r){var t=SP("getMap");return t&&t(r)}var FP=XW;ra(V_,_4);ra(fd,x4);ra(fd,b4);ra(V_,E4);ra(fd,O4);ra(MP,u6);U_(zI);Y_(p6,AW);X_("default",S4);ii({type:ro,event:ro,update:ro},ee);ii({type:lf,event:lf,update:lf},ee);ii({type:vu,event:vu,update:vu},ee);ii({type:uf,event:uf,update:uf},ee);ii({type:du,event:du,update:du},ee);W_("light",k4);W_("dark",vP);var B6={},Kw=[],z6={registerPreprocessor:U_,registerProcessor:Y_,registerPostInit:OP,registerPostUpdate:NP,registerUpdateLifecycle:vd,registerAction:ii,registerCoordinateSystem:BP,registerLayout:zP,registerVisual:ra,registerTransform:FP,registerLoading:X_,registerMap:VP,registerImpl:h6,PRIORITY:CP,ComponentModel:yt,ComponentView:Yt,SeriesModel:zt,ChartView:Ot,registerComponentModel:function(r){yt.registerClass(r)},registerComponentView:function(r){Yt.registerClass(r)},registerSeriesModel:function(r){zt.registerClass(r)},registerChartView:function(r){Ot.registerClass(r)},registerSubTypeDefaulter:function(r,t){yt.registerSubTypeDefaulter(r,t)},registerPainter:function(r,t){d2(r,t)}};function pt(r){if(V(r)){A(r,function(t){pt(t)});return}vt(Kw,r)>=0||(Kw.push(r),Q(r)&&(r={install:r}),r.install(z6))}function ml(r){return r==null?0:r.length||1}function Jw(r){return r}var Qi=function(){function r(t,e,i,n,a,o){this._old=t,this._new=e,this._oldKeyGetter=i||Jw,this._newKeyGetter=n||Jw,this.context=a,this._diffModeMultiple=o==="multiple"}return r.prototype.add=function(t){return this._add=t,this},r.prototype.update=function(t){return this._update=t,this},r.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},r.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},r.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},r.prototype.remove=function(t){return this._remove=t,this},r.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},r.prototype._executeOneToOne=function(){var t=this._old,e=this._new,i={},n=new Array(t.length),a=new Array(e.length);this._initIndexMap(t,null,n,"_oldKeyGetter"),this._initIndexMap(e,i,a,"_newKeyGetter");for(var o=0;o1){var h=l.shift();l.length===1&&(i[s]=l[0]),this._update&&this._update(h,o)}else u===1?(i[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,i)},r.prototype._executeMultiple=function(){var t=this._old,e=this._new,i={},n={},a=[],o=[];this._initIndexMap(t,i,a,"_oldKeyGetter"),this._initIndexMap(e,n,o,"_newKeyGetter");for(var s=0;s1&&f===1)this._updateManyToOne&&this._updateManyToOne(h,u),n[l]=null;else if(c===1&&f>1)this._updateOneToMany&&this._updateOneToMany(h,u),n[l]=null;else if(c===1&&f===1)this._update&&this._update(h,u),n[l]=null;else if(c>1&&f>1)this._updateManyToMany&&this._updateManyToMany(h,u),n[l]=null;else if(c>1)for(var v=0;v1)for(var s=0;s30}var _l=et,fn=F,U6=typeof Int32Array>"u"?Array:Int32Array,Y6="e\0\0",Qw=-1,$6=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],X6=["_approximateExtent"],tT,yc,xl,bl,Yp,Sl,$p,Be=function(){function r(t,e){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var i,n=!1;HP(t)?(i=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(n=!0,i=t),i=i||["x","y"];for(var a={},o=[],s={},l=!1,u={},h=0;h=e)){var i=this._store,n=i.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=n.getSource().sourceFormat,l=s===Or;if(l&&!n.pure)for(var u=[],h=t;h0},r.prototype.ensureUniqueItemVisual=function(t,e){var i=this._itemVisuals,n=i[t];n||(n=i[t]={});var a=n[e];return a==null&&(a=this.getVisual(e),V(a)?a=a.slice():_l(a)&&(a=z({},a)),n[e]=a),a},r.prototype.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{};this._itemVisuals[t]=n,_l(e)?z(n,e):n[e]=i},r.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},r.prototype.setLayout=function(t,e){_l(t)?z(this._layout,t):this._layout[t]=e},r.prototype.getLayout=function(t){return this._layout[t]},r.prototype.getItemLayout=function(t){return this._itemLayouts[t]},r.prototype.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?z(this._itemLayouts[t]||{},e):e},r.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},r.prototype.setItemGraphicEl=function(t,e){var i=this.hostModel&&this.hostModel.seriesIndex;im(i,this.dataType,t,e),this._graphicEls[t]=e},r.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},r.prototype.eachItemGraphicEl=function(t,e){A(this._graphicEls,function(i,n){i&&t&&t.call(e,i,n)})},r.prototype.cloneShallow=function(t){return t||(t=new r(this._schema?this._schema:fn(this.dimensions,this._getDimInfo,this),this.hostModel)),Yp(t,this),t._store=this._store,t},r.prototype.wrapMethod=function(t,e){var i=this[t];Q(i)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var n=i.apply(this,arguments);return e.apply(this,[n].concat(Vv(arguments)))})},r.internalField=function(){tT=function(t){var e=t._invertedIndicesMap;A(e,function(i,n){var a=t._dimInfos[n],o=a.ordinalMeta,s=t._store;if(o){i=e[n]=new U6(o.categories.length);for(var l=0;l1&&(l+="__ec__"+h),n[e]=l}}}(),r}();function Z6(r,t){return qs(r,t).dimensions}function qs(r,t){k_(r)||(r=R_(r)),t=t||{};var e=t.coordDimensions||[],i=t.dimensionsDefine||r.dimensionsDefine||[],n=Z(),a=[],o=q6(r,e,i,t.dimensionsCount),s=t.canOmitUnusedDimensions&&YP(o),l=i===r.dimensionsDefine,u=l?UP(r):WP(i),h=t.encodeDefine;!h&&t.encodeDefaulter&&(h=t.encodeDefaulter(r,o));for(var c=Z(h),f=new jI(o),v=0;v0&&(i.name=n+(a-1)),a++,t.set(n,a)}}function q6(r,t,e,i){var n=Math.max(r.dimensionsDetectedCount||1,t.length,e.length,i||0);return A(t,function(a){var o;et(a)&&(o=a.dimsDef)&&(n=Math.max(n,o.length))}),n}function K6(r,t,e){if(e||t.hasKey(r)){for(var i=0;t.hasKey(r+i);)i++;r+=i}return t.set(r,!0),r}var J6=function(){function r(t){this.coordSysDims=[],this.axisMap=Z(),this.categoryAxisMap=Z(),this.coordSysName=t}return r}();function Q6(r){var t=r.get("coordinateSystem"),e=new J6(t),i=tU[t];if(i)return i(r,e,e.axisMap,e.categoryAxisMap),e}var tU={cartesian2d:function(r,t,e,i){var n=r.getReferringComponents("xAxis",le).models[0],a=r.getReferringComponents("yAxis",le).models[0];t.coordSysDims=["x","y"],e.set("x",n),e.set("y",a),Wo(n)&&(i.set("x",n),t.firstCategoryDimIndex=0),Wo(a)&&(i.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(r,t,e,i){var n=r.getReferringComponents("singleAxis",le).models[0];t.coordSysDims=["single"],e.set("single",n),Wo(n)&&(i.set("single",n),t.firstCategoryDimIndex=0)},polar:function(r,t,e,i){var n=r.getReferringComponents("polar",le).models[0],a=n.findAxisModel("radiusAxis"),o=n.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],e.set("radius",a),e.set("angle",o),Wo(a)&&(i.set("radius",a),t.firstCategoryDimIndex=0),Wo(o)&&(i.set("angle",o),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},geo:function(r,t,e,i){t.coordSysDims=["lng","lat"]},parallel:function(r,t,e,i){var n=r.ecModel,a=n.getComponent("parallel",r.get("parallelIndex")),o=t.coordSysDims=a.dimensions.slice();A(a.parallelAxisIndex,function(s,l){var u=n.getComponent("parallelAxis",s),h=o[l];e.set(h,u),Wo(u)&&(i.set(h,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})}};function Wo(r){return r.get("type")==="category"}function $P(r,t,e){e=e||{};var i=e.byIndex,n=e.stackedCoordDimension,a,o,s;eU(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(r&&r.get("stack")),u,h,c,f;if(A(a,function(m,_){Y(m)&&(a[_]=m={name:m}),l&&!m.isExtraCoord&&(!i&&!u&&m.ordinalMeta&&(u=m),!h&&m.type!=="ordinal"&&m.type!=="time"&&(!n||n===m.coordDim)&&(h=m))}),h&&!i&&!u&&(i=!0),h){c="__\0ecstackresult_"+r.id,f="__\0ecstackedover_"+r.id,u&&(u.createInvertedIndices=!0);var v=h.coordDim,d=h.type,p=0;A(a,function(m){m.coordDim===v&&p++});var g={name:c,coordDim:v,coordDimIndex:p,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},y={name:f,coordDim:f,coordDimIndex:p+1,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(g.storeDimIndex=s.ensureCalculationDimension(f,d),y.storeDimIndex=s.ensureCalculationDimension(c,d)),o.appendCalculationDimension(g),o.appendCalculationDimension(y)):(a.push(g),a.push(y))}return{stackedDimension:h&&h.name,stackedByDimension:u&&u.name,isStackedByIndex:i,stackedOverDimension:f,stackResultDimension:c}}function eU(r){return!HP(r.schema)}function tn(r,t){return!!t&&t===r.getCalculationInfo("stackedDimension")}function Z_(r,t){return tn(r,t)?r.getCalculationInfo("stackResultDimension"):t}function rU(r,t){var e=r.get("coordinateSystem"),i=$s.get(e),n;return t&&t.coordSysDims&&(n=F(t.coordSysDims,function(a){var o={name:a},s=t.axisMap.get(a);if(s){var l=s.get("type");o.type=nv(l)}return o})),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}function iU(r,t,e){var i,n;return e&&A(r,function(a,o){var s=a.coordDim,l=e.categoryAxisMap.get(s);l&&(i==null&&(i=o),a.ordinalMeta=l.getOrdinalMeta(),t&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(n=!0)}),!n&&i!=null&&(r[i].otherDims.itemName=0),i}function Li(r,t,e){e=e||{};var i=t.getSourceManager(),n,a=!1;r?(a=!0,n=R_(r)):(n=i.getSource(),a=n.sourceFormat===Or);var o=Q6(t),s=rU(t,o),l=e.useEncodeDefaulter,u=Q(l)?l:l?ut(kI,s,t):null,h={coordDimensions:s,generateCoord:e.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},c=qs(n,h),f=iU(c.dimensions,e.createInvertedIndices,o),v=a?null:i.getSharedDataStore(c),d=$P(t,{schema:c,store:v}),p=new Be(c,t);p.setCalculationInfo(d);var g=f!=null&&nU(n)?function(y,m,_,x){return x===f?_:this.defaultDimValueGetter(y,m,_,x)}:null;return p.hasItemOption=!1,p.initData(a?n:v,null,g),p}function nU(r){if(r.sourceFormat===Or){var t=aU(r.data||[]);return!V(Os(t))}}function aU(r){for(var t=0;te[1]&&(e[1]=t[1])},r.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},r.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},r.prototype.isBlank=function(){return this._isBlank},r.prototype.setBlank=function(t){this._isBlank=t},r}();Xv(Ii);var oU=0,Cm=function(){function r(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++oU}return r.createByAxisModel=function(t){var e=t.option,i=e.data,n=i&&F(i,sU);return new r({categories:n,needCollect:!n,deduplication:e.dedplication!==!1})},r.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},r.prototype.parseAndCollect=function(t){var e,i=this._needCollect;if(!Y(t)&&!i)return t;if(i&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var n=this._getOrCreateMap();return e=n.get(t),e==null&&(i?(e=this.categories.length,this.categories[e]=t,n.set(t,e)):e=NaN),e},r.prototype._getOrCreateMap=function(){return this._map||(this._map=Z(this.categories))},r}();function sU(r){return et(r)&&r.value!=null?r.value:r+""}function Am(r){return r.type==="interval"||r.type==="log"}function lU(r,t,e,i){var n={},a=r[1]-r[0],o=n.interval=Q0(a/t,!0);e!=null&&oi&&(o=n.interval=i);var s=n.intervalPrecision=XP(o),l=n.niceTickExtent=[Qt(Math.ceil(r[0]/o)*o,s),Qt(Math.floor(r[1]/o)*o,s)];return uU(l,r),n}function Xp(r){var t=Math.pow(10,$v(r)),e=r/t;return e?e===2?e=3:e===3?e=5:e*=2:e=1,Qt(e*t)}function XP(r){return $r(r)+2}function eT(r,t,e){r[t]=Math.max(Math.min(r[t],e[1]),e[0])}function uU(r,t){!isFinite(r[0])&&(r[0]=t[0]),!isFinite(r[1])&&(r[1]=t[1]),eT(r,0,t),eT(r,1,t),r[0]>r[1]&&(r[0]=r[1])}function dd(r,t){return r>=t[0]&&r<=t[1]}function pd(r,t){return t[1]===t[0]?.5:(r-t[0])/(t[1]-t[0])}function gd(r,t){return r*(t[1]-t[0])+t[0]}var yd=function(r){E(t,r);function t(e){var i=r.call(this,e)||this;i.type="ordinal";var n=i.getSetting("ordinalMeta");return n||(n=new Cm({})),V(n)&&(n=new Cm({categories:F(n,function(a){return et(a)?a.value:a})})),i._ordinalMeta=n,i._extent=i.getSetting("extent")||[0,n.categories.length-1],i}return t.prototype.parse=function(e){return e==null?NaN:Y(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return e=this.parse(e),dd(e,this._extent)&&this._ordinalMeta.categories[e]!=null},t.prototype.normalize=function(e){return e=this._getTickNumber(this.parse(e)),pd(e,this._extent)},t.prototype.scale=function(e){return e=Math.round(gd(e,this._extent)),this.getRawOrdinalNumber(e)},t.prototype.getTicks=function(){for(var e=[],i=this._extent,n=i[0];n<=i[1];)e.push({value:n}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(e==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var i=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,i.length);o=0&&e=0&&e=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t}(Ii);Ii.registerClass(yd);var Aa=Qt,en=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return dd(e,this._extent)},t.prototype.normalize=function(e){return pd(e,this._extent)},t.prototype.scale=function(e){return gd(e,this._extent)},t.prototype.setExtent=function(e,i){var n=this._extent;isNaN(e)||(n[0]=parseFloat(e)),isNaN(i)||(n[1]=parseFloat(i))},t.prototype.unionExtent=function(e){var i=this._extent;e[0]i[1]&&(i[1]=e[1]),this.setExtent(i[0],i[1])},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=XP(e)},t.prototype.getTicks=function(e){var i=this._interval,n=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=[];if(!i)return s;var l=1e4;n[0]l)return[];var h=s.length?s[s.length-1].value:a[1];return n[1]>h&&(e?s.push({value:Aa(h+i,o)}):s.push({value:n[1]})),s},t.prototype.getMinorTicks=function(e){for(var i=this.getTicks(!0),n=[],a=this.getExtent(),o=1;oa[0]&&v0&&(a=a===null?s:Math.min(a,s))}e[i]=a}}return e}function KP(r){var t=fU(r),e=[];return A(r,function(i){var n=i.coordinateSystem,a=n.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=t[l],h=Math.abs(o[1]-o[0]),c=a.scale.getExtent(),f=Math.abs(c[1]-c[0]);s=u?h/f*u:h}else{var v=i.getData();s=Math.abs(o[1]-o[0])/v.count()}var d=U(i.get("barWidth"),s),p=U(i.get("barMaxWidth"),s),g=U(i.get("barMinWidth")||(rk(i)?.5:1),s),y=i.get("barGap"),m=i.get("barCategoryGap");e.push({bandWidth:s,barWidth:d,barMaxWidth:p,barMinWidth:g,barGap:y,barCategoryGap:m,axisKey:j_(a),stackId:jP(i)})}),JP(e)}function JP(r){var t={};A(r,function(i,n){var a=i.axisKey,o=i.bandWidth,s=t[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;t[a]=s;var u=i.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var h=i.barWidth;h&&!l[u].width&&(l[u].width=h,h=Math.min(s.remainedWidth,h),s.remainedWidth-=h);var c=i.barMaxWidth;c&&(l[u].maxWidth=c);var f=i.barMinWidth;f&&(l[u].minWidth=f);var v=i.barGap;v!=null&&(s.gap=v);var d=i.barCategoryGap;d!=null&&(s.categoryGap=d)});var e={};return A(t,function(i,n){e[n]={};var a=i.stacks,o=i.bandWidth,s=i.categoryGap;if(s==null){var l=xt(a).length;s=Math.max(35-l*4,15)+"%"}var u=U(s,o),h=U(i.gap,1),c=i.remainedWidth,f=i.autoWidthCount,v=(c-u)/(f+(f-1)*h);v=Math.max(v,0),A(a,function(y){var m=y.maxWidth,_=y.minWidth;if(y.width){var x=y.width;m&&(x=Math.min(x,m)),_&&(x=Math.max(x,_)),y.width=x,c-=x+h*x,f--}else{var x=v;m&&mx&&(x=_),x!==v&&(y.width=x,c-=x+h*x,f--)}}),v=(c-u)/(f+(f-1)*h),v=Math.max(v,0);var d=0,p;A(a,function(y,m){y.width||(y.width=v),p=y,d+=y.width*(1+h)}),p&&(d-=p.width*h);var g=-d/2;A(a,function(y,m){e[n][m]=e[n][m]||{bandWidth:o,offset:g,width:y.width},g+=y.width*(1+h)})}),e}function vU(r,t,e){if(r&&t){var i=r[j_(t)];return i}}function QP(r,t){var e=qP(r,t),i=KP(e);A(e,function(n){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=jP(n),u=i[j_(s)][l],h=u.offset,c=u.width;a.setLayout({bandWidth:u.bandWidth,offset:h,size:c})})}function tk(r){return{seriesType:r,plan:Xs(),reset:function(t){if(ek(t)){var e=t.getData(),i=t.coordinateSystem,n=i.getBaseAxis(),a=i.getOtherAxis(n),o=e.getDimensionIndex(e.mapDimension(a.dim)),s=e.getDimensionIndex(e.mapDimension(n.dim)),l=t.get("showBackground",!0),u=e.mapDimension(a.dim),h=e.getCalculationInfo("stackResultDimension"),c=tn(e,u)&&!!e.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),v=dU(n,a),d=rk(t),p=t.get("barMinHeight")||0,g=h&&e.getDimensionIndex(h),y=e.getLayout("size"),m=e.getLayout("offset");return{progress:function(_,x){for(var b=_.count,S=d&&yi(b*3),w=d&&l&&yi(b*3),T=d&&yi(b),M=i.master.getRect(),C=f?M.width:M.height,D,L=x.getStore(),I=0;(D=_.next())!=null;){var P=L.get(c?g:o,D),k=L.get(s,D),R=v,N=void 0;c&&(N=+P-L.get(o,D));var O=void 0,B=void 0,G=void 0,H=void 0;if(f){var W=i.dataToPoint([P,k]);if(c){var q=i.dataToPoint([N,k]);R=q[0]}O=R,B=W[1]+m,G=W[0]-R,H=y,Math.abs(G)0?e:1:e))}var pU=function(r,t,e,i){for(;e>>1;r[n][1]n&&(this._approxInterval=n);var s=mc.length,l=Math.min(pU(mc,this._approxInterval,0,s),s-1);this._interval=mc[l][1],this._minLevelUnit=mc[Math.max(l-1,0)][0]},t.prototype.parse=function(e){return Mt(e)?e:+pr(e)},t.prototype.contain=function(e){return dd(this.parse(e),this._extent)},t.prototype.normalize=function(e){return pd(this.parse(e),this._extent)},t.prototype.scale=function(e){return gd(e,this._extent)},t.type="time",t}(en),mc=[["second",b_],["minute",S_],["hour",gu],["quarter-day",gu*6],["half-day",gu*12],["day",Dr*1.2],["half-week",Dr*3.5],["week",Dr*7],["month",Dr*31],["quarter",Dr*95],["half-year",YS/2],["year",YS]];function gU(r,t,e,i){var n=pr(t),a=pr(e),o=function(d){return XS(n,d,i)===XS(a,d,i)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},h=function(){return u()&&o("hour")},c=function(){return h()&&o("minute")},f=function(){return c()&&o("second")},v=function(){return f()&&o("millisecond")};switch(r){case"year":return s();case"month":return l();case"day":return u();case"hour":return h();case"minute":return c();case"second":return f();case"millisecond":return v()}}function yU(r,t){return r/=Dr,r>16?16:r>7.5?7:r>3.5?4:r>1.5?2:1}function mU(r){var t=30*Dr;return r/=t,r>6?6:r>3?3:r>2?2:1}function _U(r){return r/=gu,r>12?12:r>6?6:r>3.5?4:r>2?2:1}function rT(r,t){return r/=t?S_:b_,r>30?30:r>20?20:r>15?15:r>10?10:r>5?5:r>2?2:1}function xU(r){return Q0(r,!0)}function bU(r,t,e){var i=new Date(r);switch(ps(t)){case"year":case"month":i[_I(e)](0);case"day":i[xI(e)](1);case"hour":i[bI(e)](0);case"minute":i[SI(e)](0);case"second":i[wI(e)](0),i[TI(e)](0)}return i.getTime()}function SU(r,t,e,i){var n=1e4,a=yI,o=0;function s(C,D,L,I,P,k,R){for(var N=new Date(D),O=D,B=N[I]();O1&&k===0&&L.unshift({value:L[0].value-O})}}for(var k=0;k=i[0]&&m<=i[1]&&c++)}var _=(i[1]-i[0])/t;if(c>_*1.5&&f>_/1.5||(u.push(g),c>_||r===a[v]))break}h=[]}}}for(var x=Dt(F(u,function(C){return Dt(C,function(D){return D.value>=i[0]&&D.value<=i[1]&&!D.notAdd})}),function(C){return C.length>0}),b=[],S=x.length-1,v=0;v0;)a*=10;var s=[Qt(MU(i[0]/a)*a),Qt(TU(i[1]/a)*a)];this._interval=a,this._niceExtent=s}},t.prototype.calcNiceExtent=function(e){_u.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return e=Vr(e)/Vr(this.base),dd(e,this._extent)},t.prototype.normalize=function(e){return e=Vr(e)/Vr(this.base),pd(e,this._extent)},t.prototype.scale=function(e){return e=gd(e,this._extent),_c(this.base,e)},t.type="log",t}(Ii),ik=K_.prototype;ik.getMinorTicks=_u.getMinorTicks;ik.getLabel=_u.getLabel;function xc(r,t){return wU(r,$r(t))}Ii.registerClass(K_);var CU=function(){function r(t,e,i){this._prepareParams(t,e,i)}return r.prototype._prepareParams=function(t,e,i){i[1]0&&l>0&&!u&&(s=0),s<0&&l<0&&!h&&(l=0));var f=this._determinedMin,v=this._determinedMax;return f!=null&&(s=f,u=!0),v!=null&&(l=v,h=!0),{min:s,max:l,minFixed:u,maxFixed:h,isBlank:c}},r.prototype.modifyDataMinMax=function(t,e){this[DU[t]]=e},r.prototype.setDeterminedMinMax=function(t,e){var i=AU[t];this[i]=e},r.prototype.freeze=function(){this.frozen=!0},r}(),AU={min:"_determinedMin",max:"_determinedMax"},DU={min:"_dataMin",max:"_dataMax"};function nk(r,t,e){var i=r.rawExtentInfo;return i||(i=new CU(r,t,e),r.rawExtentInfo=i,i)}function bc(r,t){return t==null?null:Ss(t)?NaN:r.parse(t)}function ak(r,t){var e=r.type,i=nk(r,t,r.getExtent()).calculate();r.setBlank(i.isBlank);var n=i.min,a=i.max,o=t.ecModel;if(o&&e==="time"){var s=qP("bar",o),l=!1;if(A(s,function(c){l=l||c.getBaseAxis()===t.axis}),l){var u=KP(s),h=LU(n,a,t,u);n=h.min,a=h.max}}return{extent:[n,a],fixMin:i.minFixed,fixMax:i.maxFixed}}function LU(r,t,e,i){var n=e.axis.getExtent(),a=Math.abs(n[1]-n[0]),o=vU(i,e.axis);if(o===void 0)return{min:r,max:t};var s=1/0;A(o,function(v){s=Math.min(v.offset,s)});var l=-1/0;A(o,function(v){l=Math.max(v.offset+v.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=t-r,c=1-(s+l)/a,f=h/c-h;return t+=f*(l/u),r-=f*(s/u),{min:r,max:t}}function yo(r,t){var e=t,i=ak(r,e),n=i.extent,a=e.get("splitNumber");r instanceof K_&&(r.base=e.get("logBase"));var o=r.type,s=e.get("interval"),l=o==="interval"||o==="time";r.setExtent(n[0],n[1]),r.calcNiceExtent({splitNumber:a,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?e.get("minInterval"):null,maxInterval:l?e.get("maxInterval"):null}),s!=null&&r.setInterval&&r.setInterval(s)}function bh(r,t){if(t=t||r.get("type"),t)switch(t){case"category":return new yd({ordinalMeta:r.getOrdinalMeta?r.getOrdinalMeta():r.getCategories(),extent:[1/0,-1/0]});case"time":return new q_({locale:r.ecModel.getLocaleModel(),useUTC:r.ecModel.get("useUTC")});default:return new(Ii.getClass(t)||en)}}function IU(r){var t=r.scale.getExtent(),e=t[0],i=t[1];return!(e>0&&i>0||e<0&&i<0)}function Ks(r){var t=r.getLabelModel().get("formatter"),e=r.type==="category"?r.scale.getExtent()[0]:null;return r.scale.type==="time"?function(i){return function(n,a){return r.scale.getFormattedLabel(n,a,i)}}(t):Y(t)?function(i){return function(n){var a=r.scale.getLabel(n),o=i.replace("{value}",a??"");return o}}(t):Q(t)?function(i){return function(n,a){return e!=null&&(a=n.value-e),i(J_(r,n),a,n.level!=null?{level:n.level}:null)}}(t):function(i){return r.scale.getLabel(i)}}function J_(r,t){return r.type==="category"?r.scale.getLabel(t):t.value}function PU(r){var t=r.model,e=r.scale;if(!(!t.get(["axisLabel","show"])||e.isBlank())){var i,n,a=e.getExtent();e instanceof yd?n=e.count():(i=e.getTicks(),n=i.length);var o=r.getLabelModel(),s=Ks(r),l,u=1;n>40&&(u=Math.ceil(n/40));for(var h=0;hr[1]&&(r[1]=n[1])})}var Js=function(){function r(){}return r.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},r.prototype.getCoordSysModel=function(){},r}();function EU(r){return Li(null,r)}var OU={isDimensionStacked:tn,enableDataStack:$P,getStackedDimension:Z_};function NU(r,t){var e=t;t instanceof Lt||(e=new Lt(t));var i=bh(e);return i.setExtent(r[0],r[1]),yo(i,e),i}function BU(r){re(r,Js)}function zU(r,t){return t=t||{},Gt(r,null,null,t.state!=="normal")}const VU=Object.freeze(Object.defineProperty({__proto__:null,createDimensions:Z6,createList:EU,createScale:NU,createSymbol:ae,createTextStyle:zU,dataStack:OU,enableHoverEmphasis:Bn,getECData:ot,getLayoutRect:ue,mixinAxisModelCommonMethods:BU},Symbol.toStringTag,{value:"Module"}));var FU=1e-8;function nT(r,t){return Math.abs(r-t)n&&(i=o,n=l)}if(i)return HU(i.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},t.prototype.getBoundingRect=function(e){var i=this._rect;if(i&&!e)return i;var n=[1/0,1/0],a=[-1/0,-1/0],o=this.geometries;return A(o,function(s){s.type==="polygon"?aT(s.exterior,n,a,e):A(s.points,function(l){aT(l,n,a,e)})}),isFinite(n[0])&&isFinite(n[1])&&isFinite(a[0])&&isFinite(a[1])||(n[0]=n[1]=a[0]=a[1]=0),i=new ft(n[0],n[1],a[0]-n[0],a[1]-n[1]),e||(this._rect=i),i},t.prototype.contain=function(e){var i=this.getBoundingRect(),n=this.geometries;if(!i.contain(e[0],e[1]))return!1;t:for(var a=0,o=n.length;a>1^-(s&1),l=l>>1^-(l&1),s+=n,l+=a,n=s,a=l,i.push([s/e,l/e])}return i}function Lm(r,t){return r=UU(r),F(Dt(r.features,function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0}),function(e){var i=e.properties,n=e.geometry,a=[];switch(n.type){case"Polygon":var o=n.coordinates;a.push(new oT(o[0],o.slice(1)));break;case"MultiPolygon":A(n.coordinates,function(l){l[0]&&a.push(new oT(l[0],l.slice(1)))});break;case"LineString":a.push(new sT([n.coordinates]));break;case"MultiLineString":a.push(new sT(n.coordinates))}var s=new lk(i[t||"name"],a,i.cp);return s.properties=i,s})}const YU=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:Ky,asc:fr,getPercentWithPrecision:CG,getPixelPrecision:K0,getPrecision:$r,getPrecisionSafe:m2,isNumeric:t_,isRadianAroundZero:Ts,linearMap:Pt,nice:Q0,numericToNumber:Mi,parseDate:pr,quantile:sf,quantity:x2,quantityExponent:$v,reformIntervals:Jy,remRadian:J0,round:Qt},Symbol.toStringTag,{value:"Module"})),$U=Object.freeze(Object.defineProperty({__proto__:null,format:_h,parse:pr},Symbol.toStringTag,{value:"Module"})),XU=Object.freeze(Object.defineProperty({__proto__:null,Arc:gh,BezierCurve:zs,BoundingRect:ft,Circle:Ai,CompoundPath:Qv,Ellipse:ph,Group:at,Image:xe,IncrementalDisplayable:nI,Line:ce,LinearGradient:Vs,Polygon:Ge,Polyline:We,RadialGradient:f_,Rect:wt,Ring:Bs,Sector:Fe,Text:St,clipPointsByRect:g_,clipRectByRect:uI,createIcon:Gs,extendPath:sI,extendShape:oI,getShapeClass:td,getTransform:zn,initProps:$t,makeImage:d_,makePath:yh,mergePath:cr,registerShape:Er,resizePath:p_,updateProps:At},Symbol.toStringTag,{value:"Module"})),ZU=Object.freeze(Object.defineProperty({__proto__:null,addCommas:T_,capitalFirst:KH,encodeHTML:Oe,formatTime:qH,formatTpl:C_,getTextRect:ZH,getTooltipMarker:MI,normalizeCssArray:To,toCamelCase:M_,truncateText:r3},Symbol.toStringTag,{value:"Module"})),jU=Object.freeze(Object.defineProperty({__proto__:null,bind:$,clone:it,curry:ut,defaults:tt,each:A,extend:z,filter:Dt,indexOf:vt,inherits:W0,isArray:V,isFunction:Q,isObject:et,isString:Y,map:F,merge:ht,reduce:Pr},Symbol.toStringTag,{value:"Module"}));var $u=Tt();function hk(r,t){var e=F(t,function(i){return r.scale.parse(i)});return r.type==="time"&&e.length>0&&(e.sort(),e.unshift(e[0]),e.push(e[e.length-1])),e}function qU(r){var t=r.getLabelModel().get("customValues");if(t){var e=Ks(r),i=r.scale.getExtent(),n=hk(r,t),a=Dt(n,function(o){return o>=i[0]&&o<=i[1]});return{labels:F(a,function(o){var s={value:o};return{formattedLabel:e(s),rawLabel:r.scale.getLabel(s),tickValue:o}})}}return r.type==="category"?JU(r):tY(r)}function KU(r,t){var e=r.getTickModel().get("customValues");if(e){var i=r.scale.getExtent(),n=hk(r,e);return{ticks:Dt(n,function(a){return a>=i[0]&&a<=i[1]})}}return r.type==="category"?QU(r,t):{ticks:F(r.scale.getTicks(),function(a){return a.value})}}function JU(r){var t=r.getLabelModel(),e=ck(r,t);return!t.get("show")||r.scale.isBlank()?{labels:[],labelCategoryInterval:e.labelCategoryInterval}:e}function ck(r,t){var e=fk(r,"labels"),i=Q_(t),n=vk(e,i);if(n)return n;var a,o;return Q(i)?a=gk(r,i):(o=i==="auto"?eY(r):i,a=pk(r,o)),dk(e,i,{labels:a,labelCategoryInterval:o})}function QU(r,t){var e=fk(r,"ticks"),i=Q_(t),n=vk(e,i);if(n)return n;var a,o;if((!t.get("show")||r.scale.isBlank())&&(a=[]),Q(i))a=gk(r,i,!0);else if(i==="auto"){var s=ck(r,r.getLabelModel());o=s.labelCategoryInterval,a=F(s.labels,function(l){return l.tickValue})}else o=i,a=pk(r,o,!0);return dk(e,i,{ticks:a,tickCategoryInterval:o})}function tY(r){var t=r.scale.getTicks(),e=Ks(r);return{labels:F(t,function(i,n){return{level:i.level,formattedLabel:e(i,n),rawLabel:r.scale.getLabel(i),tickValue:i.value}})}}function fk(r,t){return $u(r)[t]||($u(r)[t]=[])}function vk(r,t){for(var e=0;e40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=r.dataToCoord(l+1)-r.dataToCoord(l),h=Math.abs(u*Math.cos(i)),c=Math.abs(u*Math.sin(i)),f=0,v=0;l<=a[1];l+=s){var d=0,p=0,g=fh(e({value:l}),t.font,"center","top");d=g.width*1.3,p=g.height*1.3,f=Math.max(f,d,7),v=Math.max(v,p,7)}var y=f/h,m=v/c;isNaN(y)&&(y=1/0),isNaN(m)&&(m=1/0);var _=Math.max(0,Math.floor(Math.min(y,m))),x=$u(r.model),b=r.getExtent(),S=x.lastAutoInterval,w=x.lastTickCount;return S!=null&&w!=null&&Math.abs(S-_)<=1&&Math.abs(w-o)<=1&&S>_&&x.axisExtent0===b[0]&&x.axisExtent1===b[1]?_=S:(x.lastTickCount=o,x.lastAutoInterval=_,x.axisExtent0=b[0],x.axisExtent1=b[1]),_}function iY(r){var t=r.getLabelModel();return{axisRotate:r.getRotate?r.getRotate():r.isHorizontal&&!r.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}function pk(r,t,e){var i=Ks(r),n=r.scale,a=n.getExtent(),o=r.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=a[0],h=n.count();u!==0&&l>1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=ok(r),f=o.get("showMinLabel")||c,v=o.get("showMaxLabel")||c;f&&u!==a[0]&&p(a[0]);for(var d=u;d<=a[1];d+=l)p(d);v&&d-l!==a[1]&&p(a[1]);function p(g){var y={value:g};s.push(e?g:{formattedLabel:i(y),rawLabel:n.getLabel(y),tickValue:g})}return s}function gk(r,t,e){var i=r.scale,n=Ks(r),a=[];return A(i.getTicks(),function(o){var s=i.getLabel(o),l=o.value;t(o.value,s)&&a.push(e?l:{formattedLabel:n(o),rawLabel:s,tickValue:l})}),a}var lT=[0,1],Br=function(){function r(t,e,i){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=i||[0,0]}return r.prototype.contain=function(t){var e=this._extent,i=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return t>=i&&t<=n},r.prototype.containData=function(t){return this.scale.contain(t)},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.getPixelPrecision=function(t){return K0(t||this.scale.getExtent(),this._extent)},r.prototype.setExtent=function(t,e){var i=this._extent;i[0]=t,i[1]=e},r.prototype.dataToCoord=function(t,e){var i=this._extent,n=this.scale;return t=n.normalize(t),this.onBand&&n.type==="ordinal"&&(i=i.slice(),uT(i,n.count())),Pt(t,lT,i,e)},r.prototype.coordToData=function(t,e){var i=this._extent,n=this.scale;this.onBand&&n.type==="ordinal"&&(i=i.slice(),uT(i,n.count()));var a=Pt(t,i,lT,e);return this.scale.scale(a)},r.prototype.pointToData=function(t,e){},r.prototype.getTicksCoords=function(t){t=t||{};var e=t.tickModel||this.getTickModel(),i=KU(this,e),n=i.ticks,a=F(n,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=e.get("alignWithLabel");return nY(this,a,o,t.clamp),a},r.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var t=this.model.getModel("minorTick"),e=t.get("splitNumber");e>0&&e<100||(e=5);var i=this.scale.getMinorTicks(e),n=F(i,function(a){return F(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return n},r.prototype.getViewLabels=function(){return qU(this).labels},r.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},r.prototype.getTickModel=function(){return this.model.getModel("axisTick")},r.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),i=e[1]-e[0]+(this.onBand?1:0);i===0&&(i=1);var n=Math.abs(t[1]-t[0]);return Math.abs(n)/i},r.prototype.calculateCategoryInterval=function(){return rY(this)},r}();function uT(r,t){var e=r[1]-r[0],i=t,n=e/i/2;r[0]+=n,r[1]-=n}function nY(r,t,e,i){var n=t.length;if(!r.onBand||e||!n)return;var a=r.getExtent(),o,s;if(n===1)t[0].coord=a[0],o=t[1]={coord:a[1],tickValue:t[0].tickValue};else{var l=t[n-1].tickValue-t[0].tickValue,u=(t[n-1].coord-t[0].coord)/l;A(t,function(v){v.coord-=u/2});var h=r.scale.getExtent();s=1+h[1]-t[n-1].tickValue,o={coord:t[n-1].coord+u*s,tickValue:h[1]+1},t.push(o)}var c=a[0]>a[1];f(t[0].coord,a[0])&&(i?t[0].coord=a[0]:t.shift()),i&&f(a[0],t[0].coord)&&t.unshift({coord:a[0]}),f(a[1],o.coord)&&(i?o.coord=a[1]:t.pop()),i&&f(o.coord,a[1])&&t.push({coord:a[1]});function f(v,d){return v=Qt(v),d=Qt(d),c?v>d:vn&&(n+=wl);var v=Math.atan2(s,o);if(v<0&&(v+=wl),v>=i&&v<=n||v+wl>=i&&v+wl<=n)return l[0]=h,l[1]=c,u-e;var d=e*Math.cos(i)+r,p=e*Math.sin(i)+t,g=e*Math.cos(n)+r,y=e*Math.sin(n)+t,m=(d-o)*(d-o)+(p-s)*(p-s),_=(g-o)*(g-o)+(y-s)*(y-s);return m<_?(l[0]=d,l[1]=p,Math.sqrt(m)):(l[0]=g,l[1]=y,Math.sqrt(_))}function ov(r,t,e,i,n,a,o,s){var l=n-r,u=a-t,h=e-r,c=i-t,f=Math.sqrt(h*h+c*c);h/=f,c/=f;var v=l*h+u*c,d=v/f;s&&(d=Math.min(Math.max(d,0),1)),d*=f;var p=o[0]=r+d*h,g=o[1]=t+d*c;return Math.sqrt((p-n)*(p-n)+(g-a)*(g-a))}function yk(r,t,e,i,n,a,o){e<0&&(r=r+e,e=-e),i<0&&(t=t+i,i=-i);var s=r+e,l=t+i,u=o[0]=Math.min(Math.max(n,r),s),h=o[1]=Math.min(Math.max(a,t),l);return Math.sqrt((u-n)*(u-n)+(h-a)*(h-a))}var Ur=[];function fY(r,t,e){var i=yk(t.x,t.y,t.width,t.height,r.x,r.y,Ur);return e.set(Ur[0],Ur[1]),i}function vY(r,t,e){for(var i=0,n=0,a=0,o=0,s,l,u=1/0,h=t.data,c=r.x,f=r.y,v=0;v0){t=t/180*Math.PI,Xr.fromArray(r[0]),Ut.fromArray(r[1]),ie.fromArray(r[2]),ct.sub(mi,Xr,Ut),ct.sub(pi,ie,Ut);var e=mi.len(),i=pi.len();if(!(e<.001||i<.001)){mi.scale(1/e),pi.scale(1/i);var n=mi.dot(pi),a=Math.cos(t);if(a1&&ct.copy(Xe,ie),Xe.toArray(r[1])}}}}function dY(r,t,e){if(e<=180&&e>0){e=e/180*Math.PI,Xr.fromArray(r[0]),Ut.fromArray(r[1]),ie.fromArray(r[2]),ct.sub(mi,Ut,Xr),ct.sub(pi,ie,Ut);var i=mi.len(),n=pi.len();if(!(i<.001||n<.001)){mi.scale(1/i),pi.scale(1/n);var a=mi.dot(t),o=Math.cos(e);if(a=l)ct.copy(Xe,ie);else{Xe.scaleAndAdd(pi,s/Math.tan(Math.PI/2-h));var c=ie.x!==Ut.x?(Xe.x-Ut.x)/(ie.x-Ut.x):(Xe.y-Ut.y)/(ie.y-Ut.y);if(isNaN(c))return;c<0?ct.copy(Xe,Ut):c>1&&ct.copy(Xe,ie)}Xe.toArray(r[1])}}}}function qp(r,t,e,i){var n=e==="normal",a=n?r:r.ensureState(e);a.ignore=t;var o=i.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=i.getModel("lineStyle").getLineStyle();n?r.useStyle(s):a.style=s}function pY(r,t){var e=t.smooth,i=t.points;if(i)if(r.moveTo(i[0][0],i[0][1]),e>0&&i.length>=3){var n=Wi(i[0],i[1]),a=Wi(i[1],i[2]);if(!n||!a){r.lineTo(i[1][0],i[1][1]),r.lineTo(i[2][0],i[2][1]);return}var o=Math.min(n,a)*e,s=su([],i[1],i[0],o/n),l=su([],i[1],i[2],o/a),u=su([],s,l,.5);r.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),r.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var h=1;h0){_(M*T,0,o);var C=M+S;C<0&&x(-C*T,1)}else x(-S*T,1)}}function _(S,w,T){S!==0&&(u=!0);for(var M=w;M0)for(var C=0;C0;C--){var P=T[C-1]*I;_(-P,C,o)}}}function b(S){var w=S<0?-1:1;S=Math.abs(S);for(var T=Math.ceil(S/(o-1)),M=0;M0?_(T,0,M+1):_(-T,o-M-1,o),S-=T,S<=0)return}return u}function gY(r,t,e,i){return xk(r,"x","width",t,e)}function bk(r,t,e,i){return xk(r,"y","height",t,e)}function Sk(r){var t=[];r.sort(function(p,g){return g.priority-p.priority});var e=new ft(0,0,0,0);function i(p){if(!p.ignore){var g=p.ensureState("emphasis");g.ignore==null&&(g.ignore=!1)}p.ignore=!0}for(var n=0;n=0&&i.attr(a.oldLayoutSelect),vt(f,"emphasis")>=0&&i.attr(a.oldLayoutEmphasis)),At(i,u,e,l)}else if(i.attr(u),!Hs(i).valueAnimation){var c=lt(i.style.opacity,1);i.style.opacity=0,$t(i,{style:{opacity:c}},e,l)}if(a.oldLayout=u,i.states.select){var v=a.oldLayoutSelect={};Sc(v,u,wc),Sc(v,i.states.select,wc)}if(i.states.emphasis){var d=a.oldLayoutEmphasis={};Sc(d,u,wc),Sc(d,i.states.emphasis,wc)}vI(i,l,h,e,e)}if(n&&!n.ignore&&!n.invisible){var a=_Y(n),o=a.oldLayout,p={points:n.shape.points};o?(n.attr({shape:o}),At(n,{shape:p},e)):(n.setShape(p),n.style.strokePercent=0,$t(n,{style:{strokePercent:1}},e)),a.oldLayout=p}},r}(),Jp=Tt();function bY(r){r.registerUpdateLifecycle("series:beforeupdate",function(t,e,i){var n=Jp(e).labelManager;n||(n=Jp(e).labelManager=new xY),n.clearLabels()}),r.registerUpdateLifecycle("series:layoutlabels",function(t,e,i){var n=Jp(e).labelManager;i.updatedSeries.forEach(function(a){n.addLabelsOfSeries(e.getViewOfSeriesModel(a))}),n.updateLayoutConfig(e),n.layout(e),n.processLabelsOverall()})}var Qp=Math.sin,tg=Math.cos,wk=Math.PI,La=Math.PI*2,SY=180/wk,Tk=function(){function r(){}return r.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},r.prototype.moveTo=function(t,e){this._add("M",t,e)},r.prototype.lineTo=function(t,e){this._add("L",t,e)},r.prototype.bezierCurveTo=function(t,e,i,n,a,o){this._add("C",t,e,i,n,a,o)},r.prototype.quadraticCurveTo=function(t,e,i,n){this._add("Q",t,e,i,n)},r.prototype.arc=function(t,e,i,n,a,o){this.ellipse(t,e,i,i,0,n,a,o)},r.prototype.ellipse=function(t,e,i,n,a,o,s,l){var u=s-o,h=!l,c=Math.abs(u),f=In(c-La)||(h?u>=La:-u>=La),v=u>0?u%La:u%La+La,d=!1;f?d=!0:In(c)?d=!1:d=v>=wk==!!h;var p=t+i*tg(o),g=e+n*Qp(o);this._start&&this._add("M",p,g);var y=Math.round(a*SY);if(f){var m=1/this._p,_=(h?1:-1)*(La-m);this._add("A",i,n,y,1,+h,t+i*tg(o+_),e+n*Qp(o+_)),m>.01&&this._add("A",i,n,y,0,+h,p,g)}else{var x=t+i*tg(s),b=e+n*Qp(s);this._add("A",i,n,y,+d,+h,x,b)}},r.prototype.rect=function(t,e,i,n){this._add("M",t,e),this._add("l",i,0),this._add("l",0,n),this._add("l",-i,0),this._add("Z")},r.prototype.closePath=function(){this._d.length>0&&this._add("Z")},r.prototype._add=function(t,e,i,n,a,o,s,l,u){for(var h=[],c=this._p,f=1;f"}function PY(r){return""}function ix(r,t){t=t||{};var e=t.newline?` +`:"";function i(n){var a=n.children,o=n.tag,s=n.attrs,l=n.text;return IY(o,s)+(o!=="style"?Oe(l):l||"")+(a?""+e+F(a,function(u){return i(u)}).join(e)+e:"")+PY(o)}return i(r)}function kY(r,t,e){e=e||{};var i=e.newline?` +`:"",n=" {"+i,a=i+"}",o=F(xt(r),function(l){return l+n+F(xt(r[l]),function(u){return u+":"+r[l][u]+";"}).join(i)+a}).join(i),s=F(xt(t),function(l){return"@keyframes "+l+n+F(xt(t[l]),function(u){return u+n+F(xt(t[l][u]),function(h){var c=t[l][u][h];return h==="d"&&(c='path("'+c+'")'),h+":"+c+";"}).join(i)+a}).join(i)+a}).join(i);return!o&&!s?"":[""].join(i)}function Pm(r){return{zrId:r,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function vT(r,t,e,i){return ge("svg","root",{width:r,height:t,xmlns:Mk,"xmlns:xlink":Ck,version:"1.1",baseProfile:"full",viewBox:i?"0 0 "+r+" "+t:!1},e)}var RY=0;function Dk(){return RY++}var dT={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},Ea="transform-origin";function EY(r,t,e){var i=z({},r.shape);z(i,t),r.buildPath(e,i);var n=new Tk;return n.reset(s2(r)),e.rebuildPath(n,1),n.generateStr(),n.getStr()}function OY(r,t){var e=t.originX,i=t.originY;(e||i)&&(r[Ea]=e+"px "+i+"px")}var NY={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function Lk(r,t){var e=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[e]=r,e}function BY(r,t,e){var i=r.shape.paths,n={},a,o;if(A(i,function(l){var u=Pm(e.zrId);u.animation=!0,md(l,{},u,!0);var h=u.cssAnims,c=u.cssNodes,f=xt(h),v=f.length;if(v){o=f[v-1];var d=h[o];for(var p in d){var g=d[p];n[p]=n[p]||{d:""},n[p].d+=g.d||""}for(var y in c){var m=c[y].animation;m.indexOf(o)>=0&&(a=m)}}}),!!a){t.d=!1;var s=Lk(n,e);return a.replace(o,s)}}function pT(r){return Y(r)?dT[r]?"cubic-bezier("+dT[r]+")":X0(r)?r:"":""}function md(r,t,e,i){var n=r.animators,a=n.length,o=[];if(r instanceof Qv){var s=BY(r,t,e);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var te=Lk(w,e);return te+" "+m[0]+" both"}}for(var g in l){var s=p(l[g]);s&&o.push(s)}if(o.length){var y=e.zrId+"-cls-"+Dk();e.cssNodes["."+y]={animation:o.join(",")},t.class=y}}function zY(r,t,e){if(!r.ignore)if(r.isSilent()){var i={"pointer-events":"none"};gT(i,t,e)}else{var n=r.states.emphasis&&r.states.emphasis.style?r.states.emphasis.style:{},a=n.fill;if(!a){var o=r.style&&r.style.fill,s=r.states.select&&r.states.select.style&&r.states.select.style.fill,l=r.currentStates.indexOf("select")>=0&&s||o;l&&(a=Bf(l))}var u=n.lineWidth;if(u){var h=!n.strokeNoScale&&r.transform?r.transform[0]:1;u=u/h}var i={cursor:"pointer"};a&&(i.fill=a),n.stroke&&(i.stroke=n.stroke),u&&(i["stroke-width"]=u),gT(i,t,e)}}function gT(r,t,e,i){var n=JSON.stringify(r),a=e.cssStyleCache[n];a||(a=e.zrId+"-cls-"+Dk(),e.cssStyleCache[n]=a,e.cssNodes["."+a+":hover"]=r),t.class=t.class?t.class+" "+a:a}var Xu=Math.round;function Ik(r){return r&&Y(r.src)}function Pk(r){return r&&Q(r.toDataURL)}function nx(r,t,e,i){AY(function(n,a){var o=n==="fill"||n==="stroke";o&&o2(a)?Rk(t,r,n,i):o&&j0(a)?Ek(e,r,n,i):r[n]=a,o&&i.ssr&&a==="none"&&(r["pointer-events"]="visible")},t,e,!1),YY(e,r,i)}function ax(r,t){var e=p2(t);e&&(e.each(function(i,n){i!=null&&(r[(fT+n).toLowerCase()]=i+"")}),t.isSilent()&&(r[fT+"silent"]="true"))}function yT(r){return In(r[0]-1)&&In(r[1])&&In(r[2])&&In(r[3]-1)}function VY(r){return In(r[4])&&In(r[5])}function ox(r,t,e){if(t&&!(VY(t)&&yT(t))){var i=1e4;r.transform=yT(t)?"translate("+Xu(t[4]*i)/i+" "+Xu(t[5]*i)/i+")":UF(t)}}function mT(r,t,e){for(var i=r.points,n=[],a=0;a"u"){var g="Image width/height must been given explictly in svg-ssr renderer.";Ve(f,g),Ve(v,g)}else if(f==null||v==null){var y=function(C,D){if(C){var L=C.elm,I=f||D.width,P=v||D.height;C.tag==="pattern"&&(u?(P=1,I/=a.width):h&&(I=1,P/=a.height)),C.attrs.width=I,C.attrs.height=P,L&&(L.setAttribute("width",I),L.setAttribute("height",P))}},m=n_(d,null,r,function(C){l||y(S,C),y(c,C)});m&&m.width&&m.height&&(f=f||m.width,v=v||m.height)}c=ge("image","img",{href:d,width:f,height:v}),o.width=f,o.height=v}else n.svgElement&&(c=it(n.svgElement),o.width=n.svgWidth,o.height=n.svgHeight);if(c){var _,x;l?_=x=1:u?(x=1,_=o.width/a.width):h?(_=1,x=o.height/a.height):o.patternUnits="userSpaceOnUse",_!=null&&!isNaN(_)&&(o.width=_),x!=null&&!isNaN(x)&&(o.height=x);var b=l2(n);b&&(o.patternTransform=b);var S=ge("pattern","",o,[c]),w=ix(S),T=i.patternCache,M=T[w];M||(M=i.zrId+"-p"+i.patternIdx++,T[w]=M,o.id=M,S=i.defs[M]=ge("pattern",M,o,[c])),t[e]=Wv(M)}}function $Y(r,t,e){var i=e.clipPathCache,n=e.defs,a=i[r.id];if(!a){a=e.zrId+"-c"+e.clipPathIdx++;var o={id:a};i[r.id]=a,n[a]=ge("clipPath",a,o,[kk(r,e)])}t["clip-path"]=Wv(a)}function bT(r){return document.createTextNode(r)}function Ga(r,t,e){r.insertBefore(t,e)}function ST(r,t){r.removeChild(t)}function wT(r,t){r.appendChild(t)}function Ok(r){return r.parentNode}function Nk(r){return r.nextSibling}function eg(r,t){r.textContent=t}var TT=58,XY=120,ZY=ge("","");function km(r){return r===void 0}function vi(r){return r!==void 0}function jY(r,t,e){for(var i={},n=t;n<=e;++n){var a=r[n].key;a!==void 0&&(i[a]=n)}return i}function Xl(r,t){var e=r.key===t.key,i=r.tag===t.tag;return i&&e}function Zu(r){var t,e=r.children,i=r.tag;if(vi(i)){var n=r.elm=Ak(i);if(sx(ZY,r),V(e))for(t=0;ta?(d=e[l+1]==null?null:e[l+1].elm,Bk(r,d,e,n,l)):lv(r,t,i,a))}function rs(r,t){var e=t.elm=r.elm,i=r.children,n=t.children;r!==t&&(sx(r,t),km(t.text)?vi(i)&&vi(n)?i!==n&&qY(e,i,n):vi(n)?(vi(r.text)&&eg(e,""),Bk(e,null,n,0,n.length-1)):vi(i)?lv(e,i,0,i.length-1):vi(r.text)&&eg(e,""):r.text!==t.text&&(vi(i)&&lv(e,i,0,i.length-1),eg(e,t.text)))}function KY(r,t){if(Xl(r,t))rs(r,t);else{var e=r.elm,i=Ok(e);Zu(t),i!==null&&(Ga(i,t.elm,Nk(e)),lv(i,[r],0,0))}return t}var JY=0,QY=function(){function r(t,e,i){if(this.type="svg",this.refreshHover=MT(),this.configLayer=MT(),this.storage=e,this._opts=i=z({},i),this.root=t,this._id="zr"+JY++,this._oldVNode=vT(i.width,i.height),t&&!i.ssr){var n=this._viewport=document.createElement("div");n.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=Ak("svg");sx(null,this._oldVNode),n.appendChild(a),t.appendChild(n)}this.resize(i.width,i.height)}return r.prototype.getType=function(){return this.type},r.prototype.getViewportRoot=function(){return this._viewport},r.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},r.prototype.getSvgDom=function(){return this._svgDom},r.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",KY(this._oldVNode,t),this._oldVNode=t}},r.prototype.renderOneToVNode=function(t){return xT(t,Pm(this._id))},r.prototype.renderToVNode=function(t){t=t||{};var e=this.storage.getDisplayList(!0),i=this._width,n=this._height,a=Pm(this._id);a.animation=t.animation,a.willUpdate=t.willUpdate,a.compress=t.compress,a.emphasis=t.emphasis,a.ssr=this._opts.ssr;var o=[],s=this._bgVNode=t8(i,n,this._backgroundColor,a);s&&o.push(s);var l=t.compress?null:this._mainVNode=ge("g","main",{},[]);this._paintList(e,a,l?l.children:o),l&&o.push(l);var u=F(xt(a.defs),function(f){return a.defs[f]});if(u.length&&o.push(ge("defs","defs",{},u)),t.animation){var h=kY(a.cssNodes,a.cssAnims,{newline:!0});if(h){var c=ge("style","stl",{},[],h);o.push(c)}}return vT(i,n,o,t.useViewBox)},r.prototype.renderToString=function(t){return t=t||{},ix(this.renderToVNode({animation:lt(t.cssAnimation,!0),emphasis:lt(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:lt(t.useViewBox,!0)}),{newline:!0})},r.prototype.setBackgroundColor=function(t){this._backgroundColor=t},r.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},r.prototype._paintList=function(t,e,i){for(var n=t.length,a=[],o=0,s,l,u=0,h=0;h=0&&!(f&&l&&f[p]===l[p]);p--);for(var g=d-1;g>p;g--)o--,s=a[o-1];for(var y=p+1;y=s)}}for(var c=this.__startIndex;c15)break}}P.prevElClipPaths&&y.restore()};if(m)if(m.length===0)T=g.__endIndex;else for(var C=v.dpr,D=0;D0&&t>n[0]){for(l=0;lt);l++);s=i[n[l]]}if(n.splice(l+1,0,t),i[t]=e,!e.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(e.dom,u.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom);e.painter||(e.painter=this)}},r.prototype.eachLayer=function(t,e){for(var i=this._zlevelList,n=0;n0?Tc:0),this._needsManuallyCompositing),h.__builtin__||Bv("ZLevel "+u+" has been used by unkown layer "+h.id),h!==a&&(h.__used=!0,h.__startIndex!==l&&(h.__dirty=!0),h.__startIndex=l,h.incremental?h.__drawIndex=-1:h.__drawIndex=l,e(l),a=h),n.__dirty&hr&&!n.__inHover&&(h.__dirty=!0,h.incremental&&h.__drawIndex<0&&(h.__drawIndex=l))}e(l),this.eachBuiltinLayer(function(c,f){!c.__used&&c.getElementCount()>0&&(c.__dirty=!0,c.__startIndex=c.__endIndex=c.__drawIndex=0),c.__dirty&&c.__drawIndex<0&&(c.__drawIndex=c.__startIndex)})},r.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},r.prototype._clearLayer=function(t){t.clear()},r.prototype.setBackgroundColor=function(t){this._backgroundColor=t,A(this._layers,function(e){e.setUnpainted()})},r.prototype.configLayer=function(t,e){if(e){var i=this._layerConfig;i[t]?ht(i[t],e,!0):i[t]=e;for(var n=0;n-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),i},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},t}(zt);function Ls(r,t){var e=r.mapDimensionsAll("defaultedLabel"),i=e.length;if(i===1){var n=As(r,t,e[0]);return n!=null?n+"":null}else if(i){for(var a=[],o=0;o=0&&i.push(t[a])}return i.join(" ")}var Sh=function(r){E(t,r);function t(e,i,n,a){var o=r.call(this)||this;return o.updateData(e,i,n,a),o}return t.prototype._createSymbol=function(e,i,n,a,o){this.removeAll();var s=ae(e,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=l8,this._symbolType=e,this.add(s)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){Ki(this.childAt(0))},t.prototype.downplay=function(){Ji(this.childAt(0))},t.prototype.setZ=function(e,i){var n=this.childAt(0);n.zlevel=e,n.z=i},t.prototype.setDraggable=function(e,i){var n=this.childAt(0);n.draggable=e,n.cursor=!i&&e?"move":n.cursor},t.prototype.updateData=function(e,i,n,a){this.silent=!1;var o=e.getItemVisual(i,"symbol")||"circle",s=e.hostModel,l=t.getSymbolSize(e,i),u=o!==this._symbolType,h=a&&a.disableAnimation;if(u){var c=e.getItemVisual(i,"symbolKeepAspect");this._createSymbol(o,e,i,l,c)}else{var f=this.childAt(0);f.silent=!1;var v={scaleX:l[0]/2,scaleY:l[1]/2};h?f.attr(v):At(f,v,s,i),ri(f)}if(this._updateCommon(e,i,l,n,a),u){var f=this.childAt(0);if(!h){var v={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:f.style.opacity}};f.scaleX=f.scaleY=0,f.style.opacity=0,$t(f,v,s,i)}}h&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(e,i,n,a,o){var s=this.childAt(0),l=e.hostModel,u,h,c,f,v,d,p,g,y;if(a&&(u=a.emphasisItemStyle,h=a.blurItemStyle,c=a.selectItemStyle,f=a.focus,v=a.blurScope,p=a.labelStatesModels,g=a.hoverScale,y=a.cursorStyle,d=a.emphasisDisabled),!a||e.hasItemOption){var m=a&&a.itemModel?a.itemModel:e.getItemModel(i),_=m.getModel("emphasis");u=_.getModel("itemStyle").getItemStyle(),c=m.getModel(["select","itemStyle"]).getItemStyle(),h=m.getModel(["blur","itemStyle"]).getItemStyle(),f=_.get("focus"),v=_.get("blurScope"),d=_.get("disabled"),p=me(m),g=_.getShallow("scale"),y=m.getShallow("cursor")}var x=e.getItemVisual(i,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var b=Mo(e.getItemVisual(i,"symbolOffset"),n);b&&(s.x=b[0],s.y=b[1]),y&&s.attr("cursor",y);var S=e.getItemVisual(i,"style"),w=S.fill;if(s instanceof xe){var T=s.style;s.useStyle(z({image:T.image,x:T.x,y:T.y,width:T.width,height:T.height},S))}else s.__isEmptyBrush?s.useStyle(z({},S)):s.useStyle(S),s.style.decal=null,s.setColor(w,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var M=e.getItemVisual(i,"liftZ"),C=this._z2;M!=null?C==null&&(this._z2=s.z2,s.z2+=M):C!=null&&(s.z2=C,this._z2=null);var D=o&&o.useNameLabel;Ae(s,p,{labelFetcher:l,labelDataIndex:i,defaultText:L,inheritColor:w,defaultOpacity:S.opacity});function L(k){return D?e.getName(k):Ls(e,k)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var I=s.ensureState("emphasis");I.style=u,s.ensureState("select").style=c,s.ensureState("blur").style=h;var P=g==null||g===!0?Math.max(1.1,3/this._sizeY):isFinite(g)&&g>0?+g:1;I.scaleX=this._sizeX*P,I.scaleY=this._sizeY*P,this.setSymbolScale(1),Kt(this,f,v,d)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,i,n){var a=this.childAt(0),o=ot(this).dataIndex,s=n&&n.animation;if(this.silent=a.silent=!0,n&&n.fadeLabel){var l=a.getTextContent();l&&Xn(l,{style:{opacity:0}},i,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();Xn(a,{style:{opacity:0},scaleX:0,scaleY:0},i,{dataIndex:o,cb:e,removeOpt:s})},t.getSymbolSize=function(e,i){return js(e.getItemVisual(i,"symbolSize"))},t}(at);function l8(r,t){this.parent.drift(r,t)}function ig(r,t,e,i){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(i.isIgnore&&i.isIgnore(e))&&!(i.clipShape&&!i.clipShape.contain(t[0],t[1]))&&r.getItemVisual(e,"symbol")!=="none"}function DT(r){return r!=null&&!et(r)&&(r={isIgnore:r}),r||{}}function LT(r){var t=r.hostModel,e=t.getModel("emphasis");return{emphasisItemStyle:e.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:e.get("focus"),blurScope:e.get("blurScope"),emphasisDisabled:e.get("disabled"),hoverScale:e.get("scale"),labelStatesModels:me(t),cursorStyle:t.get("cursor")}}var wh=function(){function r(t){this.group=new at,this._SymbolCtor=t||Sh}return r.prototype.updateData=function(t,e){this._progressiveEls=null,e=DT(e);var i=this.group,n=t.hostModel,a=this._data,o=this._SymbolCtor,s=e.disableAnimation,l=LT(t),u={disableAnimation:s},h=e.getSymbolPoint||function(c){return t.getItemLayout(c)};a||i.removeAll(),t.diff(a).add(function(c){var f=h(c);if(ig(t,f,c,e)){var v=new o(t,c,l,u);v.setPosition(f),t.setItemGraphicEl(c,v),i.add(v)}}).update(function(c,f){var v=a.getItemGraphicEl(f),d=h(c);if(!ig(t,d,c,e)){i.remove(v);return}var p=t.getItemVisual(c,"symbol")||"circle",g=v&&v.getSymbolType&&v.getSymbolType();if(!v||g&&g!==p)i.remove(v),v=new o(t,c,l,u),v.setPosition(d);else{v.updateData(t,c,l,u);var y={x:d[0],y:d[1]};s?v.attr(y):At(v,y,n)}i.add(v),t.setItemGraphicEl(c,v)}).remove(function(c){var f=a.getItemGraphicEl(c);f&&f.fadeOut(function(){i.remove(f)},n)}).execute(),this._getSymbolPoint=h,this._data=t},r.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl(function(i,n){var a=t._getSymbolPoint(n);i.setPosition(a),i.markRedraw()})},r.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=LT(t),this._data=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(t,e,i){this._progressiveEls=[],i=DT(i);function n(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=t.start;a0?e=i[0]:i[1]<0&&(e=i[1]),e}function Fk(r,t,e,i){var n=NaN;r.stacked&&(n=e.get(e.getCalculationInfo("stackedOverDimension"),i)),isNaN(n)&&(n=r.valueStart);var a=r.baseDataOffset,o=[];return o[a]=e.get(r.baseDim,i),o[1-a]=n,t.dataToPoint(o)}function h8(r,t){var e=[];return t.diff(r).add(function(i){e.push({cmd:"+",idx:i})}).update(function(i,n){e.push({cmd:"=",idx:n,idx1:i})}).remove(function(i){e.push({cmd:"-",idx:i})}).execute(),e}function c8(r,t,e,i,n,a,o,s){for(var l=h8(r,t),u=[],h=[],c=[],f=[],v=[],d=[],p=[],g=Vk(n,t,o),y=r.getLayout("points")||[],m=t.getLayout("points")||[],_=0;_=n||p<0)break;if(ao(y,m)){if(l){p+=a;continue}break}if(p===e)r[a>0?"moveTo":"lineTo"](y,m),c=y,f=m;else{var _=y-u,x=m-h;if(_*_+x*x<.5){p+=a;continue}if(o>0){for(var b=p+a,S=t[b*2],w=t[b*2+1];S===y&&w===m&&g=i||ao(S,w))v=y,d=m;else{C=S-u,D=w-h;var P=y-u,k=S-y,R=m-h,N=w-m,O=void 0,B=void 0;if(s==="x"){O=Math.abs(P),B=Math.abs(k);var G=C>0?1:-1;v=y-G*O*o,d=m,L=y+G*B*o,I=m}else if(s==="y"){O=Math.abs(R),B=Math.abs(N);var H=D>0?1:-1;v=y,d=m-H*O*o,L=y,I=m+H*B*o}else O=Math.sqrt(P*P+R*R),B=Math.sqrt(k*k+N*N),M=B/(B+O),v=y-C*o*(1-M),d=m-D*o*(1-M),L=y+C*o*M,I=m+D*o*M,L=vn(L,dn(S,y)),I=vn(I,dn(w,m)),L=dn(L,vn(S,y)),I=dn(I,vn(w,m)),C=L-y,D=I-m,v=y-C*O/B,d=m-D*O/B,v=vn(v,dn(u,y)),d=vn(d,dn(h,m)),v=dn(v,vn(u,y)),d=dn(d,vn(h,m)),C=y-v,D=m-d,L=y+C*B/O,I=m+D*B/O}r.bezierCurveTo(c,f,v,d,y,m),c=L,f=I}else r.lineTo(y,m)}u=y,h=m,p+=a}return g}var Gk=function(){function r(){this.smooth=0,this.smoothConstraint=!0}return r}(),f8=function(r){E(t,r);function t(e){var i=r.call(this,e)||this;return i.type="ec-polyline",i}return t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new Gk},t.prototype.buildPath=function(e,i){var n=i.points,a=0,o=n.length/2;if(i.connectNulls){for(;o>0&&ao(n[o*2-2],n[o*2-1]);o--);for(;a=0){var x=u?(d-l)*_+l:(v-s)*_+s;return u?[e,x]:[x,e]}s=v,l=d;break;case o.C:v=a[c++],d=a[c++],p=a[c++],g=a[c++],y=a[c++],m=a[c++];var b=u?Of(s,v,p,y,e,h):Of(l,d,g,m,e,h);if(b>0)for(var S=0;S=0){var x=u?ve(l,d,g,m,w):ve(s,v,p,y,w);return u?[e,x]:[x,e]}}s=y,l=m;break}}},t}(_t),v8=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t}(Gk),Hk=function(r){E(t,r);function t(e){var i=r.call(this,e)||this;return i.type="ec-polygon",i}return t.prototype.getDefaultShape=function(){return new v8},t.prototype.buildPath=function(e,i){var n=i.points,a=i.stackedOnPoints,o=0,s=n.length/2,l=i.smoothMonotone;if(i.connectNulls){for(;s>0&&ao(n[s*2-2],n[s*2-1]);s--);for(;ot){a?e.push(o(a,l,t)):n&&e.push(o(n,l,0),o(n,l,t));break}else n&&(e.push(o(n,l,0)),n=null),e.push(l),a=l}return e}function g8(r,t,e){var i=r.getVisual("visualMeta");if(!(!i||!i.length||!r.count())&&t.type==="cartesian2d"){for(var n,a,o=i.length-1;o>=0;o--){var s=r.getDimensionInfo(i[o].dimension);if(n=s&&s.coordDim,n==="x"||n==="y"){a=i[o];break}}if(a){var l=t.getAxis(n),u=F(a.stops,function(_){return{coord:l.toGlobalCoord(l.dataToCoord(_.value)),color:_.color}}),h=u.length,c=a.outerColors.slice();h&&u[0].coord>u[h-1].coord&&(u.reverse(),c.reverse());var f=p8(u,n==="x"?e.getWidth():e.getHeight()),v=f.length;if(!v&&h)return u[0].coord<0?c[1]?c[1]:u[h-1].color:c[0]?c[0]:u[0].color;var d=10,p=f[0].coord-d,g=f[v-1].coord+d,y=g-p;if(y<.001)return"transparent";A(f,function(_){_.offset=(_.coord-p)/y}),f.push({offset:v?f[v-1].offset:.5,color:c[1]||"transparent"}),f.unshift({offset:v?f[0].offset:.5,color:c[0]||"transparent"});var m=new Vs(0,0,0,0,f,!0);return m[n]=p,m[n+"2"]=g,m}}}function y8(r,t,e){var i=r.get("showAllSymbol"),n=i==="auto";if(!(i&&!n)){var a=e.getAxesByScale("ordinal")[0];if(a&&!(n&&m8(a,t))){var o=t.mapDimension(a.dim),s={};return A(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function m8(r,t){var e=r.getExtent(),i=Math.abs(e[1]-e[0])/r.scale.count();isNaN(i)&&(i=0);for(var n=t.count(),a=Math.max(1,Math.round(n/5)),o=0;oi)return!1;return!0}function _8(r,t){return isNaN(r)||isNaN(t)}function x8(r){for(var t=r.length/2;t>0&&_8(r[t*2-2],r[t*2-1]);t--);return t-1}function ET(r,t){return[r[t*2],r[t*2+1]]}function b8(r,t,e){for(var i=r.length/2,n=e==="x"?0:1,a,o,s=0,l=-1,u=0;u=t||a>=t&&o<=t){l=u;break}s=u,a=o}return{range:[s,l],t:(t-a)/(o-a)}}function Yk(r){if(r.get(["endLabel","show"]))return!0;for(var t=0;t0&&e.get(["emphasis","lineStyle","width"])==="bolder"){var B=d.getState("emphasis").style;B.lineWidth=+d.style.lineWidth+1}ot(d).seriesIndex=e.seriesIndex,Kt(d,R,N,O);var G=RT(e.get("smooth")),H=e.get("smoothMonotone");if(d.setShape({smooth:G,smoothMonotone:H,connectNulls:w}),p){var W=s.getCalculationInfo("stackedOnSeries"),q=0;p.useStyle(tt(u.getAreaStyle(),{fill:L,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),W&&(q=RT(W.get("smooth"))),p.setShape({smooth:G,stackedOnSmooth:q,smoothMonotone:H,connectNulls:w}),Ce(p,e,"areaStyle"),ot(p).seriesIndex=e.seriesIndex,Kt(p,R,N,O)}var K=this._changePolyState;s.eachItemGraphicEl(function(nt){nt&&(nt.onHoverStateChange=K)}),this._polyline.onHoverStateChange=K,this._data=s,this._coordSys=a,this._stackedOnPoints=b,this._points=h,this._step=C,this._valueOrigin=_,e.get("triggerLineEvent")&&(this.packEventData(e,d),p&&this.packEventData(e,p))},t.prototype.packEventData=function(e,i){ot(i).eventData={componentType:"series",componentSubType:"line",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"line"}},t.prototype.highlight=function(e,i,n,a){var o=e.getData(),s=fo(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var h=l[s*2],c=l[s*2+1];if(isNaN(h)||isNaN(c)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(h,c))return;var f=e.get("zlevel")||0,v=e.get("z")||0;u=new Sh(o,s),u.x=h,u.y=c,u.setZ(f,v);var d=u.getSymbolPath().getTextContent();d&&(d.zlevel=f,d.z=v,d.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else Ot.prototype.highlight.call(this,e,i,n,a)},t.prototype.downplay=function(e,i,n,a){var o=e.getData(),s=fo(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else Ot.prototype.downplay.call(this,e,i,n,a)},t.prototype._changePolyState=function(e){var i=this._polygon;Hf(this._polyline,e),i&&Hf(i,e)},t.prototype._newPolyline=function(e){var i=this._polyline;return i&&this._lineGroup.remove(i),i=new f8({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(i),this._polyline=i,i},t.prototype._newPolygon=function(e,i){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new Hk({shape:{points:e,stackedOnPoints:i},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,i,n){var a,o,s=i.getBaseAxis(),l=s.inverse;i.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):i.type==="polar"&&(a=s.dim==="angle",o=!0);var u=e.hostModel,h=u.get("animationDuration");Q(h)&&(h=h(null));var c=u.get("animationDelay")||0,f=Q(c)?c(null):c;e.eachItemGraphicEl(function(v,d){var p=v;if(p){var g=[v.x,v.y],y=void 0,m=void 0,_=void 0;if(n)if(o){var x=n,b=i.pointToCoord(g);a?(y=x.startAngle,m=x.endAngle,_=-b[1]/180*Math.PI):(y=x.r0,m=x.r,_=b[0])}else{var S=n;a?(y=S.x,m=S.x+S.width,_=v.x):(y=S.y+S.height,m=S.y,_=v.y)}var w=m===y?0:(_-y)/(m-y);l&&(w=1-w);var T=Q(c)?c(d):h*w+f,M=p.getSymbolPath(),C=M.getTextContent();p.attr({scaleX:0,scaleY:0}),p.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:T}),C&&C.animateFrom({style:{opacity:0}},{duration:300,delay:T}),M.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(e,i,n){var a=e.getModel("endLabel");if(Yk(e)){var o=e.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new St({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var h=x8(l);h>=0&&(Ae(s,me(e,"endLabel"),{inheritColor:n,labelFetcher:e,labelDataIndex:h,defaultText:function(c,f,v){return v!=null?zk(o,v):Ls(o,c)},enableTextSetter:!0},S8(a,i)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(e,i,n,a,o,s,l){var u=this._endLabel,h=this._polyline;if(u){e<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var c=n.getLayout("points"),f=n.hostModel,v=f.get("connectNulls"),d=s.get("precision"),p=s.get("distance")||0,g=l.getBaseAxis(),y=g.isHorizontal(),m=g.inverse,_=i.shape,x=m?y?_.x:_.y+_.height:y?_.x+_.width:_.y,b=(y?p:0)*(m?-1:1),S=(y?0:-p)*(m?-1:1),w=y?"x":"y",T=b8(c,x,w),M=T.range,C=M[1]-M[0],D=void 0;if(C>=1){if(C>1&&!v){var L=ET(c,M[0]);u.attr({x:L[0]+b,y:L[1]+S}),o&&(D=f.getRawValue(M[0]))}else{var L=h.getPointOn(x,w);L&&u.attr({x:L[0]+b,y:L[1]+S});var I=f.getRawValue(M[0]),P=f.getRawValue(M[1]);o&&(D=D2(n,d,I,P,T.t))}a.lastFrameIndex=M[0]}else{var k=e===1||a.lastFrameIndex>0?M[0]:0,L=ET(c,k);o&&(D=f.getRawValue(k)),u.attr({x:L[0]+b,y:L[1]+S})}if(o){var R=Hs(u);typeof R.setLabelText=="function"&&R.setLabelText(D)}}},t.prototype._doUpdateAnimation=function(e,i,n,a,o,s,l){var u=this._polyline,h=this._polygon,c=e.hostModel,f=c8(this._data,e,this._stackedOnPoints,i,this._coordSys,n,this._valueOrigin),v=f.current,d=f.stackedOnCurrent,p=f.next,g=f.stackedOnNext;if(o&&(d=pn(f.stackedOnCurrent,f.current,n,o,l),v=pn(f.current,null,n,o,l),g=pn(f.stackedOnNext,f.next,n,o,l),p=pn(f.next,null,n,o,l)),kT(v,p)>3e3||h&&kT(d,g)>3e3){u.stopAnimation(),u.setShape({points:p}),h&&(h.stopAnimation(),h.setShape({points:p,stackedOnPoints:g}));return}u.shape.__points=f.current,u.shape.points=v;var y={shape:{points:p}};f.current!==v&&(y.shape.__points=f.next),u.stopAnimation(),At(u,y,c),h&&(h.setShape({points:v,stackedOnPoints:d}),h.stopAnimation(),At(h,{shape:{stackedOnPoints:g}},c),u.shape.points!==h.shape.points&&(h.shape.points=u.shape.points));for(var m=[],_=f.status,x=0;x<_.length;x++){var b=_[x].cmd;if(b==="="){var S=e.getItemGraphicEl(_[x].idx1);S&&m.push({el:S,ptIdx:x})}}u.animators&&u.animators.length&&u.animators[0].during(function(){h&&h.dirtyShape();for(var w=u.shape.__points,T=0;Tt&&(t=r[e]);return isFinite(t)?t:NaN},min:function(r){for(var t=1/0,e=0;e10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),h=l.getExtent(),c=i.getDevicePixelRatio(),f=Math.abs(h[1]-h[0])*(c||1),v=Math.round(s/f);if(isFinite(v)&&v>1){a==="lttb"?t.setData(n.lttbDownSample(n.mapDimension(u.dim),1/v)):a==="minmax"&&t.setData(n.minmaxDownSample(n.mapDimension(u.dim),1/v));var d=void 0;Y(a)?d=T8[a]:Q(a)&&(d=a),d&&t.setData(n.downSample(n.mapDimension(u.dim),1/v,d,M8))}}}}}function C8(r){r.registerChartView(w8),r.registerSeriesModel(s8),r.registerLayout(Mh("line",!0)),r.registerVisual({seriesType:"line",reset:function(t){var e=t.getData(),i=t.getModel("lineStyle").getLineStyle();i&&!i.stroke&&(i.stroke=e.getVisual("style").fill),e.setVisual("legendLineStyle",i)}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,$k("line"))}var ju=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.getInitialData=function(e,i){return Li(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,i,n){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(e),s=a.dataToPoint(o);if(n)A(a.getAxes(),function(f,v){if(f.type==="category"&&i!=null){var d=f.getTicksCoords(),p=f.getTickModel().get("alignWithLabel"),g=o[v],y=i[v]==="x1"||i[v]==="y1";if(y&&!p&&(g+=1),d.length<2)return;if(d.length===2){s[v]=f.toGlobalCoord(f.getExtent()[y?1:0]);return}for(var m=void 0,_=void 0,x=1,b=0;bg){_=(S+m)/2;break}b===1&&(x=w-d[0].tickValue)}_==null&&(m?m&&(_=d[d.length-1].coord):_=d[0].coord),s[v]=f.toGlobalCoord(_)}});else{var l=this.getData(),u=l.getLayout("offset"),h=l.getLayout("size"),c=a.getBaseAxis().isHorizontal()?0:1;s[c]+=u+h/2}return s}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},t}(zt);zt.registerClass(ju);var A8=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.getInitialData=function(){return Li(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},t.prototype.getProgressiveThreshold=function(){var e=this.get("progressiveThreshold"),i=this.get("largeThreshold");return i>e&&(e=i),e},t.prototype.brushSelector=function(e,i,n){return n.rect(i.getItemLayout(e))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=ea(ju.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),t}(ju),D8=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return r}(),uv=function(r){E(t,r);function t(e){var i=r.call(this,e)||this;return i.type="sausage",i}return t.prototype.getDefaultShape=function(){return new D8},t.prototype.buildPath=function(e,i){var n=i.cx,a=i.cy,o=Math.max(i.r0||0,0),s=Math.max(i.r,0),l=(s-o)*.5,u=o+l,h=i.startAngle,c=i.endAngle,f=i.clockwise,v=Math.PI*2,d=f?c-hMath.PI/2&&hs)return!0;s=c}return!1},t.prototype._isOrderDifferentInView=function(e,i){for(var n=i.scale,a=n.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],n.getOrdinalMeta().categories.length-1);o<=s;++o)if(e.ordinalNumbers[o]!==n.getRawOrdinalNumber(o))return!0},t.prototype._updateSortWithinSameData=function(e,i,n,a){if(this._isOrderChangedWithinSameData(e,i,n)){var o=this._dataSort(e,n,i);this._isOrderDifferentInView(o,n)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:o}))}},t.prototype._dispatchInitSort=function(e,i,n){var a=i.baseAxis,o=this._dataSort(e,a,function(s){return e.get(e.mapDimension(i.otherAxis.dim),s)});n.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},t.prototype.remove=function(e,i){this._clear(this._model),this._removeOnRenderedListener(i)},t.prototype.dispose=function(e,i){this._removeOnRenderedListener(i)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&(e.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(e){var i=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(a){Vu(a,e,ot(a).dataIndex)})):i.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t}(Ot),OT={cartesian2d:function(r,t){var e=t.width<0?-1:1,i=t.height<0?-1:1;e<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height);var n=r.x+r.width,a=r.y+r.height,o=ag(t.x,r.x),s=og(t.x+t.width,n),l=ag(t.y,r.y),u=og(t.y+t.height,a),h=sn?s:o,t.y=c&&l>a?u:l,t.width=h?0:s-o,t.height=c?0:u-l,e<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height),h||c},polar:function(r,t){var e=t.r0<=t.r?1:-1;if(e<0){var i=t.r;t.r=t.r0,t.r0=i}var n=og(t.r,r.r),a=ag(t.r0,r.r0);t.r=n,t.r0=a;var o=n-a<0;if(e<0){var i=t.r;t.r=t.r0,t.r0=i}return o}},NT={cartesian2d:function(r,t,e,i,n,a,o,s,l){var u=new wt({shape:z({},i),z2:1});if(u.__dataIndex=e,u.name="item",a){var h=u.shape,c=n?"height":"width";h[c]=0}return u},polar:function(r,t,e,i,n,a,o,s,l){var u=!n&&l?uv:Fe,h=new u({shape:i,z2:1});h.name="item";var c=Xk(n);if(h.calculateTextPosition=L8(c,{isRoundCap:u===uv}),a){var f=h.shape,v=n?"r":"endAngle",d={};f[v]=n?i.r0:i.startAngle,d[v]=i[v],(s?At:$t)(h,{shape:d},a)}return h}};function R8(r,t){var e=r.get("realtimeSort",!0),i=t.getBaseAxis();if(e&&i.type==="category"&&t.type==="cartesian2d")return{baseAxis:i,otherAxis:t.getOtherAxis(i)}}function BT(r,t,e,i,n,a,o,s){var l,u;a?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(o?At:$t)(e,{shape:l},t,n,null);var h=t?r.baseAxis.model:null;(o?At:$t)(e,{shape:u},h,n)}function zT(r,t){for(var e=0;e0?1:-1,o=i.height>0?1:-1;return{x:i.x+a*n/2,y:i.y+o*n/2,width:i.width-a*n,height:i.height-o*n}},polar:function(r,t,e){var i=r.getItemLayout(t);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function N8(r){return r.startAngle!=null&&r.endAngle!=null&&r.startAngle===r.endAngle}function Xk(r){return function(t){var e=t?"Arc":"Angle";return function(i){switch(i){case"start":case"insideStart":case"end":case"insideEnd":return i+e;default:return i}}}(r)}function FT(r,t,e,i,n,a,o,s){var l=t.getItemVisual(e,"style");if(s){if(!a.get("roundCap")){var h=r.shape,c=Ka(i.getModel("itemStyle"),h,!0);z(h,c),r.setShape(h)}}else{var u=i.get(["itemStyle","borderRadius"])||0;r.setShape("r",u)}r.useStyle(l);var f=i.getShallow("cursor");f&&r.attr("cursor",f);var v=s?o?n.r>=n.r0?"endArc":"startArc":n.endAngle>=n.startAngle?"endAngle":"startAngle":o?n.height>=0?"bottom":"top":n.width>=0?"right":"left",d=me(i);Ae(r,d,{labelFetcher:a,labelDataIndex:e,defaultText:Ls(a.getData(),e),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:v});var p=r.getTextContent();if(s&&p){var g=i.get(["label","position"]);r.textConfig.inside=g==="middle"?!0:null,I8(r,g==="outside"?v:g,Xk(o),i.get(["label","rotate"]))}fI(p,d,a.getRawValue(e),function(m){return zk(t,m)});var y=i.getModel(["emphasis"]);Kt(r,y.get("focus"),y.get("blurScope"),y.get("disabled")),Ce(r,i),N8(n)&&(r.style.fill="none",r.style.stroke="none",A(r.states,function(m){m.style&&(m.style.fill=m.style.stroke="none")}))}function B8(r,t){var e=r.get(["itemStyle","borderColor"]);if(!e||e==="none")return 0;var i=r.get(["itemStyle","borderWidth"])||0,n=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(i,n,a)}var z8=function(){function r(){}return r}(),GT=function(r){E(t,r);function t(e){var i=r.call(this,e)||this;return i.type="largeBar",i}return t.prototype.getDefaultShape=function(){return new z8},t.prototype.buildPath=function(e,i){for(var n=i.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,h=0;h=0?e:null},30,!1);function V8(r,t,e){for(var i=r.baseDimIdx,n=1-i,a=r.shape.points,o=r.largeDataIndices,s=[],l=[],u=r.barWidth,h=0,c=a.length/3;h=s[0]&&t<=s[0]+l[0]&&e>=s[1]&&e<=s[1]+l[1])return o[h]}return-1}function Zk(r,t,e){if(Co(e,"cartesian2d")){var i=t,n=e.getArea();return{x:r?i.x:n.x,y:r?n.y:i.y,width:r?i.width:n.width,height:r?n.height:i.height}}else{var n=e.getArea(),a=t;return{cx:n.cx,cy:n.cy,r0:r?n.r0:a.r0,r:r?n.r:a.r,startAngle:r?a.startAngle:0,endAngle:r?a.endAngle:Math.PI*2}}}function F8(r,t,e){var i=r.type==="polar"?Fe:wt;return new i({shape:Zk(t,e,r),silent:!0,z2:0})}function G8(r){r.registerChartView(k8),r.registerSeriesModel(A8),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,ut(QP,"bar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,tk("bar")),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,$k("bar")),r.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(t,e){var i=t.componentType||"series";e.eachComponent({mainType:i,query:t},function(n){t.sortInfo&&n.axis.setCategorySortInfo(t.sortInfo)})})}var UT=Math.PI*2,Dc=Math.PI/180;function jk(r,t){return ue(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function qk(r,t){var e=jk(r,t),i=r.get("center"),n=r.get("radius");V(n)||(n=[0,n]);var a=U(e.width,t.getWidth()),o=U(e.height,t.getHeight()),s=Math.min(a,o),l=U(n[0],s/2),u=U(n[1],s/2),h,c,f=r.coordinateSystem;if(f){var v=f.dataToPoint(i);h=v[0]||0,c=v[1]||0}else V(i)||(i=[i,i]),h=U(i[0],a)+e.x,c=U(i[1],o)+e.y;return{cx:h,cy:c,r0:l,r:u}}function H8(r,t,e){t.eachSeriesByType(r,function(i){var n=i.getData(),a=n.mapDimension("value"),o=jk(i,e),s=qk(i,e),l=s.cx,u=s.cy,h=s.r,c=s.r0,f=-i.get("startAngle")*Dc,v=i.get("endAngle"),d=i.get("padAngle")*Dc;v=v==="auto"?f-UT:-v*Dc;var p=i.get("minAngle")*Dc,g=p+d,y=0;n.each(a,function(N){!isNaN(N)&&y++});var m=n.getSum(a),_=Math.PI/(m||y)*2,x=i.get("clockwise"),b=i.get("roseType"),S=i.get("stillShowZeroSum"),w=n.getDataExtent(a);w[0]=0;var T=x?1:-1,M=[f,v],C=T*d/2;a_(M,!x),f=M[0],v=M[1];var D=Kk(i);D.startAngle=f,D.endAngle=v,D.clockwise=x;var L=Math.abs(v-f),I=L,P=0,k=f;if(n.setLayout({viewRect:o,r:h}),n.each(a,function(N,O){var B;if(isNaN(N)){n.setItemLayout(O,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:x,cx:l,cy:u,r0:c,r:b?NaN:h});return}b!=="area"?B=m===0&&S?_:N*_:B=L/y,BB?(H=k+T*B/2,W=H):(H=k+C,W=G-C),n.setItemLayout(O,{angle:B,startAngle:H,endAngle:W,clockwise:x,cx:l,cy:u,r0:c,r:b?Pt(N,w,[c,h]):h}),k=G}),Ie?y:g,b=Math.abs(_.label.y-e);if(b>=x.maxY){var S=_.label.x-t-_.len2*n,w=i+_.len,T=Math.abs(S)r.unconstrainedWidth?null:v:null;i.setStyle("width",d)}var p=i.getBoundingRect();a.width=p.width;var g=(i.style.margin||0)+2.1;a.height=p.height+g,a.y-=(a.height-c)/2}}}function sg(r){return r.position==="center"}function Y8(r){var t=r.getData(),e=[],i,n,a=!1,o=(r.get("minShowLabelAngle")||0)*W8,s=t.getLayout("viewRect"),l=t.getLayout("r"),u=s.width,h=s.x,c=s.y,f=s.height;function v(S){S.ignore=!0}function d(S){if(!S.ignore)return!0;for(var w in S.states)if(S.states[w].ignore===!1)return!0;return!1}t.each(function(S){var w=t.getItemGraphicEl(S),T=w.shape,M=w.getTextContent(),C=w.getTextGuideLine(),D=t.getItemModel(S),L=D.getModel("label"),I=L.get("position")||D.get(["emphasis","label","position"]),P=L.get("distanceToLabelLine"),k=L.get("alignTo"),R=U(L.get("edgeDistance"),u),N=L.get("bleedMargin"),O=D.getModel("labelLine"),B=O.get("length");B=U(B,u);var G=O.get("length2");if(G=U(G,u),Math.abs(T.endAngle-T.startAngle)0?"right":"left":W>0?"left":"right"}var Vt=Math.PI,Xt=0,fe=L.get("rotate");if(Mt(fe))Xt=fe*(Vt/180);else if(I==="center")Xt=0;else if(fe==="radial"||fe===!0){var sr=W<0?-H+Vt:-H;Xt=sr}else if(fe==="tangential"&&I!=="outside"&&I!=="outer"){var Je=Math.atan2(W,q);Je<0&&(Je=Vt*2+Je);var ia=q>0;ia&&(Je=Vt+Je),Xt=Je-Vt}if(a=!!Xt,M.x=K,M.y=nt,M.rotation=Xt,M.setStyle({verticalAlign:"middle"}),dt){M.setStyle({align:te});var Ld=M.states.select;Ld&&(Ld.x+=M.x,Ld.y+=M.y)}else{var sn=M.getBoundingRect().clone();sn.applyTransform(M.getComputedTransform());var lb=(M.style.margin||0)+2.1;sn.y-=lb/2,sn.height+=lb,e.push({label:M,labelLine:C,position:I,len:B,len2:G,minTurnAngle:O.get("minTurnAngle"),maxSurfaceAngle:O.get("maxSurfaceAngle"),surfaceNormal:new ct(W,q),linePoints:Ct,textAlign:te,labelDistance:P,labelAlignTo:k,edgeDistance:R,bleedMargin:N,rect:sn,unconstrainedWidth:sn.width,labelStyleWidth:M.style.width})}w.setTextConfig({inside:dt})}}),!a&&r.get("avoidLabelOverlap")&&U8(e,i,n,l,u,f,h,c);for(var p=0;p0){for(var h=o.getItemLayout(0),c=1;isNaN(h&&h.startAngle)&&c=a.r0}},t.type="pie",t}(Ot);function Qs(r,t,e){t=V(t)&&{coordDimensions:t}||z({encodeDefine:r.getEncode()},t);var i=r.getSource(),n=qs(i,t).dimensions,a=new Be(n,r);return a.initData(i,e),a}var Ah=function(){function r(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return r.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},r.prototype.containName=function(t){var e=this._getRawData();return e.indexOfName(t)>=0},r.prototype.indexOfName=function(t){var e=this._getDataWithEncodedVisual();return e.indexOfName(t)},r.prototype.getItemVisual=function(t,e){var i=this._getDataWithEncodedVisual();return i.getItemVisual(t,e)},r}(),Z8=Tt(),j8=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.init=function(e){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new Ah($(this.getData,this),$(this.getRawData,this)),this._defaultLabelLine(e)},t.prototype.mergeOption=function(){r.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return Qs(this,{coordDimensions:["value"],encodeDefaulter:ut(D_,this)})},t.prototype.getDataParams=function(e){var i=this.getData(),n=Z8(i),a=n.seats;if(!a){var o=[];i.each(i.mapDimension("value"),function(l){o.push(l)}),a=n.seats=_2(o,i.hostModel.get("percentPrecision"))}var s=r.prototype.getDataParams.call(this,e);return s.percent=a[e]||0,s.$vars.push("percent"),s},t.prototype._defaultLabelLine=function(e){co(e,"labelLine",["show"]);var i=e.labelLine,n=e.emphasis.labelLine;i.show=i.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(zt);function q8(r){return{seriesType:r,reset:function(t,e){var i=t.getData();i.filterSelf(function(n){var a=i.mapDimension("value"),o=i.get(a,n);return!(Mt(o)&&!isNaN(o)&&o<0)})}}}function K8(r){r.registerChartView(X8),r.registerSeriesModel(j8),pP("pie",r.registerAction),r.registerLayout(ut(H8,"pie")),r.registerProcessor(Ch("pie")),r.registerProcessor(q8("pie"))}var J8=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.hasSymbolVisual=!0,e}return t.prototype.getInitialData=function(e,i){return Li(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){var e=this.option.progressive;return e??(this.option.large?5e3:this.get("progressive"))},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return e??(this.option.large?1e4:this.get("progressiveThreshold"))},t.prototype.brushSelector=function(e,i,n){return n.point(i.getItemLayout(e))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},t.type="series.scatter",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},t}(zt),Qk=4,Q8=function(){function r(){}return r}(),t$=function(r){E(t,r);function t(e){var i=r.call(this,e)||this;return i._off=0,i.hoverDataIdx=-1,i}return t.prototype.getDefaultShape=function(){return new Q8},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(e,i){var n=i.points,a=i.size,o=this.symbolProxy,s=o.shape,l=e.getContext?e.getContext():e,u=l&&a[0]=0;u--){var h=u*2,c=a[h]-s/2,f=a[h+1]-l/2;if(e>=c&&i>=f&&e<=c+s&&i<=f+l)return u}return-1},t.prototype.contain=function(e,i){var n=this.transformCoordToLocal(e,i),a=this.getBoundingRect();if(e=n[0],i=n[1],a.contain(e,i)){var o=this.hoverDataIdx=this.findDataIndex(e,i);return o>=0}return this.hoverDataIdx=-1,!1},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var i=this.shape,n=i.points,a=i.size,o=a[0],s=a[1],l=1/0,u=1/0,h=-1/0,c=-1/0,f=0;f=0&&(u.dataIndex=c+(t.startIndex||0))})},r.prototype.remove=function(){this._clear()},r.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},r}(),r$=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,i,n){var a=e.getData(),o=this._updateSymbolDraw(a,e);o.updateData(a,{clipShape:this._getClipShape(e)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,i,n){var a=e.getData(),o=this._updateSymbolDraw(a,e);o.incrementalPrepareUpdate(a),this._finished=!1},t.prototype.incrementalRender=function(e,i,n){this._symbolDraw.incrementalUpdate(e,i.getData(),{clipShape:this._getClipShape(i)}),this._finished=e.end===i.getData().count()},t.prototype.updateTransform=function(e,i,n){var a=e.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=Mh("").reset(e,i,n);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},t.prototype.eachRendered=function(e){this._symbolDraw&&this._symbolDraw.eachRendered(e)},t.prototype._getClipShape=function(e){if(e.get("clip",!0)){var i=e.coordinateSystem;return i&&i.getArea&&i.getArea(.1)}},t.prototype._updateSymbolDraw=function(e,i){var n=this._symbolDraw,a=i.pipelineContext,o=a.large;return(!n||o!==this._isLargeDraw)&&(n&&n.remove(),n=this._symbolDraw=o?new e$:new wh,this._isLargeDraw=o,this.group.removeAll()),this.group.add(n.group),n},t.prototype.remove=function(e,i){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter",t}(Ot),i$=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},t}(yt),Em=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",le).models[0]},t.type="cartesian2dAxis",t}(yt);re(Em,Js);var tR={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},n$=ht({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},tR),lx=ht({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},tR),a$=ht({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},lx),o$=tt({logBase:10},lx);const eR={category:n$,value:lx,time:a$,log:o$};var s$={value:1,category:1,time:1,log:1};function Is(r,t,e,i){A(s$,function(n,a){var o=ht(ht({},eR[a],!0),i,!0),s=function(l){E(u,l);function u(){var h=l!==null&&l.apply(this,arguments)||this;return h.type=t+"Axis."+a,h}return u.prototype.mergeDefaultAndTheme=function(h,c){var f=Gu(this),v=f?Us(h):{},d=c.getTheme();ht(h,d.get(a+"Axis")),ht(h,this.getDefaultOption()),h.type=$T(h),f&&Zn(h,v,f)},u.prototype.optionUpdated=function(){var h=this.option;h.type==="category"&&(this.__ordinalMeta=Cm.createByAxisModel(this))},u.prototype.getCategories=function(h){var c=this.option;if(c.type==="category")return h?c.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.type=t+"Axis."+a,u.defaultOption=o,u}(e);r.registerComponentModel(s)}),r.registerSubTypeDefaulter(t+"Axis",$T)}function $T(r){return r.type||(r.data?"category":"value")}var l$=function(){function r(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return r.prototype.getAxis=function(t){return this._axes[t]},r.prototype.getAxes=function(){return F(this._dimList,function(t){return this._axes[t]},this)},r.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),Dt(this.getAxes(),function(e){return e.scale.type===t})},r.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},r}(),Om=["x","y"];function XT(r){return r.type==="interval"||r.type==="time"}var u$=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=Om,e}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,i=this.getAxis("y").scale;if(!(!XT(e)||!XT(i))){var n=e.getExtent(),a=i.getExtent(),o=this.dataToPoint([n[0],a[0]]),s=this.dataToPoint([n[1],a[1]]),l=n[1]-n[0],u=a[1]-a[0];if(!(!l||!u)){var h=(s[0]-o[0])/l,c=(s[1]-o[1])/u,f=o[0]-n[0]*h,v=o[1]-a[0]*c,d=this._transform=[h,0,0,c,f,v];this._invTransform=bo([],d)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(e){var i=this.getAxis("x"),n=this.getAxis("y");return i.contain(i.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},t.prototype.containZone=function(e,i){var n=this.dataToPoint(e),a=this.dataToPoint(i),o=this.getArea(),s=new ft(n[0],n[1],a[0]-n[0],a[1]-n[1]);return o.intersect(s)},t.prototype.dataToPoint=function(e,i,n){n=n||[];var a=e[0],o=e[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return we(n,e,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return n[0]=s.toGlobalCoord(s.dataToCoord(a,i)),n[1]=l.toGlobalCoord(l.dataToCoord(o,i)),n},t.prototype.clampData=function(e,i){var n=this.getAxis("x").scale,a=this.getAxis("y").scale,o=n.getExtent(),s=a.getExtent(),l=n.parse(e[0]),u=a.parse(e[1]);return i=i||[],i[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),i[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),i},t.prototype.pointToData=function(e,i){var n=[];if(this._invTransform)return we(n,e,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return n[0]=a.coordToData(a.toLocalCoord(e[0]),i),n[1]=o.coordToData(o.toLocalCoord(e[1]),i),n},t.prototype.getOtherAxis=function(e){return this.getAxis(e.dim==="x"?"y":"x")},t.prototype.getArea=function(e){e=e||0;var i=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),a=Math.min(i[0],i[1])-e,o=Math.min(n[0],n[1])-e,s=Math.max(i[0],i[1])-a+e,l=Math.max(n[0],n[1])-o+e;return new ft(a,o,s,l)},t}(l$),h$=function(r){E(t,r);function t(e,i,n,a,o){var s=r.call(this,e,i,n)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return t.prototype.isHorizontal=function(){var e=this.position;return e==="top"||e==="bottom"},t.prototype.getGlobalExtent=function(e){var i=this.getExtent();return i[0]=this.toGlobalCoord(i[0]),i[1]=this.toGlobalCoord(i[1]),e&&i[0]>i[1]&&i.reverse(),i},t.prototype.pointToData=function(e,i){return this.coordToData(this.toLocalCoord(e[this.dim==="x"?0:1]),i)},t.prototype.setCategorySortInfo=function(e){if(this.type!=="category")return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(Br);function Nm(r,t,e){e=e||{};var i=r.coordinateSystem,n=t.axis,a={},o=n.getAxesOnZeroOf()[0],s=n.position,l=o?"onZero":s,u=n.dim,h=i.getRect(),c=[h.x,h.x+h.width,h.y,h.y+h.height],f={left:0,right:1,top:0,bottom:1,onZero:2},v=t.get("offset")||0,d=u==="x"?[c[2]-v,c[3]+v]:[c[0]-v,c[1]+v];if(o){var p=o.toGlobalCoord(o.dataToCoord(0));d[f.onZero]=Math.max(Math.min(p,d[1]),d[0])}a.position=[u==="y"?d[f[l]]:c[0],u==="x"?d[f[l]]:c[3]],a.rotation=Math.PI/2*(u==="x"?0:1);var g={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=g[s],a.labelOffset=o?d[f[s]]-d[f.onZero]:0,t.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),pe(e.labelInside,t.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var y=t.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-y:y,a.z2=1,a}function ZT(r){return r.get("coordinateSystem")==="cartesian2d"}function jT(r){var t={xAxisModel:null,yAxisModel:null};return A(t,function(e,i){var n=i.replace(/Model$/,""),a=r.getReferringComponents(n,le).models[0];t[i]=a}),t}var lg=Math.log;function rR(r,t,e){var i=en.prototype,n=i.getTicks.call(e),a=i.getTicks.call(e,!0),o=n.length-1,s=i.getInterval.call(e),l=ak(r,t),u=l.extent,h=l.fixMin,c=l.fixMax;if(r.type==="log"){var f=lg(r.base);u=[lg(u[0])/f,lg(u[1])/f]}r.setExtent(u[0],u[1]),r.calcNiceExtent({splitNumber:o,fixMin:h,fixMax:c});var v=i.getExtent.call(r);h&&(u[0]=v[0]),c&&(u[1]=v[1]);var d=i.getInterval.call(r),p=u[0],g=u[1];if(h&&c)d=(g-p)/o;else if(h)for(g=u[0]+d*o;gu[0]&&isFinite(p)&&isFinite(u[0]);)d=Xp(d),p=u[1]-d*o;else{var y=r.getTicks().length-1;y>o&&(d=Xp(d));var m=d*o;g=Math.ceil(u[1]/d)*d,p=Qt(g-m),p<0&&u[0]>=0?(p=0,g=Qt(m)):g>0&&u[1]<=0&&(g=0,p=-Qt(m))}var _=(n[0].value-a[0].value)/s,x=(n[o].value-a[o].value)/s;i.setExtent.call(r,p+d*_,g+d*x),i.setInterval.call(r,d),(_||x)&&i.setNiceExtent.call(r,p+d,g-d)}var c$=function(){function r(t,e,i){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=Om,this._initCartesian(t,e,i),this.model=t}return r.prototype.getRect=function(){return this._rect},r.prototype.update=function(t,e){var i=this._axesMap;this._updateScale(t,this.model);function n(o){var s,l=xt(o),u=l.length;if(u){for(var h=[],c=u-1;c>=0;c--){var f=+l[c],v=o[f],d=v.model,p=v.scale;Am(p)&&d.get("alignTicks")&&d.get("interval")==null?h.push(v):(yo(p,d),Am(p)&&(s=v))}h.length&&(s||(s=h.pop(),yo(s.scale,s.model)),A(h,function(g){rR(g.scale,g.model,s.scale)}))}}n(i.x),n(i.y);var a={};A(i.x,function(o){qT(i,"y",o,a)}),A(i.y,function(o){qT(i,"x",o,a)}),this.resize(this.model,e)},r.prototype.resize=function(t,e,i){var n=t.getBoxLayoutParams(),a=!i&&t.get("containLabel"),o=ue(n,{width:e.getWidth(),height:e.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(A(s,function(u){if(!u.model.get(["axisLabel","inside"])){var h=PU(u);if(h){var c=u.isHorizontal()?"height":"width",f=u.model.get(["axisLabel","margin"]);o[c]-=h[c]+f,u.position==="top"?o.y+=h.height+f:u.position==="left"&&(o.x+=h.width+f)}}}),l()),A(this._coordsList,function(u){u.calcAffineTransform()});function l(){A(s,function(u){var h=u.isHorizontal(),c=h?[0,o.width]:[0,o.height],f=u.inverse?1:0;u.setExtent(c[f],c[1-f]),f$(u,h?o.x:o.y)})}},r.prototype.getAxis=function(t,e){var i=this._axesMap[t];if(i!=null)return i[e||0]},r.prototype.getAxes=function(){return this._axesList.slice()},r.prototype.getCartesian=function(t,e){if(t!=null&&e!=null){var i="x"+t+"y"+e;return this._coordsMap[i]}et(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var n=0,a=this._coordsList;n0?"top":"bottom",a="center"):Ts(n-Pn)?(o=i>0?"bottom":"top",a="center"):(o="middle",n>0&&n0?"right":"left":a=i>0?"left":"right"),{rotation:n,textAlign:a,textVerticalAlign:o}},r.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},r.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},r}(),JT={axisLine:function(r,t,e,i){var n=t.get(["axisLine","show"]);if(n==="auto"&&r.handleAutoShown&&(n=r.handleAutoShown("axisLine")),!!n){var a=t.axis.getExtent(),o=i.transform,s=[a[0],0],l=[a[1],0],u=s[0]>l[0];o&&(we(s,s,o),we(l,l,o));var h=z({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),c=new ce({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:h,strokeContainThreshold:r.strokeContainThreshold||5,silent:!0,z2:1});Cs(c.shape,c.style.lineWidth),c.anid="line",e.add(c);var f=t.get(["axisLine","symbol"]);if(f!=null){var v=t.get(["axisLine","symbolSize"]);Y(f)&&(f=[f,f]),(Y(v)||Mt(v))&&(v=[v,v]);var d=Mo(t.get(["axisLine","symbolOffset"])||0,v),p=v[0],g=v[1];A([{rotate:r.rotation+Math.PI/2,offset:d[0],r:0},{rotate:r.rotation-Math.PI/2,offset:d[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(y,m){if(f[m]!=="none"&&f[m]!=null){var _=ae(f[m],-p/2,-g/2,p,g,h.stroke,!0),x=y.r+y.offset,b=u?l:s;_.attr({rotation:y.rotate,x:b[0]+x*Math.cos(r.rotation),y:b[1]-x*Math.sin(r.rotation),silent:!0,z2:11}),e.add(_)}})}}},axisTickLabel:function(r,t,e,i){var n=p$(e,i,t,r),a=y$(e,i,t,r);if(d$(t,a,n),g$(e,i,t,r.tickDirection),t.get(["axisLabel","hideOverlap"])){var o=_k(F(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));Sk(o)}},axisName:function(r,t,e,i){var n=pe(r.axisName,t.get("name"));if(n){var a=t.get("nameLocation"),o=r.nameDirection,s=t.getModel("nameTextStyle"),l=t.get("nameGap")||0,u=t.axis.getExtent(),h=u[0]>u[1]?-1:1,c=[a==="start"?u[0]-h*l:a==="end"?u[1]+h*l:(u[0]+u[1])/2,tM(a)?r.labelOffset+o*l:0],f,v=t.get("nameRotate");v!=null&&(v=v*Pn/180);var d;tM(a)?f=je.innerTextLayout(r.rotation,v??r.rotation,o):(f=v$(r.rotation,a,v||0,u),d=r.axisNameAvailableWidth,d!=null&&(d=Math.abs(d/Math.sin(f.rotation)),!isFinite(d)&&(d=null)));var p=s.getFont(),g=t.get("nameTruncate",!0)||{},y=g.ellipsis,m=pe(r.nameTruncateMaxWidth,g.maxWidth,d),_=new St({x:c[0],y:c[1],rotation:f.rotation,silent:je.isLabelSilent(t),style:Gt(s,{text:n,font:p,overflow:"truncate",width:m,ellipsis:y,fill:s.getTextColor()||t.get(["axisLine","lineStyle","color"]),align:s.get("align")||f.textAlign,verticalAlign:s.get("verticalAlign")||f.textVerticalAlign}),z2:1});if(So({el:_,componentModel:t,itemName:n}),_.__fullText=n,_.anid="name",t.get("triggerEvent")){var x=je.makeAxisEventDataBase(t);x.targetType="axisName",x.name=n,ot(_).eventData=x}i.add(_),_.updateTransform(),e.add(_),_.decomposeTransform()}}};function v$(r,t,e,i){var n=J0(e-r),a,o,s=i[0]>i[1],l=t==="start"&&!s||t!=="start"&&s;return Ts(n-Pn/2)?(o=l?"bottom":"top",a="center"):Ts(n-Pn*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",nPn/2?a=l?"left":"right":a=l?"right":"left"),{rotation:n,textAlign:a,textVerticalAlign:o}}function d$(r,t,e){if(!ok(r.axis)){var i=r.get(["axisLabel","showMinLabel"]),n=r.get(["axisLabel","showMaxLabel"]);t=t||[],e=e||[];var a=t[0],o=t[1],s=t[t.length-1],l=t[t.length-2],u=e[0],h=e[1],c=e[e.length-1],f=e[e.length-2];i===!1?(mr(a),mr(u)):QT(a,o)&&(i?(mr(o),mr(h)):(mr(a),mr(u))),n===!1?(mr(s),mr(c)):QT(l,s)&&(n?(mr(l),mr(f)):(mr(s),mr(c)))}}function mr(r){r&&(r.ignore=!0)}function QT(r,t){var e=r&&r.getBoundingRect().clone(),i=t&&t.getBoundingRect().clone();if(!(!e||!i)){var n=hh([]);return Qn(n,n,-r.rotation),e.applyTransform(bi([],n,r.getLocalTransform())),i.applyTransform(bi([],n,t.getLocalTransform())),e.intersect(i)}}function tM(r){return r==="middle"||r==="center"}function iR(r,t,e,i,n){for(var a=[],o=[],s=[],l=0;l=0||r===t}function w$(r){var t=ux(r);if(t){var e=t.axisPointerModel,i=t.axis.scale,n=e.option,a=e.get("status"),o=e.get("value");o!=null&&(o=i.parse(o));var s=Bm(e);a==null&&(n.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o0&&!d.min?d.min=0:d.min!=null&&d.min<0&&!d.max&&(d.max=0);var p=l;d.color!=null&&(p=tt({color:d.color},l));var g=ht(it(d),{boundaryGap:e,splitNumber:i,scale:n,axisLine:a,axisTick:o,axisLabel:s,name:d.text,showName:u,nameLocation:"end",nameGap:c,nameTextStyle:p,triggerEvent:f},!1);if(Y(h)){var y=g.name;g.name=h.replace("{value}",y??"")}else Q(h)&&(g.name=h(g.name,g));var m=new Lt(g,null,this.ecModel);return re(m,Js.prototype),m.mainType="radar",m.componentIndex=this.componentIndex,m},this);this._indicatorModels=v},t.prototype.getIndicatorModels=function(){return this._indicatorModels},t.type="radar",t.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:ht({lineStyle:{color:"#bbb"}},Tl.axisLine),axisLabel:Lc(Tl.axisLabel,!1),axisTick:Lc(Tl.axisTick,!1),splitLine:Lc(Tl.splitLine,!0),splitArea:Lc(Tl.splitArea,!0),indicator:[]},t}(yt),N$=["axisLine","axisTickLabel","axisName"],B$=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,i,n){var a=this.group;a.removeAll(),this._buildAxes(e),this._buildSplitLineAndArea(e)},t.prototype._buildAxes=function(e){var i=e.coordinateSystem,n=i.getIndicatorAxes(),a=F(n,function(o){var s=o.model.get("showName")?o.name:"",l=new je(o.model,{axisName:s,position:[i.cx,i.cy],rotation:o.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return l});A(a,function(o){A(N$,o.add,o),this.group.add(o.getGroup())},this)},t.prototype._buildSplitLineAndArea=function(e){var i=e.coordinateSystem,n=i.getIndicatorAxes();if(!n.length)return;var a=e.get("shape"),o=e.getModel("splitLine"),s=e.getModel("splitArea"),l=o.getModel("lineStyle"),u=s.getModel("areaStyle"),h=o.get("show"),c=s.get("show"),f=l.get("color"),v=u.get("color"),d=V(f)?f:[f],p=V(v)?v:[v],g=[],y=[];function m(k,R,N){var O=N%R.length;return k[O]=k[O]||[],O}if(a==="circle")for(var _=n[0].getTicksCoords(),x=i.cx,b=i.cy,S=0;S<_.length;S++){if(h){var w=m(g,d,S);g[w].push(new Ai({shape:{cx:x,cy:b,r:_[S].coord}}))}if(c&&S<_.length-1){var w=m(y,p,S);y[w].push(new Bs({shape:{cx:x,cy:b,r0:_[S].coord,r:_[S+1].coord}}))}}else for(var T,M=F(n,function(k,R){var N=k.getTicksCoords();return T=T==null?N.length-1:Math.min(N.length-1,T),F(N,function(O){return i.coordToPoint(O.coord,R)})}),C=[],S=0;S<=T;S++){for(var D=[],L=0;L3?1.4:o>1?1.2:1.1,h=a>0?u:1/u;cg(this,"zoom","zoomOnMouseWheel",e,{scale:h,originX:s,originY:l,isAvailableBehavior:null})}if(n){var c=Math.abs(a),f=(a>0?1:-1)*(c>3?.4:c>1?.15:.05);cg(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:f,originX:s,originY:l,isAvailableBehavior:null})}}},t.prototype._pinchHandler=function(e){if(!oM(this._zr,"globalPan")){var i=e.pinchScale>1?1.1:1/1.1;cg(this,"zoom",null,e,{scale:i,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})}},t}(Rr);function cg(r,t,e,i,n){r.pointerChecker&&r.pointerChecker(i,n.originX,n.originY)&&(qi(i.event),uR(r,t,e,i,n))}function uR(r,t,e,i,n){n.isAvailableBehavior=$(pf,null,e,i),r.trigger(t,n)}function pf(r,t,e){var i=e[r];return!r||i&&(!Y(i)||t.event[i+"Key"])}function cx(r,t,e){var i=r.target;i.x+=t,i.y+=e,i.dirty()}function fx(r,t,e,i){var n=r.target,a=r.zoomLimit,o=r.zoom=r.zoom||1;if(o*=t,a){var s=a.min||0,l=a.max||1/0;o=Math.max(Math.min(l,o),s)}var u=o/r.zoom;r.zoom=o,n.x-=(e-n.x)*(u-1),n.y-=(i-n.y)*(u-1),n.scaleX*=u,n.scaleY*=u,n.dirty()}var U$={axisPointer:1,tooltip:1,brush:1};function _d(r,t,e){var i=t.getComponentByElement(r.topTarget),n=i&&i.coordinateSystem;return i&&i!==e&&!U$.hasOwnProperty(i.mainType)&&n&&n.model!==e}function hR(r){if(Y(r)){var t=new DOMParser;r=t.parseFromString(r,"text/xml")}var e=r;for(e.nodeType===9&&(e=e.firstChild);e.nodeName.toLowerCase()!=="svg"||e.nodeType!==1;)e=e.nextSibling;return e}var fg,hv={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},sM=xt(hv),cv={"alignment-baseline":"textBaseline","stop-color":"stopColor"},lM=xt(cv),Y$=function(){function r(){this._defs={},this._root=null}return r.prototype.parse=function(t,e){e=e||{};var i=hR(t);this._defsUsePending=[];var n=new at;this._root=n;var a=[],o=i.getAttribute("viewBox")||"",s=parseFloat(i.getAttribute("width")||e.width),l=parseFloat(i.getAttribute("height")||e.height);isNaN(s)&&(s=null),isNaN(l)&&(l=null),lr(i,n,null,!0,!1);for(var u=i.firstChild;u;)this._parseNode(u,n,a,null,!1,!1),u=u.nextSibling;Z$(this._defs,this._defsUsePending),this._defsUsePending=[];var h,c;if(o){var f=xd(o);f.length>=4&&(h={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(h&&s!=null&&l!=null&&(c=fR(h,{x:0,y:0,width:s,height:l}),!e.ignoreViewBox)){var v=n;n=new at,n.add(v),v.scaleX=v.scaleY=c.scale,v.x=c.x,v.y=c.y}return!e.ignoreRootClip&&s!=null&&l!=null&&n.setClipPath(new wt({shape:{x:0,y:0,width:s,height:l}})),{root:n,width:s,height:l,viewBoxRect:h,viewBoxTransform:c,named:a}},r.prototype._parseNode=function(t,e,i,n,a,o){var s=t.nodeName.toLowerCase(),l,u=n;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=e;else{if(!a){var h=fg[s];if(h&&X(fg,s)){l=h.call(this,t,e);var c=t.getAttribute("name");if(c){var f={name:c,namedFrom:null,svgNodeTagLower:s,el:l};i.push(f),s==="g"&&(u=f)}else n&&i.push({name:n.name,namedFrom:n,svgNodeTagLower:s,el:l});e.add(l)}}var v=uM[s];if(v&&X(uM,s)){var d=v.call(this,t),p=t.getAttribute("id");p&&(this._defs[p]=d)}}if(l&&l.isGroup)for(var g=t.firstChild;g;)g.nodeType===1?this._parseNode(g,l,i,u,a,o):g.nodeType===3&&o&&this._parseText(g,l),g=g.nextSibling},r.prototype._parseText=function(t,e){var i=new Ms({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});_r(e,i),lr(t,i,this._defsUsePending,!1,!1),$$(i,e);var n=i.style,a=n.fontSize;a&&a<9&&(n.fontSize=9,i.scaleX*=a/9,i.scaleY*=a/9);var o=(n.fontSize||n.fontFamily)&&[n.fontStyle,n.fontWeight,(n.fontSize||12)+"px",n.fontFamily||"sans-serif"].join(" ");n.font=o;var s=i.getBoundingRect();return this._textX+=s.width,e.add(i),i},r.internalField=function(){fg={g:function(t,e){var i=new at;return _r(e,i),lr(t,i,this._defsUsePending,!1,!1),i},rect:function(t,e){var i=new wt;return _r(e,i),lr(t,i,this._defsUsePending,!1,!1),i.setShape({x:parseFloat(t.getAttribute("x")||"0"),y:parseFloat(t.getAttribute("y")||"0"),width:parseFloat(t.getAttribute("width")||"0"),height:parseFloat(t.getAttribute("height")||"0")}),i.silent=!0,i},circle:function(t,e){var i=new Ai;return _r(e,i),lr(t,i,this._defsUsePending,!1,!1),i.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),i.silent=!0,i},line:function(t,e){var i=new ce;return _r(e,i),lr(t,i,this._defsUsePending,!1,!1),i.setShape({x1:parseFloat(t.getAttribute("x1")||"0"),y1:parseFloat(t.getAttribute("y1")||"0"),x2:parseFloat(t.getAttribute("x2")||"0"),y2:parseFloat(t.getAttribute("y2")||"0")}),i.silent=!0,i},ellipse:function(t,e){var i=new ph;return _r(e,i),lr(t,i,this._defsUsePending,!1,!1),i.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),rx:parseFloat(t.getAttribute("rx")||"0"),ry:parseFloat(t.getAttribute("ry")||"0")}),i.silent=!0,i},polygon:function(t,e){var i=t.getAttribute("points"),n;i&&(n=fM(i));var a=new Ge({shape:{points:n||[]},silent:!0});return _r(e,a),lr(t,a,this._defsUsePending,!1,!1),a},polyline:function(t,e){var i=t.getAttribute("points"),n;i&&(n=fM(i));var a=new We({shape:{points:n||[]},silent:!0});return _r(e,a),lr(t,a,this._defsUsePending,!1,!1),a},image:function(t,e){var i=new xe;return _r(e,i),lr(t,i,this._defsUsePending,!1,!1),i.setStyle({image:t.getAttribute("xlink:href")||t.getAttribute("href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),i.silent=!0,i},text:function(t,e){var i=t.getAttribute("x")||"0",n=t.getAttribute("y")||"0",a=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(i)+parseFloat(a),this._textY=parseFloat(n)+parseFloat(o);var s=new at;return _r(e,s),lr(t,s,this._defsUsePending,!1,!0),s},tspan:function(t,e){var i=t.getAttribute("x"),n=t.getAttribute("y");i!=null&&(this._textX=parseFloat(i)),n!=null&&(this._textY=parseFloat(n));var a=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0",s=new at;return _r(e,s),lr(t,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(t,e){var i=t.getAttribute("d")||"",n=tI(i);return _r(e,n),lr(t,n,this._defsUsePending,!1,!1),n.silent=!0,n}}}(),r}(),uM={lineargradient:function(r){var t=parseInt(r.getAttribute("x1")||"0",10),e=parseInt(r.getAttribute("y1")||"0",10),i=parseInt(r.getAttribute("x2")||"10",10),n=parseInt(r.getAttribute("y2")||"0",10),a=new Vs(t,e,i,n);return hM(r,a),cM(r,a),a},radialgradient:function(r){var t=parseInt(r.getAttribute("cx")||"0",10),e=parseInt(r.getAttribute("cy")||"0",10),i=parseInt(r.getAttribute("r")||"0",10),n=new f_(t,e,i);return hM(r,n),cM(r,n),n}};function hM(r,t){var e=r.getAttribute("gradientUnits");e==="userSpaceOnUse"&&(t.global=!0)}function cM(r,t){for(var e=r.firstChild;e;){if(e.nodeType===1&&e.nodeName.toLocaleLowerCase()==="stop"){var i=e.getAttribute("offset"),n=void 0;i&&i.indexOf("%")>0?n=parseInt(i,10)/100:i?n=parseFloat(i):n=0;var a={};cR(e,a,a);var o=a.stopColor||e.getAttribute("stop-color")||"#000000";t.colorStops.push({offset:n,color:o})}e=e.nextSibling}}function _r(r,t){r&&r.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),tt(t.__inheritedStyle,r.__inheritedStyle))}function fM(r){for(var t=xd(r),e=[],i=0;i0;a-=2){var o=i[a],s=i[a-1],l=xd(o);switch(n=n||or(),s){case"translate":ti(n,n,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":Hv(n,n,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Qn(n,n,-parseFloat(l[0])*vg,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*vg);bi(n,[1,0,u,1,0,0],n);break;case"skewY":var h=Math.tan(parseFloat(l[0])*vg);bi(n,[1,h,0,1,0,0],n);break;case"matrix":n[0]=parseFloat(l[0]),n[1]=parseFloat(l[1]),n[2]=parseFloat(l[2]),n[3]=parseFloat(l[3]),n[4]=parseFloat(l[4]),n[5]=parseFloat(l[5]);break}}t.setLocalTransform(n)}}var dM=/([^\s:;]+)\s*:\s*([^:;]+)/g;function cR(r,t,e){var i=r.getAttribute("style");if(i){dM.lastIndex=0;for(var n;(n=dM.exec(i))!=null;){var a=n[1],o=X(hv,a)?hv[a]:null;o&&(t[o]=n[2]);var s=X(cv,a)?cv[a]:null;s&&(e[s]=n[2])}}}function J$(r,t,e){for(var i=0;i0,g={api:i,geo:l,mapOrGeoModel:t,data:s,isVisualEncodedByVisualMap:p,isGeo:o,transformInfoRaw:f};l.resourceType==="geoJSON"?this._buildGeoJSON(g):l.resourceType==="geoSVG"&&this._buildSVG(g),this._updateController(t,e,i),this._updateMapSelectHandler(t,u,i,n)},r.prototype._buildGeoJSON=function(t){var e=this._regionsGroupByName=Z(),i=Z(),n=this._regionsGroup,a=t.transformInfoRaw,o=t.mapOrGeoModel,s=t.data,l=t.geo.projection,u=l&&l.stream;function h(v,d){return d&&(v=d(v)),v&&[v[0]*a.scaleX+a.x,v[1]*a.scaleY+a.y]}function c(v){for(var d=[],p=!u&&l&&l.project,g=0;g=0)&&(f=n);var v=o?{normal:{align:"center",verticalAlign:"middle"}}:null;Ae(t,me(i),{labelFetcher:f,labelDataIndex:c,defaultText:e},v);var d=t.getTextContent();if(d&&(vR(d).ignore=d.ignore,t.textConfig&&o)){var p=t.getBoundingRect().clone();t.textConfig.layoutRect=p,t.textConfig.position=[(o[0]-p.x)/p.width*100+"%",(o[1]-p.y)/p.height*100+"%"]}t.disableLabelAnimation=!0}else t.removeTextContent(),t.removeTextConfig(),t.disableLabelAnimation=null}function _M(r,t,e,i,n,a){r.data?r.data.setItemGraphicEl(a,t):ot(t).eventData={componentType:"geo",componentIndex:n.componentIndex,geoIndex:n.componentIndex,name:e,region:i&&i.option||{}}}function xM(r,t,e,i,n){r.data||So({el:t,componentModel:n,itemName:e,itemTooltipOption:i.get("tooltip")})}function bM(r,t,e,i,n){t.highDownSilentOnTouch=!!n.get("selectedMode");var a=i.getModel("emphasis"),o=a.get("focus");return Kt(t,o,a.get("blurScope"),a.get("disabled")),r.isGeo&&J3(t,n,e),o}function SM(r,t,e){var i=[],n;function a(){n=[]}function o(){n.length&&(i.push(n),n=[])}var s=t({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(l,u){isFinite(l)&&isFinite(u)&&n.push([l,u])},sphere:function(){}});return!e&&s.polygonStart(),A(r,function(l){s.lineStart();for(var u=0;u-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},t.type="series.map",t.dependencies=["geo"],t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},t}(zt);function m7(r,t){var e={};return A(r,function(i){i.each(i.mapDimension("value"),function(n,a){var o="ec-"+i.getName(a);e[o]=e[o]||[],isNaN(n)||e[o].push(n)})}),r[0].map(r[0].mapDimension("value"),function(i,n){for(var a="ec-"+r[0].getName(n),o=0,s=1/0,l=-1/0,u=e[a].length,h=0;h1?(x.width=_,x.height=_/g):(x.height=_,x.width=_*g),x.y=m[1]-x.height/2,x.x=m[0]-x.width/2;else{var b=r.getBoxLayoutParams();b.aspect=g,x=ue(b,{width:d,height:p})}this.setViewRect(x.x,x.y,x.width,x.height),this.setCenter(r.get("center"),t),this.setZoom(r.get("zoom"))}function S7(r,t){A(t.get("geoCoord"),function(e,i){r.addGeoCoord(i,e)})}var w7=function(){function r(){this.dimensions=pR}return r.prototype.create=function(t,e){var i=[];function n(o){return{nameProperty:o.get("nameProperty"),aspectScale:o.get("aspectScale"),projection:o.get("projection")}}t.eachComponent("geo",function(o,s){var l=o.get("map"),u=new Fm(l+s,l,z({nameMap:o.get("nameMap")},n(o)));u.zoomLimit=o.get("scaleLimit"),i.push(u),o.coordinateSystem=u,u.model=o,u.resize=CM,u.resize(o,e)}),t.eachSeries(function(o){var s=o.get("coordinateSystem");if(s==="geo"){var l=o.get("geoIndex")||0;o.coordinateSystem=i[l]}});var a={};return t.eachSeriesByType("map",function(o){if(!o.getHostGeoModel()){var s=o.getMapType();a[s]=a[s]||[],a[s].push(o)}}),A(a,function(o,s){var l=F(o,function(h){return h.get("nameMap")}),u=new Fm(s,s,z({nameMap:zv(l)},n(o[0])));u.zoomLimit=pe.apply(null,F(o,function(h){return h.get("scaleLimit")})),i.push(u),u.resize=CM,u.resize(o[0],e),A(o,function(h){h.coordinateSystem=u,S7(u,h)})}),i},r.prototype.getFilledRegions=function(t,e,i,n){for(var a=(t||[]).slice(),o=Z(),s=0;s=0;o--){var s=n[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},e.push(s)}}function L7(r,t){var e=r.isExpand?r.children:[],i=r.parentNode.children,n=r.hierNode.i?i[r.hierNode.i-1]:null;if(e.length){k7(r);var a=(e[0].hierNode.prelim+e[e.length-1].hierNode.prelim)/2;n?(r.hierNode.prelim=n.hierNode.prelim+t(r,n),r.hierNode.modifier=r.hierNode.prelim-a):r.hierNode.prelim=a}else n&&(r.hierNode.prelim=n.hierNode.prelim+t(r,n));r.parentNode.hierNode.defaultAncestor=R7(r,n,r.parentNode.hierNode.defaultAncestor||i[0],t)}function I7(r){var t=r.hierNode.prelim+r.parentNode.hierNode.modifier;r.setLayout({x:t},!0),r.hierNode.modifier+=r.parentNode.hierNode.modifier}function DM(r){return arguments.length?r:N7}function Zl(r,t){return r-=Math.PI/2,{x:t*Math.cos(r),y:t*Math.sin(r)}}function P7(r,t){return ue(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function k7(r){for(var t=r.children,e=t.length,i=0,n=0;--e>=0;){var a=t[e];a.hierNode.prelim+=i,a.hierNode.modifier+=i,n+=a.hierNode.change,i+=a.hierNode.shift+n}}function R7(r,t,e,i){if(t){for(var n=r,a=r,o=a.parentNode.children[0],s=t,l=n.hierNode.modifier,u=a.hierNode.modifier,h=o.hierNode.modifier,c=s.hierNode.modifier;s=dg(s),a=pg(a),s&&a;){n=dg(n),o=pg(o),n.hierNode.ancestor=r;var f=s.hierNode.prelim+c-a.hierNode.prelim-u+i(s,a);f>0&&(O7(E7(s,r,e),r,f),u+=f,l+=f),c+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=n.hierNode.modifier,h+=o.hierNode.modifier}s&&!dg(n)&&(n.hierNode.thread=s,n.hierNode.modifier+=c-l),a&&!pg(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-h,e=r)}return e}function dg(r){var t=r.children;return t.length&&r.isExpand?t[t.length-1]:r.hierNode.thread}function pg(r){var t=r.children;return t.length&&r.isExpand?t[0]:r.hierNode.thread}function E7(r,t,e){return r.hierNode.ancestor.parentNode===t.parentNode?r.hierNode.ancestor:e}function O7(r,t,e){var i=e/(t.hierNode.i-r.hierNode.i);t.hierNode.change-=i,t.hierNode.shift+=e,t.hierNode.modifier+=e,t.hierNode.prelim+=e,r.hierNode.change+=i}function N7(r,t){return r.parentNode===t.parentNode?1:2}var B7=function(){function r(){this.parentPoint=[],this.childPoints=[]}return r}(),z7=function(r){E(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new B7},t.prototype.buildPath=function(e,i){var n=i.childPoints,a=n.length,o=i.parentPoint,s=n[0],l=n[a-1];if(a===1){e.moveTo(o[0],o[1]),e.lineTo(s[0],s[1]);return}var u=i.orient,h=u==="TB"||u==="BT"?0:1,c=1-h,f=U(i.forkPosition,1),v=[];v[h]=o[h],v[c]=o[c]+(l[c]-o[c])*f,e.moveTo(o[0],o[1]),e.lineTo(v[0],v[1]),e.moveTo(s[0],s[1]),v[h]=s[h],e.lineTo(v[0],v[1]),v[h]=l[h],e.lineTo(v[0],v[1]),e.lineTo(l[0],l[1]);for(var d=1;dm.x,b||(x=x-Math.PI));var w=b?"left":"right",T=s.getModel("label"),M=T.get("rotate"),C=M*(Math.PI/180),D=g.getTextContent();D&&(g.setTextConfig({position:T.get("position")||w,rotation:M==null?-x:C,origin:"center"}),D.setStyle("verticalAlign","middle"))}var L=s.get(["emphasis","focus"]),I=L==="relative"?ws(o.getAncestorsIndices(),o.getDescendantIndices()):L==="ancestor"?o.getAncestorsIndices():L==="descendant"?o.getDescendantIndices():null;I&&(ot(e).focus=I),F7(n,o,h,e,d,v,p,i),e.__edge&&(e.onHoverStateChange=function(P){if(P!=="blur"){var k=o.parentNode&&r.getItemGraphicEl(o.parentNode.dataIndex);k&&k.hoverState===dh||Hf(e.__edge,P)}})}function F7(r,t,e,i,n,a,o,s){var l=t.getModel(),u=r.get("edgeShape"),h=r.get("layout"),c=r.getOrient(),f=r.get(["lineStyle","curveness"]),v=r.get("edgeForkPosition"),d=l.getModel("lineStyle").getLineStyle(),p=i.__edge;if(u==="curve")t.parentNode&&t.parentNode!==e&&(p||(p=i.__edge=new zs({shape:Gm(h,c,f,n,n)})),At(p,{shape:Gm(h,c,f,a,o)},r));else if(u==="polyline"&&h==="orthogonal"&&t!==e&&t.children&&t.children.length!==0&&t.isExpand===!0){for(var g=t.children,y=[],m=0;me&&(e=n.height)}this.height=e+1},r.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var e=0,i=this.children,n=i.length;e=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},r.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},r.prototype.getModel=function(t){if(!(this.dataIndex<0)){var e=this.hostTree,i=e.data.getItemModel(this.dataIndex);return i.getModel(t)}},r.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},r.prototype.setVisual=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},r.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},r.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},r.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},r.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,e=0;e=0){var i=e.getData().tree.root,n=r.targetNode;if(Y(n)&&(n=i.getNodeById(n)),n&&i.contains(n))return{node:n};var a=r.targetNodeId;if(a!=null&&(n=i.getNodeById(a)))return{node:n}}}function bR(r){for(var t=[];r;)r=r.parentNode,r&&t.push(r);return t.reverse()}function yx(r,t){var e=bR(r);return vt(e,t)>=0}function bd(r,t){for(var e=[];r;){var i=r.dataIndex;e.push({name:r.name,dataIndex:i,value:t.getRawValue(i)}),r=r.parentNode}return e.reverse(),e}var j7=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.hasSymbolVisual=!0,e.ignoreStyleOnData=!0,e}return t.prototype.getInitialData=function(e){var i={name:e.name,children:e.data},n=e.leaves||{},a=new Lt(n,this,this.ecModel),o=gx.createTree(i,this,s);function s(c){c.wrapMethod("getItemModel",function(f,v){var d=o.getNodeByDataIndex(v);return d&&d.children.length&&d.isExpand||(f.parentModel=a),f})}var l=0;o.eachNode("preorder",function(c){c.depth>l&&(l=c.depth)});var u=e.expandAndCollapse,h=u&&e.initialTreeDepth>=0?e.initialTreeDepth:l;return o.root.eachNode("preorder",function(c){var f=c.hostTree.data.getRawDataItem(c.dataIndex);c.isExpand=f&&f.collapsed!=null?!f.collapsed:c.depth<=h}),o.data},t.prototype.getOrient=function(){var e=this.get("orient");return e==="horizontal"?e="LR":e==="vertical"&&(e="TB"),e},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.formatTooltip=function(e,i,n){for(var a=this.getData().tree,o=a.root.children[0],s=a.getNodeByDataIndex(e),l=s.getValue(),u=s.name;s&&s!==o;)u=s.parentNode.name+"."+u,s=s.parentNode;return _e("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},t.prototype.getDataParams=function(e){var i=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(e);return i.treeAncestors=bd(n,this),i.collapsed=!n.isExpand,i},t.type="series.tree",t.layoutMode="box",t.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t}(zt);function q7(r,t,e){for(var i=[r],n=[],a;a=i.pop();)if(n.push(a),a.isExpand){var o=a.children;if(o.length)for(var s=0;s=0;a--)e.push(n[a])}}function K7(r,t){r.eachSeriesByType("tree",function(e){J7(e,t)})}function J7(r,t){var e=P7(r,t);r.layoutInfo=e;var i=r.get("layout"),n=0,a=0,o=null;i==="radial"?(n=2*Math.PI,a=Math.min(e.height,e.width)/2,o=DM(function(_,x){return(_.parentNode===x.parentNode?1:2)/_.depth})):(n=e.width,a=e.height,o=DM());var s=r.getData().tree.root,l=s.children[0];if(l){D7(s),q7(l,L7,o),s.hierNode.modifier=-l.hierNode.prelim,Cl(l,I7);var u=l,h=l,c=l;Cl(l,function(_){var x=_.getLayout().x;xh.getLayout().x&&(h=_),_.depth>c.depth&&(c=_)});var f=u===h?1:o(u,h)/2,v=f-u.getLayout().x,d=0,p=0,g=0,y=0;if(i==="radial")d=n/(h.getLayout().x+f+v),p=a/(c.depth-1||1),Cl(l,function(_){g=(_.getLayout().x+v)*d,y=(_.depth-1)*p;var x=Zl(g,y);_.setLayout({x:x.x,y:x.y,rawX:g,rawY:y},!0)});else{var m=r.getOrient();m==="RL"||m==="LR"?(p=a/(h.getLayout().x+f+v),d=n/(c.depth-1||1),Cl(l,function(_){y=(_.getLayout().x+v)*p,g=m==="LR"?(_.depth-1)*d:n-(_.depth-1)*d,_.setLayout({x:g,y},!0)})):(m==="TB"||m==="BT")&&(d=n/(h.getLayout().x+f+v),p=a/(c.depth-1||1),Cl(l,function(_){g=(_.getLayout().x+v)*d,y=m==="TB"?(_.depth-1)*p:a-(_.depth-1)*p,_.setLayout({x:g,y},!0)}))}}}function Q7(r){r.eachSeriesByType("tree",function(t){var e=t.getData(),i=e.tree;i.eachNode(function(n){var a=n.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=e.ensureUniqueItemVisual(n.dataIndex,"style");z(s,o)})})}function t9(r){r.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},function(i){var n=t.dataIndex,a=i.getData().tree,o=a.getNodeByDataIndex(n);o.isExpand=!o.isExpand})}),r.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(t,e,i){e.eachComponent({mainType:"series",subType:"tree",query:t},function(n){var a=n.coordinateSystem,o=dx(a,t,void 0,i);n.setCenter&&n.setCenter(o.center),n.setZoom&&n.setZoom(o.zoom)})})}function e9(r){r.registerChartView(V7),r.registerSeriesModel(j7),r.registerLayout(K7),r.registerVisual(Q7),t9(r)}var RM=["treemapZoomToNode","treemapRender","treemapMove"];function r9(r){for(var t=0;t1;)a=a.parentNode;var o=dm(r.ecModel,a.name||a.dataIndex+"",i);n.setVisual("decal",o)})}var i9=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.preventUsingHoverLayer=!0,e}return t.prototype.getInitialData=function(e,i){var n={name:e.name,children:e.data};wR(n);var a=e.levels||[],o=this.designatedVisualItemStyle={},s=new Lt({itemStyle:o},this,i);a=e.levels=n9(a,i);var l=F(a||[],function(c){return new Lt(c,s,i)},this),u=gx.createTree(n,this,h);function h(c){c.wrapMethod("getItemModel",function(f,v){var d=u.getNodeByDataIndex(v),p=d?l[d.depth]:null;return f.parentModel=p||s,f})}return u.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(e,i,n){var a=this.getData(),o=this.getRawValue(e),s=a.getName(e);return _e("nameValue",{name:s,value:o})},t.prototype.getDataParams=function(e){var i=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(e);return i.treeAncestors=bd(n,this),i.treePathInfo=i.treeAncestors,i},t.prototype.setLayoutInfo=function(e){this.layoutInfo=this.layoutInfo||{},z(this.layoutInfo,e)},t.prototype.mapIdToIndex=function(e){var i=this._idIndexMap;i||(i=this._idIndexMap=Z(),this._idIndexMapCount=0);var n=i.get(e);return n==null&&i.set(e,n=this._idIndexMapCount++),n},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var i=this.getRawData().tree.root;(!e||e!==i&&!i.contains(e))&&(this._viewRoot=i)},t.prototype.enableAriaDecal=function(){SR(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.32*.32,scaleLimit:null,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},t}(zt);function wR(r){var t=0;A(r.children,function(i){wR(i);var n=i.value;V(n)&&(n=n[0]),t+=n});var e=r.value;V(e)&&(e=e[0]),(e==null||isNaN(e))&&(e=t),e<0&&(e=0),V(r.value)?r.value[0]=e:r.value=e}function n9(r,t){var e=Bt(t.get("color")),i=Bt(t.get(["aria","decal","decals"]));if(e){r=r||[];var n,a;A(r,function(s){var l=new Lt(s),u=l.get("color"),h=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(n=!0),(l.get(["itemStyle","decal"])||h&&h!=="none")&&(a=!0)});var o=r[0]||(r[0]={});return n||(o.color=e.slice()),!a&&i&&(o.decal=i.slice()),r}}var a9=8,EM=8,gg=5,o9=function(){function r(t){this.group=new at,t.add(this.group)}return r.prototype.render=function(t,e,i,n){var a=t.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!i)){var s=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=s.getModel("textStyle"),h=l.getModel(["itemStyle","textStyle"]),c={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,c,u),this._renderContent(t,c,s,l,u,h,n),sd(o,c.pos,c.box)}},r.prototype._prepare=function(t,e,i){for(var n=t;n;n=n.parentNode){var a=he(n.getModel().get("name"),""),o=i.getTextRect(a),s=Math.max(o.width+a9*2,e.emptyItemWidth);e.totalWidth+=s+EM,e.renderList.push({node:n,text:a,width:s})}},r.prototype._renderContent=function(t,e,i,n,a,o,s){for(var l=0,u=e.emptyItemWidth,h=t.get(["breadcrumb","height"]),c=JH(e.pos,e.box),f=e.totalWidth,v=e.renderList,d=n.getModel("itemStyle").getItemStyle(),p=v.length-1;p>=0;p--){var g=v[p],y=g.node,m=g.width,_=g.text;f>c.width&&(f-=m-u,m=u,_=null);var x=new Ge({shape:{points:s9(l,0,m,h,p===v.length-1,p===0)},style:tt(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new St({style:Gt(a,{text:_})}),textConfig:{position:"inside"},z2:Ns*1e4,onclick:ut(s,y)});x.disableLabelAnimation=!0,x.getTextContent().ensureState("emphasis").style=Gt(o,{text:_}),x.ensureState("emphasis").style=d,Kt(x,n.get("focus"),n.get("blurScope"),n.get("disabled")),this.group.add(x),l9(x,t,y),l+=m+EM}},r.prototype.remove=function(){this.group.removeAll()},r}();function s9(r,t,e,i,n,a){var o=[[n?r:r-gg,t],[r+e,t],[r+e,t+i],[n?r:r-gg,t+i]];return!a&&o.splice(2,0,[r+e+gg,t+i/2]),!n&&o.push([r,t+i/2]),o}function l9(r,t,e){ot(r).eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:e&&e.dataIndex,name:e&&e.name},treePathInfo:e&&bd(e,t)}}var u9=function(){function r(){this._storage=[],this._elExistsMap={}}return r.prototype.add=function(t,e,i,n,a){return this._elExistsMap[t.id]?!1:(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:e,duration:i,delay:n,easing:a}),!0)},r.prototype.finished=function(t){return this._finishedCallback=t,this},r.prototype.start=function(){for(var t=this,e=this._storage.length,i=function(){e--,e<=0&&(t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},n=0,a=this._storage.length;nNM||Math.abs(e.dy)>NM)){var i=this.seriesModel.getData().tree.root;if(!i)return;var n=i.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+e.dx,y:n.y+e.dy,width:n.width,height:n.height}})}},t.prototype._onZoom=function(e){var i=e.originX,n=e.originY,a=e.scale;if(this._state!=="animating"){var o=this.seriesModel.getData().tree.root;if(!o)return;var s=o.getLayout();if(!s)return;var l=new ft(s.x,s.y,s.width,s.height),u=null,h=this._controllerHost;u=h.zoomLimit;var c=h.zoom=h.zoom||1;if(c*=a,u){var f=u.min||0,v=u.max||1/0;c=Math.max(Math.min(v,c),f)}var d=c/h.zoom;h.zoom=c;var p=this.seriesModel.layoutInfo;i-=p.x,n-=p.y;var g=or();ti(g,g,[-i,-n]),Hv(g,g,[d,d]),ti(g,g,[i,n]),l.applyTransform(g),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:l.x,y:l.y,width:l.width,height:l.height}})}},t.prototype._initEvents=function(e){var i=this;e.on("click",function(n){if(i._state==="ready"){var a=i.seriesModel.get("nodeClick",!0);if(a){var o=i.findTarget(n.offsetX,n.offsetY);if(o){var s=o.node;if(s.getLayout().isLeafRoot)i._rootToNode(o);else if(a==="zoomToNode")i._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),u=l.get("link",!0),h=l.get("target",!0)||"blank";u&&Zf(u,h)}}}}},this)},t.prototype._renderBreadcrumb=function(e,i,n){var a=this;n||(n=e.get("leafDepth",!0)!=null?{node:e.getViewRoot()}:this.findTarget(i.getWidth()/2,i.getHeight()/2),n||(n={node:e.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new o9(this.group))).render(e,i,n.node,function(o){a._state!=="animating"&&(yx(e.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=Al(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(e){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype._rootToNode=function(e){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype.findTarget=function(e,i){var n,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(e,i),u=s.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)n={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),n},t.type="treemap",t}(Ot);function Al(){return{nodeGroup:[],background:[],content:[]}}function p9(r,t,e,i,n,a,o,s,l,u){if(!o)return;var h=o.getLayout(),c=r.getData(),f=o.getModel();if(c.setItemGraphicEl(o.dataIndex,null),!h||!h.isInView)return;var v=h.width,d=h.height,p=h.borderWidth,g=h.invisible,y=o.getRawIndex(),m=s&&s.getRawIndex(),_=o.viewChildren,x=h.upperHeight,b=_&&_.length,S=f.getModel("itemStyle"),w=f.getModel(["emphasis","itemStyle"]),T=f.getModel(["blur","itemStyle"]),M=f.getModel(["select","itemStyle"]),C=S.get("borderRadius")||0,D=nt("nodeGroup",Hm);if(!D)return;if(l.add(D),D.x=h.x||0,D.y=h.y||0,D.markRedraw(),fv(D).nodeWidth=v,fv(D).nodeHeight=d,h.isAboveViewRoot)return D;var L=nt("background",OM,u,f9);L&&G(D,L,b&&h.upperLabelHeight);var I=f.getModel("emphasis"),P=I.get("focus"),k=I.get("blurScope"),R=I.get("disabled"),N=P==="ancestor"?o.getAncestorsIndices():P==="descendant"?o.getDescendantIndices():P;if(b)zu(D)&&$a(D,!1),L&&($a(L,!R),c.setItemGraphicEl(o.dataIndex,L),om(L,N,k));else{var O=nt("content",OM,u,v9);O&&H(D,O),L.disableMorphing=!0,L&&zu(L)&&$a(L,!1),$a(D,!R),c.setItemGraphicEl(o.dataIndex,D);var B=f.getShallow("cursor");B&&O.attr("cursor",B),om(D,N,k)}return D;function G(dt,rt,gt){var J=ot(rt);if(J.dataIndex=o.dataIndex,J.seriesIndex=r.seriesIndex,rt.setShape({x:0,y:0,width:v,height:d,r:C}),g)W(rt);else{rt.invisible=!1;var st=o.getVisual("style"),Ht=st.stroke,Et=VM(S);Et.fill=Ht;var Vt=Na(w);Vt.fill=w.get("borderColor");var Xt=Na(T);Xt.fill=T.get("borderColor");var fe=Na(M);if(fe.fill=M.get("borderColor"),gt){var sr=v-2*p;q(rt,Ht,st.opacity,{x:p,y:0,width:sr,height:x})}else rt.removeTextContent();rt.setStyle(Et),rt.ensureState("emphasis").style=Vt,rt.ensureState("blur").style=Xt,rt.ensureState("select").style=fe,po(rt)}dt.add(rt)}function H(dt,rt){var gt=ot(rt);gt.dataIndex=o.dataIndex,gt.seriesIndex=r.seriesIndex;var J=Math.max(v-2*p,0),st=Math.max(d-2*p,0);if(rt.culling=!0,rt.setShape({x:p,y:p,width:J,height:st,r:C}),g)W(rt);else{rt.invisible=!1;var Ht=o.getVisual("style"),Et=Ht.fill,Vt=VM(S);Vt.fill=Et,Vt.decal=Ht.decal;var Xt=Na(w),fe=Na(T),sr=Na(M);q(rt,Et,Ht.opacity,null),rt.setStyle(Vt),rt.ensureState("emphasis").style=Xt,rt.ensureState("blur").style=fe,rt.ensureState("select").style=sr,po(rt)}dt.add(rt)}function W(dt){!dt.invisible&&a.push(dt)}function q(dt,rt,gt,J){var st=f.getModel(J?zM:BM),Ht=he(f.get("name"),null),Et=st.getShallow("show");Ae(dt,me(f,J?zM:BM),{defaultText:Et?Ht:null,inheritColor:rt,defaultOpacity:gt,labelFetcher:r,labelDataIndex:o.dataIndex});var Vt=dt.getTextContent();if(Vt){var Xt=Vt.style,fe=Fv(Xt.padding||0);J&&(dt.setTextConfig({layoutRect:J}),Vt.disableLabelLayout=!0),Vt.beforeUpdate=function(){var Je=Math.max((J?J.width:dt.shape.width)-fe[1]-fe[3],0),ia=Math.max((J?J.height:dt.shape.height)-fe[0]-fe[2],0);(Xt.width!==Je||Xt.height!==ia)&&Vt.setStyle({width:Je,height:ia})},Xt.truncateMinChar=2,Xt.lineOverflow="truncate",K(Xt,J,h);var sr=Vt.getState("emphasis");K(sr?sr.style:null,J,h)}}function K(dt,rt,gt){var J=dt?dt.text:null;if(!rt&>.isLeafRoot&&J!=null){var st=r.get("drillDownIcon",!0);dt.text=st?st+" "+J:J}}function nt(dt,rt,gt,J){var st=m!=null&&e[dt][m],Ht=n[dt];return st?(e[dt][m]=null,Ct(Ht,st)):g||(st=new rt,st instanceof kr&&(st.z2=g9(gt,J)),te(Ht,st)),t[dt][y]=st}function Ct(dt,rt){var gt=dt[y]={};rt instanceof Hm?(gt.oldX=rt.x,gt.oldY=rt.y):gt.oldShape=z({},rt.shape)}function te(dt,rt){var gt=dt[y]={},J=o.parentNode,st=rt instanceof at;if(J&&(!i||i.direction==="drillDown")){var Ht=0,Et=0,Vt=n.background[J.getRawIndex()];!i&&Vt&&Vt.oldShape&&(Ht=Vt.oldShape.width,Et=Vt.oldShape.height),st?(gt.oldX=0,gt.oldY=Et):gt.oldShape={x:Ht,y:Et,width:0,height:0}}gt.fadein=!st}}function g9(r,t){return r*c9+t}var Ju=A,y9=et,vv=-1,ye=function(){function r(t){var e=t.mappingMethod,i=t.type,n=this.option=it(t);this.type=i,this.mappingMethod=e,this._normalizeData=x9[e];var a=r.visualHandlers[i];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[e],e==="piecewise"?(yg(n),m9(n)):e==="category"?n.categories?_9(n):yg(n,!0):(Ve(e!=="linear"||n.dataExtent),yg(n))}return r.prototype.mapValueToVisual=function(t){var e=this._normalizeData(t);return this._normalizedToVisual(e,t)},r.prototype.getNormalizer=function(){return $(this._normalizeData,this)},r.listVisualTypes=function(){return xt(r.visualHandlers)},r.isValidType=function(t){return r.visualHandlers.hasOwnProperty(t)},r.eachVisual=function(t,e,i){et(t)?A(t,e,i):e.call(i,t)},r.mapVisual=function(t,e,i){var n,a=V(t)?[]:et(t)?{}:(n=!0,null);return r.eachVisual(t,function(o,s){var l=e.call(i,o,s);n?a=l:a[s]=l}),a},r.retrieveVisuals=function(t){var e={},i;return t&&Ju(r.visualHandlers,function(n,a){t.hasOwnProperty(a)&&(e[a]=t[a],i=!0)}),i?e:null},r.prepareVisualTypes=function(t){if(V(t))t=t.slice();else if(y9(t)){var e=[];Ju(t,function(i,n){e.push(n)}),t=e}else return[];return t.sort(function(i,n){return n==="color"&&i!=="color"&&i.indexOf("color")===0?1:-1}),t},r.dependsOn=function(t,e){return e==="color"?!!(t&&t.indexOf(e)===0):t===e},r.findPieceIndex=function(t,e,i){for(var n,a=1/0,o=0,s=e.length;o=0;a--)i[a]==null&&(delete e[t[a]],t.pop())}function yg(r,t){var e=r.visual,i=[];et(e)?Ju(e,function(a){i.push(a)}):e!=null&&i.push(e);var n={color:1,symbol:1};!t&&i.length===1&&!n.hasOwnProperty(r.type)&&(i[1]=i[0]),TR(r,i)}function Pc(r){return{applyVisual:function(t,e,i){var n=this.mapValueToVisual(t);i("color",r(e("color"),n))},_normalizedToVisual:Wm([0,1])}}function FM(r){var t=this.option.visual;return t[Math.round(Pt(r,[0,1],[0,t.length-1],!0))]||{}}function Dl(r){return function(t,e,i){i(r,this.mapValueToVisual(t))}}function jl(r){var t=this.option.visual;return t[this.option.loop&&r!==vv?r%t.length:r]}function Ba(){return this.option.visual[0]}function Wm(r){return{linear:function(t){return Pt(t,r,this.option.visual,!0)},category:jl,piecewise:function(t,e){var i=Um.call(this,e);return i==null&&(i=Pt(t,r,this.option.visual,!0)),i},fixed:Ba}}function Um(r){var t=this.option,e=t.pieceList;if(t.hasSpecialVisual){var i=ye.findPieceIndex(r,e),n=e[i];if(n&&n.visual)return n.visual[this.type]}}function TR(r,t){return r.visual=t,r.type==="color"&&(r.parsedVisual=F(t,function(e){var i=Ze(e);return i||[0,0,0,1]})),t}var x9={linear:function(r){return Pt(r,this.option.dataExtent,[0,1],!0)},piecewise:function(r){var t=this.option.pieceList,e=ye.findPieceIndex(r,t,!0);if(e!=null)return Pt(e,[0,t.length-1],[0,1],!0)},category:function(r){var t=this.option.categories?this.option.categoryMap[r]:r;return t??vv},fixed:ee};function kc(r,t,e){return r?t<=e:t=e.length||p===e[p.depth]){var y=C9(n,l,p,g,d,i);CR(p,y,e,i)}})}}}function w9(r,t,e){var i=z({},t),n=e.designatedVisualItemStyle;return A(["color","colorAlpha","colorSaturation"],function(a){n[a]=t[a];var o=r.get(a);n[a]=null,o!=null&&(i[a]=o)}),i}function GM(r){var t=mg(r,"color");if(t){var e=mg(r,"colorAlpha"),i=mg(r,"colorSaturation");return i&&(t=fs(t,null,null,i)),e&&(t=Ru(t,e)),t}}function T9(r,t){return t!=null?fs(t,null,null,r):null}function mg(r,t){var e=r[t];if(e!=null&&e!=="none")return e}function M9(r,t,e,i,n,a){if(!(!a||!a.length)){var o=_g(t,"color")||n.color!=null&&n.color!=="none"&&(_g(t,"colorAlpha")||_g(t,"colorSaturation"));if(o){var s=t.get("visualMin"),l=t.get("visualMax"),u=e.dataExtent.slice();s!=null&&su[1]&&(u[1]=l);var h=t.get("colorMappingBy"),c={type:o.name,dataExtent:u,visual:o.range};c.type==="color"&&(h==="index"||h==="id")?(c.mappingMethod="category",c.loop=!0):c.mappingMethod="linear";var f=new ye(c);return MR(f).drColorMappingBy=h,f}}}function _g(r,t){var e=r.get(t);return V(e)&&e.length?{name:t,range:e}:null}function C9(r,t,e,i,n,a){var o=z({},t);if(n){var s=n.type,l=s==="color"&&MR(n).drColorMappingBy,u=l==="index"?i:l==="id"?a.mapIdToIndex(e.getId()):e.getValue(r.get("visualDimension"));o[s]=n.mapValueToVisual(u)}return o}var Qu=Math.max,dv=Math.min,HM=pe,mx=A,AR=["itemStyle","borderWidth"],A9=["itemStyle","gapWidth"],D9=["upperLabel","show"],L9=["upperLabel","height"];const I9={seriesType:"treemap",reset:function(r,t,e,i){var n=e.getWidth(),a=e.getHeight(),o=r.option,s=ue(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),l=o.size||[],u=U(HM(s.width,l[0]),n),h=U(HM(s.height,l[1]),a),c=i&&i.type,f=["treemapZoomToNode","treemapRootToNode"],v=Ku(i,f,r),d=c==="treemapRender"||c==="treemapMove"?i.rootRect:null,p=r.getViewRoot(),g=bR(p);if(c!=="treemapMove"){var y=c==="treemapZoomToNode"?N9(r,v,p,u,h):d?[d.width,d.height]:[u,h],m=o.sort;m&&m!=="asc"&&m!=="desc"&&(m="desc");var _={squareRatio:o.squareRatio,sort:m,leafDepth:o.leafDepth};p.hostTree.clearLayouts();var x={x:0,y:0,width:y[0],height:y[1],area:y[0]*y[1]};p.setLayout(x),DR(p,_,!1,0),x=p.getLayout(),mx(g,function(S,w){var T=(g[w+1]||p).getValue();S.setLayout(z({dataExtent:[T,T],borderWidth:0,upperHeight:0},x))})}var b=r.getData().tree.root;b.setLayout(B9(s,d,v),!0),r.setLayoutInfo(s),LR(b,new ft(-s.x,-s.y,n,a),g,p,0)}};function DR(r,t,e,i){var n,a;if(!r.isRemoved()){var o=r.getLayout();n=o.width,a=o.height;var s=r.getModel(),l=s.get(AR),u=s.get(A9)/2,h=IR(s),c=Math.max(l,h),f=l-u,v=c-u;r.setLayout({borderWidth:l,upperHeight:c,upperLabelHeight:h},!0),n=Qu(n-2*f,0),a=Qu(a-f-v,0);var d=n*a,p=P9(r,s,d,t,e,i);if(p.length){var g={x:f,y:v,width:n,height:a},y=dv(n,a),m=1/0,_=[];_.area=0;for(var x=0,b=p.length;x=0;l--){var u=n[i==="asc"?o-l-1:l].getValue();u/e*ts[1]&&(s[1]=u)})),{sum:i,dataExtent:s}}function O9(r,t,e){for(var i=0,n=1/0,a=0,o=void 0,s=r.length;ai&&(i=o));var l=r.area*r.area,u=t*t*e;return l?Qu(u*i/l,l/(u*n)):1/0}function WM(r,t,e,i,n){var a=t===e.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=e[s[a]],h=t?r.area/t:0;(n||h>e[l[o]])&&(h=e[l[o]]);for(var c=0,f=r.length;cKy&&(u=Ky),a=s}ui&&(i=t);var a=i%2?i+2:i+3;n=[];for(var o=0;o0&&(b[0]=-b[0],b[1]=-b[1]);var w=x[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var T=-Math.atan2(x[1],x[0]);c[0].8?"left":f[0]<-.8?"right":"center",p=f[1]>.8?"top":f[1]<-.8?"bottom":"middle";break;case"start":a.x=-f[0]*y+h[0],a.y=-f[1]*m+h[1],d=f[0]>.8?"right":f[0]<-.8?"left":"center",p=f[1]>.8?"bottom":f[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=y*w+h[0],a.y=h[1]+M,d=x[0]<0?"right":"left",a.originX=-y*w,a.originY=-M;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=S[0],a.y=S[1]+M,d="center",a.originY=-M;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-y*w+c[0],a.y=c[1]+M,d=x[0]>=0?"right":"left",a.originX=y*w,a.originY=-M;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||p,align:a.__align||d})}},t}(at),Tx=function(){function r(t){this.group=new at,this._LineCtor=t||Sx}return r.prototype.updateData=function(t){var e=this;this._progressiveEls=null;var i=this,n=i.group,a=i._lineData;i._lineData=t,a||n.removeAll();var o=jM(t);t.diff(a).add(function(s){e._doAdd(t,s,o)}).update(function(s,l){e._doUpdate(a,t,l,s,o)}).remove(function(s){n.remove(a.getItemGraphicEl(s))}).execute()},r.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl(function(e,i){e.updateLayout(t,i)},this)},r.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=jM(t),this._lineData=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(t,e){this._progressiveEls=[];function i(s){!s.isGroup&&!eX(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var n=t.start;n0}function jM(r){var t=r.hostModel,e=t.getModel("emphasis");return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:e.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:e.get("disabled"),blurScope:e.get("blurScope"),focus:e.get("focus"),labelStatesModels:me(t)}}function qM(r){return isNaN(r[0])||isNaN(r[1])}function Tg(r){return r&&!qM(r[0])&&!qM(r[1])}var Mg=[],Cg=[],Ag=[],$o=be,Dg=On,KM=Math.abs;function JM(r,t,e){for(var i=r[0],n=r[1],a=r[2],o=1/0,s,l=e*e,u=.1,h=.1;h<=.9;h+=.1){Mg[0]=$o(i[0],n[0],a[0],h),Mg[1]=$o(i[1],n[1],a[1],h);var c=KM(Dg(Mg,t)-l);c=0?s=s+u:s=s-u:d>=0?s=s-u:s=s+u}return s}function Lg(r,t){var e=[],i=Pu,n=[[],[],[]],a=[[],[]],o=[];t/=2,r.eachEdge(function(s,l){var u=s.getLayout(),h=s.getVisual("fromSymbol"),c=s.getVisual("toSymbol");u.__original||(u.__original=[xi(u[0]),xi(u[1])],u[2]&&u.__original.push(xi(u[2])));var f=u.__original;if(u[2]!=null){if(ke(n[0],f[0]),ke(n[1],f[2]),ke(n[2],f[1]),h&&h!=="none"){var v=Kl(s.node1),d=JM(n,f[0],v*t);i(n[0][0],n[1][0],n[2][0],d,e),n[0][0]=e[3],n[1][0]=e[4],i(n[0][1],n[1][1],n[2][1],d,e),n[0][1]=e[3],n[1][1]=e[4]}if(c&&c!=="none"){var v=Kl(s.node2),d=JM(n,f[1],v*t);i(n[0][0],n[1][0],n[2][0],d,e),n[1][0]=e[1],n[2][0]=e[2],i(n[0][1],n[1][1],n[2][1],d,e),n[1][1]=e[1],n[2][1]=e[2]}ke(u[0],n[0]),ke(u[1],n[2]),ke(u[2],n[1])}else{if(ke(a[0],f[0]),ke(a[1],f[1]),An(o,a[1],a[0]),xo(o,o),h&&h!=="none"){var v=Kl(s.node1);Pf(a[0],a[0],o,v*t)}if(c&&c!=="none"){var v=Kl(s.node2);Pf(a[1],a[1],o,-v*t)}ke(u[0],a[0]),ke(u[1],a[1])}})}function QM(r){return r.type==="view"}var rX=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.init=function(e,i){var n=new wh,a=new Tx,o=this.group;this._controller=new Dh(i.getZr()),this._controllerHost={target:o},o.add(n.group),o.add(a.group),this._symbolDraw=n,this._lineDraw=a,this._firstRender=!0},t.prototype.render=function(e,i,n){var a=this,o=e.coordinateSystem;this._model=e;var s=this._symbolDraw,l=this._lineDraw,u=this.group;if(QM(o)){var h={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?u.attr(h):At(u,h,e)}Lg(e.getGraph(),ql(e));var c=e.getData();s.updateData(c);var f=e.getEdgeData();l.updateData(f),this._updateNodeAndLinkScale(),this._updateController(e,i,n),clearTimeout(this._layoutTimeout);var v=e.forceLayout,d=e.get(["force","layoutAnimation"]);v&&this._startForceLayoutIteration(v,d);var p=e.get("layout");c.graph.eachNode(function(_){var x=_.dataIndex,b=_.getGraphicEl(),S=_.getModel();if(b){b.off("drag").off("dragend");var w=S.get("draggable");w&&b.on("drag",function(M){switch(p){case"force":v.warmUp(),!a._layouting&&a._startForceLayoutIteration(v,d),v.setFixed(x),c.setItemLayout(x,[b.x,b.y]);break;case"circular":c.setItemLayout(x,[b.x,b.y]),_.setLayout({fixed:!0},!0),bx(e,"symbolSize",_,[M.offsetX,M.offsetY]),a.updateLayout(e);break;case"none":default:c.setItemLayout(x,[b.x,b.y]),xx(e.getGraph(),e),a.updateLayout(e);break}}).on("dragend",function(){v&&v.setUnfixed(x)}),b.setDraggable(w,!!S.get("cursor"));var T=S.get(["emphasis","focus"]);T==="adjacency"&&(ot(b).focus=_.getAdjacentDataIndices())}}),c.graph.eachEdge(function(_){var x=_.getGraphicEl(),b=_.getModel().get(["emphasis","focus"]);x&&b==="adjacency"&&(ot(x).focus={edge:[_.dataIndex],node:[_.node1.dataIndex,_.node2.dataIndex]})});var g=e.get("layout")==="circular"&&e.get(["circular","rotateLabel"]),y=c.getLayout("cx"),m=c.getLayout("cy");c.graph.eachNode(function(_){ER(_,g,y,m)}),this._firstRender=!1},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(e,i){var n=this;(function a(){e.step(function(o){n.updateLayout(n._model),(n._layouting=!o)&&(i?n._layoutTimeout=setTimeout(a,16):a())})})()},t.prototype._updateController=function(e,i,n){var a=this,o=this._controller,s=this._controllerHost,l=this.group;if(o.setPointerChecker(function(u,h,c){var f=l.getBoundingRect();return f.applyTransform(l.transform),f.contain(h,c)&&!_d(u,n,e)}),!QM(e.coordinateSystem)){o.disable();return}o.enable(e.get("roam")),s.zoomLimit=e.get("scaleLimit"),s.zoom=e.coordinateSystem.getZoom(),o.off("pan").off("zoom").on("pan",function(u){cx(s,u.dx,u.dy),n.dispatchAction({seriesId:e.id,type:"graphRoam",dx:u.dx,dy:u.dy})}).on("zoom",function(u){fx(s,u.scale,u.originX,u.originY),n.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:u.scale,originX:u.originX,originY:u.originY}),a._updateNodeAndLinkScale(),Lg(e.getGraph(),ql(e)),a._lineDraw.updateLayout(),n.updateLabelLayout()})},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,i=e.getData(),n=ql(e);i.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(n)})},t.prototype.updateLayout=function(e){Lg(e.getGraph(),ql(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},t.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},t.type="graph",t}(Ot);function Xo(r){return"_EC_"+r}var iX=function(){function r(t){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=t||!1}return r.prototype.isDirected=function(){return this._directed},r.prototype.addNode=function(t,e){t=t==null?""+e:""+t;var i=this._nodesMap;if(!i[Xo(t)]){var n=new za(t,e);return n.hostGraph=this,this.nodes.push(n),i[Xo(t)]=n,n}},r.prototype.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},r.prototype.getNodeById=function(t){return this._nodesMap[Xo(t)]},r.prototype.addEdge=function(t,e,i){var n=this._nodesMap,a=this._edgesMap;if(Mt(t)&&(t=this.nodes[t]),Mt(e)&&(e=this.nodes[e]),t instanceof za||(t=n[Xo(t)]),e instanceof za||(e=n[Xo(e)]),!(!t||!e)){var o=t.id+"-"+e.id,s=new NR(t,e,i);return s.hostGraph=this,this._directed&&(t.outEdges.push(s),e.inEdges.push(s)),t.edges.push(s),t!==e&&e.edges.push(s),this.edges.push(s),a[o]=s,s}},r.prototype.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},r.prototype.getEdge=function(t,e){t instanceof za&&(t=t.id),e instanceof za&&(e=e.id);var i=this._edgesMap;return this._directed?i[t+"-"+e]:i[t+"-"+e]||i[e+"-"+t]},r.prototype.eachNode=function(t,e){for(var i=this.nodes,n=i.length,a=0;a=0&&t.call(e,i[a],a)},r.prototype.eachEdge=function(t,e){for(var i=this.edges,n=i.length,a=0;a=0&&i[a].node1.dataIndex>=0&&i[a].node2.dataIndex>=0&&t.call(e,i[a],a)},r.prototype.breadthFirstTraverse=function(t,e,i,n){if(e instanceof za||(e=this._nodesMap[Xo(e)]),!!e){for(var a=i==="out"?"outEdges":i==="in"?"inEdges":"edges",o=0;o=0&&l.node2.dataIndex>=0});for(var a=0,o=n.length;a=0&&this[r][t].setItemVisual(this.dataIndex,e,i)},getVisual:function(e){return this[r][t].getItemVisual(this.dataIndex,e)},setLayout:function(e,i){this.dataIndex>=0&&this[r][t].setItemLayout(this.dataIndex,e,i)},getLayout:function(){return this[r][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[r][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[r][t].getRawIndex(this.dataIndex)}}}re(za,BR("hostGraph","data"));re(NR,BR("hostGraph","edgeData"));function zR(r,t,e,i,n){for(var a=new iX(i),o=0;o "+f)),u++)}var v=e.get("coordinateSystem"),d;if(v==="cartesian2d"||v==="polar")d=Li(r,e);else{var p=$s.get(v),g=p?p.dimensions||[]:[];vt(g,"value")<0&&g.concat(["value"]);var y=qs(r,{coordDimensions:g,encodeDefine:e.getEncode()}).dimensions;d=new Be(y,e),d.initData(r)}var m=new Be(["value"],e);return m.initData(l,s),n&&n(d,m),_R({mainData:d,struct:a,structAttr:"graph",datas:{node:d,edge:m},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var nX=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.hasSymbolVisual=!0,e}return t.prototype.init=function(e){r.prototype.init.apply(this,arguments);var i=this;function n(){return i._categoriesData}this.legendVisualProvider=new Ah(n,n),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},t.prototype.mergeOption=function(e){r.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(e){r.prototype.mergeDefaultAndTheme.apply(this,arguments),co(e,"edgeLabel",["show"])},t.prototype.getInitialData=function(e,i){var n=e.edges||e.links||[],a=e.data||e.nodes||[],o=this;if(a&&n){U9(this);var s=zR(a,n,this,!0,l);return A(s.edges,function(u){Y9(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,h){u.wrapMethod("getItemModel",function(d){var p=o._categoriesModels,g=d.getShallow("category"),y=p[g];return y&&(y.parentModel=d.parentModel,d.parentModel=y),d});var c=Lt.prototype.getModel;function f(d,p){var g=c.call(this,d,p);return g.resolveParentPath=v,g}h.wrapMethod("getItemModel",function(d){return d.resolveParentPath=v,d.getModel=f,d});function v(d){if(d&&(d[0]==="label"||d[1]==="label")){var p=d.slice();return d[0]==="label"?p[0]="edgeLabel":d[1]==="label"&&(p[1]="edgeLabel"),p}return d}}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(e,i,n){if(n==="edge"){var a=this.getData(),o=this.getDataParams(e,n),s=a.graph.getEdgeByIndex(e),l=a.getName(s.node1.dataIndex),u=a.getName(s.node2.dataIndex),h=[];return l!=null&&h.push(l),u!=null&&h.push(u),_e("nameValue",{name:h.join(" > "),value:o.value,noValue:o.value==null})}var c=aP({series:this,dataIndex:e,multipleSeries:i});return c},t.prototype._updateCategoriesData=function(){var e=F(this.option.categories||[],function(n){return n.value!=null?n:z({value:0},n)}),i=new Be(["value"],this);i.initData(e),this._categoriesData=i,this._categoriesModels=i.mapArray(function(n){return i.getItemModel(n)})},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.isAnimationEnabled=function(){return r.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},t.type="series.graph",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t}(zt),aX={type:"graphRoam",event:"graphRoam",update:"none"};function oX(r){r.registerChartView(rX),r.registerSeriesModel(nX),r.registerProcessor(V9),r.registerVisual(F9),r.registerVisual(G9),r.registerLayout($9),r.registerLayout(r.PRIORITY.VISUAL.POST_CHART_LAYOUT,Z9),r.registerLayout(q9),r.registerCoordinateSystem("graphView",{dimensions:Lh.dimensions,create:J9}),r.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},ee),r.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},ee),r.registerAction(aX,function(t,e,i){e.eachComponent({mainType:"series",query:t},function(n){var a=n.coordinateSystem,o=dx(a,t,void 0,i);n.setCenter&&n.setCenter(o.center),n.setZoom&&n.setZoom(o.zoom)})})}var sX=function(){function r(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return r}(),lX=function(r){E(t,r);function t(e){var i=r.call(this,e)||this;return i.type="pointer",i}return t.prototype.getDefaultShape=function(){return new sX},t.prototype.buildPath=function(e,i){var n=Math.cos,a=Math.sin,o=i.r,s=i.width,l=i.angle,u=i.x-n(l)*s*(s>=o/3?1:2),h=i.y-a(l)*s*(s>=o/3?1:2);l=i.angle-Math.PI/2,e.moveTo(u,h),e.lineTo(i.x+n(l)*s,i.y+a(l)*s),e.lineTo(i.x+n(i.angle)*o,i.y+a(i.angle)*o),e.lineTo(i.x-n(l)*s,i.y-a(l)*s),e.lineTo(u,h)},t}(_t);function uX(r,t){var e=r.get("center"),i=t.getWidth(),n=t.getHeight(),a=Math.min(i,n),o=U(e[0],t.getWidth()),s=U(e[1],t.getHeight()),l=U(r.get("radius"),a/2);return{cx:o,cy:s,r:l}}function Ec(r,t){var e=r==null?"":r+"";return t&&(Y(t)?e=t.replace("{value}",e):Q(t)&&(e=t(r))),e}var hX=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,i,n){this.group.removeAll();var a=e.get(["axisLine","lineStyle","color"]),o=uX(e,n);this._renderMain(e,i,n,a,o),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,i,n,a,o){var s=this.group,l=e.get("clockwise"),u=-e.get("startAngle")/180*Math.PI,h=-e.get("endAngle")/180*Math.PI,c=e.getModel("axisLine"),f=c.get("roundCap"),v=f?uv:Fe,d=c.get("show"),p=c.getModel("lineStyle"),g=p.get("width"),y=[u,h];a_(y,!l),u=y[0],h=y[1];for(var m=h-u,_=u,x=[],b=0;d&&b=M&&(C===0?0:a[C-1][0])Math.PI/2&&(K+=Math.PI)):q==="tangential"?K=-T-Math.PI/2:Mt(q)&&(K=q*Math.PI/180),K===0?c.add(new St({style:Gt(_,{text:B,x:H,y:W,verticalAlign:k<-.8?"top":k>.8?"bottom":"middle",align:P<-.4?"left":P>.4?"right":"center"},{inheritColor:G}),silent:!0})):c.add(new St({style:Gt(_,{text:B,x:H,y:W,verticalAlign:"middle",align:"center"},{inheritColor:G}),silent:!0,originX:H,originY:W,rotation:K}))}if(m.get("show")&&R!==x){var N=m.get("distance");N=N?N+h:h;for(var nt=0;nt<=b;nt++){P=Math.cos(T),k=Math.sin(T);var Ct=new ce({shape:{x1:P*(d-N)+f,y1:k*(d-N)+v,x2:P*(d-w-N)+f,y2:k*(d-w-N)+v},silent:!0,style:L});L.stroke==="auto"&&Ct.setStyle({stroke:a((R+nt/b)/x)}),c.add(Ct),T+=C}T-=C}else T+=M}},t.prototype._renderPointer=function(e,i,n,a,o,s,l,u,h){var c=this.group,f=this._data,v=this._progressEls,d=[],p=e.get(["pointer","show"]),g=e.getModel("progress"),y=g.get("show"),m=e.getData(),_=m.mapDimension("value"),x=+e.get("min"),b=+e.get("max"),S=[x,b],w=[s,l];function T(C,D){var L=m.getItemModel(C),I=L.getModel("pointer"),P=U(I.get("width"),o.r),k=U(I.get("length"),o.r),R=e.get(["pointer","icon"]),N=I.get("offsetCenter"),O=U(N[0],o.r),B=U(N[1],o.r),G=I.get("keepAspect"),H;return R?H=ae(R,O-P/2,B-k,P,k,null,G):H=new lX({shape:{angle:-Math.PI/2,width:P,r:k,x:O,y:B}}),H.rotation=-(D+Math.PI/2),H.x=o.cx,H.y=o.cy,H}function M(C,D){var L=g.get("roundCap"),I=L?uv:Fe,P=g.get("overlap"),k=P?g.get("width"):h/m.count(),R=P?o.r-k:o.r-(C+1)*k,N=P?o.r:o.r-C*k,O=new I({shape:{startAngle:s,endAngle:D,cx:o.cx,cy:o.cy,clockwise:u,r0:R,r:N}});return P&&(O.z2=Pt(m.get(_,C),[x,b],[100,0],!0)),O}(y||p)&&(m.diff(f).add(function(C){var D=m.get(_,C);if(p){var L=T(C,s);$t(L,{rotation:-((isNaN(+D)?w[0]:Pt(D,S,w,!0))+Math.PI/2)},e),c.add(L),m.setItemGraphicEl(C,L)}if(y){var I=M(C,s),P=g.get("clip");$t(I,{shape:{endAngle:Pt(D,S,w,P)}},e),c.add(I),im(e.seriesIndex,m.dataType,C,I),d[C]=I}}).update(function(C,D){var L=m.get(_,C);if(p){var I=f.getItemGraphicEl(D),P=I?I.rotation:s,k=T(C,P);k.rotation=P,At(k,{rotation:-((isNaN(+L)?w[0]:Pt(L,S,w,!0))+Math.PI/2)},e),c.add(k),m.setItemGraphicEl(C,k)}if(y){var R=v[D],N=R?R.shape.endAngle:s,O=M(C,N),B=g.get("clip");At(O,{shape:{endAngle:Pt(L,S,w,B)}},e),c.add(O),im(e.seriesIndex,m.dataType,C,O),d[C]=O}}).execute(),m.each(function(C){var D=m.getItemModel(C),L=D.getModel("emphasis"),I=L.get("focus"),P=L.get("blurScope"),k=L.get("disabled");if(p){var R=m.getItemGraphicEl(C),N=m.getItemVisual(C,"style"),O=N.fill;if(R instanceof xe){var B=R.style;R.useStyle(z({image:B.image,x:B.x,y:B.y,width:B.width,height:B.height},N))}else R.useStyle(N),R.type!=="pointer"&&R.setColor(O);R.setStyle(D.getModel(["pointer","itemStyle"]).getItemStyle()),R.style.fill==="auto"&&R.setStyle("fill",a(Pt(m.get(_,C),S,[0,1],!0))),R.z2EmphasisLift=0,Ce(R,D),Kt(R,I,P,k)}if(y){var G=d[C];G.useStyle(m.getItemVisual(C,"style")),G.setStyle(D.getModel(["progress","itemStyle"]).getItemStyle()),G.z2EmphasisLift=0,Ce(G,D),Kt(G,I,P,k)}}),this._progressEls=d)},t.prototype._renderAnchor=function(e,i){var n=e.getModel("anchor"),a=n.get("show");if(a){var o=n.get("size"),s=n.get("icon"),l=n.get("offsetCenter"),u=n.get("keepAspect"),h=ae(s,i.cx-o/2+U(l[0],i.r),i.cy-o/2+U(l[1],i.r),o,o,null,u);h.z2=n.get("showAbove")?1:0,h.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(h)}},t.prototype._renderTitleAndDetail=function(e,i,n,a,o){var s=this,l=e.getData(),u=l.mapDimension("value"),h=+e.get("min"),c=+e.get("max"),f=new at,v=[],d=[],p=e.isAnimationEnabled(),g=e.get(["pointer","showAbove"]);l.diff(this._data).add(function(y){v[y]=new St({silent:!0}),d[y]=new St({silent:!0})}).update(function(y,m){v[y]=s._titleEls[m],d[y]=s._detailEls[m]}).execute(),l.each(function(y){var m=l.getItemModel(y),_=l.get(u,y),x=new at,b=a(Pt(_,[h,c],[0,1],!0)),S=m.getModel("title");if(S.get("show")){var w=S.get("offsetCenter"),T=o.cx+U(w[0],o.r),M=o.cy+U(w[1],o.r),C=v[y];C.attr({z2:g?0:2,style:Gt(S,{x:T,y:M,text:l.getName(y),align:"center",verticalAlign:"middle"},{inheritColor:b})}),x.add(C)}var D=m.getModel("detail");if(D.get("show")){var L=D.get("offsetCenter"),I=o.cx+U(L[0],o.r),P=o.cy+U(L[1],o.r),k=U(D.get("width"),o.r),R=U(D.get("height"),o.r),N=e.get(["progress","show"])?l.getItemVisual(y,"style").fill:b,C=d[y],O=D.get("formatter");C.attr({z2:g?0:2,style:Gt(D,{x:I,y:P,text:Ec(_,O),width:isNaN(k)?null:k,height:isNaN(R)?null:R,align:"center",verticalAlign:"middle"},{inheritColor:N})}),fI(C,{normal:D},_,function(G){return Ec(G,O)}),p&&vI(C,y,l,e,{getFormattedLabel:function(G,H,W,q,K,nt){return Ec(nt?nt.interpolatedValue:_,O)}}),x.add(C)}f.add(x)}),this.group.add(f),this._titleEls=v,this._detailEls=d},t.type="gauge",t}(Ot),cX=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.visualStyleAccessPath="itemStyle",e}return t.prototype.getInitialData=function(e,i){return Qs(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(zt);function fX(r){r.registerChartView(hX),r.registerSeriesModel(cX)}var vX=["itemStyle","opacity"],dX=function(r){E(t,r);function t(e,i){var n=r.call(this)||this,a=n,o=new We,s=new St;return a.setTextContent(s),n.setTextGuideLine(o),n.updateData(e,i,!0),n}return t.prototype.updateData=function(e,i,n){var a=this,o=e.hostModel,s=e.getItemModel(i),l=e.getItemLayout(i),u=s.getModel("emphasis"),h=s.get(vX);h=h??1,n||ri(a),a.useStyle(e.getItemVisual(i,"style")),a.style.lineJoin="round",n?(a.setShape({points:l.points}),a.style.opacity=0,$t(a,{style:{opacity:h}},o,i)):At(a,{style:{opacity:h},shape:{points:l.points}},o,i),Ce(a,s),this._updateLabel(e,i),Kt(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},t.prototype._updateLabel=function(e,i){var n=this,a=this.getTextGuideLine(),o=n.getTextContent(),s=e.hostModel,l=e.getItemModel(i),u=e.getItemLayout(i),h=u.label,c=e.getItemVisual(i,"style"),f=c.fill;Ae(o,me(l),{labelFetcher:e.hostModel,labelDataIndex:i,defaultOpacity:c.opacity,defaultText:e.getName(i)},{normal:{align:h.textAlign,verticalAlign:h.verticalAlign}}),n.setTextConfig({local:!0,inside:!!h.inside,insideStroke:f,outsideFill:f});var v=h.linePoints;a.setShape({points:v}),n.textGuideLineConfig={anchor:v?new ct(v[0][0],v[0][1]):null},At(o,{style:{x:h.x,y:h.y}},s,i),o.attr({rotation:h.rotation,originX:h.x,originY:h.y,z2:10}),tx(n,ex(l),{stroke:f})},t}(Ge),pX=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.ignoreLabelLineUpdate=!0,e}return t.prototype.render=function(e,i,n){var a=e.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var u=new dX(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var h=o.getItemGraphicEl(u);h.updateData(a,l),s.add(h),a.setItemGraphicEl(l,h)}).remove(function(l){var u=o.getItemGraphicEl(l);Vu(u,e,l)}).execute(),this._data=a},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type="funnel",t}(Ot),gX=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.init=function(e){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new Ah($(this.getData,this),$(this.getRawData,this)),this._defaultLabelLine(e)},t.prototype.getInitialData=function(e,i){return Qs(this,{coordDimensions:["value"],encodeDefaulter:ut(D_,this)})},t.prototype._defaultLabelLine=function(e){co(e,"labelLine",["show"]);var i=e.labelLine,n=e.emphasis.labelLine;i.show=i.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.prototype.getDataParams=function(e){var i=this.getData(),n=r.prototype.getDataParams.call(this,e),a=i.mapDimension("value"),o=i.getSum(a);return n.percent=o?+(i.get(a,e)/o*100).toFixed(2):0,n.$vars.push("percent"),n},t.type="series.funnel",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t}(zt);function yX(r,t){return ue(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function mX(r,t){for(var e=r.mapDimension("value"),i=r.mapArray(e,function(l){return l}),n=[],a=t==="ascending",o=0,s=r.count();oEX)return;var n=this._model.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX,r.offsetY]);n.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:n.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(r){if(!(this._mouseDownPoint||!Pg(this,"mousemove"))){var t=this._model,e=t.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX,r.offsetY]),i=e.behavior;i==="jump"&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand(i==="none"?null:{axisExpandWindow:e.axisExpandWindow,animation:i==="jump"?null:{duration:0}})}}};function Pg(r,t){var e=r._model;return e.get("axisExpandable")&&e.get("axisExpandTriggerOn")===t}var BX=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.init=function(){r.prototype.init.apply(this,arguments),this.mergeOption({})},t.prototype.mergeOption=function(e){var i=this.option;e&&ht(i,e,!0),this._initDimensions()},t.prototype.contains=function(e,i){var n=e.get("parallelIndex");return n!=null&&i.getComponent("parallel",n)===this},t.prototype.setAxisExpand=function(e){A(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(i){e.hasOwnProperty(i)&&(this.option[i]=e[i])},this)},t.prototype._initDimensions=function(){var e=this.dimensions=[],i=this.parallelAxisIndex=[],n=Dt(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);A(n,function(a){e.push("dim"+a.get("dim")),i.push(a.componentIndex)})},t.type="parallel",t.dependencies=["parallelAxis"],t.layoutMode="box",t.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},t}(yt),zX=function(r){E(t,r);function t(e,i,n,a,o){var s=r.call(this,e,i,n)||this;return s.type=a||"value",s.axisIndex=o,s}return t.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},t}(Br);function Do(r,t,e,i,n,a){r=r||0;var o=e[1]-e[0];if(n!=null&&(n=Zo(n,[0,o])),a!=null&&(a=Math.max(a,n??0)),i==="all"){var s=Math.abs(t[1]-t[0]);s=Zo(s,[0,o]),n=a=Zo(s,[n,a]),i=0}t[0]=Zo(t[0],e),t[1]=Zo(t[1],e);var l=kg(t,i);t[i]+=r;var u=n||0,h=e.slice();l.sign<0?h[0]+=u:h[1]-=u,t[i]=Zo(t[i],h);var c;return c=kg(t,i),n!=null&&(c.sign!==l.sign||c.spana&&(t[1-i]=t[i]+c.sign*a),t}function kg(r,t){var e=r[t]-r[1-t];return{span:Math.abs(e),sign:e>0?-1:e<0?1:t?-1:1}}function Zo(r,t){return Math.min(t[1]!=null?t[1]:1/0,Math.max(t[0]!=null?t[0]:-1/0,r))}var Rg=A,FR=Math.min,GR=Math.max,rC=Math.floor,VX=Math.ceil,iC=Qt,FX=Math.PI,GX=function(){function r(t,e,i){this.type="parallel",this._axesMap=Z(),this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,e,i)}return r.prototype._init=function(t,e,i){var n=t.dimensions,a=t.parallelAxisIndex;Rg(n,function(o,s){var l=a[s],u=e.getComponent("parallelAxis",l),h=this._axesMap.set(o,new zX(o,bh(u),[0,0],u.get("type"),l)),c=h.type==="category";h.onBand=c&&u.get("boundaryGap"),h.inverse=u.get("inverse"),u.axis=h,h.model=u,h.coordinateSystem=u.coordinateSystem=this},this)},r.prototype.update=function(t,e){this._updateAxesFromSeries(this._model,t)},r.prototype.containPoint=function(t){var e=this._makeLayoutInfo(),i=e.axisBase,n=e.layoutBase,a=e.pixelDimIndex,o=t[1-a],s=t[a];return o>=i&&o<=i+e.axisLength&&s>=n&&s<=n+e.layoutLength},r.prototype.getModel=function(){return this._model},r.prototype._updateAxesFromSeries=function(t,e){e.eachSeries(function(i){if(t.contains(i,e)){var n=i.getData();Rg(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(n,n.mapDimension(a)),yo(o.scale,o.model)},this)}},this)},r.prototype.resize=function(t,e){this._rect=ue(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},r.prototype.getRect=function(){return this._rect},r.prototype._makeLayoutInfo=function(){var t=this._model,e=this._rect,i=["x","y"],n=["width","height"],a=t.get("layout"),o=a==="horizontal"?0:1,s=e[n[o]],l=[0,s],u=this.dimensions.length,h=Oc(t.get("axisExpandWidth"),l),c=Oc(t.get("axisExpandCount")||0,[0,u]),f=t.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,v=t.get("axisExpandWindow"),d;if(v)d=Oc(v[1]-v[0],l),v[1]=v[0]+d;else{d=Oc(h*(c-1),l);var p=t.get("axisExpandCenter")||rC(u/2);v=[h*p-d/2],v[1]=v[0]+d}var g=(s-d)/(u-c);g<3&&(g=0);var y=[rC(iC(v[0]/h,1))+1,VX(iC(v[1]/h,1))-1],m=g/h*v[0];return{layout:a,pixelDimIndex:o,layoutBase:e[i[o]],layoutLength:s,axisBase:e[i[1-o]],axisLength:e[n[1-o]],axisExpandable:f,axisExpandWidth:h,axisCollapseWidth:g,axisExpandWindow:v,axisCount:u,winInnerIndices:y,axisExpandWindow0Pos:m}},r.prototype._layoutAxes=function(){var t=this._rect,e=this._axesMap,i=this.dimensions,n=this._makeLayoutInfo(),a=n.layout;e.each(function(o){var s=[0,n.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),Rg(i,function(o,s){var l=(n.axisExpandable?WX:HX)(s,n),u={horizontal:{x:l.position,y:n.axisLength},vertical:{x:0,y:l.position}},h={horizontal:FX/2,vertical:0},c=[u[a].x+t.x,u[a].y+t.y],f=h[a],v=or();Qn(v,v,f),ti(v,v,c),this._axesLayout[o]={position:c,rotation:f,transform:v,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},r.prototype.getAxis=function(t){return this._axesMap.get(t)},r.prototype.dataToPoint=function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},r.prototype.eachActiveState=function(t,e,i,n){i==null&&(i=0),n==null&&(n=t.count());var a=this._axesMap,o=this.dimensions,s=[],l=[];A(o,function(g){s.push(t.mapDimension(g)),l.push(a.get(g).model)});for(var u=this.hasAxisBrushed(),h=i;ha*(1-c[0])?(u="jump",l=s-a*(1-c[2])):(l=s-a*c[1])>=0&&(l=s-a*(1-c[1]))<=0&&(l=0),l*=e.axisExpandWidth/h,l?Do(l,n,o,"all"):u="none";else{var v=n[1]-n[0],d=o[1]*s/v;n=[GR(0,d-v/2)],n[1]=FR(o[1],n[0]+v),n[0]=n[1]-v}return{axisExpandWindow:n,behavior:u}},r}();function Oc(r,t){return FR(GR(r,t[0]),t[1])}function HX(r,t){var e=t.layoutLength/(t.axisCount-1);return{position:e*r,axisNameAvailableWidth:e,axisLabelShow:!0}}function WX(r,t){var e=t.layoutLength,i=t.axisExpandWidth,n=t.axisCount,a=t.axisCollapseWidth,o=t.winInnerIndices,s,l=a,u=!1,h;return r=0;n--)fr(i[n])},t.prototype.getActiveState=function(e){var i=this.activeIntervals;if(!i.length)return"normal";if(e==null||isNaN(+e))return"inactive";if(i.length===1){var n=i[0];if(n[0]<=e&&e<=n[1])return"active"}else for(var a=0,o=i.length;aZX}function XR(r){var t=r.length-1;return t<0&&(t=0),[r[0],r[t]]}function ZR(r,t,e,i){var n=new at;return n.add(new wt({name:"main",style:Lx(e),silent:!0,draggable:!0,cursor:"move",drift:ut(oC,r,t,n,["n","s","w","e"]),ondragend:ut(_o,t,{isEnd:!0})})),A(i,function(a){n.add(new wt({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:ut(oC,r,t,n,a),ondragend:ut(_o,t,{isEnd:!0})}))}),n}function jR(r,t,e,i){var n=i.brushStyle.lineWidth||0,a=Ps(n,jX),o=e[0][0],s=e[1][0],l=o-n/2,u=s-n/2,h=e[0][1],c=e[1][1],f=h-a+n/2,v=c-a+n/2,d=h-o,p=c-s,g=d+n,y=p+n;Ei(r,t,"main",o,s,d,p),i.transformable&&(Ei(r,t,"w",l,u,a,y),Ei(r,t,"e",f,u,a,y),Ei(r,t,"n",l,u,g,a),Ei(r,t,"s",l,v,g,a),Ei(r,t,"nw",l,u,a,a),Ei(r,t,"ne",f,u,a,a),Ei(r,t,"sw",l,v,a,a),Ei(r,t,"se",f,v,a,a))}function qm(r,t){var e=t.__brushOption,i=e.transformable,n=t.childAt(0);n.useStyle(Lx(e)),n.attr({silent:!i,cursor:i?"move":"default"}),A([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=t.childOfName(a.join("")),s=a.length===1?Km(r,a[0]):eZ(r,a);o&&o.attr({silent:!i,invisible:!i,cursor:i?KX[s]+"-resize":null})})}function Ei(r,t,e,i,n,a,o){var s=t.childOfName(e);s&&s.setShape(iZ(Ix(r,t,[[i,n],[i+a,n+o]])))}function Lx(r){return tt({strokeNoScale:!0},r.brushStyle)}function qR(r,t,e,i){var n=[eh(r,e),eh(t,i)],a=[Ps(r,e),Ps(t,i)];return[[n[0],a[0]],[n[1],a[1]]]}function tZ(r){return zn(r.group)}function Km(r,t){var e={w:"left",e:"right",n:"top",s:"bottom"},i={left:"w",right:"e",top:"n",bottom:"s"},n=ed(e[t],tZ(r));return i[n]}function eZ(r,t){var e=[Km(r,t[0]),Km(r,t[1])];return(e[0]==="e"||e[0]==="w")&&e.reverse(),e.join("")}function oC(r,t,e,i,n,a){var o=e.__brushOption,s=r.toRectRange(o.range),l=KR(t,n,a);A(i,function(u){var h=qX[u];s[h[0]][h[1]]+=l[h[0]]}),o.range=r.fromRectRange(qR(s[0][0],s[1][0],s[0][1],s[1][1])),Cx(t,e),_o(t,{isEnd:!1})}function rZ(r,t,e,i){var n=t.__brushOption.range,a=KR(r,e,i);A(n,function(o){o[0]+=a[0],o[1]+=a[1]}),Cx(r,t),_o(r,{isEnd:!1})}function KR(r,t,e){var i=r.group,n=i.transformCoordToLocal(t,e),a=i.transformCoordToLocal(0,0);return[n[0]-a[0],n[1]-a[1]]}function Ix(r,t,e){var i=$R(r,t);return i&&i!==mo?i.clipPath(e,r._transform):it(e)}function iZ(r){var t=eh(r[0][0],r[1][0]),e=eh(r[0][1],r[1][1]),i=Ps(r[0][0],r[1][0]),n=Ps(r[0][1],r[1][1]);return{x:t,y:e,width:i-t,height:n-e}}function nZ(r,t,e){if(!(!r._brushType||oZ(r,t.offsetX,t.offsetY))){var i=r._zr,n=r._covers,a=Dx(r,t,e);if(!r._dragging)for(var o=0;oi.getWidth()||e<0||e>i.getHeight()}var wd={lineX:uC(0),lineY:uC(1),rect:{createCover:function(r,t){function e(i){return i}return ZR({toRectRange:e,fromRectRange:e},r,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(r){var t=XR(r);return qR(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(r,t,e,i){jR(r,t,e,i)},updateCommon:qm,contain:Qm},polygon:{createCover:function(r,t){var e=new at;return e.add(new We({name:"main",style:Lx(t),silent:!0})),e},getCreatingRange:function(r){return r},endCreating:function(r,t){t.remove(t.childAt(0)),t.add(new Ge({name:"main",draggable:!0,drift:ut(rZ,r,t),ondragend:ut(_o,r,{isEnd:!0})}))},updateCoverShape:function(r,t,e,i){t.childAt(0).setShape({points:Ix(r,t,e)})},updateCommon:qm,contain:Qm}};function uC(r){return{createCover:function(t,e){return ZR({toRectRange:function(i){var n=[i,[0,100]];return r&&n.reverse(),n},fromRectRange:function(i){return i[r]}},t,e,[[["w"],["e"]],[["n"],["s"]]][r])},getCreatingRange:function(t){var e=XR(t),i=eh(e[0][r],e[1][r]),n=Ps(e[0][r],e[1][r]);return[i,n]},updateCoverShape:function(t,e,i,n){var a,o=$R(t,e);if(o!==mo&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(r);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-r]]}var l=[i,a];r&&l.reverse(),jR(t,e,l,n)},updateCommon:qm,contain:Qm}}function QR(r){return r=Px(r),function(t){return g_(t,r)}}function tE(r,t){return r=Px(r),function(e){var i=t??e,n=i?r.width:r.height,a=i?r.x:r.y;return[a,a+(n||0)]}}function eE(r,t,e){var i=Px(r);return function(n,a){return i.contain(a[0],a[1])&&!_d(n,t,e)}}function Px(r){return ft.create(r)}var sZ=["axisLine","axisTickLabel","axisName"],lZ=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.init=function(e,i){r.prototype.init.apply(this,arguments),(this._brushController=new Mx(i.getZr())).on("brush",$(this._onBrush,this))},t.prototype.render=function(e,i,n,a){if(!uZ(e,i,a)){this.axisModel=e,this.api=n,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new at,this.group.add(this._axisGroup),!!e.get("show")){var s=cZ(e,i),l=s.coordinateSystem,u=e.getAreaSelectStyle(),h=u.width,c=e.axis.dim,f=l.getAxisLayout(c),v=z({strokeContainThreshold:h},f),d=new je(e,v);A(sZ,d.add,d),this._axisGroup.add(d.getGroup()),this._refreshBrushController(v,u,e,s,h,n),mh(o,this._axisGroup,e)}}},t.prototype._refreshBrushController=function(e,i,n,a,o,s){var l=n.axis.getExtent(),u=l[1]-l[0],h=Math.min(30,Math.abs(u)*.1),c=ft.create({x:l[0],y:-o/2,width:u,height:o});c.x-=h,c.width+=2*h,this._brushController.mount({enableGlobalPan:!0,rotation:e.rotation,x:e.position[0],y:e.position[1]}).setPanels([{panelId:"pl",clipPath:QR(c),isTargetByCursor:eE(c,s,a),getLinearBrushOtherExtent:tE(c,0)}]).enableBrush({brushType:"lineX",brushStyle:i,removeOnClick:!0}).updateCovers(hZ(n))},t.prototype._onBrush=function(e){var i=e.areas,n=this.axisModel,a=n.axis,o=F(i,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!n.option.realtime===e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:o})},t.prototype.dispose=function(){this._brushController.dispose()},t.type="parallelAxis",t}(Yt);function uZ(r,t,e){return e&&e.type==="axisAreaSelect"&&t.findComponents({mainType:"parallelAxis",query:e})[0]===r}function hZ(r){var t=r.axis;return F(r.activeIntervals,function(e){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(e[0],!0),t.dataToCoord(e[1],!0)]}})}function cZ(r,t){return t.getComponent("parallel",r.get("parallelIndex"))}var fZ={type:"axisAreaSelect",event:"axisAreaSelected"};function vZ(r){r.registerAction(fZ,function(t,e){e.eachComponent({mainType:"parallelAxis",query:t},function(i){i.axis.model.setActiveIntervals(t.intervals)})}),r.registerAction("parallelAxisExpand",function(t,e){e.eachComponent({mainType:"parallel",query:t},function(i){i.setAxisExpand(t)})})}var dZ={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function rE(r){r.registerComponentView(OX),r.registerComponentModel(BX),r.registerCoordinateSystem("parallel",YX),r.registerPreprocessor(PX),r.registerComponentModel(Zm),r.registerComponentView(lZ),Is(r,"parallel",Zm,dZ),vZ(r)}function pZ(r){pt(rE),r.registerChartView(wX),r.registerSeriesModel(CX),r.registerVisual(r.PRIORITY.VISUAL.BRUSH,IX)}var gZ=function(){function r(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return r}(),yZ=function(r){E(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new gZ},t.prototype.buildPath=function(e,i){var n=i.extent;e.moveTo(i.x1,i.y1),e.bezierCurveTo(i.cpx1,i.cpy1,i.cpx2,i.cpy2,i.x2,i.y2),i.orient==="vertical"?(e.lineTo(i.x2+n,i.y2),e.bezierCurveTo(i.cpx2+n,i.cpy2,i.cpx1+n,i.cpy1,i.x1+n,i.y1)):(e.lineTo(i.x2,i.y2+n),e.bezierCurveTo(i.cpx2,i.cpy2+n,i.cpx1,i.cpy1+n,i.x1,i.y1+n)),e.closePath()},t.prototype.highlight=function(){Ki(this)},t.prototype.downplay=function(){Ji(this)},t}(_t),mZ=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e._focusAdjacencyDisabled=!1,e}return t.prototype.render=function(e,i,n){var a=this,o=e.getGraph(),s=this.group,l=e.layoutInfo,u=l.width,h=l.height,c=e.getData(),f=e.getData("edge"),v=e.get("orient");this._model=e,s.removeAll(),s.x=l.x,s.y=l.y,o.eachEdge(function(d){var p=new yZ,g=ot(p);g.dataIndex=d.dataIndex,g.seriesIndex=e.seriesIndex,g.dataType="edge";var y=d.getModel(),m=y.getModel("lineStyle"),_=m.get("curveness"),x=d.node1.getLayout(),b=d.node1.getModel(),S=b.get("localX"),w=b.get("localY"),T=d.node2.getLayout(),M=d.node2.getModel(),C=M.get("localX"),D=M.get("localY"),L=d.getLayout(),I,P,k,R,N,O,B,G;p.shape.extent=Math.max(1,L.dy),p.shape.orient=v,v==="vertical"?(I=(S!=null?S*u:x.x)+L.sy,P=(w!=null?w*h:x.y)+x.dy,k=(C!=null?C*u:T.x)+L.ty,R=D!=null?D*h:T.y,N=I,O=P*(1-_)+R*_,B=k,G=P*_+R*(1-_)):(I=(S!=null?S*u:x.x)+x.dx,P=(w!=null?w*h:x.y)+L.sy,k=C!=null?C*u:T.x,R=(D!=null?D*h:T.y)+L.ty,N=I*(1-_)+k*_,O=P,B=I*_+k*(1-_),G=R),p.setShape({x1:I,y1:P,x2:k,y2:R,cpx1:N,cpy1:O,cpx2:B,cpy2:G}),p.useStyle(m.getItemStyle()),hC(p.style,v,d);var H=""+y.get("value"),W=me(y,"edgeLabel");Ae(p,W,{labelFetcher:{getFormattedLabel:function(nt,Ct,te,dt,rt,gt){return e.getFormattedLabel(nt,Ct,"edge",dt,jr(rt,W.normal&&W.normal.get("formatter"),H),gt)}},labelDataIndex:d.dataIndex,defaultText:H}),p.setTextConfig({position:"inside"});var q=y.getModel("emphasis");Ce(p,y,"lineStyle",function(nt){var Ct=nt.getItemStyle();return hC(Ct,v,d),Ct}),s.add(p),f.setItemGraphicEl(d.dataIndex,p);var K=q.get("focus");Kt(p,K==="adjacency"?d.getAdjacentDataIndices():K==="trajectory"?d.getTrajectoryDataIndices():K,q.get("blurScope"),q.get("disabled"))}),o.eachNode(function(d){var p=d.getLayout(),g=d.getModel(),y=g.get("localX"),m=g.get("localY"),_=g.getModel("emphasis"),x=g.get(["itemStyle","borderRadius"])||0,b=new wt({shape:{x:y!=null?y*u:p.x,y:m!=null?m*h:p.y,width:p.dx,height:p.dy,r:x},style:g.getModel("itemStyle").getItemStyle(),z2:10});Ae(b,me(g),{labelFetcher:{getFormattedLabel:function(w,T){return e.getFormattedLabel(w,T,"node")}},labelDataIndex:d.dataIndex,defaultText:d.id}),b.disableLabelAnimation=!0,b.setStyle("fill",d.getVisual("color")),b.setStyle("decal",d.getVisual("style").decal),Ce(b,g),s.add(b),c.setItemGraphicEl(d.dataIndex,b),ot(b).dataType="node";var S=_.get("focus");Kt(b,S==="adjacency"?d.getAdjacentDataIndices():S==="trajectory"?d.getTrajectoryDataIndices():S,_.get("blurScope"),_.get("disabled"))}),c.eachItemGraphicEl(function(d,p){var g=c.getItemModel(p);g.get("draggable")&&(d.drift=function(y,m){a._focusAdjacencyDisabled=!0,this.shape.x+=y,this.shape.y+=m,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:e.id,dataIndex:c.getRawIndex(p),localX:this.shape.x/u,localY:this.shape.y/h})},d.ondragend=function(){a._focusAdjacencyDisabled=!1},d.draggable=!0,d.cursor="move")}),!this._data&&e.isAnimationEnabled()&&s.setClipPath(_Z(s.getBoundingRect(),e,function(){s.removeClipPath()})),this._data=e.getData()},t.prototype.dispose=function(){},t.type="sankey",t}(Ot);function hC(r,t,e){switch(r.fill){case"source":r.fill=e.node1.getVisual("color"),r.decal=e.node1.getVisual("style").decal;break;case"target":r.fill=e.node2.getVisual("color"),r.decal=e.node2.getVisual("style").decal;break;case"gradient":var i=e.node1.getVisual("color"),n=e.node2.getVisual("color");Y(i)&&Y(n)&&(r.fill=new Vs(0,0,+(t==="horizontal"),+(t==="vertical"),[{color:i,offset:0},{color:n,offset:1}]))}}function _Z(r,t,e){var i=new wt({shape:{x:r.x-10,y:r.y-10,width:0,height:r.height+20}});return $t(i,{shape:{width:r.width+20}},t,e),i}var xZ=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.getInitialData=function(e,i){var n=e.edges||e.links||[],a=e.data||e.nodes||[],o=e.levels||[];this.levelModels=[];for(var s=this.levelModels,l=0;l=0&&(s[o[l].depth]=new Lt(o[l],this,i));var u=zR(a,n,this,!0,h);return u.data;function h(c,f){c.wrapMethod("getItemModel",function(v,d){var p=v.parentModel,g=p.getData().getItemLayout(d);if(g){var y=g.depth,m=p.levelModels[y];m&&(v.parentModel=m)}return v}),f.wrapMethod("getItemModel",function(v,d){var p=v.parentModel,g=p.getGraph().getEdgeByIndex(d),y=g.node1.getLayout();if(y){var m=y.depth,_=p.levelModels[m];_&&(v.parentModel=_)}return v})}},t.prototype.setNodePosition=function(e,i){var n=this.option.data||this.option.nodes,a=n[e];a.localX=i[0],a.localY=i[1]},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(e,i,n){function a(v){return isNaN(v)||v==null}if(n==="edge"){var o=this.getDataParams(e,n),s=o.data,l=o.value,u=s.source+" -- "+s.target;return _e("nameValue",{name:u,value:l,noValue:a(l)})}else{var h=this.getGraph().getNodeByIndex(e),c=h.getLayout().value,f=this.getDataParams(e,n).data.name;return _e("nameValue",{name:f!=null?f+"":null,value:c,noValue:a(c)})}},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(e,i){var n=r.prototype.getDataParams.call(this,e,i);if(n.value==null&&i==="node"){var a=this.getGraph().getNodeByIndex(e),o=a.getLayout().value;n.value=o}return n},t.type="series.sankey",t.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},t}(zt);function bZ(r,t){r.eachSeriesByType("sankey",function(e){var i=e.get("nodeWidth"),n=e.get("nodeGap"),a=SZ(e,t);e.layoutInfo=a;var o=a.width,s=a.height,l=e.getGraph(),u=l.nodes,h=l.edges;TZ(u);var c=Dt(u,function(p){return p.getLayout().value===0}),f=c.length!==0?0:e.get("layoutIterations"),v=e.get("orient"),d=e.get("nodeAlign");wZ(u,h,i,n,o,s,f,v,d)})}function SZ(r,t){return ue(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function wZ(r,t,e,i,n,a,o,s,l){MZ(r,t,e,n,a,s,l),LZ(r,t,a,n,i,o,s),zZ(r,s)}function TZ(r){A(r,function(t){var e=Gn(t.outEdges,pv),i=Gn(t.inEdges,pv),n=t.getValue()||0,a=Math.max(e,i,n);t.setLayout({value:a},!0)})}function MZ(r,t,e,i,n,a,o){for(var s=[],l=[],u=[],h=[],c=0,f=0;f=0;y&&g.depth>v&&(v=g.depth),p.setLayout({depth:y?g.depth:c},!0),a==="vertical"?p.setLayout({dy:e},!0):p.setLayout({dx:e},!0);for(var m=0;mc-1?v:c-1;o&&o!=="left"&&CZ(r,o,a,w);var T=a==="vertical"?(n-e)/w:(i-e)/w;DZ(r,T,a)}function iE(r){var t=r.hostGraph.data.getRawDataItem(r.dataIndex);return t.depth!=null&&t.depth>=0}function CZ(r,t,e,i){if(t==="right"){for(var n=[],a=r,o=0;a.length;){for(var s=0;s0;a--)l*=.99,kZ(s,l,o),Eg(s,n,e,i,o),BZ(s,l,o),Eg(s,n,e,i,o)}function IZ(r,t){var e=[],i=t==="vertical"?"y":"x",n=Qy(r,function(a){return a.getLayout()[i]});return n.keys.sort(function(a,o){return a-o}),A(n.keys,function(a){e.push(n.buckets.get(a))}),e}function PZ(r,t,e,i,n,a){var o=1/0;A(r,function(s){var l=s.length,u=0;A(s,function(c){u+=c.getLayout().value});var h=a==="vertical"?(i-(l-1)*n)/u:(e-(l-1)*n)/u;h0&&(s=l.getLayout()[a]+u,n==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),h=l.getLayout()[a]+l.getLayout()[f]+t;var d=n==="vertical"?i:e;if(u=h-t-d,u>0){s=l.getLayout()[a]-u,n==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),h=s;for(var v=c-2;v>=0;--v)l=o[v],u=l.getLayout()[a]+l.getLayout()[f]+t-h,u>0&&(s=l.getLayout()[a]-u,n==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),h=l.getLayout()[a]}})}function kZ(r,t,e){A(r.slice().reverse(),function(i){A(i,function(n){if(n.outEdges.length){var a=Gn(n.outEdges,RZ,e)/Gn(n.outEdges,pv);if(isNaN(a)){var o=n.outEdges.length;a=o?Gn(n.outEdges,EZ,e)/o:0}if(e==="vertical"){var s=n.getLayout().x+(a-jn(n,e))*t;n.setLayout({x:s},!0)}else{var l=n.getLayout().y+(a-jn(n,e))*t;n.setLayout({y:l},!0)}}})})}function RZ(r,t){return jn(r.node2,t)*r.getValue()}function EZ(r,t){return jn(r.node2,t)}function OZ(r,t){return jn(r.node1,t)*r.getValue()}function NZ(r,t){return jn(r.node1,t)}function jn(r,t){return t==="vertical"?r.getLayout().x+r.getLayout().dx/2:r.getLayout().y+r.getLayout().dy/2}function pv(r){return r.getValue()}function Gn(r,t,e){for(var i=0,n=r.length,a=-1;++ao&&(o=l)}),A(i,function(s){var l=new ye({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:t.get("color")}),u=l.mapValueToVisual(s.getLayout().value),h=s.getModel().get(["itemStyle","color"]);h!=null?(s.setVisual("color",h),s.setVisual("style",{fill:h})):(s.setVisual("color",u),s.setVisual("style",{fill:u}))})}n.length&&A(n,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function FZ(r){r.registerChartView(mZ),r.registerSeriesModel(xZ),r.registerLayout(bZ),r.registerVisual(VZ),r.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(t,e){e.eachComponent({mainType:"series",subType:"sankey",query:t},function(i){i.setNodePosition(t.dataIndex,[t.localX,t.localY])})})}var nE=function(){function r(){}return r.prototype._hasEncodeRule=function(t){var e=this.getEncode();return e&&e.get(t)!=null},r.prototype.getInitialData=function(t,e){var i,n=e.getComponent("xAxis",this.get("xAxisIndex")),a=e.getComponent("yAxis",this.get("yAxisIndex")),o=n.get("type"),s=a.get("type"),l;o==="category"?(t.layout="horizontal",i=n.getOrdinalMeta(),l=!this._hasEncodeRule("x")):s==="category"?(t.layout="vertical",i=a.getOrdinalMeta(),l=!this._hasEncodeRule("y")):t.layout=t.layout||"horizontal";var u=["x","y"],h=t.layout==="horizontal"?0:1,c=this._baseAxisDim=u[h],f=u[1-h],v=[n,a],d=v[h].get("type"),p=v[1-h].get("type"),g=t.data;if(g&&l){var y=[];A(g,function(x,b){var S;V(x)?(S=x.slice(),x.unshift(b)):V(x.value)?(S=z({},x),S.value=S.value.slice(),x.value.unshift(b)):S=x,y.push(S)}),t.data=y}var m=this.defaultValueDimensions,_=[{name:c,type:nv(d),ordinalMeta:i,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:f,type:nv(p),dimsDef:m.slice()}];return Qs(this,{coordDimensions:_,dimensionsCount:m.length+1,encodeDefaulter:ut(kI,_,this)})},r.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},r}(),aE=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],e.visualDrawType="stroke",e}return t.type="series.boxplot",t.dependencies=["xAxis","yAxis","grid"],t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},t}(zt);re(aE,nE,!0);var GZ=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,i,n){var a=e.getData(),o=this.group,s=this._data;this._data||o.removeAll();var l=e.get("layout")==="horizontal"?1:0;a.diff(s).add(function(u){if(a.hasValue(u)){var h=a.getItemLayout(u),c=cC(h,a,u,l,!0);a.setItemGraphicEl(u,c),o.add(c)}}).update(function(u,h){var c=s.getItemGraphicEl(h);if(!a.hasValue(u)){o.remove(c);return}var f=a.getItemLayout(u);c?(ri(c),oE(f,c,a,u)):c=cC(f,a,u,l),o.add(c),a.setItemGraphicEl(u,c)}).remove(function(u){var h=s.getItemGraphicEl(u);h&&o.remove(h)}).execute(),this._data=a},t.prototype.remove=function(e){var i=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl(function(a){a&&i.remove(a)})},t.type="boxplot",t}(Ot),HZ=function(){function r(){}return r}(),WZ=function(r){E(t,r);function t(e){var i=r.call(this,e)||this;return i.type="boxplotBoxPath",i}return t.prototype.getDefaultShape=function(){return new HZ},t.prototype.buildPath=function(e,i){var n=i.points,a=0;for(e.moveTo(n[a][0],n[a][1]),a++;a<4;a++)e.lineTo(n[a][0],n[a][1]);for(e.closePath();ap){var x=[y,_];i.push(x)}}}return{boxData:e,outliers:i}}var qZ={type:"echarts:boxplot",transform:function(t){var e=t.upstream;if(e.sourceFormat!==He){var i="";kt(i)}var n=jZ(e.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:n.boxData},{data:n.outliers}]}};function KZ(r){r.registerSeriesModel(aE),r.registerChartView(GZ),r.registerLayout(YZ),r.registerTransform(qZ)}var JZ=["itemStyle","borderColor"],QZ=["itemStyle","borderColor0"],tj=["itemStyle","borderColorDoji"],ej=["itemStyle","color"],rj=["itemStyle","color0"];function kx(r,t){return t.get(r>0?ej:rj)}function Rx(r,t){return t.get(r===0?tj:r>0?JZ:QZ)}var ij={seriesType:"candlestick",plan:Xs(),performRawSeries:!0,reset:function(r,t){if(!t.isSeriesFiltered(r)){var e=r.pipelineContext.large;return!e&&{progress:function(i,n){for(var a;(a=i.next())!=null;){var o=n.getItemModel(a),s=n.getItemLayout(a).sign,l=o.getItemStyle();l.fill=kx(s,o),l.stroke=Rx(s,o)||l.fill;var u=n.ensureUniqueItemVisual(a,"style");z(u,l)}}}}}},nj=["color","borderColor"],aj=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,i,n){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(e),this._isLargeDraw?this._renderLarge(e):this._renderNormal(e)},t.prototype.incrementalPrepareRender=function(e,i,n){this._clear(),this._updateDrawMode(e)},t.prototype.incrementalRender=function(e,i,n,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(e,i):this._incrementalRenderNormal(e,i)},t.prototype.eachRendered=function(e){ta(this._progressiveEls||this.group,e)},t.prototype._updateDrawMode=function(e){var i=e.pipelineContext.large;(this._isLargeDraw==null||i!==this._isLargeDraw)&&(this._isLargeDraw=i,this._clear())},t.prototype._renderNormal=function(e){var i=e.getData(),n=this._data,a=this.group,o=i.getLayout("isSimpleBox"),s=e.get("clip",!0),l=e.coordinateSystem,u=l.getArea&&l.getArea();this._data||a.removeAll(),i.diff(n).add(function(h){if(i.hasValue(h)){var c=i.getItemLayout(h);if(s&&fC(u,c))return;var f=Og(c,h,!0);$t(f,{shape:{points:c.ends}},e,h),Ng(f,i,h,o),a.add(f),i.setItemGraphicEl(h,f)}}).update(function(h,c){var f=n.getItemGraphicEl(c);if(!i.hasValue(h)){a.remove(f);return}var v=i.getItemLayout(h);if(s&&fC(u,v)){a.remove(f);return}f?(At(f,{shape:{points:v.ends}},e,h),ri(f)):f=Og(v),Ng(f,i,h,o),a.add(f),i.setItemGraphicEl(h,f)}).remove(function(h){var c=n.getItemGraphicEl(h);c&&a.remove(c)}).execute(),this._data=i},t.prototype._renderLarge=function(e){this._clear(),vC(e,this.group);var i=e.get("clip",!0)?Th(e.coordinateSystem,!1,e):null;i?this.group.setClipPath(i):this.group.removeClipPath()},t.prototype._incrementalRenderNormal=function(e,i){for(var n=i.getData(),a=n.getLayout("isSimpleBox"),o;(o=e.next())!=null;){var s=n.getItemLayout(o),l=Og(s);Ng(l,n,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},t.prototype._incrementalRenderLarge=function(e,i){vC(i,this.group,this._progressiveEls,!0)},t.prototype.remove=function(e){this._clear()},t.prototype._clear=function(){this.group.removeAll(),this._data=null},t.type="candlestick",t}(Ot),oj=function(){function r(){}return r}(),sj=function(r){E(t,r);function t(e){var i=r.call(this,e)||this;return i.type="normalCandlestickBox",i}return t.prototype.getDefaultShape=function(){return new oj},t.prototype.buildPath=function(e,i){var n=i.points;this.__simpleBox?(e.moveTo(n[4][0],n[4][1]),e.lineTo(n[6][0],n[6][1])):(e.moveTo(n[0][0],n[0][1]),e.lineTo(n[1][0],n[1][1]),e.lineTo(n[2][0],n[2][1]),e.lineTo(n[3][0],n[3][1]),e.closePath(),e.moveTo(n[4][0],n[4][1]),e.lineTo(n[5][0],n[5][1]),e.moveTo(n[6][0],n[6][1]),e.lineTo(n[7][0],n[7][1]))},t}(_t);function Og(r,t,e){var i=r.ends;return new sj({shape:{points:e?lj(i,r):i},z2:100})}function fC(r,t){for(var e=!0,i=0;ib?D[a]:C[a],ends:P,brushRect:B(S,w,_)})}function N(H,W){var q=[];return q[n]=W,q[a]=H,isNaN(W)||isNaN(H)?[NaN,NaN]:t.dataToPoint(q)}function O(H,W,q){var K=W.slice(),nt=W.slice();K[n]=hf(K[n]+i/2,1,!1),nt[n]=hf(nt[n]-i/2,1,!0),q?H.push(K,nt):H.push(nt,K)}function B(H,W,q){var K=N(H,q),nt=N(W,q);return K[n]-=i/2,nt[n]-=i/2,{x:K[0],y:K[1],width:i,height:nt[1]-K[1]}}function G(H){return H[n]=hf(H[n],1),H}}function d(p,g){for(var y=yi(p.count*4),m=0,_,x=[],b=[],S,w=g.getStore(),T=!!r.get(["itemStyle","borderColorDoji"]);(S=p.next())!=null;){var M=w.get(s,S),C=w.get(u,S),D=w.get(h,S),L=w.get(c,S),I=w.get(f,S);if(isNaN(M)||isNaN(L)||isNaN(I)){y[m++]=NaN,m+=3;continue}y[m++]=dC(w,S,C,D,h,T),x[n]=M,x[a]=L,_=t.dataToPoint(x,null,b),y[m++]=_?_[0]:NaN,y[m++]=_?_[1]:NaN,x[a]=I,_=t.dataToPoint(x,null,b),y[m++]=_?_[1]:NaN}g.setLayout("largePoints",y)}}};function dC(r,t,e,i,n,a){var o;return e>i?o=-1:e0?r.get(n,t-1)<=i?1:-1:1,o}function fj(r,t){var e=r.getBaseAxis(),i,n=e.type==="category"?e.getBandWidth():(i=e.getExtent(),Math.abs(i[1]-i[0])/t.count()),a=U(lt(r.get("barMaxWidth"),n),n),o=U(lt(r.get("barMinWidth"),1),n),s=r.get("barWidth");return s!=null?U(s,n):Math.max(Math.min(n/2,a),o)}function vj(r){r.registerChartView(aj),r.registerSeriesModel(sE),r.registerPreprocessor(hj),r.registerVisual(ij),r.registerLayout(cj)}function pC(r,t){var e=t.rippleEffectColor||t.color;r.eachChild(function(i){i.attr({z:t.z,zlevel:t.zlevel,style:{stroke:t.brushType==="stroke"?e:null,fill:t.brushType==="fill"?e:null}})})}var dj=function(r){E(t,r);function t(e,i){var n=r.call(this)||this,a=new Sh(e,i),o=new at;return n.add(a),n.add(o),n.updateData(e,i),n}return t.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},t.prototype.startEffectAnimation=function(e){for(var i=e.symbolType,n=e.color,a=e.rippleNumber,o=this.childAt(1),s=0;s0&&(s=this._getLineLength(a)/h*1e3),s!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var f=void 0;Q(c)?f=c(n):f=c,a.__t>0&&(f=-s*a.__t),this._animateSymbol(a,s,f,l,u)}this._period=s,this._loop=l,this._roundTrip=u}},t.prototype._animateSymbol=function(e,i,n,a,o){if(i>0){e.__t=0;var s=this,l=e.animate("",a).when(o?i*2:i,{__t:o?2:1}).delay(n).during(function(){s._updateSymbolPosition(e)});a||l.done(function(){s.remove(e)}),l.start()}},t.prototype._getLineLength=function(e){return Wi(e.__p1,e.__cp1)+Wi(e.__cp1,e.__p2)},t.prototype._updateAnimationPoints=function(e,i){e.__p1=i[0],e.__p2=i[1],e.__cp1=i[2]||[(i[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2]},t.prototype.updateData=function(e,i,n){this.childAt(0).updateData(e,i,n),this._updateEffectSymbol(e,i)},t.prototype._updateSymbolPosition=function(e){var i=e.__p1,n=e.__p2,a=e.__cp1,o=e.__t<1?e.__t:2-e.__t,s=[e.x,e.y],l=s.slice(),u=be,h=By;s[0]=u(i[0],a[0],n[0],o),s[1]=u(i[1],a[1],n[1],o);var c=e.__t<1?h(i[0],a[0],n[0],o):h(n[0],a[0],i[0],1-o),f=e.__t<1?h(i[1],a[1],n[1],o):h(n[1],a[1],i[1],1-o);e.rotation=-Math.atan2(f,c)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(e.__lastT!==void 0&&e.__lastT=0&&!(a[l]<=i);l--);l=Math.min(l,o-2)}else{for(l=s;li);l++);l=Math.min(l-1,o-2)}var h=(i-a[l])/(a[l+1]-a[l]),c=n[l],f=n[l+1];e.x=c[0]*(1-h)+h*f[0],e.y=c[1]*(1-h)+h*f[1];var v=e.__t<1?f[0]-c[0]:c[0]-f[0],d=e.__t<1?f[1]-c[1]:c[1]-f[1];e.rotation=-Math.atan2(d,v)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=i,e.ignore=!1}},t}(lE),_j=function(){function r(){this.polyline=!1,this.curveness=0,this.segs=[]}return r}(),xj=function(r){E(t,r);function t(e){var i=r.call(this,e)||this;return i._off=0,i.hoverDataIdx=-1,i}return t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new _j},t.prototype.buildPath=function(e,i){var n=i.segs,a=i.curveness,o;if(i.polyline)for(o=this._off;o0){e.moveTo(n[o++],n[o++]);for(var l=1;l0){var v=(u+c)/2-(h-f)*a,d=(h+f)/2-(c-u)*a;e.quadraticCurveTo(v,d,c,f)}else e.lineTo(c,f)}this.incremental&&(this._off=o,this.notClear=!0)},t.prototype.findDataIndex=function(e,i){var n=this.shape,a=n.segs,o=n.curveness,s=this.style.lineWidth;if(n.polyline)for(var l=0,u=0;u0)for(var c=a[u++],f=a[u++],v=1;v0){var g=(c+d)/2-(f-p)*o,y=(f+p)/2-(d-c)*o;if(O2(c,f,g,y,d,p,s,e,i))return l}else if(_n(c,f,d,p,s,e,i))return l;l++}return-1},t.prototype.contain=function(e,i){var n=this.transformCoordToLocal(e,i),a=this.getBoundingRect();if(e=n[0],i=n[1],a.contain(e,i)){var o=this.hoverDataIdx=this.findDataIndex(e,i);return o>=0}return this.hoverDataIdx=-1,!1},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var i=this.shape,n=i.segs,a=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u0&&(o.dataIndex=l+t.__startIndex)})},r.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},r}(),hE={seriesType:"lines",plan:Xs(),reset:function(r){var t=r.coordinateSystem;if(t){var e=r.get("polyline"),i=r.pipelineContext.large;return{progress:function(n,a){var o=[];if(i){var s=void 0,l=n.end-n.start;if(e){for(var u=0,h=n.start;h0&&(h||u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)})),o.updateData(a);var c=e.get("clip",!0)&&Th(e.coordinateSystem,!1,e);c?this.group.setClipPath(c):this.group.removeClipPath(),this._lastZlevel=s,this._finished=!0},t.prototype.incrementalPrepareRender=function(e,i,n){var a=e.getData(),o=this._updateLineDraw(a,e);o.incrementalPrepareUpdate(a),this._clearLayer(n),this._finished=!1},t.prototype.incrementalRender=function(e,i,n){this._lineDraw.incrementalUpdate(e,i.getData()),this._finished=e.end===i.getData().count()},t.prototype.eachRendered=function(e){this._lineDraw&&this._lineDraw.eachRendered(e)},t.prototype.updateTransform=function(e,i,n){var a=e.getData(),o=e.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var s=hE.reset(e,i,n);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),this._lineDraw.updateLayout(),this._clearLayer(n)},t.prototype._updateLineDraw=function(e,i){var n=this._lineDraw,a=this._showEffect(i),o=!!i.get("polyline"),s=i.pipelineContext,l=s.large;return(!n||a!==this._hasEffet||o!==this._isPolyline||l!==this._isLargeDraw)&&(n&&n.remove(),n=this._lineDraw=l?new bj:new Tx(o?a?mj:uE:a?lE:Sx),this._hasEffet=a,this._isPolyline=o,this._isLargeDraw=l),this.group.add(n.group),n},t.prototype._showEffect=function(e){return!!e.get(["effect","show"])},t.prototype._clearLayer=function(e){var i=e.getZr(),n=i.painter.getType()==="svg";!n&&this._lastZlevel!=null&&i.painter.getLayer(this._lastZlevel).clear(!0)},t.prototype.remove=function(e,i){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(i)},t.prototype.dispose=function(e,i){this.remove(e,i)},t.type="lines",t}(Ot),wj=typeof Uint32Array>"u"?Array:Uint32Array,Tj=typeof Float64Array>"u"?Array:Float64Array;function gC(r){var t=r.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(r.data=F(t,function(e){var i=[e[0].coord,e[1].coord],n={coords:i};return e[0].name&&(n.fromName=e[0].name),e[1].name&&(n.toName=e[1].name),zv([n,e[0],e[1]])}))}var Mj=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.visualStyleAccessPath="lineStyle",e.visualDrawType="stroke",e}return t.prototype.init=function(e){e.data=e.data||[],gC(e);var i=this._processFlatCoordsArray(e.data);this._flatCoords=i.flatCoords,this._flatCoordsOffset=i.flatCoordsOffset,i.flatCoords&&(e.data=new Float32Array(i.count)),r.prototype.init.apply(this,arguments)},t.prototype.mergeOption=function(e){if(gC(e),e.data){var i=this._processFlatCoordsArray(e.data);this._flatCoords=i.flatCoords,this._flatCoordsOffset=i.flatCoordsOffset,i.flatCoords&&(e.data=new Float32Array(i.count))}r.prototype.mergeOption.apply(this,arguments)},t.prototype.appendData=function(e){var i=this._processFlatCoordsArray(e.data);i.flatCoords&&(this._flatCoords?(this._flatCoords=ws(this._flatCoords,i.flatCoords),this._flatCoordsOffset=ws(this._flatCoordsOffset,i.flatCoordsOffset)):(this._flatCoords=i.flatCoords,this._flatCoordsOffset=i.flatCoordsOffset),e.data=new Float32Array(i.count)),this.getRawData().appendData(e.data)},t.prototype._getCoordsFromItemModel=function(e){var i=this.getData().getItemModel(e),n=i.option instanceof Array?i.option:i.getShallow("coords");return n},t.prototype.getLineCoordsCount=function(e){return this._flatCoordsOffset?this._flatCoordsOffset[e*2+1]:this._getCoordsFromItemModel(e).length},t.prototype.getLineCoords=function(e,i){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[e*2],a=this._flatCoordsOffset[e*2+1],o=0;o ")})},t.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},t.prototype.getProgressive=function(){var e=this.option.progressive;return e??(this.option.large?1e4:this.get("progressive"))},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return e??(this.option.large?2e4:this.get("progressiveThreshold"))},t.prototype.getZLevelKey=function(){var e=this.getModel("effect"),i=e.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:e.get("show")&&i>0?i+"":""},t.type="series.lines",t.dependencies=["grid","polar","geo","calendar"],t.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},t}(zt);function Nc(r){return r instanceof Array||(r=[r,r]),r}var Cj={seriesType:"lines",reset:function(r){var t=Nc(r.get("symbol")),e=Nc(r.get("symbolSize")),i=r.getData();i.setVisual("fromSymbol",t&&t[0]),i.setVisual("toSymbol",t&&t[1]),i.setVisual("fromSymbolSize",e&&e[0]),i.setVisual("toSymbolSize",e&&e[1]);function n(a,o){var s=a.getItemModel(o),l=Nc(s.getShallow("symbol",!0)),u=Nc(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:i.hasItemOption?n:null}}};function Aj(r){r.registerChartView(Sj),r.registerSeriesModel(Mj),r.registerLayout(hE),r.registerVisual(Cj)}var Dj=256,Lj=function(){function r(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=Qr.createCanvas();this.canvas=t}return r.prototype.update=function(t,e,i,n,a,o){var s=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),h=this.pointSize+this.blurSize,c=this.canvas,f=c.getContext("2d"),v=t.length;c.width=e,c.height=i;for(var d=0;d0){var L=o(_)?l:u;_>0&&(_=_*C+T),b[S++]=L[D],b[S++]=L[D+1],b[S++]=L[D+2],b[S++]=L[D+3]*_*256}else S+=4}return f.putImageData(x,0,0),c},r.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=Qr.createCanvas()),e=this.pointSize+this.blurSize,i=e*2;t.width=i,t.height=i;var n=t.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-e,e,this.pointSize,0,Math.PI*2,!0),n.closePath(),n.fill(),t},r.prototype._getGradient=function(t,e){for(var i=this._gradientPixels,n=i[e]||(i[e]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],o=0,s=0;s<256;s++)t[e](s/255,!0,a),n[o++]=a[0],n[o++]=a[1],n[o++]=a[2],n[o++]=a[3];return n},r}();function Ij(r,t,e){var i=r[1]-r[0];t=F(t,function(o){return{interval:[(o.interval[0]-r[0])/i,(o.interval[1]-r[0])/i]}});var n=t.length,a=0;return function(o){var s;for(s=a;s=0;s--){var l=t[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s=t[0]&&i<=t[1]}}function yC(r){var t=r.dimensions;return t[0]==="lng"&&t[1]==="lat"}var kj=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,i,n){var a;i.eachComponent("visualMap",function(s){s.eachTargetSeries(function(l){l===e&&(a=s)})}),this._progressiveEls=null,this.group.removeAll();var o=e.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"?this._renderOnCartesianAndCalendar(e,n,0,e.getData().count()):yC(o)&&this._renderOnGeo(o,e,a,n)},t.prototype.incrementalPrepareRender=function(e,i,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,i,n,a){var o=i.coordinateSystem;o&&(yC(o)?this.render(i,n,a):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(i,a,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){ta(this._progressiveEls||this.group,e)},t.prototype._renderOnCartesianAndCalendar=function(e,i,n,a,o){var s=e.coordinateSystem,l=Co(s,"cartesian2d"),u,h,c,f;if(l){var v=s.getAxis("x"),d=s.getAxis("y");u=v.getBandWidth()+.5,h=d.getBandWidth()+.5,c=v.scale.getExtent(),f=d.scale.getExtent()}for(var p=this.group,g=e.getData(),y=e.getModel(["emphasis","itemStyle"]).getItemStyle(),m=e.getModel(["blur","itemStyle"]).getItemStyle(),_=e.getModel(["select","itemStyle"]).getItemStyle(),x=e.get(["itemStyle","borderRadius"]),b=me(e),S=e.getModel("emphasis"),w=S.get("focus"),T=S.get("blurScope"),M=S.get("disabled"),C=l?[g.mapDimension("x"),g.mapDimension("y"),g.mapDimension("value")]:[g.mapDimension("time"),g.mapDimension("value")],D=n;Dc[1]||kf[1])continue;var R=s.dataToPoint([P,k]);L=new wt({shape:{x:R[0]-u/2,y:R[1]-h/2,width:u,height:h},style:I})}else{if(isNaN(g.get(C[1],D)))continue;L=new wt({z2:1,shape:s.dataToRect([g.get(C[0],D)]).contentShape,style:I})}if(g.hasItemOption){var N=g.getItemModel(D),O=N.getModel("emphasis");y=O.getModel("itemStyle").getItemStyle(),m=N.getModel(["blur","itemStyle"]).getItemStyle(),_=N.getModel(["select","itemStyle"]).getItemStyle(),x=N.get(["itemStyle","borderRadius"]),w=O.get("focus"),T=O.get("blurScope"),M=O.get("disabled"),b=me(N)}L.shape.r=x;var B=e.getRawValue(D),G="-";B&&B[2]!=null&&(G=B[2]+""),Ae(L,b,{labelFetcher:e,labelDataIndex:D,defaultOpacity:I.opacity,defaultText:G}),L.ensureState("emphasis").style=y,L.ensureState("blur").style=m,L.ensureState("select").style=_,Kt(L,w,T,M),L.incremental=o,o&&(L.states.emphasis.hoverLayer=!0),p.add(L),g.setItemGraphicEl(D,L),this._progressiveEls&&this._progressiveEls.push(L)}},t.prototype._renderOnGeo=function(e,i,n,a){var o=n.targetVisuals.inRange,s=n.targetVisuals.outOfRange,l=i.getData(),u=this._hmLayer||this._hmLayer||new Lj;u.blurSize=i.get("blurSize"),u.pointSize=i.get("pointSize"),u.minOpacity=i.get("minOpacity"),u.maxOpacity=i.get("maxOpacity");var h=e.getViewRect().clone(),c=e.getRoamTransform();h.applyTransform(c);var f=Math.max(h.x,0),v=Math.max(h.y,0),d=Math.min(h.width+h.x,a.getWidth()),p=Math.min(h.height+h.y,a.getHeight()),g=d-f,y=p-v,m=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],_=l.mapArray(m,function(w,T,M){var C=e.dataToPoint([w,T]);return C[0]-=f,C[1]-=v,C.push(M),C}),x=n.getExtent(),b=n.type==="visualMap.continuous"?Pj(x,n.option.range):Ij(x,n.getPieceList(),n.option.selected);u.update(_,g,y,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},b);var S=new xe({style:{width:g,height:y,x:f,y:v,image:u.canvas},silent:!0});this.group.add(S)},t.type="heatmap",t}(Ot),Rj=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.getInitialData=function(e,i){return Li(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var e=$s.get(this.get("coordinateSystem"));if(e&&e.dimensions)return e.dimensions[0]==="lng"&&e.dimensions[1]==="lat"},t.type="series.heatmap",t.dependencies=["grid","geo","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},t}(zt);function Ej(r){r.registerChartView(kj),r.registerSeriesModel(Rj)}var Oj=["itemStyle","borderWidth"],mC=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],Vg=new Ai,Nj=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,i,n){var a=this.group,o=e.getData(),s=this._data,l=e.coordinateSystem,u=l.getBaseAxis(),h=u.isHorizontal(),c=l.master.getRect(),f={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:e,coordSys:l,coordSysExtent:[[c.x,c.x+c.width],[c.y,c.y+c.height]],isHorizontal:h,valueDim:mC[+h],categoryDim:mC[1-+h]};o.diff(s).add(function(d){if(o.hasValue(d)){var p=xC(o,d),g=_C(o,d,p,f),y=bC(o,f,g);o.setItemGraphicEl(d,y),a.add(y),wC(y,f,g)}}).update(function(d,p){var g=s.getItemGraphicEl(p);if(!o.hasValue(d)){a.remove(g);return}var y=xC(o,d),m=_C(o,d,y,f),_=gE(o,m);g&&_!==g.__pictorialShapeStr&&(a.remove(g),o.setItemGraphicEl(d,null),g=null),g?Wj(g,f,m):g=bC(o,f,m,!0),o.setItemGraphicEl(d,g),g.__pictorialSymbolMeta=m,a.add(g),wC(g,f,m)}).remove(function(d){var p=s.getItemGraphicEl(d);p&&SC(s,d,p.__pictorialSymbolMeta.animationModel,p)}).execute();var v=e.get("clip",!0)?Th(e.coordinateSystem,!1,e):null;return v?a.setClipPath(v):a.removeClipPath(),this._data=o,this.group},t.prototype.remove=function(e,i){var n=this.group,a=this._data;e.get("animation")?a&&a.eachItemGraphicEl(function(o){SC(a,ot(o).dataIndex,e,o)}):n.removeAll()},t.type="pictorialBar",t}(Ot);function _C(r,t,e,i){var n=r.getItemLayout(t),a=e.get("symbolRepeat"),o=e.get("symbolClip"),s=e.get("symbolPosition")||"start",l=e.get("symbolRotate"),u=(l||0)*Math.PI/180||0,h=e.get("symbolPatternSize")||2,c=e.isAnimationEnabled(),f={dataIndex:t,layout:n,itemModel:e,symbolType:r.getItemVisual(t,"symbol")||"circle",style:r.getItemVisual(t,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:e.get("symbolRepeatDirection"),symbolPatternSize:h,rotation:u,animationModel:c?e:null,hoverScale:c&&e.get(["emphasis","scale"]),z2:e.getShallow("z",!0)||0};Bj(e,a,n,i,f),zj(r,t,n,a,o,f.boundingLength,f.pxSign,h,i,f),Vj(e,f.symbolScale,u,i,f);var v=f.symbolSize,d=Mo(e.get("symbolOffset"),v);return Fj(e,v,n,a,o,d,s,f.valueLineWidth,f.boundingLength,f.repeatCutLength,i,f),f}function Bj(r,t,e,i,n){var a=i.valueDim,o=r.get("symbolBoundingData"),s=i.coordSys.getOtherAxis(i.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),u=1-+(e[a.wh]<=0),h;if(V(o)){var c=[Fg(s,o[0])-l,Fg(s,o[1])-l];c[1]=0?1:-1:h>0?1:-1}function Fg(r,t){return r.toGlobalCoord(r.dataToCoord(r.scale.parse(t)))}function zj(r,t,e,i,n,a,o,s,l,u){var h=l.valueDim,c=l.categoryDim,f=Math.abs(e[c.wh]),v=r.getItemVisual(t,"symbolSize"),d;V(v)?d=v.slice():v==null?d=["100%","100%"]:d=[v,v],d[c.index]=U(d[c.index],f),d[h.index]=U(d[h.index],i?f:Math.abs(a)),u.symbolSize=d;var p=u.symbolScale=[d[0]/s,d[1]/s];p[h.index]*=(l.isHorizontal?-1:1)*o}function Vj(r,t,e,i,n){var a=r.get(Oj)||0;a&&(Vg.attr({scaleX:t[0],scaleY:t[1],rotation:e}),Vg.updateTransform(),a/=Vg.getLineScale(),a*=t[i.valueDim.index]),n.valueLineWidth=a||0}function Fj(r,t,e,i,n,a,o,s,l,u,h,c){var f=h.categoryDim,v=h.valueDim,d=c.pxSign,p=Math.max(t[v.index]+s,0),g=p;if(i){var y=Math.abs(l),m=pe(r.get("symbolMargin"),"15%")+"",_=!1;m.lastIndexOf("!")===m.length-1&&(_=!0,m=m.slice(0,m.length-1));var x=U(m,t[v.index]),b=Math.max(p+x*2,0),S=_?0:x*2,w=t_(i),T=w?i:TC((y+S)/b),M=y-T*p;x=M/2/(_?T:Math.max(T-1,1)),b=p+x*2,S=_?0:x*2,!w&&i!=="fixed"&&(T=u?TC((Math.abs(u)+S)/b):0),g=T*b-S,c.repeatTimes=T,c.symbolMargin=x}var C=d*(g/2),D=c.pathPosition=[];D[f.index]=e[f.wh]/2,D[v.index]=o==="start"?C:o==="end"?l-C:l/2,a&&(D[0]+=a[0],D[1]+=a[1]);var L=c.bundlePosition=[];L[f.index]=e[f.xy],L[v.index]=e[v.xy];var I=c.barRectShape=z({},e);I[v.wh]=d*Math.max(Math.abs(e[v.wh]),Math.abs(D[v.index]+C)),I[f.wh]=e[f.wh];var P=c.clipShape={};P[f.xy]=-e[f.xy],P[f.wh]=h.ecSize[f.wh],P[v.xy]=0,P[v.wh]=e[v.wh]}function cE(r){var t=r.symbolPatternSize,e=ae(r.symbolType,-t/2,-t/2,t,t);return e.attr({culling:!0}),e.type!=="image"&&e.setStyle({strokeNoScale:!0}),e}function fE(r,t,e,i){var n=r.__pictorialBundle,a=e.symbolSize,o=e.valueLineWidth,s=e.pathPosition,l=t.valueDim,u=e.repeatTimes||0,h=0,c=a[t.valueDim.index]+o+e.symbolMargin*2;for(Ex(r,function(p){p.__pictorialAnimationIndex=h,p.__pictorialRepeatTimes=u,h0:y<0)&&(m=u-1-p),g[l.index]=c*(m-u/2+.5)+s[l.index],{x:g[0],y:g[1],scaleX:e.symbolScale[0],scaleY:e.symbolScale[1],rotation:e.rotation}}}function vE(r,t,e,i){var n=r.__pictorialBundle,a=r.__pictorialMainPath;a?ys(a,null,{x:e.pathPosition[0],y:e.pathPosition[1],scaleX:e.symbolScale[0],scaleY:e.symbolScale[1],rotation:e.rotation},e,i):(a=r.__pictorialMainPath=cE(e),n.add(a),ys(a,{x:e.pathPosition[0],y:e.pathPosition[1],scaleX:0,scaleY:0,rotation:e.rotation},{scaleX:e.symbolScale[0],scaleY:e.symbolScale[1]},e,i))}function dE(r,t,e){var i=z({},t.barRectShape),n=r.__pictorialBarRect;n?ys(n,null,{shape:i},t,e):(n=r.__pictorialBarRect=new wt({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),n.disableMorphing=!0,r.add(n))}function pE(r,t,e,i){if(e.symbolClip){var n=r.__pictorialClipPath,a=z({},e.clipShape),o=t.valueDim,s=e.animationModel,l=e.dataIndex;if(n)At(n,{shape:a},s,l);else{a[o.wh]=0,n=new wt({shape:a}),r.__pictorialBundle.setClipPath(n),r.__pictorialClipPath=n;var u={};u[o.wh]=e.clipShape[o.wh],wo[i?"updateProps":"initProps"](n,{shape:u},s,l)}}}function xC(r,t){var e=r.getItemModel(t);return e.getAnimationDelayParams=Gj,e.isAnimationEnabled=Hj,e}function Gj(r){return{index:r.__pictorialAnimationIndex,count:r.__pictorialRepeatTimes}}function Hj(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function bC(r,t,e,i){var n=new at,a=new at;return n.add(a),n.__pictorialBundle=a,a.x=e.bundlePosition[0],a.y=e.bundlePosition[1],e.symbolRepeat?fE(n,t,e):vE(n,t,e),dE(n,e,i),pE(n,t,e,i),n.__pictorialShapeStr=gE(r,e),n.__pictorialSymbolMeta=e,n}function Wj(r,t,e){var i=e.animationModel,n=e.dataIndex,a=r.__pictorialBundle;At(a,{x:e.bundlePosition[0],y:e.bundlePosition[1]},i,n),e.symbolRepeat?fE(r,t,e,!0):vE(r,t,e,!0),dE(r,e,!0),pE(r,t,e,!0)}function SC(r,t,e,i){var n=i.__pictorialBarRect;n&&n.removeTextContent();var a=[];Ex(i,function(o){a.push(o)}),i.__pictorialMainPath&&a.push(i.__pictorialMainPath),i.__pictorialClipPath&&(e=null),A(a,function(o){Xn(o,{scaleX:0,scaleY:0},e,t,function(){i.parent&&i.parent.remove(i)})}),r.setItemGraphicEl(t,null)}function gE(r,t){return[r.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function Ex(r,t,e){A(r.__pictorialBundle.children(),function(i){i!==r.__pictorialBarRect&&t.call(e,i)})}function ys(r,t,e,i,n,a){t&&r.attr(t),i.symbolClip&&!n?e&&r.attr(e):e&&wo[n?"updateProps":"initProps"](r,e,i.animationModel,i.dataIndex,a)}function wC(r,t,e){var i=e.dataIndex,n=e.itemModel,a=n.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=n.getModel(["blur","itemStyle"]).getItemStyle(),l=n.getModel(["select","itemStyle"]).getItemStyle(),u=n.getShallow("cursor"),h=a.get("focus"),c=a.get("blurScope"),f=a.get("scale");Ex(r,function(p){if(p instanceof xe){var g=p.style;p.useStyle(z({image:g.image,x:g.x,y:g.y,width:g.width,height:g.height},e.style))}else p.useStyle(e.style);var y=p.ensureState("emphasis");y.style=o,f&&(y.scaleX=p.scaleX*1.1,y.scaleY=p.scaleY*1.1),p.ensureState("blur").style=s,p.ensureState("select").style=l,u&&(p.cursor=u),p.z2=e.z2});var v=t.valueDim.posDesc[+(e.boundingLength>0)],d=r.__pictorialBarRect;d.ignoreClip=!0,Ae(d,me(n),{labelFetcher:t.seriesModel,labelDataIndex:i,defaultText:Ls(t.seriesModel.getData(),i),inheritColor:e.style.fill,defaultOpacity:e.style.opacity,defaultOutsidePosition:v}),Kt(r,h,c,a.get("disabled"))}function TC(r){var t=Math.round(r);return Math.abs(r-t)<1e-4?t:Math.ceil(r)}var Uj=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.hasSymbolVisual=!0,e.defaultSymbol="roundRect",e}return t.prototype.getInitialData=function(e){return e.stack=null,r.prototype.getInitialData.apply(this,arguments)},t.type="series.pictorialBar",t.dependencies=["grid"],t.defaultOption=ea(ju.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),t}(ju);function Yj(r){r.registerChartView(Nj),r.registerSeriesModel(Uj),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,ut(QP,"pictorialBar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,tk("pictorialBar"))}var $j=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e._layers=[],e}return t.prototype.render=function(e,i,n){var a=e.getData(),o=this,s=this.group,l=e.getLayerSeries(),u=a.getLayout("layoutInfo"),h=u.rect,c=u.boundaryGap;s.x=0,s.y=h.y+c[0];function f(g){return g.name}var v=new Qi(this._layersSeries||[],l,f,f),d=[];v.add($(p,this,"add")).update($(p,this,"update")).remove($(p,this,"remove")).execute();function p(g,y,m){var _=o._layers;if(g==="remove"){s.remove(_[y]);return}for(var x=[],b=[],S,w=l[y].indices,T=0;Ta&&(a=s),i.push(s)}for(var u=0;ua&&(a=c)}return{y0:n,max:a}}function Kj(r){r.registerChartView($j),r.registerSeriesModel(Zj),r.registerLayout(jj),r.registerProcessor(Ch("themeRiver"))}var Jj=2,Qj=4,CC=function(r){E(t,r);function t(e,i,n,a){var o=r.call(this)||this;o.z2=Jj,o.textConfig={inside:!0},ot(o).seriesIndex=i.seriesIndex;var s=new St({z2:Qj,silent:e.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,e,i,n,a),o}return t.prototype.updateData=function(e,i,n,a,o){this.node=i,i.piece=this,n=n||this._seriesModel,a=a||this._ecModel;var s=this;ot(s).dataIndex=i.dataIndex;var l=i.getModel(),u=l.getModel("emphasis"),h=i.getLayout(),c=z({},h);c.label=null;var f=i.getVisual("style");f.lineJoin="bevel";var v=i.getVisual("decal");v&&(f.decal=Ds(v,o));var d=Ka(l.getModel("itemStyle"),c,!0);z(c,d),A(Ke,function(m){var _=s.ensureState(m),x=l.getModel([m,"itemStyle"]);_.style=x.getItemStyle();var b=Ka(x,c);b&&(_.shape=b)}),e?(s.setShape(c),s.shape.r=h.r0,$t(s,{shape:{r:h.r}},n,i.dataIndex)):(At(s,{shape:c},n),ri(s)),s.useStyle(f),this._updateLabel(n);var p=l.getShallow("cursor");p&&s.attr("cursor",p),this._seriesModel=n||this._seriesModel,this._ecModel=a||this._ecModel;var g=u.get("focus"),y=g==="relative"?ws(i.getAncestorsIndices(),i.getDescendantIndices()):g==="ancestor"?i.getAncestorsIndices():g==="descendant"?i.getDescendantIndices():g;Kt(this,y,u.get("blurScope"),u.get("disabled"))},t.prototype._updateLabel=function(e){var i=this,n=this.node.getModel(),a=n.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.endAngle)/2,u=Math.cos(l),h=Math.sin(l),c=this,f=c.getTextContent(),v=this.node.dataIndex,d=a.get("minAngle")/180*Math.PI,p=a.get("show")&&!(d!=null&&Math.abs(s)P&&!Ts(R-P)&&R0?(o.virtualPiece?o.virtualPiece.updateData(!1,m,e,i,n):(o.virtualPiece=new CC(m,e,i,n),h.add(o.virtualPiece)),_.piece.off("click"),o.virtualPiece.on("click",function(x){o._rootToNode(_.parentNode)})):o.virtualPiece&&(h.remove(o.virtualPiece),o.virtualPiece=null)}},t.prototype._initEvents=function(){var e=this;this.group.off("click"),this.group.on("click",function(i){var n=!1,a=e.seriesModel.getViewRoot();a.eachNode(function(o){if(!n&&o.piece&&o.piece===i.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")e._rootToNode(o);else if(s==="link"){var l=o.getModel(),u=l.get("link");if(u){var h=l.get("target",!0)||"_blank";Zf(u,h)}}n=!0}})})},t.prototype._rootToNode=function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:t0,from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},t.prototype.containPoint=function(e,i){var n=i.getData(),a=n.getItemLayout(0);if(a){var o=e[0]-a.cx,s=e[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},t.type="sunburst",t}(Ot),iq=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.ignoreStyleOnData=!0,e}return t.prototype.getInitialData=function(e,i){var n={name:e.name,children:e.data};yE(n);var a=this._levelModels=F(e.levels||[],function(l){return new Lt(l,this,i)},this),o=gx.createTree(n,this,s);function s(l){l.wrapMethod("getItemModel",function(u,h){var c=o.getNodeByDataIndex(h),f=a[c.depth];return f&&(u.parentModel=f),u})}return o.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(e){var i=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(e);return i.treePathInfo=bd(n,this),i},t.prototype.getLevelModel=function(e){return this._levelModels&&this._levelModels[e.depth]},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var i=this.getRawData().tree.root;(!e||e!==i&&!i.contains(e))&&(this._viewRoot=i)},t.prototype.enableAriaDecal=function(){SR(this)},t.type="series.sunburst",t.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},t}(zt);function yE(r){var t=0;A(r.children,function(i){yE(i);var n=i.value;V(n)&&(n=n[0]),t+=n});var e=r.value;V(e)&&(e=e[0]),(e==null||isNaN(e))&&(e=t),e<0&&(e=0),V(r.value)?r.value[0]=e:r.value=e}var DC=Math.PI/180;function nq(r,t,e){t.eachSeriesByType(r,function(i){var n=i.get("center"),a=i.get("radius");V(a)||(a=[0,a]),V(n)||(n=[n,n]);var o=e.getWidth(),s=e.getHeight(),l=Math.min(o,s),u=U(n[0],o),h=U(n[1],s),c=U(a[0],l/2),f=U(a[1],l/2),v=-i.get("startAngle")*DC,d=i.get("minAngle")*DC,p=i.getData().tree.root,g=i.getViewRoot(),y=g.depth,m=i.get("sort");m!=null&&mE(g,m);var _=0;A(g.children,function(R){!isNaN(R.getValue())&&_++});var x=g.getValue(),b=Math.PI/(x||_)*2,S=g.depth>0,w=g.height-(S?-1:1),T=(f-c)/(w||1),M=i.get("clockwise"),C=i.get("stillShowZeroSum"),D=M?1:-1,L=function(R,N){if(R){var O=N;if(R!==p){var B=R.getValue(),G=x===0&&C?b:B*b;G1;)o=o.parentNode;var s=n.getColorFromPalette(o.name||o.dataIndex+"",t);return i.depth>1&&Y(s)&&(s=Nf(s,(i.depth-1)/(a-1)*.5)),s}r.eachSeriesByType("sunburst",function(i){var n=i.getData(),a=n.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=e(o,i,a.root.height));var u=n.ensureUniqueItemVisual(o.dataIndex,"style");z(u,l)})})}function sq(r){r.registerChartView(rq),r.registerSeriesModel(iq),r.registerLayout(ut(nq,"sunburst")),r.registerProcessor(ut(Ch,"sunburst")),r.registerVisual(oq),eq(r)}var LC={color:"fill",borderColor:"stroke"},lq={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Zi=Tt(),uq=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(e,i){return Li(null,this)},t.prototype.getDataParams=function(e,i,n){var a=r.prototype.getDataParams.call(this,e,i);return n&&(a.info=Zi(n).info),a},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},t}(zt);function hq(r,t){return t=t||[0,0],F(["x","y"],function(e,i){var n=this.getAxis(e),a=t[i],o=r[i]/2;return n.type==="category"?n.getBandWidth():Math.abs(n.dataToCoord(a-o)-n.dataToCoord(a+o))},this)}function cq(r){var t=r.master.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(e){return r.dataToPoint(e)},size:$(hq,r)}}}function fq(r,t){return t=t||[0,0],F([0,1],function(e){var i=t[e],n=r[e]/2,a=[],o=[];return a[e]=i-n,o[e]=i+n,a[1-e]=o[1-e]=t[1-e],Math.abs(this.dataToPoint(a)[e]-this.dataToPoint(o)[e])},this)}function vq(r){var t=r.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:r.getZoom()},api:{coord:function(e){return r.dataToPoint(e)},size:$(fq,r)}}}function dq(r,t){var e=this.getAxis(),i=t instanceof Array?t[0]:t,n=(r instanceof Array?r[0]:r)/2;return e.type==="category"?e.getBandWidth():Math.abs(e.dataToCoord(i-n)-e.dataToCoord(i+n))}function pq(r){var t=r.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(e){return r.dataToPoint(e)},size:$(dq,r)}}}function gq(r,t){return t=t||[0,0],F(["Radius","Angle"],function(e,i){var n="get"+e+"Axis",a=this[n](),o=t[i],s=r[i]/2,l=a.type==="category"?a.getBandWidth():Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return e==="Angle"&&(l=l*Math.PI/180),l},this)}function yq(r){var t=r.getRadiusAxis(),e=r.getAngleAxis(),i=t.getExtent();return i[0]>i[1]&&i.reverse(),{coordSys:{type:"polar",cx:r.cx,cy:r.cy,r:i[1],r0:i[0]},api:{coord:function(n){var a=t.dataToRadius(n[0]),o=e.dataToAngle(n[1]),s=r.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:$(gq,r)}}}function mq(r){var t=r.getRect(),e=r.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:r.getCellWidth(),cellHeight:r.getCellHeight(),rangeInfo:{start:e.start,end:e.end,weeks:e.weeks,dayCount:e.allDay}},api:{coord:function(i,n){return r.dataToPoint(i,n)}}}}function _E(r,t,e,i){return r&&(r.legacy||r.legacy!==!1&&!e&&!i&&t!=="tspan"&&(t==="text"||X(r,"text")))}function xE(r,t,e){var i=r,n,a,o;if(t==="text")o=i;else{o={},X(i,"text")&&(o.text=i.text),X(i,"rich")&&(o.rich=i.rich),X(i,"textFill")&&(o.fill=i.textFill),X(i,"textStroke")&&(o.stroke=i.textStroke),X(i,"fontFamily")&&(o.fontFamily=i.fontFamily),X(i,"fontSize")&&(o.fontSize=i.fontSize),X(i,"fontStyle")&&(o.fontStyle=i.fontStyle),X(i,"fontWeight")&&(o.fontWeight=i.fontWeight),a={type:"text",style:o,silent:!0},n={};var s=X(i,"textPosition");e?n.position=s?i.textPosition:"inside":s&&(n.position=i.textPosition),X(i,"textPosition")&&(n.position=i.textPosition),X(i,"textOffset")&&(n.offset=i.textOffset),X(i,"textRotation")&&(n.rotation=i.textRotation),X(i,"textDistance")&&(n.distance=i.textDistance)}return IC(o,r),A(o.rich,function(l){IC(l,l)}),{textConfig:n,textContent:a}}function IC(r,t){t&&(t.font=t.textFont||t.font,X(t,"textStrokeWidth")&&(r.lineWidth=t.textStrokeWidth),X(t,"textAlign")&&(r.align=t.textAlign),X(t,"textVerticalAlign")&&(r.verticalAlign=t.textVerticalAlign),X(t,"textLineHeight")&&(r.lineHeight=t.textLineHeight),X(t,"textWidth")&&(r.width=t.textWidth),X(t,"textHeight")&&(r.height=t.textHeight),X(t,"textBackgroundColor")&&(r.backgroundColor=t.textBackgroundColor),X(t,"textPadding")&&(r.padding=t.textPadding),X(t,"textBorderColor")&&(r.borderColor=t.textBorderColor),X(t,"textBorderWidth")&&(r.borderWidth=t.textBorderWidth),X(t,"textBorderRadius")&&(r.borderRadius=t.textBorderRadius),X(t,"textBoxShadowColor")&&(r.shadowColor=t.textBoxShadowColor),X(t,"textBoxShadowBlur")&&(r.shadowBlur=t.textBoxShadowBlur),X(t,"textBoxShadowOffsetX")&&(r.shadowOffsetX=t.textBoxShadowOffsetX),X(t,"textBoxShadowOffsetY")&&(r.shadowOffsetY=t.textBoxShadowOffsetY))}function PC(r,t,e){var i=r;i.textPosition=i.textPosition||e.position||"inside",e.offset!=null&&(i.textOffset=e.offset),e.rotation!=null&&(i.textRotation=e.rotation),e.distance!=null&&(i.textDistance=e.distance);var n=i.textPosition.indexOf("inside")>=0,a=r.fill||"#000";kC(i,t);var o=i.textFill==null;return n?o&&(i.textFill=e.insideFill||"#fff",!i.textStroke&&e.insideStroke&&(i.textStroke=e.insideStroke),!i.textStroke&&(i.textStroke=a),i.textStrokeWidth==null&&(i.textStrokeWidth=2)):(o&&(i.textFill=r.fill||e.outsideFill||"#000"),!i.textStroke&&e.outsideStroke&&(i.textStroke=e.outsideStroke)),i.text=t.text,i.rich=t.rich,A(t.rich,function(s){kC(s,s)}),i}function kC(r,t){t&&(X(t,"fill")&&(r.textFill=t.fill),X(t,"stroke")&&(r.textStroke=t.fill),X(t,"lineWidth")&&(r.textStrokeWidth=t.lineWidth),X(t,"font")&&(r.font=t.font),X(t,"fontStyle")&&(r.fontStyle=t.fontStyle),X(t,"fontWeight")&&(r.fontWeight=t.fontWeight),X(t,"fontSize")&&(r.fontSize=t.fontSize),X(t,"fontFamily")&&(r.fontFamily=t.fontFamily),X(t,"align")&&(r.textAlign=t.align),X(t,"verticalAlign")&&(r.textVerticalAlign=t.verticalAlign),X(t,"lineHeight")&&(r.textLineHeight=t.lineHeight),X(t,"width")&&(r.textWidth=t.width),X(t,"height")&&(r.textHeight=t.height),X(t,"backgroundColor")&&(r.textBackgroundColor=t.backgroundColor),X(t,"padding")&&(r.textPadding=t.padding),X(t,"borderColor")&&(r.textBorderColor=t.borderColor),X(t,"borderWidth")&&(r.textBorderWidth=t.borderWidth),X(t,"borderRadius")&&(r.textBorderRadius=t.borderRadius),X(t,"shadowColor")&&(r.textBoxShadowColor=t.shadowColor),X(t,"shadowBlur")&&(r.textBoxShadowBlur=t.shadowBlur),X(t,"shadowOffsetX")&&(r.textBoxShadowOffsetX=t.shadowOffsetX),X(t,"shadowOffsetY")&&(r.textBoxShadowOffsetY=t.shadowOffsetY),X(t,"textShadowColor")&&(r.textShadowColor=t.textShadowColor),X(t,"textShadowBlur")&&(r.textShadowBlur=t.textShadowBlur),X(t,"textShadowOffsetX")&&(r.textShadowOffsetX=t.textShadowOffsetX),X(t,"textShadowOffsetY")&&(r.textShadowOffsetY=t.textShadowOffsetY))}var bE={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},RC=xt(bE);Pr(Ti,function(r,t){return r[t]=1,r},{});Ti.join(", ");var gv=["","style","shape","extra"],ks=Tt();function Ox(r,t,e,i,n){var a=r+"Animation",o=Fs(r,i,n)||{},s=ks(t).userDuring;return o.duration>0&&(o.during=s?$(wq,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=r),z(o,e[a]),o}function gf(r,t,e,i){i=i||{};var n=i.dataIndex,a=i.isInit,o=i.clearStyle,s=e.isAnimationEnabled(),l=ks(r),u=t.style;l.userDuring=t.during;var h={},c={};if(Mq(r,t,c),OC("shape",t,c),OC("extra",t,c),!a&&s&&(Tq(r,t,h),EC("shape",r,t,h),EC("extra",r,t,h),Cq(r,t,u,h)),c.style=u,_q(r,c,o),bq(r,t),s)if(a){var f={};A(gv,function(d){var p=d?t[d]:t;p&&p.enterFrom&&(d&&(f[d]=f[d]||{}),z(d?f[d]:f,p.enterFrom))});var v=Ox("enter",r,t,e,n);v.duration>0&&r.animateFrom(f,v)}else xq(r,t,n||0,e,h);SE(r,t),u?r.dirty():r.markRedraw()}function SE(r,t){for(var e=ks(r).leaveToProps,i=0;i0&&r.animateFrom(n,a)}}function bq(r,t){X(t,"silent")&&(r.silent=t.silent),X(t,"ignore")&&(r.ignore=t.ignore),r instanceof kr&&X(t,"invisible")&&(r.invisible=t.invisible),r instanceof _t&&X(t,"autoBatch")&&(r.autoBatch=t.autoBatch)}var hi={},Sq={setTransform:function(r,t){return hi.el[r]=t,this},getTransform:function(r){return hi.el[r]},setShape:function(r,t){var e=hi.el,i=e.shape||(e.shape={});return i[r]=t,e.dirtyShape&&e.dirtyShape(),this},getShape:function(r){var t=hi.el.shape;if(t)return t[r]},setStyle:function(r,t){var e=hi.el,i=e.style;return i&&(i[r]=t,e.dirtyStyle&&e.dirtyStyle()),this},getStyle:function(r){var t=hi.el.style;if(t)return t[r]},setExtra:function(r,t){var e=hi.el.extra||(hi.el.extra={});return e[r]=t,this},getExtra:function(r){var t=hi.el.extra;if(t)return t[r]}};function wq(){var r=this,t=r.el;if(t){var e=ks(t).userDuring,i=r.userDuring;if(e!==i){r.el=r.userDuring=null;return}hi.el=t,i(Sq)}}function EC(r,t,e,i){var n=e[r];if(n){var a=t[r],o;if(a){var s=e.transition,l=n.transition;if(l)if(!o&&(o=i[r]={}),oo(l))z(o,a);else for(var u=Bt(l),h=0;h=0){!o&&(o=i[r]={});for(var v=xt(a),h=0;h=0)){var f=r.getAnimationStyleProps(),v=f?f.style:null;if(v){!a&&(a=i.style={});for(var d=xt(e),u=0;u=0?t.getStore().get(N,k):void 0}var O=t.get(R.name,k),B=R&&R.ordinalMeta;return B?B.categories[O]:O}function S(P,k){k==null&&(k=u);var R=t.getItemVisual(k,"style"),N=R&&R.fill,O=R&&R.opacity,B=m(k,kn).getItemStyle();N!=null&&(B.fill=N),O!=null&&(B.opacity=O);var G={inheritColor:Y(N)?N:"#000"},H=_(k,kn),W=Gt(H,null,G,!1,!0);W.text=H.getShallow("show")?lt(r.getFormattedLabel(k,kn),Ls(t,k)):null;var q=$f(H,G,!1);return M(P,B),B=PC(B,W,q),P&&T(B,P),B.legacy=!0,B}function w(P,k){k==null&&(k=u);var R=m(k,ji).getItemStyle(),N=_(k,ji),O=Gt(N,null,null,!0,!0);O.text=N.getShallow("show")?jr(r.getFormattedLabel(k,ji),r.getFormattedLabel(k,kn),Ls(t,k)):null;var B=$f(N,null,!0);return M(P,R),R=PC(R,O,B),P&&T(R,P),R.legacy=!0,R}function T(P,k){for(var R in k)X(k,R)&&(P[R]=k[R])}function M(P,k){P&&(P.textFill&&(k.textFill=P.textFill),P.textPosition&&(k.textPosition=P.textPosition))}function C(P,k){if(k==null&&(k=u),X(LC,P)){var R=t.getItemVisual(k,"style");return R?R[LC[P]]:null}if(X(lq,P))return t.getItemVisual(k,P)}function D(P){if(a.type==="cartesian2d"){var k=a.getBaseAxis();return cU(tt({axis:k},P))}}function L(){return e.getCurrentSeriesIndices()}function I(P){return y_(P,e)}}function Nq(r){var t={};return A(r.dimensions,function(e){var i=r.getDimensionInfo(e);if(!i.isExtraCoord){var n=i.coordDim,a=t[n]=t[n]||[];a[i.coordDimIndex]=r.getDimensionIndex(e)}}),t}function Ug(r,t,e,i,n,a,o){if(!i){a.remove(t);return}var s=Fx(r,t,e,i,n,a);return s&&o.setItemGraphicEl(e,s),s&&Kt(s,i.focus,i.blurScope,i.emphasisDisabled),s}function Fx(r,t,e,i,n,a){var o=-1,s=t;t&&CE(t,i,n)&&(o=vt(a.childrenRef(),t),t=null);var l=!t,u=t;u?u.clearStates():(u=zx(i),s&&kq(s,u)),i.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),xr.normal.cfg=xr.normal.conOpt=xr.emphasis.cfg=xr.emphasis.conOpt=xr.blur.cfg=xr.blur.conOpt=xr.select.cfg=xr.select.conOpt=null,xr.isLegacy=!1,zq(u,e,i,n,l,xr),Bq(u,e,i,n,l),Vx(r,u,e,i,xr,n,l),X(i,"info")&&(Zi(u).info=i.info);for(var h=0;h=0?a.replaceAt(u,o):a.add(u),u}function CE(r,t,e){var i=Zi(r),n=t.type,a=t.shape,o=t.style;return e.isUniversalTransitionEnabled()||n!=null&&n!==i.customGraphicType||n==="path"&&Wq(a)&&AE(a)!==i.customPathData||n==="image"&&X(o,"image")&&o.image!==i.customImagePath}function Bq(r,t,e,i,n){var a=e.clipPath;if(a===!1)r&&r.getClipPath()&&r.removeClipPath();else if(a){var o=r.getClipPath();o&&CE(o,a,i)&&(o=null),o||(o=zx(a),r.setClipPath(o)),Vx(null,o,t,a,null,i,n)}}function zq(r,t,e,i,n,a){if(!r.isGroup){BC(e,null,a),BC(e,ji,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(o!=null||s!=null||u!=null||l!=null){var h=r.getTextContent();if(o===!1)h&&r.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},h?h.clearStates():(h=zx(o),r.setTextContent(h)),Vx(null,h,t,o,null,i,n);for(var c=o&&o.style,f=0;f=h;v--){var d=t.childAt(v);Fq(t,d,n)}}}function Fq(r,t,e){t&&Td(t,Zi(r).option,e)}function Gq(r){new Qi(r.oldChildren,r.newChildren,zC,zC,r).add(VC).update(VC).remove(Hq).execute()}function zC(r,t){var e=r&&r.name;return e??Iq+t}function VC(r,t){var e=this.context,i=r!=null?e.newChildren[r]:null,n=t!=null?e.oldChildren[t]:null;Fx(e.api,n,e.dataIndex,i,e.seriesModel,e.group)}function Hq(r){var t=this.context,e=t.oldChildren[r];e&&Td(e,Zi(e).option,t.seriesModel)}function AE(r){return r&&(r.pathData||r.d)}function Wq(r){return r&&(X(r,"pathData")||X(r,"d"))}function Uq(r){r.registerChartView(Rq),r.registerSeriesModel(uq)}var Ha=Tt(),FC=it,Yg=$,Hx=function(){function r(){this._dragging=!1,this.animationThreshold=15}return r.prototype.render=function(t,e,i,n){var a=e.get("value"),o=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=i,!(!n&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,t,e,i);var h=u.graphicKey;h!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=h;var c=this._moveAnimation=this.determineAnimation(t,e);if(!s)s=this._group=new at,this.createPointerEl(s,u,t,e),this.createLabelEl(s,u,t,e),i.getZr().add(s);else{var f=ut(GC,e,c);this.updatePointerEl(s,u,f),this.updateLabelEl(s,u,f,e)}WC(s,e,!0),this._renderHandle(a)}},r.prototype.remove=function(t){this.clear(t)},r.prototype.dispose=function(t){this.clear(t)},r.prototype.determineAnimation=function(t,e){var i=e.get("animation"),n=t.axis,a=n.type==="category",o=e.get("snap");if(!o&&!a)return!1;if(i==="auto"||i==null){var s=this.animationThreshold;if(a&&n.getBandWidth()>s)return!0;if(o){var l=ux(t).seriesDataCount,u=n.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return i===!0},r.prototype.makeElOption=function(t,e,i,n,a){},r.prototype.createPointerEl=function(t,e,i,n){var a=e.pointer;if(a){var o=Ha(t).pointerEl=new wo[a.type](FC(e.pointer));t.add(o)}},r.prototype.createLabelEl=function(t,e,i,n){if(e.label){var a=Ha(t).labelEl=new St(FC(e.label));t.add(a),HC(a,n)}},r.prototype.updatePointerEl=function(t,e,i){var n=Ha(t).pointerEl;n&&e.pointer&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},r.prototype.updateLabelEl=function(t,e,i,n){var a=Ha(t).labelEl;a&&(a.setStyle(e.label.style),i(a,{x:e.label.x,y:e.label.y}),HC(a,n))},r.prototype._renderHandle=function(t){if(!(this._dragging||!this.updateHandleTransform)){var e=this._axisPointerModel,i=this._api.getZr(),n=this._handle,a=e.getModel("handle"),o=e.get("status");if(!a.get("show")||!o||o==="hide"){n&&i.remove(n),this._handle=null;return}var s;this._handle||(s=!0,n=this._handle=Gs(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){qi(u.event)},onmousedown:Yg(this._onHandleDragMove,this,0,0),drift:Yg(this._onHandleDragMove,this),ondragend:Yg(this._onHandleDragEnd,this)}),i.add(n)),WC(n,e,!1),n.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");V(l)||(l=[l,l]),n.scaleX=l[0]/2,n.scaleY=l[1]/2,Zs(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},r.prototype._moveHandleToValue=function(t,e){GC(this._axisPointerModel,!e&&this._moveAnimation,this._handle,$g(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},r.prototype._onHandleDragMove=function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform($g(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr($g(n)),Ha(i).lastProp=null,this._doDispatchAxisPointer()}},r.prototype._doDispatchAxisPointer=function(){var t=this._handle;if(t){var e=this._payloadInfo,i=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:i.axis.dim,axisIndex:i.componentIndex}]})}},r.prototype._onHandleDragEnd=function(){this._dragging=!1;var t=this._handle;if(t){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},r.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),i=this._group,n=this._handle;e&&i&&(this._lastGraphicKey=null,i&&e.remove(i),n&&e.remove(n),this._group=null,this._handle=null,this._payloadInfo=null),Wu(this,"_doDispatchAxisPointer")},r.prototype.doClear=function(){},r.prototype.buildLabel=function(t,e,i){return i=i||0,{x:t[i],y:t[1-i],width:e[i],height:e[1-i]}},r}();function GC(r,t,e,i){DE(Ha(e).lastProp,i)||(Ha(e).lastProp=i,t?At(e,i,r):(e.stopAnimation(),e.attr(i)))}function DE(r,t){if(et(r)&&et(t)){var e=!0;return A(t,function(i,n){e=e&&DE(r[n],i)}),!!e}else return r===t}function HC(r,t){r[t.get(["label","show"])?"show":"hide"]()}function $g(r){return{x:r.x||0,y:r.y||0,rotation:r.rotation||0}}function WC(r,t,e){var i=t.get("z"),n=t.get("zlevel");r&&r.traverse(function(a){a.type!=="group"&&(i!=null&&(a.z=i),n!=null&&(a.zlevel=n),a.silent=e)})}function Wx(r){var t=r.get("type"),e=r.getModel(t+"Style"),i;return t==="line"?(i=e.getLineStyle(),i.fill=null):t==="shadow"&&(i=e.getAreaStyle(),i.stroke=null),i}function LE(r,t,e,i,n){var a=e.get("value"),o=IE(a,t.axis,t.ecModel,e.get("seriesDataIndices"),{precision:e.get(["label","precision"]),formatter:e.get(["label","formatter"])}),s=e.getModel("label"),l=To(s.get("padding")||0),u=s.getFont(),h=fh(o,u),c=n.position,f=h.width+l[1]+l[3],v=h.height+l[0]+l[2],d=n.align;d==="right"&&(c[0]-=f),d==="center"&&(c[0]-=f/2);var p=n.verticalAlign;p==="bottom"&&(c[1]-=v),p==="middle"&&(c[1]-=v/2),Yq(c,f,v,i);var g=s.get("backgroundColor");(!g||g==="auto")&&(g=t.get(["axisLine","lineStyle","color"])),r.label={x:c[0],y:c[1],style:Gt(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:g}),z2:10}}function Yq(r,t,e,i){var n=i.getWidth(),a=i.getHeight();r[0]=Math.min(r[0]+t,n)-t,r[1]=Math.min(r[1]+e,a)-e,r[0]=Math.max(r[0],0),r[1]=Math.max(r[1],0)}function IE(r,t,e,i,n){r=t.scale.parse(r);var a=t.scale.getLabel({value:r},{precision:n.precision}),o=n.formatter;if(o){var s={value:J_(t,{value:r}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};A(i,function(l){var u=e.getSeriesByIndex(l.seriesIndex),h=l.dataIndexInside,c=u&&u.getDataParams(h);c&&s.seriesData.push(c)}),Y(o)?a=o.replace("{value}",a):Q(o)&&(a=o(s))}return a}function Ux(r,t,e){var i=or();return Qn(i,i,e.rotation),ti(i,i,e.position),Jr([r.dataToCoord(t),(e.labelOffset||0)+(e.labelDirection||1)*(e.labelMargin||0)],i)}function PE(r,t,e,i,n,a){var o=je.innerTextLayout(e.rotation,0,e.labelDirection);e.labelMargin=n.get(["label","margin"]),LE(t,i,n,a,{position:Ux(i.axis,r,e),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function Yx(r,t,e){return e=e||0,{x1:r[e],y1:r[1-e],x2:t[e],y2:t[1-e]}}function kE(r,t,e){return e=e||0,{x:r[e],y:r[1-e],width:t[e],height:t[1-e]}}function UC(r,t,e,i,n,a){return{cx:r,cy:t,r0:e,r:i,startAngle:n,endAngle:a,clockwise:!0}}var $q=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,i,n,a,o){var s=n.axis,l=s.grid,u=a.get("type"),h=YC(l,s).getOtherAxis(s).getGlobalExtent(),c=s.toGlobalCoord(s.dataToCoord(i,!0));if(u&&u!=="none"){var f=Wx(a),v=Xq[u](s,c,h);v.style=f,e.graphicKey=v.type,e.pointer=v}var d=Nm(l.model,n);PE(i,e,d,n,a,o)},t.prototype.getHandleTransform=function(e,i,n){var a=Nm(i.axis.grid.model,i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=Ux(i.axis,e,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,i,n,a){var o=n.axis,s=o.grid,l=o.getGlobalExtent(!0),u=YC(s,o).getOtherAxis(o).getGlobalExtent(),h=o.dim==="x"?0:1,c=[e.x,e.y];c[h]+=i[h],c[h]=Math.min(l[1],c[h]),c[h]=Math.max(l[0],c[h]);var f=(u[1]+u[0])/2,v=[f,f];v[h]=c[h];var d=[{verticalAlign:"middle"},{align:"center"}];return{x:c[0],y:c[1],rotation:e.rotation,cursorPoint:v,tooltipOption:d[h]}},t}(Hx);function YC(r,t){var e={};return e[t.dim+"AxisIndex"]=t.index,r.getCartesian(e)}var Xq={line:function(r,t,e){var i=Yx([t,e[0]],[t,e[1]],$C(r));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(r,t,e){var i=Math.max(1,r.getBandWidth()),n=e[1]-e[0];return{type:"Rect",shape:kE([t-i/2,e[0]],[i,n],$C(r))}}};function $C(r){return r.dim==="x"?0:1}var Zq=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},t}(yt),Xi=Tt(),jq=A;function RE(r,t,e){if(!mt.node){var i=t.getZr();Xi(i).records||(Xi(i).records={}),qq(i,t);var n=Xi(i).records[r]||(Xi(i).records[r]={});n.handler=e}}function qq(r,t){if(Xi(r).initialized)return;Xi(r).initialized=!0,e("click",ut(XC,"click")),e("mousemove",ut(XC,"mousemove")),e("globalout",Jq);function e(i,n){r.on(i,function(a){var o=Qq(t);jq(Xi(r).records,function(s){s&&n(s,a,o.dispatchAction)}),Kq(o.pendings,t)})}}function Kq(r,t){var e=r.showTip.length,i=r.hideTip.length,n;e?n=r.showTip[e-1]:i&&(n=r.hideTip[i-1]),n&&(n.dispatchAction=null,t.dispatchAction(n))}function Jq(r,t,e){r.handler("leave",null,e)}function XC(r,t,e,i){t.handler(r,e,i)}function Qq(r){var t={showTip:[],hideTip:[]},e=function(i){var n=t[i.type];n?n.push(i):(i.dispatchAction=e,r.dispatchAction(i))};return{dispatchAction:e,pendings:t}}function i0(r,t){if(!mt.node){var e=t.getZr(),i=(Xi(e).records||{})[r];i&&(Xi(e).records[r]=null)}}var tK=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,i,n){var a=i.getComponent("tooltip"),o=e.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";RE("axisPointer",n,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},t.prototype.remove=function(e,i){i0("axisPointer",i)},t.prototype.dispose=function(e,i){i0("axisPointer",i)},t.type="axisPointer",t}(Yt);function EE(r,t){var e=[],i=r.seriesIndex,n;if(i==null||!(n=t.getSeriesByIndex(i)))return{point:[]};var a=n.getData(),o=fo(a,r);if(o==null||o<0||V(o))return{point:[]};var s=a.getItemGraphicEl(o),l=n.coordinateSystem;if(n.getTooltipPosition)e=n.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(r.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u),c=h.dim,f=u.dim,v=c==="x"||c==="radius"?1:0,d=a.mapDimension(f),p=[];p[v]=a.get(d,o),p[1-v]=a.get(a.getCalculationInfo("stackResultDimension"),o),e=l.dataToPoint(p)||[]}else e=l.dataToPoint(a.getValues(F(l.dimensions,function(y){return a.mapDimension(y)}),o))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),e=[g.x+g.width/2,g.y+g.height/2]}return{point:e,el:s}}var ZC=Tt();function eK(r,t,e){var i=r.currTrigger,n=[r.x,r.y],a=r,o=r.dispatchAction||$(e.dispatchAction,e),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){yf(n)&&(n=EE({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=yf(n),u=a.axesInfo,h=s.axesInfo,c=i==="leave"||yf(n),f={},v={},d={list:[],map:{}},p={showPointer:ut(iK,v),showTooltip:ut(nK,d)};A(s.coordSysMap,function(y,m){var _=l||y.containPoint(n);A(s.coordSysAxesInfo[m],function(x,b){var S=x.axis,w=lK(u,x);if(!c&&_&&(!u||w)){var T=w&&w.value;T==null&&!l&&(T=S.pointToData(n)),T!=null&&jC(x,T,p,!1,f)}})});var g={};return A(h,function(y,m){var _=y.linkGroup;_&&!v[m]&&A(_.axesInfo,function(x,b){var S=v[b];if(x!==y&&S){var w=S.value;_.mapper&&(w=y.axis.scale.parse(_.mapper(w,qC(x),qC(y)))),g[y.key]=w}})}),A(g,function(y,m){jC(h[m],y,p,!0,f)}),aK(v,h,f),oK(d,n,r,o),sK(h,o,e),f}}function jC(r,t,e,i,n){var a=r.axis;if(!(a.scale.isBlank()||!a.containData(t))){if(!r.involveSeries){e.showPointer(r,t);return}var o=rK(t,r),s=o.payloadBatch,l=o.snapToValue;s[0]&&n.seriesIndex==null&&z(n,s[0]),!i&&r.snap&&a.containData(l)&&l!=null&&(t=l),e.showPointer(r,t,s),e.showTooltip(r,o,l)}}function rK(r,t){var e=t.axis,i=e.dim,n=r,a=[],o=Number.MAX_VALUE,s=-1;return A(t.seriesModels,function(l,u){var h=l.getData().mapDimensionsAll(i),c,f;if(l.getAxisTooltipData){var v=l.getAxisTooltipData(h,r,e);f=v.dataIndices,c=v.nestestValue}else{if(f=l.getData().indicesOfNearest(h[0],r,e.type==="category"?.5:null),!f.length)return;c=l.getData().get(h[0],f[0])}if(!(c==null||!isFinite(c))){var d=r-c,p=Math.abs(d);p<=o&&((p=0&&s<0)&&(o=p,s=d,n=c,a.length=0),A(f,function(g){a.push({seriesIndex:l.seriesIndex,dataIndexInside:g,dataIndex:l.getData().getRawIndex(g)})}))}}),{payloadBatch:a,snapToValue:n}}function iK(r,t,e,i){r[t.key]={value:e,payloadBatch:i}}function nK(r,t,e,i){var n=e.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(!(!t.triggerTooltip||!n.length)){var l=t.coordSys.model,u=qu(l),h=r.map[u];h||(h=r.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},r.list.push(h)),h.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:n.slice()})}}function aK(r,t,e){var i=e.axesInfo=[];A(t,function(n,a){var o=n.axisPointerModel.option,s=r[a];s?(!n.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!n.useHandle&&(o.status="hide"),o.status==="show"&&i.push({axisDim:n.axis.dim,axisIndex:n.axis.model.componentIndex,value:o.value})})}function oK(r,t,e,i){if(yf(t)||!r.list.length){i({type:"hideTip"});return}var n=((r.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:e.tooltipOption,position:e.position,dataIndexInside:n.dataIndexInside,dataIndex:n.dataIndex,seriesIndex:n.seriesIndex,dataByCoordSys:r.list})}function sK(r,t,e){var i=e.getZr(),n="axisPointerLastHighlights",a=ZC(i)[n]||{},o=ZC(i)[n]={};A(r,function(u,h){var c=u.axisPointerModel.option;c.status==="show"&&u.triggerEmphasis&&A(c.seriesDataIndices,function(f){var v=f.seriesIndex+" | "+f.dataIndex;o[v]=f})});var s=[],l=[];A(a,function(u,h){!o[h]&&l.push(u)}),A(o,function(u,h){!a[h]&&s.push(u)}),l.length&&e.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&e.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function lK(r,t){for(var e=0;e<(r||[]).length;e++){var i=r[e];if(t.axis.dim===i.axisDim&&t.axis.model.componentIndex===i.axisIndex)return i}}function qC(r){var t=r.axis.model,e={},i=e.axisDim=r.axis.dim;return e.axisIndex=e[i+"AxisIndex"]=t.componentIndex,e.axisName=e[i+"AxisName"]=t.name,e.axisId=e[i+"AxisId"]=t.id,e}function yf(r){return!r||r[0]==null||isNaN(r[0])||r[1]==null||isNaN(r[1])}function Ih(r){Ao.registerAxisPointerClass("CartesianAxisPointer",$q),r.registerComponentModel(Zq),r.registerComponentView(tK),r.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!V(e)&&(t.axisPointer.link=[e])}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=m$(t,e)}),r.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},eK)}function uK(r){pt(lR),pt(Ih)}var hK=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,i,n,a,o){var s=n.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,u=l.getOtherAxis(s),h=u.getExtent(),c=s.dataToCoord(i),f=a.get("type");if(f&&f!=="none"){var v=Wx(a),d=fK[f](s,l,c,h);d.style=v,e.graphicKey=d.type,e.pointer=d}var p=a.get(["label","margin"]),g=cK(i,n,a,l,p);LE(e,n,a,o,g)},t}(Hx);function cK(r,t,e,i,n){var a=t.axis,o=a.dataToCoord(r),s=i.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=i.getRadiusAxis().getExtent(),u,h,c;if(a.dim==="radius"){var f=or();Qn(f,f,s),ti(f,f,[i.cx,i.cy]),u=Jr([o,-n],f);var v=t.getModel("axisLabel").get("rotate")||0,d=je.innerTextLayout(s,v*Math.PI/180,-1);h=d.textAlign,c=d.textVerticalAlign}else{var p=l[1];u=i.coordToPoint([p+n,o]);var g=i.cx,y=i.cy;h=Math.abs(u[0]-g)/p<.3?"center":u[0]>g?"left":"right",c=Math.abs(u[1]-y)/p<.3?"middle":u[1]>y?"top":"bottom"}return{position:u,align:h,verticalAlign:c}}var fK={line:function(r,t,e,i){return r.dim==="angle"?{type:"Line",shape:Yx(t.coordToPoint([i[0],e]),t.coordToPoint([i[1],e]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r:e}}},shadow:function(r,t,e,i){var n=Math.max(1,r.getBandWidth()),a=Math.PI/180;return r.dim==="angle"?{type:"Sector",shape:UC(t.cx,t.cy,i[0],i[1],(-e-n/2)*a,(-e+n/2)*a)}:{type:"Sector",shape:UC(t.cx,t.cy,e-n/2,e+n/2,0,Math.PI*2)}}},vK=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.findAxisModel=function(e){var i,n=this.ecModel;return n.eachComponent(e,function(a){a.getCoordSysModel()===this&&(i=a)},this),i},t.type="polar",t.dependencies=["radiusAxis","angleAxis"],t.defaultOption={z:0,center:["50%","50%"],radius:"80%"},t}(yt),$x=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",le).models[0]},t.type="polarAxis",t}(yt);re($x,Js);var dK=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="angleAxis",t}($x),pK=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="radiusAxis",t}($x),Xx=function(r){E(t,r);function t(e,i){return r.call(this,"radius",e,i)||this}return t.prototype.pointToData=function(e,i){return this.polar.pointToData(e,i)[this.dim==="radius"?0:1]},t}(Br);Xx.prototype.dataToRadius=Br.prototype.dataToCoord;Xx.prototype.radiusToData=Br.prototype.coordToData;var gK=Tt(),Zx=function(r){E(t,r);function t(e,i){return r.call(this,"angle",e,i||[0,360])||this}return t.prototype.pointToData=function(e,i){return this.polar.pointToData(e,i)[this.dim==="radius"?0:1]},t.prototype.calculateCategoryInterval=function(){var e=this,i=e.getLabelModel(),n=e.scale,a=n.getExtent(),o=n.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=e.dataToCoord(s+1)-e.dataToCoord(s),u=Math.abs(l),h=fh(s==null?"":s+"",i.getFont(),"center","top"),c=Math.max(h.height,7),f=c/u;isNaN(f)&&(f=1/0);var v=Math.max(0,Math.floor(f)),d=gK(e.model),p=d.lastAutoInterval,g=d.lastTickCount;return p!=null&&g!=null&&Math.abs(p-v)<=1&&Math.abs(g-o)<=1&&p>v?v=p:(d.lastTickCount=o,d.lastAutoInterval=v),v},t}(Br);Zx.prototype.dataToAngle=Br.prototype.dataToCoord;Zx.prototype.angleToData=Br.prototype.coordToData;var OE=["radius","angle"],yK=function(){function r(t){this.dimensions=OE,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new Xx,this._angleAxis=new Zx,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}return r.prototype.containPoint=function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},r.prototype.containData=function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},r.prototype.getAxis=function(t){var e="_"+t+"Axis";return this[e]},r.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},r.prototype.getAxesByScale=function(t){var e=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===t&&e.push(i),n.scale.type===t&&e.push(n),e},r.prototype.getAngleAxis=function(){return this._angleAxis},r.prototype.getRadiusAxis=function(){return this._radiusAxis},r.prototype.getOtherAxis=function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},r.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},r.prototype.getTooltipAxes=function(t){var e=t!=null&&t!=="auto"?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},r.prototype.dataToPoint=function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},r.prototype.pointToData=function(t,e){var i=this.pointToCoord(t);return[this._radiusAxis.radiusToData(i[0],e),this._angleAxis.angleToData(i[1],e)]},r.prototype.pointToCoord=function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=this.getAngleAxis(),a=n.getExtent(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);n.inverse?o=s-360:s=o+360;var l=Math.sqrt(e*e+i*i);e/=l,i/=l;for(var u=Math.atan2(-i,e)/Math.PI*180,h=us;)u+=h*360;return[l,u]},r.prototype.coordToPoint=function(t){var e=t[0],i=t[1]/180*Math.PI,n=Math.cos(i)*e+this.cx,a=-Math.sin(i)*e+this.cy;return[n,a]},r.prototype.getArea=function(){var t=this.getAngleAxis(),e=this.getRadiusAxis(),i=e.getExtent().slice();i[0]>i[1]&&i.reverse();var n=t.getExtent(),a=Math.PI/180,o=1e-4;return{cx:this.cx,cy:this.cy,r0:i[0],r:i[1],startAngle:-n[0]*a,endAngle:-n[1]*a,clockwise:t.inverse,contain:function(s,l){var u=s-this.cx,h=l-this.cy,c=u*u+h*h,f=this.r,v=this.r0;return f!==v&&c-o<=f*f&&c+o>=v*v}}},r.prototype.convertToPixel=function(t,e,i){var n=KC(e);return n===this?this.dataToPoint(i):null},r.prototype.convertFromPixel=function(t,e,i){var n=KC(e);return n===this?this.pointToData(i):null},r}();function KC(r){var t=r.seriesModel,e=r.polarModel;return e&&e.coordinateSystem||t&&t.coordinateSystem}function mK(r,t,e){var i=t.get("center"),n=e.getWidth(),a=e.getHeight();r.cx=U(i[0],n),r.cy=U(i[1],a);var o=r.getRadiusAxis(),s=Math.min(n,a)/2,l=t.get("radius");l==null?l=[0,"100%"]:V(l)||(l=[0,l]);var u=[U(l[0],s),U(l[1],s)];o.inverse?o.setExtent(u[1],u[0]):o.setExtent(u[0],u[1])}function _K(r,t){var e=this,i=e.getAngleAxis(),n=e.getRadiusAxis();if(i.scale.setExtent(1/0,-1/0),n.scale.setExtent(1/0,-1/0),r.eachSeries(function(s){if(s.coordinateSystem===e){var l=s.getData();A(av(l,"radius"),function(u){n.scale.unionExtentFromData(l,u)}),A(av(l,"angle"),function(u){i.scale.unionExtentFromData(l,u)})}}),yo(i.scale,i.model),yo(n.scale,n.model),i.type==="category"&&!i.onBand){var a=i.getExtent(),o=360/i.scale.count();i.inverse?a[1]+=o:a[1]-=o,i.setExtent(a[0],a[1])}}function xK(r){return r.mainType==="angleAxis"}function JC(r,t){var e;if(r.type=t.get("type"),r.scale=bh(t),r.onBand=t.get("boundaryGap")&&r.type==="category",r.inverse=t.get("inverse"),xK(t)){r.inverse=r.inverse!==t.get("clockwise");var i=t.get("startAngle"),n=(e=t.get("endAngle"))!==null&&e!==void 0?e:i+(r.inverse?-360:360);r.setExtent(i,n)}t.axis=r,r.model=t}var bK={dimensions:OE,create:function(r,t){var e=[];return r.eachComponent("polar",function(i,n){var a=new yK(n+"");a.update=_K;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=i.findAxisModel("radiusAxis"),u=i.findAxisModel("angleAxis");JC(o,l),JC(s,u),mK(a,i,t),e.push(a),i.coordinateSystem=a,a.model=i}),r.eachSeries(function(i){if(i.get("coordinateSystem")==="polar"){var n=i.getReferringComponents("polar",le).models[0];i.coordinateSystem=n.coordinateSystem}}),e}},SK=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function Bc(r,t,e){t[1]>t[0]&&(t=t.slice().reverse());var i=r.coordToPoint([t[0],e]),n=r.coordToPoint([t[1],e]);return{x1:i[0],y1:i[1],x2:n[0],y2:n[1]}}function zc(r){var t=r.getRadiusAxis();return t.inverse?0:1}function QC(r){var t=r[0],e=r[r.length-1];t&&e&&Math.abs(Math.abs(t.coord-e.coord)-360)<1e-4&&r.pop()}var wK=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.axisPointerClass="PolarAxisPointer",e}return t.prototype.render=function(e,i){if(this.group.removeAll(),!!e.get("show")){var n=e.axis,a=n.polar,o=a.getRadiusAxis().getExtent(),s=n.getTicksCoords(),l=n.getMinorTicksCoords(),u=F(n.getViewLabels(),function(h){h=it(h);var c=n.scale,f=c.type==="ordinal"?c.getRawOrdinalNumber(h.tickValue):h.tickValue;return h.coord=n.dataToCoord(f),h});QC(u),QC(s),A(SK,function(h){e.get([h,"show"])&&(!n.scale.isBlank()||h==="axisLine")&&TK[h](this.group,e,a,s,l,o,u)},this)}},t.type="angleAxis",t}(Ao),TK={axisLine:function(r,t,e,i,n,a){var o=t.getModel(["axisLine","lineStyle"]),s=e.getAngleAxis(),l=Math.PI/180,u=s.getExtent(),h=zc(e),c=h?0:1,f,v=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[c]===0?f=new wo[v]({shape:{cx:e.cx,cy:e.cy,r:a[h],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):f=new Bs({shape:{cx:e.cx,cy:e.cy,r:a[h],r0:a[c]},style:o.getLineStyle(),z2:1,silent:!0}),f.style.fill=null,r.add(f)},axisTick:function(r,t,e,i,n,a){var o=t.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[zc(e)],u=F(i,function(h){return new ce({shape:Bc(e,[l,l+s],h.coord)})});r.add(cr(u,{style:tt(o.getModel("lineStyle").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})}))},minorTick:function(r,t,e,i,n,a){if(n.length){for(var o=t.getModel("axisTick"),s=t.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[zc(e)],h=[],c=0;cy?"left":"right",x=Math.abs(g[1]-m)/p<.3?"middle":g[1]>m?"top":"bottom";if(s&&s[d]){var b=s[d];et(b)&&b.textStyle&&(v=new Lt(b.textStyle,l,l.ecModel))}var S=new St({silent:je.isLabelSilent(t),style:Gt(v,{x:g[0],y:g[1],fill:v.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:c.formattedLabel,align:_,verticalAlign:x})});if(r.add(S),h){var w=je.makeAxisEventDataBase(t);w.targetType="axisLabel",w.value=c.rawLabel,ot(S).eventData=w}},this)},splitLine:function(r,t,e,i,n,a){var o=t.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var h=[],c=0;c=0?"p":"n",k=M;b&&(i[h][I]||(i[h][I]={p:M,n:M}),k=i[h][I][P]);var R=void 0,N=void 0,O=void 0,B=void 0;if(d.dim==="radius"){var G=d.dataToCoord(L)-M,H=l.dataToCoord(I);Math.abs(G)=B})}}})}function PK(r){var t={};A(r,function(i,n){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=BE(o,s),u=s.getExtent(),h=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),c=t[l]||{bandWidth:h,remainedWidth:h,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},f=c.stacks;t[l]=c;var v=NE(i);f[v]||c.autoWidthCount++,f[v]=f[v]||{width:0,maxWidth:0};var d=U(i.get("barWidth"),h),p=U(i.get("barMaxWidth"),h),g=i.get("barGap"),y=i.get("barCategoryGap");d&&!f[v].width&&(d=Math.min(c.remainedWidth,d),f[v].width=d,c.remainedWidth-=d),p&&(f[v].maxWidth=p),g!=null&&(c.gap=g),y!=null&&(c.categoryGap=y)});var e={};return A(t,function(i,n){e[n]={};var a=i.stacks,o=i.bandWidth,s=U(i.categoryGap,o),l=U(i.gap,1),u=i.remainedWidth,h=i.autoWidthCount,c=(u-s)/(h+(h-1)*l);c=Math.max(c,0),A(a,function(p,g){var y=p.maxWidth;y&&y=e.y&&t[1]<=e.y+e.height:i.contain(i.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},r.prototype.pointToData=function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t[e.orient==="horizontal"?0:1]))]},r.prototype.dataToPoint=function(t){var e=this.getAxis(),i=this.getRect(),n=[],a=e.orient==="horizontal"?0:1;return t instanceof Array&&(t=t[0]),n[a]=e.toGlobalCoord(e.dataToCoord(+t)),n[1-a]=a===0?i.y+i.height/2:i.x+i.width/2,n},r.prototype.convertToPixel=function(t,e,i){var n=tA(e);return n===this?this.dataToPoint(i):null},r.prototype.convertFromPixel=function(t,e,i){var n=tA(e);return n===this?this.pointToData(i):null},r}();function tA(r){var t=r.seriesModel,e=r.singleAxisModel;return e&&e.coordinateSystem||t&&t.coordinateSystem}function HK(r,t){var e=[];return r.eachComponent("singleAxis",function(i,n){var a=new GK(i,r,t);a.name="single_"+n,a.resize(i,t),i.coordinateSystem=a,e.push(a)}),r.eachSeries(function(i){if(i.get("coordinateSystem")==="singleAxis"){var n=i.getReferringComponents("singleAxis",le).models[0];i.coordinateSystem=n&&n.coordinateSystem}}),e}var WK={create:HK,dimensions:zE},eA=["x","y"],UK=["width","height"],YK=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,i,n,a,o){var s=n.axis,l=s.coordinateSystem,u=Xg(l,1-_v(s)),h=l.dataToPoint(i)[0],c=a.get("type");if(c&&c!=="none"){var f=Wx(a),v=$K[c](s,h,u);v.style=f,e.graphicKey=v.type,e.pointer=v}var d=n0(n);PE(i,e,d,n,a,o)},t.prototype.getHandleTransform=function(e,i,n){var a=n0(i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=Ux(i.axis,e,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,i,n,a){var o=n.axis,s=o.coordinateSystem,l=_v(o),u=Xg(s,l),h=[e.x,e.y];h[l]+=i[l],h[l]=Math.min(u[1],h[l]),h[l]=Math.max(u[0],h[l]);var c=Xg(s,1-l),f=(c[1]+c[0])/2,v=[f,f];return v[l]=h[l],{x:h[0],y:h[1],rotation:e.rotation,cursorPoint:v,tooltipOption:{verticalAlign:"middle"}}},t}(Hx),$K={line:function(r,t,e){var i=Yx([t,e[0]],[t,e[1]],_v(r));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(r,t,e){var i=r.getBandWidth(),n=e[1]-e[0];return{type:"Rect",shape:kE([t-i/2,e[0]],[i,n],_v(r))}}};function _v(r){return r.isHorizontal()?0:1}function Xg(r,t){var e=r.getRect();return[e[eA[t]],e[eA[t]]+e[UK[t]]]}var XK=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="single",t}(Yt);function ZK(r){pt(Ih),Ao.registerAxisPointerClass("SingleAxisPointer",YK),r.registerComponentView(XK),r.registerComponentView(zK),r.registerComponentModel(mf),Is(r,"single",mf,mf.defaultOption),r.registerCoordinateSystem("single",WK)}var jK=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.init=function(e,i,n){var a=Us(e);r.prototype.init.apply(this,arguments),rA(e,a)},t.prototype.mergeOption=function(e){r.prototype.mergeOption.apply(this,arguments),rA(this.option,e)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type="calendar",t.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},t}(yt);function rA(r,t){var e=r.cellSize,i;V(e)?i=e:i=r.cellSize=[e,e],i.length===1&&(i[1]=i[0]);var n=F([0,1],function(a){return QH(t,a)&&(i[a]="auto"),i[a]!=null&&i[a]!=="auto"});Zn(r,t,{type:"box",ignoreSize:n})}var qK=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,i,n){var a=this.group;a.removeAll();var o=e.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),u=i.getLocaleModel();this._renderDayRect(e,s,a),this._renderLines(e,s,l,a),this._renderYearText(e,s,l,a),this._renderMonthText(e,u,l,a),this._renderWeekText(e,u,s,l,a)},t.prototype._renderDayRect=function(e,i,n){for(var a=e.coordinateSystem,o=e.getModel("itemStyle").getItemStyle(),s=a.getCellWidth(),l=a.getCellHeight(),u=i.start.time;u<=i.end.time;u=a.getNextNDay(u,1).time){var h=a.dataToRect([u],!1).tl,c=new wt({shape:{x:h[0],y:h[1],width:s,height:l},cursor:"default",style:o});n.add(c)}},t.prototype._renderLines=function(e,i,n,a){var o=this,s=e.coordinateSystem,l=e.getModel(["splitLine","lineStyle"]).getLineStyle(),u=e.get(["splitLine","show"]),h=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var c=i.start,f=0;c.time<=i.end.time;f++){d(c.formatedDate),f===0&&(c=s.getDateInfo(i.start.y+"-"+i.start.m));var v=c.date;v.setMonth(v.getMonth()+1),c=s.getDateInfo(v)}d(s.getNextNDay(i.end.time,1).formatedDate);function d(p){o._firstDayOfMonth.push(s.getDateInfo(p)),o._firstDayPoints.push(s.dataToRect([p],!1).tl);var g=o._getLinePointsOfOneWeek(e,p,n);o._tlpoints.push(g[0]),o._blpoints.push(g[g.length-1]),u&&o._drawSplitline(g,l,a)}u&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,h,n),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,h,n),l,a)},t.prototype._getEdgesPoints=function(e,i,n){var a=[e[0].slice(),e[e.length-1].slice()],o=n==="horizontal"?0:1;return a[0][o]=a[0][o]-i/2,a[1][o]=a[1][o]+i/2,a},t.prototype._drawSplitline=function(e,i,n){var a=new We({z2:20,shape:{points:e},style:i});n.add(a)},t.prototype._getLinePointsOfOneWeek=function(e,i,n){for(var a=e.coordinateSystem,o=a.getDateInfo(i),s=[],l=0;l<7;l++){var u=a.getNextNDay(o.time,l),h=a.dataToRect([u.time],!1);s[2*u.day]=h.tl,s[2*u.day+1]=h[n==="horizontal"?"bl":"tr"]}return s},t.prototype._formatterLabel=function(e,i){return Y(e)&&e?jH(e,i):Q(e)?e(i):i.nameMap},t.prototype._yearTextPositionControl=function(e,i,n,a,o){var s=i[0],l=i[1],u=["center","bottom"];a==="bottom"?(l+=o,u=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,u=["center","top"]):l-=o;var h=0;return(a==="left"||a==="right")&&(h=Math.PI/2),{rotation:h,x:s,y:l,style:{align:u[0],verticalAlign:u[1]}}},t.prototype._renderYearText=function(e,i,n,a){var o=e.getModel("yearLabel");if(o.get("show")){var s=o.get("margin"),l=o.get("position");l||(l=n!=="horizontal"?"top":"left");var u=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],h=(u[0][0]+u[1][0])/2,c=(u[0][1]+u[1][1])/2,f=n==="horizontal"?0:1,v={top:[h,u[f][1]],bottom:[h,u[1-f][1]],left:[u[1-f][0],c],right:[u[f][0],c]},d=i.start.y;+i.end.y>+i.start.y&&(d=d+"-"+i.end.y);var p=o.get("formatter"),g={start:i.start.y,end:i.end.y,nameMap:d},y=this._formatterLabel(p,g),m=new St({z2:30,style:Gt(o,{text:y}),silent:o.get("silent")});m.attr(this._yearTextPositionControl(m,v[l],n,l,s)),a.add(m)}},t.prototype._monthTextPositionControl=function(e,i,n,a,o){var s="left",l="top",u=e[0],h=e[1];return n==="horizontal"?(h=h+o,i&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,i&&(l="middle"),a==="start"&&(s="right")),{x:u,y:h,align:s,verticalAlign:l}},t.prototype._renderMonthText=function(e,i,n,a){var o=e.getModel("monthLabel");if(o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),h=o.get("align"),c=[this._tlpoints,this._blpoints];(!s||Y(s))&&(s&&(i=cm(s)||i),s=i.get(["time","monthAbbr"])||[]);var f=u==="start"?0:1,v=n==="horizontal"?0:1;l=u==="start"?-l:l;for(var d=h==="center",p=o.get("silent"),g=0;g=n.start.time&&i.times.end.time&&e.reverse(),e},r.prototype._getRangeInfo=function(t){var e=[this.getDateInfo(t[0]),this.getDateInfo(t[1])],i;e[0].time>e[1].time&&(i=!0,e.reverse());var n=Math.floor(e[1].time/Zg)-Math.floor(e[0].time/Zg)+1,a=new Date(e[0].time),o=a.getDate(),s=e[1].date.getDate();a.setDate(o+n-1);var l=a.getDate();if(l!==s)for(var u=a.getTime()-e[1].time>0?1:-1;(l=a.getDate())!==s&&(a.getTime()-e[1].time)*u>0;)n-=u,a.setDate(l-u);var h=Math.floor((n+e[0].day+6)/7),c=i?-h+1:h-1;return i&&e.reverse(),{range:[e[0].formatedDate,e[1].formatedDate],start:e[0],end:e[1],allDay:n,weeks:h,nthWeek:c,fweek:e[0].day,lweek:e[1].day}},r.prototype._getDateByWeeksAndDay=function(t,e,i){var n=this._getRangeInfo(i);if(t>n.weeks||t===0&&en.lweek)return null;var a=(t-1)*7-n.fweek+e,o=new Date(n.start.time);return o.setDate(+n.start.d+a),this.getDateInfo(o)},r.create=function(t,e){var i=[];return t.eachComponent("calendar",function(n){var a=new r(n);i.push(a),n.coordinateSystem=a}),t.eachSeries(function(n){n.get("coordinateSystem")==="calendar"&&(n.coordinateSystem=i[n.get("calendarIndex")||0])}),i},r.dimensions=["time","value"],r}();function iA(r){var t=r.calendarModel,e=r.seriesModel,i=t?t.coordinateSystem:e?e.coordinateSystem:null;return i}function JK(r){r.registerComponentModel(jK),r.registerComponentView(qK),r.registerCoordinateSystem("calendar",KK)}function QK(r,t){var e=r.existing;if(t.id=r.keyInfo.id,!t.type&&e&&(t.type=e.type),t.parentId==null){var i=t.parentOption;i?t.parentId=i.id:e&&(t.parentId=e.parentId)}t.parentOption=null}function nA(r,t){var e;return A(t,function(i){r[i]!=null&&r[i]!=="auto"&&(e=!0)}),e}function tJ(r,t,e){var i=z({},e),n=r[t],a=e.$action||"merge";a==="merge"?n?(ht(n,i,!0),Zn(n,i,{ignoreSize:!0}),AI(e,n),Vc(e,n),Vc(e,n,"shape"),Vc(e,n,"style"),Vc(e,n,"extra"),e.clipPath=n.clipPath):r[t]=i:a==="replace"?r[t]=i:a==="remove"&&n&&(r[t]=null)}var VE=["transition","enterFrom","leaveTo"],eJ=VE.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function Vc(r,t,e){if(e&&(!r[e]&&t[e]&&(r[e]={}),r=r[e],t=t[e]),!(!r||!t))for(var i=e?VE:eJ,n=0;n=0;h--){var c=n[h],f=he(c.id,null),v=f!=null?o.get(f):null;if(v){var d=v.parent,y=Mr(d),m=d===a?{width:s,height:l}:{width:y.width,height:y.height},_={},x=sd(v,c,m,null,{hv:c.hv,boundingMode:c.bounding},_);if(!Mr(v).isNew&&x){for(var b=c.transition,S={},w=0;w=0)?S[T]=M:v[T]=M}At(v,S,e,0)}else v.attr(_)}}},t.prototype._clear=function(){var e=this,i=this._elMap;i.each(function(n){_f(n,Mr(n).option,i,e._lastGraphicModel)}),this._elMap=Z()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(Yt);function a0(r){var t=X(aA,r)?aA[r]:td(r),e=new t({});return Mr(e).type=r,e}function oA(r,t,e,i){var n=a0(e);return t.add(n),i.set(r,n),Mr(n).id=r,Mr(n).isNew=!0,n}function _f(r,t,e,i){var n=r&&r.parent;n&&(r.type==="group"&&r.traverse(function(a){_f(a,t,e,i)}),Td(r,t,i),e.removeKey(Mr(r).id))}function sA(r,t,e,i){r.isGroup||A([["cursor",kr.prototype.cursor],["zlevel",i||0],["z",e||0],["z2",0]],function(n){var a=n[0];X(t,a)?r[a]=lt(t[a],n[1]):r[a]==null&&(r[a]=n[1])}),A(xt(t),function(n){if(n.indexOf("on")===0){var a=t[n];r[n]=Q(a)?a:null}}),X(t,"draggable")&&(r.draggable=t.draggable),t.name!=null&&(r.name=t.name),t.id!=null&&(r.id=t.id)}function aJ(r){return r=z({},r),A(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(CI),function(t){delete r[t]}),r}function oJ(r,t,e){var i=ot(r).eventData;!r.silent&&!r.ignore&&!i&&(i=ot(r).eventData={componentType:"graphic",componentIndex:t.componentIndex,name:r.name}),i&&(i.info=e.info)}function sJ(r){r.registerComponentModel(iJ),r.registerComponentView(nJ),r.registerPreprocessor(function(t){var e=t.graphic;V(e)?!e[0]||!e[0].elements?t.graphic=[{elements:e}]:t.graphic=[t.graphic[0]]:e&&!e.elements&&(t.graphic=[{elements:[e]}])})}var lA=["x","y","radius","angle","single"],lJ=["cartesian2d","polar","singleAxis"];function uJ(r){var t=r.get("coordinateSystem");return vt(lJ,t)>=0}function Rn(r){return r+"Axis"}function hJ(r,t){var e=Z(),i=[],n=Z();r.eachComponent({mainType:"dataZoom",query:t},function(h){n.get(h.uid)||s(h)});var a;do a=!1,r.eachComponent("dataZoom",o);while(a);function o(h){!n.get(h.uid)&&l(h)&&(s(h),a=!0)}function s(h){n.set(h.uid,!0),i.push(h),u(h)}function l(h){var c=!1;return h.eachTargetAxis(function(f,v){var d=e.get(f);d&&d[v]&&(c=!0)}),c}function u(h){h.eachTargetAxis(function(c,f){(e.get(c)||e.set(c,[]))[f]=!0})}return i}function FE(r){var t=r.ecModel,e={infoList:[],infoMap:Z()};return r.eachTargetAxis(function(i,n){var a=t.getComponent(Rn(i),n);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=e.infoMap.get(s);l||(l={model:o,axisModels:[]},e.infoList.push(l),e.infoMap.set(s,l)),l.axisModels.push(a)}}}),e}var jg=function(){function r(){this.indexList=[],this.indexMap=[]}return r.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},r}(),rh=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e._autoThrottle=!0,e._noTarget=!0,e._rangePropMode=["percent","percent"],e}return t.prototype.init=function(e,i,n){var a=uA(e);this.settledOption=a,this.mergeDefaultAndTheme(e,n),this._doInit(a)},t.prototype.mergeOption=function(e){var i=uA(e);ht(this.option,e,!0),ht(this.settledOption,i,!0),this._doInit(i)},t.prototype._doInit=function(e){var i=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;A([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(i[a[0]]=n[a[0]]=null)},this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get("orient",!0),i=this._targetAxisInfoMap=Z(),n=this._fillSpecifiedTargetAxis(i);n?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||"horizontal",this._fillAutoTargetAxisByOrient(i,this._orient)),this._noTarget=!0,i.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},t.prototype._fillSpecifiedTargetAxis=function(e){var i=!1;return A(lA,function(n){var a=this.getReferringComponents(Rn(n),GG);if(a.specified){i=!0;var o=new jg;A(a.models,function(s){o.add(s.componentIndex)}),e.set(n,o)}},this),i},t.prototype._fillAutoTargetAxisByOrient=function(e,i){var n=this.ecModel,a=!0;if(a){var o=i==="vertical"?"y":"x",s=n.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=n.findComponents({mainType:"singleAxis",filter:function(h){return h.get("orient",!0)===i}});l(s,"single")}function l(u,h){var c=u[0];if(c){var f=new jg;if(f.add(c.componentIndex),e.set(h,f),a=!1,h==="x"||h==="y"){var v=c.getReferringComponents("grid",le).models[0];v&&A(u,function(d){c.componentIndex!==d.componentIndex&&v===d.getReferringComponents("grid",le).models[0]&&f.add(d.componentIndex)})}}}a&&A(lA,function(u){if(a){var h=n.findComponents({mainType:Rn(u),filter:function(f){return f.get("type",!0)==="category"}});if(h[0]){var c=new jg;c.add(h[0].componentIndex),e.set(u,c),a=!1}}},this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis(function(i){!e&&(e=i)},this),e==="y"?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var i=this.ecModel.option;this.option.throttle=i.animation&&i.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var i=this._rangePropMode,n=this.get("rangeMode");A([["start","startValue"],["end","endValue"]],function(a,o){var s=e[a[0]]!=null,l=e[a[1]]!=null;s&&!l?i[o]="percent":!s&&l?i[o]="value":n?i[o]=n[o]:s&&(i[o]="percent")})},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis(function(i,n){e==null&&(e=this.ecModel.getComponent(Rn(i),n))},this),e},t.prototype.eachTargetAxis=function(e,i){this._targetAxisInfoMap.each(function(n,a){A(n.indexList,function(o){e.call(i,a,o)})})},t.prototype.getAxisProxy=function(e,i){var n=this.getAxisModel(e,i);if(n)return n.__dzAxisProxy},t.prototype.getAxisModel=function(e,i){var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[i])return this.ecModel.getComponent(Rn(e),i)},t.prototype.setRawRange=function(e){var i=this.option,n=this.settledOption;A([["start","startValue"],["end","endValue"]],function(a){(e[a[0]]!=null||e[a[1]]!=null)&&(i[a[0]]=n[a[0]]=e[a[0]],i[a[1]]=n[a[1]]=e[a[1]])},this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var i=this.option;A(["start","startValue","end","endValue"],function(n){i[n]=e[n]})},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},t.prototype.getValueRange=function(e,i){if(e==null&&i==null){var n=this.findRepresentativeAxisProxy();if(n)return n.getDataValueWindow()}else return this.getAxisProxy(e,i).getDataValueWindow()},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return e.__dzAxisProxy;for(var i,n=this._targetAxisInfoMap.keys(),a=0;ao[1];if(_&&!x&&!b)return!0;_&&(g=!0),x&&(d=!0),b&&(p=!0)}return g&&d&&p})}else is(h,function(v){if(a==="empty")l.setData(u=u.map(v,function(p){return s(p)?p:NaN}));else{var d={};d[v]=o,u.selectRange(d)}});is(h,function(v){u.setApproximateExtent(o,v)})}});function s(l){return l>=o[0]&&l<=o[1]}},r.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,i=this._dataExtent;is(["min","max"],function(n){var a=e.get(n+"Span"),o=e.get(n+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=Pt(i[0]+o,i,[0,100],!0):a!=null&&(o=Pt(a,[0,100],i,!0)-i[0]),t[n+"Span"]=a,t[n+"ValueSpan"]=o},this)},r.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,i=this._valueWindow;if(e){var n=K0(i,[0,500]);n=Math.min(n,20);var a=t.axis.scale.rawExtentInfo;e[0]!==0&&a.setDeterminedMinMax("min",+i[0].toFixed(n)),e[1]!==100&&a.setDeterminedMinMax("max",+i[1].toFixed(n)),a.freeze()}},r}();function dJ(r,t,e){var i=[1/0,-1/0];is(e,function(o){RU(i,o.getData(),t)});var n=r.getAxisModel(),a=nk(n.axis.scale,n,i).calculate();return[a.min,a.max]}var pJ={getTargetSeries:function(r){function t(n){r.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=r.getComponent(Rn(o),s);n(o,s,l,a)})})}t(function(n,a,o,s){o.__dzAxisProxy=null});var e=[];t(function(n,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new vJ(n,a,s,r),e.push(o.__dzAxisProxy))});var i=Z();return A(e,function(n){A(n.getTargetSeriesModels(),function(a){i.set(a.uid,a)})}),i},overallReset:function(r,t){r.eachComponent("dataZoom",function(e){e.eachTargetAxis(function(i,n){e.getAxisProxy(i,n).reset(e)}),e.eachTargetAxis(function(i,n){e.getAxisProxy(i,n).filterData(e,t)})}),r.eachComponent("dataZoom",function(e){var i=e.findRepresentativeAxisProxy();if(i){var n=i.getDataPercentWindow(),a=i.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:a[0],endValue:a[1]})}})}};function gJ(r){r.registerAction("dataZoom",function(t,e){var i=hJ(e,t);A(i,function(n){n.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}var cA=!1;function qx(r){cA||(cA=!0,r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,pJ),gJ(r),r.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function yJ(r){r.registerComponentModel(cJ),r.registerComponentView(fJ),qx(r)}var Ar=function(){function r(){}return r}(),GE={};function ns(r,t){GE[r]=t}function HE(r){return GE[r]}var mJ=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.optionUpdated=function(){r.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;A(this.option.feature,function(i,n){var a=HE(n);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(e)),ht(i,a.defaultOption))})},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},t}(yt);function _J(r,t,e){var i=t.getBoxLayoutParams(),n=t.get("padding"),a={width:e.getWidth(),height:e.getHeight()},o=ue(i,a,n);io(t.get("orient"),r,t.get("itemGap"),o.width,o.height),sd(r,i,a,n)}function WE(r,t){var e=To(t.get("padding")),i=t.getItemStyle(["color","opacity"]);return i.fill=t.get("backgroundColor"),r=new wt({shape:{x:r.x-e[3],y:r.y-e[0],width:r.width+e[1]+e[3],height:r.height+e[0]+e[2],r:t.get("borderRadius")},style:i,silent:!0,z2:-1}),r}var xJ=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.render=function(e,i,n,a){var o=this.group;if(o.removeAll(),!e.get("show"))return;var s=+e.get("itemSize"),l=e.get("orient")==="vertical",u=e.get("feature")||{},h=this._features||(this._features={}),c=[];A(u,function(d,p){c.push(p)}),new Qi(this._featureNames||[],c).add(f).update(f).remove(ut(f,null)).execute(),this._featureNames=c;function f(d,p){var g=c[d],y=c[p],m=u[g],_=new Lt(m,e,e.ecModel),x;if(a&&a.newTitle!=null&&a.featureName===g&&(m.title=a.newTitle),g&&!y){if(bJ(g))x={onclick:_.option.onclick,featureName:g};else{var b=HE(g);if(!b)return;x=new b}h[g]=x}else if(x=h[y],!x)return;x.uid=Ws("toolbox-feature"),x.model=_,x.ecModel=i,x.api=n;var S=x instanceof Ar;if(!g&&y){S&&x.dispose&&x.dispose(i,n);return}if(!_.get("show")||S&&x.unusable){S&&x.remove&&x.remove(i,n);return}v(_,x,g),_.setIconStatus=function(w,T){var M=this.option,C=this.iconPaths;M.iconStatus=M.iconStatus||{},M.iconStatus[w]=T,C[w]&&(T==="emphasis"?Ki:Ji)(C[w])},x instanceof Ar&&x.render&&x.render(_,i,n,a)}function v(d,p,g){var y=d.getModel("iconStyle"),m=d.getModel(["emphasis","iconStyle"]),_=p instanceof Ar&&p.getIcons?p.getIcons():d.get("icon"),x=d.get("title")||{},b,S;Y(_)?(b={},b[g]=_):b=_,Y(x)?(S={},S[g]=x):S=x;var w=d.iconPaths={};A(b,function(T,M){var C=Gs(T,{},{x:-s/2,y:-s/2,width:s,height:s});C.setStyle(y.getItemStyle());var D=C.ensureState("emphasis");D.style=m.getItemStyle();var L=new St({style:{text:S[M],align:m.get("textAlign"),borderRadius:m.get("textBorderRadius"),padding:m.get("textPadding"),fill:null,font:y_({fontStyle:m.get("textFontStyle"),fontFamily:m.get("textFontFamily"),fontSize:m.get("textFontSize"),fontWeight:m.get("textFontWeight")},i)},ignore:!0});C.setTextContent(L),So({el:C,componentModel:e,itemName:M,formatterParamsExtra:{title:S[M]}}),C.__title=S[M],C.on("mouseover",function(){var I=m.getItemStyle(),P=l?e.get("right")==null&&e.get("left")!=="right"?"right":"left":e.get("bottom")==null&&e.get("top")!=="bottom"?"bottom":"top";L.setStyle({fill:m.get("textFill")||I.fill||I.stroke||"#000",backgroundColor:m.get("textBackgroundColor")}),C.setTextConfig({position:m.get("textPosition")||P}),L.ignore=!e.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){d.get(["iconStatus",M])!=="emphasis"&&n.leaveEmphasis(this),L.hide()}),(d.get(["iconStatus",M])==="emphasis"?Ki:Ji)(C),o.add(C),C.on("click",$(p.onclick,p,i,n,M)),w[M]=C})}_J(o,e,n),o.add(WE(o.getBoundingRect(),e)),l||o.eachChild(function(d){var p=d.__title,g=d.ensureState("emphasis"),y=g.textConfig||(g.textConfig={}),m=d.getTextContent(),_=m&&m.ensureState("emphasis");if(_&&!Q(_)&&p){var x=_.style||(_.style={}),b=fh(p,St.makeFont(x)),S=d.x+o.x,w=d.y+o.y+s,T=!1;w+b.height>n.getHeight()&&(y.position="top",T=!0);var M=T?-5-b.height:s+10;S+b.width/2>n.getWidth()?(y.position=["100%",M],x.align="right"):S-b.width/2<0&&(y.position=[0,M],x.align="left")}})},t.prototype.updateView=function(e,i,n,a){A(this._features,function(o){o instanceof Ar&&o.updateView&&o.updateView(o.model,i,n,a)})},t.prototype.remove=function(e,i){A(this._features,function(n){n instanceof Ar&&n.remove&&n.remove(e,i)}),this.group.removeAll()},t.prototype.dispose=function(e,i){A(this._features,function(n){n instanceof Ar&&n.dispose&&n.dispose(e,i)})},t.type="toolbox",t}(Yt);function bJ(r){return r.indexOf("my")===0}var SJ=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.onclick=function(e,i){var n=this.model,a=n.get("name")||e.get("title.0.text")||"echarts",o=i.getZr().painter.getType()==="svg",s=o?"svg":n.get("type",!0)||"png",l=i.getConnectedDataURL({type:s,backgroundColor:n.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),u=mt.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var h=document.createElement("a");h.download=a+"."+s,h.target="_blank",h.href=l;var c=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});h.dispatchEvent(c)}else if(window.navigator.msSaveOrOpenBlob||o){var f=l.split(","),v=f[0].indexOf("base64")>-1,d=o?decodeURIComponent(f[1]):f[1];v&&(d=window.atob(d));var p=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var g=d.length,y=new Uint8Array(g);g--;)y[g]=d.charCodeAt(g);var m=new Blob([y]);window.navigator.msSaveOrOpenBlob(m,p)}else{var _=document.createElement("iframe");document.body.appendChild(_);var x=_.contentWindow,b=x.document;b.open("image/svg+xml","replace"),b.write(d),b.close(),x.focus(),b.execCommand("SaveAs",!0,p),document.body.removeChild(_)}}else{var S=n.get("lang"),w='',T=window.open();T.document.write(w),T.document.title=a}},t.getDefaultOption=function(e){var i={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:e.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:e.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return i},t}(Ar),fA="__ec_magicType_stack__",wJ=[["line","bar"],["stack"]],TJ=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getIcons=function(){var e=this.model,i=e.get("icon"),n={};return A(e.get("type"),function(a){i[a]&&(n[a]=i[a])}),n},t.getDefaultOption=function(e){var i={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:e.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return i},t.prototype.onclick=function(e,i,n){var a=this.model,o=a.get(["seriesIndex",n]);if(vA[n]){var s={series:[]},l=function(c){var f=c.subType,v=c.id,d=vA[n](f,v,c,a);d&&(tt(d,c.option),s.series.push(d));var p=c.coordinateSystem;if(p&&p.type==="cartesian2d"&&(n==="line"||n==="bar")){var g=p.getAxesByScale("ordinal")[0];if(g){var y=g.dim,m=y+"Axis",_=c.getReferringComponents(m,le).models[0],x=_.componentIndex;s[m]=s[m]||[];for(var b=0;b<=x;b++)s[m][x]=s[m][x]||{};s[m][x].boundaryGap=n==="bar"}}};A(wJ,function(c){vt(c,n)>=0&&A(c,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,h=n;n==="stack"&&(u=ht({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",n])!=="emphasis"&&(h="tiled")),i.dispatchAction({type:"changeMagicType",currentType:h,newOption:s,newTitle:u,featureName:"magicType"})}},t}(Ar),vA={line:function(r,t,e,i){if(r==="bar")return ht({id:t,type:"line",data:e.get("data"),stack:e.get("stack"),markPoint:e.get("markPoint"),markLine:e.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(r,t,e,i){if(r==="line")return ht({id:t,type:"bar",data:e.get("data"),stack:e.get("stack"),markPoint:e.get("markPoint"),markLine:e.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(r,t,e,i){var n=e.get("stack")===fA;if(r==="line"||r==="bar")return i.setIconStatus("stack",n?"normal":"emphasis"),ht({id:t,stack:n?"":fA},i.get(["option","stack"])||{},!0)}};ii({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(r,t){t.mergeOption(r.newOption)});var Md=new Array(60).join("-"),Rs=" ";function MJ(r){var t={},e=[],i=[];return r.eachRawSeries(function(n){var a=n.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=o.dim+"_"+o.index;t[s]||(t[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},i.push({axisDim:o.dim,axisIndex:o.index})),t[s].series.push(n)}else e.push(n)}else e.push(n)}),{seriesGroupByCategoryAxis:t,other:e,meta:i}}function CJ(r){var t=[];return A(r,function(e,i){var n=e.categoryAxis,a=e.valueAxis,o=a.dim,s=[" "].concat(F(e.series,function(v){return v.name})),l=[n.model.getCategories()];A(e.series,function(v){var d=v.getRawData();l.push(v.getRawData().mapArray(d.mapDimension(o),function(p){return p}))});for(var u=[s.join(Rs)],h=0;h=0)return!0}var o0=new RegExp("["+Rs+"]+","g");function IJ(r){for(var t=r.split(/\n+/g),e=xv(t.shift()).split(o0),i=[],n=F(e,function(l){return{name:l,data:[]}}),a=0;a=0;a--){var o=e[a];if(o[n])break}if(a<0){var s=r.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(s){var l=s.getPercentRange();e[0][n]={dataZoomId:n,start:l[0],end:l[1]}}}}),e.push(t)}function NJ(r){var t=Kx(r),e=t[t.length-1];t.length>1&&t.pop();var i={};return UE(e,function(n,a){for(var o=t.length-1;o>=0;o--)if(n=t[o][a],n){i[a]=n;break}}),i}function BJ(r){YE(r).snapshots=null}function zJ(r){return Kx(r).length}function Kx(r){var t=YE(r);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var VJ=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.onclick=function(e,i){BJ(e),i.dispatchAction({type:"restore",from:this.uid})},t.getDefaultOption=function(e){var i={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:e.getLocaleModel().get(["toolbox","restore","title"])};return i},t}(Ar);ii({type:"restore",event:"restore",update:"prepareAndUpdate"},function(r,t){t.resetOption("recreate")});var FJ=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],Jx=function(){function r(t,e,i){var n=this;this._targetInfoList=[];var a=dA(e,t);A(GJ,function(o,s){(!i||!i.include||vt(i.include,s)>=0)&&o(a,n._targetInfoList)})}return r.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,function(i,n,a){if((i.coordRanges||(i.coordRanges=[])).push(n),!i.coordRange){i.coordRange=n;var o=qg[i.brushType](0,a,n);i.__rangeOffset={offset:mA[i.brushType](o.values,i.range,[1,1]),xyMinMax:o.xyMinMax}}}),t},r.prototype.matchOutputRanges=function(t,e,i){A(t,function(n){var a=this.findTargetInfo(n,e);a&&a!==!0&&A(a.coordSyses,function(o){var s=qg[n.brushType](1,o,n.range,!0);i(n,s.values,o,e)})},this)},r.prototype.setInputRanges=function(t,e){A(t,function(i){var n=this.findTargetInfo(i,e);if(i.range=i.range||[],n&&n!==!0){i.panelId=n.panelId;var a=qg[i.brushType](0,n.coordSys,i.coordRange),o=i.__rangeOffset;i.range=o?mA[i.brushType](a.values,o.offset,HJ(a.xyMinMax,o.xyMinMax)):a.values}},this)},r.prototype.makePanelOpts=function(t,e){return F(this._targetInfoList,function(i){var n=i.getPanelRect();return{panelId:i.panelId,defaultBrushType:e?e(i):null,clipPath:QR(n),isTargetByCursor:eE(n,t,i.coordSysModel),getLinearBrushOtherExtent:tE(n)}})},r.prototype.controlSeries=function(t,e,i){var n=this.findTargetInfo(t,i);return n===!0||n&&vt(n.coordSyses,e.coordinateSystem)>=0},r.prototype.findTargetInfo=function(t,e){for(var i=this._targetInfoList,n=dA(e,t),a=0;ar[1]&&r.reverse(),r}function dA(r,t){return fu(r,t,{includeMainTypes:FJ})}var GJ={grid:function(r,t){var e=r.xAxisModels,i=r.yAxisModels,n=r.gridModels,a=Z(),o={},s={};!e&&!i&&!n||(A(e,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),A(i,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),A(n,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,h=[];A(u.getCartesians(),function(c,f){(vt(e,c.getAxis("x").model)>=0||vt(i,c.getAxis("y").model)>=0)&&h.push(c)}),t.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:h[0],coordSyses:h,getPanelRect:gA.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(r,t){A(r.geoModels,function(e){var i=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:i,coordSyses:[i],getPanelRect:gA.geo})})}},pA=[function(r,t){var e=r.xAxisModel,i=r.yAxisModel,n=r.gridModel;return!n&&e&&(n=e.axis.grid.model),!n&&i&&(n=i.axis.grid.model),n&&n===t.gridModel},function(r,t){var e=r.geoModel;return e&&e===t.geoModel}],gA={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var r=this.coordSys,t=r.getBoundingRect().clone();return t.applyTransform(zn(r)),t}},qg={lineX:ut(yA,0),lineY:ut(yA,1),rect:function(r,t,e,i){var n=r?t.pointToData([e[0][0],e[1][0]],i):t.dataToPoint([e[0][0],e[1][0]],i),a=r?t.pointToData([e[0][1],e[1][1]],i):t.dataToPoint([e[0][1],e[1][1]],i),o=[s0([n[0],a[0]]),s0([n[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(r,t,e,i){var n=[[1/0,-1/0],[1/0,-1/0]],a=F(e,function(o){var s=r?t.pointToData(o,i):t.dataToPoint(o,i);return n[0][0]=Math.min(n[0][0],s[0]),n[1][0]=Math.min(n[1][0],s[1]),n[0][1]=Math.max(n[0][1],s[0]),n[1][1]=Math.max(n[1][1],s[1]),s});return{values:a,xyMinMax:n}}};function yA(r,t,e,i){var n=e.getAxis(["x","y"][r]),a=s0(F([0,1],function(s){return t?n.coordToData(n.toLocalCoord(i[s]),!0):n.toGlobalCoord(n.dataToCoord(i[s]))})),o=[];return o[r]=a,o[1-r]=[NaN,NaN],{values:a,xyMinMax:o}}var mA={lineX:ut(_A,0),lineY:ut(_A,1),rect:function(r,t,e){return[[r[0][0]-e[0]*t[0][0],r[0][1]-e[0]*t[0][1]],[r[1][0]-e[1]*t[1][0],r[1][1]-e[1]*t[1][1]]]},polygon:function(r,t,e){return F(r,function(i,n){return[i[0]-e[0]*t[n][0],i[1]-e[1]*t[n][1]]})}};function _A(r,t,e,i){return[t[0]-i[r]*e[0],t[1]-i[r]*e[1]]}function HJ(r,t){var e=xA(r),i=xA(t),n=[e[0]/i[0],e[1]/i[1]];return isNaN(n[0])&&(n[0]=1),isNaN(n[1])&&(n[1]=1),n}function xA(r){return r?[r[0][1]-r[0][0],r[1][1]-r[1][0]]:[NaN,NaN]}var l0=A,WJ=NG("toolbox-dataZoom_"),UJ=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.render=function(e,i,n,a){this._brushController||(this._brushController=new Mx(n.getZr()),this._brushController.on("brush",$(this._onBrush,this)).mount()),XJ(e,i,this,a,n),$J(e,i)},t.prototype.onclick=function(e,i,n){YJ[n].call(this)},t.prototype.remove=function(e,i){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(e,i){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(e){var i=e.areas;if(!e.isEnd||!i.length)return;var n={},a=this.ecModel;this._brushController.updateCovers([]);var o=new Jx(Qx(this.model),a,{include:["grid"]});o.matchOutputRanges(i,a,function(u,h,c){if(c.type==="cartesian2d"){var f=u.brushType;f==="rect"?(s("x",c,h[0]),s("y",c,h[1])):s({lineX:"x",lineY:"y"}[f],c,h)}}),OJ(a,n),this._dispatchZoomAction(n);function s(u,h,c){var f=h.getAxis(u),v=f.model,d=l(u,v,a),p=d.findRepresentativeAxisProxy(v).getMinMaxSpan();(p.minValueSpan!=null||p.maxValueSpan!=null)&&(c=Do(0,c.slice(),f.scale.getExtent(),0,p.minValueSpan,p.maxValueSpan)),d&&(n[d.id]={dataZoomId:d.id,startValue:c[0],endValue:c[1]})}function l(u,h,c){var f;return c.eachComponent({mainType:"dataZoom",subType:"select"},function(v){var d=v.getAxisModel(u,h.componentIndex);d&&(f=v)}),f}},t.prototype._dispatchZoomAction=function(e){var i=[];l0(e,function(n,a){i.push(it(n))}),i.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:i})},t.getDefaultOption=function(e){var i={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:e.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}};return i},t}(Ar),YJ={zoom:function(){var r=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:r})},back:function(){this._dispatchZoomAction(NJ(this.ecModel))}};function Qx(r){var t={xAxisIndex:r.get("xAxisIndex",!0),yAxisIndex:r.get("yAxisIndex",!0),xAxisId:r.get("xAxisId",!0),yAxisId:r.get("yAxisId",!0)};return t.xAxisIndex==null&&t.xAxisId==null&&(t.xAxisIndex="all"),t.yAxisIndex==null&&t.yAxisId==null&&(t.yAxisIndex="all"),t}function $J(r,t){r.setIconStatus("back",zJ(t)>1?"emphasis":"normal")}function XJ(r,t,e,i,n){var a=e._isZoomActive;i&&i.type==="takeGlobalCursor"&&(a=i.key==="dataZoomSelect"?i.dataZoomSelectActive:!1),e._isZoomActive=a,r.setIconStatus("zoom",a?"emphasis":"normal");var o=new Jx(Qx(r),t,{include:["grid"]}),s=o.makePanelOpts(n,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});e._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:r.getModel("brushStyle").getItemStyle()}:!1)}aW("dataZoom",function(r){var t=r.getComponent("toolbox",0),e=["feature","dataZoom"];if(!t||t.get(e)==null)return;var i=t.getModel(e),n=[],a=Qx(i),o=fu(r,a);l0(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),l0(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,h){var c=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:WJ+u+c};f[h]=c,n.push(f)}return n});function ZJ(r){r.registerComponentModel(mJ),r.registerComponentView(xJ),ns("saveAsImage",SJ),ns("magicType",TJ),ns("dataView",RJ),ns("dataZoom",UJ),ns("restore",VJ),pt(yJ)}var jJ=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},t}(yt);function $E(r){var t=r.get("confine");return t!=null?!!t:r.get("renderMode")==="richText"}function XE(r){if(mt.domSupported){for(var t=document.documentElement.style,e=0,i=r.length;e-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var h=u*Math.PI/180,c=o+n,f=c*Math.abs(Math.cos(h))+c*Math.abs(Math.sin(h)),v=Math.round(((f-Math.SQRT2*n)/2+Math.SQRT2*n-(f-c)/2)*100)/100;s+=";"+a+":-"+v+"px";var d=t+" solid "+n+"px;",p=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+d,"border-right:"+d,"background-color:"+i+";"];return'
'}function rQ(r,t){var e="cubic-bezier(0.23,1,0.32,1)",i=" "+r/2+"s "+e,n="opacity"+i+",visibility"+i;return t||(i=" "+r+"s "+e,n+=mt.transformSupported?","+tb+i:",left"+i+",top"+i),JJ+":"+n}function bA(r,t,e){var i=r.toFixed(0)+"px",n=t.toFixed(0)+"px";if(!mt.transformSupported)return e?"top:"+n+";left:"+i+";":[["top",n],["left",i]];var a=mt.transform3dSupported,o="translate"+(a?"3d":"")+"("+i+","+n+(a?",0":"")+")";return e?"top:0;left:0;"+tb+":"+o+";":[["top",0],["left",0],[ZE,o]]}function iQ(r){var t=[],e=r.get("fontSize"),i=r.getTextColor();i&&t.push("color:"+i),t.push("font:"+r.getFont());var n=lt(r.get("lineHeight"),Math.round(e*3/2));e&&t.push("line-height:"+n+"px");var a=r.get("textShadowColor"),o=r.get("textShadowBlur")||0,s=r.get("textShadowOffsetX")||0,l=r.get("textShadowOffsetY")||0;return a&&o&&t.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),A(["decoration","align"],function(u){var h=r.get(u);h&&t.push("text-"+u+":"+h)}),t.join(";")}function nQ(r,t,e){var i=[],n=r.get("transitionDuration"),a=r.get("backgroundColor"),o=r.get("shadowBlur"),s=r.get("shadowColor"),l=r.get("shadowOffsetX"),u=r.get("shadowOffsetY"),h=r.getModel("textStyle"),c=nP(r,"html"),f=l+"px "+u+"px "+o+"px "+s;return i.push("box-shadow:"+f),t&&n&&i.push(rQ(n,e)),a&&i.push("background-color:"+a),A(["width","color","radius"],function(v){var d="border-"+v,p=M_(d),g=r.get(p);g!=null&&i.push(d+":"+g+(v==="color"?"":"px"))}),i.push(iQ(h)),c!=null&&i.push("padding:"+To(c).join("px ")+"px"),i.join(";")+";"}function SA(r,t,e,i,n){var a=t&&t.painter;if(e){var o=a&&a.getViewportRoot();o&&hF(r,o,e,i,n)}else{r[0]=i,r[1]=n;var s=a&&a.getViewportRootOffset();s&&(r[0]+=s.offsetLeft,r[1]+=s.offsetTop)}r[2]=r[0]/t.getWidth(),r[3]=r[1]/t.getHeight()}var aQ=function(){function r(t,e){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,mt.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var n=this._zr=t.getZr(),a=e.appendTo,o=a&&(Y(a)?document.querySelector(a):ho(a)?a:Q(a)&&a(t.getDom()));SA(this._styleCoord,n,o,t.getWidth()/2,t.getHeight()/2),(o||t.getDom()).appendChild(i),this._api=t,this._container=o;var s=this;i.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},i.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=n.handler,h=n.painter.getViewportRoot();Sr(h,l,!0),u.dispatch("mousemove",l)}},i.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return r.prototype.update=function(t){if(!this._container){var e=this._api.getDom(),i=KJ(e,"position"),n=e.style;n.position!=="absolute"&&i!=="absolute"&&(n.position="relative")}var a=t.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=t.get("className")||""},r.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var i=this.el,n=i.style,a=this._styleCoord;i.innerHTML?n.cssText=QJ+nQ(t,!this._firstShow,this._longHide)+bA(a[0],a[1],!0)+("border-color:"+go(e)+";")+(t.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):n.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},r.prototype.setContent=function(t,e,i,n,a){var o=this.el;if(t==null){o.innerHTML="";return}var s="";if(Y(a)&&i.get("trigger")==="item"&&!$E(i)&&(s=eQ(i,n,a)),Y(t))o.innerHTML=t+s;else if(t){o.innerHTML="",V(t)||(t=[t]);for(var l=0;l=0?this._tryShow(a,o):n==="leave"&&this._hide(o))},this))},t.prototype._keepShow=function(){var e=this._tooltipModel,i=this._ecModel,n=this._api,a=e.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&o.manuallyShowTip(e,i,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(e,i,n,a){if(!(a.from===this.uid||mt.node||!n.getDom())){var o=MA(a,n);this._ticket="";var s=a.dataByCoordSys,l=fQ(a,i,n);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var h=sQ;h.x=a.x,h.y=a.y,h.update(),ot(h).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:h},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(e,i,n,a))return;var c=EE(a,i),f=c.point[0],v=c.point[1];f!=null&&v!=null&&this._tryShow({offsetX:f,offsetY:v,target:c.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(n.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:n.getZr().findHover(a.x,a.y).target},o))}},t.prototype.manuallyHideTip=function(e,i,n,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(MA(a,n))},t.prototype._manuallyAxisShowTip=function(e,i,n,a){var o=a.seriesIndex,s=a.dataIndex,l=i.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=i.getSeriesByIndex(o);if(u){var h=u.getData(),c=Ll([h.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(c.get("trigger")==="axis")return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},t.prototype._tryShow=function(e,i){var n=e.target,a=this._tooltipModel;if(a){this._lastX=e.offsetX,this._lastY=e.offsetY;var o=e.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,e);else if(n){var s=ot(n);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;Za(n,function(h){if(ot(h).dataIndex!=null)return l=h,!0;if(ot(h).tooltipConfig!=null)return u=h,!0},!0),l?this._showSeriesItemTooltip(e,l,i):u?this._showComponentItemTooltip(e,u,i):this._hide(i)}else this._lastDataByCoordSys=null,this._hide(i)}},t.prototype._showOrMove=function(e,i){var n=e.get("showDelay");i=$(i,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(i,n):i()},t.prototype._showAxisTooltip=function(e,i){var n=this._ecModel,a=this._tooltipModel,o=[i.offsetX,i.offsetY],s=Ll([i.tooltipOption],a),l=this._renderMode,u=[],h=_e("section",{blocks:[],noHeader:!0}),c=[],f=new Op;A(e,function(m){A(m.dataByAxis,function(_){var x=n.getComponent(_.axisDim+"Axis",_.axisIndex),b=_.value;if(!(!x||b==null)){var S=IE(b,x.axis,n,_.seriesDataIndices,_.valueLabelOpt),w=_e("section",{header:S,noHeader:!Lr(S),sortBlocks:!0,blocks:[]});h.blocks.push(w),A(_.seriesDataIndices,function(T){var M=n.getSeriesByIndex(T.seriesIndex),C=T.dataIndexInside,D=M.getDataParams(C);if(!(D.dataIndex<0)){D.axisDim=_.axisDim,D.axisIndex=_.axisIndex,D.axisType=_.axisType,D.axisId=_.axisId,D.axisValue=J_(x.axis,{value:b}),D.axisValueLabel=S,D.marker=f.makeTooltipMarker("item",go(D.color),l);var L=fw(M.formatTooltip(C,!0,null)),I=L.frag;if(I){var P=Ll([M],a).get("valueFormatter");w.blocks.push(P?z({valueFormatter:P},I):I)}L.text&&c.push(L.text),u.push(D)}})}})}),h.blocks.reverse(),c.reverse();var v=i.position,d=s.get("order"),p=mw(h,f,l,d,n.get("useUTC"),s.get("textStyle"));p&&c.unshift(p);var g=l==="richText"?` + +`:"
",y=c.join(g);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(e,u)?this._updatePosition(s,v,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,y,u,Math.random()+"",o[0],o[1],v,null,f)})},t.prototype._showSeriesItemTooltip=function(e,i,n){var a=this._ecModel,o=ot(i),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,h=o.dataIndex,c=o.dataType,f=u.getData(c),v=this._renderMode,d=e.positionDefault,p=Ll([f.getItemModel(h),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),g=p.get("trigger");if(!(g!=null&&g!=="item")){var y=u.getDataParams(h,c),m=new Op;y.marker=m.makeTooltipMarker("item",go(y.color),v);var _=fw(u.formatTooltip(h,!1,c)),x=p.get("order"),b=p.get("valueFormatter"),S=_.frag,w=S?mw(b?z({valueFormatter:b},S):S,m,v,x,a.get("useUTC"),p.get("textStyle")):_.text,T="item_"+u.name+"_"+h;this._showOrMove(p,function(){this._showTooltipContent(p,w,y,T,e.offsetX,e.offsetY,e.position,e.target,m)}),n({type:"showTip",dataIndexInside:h,dataIndex:f.getRawIndex(h),seriesIndex:s,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,i,n){var a=this._renderMode==="html",o=ot(i),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(Y(l)){var h=l;l={content:h,formatter:h},u=!0}u&&a&&l.content&&(l=it(l),l.content=Oe(l.content));var c=[l],f=this._ecModel.getComponent(o.componentMainType,o.componentIndex);f&&c.push(f),c.push({formatter:l.content});var v=e.positionDefault,d=Ll(c,this._tooltipModel,v?{position:v}:null),p=d.get("content"),g=Math.random()+"",y=new Op;this._showOrMove(d,function(){var m=it(d.get("formatterParams")||{});this._showTooltipContent(d,p,m,g,e.offsetX,e.offsetY,e.position,i,y)}),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,i,n,a,o,s,l,u,h){if(this._ticket="",!(!e.get("showContent")||!e.get("show"))){var c=this._tooltipContent;c.setEnterable(e.get("enterable"));var f=e.get("formatter");l=l||e.get("position");var v=i,d=this._getNearestPoint([o,s],n,e.get("trigger"),e.get("borderColor")),p=d.color;if(f)if(Y(f)){var g=e.ecModel.get("useUTC"),y=V(n)?n[0]:n,m=y&&y.axisType&&y.axisType.indexOf("time")>=0;v=f,m&&(v=_h(y.axisValue,v,g)),v=C_(v,n,!0)}else if(Q(f)){var _=$(function(x,b){x===this._ticket&&(c.setContent(b,h,e,p,l),this._updatePosition(e,l,o,s,c,n,u))},this);this._ticket=a,v=f(n,a,_)}else v=f;c.setContent(v,h,e,p,l),c.show(e,p),this._updatePosition(e,l,o,s,c,n,u)}},t.prototype._getNearestPoint=function(e,i,n,a){if(n==="axis"||V(i))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!V(i))return{color:a||i.color||i.borderColor}},t.prototype._updatePosition=function(e,i,n,a,o,s,l){var u=this._api.getWidth(),h=this._api.getHeight();i=i||e.get("position");var c=o.getSize(),f=e.get("align"),v=e.get("verticalAlign"),d=l&&l.getBoundingRect().clone();if(l&&d.applyTransform(l.transform),Q(i)&&(i=i([n,a],s,o.el,d,{viewSize:[u,h],contentSize:c.slice()})),V(i))n=U(i[0],u),a=U(i[1],h);else if(et(i)){var p=i;p.width=c[0],p.height=c[1];var g=ue(p,{width:u,height:h});n=g.x,a=g.y,f=null,v=null}else if(Y(i)&&l){var y=cQ(i,d,c,e.get("borderWidth"));n=y[0],a=y[1]}else{var y=uQ(n,a,o,u,h,f?null:20,v?null:20);n=y[0],a=y[1]}if(f&&(n-=CA(f)?c[0]/2:f==="right"?c[0]:0),v&&(a-=CA(v)?c[1]/2:v==="bottom"?c[1]:0),$E(e)){var y=hQ(n,a,o,u,h);n=y[0],a=y[1]}o.moveTo(n,a)},t.prototype._updateContentNotChangedOnAxis=function(e,i){var n=this._lastDataByCoordSys,a=this._cbParamsList,o=!!n&&n.length===e.length;return o&&A(n,function(s,l){var u=s.dataByAxis||[],h=e[l]||{},c=h.dataByAxis||[];o=o&&u.length===c.length,o&&A(u,function(f,v){var d=c[v]||{},p=f.seriesDataIndices||[],g=d.seriesDataIndices||[];o=o&&f.value===d.value&&f.axisType===d.axisType&&f.axisId===d.axisId&&p.length===g.length,o&&A(p,function(y,m){var _=g[m];o=o&&y.seriesIndex===_.seriesIndex&&y.dataIndex===_.dataIndex}),a&&A(f.seriesDataIndices,function(y){var m=y.seriesIndex,_=i[m],x=a[m];_&&x&&x.data!==_.data&&(o=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=i,!!o},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,i){mt.node||!i.getDom()||(Wu(this,"_updatePosition"),this._tooltipContent.dispose(),i0("itemTooltip",i))},t.type="tooltip",t}(Yt);function Ll(r,t,e){var i=t.ecModel,n;e?(n=new Lt(e,i,i),n=new Lt(t.option,n,i)):n=t;for(var a=r.length-1;a>=0;a--){var o=r[a];o&&(o instanceof Lt&&(o=o.get("tooltip",!0)),Y(o)&&(o={formatter:o}),o&&(n=new Lt(o,n,i)))}return n}function MA(r,t){return r.dispatchAction||$(t.dispatchAction,t)}function uQ(r,t,e,i,n,a,o){var s=e.getSize(),l=s[0],u=s[1];return a!=null&&(r+l+a+2>i?r-=l+a:r+=a),o!=null&&(t+u+o>n?t-=u+o:t+=o),[r,t]}function hQ(r,t,e,i,n){var a=e.getSize(),o=a[0],s=a[1];return r=Math.min(r+o,i)-o,t=Math.min(t+s,n)-s,r=Math.max(r,0),t=Math.max(t,0),[r,t]}function cQ(r,t,e,i){var n=e[0],a=e[1],o=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=t.width,h=t.height;switch(r){case"inside":s=t.x+u/2-n/2,l=t.y+h/2-a/2;break;case"top":s=t.x+u/2-n/2,l=t.y-a-o;break;case"bottom":s=t.x+u/2-n/2,l=t.y+h+o;break;case"left":s=t.x-n-o,l=t.y+h/2-a/2;break;case"right":s=t.x+u+o,l=t.y+h/2-a/2}return[s,l]}function CA(r){return r==="center"||r==="middle"}function fQ(r,t,e){var i=r_(r).queryOptionMap,n=i.keys()[0];if(!(!n||n==="series")){var a=vh(t,n,i.get(n),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=e.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var h=ot(u).tooltipConfig;if(h&&h.name===r.name)return l=u,!0}),l)return{componentMainType:n,componentIndex:o.componentIndex,el:l}}}}function vQ(r){pt(Ih),r.registerComponentModel(jJ),r.registerComponentView(lQ),r.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},ee),r.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},ee)}var dQ=["rect","polygon","keep","clear"];function pQ(r,t){var e=Bt(r?r.brush:[]);if(e.length){var i=[];A(e,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(i=i.concat(u))});var n=r&&r.toolbox;V(n)&&(n=n[0]),n||(n={feature:{}},r.toolbox=[n]);var a=n.feature||(n.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,i),gQ(s),t&&!s.length&&s.push.apply(s,dQ)}}function gQ(r){var t={};A(r,function(e){t[e]=1}),r.length=0,A(t,function(e,i){r.push(i)})}var AA=A;function DA(r){if(r){for(var t in r)if(r.hasOwnProperty(t))return!0}}function u0(r,t,e){var i={};return AA(t,function(a){var o=i[a]=n();AA(r[a],function(s,l){if(ye.isValidType(l)){var u={type:l,visual:s};e&&e(u,a),o[l]=new ye(u),l==="opacity"&&(u=it(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new ye(u))}})}),i;function n(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function qE(r,t,e){var i;A(e,function(n){t.hasOwnProperty(n)&&DA(t[n])&&(i=!0)}),i&&A(e,function(n){t.hasOwnProperty(n)&&DA(t[n])?r[n]=it(t[n]):delete r[n]})}function yQ(r,t,e,i,n,a){var o={};A(r,function(c){var f=ye.prepareVisualTypes(t[c]);o[c]=f});var s;function l(c){return N_(e,s,c)}function u(c,f){dP(e,s,c,f)}e.each(h);function h(c,f){s=c;var v=e.getRawDataItem(s);if(!(v&&v.visualMap===!1))for(var d=i.call(n,c),p=t[d],g=o[d],y=0,m=g.length;yt[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&RA(t)}};function RA(r){return new ft(r[0][0],r[1][0],r[0][1]-r[0][0],r[1][1]-r[1][0])}var MQ=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.init=function(e,i){this.ecModel=e,this.api=i,this.model,(this._brushController=new Mx(i.getZr())).on("brush",$(this._onBrush,this)).mount()},t.prototype.render=function(e,i,n,a){this.model=e,this._updateController(e,i,n,a)},t.prototype.updateTransform=function(e,i,n,a){KE(i),this._updateController(e,i,n,a)},t.prototype.updateVisual=function(e,i,n,a){this.updateTransform(e,i,n,a)},t.prototype.updateView=function(e,i,n,a){this._updateController(e,i,n,a)},t.prototype._updateController=function(e,i,n,a){(!a||a.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(n)).enableBrush(e.brushOption).updateCovers(e.areas.slice())},t.prototype.dispose=function(){this._brushController.dispose()},t.prototype._onBrush=function(e){var i=this.model.id,n=this.model.brushTargetManager.setOutputRanges(e.areas,this.ecModel);(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:i,areas:it(n),$from:i}),e.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:it(n),$from:i})},t.type="brush",t}(Yt),CQ="#ddd",AQ=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.areas=[],e.brushOption={},e}return t.prototype.optionUpdated=function(e,i){var n=this.option;!i&&qE(n,e,["inBrush","outOfBrush"]);var a=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:CQ},a.hasOwnProperty("liftZ")||(a.liftZ=5)},t.prototype.setAreas=function(e){e&&(this.areas=F(e,function(i){return EA(this.option,i)},this))},t.prototype.setBrushOption=function(e){this.brushOption=EA(this.option,e),this.brushType=this.brushOption.brushType},t.type="brush",t.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],t.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},t}(yt);function EA(r,t){return ht({brushType:r.brushType,brushMode:r.brushMode,transformable:r.transformable,brushStyle:new Lt(r.brushStyle).getItemStyle(),removeOnClick:r.removeOnClick,z:r.z},t,!0)}var DQ=["rect","polygon","lineX","lineY","keep","clear"],LQ=function(r){E(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.render=function(e,i,n){var a,o,s;i.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,A(e.get("type",!0),function(l){e.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s:l===a)?"emphasis":"normal")})},t.prototype.updateView=function(e,i,n){this.render(e,i,n)},t.prototype.getIcons=function(){var e=this.model,i=e.get("icon",!0),n={};return A(e.get("type",!0),function(a){i[a]&&(n[a]=i[a])}),n},t.prototype.onclick=function(e,i,n){var a=this._brushType,o=this._brushMode;n==="clear"?(i.dispatchAction({type:"axisAreaSelect",intervals:[]}),i.dispatchAction({type:"brush",command:"clear",areas:[]})):i.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:n==="keep"?a:a===n?!1:n,brushMode:n==="keep"?o==="multiple"?"single":"multiple":o}})},t.getDefaultOption=function(e){var i={show:!0,type:DQ.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:e.getLocaleModel().get(["toolbox","brush","title"])};return i},t}(Ar);function IQ(r){r.registerComponentView(MQ),r.registerComponentModel(AQ),r.registerPreprocessor(pQ),r.registerVisual(r.PRIORITY.VISUAL.BRUSH,xQ),r.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(t,e){e.eachComponent({mainType:"brush",query:t},function(i){i.setAreas(t.areas)})}),r.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},ee),r.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},ee),ns("brush",LQ)}var PQ=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.layoutMode={type:"box",ignoreSize:!0},e}return t.type="title",t.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},t}(yt),kQ=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,i,n){if(this.group.removeAll(),!!e.get("show")){var a=this.group,o=e.getModel("textStyle"),s=e.getModel("subtextStyle"),l=e.get("textAlign"),u=lt(e.get("textBaseline"),e.get("textVerticalAlign")),h=new St({style:Gt(o,{text:e.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),c=h.getBoundingRect(),f=e.get("subtext"),v=new St({style:Gt(s,{text:f,fill:s.getTextColor(),y:c.height+e.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=e.get("link"),p=e.get("sublink"),g=e.get("triggerEvent",!0);h.silent=!d&&!g,v.silent=!p&&!g,d&&h.on("click",function(){Zf(d,"_"+e.get("target"))}),p&&v.on("click",function(){Zf(p,"_"+e.get("subtarget"))}),ot(h).eventData=ot(v).eventData=g?{componentType:"title",componentIndex:e.componentIndex}:null,a.add(h),f&&a.add(v);var y=a.getBoundingRect(),m=e.getBoxLayoutParams();m.width=y.width,m.height=y.height;var _=ue(m,{width:n.getWidth(),height:n.getHeight()},e.get("padding"));l||(l=e.get("left")||e.get("right"),l==="middle"&&(l="center"),l==="right"?_.x+=_.width:l==="center"&&(_.x+=_.width/2)),u||(u=e.get("top")||e.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?_.y+=_.height:u==="middle"&&(_.y+=_.height/2),u=u||"top"),a.x=_.x,a.y=_.y,a.markRedraw();var x={align:l,verticalAlign:u};h.setStyle(x),v.setStyle(x),y=a.getBoundingRect();var b=_.margin,S=e.getItemStyle(["color","opacity"]);S.fill=e.get("backgroundColor");var w=new wt({shape:{x:y.x-b[3],y:y.y-b[0],width:y.width+b[1]+b[3],height:y.height+b[0]+b[2],r:e.get("borderRadius")},style:S,subPixelOptimize:!0,silent:!0});a.add(w)}},t.type="title",t}(Yt);function RQ(r){r.registerComponentModel(PQ),r.registerComponentView(kQ)}var OA=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.layoutMode="box",e}return t.prototype.init=function(e,i,n){this.mergeDefaultAndTheme(e,n),this._initData()},t.prototype.mergeOption=function(e){r.prototype.mergeOption.apply(this,arguments),this._initData()},t.prototype.setCurrentIndex=function(e){e==null&&(e=this.option.currentIndex);var i=this._data.count();this.option.loop?e=(e%i+i)%i:(e>=i&&(e=i-1),e<0&&(e=0)),this.option.currentIndex=e},t.prototype.getCurrentIndex=function(){return this.option.currentIndex},t.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},t.prototype.setPlayState=function(e){this.option.autoPlay=!!e},t.prototype.getPlayState=function(){return!!this.option.autoPlay},t.prototype._initData=function(){var e=this.option,i=e.data||[],n=e.axisType,a=this._names=[],o;n==="category"?(o=[],A(i,function(u,h){var c=he(Os(u),""),f;et(u)?(f=it(u),f.value=h):f=h,o.push(f),a.push(c)})):o=i;var s={category:"ordinal",time:"time",value:"number"}[n]||"number",l=this._data=new Be([{name:"value",type:s}],this);l.initData(o,a)},t.prototype.getData=function(){return this._data},t.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},t.type="timeline",t.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},t}(yt),JE=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="timeline.slider",t.defaultOption=ea(OA.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),t}(OA);re(JE,ud.prototype);var EQ=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="timeline",t}(Yt),OQ=function(r){E(t,r);function t(e,i,n,a){var o=r.call(this,e,i,n)||this;return o.type=a||"value",o}return t.prototype.getLabelModel=function(){return this.model.getModel("label")},t.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},t}(Br),Jg=Math.PI,NA=Tt(),NQ=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.init=function(e,i){this.api=i},t.prototype.render=function(e,i,n){if(this.model=e,this.api=n,this.ecModel=i,this.group.removeAll(),e.get("show",!0)){var a=this._layout(e,n),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,e);e.formatTooltip=function(u){var h=l.scale.getLabel({value:u});return _e("nameValue",{noName:!0,value:h})},A(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,e)},this),this._renderAxisLabel(a,s,l,e),this._position(a,e)}this._doPlayStop(),this._updateTicksStatus()},t.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},t.prototype.dispose=function(){this._clearTimer()},t.prototype._layout=function(e,i){var n=e.get(["label","position"]),a=e.get("orient"),o=zQ(e,i),s;n==null||n==="auto"?s=a==="horizontal"?o.y+o.height/2=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:Jg/2},c=a==="vertical"?o.height:o.width,f=e.getModel("controlStyle"),v=f.get("show",!0),d=v?f.get("itemSize"):0,p=v?f.get("itemGap"):0,g=d+p,y=e.get(["label","rotate"])||0;y=y*Jg/180;var m,_,x,b=f.get("position",!0),S=v&&f.get("showPlayBtn",!0),w=v&&f.get("showPrevBtn",!0),T=v&&f.get("showNextBtn",!0),M=0,C=c;b==="left"||b==="bottom"?(S&&(m=[0,0],M+=g),w&&(_=[M,0],M+=g),T&&(x=[C-d,0],C-=g)):(S&&(m=[C-d,0],C-=g),w&&(_=[0,0],M+=g),T&&(x=[C-d,0],C-=g));var D=[M,C];return e.get("inverse")&&D.reverse(),{viewRect:o,mainLength:c,orient:a,rotation:h[a],labelRotation:y,labelPosOpt:s,labelAlign:e.get(["label","align"])||l[a],labelBaseline:e.get(["label","verticalAlign"])||e.get(["label","baseline"])||u[a],playPosition:m,prevBtnPosition:_,nextBtnPosition:x,axisExtent:D,controlSize:d,controlGap:p}},t.prototype._position=function(e,i){var n=this._mainGroup,a=this._labelGroup,o=e.viewRect;if(e.orient==="vertical"){var s=or(),l=o.x,u=o.y+o.height;ti(s,s,[-l,-u]),Qn(s,s,-Jg/2),ti(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var h=m(o),c=m(n.getBoundingRect()),f=m(a.getBoundingRect()),v=[n.x,n.y],d=[a.x,a.y];d[0]=v[0]=h[0][0];var p=e.labelPosOpt;if(p==null||Y(p)){var g=p==="+"?0:1;_(v,c,h,1,g),_(d,f,h,1,1-g)}else{var g=p>=0?0:1;_(v,c,h,1,g),d[1]=v[1]+p}n.setPosition(v),a.setPosition(d),n.rotation=a.rotation=e.rotation,y(n),y(a);function y(x){x.originX=h[0][0]-x.x,x.originY=h[1][0]-x.y}function m(x){return[[x.x,x.x+x.width],[x.y,x.y+x.height]]}function _(x,b,S,w,T){x[w]+=S[w][T]-b[w][T]}},t.prototype._createAxis=function(e,i){var n=i.getData(),a=i.get("axisType"),o=BQ(i,a);o.getTicks=function(){return n.mapArray(["value"],function(u){return{value:u}})};var s=n.getDataExtent("value");o.setExtent(s[0],s[1]),o.calcNiceTicks();var l=new OQ("value",o,e.axisExtent,a);return l.model=i,l},t.prototype._createGroup=function(e){var i=this[e]=new at;return this.group.add(i),i},t.prototype._renderAxisLine=function(e,i,n,a){var o=n.getExtent();if(a.get(["lineStyle","show"])){var s=new ce({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:z({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});i.add(s);var l=this._progressLine=new ce({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:tt({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});i.add(l)}},t.prototype._renderAxisTick=function(e,i,n,a){var o=this,s=a.getData(),l=n.scale.getTicks();this._tickSymbols=[],A(l,function(u){var h=n.dataToCoord(u.value),c=s.getItemModel(u.value),f=c.getModel("itemStyle"),v=c.getModel(["emphasis","itemStyle"]),d=c.getModel(["progress","itemStyle"]),p={x:h,y:0,onclick:$(o._changeTimeline,o,u.value)},g=BA(c,f,i,p);g.ensureState("emphasis").style=v.getItemStyle(),g.ensureState("progress").style=d.getItemStyle(),Bn(g);var y=ot(g);c.get("tooltip")?(y.dataIndex=u.value,y.dataModel=a):y.dataIndex=y.dataModel=null,o._tickSymbols.push(g)})},t.prototype._renderAxisLabel=function(e,i,n,a){var o=this,s=n.getLabelModel();if(s.get("show")){var l=a.getData(),u=n.getViewLabels();this._tickLabels=[],A(u,function(h){var c=h.tickValue,f=l.getItemModel(c),v=f.getModel("label"),d=f.getModel(["emphasis","label"]),p=f.getModel(["progress","label"]),g=n.dataToCoord(h.tickValue),y=new St({x:g,y:0,rotation:e.labelRotation-e.rotation,onclick:$(o._changeTimeline,o,c),silent:!1,style:Gt(v,{text:h.formattedLabel,align:e.labelAlign,verticalAlign:e.labelBaseline})});y.ensureState("emphasis").style=Gt(d),y.ensureState("progress").style=Gt(p),i.add(y),Bn(y),NA(y).dataIndex=c,o._tickLabels.push(y)})}},t.prototype._renderControl=function(e,i,n,a){var o=e.controlSize,s=e.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),h=a.getPlayState(),c=a.get("inverse",!0);f(e.nextBtnPosition,"next",$(this._changeTimeline,this,c?"-":"+")),f(e.prevBtnPosition,"prev",$(this._changeTimeline,this,c?"+":"-")),f(e.playPosition,h?"stop":"play",$(this._handlePlayClick,this,!h),!0);function f(v,d,p,g){if(v){var y=ei(lt(a.get(["controlStyle",d+"BtnSize"]),o),o),m=[0,-y/2,y,y],_=VQ(a,d+"Icon",m,{x:v[0],y:v[1],originX:o/2,originY:0,rotation:g?-s:0,rectHover:!0,style:l,onclick:p});_.ensureState("emphasis").style=u,i.add(_),Bn(_)}}},t.prototype._renderCurrentPointer=function(e,i,n,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,h={onCreate:function(c){c.draggable=!0,c.drift=$(u._handlePointerDrag,u),c.ondragend=$(u._handlePointerDragend,u),zA(c,u._progressLine,s,n,a,!0)},onUpdate:function(c){zA(c,u._progressLine,s,n,a)}};this._currentPointer=BA(l,l,this._mainGroup,{},this._currentPointer,h)},t.prototype._handlePlayClick=function(e){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:e,from:this.uid})},t.prototype._handlePointerDrag=function(e,i,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},t.prototype._handlePointerDragend=function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},t.prototype._pointerChangeTimeline=function(e,i){var n=this._toAxisCoord(e)[0],a=this._axis,o=fr(a.getExtent().slice());n>o[1]&&(n=o[1]),n=0&&(o[a]=+o[a].toFixed(f)),[o,c]}var Qg={min:ut(Hc,"min"),max:ut(Hc,"max"),average:ut(Hc,"average"),median:ut(Hc,"median")};function ih(r,t){if(t){var e=r.getData(),i=r.coordinateSystem,n=i&&i.dimensions;if(!YQ(t)&&!V(t.coord)&&V(n)){var a=QE(t,e,i,r);if(t=it(t),t.type&&Qg[t.type]&&a.baseAxis&&a.valueAxis){var o=vt(n,a.baseAxis.dim),s=vt(n,a.valueAxis.dim),l=Qg[t.type](e,a.baseDataDim,a.valueDataDim,o,s);t.coord=l[0],t.value=l[1]}else t.coord=[t.xAxis!=null?t.xAxis:t.radiusAxis,t.yAxis!=null?t.yAxis:t.angleAxis]}if(t.coord==null||!V(n))t.coord=[];else for(var u=t.coord,h=0;h<2;h++)Qg[u[h]]&&(u[h]=rb(e,e.mapDimension(n[h]),u[h]));return t}}function QE(r,t,e,i){var n={};return r.valueIndex!=null||r.valueDim!=null?(n.valueDataDim=r.valueIndex!=null?t.getDimension(r.valueIndex):r.valueDim,n.valueAxis=e.getAxis($Q(i,n.valueDataDim)),n.baseAxis=e.getOtherAxis(n.valueAxis),n.baseDataDim=t.mapDimension(n.baseAxis.dim)):(n.baseAxis=i.getBaseAxis(),n.valueAxis=e.getOtherAxis(n.baseAxis),n.baseDataDim=t.mapDimension(n.baseAxis.dim),n.valueDataDim=t.mapDimension(n.valueAxis.dim)),n}function $Q(r,t){var e=r.getData().getDimensionInfo(t);return e&&e.coordDim}function nh(r,t){return r&&r.containData&&t.coord&&!c0(t)?r.containData(t.coord):!0}function XQ(r,t,e){return r&&r.containZone&&t.coord&&e.coord&&!c0(t)&&!c0(e)?r.containZone(t.coord,e.coord):!0}function tO(r,t){return r?function(e,i,n,a){var o=a<2?e.coord&&e.coord[a]:e.value;return Fn(o,t[a])}:function(e,i,n,a){return Fn(e.value,t[a])}}function rb(r,t,e){if(e==="average"){var i=0,n=0;return r.each(t,function(a,o){isNaN(a)||(i+=a,n++)}),i/n}else return e==="median"?r.getMedian(t):r.getDataExtent(t)[e==="max"?1:0]}var ty=Tt(),ib=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.init=function(){this.markerGroupMap=Z()},t.prototype.render=function(e,i,n){var a=this,o=this.markerGroupMap;o.each(function(s){ty(s).keep=!1}),i.eachSeries(function(s){var l=nn.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,i,n)}),o.each(function(s){!ty(s).keep&&a.group.remove(s.group)})},t.prototype.markKeep=function(e){ty(e).keep=!0},t.prototype.toggleBlurSeries=function(e,i){var n=this;A(e,function(a){var o=nn.getMarkerModelFromSeries(a,n.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(i?Y2(l):u_(l))})}})},t.type="marker",t}(Yt);function FA(r,t,e){var i=t.coordinateSystem;r.each(function(n){var a=r.getItemModel(n),o,s=U(a.get("x"),e.getWidth()),l=U(a.get("y"),e.getHeight());if(!isNaN(s)&&!isNaN(l))o=[s,l];else if(t.getMarkerPosition)o=t.getMarkerPosition(r.getValues(r.dimensions,n));else if(i){var u=r.get(i.dimensions[0],n),h=r.get(i.dimensions[1],n);o=i.dataToPoint([u,h])}isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),r.setItemLayout(n,o)})}var ZQ=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.updateTransform=function(e,i,n){i.eachSeries(function(a){var o=nn.getMarkerModelFromSeries(a,"markPoint");o&&(FA(o.getData(),a,n),this.markerGroupMap.get(a.id).updateLayout())},this)},t.prototype.renderSeries=function(e,i,n,a){var o=e.coordinateSystem,s=e.id,l=e.getData(),u=this.markerGroupMap,h=u.get(s)||u.set(s,new wh),c=jQ(o,e,i);i.setData(c),FA(i.getData(),e,a),c.each(function(f){var v=c.getItemModel(f),d=v.getShallow("symbol"),p=v.getShallow("symbolSize"),g=v.getShallow("symbolRotate"),y=v.getShallow("symbolOffset"),m=v.getShallow("symbolKeepAspect");if(Q(d)||Q(p)||Q(g)||Q(y)){var _=i.getRawValue(f),x=i.getDataParams(f);Q(d)&&(d=d(_,x)),Q(p)&&(p=p(_,x)),Q(g)&&(g=g(_,x)),Q(y)&&(y=y(_,x))}var b=v.getModel("itemStyle").getItemStyle(),S=xh(l,"color");b.fill||(b.fill=S),c.setItemVisual(f,{symbol:d,symbolSize:p,symbolRotate:g,symbolOffset:y,symbolKeepAspect:m,style:b})}),h.updateData(c),this.group.add(h.group),c.eachItemGraphicEl(function(f){f.traverse(function(v){ot(v).dataModel=i})}),this.markKeep(h),h.group.silent=i.get("silent")||e.get("silent")},t.type="markPoint",t}(ib);function jQ(r,t,e){var i;r?i=F(r&&r.dimensions,function(s){var l=t.getData().getDimensionInfo(t.getData().mapDimension(s))||{};return z(z({},l),{name:s,ordinalMeta:null})}):i=[{name:"value",type:"float"}];var n=new Be(i,e),a=F(e.get("data"),ut(ih,t));r&&(a=Dt(a,ut(nh,r)));var o=tO(!!r,i);return n.initData(a,null,o),n}function qQ(r){r.registerComponentModel(UQ),r.registerComponentView(ZQ),r.registerPreprocessor(function(t){eb(t.series,"markPoint")&&(t.markPoint=t.markPoint||{})})}var KQ=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.createMarkerModelFromSeries=function(e,i,n){return new t(e,i,n)},t.type="markLine",t.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},t}(nn),Wc=Tt(),JQ=function(r,t,e,i){var n=r.getData(),a;if(V(i))a=i;else{var o=i.type;if(o==="min"||o==="max"||o==="average"||o==="median"||i.xAxis!=null||i.yAxis!=null){var s=void 0,l=void 0;if(i.yAxis!=null||i.xAxis!=null)s=t.getAxis(i.yAxis!=null?"y":"x"),l=pe(i.yAxis,i.xAxis);else{var u=QE(i,n,t,r);s=u.valueAxis;var h=Z_(n,u.valueDataDim);l=rb(n,h,o)}var c=s.dim==="x"?0:1,f=1-c,v=it(i),d={coord:[]};v.type=null,v.coord=[],v.coord[f]=-1/0,d.coord[f]=1/0;var p=e.get("precision");p>=0&&Mt(l)&&(l=+l.toFixed(Math.min(p,20))),v.coord[c]=d.coord[c]=l,a=[v,d,{type:o,valueIndex:i.valueIndex,value:l}]}else a=[]}var g=[ih(r,a[0]),ih(r,a[1]),z({},a[2])];return g[2].type=g[2].type||null,ht(g[2],g[0]),ht(g[2],g[1]),g};function bv(r){return!isNaN(r)&&!isFinite(r)}function GA(r,t,e,i){var n=1-r,a=i.dimensions[r];return bv(t[n])&&bv(e[n])&&t[r]===e[r]&&i.getAxis(a).containData(t[r])}function QQ(r,t){if(r.type==="cartesian2d"){var e=t[0].coord,i=t[1].coord;if(e&&i&&(GA(1,e,i,r)||GA(0,e,i,r)))return!0}return nh(r,t[0])&&nh(r,t[1])}function ey(r,t,e,i,n){var a=i.coordinateSystem,o=r.getItemModel(t),s,l=U(o.get("x"),n.getWidth()),u=U(o.get("y"),n.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(i.getMarkerPosition)s=i.getMarkerPosition(r.getValues(r.dimensions,t));else{var h=a.dimensions,c=r.get(h[0],t),f=r.get(h[1],t);s=a.dataToPoint([c,f])}if(Co(a,"cartesian2d")){var v=a.getAxis("x"),d=a.getAxis("y"),h=a.dimensions;bv(r.get(h[0],t))?s[0]=v.toGlobalCoord(v.getExtent()[e?0:1]):bv(r.get(h[1],t))&&(s[1]=d.toGlobalCoord(d.getExtent()[e?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}r.setItemLayout(t,s)}var ttt=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.updateTransform=function(e,i,n){i.eachSeries(function(a){var o=nn.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=Wc(o).from,u=Wc(o).to;l.each(function(h){ey(l,h,!0,a,n),ey(u,h,!1,a,n)}),s.each(function(h){s.setItemLayout(h,[l.getItemLayout(h),u.getItemLayout(h)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},t.prototype.renderSeries=function(e,i,n,a){var o=e.coordinateSystem,s=e.id,l=e.getData(),u=this.markerGroupMap,h=u.get(s)||u.set(s,new Tx);this.group.add(h.group);var c=ett(o,e,i),f=c.from,v=c.to,d=c.line;Wc(i).from=f,Wc(i).to=v,i.setData(d);var p=i.get("symbol"),g=i.get("symbolSize"),y=i.get("symbolRotate"),m=i.get("symbolOffset");V(p)||(p=[p,p]),V(g)||(g=[g,g]),V(y)||(y=[y,y]),V(m)||(m=[m,m]),c.from.each(function(x){_(f,x,!0),_(v,x,!1)}),d.each(function(x){var b=d.getItemModel(x).getModel("lineStyle").getLineStyle();d.setItemLayout(x,[f.getItemLayout(x),v.getItemLayout(x)]),b.stroke==null&&(b.stroke=f.getItemVisual(x,"style").fill),d.setItemVisual(x,{fromSymbolKeepAspect:f.getItemVisual(x,"symbolKeepAspect"),fromSymbolOffset:f.getItemVisual(x,"symbolOffset"),fromSymbolRotate:f.getItemVisual(x,"symbolRotate"),fromSymbolSize:f.getItemVisual(x,"symbolSize"),fromSymbol:f.getItemVisual(x,"symbol"),toSymbolKeepAspect:v.getItemVisual(x,"symbolKeepAspect"),toSymbolOffset:v.getItemVisual(x,"symbolOffset"),toSymbolRotate:v.getItemVisual(x,"symbolRotate"),toSymbolSize:v.getItemVisual(x,"symbolSize"),toSymbol:v.getItemVisual(x,"symbol"),style:b})}),h.updateData(d),c.line.eachItemGraphicEl(function(x){ot(x).dataModel=i,x.traverse(function(b){ot(b).dataModel=i})});function _(x,b,S){var w=x.getItemModel(b);ey(x,b,S,e,a);var T=w.getModel("itemStyle").getItemStyle();T.fill==null&&(T.fill=xh(l,"color")),x.setItemVisual(b,{symbolKeepAspect:w.get("symbolKeepAspect"),symbolOffset:lt(w.get("symbolOffset",!0),m[S?0:1]),symbolRotate:lt(w.get("symbolRotate",!0),y[S?0:1]),symbolSize:lt(w.get("symbolSize"),g[S?0:1]),symbol:lt(w.get("symbol",!0),p[S?0:1]),style:T})}this.markKeep(h),h.group.silent=i.get("silent")||e.get("silent")},t.type="markLine",t}(ib);function ett(r,t,e){var i;r?i=F(r&&r.dimensions,function(u){var h=t.getData().getDimensionInfo(t.getData().mapDimension(u))||{};return z(z({},h),{name:u,ordinalMeta:null})}):i=[{name:"value",type:"float"}];var n=new Be(i,e),a=new Be(i,e),o=new Be([],e),s=F(e.get("data"),ut(JQ,t,r,e));r&&(s=Dt(s,ut(QQ,r)));var l=tO(!!r,i);return n.initData(F(s,function(u){return u[0]}),null,l),a.initData(F(s,function(u){return u[1]}),null,l),o.initData(F(s,function(u){return u[2]})),o.hasItemOption=!0,{from:n,to:a,line:o}}function rtt(r){r.registerComponentModel(KQ),r.registerComponentView(ttt),r.registerPreprocessor(function(t){eb(t.series,"markLine")&&(t.markLine=t.markLine||{})})}var itt=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.createMarkerModelFromSeries=function(e,i,n){return new t(e,i,n)},t.type="markArea",t.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},t}(nn),Uc=Tt(),ntt=function(r,t,e,i){var n=i[0],a=i[1];if(!(!n||!a)){var o=ih(r,n),s=ih(r,a),l=o.coord,u=s.coord;l[0]=pe(l[0],-1/0),l[1]=pe(l[1],-1/0),u[0]=pe(u[0],1/0),u[1]=pe(u[1],1/0);var h=zv([{},o,s]);return h.coord=[o.coord,s.coord],h.x0=o.x,h.y0=o.y,h.x1=s.x,h.y1=s.y,h}};function Sv(r){return!isNaN(r)&&!isFinite(r)}function HA(r,t,e,i){var n=1-r;return Sv(t[n])&&Sv(e[n])}function att(r,t){var e=t.coord[0],i=t.coord[1],n={coord:e,x:t.x0,y:t.y0},a={coord:i,x:t.x1,y:t.y1};return Co(r,"cartesian2d")?e&&i&&(HA(1,e,i)||HA(0,e,i))?!0:XQ(r,n,a):nh(r,n)||nh(r,a)}function WA(r,t,e,i,n){var a=i.coordinateSystem,o=r.getItemModel(t),s,l=U(o.get(e[0]),n.getWidth()),u=U(o.get(e[1]),n.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(i.getMarkerPosition){var h=r.getValues(["x0","y0"],t),c=r.getValues(["x1","y1"],t),f=a.clampData(h),v=a.clampData(c),d=[];e[0]==="x0"?d[0]=f[0]>v[0]?c[0]:h[0]:d[0]=f[0]>v[0]?h[0]:c[0],e[1]==="y0"?d[1]=f[1]>v[1]?c[1]:h[1]:d[1]=f[1]>v[1]?h[1]:c[1],s=i.getMarkerPosition(d,e,!0)}else{var p=r.get(e[0],t),g=r.get(e[1],t),y=[p,g];a.clampData&&a.clampData(y,y),s=a.dataToPoint(y,!0)}if(Co(a,"cartesian2d")){var m=a.getAxis("x"),_=a.getAxis("y"),p=r.get(e[0],t),g=r.get(e[1],t);Sv(p)?s[0]=m.toGlobalCoord(m.getExtent()[e[0]==="x0"?0:1]):Sv(g)&&(s[1]=_.toGlobalCoord(_.getExtent()[e[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var UA=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],ott=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.updateTransform=function(e,i,n){i.eachSeries(function(a){var o=nn.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=F(UA,function(c){return WA(s,l,c,a,n)});s.setItemLayout(l,u);var h=s.getItemGraphicEl(l);h.setShape("points",u)})}},this)},t.prototype.renderSeries=function(e,i,n,a){var o=e.coordinateSystem,s=e.id,l=e.getData(),u=this.markerGroupMap,h=u.get(s)||u.set(s,{group:new at});this.group.add(h.group),this.markKeep(h);var c=stt(o,e,i);i.setData(c),c.each(function(f){var v=F(UA,function(T){return WA(c,f,T,e,a)}),d=o.getAxis("x").scale,p=o.getAxis("y").scale,g=d.getExtent(),y=p.getExtent(),m=[d.parse(c.get("x0",f)),d.parse(c.get("x1",f))],_=[p.parse(c.get("y0",f)),p.parse(c.get("y1",f))];fr(m),fr(_);var x=!(g[0]>m[1]||g[1]_[1]||y[1]<_[0]),b=!x;c.setItemLayout(f,{points:v,allClipped:b});var S=c.getItemModel(f).getModel("itemStyle").getItemStyle(),w=xh(l,"color");S.fill||(S.fill=w,Y(S.fill)&&(S.fill=Ru(S.fill,.4))),S.stroke||(S.stroke=w),c.setItemVisual(f,"style",S)}),c.diff(Uc(h).data).add(function(f){var v=c.getItemLayout(f);if(!v.allClipped){var d=new Ge({shape:{points:v.points}});c.setItemGraphicEl(f,d),h.group.add(d)}}).update(function(f,v){var d=Uc(h).data.getItemGraphicEl(v),p=c.getItemLayout(f);p.allClipped?d&&h.group.remove(d):(d?At(d,{shape:{points:p.points}},i,f):d=new Ge({shape:{points:p.points}}),c.setItemGraphicEl(f,d),h.group.add(d))}).remove(function(f){var v=Uc(h).data.getItemGraphicEl(f);h.group.remove(v)}).execute(),c.eachItemGraphicEl(function(f,v){var d=c.getItemModel(v),p=c.getItemVisual(v,"style");f.useStyle(c.getItemVisual(v,"style")),Ae(f,me(d),{labelFetcher:i,labelDataIndex:v,defaultText:c.getName(v)||"",inheritColor:Y(p.fill)?Ru(p.fill,1):"#000"}),Ce(f,d),Kt(f,null,null,d.get(["emphasis","disabled"])),ot(f).dataModel=i}),Uc(h).data=c,h.group.silent=i.get("silent")||e.get("silent")},t.type="markArea",t}(ib);function stt(r,t,e){var i,n,a=["x0","y0","x1","y1"];if(r){var o=F(r&&r.dimensions,function(u){var h=t.getData(),c=h.getDimensionInfo(h.mapDimension(u))||{};return z(z({},c),{name:u,ordinalMeta:null})});n=F(a,function(u,h){return{name:u,type:o[h%2].type}}),i=new Be(n,e)}else n=[{name:"value",type:"float"}],i=new Be(n,e);var s=F(e.get("data"),ut(ntt,t,r,e));r&&(s=Dt(s,ut(att,r)));var l=r?function(u,h,c,f){var v=u.coord[Math.floor(f/2)][f%2];return Fn(v,n[f])}:function(u,h,c,f){return Fn(u.value,n[f])};return i.initData(s,null,l),i.hasItemOption=!0,i}function ltt(r){r.registerComponentModel(itt),r.registerComponentView(ott),r.registerPreprocessor(function(t){eb(t.series,"markArea")&&(t.markArea=t.markArea||{})})}var utt=function(r,t){if(t==="all")return{type:"all",title:r.getLocaleModel().get(["legend","selector","all"])};if(t==="inverse")return{type:"inverse",title:r.getLocaleModel().get(["legend","selector","inverse"])}},f0=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.layoutMode={type:"box",ignoreSize:!0},e}return t.prototype.init=function(e,i,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(e,i){r.prototype.mergeOption.call(this,e,i),this._updateSelector(e)},t.prototype._updateSelector=function(e){var i=e.selector,n=this.ecModel;i===!0&&(i=e.selector=["all","inverse"]),V(i)&&A(i,function(a,o){Y(a)&&(a={type:a}),i[o]=ht(a,utt(n,a.type))})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&this.get("selectedMode")==="single"){for(var i=!1,n=0;n=0},t.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},t}(yt),jo=ut,v0=A,Yc=at,eO=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.newlineDisabled=!1,e}return t.prototype.init=function(){this.group.add(this._contentGroup=new Yc),this.group.add(this._selectorGroup=new Yc),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,i,n){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!e.get("show",!0)){var o=e.get("align"),s=e.get("orient");(!o||o==="auto")&&(o=e.get("left")==="right"&&s==="vertical"?"right":"left");var l=e.get("selector",!0),u=e.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,e,i,n,l,s,u);var h=e.getBoxLayoutParams(),c={width:n.getWidth(),height:n.getHeight()},f=e.get("padding"),v=ue(h,c,f),d=this.layoutInner(e,o,v,a,l,u),p=ue(tt({width:d.width,height:d.height},h),c,f);this.group.x=p.x-d.x,this.group.y=p.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=WE(d,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,i,n,a,o,s,l){var u=this.getContentGroup(),h=Z(),c=i.get("selectedMode"),f=[];n.eachRawSeries(function(v){!v.get("legendHoverLink")&&f.push(v.id)}),v0(i.getData(),function(v,d){var p=v.get("name");if(!this.newlineDisabled&&(p===""||p===` +`)){var g=new Yc;g.newline=!0,u.add(g);return}var y=n.getSeriesByName(p)[0];if(!h.get(p))if(y){var m=y.getData(),_=m.getVisual("legendLineStyle")||{},x=m.getVisual("legendIcon"),b=m.getVisual("style"),S=this._createItem(y,p,d,v,i,e,_,b,x,c,a);S.on("click",jo(YA,p,null,a,f)).on("mouseover",jo(d0,y.name,null,a,f)).on("mouseout",jo(p0,y.name,null,a,f)),n.ssr&&S.eachChild(function(w){var T=ot(w);T.seriesIndex=y.seriesIndex,T.dataIndex=d,T.ssrType="legend"}),h.set(p,!0)}else n.eachRawSeries(function(w){if(!h.get(p)&&w.legendVisualProvider){var T=w.legendVisualProvider;if(!T.containName(p))return;var M=T.indexOfName(p),C=T.getItemVisual(M,"style"),D=T.getItemVisual(M,"legendIcon"),L=Ze(C.fill);L&&L[3]===0&&(L[3]=.2,C=z(z({},C),{fill:Kr(L,"rgba")}));var I=this._createItem(w,p,d,v,i,e,{},C,D,c,a);I.on("click",jo(YA,null,p,a,f)).on("mouseover",jo(d0,null,p,a,f)).on("mouseout",jo(p0,null,p,a,f)),n.ssr&&I.eachChild(function(P){var k=ot(P);k.seriesIndex=w.seriesIndex,k.dataIndex=d,k.ssrType="legend"}),h.set(p,!0)}},this)},this),o&&this._createSelector(o,i,a,s,l)},t.prototype._createSelector=function(e,i,n,a,o){var s=this.getSelectorGroup();v0(e,function(u){var h=u.type,c=new St({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:h==="all"?"legendAllSelect":"legendInverseSelect",legendId:i.id})}});s.add(c);var f=i.getModel("selectorLabel"),v=i.getModel(["emphasis","selectorLabel"]);Ae(c,{normal:f,emphasis:v},{defaultText:u.title}),Bn(c)})},t.prototype._createItem=function(e,i,n,a,o,s,l,u,h,c,f){var v=e.visualDrawType,d=o.get("itemWidth"),p=o.get("itemHeight"),g=o.isSelected(i),y=a.get("symbolRotate"),m=a.get("symbolKeepAspect"),_=a.get("icon");h=_||h||"roundRect";var x=htt(h,a,l,u,v,g,f),b=new Yc,S=a.getModel("textStyle");if(Q(e.getLegendIcon)&&(!_||_==="inherit"))b.add(e.getLegendIcon({itemWidth:d,itemHeight:p,icon:h,iconRotate:y,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:m}));else{var w=_==="inherit"&&e.getData().getVisual("symbol")?y==="inherit"?e.getData().getVisual("symbolRotate"):y:0;b.add(ctt({itemWidth:d,itemHeight:p,icon:h,iconRotate:w,itemStyle:x.itemStyle,symbolKeepAspect:m}))}var T=s==="left"?d+5:-5,M=s,C=o.get("formatter"),D=i;Y(C)&&C?D=C.replace("{name}",i??""):Q(C)&&(D=C(i));var L=g?S.getTextColor():a.get("inactiveColor");b.add(new St({style:Gt(S,{text:D,x:T,y:p/2,fill:L,align:M,verticalAlign:"middle"},{inheritColor:L})}));var I=new wt({shape:b.getBoundingRect(),style:{fill:"transparent"}}),P=a.getModel("tooltip");return P.get("show")&&So({el:I,componentModel:o,itemName:i,itemTooltipOption:P.option}),b.add(I),b.eachChild(function(k){k.silent=!0}),I.silent=!c,this.getContentGroup().add(b),Bn(b),b.__legendDataIndex=n,b},t.prototype.layoutInner=function(e,i,n,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();io(e.get("orient"),l,e.get("itemGap"),n.width,n.height);var h=l.getBoundingRect(),c=[-h.x,-h.y];if(u.markRedraw(),l.markRedraw(),o){io("horizontal",u,e.get("selectorItemGap",!0));var f=u.getBoundingRect(),v=[-f.x,-f.y],d=e.get("selectorButtonGap",!0),p=e.getOrient().index,g=p===0?"width":"height",y=p===0?"height":"width",m=p===0?"y":"x";s==="end"?v[p]+=h[g]+d:c[p]+=f[g]+d,v[1-p]+=h[y]/2-f[y]/2,u.x=v[0],u.y=v[1],l.x=c[0],l.y=c[1];var _={x:0,y:0};return _[g]=h[g]+d+f[g],_[y]=Math.max(h[y],f[y]),_[m]=Math.min(0,f[m]+v[1-p]),_}else return l.x=c[0],l.y=c[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(Yt);function htt(r,t,e,i,n,a,o){function s(g,y){g.lineWidth==="auto"&&(g.lineWidth=y.lineWidth>0?2:0),v0(g,function(m,_){g[_]==="inherit"&&(g[_]=y[_])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),h=r.lastIndexOf("empty",0)===0?"fill":"stroke",c=l.getShallow("decal");u.decal=!c||c==="inherit"?i.decal:Ds(c,o),u.fill==="inherit"&&(u.fill=i[n]),u.stroke==="inherit"&&(u.stroke=i[h]),u.opacity==="inherit"&&(u.opacity=(n==="fill"?i:e).opacity),s(u,i);var f=t.getModel("lineStyle"),v=f.getLineStyle();if(s(v,e),u.fill==="auto"&&(u.fill=i.fill),u.stroke==="auto"&&(u.stroke=i.fill),v.stroke==="auto"&&(v.stroke=i.fill),!a){var d=t.get("inactiveBorderWidth"),p=u[h];u.lineWidth=d==="auto"?i.lineWidth>0&&p?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),v.stroke=f.get("inactiveColor"),v.lineWidth=f.get("inactiveWidth")}return{itemStyle:u,lineStyle:v}}function ctt(r){var t=r.icon||"roundRect",e=ae(t,0,0,r.itemWidth,r.itemHeight,r.itemStyle.fill,r.symbolKeepAspect);return e.setStyle(r.itemStyle),e.rotation=(r.iconRotate||0)*Math.PI/180,e.setOrigin([r.itemWidth/2,r.itemHeight/2]),t.indexOf("empty")>-1&&(e.style.stroke=e.style.fill,e.style.fill="#fff",e.style.lineWidth=2),e}function YA(r,t,e,i){p0(r,t,e,i),e.dispatchAction({type:"legendToggleSelect",name:r??t}),d0(r,t,e,i)}function rO(r){for(var t=r.getZr().storage.getDisplayList(),e,i=0,n=t.length;in[o],g=[-v.x,-v.y];i||(g[a]=h[u]);var y=[0,0],m=[-d.x,-d.y],_=lt(e.get("pageButtonGap",!0),e.get("itemGap",!0));if(p){var x=e.get("pageButtonPosition",!0);x==="end"?m[a]+=n[o]-d[o]:y[a]+=d[o]+_}m[1-a]+=v[s]/2-d[s]/2,h.setPosition(g),c.setPosition(y),f.setPosition(m);var b={x:0,y:0};if(b[o]=p?n[o]:v[o],b[s]=Math.max(v[s],d[s]),b[l]=Math.min(0,d[l]+m[1-a]),c.__rectSize=n[o],p){var S={x:0,y:0};S[o]=Math.max(n[o]-d[o]-_,0),S[s]=b[s],c.setClipPath(new wt({shape:S})),c.__rectSize=S[o]}else f.eachChild(function(T){T.attr({invisible:!0,silent:!0})});var w=this._getPageInfo(e);return w.pageIndex!=null&&At(h,{x:w.contentPosition[0],y:w.contentPosition[1]},p?e:null),this._updatePageInfoView(e,w),b},t.prototype._pageGo=function(e,i,n){var a=this._getPageInfo(i)[e];a!=null&&n.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:i.id})},t.prototype._updatePageInfoView=function(e,i){var n=this._controllerGroup;A(["pagePrev","pageNext"],function(h){var c=h+"DataIndex",f=i[c]!=null,v=n.childOfName(h);v&&(v.setStyle("fill",f?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),v.cursor=f?"pointer":"default")});var a=n.childOfName("pageText"),o=e.get("pageFormatter"),s=i.pageIndex,l=s!=null?s+1:0,u=i.pageCount;a&&o&&a.setStyle("text",Y(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},t.prototype._getPageInfo=function(e){var i=e.get("scrollDataIndex",!0),n=this.getContentGroup(),a=this._containerGroup.__rectSize,o=e.getOrient().index,s=ry[o],l=iy[o],u=this._findTargetItemIndex(i),h=n.children(),c=h[u],f=h.length,v=f?1:0,d={contentPosition:[n.x,n.y],pageCount:v,pageIndex:v-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return d;var p=x(c);d.contentPosition[o]=-p.s;for(var g=u+1,y=p,m=p,_=null;g<=f;++g)_=x(h[g]),(!_&&m.e>y.s+a||_&&!b(_,y.s))&&(m.i>y.i?y=m:y=_,y&&(d.pageNextDataIndex==null&&(d.pageNextDataIndex=y.i),++d.pageCount)),m=_;for(var g=u-1,y=p,m=p,_=null;g>=-1;--g)_=x(h[g]),(!_||!b(m,_.s))&&y.i=w&&S.s<=w+a}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var i,n=this.getContentGroup(),a;return n.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===e&&(i=s)}),i??a},t.type="legend.scroll",t}(eO);function gtt(r){r.registerAction("legendScroll","legendscroll",function(t,e){var i=t.scrollDataIndex;i!=null&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(n){n.setScrollDataIndex(i)})})}function ytt(r){pt(iO),r.registerComponentModel(dtt),r.registerComponentView(ptt),gtt(r)}function mtt(r){pt(iO),pt(ytt)}var _tt=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="dataZoom.inside",t.defaultOption=ea(rh.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(rh),nb=Tt();function xtt(r,t,e){nb(r).coordSysRecordMap.each(function(i){var n=i.dataZoomInfoMap.get(t.uid);n&&(n.getRange=e)})}function btt(r,t){for(var e=nb(r).coordSysRecordMap,i=e.keys(),n=0;ni[e+t]&&(t=s),n=n&&o.get("preventDefaultMouseMove",!0)}),{controlType:t,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!n}}}function Ctt(r){r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,function(t,e){var i=nb(e),n=i.coordSysRecordMap||(i.coordSysRecordMap=Z());n.each(function(a){a.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=FE(a);A(o.infoList,function(s){var l=s.model.uid,u=n.get(l)||n.set(l,Stt(e,s.model)),h=u.dataZoomInfoMap||(u.dataZoomInfoMap=Z());h.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),n.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){nO(n,a);return}var h=Mtt(l);o.enable(h.controlType,h.opt),o.setPointerChecker(a.containsPoint),Zs(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var Att=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="dataZoom.inside",e}return t.prototype.render=function(e,i,n){if(r.prototype.render.apply(this,arguments),e.noTarget()){this._clear();return}this.range=e.getPercentRange(),xtt(n,e,{pan:$(ny.pan,this),zoom:$(ny.zoom,this),scrollMove:$(ny.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){btt(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(jx),ny={zoom:function(r,t,e,i){var n=this.range,a=n.slice(),o=r.axisModels[0];if(o){var s=ay[t](null,[i.originX,i.originY],o,e,r),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/i.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Do(0,a,[0,100],0,h.minSpan,h.maxSpan),this.range=a,n[0]!==a[0]||n[1]!==a[1])return a}},pan:jA(function(r,t,e,i,n,a){var o=ay[i]([a.oldX,a.oldY],[a.newX,a.newY],t,n,e);return o.signal*(r[1]-r[0])*o.pixel/o.pixelLength}),scrollMove:jA(function(r,t,e,i,n,a){var o=ay[i]([0,0],[a.scrollDelta,a.scrollDelta],t,n,e);return o.signal*(r[1]-r[0])*a.scrollDelta})};function jA(r){return function(t,e,i,n){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s){var l=r(o,s,t,e,i,n);if(Do(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var ay={grid:function(r,t,e,i,n){var a=e.axis,o={},s=n.model.coordinateSystem.getRect();return r=r||[0,0],a.dim==="x"?(o.pixel=t[0]-r[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-r[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(r,t,e,i,n){var a=e.axis,o={},s=n.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return r=r?s.pointToCoord(r):[0,0],t=s.pointToCoord(t),e.mainType==="radiusAxis"?(o.pixel=t[0]-r[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-r[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(r,t,e,i,n){var a=e.axis,o=n.model.coordinateSystem.getRect(),s={};return r=r||[0,0],a.orient==="horizontal"?(s.pixel=t[0]-r[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-r[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function aO(r){qx(r),r.registerComponentModel(_tt),r.registerComponentView(Att),Ctt(r)}var Dtt=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=ea(rh.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),t}(rh),kl=wt,qA=7,Ltt=1,oy=30,Itt=7,Rl="horizontal",KA="vertical",Ptt=5,ktt=["line","bar","candlestick","scatter"],Rtt={easing:"cubicOut",duration:100,delay:0},Ett=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e._displayables={},e}return t.prototype.init=function(e,i){this.api=i,this._onBrush=$(this._onBrush,this),this._onBrushEnd=$(this._onBrushEnd,this)},t.prototype.render=function(e,i,n,a){if(r.prototype.render.apply(this,arguments),Zs(this,"_dispatchZoomAction",e.get("throttle"),"fixRate"),this._orient=e.getOrient(),e.get("show")===!1){this.group.removeAll();return}if(e.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){Wu(this,"_dispatchZoomAction");var e=this.api.getZr();e.off("mousemove",this._onBrush),e.off("mouseup",this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var i=this._displayables.sliderGroup=new at;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(i),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,i=this.api,n=e.get("brushSelect"),a=n?Itt:0,o=this._findCoordRect(),s={width:i.getWidth(),height:i.getHeight()},l=this._orient===Rl?{right:s.width-o.x-o.width,top:s.height-oy-qA-a,width:o.width,height:oy}:{right:qA,top:o.y,width:oy,height:o.height},u=Us(e.option);A(["right","top","width","height"],function(c){u[c]==="ph"&&(u[c]=l[c])});var h=ue(u,s);this._location={x:h.x,y:h.y},this._size=[h.width,h.height],this._orient===KA&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,i=this._location,n=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(n===Rl&&!o?{scaleY:l?1:-1,scaleX:1}:n===Rl&&o?{scaleY:l?1:-1,scaleX:-1}:n===KA&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=e.getBoundingRect([s]);e.x=i.x-u.x,e.y=i.y-u.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,i=this._size,n=this._displayables.sliderGroup,a=e.get("brushSelect");n.add(new kl({silent:!0,shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:e.get("backgroundColor")},z2:-40}));var o=new kl({shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:"transparent"},z2:0,onclick:$(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),n.add(o)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!e)return;var i=this._size,n=this._shadowSize||[],a=e.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():e.otherDim;if(l==null)return;var u=this._shadowPolygonPts,h=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||i[0]!==n[0]||i[1]!==n[1]){var c=o.getDataExtent(l),f=(c[1]-c[0])*.3;c=[c[0]-f,c[1]+f];var v=[0,i[1]],d=[0,i[0]],p=[[i[0],0],[0,0]],g=[],y=d[1]/(o.count()-1),m=0,_=Math.round(o.count()/i[0]),x;o.each([l],function(M,C){if(_>0&&C%_){m+=y;return}var D=M==null||isNaN(M)||M==="",L=D?0:Pt(M,c,v,!0);D&&!x&&C?(p.push([p[p.length-1][0],0]),g.push([g[g.length-1][0],0])):!D&&x&&(p.push([m,0]),g.push([m,0])),p.push([m,L]),g.push([m,L]),m+=y,x=D}),u=this._shadowPolygonPts=p,h=this._shadowPolylinePts=g}this._shadowData=o,this._shadowDim=l,this._shadowSize=[i[0],i[1]];var b=this.dataZoomModel;function S(M){var C=b.getModel(M?"selectedDataBackground":"dataBackground"),D=new at,L=new Ge({shape:{points:u},segmentIgnoreThreshold:1,style:C.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),I=new We({shape:{points:h},segmentIgnoreThreshold:1,style:C.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return D.add(L),D.add(I),D}for(var w=0;w<3;w++){var T=S(w===1);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,i=e.get("showDataShadow");if(i!==!1){var n,a=this.ecModel;return e.eachTargetAxis(function(o,s){var l=e.getAxisProxy(o,s).getTargetSeriesModels();A(l,function(u){if(!n&&!(i!==!0&&vt(ktt,u.get("type"))<0)){var h=a.getComponent(Rn(o),s).axis,c=Ott(o),f,v=u.coordinateSystem;c!=null&&v.getOtherAxis&&(f=v.getOtherAxis(h).inverse),c=u.getData().mapDimension(c),n={thisAxis:h,series:u,thisDim:o,otherDim:c,otherAxisInverse:f}}},this)},this),n}},t.prototype._renderHandle=function(){var e=this.group,i=this._displayables,n=i.handles=[null,null],a=i.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,h=l.get("borderRadius")||0,c=l.get("brushSelect"),f=i.filler=new kl({silent:c,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(f),o.add(new kl({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:h},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:Ltt,fill:"rgba(0,0,0,0)"}})),A([0,1],function(_){var x=l.get("handleIcon");!Kf[x]&&x.indexOf("path://")<0&&x.indexOf("image://")<0&&(x="path://"+x);var b=ae(x,-1,0,2,2,null,!0);b.attr({cursor:JA(this._orient),draggable:!0,drift:$(this._onDragMove,this,_),ondragend:$(this._onDragEnd,this),onmouseover:$(this._showDataInfo,this,!0),onmouseout:$(this._showDataInfo,this,!1),z2:5});var S=b.getBoundingRect(),w=l.get("handleSize");this._handleHeight=U(w,this._size[1]),this._handleWidth=S.width/S.height*this._handleHeight,b.setStyle(l.getModel("handleStyle").getItemStyle()),b.style.strokeNoScale=!0,b.rectHover=!0,b.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),Bn(b);var T=l.get("handleColor");T!=null&&(b.style.fill=T),o.add(n[_]=b);var M=l.getModel("textStyle"),C=l.get("handleLabel")||{},D=C.show||!1;e.add(a[_]=new St({silent:!0,invisible:!D,style:Gt(M,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:M.getTextColor(),font:M.getFont()}),z2:10}))},this);var v=f;if(c){var d=U(l.get("moveHandleSize"),s[1]),p=i.moveHandle=new wt({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:d}}),g=d*.8,y=i.moveHandleIcon=ae(l.get("moveHandleIcon"),-g/2,-g/2,g,g,"#fff",!0);y.silent=!0,y.y=s[1]+d/2-.5,p.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(s[1]/2,Math.max(d,10));v=i.moveZone=new wt({invisible:!0,shape:{y:s[1]-m,height:d+m}}),v.on("mouseover",function(){u.enterEmphasis(p)}).on("mouseout",function(){u.leaveEmphasis(p)}),o.add(p),o.add(y),o.add(v)}v.attr({draggable:!0,cursor:JA(this._orient),drift:$(this._onDragMove,this,"all"),ondragstart:$(this._showDataInfo,this,!0),ondragend:$(this._onDragEnd,this),onmouseover:$(this._showDataInfo,this,!0),onmouseout:$(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),i=this._getViewExtent();this._handleEnds=[Pt(e[0],[0,100],i,!0),Pt(e[1],[0,100],i,!0)]},t.prototype._updateInterval=function(e,i){var n=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=n.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];Do(i,a,o,n.get("zoomLock")?"all":e,s.minSpan!=null?Pt(s.minSpan,l,o,!0):null,s.maxSpan!=null?Pt(s.maxSpan,l,o,!0):null);var u=this._range,h=this._range=fr([Pt(a[0],o,l,!0),Pt(a[1],o,l,!0)]);return!u||u[0]!==h[0]||u[1]!==h[1]},t.prototype._updateView=function(e){var i=this._displayables,n=this._handleEnds,a=fr(n.slice()),o=this._size;A([0,1],function(v){var d=i.handles[v],p=this._handleHeight;d.attr({scaleX:p/2,scaleY:p/2,x:n[v]+(v?-1:1),y:o[1]/2-p/2})},this),i.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};i.moveHandle&&(i.moveHandle.setShape(s),i.moveZone.setShape(s),i.moveZone.getBoundingRect(),i.moveHandleIcon&&i.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=i.dataShadowSegs,u=[0,a[0],a[1],o[0]],h=0;hi[0]||n[1]<0||n[1]>i[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",n[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var i=e.offsetX,n=e.offsetY;this._brushStart=new ct(i,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var i=this._displayables.brushRect;if(this._brushing=!1,!!i){i.attr("ignore",!0);var n=i.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(n.width)<5)){var o=this._getViewExtent(),s=[0,100];this._range=fr([Pt(n.x,o,s,!0),Pt(n.x+n.width,o,s,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(qi(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,i){var n=this._displayables,a=this.dataZoomModel,o=n.brushRect;o||(o=n.brushRect=new kl({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(e,i),h=l.transformCoordToLocal(s.x,s.y),c=this._size;u[0]=Math.max(Math.min(c[0],u[0]),0),o.setShape({x:h[0],y:0,width:u[0]-h[0],height:c[1]})},t.prototype._dispatchZoomAction=function(e){var i=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?Rtt:null,start:i[0],end:i[1]})},t.prototype._findCoordRect=function(){var e,i=FE(this.dataZoomModel).infoList;if(!e&&i.length){var n=i[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var a=this.api.getWidth(),o=this.api.getHeight();e={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return e},t.type="dataZoom.slider",t}(jx);function Ott(r){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[r]}function JA(r){return r==="vertical"?"ns-resize":"ew-resize"}function oO(r){r.registerComponentModel(Dtt),r.registerComponentView(Ett),qx(r)}function Ntt(r){pt(aO),pt(oO)}var sO={get:function(r,t,e){var i=it((Btt[r]||{})[t]);return e&&V(i)?i[i.length-1]:i}},Btt={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},QA=ye.mapVisual,ztt=ye.eachVisual,Vtt=V,tD=A,Ftt=fr,Gtt=Pt,wv=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.stateList=["inRange","outOfRange"],e.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],e.layoutMode={type:"box",ignoreSize:!0},e.dataBound=[-1/0,1/0],e.targetVisuals={},e.controllerVisuals={},e}return t.prototype.init=function(e,i,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,i){var n=this.option;!i&&qE(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var i=this.stateList;e=$(e,this),this.controllerVisuals=u0(this.option.controller,i,e),this.targetVisuals=u0(this.option.target,i,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this.option.seriesIndex,i=[];return e==null||e==="all"?this.ecModel.eachSeries(function(n,a){i.push(a)}):i=Bt(e),i},t.prototype.eachTargetSeries=function(e,i){A(this.getTargetSeriesIndices(),function(n){var a=this.ecModel.getSeriesByIndex(n);a&&e.call(i,a)},this)},t.prototype.isTargetSeries=function(e){var i=!1;return this.eachTargetSeries(function(n){n===e&&(i=!0)}),i},t.prototype.formatValueText=function(e,i,n){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;n=n||["<",">"],V(e)&&(e=e.slice(),u=!0);var h=i?e:u?[c(e[0]),c(e[1])]:c(e);if(Y(l))return l.replace("{value}",u?h[0]:h).replace("{value2}",u?h[1]:h);if(Q(l))return u?l(e[0],e[1]):l(e);if(u)return e[0]===s[0]?n[0]+" "+h[1]:e[1]===s[1]?n[1]+" "+h[0]:h[0]+" - "+h[1];return h;function c(f){return f===s[0]?"min":f===s[1]?"max":(+f).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var e=this.option,i=Ftt([e.min,e.max]);this._dataExtent=i},t.prototype.getDataDimensionIndex=function(e){var i=this.option.dimension;if(i!=null)return e.getDimensionIndex(i);for(var n=e.dimensions,a=n.length-1;a>=0;a--){var o=n[a],s=e.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,i=this.option,n={inRange:i.inRange,outOfRange:i.outOfRange},a=i.target||(i.target={}),o=i.controller||(i.controller={});ht(a,n),ht(o,n);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),h.call(this,o);function l(c){Vtt(i.color)&&!c.inRange&&(c.inRange={color:i.color.slice().reverse()}),c.inRange=c.inRange||{color:e.get("gradientColor")}}function u(c,f,v){var d=c[f],p=c[v];d&&!p&&(p=c[v]={},tD(d,function(g,y){if(ye.isValidType(y)){var m=sO.get(y,"inactive",s);m!=null&&(p[y]=m,y==="color"&&!p.hasOwnProperty("opacity")&&!p.hasOwnProperty("colorAlpha")&&(p.opacity=[0,0]))}}))}function h(c){var f=(c.inRange||{}).symbol||(c.outOfRange||{}).symbol,v=(c.inRange||{}).symbolSize||(c.outOfRange||{}).symbolSize,d=this.get("inactiveColor"),p=this.getItemSymbol(),g=p||"roundRect";tD(this.stateList,function(y){var m=this.itemSize,_=c[y];_||(_=c[y]={color:s?d:[d]}),_.symbol==null&&(_.symbol=f&&it(f)||(s?g:[g])),_.symbolSize==null&&(_.symbolSize=v&&it(v)||(s?m[0]:[m[0],m[0]])),_.symbol=QA(_.symbol,function(S){return S==="none"?g:S});var x=_.symbolSize;if(x!=null){var b=-1/0;ztt(x,function(S){S>b&&(b=S)}),_.symbolSize=QA(x,function(S){return Gtt(S,[0,b],[0,m[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},t}(yt),eD=[20,140],Htt=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.optionUpdated=function(e,i){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(n){n.mappingMethod="linear",n.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){r.prototype.resetItemSize.apply(this,arguments);var e=this.itemSize;(e[0]==null||isNaN(e[0]))&&(e[0]=eD[0]),(e[1]==null||isNaN(e[1]))&&(e[1]=eD[1])},t.prototype._resetRange=function(){var e=this.getExtent(),i=this.option.range;!i||i.auto?(e.auto=1,this.option.range=e):V(i)&&(i[0]>i[1]&&i.reverse(),i[0]=Math.max(i[0],e[0]),i[1]=Math.min(i[1],e[1]))},t.prototype.completeVisualOption=function(){r.prototype.completeVisualOption.apply(this,arguments),A(this.stateList,function(e){var i=this.option.controller[e].symbolSize;i&&i[0]!==i[1]&&(i[0]=i[1]/3)},this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),i=fr((this.get("range")||[]).slice());return i[0]>e[1]&&(i[0]=e[1]),i[1]>e[1]&&(i[1]=e[1]),i[0]=n[1]||e<=i[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var i=[];return this.eachTargetSeries(function(n){var a=[],o=n.getData();o.each(this.getDataDimensionIndex(o),function(s,l){e[0]<=s&&s<=e[1]&&a.push(l)},this),i.push({seriesId:n.id,dataIndex:a})},this),i},t.prototype.getVisualMeta=function(e){var i=rD(this,"outOfRange",this.getExtent()),n=rD(this,"inRange",this.option.range.slice()),a=[];function o(v,d){a.push({value:v,color:e(v,d)})}for(var s=0,l=0,u=n.length,h=i.length;le[1])break;a.push({color:this.getControllerVisual(l,"color",i),offset:s/n})}return a.push({color:this.getControllerVisual(e[1],"color",i),offset:1}),a},t.prototype._createBarPoints=function(e,i){var n=this.visualMapModel.itemSize;return[[n[0]-i[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-i[1],e[1]]]},t.prototype._createBarGroup=function(e){var i=this._orient,n=this.visualMapModel.get("inverse");return new at(i==="horizontal"&&!n?{scaleX:e==="bottom"?1:-1,rotation:Math.PI/2}:i==="horizontal"&&n?{scaleX:e==="bottom"?-1:1,rotation:-Math.PI/2}:i==="vertical"&&!n?{scaleX:e==="left"?1:-1,scaleY:-1}:{scaleX:e==="left"?1:-1})},t.prototype._updateHandle=function(e,i){if(this._useHandle){var n=this._shapes,a=this.visualMapModel,o=n.handleThumbs,s=n.handleLabels,l=a.itemSize,u=a.getExtent(),h=this._applyTransform("left",n.mainGroup);Wtt([0,1],function(c){var f=o[c];f.setStyle("fill",i.handlesColor[c]),f.y=e[c];var v=ci(e[c],[0,l[1]],u,!0),d=this.getControllerVisual(v,"symbolSize");f.scaleX=f.scaleY=d/l[0],f.x=l[0]-d/2;var p=Jr(n.handleLabelPoints[c],zn(f,this.group));if(this._orient==="horizontal"){var g=h==="left"||h==="top"?(l[0]-d)/2:(l[0]-d)/-2;p[1]+=g}s[c].setStyle({x:p[0],y:p[1],text:a.formatValueText(this._dataInterval[c]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",n.mainGroup):"center"})},this)}},t.prototype._showIndicator=function(e,i,n,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],h=this._shapes,c=h.indicator;if(c){c.attr("invisible",!1);var f={convertOpacityToAlpha:!0},v=this.getControllerVisual(e,"color",f),d=this.getControllerVisual(e,"symbolSize"),p=ci(e,s,u,!0),g=l[0]-d/2,y={x:c.x,y:c.y};c.y=p,c.x=g;var m=Jr(h.indicatorLabelPoint,zn(c,this.group)),_=h.indicatorLabel;_.attr("invisible",!1);var x=this._applyTransform("left",h.mainGroup),b=this._orient,S=b==="horizontal";_.setStyle({text:(n||"")+o.formatValueText(i),verticalAlign:S?x:"middle",align:S?"center":x});var w={x:g,y:p,style:{fill:v}},T={style:{x:m[0],y:m[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var M={duration:100,easing:"cubicInOut",additive:!0};c.x=y.x,c.y=y.y,c.animateTo(w,M),_.animateTo(T,M)}else c.attr(w),_.attr(T);this._firstShowIndicator=!1;var C=this._shapes.handleLabels;if(C)for(var D=0;Do[1]&&(c[1]=1/0),i&&(c[0]===-1/0?this._showIndicator(h,c[1],"< ",l):c[1]===1/0?this._showIndicator(h,c[0],"> ",l):this._showIndicator(h,h,"≈ ",l));var f=this._hoverLinkDataIndices,v=[];(i||oD(n))&&(v=this._hoverLinkDataIndices=n.findTargetDataIndices(c));var d=VG(f,v);this._dispatchHighDown("downplay",xf(d[0],n)),this._dispatchHighDown("highlight",xf(d[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var i;if(Za(e.target,function(l){var u=ot(l);if(u.dataIndex!=null)return i=u,!0},!0),!!i){var n=this.ecModel.getSeriesByIndex(i.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(n)){var o=n.getData(i.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),i.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0);var i=this._shapes.handleLabels;if(i)for(var n=0;n=0&&(a.dimension=o,i.push(a))}}),r.getData().setVisual("visualMeta",i)}}];function Ktt(r,t,e,i){for(var n=t.targetVisuals[i],a=ye.prepareVisualTypes(n),o={color:xh(r.getData(),"color")},s=0,l=a.length;s0:t.splitNumber>0)||t.calculable)?"continuous":"piecewise"}),r.registerAction(Ztt,jtt),A(qtt,function(t){r.registerVisual(r.PRIORITY.VISUAL.COMPONENT,t)}),r.registerPreprocessor(Jtt))}function cO(r){r.registerComponentModel(Htt),r.registerComponentView($tt),hO(r)}var Qtt=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e._pieceList=[],e}return t.prototype.optionUpdated=function(e,i){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var n=this._mode=this._determineMode();this._pieceList=[],tet[this._mode].call(this,this._pieceList),this._resetSelected(e,i);var a=this.option.categories;this.resetVisual(function(o,s){n==="categories"?(o.mappingMethod="category",o.categories=it(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=F(this._pieceList,function(l){return l=it(l),s!=="inRange"&&(l.visual=null),l}))})},t.prototype.completeVisualOption=function(){var e=this.option,i={},n=ye.listVisualTypes(),a=this.isCategory();A(e.pieces,function(s){A(n,function(l){s.hasOwnProperty(l)&&(i[l]=1)})}),A(i,function(s,l){var u=!1;A(this.stateList,function(h){u=u||o(e,h,l)||o(e.target,h,l)},this),!u&&A(this.stateList,function(h){(e[h]||(e[h]={}))[l]=sO.get(l,h==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}r.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,i){var n=this.option,a=this._pieceList,o=(i?n:e).selected||{};if(n.selected=o,A(a,function(l,u){var h=this.getSelectedMapKey(l);o.hasOwnProperty(h)||(o[h]=!0)},this),n.selectedMode==="single"){var s=!1;A(a,function(l,u){var h=this.getSelectedMapKey(l);o[h]&&(s?o[h]=!1:s=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(e){return this._mode==="categories"?e.value+"":e.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(e){this.option.selected=it(e)},t.prototype.getValueState=function(e){var i=ye.findPieceIndex(e,this._pieceList);return i!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[i])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var i=[],n=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var h=ye.findPieceIndex(l,n);h===e&&o.push(u)},this),i.push({seriesId:a.id,dataIndex:o})},this),i},t.prototype.getRepresentValue=function(e){var i;if(this.isCategory())i=e.value;else if(e.value!=null)i=e.value;else{var n=e.interval||[];i=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return i},t.prototype.getVisualMeta=function(e){if(this.isCategory())return;var i=[],n=["",""],a=this;function o(h,c){var f=a.getRepresentValue({interval:h});c||(c=a.getValueState(f));var v=e(f,c);h[0]===-1/0?n[0]=v:h[1]===1/0?n[1]=v:i.push({value:h[0],color:v},{value:h[1],color:v})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return A(s,function(h){var c=h.interval;c&&(c[0]>u&&o([u,c[0]],"outOfRange"),o(c.slice()),u=c[1])},this),{stops:i,outerColors:n}},t.type="visualMap.piecewise",t.defaultOption=ea(wv.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(wv),tet={splitNumber:function(r){var t=this.option,e=Math.min(t.precision,20),i=this.getExtent(),n=t.splitNumber;n=Math.max(parseInt(n,10),1),t.splitNumber=n;for(var a=(i[1]-i[0])/n;+a.toFixed(e)!==a&&e<5;)e++;t.precision=e,a=+a.toFixed(e),t.minOpen&&r.push({interval:[-1/0,i[0]],close:[0,0]});for(var o=0,s=i[0];o","≥"][i[0]]];e.text=e.text||this.formatValueText(e.value!=null?e.value:e.interval,!1,n)},this)}};function hD(r,t){var e=r.inverse;(r.orient==="vertical"?!e:e)&&t.reverse()}var eet=function(r){E(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.doRender=function(){var e=this.group;e.removeAll();var i=this.visualMapModel,n=i.get("textGap"),a=i.textStyleModel,o=a.getFont(),s=a.getTextColor(),l=this._getItemAlign(),u=i.itemSize,h=this._getViewData(),c=h.endsText,f=pe(i.get("showLabel",!0),!c),v=!i.get("selectedMode");c&&this._renderEndsText(e,c[0],u,f,l),A(h.viewPieceList,function(d){var p=d.piece,g=new at;g.onclick=$(this._onItemClick,this,p),this._enableHoverLink(g,d.indexInModelPieceList);var y=i.getRepresentValue(p);if(this._createItemSymbol(g,y,[0,0,u[0],u[1]],v),f){var m=this.visualMapModel.getValueState(y);g.add(new St({style:{x:l==="right"?-n:u[0]+n,y:u[1]/2,text:p.text,verticalAlign:"middle",align:l,font:o,fill:s,opacity:m==="outOfRange"?.5:1},silent:v}))}e.add(g)},this),c&&this._renderEndsText(e,c[1],u,f,l),io(i.get("orient"),e,i.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,i){var n=this;e.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=n.visualMapModel;s.option.hoverLink&&n.api.dispatchAction({type:o,batch:xf(s.findTargetDataIndices(i),s)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,i=e.option;if(i.orient==="vertical")return uO(e,this.api,e.itemSize);var n=i.align;return(!n||n==="auto")&&(n="left"),n},t.prototype._renderEndsText=function(e,i,n,a,o){if(i){var s=new at,l=this.visualMapModel.textStyleModel;s.add(new St({style:Gt(l,{x:a?o==="right"?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:a?o:"center",text:i})})),e.add(s)}},t.prototype._getViewData=function(){var e=this.visualMapModel,i=F(e.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),n=e.get("text"),a=e.get("orient"),o=e.get("inverse");return(a==="horizontal"?o:!o)?i.reverse():n&&(n=n.slice().reverse()),{viewPieceList:i,endsText:n}},t.prototype._createItemSymbol=function(e,i,n,a){var o=ae(this.getControllerVisual(i,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(i,"color"));o.silent=a,e.add(o)},t.prototype._onItemClick=function(e){var i=this.visualMapModel,n=i.option,a=n.selectedMode;if(a){var o=it(n.selected),s=i.getSelectedMapKey(e);a==="single"||a===!0?(o[s]=!0,A(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},t.type="visualMap.piecewise",t}(lO);function fO(r){r.registerComponentModel(Qtt),r.registerComponentView(eet),hO(r)}function ret(r){pt(cO),pt(fO)}var iet={label:{enabled:!0},decal:{show:!1}},cD=Tt(),net={};function aet(r,t){var e=r.getModel("aria");if(!e.get("enabled"))return;var i=it(iet);ht(i.label,r.getLocaleModel().get("aria"),!1),ht(e.option,i,!1),n(),a();function n(){var u=e.getModel("decal"),h=u.get("show");if(h){var c=Z();r.eachSeries(function(f){if(!f.isColorBySeries()){var v=c.get(f.type);v||(v={},c.set(f.type,v)),cD(f).scope=v}}),r.eachRawSeries(function(f){if(r.isSeriesFiltered(f))return;if(Q(f.enableAriaDecal)){f.enableAriaDecal();return}var v=f.getData();if(f.isColorBySeries()){var m=dm(f.ecModel,f.name,net,r.getSeriesCount()),_=v.getVisual("decal");v.setVisual("decal",x(_,m))}else{var d=f.getRawData(),p={},g=cD(f).scope;v.each(function(b){var S=v.getRawIndex(b);p[S]=b});var y=d.count();d.each(function(b){var S=p[b],w=d.getName(b)||b+"",T=dm(f.ecModel,w,g,y),M=v.getItemVisual(S,"decal");v.setItemVisual(S,"decal",x(M,T))})}function x(b,S){var w=b?z(z({},S),b):S;return w.dirty=!0,w}})}}function a(){var u=t.getZr().dom;if(u){var h=r.getLocaleModel().get("aria"),c=e.getModel("label");if(c.option=tt(c.option,h),!!c.get("enabled")){if(u.setAttribute("role","img"),c.get("description")){u.setAttribute("aria-label",c.get("description"));return}var f=r.getSeriesCount(),v=c.get(["data","maxCount"])||10,d=c.get(["series","maxCount"])||10,p=Math.min(f,d),g;if(!(f<1)){var y=s();if(y){var m=c.get(["general","withTitle"]);g=o(m,{title:y})}else g=c.get(["general","withoutTitle"]);var _=[],x=f>1?c.get(["series","multiple","prefix"]):c.get(["series","single","prefix"]);g+=o(x,{seriesCount:f}),r.eachSeries(function(T,M){if(M1?c.get(["series","multiple",L]):c.get(["series","single",L]),C=o(C,{seriesId:T.seriesIndex,seriesName:T.get("name"),seriesType:l(T.subType)});var I=T.getData();if(I.count()>v){var P=c.get(["data","partialData"]);C+=o(P,{displayCnt:v})}else C+=c.get(["data","allData"]);for(var k=c.get(["data","separator","middle"]),R=c.get(["data","separator","end"]),N=c.get(["data","excludeDimensionId"]),O=[],B=0;B":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},uet=function(){function r(t){var e=this._condVal=Y(t)?new RegExp(t):BL(t)?t:null;if(e==null){var i="";kt(i)}}return r.prototype.evaluate=function(t){var e=typeof t;return Y(e)?this._condVal.test(t):Mt(e)?this._condVal.test(t+""):!1},r}(),het=function(){function r(){}return r.prototype.evaluate=function(){return this.value},r}(),cet=function(){function r(){}return r.prototype.evaluate=function(){for(var t=this.children,e=0;e2&&i.push(n),n=[I,P]}function h(I,P,k,R){ls(I,k)&&ls(P,R)||n.push(I,P,k,R,k,R)}function c(I,P,k,R,N,O){var B=Math.abs(P-I),G=Math.tan(B/4)*4/3,H=PT:D2&&i.push(n),i}function y0(r,t,e,i,n,a,o,s,l,u){if(ls(r,e)&&ls(t,i)&&ls(n,o)&&ls(a,s)){l.push(o,s);return}var h=2/u,c=h*h,f=o-r,v=s-t,d=Math.sqrt(f*f+v*v);f/=d,v/=d;var p=e-r,g=i-t,y=n-o,m=a-s,_=p*p+g*g,x=y*y+m*m;if(_=0&&T=0){l.push(o,s);return}var M=[],C=[];$n(r,e,n,o,.5,M),$n(t,i,a,s,.5,C),y0(M[0],C[0],M[1],C[1],M[2],C[2],M[3],C[3],l,u),y0(M[4],C[4],M[5],C[5],M[6],C[6],M[7],C[7],l,u)}function Cet(r,t){var e=g0(r),i=[];t=t||1;for(var n=0;n0)for(var u=0;uMath.abs(u),c=dO([l,u],h?0:1,t),f=(h?s:u)/c.length,v=0;vn,o=dO([i,n],a?0:1,t),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",h=a?"y":"x",c=r[s]/o.length,f=0;f1?null:new ct(p*l+r,p*u+t)}function Let(r,t,e){var i=new ct;ct.sub(i,e,t),i.normalize();var n=new ct;ct.sub(n,r,t);var a=n.dot(i);return a}function Ko(r,t){var e=r[r.length-1];e&&e[0]===t[0]&&e[1]===t[1]||r.push(t)}function Iet(r,t,e){for(var i=r.length,n=[],a=0;ao?(u.x=h.x=s+a/2,u.y=l,h.y=l+o):(u.y=h.y=l+o/2,u.x=s,h.x=s+a),Iet(t,u,h)}function Tv(r,t,e,i){if(e===1)i.push(t);else{var n=Math.floor(e/2),a=r(t);Tv(r,a[0],n,i),Tv(r,a[1],e-n,i)}return i}function Pet(r,t){for(var e=[],i=0;i0;u/=2){var h=0,c=0;(r&u)>0&&(h=1),(t&u)>0&&(c=1),s+=u*u*(3*h^c),c===0&&(h===1&&(r=u-1-r,t=u-1-t),l=r,r=t,t=l)}return s}function Av(r){var t=1/0,e=1/0,i=-1/0,n=-1/0,a=F(r,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),h=l.x+l.width/2+(u?u[4]:0),c=l.y+l.height/2+(u?u[5]:0);return t=Math.min(h,t),e=Math.min(c,e),i=Math.max(h,i),n=Math.max(c,n),[h,c]}),o=F(a,function(s,l){return{cp:s,z:Fet(s[0],s[1],t,e,i,n),path:r[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function yO(r){return Eet(r.path,r.count)}function m0(){return{fromIndividuals:[],toIndividuals:[],count:0}}function Get(r,t,e){var i=[];function n(b){for(var S=0;S=0;n--)if(!e[n].many.length){var l=e[s].many;if(l.length<=1)if(s)s=0;else return e;var a=l.length,u=Math.ceil(a/2);e[n].many=l.slice(u,a),e[s].many=l.slice(0,u),s++}return e}var Wet={clone:function(r){for(var t=[],e=1-Math.pow(1-r.path.style.opacity,1/r.count),i=0;i0))return;var s=i.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,h;xD(r)&&(u=r,h=t),xD(t)&&(u=t,h=r);function c(y,m,_,x,b){var S=y.many,w=y.one;if(S.length===1&&!b){var T=m?S[0]:w,M=m?w:S[0];if(Mv(T))c({many:[T],one:M},!0,_,x,!0);else{var C=s?tt({delay:s(_,x)},l):l;ob(T,M,C),a(T,M,T,M,C)}}else for(var D=tt({dividePath:Wet[e],individualDelay:s&&function(N,O,B,G){return s(N+_,x)}},l),L=m?Get(S,w,D):Het(w,S,D),I=L.fromIndividuals,P=L.toIndividuals,k=I.length,R=0;Rt.length,v=u?bD(h,u):bD(f?t:r,[f?r:t]),d=0,p=0;pmO))for(var a=i.getIndices(),o=0;o0&&S.group.traverse(function(T){T instanceof _t&&!T.animators.length&&T.animateFrom({style:{opacity:0}},w)})})}function CD(r){var t=r.getModel("universalTransition").get("seriesKey");return t||r.id}function AD(r){return V(r)?r.sort().join(","):r}function xn(r){if(r.hostModel)return r.hostModel.getModel("universalTransition").get("divideShape")}function qet(r,t){var e=Z(),i=Z(),n=Z();return A(r.oldSeries,function(a,o){var s=r.oldDataGroupIds[o],l=r.oldData[o],u=CD(a),h=AD(u);i.set(h,{dataGroupId:s,data:l}),V(u)&&A(u,function(c){n.set(c,{key:h,dataGroupId:s,data:l})})}),A(t.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=CD(a),u=AD(l),h=i.get(u);if(h)e.set(u,{oldSeries:[{dataGroupId:h.dataGroupId,divide:xn(h.data),data:h.data}],newSeries:[{dataGroupId:o,divide:xn(s),data:s}]});else if(V(l)){var c=[];A(l,function(d){var p=i.get(d);p.data&&c.push({dataGroupId:p.dataGroupId,divide:xn(p.data),data:p.data})}),c.length&&e.set(u,{oldSeries:c,newSeries:[{dataGroupId:o,data:s,divide:xn(s)}]})}else{var f=n.get(l);if(f){var v=e.get(f.key);v||(v={oldSeries:[{dataGroupId:f.dataGroupId,data:f.data,divide:xn(f.data)}],newSeries:[]},e.set(f.key,v)),v.newSeries.push({dataGroupId:o,data:s,divide:xn(s)})}}}}),e}function DD(r,t){for(var e=0;e=0&&n.push({dataGroupId:t.oldDataGroupIds[s],data:t.oldData[s],divide:xn(t.oldData[s]),groupIdDim:o.dimension})}),A(Bt(r.to),function(o){var s=DD(e.updatedSeries,o);if(s>=0){var l=e.updatedSeries[s].getData();a.push({dataGroupId:t.oldDataGroupIds[s],data:l,divide:xn(l),groupIdDim:o.dimension})}}),n.length>0&&a.length>0&&_O(n,a,i)}function Jet(r){r.registerUpdateLifecycle("series:beforeupdate",function(t,e,i){A(Bt(i.seriesTransition),function(n){A(Bt(n.to),function(a){for(var o=i.updatedSeries,s=0;s1&&arguments[1]!==void 0?arguments[1]:60,a=null;return function(){for(var o=this,s=arguments.length,l=new Array(s),u=0;ur.right&&(a|=O),tr.bottom&&(a|=N),a}function ie(e,t){for(var r=e.x0,a=e.y0,i=e.x1,n=e.y1,o=M(r,a,t),s=M(i,n,t),l,u,v;!(!(o|s)||o&s);)l=o||s,l&F?(u=r+(i-r)*(t.top-a)/(n-a),v=t.top):l&N?(u=r+(i-r)*(t.bottom-a)/(n-a),v=t.bottom):l&O?(v=a+(n-a)*(t.right-r)/(i-r),u=t.right):l&z&&(v=a+(n-a)*(t.left-r)/(i-r),u=t.left),l===o?(r=u,a=v,o=M(r,a,t)):(i=u,n=v,s=M(i,n,t));return{x0:r,x1:i,y0:a,y1:n}}function P(e,t){var r=t.anchor,a=e,i,n;return t.clamp&&(a=ie(a,t.area)),r==="start"?(i=a.x0,n=a.y0):r==="end"?(i=a.x1,n=a.y1):(i=(a.x0+a.x1)/2,n=(a.y0+a.y1)/2),ae(i,n,e.vx,e.vy,t.align)}var S={arc:function(e,t){var r=(e.startAngle+e.endAngle)/2,a=Math.cos(r),i=Math.sin(r),n=e.innerRadius,o=e.outerRadius;return P({x0:e.x+a*n,y0:e.y+i*n,x1:e.x+a*o,y1:e.y+i*o,vx:a,vy:i},t)},point:function(e,t){var r=R(e,t.origin),a=r.x*e.options.radius,i=r.y*e.options.radius;return P({x0:e.x-a,y0:e.y-i,x1:e.x+a,y1:e.y+i,vx:r.x,vy:r.y},t)},bar:function(e,t){var r=R(e,t.origin),a=e.x,i=e.y,n=0,o=0;return e.horizontal?(a=Math.min(e.x,e.base),n=Math.abs(e.base-e.x)):(i=Math.min(e.y,e.base),o=Math.abs(e.base-e.y)),P({x0:a,y0:i+o,x1:a+n,y1:i,vx:r.x,vy:r.y},t)},fallback:function(e,t){var r=R(e,t.origin);return P({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:r.x,vy:r.y},t)}},x=m.rasterize;function ne(e){var t=e.borderWidth||0,r=e.padding,a=e.size.height,i=e.size.width,n=-i/2,o=-a/2;return{frame:{x:n-r.left-t,y:o-r.top-t,w:i+r.width+t*2,h:a+r.height+t*2},text:{x:n,y:o,w:i,h:a}}}function oe(e,t){var r=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!r)return null;if(r.xCenter!==void 0&&r.yCenter!==void 0)return{x:r.xCenter,y:r.yCenter};var a=r.getBasePixel();return e.horizontal?{x:a,y:null}:{x:null,y:a}}function se(e){return e instanceof Y?S.arc:e instanceof Q?S.point:e instanceof Z?S.bar:S.fallback}function le(e,t,r,a,i,n){var o=Math.PI/2;if(n){var s=Math.min(n,i/2,a/2),l=t+s,u=r+s,v=t+a-s,d=r+i-s;e.moveTo(t,u),la.x+a.w+r*2||e.y>a.y+a.h+r*2)},intersects:function(e){var t=this._points(),r=e._points(),a=[E(t[0],t[1]),E(t[0],t[3])],i,n,o;for(this._rotation!==e._rotation&&a.push(E(r[0],r[1]),E(r[0],r[3])),i=0;i=0;--r)for(i=e[r].$layout,a=r-1;a>=0&&i._visible;--a)n=e[a].$layout,n._visible&&i._box.intersects(n._box)&&t(i,n);return e}function _e(e){var t,r,a,i,n,o,s;for(t=0,r=e.length;tl.getProps([u],!0)[u]}),n=a.geometry(),o=H(s,a.model(),n),i._box.update(o,n,a.rotation()));return xe(e,function(l,u){var v=l._hidable,d=u._hidable;v&&d||d?u._visible=!1:v&&(l._visible=!1)})}var w={prepare:function(e){var t=[],r,a,i,n,o;for(r=0,i=e.length;r=0;--r)if(a=e[r].$layout,a&&a._visible&&a._box.contains(t))return e[r];return null},draw:function(e,t){var r,a,i,n,o,s;for(r=0,a=t.length;r{t(o());const{data:a,status:n}=await e.get("province");return t(r()),{data:a,status:n}}),T=c("CITY_GET_PROVINCES",async s=>{const{data:t,status:a}=await e.get("city/?province_key="+s);return{data:t,status:a}});export{T as a,_ as c}; diff --git a/build/assets/delete-debtor-killhouses-DJCuTTOS.js b/build/assets/delete-debtor-killhouses-DJCuTTOS.js new file mode 100644 index 0000000..9003d9f --- /dev/null +++ b/build/assets/delete-debtor-killhouses-DJCuTTOS.js @@ -0,0 +1 @@ +import{j as u,a3 as _,B as C,ak as T,I as V,b0 as z,an as w,d as x,ao as f,b4 as v,ap as A,aq as j}from"./mui-vendor-CkIVaoQP.js";import{r as i,u as B}from"./react-vendor-CmFgShSM.js";import{a as F,u as S}from"./redux-vendor-B7uoacJt.js";import{L as k,j as E,h as p,A as m,u as N,C as h,cm as R,c4 as M,a1 as L,cn as U,X as G,c as $,M as K,G as q,O as g,a7 as Q,S as I}from"./index-CeyyVc1v.js";import{d as H}from"./Delete-C5MyLelE.js";import{d as W}from"./Tune-D4M2CAhp.js";import{d as X}from"./Plagiarism-BiXORbzo.js";import{d as Y}from"./Edit-CqBj1Y2L.js";import{N as Z}from"./NumberFormatCustom-DwWPj40N.js";import{d as J}from"./VpnKey-Di_7HUWD.js";const uu=F("ARCHIVE_AVICALTURE_REQUEST_SERVICE",async(e,{dispatch:r})=>{r(k());try{const{data:a,status:t}=await E.put("Poultry_Request/0/",e);return r(p()),{data:a,status:t}}catch(a){return r(p()),{error:a.response.data.result}}}),eu=F("REMOVE_AVICALTURE_REQUEST_SERVICE",async(e,{dispatch:r})=>{r(k());try{const{data:a,status:t}=await E.delete("Poultry_Request/"+e);return r(p()),{data:a,status:t}}catch(a){return r(p()),{error:a.response.data.result}}}),tu=F("UPDATE_KILL_POULTRY_REQUEST",async e=>{try{const{data:r,status:a}=await E.put("Poultry_Request/0/",e);return{data:r,status:a}}catch(r){return{error:r.response.data.result}}}),ru=({item:e,updateTable:r})=>{const[a]=i.useContext(m),t=S(),[,,y,,s]=i.useContext(m),n=N({initialValues:{quantity:""},validate:o=>{const c={};return o.quantity?isNaN(o.quantity)&&(c.quantity="Must be a number"):c.quantity="Required",c},onSubmit:o=>{}});return i.useEffect(()=>{n.validateForm()},[]),i.useEffect(()=>{n.setFieldValue("quantity",e.quantity)},[e.quantity]),u.jsxs(_,{direction:"row",display:"flex",children:[u.jsx(Z,{allowLeadingZeros:!0,thousandSeparator:",",id:"quantity",onChange:n.handleChange,value:n.values.quantity,style:{width:80,textAlign:"center"}}),u.jsx(C,{disabled:!n.isValid,onClick:()=>{t(tu({key:e.key,quantity:Number(n.values.quantity),state:"accepted_quantity"})).then(o=>{o.payload.error?a({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(t(h()),r(),t(R({selectedDate1:y,selectedDate2:s})),t(M()),t(L()),t(U(G())),t(L()),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت"})]},"ooo")},au=F("PROVINCE_EDIT_CONFIRMATION_CODE",async(e,{dispatch:r})=>{try{r(k());const{data:a,status:t}=await E.put("Poultry_Request/0/",e);return r(p()),{data:a,status:t}}catch(a){return r(p()),{error:a.response.data.result}}}),su=({updateTable:e,item:r})=>{const[a]=i.useContext(m),t=S(),y=$({verificationCode:K().required("کد احراز الزامی است").matches(/^\d+$/,"کد احراز باید عددی باشد").length(5,"کد احراز باید 5 رقم باشد")}),s=N({initialValues:{verificationCode:""},validationSchema:y,onSubmit:n=>{t(au({poultry_request_key:r==null?void 0:r.key,confirmation_code:n==null?void 0:n.verificationCode})).then(o=>{e(),o.payload.error?a({vertical:"top",horizontal:"center",msg:o.payload.error,severity:"error"}):(e(),a({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(h()))})}});return i.useEffect(()=>{s.validateForm()},[t]),u.jsxs(_,{container:!0,xs:12,justifyContent:"center",children:[u.jsx(_,{item:!0,xs:12,mb:3,children:u.jsx(T,{fullWidth:!0,id:"verificationCode",name:"verificationCode",label:"کد احراز",variant:"outlined",value:s.values.verificationCode,onChange:s.handleChange,onBlur:s.handleBlur,error:s.touched.verificationCode&&!!s.errors.verificationCode,helperText:s.touched.verificationCode&&s.errors.verificationCode,inputProps:{maxLength:6,inputMode:"numeric"}})}),u.jsx(_,{item:!0,xs:12,children:u.jsx(C,{fullWidth:!0,color:"primary",variant:"contained",onClick:s.handleSubmit,type:"submit",disabled:!s.isValid||s.isSubmitting,size:"large",children:"تایید"})})]})},xu=({item:e,fileUrl:r,updateTable:a})=>{const t=S(),y=B(),[s]=i.useContext(m),[,,n,,o]=i.useContext(m),[c,D]=i.useState(null),O=l=>{D(l.currentTarget)},d=()=>{D(null)},P=!!c,b=P?"popover":void 0;return u.jsxs(q,{container:!0,children:[u.jsx(V,{"aria-describedby":b,variant:"contained",color:"primary",onClick:O,children:u.jsx(W,{})}),u.jsx(z,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:b,open:P,anchorEl:c,onClose:d,children:u.jsxs(w,{dense:!0,sx:{minWidth:220,py:0},children:[e.hatching.fileState==="confirmation_code_pending"&&u.jsx(x,{title:"ورود کد احراز",placement:"left-start",children:u.jsx(f,{disablePadding:!0,children:u.jsxs(v,{onClick:()=>{d(),t(g({title:"ورود کد احراز",content:u.jsx(su,{updateTable:a,item:e})}))},children:[u.jsx(A,{children:u.jsx(J,{color:"primary"})}),u.jsx(j,{primary:"ورود کد احراز"})]})})}),u.jsx(x,{title:"ویرایش تعداد کشتار",placement:"left-start",children:u.jsx(f,{disablePadding:!0,children:u.jsxs(v,{onClick:()=>{d(),t(g({title:"ویرایش تعداد کشتار",content:u.jsx(ru,{updateTable:a,item:e})}))},children:[u.jsx(A,{children:u.jsx(Y,{color:"primary"})}),u.jsx(j,{primary:"ویرایش تعداد کشتار"})]})})}),u.jsx(x,{title:"اتمام پرونده",placement:"left-start",children:u.jsx(f,{disablePadding:!0,children:u.jsxs(v,{onClick:()=>{d(),t(g({title:"آیا مطمئن هستید؟",content:u.jsxs(q,{display:"flex",justifyContent:"space-between",gap:I.SMALL,children:[u.jsx(C,{variant:"contained",onClick:()=>{t(uu({allocated_number:e.quantity-(e==null?void 0:e.remainQuantity),final_state:"archive",key:e==null?void 0:e.key})).then(l=>{a(),t(R({selectedDate1:n,selectedDate2:o})),l.payload.error?s({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(a(),s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(h()))})},children:"بله"}),u.jsx(C,{variant:"contained",color:"error",onClick:()=>{t(h())},children:"خیر"})]})}))},children:[u.jsx(A,{children:u.jsx(Q,{color:"primary"})}),u.jsx(j,{primary:"اتمام پرونده"})]})})}),u.jsx(x,{title:"مشاهده پرونده",placement:"left-start",children:u.jsx(f,{disablePadding:!0,children:u.jsxs(v,{onClick:()=>{d(),y(r+(e==null?void 0:e.id))},children:[u.jsx(A,{children:u.jsx(X,{color:"primary"})}),u.jsx(j,{primary:"مشاهده پرونده"})]})})}),u.jsx(x,{title:"حذف درخواست کشتار",placement:"left-start",children:u.jsx(f,{disablePadding:!0,children:u.jsxs(v,{onClick:()=>{d(),t(g({title:"آیا مطمئن هستید؟",content:u.jsxs(q,{display:"flex",justifyContent:"space-between",gap:I.SMALL,children:[u.jsx(C,{variant:"contained",onClick:()=>{t(eu(e==null?void 0:e.id)).then(l=>{l.payload.error?s({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(a(),t(R({selectedDate1:n,selectedDate2:o})),s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),t(h()))})},children:"بله"}),u.jsx(C,{variant:"contained",color:"error",onClick:()=>{t(h())},children:"خیر"})]})}))},children:[u.jsx(A,{children:u.jsx(H,{color:"error"})}),u.jsx(j,{primary:"حذف درخواست کشتار",primaryTypographyProps:{color:"error"}})]})})})]})})]})},fu=F("DELETE_DEBTORS",async()=>{const{data:e,status:r}=await E.delete("delete-debtors-kill-requests/0");return{data:e,status:r}});export{xu as P,su as a,fu as d}; diff --git a/build/assets/eita-DbmaOKcl.png b/build/assets/eita-DbmaOKcl.png new file mode 100644 index 0000000..dd50b93 Binary files /dev/null and b/build/assets/eita-DbmaOKcl.png differ diff --git a/build/assets/farmIcon1-DhvNG8hJ.png b/build/assets/farmIcon1-DhvNG8hJ.png new file mode 100644 index 0000000..44b558d Binary files /dev/null and b/build/assets/farmIcon1-DhvNG8hJ.png differ diff --git a/build/assets/farmIcon2-CmGqZYKG.png b/build/assets/farmIcon2-CmGqZYKG.png new file mode 100644 index 0000000..ae7e8b3 Binary files /dev/null and b/build/assets/farmIcon2-CmGqZYKG.png differ diff --git a/build/assets/farmIcon4-elV-CAva.png b/build/assets/farmIcon4-elV-CAva.png new file mode 100644 index 0000000..6de21b3 Binary files /dev/null and b/build/assets/farmIcon4-elV-CAva.png differ diff --git a/build/assets/farmIcon6-imt3OpUd.png b/build/assets/farmIcon6-imt3OpUd.png new file mode 100644 index 0000000..f85d83c Binary files /dev/null and b/build/assets/farmIcon6-imt3OpUd.png differ diff --git a/build/assets/farmIcon7-Bdy1Kjio.png b/build/assets/farmIcon7-Bdy1Kjio.png new file mode 100644 index 0000000..6743ff3 Binary files /dev/null and b/build/assets/farmIcon7-Bdy1Kjio.png differ diff --git a/build/assets/free-buying-payment-DH20xTKI.js b/build/assets/free-buying-payment-DH20xTKI.js new file mode 100644 index 0000000..ad283c3 --- /dev/null +++ b/build/assets/free-buying-payment-DH20xTKI.js @@ -0,0 +1 @@ +import{a as o}from"./redux-vendor-B7uoacJt.js";import{L as y,j as c,h as a}from"./index-CeyyVc1v.js";const m=o("FREE_BUYING_PAYMENT",async(s,{dispatch:u})=>{var r,t;try{u(y());const{data:e,status:n}=await c.get(`direct-buying-payment/?province_kill_request_key=${s}`);return u(a()),{data:e,status:n}}catch(e){return u(a()),{error:((t=(r=e.response)==null?void 0:r.data)==null?void 0:t.result)||"خطایی رخ داده است"}}});export{m as f}; diff --git a/build/assets/get-announcement-5NHhejXl.js b/build/assets/get-announcement-5NHhejXl.js new file mode 100644 index 0000000..e644464 --- /dev/null +++ b/build/assets/get-announcement-5NHhejXl.js @@ -0,0 +1 @@ +import{a as s}from"./redux-vendor-B7uoacJt.js";import{L as o,j as r,h as N}from"./index-CeyyVc1v.js";const m=s("GET_ANNOUNCEMENT",async(e,{dispatch:t})=>{t(o());const{data:n,status:a}=await r.get("announcements/?total=true");return t(N()),{data:n,status:a}}),A=s("GET_ANNOUNCEMENT",async(e,{dispatch:t})=>{t(o());const{data:n,status:a}=await r.get(`announcements/?role=${e}`);return t(N()),{data:n,status:a}});export{m as a,A as g}; diff --git a/build/assets/getAllocationType-76F45b0K.js b/build/assets/getAllocationType-76F45b0K.js new file mode 100644 index 0000000..4742590 --- /dev/null +++ b/build/assets/getAllocationType-76F45b0K.js @@ -0,0 +1 @@ +const o=u=>u!=null&&u.allocationType&&{killhouse_steward:"کشتارگاه به مباشر",killhouse_guild:"کشتارگاه به صنف",killhouse_coldhouse:"کشتارگاه به سردخانه",steward_steward:"مباشر به مباشر",steward_guild:"مباشر به صنف",ColdHouse:"کشتارگاه به سردخانه",guild_killhouse:"صنف به کشتارگاه"}[u.allocationType]||"-";export{o as g}; diff --git a/build/assets/getDocumentStates-BlCrMUIj.js b/build/assets/getDocumentStates-BlCrMUIj.js new file mode 100644 index 0000000..8b5c74d --- /dev/null +++ b/build/assets/getDocumentStates-BlCrMUIj.js @@ -0,0 +1 @@ +import{a as n}from"./redux-vendor-B7uoacJt.js";import{L as o,j as u,h as r}from"./index-CeyyVc1v.js";const m=n("GET_DOCUMENT_STATES",async(e,{dispatch:t})=>{t(o());const{data:s,status:a}=await u.get("bar-documents-status/");return t(r()),{data:s,status:a}}),S=n("PROVINCE_SUBMIT_DOCUMENT_STATES",async(e,{dispatch:t})=>{try{t(o());const{data:s,status:a}=await u.put("bar-documents-status/0/",e);return t(r()),{data:s,status:a}}catch(s){return t(r()),{error:s.response.data.result}}});export{m as g,S as s}; diff --git a/build/assets/getPosProviderName-CYVCBpcT.js b/build/assets/getPosProviderName-CYVCBpcT.js new file mode 100644 index 0000000..437ac06 --- /dev/null +++ b/build/assets/getPosProviderName-CYVCBpcT.js @@ -0,0 +1 @@ +const e=u=>{switch(u){case"SEP":return"سامان کیش";case"asanpardakht":return"آسان پرداخت";case"irkish":return"ایران کیش";case"sepehr":return"سپهر";case"mellat":return"ملت";case"pec":return"پارسیان";default:return"نامشخص"}};export{e as g}; diff --git a/build/assets/getProvinceName-BujSmyBy.js b/build/assets/getProvinceName-BujSmyBy.js new file mode 100644 index 0000000..aa38b7e --- /dev/null +++ b/build/assets/getProvinceName-BujSmyBy.js @@ -0,0 +1 @@ +import{f as r}from"./redux-vendor-B7uoacJt.js";const c=()=>{const e=r(s=>s.userSlice.userPath);let a;return e==="https://testbackend.rasadyar.com/"?a="test":e==="https://mabackend.rasadyar.com/"?a="markazi":e==="https://arbackend.rasadyar.com/"?a="ardabil":e==="https://habackend.rasadyar.com/"?a="hamedan":e==="https://bubackend.rasadyar.com/"?a="bushehr":a="hamedan",a};export{c as u}; diff --git a/build/assets/getRemainedSeconds-D4cLRaa6.js b/build/assets/getRemainedSeconds-D4cLRaa6.js new file mode 100644 index 0000000..af6bf1d --- /dev/null +++ b/build/assets/getRemainedSeconds-D4cLRaa6.js @@ -0,0 +1 @@ +import{j as e,ag as E,av as L,aw as N,ax as A,ak as g,T as w,B as k,p as x}from"./mui-vendor-CkIVaoQP.js";import{j as D,A as G,u as F,c as v,M as R,b as _,G as p,S as C,L as M,h as V,jI as P,jJ as W,N as H,v as m}from"./index-CeyyVc1v.js";import{r as f,b as h}from"./react-vendor-CmFgShSM.js";import{I as O,f as U}from"./toBase64-BzgTOHsW.js";import{a as q,u as z}from"./redux-vendor-B7uoacJt.js";const $=q("SLAUGHTER_NEW_COMPLAINT",async r=>{const{data:l,status:o}=await D.post("kill_house_complaint/",r);return{data:l,status:o}}),J=({barKey:r,role:l})=>{const[o]=f.useContext(G),t=z(),[n,j]=h.useState(10),[S,B]=h.useState([]),[i,y]=h.useState([]),b=(a,c)=>{B(a),y(a.map(d=>U(d.data_url)))},I=a=>{switch(a){case 10:return s.isValid&&u.isValid&&i.length;default:return u.isValid&&i.length}},T=a=>{j(a.target.value)},u=F({initialValues:{description:""},validationSchema:v({description:R().required("این فیلد اجباری است!").typeError("لطفا فیلد را پر کنید!")})}),s=F({initialValues:{looses:""},validationSchema:v({looses:_().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!")})});return f.useEffect(()=>{u.validateForm(),s.validateForm()},[]),e.jsxs(p,{container:!0,gap:C.SMALL,direction:"column",flex:"1",height:"100%",justifyContent:"space-between",children:[e.jsxs(p,{container:!0,direction:"column",gap:C.SMALL,children:[e.jsxs(E,{fullWidth:!0,children:[e.jsx(L,{id:"demo-simple-select-label",children:"موضوع"}),e.jsxs(N,{labelId:"demo-simple-select-label",id:"demo-simple-select",value:n,label:"موضوع",onChange:T,children:[e.jsx(A,{value:10,children:"مغایرت درصد تلفات با واقعیت"}),e.jsx(A,{value:20,children:"دیگر"})]})]}),n===10&&e.jsx(g,{id:"looses",label:"درصد تلفات",variant:"outlined",sx:{width:"100%",height:"100%"},value:s.values.looses,error:s.touched.looses?!!s.errors.looses:null,onChange:s.handleChange,onBlur:s.handleBlur,helperText:s.touched.looses&&s.errors.looses?s.errors.looses:null}),e.jsx(g,{id:"description",label:"توضیحات",multiline:!0,rows:5,variant:"outlined",sx:{width:"100%",height:"100%"},value:u.values.description,error:u.touched.description?!!u.errors.description:null,onChange:u.handleChange,onBlur:u.handleBlur,helperText:u.touched.description&&u.errors.description?u.errors.description:null}),e.jsx(w,{children:"پیوست تصویر"}),e.jsx(p,{mb:C.SMALL,children:e.jsx(O,{id:"image",onChange:b,images:S,maxNumber:4,title:"بارگذاری سند",value:u.values.image,error:u.touched.image?!!u.errors.image:null,onBlur:u.handleBlur,helperText:u.touched.image&&u.errors.image?u.errors.image:null})})]}),e.jsx(k,{fullWidth:!0,variant:"contained",disabled:!I(n),onClick:()=>{var a,c;t(M()),t($({bar_key:r,image:i,title:n===10?" مغایرت درصد تلفات با واقعیت":"دیگر",description:u.values.description,percent:(a=s.values)!=null&&a.looses?(c=s.values)==null?void 0:c.looses:null,role:l})).then(d=>{t(V()),d.error?o({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است",severity:"error"}):(t(P()),t(W()),t(H({right:!1,bottom:!1,content:null})),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد!",severity:"success"}))})},children:"ثبت اطلاعات"})]})};J.propTypes={barKey:x.PropTypes.any,role:x.PropTypes.any};const uu=r=>{const l=m(new Date(r)),o=m(),t=l.diff(o);return m.duration(t).asSeconds()};export{J as S,uu as g}; diff --git a/build/assets/getRoleList-CoZzcy9u.js b/build/assets/getRoleList-CoZzcy9u.js new file mode 100644 index 0000000..7741d1c --- /dev/null +++ b/build/assets/getRoleList-CoZzcy9u.js @@ -0,0 +1 @@ +import{V as o}from"./index-CeyyVc1v.js";const i=()=>["CityOperator","Poultry","ProvinceOperator","KillHouse","KillHouseVet","VetFarm","ProvinceFinancial","ProvinceInspector","VetSupervisor","Commerce","CityCommerce","CityVet","CityJahad","Observatory","ProvinceSupervisor","Guilds","GuildRoom","LiveStockSupport","SuperAdmin","ChainCompany","AdminX","Supporter","Dispenser","CityPoultry","ParentCompany","ColdHouseSteward","CityGuild","LiveStockProvinceJahad","Union","Cooperative","Rancher"].map(e=>({role:e,translation:o(e)}));export{i as g}; diff --git a/build/assets/getSamasatProvinces-BvJGUILK.js b/build/assets/getSamasatProvinces-BvJGUILK.js new file mode 100644 index 0000000..58facce --- /dev/null +++ b/build/assets/getSamasatProvinces-BvJGUILK.js @@ -0,0 +1 @@ +const u=()=>[{name:"آذربایجان شرقی",id:"65521"},{name:"آذربایجان غربی",id:"65522"},{name:"اردبیل",id:"65523"},{name:"اصفهان",id:"65524"},{name:"البرز",id:"65525"},{name:"ایلام",id:"65526"},{name:"بوشهر",id:"65527"},{name:"تهران",id:"65528"},{name:"چهارمحال و بختیاری",id:"65529"},{name:"خراسان جنوبی",id:"65530"},{name:"خراسان رضوی",id:"65531"},{name:"خراسان شمالی",id:"65532"},{name:"خوزستان",id:"65533"},{name:"زنجان",id:"65534"},{name:"سمنان",id:"65535"},{name:"سیستان و بلوچستان",id:"65536"},{name:"فارس",id:"65537"},{name:"قزوین",id:"65538"},{name:"قم",id:"65539"},{name:"کردستان",id:"65540"},{name:"کرمان",id:"65541"},{name:"کرمانشاه",id:"65542"},{name:"کهکیلویه و بویراحمد",id:"65543"},{name:"گلستان",id:"65544"},{name:"گیلان",id:"65545"},{name:"لرستان",id:"65546"},{name:"مازندران",id:"65547"},{name:"مرکزی",id:"65548"},{name:"هرمزگان",id:"65549"},{name:"همدان",id:"65550"},{name:"یزد",id:"65551"}];export{u as g}; diff --git a/build/assets/getSystemBaseAddress-B3dWKz82.js b/build/assets/getSystemBaseAddress-B3dWKz82.js new file mode 100644 index 0000000..366f545 --- /dev/null +++ b/build/assets/getSystemBaseAddress-B3dWKz82.js @@ -0,0 +1 @@ +const s=e=>{let a;return e==="https://testbackend.rasadyar.com/"?a="test":e==="https://mabackend.rasadyar.com/"?a="ma":e==="https://arbackend.rasadyar.com/"?a="ar":e==="https://habackend.rasadyar.com/"?a="ha":e==="https://bubackend.rasadyar.com/"?a="bu":a="ha",a};export{s as g}; diff --git a/build/assets/guild-allocated-stock-operation-BiIjKHlL.js b/build/assets/guild-allocated-stock-operation-BiIjKHlL.js new file mode 100644 index 0000000..313fafc --- /dev/null +++ b/build/assets/guild-allocated-stock-operation-BiIjKHlL.js @@ -0,0 +1 @@ +import{a as s}from"./redux-vendor-B7uoacJt.js";import{L as n,j as c,h as r}from"./index-CeyyVc1v.js";const O=s("GUILD_ALLOCATED_STOCK_OPERATION_SERVICE",async(e,{dispatch:a})=>{a(n());try{const{data:t,status:o}=await c.put("steward-allocation/0/",e);return a(r()),{data:t,status:o}}catch(t){return a(r()),{error:t.response.data.result}}});export{O as g}; diff --git a/build/assets/hour-limit-get-kill-request-HFzpgBg7.js b/build/assets/hour-limit-get-kill-request-HFzpgBg7.js new file mode 100644 index 0000000..b121634 --- /dev/null +++ b/build/assets/hour-limit-get-kill-request-HFzpgBg7.js @@ -0,0 +1 @@ +import{a as r}from"./redux-vendor-B7uoacJt.js";import{L as e,j as o,h as i}from"./index-CeyyVc1v.js";const n=r("HOUR_LIMIT_GET_KILL_REQUEST_SERVICE",async(_,{dispatch:t})=>{t(e());const{data:a,status:s}=await o.get("hour_limit/");return t(i()),{data:a,status:s}});export{n as h}; diff --git a/build/assets/html2canvas.esm-BfYXEYrK.js b/build/assets/html2canvas.esm-BfYXEYrK.js new file mode 100644 index 0000000..66e9fd5 --- /dev/null +++ b/build/assets/html2canvas.esm-BfYXEYrK.js @@ -0,0 +1,22 @@ +/*! + * html2canvas 1.4.1 + * Copyright (c) 2022 Niklas von Hertzen + * Released under MIT License + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var mr=function(e,A){return mr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var B in r)Object.prototype.hasOwnProperty.call(r,B)&&(t[B]=r[B])},mr(e,A)};function tA(e,A){if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");mr(e,A);function t(){this.constructor=e}e.prototype=A===null?Object.create(A):(t.prototype=A.prototype,new t)}var Lr=function(){return Lr=Object.assign||function(A){for(var t,r=1,B=arguments.length;r0&&n[n.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!n||o[1]>n[0]&&o[1]=55296&&B<=56319&&t>10)+55296,s%1024+56320)),(B+1===t||r.length>16384)&&(n+=String.fromCharCode.apply(String,r),r.length=0)}return n},nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",on=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var le=0;le"u"?[]:new Uint8Array(256);for(var fe=0;fe>4,Q[B++]=(s&15)<<4|i>>2,Q[B++]=(i&3)<<6|a&63;return o},gn=function(e){for(var A=e.length,t=[],r=0;r>bA,Cn=1<>bA,ln=BB+un,fn=ln,Un=32,Fn=fn+Un,hn=65536>>zr,dn=1<=0){if(A<55296||A>56319&&A<=65535)return t=this.index[A>>bA],t=(t<>bA)],t=(t<>zr),t=this.index[t],t+=A>>bA&En,t=this.index[t],t=(t<"u"?[]:new Uint8Array(256);for(var Ue=0;Ueot?(B.push(!0),i-=ot):B.push(!1),["normal","auto","loose"].indexOf(A)!==-1&&[8208,8211,12316,12448].indexOf(n)!==-1)return r.push(s),t.push(xr);if(i===mn||i===Dr){if(s===0)return r.push(s),t.push(LA);var a=t[s-1];return Mn.indexOf(a)===-1?(r.push(r[s-1]),t.push(a)):(r.push(s),t.push(LA))}if(r.push(s),i===Tn)return t.push(A==="strict"?Tr:Qe);if(i===iB||i===xn)return t.push(LA);if(i===Sn)return n>=131072&&n<=196605||n>=196608&&n<=262141?t.push(Qe):t.push(LA);t.push(i)}),[r,t,B]},wr=function(e,A,t,r){var B=r[t];if(Array.isArray(e)?e.indexOf(B)!==-1:e===B)for(var n=t;n<=r.length;){n++;var s=r[n];if(s===A)return!0;if(s!==FA)break}if(B===FA)for(var n=t;n>0;){n--;var i=r[n];if(Array.isArray(e)?e.indexOf(i)!==-1:e===i)for(var a=t;a<=r.length;){a++;var s=r[a];if(s===A)return!0;if(s!==FA)break}if(i!==FA)break}return!1},lt=function(e,A){for(var t=e;t>=0;){var r=A[t];if(r===FA)t--;else return r}return 0},Vn=function(e,A,t,r,B){if(t[r]===0)return I;var n=r-1;if(Array.isArray(B)&&B[n]===!0)return I;var s=n-1,i=n+1,a=A[n],o=s>=0?A[s]:0,Q=A[i];if(a===nB&&Q===sB)return I;if(Vr.indexOf(a)!==-1)return oB;if(Vr.indexOf(Q)!==-1||QB.indexOf(Q)!==-1)return I;if(lt(n,A)===aB)return Ee;if(Rr.get(e[n])===Dr||(a===he||a===de)&&Rr.get(e[i])===Dr||a===Qt||Q===Qt||a===gt||[FA,br,$A].indexOf(a)===-1&&Q===gt||[Fe,WA,bn,SA,OA].indexOf(Q)!==-1||lt(n,A)===ZA||wr(Qr,ZA,n,A)||wr([Fe,WA],Tr,n,A)||wr(wt,wt,n,A))return I;if(a===FA)return Ee;if(a===Qr||Q===Qr)return I;if(Q===xr||a===xr)return Ee;if([br,$A,Tr].indexOf(Q)!==-1||a===Dn||o===Mr&&Gn.indexOf(a)!==-1||a===OA&&Q===Mr||Q===ct||QA.indexOf(Q)!==-1&&a===j||QA.indexOf(a)!==-1&&Q===j||a===ee&&[Qe,he,de].indexOf(Q)!==-1||[Qe,he,de].indexOf(a)!==-1&&Q===Ae||QA.indexOf(a)!==-1&&Ct.indexOf(Q)!==-1||Ct.indexOf(a)!==-1&&QA.indexOf(Q)!==-1||[ee,Ae].indexOf(a)!==-1&&(Q===j||[ZA,$A].indexOf(Q)!==-1&&A[i+1]===j)||[ZA,$A].indexOf(a)!==-1&&Q===j||a===j&&[j,OA,SA].indexOf(Q)!==-1)return I;if([j,OA,SA,Fe,WA].indexOf(Q)!==-1)for(var g=n;g>=0;){var w=A[g];if(w===j)return I;if([OA,SA].indexOf(w)!==-1)g--;else break}if([ee,Ae].indexOf(Q)!==-1)for(var g=[Fe,WA].indexOf(a)!==-1?s:n;g>=0;){var w=A[g];if(w===j)return I;if([OA,SA].indexOf(w)!==-1)g--;else break}if(Gr===a&&[Gr,Ge,Sr,Or].indexOf(Q)!==-1||[Ge,Sr].indexOf(a)!==-1&&[Ge,Re].indexOf(Q)!==-1||[Re,Or].indexOf(a)!==-1&&Q===Re||ut.indexOf(a)!==-1&&[ct,Ae].indexOf(Q)!==-1||ut.indexOf(Q)!==-1&&a===ee||QA.indexOf(a)!==-1&&QA.indexOf(Q)!==-1||a===SA&&QA.indexOf(Q)!==-1||QA.concat(j).indexOf(a)!==-1&&Q===ZA&&On.indexOf(e[i])===-1||QA.concat(j).indexOf(Q)!==-1&&a===WA)return I;if(a===gr&&Q===gr){for(var f=t[n],c=1;f>0&&(f--,A[f]===gr);)c++;if(c%2!==0)return I}return a===he&&Q===de?I:Ee},Nn=function(e,A){A||(A={lineBreak:"normal",wordBreak:"normal"});var t=Rn(e,A.lineBreak),r=t[0],B=t[1],n=t[2];(A.wordBreak==="break-all"||A.wordBreak==="break-word")&&(B=B.map(function(i){return[j,LA,iB].indexOf(i)!==-1?Qe:i}));var s=A.wordBreak==="keep-all"?n.map(function(i,a){return i&&e[a]>=19968&&e[a]<=40959}):void 0;return[r,B,s]},Xn=function(){function e(A,t,r,B){this.codePoints=A,this.required=t===oB,this.start=r,this.end=B}return e.prototype.slice=function(){return S.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),_n=function(e,A){var t=$e(e),r=Nn(t,A),B=r[0],n=r[1],s=r[2],i=t.length,a=0,o=0;return{next:function(){if(o>=i)return{done:!0,value:null};for(var Q=I;o=gB&&e<=57},Hs=function(e){return e>=55296&&e<=57343},MA=function(e){return J(e)||e>=CB&&e<=lB||e>=wB&&e<=Us},ps=function(e){return e>=wB&&e<=hs},Is=function(e){return e>=CB&&e<=Es},vs=function(e){return ps(e)||Is(e)},ys=function(e){return e>=is},ye=function(e){return e===Xe||e===kn||e===Yn},_e=function(e){return vs(e)||ys(e)||e===jn},dt=function(e){return _e(e)||J(e)||e===Z},Ks=function(e){return e>=ws&&e<=cs||e===Cs||e>=us&&e<=ls||e===fs},UA=function(e,A){return e!==ne?!1:A!==Xe},Ke=function(e,A,t){return e===Z?_e(A)||UA(A,t):_e(e)?!0:!!(e===ne&&UA(e,A))},Cr=function(e,A,t){return e===DA||e===Z?J(A)?!0:A===ge&&J(t):J(e===ge?A:e)},ms=function(e){var A=0,t=1;(e[A]===DA||e[A]===Z)&&(e[A]===Z&&(t=-1),A++);for(var r=[];J(e[A]);)r.push(e[A++]);var B=r.length?parseInt(S.apply(void 0,r),10):0;e[A]===ge&&A++;for(var n=[];J(e[A]);)n.push(e[A++]);var s=n.length,i=s?parseInt(S.apply(void 0,n),10):0;(e[A]===uB||e[A]===cB)&&A++;var a=1;(e[A]===DA||e[A]===Z)&&(e[A]===Z&&(a=-1),A++);for(var o=[];J(e[A]);)o.push(e[A++]);var Q=o.length?parseInt(S.apply(void 0,o),10):0;return t*(B+i*Math.pow(10,-s))*Math.pow(10,a*Q)},Ls={type:2},Ds={type:3},bs={type:4},xs={type:13},Ts={type:8},Ss={type:21},Os={type:9},Ms={type:10},Gs={type:11},Rs={type:12},Vs={type:14},me={type:23},Ns={type:1},Xs={type:25},_s={type:24},Js={type:26},Ps={type:27},ks={type:28},Ys={type:29},Ws={type:31},Nr={type:32},fB=function(){function e(){this._value=[]}return e.prototype.write=function(A){this._value=this._value.concat($e(A))},e.prototype.read=function(){for(var A=[],t=this.consumeToken();t!==Nr;)A.push(t),t=this.consumeToken();return A},e.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case He:return this.consumeStringToken(He);case Wn:var t=this.peekCodePoint(0),r=this.peekCodePoint(1),B=this.peekCodePoint(2);if(dt(t)||UA(r,B)){var n=Ke(t,r,B)?Pn:Jn,s=this.consumeName();return{type:5,value:s,flags:n}}break;case Zn:if(this.peekCodePoint(0)===qA)return this.consumeCodePoint(),xs;break;case pe:return this.consumeStringToken(pe);case Ie:return Ls;case jA:return Ds;case cr:if(this.peekCodePoint(0)===qA)return this.consumeCodePoint(),Vs;break;case DA:if(Cr(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case os:return bs;case Z:var i=A,a=this.peekCodePoint(0),o=this.peekCodePoint(1);if(Cr(i,a,o))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(Ke(i,a,o))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(a===Z&&o===As)return this.consumeCodePoint(),this.consumeCodePoint(),_s;break;case ge:if(Cr(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case Ut:if(this.peekCodePoint(0)===cr)for(this.consumeCodePoint();;){var Q=this.consumeCodePoint();if(Q===cr&&(Q=this.consumeCodePoint(),Q===Ut))return this.consumeToken();if(Q===nA)return this.consumeToken()}break;case Qs:return Js;case gs:return Ps;case $n:if(this.peekCodePoint(0)===zn&&this.peekCodePoint(1)===Z&&this.peekCodePoint(2)===Z)return this.consumeCodePoint(),this.consumeCodePoint(),Xs;break;case es:var g=this.peekCodePoint(0),w=this.peekCodePoint(1),f=this.peekCodePoint(2);if(Ke(g,w,f)){var s=this.consumeName();return{type:7,value:s}}break;case rs:return ks;case ne:if(UA(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case ts:return Ys;case Bs:if(this.peekCodePoint(0)===qA)return this.consumeCodePoint(),Ts;break;case ns:return Gs;case ss:return Rs;case Fs:case ds:var c=this.peekCodePoint(0),C=this.peekCodePoint(1);return c===DA&&(MA(C)||C===ve)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case Ft:if(this.peekCodePoint(0)===qA)return this.consumeCodePoint(),Os;if(this.peekCodePoint(0)===Ft)return this.consumeCodePoint(),Ss;break;case as:if(this.peekCodePoint(0)===qA)return this.consumeCodePoint(),Ms;break;case nA:return Nr}return ye(A)?(this.consumeWhiteSpace(),Ws):J(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):_e(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:S(A)}},e.prototype.consumeCodePoint=function(){var A=this._value.shift();return typeof A>"u"?-1:A},e.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},e.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},e.prototype.consumeUnicodeRangeToken=function(){for(var A=[],t=this.consumeCodePoint();MA(t)&&A.length<6;)A.push(t),t=this.consumeCodePoint();for(var r=!1;t===ve&&A.length<6;)A.push(t),t=this.consumeCodePoint(),r=!0;if(r){var B=parseInt(S.apply(void 0,A.map(function(a){return a===ve?gB:a})),16),n=parseInt(S.apply(void 0,A.map(function(a){return a===ve?lB:a})),16);return{type:30,start:B,end:n}}var s=parseInt(S.apply(void 0,A),16);if(this.peekCodePoint(0)===Z&&MA(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var i=[];MA(t)&&i.length<6;)i.push(t),t=this.consumeCodePoint();var n=parseInt(S.apply(void 0,i),16);return{type:30,start:s,end:n}}else return{type:30,start:s,end:s}},e.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return A.toLowerCase()==="url"&&this.peekCodePoint(0)===Ie?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===Ie?(this.consumeCodePoint(),{type:19,value:A}):{type:20,value:A}},e.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===nA)return{type:22,value:""};var t=this.peekCodePoint(0);if(t===pe||t===He){var r=this.consumeStringToken(this.consumeCodePoint());return r.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===nA||this.peekCodePoint(0)===jA)?(this.consumeCodePoint(),{type:22,value:r.value}):(this.consumeBadUrlRemnants(),me)}for(;;){var B=this.consumeCodePoint();if(B===nA||B===jA)return{type:22,value:S.apply(void 0,A)};if(ye(B))return this.consumeWhiteSpace(),this.peekCodePoint(0)===nA||this.peekCodePoint(0)===jA?(this.consumeCodePoint(),{type:22,value:S.apply(void 0,A)}):(this.consumeBadUrlRemnants(),me);if(B===He||B===pe||B===Ie||Ks(B))return this.consumeBadUrlRemnants(),me;if(B===ne)if(UA(B,this.peekCodePoint(0)))A.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),me;else A.push(B)}},e.prototype.consumeWhiteSpace=function(){for(;ye(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(A===jA||A===nA)return;UA(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(A){for(var t=5e4,r="";A>0;){var B=Math.min(t,A);r+=S.apply(void 0,this._value.splice(0,B)),A-=B}return this._value.shift(),r},e.prototype.consumeStringToken=function(A){var t="",r=0;do{var B=this._value[r];if(B===nA||B===void 0||B===A)return t+=this.consumeStringSlice(r),{type:0,value:t};if(B===Xe)return this._value.splice(0,r),Ns;if(B===ne){var n=this._value[r+1];n!==nA&&n!==void 0&&(n===Xe?(t+=this.consumeStringSlice(r),r=-1,this._value.shift()):UA(B,n)&&(t+=this.consumeStringSlice(r),t+=S(this.consumeEscapedCodePoint()),r=-1))}r++}while(!0)},e.prototype.consumeNumber=function(){var A=[],t=ce,r=this.peekCodePoint(0);for((r===DA||r===Z)&&A.push(this.consumeCodePoint());J(this.peekCodePoint(0));)A.push(this.consumeCodePoint());r=this.peekCodePoint(0);var B=this.peekCodePoint(1);if(r===ge&&J(B))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),t=ft;J(this.peekCodePoint(0));)A.push(this.consumeCodePoint());r=this.peekCodePoint(0),B=this.peekCodePoint(1);var n=this.peekCodePoint(2);if((r===uB||r===cB)&&((B===DA||B===Z)&&J(n)||J(B)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),t=ft;J(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[ms(A),t]},e.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),t=A[0],r=A[1],B=this.peekCodePoint(0),n=this.peekCodePoint(1),s=this.peekCodePoint(2);if(Ke(B,n,s)){var i=this.consumeName();return{type:15,number:t,flags:r,unit:i}}return B===qn?(this.consumeCodePoint(),{type:16,number:t,flags:r}):{type:17,number:t,flags:r}},e.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(MA(A)){for(var t=S(A);MA(this.peekCodePoint(0))&&t.length<6;)t+=S(this.consumeCodePoint());ye(this.peekCodePoint(0))&&this.consumeCodePoint();var r=parseInt(t,16);return r===0||Hs(r)||r>1114111?ht:r}return A===nA?ht:A},e.prototype.consumeName=function(){for(var A="";;){var t=this.consumeCodePoint();if(dt(t))A+=S(t);else if(UA(t,this.peekCodePoint(0)))A+=S(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),A}},e}(),UB=function(){function e(A){this._tokens=A}return e.create=function(A){var t=new fB;return t.write(A),new e(t.read())},e.parseValue=function(A){return e.create(A).parseComponentValue()},e.parseValues=function(A){return e.create(A).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var A=this.consumeToken();A.type===31;)A=this.consumeToken();if(A.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);var t=this.consumeComponentValue();do A=this.consumeToken();while(A.type===31);if(A.type===32)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var A=[];;){var t=this.consumeComponentValue();if(t.type===32)return A;A.push(t),A.push()}},e.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case 11:case 28:case 2:return this.consumeSimpleBlock(A.type);case 19:return this.consumeFunction(A)}return A},e.prototype.consumeSimpleBlock=function(A){for(var t={type:A,values:[]},r=this.consumeToken();;){if(r.type===32||qs(r,A))return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue()),r=this.consumeToken()}},e.prototype.consumeFunction=function(A){for(var t={name:A.value,values:[],type:18};;){var r=this.consumeToken();if(r.type===32||r.type===3)return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var A=this._tokens.shift();return typeof A>"u"?Nr:A},e.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},e}(),Ce=function(e){return e.type===15},kA=function(e){return e.type===17},D=function(e){return e.type===20},Zs=function(e){return e.type===0},Xr=function(e,A){return D(e)&&e.value===A},FB=function(e){return e.type!==31},PA=function(e){return e.type!==31&&e.type!==4},sA=function(e){var A=[],t=[];return e.forEach(function(r){if(r.type===4){if(t.length===0)throw new Error("Error parsing function args, zero tokens for arg");A.push(t),t=[];return}r.type!==31&&t.push(r)}),t.length&&A.push(t),A},qs=function(e,A){return A===11&&e.type===12||A===28&&e.type===29?!0:A===2&&e.type===3},pA=function(e){return e.type===17||e.type===15},M=function(e){return e.type===16||pA(e)},hB=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},X={type:17,number:0,flags:ce},$r={type:16,number:50,flags:ce},hA={type:16,number:100,flags:ce},re=function(e,A,t){var r=e[0],B=e[1];return[b(r,A),b(typeof B<"u"?B:r,t)]},b=function(e,A){if(e.type===16)return e.number/100*A;if(Ce(e))switch(e.unit){case"rem":case"em":return 16*e.number;case"px":default:return e.number}return e.number},dB="deg",EB="grad",HB="rad",pB="turn",Ar={name:"angle",parse:function(e,A){if(A.type===15)switch(A.unit){case dB:return Math.PI*A.number/180;case EB:return Math.PI/200*A.number;case HB:return A.number;case pB:return Math.PI*2*A.number}throw new Error("Unsupported angle type")}},IB=function(e){return e.type===15&&(e.unit===dB||e.unit===EB||e.unit===HB||e.unit===pB)},vB=function(e){var A=e.filter(D).map(function(t){return t.value}).join(" ");switch(A){case"to bottom right":case"to right bottom":case"left top":case"top left":return[X,X];case"to top":case"bottom":return AA(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[X,hA];case"to right":case"left":return AA(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[hA,hA];case"to bottom":case"top":return AA(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[hA,X];case"to left":case"right":return AA(270)}return 0},AA=function(e){return Math.PI*e/180},EA={name:"color",parse:function(e,A){if(A.type===18){var t=js[A.name];if(typeof t>"u")throw new Error('Attempting to parse an unsupported color function "'+A.name+'"');return t(e,A.values)}if(A.type===5){if(A.value.length===3){var r=A.value.substring(0,1),B=A.value.substring(1,2),n=A.value.substring(2,3);return dA(parseInt(r+r,16),parseInt(B+B,16),parseInt(n+n,16),1)}if(A.value.length===4){var r=A.value.substring(0,1),B=A.value.substring(1,2),n=A.value.substring(2,3),s=A.value.substring(3,4);return dA(parseInt(r+r,16),parseInt(B+B,16),parseInt(n+n,16),parseInt(s+s,16)/255)}if(A.value.length===6){var r=A.value.substring(0,2),B=A.value.substring(2,4),n=A.value.substring(4,6);return dA(parseInt(r,16),parseInt(B,16),parseInt(n,16),1)}if(A.value.length===8){var r=A.value.substring(0,2),B=A.value.substring(2,4),n=A.value.substring(4,6),s=A.value.substring(6,8);return dA(parseInt(r,16),parseInt(B,16),parseInt(n,16),parseInt(s,16)/255)}}if(A.type===20){var i=wA[A.value.toUpperCase()];if(typeof i<"u")return i}return wA.TRANSPARENT}},HA=function(e){return(255&e)===0},R=function(e){var A=255&e,t=255&e>>8,r=255&e>>16,B=255&e>>24;return A<255?"rgba("+B+","+r+","+t+","+A/255+")":"rgb("+B+","+r+","+t+")"},dA=function(e,A,t,r){return(e<<24|A<<16|t<<8|Math.round(r*255)<<0)>>>0},Et=function(e,A){if(e.type===17)return e.number;if(e.type===16){var t=A===3?1:255;return A===3?e.number/100*t:Math.round(e.number/100*t)}return 0},Ht=function(e,A){var t=A.filter(PA);if(t.length===3){var r=t.map(Et),B=r[0],n=r[1],s=r[2];return dA(B,n,s,1)}if(t.length===4){var i=t.map(Et),B=i[0],n=i[1],s=i[2],a=i[3];return dA(B,n,s,a)}return 0};function ur(e,A,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(A-e)*t*6+e:t<1/2?A:t<2/3?(A-e)*6*(2/3-t)+e:e}var pt=function(e,A){var t=A.filter(PA),r=t[0],B=t[1],n=t[2],s=t[3],i=(r.type===17?AA(r.number):Ar.parse(e,r))/(Math.PI*2),a=M(B)?B.number/100:0,o=M(n)?n.number/100:0,Q=typeof s<"u"&&M(s)?b(s,1):1;if(a===0)return dA(o*255,o*255,o*255,1);var g=o<=.5?o*(a+1):o+a-o*a,w=o*2-g,f=ur(w,g,i+1/3),c=ur(w,g,i),C=ur(w,g,i-1/3);return dA(f*255,c*255,C*255,Q)},js={hsl:pt,hsla:pt,rgb:Ht,rgba:Ht},se=function(e,A){return EA.parse(e,UB.create(A).parseComponentValue())},wA={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},zs={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,A){return A.map(function(t){if(D(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},$s={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},er=function(e,A){var t=EA.parse(e,A[0]),r=A[1];return r&&M(r)?{color:t,stop:r}:{color:t,stop:null}},It=function(e,A){var t=e[0],r=e[e.length-1];t.stop===null&&(t.stop=X),r.stop===null&&(r.stop=hA);for(var B=[],n=0,s=0;sn?B.push(a):B.push(n),n=a}else B.push(null)}for(var o=null,s=0;ss.optimumDistance)?{optimumCorner:i,optimumDistance:Q}:s},{optimumDistance:B?1/0:-1/0,optimumCorner:null}).optimumCorner},ra=function(e,A,t,r,B){var n=0,s=0;switch(e.size){case 0:e.shape===0?n=s=Math.min(Math.abs(A),Math.abs(A-r),Math.abs(t),Math.abs(t-B)):e.shape===1&&(n=Math.min(Math.abs(A),Math.abs(A-r)),s=Math.min(Math.abs(t),Math.abs(t-B)));break;case 2:if(e.shape===0)n=s=Math.min(rA(A,t),rA(A,t-B),rA(A-r,t),rA(A-r,t-B));else if(e.shape===1){var i=Math.min(Math.abs(t),Math.abs(t-B))/Math.min(Math.abs(A),Math.abs(A-r)),a=vt(r,B,A,t,!0),o=a[0],Q=a[1];n=rA(o-A,(Q-t)/i),s=i*n}break;case 1:e.shape===0?n=s=Math.max(Math.abs(A),Math.abs(A-r),Math.abs(t),Math.abs(t-B)):e.shape===1&&(n=Math.max(Math.abs(A),Math.abs(A-r)),s=Math.max(Math.abs(t),Math.abs(t-B)));break;case 3:if(e.shape===0)n=s=Math.max(rA(A,t),rA(A,t-B),rA(A-r,t),rA(A-r,t-B));else if(e.shape===1){var i=Math.max(Math.abs(t),Math.abs(t-B))/Math.max(Math.abs(A),Math.abs(A-r)),g=vt(r,B,A,t,!1),o=g[0],Q=g[1];n=rA(o-A,(Q-t)/i),s=i*n}break}return Array.isArray(e.size)&&(n=b(e.size[0],r),s=e.size.length===2?b(e.size[1],B):n),[n,s]},ta=function(e,A){var t=AA(180),r=[];return sA(A).forEach(function(B,n){if(n===0){var s=B[0];if(s.type===20&&s.value==="to"){t=vB(B);return}else if(IB(s)){t=Ar.parse(e,s);return}}var i=er(e,B);r.push(i)}),{angle:t,stops:r,type:1}},Le=function(e,A){var t=AA(180),r=[];return sA(A).forEach(function(B,n){if(n===0){var s=B[0];if(s.type===20&&["top","left","right","bottom"].indexOf(s.value)!==-1){t=vB(B);return}else if(IB(s)){t=(Ar.parse(e,s)+AA(270))%AA(360);return}}var i=er(e,B);r.push(i)}),{angle:t,stops:r,type:1}},Ba=function(e,A){var t=AA(180),r=[],B=1,n=0,s=3,i=[];return sA(A).forEach(function(a,o){var Q=a[0];if(o===0){if(D(Q)&&Q.value==="linear"){B=1;return}else if(D(Q)&&Q.value==="radial"){B=2;return}}if(Q.type===18){if(Q.name==="from"){var g=EA.parse(e,Q.values[0]);r.push({stop:X,color:g})}else if(Q.name==="to"){var g=EA.parse(e,Q.values[0]);r.push({stop:hA,color:g})}else if(Q.name==="color-stop"){var w=Q.values.filter(PA);if(w.length===2){var g=EA.parse(e,w[1]),f=w[0];kA(f)&&r.push({stop:{type:16,number:f.number*100,flags:f.flags},color:g})}}}}),B===1?{angle:(t+AA(180))%AA(360),stops:r,type:B}:{size:s,shape:n,stops:r,position:i,type:B}},yB="closest-side",KB="farthest-side",mB="closest-corner",LB="farthest-corner",DB="circle",bB="ellipse",xB="cover",TB="contain",na=function(e,A){var t=0,r=3,B=[],n=[];return sA(A).forEach(function(s,i){var a=!0;if(i===0){var o=!1;a=s.reduce(function(g,w){if(o)if(D(w))switch(w.value){case"center":return n.push($r),g;case"top":case"left":return n.push(X),g;case"right":case"bottom":return n.push(hA),g}else(M(w)||pA(w))&&n.push(w);else if(D(w))switch(w.value){case DB:return t=0,!1;case bB:return t=1,!1;case"at":return o=!0,!1;case yB:return r=0,!1;case xB:case KB:return r=1,!1;case TB:case mB:return r=2,!1;case LB:return r=3,!1}else if(pA(w)||M(w))return Array.isArray(r)||(r=[]),r.push(w),!1;return g},a)}if(a){var Q=er(e,s);B.push(Q)}}),{size:r,shape:t,stops:B,position:n,type:2}},De=function(e,A){var t=0,r=3,B=[],n=[];return sA(A).forEach(function(s,i){var a=!0;if(i===0?a=s.reduce(function(Q,g){if(D(g))switch(g.value){case"center":return n.push($r),!1;case"top":case"left":return n.push(X),!1;case"right":case"bottom":return n.push(hA),!1}else if(M(g)||pA(g))return n.push(g),!1;return Q},a):i===1&&(a=s.reduce(function(Q,g){if(D(g))switch(g.value){case DB:return t=0,!1;case bB:return t=1,!1;case TB:case yB:return r=0,!1;case KB:return r=1,!1;case mB:return r=2,!1;case xB:case LB:return r=3,!1}else if(pA(g)||M(g))return Array.isArray(r)||(r=[]),r.push(g),!1;return Q},a)),a){var o=er(e,s);B.push(o)}}),{size:r,shape:t,stops:B,position:n,type:2}},sa=function(e){return e.type===1},aa=function(e){return e.type===2},At={name:"image",parse:function(e,A){if(A.type===22){var t={url:A.value,type:0};return e.cache.addImage(A.value),t}if(A.type===18){var r=SB[A.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported image function "'+A.name+'"');return r(e,A.values)}throw new Error("Unsupported image type "+A.type)}};function ia(e){return!(e.type===20&&e.value==="none")&&(e.type!==18||!!SB[e.name])}var SB={"linear-gradient":ta,"-moz-linear-gradient":Le,"-ms-linear-gradient":Le,"-o-linear-gradient":Le,"-webkit-linear-gradient":Le,"radial-gradient":na,"-moz-radial-gradient":De,"-ms-radial-gradient":De,"-o-radial-gradient":De,"-webkit-radial-gradient":De,"-webkit-gradient":Ba},oa={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,A){if(A.length===0)return[];var t=A[0];return t.type===20&&t.value==="none"?[]:A.filter(function(r){return PA(r)&&ia(r)}).map(function(r){return At.parse(e,r)})}},Qa={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,A){return A.map(function(t){if(D(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},ga={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,A){return sA(A).map(function(t){return t.filter(M)}).map(hB)}},wa={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,A){return sA(A).map(function(t){return t.filter(D).map(function(r){return r.value}).join(" ")}).map(ca)}},ca=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},JA;(function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"})(JA||(JA={}));var Ca={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,A){return sA(A).map(function(t){return t.filter(ua)})}},ua=function(e){return D(e)||M(e)},rr=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},la=rr("top"),fa=rr("right"),Ua=rr("bottom"),Fa=rr("left"),tr=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(A,t){return hB(t.filter(M))}}},ha=tr("top-left"),da=tr("top-right"),Ea=tr("bottom-right"),Ha=tr("bottom-left"),Br=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(A,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},pa=Br("top"),Ia=Br("right"),va=Br("bottom"),ya=Br("left"),nr=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,t){return Ce(t)?t.number:0}}},Ka=nr("top"),ma=nr("right"),La=nr("bottom"),Da=nr("left"),ba={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},xa={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,A){switch(A){case"rtl":return 1;case"ltr":default:return 0}}},Ta={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,A){return A.filter(D).reduce(function(t,r){return t|Sa(r.value)},0)}},Sa=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},Oa={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Ma={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,A){return A.type===20&&A.value==="normal"?0:A.type===17||A.type===15?A.number:0}},Je;(function(e){e.NORMAL="normal",e.STRICT="strict"})(Je||(Je={}));var Ga={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){switch(A){case"strict":return Je.STRICT;case"normal":default:return Je.NORMAL}}},Ra={name:"line-height",initialValue:"normal",prefix:!1,type:4},yt=function(e,A){return D(e)&&e.value==="normal"?1.2*A:e.type===17?A*e.number:M(e)?b(e,A):A},Va={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,A){return A.type===20&&A.value==="none"?null:At.parse(e,A)}},Na={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,A){switch(A){case"inside":return 0;case"outside":default:return 1}}},_r={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},sr=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},Xa=sr("top"),_a=sr("right"),Ja=sr("bottom"),Pa=sr("left"),ka={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,A){return A.filter(D).map(function(t){switch(t.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},Ya={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){switch(A){case"break-word":return"break-word";case"normal":default:return"normal"}}},ar=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Wa=ar("top"),Za=ar("right"),qa=ar("bottom"),ja=ar("left"),za={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,A){switch(A){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},$a={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,A){switch(A){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Ai={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,A){return A.length===1&&Xr(A[0],"none")?[]:sA(A).map(function(t){for(var r={color:wA.TRANSPARENT,offsetX:X,offsetY:X,blur:X},B=0,n=0;n"u")throw new Error('Attempting to parse an unsupported transform function "'+A.name+'"');return t(A.values)}return null}},ti=function(e){var A=e.filter(function(t){return t.type===17}).map(function(t){return t.number});return A.length===6?A:null},Bi=function(e){var A=e.filter(function(a){return a.type===17}).map(function(a){return a.number}),t=A[0],r=A[1];A[2],A[3];var B=A[4],n=A[5];A[6],A[7],A[8],A[9],A[10],A[11];var s=A[12],i=A[13];return A[14],A[15],A.length===16?[t,r,B,n,s,i]:null},ni={matrix:ti,matrix3d:Bi},Kt={type:16,number:50,flags:ce},si=[Kt,Kt],ai={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,A){var t=A.filter(M);return t.length!==2?si:[t[0],t[1]]}},ii={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},ae;(function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"})(ae||(ae={}));var oi={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){switch(A){case"break-all":return ae.BREAK_ALL;case"keep-all":return ae.KEEP_ALL;case"normal":default:return ae.NORMAL}}},Qi={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,A){if(A.type===20)return{auto:!0,order:0};if(kA(A))return{auto:!1,order:A.number};throw new Error("Invalid z-index number parsed")}},OB={name:"time",parse:function(e,A){if(A.type===15)switch(A.unit.toLowerCase()){case"s":return 1e3*A.number;case"ms":return A.number}throw new Error("Unsupported time type")}},gi={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,A){return kA(A)?A.number:1}},wi={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ci={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,A){return A.filter(D).map(function(t){switch(t.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(t){return t!==0})}},Ci={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,A){var t=[],r=[];return A.forEach(function(B){switch(B.type){case 20:case 0:t.push(B.value);break;case 17:t.push(B.number.toString());break;case 4:r.push(t.join(" ")),t.length=0;break}}),t.length&&r.push(t.join(" ")),r.map(function(B){return B.indexOf(" ")===-1?B:"'"+B+"'"})}},ui={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},li={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,A){if(kA(A))return A.number;if(D(A))switch(A.value){case"bold":return 700;case"normal":default:return 400}return 400}},fi={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,A){return A.filter(D).map(function(t){return t.value})}},Ui={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){switch(A){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},G=function(e,A){return(e&A)!==0},Fi={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,A){if(A.length===0)return[];var t=A[0];return t.type===20&&t.value==="none"?[]:A}},hi={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,A){if(A.length===0)return null;var t=A[0];if(t.type===20&&t.value==="none")return null;for(var r=[],B=A.filter(FB),n=0;n1?1:0],this.overflowWrap=U(A,Ya,t.overflowWrap),this.paddingTop=U(A,Wa,t.paddingTop),this.paddingRight=U(A,Za,t.paddingRight),this.paddingBottom=U(A,qa,t.paddingBottom),this.paddingLeft=U(A,ja,t.paddingLeft),this.paintOrder=U(A,Ii,t.paintOrder),this.position=U(A,$a,t.position),this.textAlign=U(A,za,t.textAlign),this.textDecorationColor=U(A,wi,(r=t.textDecorationColor)!==null&&r!==void 0?r:t.color),this.textDecorationLine=U(A,ci,(B=t.textDecorationLine)!==null&&B!==void 0?B:t.textDecoration),this.textShadow=U(A,Ai,t.textShadow),this.textTransform=U(A,ei,t.textTransform),this.transform=U(A,ri,t.transform),this.transformOrigin=U(A,ai,t.transformOrigin),this.visibility=U(A,ii,t.visibility),this.webkitTextStrokeColor=U(A,vi,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=U(A,yi,t.webkitTextStrokeWidth),this.wordBreak=U(A,oi,t.wordBreak),this.zIndex=U(A,Qi,t.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},e.prototype.isTransparent=function(){return HA(this.backgroundColor)},e.prototype.isTransformed=function(){return this.transform!==null},e.prototype.isPositioned=function(){return this.position!==0},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return this.float!==0},e.prototype.isInlineLevel=function(){return G(this.display,4)||G(this.display,33554432)||G(this.display,268435456)||G(this.display,536870912)||G(this.display,67108864)||G(this.display,134217728)},e}(),mi=function(){function e(A,t){this.content=U(A,Fi,t.content),this.quotes=U(A,Hi,t.quotes)}return e}(),Lt=function(){function e(A,t){this.counterIncrement=U(A,hi,t.counterIncrement),this.counterReset=U(A,di,t.counterReset)}return e}(),U=function(e,A,t){var r=new fB,B=t!==null&&typeof t<"u"?t.toString():A.initialValue;r.write(B);var n=new UB(r.read());switch(A.type){case 2:var s=n.parseComponentValue();return A.parse(e,D(s)?s.value:A.initialValue);case 0:return A.parse(e,n.parseComponentValue());case 1:return A.parse(e,n.parseComponentValues());case 4:return n.parseComponentValue();case 3:switch(A.format){case"angle":return Ar.parse(e,n.parseComponentValue());case"color":return EA.parse(e,n.parseComponentValue());case"image":return At.parse(e,n.parseComponentValue());case"length":var i=n.parseComponentValue();return pA(i)?i:X;case"length-percentage":var a=n.parseComponentValue();return M(a)?a:X;case"time":return OB.parse(e,n.parseComponentValue())}break}},Li="data-html2canvas-debug",Di=function(e){var A=e.getAttribute(Li);switch(A){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Jr=function(e,A){var t=Di(e);return t===1||A===t},aA=function(){function e(A,t){if(this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Jr(t,3))debugger;this.styles=new Ki(A,window.getComputedStyle(t,null)),Yr(t)&&(this.styles.animationDuration.some(function(r){return r>0})&&(t.style.animationDuration="0s"),this.styles.transform!==null&&(t.style.transform="none")),this.bounds=ze(this.context,t),Jr(t,4)&&(this.flags|=16)}return e}(),bi="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",Dt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",te=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var be=0;be>4,Q[B++]=(s&15)<<4|i>>2,Q[B++]=(i&3)<<6|a&63;return o},Ti=function(e){for(var A=e.length,t=[],r=0;r>xA,Mi=1<>xA,Ri=MB+Gi,Vi=Ri,Ni=32,Xi=Vi+Ni,_i=65536>>et,Ji=1<=0){if(A<55296||A>56319&&A<=65535)return t=this.index[A>>xA],t=(t<>xA)],t=(t<>et),t=this.index[t],t+=A>>xA&Pi,t=this.index[t],t=(t<"u"?[]:new Uint8Array(256);for(var xe=0;xe=55296&&B<=56319&&t>10)+55296,s%1024+56320)),(B+1===t||r.length>16384)&&(n+=String.fromCharCode.apply(String,r),r.length=0)}return n},Ao=Yi(bi),z="×",Hr="÷",eo=function(e){return Ao.get(e)},ro=function(e,A,t){var r=t-2,B=A[r],n=A[t-1],s=A[t];if(n===Ur&&s===Fr)return z;if(n===Ur||n===Fr||n===Tt||s===Ur||s===Fr||s===Tt)return Hr;if(n===Ot&&[Ot,hr,Mt,Gt].indexOf(s)!==-1||(n===Mt||n===hr)&&(s===hr||s===dr)||(n===Gt||n===dr)&&s===dr||s===Rt||s===St||s===ji||n===qi)return z;if(n===Rt&&s===Vt){for(;B===St;)B=A[--r];if(B===Vt)return z}if(n===Er&&s===Er){for(var i=0;B===Er;)i++,B=A[--r];if(i%2===0)return z}return Hr},to=function(e){var A=zi(e),t=A.length,r=0,B=0,n=A.map(eo);return{next:function(){if(r>=t)return{done:!0,value:null};for(var s=z;rs.x||Q.y>s.y;return s=Q,o===0?!0:g});return e.body.removeChild(A),i},ao=function(){return typeof new Image().crossOrigin<"u"},io=function(){return typeof new XMLHttpRequest().responseType=="string"},oo=function(e){var A=new Image,t=e.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;A.src="data:image/svg+xml,";try{r.drawImage(A,0,0),t.toDataURL()}catch{return!1}return!0},Nt=function(e){return e[0]===0&&e[1]===255&&e[2]===0&&e[3]===255},Qo=function(e){var A=e.createElement("canvas"),t=100;A.width=t,A.height=t;var r=A.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,t,t);var B=new Image,n=A.toDataURL();B.src=n;var s=Pr(t,t,0,0,B);return r.fillStyle="red",r.fillRect(0,0,t,t),Xt(s).then(function(i){r.drawImage(i,0,0);var a=r.getImageData(0,0,t,t).data;r.fillStyle="red",r.fillRect(0,0,t,t);var o=e.createElement("div");return o.style.backgroundImage="url("+n+")",o.style.height=t+"px",Nt(a)?Xt(Pr(t,t,0,0,o)):Promise.reject(!1)}).then(function(i){return r.drawImage(i,0,0),Nt(r.getImageData(0,0,t,t).data)}).catch(function(){return!1})},Pr=function(e,A,t,r,B){var n="http://www.w3.org/2000/svg",s=document.createElementNS(n,"svg"),i=document.createElementNS(n,"foreignObject");return s.setAttributeNS(null,"width",e.toString()),s.setAttributeNS(null,"height",A.toString()),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.setAttributeNS(null,"x",t.toString()),i.setAttributeNS(null,"y",r.toString()),i.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(i),i.appendChild(B),s},Xt=function(e){return new Promise(function(A,t){var r=new Image;r.onload=function(){return A(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},N={get SUPPORT_RANGE_BOUNDS(){var e=no(document);return Object.defineProperty(N,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=N.SUPPORT_RANGE_BOUNDS&&so(document);return Object.defineProperty(N,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=oo(document);return Object.defineProperty(N,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e=typeof Array.from=="function"&&typeof window.fetch=="function"?Qo(document):Promise.resolve(!1);return Object.defineProperty(N,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=ao();return Object.defineProperty(N,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=io();return Object.defineProperty(N,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(N,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(N,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},ie=function(){function e(A,t){this.text=A,this.bounds=t}return e}(),go=function(e,A,t,r){var B=Co(A,t),n=[],s=0;return B.forEach(function(i){if(t.textDecorationLine.length||i.trim().length>0)if(N.SUPPORT_RANGE_BOUNDS){var a=_t(r,s,i.length).getClientRects();if(a.length>1){var o=rt(i),Q=0;o.forEach(function(w){n.push(new ie(w,cA.fromDOMRectList(e,_t(r,Q+s,w.length).getClientRects()))),Q+=w.length})}else n.push(new ie(i,cA.fromDOMRectList(e,a)))}else{var g=r.splitText(i.length);n.push(new ie(i,wo(e,r))),r=g}else N.SUPPORT_RANGE_BOUNDS||(r=r.splitText(i.length));s+=i.length}),n},wo=function(e,A){var t=A.ownerDocument;if(t){var r=t.createElement("html2canvaswrapper");r.appendChild(A.cloneNode(!0));var B=A.parentNode;if(B){B.replaceChild(r,A);var n=ze(e,r);return r.firstChild&&B.replaceChild(r.firstChild,r),n}}return cA.EMPTY},_t=function(e,A,t){var r=e.ownerDocument;if(!r)throw new Error("Node has no owner document");var B=r.createRange();return B.setStart(e,A),B.setEnd(e,A+t),B},rt=function(e){if(N.SUPPORT_NATIVE_TEXT_SEGMENTATION){var A=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(A.segment(e)).map(function(t){return t.segment})}return Bo(e)},co=function(e,A){if(N.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(e)).map(function(r){return r.segment})}return lo(e,A)},Co=function(e,A){return A.letterSpacing!==0?rt(e):co(e,A)},uo=[32,160,4961,65792,65793,4153,4241],lo=function(e,A){for(var t=_n(e,{lineBreak:A.lineBreak,wordBreak:A.overflowWrap==="break-word"?"break-word":A.wordBreak}),r=[],B,n=function(){if(B.value){var s=B.value.slice(),i=$e(s),a="";i.forEach(function(o){uo.indexOf(o)===-1?a+=S(o):(a.length&&r.push(a),r.push(S(o)),a="")}),a.length&&r.push(a)}};!(B=t.next()).done;)n();return r},fo=function(){function e(A,t,r){this.text=Uo(t.data,r.textTransform),this.textBounds=go(A,this.text,r,t)}return e}(),Uo=function(e,A){switch(A){case 1:return e.toLowerCase();case 3:return e.replace(Fo,ho);case 2:return e.toUpperCase();default:return e}},Fo=/(^|\s|:|-|\(|\))([a-z])/g,ho=function(e,A,t){return e.length>0?A+t.toUpperCase():e},GB=function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this;return B.src=r.currentSrc||r.src,B.intrinsicWidth=r.naturalWidth,B.intrinsicHeight=r.naturalHeight,B.context.cache.addImage(B.src),B}return A}(aA),RB=function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this;return B.canvas=r,B.intrinsicWidth=r.width,B.intrinsicHeight=r.height,B}return A}(aA),VB=function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this,n=new XMLSerializer,s=ze(t,r);return r.setAttribute("width",s.width+"px"),r.setAttribute("height",s.height+"px"),B.svg="data:image/svg+xml,"+encodeURIComponent(n.serializeToString(r)),B.intrinsicWidth=r.width.baseVal.value,B.intrinsicHeight=r.height.baseVal.value,B.context.cache.addImage(B.svg),B}return A}(aA),NB=function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this;return B.value=r.value,B}return A}(aA),kr=function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this;return B.start=r.start,B.reversed=typeof r.reversed=="boolean"&&r.reversed===!0,B}return A}(aA),Eo=[{type:15,flags:0,unit:"px",number:3}],Ho=[{type:16,flags:0,number:50}],po=function(e){return e.width>e.height?new cA(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width0)t.textNodes.push(new fo(e,B,t.styles));else if(_A(B))if(jB(B)&&B.assignedNodes)B.assignedNodes().forEach(function(i){return Ve(e,i,t,r)});else{var s=PB(e,B);s.styles.isVisible()&&(Ko(B,s,r)?s.flags|=4:mo(s.styles)&&(s.flags|=2),yo.indexOf(B.tagName)!==-1&&(s.flags|=8),t.elements.push(s),B.slot,B.shadowRoot?Ve(e,B.shadowRoot,s,r):!Ye(B)&&!WB(B)&&!We(B)&&Ve(e,B,s,r))}},PB=function(e,A){return Wr(A)?new GB(e,A):ZB(A)?new RB(e,A):WB(A)?new VB(e,A):Lo(A)?new NB(e,A):Do(A)?new kr(e,A):bo(A)?new tt(e,A):We(A)?new XB(e,A):Ye(A)?new _B(e,A):qB(A)?new JB(e,A):new aA(e,A)},kB=function(e,A){var t=PB(e,A);return t.flags|=4,Ve(e,A,t,t),t},Ko=function(e,A,t){return A.styles.isPositionedWithZIndex()||A.styles.opacity<1||A.styles.isTransformed()||Bt(e)&&t.styles.isTransparent()},mo=function(e){return e.isPositioned()||e.isFloating()},YB=function(e){return e.nodeType===Node.TEXT_NODE},_A=function(e){return e.nodeType===Node.ELEMENT_NODE},Yr=function(e){return _A(e)&&typeof e.style<"u"&&!Ne(e)},Ne=function(e){return typeof e.className=="object"},Lo=function(e){return e.tagName==="LI"},Do=function(e){return e.tagName==="OL"},bo=function(e){return e.tagName==="INPUT"},xo=function(e){return e.tagName==="HTML"},WB=function(e){return e.tagName==="svg"},Bt=function(e){return e.tagName==="BODY"},ZB=function(e){return e.tagName==="CANVAS"},Pt=function(e){return e.tagName==="VIDEO"},Wr=function(e){return e.tagName==="IMG"},qB=function(e){return e.tagName==="IFRAME"},kt=function(e){return e.tagName==="STYLE"},To=function(e){return e.tagName==="SCRIPT"},Ye=function(e){return e.tagName==="TEXTAREA"},We=function(e){return e.tagName==="SELECT"},jB=function(e){return e.tagName==="SLOT"},Yt=function(e){return e.tagName.indexOf("-")>0},So=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(A){var t=this.counters[A];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(A){var t=this.counters[A];return t||[]},e.prototype.pop=function(A){var t=this;A.forEach(function(r){return t.counters[r].pop()})},e.prototype.parse=function(A){var t=this,r=A.counterIncrement,B=A.counterReset,n=!0;r!==null&&r.forEach(function(i){var a=t.counters[i.counter];a&&i.increment!==0&&(n=!1,a.length||a.push(1),a[Math.max(0,a.length-1)]+=i.increment)});var s=[];return n&&B.forEach(function(i){var a=t.counters[i.counter];s.push(i.counter),a||(a=t.counters[i.counter]=[]),a.push(i.reset)}),s},e}(),Wt={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Zt={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Oo={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Mo={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},GA=function(e,A,t,r,B,n){return et?we(e,B,n.length>0):r.integers.reduce(function(s,i,a){for(;e>=i;)e-=i,s+=r.values[a];return s},"")+n},zB=function(e,A,t,r){var B="";do t||e--,B=r(e)+B,e/=A;while(e*A>=A);return B},T=function(e,A,t,r,B){var n=t-A+1;return(e<0?"-":"")+(zB(Math.abs(e),n,r,function(s){return S(Math.floor(s%n)+A)})+B)},mA=function(e,A,t){t===void 0&&(t=". ");var r=A.length;return zB(Math.abs(e),r,!1,function(B){return A[Math.floor(B%r)]})+t},NA=1,lA=2,fA=4,Be=8,gA=function(e,A,t,r,B,n){if(e<-9999||e>9999)return we(e,4,B.length>0);var s=Math.abs(e),i=B;if(s===0)return A[0]+i;for(var a=0;s>0&&a<=4;a++){var o=s%10;o===0&&G(n,NA)&&i!==""?i=A[o]+i:o>1||o===1&&a===0||o===1&&a===1&&G(n,lA)||o===1&&a===1&&G(n,fA)&&e>100||o===1&&a>1&&G(n,Be)?i=A[o]+(a>0?t[a-1]:"")+i:o===1&&a>0&&(i=t[a-1]+i),s=Math.floor(s/10)}return(e<0?r:"")+i},qt="十百千萬",jt="拾佰仟萬",zt="マイナス",pr="마이너스",we=function(e,A,t){var r=t?". ":"",B=t?"、":"",n=t?", ":"",s=t?" ":"";switch(A){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var i=T(e,48,57,!0,r);return i.length<4?"0"+i:i;case 4:return mA(e,"〇一二三四五六七八九",B);case 6:return GA(e,1,3999,Wt,3,r).toLowerCase();case 7:return GA(e,1,3999,Wt,3,r);case 8:return T(e,945,969,!1,r);case 9:return T(e,97,122,!1,r);case 10:return T(e,65,90,!1,r);case 11:return T(e,1632,1641,!0,r);case 12:case 49:return GA(e,1,9999,Zt,3,r);case 35:return GA(e,1,9999,Zt,3,r).toLowerCase();case 13:return T(e,2534,2543,!0,r);case 14:case 30:return T(e,6112,6121,!0,r);case 15:return mA(e,"子丑寅卯辰巳午未申酉戌亥",B);case 16:return mA(e,"甲乙丙丁戊己庚辛壬癸",B);case 17:case 48:return gA(e,"零一二三四五六七八九",qt,"負",B,lA|fA|Be);case 47:return gA(e,"零壹貳參肆伍陸柒捌玖",jt,"負",B,NA|lA|fA|Be);case 42:return gA(e,"零一二三四五六七八九",qt,"负",B,lA|fA|Be);case 41:return gA(e,"零壹贰叁肆伍陆柒捌玖",jt,"负",B,NA|lA|fA|Be);case 26:return gA(e,"〇一二三四五六七八九","十百千万",zt,B,0);case 25:return gA(e,"零壱弐参四伍六七八九","拾百千万",zt,B,NA|lA|fA);case 31:return gA(e,"영일이삼사오육칠팔구","십백천만",pr,n,NA|lA|fA);case 33:return gA(e,"零一二三四五六七八九","十百千萬",pr,n,0);case 32:return gA(e,"零壹貳參四五六七八九","拾百千",pr,n,NA|lA|fA);case 18:return T(e,2406,2415,!0,r);case 20:return GA(e,1,19999,Mo,3,r);case 21:return T(e,2790,2799,!0,r);case 22:return T(e,2662,2671,!0,r);case 22:return GA(e,1,10999,Oo,3,r);case 23:return mA(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return mA(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return T(e,3302,3311,!0,r);case 28:return mA(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",B);case 29:return mA(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",B);case 34:return T(e,3792,3801,!0,r);case 37:return T(e,6160,6169,!0,r);case 38:return T(e,4160,4169,!0,r);case 39:return T(e,2918,2927,!0,r);case 40:return T(e,1776,1785,!0,r);case 43:return T(e,3046,3055,!0,r);case 44:return T(e,3174,3183,!0,r);case 45:return T(e,3664,3673,!0,r);case 46:return T(e,3872,3881,!0,r);case 3:default:return T(e,48,57,!0,r)}},$B="data-html2canvas-ignore",$t=function(){function e(A,t,r){if(this.context=A,this.options=r,this.scrolledElements=[],this.referenceElement=t,this.counters=new So,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(A,t){var r=this,B=Go(A,t);if(!B.contentWindow)return Promise.reject("Unable to find iframe window");var n=A.defaultView.pageXOffset,s=A.defaultView.pageYOffset,i=B.contentWindow,a=i.document,o=No(B).then(function(){return P(r,void 0,void 0,function(){var Q,g;return _(this,function(w){switch(w.label){case 0:return this.scrolledElements.forEach(Po),i&&(i.scrollTo(t.left,t.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(i.scrollY!==t.top||i.scrollX!==t.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(i.scrollX-t.left,i.scrollY-t.top,0,0))),Q=this.options.onclone,g=this.clonedReferenceElement,typeof g>"u"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:a.fonts&&a.fonts.ready?[4,a.fonts.ready]:[3,2];case 1:w.sent(),w.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,Vo(a)]:[3,4];case 3:w.sent(),w.label=4;case 4:return typeof Q=="function"?[2,Promise.resolve().then(function(){return Q(a,g)}).then(function(){return B})]:[2,B]}})})});return a.open(),a.write(_o(document.doctype)+""),Jo(this.referenceElement.ownerDocument,n,s),a.replaceChild(a.adoptNode(this.documentElement),a.documentElement),a.close(),o},e.prototype.createElementClone=function(A){if(Jr(A,2))debugger;if(ZB(A))return this.createCanvasClone(A);if(Pt(A))return this.createVideoClone(A);if(kt(A))return this.createStyleClone(A);var t=A.cloneNode(!1);return Wr(t)&&(Wr(A)&&A.currentSrc&&A.currentSrc!==A.src&&(t.src=A.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager")),Yt(t)?this.createCustomElementClone(t):t},e.prototype.createCustomElementClone=function(A){var t=document.createElement("html2canvascustomelement");return Ir(A.style,t),t},e.prototype.createStyleClone=function(A){try{var t=A.sheet;if(t&&t.cssRules){var r=[].slice.call(t.cssRules,0).reduce(function(n,s){return s&&typeof s.cssText=="string"?n+s.cssText:n},""),B=A.cloneNode(!1);return B.textContent=r,B}}catch(n){if(this.context.logger.error("Unable to access cssRules property",n),n.name!=="SecurityError")throw n}return A.cloneNode(!1)},e.prototype.createCanvasClone=function(A){var t;if(this.options.inlineImages&&A.ownerDocument){var r=A.ownerDocument.createElement("img");try{return r.src=A.toDataURL(),r}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}var B=A.cloneNode(!1);try{B.width=A.width,B.height=A.height;var n=A.getContext("2d"),s=B.getContext("2d");if(s)if(!this.options.allowTaint&&n)s.putImageData(n.getImageData(0,0,A.width,A.height),0,0);else{var i=(t=A.getContext("webgl2"))!==null&&t!==void 0?t:A.getContext("webgl");if(i){var a=i.getContextAttributes();(a==null?void 0:a.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A)}s.drawImage(A,0,0)}return B}catch{this.context.logger.info("Unable to clone canvas as it is tainted",A)}return B},e.prototype.createVideoClone=function(A){var t=A.ownerDocument.createElement("canvas");t.width=A.offsetWidth,t.height=A.offsetHeight;var r=t.getContext("2d");try{return r&&(r.drawImage(A,0,0,t.width,t.height),this.options.allowTaint||r.getImageData(0,0,t.width,t.height)),t}catch{this.context.logger.info("Unable to clone video as it is tainted",A)}var B=A.ownerDocument.createElement("canvas");return B.width=A.offsetWidth,B.height=A.offsetHeight,B},e.prototype.appendChildNode=function(A,t,r){(!_A(t)||!To(t)&&!t.hasAttribute($B)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(t)))&&(!this.options.copyStyles||!_A(t)||!kt(t))&&A.appendChild(this.cloneNode(t,r))},e.prototype.cloneChildNodes=function(A,t,r){for(var B=this,n=A.shadowRoot?A.shadowRoot.firstChild:A.firstChild;n;n=n.nextSibling)if(_A(n)&&jB(n)&&typeof n.assignedNodes=="function"){var s=n.assignedNodes();s.length&&s.forEach(function(i){return B.appendChildNode(t,i,r)})}else this.appendChildNode(t,n,r)},e.prototype.cloneNode=function(A,t){if(YB(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var r=A.ownerDocument.defaultView;if(r&&_A(A)&&(Yr(A)||Ne(A))){var B=this.createElementClone(A);B.style.transitionProperty="none";var n=r.getComputedStyle(A),s=r.getComputedStyle(A,":before"),i=r.getComputedStyle(A,":after");this.referenceElement===A&&Yr(B)&&(this.clonedReferenceElement=B),Bt(B)&&Wo(B);var a=this.counters.parse(new Lt(this.context,n)),o=this.resolvePseudoContent(A,B,s,oe.BEFORE);Yt(A)&&(t=!0),Pt(A)||this.cloneChildNodes(A,B,t),o&&B.insertBefore(o,B.firstChild);var Q=this.resolvePseudoContent(A,B,i,oe.AFTER);return Q&&B.appendChild(Q),this.counters.pop(a),(n&&(this.options.copyStyles||Ne(A))&&!qB(A)||t)&&Ir(n,B),(A.scrollTop!==0||A.scrollLeft!==0)&&this.scrolledElements.push([B,A.scrollLeft,A.scrollTop]),(Ye(A)||We(A))&&(Ye(B)||We(B))&&(B.value=A.value),B}return A.cloneNode(!1)},e.prototype.resolvePseudoContent=function(A,t,r,B){var n=this;if(r){var s=r.content,i=t.ownerDocument;if(!(!i||!s||s==="none"||s==="-moz-alt-content"||r.display==="none")){this.counters.parse(new Lt(this.context,r));var a=new mi(this.context,r),o=i.createElement("html2canvaspseudoelement");Ir(r,o),a.content.forEach(function(g){if(g.type===0)o.appendChild(i.createTextNode(g.value));else if(g.type===22){var w=i.createElement("img");w.src=g.value,w.style.opacity="1",o.appendChild(w)}else if(g.type===18){if(g.name==="attr"){var f=g.values.filter(D);f.length&&o.appendChild(i.createTextNode(A.getAttribute(f[0].value)||""))}else if(g.name==="counter"){var c=g.values.filter(PA),C=c[0],H=c[1];if(C&&D(C)){var h=n.counters.getCounterValue(C.value),F=H&&D(H)?_r.parse(n.context,H.value):3;o.appendChild(i.createTextNode(we(h,F,!1)))}}else if(g.name==="counters"){var K=g.values.filter(PA),C=K[0],p=K[1],H=K[2];if(C&&D(C)){var d=n.counters.getCounterValues(C.value),l=H&&D(H)?_r.parse(n.context,H.value):3,v=p&&p.type===0?p.value:"",y=d.map(function(k){return we(k,l,!1)}).join(v);o.appendChild(i.createTextNode(y))}}}else if(g.type===20)switch(g.value){case"open-quote":o.appendChild(i.createTextNode(mt(a.quotes,n.quoteDepth++,!0)));break;case"close-quote":o.appendChild(i.createTextNode(mt(a.quotes,--n.quoteDepth,!1)));break;default:o.appendChild(i.createTextNode(g.value))}}),o.className=Zr+" "+qr;var Q=B===oe.BEFORE?" "+Zr:" "+qr;return Ne(t)?t.className.baseValue+=Q:t.className+=Q,o}}},e.destroy=function(A){return A.parentNode?(A.parentNode.removeChild(A),!0):!1},e}(),oe;(function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"})(oe||(oe={}));var Go=function(e,A){var t=e.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=A.width.toString(),t.height=A.height.toString(),t.scrolling="no",t.setAttribute($B,"true"),e.body.appendChild(t),t},Ro=function(e){return new Promise(function(A){if(e.complete){A();return}if(!e.src){A();return}e.onload=A,e.onerror=A})},Vo=function(e){return Promise.all([].slice.call(e.images,0).map(Ro))},No=function(e){return new Promise(function(A,t){var r=e.contentWindow;if(!r)return t("No window assigned for iframe");var B=r.document;r.onload=e.onload=function(){r.onload=e.onload=null;var n=setInterval(function(){B.body.childNodes.length>0&&B.readyState==="complete"&&(clearInterval(n),A(e))},50)}})},Xo=["all","d","content"],Ir=function(e,A){for(var t=e.length-1;t>=0;t--){var r=e.item(t);Xo.indexOf(r)===-1&&A.style.setProperty(r,e.getPropertyValue(r))}return A},_o=function(e){var A="";return e&&(A+=""),A},Jo=function(e,A,t){e&&e.defaultView&&(A!==e.defaultView.pageXOffset||t!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(A,t)},Po=function(e){var A=e[0],t=e[1],r=e[2];A.scrollLeft=t,A.scrollTop=r},ko=":before",Yo=":after",Zr="___html2canvas___pseudoelement_before",qr="___html2canvas___pseudoelement_after",AB=`{ + content: "" !important; + display: none !important; +}`,Wo=function(e){Zo(e,"."+Zr+ko+AB+` + .`+qr+Yo+AB)},Zo=function(e,A){var t=e.ownerDocument;if(t){var r=t.createElement("style");r.textContent=A,e.appendChild(r)}},An=function(){function e(){}return e.getOrigin=function(A){var t=e._link;return t?(t.href=A,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},e.isSameOrigin=function(A){return e.getOrigin(A)===e._origin},e.setContext=function(A){e._link=A.document.createElement("a"),e._origin=e.getOrigin(A.location.href)},e._origin="about:blank",e}(),qo=function(){function e(A,t){this.context=A,this._options=t,this._cache={}}return e.prototype.addImage=function(A){var t=Promise.resolve();return this.has(A)||(yr(A)||AQ(A))&&(this._cache[A]=this.loadImage(A)).catch(function(){}),t},e.prototype.match=function(A){return this._cache[A]},e.prototype.loadImage=function(A){return P(this,void 0,void 0,function(){var t,r,B,n,s=this;return _(this,function(i){switch(i.label){case 0:return t=An.isSameOrigin(A),r=!vr(A)&&this._options.useCORS===!0&&N.SUPPORT_CORS_IMAGES&&!t,B=!vr(A)&&!t&&!yr(A)&&typeof this._options.proxy=="string"&&N.SUPPORT_CORS_XHR&&!r,!t&&this._options.allowTaint===!1&&!vr(A)&&!yr(A)&&!B&&!r?[2]:(n=A,B?[4,this.proxy(n)]:[3,2]);case 1:n=i.sent(),i.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise(function(a,o){var Q=new Image;Q.onload=function(){return a(Q)},Q.onerror=o,(eQ(n)||r)&&(Q.crossOrigin="anonymous"),Q.src=n,Q.complete===!0&&setTimeout(function(){return a(Q)},500),s._options.imageTimeout>0&&setTimeout(function(){return o("Timed out ("+s._options.imageTimeout+"ms) loading image")},s._options.imageTimeout)})];case 3:return[2,i.sent()]}})})},e.prototype.has=function(A){return typeof this._cache[A]<"u"},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(A){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var B=A.substring(0,256);return new Promise(function(n,s){var i=N.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(i==="text")n(a.response);else{var g=new FileReader;g.addEventListener("load",function(){return n(g.result)},!1),g.addEventListener("error",function(w){return s(w)},!1),g.readAsDataURL(a.response)}else s("Failed to proxy resource "+B+" with status code "+a.status)},a.onerror=s;var o=r.indexOf("?")>-1?"&":"?";if(a.open("GET",""+r+o+"url="+encodeURIComponent(A)+"&responseType="+i),i!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=i),t._options.imageTimeout){var Q=t._options.imageTimeout;a.timeout=Q,a.ontimeout=function(){return s("Timed out ("+Q+"ms) proxying "+B)}}a.send()})},e}(),jo=/^data:image\/svg\+xml/i,zo=/^data:image\/.*;base64,/i,$o=/^data:image\/.*/i,AQ=function(e){return N.SUPPORT_SVG_DRAWING||!rQ(e)},vr=function(e){return $o.test(e)},eQ=function(e){return zo.test(e)},yr=function(e){return e.substr(0,4)==="blob"},rQ=function(e){return e.substr(-3).toLowerCase()==="svg"||jo.test(e)},u=function(){function e(A,t){this.type=0,this.x=A,this.y=t}return e.prototype.add=function(A,t){return new e(this.x+A,this.y+t)},e}(),RA=function(e,A,t){return new u(e.x+(A.x-e.x)*t,e.y+(A.y-e.y)*t)},Te=function(){function e(A,t,r,B){this.type=1,this.start=A,this.startControl=t,this.endControl=r,this.end=B}return e.prototype.subdivide=function(A,t){var r=RA(this.start,this.startControl,A),B=RA(this.startControl,this.endControl,A),n=RA(this.endControl,this.end,A),s=RA(r,B,A),i=RA(B,n,A),a=RA(s,i,A);return t?new e(this.start,r,s,a):new e(a,i,n,this.end)},e.prototype.add=function(A,t){return new e(this.start.add(A,t),this.startControl.add(A,t),this.endControl.add(A,t),this.end.add(A,t))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),$=function(e){return e.type===1},tQ=function(){function e(A){var t=A.styles,r=A.bounds,B=re(t.borderTopLeftRadius,r.width,r.height),n=B[0],s=B[1],i=re(t.borderTopRightRadius,r.width,r.height),a=i[0],o=i[1],Q=re(t.borderBottomRightRadius,r.width,r.height),g=Q[0],w=Q[1],f=re(t.borderBottomLeftRadius,r.width,r.height),c=f[0],C=f[1],H=[];H.push((n+a)/r.width),H.push((c+g)/r.width),H.push((s+C)/r.height),H.push((o+w)/r.height);var h=Math.max.apply(Math,H);h>1&&(n/=h,s/=h,a/=h,o/=h,g/=h,w/=h,c/=h,C/=h);var F=r.width-a,K=r.height-w,p=r.width-g,d=r.height-C,l=t.borderTopWidth,v=t.borderRightWidth,y=t.borderBottomWidth,E=t.borderLeftWidth,O=b(t.paddingTop,A.bounds.width),k=b(t.paddingRight,A.bounds.width),q=b(t.paddingBottom,A.bounds.width),L=b(t.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=n>0||s>0?x(r.left+E/3,r.top+l/3,n-E/3,s-l/3,m.TOP_LEFT):new u(r.left+E/3,r.top+l/3),this.topRightBorderDoubleOuterBox=n>0||s>0?x(r.left+F,r.top+l/3,a-v/3,o-l/3,m.TOP_RIGHT):new u(r.left+r.width-v/3,r.top+l/3),this.bottomRightBorderDoubleOuterBox=g>0||w>0?x(r.left+p,r.top+K,g-v/3,w-y/3,m.BOTTOM_RIGHT):new u(r.left+r.width-v/3,r.top+r.height-y/3),this.bottomLeftBorderDoubleOuterBox=c>0||C>0?x(r.left+E/3,r.top+d,c-E/3,C-y/3,m.BOTTOM_LEFT):new u(r.left+E/3,r.top+r.height-y/3),this.topLeftBorderDoubleInnerBox=n>0||s>0?x(r.left+E*2/3,r.top+l*2/3,n-E*2/3,s-l*2/3,m.TOP_LEFT):new u(r.left+E*2/3,r.top+l*2/3),this.topRightBorderDoubleInnerBox=n>0||s>0?x(r.left+F,r.top+l*2/3,a-v*2/3,o-l*2/3,m.TOP_RIGHT):new u(r.left+r.width-v*2/3,r.top+l*2/3),this.bottomRightBorderDoubleInnerBox=g>0||w>0?x(r.left+p,r.top+K,g-v*2/3,w-y*2/3,m.BOTTOM_RIGHT):new u(r.left+r.width-v*2/3,r.top+r.height-y*2/3),this.bottomLeftBorderDoubleInnerBox=c>0||C>0?x(r.left+E*2/3,r.top+d,c-E*2/3,C-y*2/3,m.BOTTOM_LEFT):new u(r.left+E*2/3,r.top+r.height-y*2/3),this.topLeftBorderStroke=n>0||s>0?x(r.left+E/2,r.top+l/2,n-E/2,s-l/2,m.TOP_LEFT):new u(r.left+E/2,r.top+l/2),this.topRightBorderStroke=n>0||s>0?x(r.left+F,r.top+l/2,a-v/2,o-l/2,m.TOP_RIGHT):new u(r.left+r.width-v/2,r.top+l/2),this.bottomRightBorderStroke=g>0||w>0?x(r.left+p,r.top+K,g-v/2,w-y/2,m.BOTTOM_RIGHT):new u(r.left+r.width-v/2,r.top+r.height-y/2),this.bottomLeftBorderStroke=c>0||C>0?x(r.left+E/2,r.top+d,c-E/2,C-y/2,m.BOTTOM_LEFT):new u(r.left+E/2,r.top+r.height-y/2),this.topLeftBorderBox=n>0||s>0?x(r.left,r.top,n,s,m.TOP_LEFT):new u(r.left,r.top),this.topRightBorderBox=a>0||o>0?x(r.left+F,r.top,a,o,m.TOP_RIGHT):new u(r.left+r.width,r.top),this.bottomRightBorderBox=g>0||w>0?x(r.left+p,r.top+K,g,w,m.BOTTOM_RIGHT):new u(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=c>0||C>0?x(r.left,r.top+d,c,C,m.BOTTOM_LEFT):new u(r.left,r.top+r.height),this.topLeftPaddingBox=n>0||s>0?x(r.left+E,r.top+l,Math.max(0,n-E),Math.max(0,s-l),m.TOP_LEFT):new u(r.left+E,r.top+l),this.topRightPaddingBox=a>0||o>0?x(r.left+Math.min(F,r.width-v),r.top+l,F>r.width+v?0:Math.max(0,a-v),Math.max(0,o-l),m.TOP_RIGHT):new u(r.left+r.width-v,r.top+l),this.bottomRightPaddingBox=g>0||w>0?x(r.left+Math.min(p,r.width-E),r.top+Math.min(K,r.height-y),Math.max(0,g-v),Math.max(0,w-y),m.BOTTOM_RIGHT):new u(r.left+r.width-v,r.top+r.height-y),this.bottomLeftPaddingBox=c>0||C>0?x(r.left+E,r.top+Math.min(d,r.height-y),Math.max(0,c-E),Math.max(0,C-y),m.BOTTOM_LEFT):new u(r.left+E,r.top+r.height-y),this.topLeftContentBox=n>0||s>0?x(r.left+E+L,r.top+l+O,Math.max(0,n-(E+L)),Math.max(0,s-(l+O)),m.TOP_LEFT):new u(r.left+E+L,r.top+l+O),this.topRightContentBox=a>0||o>0?x(r.left+Math.min(F,r.width+E+L),r.top+l+O,F>r.width+E+L?0:a-E+L,o-(l+O),m.TOP_RIGHT):new u(r.left+r.width-(v+k),r.top+l+O),this.bottomRightContentBox=g>0||w>0?x(r.left+Math.min(p,r.width-(E+L)),r.top+Math.min(K,r.height+l+O),Math.max(0,g-(v+k)),w-(y+q),m.BOTTOM_RIGHT):new u(r.left+r.width-(v+k),r.top+r.height-(y+q)),this.bottomLeftContentBox=c>0||C>0?x(r.left+E+L,r.top+d,Math.max(0,c-(E+L)),C-(y+q),m.BOTTOM_LEFT):new u(r.left+E+L,r.top+r.height-(y+q))}return e}(),m;(function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(m||(m={}));var x=function(e,A,t,r,B){var n=4*((Math.sqrt(2)-1)/3),s=t*n,i=r*n,a=e+t,o=A+r;switch(B){case m.TOP_LEFT:return new Te(new u(e,o),new u(e,o-i),new u(a-s,A),new u(a,A));case m.TOP_RIGHT:return new Te(new u(e,A),new u(e+s,A),new u(a,o-i),new u(a,o));case m.BOTTOM_RIGHT:return new Te(new u(a,A),new u(a,A+i),new u(e+s,o),new u(e,o));case m.BOTTOM_LEFT:default:return new Te(new u(a,o),new u(a-s,o),new u(e,A+i),new u(e,A))}},Ze=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},BQ=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},qe=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},nQ=function(){function e(A,t,r){this.offsetX=A,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return e}(),Se=function(){function e(A,t){this.path=A,this.target=t,this.type=1}return e}(),sQ=function(){function e(A){this.opacity=A,this.type=2,this.target=6}return e}(),aQ=function(e){return e.type===0},en=function(e){return e.type===1},iQ=function(e){return e.type===2},eB=function(e,A){return e.length===A.length?e.some(function(t,r){return t===A[r]}):!1},oQ=function(e,A,t,r,B){return e.map(function(n,s){switch(s){case 0:return n.add(A,t);case 1:return n.add(A+r,t);case 2:return n.add(A+r,t+B);case 3:return n.add(A,t+B)}return n})},rn=function(){function e(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),tn=function(){function e(A,t){if(this.container=A,this.parent=t,this.effects=[],this.curves=new tQ(this.container),this.container.styles.opacity<1&&this.effects.push(new sQ(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,B=this.container.bounds.top+this.container.styles.transformOrigin[1].number,n=this.container.styles.transform;this.effects.push(new nQ(r,B,n))}if(this.container.styles.overflowX!==0){var s=Ze(this.curves),i=qe(this.curves);eB(s,i)?this.effects.push(new Se(s,6)):(this.effects.push(new Se(s,2)),this.effects.push(new Se(i,4)))}}return e.prototype.getEffects=function(A){for(var t=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,B=this.effects.slice(0);r;){var n=r.effects.filter(function(a){return!en(a)});if(t||r.container.styles.position!==0||!r.parent){if(B.unshift.apply(B,n),t=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var s=Ze(r.curves),i=qe(r.curves);eB(s,i)||B.unshift(new Se(i,6))}}else B.unshift.apply(B,n);r=r.parent}return B.filter(function(a){return G(a.target,A)})},e}(),jr=function(e,A,t,r){e.container.elements.forEach(function(B){var n=G(B.flags,4),s=G(B.flags,2),i=new tn(B,e);G(B.styles.display,2048)&&r.push(i);var a=G(B.flags,8)?[]:r;if(n||s){var o=n||B.styles.isPositioned()?t:A,Q=new rn(i);if(B.styles.isPositioned()||B.styles.opacity<1||B.styles.isTransformed()){var g=B.styles.zIndex.order;if(g<0){var w=0;o.negativeZIndex.some(function(c,C){return g>c.element.container.styles.zIndex.order?(w=C,!1):w>0}),o.negativeZIndex.splice(w,0,Q)}else if(g>0){var f=0;o.positiveZIndex.some(function(c,C){return g>=c.element.container.styles.zIndex.order?(f=C+1,!1):f>0}),o.positiveZIndex.splice(f,0,Q)}else o.zeroOrAutoZIndexOrTransformedOrOpacity.push(Q)}else B.styles.isFloating()?o.nonPositionedFloats.push(Q):o.nonPositionedInlineLevel.push(Q);jr(i,Q,n?Q:t,a)}else B.styles.isInlineLevel()?A.inlineLevel.push(i):A.nonInlineLevel.push(i),jr(i,A,t,a);G(B.flags,8)&&Bn(B,a)})},Bn=function(e,A){for(var t=e instanceof kr?e.start:1,r=e instanceof kr?e.reversed:!1,B=0;B"u"?e[0]:t},fQ=function(e,A,t,r,B){var n=A[0],s=A[1],i=t[0],a=t[1];switch(e){case 2:return[new u(Math.round(r.left),Math.round(r.top+s)),new u(Math.round(r.left+r.width),Math.round(r.top+s)),new u(Math.round(r.left+r.width),Math.round(a+r.top+s)),new u(Math.round(r.left),Math.round(a+r.top+s))];case 3:return[new u(Math.round(r.left+n),Math.round(r.top)),new u(Math.round(r.left+n+i),Math.round(r.top)),new u(Math.round(r.left+n+i),Math.round(r.height+r.top)),new u(Math.round(r.left+n),Math.round(r.height+r.top))];case 1:return[new u(Math.round(r.left+n),Math.round(r.top+s)),new u(Math.round(r.left+n+i),Math.round(r.top+s)),new u(Math.round(r.left+n+i),Math.round(r.top+s+a)),new u(Math.round(r.left+n),Math.round(r.top+s+a))];default:return[new u(Math.round(B.left),Math.round(B.top)),new u(Math.round(B.left+B.width),Math.round(B.top)),new u(Math.round(B.left+B.width),Math.round(B.height+B.top)),new u(Math.round(B.left),Math.round(B.height+B.top))]}},UQ="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",tB="Hidden Text",FQ=function(){function e(A){this._data={},this._document=A}return e.prototype.parseMetrics=function(A,t){var r=this._document.createElement("div"),B=this._document.createElement("img"),n=this._document.createElement("span"),s=this._document.body;r.style.visibility="hidden",r.style.fontFamily=A,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",s.appendChild(r),B.src=UQ,B.width=1,B.height=1,B.style.margin="0",B.style.padding="0",B.style.verticalAlign="baseline",n.style.fontFamily=A,n.style.fontSize=t,n.style.margin="0",n.style.padding="0",n.appendChild(this._document.createTextNode(tB)),r.appendChild(n),r.appendChild(B);var i=B.offsetTop-n.offsetTop+2;r.removeChild(n),r.appendChild(this._document.createTextNode(tB)),r.style.lineHeight="normal",B.style.verticalAlign="super";var a=B.offsetTop-r.offsetTop+2;return s.removeChild(r),{baseline:i,middle:a}},e.prototype.getMetrics=function(A,t){var r=A+" "+t;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(A,t)),this._data[r]},e}(),sn=function(){function e(A,t){this.context=A,this.options=t}return e}(),hQ=1e4,dQ=function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this;return B._activeEffects=[],B.canvas=r.canvas?r.canvas:document.createElement("canvas"),B.ctx=B.canvas.getContext("2d"),r.canvas||(B.canvas.width=Math.floor(r.width*r.scale),B.canvas.height=Math.floor(r.height*r.scale),B.canvas.style.width=r.width+"px",B.canvas.style.height=r.height+"px"),B.fontMetrics=new FQ(document),B.ctx.scale(B.options.scale,B.options.scale),B.ctx.translate(-r.x,-r.y),B.ctx.textBaseline="bottom",B._activeEffects=[],B.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),B}return A.prototype.applyEffects=function(t){for(var r=this;this._activeEffects.length;)this.popEffect();t.forEach(function(B){return r.applyEffect(B)})},A.prototype.applyEffect=function(t){this.ctx.save(),iQ(t)&&(this.ctx.globalAlpha=t.opacity),aQ(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),en(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},A.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},A.prototype.renderStack=function(t){return P(this,void 0,void 0,function(){var r;return _(this,function(B){switch(B.label){case 0:return r=t.element.container.styles,r.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:B.sent(),B.label=2;case 2:return[2]}})})},A.prototype.renderNode=function(t){return P(this,void 0,void 0,function(){return _(this,function(r){switch(r.label){case 0:if(G(t.container.flags,16))debugger;return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(t)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},A.prototype.renderTextWithLetterSpacing=function(t,r,B){var n=this;if(r===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+B);else{var s=rt(t.text);s.reduce(function(i,a){return n.ctx.fillText(a,i,t.bounds.top+B),i+n.ctx.measureText(a).width},t.bounds.left)}},A.prototype.createFontStyle=function(t){var r=t.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),B=vQ(t.fontFamily).join(", "),n=Ce(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,r,t.fontWeight,n,B].join(" "),B,n]},A.prototype.renderTextNode=function(t,r){return P(this,void 0,void 0,function(){var B,n,s,i,a,o,Q,g,w=this;return _(this,function(f){return B=this.createFontStyle(r),n=B[0],s=B[1],i=B[2],this.ctx.font=n,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(s,i),o=a.baseline,Q=a.middle,g=r.paintOrder,t.textBounds.forEach(function(c){g.forEach(function(C){switch(C){case 0:w.ctx.fillStyle=R(r.color),w.renderTextWithLetterSpacing(c,r.letterSpacing,o);var H=r.textShadow;H.length&&c.text.trim().length&&(H.slice(0).reverse().forEach(function(h){w.ctx.shadowColor=R(h.color),w.ctx.shadowOffsetX=h.offsetX.number*w.options.scale,w.ctx.shadowOffsetY=h.offsetY.number*w.options.scale,w.ctx.shadowBlur=h.blur.number,w.renderTextWithLetterSpacing(c,r.letterSpacing,o)}),w.ctx.shadowColor="",w.ctx.shadowOffsetX=0,w.ctx.shadowOffsetY=0,w.ctx.shadowBlur=0),r.textDecorationLine.length&&(w.ctx.fillStyle=R(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(h){switch(h){case 1:w.ctx.fillRect(c.bounds.left,Math.round(c.bounds.top+o),c.bounds.width,1);break;case 2:w.ctx.fillRect(c.bounds.left,Math.round(c.bounds.top),c.bounds.width,1);break;case 3:w.ctx.fillRect(c.bounds.left,Math.ceil(c.bounds.top+Q),c.bounds.width,1);break}}));break;case 1:r.webkitTextStrokeWidth&&c.text.trim().length&&(w.ctx.strokeStyle=R(r.webkitTextStrokeColor),w.ctx.lineWidth=r.webkitTextStrokeWidth,w.ctx.lineJoin=window.chrome?"miter":"round",w.ctx.strokeText(c.text,c.bounds.left,c.bounds.top+o)),w.ctx.strokeStyle="",w.ctx.lineWidth=0,w.ctx.lineJoin="miter";break}})}),[2]})})},A.prototype.renderReplacedElement=function(t,r,B){if(B&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var n=je(t),s=qe(r);this.path(s),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(B,0,0,t.intrinsicWidth,t.intrinsicHeight,n.left,n.top,n.width,n.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(t){return P(this,void 0,void 0,function(){var r,B,n,s,i,a,F,F,o,Q,g,w,p,f,c,d,C,H,h,F,K,p,d;return _(this,function(l){switch(l.label){case 0:this.applyEffects(t.getEffects(4)),r=t.container,B=t.curves,n=r.styles,s=0,i=r.textNodes,l.label=1;case 1:return s0&&V>0&&(y=n.ctx.createPattern(d,"repeat"),n.renderRepeat(O,y,Y,W))):aa(Q)&&(E=Kr(t,r,[null,null,null]),O=E[0],k=E[1],q=E[2],L=E[3],V=E[4],CA=Q.position.length===0?[$r]:Q.position,Y=b(CA[0],L),W=b(CA[CA.length-1],V),IA=ra(Q,Y,W,L,V),BA=IA[0],uA=IA[1],BA>0&&uA>0&&(vA=n.ctx.createRadialGradient(k+Y,q+W,0,k+Y,q+W,BA),It(Q.stops,BA*2).forEach(function(YA){return vA.addColorStop(YA.stop,R(YA.color))}),n.path(O),n.ctx.fillStyle=vA,BA!==uA?(yA=t.bounds.left+.5*t.bounds.width,iA=t.bounds.top+.5*t.bounds.height,KA=uA/BA,oA=1/KA,n.ctx.save(),n.ctx.translate(yA,iA),n.ctx.transform(1,0,0,KA,0,0),n.ctx.translate(-yA,-iA),n.ctx.fillRect(k,oA*(q-iA)+iA,L,V*oA),n.ctx.restore()):n.ctx.fill())),TA.label=6;case 6:return r--,[2]}})},n=this,s=0,i=t.styles.backgroundImage.slice(0).reverse(),o.label=1;case 1:return s0?Q.style!==2?[3,5]:[4,this.renderDashedDottedBorder(Q.color,Q.width,i,t.curves,2)]:[3,11]):[3,13];case 4:return w.sent(),[3,11];case 5:return Q.style!==3?[3,7]:[4,this.renderDashedDottedBorder(Q.color,Q.width,i,t.curves,3)];case 6:return w.sent(),[3,11];case 7:return Q.style!==4?[3,9]:[4,this.renderDoubleBorder(Q.color,Q.width,i,t.curves)];case 8:return w.sent(),[3,11];case 9:return[4,this.renderSolidBorder(Q.color,i,t.curves)];case 10:w.sent(),w.label=11;case 11:i++,w.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(t,r,B,n,s){return P(this,void 0,void 0,function(){var i,a,o,Q,g,w,f,c,C,H,h,F,K,p,d,l,d,l;return _(this,function(v){return this.ctx.save(),i=cQ(n,B),a=rB(n,B),s===2&&(this.path(a),this.ctx.clip()),$(a[0])?(o=a[0].start.x,Q=a[0].start.y):(o=a[0].x,Q=a[0].y),$(a[1])?(g=a[1].end.x,w=a[1].end.y):(g=a[1].x,w=a[1].y),B===0||B===2?f=Math.abs(o-g):f=Math.abs(Q-w),this.ctx.beginPath(),s===3?this.formatPath(i):this.formatPath(a.slice(0,2)),c=r<3?r*3:r*2,C=r<3?r*2:r,s===3&&(c=r,C=r),H=!0,f<=c*2?H=!1:f<=c*2+C?(h=f/(2*c+C),c*=h,C*=h):(F=Math.floor((f+C)/(c+C)),K=(f-F*c)/(F-1),p=(f-(F+1)*c)/F,C=p<=0||Math.abs(C-K)(s.current=!0,()=>{s.current=!1}),[]),s}function K(){const s=I(),[n,t]=e.useState(0),r=e.useCallback(()=>{s.current&&t(n+1)},[n]);return[e.useCallback(()=>$.postRender(r),[r]),n]}class B extends e.Component{getSnapshotBeforeUpdate(n){const t=this.props.childRef.current;if(t&&n.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function G({children:s,isPresent:n}){const t=e.useId(),r=e.useRef(null),m=e.useRef({width:0,height:0,top:0,left:0});return e.useInsertionEffect(()=>{const{width:a,height:u,top:i,left:h}=m.current;if(n||!r.current||!a||!u)return;r.current.dataset.motionPopId=t;const d=document.createElement("style");return document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` + [data-motion-pop-id="${t}"] { + position: absolute !important; + width: ${a}px !important; + height: ${u}px !important; + top: ${i}px !important; + left: ${h}px !important; + } + `),()=>{document.head.removeChild(d)}},[n]),e.createElement(B,{isPresent:n,childRef:r,sizeRef:m},e.cloneElement(s,{ref:r}))}const w=({children:s,initial:n,isPresent:t,onExitComplete:r,custom:m,presenceAffectsLayout:a,mode:u})=>{const i=O(T),h=e.useId(),d=e.useMemo(()=>({id:h,initial:n,isPresent:t,custom:m,onExitComplete:f=>{i.set(f,!0);for(const c of i.values())if(!c)return;r&&r()},register:f=>(i.set(f,!1),()=>i.delete(f))}),a?void 0:[t]);return e.useMemo(()=>{i.forEach((f,c)=>i.set(c,!1))},[t]),e.useEffect(()=>{!t&&!i.size&&r&&r()},[t]),u==="popLayout"&&(s=e.createElement(G,{isPresent:t},s)),e.createElement(S.Provider,{value:d},s)};function T(){return new Map}const R=s=>s.key||"";function D(s,n){s.forEach(t=>{const r=R(t);n.set(r,t)})}function H(s){const n=[];return e.Children.forEach(s,t=>{e.isValidElement(t)&&n.push(t)}),n}const _=({children:s,custom:n,initial:t=!0,onExitComplete:r,exitBeforeEnter:m,presenceAffectsLayout:a=!0,mode:u="sync"})=>{m&&(u="wait",A(!1,"Replace exitBeforeEnter with mode='wait'"));let[i]=K();const h=e.useContext(U).forceRender;h&&(i=h);const d=I(),f=H(s);let c=f;const l=new Set,E=e.useRef(c),C=e.useRef(new Map).current,x=e.useRef(!0);if(z(()=>{x.current=!1,D(f,C),E.current=c}),b(()=>{x.current=!0,C.clear(),l.clear()}),x.current)return e.createElement(e.Fragment,null,c.map(o=>e.createElement(w,{key:R(o),isPresent:!0,initial:t?void 0:!1,presenceAffectsLayout:a,mode:u},o)));c=[...c];const y=E.current.map(R),g=f.map(R),P=y.length;for(let o=0;o{if(g.indexOf(o)!==-1)return;const p=C.get(o);if(!p)return;const k=y.indexOf(o),L=()=>{C.delete(o),l.delete(o);const v=E.current.findIndex(F=>F.key===o);if(E.current.splice(v,1),!l.size){if(E.current=f,d.current===!1)return;i(),r&&r()}};c.splice(k,0,e.createElement(w,{key:R(p),isPresent:!1,onExitComplete:L,custom:n,presenceAffectsLayout:a,mode:u},p))}),c=c.map(o=>{const p=o.key;return l.has(p)?o:e.createElement(w,{key:R(o),isPresent:!0,presenceAffectsLayout:a,mode:u},o)}),e.createElement(e.Fragment,null,l.size?c:c.map(o=>e.cloneElement(o)))};export{_ as A}; diff --git a/build/assets/index-BoXwyCSj.css b/build/assets/index-BoXwyCSj.css new file mode 100644 index 0000000..461879f --- /dev/null +++ b/build/assets/index-BoXwyCSj.css @@ -0,0 +1 @@ +@font-face{font-family:iranyekan;font-style:normal;font-weight:700;src:url(/assets/iranyekanwebboldfanum-4MyXKl7R.eot);src:url(/assets/iranyekanwebboldfanum-4MyXKl7R.eot?#iefix) format("embedded-opentype"),url(/assets/iranyekanwebboldfanum-DuHlIwL1.woff) format("woff"),url(/assets/iranyekanwebboldfanum-DPpYUa29.ttf) format("truetype")}@font-face{font-family:iranyekan;font-style:normal;font-weight:100;src:url(/assets/iranyekanwebthinfanum-D-ZSjYYz.eot);src:url(/assets/iranyekanwebthinfanum-D-ZSjYYz.eot?#iefix) format("embedded-opentype"),url(/assets/iranyekanwebthinfanum-CSNE-9l9.woff) format("woff"),url(/assets/iranyekanwebthinfanum-DcHs2iuA.ttf) format("truetype")}@font-face{font-family:iranyekan;font-style:normal;font-weight:300;src:url(/assets/iranyekanweblightfanum-ygAVe80Z.eot);src:url(/assets/iranyekanweblightfanum-ygAVe80Z.eot?#iefix) format("embedded-opentype"),url(/assets/iranyekanweblightfanum-CUSCFX3r.woff) format("woff"),url(/assets/iranyekanweblightfanum-BGe6BYo1.ttf) format("truetype")}@font-face{font-family:iranyekan;font-style:normal;font-weight:400;src:url(/assets/iranyekanwebregularfanum-ByZg3G6b.eot);src:url(/assets/iranyekanwebregularfanum-ByZg3G6b.eot?#iefix) format("embedded-opentype"),url(/assets/iranyekanwebregularfanum-BFcizGKW.woff) format("woff"),url(/assets/iranyekanwebregularfanum-DbwvR45l.ttf) format("truetype")}@font-face{font-family:iranyekan;font-style:normal;font-weight:500;src:url(/assets/iranyekanwebmediumfanum-D05JzbBp.eot);src:url(/assets/iranyekanwebmediumfanum-D05JzbBp.eot?#iefix) format("embedded-opentype"),url(/assets/iranyekanwebmediumfanum-s03dbLnU.woff) format("woff"),url(/assets/iranyekanwebmediumfanum-BUeGgNk3.ttf) format("truetype")}@font-face{font-family:iranyekan;font-style:normal;font-weight:800;src:url(/assets/iranyekanwebextraboldfanum-B_HxCE9G.eot);src:url(/assets/iranyekanwebextraboldfanum-B_HxCE9G.eot?#iefix) format("embedded-opentype"),url(/assets/iranyekanwebextraboldfanum-BxduwGDe.woff) format("woff"),url(/assets/iranyekanwebextraboldfanum-BtBLW69P.ttf) format("truetype")}@font-face{font-family:iranyekan;font-style:normal;font-weight:850;src:url(/assets/iranyekanwebblackfanum-D4YLG5Qd.eot);src:url(/assets/iranyekanwebblackfanum-D4YLG5Qd.eot?#iefix) format("embedded-opentype"),url(/assets/iranyekanwebblackfanum-BwAdG8eD.woff) format("woff"),url(/assets/iranyekanwebblackfanum-CTOzT0CZ.ttf) format("truetype")}@font-face{font-family:iranyekan;font-style:normal;font-weight:900;src:url(/assets/iranyekanwebextrablackfanum-BBBCPzpP.eot);src:url(/assets/iranyekanwebextrablackfanum-BBBCPzpP.eot?#iefix) format("embedded-opentype"),url(/assets/iranyekanwebextrablackfanum-CKF0oDJw.woff) format("woff"),url(/assets/iranyekanwebextrablackfanum-BRm1SKeI.ttf) format("truetype")}@font-face{font-family:nazanin;src:local("nazanin"),url(/assets/B-NAZANIN-oLmczWLB.TTF) format("truetype");font-weight:700}@font-face{font-family:titr;src:local("titr"),url(/assets/Titr-CVMh0rmV.ttf) format("truetype");font-weight:700}body{margin:0;font-family:IRANSans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow-x:hidden}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.process-table{overflow-x:scroll}.process-table{font-family:iranyekan!important}.process-table th{font-size:14px}.process-table td{font-size:12px}.process-table table{width:100%;border-collapse:collapse;border:1px solid #ddd}.process-table th,.process-table td{border:1px solid #ddd;padding:8px;width:300px!important}.process-table th{background-color:#f2f2f2}@media only screen and (max-width: 400px){.resp-table.simple-table .MuiTableCell-root{width:50%;border:none;margin-bottom:5px;margin-top:5px}.resp-table.simple-table .MuiTableCell-root div{display:block;margin:auto}.resp-table.simple-table .MuiTableCell-root:nth-child(odd){border-left:1px solid #ccc!important}}.row-item-table-accordion{flex-direction:row-reverse}.page-table{font-family:iranyekan;margin-top:30px}.rdt_TableHeadRow{background-color:#ddd}.rdt_TableCol_Sortable div{white-space:normal!important}.header-stats{border:1px solid rgb(221,221,221);padding:8px;border-radius:20px 20px 0 0;background:#e9f5ff;border-top:5px solid #2196f3;border-bottom:0px}.stats-wrap{background-color:#eee;border:1px solid #ccc;width:240px}.stats-title{background-color:#e7e7e7;border:1px solid #ccc;padding:10px;margin:0!important}.stats-content{padding:10px!important}.credit{margin-top:8px;position:sticky;bottom:0;left:50%;right:50%;background:#2196f3;color:#fff;padding:4px 0;z-index:999}.ExcelTable2007 table{width:100%;border-collapse:collapse}.ExcelTable2007 th,.ExcelTable2007 td{border:1px solid #ddd;padding:8px;text-align:center;font-family:iranyekan,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,sans-serif,Arial,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol}.ExcelTable2007 th{background-color:#f2f2f2}.ExcelTable2007 .heading{font-weight:700}.percent-input-quota input{text-align:center}.auto-allocation-table{font-family:iranyekan;border-collapse:collapse;width:100%}.auto-allocation-table th,.auto-allocation-table td{border:1px solid #adadad;padding:8px;text-align:center}.auto-allocation-table th{background-color:#f2f2f2;text-align:center}.auto-allocation-table{border-collapse:collapse}.MuiTable-head th{font-weight:700;border-bottom:2px solid #ddd;text-align:left;padding:10px}.MuiTableCell-root{padding:10px}.no-border-flex-table{display:inline-flex;white-space:nowrap;flex-direction:column;border:none!important}.my-table .loop-kill-request{padding:0}.table-section:first-child{overflow-x:scroll}.rnc{display:flex;flex-direction:row;width:100%}.rnc-row{display:flex;align-items:stretch;margin:0 0 10px}.rnc-column{display:flex;flex-direction:column;justify-content:space-between;margin:0 0 0 10px}.rnc-canvas{box-sizing:border-box;background-color:#fff;border-radius:4px}.rnc-button{display:flex;justify-content:center;align-items:center;font-size:16px;background:#fff;color:inherit;border:none;padding:0;width:25px;height:20px;box-sizing:border-box;border-radius:4px}.rnc-button svg{width:1em;height:1em;fill:currentColor}.rnc-input{display:none;border:none;padding:10px 6px;font-size:inherit;font-family:inherit}.MuiTimelineItem-positionRight:before{content:""!important;flex:none!important}.simple-table .MuiTableCell-root{padding:8px 0!important}.muirtl-1gyekjj-MuiTimelineItem-root:before{padding:0!important}.images-file{border-radius:5px}.reactour__helper--is-open div:first-child{padding-top:25px}.reactour__helper--is-open{border-radius:4px!important}.reactour__mask{border-radius:10px!important;background-color:red}.sc-bZQynM.diKbXs{direction:ltr}@media only screen and (max-width: 600px){.rnc{flex-direction:column}.rnc-row{justify-content:space-between;align-items:center}.rnc-column{flex-direction:row;gap:40px}.rnc-button{font-size:32px}}.timerIcon{animation-duration:1s;animation-name:example;animation-timing-function:ease-in-out;animation-iteration-count:infinite}@keyframes example{0%{transform:scale(.7)}to{transform:scale(.9)}}.table-styles{border-collapse:collapse;font-family:iranyekan,sans-serif;font-size:12px;text-align:center;box-shadow:0 0 5px #be7f7f;overflow-x:auto;width:100%}.table-styles th{padding:5px}.green-header{background-color:#4caf50;color:#fff}.strong-blue-cell-combine{color:#fff;background-color:#007bff;text-align:center}.blue-cell,.light-green-cell,.light-blue-cell,.green-cell,.strong-blue-cell,.light-yellow-cell,.sky-blue-cell,.brown-cell,.green-header th,.yellow-cell,.red-cell{color:#fff;border:1px solid #ce9c9c;transition:background-color .3s}.blue-cell:hover,.light-blue-cell:hover,.green-cell:hover,.strong-blue-cell:hover,.light-yellow-cell:hover,.sky-blue-cell:hover,.brown-cell:hover,.green-header th:hover,.light-green-cell:hover,.yellow-cell:hover,.red-cell:hover{background-color:#333;color:#fff!important}.light-green-cell{color:#636161;border:1px solid #ce9c9c}.blue-cell{background-color:#2196f3}.light-blue-cell{background-color:#6195aa}.green-cell{background-color:#4caf50}.light-green-cell{background-color:#90ee90}.strong-blue-cell{background-color:#007bff}.yellow-cell{background-color:#ffeb3b;color:#000!important}.detail-cell{background-color:#f8f8ce}.light-yellow-cell{background-color:#d4af37}.sky-blue-cell{background-color:#87cefa}.brown-cell{background-color:#b16128}.red-cell{background-color:tomato}.centered-cell{text-align:center;border:1px solid #ce9c9c;padding:5px}.table-container{width:100%;display:flex;justify-content:center}.last-table-container{width:78vw;display:flex;justify-content:center}.muirtl-1yt3g2g-MuiTableCell-root{line-height:1.2!important}a{text-decoration:none}.App{text-align:center}html::-webkit-scrollbar{width:10px}html::-webkit-scrollbar-thumb{background:linear-gradient(to bottom,#eaefff,#2247bf);border-radius:0 0 4px 4px}html::-webkit-scrollbar-track{background-color:#fff}.App-logo{height:40vmin;pointer-events:none}.svg-icon-color path{stroke:#4285f4}@media (prefers-reduced-motion: no-preference){.App-logo{animation:App-logo-spin infinite 20s linear}}.App-header{background-color:#282c34;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:calc(10px + 2vmin);color:#fff}.App-link{color:#61dafb}@keyframes App-logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.bluehover{will-change:filter;transition:filter .3s}.bluehover:hover{filter:drop-shadow(0 0 .5em #cc0a95aa)}.marquee{width:100%;line-height:30px;color:#fff;white-space:nowrap;overflow:hidden;box-sizing:border-box;direction:rtl;margin-top:-10px!important}.marquee p{font-size:15px;margin:0;display:inline-block;animation:marquee 60s linear infinite;color:#f9f947}@keyframes marquee{0%{transform:translate(-100%)}to{transform:translate(100%)}}.MuiOutlinedInput-notchedOutline{border-radius:8px!important}.insidetabs{border-style:none!important;padding:0!important;color:pink!important;font-size:10px!important}.header-menu{font-weight:800!important}.muirtl-rpxd6p-MuiButtonBase-root-MuiTab-root.Mui-selected{background:#eaefff;font-weight:800}.path-city{stroke:#fff}.path-city:hover{fill:#db5f5f}@media only screen and (max-width: 600px){.MuiButtonBase-root-MuiTab-root{font-size:.75rem!important}.muirtl-1sbhvmq{padding:12px 16px!important}.muirtl-162ovef{padding:4px 8px!important}.MuiChip-root{height:24px!important}.MuiChip-label{padding:0 6px!important}} diff --git a/build/assets/index-CIfb_iLp.js b/build/assets/index-CIfb_iLp.js new file mode 100644 index 0000000..01ae681 --- /dev/null +++ b/build/assets/index-CIfb_iLp.js @@ -0,0 +1,17 @@ +import{e as Oe,a as je,r as xe,g as sS}from"./react-vendor-CmFgShSM.js";import{bu as lS,bv as uS,bw as cS,bx as fS,by as dS,bz as pS,bA as vS,bB as hS,bC as gS,bD as yS,bE as mS,bF as bS,bG as SS,bH as wS,i as La,j as Na,bI as $S,bJ as _S,bK as OS,bL as TS,bM as xS,bN as CS,bO as IS,bP as PS,bQ as RS,bR as ES,bS as DS,bT as AS,bU as jS,bV as kS,bW as MS,bX as LS,bY as NS,bZ as FS,af as lh,b_ as HS,b$ as US,p as BS}from"./mui-vendor-CkIVaoQP.js";import{r as Fa,t as WS}from"./index-CeyyVc1v.js";import{g as zS}from"./redux-vendor-B7uoacJt.js";import{C as GS}from"./Close-_jAEIgMD.js";import{S as qS}from"./Search-Dek2fED1.js";import{D as KS}from"./Delete-C5MyLelE.js";var uh={},No=function(e){return e&&e.Math===Math&&e},gt=No(typeof globalThis=="object"&&globalThis)||No(typeof window=="object"&&window)||No(typeof self=="object"&&self)||No(typeof Oe=="object"&&Oe)||No(typeof Oe=="object"&&Oe)||function(){return this}()||Function("return this")(),Xe=function(e){try{return!!e()}catch{return!0}},VS=Xe,ni=!VS(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),YS=ni,ch=Function.prototype,Af=ch.apply,jf=ch.call,ai=typeof Reflect=="object"&&Reflect.apply||(YS?jf.bind(Af):function(){return jf.apply(Af,arguments)}),fh=ni,dh=Function.prototype,ec=dh.call,XS=fh&&dh.bind.bind(ec,ec),Ke=fh?XS:function(e){return function(){return ec.apply(e,arguments)}},ph=Ke,JS=ph({}.toString),QS=ph("".slice),Ta=function(e){return QS(JS(e),8,-1)},ZS=Ta,ew=Ke,Es=function(e){if(ZS(e)==="Function")return ew(e)},Ml=typeof document=="object"&&document.all,or=typeof Ml>"u"&&Ml!==void 0?function(e){return typeof e=="function"||e===Ml}:function(e){return typeof e=="function"},oi={},tw=Xe,Tt=!tw(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),rw=ni,Ni=Function.prototype.call,Qr=rw?Ni.bind(Ni):function(){return Ni.apply(Ni,arguments)},ii={},vh={}.propertyIsEnumerable,hh=Object.getOwnPropertyDescriptor,nw=hh&&!vh.call({1:2},1);ii.f=nw?function(t){var r=hh(this,t);return!!r&&r.enumerable}:vh;var _o=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},aw=Ke,ow=Xe,iw=Ta,Ll=Object,sw=aw("".split),Ds=ow(function(){return!Ll("z").propertyIsEnumerable(0)})?function(e){return iw(e)==="String"?sw(e,""):Ll(e)}:Ll,Pc=function(e){return e==null},lw=Pc,uw=TypeError,Ha=function(e){if(lw(e))throw new uw("Can't call method on "+e);return e},cw=Ds,fw=Ha,Hn=function(e){return cw(fw(e))},dw=or,Tr=function(e){return typeof e=="object"?e!==null:dw(e)},pt={},Nl=pt,Fl=gt,pw=or,kf=function(e){return pw(e)?e:void 0},Nr=function(e,t){return arguments.length<2?kf(Nl[e])||kf(Fl[e]):Nl[e]&&Nl[e][t]||Fl[e]&&Fl[e][t]},vw=Ke,kt=vw({}.isPrototypeOf),hw=gt,Mf=hw.navigator,Lf=Mf&&Mf.userAgent,Oo=Lf?String(Lf):"",gh=gt,Hl=Oo,Nf=gh.process,Ff=gh.Deno,Hf=Nf&&Nf.versions||Ff&&Ff.version,Uf=Hf&&Hf.v8,Mn,vs;Uf&&(Mn=Uf.split("."),vs=Mn[0]>0&&Mn[0]<4?1:+(Mn[0]+Mn[1]));!vs&&Hl&&(Mn=Hl.match(/Edge\/(\d+)/),(!Mn||Mn[1]>=74)&&(Mn=Hl.match(/Chrome\/(\d+)/),Mn&&(vs=+Mn[1])));var si=vs,Bf=si,gw=Xe,yw=gt,mw=yw.String,To=!!Object.getOwnPropertySymbols&&!gw(function(){var e=Symbol("symbol detection");return!mw(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Bf&&Bf<41}),bw=To,yh=bw&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Sw=Nr,ww=or,$w=kt,_w=yh,Ow=Object,li=_w?function(e){return typeof e=="symbol"}:function(e){var t=Sw("Symbol");return ww(t)&&$w(t.prototype,Ow(e))},Tw=String,ui=function(e){try{return Tw(e)}catch{return"Object"}},xw=or,Cw=ui,Iw=TypeError,Za=function(e){if(xw(e))return e;throw new Iw(Cw(e)+" is not a function")},Pw=Za,Rw=Pc,Rc=function(e,t){var r=e[t];return Rw(r)?void 0:Pw(r)},Ul=Qr,Bl=or,Wl=Tr,Ew=TypeError,Dw=function(e,t){var r,n;if(t==="string"&&Bl(r=e.toString)&&!Wl(n=Ul(r,e))||Bl(r=e.valueOf)&&!Wl(n=Ul(r,e))||t!=="string"&&Bl(r=e.toString)&&!Wl(n=Ul(r,e)))return n;throw new Ew("Can't convert object to primitive value")},mh={exports:{}},Aw=!0,Wf=gt,jw=Object.defineProperty,kw=function(e,t){try{jw(Wf,e,{value:t,configurable:!0,writable:!0})}catch{Wf[e]=t}return t},Mw=gt,Lw=kw,zf="__core-js_shared__",Gf=mh.exports=Mw[zf]||Lw(zf,{});(Gf.versions||(Gf.versions=[])).push({version:"3.46.0",mode:"pure",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Ec=mh.exports,qf=Ec,xo=function(e,t){return qf[e]||(qf[e]=t||{})},Nw=Ha,Fw=Object,Fr=function(e){return Fw(Nw(e))},Hw=Ke,Uw=Fr,Bw=Hw({}.hasOwnProperty),hr=Object.hasOwn||function(t,r){return Bw(Uw(t),r)},Ww=Ke,zw=0,Gw=Math.random(),qw=Ww(1.1.toString),Dc=function(e){return"Symbol("+(e===void 0?"":e)+")_"+qw(++zw+Gw,36)},Kw=gt,Vw=xo,Kf=hr,Yw=Dc,Xw=To,Jw=yh,go=Kw.Symbol,zl=Vw("wks"),Qw=Jw?go.for||go:go&&go.withoutSetter||Yw,wt=function(e){return Kf(zl,e)||(zl[e]=Xw&&Kf(go,e)?go[e]:Qw("Symbol."+e)),zl[e]},Zw=Qr,Vf=Tr,Yf=li,e$=Rc,t$=Dw,r$=wt,n$=TypeError,a$=r$("toPrimitive"),bh=function(e,t){if(!Vf(e)||Yf(e))return e;var r=e$(e,a$),n;if(r){if(t===void 0&&(t="default"),n=Zw(r,e,t),!Vf(n)||Yf(n))return n;throw new n$("Can't convert object to primitive value")}return t===void 0&&(t="number"),t$(e,t)},o$=bh,i$=li,Ac=function(e){var t=o$(e,"string");return i$(t)?t:t+""},s$=gt,Xf=Tr,tc=s$.document,l$=Xf(tc)&&Xf(tc.createElement),Sh=function(e){return l$?tc.createElement(e):{}},u$=Tt,c$=Xe,f$=Sh,wh=!u$&&!c$(function(){return Object.defineProperty(f$("div"),"a",{get:function(){return 7}}).a!==7}),d$=Tt,p$=Qr,v$=ii,h$=_o,g$=Hn,y$=Ac,m$=hr,b$=wh,Jf=Object.getOwnPropertyDescriptor;oi.f=d$?Jf:function(t,r){if(t=g$(t),r=y$(r),b$)try{return Jf(t,r)}catch{}if(m$(t,r))return h$(!p$(v$.f,t,r),t[r])};var S$=Xe,w$=or,$$=/#|\.prototype\./,ci=function(e,t){var r=O$[_$(e)];return r===x$?!0:r===T$?!1:w$(t)?S$(t):!!t},_$=ci.normalize=function(e){return String(e).replace($$,".").toLowerCase()},O$=ci.data={},T$=ci.NATIVE="N",x$=ci.POLYFILL="P",C$=ci,Qf=Es,I$=Za,P$=ni,R$=Qf(Qf.bind),fi=function(e,t){return I$(e),t===void 0?e:P$?R$(e,t):function(){return e.apply(t,arguments)}},Un={},E$=Tt,D$=Xe,$h=E$&&D$(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),A$=Tr,j$=String,k$=TypeError,oa=function(e){if(A$(e))return e;throw new k$(j$(e)+" is not an object")},M$=Tt,L$=wh,N$=$h,Fi=oa,Zf=Ac,F$=TypeError,Gl=Object.defineProperty,H$=Object.getOwnPropertyDescriptor,ql="enumerable",Kl="configurable",Vl="writable";Un.f=M$?N$?function(t,r,n){if(Fi(t),r=Zf(r),Fi(n),typeof t=="function"&&r==="prototype"&&"value"in n&&Vl in n&&!n[Vl]){var a=H$(t,r);a&&a[Vl]&&(t[r]=n.value,n={configurable:Kl in n?n[Kl]:a[Kl],enumerable:ql in n?n[ql]:a[ql],writable:!1})}return Gl(t,r,n)}:Gl:function(t,r,n){if(Fi(t),r=Zf(r),Fi(n),L$)try{return Gl(t,r,n)}catch{}if("get"in n||"set"in n)throw new F$("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var U$=Tt,B$=Un,W$=_o,As=U$?function(e,t,r){return B$.f(e,t,W$(1,r))}:function(e,t,r){return e[t]=r,e},Fo=gt,z$=ai,G$=Es,q$=or,K$=oi.f,V$=C$,io=pt,Y$=fi,so=As,ed=hr,X$=function(e){var t=function(r,n,a){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,a)}return z$(e,this,arguments)};return t.prototype=e.prototype,t},be=function(e,t){var r=e.target,n=e.global,a=e.stat,o=e.proto,u=n?Fo:a?Fo[r]:Fo[r]&&Fo[r].prototype,p=n?io:io[r]||so(io,r,{})[r],m=p.prototype,C,A,O,j,B,q,X,re,ve;for(j in t)C=V$(n?j:r+(a?".":"#")+j,e.forced),A=!C&&u&&ed(u,j),q=p[j],A&&(e.dontCallGetSet?(ve=K$(u,j),X=ve&&ve.value):X=u[j]),B=A&&X?X:t[j],!(!C&&!o&&typeof q==typeof B)&&(e.bind&&A?re=Y$(B,Fo):e.wrap&&A?re=X$(B):o&&q$(B)?re=G$(B):re=B,(e.sham||B&&B.sham||q&&q.sham)&&so(re,"sham",!0),so(p,j,re),o&&(O=r+"Prototype",ed(io,O)||so(io,O,{}),so(io[O],j,B),e.real&&m&&(C||!m[j])&&so(m,j,B)))},J$=Ke,eo=J$([].slice),_h=Ke,Q$=Za,Z$=Tr,e_=hr,td=eo,t_=ni,Oh=Function,r_=_h([].concat),n_=_h([].join),Yl={},a_=function(e,t,r){if(!e_(Yl,t)){for(var n=[],a=0;a0?R_:P_)(r)},D_=E_,di=function(e){var t=+e;return t!==t||t===0?0:D_(t)},A_=di,j_=Math.max,k_=Math.min,Ms=function(e,t){var r=A_(e);return r<0?j_(r+t,0):k_(r,t)},M_=di,L_=Math.min,Mc=function(e){var t=M_(e);return t>0?L_(t,9007199254740991):0},N_=Mc,xa=function(e){return N_(e.length)},F_=Hn,H_=Ms,U_=xa,B_=function(e){return function(t,r,n){var a=F_(t),o=U_(a);if(o===0)return!e&&-1;var u=H_(n,o),p;if(e&&r!==r){for(;o>u;)if(p=a[u++],p!==p)return!0}else for(;o>u;u++)if((e||u in a)&&a[u]===r)return e||u||0;return!e&&-1}},Eh={indexOf:B_(!1)},Ls={},W_=Ke,Xl=hr,z_=Hn,G_=Eh.indexOf,q_=Ls,rd=W_([].push),Dh=function(e,t){var r=z_(e),n=0,a=[],o;for(o in r)!Xl(q_,o)&&Xl(r,o)&&rd(a,o);for(;t.length>n;)Xl(r,o=t[n++])&&(~G_(a,o)||rd(a,o));return a},Lc=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],K_=Dh,V_=Lc,pi=Object.keys||function(t){return K_(t,V_)},Y_=Tt,X_=$h,J_=Un,Q_=oa,Z_=Hn,eO=pi;ks.f=Y_&&!X_?Object.defineProperties:function(t,r){Q_(t);for(var n=Z_(r),a=eO(r),o=a.length,u=0,p;o>u;)J_.f(t,p=a[u++],n[p]);return t};var tO=Nr,rO=tO("document","documentElement"),nO=xo,aO=Dc,nd=nO("keys"),Ns=function(e){return nd[e]||(nd[e]=aO(e))},oO=oa,iO=ks,ad=Lc,sO=Ls,lO=rO,uO=Sh,cO=Ns,od=">",id="<",nc="prototype",ac="script",Ah=cO("IE_PROTO"),Jl=function(){},jh=function(e){return id+ac+od+e+id+"/"+ac+od},sd=function(e){e.write(jh("")),e.close();var t=e.parentWindow.Object;return e=null,t},fO=function(){var e=uO("iframe"),t="java"+ac+":",r;return e.style.display="none",lO.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(jh("document.F=Object")),r.close(),r.F},Hi,ns=function(){try{Hi=new ActiveXObject("htmlfile")}catch{}ns=typeof document<"u"?document.domain&&Hi?sd(Hi):fO():sd(Hi);for(var e=ad.length;e--;)delete ns[nc][ad[e]];return ns()};sO[Ah]=!0;var Io=Object.create||function(t,r){var n;return t!==null?(Jl[nc]=oO(t),n=new Jl,Jl[nc]=null,n[Ah]=t):n=ns(),r===void 0?n:iO.f(n,r)},dO=be,pO=Nr,Ql=ai,vO=Th,ld=I_,hO=oa,ud=Tr,gO=Io,kh=Xe,Nc=pO("Reflect","construct"),yO=Object.prototype,mO=[].push,Mh=kh(function(){function e(){}return!(Nc(function(){},[],e)instanceof e)}),Lh=!kh(function(){Nc(function(){})}),cd=Mh||Lh;dO({target:"Reflect",stat:!0,forced:cd,sham:cd},{construct:function(t,r){ld(t),hO(r);var n=arguments.length<3?t:ld(arguments[2]);if(Lh&&!Mh)return Nc(t,r,n);if(t===n){switch(r.length){case 0:return new t;case 1:return new t(r[0]);case 2:return new t(r[0],r[1]);case 3:return new t(r[0],r[1],r[2]);case 4:return new t(r[0],r[1],r[2],r[3])}var a=[null];return Ql(mO,a,r),new(Ql(vO,t,a))}var o=n.prototype,u=gO(ud(o)?o:yO),p=Ql(t,u,r);return ud(p)?p:u}});var bO=pt,SO=bO.Reflect.construct,wO=SO,$O=wO,_O=$O,OO=be,TO=Fr,Nh=pi,xO=Xe,CO=xO(function(){Nh(1)});OO({target:"Object",stat:!0,forced:CO},{keys:function(t){return Nh(TO(t))}});var IO=pt,PO=IO.Object.keys,RO=PO,EO=RO,DO=EO,AO=Co,jO=String,xr=function(e){if(AO(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return jO(e)},Fs={},kO=Dh,MO=Lc,LO=MO.concat("length","prototype");Fs.f=Object.getOwnPropertyNames||function(t){return kO(t,LO)};var Fh={},NO=Ta,FO=Hn,Hh=Fs.f,HO=eo,Uh=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],UO=function(e){try{return Hh(e)}catch{return HO(Uh)}};Fh.f=function(t){return Uh&&NO(t)==="Window"?UO(t):Hh(FO(t))};var vi={};vi.f=Object.getOwnPropertySymbols;var BO=As,to=function(e,t,r,n){return n&&n.enumerable?e[t]=r:BO(e,t,r),e},WO=Un,Fc=function(e,t,r){return WO.f(e,t,r)},hi={},zO=wt;hi.f=zO;var fd=pt,GO=hr,qO=hi,KO=Un.f,yt=function(e){var t=fd.Symbol||(fd.Symbol={});GO(t,e)||KO(t,e,{value:qO.f(e)})},VO=Qr,YO=Nr,XO=wt,JO=to,Bh=function(){var e=YO("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,n=XO("toPrimitive");t&&!t[n]&&JO(t,n,function(a){return VO(r,this)},{})},QO=jc,ZO=Co,eT=QO?{}.toString:function(){return"[object "+ZO(this)+"]"},tT=jc,rT=Un.f,nT=As,aT=hr,oT=eT,iT=wt,dd=iT("toStringTag"),Ua=function(e,t,r,n){var a=r?e:e&&e.prototype;a&&(aT(a,dd)||rT(a,dd,{configurable:!0,value:t}),n&&!tT&&nT(a,"toString",oT))},sT=gt,lT=or,pd=sT.WeakMap,uT=lT(pd)&&/native code/.test(String(pd)),cT=uT,Wh=gt,fT=Tr,dT=As,Zl=hr,eu=Ec,pT=Ns,vT=Ls,vd="Object already initialized",oc=Wh.TypeError,hT=Wh.WeakMap,hs,ei,gs,gT=function(e){return gs(e)?ei(e):hs(e,{})},yT=function(e){return function(t){var r;if(!fT(t)||(r=ei(t)).type!==e)throw new oc("Incompatible receiver, "+e+" required");return r}};if(cT||eu.state){var ra=eu.state||(eu.state=new hT);ra.get=ra.get,ra.has=ra.has,ra.set=ra.set,hs=function(e,t){if(ra.has(e))throw new oc(vd);return t.facade=e,ra.set(e,t),t},ei=function(e){return ra.get(e)||{}},gs=function(e){return ra.has(e)}}else{var lo=pT("state");vT[lo]=!0,hs=function(e,t){if(Zl(e,lo))throw new oc(vd);return t.facade=e,dT(e,lo,t),t},ei=function(e){return Zl(e,lo)?e[lo]:{}},gs=function(e){return Zl(e,lo)}}var gi={set:hs,get:ei,has:gs,enforce:gT,getterFor:yT},mT=Ta,Po=Array.isArray||function(t){return mT(t)==="Array"},hd=Po,bT=js,ST=Tr,wT=wt,$T=wT("species"),gd=Array,_T=function(e){var t;return hd(e)&&(t=e.constructor,bT(t)&&(t===gd||hd(t.prototype))?t=void 0:ST(t)&&(t=t[$T],t===null&&(t=void 0))),t===void 0?gd:t},OT=_T,Hc=function(e,t){return new(OT(e))(t===0?0:t)},TT=fi,xT=Ke,CT=Ds,IT=Fr,PT=xa,RT=Hc,yd=xT([].push),uo=function(e){var t=e===1,r=e===2,n=e===3,a=e===4,o=e===6,u=e===7,p=e===5||o;return function(m,C,A,O){for(var j=IT(m),B=CT(j),q=PT(B),X=TT(C,A),re=0,ve=O||RT,Se=t?ve(m,q):r||u?ve(m,0):void 0,he,ee;q>re;re++)if((p||re in B)&&(he=B[re],ee=X(he,re,j),e))if(t)Se[re]=ee;else if(ee)switch(e){case 3:return!0;case 5:return he;case 6:return re;case 2:yd(Se,he)}else switch(e){case 4:return!1;case 7:yd(Se,he)}return o?-1:n||a?a:Se}},ro={forEach:uo(0),map:uo(1),filter:uo(2),some:uo(3),every:uo(4),findIndex:uo(6)},Hs=be,yi=gt,Uc=Qr,ET=Ke,mo=Tt,bo=To,DT=Xe,Jt=hr,AT=kt,ic=oa,Us=Hn,Bc=Ac,jT=xr,sc=_o,So=Io,zh=pi,kT=Fs,Gh=Fh,MT=vi,qh=oi,Kh=Un,LT=ks,Vh=ii,md=to,NT=Fc,Wc=xo,FT=Ns,Yh=Ls,bd=Dc,HT=wt,UT=hi,BT=yt,WT=Bh,zT=Ua,Xh=gi,Bs=ro.forEach,Lr=FT("hidden"),Ws="Symbol",ti="prototype",GT=Xh.set,Sd=Xh.getterFor(Ws),Nn=Object[ti],Ya=yi.Symbol,Go=Ya&&Ya[ti],qT=yi.RangeError,KT=yi.TypeError,tu=yi.QObject,Jh=qh.f,Xa=Kh.f,Qh=Gh.f,VT=Vh.f,Zh=ET([].push),Oa=Wc("symbols"),mi=Wc("op-symbols"),YT=Wc("wks"),lc=!tu||!tu[ti]||!tu[ti].findChild,eg=function(e,t,r){var n=Jh(Nn,t);n&&delete Nn[t],Xa(e,t,r),n&&e!==Nn&&Xa(Nn,t,n)},uc=mo&&DT(function(){return So(Xa({},"a",{get:function(){return Xa(this,"a",{value:7}).a}})).a!==7})?eg:Xa,ru=function(e,t){var r=Oa[e]=So(Go);return GT(r,{type:Ws,tag:e,description:t}),mo||(r.description=t),r},zs=function(t,r,n){t===Nn&&zs(mi,r,n),ic(t);var a=Bc(r);return ic(n),Jt(Oa,a)?(n.enumerable?(Jt(t,Lr)&&t[Lr][a]&&(t[Lr][a]=!1),n=So(n,{enumerable:sc(0,!1)})):(Jt(t,Lr)||Xa(t,Lr,sc(1,So(null))),t[Lr][a]=!0),uc(t,a,n)):Xa(t,a,n)},zc=function(t,r){ic(t);var n=Us(r),a=zh(n).concat(ag(n));return Bs(a,function(o){(!mo||Uc(tg,n,o))&&zs(t,o,n[o])}),t},XT=function(t,r){return r===void 0?So(t):zc(So(t),r)},tg=function(t){var r=Bc(t),n=Uc(VT,this,r);return this===Nn&&Jt(Oa,r)&&!Jt(mi,r)?!1:n||!Jt(this,r)||!Jt(Oa,r)||Jt(this,Lr)&&this[Lr][r]?n:!0},rg=function(t,r){var n=Us(t),a=Bc(r);if(!(n===Nn&&Jt(Oa,a)&&!Jt(mi,a))){var o=Jh(n,a);return o&&Jt(Oa,a)&&!(Jt(n,Lr)&&n[Lr][a])&&(o.enumerable=!0),o}},ng=function(t){var r=Qh(Us(t)),n=[];return Bs(r,function(a){!Jt(Oa,a)&&!Jt(Yh,a)&&Zh(n,a)}),n},ag=function(e){var t=e===Nn,r=Qh(t?mi:Us(e)),n=[];return Bs(r,function(a){Jt(Oa,a)&&(!t||Jt(Nn,a))&&Zh(n,Oa[a])}),n};bo||(Ya=function(){if(AT(Go,this))throw new KT("Symbol is not a constructor");var t=!arguments.length||arguments[0]===void 0?void 0:jT(arguments[0]),r=bd(t),n=function(a){var o=this===void 0?yi:this;o===Nn&&Uc(n,mi,a),Jt(o,Lr)&&Jt(o[Lr],r)&&(o[Lr][r]=!1);var u=sc(1,a);try{uc(o,r,u)}catch(p){if(!(p instanceof qT))throw p;eg(o,r,u)}};return mo&&lc&&uc(Nn,r,{configurable:!0,set:n}),ru(r,t)},Go=Ya[ti],md(Go,"toString",function(){return Sd(this).tag}),md(Ya,"withoutSetter",function(e){return ru(bd(e),e)}),Vh.f=tg,Kh.f=zs,LT.f=zc,qh.f=rg,kT.f=Gh.f=ng,MT.f=ag,UT.f=function(e){return ru(HT(e),e)},mo&&NT(Go,"description",{configurable:!0,get:function(){return Sd(this).description}}));Hs({global:!0,wrap:!0,forced:!bo,sham:!bo},{Symbol:Ya});Bs(zh(YT),function(e){BT(e)});Hs({target:Ws,stat:!0,forced:!bo},{useSetter:function(){lc=!0},useSimple:function(){lc=!1}});Hs({target:"Object",stat:!0,forced:!bo,sham:!mo},{create:XT,defineProperty:zs,defineProperties:zc,getOwnPropertyDescriptor:rg});Hs({target:"Object",stat:!0,forced:!bo},{getOwnPropertyNames:ng});WT();zT(Ya,Ws);Yh[Lr]=!0;var JT=To,og=JT&&!!Symbol.for&&!!Symbol.keyFor,QT=be,ZT=Nr,ex=hr,tx=xr,ig=xo,rx=og,nu=ig("string-to-symbol-registry"),nx=ig("symbol-to-string-registry");QT({target:"Symbol",stat:!0,forced:!rx},{for:function(e){var t=tx(e);if(ex(nu,t))return nu[t];var r=ZT("Symbol")(t);return nu[t]=r,nx[r]=t,r}});var ax=be,ox=hr,ix=li,sx=ui,lx=xo,ux=og,wd=lx("symbol-to-string-registry");ax({target:"Symbol",stat:!0,forced:!ux},{keyFor:function(t){if(!ix(t))throw new TypeError(sx(t)+" is not a symbol");if(ox(wd,t))return wd[t]}});var cx=Ke,$d=Po,fx=or,_d=Ta,dx=xr,Od=cx([].push),px=function(e){if(fx(e))return e;if($d(e)){for(var t=e.length,r=[],n=0;nu;)m=n(r,p=a[u++]),m!==void 0&&oC(o,p,m);return o}});var iC=pt,sC=iC.Object.getOwnPropertyDescriptors,lC=sC,uC=lC,cC=uC,yg={exports:{}},fC=be,dC=Tt,Dd=ks.f;fC({target:"Object",stat:!0,forced:Object.defineProperties!==Dd,sham:!dC},{defineProperties:Dd});var pC=pt,mg=pC.Object,vC=yg.exports=function(t,r){return mg.defineProperties(t,r)};mg.defineProperties.sham&&(vC.sham=!0);var hC=yg.exports,gC=hC,yC=gC,mC=yC,bg={exports:{}},bC=be,SC=Tt,Ad=Un.f;bC({target:"Object",stat:!0,forced:Object.defineProperty!==Ad,sham:!SC},{defineProperty:Ad});var wC=pt,Sg=wC.Object,$C=bg.exports=function(t,r,n){return Sg.defineProperty(t,r,n)};Sg.defineProperty.sham&&($C.sham=!0);var _C=bg.exports,OC=_C,wg=OC,TC=wg,$g={exports:{}},jd=Tt,xC=Ke,CC=Qr,IC=Xe,au=pi,PC=vi,RC=ii,EC=Fr,DC=Ds,co=Object.assign,kd=Object.defineProperty,AC=xC([].concat),_g=!co||IC(function(){if(jd&&co({b:1},co(kd({},"a",{enumerable:!0,get:function(){kd(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(a){t[a]=a}),co({},e)[r]!==7||au(co({},t)).join("")!==n})?function(t,r){for(var n=EC(t),a=arguments.length,o=1,u=PC.f,p=RC.f;a>o;)for(var m=DC(arguments[o++]),C=u?AC(au(m),u(m)):au(m),A=C.length,O=0,j;A>O;)j=C[O++],(!jd||CC(p,m,j))&&(n[j]=m[j]);return n}:co,jC=be,Md=_g;jC({target:"Object",stat:!0,forced:Object.assign!==Md},{assign:Md});var kC=pt,MC=kC.Object.assign,LC=MC,Og=LC,NC=Og,FC=NC,HC=FC,UC=HC,BC=UC,WC=be,Ld=Th;WC({target:"Function",proto:!0,forced:Function.bind!==Ld},{bind:Ld});var zC=gt,GC=pt,gr=function(e,t){var r=GC[e+"Prototype"],n=r&&r[t];if(n)return n;var a=zC[e],o=a&&a.prototype;return o&&o[t]},qC=gr,KC=qC("Function","bind"),VC=kt,YC=KC,ou=Function.prototype,XC=function(e){var t=e.bind;return e===ou||VC(ou,e)&&t===ou.bind?YC:t},JC=XC,Tg=JC,QC=Tg,ZC=QC,eI=ZC,tI=eI,Gc=tI;(function(e){var t=BC,r=Gc;function n(){var a;return e.exports=n=t?r(a=t).call(a):function(o){for(var u=1;ur.length)&&(n=r.length);for(var a=0,o=Array(n);avI)throw pI("Maximum allowed index exceeded");return e},hI=Xe,gI=wt,yI=si,mI=gI("species"),wi=function(e){return yI>=51||!hI(function(){var t=[],r=t.constructor={};return r[mI]=function(){return{foo:1}},t[e](Boolean).foo!==1})},bI=be,SI=Xe,wI=Po,$I=Tr,_I=Fr,OI=xa,Nd=qc,Fd=Si,TI=Hc,xI=wi,CI=wt,II=si,Ag=CI("isConcatSpreadable"),PI=II>=51||!SI(function(){var e=[];return e[Ag]=!1,e.concat()[0]!==e}),RI=function(e){if(!$I(e))return!1;var t=e[Ag];return t!==void 0?!!t:wI(e)},EI=!PI||!xI("concat");bI({target:"Array",proto:!0,forced:EI},{concat:function(t){var r=_I(this),n=TI(r,0),a=0,o,u,p,m,C;for(o=-1,p=arguments.length;o=t.length)return e.target=null,zi(void 0,!0);switch(e.kind){case"keys":return zi(r,!1);case"values":return zi(t[r],!1)}return zi([r,t[r]],!1)},"values");qd.Arguments=qd.Array;var X0={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},J0=X0,Q0=gt,Z0=Ua,Kd=Ro;for(var uu in J0)Z0(Q0[uu],uu),Kd[uu]=Kd.Array;var eP=ZI,tP=eP,rP=wt,nP=Un.f,Vd=rP("metadata"),Yd=Function.prototype;Yd[Vd]===void 0&&nP(Yd,Vd,{value:null});var aP=yt;aP("metadata");var oP=tP,iP=oP,sP=Nr,lP=Ke,Vc=sP("Symbol"),uP=Vc.keyFor,cP=lP(Vc.prototype.valueOf),qg=Vc.isRegisteredSymbol||function(t){try{return uP(cP(t))!==void 0}catch{return!1}},fP=be,dP=qg;fP({target:"Symbol",stat:!0},{isRegisteredSymbol:dP});var pP=xo,Kg=Nr,vP=Ke,hP=li,gP=wt,ys=Kg("Symbol"),Xd=ys.isWellKnownSymbol,Vg=Kg("Object","getOwnPropertyNames"),yP=vP(ys.prototype.valueOf),Jd=pP("wks");for(var cu=0,Qd=Vg(ys),mP=Qd.length;cu=o?e?"":void 0:(u=ep(n,a),u<55296||u>56319||a+1===o||(p=ep(n,a+1))<56320||p>57343?e?MP(n,a):u:e?LP(n,a,a+2):(u-55296<<10)+(p-56320)+65536)}},Xg={codeAt:tp(!1),charAt:tp(!0)},NP=Xg.charAt,FP=xr,Jg=gi,HP=Wg,rp=Kc,Qg="String Iterator",UP=Jg.set,BP=Jg.getterFor(Qg);HP(String,"String",function(e){UP(this,{type:Qg,string:FP(e),index:0})},function(){var t=BP(this),r=t.string,n=t.index,a;return n>=r.length?rp(void 0,!0):(a=NP(r,n),t.index+=a.length,rp(a,!1))});var WP=Co,np=Rc,zP=Pc,GP=Ro,qP=wt,KP=qP("iterator"),qs=function(e){if(!zP(e))return np(e,KP)||np(e,"@@iterator")||GP[WP(e)]},VP=qs,YP=VP,XP=YP,JP=XP,QP=JP,ZP=QP,eR=ZP,tR=eR,Zg=tR,rR=Qr,ap=oa,nR=Rc,aR=function(e,t,r){var n,a;ap(e);try{if(n=nR(e,"return"),!n){if(t==="throw")throw r;return r}n=rR(n,e)}catch(o){a=!0,n=o}if(t==="throw")throw r;if(a)throw n;return ap(n),r},oR=oa,iR=aR,sR=function(e,t,r,n){try{return n?t(oR(r)[0],r[1]):t(r)}catch(a){iR(e,"throw",a)}},lR=wt,uR=Ro,cR=lR("iterator"),fR=Array.prototype,dR=function(e){return e!==void 0&&(uR.Array===e||fR[cR]===e)},pR=Qr,vR=Za,hR=oa,gR=ui,yR=qs,mR=TypeError,ey=function(e,t){var r=arguments.length<2?yR(e):t;if(vR(r))return hR(pR(r,e));throw new mR(gR(e)+" is not iterable")},bR=fi,SR=Qr,wR=Fr,$R=sR,_R=dR,OR=js,TR=xa,op=Si,xR=ey,CR=qs,ip=Array,ty=function(t){var r=wR(t),n=OR(this),a=arguments.length,o=a>1?arguments[1]:void 0,u=o!==void 0;u&&(o=bR(o,a>2?arguments[2]:void 0));var p=CR(r),m=0,C,A,O,j,B,q;if(p&&!(this===ip&&_R(p)))for(A=n?new this:[],j=xR(r,p),B=j.next;!(O=SR(B,j)).done;m++)q=u?$R(j,o,[O.value,m],!0):O.value,op(A,m,q);else for(C=TR(r),A=n?new this(C):ip(C);C>m;m++)q=u?o(r[m],m):r[m],op(A,m,q);return A.length=m,A},IR=wt,ry=IR("iterator"),ny=!1;try{var PR=0,sp={next:function(){return{done:!!PR++}},return:function(){ny=!0}};sp[ry]=function(){return this},Array.from(sp,function(){throw 2})}catch{}var RR=function(e,t){try{if(!t&&!ny)return!1}catch{return!1}var r=!1;try{var n={};n[ry]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},ER=be,DR=ty,AR=RR,jR=!AR(function(e){Array.from(e)});ER({target:"Array",stat:!0,forced:jR},{from:DR});var kR=pt,MR=kR.Array.from,LR=MR,NR=LR,FR=NR,HR=FR,UR=HR,BR=UR,ay=BR;(function(e){var t=Yc,r=Zg,n=ay;function a(o){if(typeof t<"u"&&r(o)!=null||o["@@iterator"]!=null)return n(o)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports})(Dg);var WR=Dg.exports,oy={exports:{}},zR=be,lp=Po,GR=js,qR=Tr,up=Ms,KR=xa,VR=Hn,YR=Si,XR=wt,JR=wi,QR=eo,ZR=JR("slice"),e1=XR("species"),fu=Array,t1=Math.max;zR({target:"Array",proto:!0,forced:!ZR},{slice:function(t,r){var n=VR(this),a=KR(n),o=up(t,a),u=up(r===void 0?a:r,a),p,m,C;if(lp(n)&&(p=n.constructor,GR(p)&&(p===fu||lp(p.prototype))?p=void 0:qR(p)&&(p=p[e1],p===null&&(p=void 0)),p===fu||p===void 0))return QR(n,o,u);for(m=new(p===void 0?fu:p)(t1(u-o,0)),C=0;o1?arguments[1]:void 0;return cy?pc(this,t,r)||0:_1(this,t,r)}});var x1=gr,C1=x1("Array","indexOf"),I1=kt,P1=C1,pu=Array.prototype,R1=function(e){var t=e.indexOf;return e===pu||I1(pu,e)&&t===pu.indexOf?P1:t},E1=R1,fy=E1,D1=fy,A1=D1,j1=A1,k1=j1,dy=k1,py={exports:{}};(function(e){var t=dy;function r(n,a){if(n==null)return{};var o={};for(var u in n)if({}.hasOwnProperty.call(n,u)){if(t(a).call(a,u)!==-1)continue;o[u]=n[u]}return o}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(py);var M1=py.exports;(function(e){var t=b1,r=dy,n=M1;function a(o,u){if(o==null)return{};var p,m,C=n(o,u);if(t){var A=t(o);for(m=0;m1?arguments[1]:void 0)}});var rD=gr,nD=rD("Array","map"),aD=kt,oD=nD,vu=Array.prototype,iD=function(e){var t=e.map;return e===vu||aD(vu,e)&&t===vu.map?oD:t},sD=iD,lD=sD,uD=lD,Py=Tt,cD=Xe,Ry=Ke,fD=Gs,dD=pi,pD=Hn,vD=ii.f,Ey=Ry(vD),hD=Ry([].push),gD=Py&&cD(function(){var e=Object.create(null);return e[2]=2,!Ey(e,2)}),cp=function(e){return function(t){for(var r=pD(t),n=dD(r),a=gD&&fD(r)===null,o=n.length,u=0,p=[],m;o>u;)m=n[u++],(!Py||(a?m in r:Ey(r,m)))&&hD(p,e?[m,r[m]]:r[m]);return p}},Dy={entries:cp(!0),values:cp(!1)},yD=be,mD=Dy.values;yD({target:"Object",stat:!0},{values:function(t){return mD(t)}});var bD=pt,SD=bD.Object.values,wD=SD,$D=wD,_D=$D,OD=ro.forEach,TD=Eo,xD=TD("forEach"),CD=xD?[].forEach:function(t){return OD(this,t,arguments.length>1?arguments[1]:void 0)},ID=be,fp=CD;ID({target:"Array",proto:!0,forced:[].forEach!==fp},{forEach:fp});var PD=gr,RD=PD("Array","forEach"),ED=RD,DD=ED,AD=Co,jD=hr,kD=kt,MD=DD,hu=Array.prototype,LD={DOMTokenList:!0,NodeList:!0},ND=function(e){var t=e.forEach;return e===hu||kD(hu,e)&&t===hu.forEach||jD(LD,AD(e))?MD:t},FD=ND,HD=Ig,UD=Za,BD=Fr,WD=Ds,zD=xa,dp=TypeError,pp="Reduce of empty array with no initial value",GD=function(e){return function(t,r,n,a){var o=BD(t),u=WD(o),p=zD(o);if(UD(r),p===0&&n<2)throw new dp(pp);var m=e?p-1:0,C=e?-1:1;if(n<2)for(;;){if(m in u){a=u[m],m+=C;break}if(m+=C,e?m<0:p<=m)throw new dp(pp)}for(;e?m>=0:p>m;m+=C)m in u&&(a=r(a,u[m],m,o));return a}},qD={left:GD(!1)},Uo=gt,KD=Oo,VD=Ta,Gi=function(e){return KD.slice(0,e.length)===e},Ay=function(){return Gi("Bun/")?"BUN":Gi("Cloudflare-Workers")?"CLOUDFLARE":Gi("Deno/")?"DENO":Gi("Node.js/")?"NODE":Uo.Bun&&typeof Bun.version=="string"?"BUN":Uo.Deno&&typeof Deno.version=="object"?"DENO":VD(Uo.process)==="process"?"NODE":Uo.window&&Uo.document?"BROWSER":"REST"}(),YD=Ay,XD=YD==="NODE",JD=be,QD=qD.left,ZD=Eo,vp=si,eA=XD,tA=!eA&&vp>79&&vp<83,rA=tA||!ZD("reduce");JD({target:"Array",proto:!0,forced:rA},{reduce:function(t){var r=arguments.length;return QD(this,t,r,r>1?arguments[1]:void 0)}});var nA=gr,aA=nA("Array","reduce"),oA=kt,iA=aA,gu=Array.prototype,sA=function(e){var t=e.reduce;return e===gu||oA(gu,e)&&t===gu.reduce?iA:t},lA=sA,uA=lA,cA=uA,fA=Tt,dA=Po,pA=TypeError,vA=Object.getOwnPropertyDescriptor,hA=fA&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),jy=hA?function(e,t){if(dA(e)&&!vA(e,"length").writable)throw new pA("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},hp=ui,gA=TypeError,ky=function(e,t){if(!delete e[t])throw new gA("Cannot delete property "+hp(t)+" of "+hp(e))},yA=be,mA=Fr,bA=Ms,SA=di,wA=xa,$A=jy,_A=qc,OA=Hc,TA=Si,yu=ky,xA=wi,CA=xA("splice"),IA=Math.max,PA=Math.min;yA({target:"Array",proto:!0,forced:!CA},{splice:function(t,r){var n=mA(this),a=wA(n),o=bA(t,a),u=arguments.length,p,m,C,A,O,j;for(u===0?p=m=0:u===1?(p=0,m=a-o):(p=u-2,m=PA(IA(SA(r),0),a-o)),_A(a+p-m),C=OA(n,m),A=0;Aa-m+p;A--)yu(n,A-1)}else if(p>m)for(A=a-m;A>o;A--)O=A+m-1,j=A+p-1,O in n?n[j]=n[O]:yu(n,j);for(A=0;A0;)e[o]=e[--o];o!==n++&&(e[o]=a)}else for(var u=NA(r/2),p=vc(gp(e,0,u),t),m=vc(gp(e,u),t),C=p.length,A=m.length,O=0,j=0;O3)){if(JA)return!0;if(_p)return _p<603;var e="",t,r,n,a;for(t=65;t<76;t++){switch(r=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(a=0;a<47;a++)Da.push({k:r+a,v:n})}for(Da.sort(function(o,u){return u.v-o.v}),a=0;aSp(r)?1:-1}};GA({target:"Array",proto:!0,forced:rj},{sort:function(t){t!==void 0&&qA(t);var r=KA(this);if(Ny)return t===void 0?Op(r):Op(r,t);var n=[],a=bp(r),o,u;for(u=0;u1?arguments[1]:void 0)}});var $j=gr,_j=$j("Array","findIndex"),Oj=kt,Tj=_j,wu=Array.prototype,xj=function(e){var t=e.findIndex;return e===wu||Oj(wu,e)&&t===wu.findIndex?Tj:t},Cj=xj,Ij=Cj,Pj=Ij,Rj=be,Ej=ro.filter,Dj=wi,Aj=Dj("filter");Rj({target:"Array",proto:!0,forced:!Aj},{filter:function(t){return Ej(this,t,arguments.length>1?arguments[1]:void 0)}});var jj=gr,kj=jj("Array","filter"),Mj=kt,Lj=kj,$u=Array.prototype,Nj=function(e){var t=e.filter;return e===$u||Mj($u,e)&&t===$u.filter?Lj:t},Fj=Nj,Hj=Fj,Uj=Hj,Bj=Og,Wj=Tg,zj=be,Gj=ro.some,qj=Eo,Kj=qj("some");zj({target:"Array",proto:!0,forced:!Kj},{some:function(t){return Gj(this,t,arguments.length>1?arguments[1]:void 0)}});var Vj=gr,Yj=Vj("Array","some"),Xj=kt,Jj=Yj,_u=Array.prototype,Qj=function(e){var t=e.some;return e===_u||Xj(_u,e)&&t===_u.some?Jj:t},Zj=Qj,ek=Zj,tk=ek,rk=be,nk=ro.every,ak=Eo,ok=ak("every");rk({target:"Array",proto:!0,forced:!ok},{every:function(t){return nk(this,t,arguments.length>1?arguments[1]:void 0)}});var ik=gr,sk=ik("Array","every"),lk=kt,uk=sk,Ou=Array.prototype,ck=function(e){var t=e.every;return e===Ou||lk(Ou,e)&&t===Ou.every?uk:t},fk=ck,dk=fk,pk=dk;const vk=je(lS),hk=je(uS),gk=je(cS);var Ma={};const yk=je(fS);var Hy={},Vs={},Uy={},$i={};Object.defineProperty($i,"__esModule",{value:!0});$i.assert=void 0;function mk(e,t){if(!e)throw new Error(t)}$i.assert=mk;var _i={};Object.defineProperty(_i,"__esModule",{value:!0});_i.typeGuard=void 0;function bk(e,t){return t}_i.typeGuard=bk;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.classnames=void 0;const t=$i,r=_i,n=a=>{const o=a.length;let u=0,p="";for(;un===t[a]).indexOf(!1)>=0)&&(r.current={v:e(),prevDeps:[...t]}),r.current.v}Ys.useGuaranteedMemo=_k;var wn={};const Ok=je(vS);var Tk=Oe&&Oe.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),xk=Oe&&Oe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ck=Oe&&Oe.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Tk(t,e,r);return xk(t,e),t},Ik=Oe&&Oe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wn,"__esModule",{value:!0});wn.TssCacheProvider=wn.useTssEmotionCache=wn.getTssDefaultEmotionCache=wn.getDoExistsTssDefaultEmotionCacheMemoizedValue=void 0;const ms=Ck(xe),Pk=Ik(Ok),{getDoExistsTssDefaultEmotionCacheMemoizedValue:Rk,getTssDefaultEmotionCache:By,reactContext:Wy}=(()=>{const e="__tss-react_context",t=ms.createContext;let r=t["__tss-react_context"];if(r===void 0){const{getTssDefaultEmotionCache:n,getDoExistsTssDefaultEmotionCacheMemoizedValue:a}=(()=>{let o;function u(p){const{doReset:m=!1}=p??{};return m&&(o=void 0),o===void 0&&(o=(0,Pk.default)({key:"tss"})),o}return{getTssDefaultEmotionCache:u,getDoExistsTssDefaultEmotionCacheMemoizedValue:()=>o!==void 0}})();r={getTssDefaultEmotionCache:n,getDoExistsTssDefaultEmotionCacheMemoizedValue:a,reactContext:(0,ms.createContext)(void 0)},Object.defineProperty(t,e,{configurable:!1,enumerable:!1,writable:!1,value:r})}return r})();wn.getDoExistsTssDefaultEmotionCacheMemoizedValue=Rk;wn.getTssDefaultEmotionCache=By;function Ek(){const e=(0,ms.useContext)(Wy);return e??By()}wn.useTssEmotionCache=Ek;function Dk(e){const{children:t,value:r}=e;return ms.default.createElement(Wy.Provider,{value:r},t)}wn.TssCacheProvider=Dk;var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.matchCSSObject=void 0;function Ak(e){return e instanceof Object&&!("styles"in e)&&!("length"in e)&&!("__emotion_styles"in e)}Xs.matchCSSObject=Ak;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.useCssAndCx=e.createCssAndCx=void 0;const t=Uy,r=Sk,n=wk,a=Ys,o=wn,u=Xs;e.createCssAndCx=(()=>{function C(O,j,B){const q=[],X=(0,n.getRegisteredStyles)(O,q,B);return q.length<2?B:X+j(q)}function A(O){const{cache:j}=O,B=(...X)=>{const re=(0,r.serializeStyles)(X,j.registered);(0,n.insertStyles)(j,re,!1);const ve=`${j.key}-${re.name}`;e:{const Se=X[0];if(!(0,u.matchCSSObject)(Se))break e;m.saveClassNameCSSObjectMapping(j,ve,Se)}return ve};return{css:B,cx:(...X)=>{const re=(0,t.classnames)(X),ve=m.fixClassName(j,re,B);return C(j.registered,B,ve)}}}return{createCssAndCx:A}})().createCssAndCx;function p(){const C=(0,o.useTssEmotionCache)(),{css:A,cx:O}=(0,a.useGuaranteedMemo)(()=>(0,e.createCssAndCx)({cache:C}),[C]);return{css:A,cx:O}}e.useCssAndCx=p;const m=(()=>{const C=new WeakMap;return{saveClassNameCSSObjectMapping:(A,O,j)=>{let B=C.get(A);B===void 0&&(B=new Map,C.set(A,B)),B.set(O,j)},fixClassName:(()=>{function A(O){let j=!1;return O.map(([B,q])=>{if(q===void 0)return B;let X;if(j)X={"&&":q};else{X=B;for(const re in q)if(re.startsWith("@media")){j=!0;break}}return X})}return(O,j,B)=>{const q=C.get(O);return(0,t.classnames)(A(j.split(" ").map(X=>[X,q==null?void 0:q.get(X)])).map(X=>typeof X=="string"?X:B(X)))}})()}})()})(Vs);var Ja={},Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.objectKeys=void 0;function jk(e){return Object.keys(e)}Oi.objectKeys=jk;var Ti={};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.getDependencyArrayRef=void 0;function kk(e){if(!(e instanceof Object)||typeof e=="function")return e;const t=[];for(const r in e){const n=e[r],a=typeof n;if(!(a==="string"||a==="number"&&!isNaN(n)||a==="boolean"||n===void 0||n===null))return e;t.push(`${r}:${a}_${n}`)}return"xSqLiJdLMd9s"+t.join("|")}Ti.getDependencyArrayRef=kk;Object.defineProperty(Ja,"__esModule",{value:!0});Ja.useMergedClasses=Ja.mergeClasses=void 0;const xp=Oi,Mk=Ti,Lk=Vs,Nk=xe;function zy(e,t,r){if(!(t instanceof Object))return e;const n={};return(0,xp.objectKeys)(e).forEach(a=>n[a]=r(e[a],t[a])),(0,xp.objectKeys)(t).forEach(a=>{if(a in e)return;const o=t[a];typeof o=="string"&&(n[a]=o)}),n}Ja.mergeClasses=zy;function Fk(e,t){const{cx:r}=(0,Lk.useCssAndCx)();return(0,Nk.useMemo)(()=>zy(e,t,r),[e,(0,Mk.getDependencyArrayRef)(t),r])}Ja.useMergedClasses=Fk;var xi={},Js={};Object.defineProperty(Js,"__esModule",{value:!0});Js.objectFromEntries=void 0;Js.objectFromEntries=Object.fromEntries?Object.fromEntries:e=>{if(!e||!e[Symbol.iterator])throw new Error("Object.fromEntries() requires a single iterable argument");const t={};return Object.keys(e).forEach(r=>{const[n,a]=e[r];t[n]=a}),t};Object.defineProperty(xi,"__esModule",{value:!0});xi.createMakeStyles=void 0;const qi=xe,Hk=Js,Cp=Oi,Ip=Vs,Ki=Ti,Uk=_i,Bk=wn,Wk=$i,Pp=Ja;let zk=0;function Gk(e){const{useTheme:t}=e;function r(a){const{name:o,uniqId:u=zk++}=a??{},p=typeof o!="object"?o:Object.keys(o)[0];return function(m){const C=typeof m=="function"?m:()=>m;return function(O,j){var B,q;const X=t(),{css:re,cx:ve}=(0,Ip.useCssAndCx)(),Se=(0,Bk.useTssEmotionCache)();let he=(0,qi.useMemo)(()=>{const Ce={},Be=typeof Proxy<"u"&&new Proxy({},{get:(ze,ft)=>(typeof ft=="symbol"&&(0,Wk.assert)(!1),Ce[ft]=`${Se.key}-${u}${p!==void 0?`-${p}`:""}-${ft}-ref`)}),De=C(X,O,Be||{}),it=(0,Hk.objectFromEntries)((0,Cp.objectKeys)(De).map(ze=>{const ft=De[ze];return ft.label||(ft.label=`${p!==void 0?`${p}-`:""}${ze}`),[ze,`${re(ft)}${(0,Uk.typeGuard)(ze,ze in Ce)?` ${Ce[ze]}`:""}`]}));return(0,Cp.objectKeys)(Ce).forEach(ze=>{ze in it||(it[ze]=Ce[ze])}),it},[Se,re,ve,X,(0,Ki.getDependencyArrayRef)(O)]);const ee=j==null?void 0:j.props.classes;he=(0,qi.useMemo)(()=>(0,Pp.mergeClasses)(he,ee,ve),[he,(0,Ki.getDependencyArrayRef)(ee),ve]);{let Ce;try{Ce=p!==void 0?(q=(B=X.components)===null||B===void 0?void 0:B[p])===null||q===void 0?void 0:q.styleOverrides:void 0}catch{}const Be=(0,qi.useMemo)(()=>{if(!Ce)return;const De={};for(const it in Ce){const ze=Ce[it];ze instanceof Object&&(De[it]=re(typeof ze=="function"?ze(Object.assign({theme:X,ownerState:j==null?void 0:j.ownerState},j==null?void 0:j.props)):ze))}return De},[Ce===void 0?void 0:JSON.stringify(Ce),(0,Ki.getDependencyArrayRef)(j==null?void 0:j.props),(0,Ki.getDependencyArrayRef)(j==null?void 0:j.ownerState),re]);he=(0,qi.useMemo)(()=>(0,Pp.mergeClasses)(he,Be,ve),[he,Be,ve])}return{classes:he,theme:X,css:re,cx:ve}}}}function n(){const a=t(),{css:o,cx:u}=(0,Ip.useCssAndCx)();return{theme:a,css:o,cx:u}}return{makeStyles:r,useStyles:n}}xi.createMakeStyles=Gk;var Qs={},Zs={};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.capitalize=void 0;function qk(e){return e.charAt(0).toUpperCase()+e.slice(1)}Zs.capitalize=qk;var Kk=Oe&&Oe.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Vk=Oe&&Oe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Yk=Oe&&Oe.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Kk(t,e,r);return Vk(t,e),t},Rp=Oe&&Oe.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a{const O=a,j=function(B){var{children:q}=B,X=Rp(B,["children"]);return(0,Tu.createElement)(O,X,q)};return Object.defineProperty(j,"name",{value:(0,Jk.capitalize)(O)}),j})():a,m=(()=>{const{name:O}=p;return typeof O=="string"?O:void 0})(),C=r(u)(typeof o=="function"?(O,j,B)=>Ep(o(O,j,B)):Ep(o)),A=(0,Tu.forwardRef)(function(O,j){const{className:B,classes:q}=O,X=Rp(O,["className","classes"]),{classes:re,cx:ve}=C(O,{props:O});return Tu.default.createElement(p,Object.assign({ref:j,className:ve(re.root,B)},typeof a=="string"?{}:{classes:re},X))});return m!==void 0&&Object.defineProperty(A,"name",{value:`${m}WithStyles`}),A}return{withStyles:n}}Qs.createWithStyles=Qk;function Ep(e){const t={},r={};return Object.keys(e).forEach(n=>(n.startsWith("@media")?r:t)[n]=e[n]),Object.keys(r).forEach(n=>{const a=r[n];Object.keys(a).forEach(o=>{var u;return t[o]=Object.assign(Object.assign({},(u=t[o])!==null&&u!==void 0?u:{}),{[n]:a[o]})})}),t}const Gy=je(hS);var el={},Zk=Oe&&Oe.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),eM=Oe&&Oe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),tM=Oe&&Oe.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Zk(t,e,r);return eM(t,e),t},rM=Oe&&Oe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(el,"__esModule",{value:!0});el.GlobalStyles=void 0;const nM=rM(xe),Dp=tM(Gy);function aM(e){const{styles:t}=e;return nM.default.createElement(Dp.Global,{styles:Dp.css(t)})}el.GlobalStyles=aM;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMakeAndWithStyles=e.TssCacheProvider=e.getTssDefaultEmotionCache=e.GlobalStyles=e.keyframes=e.createWithStyles=e.createMakeStyles=e.useMergedClasses=e.useCssAndCx=void 0;var t=Vs;Object.defineProperty(e,"useCssAndCx",{enumerable:!0,get:function(){return t.useCssAndCx}});var r=Ja;Object.defineProperty(e,"useMergedClasses",{enumerable:!0,get:function(){return r.useMergedClasses}});const n=xi;Object.defineProperty(e,"createMakeStyles",{enumerable:!0,get:function(){return n.createMakeStyles}});const a=Qs;Object.defineProperty(e,"createWithStyles",{enumerable:!0,get:function(){return a.createWithStyles}});var o=Gy;Object.defineProperty(e,"keyframes",{enumerable:!0,get:function(){return o.keyframes}});var u=el;Object.defineProperty(e,"GlobalStyles",{enumerable:!0,get:function(){return u.GlobalStyles}});var p=wn;Object.defineProperty(e,"getTssDefaultEmotionCache",{enumerable:!0,get:function(){return p.getTssDefaultEmotionCache}}),Object.defineProperty(e,"TssCacheProvider",{enumerable:!0,get:function(){return p.TssCacheProvider}});function m(C){return Object.assign(Object.assign({},(0,n.createMakeStyles)(C)),(0,a.createWithStyles)(C))}e.createMakeAndWithStyles=m})(Hy);var Vi;Object.defineProperty(Ma,"__esModule",{value:!0});Ma.useStyles=Ma.withStyles=Ma.makeStyles=void 0;const oM=yk,iM=Hy;Vi=(0,iM.createMakeAndWithStyles)({useTheme:oM.useTheme}),Ma.makeStyles=Vi.makeStyles,Ma.withStyles=Vi.withStyles,Ma.useStyles=Vi.useStyles;function qy(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t1?r[a-1]:void 0,u=a>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(a--,o):void 0,u&&OM(r[0],r[1],u)&&(o=a<3?void 0:o,a=1),t=Object(t);++n-1&&e%1==0&&e-1&&e%1==0&&e<=Ky}function Jy(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function EM(e){return!!e&&typeof e=="object"}var DM=_M(function(e,t,r,n){$M(t,AM(t),e,n)});function AM(e){return Zc(e)?mM(e):SM(e)}var jM=DM,bs={exports:{}};bs.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",a=9007199254740991,o="[object Arguments]",u="[object Array]",p="[object Boolean]",m="[object Date]",C="[object Error]",A="[object Function]",O="[object GeneratorFunction]",j="[object Map]",B="[object Number]",q="[object Object]",X="[object Promise]",re="[object RegExp]",ve="[object Set]",Se="[object String]",he="[object Symbol]",ee="[object WeakMap]",Ce="[object ArrayBuffer]",Be="[object DataView]",De="[object Float32Array]",it="[object Float64Array]",ze="[object Int8Array]",ft="[object Int16Array]",Zr="[object Int32Array]",ir="[object Uint8Array]",Bn="[object Uint8ClampedArray]",Wn="[object Uint16Array]",zn="[object Uint32Array]",ia=/[\\^$.*+?()[\]{}|]/g,sa=/\w*$/,la=/^\[object .+?Constructor\]$/,ua=/^(?:0|[1-9]\d*)$/,Le={};Le[o]=Le[u]=Le[Ce]=Le[Be]=Le[p]=Le[m]=Le[De]=Le[it]=Le[ze]=Le[ft]=Le[Zr]=Le[j]=Le[B]=Le[q]=Le[re]=Le[ve]=Le[Se]=Le[he]=Le[ir]=Le[Bn]=Le[Wn]=Le[zn]=!0,Le[C]=Le[A]=Le[ee]=!1;var Qe=typeof Oe=="object"&&Oe&&Oe.Object===Object&&Oe,ca=typeof self=="object"&&self&&self.Object===Object&&self,Ie=Qe||ca||Function("return this")(),_n=t&&!t.nodeType&&t,Ne=_n&&!0&&e&&!e.nodeType&&e,Cr=Ne&&Ne.exports===_n;function Gn(s,i){return s.set(i[0],i[1]),s}function $t(s,i){return s.add(i),s}function On(s,i){for(var f=-1,S=s?s.length:0;++f-1}function we(s,i){var f=this.__data__,S=et(f,s);return S<0?f.push([s,i]):f[S][1]=i,this}dt.prototype.clear=pa,dt.prototype.delete=va,dt.prototype.get=ha,dt.prototype.has=z,dt.prototype.set=we;function Ze(s){var i=-1,f=s?s.length:0;for(this.clear();++i-1&&s%1==0&&s-1&&s%1==0&&s<=a}function rr(s){var i=typeof s;return!!s&&(i=="object"||i=="function")}function wr(s){return!!s&&typeof s=="object"}function $r(s){return At(s)?Z(s):at(s)}function Zn(){return[]}function Dn(){return!1}e.exports=cn})(bs,bs.exports);var kM=bs.exports,Ss={exports:{}};Ss.exports;(function(e,t){var r=200,n="Expected a function",a="__lodash_hash_undefined__",o=1,u=2,p=1/0,m=9007199254740991,C=17976931348623157e292,A=NaN,O="[object Arguments]",j="[object Array]",B="[object Boolean]",q="[object Date]",X="[object Error]",re="[object Function]",ve="[object GeneratorFunction]",Se="[object Map]",he="[object Number]",ee="[object Object]",Ce="[object Promise]",Be="[object RegExp]",De="[object Set]",it="[object String]",ze="[object Symbol]",ft="[object WeakMap]",Zr="[object ArrayBuffer]",ir="[object DataView]",Bn="[object Float32Array]",Wn="[object Float64Array]",zn="[object Int8Array]",ia="[object Int16Array]",sa="[object Int32Array]",la="[object Uint8Array]",ua="[object Uint8ClampedArray]",Le="[object Uint16Array]",Qe="[object Uint32Array]",ca=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ie=/^\w*$/,_n=/^\./,Ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Cr=/[\\^$.*+?()[\]{}|]/g,Gn=/^\s+|\s+$/g,$t=/\\(\\)?/g,On=/^[-+]0x[0-9a-f]+$/i,It=/^0b[01]+$/i,en=/^\[object .+?Constructor\]$/,tn=/^0o[0-7]+$/i,qn=/^(?:0|[1-9]\d*)$/,ke={};ke[Bn]=ke[Wn]=ke[zn]=ke[ia]=ke[sa]=ke[la]=ke[ua]=ke[Le]=ke[Qe]=!0,ke[O]=ke[j]=ke[Zr]=ke[B]=ke[ir]=ke[q]=ke[X]=ke[re]=ke[Se]=ke[he]=ke[ee]=ke[Be]=ke[De]=ke[it]=ke[ft]=!1;var Kn=parseInt,rn=typeof Oe=="object"&&Oe&&Oe.Object===Object&&Oe,Vn=typeof self=="object"&&self&&self.Object===Object&&self,sr=rn||Vn||Function("return this")(),Yn=t&&!t.nodeType&&t,lr=Yn&&!0&&e&&!e.nodeType&&e,Hr=lr&&lr.exports===Yn,Ir=Hr&&rn.process,Mt=function(){try{return Ir&&Ir.binding("util")}catch{}}(),Lt=Mt&&Mt.isTypedArray;function Ur(d,w){for(var F=-1,V=d?d.length:0;++F-1}function tr(d,w){var F=this.__data__,V=Dr(F,d);return V<0?F.push([d,w]):F[V][1]=w,this}nt.prototype.clear=dr,nt.prototype.delete=pr,nt.prototype.get=Rt,nt.prototype.has=Z,nt.prototype.set=tr;function et(d){var w=-1,F=d?d.length:0;for(this.clear();++w-1?ge[oe?w[Ee]:Ee]:void 0}}function Dt(d,w,F,V,ge,oe){var Ee=ge&u,St=d.length,Ot=w.length;if(St!=Ot&&!(Ee&&Ot>St))return!1;var Kt=oe.get(d);if(Kt&&oe.get(w))return Kt==w;var ar=-1,Vt=!0,Yt=ge&o?new Pe:void 0;for(oe.set(d,w),oe.set(w,d);++ar-1&&d%1==0&&d-1&&d%1==0&&d<=m}function bt(d){var w=typeof d;return!!d&&(w=="object"||w=="function")}function nr(d){return!!d&&typeof d=="object"}function Ar(d){return typeof d=="symbol"||nr(d)&&Ht.call(d)==ze}var An=Lt?nn(Lt):En;function Ia(d){if(!d)return d===0?d:0;if(d=Pi(d),d===p||d===-p){var w=d<0?-1:1;return w*C}return d===d?d:0}function Pa(d){var w=Ia(d),F=w%1;return w===w?F?w-F:w:0}function Pi(d){if(typeof d=="number")return d;if(Ar(d))return A;if(bt(d)){var w=typeof d.valueOf=="function"?d.valueOf():d;d=bt(w)?w+"":w}if(typeof d!="string")return d===0?d:+d;d=d.replace(Gn,"");var F=It.test(d);return F||tn.test(d)?Kn(d.slice(2),F?2:8):On.test(d)?A:+d}function jo(d){return d==null?"":un(d)}function Ri(d,w,F){var V=d==null?void 0:Kr(d,w);return V===void 0?F:V}function ml(d,w){return d!=null&&fn(d,w,Rn)}function ao(d){return Ue(d)?_t(d):ga(d)}function bl(d){return d}function Sl(d){return wr(d)?Br(S(d)):I(d)}e.exports=ae})(Ss,Ss.exports);var MM=Ss.exports,ws={exports:{}};ws.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",a=1,o=2,u=9007199254740991,p="[object Arguments]",m="[object Array]",C="[object AsyncFunction]",A="[object Boolean]",O="[object Date]",j="[object Error]",B="[object Function]",q="[object GeneratorFunction]",X="[object Map]",re="[object Number]",ve="[object Null]",Se="[object Object]",he="[object Promise]",ee="[object Proxy]",Ce="[object RegExp]",Be="[object Set]",De="[object String]",it="[object Symbol]",ze="[object Undefined]",ft="[object WeakMap]",Zr="[object ArrayBuffer]",ir="[object DataView]",Bn="[object Float32Array]",Wn="[object Float64Array]",zn="[object Int8Array]",ia="[object Int16Array]",sa="[object Int32Array]",la="[object Uint8Array]",ua="[object Uint8ClampedArray]",Le="[object Uint16Array]",Qe="[object Uint32Array]",ca=/[\\^$.*+?()[\]{}|]/g,Ie=/^\[object .+?Constructor\]$/,_n=/^(?:0|[1-9]\d*)$/,Ne={};Ne[Bn]=Ne[Wn]=Ne[zn]=Ne[ia]=Ne[sa]=Ne[la]=Ne[ua]=Ne[Le]=Ne[Qe]=!0,Ne[p]=Ne[m]=Ne[Zr]=Ne[A]=Ne[ir]=Ne[O]=Ne[j]=Ne[B]=Ne[X]=Ne[re]=Ne[Se]=Ne[Ce]=Ne[Be]=Ne[De]=Ne[ft]=!1;var Cr=typeof Oe=="object"&&Oe&&Oe.Object===Object&&Oe,Gn=typeof self=="object"&&self&&self.Object===Object&&self,$t=Cr||Gn||Function("return this")(),On=t&&!t.nodeType&&t,It=On&&!0&&e&&!e.nodeType&&e,en=It&&It.exports===On,tn=en&&Cr.process,qn=function(){try{return tn&&tn.binding&&tn.binding("util")}catch{}}(),ke=qn&&qn.isTypedArray;function Kn(s,i){for(var f=-1,S=s==null?0:s.length,W=0,G=[];++f-1}function ln(s,i){var f=this.__data__,S=Bt(f,s);return S<0?(++this.size,f.push([s,i])):f[S][1]=i,this}Ze.prototype.clear=er,Ze.prototype.delete=mt,Ze.prototype.get=cr,Ze.prototype.has=sn,Ze.prototype.set=ln;function Fe(s){var i=-1,f=s==null?0:s.length;for(this.clear();++ise))return!1;var ce=G.get(s);if(ce&&G.get(i))return ce==i;var Re=-1,Ue=!0,Ye=f&o?new Z:void 0;for(G.set(s,i),G.set(i,s);++Re-1&&s%1==0&&s-1&&s%1==0&&s<=u}function fn(s){var i=typeof s;return s!=null&&(i=="object"||i=="function")}function rr(s){return s!=null&&typeof s=="object"}var wr=ke?Yn(ke):_t;function $r(s){return Sr(s)?at(s):Dr(s)}function Zn(){return[]}function Dn(){return!1}e.exports=ct})(ws,ws.exports);var LM=ws.exports;function NM(e){return e===void 0}var FM=NM,$s={exports:{}};$s.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",a=800,o=16,u=9007199254740991,p="[object Arguments]",m="[object Array]",C="[object AsyncFunction]",A="[object Boolean]",O="[object Date]",j="[object Error]",B="[object Function]",q="[object GeneratorFunction]",X="[object Map]",re="[object Number]",ve="[object Null]",Se="[object Object]",he="[object Proxy]",ee="[object RegExp]",Ce="[object Set]",Be="[object String]",De="[object Undefined]",it="[object WeakMap]",ze="[object ArrayBuffer]",ft="[object DataView]",Zr="[object Float32Array]",ir="[object Float64Array]",Bn="[object Int8Array]",Wn="[object Int16Array]",zn="[object Int32Array]",ia="[object Uint8Array]",sa="[object Uint8ClampedArray]",la="[object Uint16Array]",ua="[object Uint32Array]",Le=/[\\^$.*+?()[\]{}|]/g,Qe=/^\[object .+?Constructor\]$/,ca=/^(?:0|[1-9]\d*)$/,Ie={};Ie[Zr]=Ie[ir]=Ie[Bn]=Ie[Wn]=Ie[zn]=Ie[ia]=Ie[sa]=Ie[la]=Ie[ua]=!0,Ie[p]=Ie[m]=Ie[ze]=Ie[A]=Ie[ft]=Ie[O]=Ie[j]=Ie[B]=Ie[X]=Ie[re]=Ie[Se]=Ie[ee]=Ie[Ce]=Ie[Be]=Ie[it]=!1;var _n=typeof Oe=="object"&&Oe&&Oe.Object===Object&&Oe,Ne=typeof self=="object"&&self&&self.Object===Object&&self,Cr=_n||Ne||Function("return this")(),Gn=t&&!t.nodeType&&t,$t=Gn&&!0&&e&&!e.nodeType&&e,On=$t&&$t.exports===Gn,It=On&&_n.process,en=function(){try{var i=$t&&$t.require&&$t.require("util").types;return i||It&&It.binding&&It.binding("util")}catch{}}(),tn=en&&en.isTypedArray;function qn(i,f,S){switch(S.length){case 0:return i.call(f);case 1:return i.call(f,S[0]);case 2:return i.call(f,S[0],S[1]);case 3:return i.call(f,S[0],S[1],S[2])}return i.apply(f,S)}function ke(i,f){for(var S=-1,W=Array(i);++S-1}function on(i,f){var S=this.__data__,W=nt(S,i);return W<0?(++this.size,S.push([i,f])):S[W][1]=f,this}Ut.prototype.clear=Zt,Ut.prototype.delete=qr,Ut.prototype.get=In,Ut.prototype.has=Pn,Ut.prototype.set=on;function xt(i){var f=-1,S=i==null?0:i.length;for(this.clear();++f1?S[G-1]:void 0,se=G>2?S[2]:void 0;for(ae=i.length>3&&typeof ae=="function"?(G--,ae):void 0,se&&Qn(S[0],S[1],se)&&(ae=G<3?void 0:ae,G=1),f=Object(f);++W-1&&i%1==0&&i0){if(++f>=a)return arguments[0]}else f=0;return i.apply(void 0,arguments)}}function $(i){if(i!=null){try{return Ir.call(i)}catch{}try{return i+""}catch{}}return""}function I(i,f){return i===f||i!==i&&f!==f}var un=Z(function(){return arguments}())?Z:function(i){return jt(i)&&Mt.call(i,"callee")&&!da.call(i,"callee")},Ve=Array.isArray;function cn(i){return i!=null&&At(i.length)&&!Sr(i)}function Dt(i){return jt(i)&&cn(i)}var vr=mr||s;function Sr(i){if(!ct(i))return!1;var f=Rt(i);return f==B||f==q||f==C||f==he}function At(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=u}function ct(i){var f=typeof i;return i!=null&&(f=="object"||f=="function")}function jt(i){return i!=null&&typeof i=="object"}function qt(i){if(!jt(i)||Rt(i)!=Se)return!1;var f=Wr(i);if(f===null)return!0;var S=Mt.call(f,"constructor")&&f.constructor;return typeof S=="function"&&S instanceof S&&Ir.call(S)==fa}var fn=tn?Kn(tn):et;function rr(i){return Wt(i,wr(i))}function wr(i){return cn(i)?ln(i):Ge(i)}var $r=tt(function(i,f,S){k(i,f,S)});function Zn(i){return function(){return i}}function Dn(i){return i}function s(){return!1}e.exports=$r})($s,$s.exports);var HM=$s.exports,UM=Tr,BM=Ta,WM=wt,zM=WM("match"),GM=function(e){var t;return UM(e)&&((t=e[zM])!==void 0?!!t:BM(e)==="RegExp")},qM=GM,KM=TypeError,VM=function(e){if(qM(e))throw new KM("The method doesn't accept regular expressions");return e},YM=wt,XM=YM("match"),JM=function(e){var t=/./;try{"/./"[e](t)}catch{try{return t[XM]=!1,"/./"[e](t)}catch{}}return!1},QM=be,ZM=Es,eL=Mc,kp=xr,tL=VM,rL=Ha,nL=JM,aL=ZM("".slice),oL=Math.min,iL=nL("startsWith");QM({target:"String",proto:!0,forced:!iL},{startsWith:function(t){var r=kp(rL(this));tL(t);var n=eL(oL(arguments.length>1?arguments[1]:void 0,r.length)),a=kp(t);return aL(r,n,n+a.length)===a}});var sL=gr,lL=sL("String","startsWith"),uL=kt,cL=lL,xu=String.prototype,fL=function(e){var t=e.startsWith;return typeof e=="string"||e===xu||uL(xu,e)&&t===xu.startsWith?cL:t},dL=fL,pL=dL,vL=pL;const hL=je(gS),gL=je(yS);var yL=iy;const mL=je(mS),bL=je(bS),SL=je(SS),wL=je(wS);var nl={},$L=La;Object.defineProperty(nl,"__esModule",{value:!0});var _L=nl.default=void 0,OL=$L(Fa()),TL=Na;_L=nl.default=(0,OL.default)((0,TL.jsx)("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"}),"KeyboardArrowRight");var al={},xL=La;Object.defineProperty(al,"__esModule",{value:!0});var CL=al.default=void 0,IL=xL(Fa()),PL=Na;CL=al.default=(0,IL.default)((0,PL.jsx)("path",{d:"M19 13H5v-2h14z"}),"Remove");var ef=` +\v\f\r                 \u2028\u2029\uFEFF`,RL=Ke,EL=Ha,DL=xr,hc=ef,Mp=RL("".replace),AL=RegExp("^["+hc+"]+"),jL=RegExp("(^|[^"+hc+"])["+hc+"]+$"),kL=function(e){return function(t){var r=DL(EL(t));return e&1&&(r=Mp(r,AL,"")),e&2&&(r=Mp(r,jL,"$1")),r}},Qy={trim:kL(3)},ML=Mg.PROPER,LL=Xe,Lp=ef,Np="​…᠎",NL=function(e){return LL(function(){return!!Lp[e]()||Np[e]()!==Np||ML&&Lp[e].name!==e})},FL=be,HL=Qy.trim,UL=NL;FL({target:"String",proto:!0,forced:UL("trim")},{trim:function(){return HL(this)}});var BL=gr,WL=BL("String","trim"),zL=kt,GL=WL,Cu=String.prototype,qL=function(e){var t=e.trim;return typeof e=="string"||e===Cu||zL(Cu,e)&&t===Cu.trim?GL:t},KL=qL,VL=KL,YL=VL,XL=be,JL=Ke,QL=Ms,ZL=RangeError,Fp=String.fromCharCode,Hp=String.fromCodePoint,e2=JL([].join),t2=!!Hp&&Hp.length!==1;XL({target:"String",stat:!0,forced:t2},{fromCodePoint:function(t){for(var r=[],n=arguments.length,a=0,o;n>a;){if(o=+arguments[a++],QL(o,1114111)!==o)throw new ZL(o+" is not a valid code point");r[a]=o<65536?Fp(o):Fp(((o-=65536)>>10)+55296,o%1024+56320)}return e2(r,"")}});var Up=gt,r2=Tt,n2=Object.getOwnPropertyDescriptor,a2=function(e){if(!r2)return Up[e];var t=n2(Up,e);return t&&t.value},o2=Xe,i2=wt,s2=Tt,Bp=Aw,l2=i2("iterator"),ol=!o2(function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach(function(a,o){t.delete("b"),n+=o+a}),r.delete("a",2),r.delete("b",void 0),Bp&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(Bp||!s2)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[l2]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||n!=="a1c3"||new URL("https://x",void 0).host!=="x"}),u2=to,c2=function(e,t,r){for(var n in t)r&&r.unsafe&&e[n]?e[n]=t[n]:u2(e,n,t[n],r);return e},f2=kt,d2=TypeError,Zy=function(e,t){if(f2(t,e))return e;throw new d2("Incorrect invocation")},p2=TypeError,Ci=function(e,t){if(e0&&e&r;r>>=1)t++;return t},F2=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(e[0]&31)<<6|e[1]&63;break;case 3:t=(e[0]&15)<<12|(e[1]&63)<<6|e[2]&63;break;case 4:t=(e[0]&7)<<18|(e[1]&63)<<12|(e[2]&63)<<6|e[3]&63;break}return t>1114111?null:t},Jp=function(e){e=sm(e,M2," ");for(var t=e.length,r="",n=0;nt){r+="%",n++;continue}var o=Xp(e,n+1);if(o!==o){r+=a,n++;continue}n+=2;var u=N2(o);if(u===0)a=E2(o);else{if(u===1||u>4){r+=Ru,n++;continue}for(var p=[o],m=1;mt||as(e,n)!=="%"));){var C=Xp(e,n+1);if(C!==C){n+=3;break}if(C>191||C<128)break;Aa(p,C),n+=2,m++}if(p.length!==u){r+=Ru;continue}var A=F2(p);A===null?r+=Ru:a=D2(A)}}r+=a,n++}return r},H2=/[!'()~]|%20/g,U2={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},B2=function(e){return U2[e]},Qp=function(e){return sm(R2(e),H2,B2)},Eu=m2(function(t,r){im(this,{type:om,target:mn(t).entries,index:0,kind:r})},Do,function(){var t=I2(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=null,Xi(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Xi(a.key,!1);case"values":return Xi(a.value,!1)}return Xi([a.key,a.value],!1)},!0),um=function(e){this.entries=[],this.url=null,e!==void 0&&(am(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?as(e,0)==="?"?lm(e,1):e:Or(e)))};um.prototype={type:Do,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=O2(e),n,a,o,u,p,m,C;if(r)for(n=zp(e,r),a=n.next;!(o=Yi(a,n)).done;){if(u=zp($2(o.value)),p=u.next,(m=Yi(p,u)).done||(C=Yi(p,u)).done||!Yi(p,u).done)throw new P2("Expected sequence with length 2");Aa(t,{key:Or(m.value),value:Or(C.value)})}else for(var A in e)b2(e,A)&&Aa(t,{key:A,value:Or(e[A])})},parseQuery:function(e){if(e)for(var t=this.entries,r=Yp(e,"&"),n=0,a,o;n0?arguments[0]:void 0,r=im(this,new um(t));Vo||(this.size=r.entries.length)},wo=il.prototype;g2(wo,{append:function(t,r){var n=mn(this);fo(arguments.length,2),Aa(n.entries,{key:Or(t),value:Or(r)}),Vo||this.length++,n.updateURL()},delete:function(e){for(var t=mn(this),r=fo(arguments.length,1),n=t.entries,a=Or(e),o=r<2?void 0:arguments[1],u=o===void 0?o:Or(o),p=0;pn.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=mn(this).entries,n=S2(t,arguments.length>1?arguments[1]:void 0),a=0,o;a1?Zp(arguments[1]):{})}}),Iu(_s)){var Du=function(t){return nm(this,Pu),new _s(t,arguments.length>1?Zp(arguments[1]):{})};Pu.constructor=Du,Du.prototype=Pu,gc({global:!0,dontCallGetSet:!0,forced:!0},{Request:Du})}}var G2={URLSearchParams:il,getState:mn},no=Ke,Au=2147483647,Xo=36,cm=1,yc=26,q2=38,K2=700,V2=72,Y2=128,X2="-",J2=/[^\0-\u007E]/,fm=/[.\u3002\uFF0E\uFF61]/g,ev="Overflow: input needs wider integers to process",ju=Xo-cm,tv=RangeError,Q2=no(fm.exec),yo=Math.floor,ku=String.fromCharCode,rv=no("".charCodeAt),dm=no([].join),ja=no([].push),Z2=no("".replace),eN=no("".split),tN=no("".toLowerCase),rN=function(e){for(var t=[],r=0,n=e.length;r=55296&&a<=56319&&r>1,e+=yo(e/t);e>ju*yc>>1;)e=yo(e/ju),n+=Xo;return yo(n+(ju+1)*e/(e+q2))},aN=function(e){var t=[];e=rN(e);var r=e.length,n=Y2,a=0,o=V2,u,p;for(u=0;u=n&&pyo((Au-a)/O))throw new tv(ev);for(a+=(A-n)*O,n=A,u=0;uAu)throw new tv(ev);if(p===n){for(var j=a,B=Xo;;){var q=B<=o?cm:B>=o+yc?yc:B-o;if(j?@[\\\]^|]/,IN=/[\0\t\n\r #/:<>?@[\\\]^|]/,PN=/^[\u0000-\u0020]+/,RN=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,EN=/[\t\n\r]/g,hn,DN=function(e){var t=SN(e,"."),r,n,a,o,u,p,m;if(t.length&&t[t.length-1]===""&&t.length--,r=t.length,r>4)return e;for(n=[],a=0;a1&&bn(o,0)==="0"&&(u=Ln(ON,o)?16:8,o=Jo(o,u===8?1:2)),o==="")p=0;else{if(!Ln(u===10?xN:u===8?TN:gm,o))return e;p=xs(o,u)}ho(n,p)}for(a=0;a=ov(256,5-r))return null}else if(p>255)return null;for(m=mN(n),a=0;a6))return;for(p=0;j();){if(m=null,p>0)if(j()==="."&&p<4)a++;else return;if(!Ln(Sc,j()))return;for(;Ln(Sc,j());){if(C=xs(j(),10),m===null)m=C;else{if(m===0)return;m=m*10+C}if(m>255)return;a++}t[r]=t[r]*256+m,p++,(p===2||p===4)&&r++}if(p!==4)return;break}else if(j()===":"){if(a++,!j())return}else if(j())return;t[r++]=o}if(n!==null)for(A=r-n,r=7;r!==0&&A>0;)O=t[r],t[r--]=t[n+A-1],t[n+--A]=O;else if(r!==8)return;return t},jN=function(e){for(var t=null,r=1,n=null,a=0,o=0;o<8;o++)e[o]!==0?(a>r&&(t=n,r=a),n=null,a=0):(n===null&&(n=o),++a);return a>r?n:t},Wo=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)wN(t,e%256),e=gN(e/256);return qo(t,".")}if(typeof e=="object"){for(t="",n=jN(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=yN(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},os={},ym=of({},os,{" ":1,'"':1,"<":1,">":1,"`":1}),mm=of({},ym,{"#":1,"?":1,"{":1,"}":1}),Nu=of({},mm,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ea=function(e,t){var r=uN(e,0);return r>32&&r<127&&!mc(t,e)?e:encodeURIComponent(e)},Ji={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Ko=function(e,t){var r;return e.length===2&&Ln(hm,bn(e,0))&&((r=bn(e,1))===":"||!t&&r==="|")},sv=function(e){var t;return e.length>1&&Ko(Jo(e,0,2))&&(e.length===2||(t=bn(e,2))==="/"||t==="\\"||t==="?"||t==="#")},kN=function(e){return e==="."||Cs(e)==="%2e"},MN=function(e){return e=Cs(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Fu={},lv={},Hu={},uv={},cv={},Uu={},fv={},dv={},Qi={},Zi={},Bu={},Wu={},zu={},Gu={},pv={},qu={},vo={},na={},vv={},Ka={},wa={},sf=function(e,t,r){var n=$a(e),a,o,u;if(t){if(o=this.parse(n),o)throw new bc(o);this.searchParams=null}else{if(r!==void 0&&(a=new sf(r,!0)),o=this.parse(n,null,a),o)throw new bc(o);u=hN(new vN),u.bindURL(this),this.searchParams=u}};sf.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Fu,o=0,u="",p=!1,m=!1,C=!1,A,O,j,B;for(e=$a(e),t||(n.scheme="",n.username="",n.password="",n.host=null,n.port=null,n.path=[],n.query=null,n.fragment=null,n.cannotBeABaseURL=!1,e=Mu(e,PN,""),e=Mu(e,RN,"$1")),e=Mu(e,EN,""),A=po(e);o<=A.length;){switch(O=A[o],a){case Fu:if(O&&Ln(hm,O))u+=Cs(O),a=lv;else{if(t)return Lu;a=Hu;continue}break;case lv:if(O&&(Ln(_N,O)||O==="+"||O==="-"||O==="."))u+=Cs(O);else if(O===":"){if(t&&(n.isSpecial()!==mc(Ji,u)||u==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=u,t){n.isSpecial()&&Ji[n.scheme]===n.port&&(n.port=null);return}u="",n.scheme==="file"?a=Gu:n.isSpecial()&&r&&r.scheme===n.scheme?a=uv:n.isSpecial()?a=dv:A[o+1]==="/"?(a=cv,o++):(n.cannotBeABaseURL=!0,ho(n.path,""),a=vv)}else{if(t)return Lu;u="",a=Hu,o=0;continue}break;case Hu:if(!r||r.cannotBeABaseURL&&O!=="#")return Lu;if(r.cannotBeABaseURL&&O==="#"){n.scheme=r.scheme,n.path=kn(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=wa;break}a=r.scheme==="file"?Gu:Uu;continue;case uv:if(O==="/"&&A[o+1]==="/")a=Qi,o++;else{a=Uu;continue}break;case cv:if(O==="/"){a=Zi;break}else{a=na;continue}case Uu:if(n.scheme=r.scheme,O===hn)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=kn(r.path),n.query=r.query;else if(O==="/"||O==="\\"&&n.isSpecial())a=fv;else if(O==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=kn(r.path),n.query="",a=Ka;else if(O==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=kn(r.path),n.query=r.query,n.fragment="",a=wa;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=kn(r.path),n.path.length--,a=na;continue}break;case fv:if(n.isSpecial()&&(O==="/"||O==="\\"))a=Qi;else if(O==="/")a=Zi;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=na;continue}break;case dv:if(a=Qi,O!=="/"||bn(u,o+1)!=="/")continue;o++;break;case Qi:if(O!=="/"&&O!=="\\"){a=Zi;continue}break;case Zi:if(O==="@"){p&&(u="%40"+u),p=!0,j=po(u);for(var q=0;q65535)return iv;n.port=n.isSpecial()&&ve===Ji[n.scheme]?null:ve,u=""}if(t)return;a=vo;continue}else return iv;break;case Gu:if(n.scheme="file",O==="/"||O==="\\")a=pv;else if(r&&r.scheme==="file")switch(O){case hn:n.host=r.host,n.path=kn(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=kn(r.path),n.query="",a=Ka;break;case"#":n.host=r.host,n.path=kn(r.path),n.query=r.query,n.fragment="",a=wa;break;default:sv(qo(kn(A,o),""))||(n.host=r.host,n.path=kn(r.path),n.shortenPath()),a=na;continue}else{a=na;continue}break;case pv:if(O==="/"||O==="\\"){a=qu;break}r&&r.scheme==="file"&&!sv(qo(kn(A,o),""))&&(Ko(r.path[0],!0)?ho(n.path,r.path[0]):n.host=r.host),a=na;continue;case qu:if(O===hn||O==="/"||O==="\\"||O==="?"||O==="#"){if(!t&&Ko(u))a=na;else if(u===""){if(n.host="",t)return;a=vo}else{if(B=n.parseHost(u),B)return B;if(n.host==="localhost"&&(n.host=""),t)return;u="",a=vo}continue}else u+=O;break;case vo:if(n.isSpecial()){if(a=na,O!=="/"&&O!=="\\")continue}else if(!t&&O==="?")n.query="",a=Ka;else if(!t&&O==="#")n.fragment="",a=wa;else if(O!==hn&&(a=na,O!=="/"))continue;break;case na:if(O===hn||O==="/"||O==="\\"&&n.isSpecial()||!t&&(O==="?"||O==="#")){if(MN(u)?(n.shortenPath(),O!=="/"&&!(O==="\\"&&n.isSpecial())&&ho(n.path,"")):kN(u)?O!=="/"&&!(O==="\\"&&n.isSpecial())&&ho(n.path,""):(n.scheme==="file"&&!n.path.length&&Ko(u)&&(n.host&&(n.host=""),u=bn(u,0)+":"),ho(n.path,u)),u="",n.scheme==="file"&&(O===hn||O==="?"||O==="#"))for(;n.path.length>1&&n.path[0]==="";)bN(n.path);O==="?"?(n.query="",a=Ka):O==="#"&&(n.fragment="",a=wa)}else u+=Ea(O,mm);break;case vv:O==="?"?(n.query="",a=Ka):O==="#"?(n.fragment="",a=wa):O!==hn&&(n.path[0]+=Ea(O,os));break;case Ka:!t&&O==="#"?(n.fragment="",a=wa):O!==hn&&(O==="'"&&n.isSpecial()?n.query+="%27":O==="#"?n.query+="%23":n.query+=Ea(O,os));break;case wa:O!==hn&&(n.fragment+=Ea(O,ym));break}o++}},parseHost:function(e){var t,r,n;if(bn(e,0)==="["){if(bn(e,e.length-1)!=="]"||(t=AN(Jo(e,1,-1)),!t))return qa;this.host=t}else if(this.isSpecial()){if(e=cN(e),Ln(CN,e)||(t=DN(e),t===null))return qa;this.host=t}else{if(Ln(IN,e))return qa;for(t="",r=po(e),n=0;n1?arguments[1]:void 0,a=pN(r,new sf(t,!1,n));nf||(r.href=a.serialize(),r.origin=a.getOrigin(),r.protocol=a.getProtocol(),r.username=a.getUsername(),r.password=a.getPassword(),r.host=a.getHost(),r.hostname=a.getHostname(),r.port=a.getPort(),r.pathname=a.getPathname(),r.search=a.getSearch(),r.searchParams=a.getSearchParams(),r.hash=a.getHash())},_r=$o.prototype,gn=function(e,t){return{get:function(){return Ts(this)[e]()},set:t&&function(r){return Ts(this)[t](r)},configurable:!0,enumerable:!0}};nf&&(vn(_r,"href",gn("serialize","setHref")),vn(_r,"origin",gn("getOrigin")),vn(_r,"protocol",gn("getProtocol","setProtocol")),vn(_r,"username",gn("getUsername","setUsername")),vn(_r,"password",gn("getPassword","setPassword")),vn(_r,"host",gn("getHost","setHost")),vn(_r,"hostname",gn("getHostname","setHostname")),vn(_r,"port",gn("getPort","setPort")),vn(_r,"pathname",gn("getPathname","setPathname")),vn(_r,"search",gn("getSearch","setSearch")),vn(_r,"searchParams",gn("getSearchParams")),vn(_r,"hash",gn("getHash","setHash")));Os(_r,"toJSON",function(){return Ts(this).serialize()},{enumerable:!0});Os(_r,"toString",function(){return Ts(this).serialize()},{enumerable:!0});if(Bo){var hv=Bo.createObjectURL,gv=Bo.revokeObjectURL;hv&&Os($o,"createObjectURL",av(hv,Bo)),gv&&Os($o,"revokeObjectURL",av(gv,Bo))}fN($o,"URL");iN({global:!0,forced:!sN,sham:!nf},{URL:$o});var LN=be,NN=Nr,bm=Xe,FN=Ci,yv=xr,HN=ol,lf=NN("URL"),UN=HN&&bm(function(){lf.canParse()}),BN=bm(function(){return lf.canParse.length!==1});LN({target:"URL",stat:!0,forced:!UN||BN},{canParse:function(t){var r=FN(arguments.length,1),n=yv(t),a=r<2||arguments[1]===void 0?void 0:yv(arguments[1]);try{return!!new lf(n,a)}catch{return!1}}});var WN=be,zN=Nr,GN=Ci,mv=xr,qN=ol,KN=zN("URL");WN({target:"URL",stat:!0,forced:!qN},{parse:function(t){var r=GN(arguments.length,1),n=mv(t),a=r<2||arguments[1]===void 0?void 0:mv(arguments[1]);try{return new KN(n,a)}catch{return null}}});var VN=pt,YN=VN.URL,XN=YN,JN=XN,QN=JN;const ZN=je($S),eF=je(_S),tF=je(OS),rF=je(TS),nF=je(xS),aF=je(CS),oF=je(IS),iF=je(PS),sF=je(RS),lF=je(ES),uF=je(DS),cF=je(AS),fF=je(jS),dF=je(kS);var Sm=gt,pF=Xe,vF=Ke,hF=xr,gF=Qy.trim,bv=ef,Qo=Sm.parseInt,Sv=Sm.Symbol,wv=Sv&&Sv.iterator,wm=/^[+-]?0x/i,yF=vF(wm.exec),mF=Qo(bv+"08")!==8||Qo(bv+"0x16")!==22||wv&&!pF(function(){Qo(Object(wv))}),bF=mF?function(t,r){var n=gF(hF(t));return Qo(n,r>>>0||(yF(wm,n)?16:10))}:Qo,SF=be,$v=bF;SF({global:!0,forced:parseInt!==$v},{parseInt:$v});var wF=pt,$F=wF.parseInt,_F=$F,OF=_F,TF=OF;const xF=je(MS),CF=je(LS);var $m={exports:{}},_m={exports:{}};(function(e){var t=Pg;function r(n){if(t(n))return n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(_m);var IF=_m.exports,Om={exports:{}},PF=be,RF=Fr,EF=xa,DF=jy,AF=qc,jF=Xe,kF=jF(function(){return[].push.call({length:4294967296},1)!==4294967297}),MF=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}},LF=kF||!MF();PF({target:"Array",proto:!0,forced:LF},{push:function(t){var r=RF(this),n=EF(r),a=arguments.length;AF(n+a);for(var o=0;or,u=tH(n)?n:iH(n),p=o?aH(arguments,r):[],m=o?function(){eH(u,this,p)}:u;return t?e(m,a):e(m)}:e},lH=be,Im=gt,uH=Cm,_v=uH(Im.setInterval,!0);lH({global:!0,bind:!0,forced:Im.setInterval!==_v},{setInterval:_v});var cH=be,Pm=gt,fH=Cm,Ov=fH(Pm.setTimeout,!0);cH({global:!0,bind:!0,forced:Pm.setTimeout!==Ov},{setTimeout:Ov});var dH=pt,pH=dH.setTimeout,vH=pH,sl={},hH=La;Object.defineProperty(sl,"__esModule",{value:!0});sl.default=void 0;var gH=hH(Fa()),yH=Na;sl.default=(0,gH.default)((0,yH.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}),"Help");const mH=je(FS);var bH=be,SH=Dy.entries;bH({target:"Object",stat:!0},{entries:function(t){return SH(t)}});var wH=pt,$H=wH.Object.entries,_H=$H,OH=_H,TH=OH,Sn;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Sn||(Sn={}));function ue(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),a=2;a-1})}var RH={type:uf,payload:{clientOffset:null,sourceClientOffset:null}};function EH(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},a=n.publishSource,o=a===void 0?!0:a,u=n.clientOffset,p=n.getSourceClientOffset,m=e.getMonitor(),C=e.getRegistry();e.dispatch(Tv(u)),DH(r,m,C);var A=kH(r,m);if(A===null){e.dispatch(RH);return}var O=null;if(u){if(!p)throw new Error("getSourceClientOffset must be defined");AH(p),O=p(A)}e.dispatch(Tv(u,O));var j=C.getSource(A),B=j.beginDrag(m,A);jH(B),C.pinSource(A);var q=C.getSourceType(A);return{type:ll,payload:{itemType:q,item:B,sourceId:A,clientOffset:u||null,sourceClientOffset:O||null,isSourcePublic:!!o}}}}function DH(e,t,r){ue(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){ue(r.getSource(n),"Expected sourceIds to be registered.")})}function AH(e){ue(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function jH(e){ue(Rm(e),"Item must be an object.")}function kH(e,t){for(var r=null,n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function MH(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:cf}}}function wc(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function LH(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.clientOffset;NH(r);var o=r.slice(0),u=e.getMonitor(),p=e.getRegistry();FH(o,u,p);var m=u.getItemType();return HH(o,p,m),UH(o,u,p),{type:ul,payload:{targetIds:o,clientOffset:a||null}}}}function NH(e){ue(Array.isArray(e),"Expected targetIds to be an array.")}function FH(e,t,r){ue(t.isDragging(),"Cannot call hover while not dragging."),ue(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n=0;n--){var a=e[n],o=t.getTargetType(a);wc(o,r)||e.splice(n,1)}}function UH(e,t,r){e.forEach(function(n){var a=r.getTarget(n);a.hover(t,n)})}function xv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Cv(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),a=e.getRegistry();zH(n);var o=KH(n);o.forEach(function(u,p){var m=GH(u,p,a,n),C={type:cl,payload:{dropResult:Cv(Cv({},r),m)}};e.dispatch(C)})}}function zH(e){ue(e.isDragging(),"Cannot call drop while not dragging."),ue(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function GH(e,t,r,n){var a=r.getTarget(e),o=a?a.drop(n,e):void 0;return qH(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function qH(e){ue(typeof e>"u"||Rm(e),"Drop result must either be an object or undefined.")}function KH(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function VH(e){return function(){var r=e.getMonitor(),n=e.getRegistry();YH(r);var a=r.getSourceId();if(a!=null){var o=n.getSource(a,!0);o.endDrag(r,a),n.unpinSource()}return{type:fl}}}function YH(e){ue(e.isDragging(),"Cannot call endDrag while not dragging.")}function XH(e){return{beginDrag:EH(e),publishDragSource:MH(e),hover:LH(e),drop:WH(e),endDrag:VH(e)}}var JH=function(t,r){return t===r};function QH(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function ZH(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:JH;if(e.length!==t.length)return!1;for(var n=0;n0&&arguments[0]!==void 0?arguments[0]:Rv,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case uf:case ll:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case ul:return QH(e.clientOffset,r.clientOffset)?e:Pv(Pv({},e),{},{clientOffset:r.clientOffset});case fl:case cl:return Rv;default:return e}}var ff="dnd-core/ADD_SOURCE",df="dnd-core/ADD_TARGET",pf="dnd-core/REMOVE_SOURCE",dl="dnd-core/REMOVE_TARGET";function rU(e){return{type:ff,payload:{sourceId:e}}}function nU(e){return{type:df,payload:{targetId:e}}}function aU(e){return{type:pf,payload:{sourceId:e}}}function oU(e){return{type:dl,payload:{targetId:e}}}function Ev(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function yn(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:sU,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case ll:return yn(yn({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case cf:return yn(yn({},e),{},{isSourcePublic:!0});case ul:return yn(yn({},e),{},{targetIds:r.targetIds});case dl:return e.targetIds.indexOf(r.targetId)===-1?e:yn(yn({},e),{},{targetIds:CH(e.targetIds,r.targetId)});case cl:return yn(yn({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case fl:return yn(yn({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function uU(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ff:case df:return e+1;case pf:case dl:return e-1;default:return e}}var Is=[],vf=[];Is.__IS_NONE__=!0;vf.__IS_ALL__=!0;function cU(e,t){if(e===Is)return!1;if(e===vf||typeof t>"u")return!0;var r=PH(t,e);return r.length>0}function fU(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case ul:break;case ff:case df:case dl:case pf:return Is;case ll:case cf:case fl:case cl:default:return vf}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,a=t.prevTargetIds,o=a===void 0?[]:a,u=IH(n,o),p=u.length>0||!ZH(n,o);if(!p)return Is;var m=o[o.length-1],C=n[n.length-1];return m!==C&&(m&&u.push(m),C&&u.push(C)),u}function dU(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function Dv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Av(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:fU(e.dirtyHandlerIds,{type:t.type,payload:Av(Av({},t.payload),{},{prevTargetIds:xH(e,"dragOperation.targetIds",[])})}),dragOffset:tU(e.dragOffset,t),refCount:uU(e.refCount,t),dragOperation:lU(e.dragOperation,t),stateId:dU(e.stateId)}}function hU(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Em(e,t){return{x:e.x-t.x,y:e.y-t.y}}function gU(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:Em(hU(t,n),r)}function yU(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:Em(t,r)}function mU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bU(e,t){for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=a.handlerIds;ue(typeof r=="function","listener must be a function."),ue(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");var u=this.store.getState().stateId,p=function(){var C=n.store.getState(),A=C.stateId;try{var O=A===u||A===u+1&&!cU(C.dirtyHandlerIds,o);O||r()}finally{u=A}};return this.store.subscribe(p)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;ue(typeof r=="function","listener must be a function.");var a=this.store.getState().dragOffset,o=function(){var p=n.store.getState().dragOffset;p!==a&&(a=p,r())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return ue(n,"Expected to find a valid source."),this.isDragging()?!1:n.canDrag(this,r)}},{key:"canDropOnTarget",value:function(r){if(!r)return!1;var n=this.registry.getTarget(r);if(ue(n,"Expected to find a valid target."),!this.isDragging()||this.didDrop())return!1;var a=this.registry.getTargetType(r),o=this.getItemType();return wc(a,o)&&n.canDrop(this,r)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r,!0);if(ue(n,"Expected to find a valid source."),!this.isDragging()||!this.isSourcePublic())return!1;var a=this.registry.getSourceType(r),o=this.getItemType();return a!==o?!1:n.isDragging(this,r)}},{key:"isOverTarget",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!r)return!1;var a=n.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(r),u=this.getItemType();if(u&&!wc(o,u))return!1;var p=this.getTargetIds();if(!p.length)return!1;var m=p.indexOf(r);return a?m===p.length-1:m>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return gU(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return yU(this.store.getState().dragOffset)}}]),e}(),$U=0;function _U(){return $U++}function ss(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ss=function(r){return typeof r}:ss=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ss(e)}function OU(e){ue(typeof e.canDrag=="function","Expected canDrag to be a function."),ue(typeof e.beginDrag=="function","Expected beginDrag to be a function."),ue(typeof e.endDrag=="function","Expected endDrag to be a function.")}function TU(e){ue(typeof e.canDrop=="function","Expected canDrop to be a function."),ue(typeof e.hover=="function","Expected hover to be a function."),ue(typeof e.drop=="function","Expected beginDrag to be a function.")}function $c(e,t){if(t&&Array.isArray(e)){e.forEach(function(r){return $c(r,!1)});return}ue(typeof e=="string"||ss(e)==="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const jv=typeof global<"u"?global:self,Dm=jv.MutationObserver||jv.WebKitMutationObserver;function Am(e){return function(){const r=setTimeout(a,0),n=setInterval(a,50);function a(){clearTimeout(r),clearInterval(n),e()}}}function xU(e){let t=1;const r=new Dm(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const CU=typeof Dm=="function"?xU:Am;class IU{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.indexthis.capacity){for(let n=0,a=t.length-this.index;n{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=CU(this.flush),this.requestErrorThrow=Am(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class PU{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class RU{create(t){const r=this.freeTasks,n=r.length?r.pop():new PU(this.onError,a=>r[r.length]=a);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const jm=new IU,EU=new RU(jm.registerPendingError);function DU(e){jm.enqueueTask(EU.create(e))}function AU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jU(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),p;!(n=(p=u.next()).done)&&(r.push(p.value),!(t&&r.length===t));n=!0);}catch(m){a=!0,o=m}finally{try{!n&&u.return!=null&&u.return()}finally{if(a)throw o}}return r}}function HU(e){if(Array.isArray(e))return e}function UU(e){var t=_U().toString();switch(e){case Sn.SOURCE:return"S".concat(t);case Sn.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function Mv(e){switch(e[0]){case"S":return Sn.SOURCE;case"T":return Sn.TARGET;default:ue(!1,"Cannot parse handler ID: ".concat(e))}}function Lv(e,t){var r=e.entries(),n=!1;do{var a=r.next(),o=a.done,u=MU(a.value,2),p=u[1];if(p===t)return!0;n=!!o}while(!n);return!1}var BU=function(){function e(t){AU(this,e),this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}return kU(e,[{key:"addSource",value:function(r,n){$c(r),OU(n);var a=this.addHandler(Sn.SOURCE,r,n);return this.store.dispatch(rU(a)),a}},{key:"addTarget",value:function(r,n){$c(r,!0),TU(n);var a=this.addHandler(Sn.TARGET,r,n);return this.store.dispatch(nU(a)),a}},{key:"containsHandler",value:function(r){return Lv(this.dragSources,r)||Lv(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;ue(this.isSourceId(r),"Expected a valid source ID.");var a=n&&r===this.pinnedSourceId,o=a?this.pinnedSource:this.dragSources.get(r);return o}},{key:"getTarget",value:function(r){return ue(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return ue(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return ue(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=Mv(r);return n===Sn.SOURCE}},{key:"isTargetId",value:function(r){var n=Mv(r);return n===Sn.TARGET}},{key:"removeSource",value:function(r){var n=this;ue(this.getSource(r),"Expected an existing source."),this.store.dispatch(aU(r)),DU(function(){n.dragSources.delete(r),n.types.delete(r)})}},{key:"removeTarget",value:function(r){ue(this.getTarget(r),"Expected an existing target."),this.store.dispatch(oU(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);ue(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){ue(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,a){var o=UU(r);return this.types.set(o,n),r===Sn.SOURCE?this.dragSources.set(o,a):r===Sn.TARGET&&this.dropTargets.set(o,a),o}}]),e}();function WU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zU(e,t){for(var r=0;r0&&arguments[0]!==void 0?arguments[0]:!1;WU(this,e),this.isSetUp=!1,this.handleRefCountChange=function(){var a=t.store.getState().refCount>0;t.backend&&(a&&!t.isSetUp?(t.backend.setup(),t.isSetUp=!0):!a&&t.isSetUp&&(t.backend.teardown(),t.isSetUp=!1))};var n=qU(r);this.store=n,this.monitor=new wU(n,new BU(n)),n.subscribe(this.handleRefCountChange)}return GU(e,[{key:"receiveBackend",value:function(r){this.backend=r}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var r=this,n=this.store.dispatch;function a(u){return function(){for(var p=arguments.length,m=new Array(p),C=0;Ce.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),p;!(n=(p=u.next()).done)&&(r.push(p.value),!(t&&r.length===t));n=!0);}catch(m){a=!0,o=m}finally{try{!n&&u.return!=null&&u.return()}finally{if(a)throw o}}return r}}function ZU(e){if(Array.isArray(e))return e}function e3(e,t){if(e==null)return{};var r=t3(e,t),n,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function t3(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,o;for(o=0;o=0)&&(r[a]=e[a]);return r}var Vu=0,Mm=xe.memo(function(e){var t=e.children,r=e3(e,["children"]),n=r3(r),a=YU(n,2),o=a[0],u=a[1];return xe.useEffect(function(){return u&&Vu++,function(){if(u&&(Vu--,Vu===0)){var p=Lm();p[ls]=null}}},[]),xe.createElement(Ii.Provider,{value:o},t)});Mm.displayName="DndProvider";function r3(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=n3(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}var ls=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");function n3(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lm(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,a=t;return a[ls]||(a[ls]=km(e,t,r,n)),a[ls]}function Lm(){return typeof global<"u"?global:window}var Nm=xe.memo(function(e){var t=e.connect,r=e.src;return xe.useEffect(function(){if(!(typeof Image>"u")){var n=!1,a=new Image;return a.src=r,a.onload=function(){t(a),n=!0},function(){n&&t(null)}}}),null});Nm.displayName="DragPreviewImage";var Qa=typeof window<"u"?xe.useLayoutEffect:xe.useEffect;function aa(e,t,r,n){var a=r?r.call(n,e,t):void 0;if(a!==void 0)return!!a;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var o=Object.keys(e),u=Object.keys(t);if(o.length!==u.length)return!1;for(var p=Object.prototype.hasOwnProperty.bind(t),m=0;me.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),p;!(n=(p=u.next()).done)&&(r.push(p.value),!(t&&r.length===t));n=!0);}catch(m){a=!0,o=m}finally{try{!n&&u.return!=null&&u.return()}finally{if(a)throw o}}return r}}function l3(e){if(Array.isArray(e))return e}function Fm(e,t,r){var n=xe.useState(function(){return t(e)}),a=a3(n,2),o=a[0],u=a[1],p=xe.useCallback(function(){var m=t(e);aa(o,m)||(u(m),r&&r())},[o,e,r]);return Qa(p,[]),[o,p]}function u3(e,t){return p3(e)||d3(e,t)||f3(e,t)||c3()}function c3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f3(e,t){if(e){if(typeof e=="string")return Hv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hv(e,t)}}function Hv(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),p;!(n=(p=u.next()).done)&&(r.push(p.value),!(t&&r.length===t));n=!0);}catch(m){a=!0,o=m}finally{try{!n&&u.return!=null&&u.return()}finally{if(a)throw o}}return r}}function p3(e){if(Array.isArray(e))return e}function Hm(e,t,r){var n=Fm(e,t,r),a=u3(n,2),o=a[0],u=a[1];return Qa(function(){var m=e.getHandlerId();if(m!=null)return e.subscribeToStateChange(u,{handlerIds:[m]})},[e,u]),o}function Um(e,t,r){var n=r.getRegistry(),a=n.addTarget(e,t);return[a,function(){return n.removeTarget(a)}]}function Bm(e,t,r){var n=r.getRegistry(),a=n.addSource(e,t);return[a,function(){return n.removeSource(a)}]}function Ao(){var e=xe.useContext(Ii),t=e.dragDropManager;return ue(t!=null,"Expected drag drop context"),t}function v3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h3(e,t){for(var r=0;r or
. Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),r?xe.cloneElement(e,{ref:function(a){Uv(r,a),Uv(t,a)}}):xe.cloneElement(e,{ref:t})}function m3(e){if(typeof e.type!="string"){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a
, or turn it into a ")+"drag source or a drop target itself.")}}function b3(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!xe.isValidElement(t)){var n=t;return e(n,r),n}var a=t;m3(a);var o=r?function(u){return e(u,r)}:e;return y3(a,o)}}function zm(e){var t={};return Object.keys(e).forEach(function(r){var n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{var a=b3(n);t[r]=function(){return a}}}),t}function us(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?us=function(r){return typeof r}:us=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},us(e)}function _c(e){return e!==null&&us(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function S3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w3(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),p;!(n=(p=u.next()).done)&&(r.push(p.value),!(t&&r.length===t));n=!0);}catch(m){a=!0,o=m}finally{try{!n&&u.return!=null&&u.return()}finally{if(a)throw o}}return r}}function C3(e){if(Array.isArray(e))return e}function cs(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?cs=function(r){return typeof r}:cs=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},cs(e)}function I3(){var e=Ao(),t=xe.useMemo(function(){return new Wm(e)},[e]),r=xe.useMemo(function(){return new Gm(e.getBackend())},[e]);return[t,r]}function P3(e,t,r){var n=Ao(),a=xe.useMemo(function(){return{beginDrag:function(){var u=e.current,p=u.begin,m=u.item;if(p){var C=p(t);return ue(C==null||cs(C)==="object","dragSpec.begin() must either return an object, undefined, or null"),C||m||{}}return m||{}},canDrag:function(){return typeof e.current.canDrag=="boolean"?e.current.canDrag:typeof e.current.canDrag=="function"?e.current.canDrag(t):!0},isDragging:function(u,p){var m=e.current.isDragging;return m?m(t):p===u.getSourceId()},endDrag:function(){var u=e.current.end;u&&u(t.getItem(),t),r.reconnect()}}},[]);Qa(function(){var u=Bm(e.current.item.type,a,n),p=_3(u,2),m=p[0],C=p[1];return t.receiveHandlerId(m),r.receiveHandlerId(m),C},[])}function R3(e,t){return j3(e)||A3(e,t)||D3(e,t)||E3()}function E3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D3(e,t){if(e){if(typeof e=="string")return Wv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wv(e,t)}}function Wv(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),p;!(n=(p=u.next()).done)&&(r.push(p.value),!(t&&r.length===t));n=!0);}catch(m){a=!0,o=m}finally{try{!n&&u.return!=null&&u.return()}finally{if(a)throw o}}return r}}function j3(e){if(Array.isArray(e))return e}function k3(e){var t=xe.useRef(e);t.current=e,ue(e.item!=null,"item must be defined"),ue(e.item.type!=null,"item type must be defined");var r=I3(),n=R3(r,2),a=n[0],o=n[1];P3(t,a,o);var u=Hm(a,t.current.collect||function(){return{}},function(){return o.reconnect()}),p=xe.useMemo(function(){return o.hooks.dragSource()},[o]),m=xe.useMemo(function(){return o.hooks.dragPreview()},[o]);return Qa(function(){o.dragSourceOptions=t.current.options||null,o.reconnect()},[o]),Qa(function(){o.dragPreviewOptions=t.current.previewOptions||null,o.reconnect()},[o]),[u,p,m]}function M3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L3(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),p;!(n=(p=u.next()).done)&&(r.push(p.value),!(t&&r.length===t));n=!0);}catch(m){a=!0,o=m}finally{try{!n&&u.return!=null&&u.return()}finally{if(a)throw o}}return r}}function q3(e){if(Array.isArray(e))return e}function K3(){var e=Ao(),t=xe.useMemo(function(){return new Km(e)},[e]),r=xe.useMemo(function(){return new qm(e.getBackend())},[e]);return[t,r]}function V3(e,t,r){var n=Ao(),a=xe.useMemo(function(){return{canDrop:function(){var u=e.current.canDrop;return u?u(t.getItem(),t):!0},hover:function(){var u=e.current.hover;u&&u(t.getItem(),t)},drop:function(){var u=e.current.drop;if(u)return u(t.getItem(),t)}}},[t]);Qa(function(){var u=Um(e.current.accept,a,n),p=B3(u,2),m=p[0],C=p[1];return t.receiveHandlerId(m),r.receiveHandlerId(m),C},[t,r])}function Y3(e,t){return Z3(e)||Q3(e,t)||J3(e,t)||X3()}function X3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J3(e,t){if(e){if(typeof e=="string")return Gv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gv(e,t)}}function Gv(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),p;!(n=(p=u.next()).done)&&(r.push(p.value),!(t&&r.length===t));n=!0);}catch(m){a=!0,o=m}finally{try{!n&&u.return!=null&&u.return()}finally{if(a)throw o}}return r}}function Z3(e){if(Array.isArray(e))return e}function eB(e){var t=xe.useRef(e);t.current=e,ue(e.accept!=null,"accept must be defined");var r=K3(),n=Y3(r,2),a=n[0],o=n[1];V3(t,a,o);var u=Hm(a,t.current.collect||function(){return{}},function(){return o.reconnect()}),p=xe.useMemo(function(){return o.hooks.dropTarget()},[o]);return Qa(function(){o.dropTargetOptions=e.options||null,o.reconnect()},[e.options]),[u,p]}function tB(e,t){return oB(e)||aB(e,t)||nB(e,t)||rB()}function rB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nB(e,t){if(e){if(typeof e=="string")return qv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qv(e,t)}}function qv(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),p;!(n=(p=u.next()).done)&&(r.push(p.value),!(t&&r.length===t));n=!0);}catch(m){a=!0,o=m}finally{try{!n&&u.return!=null&&u.return()}finally{if(a)throw o}}return r}}function oB(e){if(Array.isArray(e))return e}function iB(e){var t=Ao(),r=t.getMonitor(),n=Fm(r,e),a=tB(n,2),o=a[0],u=a[1];return xe.useEffect(function(){return r.subscribeToOffsetChange(u)}),xe.useEffect(function(){return r.subscribeToStateChange(u)}),o}function fs(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fs=function(r){return typeof r}:fs=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},fs(e)}function Kv(e){return typeof e=="function"}function Vv(){}function sB(e){return fs(e)==="object"&&e!==null}function ri(e){if(!sB(e))return!1;if(Object.getPrototypeOf(e)===null)return!0;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Vm(e){var t=e.current;return t==null?null:t.decoratedRef?t.decoratedRef.current:t}function lB(e){return e&&e.prototype&&typeof e.prototype.render=="function"}function uB(e){var t,r=e;return(r==null||(t=r.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}function Ym(e){return lB(e)||uB(e)}function hf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yv(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),p;!(n=(p=u.next()).done)&&(r.push(p.value),!(t&&r.length===t));n=!0);}catch(m){a=!0,o=m}finally{try{!n&&u.return!=null&&u.return()}finally{if(a)throw o}}return r}}function hB(e){if(Array.isArray(e))return e}function gB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yB(e,t){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Ps(e){return Ps=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ps(e)}function Xm(e){var t=e.DecoratedComponent,r=e.createHandler,n=e.createMonitor,a=e.createConnector,o=e.registerHandler,u=e.containerDisplayName,p=e.getType,m=e.collect,C=e.options,A=C.arePropsEqual,O=A===void 0?aa:A,j=t,B=t.displayName||t.name||"Component",q=function(){var X=function(re){bB(Se,re);var ve=SB(Se);function Se(he){var ee;return gB(this,Se),ee=ve.call(this,he),ee.decoratedRef=xe.createRef(),ee.handleChange=function(){var Ce=ee.getCurrentState();aa(Ce,ee.state)||ee.setState(Ce)},ee.disposable=new Jv,ee.receiveProps(he),ee.dispose(),ee}return mB(Se,[{key:"getHandlerId",value:function(){return this.handlerId}},{key:"getDecoratedComponentInstance",value:function(){return ue(this.decoratedRef.current,"In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()"),this.decoratedRef.current}},{key:"shouldComponentUpdate",value:function(ee,Ce){return!O(ee,this.props)||!aa(Ce,this.state)}},{key:"componentDidMount",value:function(){this.disposable=new Jv,this.currentType=void 0,this.receiveProps(this.props),this.handleChange()}},{key:"componentDidUpdate",value:function(ee){O(this.props,ee)||(this.receiveProps(this.props),this.handleChange())}},{key:"componentWillUnmount",value:function(){this.dispose()}},{key:"receiveProps",value:function(ee){this.handler&&(this.handler.receiveProps(ee),this.receiveType(p(ee)))}},{key:"receiveType",value:function(ee){if(!(!this.handlerMonitor||!this.manager||!this.handlerConnector)&&ee!==this.currentType){this.currentType=ee;var Ce=o(ee,this.handler,this.manager),Be=fB(Ce,2),De=Be[0],it=Be[1];this.handlerId=De,this.handlerMonitor.receiveHandlerId(De),this.handlerConnector.receiveHandlerId(De);var ze=this.manager.getMonitor(),ft=ze.subscribeToStateChange(this.handleChange,{handlerIds:[De]});this.disposable.setDisposable(new cB(new Xv(ft),new Xv(it)))}}},{key:"dispose",value:function(){this.disposable.dispose(),this.handlerConnector&&this.handlerConnector.receiveHandlerId(null)}},{key:"getCurrentState",value:function(){if(!this.handlerConnector)return{};var ee=m(this.handlerConnector.hooks,this.handlerMonitor,this.props);return ee}},{key:"render",value:function(){var ee=this;return xe.createElement(Ii.Consumer,null,function(Ce){var Be=Ce.dragDropManager;return ee.receiveDragDropManager(Be),typeof requestAnimationFrame<"u"&&requestAnimationFrame(function(){var De;return(De=ee.handlerConnector)===null||De===void 0?void 0:De.reconnect()}),xe.createElement(j,Object.assign({},ee.props,ee.getCurrentState(),{ref:Ym(j)?ee.decoratedRef:null}))})}},{key:"receiveDragDropManager",value:function(ee){this.manager===void 0&&(ue(ee!==void 0,"Could not find the drag and drop manager in the context of %s. Make sure to render a DndProvider component in your top-level component. Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context",B,B),ee!==void 0&&(this.manager=ee,this.handlerMonitor=n(ee),this.handlerConnector=a(ee.getBackend()),this.handler=r(this.handlerMonitor,this.decoratedRef)))}}]),Se}(xe.Component);return X.DecoratedComponent=t,X.displayName="".concat(u,"(").concat(B,")"),X}();return lh(q,t)}function ps(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ps=function(r){return typeof r}:ps=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ps(e)}function yf(e,t){return typeof e=="string"||ps(e)==="symbol"||!!t&&Array.isArray(e)&&e.every(function(r){return yf(r,!1)})}function OB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TB(e,t){for(var r=0;r-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',Zv.join(", "),t),ue(typeof e[t]=="function","Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])}),CB.forEach(function(t){ue(typeof e[t]=="function","Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])}),function(r,n){return new IB(e,r,n)}}function RB(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=e;typeof e!="function"&&(ue(yf(e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',e),a=function(){return e}),ue(ri(t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',t);var o=PB(t);return ue(typeof r=="function",'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',r),ue(ri(n),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',r),function(p){return Xm({containerDisplayName:"DragSource",createHandler:o,registerHandler:Bm,createConnector:function(C){return new Gm(C)},createMonitor:function(C){return new Wm(C)},DecoratedComponent:p,getType:a,collect:r,options:n})}}function EB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DB(e,t){for(var r=0;r-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',eh.join(", "),t),ue(typeof e[t]=="function","Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target",t,t,e[t])}),function(r,n){return new jB(e,r,n)}}function MB(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=e;typeof e!="function"&&(ue(yf(e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',e),a=function(){return e}),ue(ri(t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',t);var o=kB(t);return ue(typeof r=="function",'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',r),ue(ri(n),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',r),function(p){return Xm({containerDisplayName:"DropTarget",createHandler:o,registerHandler:Um,createMonitor:function(C){return new Km(C)},createConnector:function(C){return new qm(C)},DecoratedComponent:p,getType:a,collect:r,options:n})}}function Zo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Zo=function(r){return typeof r}:Zo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Zo(e)}function LB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NB(e,t){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Rs(e){return Rs=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Rs(e)}function GB(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ue(typeof e=="function",'Expected "collect" provided as the first argument to DragLayer to be a function that collects props to inject into the component. ',"Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-layer",e),ue(ri(t),'Expected "options" provided as the second argument to DragLayer to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-layer',t),function(n){var a=n,o=t.arePropsEqual,u=o===void 0?aa:o,p=a.displayName||a.name||"Component",m=function(){var C=function(A){HB(j,A);var O=UB(j);function j(){var B;return LB(this,j),B=O.apply(this,arguments),B.isCurrentlyMounted=!1,B.ref=xe.createRef(),B.handleChange=function(){if(B.isCurrentlyMounted){var q=B.getCurrentState();aa(q,B.state)||B.setState(q)}},B}return FB(j,[{key:"getDecoratedComponentInstance",value:function(){return ue(this.ref.current,"In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()"),this.ref.current}},{key:"shouldComponentUpdate",value:function(q,X){return!u(q,this.props)||!aa(X,this.state)}},{key:"componentDidMount",value:function(){this.isCurrentlyMounted=!0,this.handleChange()}},{key:"componentWillUnmount",value:function(){this.isCurrentlyMounted=!1,this.unsubscribeFromOffsetChange&&(this.unsubscribeFromOffsetChange(),this.unsubscribeFromOffsetChange=void 0),this.unsubscribeFromStateChange&&(this.unsubscribeFromStateChange(),this.unsubscribeFromStateChange=void 0)}},{key:"render",value:function(){var q=this;return xe.createElement(Ii.Consumer,null,function(X){var re=X.dragDropManager;return re===void 0||(q.receiveDragDropManager(re),!q.isCurrentlyMounted)?null:xe.createElement(a,Object.assign({},q.props,q.state,{ref:Ym(a)?q.ref:null}))})}},{key:"receiveDragDropManager",value:function(q){if(this.manager===void 0){this.manager=q,ue(Zo(q)==="object","Could not find the drag and drop manager in the context of %s. Make sure to render a DndProvider component in your top-level component. Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context",p,p);var X=this.manager.getMonitor();this.unsubscribeFromOffsetChange=X.subscribeToOffsetChange(this.handleChange),this.unsubscribeFromStateChange=X.subscribeToStateChange(this.handleChange)}}},{key:"getCurrentState",value:function(){if(!this.manager)return{};var q=this.manager.getMonitor();return e(q,this.props)}}]),j}(xe.Component);return C.displayName="DragLayer(".concat(p,")"),C.DecoratedComponent=n,C}();return lh(m,n)}}const qB=Object.freeze(Object.defineProperty({__proto__:null,DndContext:Ii,DndProvider:Mm,DragLayer:GB,DragPreviewImage:Nm,DragSource:RB,DropTarget:MB,createDndContext:km,useDrag:k3,useDragDropManager:Ao,useDragLayer:iB,useDrop:eB},Symbol.toStringTag,{value:"Module"})),KB=je(qB),VB=je(HS),YB=je(US);var pl={},XB=La;Object.defineProperty(pl,"__esModule",{value:!0});pl.default=void 0;var JB=XB(Fa()),QB=Na;pl.default=(0,JB.default)((0,QB.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");var vl={},ZB=La;Object.defineProperty(vl,"__esModule",{value:!0});vl.default=void 0;var e4=ZB(Fa()),t4=Na;vl.default=(0,e4.default)((0,t4.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M17 13l-5 5-5-5h3V9h4v4z"}),"CloudDownload");var hl={},r4=La;Object.defineProperty(hl,"__esModule",{value:!0});var n4=hl.default=void 0,a4=r4(Fa()),o4=Na;n4=hl.default=(0,a4.default)((0,o4.jsx)("path",{d:"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3m-3 11H8v-5h8zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m-1-9H6v4h12z"}),"Print");var gl={},i4=La;Object.defineProperty(gl,"__esModule",{value:!0});gl.default=void 0;var s4=i4(Fa()),l4=Na;gl.default=(0,s4.default)((0,l4.jsx)("path",{d:"M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z"}),"ViewColumn");var yl={},u4=La;Object.defineProperty(yl,"__esModule",{value:!0});yl.default=void 0;var c4=u4(Fa()),f4=Na;yl.default=(0,c4.default)((0,f4.jsx)("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList");function Jm(e){var t=null,r=function(){return t==null&&(t=e()),t};return r}function d4(e,t){return e.filter(function(r){return r!==t})}function p4(e,t){var r=new Set,n=function(u){return r.add(u)};e.forEach(n),t.forEach(n);var a=[];return r.forEach(function(o){return a.push(o)}),a}function v4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h4(e,t){for(var r=0;r0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=d4(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e}(),Qm=Jm(function(){return/firefox/i.test(navigator.userAgent)}),Zm=Jm(function(){return!!window.safari});function m4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b4(e,t){for(var r=0;rr)A=O-1;else return a[O]}m=Math.max(0,A);var B=r-n[m],q=B*B;return a[m]+o[m]*B+u[m]*q+p[m]*B*q}}]),e}(),w4=1;function eb(e){var t=e.nodeType===w4?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,a=r.left;return{x:a,y:n}}function es(e){return{x:e.clientX,y:e.clientY}}function $4(e){var t;return e.nodeName==="IMG"&&(Qm()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function _4(e,t,r,n){var a=e?t.width:r,o=e?t.height:n;return Zm()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function O4(e,t,r,n,a){var o=$4(t),u=o?e:t,p=eb(u),m={x:r.x-p.x,y:r.y-p.y},C=e.offsetWidth,A=e.offsetHeight,O=n.anchorX,j=n.anchorY,B=_4(o,t,C,A),q=B.dragPreviewWidth,X=B.dragPreviewHeight,re=function(){var De=new th([0,.5,1],[m.y,m.y/A*X,m.y+X-A]),it=De.interpolate(j);return Zm()&&o&&(it+=(window.devicePixelRatio-1)*X),it},ve=function(){var De=new th([0,.5,1],[m.x,m.x/C*q,m.x+q-C]);return De.interpolate(O)},Se=a.offsetX,he=a.offsetY,ee=Se===0||Se,Ce=he===0||he;return{x:ee?Se:ve(),y:Ce?he:re()}}var tb="__NATIVE_FILE__",rb="__NATIVE_URL__",nb="__NATIVE_TEXT__";const xc=Object.freeze(Object.defineProperty({__proto__:null,FILE:tb,TEXT:nb,URL:rb},Symbol.toStringTag,{value:"Module"}));function rh(e,t,r){var n=t.reduce(function(a,o){return a||e.getData(o)},"");return n??r}var zo;function Qu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Cc=(zo={},Qu(zo,tb,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items}},matchesTypes:["Files"]}),Qu(zo,rb,{exposeProperties:{urls:function(t,r){return rh(t,r,"").split(` +`)}},matchesTypes:["Url","text/uri-list"]}),Qu(zo,nb,{exposeProperties:{text:function(t,r){return rh(t,r,"")}},matchesTypes:["Text","text/plain"]}),zo);function T4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x4(e,t){for(var r=0;r-1})})[0]||null}function R4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E4(e,t){for(var r=0;r0;(a>>>=1)&&(r+=r))a&1&&(n+=r);return n},ab=Ke,V4=Mc,ih=xr,Y4=K4,X4=Ha,J4=ab(Y4),Q4=ab("".slice),Z4=Math.ceil,eW=function(e){return function(t,r,n){var a=ih(X4(t)),o=V4(r),u=a.length,p=n===void 0?" ":ih(n),m,C;return o<=u||p===""?a:(m=o-u,C=J4(p,Z4(m/p.length)),C.length>m&&(C=Q4(C,0,m)),e?a+C:C+a)}},tW={start:eW(!1)},Ba=Ke,sh=Xe,Va=tW.start,rW=RangeError,nW=isFinite,aW=Math.abs,Ca=Date.prototype,Zu=Ca.toISOString,oW=Ba(Ca.getTime),iW=Ba(Ca.getUTCDate),sW=Ba(Ca.getUTCFullYear),lW=Ba(Ca.getUTCHours),uW=Ba(Ca.getUTCMilliseconds),cW=Ba(Ca.getUTCMinutes),fW=Ba(Ca.getUTCMonth),dW=Ba(Ca.getUTCSeconds),pW=sh(function(){return Zu.call(new Date(-5e13-1))!=="0385-07-25T07:06:39.999Z"})||!sh(function(){Zu.call(new Date(NaN))})?function(){if(!nW(oW(this)))throw new rW("Invalid time value");var t=this,r=sW(t),n=uW(t),a=r<0?"-":r>9999?"+":"";return a+Va(aW(r),a?6:4,0)+"-"+Va(fW(t)+1,2,0)+"-"+Va(iW(t),2,0)+"T"+Va(lW(t),2,0)+":"+Va(cW(t),2,0)+":"+Va(dW(t),2,0)+"."+Va(n,3,0)+"Z"}:Zu,vW=be,ob=Qr,hW=Fr,gW=bh,yW=pW,mW=Ta,bW=Xe,SW=bW(function(){return new Date(NaN).toJSON()!==null||ob(Date.prototype.toJSON,{toISOString:function(){return 1}})!==1});vW({target:"Date",proto:!0,forced:SW},{toJSON:function(t){var r=hW(this),n=gW(r,"number");return typeof n=="number"&&!isFinite(n)?null:!("toISOString"in r)&&mW(r)==="Date"?ob(yW,r):r.toISOString()}});var Ic=pt,wW=ai;Ic.JSON||(Ic.JSON={stringify:JSON.stringify});var $W=function(t,r,n){return wW(Ic.JSON.stringify,null,arguments)},_W=$W,OW=_W,TW=OW;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=_O,r=DO,n=Ax,a=Wx,o=cC,u=mC,p=TC,m=rI,C=v1,A=L1,O=Ks,j=K1,B=lE,q=wy,X=AE,re=jE,ve=YE,Se=XE,he=JE,ee=uD,Ce=_D,Be=FD,De=HD,it=cA,ze=LA,ft=fj,Zr=bj,ir=Pj,Bn=Uj,Wn=Bj,zn=Wj,ia=tk,sa=pk,la=vk,ua=hk,Le=gk,Qe=Ma,ca=lM,Ie=jM,_n=kM,Ne=MM,Cr=LM,Gn=FM,$t=HM,On=BS,It=xe,en=vL,tn=hL,qn=gL,ke=yL,Kn=mL,rn=bL,Vn=SL,sr=wL,Yn=nl,lr=al,Hr=YL,Ir=QN,Mt=ZN,Lt=eF,Ur=tF,fa=rF,Br=nF,yr=aF,nn=oF,Pt=iF,Wr=sF,Tn=lF,da=uF,xn=cF,Nt=fF,zr=dF,mr=TF,ur=xF,Ft=CF,Pr=QF,vt=ZF,Ht=vH,Qt=sl,Rr=mH,an=TH,Gr=KB,Cn=VB,Er=GS,Ut=YB,Zt=qS,qr=pl,In=vl,Pn=hl,on=gl,xt=yl,dt=WS,pa=KS,va=B4,ha=TW;function z(v){return v&&typeof v=="object"&&"default"in v?v:{default:v}}var we=z(t),Ze=z(r),er=z(n),mt=z(a),cr=z(o),sn=z(u),ln=z(p),Fe=z(m),fr=z(C),nt=z(A),dr=z(O),pr=z(j),Rt=z(B),Z=z(q),tr=z(X),et=z(re),Ge=z(ve),k=z(Se),st=z(he),me=z(ee),Xn=z(Ce),Pe=z(Be),at=z(De),Bt=z(it),lt=z(ze),Wt=z(ft),tt=z(Zr),Jn=z(ir),He=z(Bn),zt=z(Wn),_t=z(zn),Dr=z(ia),Kr=z(sa),Qn=z(la),Rn=z(ua),Gt=z(Le),Me=z(ca),br=z(Ie),ut=z(_n),En=z(Ne),Et=z(Cr),ga=z(Gn),ya=z($t),$=z(On),I=z(It),un=z(en),Ve=z(tn),cn=z(qn),Dt=z(ke),vr=z(Kn),Sr=z(rn),At=z(Vn),ct=z(sr),jt=z(Yn),qt=z(lr),fn=z(Hr),rr=z(Ir),wr=z(Mt),$r=z(Lt),Zn=z(Ur),Dn=z(fa),s=z(Br),i=z(yr),f=z(nn),S=z(Pt),W=z(Wr),G=z(Tn),ae=z(da),se=z(xn),de=z(Nt),ce=z(zr),Re=z(mr),Ue=z(ur),Ye=z(Ft),Ae=z(Pr),rt=z(vt),bt=z(Ht),nr=z(Qt),Ar=z(Rr),An=z(an),Ia=z(Cn),Pa=z(Er),Pi=z(Ut),jo=z(Zt),Ri=z(qr),ml=z(In),ao=z(Pn),bl=z(on),Sl=z(xt),d=z(dt),w=z(pa),F=z(ha),V=["children","colIndex","columnHeader","options","dataIndex","rowIndex","className","print","tableId"],ge=Qe.makeStyles({name:"MUIDataTableBodyCell"})(function(v){return{root:{},cellHide:{display:"none"},simpleHeader:k.default({},v.breakpoints.down("sm"),{display:"inline-block",fontWeight:"bold",width:"100%",boxSizing:"border-box"}),simpleCell:k.default({},v.breakpoints.down("sm"),{display:"inline-block",width:"100%",boxSizing:"border-box"}),stackedHeader:{verticalAlign:"top"},stackedCommon:k.default({},v.breakpoints.down("md"),{display:"inline-block",fontSize:"16px",height:"auto",width:"calc(50%)",boxSizing:"border-box","&:last-child":{borderBottom:"none"},"&:nth-last-of-type(2)":{borderBottom:"none"}}),stackedCommonAlways:{display:"inline-block",fontSize:"16px",height:"auto",width:"calc(50%)",boxSizing:"border-box","&:last-child":{borderBottom:"none"},"&:nth-last-of-type(2)":{borderBottom:"none"}},stackedParent:k.default({},v.breakpoints.down("md"),{display:"inline-block",fontSize:"16px",height:"auto",width:"calc(100%)",boxSizing:"border-box"}),stackedParentAlways:{display:"inline-block",fontSize:"16px",height:"auto",width:"calc(100%)",boxSizing:"border-box"},cellStackedSmall:k.default({},v.breakpoints.down("md"),{width:"50%",boxSizing:"border-box"}),responsiveStackedSmall:k.default({},v.breakpoints.down("md"),{width:"50%",boxSizing:"border-box"}),responsiveStackedSmallParent:k.default({},v.breakpoints.down("md"),{width:"100%",boxSizing:"border-box"})}});function oe(v){var T,x,h,c,l=ge().classes,R=v.children,y=v.colIndex,b=v.columnHeader,g=v.options,_=v.dataIndex,P=v.rowIndex,E=v.className,N=v.print,H=v.tableId,D=nt.default(v,V),L=g.onCellClick,M=It.useCallback(function(Q){L(R,{colIndex:y,rowIndex:P,dataIndex:_,event:Q})},[L,R,y,P,_]),U={};L&&(U.onClick=M);var K,J=[I.default.createElement("div",{key:1,className:Me.default((T={lastColumn:y===2},k.default(T,l.root,!0),k.default(T,l.cellHide,!0),k.default(T,l.stackedHeader,!0),k.default(T,l.stackedCommon,g.responsive==="vertical"||g.responsive==="stacked"||g.responsive==="stackedFullWidth"),k.default(T,l.stackedCommonAlways,g.responsive==="verticalAlways"),k.default(T,l.cellStackedSmall,g.responsive==="stacked"||g.responsive==="stackedFullWidth"&&(g.setTableProps().padding==="none"||g.setTableProps().size==="small")),k.default(T,l.simpleHeader,g.responsive==="simple"),k.default(T,"datatables-noprint",!N),T),E)},b),I.default.createElement("div",{key:2,className:Me.default((x={},k.default(x,l.root,!0),k.default(x,l.stackedCommon,g.responsive==="vertical"||g.responsive==="stacked"||g.responsive==="stackedFullWidth"),k.default(x,l.stackedCommonAlways,g.responsive==="verticalAlways"),k.default(x,l.responsiveStackedSmall,g.responsive==="stacked"||g.responsive==="stackedFullWidth"&&(g.setTableProps().padding==="none"||g.setTableProps().size==="small")),k.default(x,l.simpleCell,g.responsive==="simple"),k.default(x,"datatables-noprint",!N),x),E)},typeof R=="function"?R(_,P):R)];return K=st.default(h=["standard","scrollMaxHeight","scrollFullHeight","scrollFullHeightFullWidth"]).call(h,g.responsive)!==-1?Dt.default(J).call(J,1,2):J,I.default.createElement(vr.default,Fe.default({},U,{"data-colindex":y,"data-tableid":H,className:Me.default((c={},k.default(c,l.root,!0),k.default(c,l.stackedParent,g.responsive==="vertical"||g.responsive==="stacked"||g.responsive==="stackedFullWidth"),k.default(c,l.stackedParentAlways,g.responsive==="verticalAlways"),k.default(c,l.responsiveStackedSmallParent,g.responsive==="vertical"||g.responsive==="stacked"||g.responsive==="stackedFullWidth"&&(g.setTableProps().padding==="none"||g.setTableProps().size==="small")),k.default(c,l.simpleCell,g.responsive==="simple"),k.default(c,"datatables-noprint",!N),c),E)},D),K)}var Ee=["classes","options","rowSelected","onClick","className","isRowSelectable"];function St(v){var T=Ot();return function(){var x,h=Ge.default(v);if(T){var c=Ge.default(this).constructor;x=we.default(h,arguments,c)}else x=h.apply(this,arguments);return et.default(this,x)}}function Ot(){if(typeof Reflect>"u"||!we.default||we.default.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(we.default(Boolean,[],function(){})),!0}catch{return!1}}var Kt=function(v){return{root:{"&.Mui-selected":{backgroundColor:v.palette.action.selected},"&.mui-row-selected":{backgroundColor:v.palette.action.selected}},hoverCursor:{cursor:"pointer"},responsiveStacked:k.default({},v.breakpoints.down("md"),{borderTop:"solid 2px rgba(0, 0, 0, 0.15)",borderBottom:"solid 2px rgba(0, 0, 0, 0.15)",padding:0,margin:0}),responsiveSimple:k.default({},v.breakpoints.down("sm"),{borderTop:"solid 2px rgba(0, 0, 0, 0.15)",borderBottom:"solid 2px rgba(0, 0, 0, 0.15)",padding:0,margin:0})}},ar=function(v){tr.default(x,v);var T=St(x);function x(){return pr.default(this,x),T.apply(this,arguments)}return Rt.default(x,[{key:"render",value:function(){var h,c=this.props,l=c.classes,R=c.options,y=c.rowSelected,b=c.onClick,g=c.className,_=c.isRowSelectable,P=nt.default(c,Ee),E={};return b&&(E.onClick=b),I.default.createElement(Sr.default,Fe.default({hover:!!R.rowHover},E,{className:Me.default((h={},k.default(h,l.root,!0),k.default(h,l.hover,R.rowHover),k.default(h,l.hoverCursor,R.selectableRowsOnClick&&_||R.expandableRowsOnClick),k.default(h,l.responsiveSimple,R.responsive==="simple"),k.default(h,l.responsiveStacked,R.responsive==="vertical"||R.responsive==="stacked"||R.responsive==="stackedFullWidth"),k.default(h,"mui-row-selected",y),h),g),selected:y},P),this.props.children)}}]),x}(I.default.Component);k.default(ar,"propTypes",{options:$.default.object.isRequired,onClick:$.default.func,rowSelected:$.default.bool,classes:$.default.object});var Vt=Qe.withStyles(ar,Kt,{name:"MUIDataTableBodyRow"}),Yt=function(v){var T=v.areAllRowsExpanded,x=v.buttonClass,h=v.expandableRowsHeader,c=v.expandedRows,l=v.iconClass,R=v.iconIndeterminateClass,y=v.isHeaderCell,b=v.onExpand;return I.default.createElement(I.default.Fragment,null,y&&!T()&&T&&c.data.length>0?I.default.createElement(ct.default,{onClick:b,style:{padding:0},disabled:h===!1,className:x},I.default.createElement(qt.default,{id:"expandable-button",className:R})):I.default.createElement(ct.default,{onClick:b,style:{padding:0},disabled:h===!1,className:x},I.default.createElement(jt.default,{id:"expandable-button",className:l})))},jr=["fixedHeader","fixedSelectColumn","isHeaderCell","expandableOn","selectableOn","isRowExpanded","onExpand","isRowSelectable","selectableRowsHeader","hideExpandButton","expandableRowsHeader","expandedRows","areAllRowsExpanded","selectableRowsHideCheckboxes","setHeadCellRef","dataIndex","components"],kr=Qe.makeStyles({name:"MUIDataTableSelectCell"})(function(v){return{root:{"@media print":{display:"none"}},fixedHeader:{position:"sticky",top:"0px",zIndex:100},fixedLeft:{position:"sticky",left:"0px",zIndex:100},icon:{cursor:"pointer",transition:"transform 0.25s"},expanded:{transform:"rotate(90deg)"},hide:{visibility:"hidden"},headerCell:{zIndex:110,backgroundColor:v.palette.background.paper},expandDisabled:{},checkboxRoot:{},checked:{},disabled:{}}}),Vr=function(v){var T,x,h,c=v.fixedHeader,l=v.fixedSelectColumn,R=v.isHeaderCell,y=R!==void 0&&R,b=v.expandableOn,g=b!==void 0&&b,_=v.selectableOn,P=_===void 0?"none":_,E=v.isRowExpanded,N=E!==void 0&&E,H=v.onExpand,D=v.isRowSelectable,L=v.selectableRowsHeader,M=v.hideExpandButton,U=v.expandableRowsHeader,K=v.expandedRows,J=v.areAllRowsExpanded,Q=J===void 0?function(){return!1}:J,fe=v.selectableRowsHideCheckboxes,le=v.setHeadCellRef,$e=v.dataIndex,ne=v.components,qe=ne===void 0?{}:ne,Te=nt.default(v,jr),ye=kr().classes,Je=qe.Checkbox||At.default,pe=qe.ExpandButton||Yt;if(g===!1&&(P==="none"||fe===!0))return null;var ht=Me.default((k.default(T={},ye.root,!0),k.default(T,ye.fixedHeader,c&&y),k.default(T,ye.fixedLeft,l),k.default(T,ye.headerCell,y),T)),ot=Me.default(k.default({},ye.expandDisabled,M)),_e=Me.default((k.default(x={},ye.icon,!0),k.default(x,ye.hide,y&&!U),k.default(x,ye.expanded,N||y&&Q()),x)),ie=Me.default((k.default(h={},ye.icon,!0),k.default(h,ye.hide,y&&!U),h)),Y={};return le&&(Y.ref=function(te){le(0,0,te)}),I.default.createElement(vr.default,Fe.default({className:ht,padding:"checkbox"},Y),I.default.createElement("div",{style:{display:"flex",alignItems:"center"}},g&&I.default.createElement(pe,{isHeaderCell:y,areAllRowsExpanded:Q,expandedRows:K,onExpand:H,expandableRowsHeader:U,buttonClass:ot,iconIndeterminateClass:ie,iconClass:_e,dataIndex:$e}),P!=="none"&&fe!==!0&&(!y||P==="multiple"&&L!==!1?I.default.createElement(Je,Fe.default({classes:{root:ye.checkboxRoot,checked:ye.checked,disabled:ye.disabled},"data-description":y?"row-select-header":"row-select","data-index":$e||null,color:"primary",disabled:!D},Te)):null)))};Vr.propTypes={checked:$.default.bool.isRequired,fixedHeader:$.default.bool,onChange:$.default.func,classes:$.default.object,expandableOn:$.default.bool,hideExpandButton:$.default.bool,selectableOn:$.default.string,isRowSelectable:$.default.bool};function Ct(v){return Bt.default(v).call(v,function(T,x){return T[x.dataIndex]=!0,T},{})}function ea(v){return typeof v=="string"?v.replace(/^\+|^\-|^\=|^\@/g,"'$&"):v}function Ei(v){var T=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],x=typeof T=="function"?T:console.warn;T&&x("Deprecation Notice: ".concat(v))}function Wa(v){var T=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],x=typeof T=="function"?T:console.warn;T&&x("".concat(v))}function ta(v,T,x){var h=v<=T?1:Math.ceil(v/T);return x>=h?h-1:x}function mf(){return Intl?new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}).compare:function(v,T){return v.localeCompare(T)}}function ib(v){return function(T,x){var h=T.data===null||T.data===void 0?"":T.data,c=x.data===null||x.data===void 0?"":x.data;return(typeof h.localeCompare=="function"?h.localeCompare(c):h-c)*(v==="asc"?1:-1)}}function sb(v,T,x){var h,c,l=function(_){return typeof _=="string"?_.replace(/\"/g,'""'):_},R=function(_){var P;return Dt.default(P=Bt.default(_).call(_,function(E,N){return N.download?E+'"'+ea(l(N.label||N.name))+'"'+x.downloadOptions.separator:E},"")).call(P,0,-1)+`\r +`},y=R(v),b=function(_){var P;return _.length?fn.default(P=Bt.default(_).call(_,function(E,N){var H,D;return E+'"'+me.default(H=He.default(D=N.data).call(D,function(L,M){return v[M].download})).call(H,function(L){return ea(l(L))}).join('"'+x.downloadOptions.separator+'"')+`"\r +`},"")).call(P):""},g=b(T);return x.onDownload?x.onDownload(R,b,v,T):fn.default(h=tt.default(c="".concat(y)).call(c,g)).call(h)}function lb(v,T){var x=new Blob([v],{type:"text/csv"});if(navigator&&navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(x,T);else{var h="data:text/csv;charset=utf-8,".concat(v),c=rr.default||window.webkitURL,l=c.createObjectURL===void 0?h:c.createObjectURL(x),R=document.createElement("a");R.setAttribute("href",l),R.setAttribute("download",T),document.body.appendChild(R),R.click(),document.body.removeChild(R)}}function ub(v,T,x,h){var c=sb(v,T,x);x.onDownload&&c===!1||h(c,x.downloadOptions.filename)}function cb(v){var T=fb();return function(){var x,h=Ge.default(v);if(T){var c=Ge.default(this).constructor;x=we.default(h,arguments,c)}else x=h.apply(this,arguments);return et.default(this,x)}}function fb(){if(typeof Reflect>"u"||!we.default||we.default.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(we.default(Boolean,[],function(){})),!0}catch{return!1}}var db=function(v){return{root:{},emptyTitle:{textAlign:"center"},lastStackedCell:k.default({},v.breakpoints.down("md"),{"& td:last-child":{borderBottom:"none"}}),lastSimpleCell:k.default({},v.breakpoints.down("sm"),{"& td:last-child":{borderBottom:"none"}})}},wl=function(v){tr.default(x,v);var T=cb(x);function x(){var h,c;pr.default(this,x);for(var l=arguments.length,R=new Array(l),y=0;yH?H+1:H-1};H!==b.index;)M()}c.props.selectRowUpdate("cell",b,P)}),k.default(Z.default(c),"handleRowClick",function(b,g,_){var P;if(!(_.target.id==="expandable-button"||_.target.nodeName==="path"&&_.target.parentNode.id==="expandable-button"||_.target.id&&un.default(P=_.target.id).call(P,"MUIDataTableSelectCell"))){if(c.props.options.selectableRowsOnClick&&c.props.options.selectableRows!=="none"&&c.isRowSelectable(g.dataIndex,c.props.selectedRows)){var E={index:g.rowIndex,dataIndex:g.dataIndex};c.handleRowSelect(E,_)}if(c.props.options.expandableRowsOnClick&&c.props.options.expandableRows&&c.isRowExpandable(g.dataIndex,c.props.expandedRows)){var N={index:g.rowIndex,dataIndex:g.dataIndex};c.props.toggleExpandRow(N)}c.props.options.selectableRowsOnClick||c.props.options.onRowClick&&c.props.options.onRowClick(b,g,_)}}),k.default(Z.default(c),"processRow",function(b,g){for(var _=[],P=0;Pg&&console.warn("Current page is out of range, using the highest page that is in range instead.");for(var E=_;E0?me.default(D).call(D,function(M,U){var K,J,Q,fe,le,$e=M.data,ne=M.dataIndex;if(g.customRowRender)return g.customRowRender($e,ne,U);var qe=g.selectableRows!=="none"&&c.isRowSelected(ne),Te=c.isRowSelectable(ne),ye=g.setRowProps&&g.setRowProps($e,ne,U)||{},Je=c.processRow($e,P);return I.default.createElement(I.default.Fragment,{key:U},I.default.createElement(Vt,Fe.default({},ye,{options:g,rowSelected:qe,isRowSelectable:Te,onClick:_t.default(K=c.handleRowClick).call(K,null,$e,{rowIndex:U,dataIndex:ne}),className:Me.default((J={},k.default(J,R.lastStackedCell,g.responsive==="vertical"||g.responsive==="stacked"||g.responsive==="stackedFullWidth"),k.default(J,R.lastSimpleCell,g.responsive==="simple"),k.default(J,ye.className,ye.className),J)),"data-testid":"MUIDataTableBodyRow-"+ne,id:tt.default(Q="MUIDataTableBodyRow-".concat(H,"-")).call(Q,ne)}),I.default.createElement(Vr,{onChange:_t.default(fe=c.handleRowSelect).call(fe,null,{index:c.getRowIndex(U),dataIndex:ne}),onExpand:_t.default(b).call(b,null,{index:c.getRowIndex(U),dataIndex:ne}),fixedHeader:g.fixedHeader,fixedSelectColumn:g.fixedSelectColumn,checked:qe,expandableOn:g.expandableRows,hideExpandButton:!c.isRowExpandable(ne)&&g.expandableRows,selectableOn:g.selectableRows,selectableRowsHideCheckboxes:g.selectableRowsHideCheckboxes,isRowExpanded:c.isRowExpanded(ne),isRowSelectable:Te,dataIndex:ne,id:tt.default(le="MUIDataTableSelectCell-".concat(H,"-")).call(le,ne),components:N}),me.default(Je).call(Je,function(pe){var ht;return y[pe.index].display==="true"&&I.default.createElement(oe,Fe.default({},y[pe.index].setCellProps&&y[pe.index].setCellProps(pe.value,ne,pe.index)||{},{"data-testid":tt.default(ht="MuiDataTableBodyCell-".concat(pe.index,"-")).call(ht,U),dataIndex:ne,rowIndex:U,colIndex:pe.index,columnHeader:y[pe.index].label,print:y[pe.index].print,options:g,tableId:H,key:pe.index}),pe.value)})),c.isRowExpanded(ne)&&g.renderExpandableRow($e,{rowIndex:U,dataIndex:ne}))}):I.default.createElement(Vt,{options:g},I.default.createElement(oe,{colSpan:g.selectableRows!=="none"||g.expandableRows?L+1:L,options:g,colIndex:0,rowIndex:0},I.default.createElement(Ve.default,{variant:"body1",className:R.emptyTitle,component:"div"},g.textLabels.body.noMatch))))}}]),x}(I.default.Component);k.default(wl,"propTypes",{data:$.default.array.isRequired,count:$.default.number.isRequired,columns:$.default.array.isRequired,options:$.default.object.isRequired,filterList:$.default.array,onRowClick:$.default.func,expandedRows:$.default.object,selectedRows:$.default.object,selectRowUpdate:$.default.func,previousSelectedRow:$.default.object,searchText:$.default.string,toggleExpandRow:$.default.func,classes:$.default.object}),k.default(wl,"defaultProps",{toggleExpandRow:function(){}});var $l=Qe.withStyles(wl,db,{name:"MUIDataTableBody"});function pb(v){var T=vb();return function(){var x,h=Ge.default(v);if(T){var c=Ge.default(this).constructor;x=we.default(h,arguments,c)}else x=h.apply(this,arguments);return et.default(this,x)}}function vb(){if(typeof Reflect>"u"||!we.default||we.default.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(we.default(Boolean,[],function(){})),!0}catch{return!1}}var hb=function(v){return{root:{backgroundColor:v.palette.background.default,padding:"24px 24px 36px 24px",fontFamily:"Roboto"},header:{flex:"0 0 auto",marginBottom:"16px",width:"100%",display:"flex",justifyContent:"space-between"},title:{display:"inline-block",marginLeft:"7px",color:v.palette.text.primary,fontSize:"14px",fontWeight:500},noMargin:{marginLeft:"0px"},reset:{alignSelf:"left"},resetLink:{marginLeft:"16px",fontSize:"12px",cursor:"pointer"},filtersSelected:{alignSelf:"right"},checkboxListTitle:{marginLeft:"7px",marginBottom:"8px",fontSize:"14px",color:v.palette.text.secondary,textAlign:"left",fontWeight:500},checkboxFormGroup:{marginTop:"8px"},checkboxFormControl:{margin:"0px"},checkboxFormControlLabel:{fontSize:"15px",marginLeft:"8px",color:v.palette.text.primary},checkboxIcon:{width:"32px",height:"32px"},checkbox:{},checked:{},gridListTile:{marginTop:"16px"}}},bf=function(v){tr.default(x,v);var T=pb(x);function x(h){var c;return pr.default(this,x),c=T.call(this,h),k.default(Z.default(c),"filterUpdate",function(l,R,y,b,g){var _,P=Dt.default(_=c.state.filterList).call(_,0);c.props.updateFilterByType(P,l,R,b,g),c.setState({filterList:P})}),k.default(Z.default(c),"handleCheckboxChange",function(l,R,y){c.filterUpdate(l,R,y,"checkbox"),c.props.options.confirmFilters!==!0&&c.props.onFilterUpdate(l,R,y,"checkbox")}),k.default(Z.default(c),"handleDropdownChange",function(l,R,y){var b=He.default(c.props.options.textLabels).all,g=l.target.value===b?[]:[l.target.value];c.filterUpdate(R,g,y,"dropdown"),c.props.options.confirmFilters!==!0&&c.props.onFilterUpdate(R,g,y,"dropdown")}),k.default(Z.default(c),"handleMultiselectChange",function(l,R,y){c.filterUpdate(l,R,y,"multiselect"),c.props.options.confirmFilters!==!0&&c.props.onFilterUpdate(l,R,y,"multiselect")}),k.default(Z.default(c),"handleTextFieldChange",function(l,R,y){c.filterUpdate(R,l.target.value,y,"textField"),c.props.options.confirmFilters!==!0&&c.props.onFilterUpdate(R,l.target.value,y,"textField")}),k.default(Z.default(c),"handleCustomChange",function(l,R,y){c.filterUpdate(R,l,y.name,y.filterType),c.props.options.confirmFilters!==!0&&c.props.onFilterUpdate(R,l,y.name,y.filterType)}),k.default(Z.default(c),"applyFilters",function(){var l;return Pe.default(l=c.state.filterList).call(l,function(R,y){c.props.onFilterUpdate(y,R,c.props.columns[y],"custom")}),c.props.handleClose(),c.props.options.onFilterConfirm&&c.props.options.onFilterConfirm(c.state.filterList),c.state.filterList}),k.default(Z.default(c),"resetFilters",function(){var l;c.setState({filterList:me.default(l=c.props.columns).call(l,function(){return[]})}),c.props.options.confirmFilters!==!0&&c.props.onFilterReset()}),c.state={filterList:ut.default(h.filterList)},c}return Rt.default(x,[{key:"renderCheckbox",value:function(h,c){var l,R=this,y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},b=y.Checkbox||At.default,g=this.props,_=g.classes,P=g.filterData,E=this.state.filterList,N=h.filterOptions&&h.filterOptions.renderValue?h.filterOptions.renderValue:function(H){return H};return I.default.createElement(s.default,{item:!0,key:c,xs:6},I.default.createElement(Dn.default,null,I.default.createElement(s.default,{item:!0,xs:12},I.default.createElement(Ve.default,{variant:"body2",className:_.checkboxListTitle},h.label)),I.default.createElement(s.default,{container:!0},me.default(l=P[c]).call(l,function(H,D){var L,M;return I.default.createElement(s.default,{item:!0,key:D},I.default.createElement(Zn.default,{key:D,classes:{root:_.checkboxFormControl,label:_.checkboxFormControlLabel},control:I.default.createElement(b,{"data-description":"table-filter",color:"primary",className:_.checkboxIcon,onChange:_t.default(L=R.handleCheckboxChange).call(L,null,c,H,h.name),checked:st.default(M=E[c]).call(M,H)>=0,classes:{root:_.checkbox,checked:_.checked},value:H!=null?H.toString():""}),label:N(H)}))}))))}},{key:"renderSelect",value:function(h,c){var l,R=this,y=this.props,b=y.classes,g=y.filterData,_=y.options,P=this.state.filterList,E=He.default(_.textLabels),N=h.filterOptions&&h.filterOptions.renderValue?h.filterOptions.renderValue:function(D){return D!=null?D.toString():""},H=(h.filterOptions&&h.filterOptions.fullWidth)===!0?12:6;return I.default.createElement(s.default,{item:!0,key:c,xs:H,classes:{"grid-xs-12":b.gridListTile,"grid-xs-6":b.gridListTile}},I.default.createElement($r.default,{key:c,variant:"standard",fullWidth:!0},I.default.createElement(f.default,{htmlFor:h.name},h.label),I.default.createElement(G.default,{fullWidth:!0,value:P[c].length?P[c].toString():E.all,name:h.name,onChange:function(D){return R.handleDropdownChange(D,c,h.name)},input:I.default.createElement(i.default,{name:h.name,id:h.name})},I.default.createElement(W.default,{value:E.all,key:0},E.all),me.default(l=g[c]).call(l,function(D,L){return I.default.createElement(W.default,{value:D,key:L+1},N(D))}))))}},{key:"renderTextField",value:function(h,c){var l=this,R=this.props.classes,y=this.state.filterList;h.filterOptions&&h.filterOptions.renderValue&&console.warn("Custom renderValue not supported for textField filters");var b=(h.filterOptions&&h.filterOptions.fullWidth)===!0?12:6;return I.default.createElement(s.default,{item:!0,key:c,xs:b,classes:{"grid-xs-12":R.gridListTile,"grid-xs-6":R.gridListTile}},I.default.createElement($r.default,{key:c,fullWidth:!0},I.default.createElement(ae.default,{fullWidth:!0,variant:"standard",label:h.label,value:y[c].toString()||"","data-testid":"filtertextfield-"+h.name,onChange:function(g){return l.handleTextFieldChange(g,c,h.name)}})))}},{key:"renderMultiselect",value:function(h,c){var l,R=this,y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},b=y.Checkbox||At.default,g=this.props,_=g.classes,P=g.filterData,E=this.state.filterList,N=h.filterOptions&&h.filterOptions.renderValue?h.filterOptions.renderValue:function(D){return D},H=(h.filterOptions&&h.filterOptions.fullWidth)===!0?12:6;return I.default.createElement(s.default,{item:!0,key:c,xs:H,classes:{"grid-xs-12":_.gridListTile,"grid-xs-6":_.gridListTile}},I.default.createElement($r.default,{key:c,variant:"standard",fullWidth:!0},I.default.createElement(f.default,{htmlFor:h.name},h.label),I.default.createElement(G.default,{multiple:!0,fullWidth:!0,value:E[c]||[],renderValue:function(D){return me.default(D).call(D,N).join(", ")},name:h.name,onChange:function(D){return R.handleMultiselectChange(c,D.target.value,h.name)},input:I.default.createElement(i.default,{name:h.name,id:h.name})},me.default(l=P[c]).call(l,function(D,L){var M;return I.default.createElement(W.default,{value:D,key:L+1},I.default.createElement(b,{"data-description":"table-filter",color:"primary",checked:st.default(M=E[c]).call(M,D)>=0,value:D!=null?D.toString():"",className:_.checkboxIcon,classes:{root:_.checkbox,checked:_.checked}}),I.default.createElement(S.default,{primary:N(D)}))}))))}},{key:"renderCustomField",value:function(h,c){var l=this.props,R=l.classes,y=l.filterData,b=l.options,g=this.state.filterList,_=(h.filterOptions&&h.filterOptions.fullWidth)===!0?12:6,P=h.filterOptions&&h.filterOptions.display||b.filterOptions&&b.filterOptions.display;if(P)return h.filterListOptions&&h.filterListOptions.renderValue&&console.warning('"renderValue" is ignored for custom filter fields'),I.default.createElement(s.default,{item:!0,key:c,xs:_,classes:{"grid-xs-12":R.gridListTile,"grid-xs-6":R.gridListTile}},I.default.createElement($r.default,{key:c,fullWidth:!0},P(g,this.handleCustomChange,c,h,y)));console.error('Property "display" is required when using custom filter type.')}},{key:"render",value:function(){var h=this,c=this.props,l=c.classes,R=c.columns,y=c.options,b=c.customFooter,g=c.filterList,_=c.components,P=_===void 0?{}:_,E=He.default(y.textLabels);return I.default.createElement("div",{className:l.root},I.default.createElement("div",{className:l.header},I.default.createElement("div",{className:l.reset},I.default.createElement(Ve.default,{variant:"body2",className:Me.default(k.default({},l.title,!0))},E.title),I.default.createElement(wr.default,{color:"primary",className:l.resetLink,tabIndex:0,"aria-label":E.reset,"data-testid":"filterReset-button",onClick:this.resetFilters},E.reset)),I.default.createElement("div",{className:l.filtersSelected})),I.default.createElement(s.default,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",spacing:4},me.default(R).call(R,function(N,H){if(He.default(N)){var D=N.filterType||y.filterType;return D==="checkbox"?h.renderCheckbox(N,H,P):D==="multiselect"?h.renderMultiselect(N,H,P):D==="textField"?h.renderTextField(N,H):D==="custom"?h.renderCustomField(N,H):h.renderSelect(N,H)}})),b?b(g,this.applyFilters):"")}}]),x}(I.default.Component);k.default(bf,"propTypes",{filterData:$.default.array.isRequired,filterList:$.default.array.isRequired,options:$.default.object.isRequired,onFilterUpdate:$.default.func,onFilterReset:$.default.func,classes:$.default.object});var _l=Qe.withStyles(bf,hb,{name:"MUIDataTableFilter"}),Sf=function(v){var T=v.label,x=v.onDelete,h=v.className,c=v.filterProps;return(c=c||{}).className&&(h=Me.default(h,c.className)),I.default.createElement(se.default,Fe.default({label:T,onDelete:x,className:h},c))};Sf.propTypes={label:$.default.node,onDelete:$.default.func.isRequired,className:$.default.string.isRequired};var gb=Qe.makeStyles({name:"MUIDataTableFilterList"})(function(){return{root:{display:"flex",justifyContent:"left",flexWrap:"wrap",margin:"0px 16px 0px 16px"},chip:{margin:"8px 8px 0px 0px"}}}),Di=function(v){var T=v.options,x=v.filterList,h=v.filterUpdate,c=v.filterListRenderers,l=v.columnNames,R=v.serverSideFilterList,y=v.customFilterListUpdate,b=v.ItemComponent,g=b===void 0?Sf:b,_=gb().classes,P=T.serverSide,E=function(D,L,M,U){var K=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,J=L;at.default(J)&&J.length===0&&(J=x[D]),h(D,L,M,U,K,function(Q){T.onFilterChipClose&&T.onFilterChipClose(D,J,Q)})},N=function(D,L,M,U,K){var J;return J=K?y[L]?"custom":"chip":l[L].filterType,I.default.createElement(g,{label:D,key:M,onDelete:function(){return E(L,U[M]||[],l[L].name,J,y[L])},className:_.chip,itemKey:M,index:L,data:U,columnNames:l,filterProps:T.setFilterChipProps?T.setFilterChipProps(L,l[L].name,U[M]||[]):{}})},H=function(D){return me.default(D).call(D,function(L,M){if(l[M].filterType==="custom"&&D[M].length){var U=c[M](L);return at.default(U)?me.default(U).call(U,function(K,J){return N(K,M,J,L,!0)}):N(U,M,M,L,!1)}return me.default(L).call(L,function(K,J){return function(Q,fe,le){return I.default.createElement(g,{label:c[Q](fe),key:le,onDelete:function(){return E(Q,fe,l[Q].name,"chip")},className:_.chip,itemKey:le,index:Q,data:fe,columnNames:l,filterProps:T.setFilterChipProps?T.setFilterChipProps(Q,l[Q].name,fe):{}})}(M,K,J)})})};return I.default.createElement("div",{className:_.root},H(P&&R?R:x))};Di.propTypes={filterList:$.default.array.isRequired,filterListRenderers:$.default.array.isRequired,columnNames:$.default.arrayOf($.default.oneOfType([$.default.string,$.default.shape({name:$.default.string.isRequired,filterType:$.default.string})])).isRequired,onFilterUpdate:$.default.func,ItemComponent:$.default.any};var yb=Qe.makeStyles({name:"MUIDataTableJumpToPage"})(function(v){return{root:{color:v.palette.text.primary},caption:{flexShrink:0},selectRoot:{marginRight:32,marginLeft:8},select:{paddingTop:6,paddingBottom:7,paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right",fontSize:v.typography.pxToRem(14)},selectIcon:{},input:{color:"inhert",fontSize:"inhert",flexShrink:0}}});function wf(v){for(var T=yb().classes,x=v.count,h=v.textLabels,c=v.rowsPerPage,l=v.page,R=(v.changePage,h.pagination.jumpToPage),y=[],b=Math.min(1e3,ta(x,c,1e6)),g=0;g<=b;g++)y.push(g);var _=W.default;return I.default.createElement(Ye.default,{style:{display:"flex",minHeight:"52px",alignItems:"center"},className:T.root},I.default.createElement(Ve.default,{color:"inherit",variant:"body2",className:T.caption},R),I.default.createElement(G.default,{classes:{select:T.select,icon:T.selectIcon},input:I.default.createElement(Ue.default,{className:Me.default(T.input,T.selectRoot)}),value:ta(x,c,l),onChange:function(P){v.changePage(Re.default(P.target.value,10))},style:{marginRight:0}},me.default(y).call(y,function(P){return I.default.createElement(_,{className:T.menuItem,key:P,value:P},P+1)})))}wf.propTypes={count:$.default.number.isRequired,page:$.default.number.isRequired,rowsPerPage:$.default.number.isRequired,textLabels:$.default.object.isRequired};var mb=Qe.makeStyles({name:"MUIDataTablePagination"})(function(v){return{root:{},tableCellContainer:{padding:"0px 24px 0px 24px"},navContainer:{display:"flex",justifyContent:"flex-end"},toolbar:{},selectRoot:{},"@media screen and (max-width: 400px)":{toolbar:{"& span:nth-of-type(2)":{display:"none"}},selectRoot:{marginRight:"8px"}}}});function Ol(v){var T=mb().classes,x=v.count,h=v.options,c=v.rowsPerPage,l=v.page,R=h.textLabels.pagination;return I.default.createElement(de.default,null,I.default.createElement(Sr.default,null,I.default.createElement(vr.default,{colSpan:"1000",className:T.tableCellContainer},I.default.createElement("div",{className:T.navContainer},h.jumpToPage?I.default.createElement(wf,{count:x,page:l,rowsPerPage:c,textLabels:h.textLabels,changePage:v.changePage,changeRowsPerPage:v.changeRowsPerPage}):null,I.default.createElement(ce.default,{component:"div",className:T.root,classes:{caption:T.caption,toolbar:T.toolbar,selectRoot:T.selectRoot},count:x,rowsPerPage:c,page:ta(x,c,l),labelRowsPerPage:R.rowsPerPage,labelDisplayedRows:function(y){var b,g,_,P=y.from,E=y.to,N=y.count;return tt.default(b=tt.default(g=tt.default(_="".concat(P,"-")).call(_,E," ")).call(g,R.displayRows," ")).call(b,N)},backIconButtonProps:{id:"pagination-back","data-testid":"pagination-back","aria-label":R.previous,title:R.previous||""},nextIconButtonProps:{id:"pagination-next","data-testid":"pagination-next","aria-label":R.next,title:R.next||""},SelectProps:{id:"pagination-input",SelectDisplayProps:{id:"pagination-rows","data-testid":"pagination-rows"},MenuProps:{id:"pagination-menu","data-testid":"pagination-menu",MenuListProps:{id:"pagination-menu-list","data-testid":"pagination-menu-list"}}},rowsPerPageOptions:h.rowsPerPageOptions,onPageChange:function(y,b){v.changePage(b)},onRowsPerPageChange:function(y){v.changeRowsPerPage(y.target.value)}})))))}Ol.propTypes={count:$.default.number.isRequired,options:$.default.object.isRequired,page:$.default.number.isRequired,rowsPerPage:$.default.number.isRequired,changeRowsPerPage:$.default.func.isRequired};var bb=Qe.makeStyles({name:"MUIDataTableFooter"})(function(){return{root:{"@media print":{display:"none"}}}}),Ai=function(v){var T=v.options,x=v.rowCount,h=v.page,c=v.rowsPerPage,l=v.changeRowsPerPage,R=v.changePage,y=bb().classes,b=T.customFooter,g=T.pagination,_=g===void 0||g;return b?I.default.createElement(Rn.default,{className:y.root},T.customFooter(x,h,c,l,R,T.textLabels.pagination)):_?I.default.createElement(Rn.default,{className:y.root},I.default.createElement(Ol,{count:x,page:h,rowsPerPage:c,changeRowsPerPage:l,changePage:R,component:"div",options:T})):null};Ai.propTypes={rowCount:$.default.number.isRequired,options:$.default.shape({customFooter:$.default.func,pagination:$.default.bool,textLabels:$.default.shape({pagination:$.default.object})}),page:$.default.number.isRequired,rowsPerPage:$.default.number.isRequired,changeRowsPerPage:$.default.func.isRequired,changePage:$.default.func.isRequired};var $f=function(v,T,x){var h=[],c=v[0]?v[0]:null;if(c===null){c={offsetLeft:1/0};var l=An.default(v);Pe.default(l).call(l,function(g,_){var P=Ae.default(g,2),E=(P[0],P[1]);E&&E.offsetLeft1e3)););return v[0]&&(h[0]={left:y+c.offsetLeft,width:c.offsetWidth,columnIndex:null,ref:c}),Pe.default(T).call(T,function(g,_){var P=v[g+1],E=h.length-1;if(!x[g]||x[g].display==="true"){var N=E!==-1?h[E].left+h[E].width:y+c.offsetLeft;h.push({left:N,width:P.offsetWidth,columnIndex:g,ref:P})}}),h},Sb=function(v,T,x){var h=Dt.default(v).call(v),c=st.default(h).call(h,T),l=st.default(h).call(h,x);if(c!==-1&&l!==-1){var R,y,b=h[c];h=tt.default(R=[]).call(R,fr.default(Dt.default(h).call(h,0,c)),fr.default(Dt.default(h).call(h,c+1))),h=tt.default(y=[]).call(y,fr.default(Dt.default(h).call(h,0,l)),[b],fr.default(Dt.default(h).call(h,l)))}return h},wb=function(v){v.item;var T=v.mon,x=v.index,h=v.headCellRefs,c=v.updateColumnOrder,l=v.columnOrder,R=v.transitionTime,y=R===void 0?300:R,b=v.tableRef,g=v.tableId,_=v.timers,P=v.columns,E=T.getItem().colIndex;if(h===T.getItem().headCellRefs&&E!==x){for(var N=Sb(l,T.getItem().colIndex,x),H=$f(h,N,P),D=T.getClientOffset().x,L=-1,M=0;MH[M].left&&D0&&pe0&&pe>=y;if(P.disableToolbarSelect===!0||P.selectToolbarPlacement==="none"||P.selectToolbarPlacement==="above")if(ot){for(var _e=0;_ey&&(ht=!0);var ie=me.default(h).call(h,function(Y,te){return{column:c[Y],index:Y,colPos:te}});return I.default.createElement(rt.default,{className:Me.default((T={},k.default(T,le.responsiveStacked,P.responsive==="vertical"||P.responsive==="stacked"||P.responsive==="stackedFullWidth"),k.default(T,le.responsiveStackedAlways,P.responsive==="verticalAlways"),k.default(T,le.responsiveSimple,P.responsive==="simple"),k.default(T,le.main,!0),T))},I.default.createElement(xl,null,I.default.createElement(Vr,{setHeadCellRef:H,onChange:_t.default(Je).call(Je,null),indeterminate:ht,checked:ot,isHeaderCell:!0,expandedRows:_,expandableRowsHeader:P.expandableRowsHeader,expandableOn:P.expandableRows,selectableOn:P.selectableRows,fixedHeader:P.fixedHeader,fixedSelectColumn:P.fixedSelectColumn,selectableRowsHeader:P.selectableRowsHeader,selectableRowsHideCheckboxes:P.selectableRowsHideCheckboxes,onExpand:J,isRowSelectable:!0,components:R}),me.default(ie).call(ie,function(Y){var te=Y.column,We=Y.index,Xr=Y.colPos;return te.display==="true"&&(te.customHeadRender?te.customHeadRender(Cl({index:We},te),ye,L):I.default.createElement(Tl,{cellHeaderProps:c[We].setCellHeaderProps&&c[We].setCellHeaderProps(Cl({index:We},te))||{},key:We,index:We,colPosition:Xr,type:"cell",setCellRef:H,sort:Wt.default(te),sortDirection:te.name===L.name?L.direction:"none",toggleSort:ye,hint:te.hint,print:te.print,options:P,column:te,columns:c,updateColumnOrder:fe,columnOrder:h,timers:K,draggingHook:[qe,Te],draggableHeadCellRefs:g,tableRef:M,tableId:U,components:R},te.customHeadLabelRender?te.customHeadLabelRender(Cl({index:We,colPos:Xr},te)):te.label))})))};function Tf(v,T){var x=Ze.default(v);if(er.default){var h=er.default(v);T&&(h=He.default(h).call(h,function(c){return mt.default(v,c).enumerable})),x.push.apply(x,h)}return x}function ji(v){for(var T=1;T"u"||!we.default||we.default.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(we.default(Boolean,[],function(){})),!0}catch{return!1}}var Rb={root:{position:"absolute"},resizer:{position:"absolute",width:"1px",height:"100%",left:"100px",cursor:"ew-resize",border:"0.1px solid rgba(224, 224, 224, 1)"}};function xf(v){for(var T=0,x=0,h=v.offsetParent;h&&(x=x+(h.offsetLeft||0)-(h.scrollLeft||0),h=h.offsetParent,!(++T>1e3)););return x}var Cf=function(v){tr.default(x,v);var T=Ib(x);function x(){var h,c;pr.default(this,x);for(var l=arguments.length,R=new Array(l),y=0;y=0;)Y--;return E[Y]};if(P){var ne=g.clientX-fe,qe=function(ie,Y,te){return ie>Y-te?Y-te:ie},Te=function(ie,Y){return iele(te).left-We?le(te).left-We:ie},Je=function(ie,Y,te,We){return $e(te)===void 0?ie:ie<$e(te).left+We?$e(te).left+We:ie},pe=function(ie,Y){for(var te=1;!E[te]&&te<20;)te++;return ie!=="none"&&Y===0||ie==="none"&&Y===te},ht=function(ie,Y){return ie===function(te){for(var We=te-1;E[We]===void 0&&We>=0;)We--;return We}(N)};pe(Q,L)&&ht(L)?ne=qe(ne=Te(ne,H),K,D):!pe(Q,L)&&ht(L)?ne=Je(ne=qe(ne,K,D),0,L,H):pe(Q,L)&&!ht(L)?ne=ye(ne=Te(ne,H),0,L,D):pe(Q,L)||ht(L)||(ne=ye(ne=Je(ne,0,L,H),0,L,D));var ot=ji(ji({},E[b]),{},{left:ne}),_e=ji(ji({},E),{},k.default({},b,ot));c.setState({resizeCoords:_e,tableHeight:J},c.updateWidths)}}),k.default(Z.default(c),"onResizeEnd",function(b,g){c.setState({isResize:!1,id:null})}),c}return Rt.default(x,[{key:"componentDidMount",value:function(){var h=this;this.minWidths=[],this.windowWidth=null,this.props.setResizeable(this.setCellRefs),this.props.updateDividers(function(){return h.setState({updateCoords:!0},function(){return h.updateWidths})}),window.addEventListener("resize",this.handleResize,!1)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.handleResize,!1)}},{key:"render",value:function(){var h,c=this,l=this.props,R=l.classes,y=l.tableId,b=this.state,g=b.id,_=b.isResize,P=b.resizeCoords,E=b.tableWidth,N=b.tableHeight;return I.default.createElement("div",{className:R.root,style:{width:E}},me.default(h=An.default(P)).call(h,function(H){var D,L,M,U=Ae.default(H,2),K=U[0],J=U[1];return I.default.createElement("div",{"data-divider-index":K,"data-tableid":y,"aria-hidden":"true",key:K,onMouseMove:_t.default(D=c.onResizeMove).call(D,null,K),onMouseUp:_t.default(L=c.onResizeEnd).call(L,null,K),style:{width:_&&g==K?E:"auto",position:"absolute",height:N-2,cursor:"ew-resize",zIndex:1e3}},I.default.createElement("div",{"aria-hidden":"true",onMouseDown:_t.default(M=c.onResizeStart).call(M,null,K),className:R.resizer,style:{left:J.left}}))}))}}]),x}(I.default.Component);k.default(Cf,"propTypes",{classes:$.default.object});var Pl=Qe.withStyles(Cf,Rb,{name:"MUIDataTableResize"}),Eb=["className","trigger","refExit","hide","content"],ki=function(v){v.className;var T=v.trigger,x=v.refExit,h=v.hide,c=v.content,l=nt.default(v,Eb),R=It.useState(!1),y=Ae.default(R,2),b=y[0],g=y[1],_=It.useRef(null);It.useEffect(function(){b&&typeof h=="boolean"&&h&&g(!1)},[h,b,g]);var P=function(){g(!1)},E=l.classes.closeIcon;delete l.classes.closeIcon;var N={key:"content",onClick:function(H){T.props.onClick&&T.props.onClick(),function(D){_.current=D.currentTarget,g(!0)}(H)}};return I.default.createElement(I.default.Fragment,null,I.default.createElement("span",N,T),I.default.createElement(Ia.default,Fe.default({elevation:2,open:b,TransitionProps:{onExited:function(){x&&x()}},onClose:P,anchorEl:_.current,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},l),I.default.createElement(ct.default,{"aria-label":"Close",onClick:P,className:E,style:{position:"absolute",right:"4px",top:"4px",zIndex:"1000"}},I.default.createElement(Pa.default,null)),c))};ki.propTypes={refExit:$.default.func,trigger:$.default.node.isRequired,content:$.default.node.isRequired,hide:$.default.bool};var Db=Qe.makeStyles({name:"MUIDataTableViewCol"})(function(v){return{root:{padding:"16px 24px 16px 24px",fontFamily:"Roboto"},title:{marginLeft:"-7px",marginRight:"24px",fontSize:"14px",color:v.palette.text.secondary,textAlign:"left",fontWeight:500},formGroup:{marginTop:"8px"},formControl:{},checkbox:{padding:"0px",width:"32px",height:"32px"},checkboxRoot:{},checked:{},label:{fontSize:"15px",marginLeft:"8px",color:v.palette.text.primary}}}),Rl=function(v){var T=v.columns,x=v.options,h=v.components,c=h===void 0?{}:h,l=v.onColumnUpdate,R=(v.updateColumns,Db().classes),y=x.textLabels.viewColumns,b=c.Checkbox||At.default;return I.default.createElement($r.default,{component:"fieldset",className:R.root,"aria-label":y.titleAria},I.default.createElement(Ve.default,{variant:"caption",className:R.title},y.title),I.default.createElement(Dn.default,{className:R.formGroup},me.default(T).call(T,function(g,_){return g.display!=="excluded"&&g.viewColumns!==!1&&I.default.createElement(Zn.default,{key:_,classes:{root:R.formControl,label:R.label},control:I.default.createElement(b,{color:"primary","data-description":"table-view-col",className:R.checkbox,classes:{root:R.checkboxRoot,checked:R.checked},onChange:function(){return function(P){l(P)}(_)},checked:g.display==="true",value:g.name}),label:g.label})})))};Rl.propTypes={columns:$.default.array.isRequired,options:$.default.object.isRequired,onColumnUpdate:$.default.func,classes:$.default.object};var Ab=Qe.makeStyles({name:"MUIDataTableSearch"})(function(v){return{main:{display:"flex",flex:"1 0 auto",alignItems:"center"},searchIcon:{color:v.palette.text.secondary,marginRight:"8px"},searchText:{flex:"0.8 0"},clearIcon:{"&:hover":{color:v.palette.error.main}}}}),If=function(v){var T=v.options,x=v.searchText,h=v.onSearch,c=v.onHide,l=Ab().classes,R=T.searchAlwaysOpen?"hidden":"visible";return I.default.createElement(Pi.default,{appear:!0,in:!0,timeout:300},I.default.createElement("div",{className:l.main},I.default.createElement(jo.default,{className:l.searchIcon}),I.default.createElement(ae.default,Fe.default({className:l.searchText,autoFocus:!0,variant:"standard",InputProps:{"data-test-id":T.textLabels.toolbar.search},inputProps:{"aria-label":T.textLabels.toolbar.search},value:x||"",onKeyDown:function(y){y.key==="Escape"&&c()},onChange:function(y){h(y.target.value)},fullWidth:!0,placeholder:T.searchPlaceholder},T.searchProps?T.searchProps:{})),I.default.createElement(ct.default,{className:l.clearIcon,style:{visibility:R},onClick:c},I.default.createElement(Ri.default,null))))};function jb(v){var T=kb();return function(){var x,h=Ge.default(v);if(T){var c=Ge.default(this).constructor;x=we.default(h,arguments,c)}else x=h.apply(this,arguments);return et.default(this,x)}}function kb(){if(typeof Reflect>"u"||!we.default||we.default.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(we.default(Boolean,[],function(){})),!0}catch{return!1}}var Mb=function(v){var T;return T={root:{"@media print":{display:"none"}},fullWidthRoot:{},left:{flex:"1 1 auto"},fullWidthLeft:{flex:"1 1 auto"},actions:{flex:"1 1 auto",textAlign:"right"},fullWidthActions:{flex:"1 1 auto",textAlign:"right"},titleRoot:{},titleText:{},fullWidthTitleText:{textAlign:"left"},icon:{"&:hover":{color:v.palette.primary.main}},iconActive:{color:v.palette.primary.main},filterPaper:{maxWidth:"50%"},filterCloseIcon:{position:"absolute",right:0,top:0,zIndex:100},searchIcon:{display:"inline-flex",marginTop:"10px",marginRight:"8px"}},k.default(T,v.breakpoints.down("md"),{titleRoot:{},titleText:{fontSize:"16px"},spacer:{display:"none"},left:{padding:"8px 0px"},actions:{textAlign:"right"}}),k.default(T,v.breakpoints.down("sm"),{root:{display:"block","@media print":{display:"none !important"}},left:{padding:"8px 0px 0px 0px"},titleText:{textAlign:"center"},actions:{textAlign:"center"}}),k.default(T,"@media screen and (max-width: 480px)",{}),T},Mi="scrollFullHeightFullWidth",Lb=function(v){tr.default(x,v);var T=jb(x);function x(){var h,c;pr.default(this,x);for(var l=arguments.length,R=new Array(l),y=0;y"u"||!we.default||we.default.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(we.default(Boolean,[],function(){})),!0}catch{return!1}}var Hb=function(v){return{root:{backgroundColor:v.palette.background.default,flex:"1 1 100%",display:"flex",position:"relative",zIndex:120,justifyContent:"space-between",alignItems:"center",paddingTop:typeof v.spacing=="function"?v.spacing(1):v.spacing.unit,paddingBottom:typeof v.spacing=="function"?v.spacing(1):v.spacing.unit,"@media print":{display:"none"}},title:{paddingLeft:"26px"},iconButton:{marginRight:"24px"},deleteIcon:{}}},Pf=function(v){tr.default(x,v);var T=Nb(x);function x(){var h,c;pr.default(this,x);for(var l=arguments.length,R=new Array(l),y=0;y1&&g.selectableRows==="single")throw new Error('Can not select more than one row when "selectableRows" is "single"');c.props.selectRowUpdate("custom",b)}),c}return Rt.default(x,[{key:"render",value:function(){var h=this.props,c=h.classes,l=h.onRowsDelete,R=h.selectedRows,y=h.options,b=h.displayData,g=h.components,_=g===void 0?{}:g,P=y.textLabels.selectedRows,E=_.Tooltip||Gt.default;return I.default.createElement(Qn.default,{className:c.root},I.default.createElement("div",null,I.default.createElement(Ve.default,{variant:"subtitle1",className:c.title},R.data.length," ",P.text)),y.customToolbarSelect?y.customToolbarSelect(R,b,this.handleCustomSelectedRows):I.default.createElement(E,{title:P.delete},I.default.createElement(ct.default,{className:c.iconButton,onClick:l,"aria-label":P.deleteAria},I.default.createElement(w.default,{className:c.deleteIcon}))))}}]),x}(I.default.Component);k.default(Pf,"propTypes",{options:$.default.object.isRequired,rowSelected:$.default.bool,onRowsDelete:$.default.func,classes:$.default.object});var Dl=Qe.withStyles(Pf,Hb,{name:"MUIDataTableToolbarSelect"}),Ub=function(){return{body:{noMatch:"Sorry, no matching records found",toolTip:"Sort"},pagination:{next:"Next Page",previous:"Previous Page",rowsPerPage:"Rows per page:",displayRows:"of",jumpToPage:"Jump to Page:"},toolbar:{search:"Search",downloadCsv:"Download CSV",print:"Print",viewColumns:"View Columns",filterTable:"Filter Table"},filter:{all:"All",title:"FILTERS",reset:"RESET"},viewColumns:{title:"Show Columns",titleAria:"Show/Hide Table Columns"},selectedRows:{text:"row(s) selected",delete:"Delete",deleteAria:"Delete Selected Rows"}}},Bb=typeof window<"u"&&window.document!==void 0,Wb=function(v){if(Bb)return JSON.parse(window.localStorage.getItem(v));v===void 0||console.warn("storageKey support only on browser")},zb=["selectedRows","data","displayData"],Gb=function(v,T){T.selectedRows,T.data,T.displayData;var x=nt.default(T,zb);window.localStorage.setItem(v,F.default(x))},qb=["columns","data","displayData","filterData"];function Rf(v,T){var x=Ze.default(v);if(er.default){var h=er.default(v);T&&(h=He.default(h).call(h,function(c){return mt.default(v,c).enumerable})),x.push.apply(x,h)}return x}function Yr(v){for(var T=1;T"u"||!we.default||we.default.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(we.default(Boolean,[],function(){})),!0}catch{return!1}}var Yb=function(v){return{root:{"& .datatables-noprint":{"@media print":{display:"none"}}},paper:{isolation:"isolate"},paperResponsiveScrollFullHeightFullWidth:{position:"absolute"},tableRoot:{outline:"none"},responsiveBase:{overflow:"auto","@media print":{height:"auto !important"}},responsiveScroll:{overflow:"auto",height:"100%"},responsiveScrollMaxHeight:{overflow:"auto",height:"100%"},responsiveScrollFullHeight:{height:"100%"},responsiveStacked:k.default({overflow:"auto"},v.breakpoints.down("md"),{overflow:"hidden"}),responsiveStackedFullWidth:{},caption:{position:"absolute",left:"-3000px"},liveAnnounce:{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}}},Ra={INITIAL:1,UPDATE:2},Xb=["title","filter","search","print","download","viewColumns","customToolbar"],Jb=function(v,T){return v.title=T,!ga.default(En.default(Xb,function(x){return v[x]}))},dn={REPLACE:"replace",ABOVE:"above",NONE:"none",ALWAYS:"always"},Al=function(v){tr.default(x,v);var T=Kb(x);function x(h){var c,l;pr.default(this,x),l=T.call(this,h),k.default(Z.default(l),"getDefaultOptions",function(){return{caseSensitive:!1,consoleWarnings:!0,disableToolbarSelect:!1,download:!0,downloadOptions:{filename:"tableDownload.csv",separator:","},draggableColumns:{enabled:!1,transitionTime:300},elevation:4,enableNestedDataAccess:"",expandableRows:!1,expandableRowsHeader:!0,expandableRowsOnClick:!1,filter:!0,filterArrayFullMatch:!0,filterType:"dropdown",fixedHeader:!0,fixedSelectColumn:!0,pagination:!0,print:!0,resizableColumns:!1,responsive:"vertical",rowHover:!0,rowsPerPageOptions:[10,15,100],search:!0,selectableRows:"multiple",selectableRowsHideCheckboxes:!1,selectableRowsOnClick:!1,selectableRowsHeader:!0,serverSide:!1,serverSideFilterList:null,setTableProps:function(){return{}},sort:!0,sortFilterList:!0,tableBodyHeight:"auto",tableBodyMaxHeight:null,sortOrder:{},textLabels:Ub(),viewColumns:!0,selectToolbarPlacement:dn.REPLACE}}),k.default(Z.default(l),"warnDep",function(y,b){Ei(y,l.options.consoleWarnings)}),k.default(Z.default(l),"warnInfo",function(y,b){Wa(y,l.options.consoleWarnings)}),k.default(Z.default(l),"handleOptionDeprecation",function(y){var b,g,_,P;typeof l.options.selectableRows=="boolean"&&(l.warnDep("Using a boolean for selectableRows has been deprecated. Please use string option: multiple | single | none"),l.options.selectableRows=l.options.selectableRows?"multiple":"none"),st.default(b=["standard","vertical","verticalAlways","simple"]).call(b,l.options.responsive)===-1&&(st.default(_=["scrollMaxHeight","scrollFullHeight","stacked","stackedFullWidth","scrollFullHeightFullWidth","scroll"]).call(_,l.options.responsive)!==-1?l.warnDep(l.options.responsive+" has been deprecated, but will still work in version 3.x. Please use string option: standard | vertical | simple. More info: https://github.com/gregnb/mui-datatables/tree/master/docs/v2_to_v3_guide.md"):l.warnInfo(l.options.responsive+" is not recognized as a valid input for responsive option. Please use string option: standard | vertical | simple. More info: https://github.com/gregnb/mui-datatables/tree/master/docs/v2_to_v3_guide.md")),l.options.onRowsSelect&&l.warnDep("onRowsSelect has been renamed onRowSelectionChange. More info: https://github.com/gregnb/mui-datatables/tree/master/docs/v2_to_v3_guide.md"),l.options.onRowsExpand&&l.warnDep("onRowsExpand has been renamed onRowExpansionChange. More info: https://github.com/gregnb/mui-datatables/tree/master/docs/v2_to_v3_guide.md"),l.options.fixedHeaderOptions&&(l.options.fixedHeaderOptions.yAxis!==void 0&&l.options.fixedHeader===void 0&&(l.options.fixedHeader=l.options.fixedHeaderOptions.yAxis),l.options.fixedHeaderOptions.xAxis!==void 0&&l.options.fixedSelectColumn===void 0&&(l.options.fixedSelectColumn=l.options.fixedHeaderOptions.xAxis),l.warnDep("fixedHeaderOptions will still work but has been deprecated in favor of fixedHeader and fixedSelectColumn. More info: https://github.com/gregnb/mui-datatables/tree/master/docs/v2_to_v3_guide.md")),l.options.serverSideFilterList&&l.warnDep("serverSideFilterList will still work but has been deprecated in favor of the confirmFilters option. See this example for details: https://github.com/gregnb/mui-datatables/blob/master/examples/serverside-filters/index.js More info here: https://github.com/gregnb/mui-datatables/tree/master/docs/v2_to_v3_guide.md"),me.default(g=y.columns).call(g,function(E){E.options&&E.options.customFilterListRender&&l.warnDep("The customFilterListRender option has been deprecated. It is being replaced by customFilterListOptions.render (Specify customFilterListOptions: { render: Function } in column options.)")}),l.options.disableToolbarSelect===!0&&l.warnDep('disableToolbarSelect has been deprecated but will still work in version 3.x. It is being replaced by "selectToolbarPlacement"="none". More info: https://github.com/gregnb/mui-datatables/tree/master/docs/v2_to_v3_guide.md'),Xn.default&&st.default(P=Xn.default(dn)).call(P,l.options.selectToolbarPlacement)===-1&&l.warnDep("Invalid option value for selectToolbarPlacement. Please check the documentation: https://github.com/gregnb/mui-datatables#options")}),k.default(Z.default(l),"setTableAction",function(y){typeof l.options.onTableChange=="function"&&l.options.onTableChange(y,l.state),l.options.storageKey&&Gb(l.options.storageKey,l.state)}),k.default(Z.default(l),"setTableInit",function(y){typeof l.options.onTableInit=="function"&&l.options.onTableInit(y,l.state)}),k.default(Z.default(l),"setHeadCellRef",function(y,b,g){l.draggableHeadCellRefs[y]=g,l.resizeHeadCellRefs[b]=g}),k.default(Z.default(l),"getTableContentRef",function(){return l.tableContent.current}),k.default(Z.default(l),"buildColumns",function(y){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],g=arguments.length>2?arguments[2]:void 0,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],P=[],E=[],N=[],H=[];return Pe.default(y).call(y,function(D,L){var M={display:"true",empty:!1,filter:!0,sort:!0,print:!0,searchable:!0,download:!0,viewColumns:!0,sortCompare:null,sortThirdClickReset:!1,sortDescFirst:!1};H.push(L);var U=Yr({},D.options);dr.default(D)==="object"?(U&&(U.display!==void 0&&(U.display=U.display.toString()),(U.sortDirection===null||U.sortDirection)&&l.warnDep("The sortDirection column field has been deprecated. Please use the sortOrder option on the options object. More info: https://github.com/gregnb/mui-datatables/tree/master/docs/v2_to_v3_guide.md")),U.display===void 0&&b[L]&&b[L].name===D.name&&b[L].display&&(U.display=b[L].display),M=Yr(Yr({name:D.name,label:D.label?D.label:D.name},M),U)):(b[L]&&b[L].display&&(U.display=b[L].display),M=Yr(Yr(Yr({},M),U),{},{name:D,label:D})),P.push(M),E[L]=[],N[L]=[]}),at.default(g)?H=g:at.default(_)&&at.default(y)&&at.default(b)&&y.length===b.length&&(H=_),{columns:P,filterData:E,filterList:N,columnOrder:H}}),k.default(Z.default(l),"transformData",function(y,b){var g=l.options.enableNestedDataAccess;return at.default(b[0])?me.default(b).call(b,function(_){var P=-1;return me.default(y).call(y,function(E){return E.empty||P++,E.empty?void 0:_[P]})}):me.default(b).call(b,function(_){return me.default(y).call(y,function(P){return E=_,N=P.name,Bt.default(H=g?N.split(g):N.split()).call(H,function(D,L){return D?D[L]:void 0},E);var E,N,H})})}),k.default(Z.default(l),"hasSearchText",function(y,b,g){var _=y.toString(),P=b.toString();return g||(P=P.toLowerCase(),_=_.toLowerCase()),st.default(_).call(_,P)>=0}),k.default(Z.default(l),"updateDataCol",function(y,b,g){l.setState(function(_){var P,E,N=ut.default(_.data),H=ut.default(_.filterData),D=l.getTableMeta(y,b,y,_.columns[b],_.data,_,_.data),L=_.columns[b].customBodyRender(g,D),M=I.default.isValidElement(L)&&L.props.value?L.props.value:_.data[y][b],U=st.default(P=H[b]).call(P,M);if(lt.default(E=H[b]).call(E,U,1,M),N[y].data[b]=g,l.options.sortFilterList){var K,J=mf();Wt.default(K=H[b]).call(K,J)}return{data:N,filterData:H,displayData:l.getDisplayData(_.columns,N,_.filterList,_.searchText,null,l.props)}})}),k.default(Z.default(l),"getTableMeta",function(y,b,g,_,P,E,N){return E.columns,E.data,E.displayData,E.filterData,{rowIndex:y,columnIndex:b,columnData:_,rowData:g,tableData:P,tableState:nt.default(E,qb),currentTableData:N}}),k.default(Z.default(l),"toggleViewColumn",function(y){l.setState(function(b){var g=ut.default(b.columns);return g[y].display=g[y].display==="true"?"false":"true",{columns:g}},function(){l.setTableAction("viewColumnsChange");var b=l.options.onViewColumnsChange||l.options.onColumnViewChange;b&&b(l.state.columns[y].name,l.state.columns[y].display==="true"?"add":"remove")})}),k.default(Z.default(l),"updateColumns",function(y){l.setState(function(b){return{columns:y}},function(){l.setTableAction("viewColumnsChange");var b=l.options.onViewColumnsChange||l.options.onColumnViewChange;b&&b(null,"update",y)})}),k.default(Z.default(l),"toggleSortColumn",function(y){l.setState(function(b){var g,_=ut.default(b.columns),P=b.data,E=_[y].sortDescFirst?"desc":"asc",N=["asc","desc"];if(_[y].sortDescFirst&&(N=["desc","asc"]),_[y].sortThirdClickReset&&N.push("none"),_[y].name===l.state.sortOrder.name){var H=st.default(N).call(N,l.state.sortOrder.direction);H!==-1&&(++H>=N.length&&(H=0),E=N[H])}var D={name:_[y].name,direction:E},L=l.getSortDirectionLabel(D),M={columns:_,announceText:tt.default(g="Table now sorted by ".concat(_[y].name," : ")).call(g,L),activeColumn:y};if(l.options.serverSide)M=Yr(Yr({},M),{},{data:b.data,displayData:b.displayData,selectedRows:b.selectedRows,sortOrder:D});else{var U=l.sortTable(P,y,E,_[y].sortCompare);M=Yr(Yr({},M),{},{data:U.data,displayData:l.getDisplayData(_,U.data,b.filterList,b.searchText,null,l.props),selectedRows:U.selectedRows,sortOrder:D,previousSelectedRow:null})}return M},function(){l.setTableAction("sort"),l.options.onColumnSortChange&&l.options.onColumnSortChange(l.state.sortOrder.name,l.state.sortOrder.direction)})}),k.default(Z.default(l),"changeRowsPerPage",function(y){var b=l.options.count||l.state.displayData.length;l.setState(function(){return{rowsPerPage:y,page:ta(b,y,l.state.page)}},function(){l.setTableAction("changeRowsPerPage"),l.options.onChangeRowsPerPage&&l.options.onChangeRowsPerPage(l.state.rowsPerPage)})}),k.default(Z.default(l),"changePage",function(y){l.setState(function(){return{page:y}},function(){l.setTableAction("changePage"),l.options.onChangePage&&l.options.onChangePage(l.state.page)})}),k.default(Z.default(l),"searchClose",function(){l.setState(function(y){return{searchText:null,displayData:l.options.serverSide?y.displayData:l.getDisplayData(y.columns,y.data,y.filterList,null,null,l.props)}},function(){l.setTableAction("search"),l.options.onSearchChange&&l.options.onSearchChange(l.state.searchText)})}),k.default(Z.default(l),"searchTextUpdate",function(y){l.setState(function(b){return{searchText:y&&y.length?y:null,page:0,displayData:l.options.serverSide?b.displayData:l.getDisplayData(b.columns,b.data,b.filterList,y,null,l.props)}},function(){l.setTableAction("search"),l.options.onSearchChange&&l.options.onSearchChange(l.state.searchText)})}),k.default(Z.default(l),"resetFilters",function(){l.setState(function(y){var b,g=me.default(b=y.columns).call(b,function(){return[]});return{filterList:g,displayData:l.options.serverSide?y.displayData:l.getDisplayData(y.columns,y.data,g,y.searchText,null,l.props)}},function(){l.setTableAction("resetFilters"),l.options.onFilterChange&&l.options.onFilterChange(null,l.state.filterList,"reset",null)})}),k.default(Z.default(l),"updateFilterByType",function(y,b,g,_,P){var E,N,H,D=Jn.default(E=y[b]).call(E,function(L){return Et.default(L,g)});switch(_){case"checkbox":D>=0?lt.default(N=y[b]).call(N,D,1):y[b].push(g);break;case"chip":D>=0?lt.default(H=y[b]).call(H,D,1):y[b].push(g);break;case"multiselect":y[b]=g===""?[]:g;break;case"dropdown":y[b]=g;break;case"custom":P?y=P(y,D,b):y[b]=g;break;default:y[b]=D>=0||g===""?[]:[g]}}),k.default(Z.default(l),"filterUpdate",function(y,b,g,_,P,E){l.setState(function(N){var H=ut.default(N.filterList);return l.updateFilterByType(H,y,b,_,P),{page:0,filterList:H,displayData:l.options.serverSide?N.displayData:l.getDisplayData(N.columns,N.data,H,N.searchText,null,l.props),previousSelectedRow:null}},function(){l.setTableAction("filterChange"),l.options.onFilterChange&&l.options.onFilterChange(g,l.state.filterList,_,y,l.state.displayData),E&&E(l.state.filterList)})}),k.default(Z.default(l),"toggleAllExpandableRows",function(){var y=fr.default(l.state.expandedRows.data),b=l.options.isRowExpandable,g=[];if(y.length>0)for(var _=y.length-1;_>=0;_--){var P=y[_];(!b||b&&b(P.dataIndex,l.state.expandedRows))&&g.push(lt.default(y).call(y,_,1))}else for(var E=0;E2&&arguments[2]!==void 0?arguments[2]:[],_=l.options.selectableRows;if(_!=="none"){if(y==="head"){var P=l.options.isRowSelectable;l.setState(function(D){var L,M=D.displayData,U=D.selectedRows,K=D.selectedRows.data.length,J=K===M.length||K0,Q=Bt.default(M).call(M,function(ne,qe,Te){return(!P||P(M[Te].dataIndex,U))&&ne.push({index:Te,dataIndex:M[Te].dataIndex}),ne},[]),fe=fr.default(Q),le=Ct(fe);if(l.options.selectToolbarPlacement===dn.NONE)if(K>M.length)J=!0;else for(var $e=0;$e=0){if(lt.default(M).call(M,U,1),g.length>0)for(var J=Ct(g),Q=M.length-1;Q>=0;Q--)J[M[Q].dataIndex]&<.default(M).call(M,Q,1)}else if(_==="single")M=[b];else if(M.push(b),g.length>0){var fe=Ct(M);Pe.default(g).call(g,function(le){fe[le.dataIndex]||M.push(le)})}return{selectedRows:{lookup:Ct(M),data:M},previousSelectedRow:b}},function(){var D;if(l.setTableAction("rowSelectionChange"),l.options.onRowSelectionChange)l.options.onRowSelectionChange([b],l.state.selectedRows.data,me.default(D=l.state.selectedRows.data).call(D,function(M){return M.dataIndex}));else if(l.options.onRowsSelect){var L;l.options.onRowsSelect([b],l.state.selectedRows.data,me.default(L=l.state.selectedRows.data).call(L,function(M){return M.dataIndex}))}});else if(y==="custom"){var E=l.state.displayData,N=me.default(b).call(b,function(D){return{index:D,dataIndex:E[D].dataIndex}}),H=Ct(N);l.setState({selectedRows:{data:N,lookup:H},previousSelectedRow:null},function(){var D;if(l.setTableAction("rowSelectionChange"),l.options.onRowSelectionChange)l.options.onRowSelectionChange(l.state.selectedRows.data,l.state.selectedRows.data,me.default(D=l.state.selectedRows.data).call(D,function(M){return M.dataIndex}));else if(l.options.onRowsSelect){var L;l.options.onRowsSelect(l.state.selectedRows.data,l.state.selectedRows.data,me.default(L=l.state.selectedRows.data).call(L,function(M){return M.dataIndex}))}})}}}),l.tableRef=I.default.createRef(),l.tableContent=I.default.createRef(),l.draggableHeadCellRefs={},l.resizeHeadCellRefs={},l.timers={},l.setHeadResizeable=function(){},l.updateDividers=function(){},l.mergeDefaultOptions(h);var R=Wb(h.options.storageKey);return l.state=zt.default({activeColumn:null,announceText:null,count:0,columns:[],expandedRows:{data:[],lookup:{}},data:[],displayData:[],filterData:[],filterList:[],page:0,previousSelectedRow:null,rowsPerPage:10,searchProps:{},searchText:null,selectedRows:{data:[],lookup:{}},showResponsive:!1,sortOrder:{}},R||l.getInitTableOptions()),l.setTableData=_t.default(c=l.setTableData).call(c,Z.default(l)),l.setTableData(h,Ra.INITIAL,!0,null,!0),l}return Rt.default(x,[{key:"componentDidMount",value:function(){this.setHeadResizeable(this.resizeHeadCellRefs,this.tableRef),this.props.options.searchText&&!this.props.options.serverSide&&this.setState({page:0}),this.setTableInit("tableInitialized")}},{key:"componentDidUpdate",value:function(h){var c=this;if(this.props.data!==h.data||this.props.columns!==h.columns||this.props.options!==h.options){this.updateOptions(this.options,this.props);var l=this.props.data!==h.data;this.props.data&&h.data&&(l=l&&this.props.data.length===h.data.length),this.setTableData(this.props,Ra.INITIAL,l,function(){c.setTableAction("propsUpdate")})}this.props.options.searchText===h.options.searchText||this.props.options.serverSide||this.setState({page:0}),(this.options.resizableColumns===!0||this.options.resizableColumns&&this.options.resizableColumns.enabled)&&(this.setHeadResizeable(this.resizeHeadCellRefs,this.tableRef),this.updateDividers())}},{key:"updateOptions",value:function(h,c){c.options.disableToolbarSelect===!0&&c.options.selectToolbarPlacement===void 0&&(c.options.selectToolbarPlacement=dn.NONE),c.options.tableId||(c.options.tableId=(Math.random()+"").replace(/\./,"")),this.options=br.default(h,c.options,function(l,R,y){if(y==="textLabels"||y==="downloadOptions")return ya.default(l,R)}),this.handleOptionDeprecation(c)}},{key:"mergeDefaultOptions",value:function(h){var c=this.getDefaultOptions(),l=zt.default({},h);l.options=l.options||{},this.updateOptions(c,l)}},{key:"validateOptions",value:function(h){var c;if(h.serverSide&&h.onTableChange===void 0)throw Error("onTableChange callback must be provided when using serverSide option");if(h.expandableRows&&h.renderExpandableRow===void 0)throw Error("renderExpandableRow must be provided when using expandableRows option");h.rowsSelected&&at.default(h.rowsSelected)&&Dr.default(c=h.rowsSelected).call(c,isNaN)&&Wa("When using the rowsSelected option, must be provided an array of numbers only.")}},{key:"getInitTableOptions",value:function(){var h=this,c=["rowsPerPage","page","rowsSelected","rowsPerPageOptions"],l=Bt.default(c).call(c,function(R,y){return h.options[y]!==void 0&&(R[y]=h.options[y]),R},{});return this.validateOptions(l),l}},{key:"setTableData",value:function(h,c,l){var R,y,b,g=this,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){},P=arguments.length>4&&arguments[4]!==void 0&&arguments[4],E=[],N=this.buildColumns(h.columns,this.state.columns,this.options.columnOrder,this.state.columnOrder),H=N.columns,D=N.filterData,L=N.filterList,M=N.columnOrder,U=null,K="none";this.options.sortOrder&&this.options.sortOrder.direction&&this.options.sortOrder.name?y=zt.default({},this.options.sortOrder):(y=zt.default({},this.state.sortOrder)).direction||Pe.default(b=h.columns).call(b,function(_e,ie){!_e.options||_e.options.sortDirection!=="asc"&&_e.options.sortDirection!=="desc"||(y.name=_e.name,y.sortDirection=_e.sortDirection)});var J=c===Ra.INITIAL?this.transformData(H,h.data):h.data,Q=c===Ra.INITIAL?this.options.searchText:null;this.options.searchText===void 0&&this.state.searchText!==void 0&&(Q=this.state.searchText);var fe=this.state.rowsPerPage;typeof this.options.rowsPerPage=="number"&&(fe=this.options.rowsPerPage);var le=this.state.page;typeof this.options.page=="number"&&(le=this.options.page),Pe.default(H).call(H,function(_e,ie){for(var Y=0;Y0&&(L[ie]=ut.default(g.state.filterList[ie])),g.options.sortFilterList){var ma,jn=mf();Wt.default(ma=D[ie]).call(ma,jn)}_e.name===y.name&&(K=y.direction,U=ie)});var $e={data:[],lookup:{}},ne={data:[],lookup:{}};{var qe,Te,ye;if(this.options.rowsSelected&&this.options.rowsSelected.length&&this.options.selectableRows==="multiple")Pe.default(qe=He.default(Te=this.options.rowsSelected).call(Te,function(_e){return _e===0||Number(_e)&&_e>0})).call(qe,function(_e){for(var ie=_e,Y=0;Y1&&this.options.selectableRows==="single"?console.error('Multiple values provided for selectableRows, but selectableRows set to "single". Either supply only a single value or use "multiple".'):this.options.rowsSelected===void 0&&l===!1&&this.state.selectedRows&&($e=zt.default({},this.state.selectedRows));this.options.rowsExpanded&&this.options.rowsExpanded.length&&this.options.expandableRows?Pe.default(ye=this.options.rowsExpanded).call(ye,function(_e){for(var ie=_e,Y=0;Y=0})||(N=!0):Dr.default(Te).call(Te,function(pe){return st.default(Q).call(Q,pe)>=0})||(N=!0)):N=!0),y&&fe.display!=="excluded"&&E.hasSearchText(qe,y,ye)&&fe.display!=="false"&&fe.searchable&&(H=!0)},M=0;M3&&arguments[3]!==void 0?arguments[3]:null,g=this.options.customSort&&!b,_={selectedRows:this.state.selectedRows},P=g?this.options.customSort(h,c,l||(this.options.sortDescFirst?"desc":"asc"),_):h;l==="none"&&(R=Bt.default(h).call(h,function(U,K){return U[K.index]=K,U},[]));var E=me.default(P).call(P,function(U,K){return{data:U.data[c],rowData:U.data,position:K,rowSelected:!!y.state.selectedRows.lookup[U.index]}});if(!g){var N=b||ib;Wt.default(E).call(E,N(l))}for(var H=[],D=[],L=0;L0&&this.options.selectToolbarPlacement!==dn.NONE)&&I.default.createElement(ba,{options:this.options,selectedRows:ot,onRowsDelete:this.selectRowDelete,displayData:Te,selectRowUpdate:this.selectRowUpdate,components:this.props.components}),(ot.data.length===0||st.default(R=[dn.ABOVE,dn.NONE]).call(R,this.options.selectToolbarPlacement)!==-1)&&Mo&&I.default.createElement(za,{columns:ye,columnOrder:We,displayData:Te,data:qe,filterData:pe,filterList:ht,filterUpdate:this.filterUpdate,updateFilterByType:this.updateFilterByType,options:this.options,resetFilters:this.resetFilters,searchText:Y,searchTextUpdate:this.searchTextUpdate,searchClose:this.searchClose,tableRef:this.getTableContentRef,title:E,toggleViewColumn:this.toggleViewColumn,updateColumns:this.updateColumns,setTableAction:this.setTableAction,components:this.props.components}),I.default.createElement(pn,{options:this.options,serverSideFilterList:this.props.options.serverSideFilterList,filterListRenderers:me.default(ye).call(ye,function(Xt){return Xt.customFilterListOptions&&Xt.customFilterListOptions.render?Xt.customFilterListOptions.render:Xt.customFilterListRender?Xt.customFilterListRender:function(iS){return iS}}),customFilterListUpdate:me.default(ye).call(ye,function(Xt){return Xt.customFilterListOptions&&Xt.customFilterListOptions.update?Xt.customFilterListOptions.update:null}),filterList:ht,filterUpdate:this.filterUpdate,columnNames:Li}),I.default.createElement("div",{style:Yr({position:"relative"},Jr),className:y},(this.options.resizableColumns===!0||this.options.resizableColumns&&this.options.resizableColumns.enabled)&&I.default.createElement(Mr,{key:Ga,columnOrder:We,updateDividers:function(Xt){return b.updateDividers=Xt},setResizeable:function(Xt){return b.setHeadResizeable=Xt},options:this.props.options,tableId:this.options.tableId}),(kl=I.default.createElement(Rn.default,Fe.default({ref:function(Xt){return b.tableRef=Xt},tabIndex:"0",role:"grid",className:oS},Lo),I.default.createElement("caption",{className:_.caption},E),I.default.createElement(jn,{columns:ye,activeColumn:ne,data:Te,count:Ga,page:Je,rowsPerPage:ko,selectedRows:ot,selectRowUpdate:b.selectRowUpdate,toggleSort:b.toggleSortColumn,setCellRef:b.setHeadCellRef,expandedRows:ie,areAllRowsExpanded:b.areAllRowsExpanded,toggleAllExpandableRows:b.toggleAllExpandableRows,options:b.options,sortOrder:te,columnOrder:We,updateColumnOrder:b.updateColumnOrder,draggableHeadCellRefs:b.draggableHeadCellRefs,tableRef:b.getTableContentRef,tableId:b.options.tableId,timers:b.timers,components:b.props.components}),I.default.createElement(Xr,{data:Te,count:Ga,columns:ye,page:Je,rowsPerPage:ko,selectedRows:ot,selectRowUpdate:b.selectRowUpdate,previousSelectedRow:_e,expandedRows:ie,toggleExpandRow:b.toggleExpandRow,options:b.options,columnOrder:We,filterList:ht,components:b.props.components,tableId:b.options.tableId}),b.options.customTableBodyFooterRender?b.options.customTableBodyFooterRender({data:Te,count:Ga,columns:ye,selectedRows:ot,selectableRows:b.options.selectableRows}):null),fe?I.default.createElement(Gr.DndProvider,Fe.default({backend:fe},Df),kl):kl)),I.default.createElement(ma,{options:this.options,page:Je,rowCount:Ga,rowsPerPage:ko,changeRowsPerPage:this.changeRowsPerPage,changePage:this.changePage}),I.default.createElement("div",{className:_.liveAnnounce,"aria-live":"polite"},$e))}}]),x}(I.default.Component);k.default(Al,"propTypes",{title:$.default.oneOfType([$.default.string,$.default.element]).isRequired,data:$.default.array.isRequired,columns:$.default.PropTypes.arrayOf($.default.oneOfType([$.default.string,$.default.shape({label:$.default.string,name:$.default.string.isRequired,options:$.default.shape({display:$.default.oneOf(["true","false","excluded","always",!0,!1]),empty:$.default.bool,filter:$.default.bool,sort:$.default.bool,print:$.default.bool,searchable:$.default.bool,download:$.default.bool,viewColumns:$.default.bool,filterList:$.default.array,filterOptions:$.default.oneOfType([$.default.array,$.default.shape({names:$.default.array,logic:$.default.func,display:$.default.func})]),filterType:$.default.oneOf(["dropdown","checkbox","multiselect","textField","custom"]),customHeadRender:$.default.func,customBodyRender:$.default.func,customBodyRenderLite:$.default.func,customHeadLabelRender:$.default.func,customFilterListOptions:$.default.oneOfType([$.default.shape({render:$.default.func,update:$.default.func})]),customFilterListRender:$.default.func,setCellProps:$.default.func,setCellHeaderProps:$.default.func,sortThirdClickReset:$.default.bool,sortDescFirst:$.default.bool})})])).isRequired,options:$.default.shape({caseSensitive:$.default.bool,columnOrder:$.default.array,count:$.default.number,confirmFilters:$.default.bool,consoleWarnings:$.default.bool,customFilterDialogFooter:$.default.func,customFooter:$.default.oneOfType([$.default.func,$.default.element]),customRowRender:$.default.func,customSearch:$.default.func,customSearchRender:$.default.oneOfType([$.default.func,$.default.element]),customSort:$.default.func,customToolbar:$.default.oneOfType([$.default.func,$.default.element]),customToolbarSelect:$.default.oneOfType([$.default.func,$.default.element]),draggableColumns:$.default.object,enableNestedDataAccess:$.default.string,expandableRows:$.default.bool,expandableRowsHeader:$.default.bool,expandableRowsOnClick:$.default.bool,disableToolbarSelect:$.default.bool,download:$.default.oneOf([!0,!1,"true","false","disabled"]),downloadOptions:$.default.shape({filename:$.default.string,separator:$.default.string,filterOptions:$.default.shape({useDisplayedColumnsOnly:$.default.bool,useDisplayedRowsOnly:$.default.bool})}),filter:$.default.oneOf([!0,!1,"true","false","disabled"]),filterArrayFullMatch:$.default.bool,filterType:$.default.oneOf(["dropdown","checkbox","multiselect","textField","custom"]),fixedHeader:$.default.bool,fixedSelectColumn:$.default.bool,getTextLabels:$.default.func,isRowExpandable:$.default.func,isRowSelectable:$.default.func,jumpToPage:$.default.bool,onDownload:$.default.func,onFilterChange:$.default.func,onFilterChipClose:$.default.func,onFilterConfirm:$.default.func,onFilterDialogOpen:$.default.func,onFilterDialogClose:$.default.func,onRowClick:$.default.func,onRowsExpand:$.default.func,onRowExpansionChange:$.default.func,onRowsSelect:$.default.func,onRowSelectionChange:$.default.func,onTableChange:$.default.func,onTableInit:$.default.func,page:$.default.number,pagination:$.default.bool,print:$.default.oneOf([!0,!1,"true","false","disabled"]),searchProps:$.default.object,selectableRows:$.default.oneOfType([$.default.bool,$.default.oneOf(["none","single","multiple"])]),selectableRowsHeader:$.default.bool,selectableRowsHideCheckboxes:$.default.bool,selectableRowsOnClick:$.default.bool,serverSide:$.default.bool,tableId:$.default.string,tableBodyHeight:$.default.string,tableBodyMaxHeight:$.default.string,renderExpandableRow:$.default.func,resizableColumns:$.default.oneOfType([$.default.bool,$.default.object]),responsive:$.default.oneOf(["standard","vertical","verticalAlways","simple"]),rowHover:$.default.bool,rowsExpanded:$.default.array,rowsPerPage:$.default.number,rowsPerPageOptions:$.default.array,rowsSelected:$.default.array,search:$.default.oneOf([!0,!1,"true","false","disabled"]),searchOpen:$.default.bool,searchAlwaysOpen:$.default.bool,searchPlaceholder:$.default.string,searchText:$.default.string,setFilterChipProps:$.default.func,setRowProps:$.default.func,selectToolbarPlacement:$.default.oneOfType([$.default.bool,$.default.oneOf([dn.REPLACE,dn.ABOVE,dn.NONE,dn.ALWAYS])]),setTableProps:$.default.func,sort:$.default.bool,sortOrder:$.default.object,storageKey:$.default.string,viewColumns:$.default.oneOf([!0,!1,"true","false","disabled"])}),className:$.default.string,components:$.default.objectOf($.default.any)}),k.default(Al,"defaultProps",{title:"",options:{},data:[],columns:[],components:{TableBody:$l,TableFilter:_l,TableFilterList:Di,TableFooter:Ai,TableHead:Il,TableResize:Pl,TableToolbar:El,TableToolbarSelect:Dl,Tooltip:Gt.default,icons:{}}});var Qb=Qe.withStyles(Al,Yb,{name:"MUIDataTable"});function Zb(v){var T=eS();return function(){var x,h=Ge.default(v);if(T){var c=Ge.default(this).constructor;x=we.default(h,arguments,c)}else x=h.apply(this,arguments);return et.default(this,x)}}function eS(){if(typeof Reflect>"u"||!we.default||we.default.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(we.default(Boolean,[],function(){})),!0}catch{return!1}}function tS(v,T,x){var h;return function(){var c=this,l=arguments,R=function(){h=null,v.apply(c,l)};clearTimeout(h),h=bt.default(R,T)}}var rS=function(v){return{main:{display:"flex",flex:"1 0 auto",alignItems:"center"},searchIcon:{color:v.palette.text.secondary,marginRight:"8px"},searchText:{flex:"0.8 0"},clearIcon:{"&:hover":{color:v.palette.error.main}}}},nS=function(v){tr.default(x,v);var T=Zb(x);function x(){var h,c;pr.default(this,x);for(var l=arguments.length,R=new Array(l),y=0;y0&&arguments[0]!==void 0?arguments[0]:200;return function(T,x,h,c){return I.default.createElement(Ef,{searchText:T,onSearch:x,onHide:h,options:c,debounceWait:v})}}e.DebounceTableSearch=Ef,e.ExpandButton=Yt,e.Popover=ki,e.TableBody=$l,e.TableBodyCell=oe,e.TableBodyRow=Vt,e.TableFilter=_l,e.TableFilterList=Di,e.TableFooter=Ai,e.TableHead=Il,e.TableHeadCell=Tl,e.TableHeadRow=xl,e.TablePagination=Ol,e.TableResize=Pl,e.TableSearch=If,e.TableSelectCell=Vr,e.TableToolbar=El,e.TableToolbarSelect=Dl,e.TableViewCol=Rl,e.debounceSearchRender=aS,e.default=Qb})(uh);const AW=sS(uh);export{AW as M,n4 as a,CL as b,_L as d}; diff --git a/build/assets/index-CeyyVc1v.js b/build/assets/index-CeyyVc1v.js new file mode 100644 index 0000000..79aae88 --- /dev/null +++ b/build/assets/index-CeyyVc1v.js @@ -0,0 +1,71 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Auth-CFWkZDlN.js","assets/mui-vendor-CkIVaoQP.js","assets/react-vendor-CmFgShSM.js","assets/Captcha-CBxUIUNI.js","assets/redux-vendor-B7uoacJt.js","assets/Visibility-DeyjG-oI.js","assets/get-announcement-5NHhejXl.js","assets/Support-B9DfdFaF.js","assets/Phone-Dv2y8iMM.js","assets/WagePayment-C-ToCy2g.js","assets/num2persian-BIYy8amq.js","assets/SlaughterPayFeesGateway-BhtyiEES.js","assets/SimpleTable-DBAoNnCU.js","assets/index-CIfb_iLp.js","assets/Close-_jAEIgMD.js","assets/Search-Dek2fED1.js","assets/Delete-C5MyLelE.js","assets/DownloadReport-Kp5MocZr.js","assets/ChickenLogo-BK6_Z2uq.js","assets/ProvinceRequests-hAb6-LPy.js","assets/NavLink-D2GD_ItM.js","assets/LinkItem-DT6qswcs.js","assets/index.esm-CjWvmHks.js","assets/iconBase-BEJYyZsk.js","assets/index.esm-BY9chGNa.js","assets/index.esm-BcDC8KuM.js","assets/LineWithText-BpnpjRWf.js","assets/AdvancedTable-BYmmBtmq.js","assets/Plagiarism-BiXORbzo.js","assets/useRequestFile-FPqBpZfN.js","assets/index-9Ymn_7Kv.js","assets/ProvinceFreeSales-oCkrGhR8.js","assets/index.esm-Bu7XMDZU.js","assets/LabelField-B6eRSoQP.js","assets/aviculture-get-hatching-data-DsjDNd82.js","assets/Add--yVWBJhC.js","assets/NumberFormatCustom-DwWPj40N.js","assets/DialogAlert-BfXcr-Kr.js","assets/Done-Dp5awdte.js","assets/aviculture-get-unions-C1NoVg85.js","assets/CarPelak-BYFY8OXg.js","assets/isValidIndexWeight-C_ik-uYa.js","assets/ResponsiveTable-w7hk7Uq8.js","assets/FilterAlt-scT0HEUg.js","assets/styled-components.browser.esm-gS9mh05b.js","assets/Tune-D4M2CAhp.js","assets/Edit-CqBj1Y2L.js","assets/VetFarmSubmitClearanceCode-B4m3TtXY.js","assets/Pageview-TRcW_9jm.js","assets/ToggleOn-pBgb8alR.js","assets/ToggleOff-D4LkiR4X.js","assets/Check-CRb6laYC.js","assets/Sms-DasNClAG.js","assets/AvicultureArchivedRequests-Bul1i4cq.js","assets/RequestsAwaitingInspections-C8DP5FQL.js","assets/BackButton-Crzr7NMa.js","assets/hour-limit-get-kill-request-HFzpgBg7.js","assets/delete-debtor-killhouses-DJCuTTOS.js","assets/VpnKey-Di_7HUWD.js","assets/useGetAllocationInformation-DFB6N6mk.js","assets/ProvinceSelectSlaughterForSlaughter-DoXgfxS6.js","assets/EnterAuthCodeDirectBuy-zD0YV5ZE.js","assets/DoneOutline-DQzOHpRS.js","assets/ThumbUpAlt-HKYD-o6a.js","assets/province-get-sell-for-freezing-status-ieuVFEgW.js","assets/ProvinceSettlementPdfKillRequest-ChEooZGT.js","assets/PictureAsPdf-oEJEta1d.js","assets/slaughter-get-provinces-CSWL-EuK.js","assets/CityHatchingsArchiveOperations-DQ9mbEeF.js","assets/FileUploader-DT5gIVb3.js","assets/CloudUpload-BlIgB_r9.js","assets/CheckCircle-zgBvZQ-b.js","assets/ChainBarManagement-BxgsJV2X.js","assets/Settings-BckUi175.js","assets/AddCircleOutline-C8LXM-k8.js","assets/ProvinceManagePricing-C6sFsNo-.js","assets/CustomCard-B-6dDbAN.js","assets/ProvinceProducts-CJk-kZIC.js","assets/CarManagement-Chl2SE7Y.js","assets/EditOutlined-n5ie2Fmu.js","assets/DeleteOutline-DlhNLp0A.js","assets/ProvinceUserManagement-CHb4mhM7.js","assets/province-register-user-DVseE2hL.js","assets/city-get-city-qTSRxslT.js","assets/province-get-kill-houses-C3UQguyo.js","assets/SelectCheck-CAe89SYT.js","assets/Guilds-CrGG7yyR.js","assets/index.esm-fCjAhNPc.js","assets/Send-CA1iNvJP.js","assets/CreateGuilds-CCT3R9v5.js","assets/Person-Q1IHBezR.js","assets/Badge-u1S44abW.js","assets/Cake-CkaTUHNX.js","assets/Business-J-mGuLnc.js","assets/ManageGuildsOperations-DTKLlkN3.js","assets/PspActiveSession-DQjcq8bm.js","assets/ProvinceManageDistributionsSubmitCommitmentPercent-BeA64jYA.js","assets/SlaughterAgentShare-DjSsZVvD.js","assets/SlaughterManageInventoryAllocationOperations-Bla8JB6Q.js","assets/CheckCircleOutline-Ci9-hVKX.js","assets/SlaughterAllocateToGuild-Dfz5LRq5.js","assets/slaughter-get-guilds-for-allocate-B6OrhhMj.js","assets/toBase64-BzgTOHsW.js","assets/PublishedWithChanges-C8kvr_m4.js","assets/province-policy-upload-image-CRJ-U4Kc.js","assets/OperatorNewHatching-Dh3A7QxF.js","assets/CityNewKillRequest-C2SXYvKb.js","assets/province-policy-market-daily-limitation-DueqDboR.js","assets/slaughter-new-request-CTd5pQEl.js","assets/CityManageHatchings-vNwIRT4N.js","assets/CityHatchingInfo-CZPJ_c_O.js","assets/ShowImage-CqhU2hmk.js","assets/Download-DQ-VVIaV.js","assets/ToggleOffOutlined-Ch26Umk7.js","assets/ProvinceBarDifference-CBv5I_nz.js","assets/resizeImage-Csf2MO3w.js","assets/getProvinceName-BujSmyBy.js","assets/Article-DcCZ1D5y.js","assets/AvicultureNewRequest-C3L5QRVn.js","assets/NationalInfoTransports-Bzg92cmL.js","assets/getSamasatProvinces-BvJGUILK.js","assets/ChechClearanceCode-lPasOZZ_.js","assets/NationalInfo-DSCN5jIW.js","assets/VetFarmAllocations-COn5OrGn.js","assets/VetFarmOperation-BbOMvrl-.js","assets/VetFarmAggregateBars-CA10Fi1e.js","assets/VetFarmDeletedBars-DqBCKO-S.js","assets/SlaughterManageBars-CW9paHF2.js","assets/VetFarmEditTrafficCode-D3hZa5p9.js","assets/SlaughterEnterNoneReciept-Cle0J4bf.js","assets/ReceiptLong-Dxpx4wPx.js","assets/getDocumentStates-BlCrMUIj.js","assets/SlaughterFreeBuyBars-CobAAajK.js","assets/DeleteOutlineOutlined-G071NcE9.js","assets/province-policy-get-aggregate-bar-info-allow-state-CO-Vk47I.js","assets/Refresh-DkAX1rkD.js","assets/free-buying-payment-DH20xTKI.js","assets/SendMassage-DcwNiFfb.js","assets/getRoleList-CoZzcy9u.js","assets/PageTable-C16Ol94B.js","assets/ManageProcess-BGlzQVMp.js","assets/province-policy-wages-edit-killhouse-Law73imd.js","assets/getSystemBaseAddress-B3dWKz82.js","assets/province-policy-get-slaughter-buying-price-status-XGKC4dNm.js","assets/province-policy-drop-limit-BQ-Lqckd.js","assets/province-policy-edit-trade-time-range-CFotCa7K.js","assets/Save-nlxmeU5w.js","assets/index.esm-YBNW__9r.js","assets/ManageProcess-DBlSLZ24.css","assets/ManageProcessWageFractions-Cl3DA4uk.js","assets/ManageFarm-BTM56jv5.js","assets/FileDownload-Br429XFy.js","assets/PolicyCouncil-0xtufC-L.js","assets/FilesState-DMM_jfCL.js","assets/ProvinceCases-0uMkWb0x.js","assets/ProvinceCases-D2p07oto.css","assets/FilesState-B1ZVhsGy.css","assets/BarInfos-BmLW4eH9.js","assets/Slaughters-Drh8o5nL.js","assets/SlaughterActiveRequests-9ZnaAVlL.js","assets/ProvinceUserFile-cShttUtU.js","assets/NavigateNext-ByUC5RGi.js","assets/InspectorEditAviculture-MsTqlKJp.js","assets/CitySubmitTenantForm-BnB_IQ2s.js","assets/Info-CZK82--l.js","assets/Users-CuH8b--q.js","assets/Poultries-DB3DCFBq.js","assets/ProvinceFees-UfT7wk-6.js","assets/ProvinceWagePaymentTransactions-OloKgjY0.js","assets/ArrowDownward-DdOsPC7b.js","assets/SystemUpdateAlt-Bu3pObDi.js","assets/BroadcastManagement-RkF4bwmH.js","assets/ProvinceReports-B30xgkxd.js","assets/index.esm-C4MeAo59.js","assets/Transactions-BSJVJOEU.js","assets/getPosProviderName-CYVCBpcT.js","assets/ProvinceGuildsTransactions-DY4o9JwV.js","assets/VisorStatics-RjLo9w8U.js","assets/html2canvas.esm-BfYXEYrK.js","assets/chart-vendor-sE2SUVPW.js","assets/AdvancedChart-DTCDh5lM.js","assets/TradePanel-nvBox6P7.js","assets/SlaughterHouseDispenserDashboard-JLw8VA3Q.js","assets/slaughter-house-submit-dispenser-service-AaVrL_nR.js","assets/slaughter-sell-carcass-out-province-BsZg6mNm.js","assets/province-get-dispenser-killhouses-BecKvYyt.js","assets/getAllocationType-76F45b0K.js","assets/steward-get-dashboard-service-CaN_8BvO.js","assets/steward-sell-out-delete-service-DtW7IkBy.js","assets/AdminHatchings-CjLz-abB.js","assets/ProvinceColdHousesPage-61BwlOTB.js","assets/SubSectorWage-C6GLWIJC.js","assets/ProvinceKillersWages-DomGWVQy.js","assets/DiffrenceKillerPage-KlaL3_Gy.js","assets/DashboardPage-CBj16f8q.js","assets/chartjs-plugin-datalabels.esm-DvNX1Acq.js","assets/AdminSettlement-QnXM2P7E.js","assets/DoneAll-BQY85Rt1.js","assets/PoultryScienceExperts-DLgx0ZrE.js","assets/ReturnPurchases-B5_lL37U.js","assets/ComponentsCatalog-RdvMiEfN.js","assets/Timer-DHCbB9tg.js","assets/ChartLenear-WgLA0J0V.js","assets/auto-gcBAg08D.js","assets/AdminXExcelCheck-Dhsh4oVZ.js","assets/AdminXDashboard-DfgejEhn.js","assets/AdminStatics-XraSRt5m.js","assets/Tickets-rkAj5df6.js","assets/ProvinceSendMessage-CZGfVdJQ.js","assets/MessagesSenders-Y1Gaf5ab.js","assets/NewFile-DzVKWg18.js","assets/FileInformation-BQPmtbts.js","assets/Factor-CqUlgaYq.js","assets/SlaughterPayProvinceFactorForm-QExXum_R.js","assets/ProvinceDispensersStock-BetLU9Ax.js","assets/index.esm-BVxcT1y_.js","assets/ProvinceDispensersStockSlug-DxEHlpI2.js","assets/PoultriesDetailsPage-Bu9GJg8X.js","assets/Inspection-BSxrKtLr.js","assets/PspCompany-DFqxFNI1.js","assets/AvicultureRequests-BpPrjqVS.js","assets/reactour.esm-9QIjTffK.js","assets/AvicultureHallInspects-JeacJRRj.js","assets/Auction-CSwFRyO3.js","assets/AvicultureHalls-BI0mP85Q.js","assets/AvicultureReports-Ca1oaxvj.js","assets/CityRequests-IZEUUx3s.js","assets/CityAvicultureManagement-BOhjmwTw.js","assets/CityUserManagement-CRqW-IWG.js","assets/CityUserFile-DzU1_wlZ.js","assets/SlaughterRequestsPage-DSn1nwnQ.js","assets/SlaughterSellCarcass-D_Twt9ez.js","assets/guild-allocated-stock-operation-BiIjKHlL.js","assets/SlaghterEnterBarInfo-uCfcHEct.js","assets/SlaughterInventoryPage-CLOKxd-H.js","assets/StewardSegmentOperation-B4ydd22p.js","assets/SlaughterMorgue-G6AVluZe.js","assets/SlaughterManageBars-B2jDKFOF.js","assets/SlaughterComplaints-7R6Gs51u.js","assets/getRemainedSeconds-D4cLRaa6.js","assets/Wallet-C8rTBC_i.js","assets/SlaughterFreeBuy-DL-UuT_T.js","assets/SlaughterManageDispensers-CeviUzsS.js","assets/ProvinceFinancial-D2wtnzpF.js","assets/ProvinceFinancialDebts-BtSseWWb.js","assets/ProvinceFinancialComplaints-D204yz0f.js","assets/ProvinceFinancialDocumentRegister-B88BVveg.js","assets/ProvinceSettlementPage-aomMVXar.js","assets/VetFarm-DwS6N0cZ.js","assets/VetFarmInspections-C5LeABjH.js","assets/Hatching-CKVP0ju2.js","assets/GeneralDashboard-C-xEqVw5.js","assets/Messages-kMYYq0zn.js","assets/Training-Yw94DwCN.js","assets/Payment-BnucYNy2.js","assets/Driver-CHyVUqPi.js","assets/Inspector-DMOgCEzJ.js","assets/InspectorReporting-Cw7P2uCF.js","assets/SlaughterHouseVet-BNaV_ELx.js","assets/AdminRequests-Bx6KBll9.js","assets/JahadKillStats-BePuGWF-.js","assets/JahadIllegalKilling-BZcreoc1.js","assets/Commerce-DWYrSvnH.js","assets/StewardInventoryPage-CK0n2VdV.js","assets/SenfInventoryPage-BGQA4pLz.js","assets/LiveStockSupportManageBars-DPW4OFsD.js","assets/LiveStockSupportCases-AKSvycFW.js","assets/LiveStockFreezingRequests-DG4F8ICf.js","assets/LiveStockColdHouse-BgWIbVgg.js","assets/ChainCompany-B42vuLDw.js","assets/DispenserDashboard-B53mNsdU.js","assets/ParentCompany-BF1TX0KI.js","assets/ProvinceJahadRequests-zfkXqXU8.js","assets/BarSquareTransactions-DgqWT2Jp.js","assets/GuildManageGuildsPage-D2fbeDME.js"])))=>i.map(i=>d[i]); +import{c as createTheme,u as utils$c,i as interopRequireDefaultExports,j as jsxRuntimeExports,s as styled,G as Grid2,B as Button,p as propTypesExports,T as Typography,a as Backdrop,b as Box,d as Tooltip,I as IconButton,e as Badge,M as Menu,A as Avatar,C as ChevronLeft,S as Storefront$1,f as ShoppingBasket,g as TravelExplore,P as Payment$3,E as Engineering,D as DriveEta,h as AssignmentReturn,F as Folder$1,k as FileCopy,W as Warning,l as Archive$1,m as AddBox,U as UploadFile,n as AddCircleOutline,o as AssignmentTurnedIn$1,q as DirectionsCarFilled,r as PriceChange,v as SettingsApplications,w as CorporateFare$1,x as generateUtilityClasses,y as generateUtilityClass,_ as _objectWithoutPropertiesLoose$3,z as useEnhancedEffect,H as _extends$6,J as composeClasses,K as alpha$1,L as useThemeProps,N as useTheme,O as useControlled,Q as useEventCallback$1,R as Fade,V as TransitionGroup,X as useForkRef,Y as ButtonBase,Z as CSSTransition,$ as useTheme$1,a0 as createSvgIcon$1,a1 as capitalize$2,a2 as useId,a3 as Grid$1,a4 as DialogActions,a5 as Grow,a6 as FocusTrap,a7 as ownerDocument,a8 as Popper,a9 as Paper,aa as InputAdornment,ab as Dialog,ac as dialogClasses,ad as DialogContent,ae as useMediaQuery,af as hoistStatics,ag as FormControl,ah as RadioGroup,ai as FormControlLabel,aj as Radio,ak as TextField,al as Autocomplete,am as Divider,an as List,ao as ListItem,ap as ListItemIcon,aq as ListItemText,ar as Chip,as as AppBar,at as Modal$1,au as Drawer,av as InputLabel,aw as Select,ax as MenuItem,ay as Alert,az as Snackbar,aA as CircularProgress,aB as _inheritsLoose$1,aC as createCache,aD as CacheProvider,aE as ThemeProvider}from"./mui-vendor-CkIVaoQP.js";import{d as reactDomExports,r as reactExports,a as getAugmentedNamespace,g as getDefaultExportFromCjs,e as commonjsGlobal,b as React,u as useNavigate,f as useLocation,c as ReactDOM,h as Routes,i as Route,N as Navigate,B as BrowserRouter}from"./react-vendor-CmFgShSM.js";import{c as createSlice,a as createAsyncThunk,b as combineReducers,d as configureStore,p as persistStore,t as thunk,e as persistReducer,u as useDispatch,f as useSelector,P as Provider}from"./redux-vendor-B7uoacJt.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function a(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerPolicy&&(i.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?i.credentials="include":n.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(n){if(n.ep)return;n.ep=!0;const i=a(n);fetch(n.href,i)}})();var client={},m=reactDomExports;client.createRoot=m.createRoot,client.hydrateRoot=m.hydrateRoot;const scriptRel="modulepreload",assetsURL=function(e){return"/"+e},seen={},__vitePreload=function(t,a,s){let n=Promise.resolve();if(a&&a.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),u=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));n=Promise.allSettled(a.map(l=>{if(l=assetsURL(l),l in seen)return;seen[l]=!0;const c=l.endsWith(".css"),_=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${_}`))return;const p=document.createElement("link");if(p.rel=c?"stylesheet":scriptRel,c||(p.as="script"),p.crossOrigin="",p.href=l,u&&p.setAttribute("nonce",u),document.head.appendChild(p),c)return new Promise((d,E)=>{p.addEventListener("load",d),p.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(o){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=o,window.dispatchEvent(u),!u.defaultPrevented)throw o}return n.then(o=>{for(const u of o||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})},lazyRetry=function(e){return new Promise((t,a)=>{const s=JSON.parse(window.sessionStorage.getItem("retry-lazy-refreshed")||"false");e().then(n=>{window.sessionStorage.setItem("retry-lazy-refreshed","false"),t(n)}).catch(n=>{if(!s)return window.sessionStorage.setItem("retry-lazy-refreshed","true"),window.location.reload();a(n)})})},ROUTE_AVICULTURE_BASE="/aviculture",ROUTE_CITY_BASE="/city",ROUTE_SLAUGHTER_BASE="/slaughter",ROUTE_PROVINCE_BASE="/province",ROUTE_VETFARM_BASE="/vetfarm",ROUTE_AUCTION_BASE="/auction",ROUTE_DRIVER_BASE="/driver",ROUTE_VETـSUPERVISOR_BASE="/vet-supervisor",ROUTE_PROVINCE_FINANCIAL_BASE="/financial",ROUTE_PROVINCE_INSPECTOR_BASE="/inspector",ROUTE_SLAUGHTER_HOUSE_VET_BASE="/slaughter-house-vet",ROUTE_ADMIN_BASE="/admin",ROUTE_JAHAD_BASE="/jahad",ROUTE_STEWARD_BASE="/steward",ROUTE_CITYVET_BASE="/city-vet",ROUTE_COMMERCE_BASE="/commerce",ROUTE_PROVINCE_SUPERVISOR_BASE="/province-supervisor",ROUTE_CITY_COMMERCE_BASE="/city-commerce",ROUTE_CITY_JAHAD_BASE="/city-jahad",ROUTE_CITY_POULTRY_BASE="/citypoultry",ROUTE_OBSERVATORY_BASE="/observatory",ROUTE_SENF_BASE="/senf",ROUTE_GUILD_ROOM_BASE="/guild-room",ROUTE_PSP_COMPANY_BASE="/psp-company",ROUTE_LIVE_STOCK_SUPPORT_BASE="/livestock",ROUTE_SUPER_ADMIN_BASE="/superadmin",ROUTE_CHAIN_COMPANY_BASE="/chaincompany",ROUTE_ADMINX_BASE="/adminx",ROUTE_SUPPORTER_BASE="/supporter",ROUTE_DISPENSER_BASE="/dispenser",ROUTE_PARENT_COMPANY_BASE="/parent-company",ROUTE_COLD_HOUSE_STEWARD_BASE="/cold-house-steward",ROUTE_PROVINCE_JAHAD_BASE="/province-jahad",ROUTE_UNION_BASE="/union",ROUTE_COOPERATIVE_BASE="/cooperative",ROUTE_BAR_SQUARE_BASE="/bar-square",ROUTE_GENERAL_USER_PROFILE="/dashboard/profile",ROUTE_GENERAL_SUPPORT="/support/",ROUTE_GENERAL_MESSAGES="/messages/",ROUTE_GENERAL_TRAINING="/training/",ROUTE_GENERAL_PAYMENT="/payment/",ROUTE_GENERAL_WAGE_PAYMENT="/pay/:province/:key",ROUTE_GENERAL_DOWNLOAD_REPORT="/reports/:name",ROUTE_GENERAL_TICKET_LIST="/ticket/",ROUTE_GENERAL_TICKET="/ticket/:id/:create",ROUTE_AVICULTURE_USER_PROFILE="/dashboard/profile"+ROUTE_AVICULTURE_BASE,ROUTE_AVICULTURE_REQUESTS=ROUTE_AVICULTURE_BASE+"/requests",ROUTE_AVICULTURE_CREATE_NEW_REQUEST=ROUTE_AVICULTURE_BASE+"/requests/create",ROUTE_AVICULTURE_HATCHING=ROUTE_AVICULTURE_BASE+"/requests/hatching",ROUTE_AVICULTURE_SUBMIT_REQUEST=ROUTE_AVICULTURE_BASE+"/requests/submit",ROUTE_AVICULTURE_REJECTED_REQUESTS=ROUTE_AVICULTURE_BASE+"/requests/rejected",ROUTE_AVICULTURE_AWAITING_PAYMENT_REQUESTS=ROUTE_AVICULTURE_BASE+"/requests/awaitpayment",ROUTE_AVICULTURE_AWAITING_INSPECTION_REQUESTS=ROUTE_AVICULTURE_BASE+"/requests/awaitinspection",ROUTE_AVICULTURE_GIVE_PERMISSION=ROUTE_AVICULTURE_BASE+"/requests/permission",ROUTE_AVICULTURE_ARCHIVED_REQUESTS=ROUTE_AVICULTURE_BASE+"/requests/archived",ROUTE_AVICULTURE_FILE=ROUTE_AVICULTURE_BASE+"/file/",ROUTE_AVICULTURE_FILE_ROUTE=ROUTE_AVICULTURE_BASE+"/file/:id",ROUTE_AVICULTURE_INSPECTS=ROUTE_AVICULTURE_BASE+"/inspects/",ROUTE_AVICULTURE_INSPECTS_ROUTE=ROUTE_AVICULTURE_BASE+"/inspects/:key/:hall",ROUTE_AVICULTURE_AUCTION=ROUTE_AVICULTURE_BASE+ROUTE_AUCTION_BASE,ROUTE_AVICULTURE_TICKET=ROUTE_AVICULTURE_BASE+"/ticket/",ROUTE_AVICULTURE_VIEW_TICKET=ROUTE_AVICULTURE_BASE+"/ticket/:id/:create",ROUTE_AVICULTURE_ROUTE_HALLS=ROUTE_AVICULTURE_BASE+"/halls/",ROUTE_AVICULTURE_REPORTS=ROUTE_AVICULTURE_BASE+"/reports/",ROUTE_AVICULTURE_PRICING=ROUTE_AVICULTURE_BASE+"/pricing/",ROUTE_CITY_USER_PROFILE="/dashboard/profile"+ROUTE_CITY_BASE,ROUTE_CITY_REQUESTS=ROUTE_CITY_BASE+"/requests",ROUTE_CITY_ACTIVE_REQUESTS=ROUTE_CITY_BASE+"/requests/active",ROUTE_CITY_NEW_REQUESTS=ROUTE_CITY_BASE+"/requests/new",ROUTE_CITY_REJECTED_REQUESTS=ROUTE_CITY_BASE+"/requests/rejected",ROUTE_CITY_ARCHIVED_REQUESTS=ROUTE_CITY_BASE+"/requests/archived",ROUTE_CITY_POULTRY_FARMS=ROUTE_CITY_BASE+"/poultryfarms",ROUTE_CITY_FILE=ROUTE_CITY_BASE+"/file/",ROUTE_CITY_FILE_ROUTE=ROUTE_CITY_BASE+"/file/:id",ROUTE_CITY_TICKET=ROUTE_CITY_BASE+"/ticket/",ROUTE_CITY_VIEW_TICKET=ROUTE_CITY_BASE+"/ticket/:id/:create",ROUTE_CITY_USER_MANAGEMENT=ROUTE_CITY_BASE+"/users",ROUTE_CITY_USER_FILE_ROUTE=ROUTE_CITY_BASE+"/userfile/:userid",ROUTE_CITY_USER_FILE=ROUTE_CITY_BASE+"/userfile/",ROUTE_CITY_AWAITING_PAYMENT_REQUESTS=ROUTE_CITY_BASE+"/requests/awaitpayment",ROUTE_CITY_AWAITING_INSPECTION_REQUESTS=ROUTE_CITY_BASE+"/requests/awaitinspection",ROUTE_CITY_STATICS=ROUTE_CITY_BASE+"/statics",ROUTE_CITY_HATCHING=ROUTE_CITY_BASE+"/hatching",ROUTE_CITY_NEW_REQUEST=ROUTE_CITY_BASE+"/request",ROUTE_CITY_ROUTE_FILES_STATE=ROUTE_CITY_BASE+"/files-state/",ROUTE_CITY_ROUTE_ALLOCATIONS=ROUTE_CITY_BASE+"/allocations/",ROUTE_CITY_PRICING=ROUTE_CITY_BASE+"/pricing",ROUTE_CITY_POULTRIES=ROUTE_CITY_BASE+"/poultries/",ROUTE_CITY_POULTRIES_DETAILS=ROUTE_CITY_BASE+"/poultries/:key",ROUTE_CITY_FREE_SALES_REQUESTS=ROUTE_CITY_BASE+"/requests/free-sale",ROUTE_CITY_VISOR_STATICS=ROUTE_CITY_BASE+"/visor-statics",ROUTE_CITY_VISOR_STATICS_CHARTS=ROUTE_CITY_BASE+"/visor-statics/charts",ROUTE_CITY_VISOR_STATICS_PREDICTION=ROUTE_CITY_BASE+"/visor-statics/prediction/",ROUTE_CITY_VISOR_STATICS_PREDICTION_VIEW=ROUTE_CITY_BASE+"/visor-statics/prediction/:key/:date",ROUTE_CITYـHATCHINGS=ROUTE_CITY_BASE+"/manage-hatchings",ROUTE_CITY_VISOR_STATICSـHATCHINGS_DETAILS=ROUTE_CITYـHATCHINGS+"/manage-hatchings/:key",ROUTE_CITY_DIFFRENCE_KILLER=ROUTE_CITY_BASE+"/manage-hatchings/diffrence-killer",ROUTE_CITY_DIFFRENCE_KILLER_SLAUGHTER=ROUTE_CITY_BASE+"/manage-hatchings/diffrence-killer-slaughter",ROUTE_CITY_INCREASE_HATCHING=ROUTE_CITY_BASE+"/hatching/increase-hatching",ROUTE_CITY_ROUTE_INSPECTION=ROUTE_CITY_BASE+"/inspection",ROUTE_SLAUGHTER_USER_PROFILE="/dashboard/profile"+ROUTE_SLAUGHTER_BASE,ROUTE_SLAUGHTER_ADD_CAR=ROUTE_SLAUGHTER_BASE+"/cars/add",ROUTE_SLAUGHTER_CAR_MANAGEMENT=ROUTE_SLAUGHTER_BASE+"/cars/management",ROUTE_SLAUGHTER_REQUESTS=ROUTE_SLAUGHTER_BASE+"/requests",ROUTE_SLAUGHTER_NEW_REQUESTS=ROUTE_SLAUGHTER_BASE+"/requests/new",ROUTE_SLAUGHTERـFREE_BUY=ROUTE_SLAUGHTER_BASE+"/requests/free-buy",ROUTE_SLAUGHTERـEXPORT=ROUTE_SLAUGHTER_BASE+"/requests/export",ROUTE_SLAUGHTER_PENDING_REQUESTS=ROUTE_SLAUGHTER_BASE+"/requests/pending",ROUTE_SLAUGHTER_ACTIVE_REQUESTS=ROUTE_SLAUGHTER_BASE+"/requests/active",ROUTE_SLAUGHTER_ALLOCATE_CAR_REQUESTS=ROUTE_SLAUGHTER_BASE+"/requests/allocate-car",ROUTE_SLAUGHTER_ENTER_BAR_INFO=ROUTE_SLAUGHTER_BASE+"/requests/bar-info",ROUTE_SLAUGHTER_SELL_CARCASS=ROUTE_SLAUGHTER_BASE+"/requests/sell-carcass",ROUTE_SLAUGHTER_OUT_PROVINCE_BUY=ROUTE_SLAUGHTER_BASE+"/inventory/buy-out-province",ROUTE_SLAUGHTER_SEGMENTATION=ROUTE_SLAUGHTER_BASE+"/inventory/segmentation",ROUTE_SLAUGHTER_ORDERS=ROUTE_SLAUGHTER_BASE+"/inventory/orders",ROUTE_SLAUGHTER_PAY_FACTORS_REQUESTS=ROUTE_SLAUGHTER_BASE+"/requests/pay-factors",ROUTE_SLAUGHTER_PAYING_FEES_REQUESTS=ROUTE_SLAUGHTER_BASE+"/requests/payment-of-fees",ROUTE_SLAUGHTER_WALLET=ROUTE_SLAUGHTER_BASE+"/wallet",ROUTE_SLAUGHTER_REJECTED_REQUESTS=ROUTE_SLAUGHTER_BASE+"/requests/rejected",ROUTE_SLAUGHTER_ARCHIVED_REQUESTS=ROUTE_SLAUGHTER_BASE+"/requests/archived",ROUTE_SLAUGHTER_FILE=ROUTE_SLAUGHTER_BASE+"/file/",ROUTE_SLAUGHTER_FILE_ROUTE=ROUTE_SLAUGHTER_BASE+"/file/:id",ROUTE_SLAUGHTER_AUCTION=ROUTE_SLAUGHTER_BASE+ROUTE_AUCTION_BASE,ROUTE_SLAUGHTER_TICKET=ROUTE_SLAUGHTER_BASE+"/ticket/",ROUTE_SLAUGHTER_VIEW_TICKET=ROUTE_SLAUGHTER_BASE+"/ticket/:id/:create",ROUTE_SLAUGHTER_COMPLAINTS=ROUTE_SLAUGHTER_BASE+"/complaints",ROUTE_SLAUGHTER_INVENTORY=ROUTE_SLAUGHTER_BASE+"/inventory",ROUTE_SLAUGHTER_INVENTORY_SUMMARY=ROUTE_SLAUGHTER_BASE+"/inventory/summary",ROUTE_SLAUGHTER_AGENT_SHARE=ROUTE_SLAUGHTER_BASE+"/agent-share",ROUTE_SLAUGHTER_AGENT_SHARE_ID=ROUTE_SLAUGHTER_BASE+"/agent-share/:id/:date",ROUTE_SLAUGHTER_ALLOCATION_REQUESTS=ROUTE_SLAUGHTER_BASE+"/requests/allocated",ROUTE_SLAUGHTER_INVENTORY_STOCK=ROUTE_SLAUGHTER_BASE+"/inventory/stock",ROUTE_SLAUGHTER_INVENTORY_SELL_CARCASS_OUT_PROVINCE=ROUTE_SLAUGHTER_BASE+"/inventory/sell-carcass-out-province",ROUTE_SLAUGHTER_INVENTORY_SELL_CARCASS_IN_PROVINCE=ROUTE_SLAUGHTER_BASE+"/inventory/sell-carcass-in-province",ROUTE_SLAUGHTER_FACTORS=ROUTE_SLAUGHTER_BASE+"/requests/factors",ROUTE_SLAUGHTER_FINAL_FACTORS=ROUTE_SLAUGHTER_BASE+"/requests/final-factors",ROUTE_SLAUGHTER_ROUTE_MANAGE_GUILDS=ROUTE_SLAUGHTER_BASE+"/manage-guilds/",ROUTE_SLAUGHTER_ROUTE_MANAGE_BARS=ROUTE_SLAUGHTER_BASE+"/manage-bars/",ROUTE_SLAUGHTER_FINANCIAL_TRANSACTIONS=ROUTE_SLAUGHTER_BASE+"/requests/transactions",ROUTE_SLAUGHTER_PRICING=ROUTE_SLAUGHTER_BASE+"/pricing",ROUTE_SLAUGHTER_MORGUE=ROUTE_SLAUGHTER_BASE+"/morgue",ROUTE_SLAUGHTER_MORGUE_VIEW=ROUTE_SLAUGHTER_BASE+"/morgue/:key",ROUTE_SLAUGHTER_MORGUE_STOCK=ROUTE_SLAUGHTER_BASE+"/morgue/stock",ROUTE_SLAUGHTER_MORGUE_BROADCAST_MANAGEMENT=ROUTE_SLAUGHTER_BASE+"/morgue/management",ROUTE_SLAUGHTER_DISPENSERS=ROUTE_SLAUGHTER_BASE+"/dispensers",ROUTE_SLAUGHTER_DISPENSERS_MANAGEMENT=ROUTE_SLAUGHTER_BASE+"/dispensers-management",ROUTE_SLAUGHTER_DISPENSER_DETAILS=ROUTE_SLAUGHTER_BASE+"/dispenser-data",ROUTE_SLAUGHTER_DISPENSER_DETAILS_VIEW=ROUTE_SLAUGHTER_BASE+"/dispenser-data/:key",ROUTE_SLAUGHTER_DISPENSERS_STEWARDS=ROUTE_SLAUGHTER_BASE+"/dispensers-stewards",ROUTE_SLAUGHTER_DISPENSERS_KILLHOUSES=ROUTE_SLAUGHTER_BASE+"/dispensers-killhouses",ROUTE_SLAUGHTER_DAILY_LIST=ROUTE_SLAUGHTER_BASE+"/dailylist",ROUTE_SLAUGHTER_SETTLEMENTS=ROUTE_SLAUGHTER_BASE+"/settlements",ROUTE_SLAUGHTER_RETURN_PURCHASES=ROUTE_SLAUGHTER_BASE+"/return-purchases",ROUTE_SLAUGHTER_TRADING_PANEL=ROUTE_SLAUGHTER_BASE+"/requests/trade-panel",ROUTE_SLAUGHTER_ROUTE_MANAGE_DISPENSERS=ROUTE_SLAUGHTER_BASE+"/manage-dispensers",ROUTE_PROVINCE_TRADING_PANEL=ROUTE_PROVINCE_BASE+"/requests/trade-panel",ROUTE_PROVINCE_USER_PROFILE="/dashboard/profile"+ROUTE_PROVINCE_BASE,ROUTE_PROVINCE_REQUESTS=ROUTE_PROVINCE_BASE+"/requests",ROUTE_PROVINCE_ACTIVE_REQUESTS=ROUTE_PROVINCE_BASE+"/requests/active",ROUTE_PROVINCE_ALLOCATION_REQUESTS=ROUTE_PROVINCE_BASE+"/requests/allocation",ROUTE_PROVINCE_ALLOCATED_REQUESTS=ROUTE_PROVINCE_BASE+"/requests/allocated",ROUTE_PROVINCE_AUTO_ALLOCATION_REQUESTS=ROUTE_PROVINCE_BASE+"/requests/auto-allocation",ROUTE_PROVINCE_CHAINS=ROUTE_PROVINCE_BASE+"/chains",ROUTE_PROVINCE_CITY_NEW_REQUESTS=ROUTE_PROVINCE_BASE+"/requests/city",ROUTE_PROVINCE_NEW_REQUESTS=ROUTE_PROVINCE_BASE+"/requests/new",ROUTE_PROVINCE_STATEMENTـOFـNEED_REQUESTS=ROUTE_PROVINCE_BASE+"/requests/statement-of-need",ROUTE_PROVINCE_REJECTED_REQUESTS=ROUTE_PROVINCE_BASE+"/requests/rejected",ROUTE_PROVINCE_ARCHIVED_REQUESTS=ROUTE_PROVINCE_BASE+"/requests/archived",ROUTE_PROVINCE_ISSUANCE_OF_LETTER=ROUTE_PROVINCE_BASE+"/requests/issuance-of-letter",ROUTE_PROVINCE_FREE_SALES_REQUESTS=ROUTE_PROVINCE_BASE+"/requests/free-sale",ROUTE_PROVINCE_FILE=ROUTE_PROVINCE_BASE+"/file/",ROUTE_PROVINCE_FILE_ROUTE=ROUTE_PROVINCE_BASE+"/file/:id",ROUTE_PROVINCE_SEND_MESSAGE=ROUTE_PROVINCE_BASE+"/sendmessage",ROUTE_PROVINCE_SEND_ANNOUNCEMENT=ROUTE_PROVINCE_BASE+"/announcement",ROUTE_PROVINCE_SEND_REPORT=ROUTE_PROVINCE_BASE+"/sendreport",ROUTE_PROVINCE_TICKET=ROUTE_PROVINCE_BASE+"/ticket/",ROUTE_PROVINCE_VIEW_TICKET=ROUTE_PROVINCE_BASE+"/ticket/:id/:create",ROUTE_PROVINCE_AWAITING_PAYMENT_REQUESTS=ROUTE_PROVINCE_BASE+"/requests/awaitpayment",ROUTE_PROVINCE_AWAITING_INSPECTION_REQUESTS=ROUTE_PROVINCE_BASE+"/requests/awaitinspection",ROUTE_PROVINCE_STATICS=ROUTE_PROVINCE_BASE+"/statics",ROUTE_PROVINCE_NATIONAL_STATICS=ROUTE_PROVINCE_BASE+"/national-statics",ROUTE_PROVINCE_HATCHING=ROUTE_PROVINCE_BASE+"/hatching",ROUTE_PROVINCE_NEW_REQUEST=ROUTE_PROVINCE_BASE+"/request",ROUTE_PROVINCE_ROUTE_ALLOCATIONS=ROUTE_PROVINCE_BASE+"/allocations/",ROUTE_PROVINCE_ROUTE_MANAGE_GUILDS=ROUTE_PROVINCE_BASE+"/manage-guilds/",ROUTE_PROVINCE_ROUTE_IN_PROVINCE_GUILDS=ROUTE_PROVINCE_BASE+"/manage-guilds/in-province",ROUTE_PROVINCE_ROUTE_OUT_PROVINCE_GUILDS=ROUTE_PROVINCE_BASE+"/manage-guilds/out-province",ROUTE_PROVINCE_ROUTE_OUT_PROVINCE_LEGAL_GUILDS=ROUTE_PROVINCE_BASE+"/manage-guilds/out-province/legal-guilds",ROUTE_PROVINCE_ROUTE_OUT_PROVINCE_TRUE_GUILDS=ROUTE_PROVINCE_BASE+"/manage-guilds/out-province/true-guilds",ROUTE_PROVINCE_ROUTE_IN_PROVINCE_LEGAL_GUILDS=ROUTE_PROVINCE_BASE+"/manage-guilds/in-province/legal-guilds",ROUTE_PROVINCE_ROUTE_IN_PROVINCE_TRUE_GUILDS=ROUTE_PROVINCE_BASE+"/manage-guilds/in-province/true-guilds",ROUTE_PROVINCE_ROUTE_GUILDS=ROUTE_PROVINCE_BASE+"/manage-guilds/guilds",ROUTE_PROVINCE_ROUTE_IN_PROVINCE_STEWARDS=ROUTE_PROVINCE_BASE+"/manage-guilds/in-province/stewards",ROUTE_PROVINCE_ROUTE_GUILDS_SETTINGS=ROUTE_PROVINCE_BASE+"/manage-guilds/settings",ROUTE_PROVINCE_ROUTE_AGENT_SHARE=ROUTE_PROVINCE_BASE+"/agent-share",ROUTE_PROVINCE_ROUTE_STEWARD_SHARE=ROUTE_PROVINCE_BASE+"/steward-share",ROUTE_PROVINCE_ROUTE_AGENT_SHARE_ID=ROUTE_PROVINCE_BASE+"/agent-share/:id/:date",ROUTE_PROVINCE_ROUTE_IN_PROVINCE_GUILDS_REQUESTS=ROUTE_PROVINCE_BASE+"/manage-guilds/in-province/guilds-requests",ROUTE_PROVINCE_ROUTE_MANAGE_PROCESS=ROUTE_PROVINCE_BASE+"/manage-process/",ROUTE_PROVINCE_ROUTE_MANAGE_PROCESS_SLAUGHTER=ROUTE_PROVINCE_BASE+"/manage-process/slaughter",ROUTE_PROVINCE_ROUTE_MANAGE_PROCESS_KILLPLACE=ROUTE_PROVINCE_BASE+"/manage-process/killplace",ROUTE_PROVINCE_ROUTE_MANAGE_PROCESS_BUY_REQ=ROUTE_PROVINCE_BASE+"/manage-process/buy-req",ROUTE_PROVINCE_ROUTE_MANAGE_PROCESS_POLICY_COUNCIL=ROUTE_PROVINCE_BASE+"/manage-process/policy-council",ROUTE_PROVINCE_ROUTE_POLICY_COUNCIL_POULTRY_CHOOSE_SLAUGHTER=ROUTE_PROVINCE_BASE+"/policy-council/poultry-choose-slaughter",ROUTE_PROVINCE_ROUTE_POLICY_COUNCIL_FREE_SALE=ROUTE_PROVINCE_BASE+"/policy-council/free-sale",ROUTE_PROVINCE_ROUTE_POLICY_COUNCIL_DIRECT_BUY=ROUTE_PROVINCE_BASE+"/policy-council/direct-buy",ROUTE_PROVINCE_ROUTE_POLICY_COUNCIL_KILLHOUSE_GUILDS=ROUTE_PROVINCE_BASE+"/policy-council/killhouse-guilds",ROUTE_PROVINCE_ROUTE_FILES_STATE=ROUTE_PROVINCE_BASE+"/files-state/",ROUTE_PROVINCE_ASSIGN_VET_FARM=ROUTE_PROVINCE_BASE+"/assign-farm/",ROUTE_PROVINCE_CARS=ROUTE_PROVINCE_BASE+"/cars/",ROUTE_PROVINCE_USERS=ROUTE_PROVINCE_BASE+"/users/",ROUTE_PROVINCE_POULTRIES=ROUTE_PROVINCE_BASE+"/poultries/",ROUTE_PROVINCE_POULTRIES_DETAILS=ROUTE_PROVINCE_BASE+"/poultries/:key",ROUTE_PROVINCE_GUILD_TRANSACTIONS=ROUTE_PROVINCE_BASE+"/transactions/",ROUTE_PROVINCE_SLAUGHTERS=ROUTE_PROVINCE_BASE+"/slaugter-houses/",ROUTE_PROVINCE_SLAUGHTERS_MONITORING_BUYERS=ROUTE_PROVINCE_BASE+"/slaugter-houses/monitoring-buyers",ROUTE_PROVINCE_SLAUGHTERS_MANAGE=ROUTE_PROVINCE_BASE+"/slaugter-houses/manage",ROUTE_PROVINCE_ROUTE_SMS=ROUTE_PROVINCE_BASE+"/sms",ROUTE_PROVINCE_ROUTE_SMS_SEND=ROUTE_PROVINCE_BASE+"/sms/send",ROUTE_PROVINCE_ROUTE_SMS_MANAGE=ROUTE_PROVINCE_BASE+"/sms/manage",ROUTE_PROVINCE_PRICING3=ROUTE_PROVINCE_BASE+"/pricing",ROUTE_PROVINCE_BARS=ROUTE_PROVINCE_BASE+"/bars",ROUTE_PROVINCE_MANAGE_USERS=ROUTE_PROVINCE_BASE+"/manage-users/",ROUTE_PROVINCE_PAYING_FEES_REQUESTS=ROUTE_PROVINCE_BASE+"/requests/payment-of-fees",ROUTE_PROVINCE_PAYING_FEES_REQUESTS_VIEW=ROUTE_PROVINCE_BASE+"/requests/payment-of-fees/:type/:key",ROUTE_PROVINCEـFREE_BUY=ROUTE_PROVINCE_BASE+"/requests/free-buy",ROUTE_PROVINCEـBROADCAST_MANAGEMENT=ROUTE_PROVINCE_BASE+"/broadcast-management",ROUTE_PROVINCE_REPORT=ROUTE_PROVINCE_BASE+"/report",ROUTE_PROVINCE_PRODUCTS=ROUTE_PROVINCE_BASE+"/products",ROUTE_PROVINCE_TRANSACTIONS=ROUTE_PROVINCE_BASE+"/requests/transactions",ROUTE_PROVINCE_TRANSACTIONS_VIEW=ROUTE_PROVINCE_BASE+"/requests/transactions/:key/:name",ROUTE_PROVINCEـEXPORT=ROUTE_PROVINCE_BASE+"/requests/export",ROUTE_PROVINCEـVISOR_STATICS=ROUTE_PROVINCE_BASE+"/visor-statics",ROUTE_PROVINCEـVISOR_STATICS_CHARTS=ROUTE_PROVINCE_BASE+"/visor-statics/charts",ROUTE_PROVINCEـVISOR_STATICS_PREDICTION=ROUTE_PROVINCE_BASE+"/visor-statics/prediction/",ROUTE_PROVINCEـVISOR_STATICS_PREDICTION_VIEW=ROUTE_PROVINCE_BASE+"/visor-statics/prediction/:key/:date",ROUTE_PROVINCEـHATCHINGS=ROUTE_PROVINCE_BASE+"/manage-hatchings",ROUTE_PROVINCEـHATCHINGS_DETAILS=ROUTE_PROVINCE_BASE+"/manage-hatchings/:key",ROUTE_PROVINCE_DISPENSERS=ROUTE_PROVINCE_BASE+"/dispensers",ROUTE_PROVINCE_COLD_HOUSES=ROUTE_PROVINCE_BASE+"/cold-house-management",ROUTE_PROVINCE_COLD_HOUSES_MANAGEMENT=ROUTE_PROVINCE_BASE+"/cold-houses-management",ROUTE_PROVINCE_COLD_HOUSES_MANAGEMENT_VIEW=ROUTE_PROVINCE_BASE+"/cold-houses-management/:key/:name/:type",ROUTE_PROVINCE_DISPENSERS_MANAGEMENT=ROUTE_PROVINCE_BASE+"/dispensers-management",ROUTE_PROVINCE_DISPENSER_DETAILS=ROUTE_PROVINCE_BASE+"/dispenser-data",ROUTE_PROVINCE_DISPENSER_DETAILS_VIEW=ROUTE_PROVINCE_BASE+"/dispenser-data/:key",ROUTE_PROVINCE_DISPENSERS_STEWARDS=ROUTE_PROVINCE_BASE+"/dispensers-stewards",ROUTE_PROVINCE_DISPENSERS_KILLHOUSES=ROUTE_PROVINCE_BASE+"/dispensers-killhouses",ROUTE_PROVINCE_DISPENSERS_KILLHOUSES_VIEW=ROUTE_PROVINCE_BASE+"/dispensers-killhouses/:key/:name",ROUTE_PROVINCE_DISPENSERS_INVENTORY=ROUTE_PROVINCE_BASE+"/dispensers-inventory",ROUTE_PROVINCE_DISPENSERS_SELL_CARCASS=ROUTE_PROVINCE_BASE+"/dispensers-sell-carcass",ROUTE_PROVINCE_SUB_SECTORS_WAGE=ROUTE_PROVINCE_BASE+"/subsectors-wage",ROUTE_PROVINCE_SUB_SECTORS_CITY_SHARES=ROUTE_PROVINCE_BASE+"/subsectors-city-shares",ROUTE_PROVINCE_SUB_SECTORS_STEWARD_SHARES=ROUTE_PROVINCE_BASE+"/subsectors-steward-shares",ROUTE_PROVINCE_SUB_SECTORS_VET_FARM_SHARES=ROUTE_PROVINCE_BASE+"/subsectors-vet-farm-shares",ROUTE_PROVINCE_SETTLEMENTS=ROUTE_PROVINCE_BASE+"/settlements",ROUTE_PROVINCE_ROUTE_KILLERS_WAGES=ROUTE_PROVINCE_BASE+"/requests/payment-of-fees-killers",ROUTE_PROVINCE_ROUTE_KILLERS_WAGES_DETAILS=ROUTE_PROVINCE_BASE+"/requests/payment-of-fees-killers/:key",ROUTE_PROVINCE_DIFFRENCE_KILLER=ROUTE_PROVINCE_BASE+"/manage-hatchings/diffrence-killer",ROUTE_PROVINCE_DIFFRENCE_KILLER_SLAUGHTER=ROUTE_PROVINCE_BASE+"/manage-hatchings/diffrence-killer-slaughter",ROUTE_PROVINCE_INCREASE_HATCHING=ROUTE_PROVINCE_BASE+"/hatching/increase-hatching",ROUTE_PROVINCE_DASHBOARD=ROUTE_PROVINCE_BASE+"/dashbord",ROUTE_PROVINCE_SALE_DESTRIBUTION_DETAILS=ROUTE_PROVINCE_BASE+"/requests/distribution",ROUTE_PROVINCE_DASHBOARD_NEWS=ROUTE_PROVINCE_BASE+"/dashboard/news",ROUTE_PROVINCE_POULTRY_LIVESTOCK_EXPERTS=ROUTE_PROVINCE_BASE+"/livestock-experts",ROUTE_PROVINCE_RETURN_PURCHASES=ROUTE_PROVINCE_BASE+"/return-purchases",ROUTE_VETFARM_USER_PROFILE="/dashboard/profile"+ROUTE_VETFARM_BASE,ROUTE_VETFARM_REGISTER_INFO=ROUTE_VETFARM_BASE+"/farminfo",ROUTE_VETFARM_INSPECTIONS_ROUTE=ROUTE_VETFARM_BASE+"/inspections/:inspectionid",ROUTE_VETFARM_INSPECTIONS=ROUTE_VETFARM_BASE+"/inspections/",ROUTE_VETFARM_ROUTE_HATCHING=ROUTE_VETFARM_BASE+"/hatching/",ROUTE_VETFARM_ROUTE_ALLOCATIONS=ROUTE_VETFARM_BASE+"/allocations/",ROUTE_VETFARM_HATCHING=ROUTE_VETFARM_BASE+"/hatchings",ROUTE_VETFARM_ROUTE_INSPECTION=ROUTE_VETFARM_BASE+"/inspection",ROUTE_VETـSUPERVISOR_HATCHING=ROUTE_VETـSUPERVISOR_BASE+"/hatching",ROUTE_VETـSUPERVISOR_ALLOCATIONS=ROUTE_VETـSUPERVISOR_BASE+"/allocations",ROUTE_VETـSUPERVISOR_ILLEGALـKILLING=ROUTE_VETـSUPERVISOR_BASE+"/illegal-killing",ROUTE_VETـSUPERVISOR_KILLS_STATS=ROUTE_VETـSUPERVISOR_BASE+"/kill-stats",ROUTE_VETـSUPERVISOR_STATICS=ROUTE_VETـSUPERVISOR_BASE+"/visor-statics",ROUTE_VETـSUPERVISOR_STATICS_CHARTS=ROUTE_VETـSUPERVISOR_BASE+"/visor-statics/charts",ROUTE_VETـSUPERVISOR_STATICS_PREDICTION=ROUTE_VETـSUPERVISOR_BASE+"/visor-statics/prediction/",ROUTE_VETـSUPERVISOR_STATICS_PREDICTION_VIEW=ROUTE_VETـSUPERVISOR_BASE+"/visor-statics/prediction/:key/:date",ROUTE_VETـSUPERVISOR_ROUTE_FILES_STATE=ROUTE_VETـSUPERVISOR_BASE+"/files-state/",ROUTE_VETـSUPERVISOR_REPORTING=ROUTE_VETـSUPERVISOR_BASE+"/reporting",ROUTEـVET_SUPERVISOR_POULTRIES=ROUTE_VETـSUPERVISOR_BASE+"/poultries/",ROUTEـVET_SUPERVISOR_POULTRIES_DETAILS=ROUTE_VETـSUPERVISOR_BASE+"/poultries/:key",DRIVER_USER_PROFILE="/dashboard/profile/"+ROUTE_DRIVER_BASE,ROUTE_DRIVER_REQUESTS=ROUTE_DRIVER_BASE+"/requests",ROUTE_DRIVER_CARS=ROUTE_DRIVER_BASE+"/cars",ROUTE_INSPECTOR_USER_PROFILE="/dashboard/profile"+ROUTE_PROVINCE_INSPECTOR_BASE,ROUTE_INSPECTOR_REQUESTS=ROUTE_PROVINCE_INSPECTOR_BASE+"/requests",ROUTE_INSPECTOR_REQUESTS_NEW_REQUESTS=ROUTE_PROVINCE_INSPECTOR_BASE+"/requests/new",ROUTE_INSPECTOR_REJECTED_REQUESTS=ROUTE_PROVINCE_INSPECTOR_BASE+"/requests/rejected",ROUTE_INSPECTOR_ARCHIVED_REQUESTS=ROUTE_PROVINCE_INSPECTOR_BASE+"/requests/archived",ROUTE_INSPECTOR_FILE=ROUTE_PROVINCE_INSPECTOR_BASE+"/file/",ROUTE_INSPECTOR_FILE_ROUTE=ROUTE_PROVINCE_INSPECTOR_BASE+"/file/:id",ROUTE_PROVINCE_USER_MANAGEMENT=ROUTE_PROVINCE_INSPECTOR_BASE+"/users",ROUTE_PROVINCE_CAR_MANAGEMENT=ROUTE_PROVINCE_INSPECTOR_BASE+"/cars",ROUTE_PROVINCE_INSPECTOR_PRICING=ROUTE_PROVINCE_INSPECTOR_BASE+"/pricing",ROUTE_PROVINCE_USER_FILE_ROUTE=ROUTE_PROVINCE_INSPECTOR_BASE+"/userfile/:userid",ROUTE_PROVINCE_USER_FILE=ROUTE_PROVINCE_INSPECTOR_BASE+"/userfile/",ROUTE_PROVINCE_INSPECTOR_TICKET=ROUTE_PROVINCE_INSPECTOR_BASE+"/ticket/",ROUTE_PROVINCE_INSPECTOR_VIEW_TICKET=ROUTE_PROVINCE_INSPECTOR_BASE+"/ticket/:id/:create",ROUTE_PROVINCE_INSPECTOR_REPORTING=ROUTE_PROVINCE_INSPECTOR_BASE+"/reporting",ROUTE_PROVINCE_INSPECTOR_AWAITING_PAYMENT_REQUESTS=ROUTE_PROVINCE_INSPECTOR_BASE+"/requests/awaitpayment",ROUTE_PROVINCE_INSPECTOR_AWAITING_INSPECTION_REQUESTS=ROUTE_PROVINCE_INSPECTOR_BASE+"/requests/awaitinspection",ROUTE_INSPECTOR_STATICS=ROUTE_PROVINCE_INSPECTOR_BASE+"/statics",ROUTE_INSPECTOR_ASSIGN_VET_FARM=ROUTE_PROVINCE_INSPECTOR_BASE+"/assgin-vet-farm",ROUTE_PROVINCE_FINANCIAL_PENDING_REQUESTS=ROUTE_PROVINCE_FINANCIAL_BASE+"/requests/pending",ROUTE_PROVINCE_FINANCIAL_CHECK_PAYED_FACTOR_REQUESTS=ROUTE_PROVINCE_FINANCIAL_BASE+"/requests/check-payed-factors",ROUTE_PROVINCE_FINANCIAL_TRANSACTIONS=ROUTE_PROVINCE_FINANCIAL_BASE+"/requests/transactions",ROUTE_PROVINCE_FINANCIAL_TRANSACTIONS_VIEW=ROUTE_PROVINCE_FINANCIAL_BASE+"/requests/transactions/:key/:name",ROUTE_PROVINCE_FINANCIAL_FINAL_FACTORS_REQUESTS=ROUTE_PROVINCE_FINANCIAL_BASE+"/requests/final-factors",ROUTE_PROVINCE_FINANCIAL_REQUESTS=ROUTE_PROVINCE_FINANCIAL_BASE+"/requests",ROUTE_PROVINCE_FINANCIAL_ACTIVE_REQUESTS=ROUTE_PROVINCE_FINANCIAL_BASE+"/requests/active",ROUTE_PROVINCE_FINANCIAL_SETTLEMENT=ROUTE_PROVINCE_FINANCIAL_BASE+"/settlement",ROUTE_PROVINCE_FINANCIAL_USER_PROFILE="/dashboard/profile"+ROUTE_PROVINCE_FINANCIAL_BASE,ROUTE_PROVINCE_FINANCIAL_REJECTED_REQUESTS=ROUTE_PROVINCE_FINANCIAL_BASE+"/requests/rejected",ROUTE_PROVINCE_FINANCIAL_NEW_REQUESTS=ROUTE_PROVINCE_FINANCIAL_BASE+"/requests/new",ROUTE_PROVINCE_FINANCIAL_ARCHIVED_REQUESTS=ROUTE_PROVINCE_FINANCIAL_BASE+"/requests/archived",ROUTE_PROVINCE_FINANCIAL_FILE_ROUTE=ROUTE_PROVINCE_FINANCIAL_BASE+"/file/:id",ROUTE_PROVINCE_FINANCIAL_FILE=ROUTE_PROVINCE_FINANCIAL_BASE+"/file/",ROUTE_PROVINCE_PRICING=ROUTE_PROVINCE_FINANCIAL_BASE+"/pricing",ROUTE_PROVINCE_FINANCIAL_TICKET=ROUTE_PROVINCE_FINANCIAL_BASE+"/ticket/",ROUTE_PROVINCE_FINANCIAL_VIEW_TICKET=ROUTE_PROVINCE_FINANCIAL_BASE+"/ticket/:id/:create",ROUTE_PROVINCE_FINANCIAL_ROUTE_DEBT=ROUTE_PROVINCE_FINANCIAL_BASE+"/debt/",ROUTE_PROVINCE_FINANCIAL_COMPLAINTS=ROUTE_PROVINCE_FINANCIAL_BASE+"/complaints",ROUTE_PROVINCE_FINANCIAL_DOCUMENT_REGISTRATION=ROUTE_PROVINCE_FINANCIAL_BASE+"/documentregister",ROUTE_PROVINCE__FINANCIAL_USER_FINACIAL_FILE_ROUTE=ROUTE_PROVINCE_FINANCIAL_BASE+"/userfile/:userid/:profileid",ROUTE_PROVINCE__FINANCIAL_USER_FINACIAL_FILE=ROUTE_PROVINCE_FINANCIAL_BASE+"/userfile/",ROUTE_PROVINCE_FINANCIAL_AWAITING_PAYMENT_REQUESTS=ROUTE_PROVINCE_FINANCIAL_BASE+"/requests/awaitpayment",ROUTE_PROVINCE_FINANCIAL_AWAITING_INSPECTION_REQUESTS=ROUTE_PROVINCE_FINANCIAL_BASE+"/requests/awaitinspection",ROUTE_PROVINCE_FINANCIAL_STATICS=ROUTE_PROVINCE_FINANCIAL_BASE+"/statics",ROUTE_PROVINCE_FINANCIAL_SUB_SECTORS_WAGE=ROUTE_PROVINCE_FINANCIAL_BASE+"/subsectors-wage",ROUTE_PROVINCE_FINANCIAL_SUB_SECTORS_CITY_SHARES=ROUTE_PROVINCE_FINANCIAL_BASE+"/subsectors-city-shares",ROUTE_PROVINCE_FINANCIAL_SUB_SECTORS_STEWARD_SHARES=ROUTE_PROVINCE_FINANCIAL_BASE+"/subsectors-steward-shares",ROUTE_PROVINCE_FINANCIAL_SUB_SECTORS_VET_FARM_SHARES=ROUTE_PROVINCE_FINANCIAL_BASE+"/subsectors-vet-farm-shares",ROUTE_SLAUGHTER_HOUSE_VET_REQUESTS=ROUTE_SLAUGHTER_HOUSE_VET_BASE+"/requests",ROUTE_SLAUGHTER_HOUSE_VET_USER_PROFILE="/dashboard/profile"+ROUTE_SLAUGHTER_HOUSE_VET_BASE,ROUTE_SLAUGHTER_HOUSE_VET_ENTER_BAR_INFO=ROUTE_SLAUGHTER_HOUSE_VET_BASE+"/requests/bar-info",ROUTE_SLAUGHTER_HOUSE_VET_NEW_REQUESTS=ROUTE_SLAUGHTER_HOUSE_VET_BASE+"/requests/new",ROUTE_SLAUGHTER_HOUSE_VET_ACTIVE_REQUESTS=ROUTE_SLAUGHTER_HOUSE_VET_BASE+"/requests/active",ROUTE_SLAUGHTER_HOUSE_VET_REJECTED_REQUESTS=ROUTE_SLAUGHTER_HOUSE_VET_BASE+"/requests/rejected",ROUTE_SLAUGHTER_HOUSE_VET_ARCHIVED_REQUESTS=ROUTE_SLAUGHTER_HOUSE_VET_BASE+"/requests/archived",ROUTE_SLAUGHTER_HOUSE_VET_FILE_ROUTE=ROUTE_SLAUGHTER_HOUSE_VET_BASE+"/file/:id",ROUTE_SLAUGHTER_HOUSE_VET_FREE_BUY_ROUTE=ROUTE_SLAUGHTER_HOUSE_VET_BASE+"/requests/out-province",ROUTE_SLAUGHTER_HOUSE_VET_FILE=ROUTE_SLAUGHTER_HOUSE_VET_BASE+"/file/",ROUTE_SLAUGHTER_HOUSE_VET_COMPLAINTS=ROUTE_SLAUGHTER_HOUSE_VET_BASE+"/requests/complaints",ROUTE_ADMIN_REQUESTS=ROUTE_ADMIN_BASE+"/requests",ROUTE_ADMIN_VISOR_STATICS=ROUTE_ADMIN_BASE+"/visor-statics",ROUTE_ADMIN_VISOR_STATICS_CHARTS=ROUTE_ADMIN_BASE+"/visor-statics/charts",ROUTE_ADMIN_VISOR_STATICS_PREDICTION=ROUTE_ADMIN_BASE+"/visor-statics/prediction/",ROUTE_ADMIN_CREATE_NEW_REQUEST=ROUTE_ADMIN_BASE+"/requests/create",ROUTE_ADMIN_HATCHING=ROUTE_ADMIN_BASE+"/requests/hatching",ROUTE_ADMIN_NEW_REQUESTS=ROUTE_ADMIN_BASE+"/requests/new",ROUTE_ADMIN_REJECTED_REQUESTS=ROUTE_ADMIN_BASE+"/requests/new",ROUTE_ADMIN_AWAITING_PAYMENT_REQUESTS=ROUTE_ADMIN_BASE+"/requests/awaitpayment",ROUTE_ADMIN_AWAITING_INSPECTION_REQUESTS=ROUTE_ADMIN_BASE+"/requests/awaitinspection",ROUTE_ADMIN_ARCHIVED_REQUESTS=ROUTE_ADMIN_BASE+"/requests/archived",ROUTE_ADMIN_ACTIVE_REQUESTS=ROUTE_ADMIN_BASE+"/requests/active",ROUTE_ADMIN_STATICS=ROUTE_ADMIN_BASE+"/statics",ROUTE_ADMIN_NATIONAL_STATICS=ROUTE_ADMIN_BASE+"/national-statics",ROUTE_JAHAD_KILLS_STATS=ROUTE_JAHAD_BASE+"/kill-stats",ROUTE_JAHAD_ILLEGALـKILLING=ROUTE_JAHAD_BASE+"/illegal-killing",ROUTE_JAHAD_PRICING=ROUTE_JAHAD_BASE+"/pricing",ROUTE_JAHAD_FILES_STATE=ROUTE_JAHAD_BASE+"/files-state",ROUTE_STEWARD_USER_PROFILE="/dashboard/profile"+ROUTE_STEWARD_BASE,ROUTE_STEWARD_INVENTORY=ROUTE_STEWARD_BASE+"/inventory",ROUTE_STEWARD_INVENTORY_STOCK=ROUTE_STEWARD_BASE+"/inventory/stock",ROUTE_STEWARD_SALE_IN_PROVINCE=ROUTE_STEWARD_BASE+"/inventory/in/sale",ROUTE_STEWARD_PURCHASE_OUT_PROVINCE=ROUTE_STEWARD_BASE+"/inventory/out/purchase",ROUTE_STEWARD_SALE_OUT_PROVINCE=ROUTE_STEWARD_BASE+"/inventory/out/sale",ROUTE_STEWARD_MANAGE_GUILDS=ROUTE_STEWARD_BASE+"/manage-guilds",ROUTE_STEWARD_DAILY_LIST=ROUTE_STEWARD_BASE+"/dailylist",ROUTE_STEWARD_SEGMENT=ROUTE_STEWARD_BASE+"/segment",ROUTE_STEWARD_ROUTE_MANAGE_DISPENSERS=ROUTE_STEWARD_BASE+"/manage-dispensers",ROUTE_COMMERCE_REQUESTS=ROUTE_COMMERCE_BASE+"/requests",ROUTE_COMMERCE_ROUTE_MANAGE_GUILDS=ROUTE_COMMERCE_BASE+"/manage-guilds/",ROUTE_COMMERCE_ROUTE_GUILDS=ROUTE_COMMERCE_BASE+"/manage-guilds/guilds",ROUTE_COMMERCE_ROUTE_STEWARDS=ROUTE_COMMERCE_BASE+"/manage-guilds/stewards",ROUTE_COMMERCE_ROUTE_GUILDS_SETTINGS=ROUTE_COMMERCE_BASE+"/manage-guilds/settings",ROUTE_COMMERCE_ROUTE_FILES_STATE=ROUTE_COMMERCE_BASE+"/files-state/",ROUTE_COMMERCE_ROUTE_ALLOCATIONS=ROUTE_COMMERCE_BASE+"/allocations/",ROUTE_COMMERCE_STATICS=ROUTE_COMMERCE_BASE+"/statics",ROUTE_COMMERCE_HATCHING=ROUTE_COMMERCE_BASE+"/hatching",ROUTE_COMMERCE_PAYING_FEES_REQUESTS=ROUTE_COMMERCE_BASE+"/requests/payment-of-fees",ROUTE_COMMERCE_VISOR_STATICS=ROUTE_COMMERCE_BASE+"/visor-statics",ROUTE_COMMERCE_VISOR_STATICS_CHARTS=ROUTE_COMMERCE_BASE+"/visor-statics/charts",ROUTE_COMMERCE_VISOR_STATICS_PREDICTION=ROUTE_COMMERCE_BASE+"/visor-statics/prediction/",ROUTE_COMMERCE_VISOR_STATICS_PREDICTION_VIEW=ROUTE_COMMERCE_BASE+"/visor-statics/prediction/:key/:date",ROUTE_PROVINCE_SUPERVISOR_REQUESTS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/requests",ROUTE_PROVINCE_SUPERVISOR_ROUTE_MANAGE_GUILDS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/manage-guilds/",ROUTE_PROVINCE_SUPERVISOR_ROUTE_GUILDS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/manage-guilds/guilds",ROUTE_PROVINCE_SUPERVISOR_ROUTE_STEWARDS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/manage-guilds/stewards",ROUTE_PROVINCE_SUPERVISOR_ROUTE_GUILDS_SETTINGS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/manage-guilds/settings",ROUTE_PROVINCE_SUPERVISOR_ROUTE_FILES_STATE=ROUTE_PROVINCE_SUPERVISOR_BASE+"/files-state/",ROUTE_PROVINCE_SUPERVISOR_ROUTE_ALLOCATIONS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/allocations/",ROUTE_PROVINCE_SUPERVISOR_STATICS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/visor-statics",ROUTE_PROVINCE_SUPERVISOR_STATICS_CHARTS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/visor-statics/charts",ROUTE_PROVINCE_SUPERVISOR_STATICS_PREDICTION=ROUTE_PROVINCE_SUPERVISOR_BASE+"/visor-statics/prediction/",ROUTE_PROVINCE_SUPERVISOR_STATICS_PREDICTION_VIEW=ROUTE_PROVINCE_SUPERVISOR_BASE+"/visor-statics/prediction/:key/:date",ROUTE_PROVINCE_SUPERVISOR_HATCHING=ROUTE_PROVINCE_SUPERVISOR_BASE+"/hatching",ROUTE_PROVINCE_SUPERVISOR_REPORTING=ROUTE_PROVINCE_SUPERVISOR_BASE+"/reporting",ROUTE_PROVINCE_SUPERVISORـHATCHINGS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/manage-hatchings",ROUTE_PROVINCE_SUPERVISORـHATCHINGS_DETAILS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/manage-hatchings/:key",ROUTE_PROVINCE_SUPERVISOR_DASHBOARD=ROUTE_PROVINCE_SUPERVISOR_BASE+"/dashbord",ROUTE_PROVINCE_SUPERVISOR_PRICING=ROUTE_PROVINCE_SUPERVISOR_BASE+"/pricing",ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO=ROUTE_PROVINCE_SUPERVISOR_BASE+"/national-info",ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_DETAILS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/national-info/:key",ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_FARM=ROUTE_PROVINCE_SUPERVISOR_BASE+"/national-farm-info",ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_FARM_DETAILS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/national-farm-info/:key/:name",ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_HATCHING_DETAILS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/national-info/:key/:name",ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_SLAUGHTER=ROUTE_PROVINCE_SUPERVISOR_BASE+"/national-slaughter-info",ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_SLAUGHTER_DETAILS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/national-slaughter-info/:unitkey/:name",ROUTE_PROVINCE_SUPERVISOR_DISPENSERS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/dispensers",ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_MANAGEMENT=ROUTE_PROVINCE_SUPERVISOR_BASE+"/dispensers/management",ROUTE_PROVINCE_SUPERVISOR_DISPENSER_DETAILS_VIEW=ROUTE_PROVINCE_SUPERVISOR_BASE+"/dispensers/details/:key",ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STEWARDS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/dispensers/stewards",ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_KILLHOUSES=ROUTE_PROVINCE_SUPERVISOR_BASE+"/dispensers/killhouses",ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_SELL_CARCASS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/dispensers/sell-carcass",ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_INVENTORY=ROUTE_PROVINCE_SUPERVISOR_BASE+"/dispensers/inventory",ROUTE_PROVINCE_SUPERVISOR_SALE_DESTRIBUTION_DETAILS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/dispensers/sale-distribution/:key",ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK=ROUTE_PROVINCE_SUPERVISOR_BASE+"/dispensers/stock",ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK_KILLHOUSE=ROUTE_PROVINCE_SUPERVISOR_BASE+"/dispensers/stock/killhouse",ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK_GUILD=ROUTE_PROVINCE_SUPERVISOR_BASE+"/dispensers/stock/guild",ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK_STEWARD=ROUTE_PROVINCE_SUPERVISOR_BASE+"/dispensers/stock/steward",ROUTE_PROVINCE_SUPERVISOR_REQUEST_DISTRIBUTION=ROUTE_PROVINCE_SUPERVISOR_BASE+"/requests/distribution",ROUTE_PROVINCE_SUPERVISOR_REQUEST_TRANSACTIONS=ROUTE_PROVINCE_SUPERVISOR_BASE+"/requests/transactions",ROUTE_PROVINCE_SUPERVISOR_ROUTE_INSPECTION=ROUTE_PROVINCE_SUPERVISOR_BASE+"/inspection",ROUTE_CITY_COMMERCE_ROUTE_MANAGE_GUILDS=ROUTE_CITY_COMMERCE_BASE+"/manage-guilds/",ROUTE_CITY_COMMERCE_ROUTE_GUILDS=ROUTE_CITY_COMMERCE_BASE+"/manage-guilds/guilds",ROUTE_CITY_COMMERCE_ROUTE_STEWARDS=ROUTE_CITY_COMMERCE_BASE+"/manage-guilds/stewards",ROUTE_CITY_COMMERCE_ROUTE_GUILDS_SETTINGS=ROUTE_CITY_COMMERCE_BASE+"/manage-guilds/settings",ROUTE_CITY_COMMERCE_ROUTE_FILES_STATE=ROUTE_CITY_COMMERCE_BASE+"/files-state/",ROUTE_CITY_COMMERCE_ROUTE_ALLOCATIONS=ROUTE_CITY_COMMERCE_BASE+"/allocations/",ROUTE_CITYVET_USER_PROFILE="/dashboard/profile"+ROUTE_CITYVET_BASE,ROUTE_CITYVET_ROUTE_ALLOCATIONS=ROUTE_CITYVET_BASE+"/allocations/",ROUTE_CITYVET_REGISTER_INFO=ROUTE_CITYVET_BASE+"/farminfo",ROUTE_CITYVET_HATCHING=ROUTE_CITYVET_BASE+"/hatching",ROUTE_CITY_JIHAD_STATICS=ROUTE_CITY_JAHAD_BASE+"/statics",ROUTE_CITY_JIHAD_ROUTE_FILES_STATE=ROUTE_CITY_JAHAD_BASE+"/files-state/",ROUTE_CITY_JIHAD_ROUTE_ALLOCATIONS=ROUTE_CITY_JAHAD_BASE+"/allocations/",ROUTE_CITY_JIHAD_ROUTE_MANAGE_GUILDS=ROUTE_CITY_JAHAD_BASE+"/manage-guilds/",ROUTE_CITY_JIHAD_ROUTE_GUILDS=ROUTE_CITY_JAHAD_BASE+"/manage-guilds/guilds",ROUTE_CITY_JIHAD_ROUTE_STEWARDS=ROUTE_CITY_JAHAD_BASE+"/manage-guilds/stewards",ROUTE_CITY_JIHAD_DISPENSERS=ROUTE_CITY_JAHAD_BASE+"/dispensers",ROUTE_CITY_JIHAD_DISPENSERS_MANAGEMENT=ROUTE_CITY_JAHAD_BASE+"/dispensers/management",ROUTE_CITY_JIHAD_DISPENSER_DETAILS_VIEW=ROUTE_CITY_JAHAD_BASE+"/dispensers/details/:key",ROUTE_CITY_JIHAD_DISPENSERS_STEWARDS=ROUTE_CITY_JAHAD_BASE+"/dispensers/stewards",ROUTE_CITY_JIHAD_DISPENSERS_KILLHOUSES=ROUTE_CITY_JAHAD_BASE+"/dispensers/killhouses",ROUTE_CITY_JIHAD_DISPENSERS_SELL_CARCASS=ROUTE_CITY_JAHAD_BASE+"/dispensers/sell-carcass",ROUTE_CITY_JIHAD_DISPENSERS_INVENTORY=ROUTE_CITY_JAHAD_BASE+"/dispensers/inventory",ROUTE_CITY_JIHAD_SALE_DESTRIBUTION_DETAILS=ROUTE_CITY_JAHAD_BASE+"/dispensers/sale-distribution/:key",ROUTE_CITY_JIHADـHATCHINGS=ROUTE_CITY_JAHAD_BASE+"/manage-hatchings",ROUTE_CITY_JIHAD_HATCHINGS_DETAILS=ROUTE_CITY_JAHAD_BASE+"/manage-hatchings/:key",ROUTE_CITY_POULTRY_STATICS=ROUTE_CITY_POULTRY_BASE+"/statics",ROUTE_CITY_POULTRY_ROUTE_FILES_STATE=ROUTE_CITY_POULTRY_BASE+"/files-state/",ROUTE_CITY_POULTRY_ROUTE_ALLOCATIONS=ROUTE_CITY_POULTRY_BASE+"/allocations/",ROUTE_CITY_POULTRY_ROUTE_MANAGE_GUILDS=ROUTE_CITY_POULTRY_BASE+"/manage-guilds/",ROUTE_CITY_POULTRY_ROUTE_GUILDS=ROUTE_CITY_POULTRY_BASE+"/manage-guilds/guilds",ROUTE_CITY_POULTRY_ROUTE_STEWARDS=ROUTE_CITY_POULTRY_BASE+"/manage-guilds/stewards",ROUTE_CITY_POULTRY_ROUTE_GUILDS_SETTINGS=ROUTE_CITY_POULTRY_BASE+"/manage-guilds/settings",ROUTE_CITY_POULTRY_HATCHING=ROUTE_CITY_POULTRY_BASE+"/hatching",ROUTE_CITY_POULTRYـHATCHINGS=ROUTE_CITY_POULTRY_BASE+"/manage-hatchings",ROUTE_CITY_POULTRYـHATCHINGS_DETAILS=ROUTE_CITY_POULTRY_BASE+"/manage-hatchings/:key",ROUTE_CITY_DISPENSERS=ROUTE_CITY_POULTRY_BASE+"/dispensers",ROUTE_CITY_DISPENSERS_INVENTORY=ROUTE_CITY_POULTRY_BASE+"/dispensers/inventory",ROUTE_CITY_REQUEST_DISTRIBUTION=ROUTE_CITY_POULTRY_BASE+"/request-distribution",ROUTE_CITY_REQUEST_TRANSACTIONS=ROUTE_CITY_POULTRY_BASE+"/requests/transactions",ROUTE_CITY_REQUEST_TRANSACTION_DETAILS=ROUTE_CITY_POULTRY_BASE+"/requests/transactions/:key/:name",ROUTE_OBSERVATORY_STATICS=ROUTE_OBSERVATORY_BASE+"/statics",ROUTE_OBSERVATORY_VISOR_STATICS=ROUTE_OBSERVATORY_BASE+"/visor-statics",ROUTE_OBSERVATORY_VISOR_STATICS_CHARTS=ROUTE_OBSERVATORY_BASE+"/visor-statics/charts",ROUTE_OBSERVATORY_VISOR_STATICS_PREDICTION=ROUTE_OBSERVATORY_BASE+"/visor-statics/prediction/",ROUTE_OBSERVATORY_VISOR_STATICS_PREDICTION_VIEW=ROUTE_OBSERVATORY_BASE+"/visor-statics/prediction/:key/:date",ROUTE_SENF_INVENTORY=ROUTE_SENF_BASE+"/inventory",ROUTE_SENF_INVENTORY_STOCK=ROUTE_SENF_BASE+"/inventory/stock",ROUTE_GUILD_ROOM_ROUTE_MANAGE_GUILDS=ROUTE_GUILD_ROOM_BASE+"/manage-guilds/",ROUTE_GUILD_ROOM_ROUTE_GUILDS_REQUESTS=ROUTE_GUILD_ROOM_BASE+"/manage-guilds/guilds-requests",ROUTE_GUILD_ROOM_ROUTE_GUILDS=ROUTE_GUILD_ROOM_BASE+"/manage-guilds/guilds",ROUTE_GUILD_ROOM_ROUTE_STEWARDS=ROUTE_GUILD_ROOM_BASE+"/manage-guilds/stewards",ROUTE_PSP_ROUTE_COMPANY_MANAGE_STEWARDS=ROUTE_PSP_COMPANY_BASE+"/manage-stewards",ROUTE_PSP_COMPANY_ROUTE_GUILDS=ROUTE_PSP_COMPANY_BASE+"/manage-guilds/guilds",ROUTE_PSP_COMPANY_ROUTE_ACTIVE_SESSION=ROUTE_PSP_COMPANY_BASE+"/active-session/session",ROUTE_PSP_COMPANY_ROUTE_DEVICES=ROUTE_PSP_COMPANY_BASE+"/devices",ROUTE_LIVE_STOCK_SUPPORT_MANAGE_BARS=ROUTE_LIVE_STOCK_SUPPORT_BASE+"/manage-bars",ROUTE_LIVE_STOCK_USER_PROFILE="/dashboard/profile"+ROUTE_LIVE_STOCK_SUPPORT_BASE,ROUTE_LIVE_STOCK_SUPPORT_ROUTE_FILES_STATE=ROUTE_LIVE_STOCK_SUPPORT_BASE+"/files-state/",ROUTE_LIVE_STOCK_FREEZING_REQUESTS=ROUTE_LIVE_STOCK_SUPPORT_BASE+"/freezing/",ROUTE_LIVE_STOCK_COLD_HOUSE=ROUTE_LIVE_STOCK_SUPPORT_BASE+"/coldhouse/",ROUTE_SUPER_ADMIN_REQUESTS=ROUTE_SUPER_ADMIN_BASE+"/requests",ROUTE_SUPER_ADMIN_SETTLEMENTS=ROUTE_SUPER_ADMIN_BASE+"/settlements",ROUTE_SUPER_ADMIN_ACTIVE_REQUESTS=ROUTE_SUPER_ADMIN_BASE+"/requests/active",ROUTE_SUPER_ADMIN_ALLOCATION_REQUESTS=ROUTE_SUPER_ADMIN_BASE+"/requests/allocation",ROUTE_SUPER_ADMIN_ALLOCATED_REQUESTS=ROUTE_SUPER_ADMIN_BASE+"/requests/allocated",ROUTE_SUPER_ADMIN_AUTO_ALLOCATION_REQUESTS=ROUTE_SUPER_ADMIN_BASE+"/requests/auto-allocation",ROUTE_SUPER_ADMIN_CITY_NEW_REQUESTS=ROUTE_SUPER_ADMIN_BASE+"/requests/city",ROUTE_SUPER_ADMIN_NEW_REQUESTS=ROUTE_SUPER_ADMIN_BASE+"/requests/new",ROUTE_SUPER_ADMIN_STATEMENTـOFـNEED_REQUESTS=ROUTE_SUPER_ADMIN_BASE+"/requests/statement-of-need",ROUTE_SUPER_ADMIN_REJECTED_REQUESTS=ROUTE_SUPER_ADMIN_BASE+"/requests/rejected",ROUTE_SUPER_ADMIN_ARCHIVED_REQUESTS=ROUTE_SUPER_ADMIN_BASE+"/requests/archived",ROUTE_SUPER_ADMIN_ISSUANCE_OF_LETTER=ROUTE_SUPER_ADMIN_BASE+"/requests/issuance-of-letter",ROUTE_SUPER_ADMIN_FREE_SALES_REQUESTS=ROUTE_SUPER_ADMIN_BASE+"/requests/free-sale",ROUTE_SUPER_ADMIN_FILE_ROUTE=ROUTE_SUPER_ADMIN_BASE+"/file/:id",ROUTE_SUPER_ADMIN_SEND_MESSAGE=ROUTE_SUPER_ADMIN_BASE+"/sendmessage",ROUTE_SUPER_ADMIN_SEND_ANNOUNCEMENT=ROUTE_SUPER_ADMIN_BASE+"/announcement",ROUTE_SUPER_ADMIN_SEND_REPORT=ROUTE_SUPER_ADMIN_BASE+"/sendreport",ROUTE_SUPER_ADMIN_TICKET=ROUTE_SUPER_ADMIN_BASE+"/ticket/",ROUTE_SUPER_ADMIN_VIEW_TICKET=ROUTE_SUPER_ADMIN_BASE+"/ticket/:id/:create",ROUTE_SUPER_ADMIN_AWAITING_PAYMENT_REQUESTS=ROUTE_SUPER_ADMIN_BASE+"/requests/awaitpayment",ROUTE_SUPER_ADMIN_AWAITING_INSPECTION_REQUESTS=ROUTE_SUPER_ADMIN_BASE+"/requests/awaitinspection",ROUTE_SUPER_ADMIN_STATICS=ROUTE_SUPER_ADMIN_BASE+"/statics",ROUTE_SUPER_ADMIN_NATIONAL_STATICS=ROUTE_SUPER_ADMIN_BASE+"/national-statics",ROUTE_SUPER_ADMIN_HATCHING=ROUTE_SUPER_ADMIN_BASE+"/hatching",ROUTE_SUPER_ADMINـHATCHINGS=ROUTE_SUPER_ADMIN_BASE+"/manage-hatchings",ROUTE_SUPER_ADMINـHATCHINGS_DETAILS=ROUTE_SUPER_ADMIN_BASE+"/manage-hatchings/:key",ROUTE_SUPER_ADMIN_NEW_REQUEST=ROUTE_SUPER_ADMIN_BASE+"/request",ROUTE_SUPER_ADMIN_ROUTE_ALLOCATIONS=ROUTE_SUPER_ADMIN_BASE+"/allocations/",ROUTE_SUPER_ADMIN_ROUTE_MANAGE_GUILDS=ROUTE_SUPER_ADMIN_BASE+"/manage-guilds/",ROUTE_SUPER_ADMIN_ROUTE_IN_PROVINCE_GUILDS=ROUTE_SUPER_ADMIN_BASE+"/manage-guilds/in-province",ROUTE_SUPER_ADMIN_ROUTE_OUT_PROVINCE_GUILDS=ROUTE_SUPER_ADMIN_BASE+"/manage-guilds/out-province",ROUTE_SUPER_ADMIN_ROUTE_OUT_PROVINCE_LEGAL_GUILDS=ROUTE_SUPER_ADMIN_BASE+"/manage-guilds/out-province/legal-guilds",ROUTE_SUPER_ADMIN_ROUTE_OUT_PROVINCE_TRUE_GUILDS=ROUTE_SUPER_ADMIN_BASE+"/manage-guilds/out-province/true-guilds",ROUTE_SUPER_ADMIN_ROUTE_IN_PROVINCE_LEGAL_GUILDS=ROUTE_SUPER_ADMIN_BASE+"/manage-guilds/in-province/legal-guilds",ROUTE_SUPER_ADMIN_ROUTE_IN_PROVINCE_TRUE_GUILDS=ROUTE_SUPER_ADMIN_BASE+"/manage-guilds/in-province/true-guilds",ROUTE_SUPER_ADMIN_ROUTE_GUILDS=ROUTE_SUPER_ADMIN_BASE+"/manage-guilds/guilds",ROUTE_SUPER_ADMIN_ROUTE_IN_PROVINCE_STEWARDS=ROUTE_SUPER_ADMIN_BASE+"/manage-guilds/in-province/stewards",ROUTE_SUPER_ADMIN_ROUTE_GUILDS_SETTINGS=ROUTE_SUPER_ADMIN_BASE+"/manage-guilds/settings",ROUTE_SUPER_ADMIN_ROUTE_AGENT_SHARE=ROUTE_SUPER_ADMIN_BASE+"/agent-share",ROUTE_SUPER_ADMIN_ROUTE_STEWARD_SHARE=ROUTE_SUPER_ADMIN_BASE+"/steward-share",ROUTE_SUPER_ADMIN_ROUTE_AGENT_SHARE_ID=ROUTE_SUPER_ADMIN_BASE+"/agent-share/:id/:date",ROUTE_SUPER_ADMIN_ROUTE_IN_PROVINCE_GUILDS_REQUESTS=ROUTE_SUPER_ADMIN_BASE+"/manage-guilds/in-province/guilds-requests",ROUTE_SUPER_ADMIN_ROUTE_IN_PROVINCE_GUILDS_DISTRIBUTIONS=ROUTE_SUPER_ADMIN_BASE+"/manage-guilds/guilds-distributions",ROUTE_SUPER_ADMIN_RETURN_PURCHASES=ROUTE_SUPER_ADMIN_BASE+"/return-purchases",ROUTE_SUPER_ADMIN_ROUTE_WEIGHT_RANGE=ROUTE_SUPER_ADMIN_BASE+"/manage-process/weight-range",ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS=ROUTE_SUPER_ADMIN_BASE+"/manage-process/",ROUTE_SUPER_ADMIN_ROUTE_RESTRICTION_OF_CARCASS_DISTRIBUTION=ROUTE_SUPER_ADMIN_BASE+"/manage-process/restriction-of-carcass-distribution",ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_SLAUGHTER=ROUTE_SUPER_ADMIN_BASE+"/manage-process/slaughter",ROUTE_SUPER_ADMIN_ROUTE_SLAUGHTER_TRADE_PANEL=ROUTE_SUPER_ADMIN_BASE+"/manage-process/slaughter-trade-panel",ROUTE_SUPER_ADMIN_ROUTE_MANAGE_DISTRIBUTIONS=ROUTE_SUPER_ADMIN_BASE+"/manage-process/manage-distributions",ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_KILLPLACE=ROUTE_SUPER_ADMIN_BASE+"/manage-process/killplace",ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_BUY_REQ=ROUTE_SUPER_ADMIN_BASE+"/manage-process/buy-req",ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_POLICY_COUNCIL=ROUTE_SUPER_ADMIN_BASE+"/manage-process/policy-council",ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_DOCUMENT_STATES=ROUTE_SUPER_ADMIN_BASE+"/manage-process/document-states",ROUTE_SUPER_ADMIN_ROUTE_TICKET_PERMISSION=ROUTE_SUPER_ADMIN_BASE+"/manage-process/ticket-permission",ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_WAGE_FRACTIONS=ROUTE_SUPER_ADMIN_BASE+"/manage-process/wage-fractions",ROUTE_SUPER_ADMIN_ROUTE_POLICY_COUNCIL_POULTRY_CHOOSE_SLAUGHTER=ROUTE_SUPER_ADMIN_BASE+"/policy-council/poultry-choose-slaughter",ROUTE_SUPER_ADMIN_ROUTE_POLICY_COUNCIL_FREE_SALE=ROUTE_SUPER_ADMIN_BASE+"/policy-council/free-sale",ROUTE_SUPER_ADMIN_ROUTE_POLICY_COUNCIL_DIRECT_BUY=ROUTE_SUPER_ADMIN_BASE+"/policy-council/direct-buy",ROUTE_SUPER_ADMIN_ROUTE_POLICY_COUNCIL_KILLHOUSE_GUILDS=ROUTE_SUPER_ADMIN_BASE+"/policy-council/killhouse-guilds",ROUTE_SUPER_ADMIN_ROUTE_FILES_STATE=ROUTE_SUPER_ADMIN_BASE+"/files-state/",ROUTE_SUPER_ADMIN_ROUTE_WEIGHT_CATEGORY=ROUTE_SUPER_ADMIN_BASE+"/manage-process/weight-category",ROUTE_SUPER_ADMIN_ROUTE_PENALTY=ROUTE_SUPER_ADMIN_BASE+"/manage-process/penalty",ROUTE_SUPER_ADMIN_ASSIGN_VET_FARM=ROUTE_SUPER_ADMIN_BASE+"/assign-farm/",ROUTE_SUPER_ADMIN_CARS=ROUTE_SUPER_ADMIN_BASE+"/cars/",ROUTE_SUPER_ADMIN_USERS=ROUTE_SUPER_ADMIN_BASE+"/users/",ROUTE_SUPER_ADMIN_POULTRIES=ROUTE_SUPER_ADMIN_BASE+"/poultries/",ROUTE_SUPER_ADMIN_POULTRIES_DETAILS=ROUTE_SUPER_ADMIN_BASE+"/poultries/:key",ROUTE_SUPER_ADMIN_GUILD_TRANSACTIONS=ROUTE_SUPER_ADMIN_BASE+"/transactions/",ROUTE_SUPER_ADMIN_SLAUGHTERS=ROUTE_SUPER_ADMIN_BASE+"/slaugter-houses/",ROUTE_SUPER_ADMIN_SLAUGHTERS_MONITORING_BUYERS=ROUTE_SUPER_ADMIN_BASE+"/slaugter-houses/monitoring-buyers",ROUTE_SUPER_ADMIN_SLAUGHTERS_MANAGE=ROUTE_SUPER_ADMIN_BASE+"/slaugter-houses/manage",ROUTE_SUPER_ADMIN_ROUTE_SMS=ROUTE_SUPER_ADMIN_BASE+"/sms",ROUTE_SUPER_ADMIN_ROUTE_SMS_SEND=ROUTE_SUPER_ADMIN_BASE+"/sms/send",ROUTE_SUPER_ADMIN_ROUTE_SMS_MANAGE=ROUTE_SUPER_ADMIN_BASE+"/sms/manage",ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_MOBILE_MESSAGE=ROUTE_SUPER_ADMIN_BASE+"/sms/mobile-message",ROUTE_SUPER_ADMIN_ROUTE_AGE_MESSAGE=ROUTE_SUPER_ADMIN_BASE+"/sms/age-message",ROUTE_SUPER_ADMIN_PRICING3=ROUTE_SUPER_ADMIN_BASE+"/pricing",ROUTE_SUPER_ADMIN_BARS=ROUTE_SUPER_ADMIN_BASE+"/bars",ROUTE_SUPER_ADMIN_USER_FILE_ROUTE=ROUTE_SUPER_ADMIN_BASE+"/userfile/:userid",ROUTE_SUPER_ADMIN_OPERATOR_USER_FILE=ROUTE_SUPER_ADMIN_BASE+"/userfile/",ROUTE_SUPER_ADMIN_MANAGE_USERS=ROUTE_SUPER_ADMIN_BASE+"/manage-users/",ROUTE_SUPER_ADMIN_PAYING_FEES_REQUESTS=ROUTE_SUPER_ADMIN_BASE+"/requests/payment-of-fees",ROUTE_SUPER_ADMIN_PAYING_FEES_REQUESTS_VIEW=ROUTE_SUPER_ADMIN_BASE+"/requests/payment-of-fees/:type/:key",ROUT_SUPER_ADMIN_FREE_BUY=ROUTE_SUPER_ADMIN_BASE+"/requests/free-buy",ROUTE_SUPER_ADMIN_BROADCAST_MANAGEMENT=ROUTE_SUPER_ADMIN_BASE+"/broadcast-management",ROUTE_SUPER_ADMIN_REPORT=ROUTE_SUPER_ADMIN_BASE+"/report",ROUTE_SUPER_ADMIN_PRODUCTS=ROUTE_SUPER_ADMIN_BASE+"/products",ROUTE_SUPER_ADMIN_TRANSACTIONS=ROUTE_SUPER_ADMIN_BASE+"/requests/transactions",ROUTE_SUPER_ADMIN_DESTRIBUTION_DETAILS=ROUTE_SUPER_ADMIN_BASE+"/requests/distribution",ROUTE_SUPER_ADMIN_TRANSACTIONS_VIEW=ROUTE_SUPER_ADMIN_BASE+"/requests/transactions/:key/:name",ROUTE_SUPER_ADMIN_CHAINS=ROUTE_SUPER_ADMIN_BASE+"/chains",ROUTE_SUPER_ADMIN_EXPORT=ROUTE_SUPER_ADMIN_BASE+"/requests/export",ROUTE_SUPER_ADMIN_VISOR_STATICS=ROUTE_SUPER_ADMIN_BASE+"/visor-statics",ROUTE_SUPER_ADMIN_VISOR_STATICS_CHARTS=ROUTE_SUPER_ADMIN_BASE+"/visor-statics/charts",ROUTE_SUPER_ADMIN_VISOR_STATICS_PREDICTION=ROUTE_SUPER_ADMIN_BASE+"/visor-statics/prediction/",ROUTE_SUPER_ADMIN_VISOR_STATICS_PREDICTION_VIEW=ROUTE_SUPER_ADMIN_BASE+"/visor-statics/prediction/:key/:date",ROUTE_SUPER_ADMIN_DISPENSERS=ROUTE_SUPER_ADMIN_BASE+"/dispensers",ROUTE_SUPER_ADMIN_DISPENSERS_MANAGEMENT=ROUTE_SUPER_ADMIN_BASE+"/dispensers-management",ROUTE_SUPER_ADMIN_DISPENSER_DETAILS=ROUTE_SUPER_ADMIN_BASE+"/dispenser-data",ROUTE_SUPER_ADMIN_DISPENSER_DETAILS_VIEW=ROUTE_SUPER_ADMIN_BASE+"/dispenser-data/:key",ROUTE_SUPER_ADMIN_DISPENSERS_STEWARDS=ROUTE_SUPER_ADMIN_BASE+"/dispensers-stewards",ROUTE_SUPER_ADMIN_DISPENSERS_KILLHOUSES=ROUTE_SUPER_ADMIN_BASE+"/dispensers-killhouses",ROUTE_SUPER_ADMIN_DISPENSERS_KILLHOUSES_VIEW=ROUTE_SUPER_ADMIN_BASE+"/dispensers-killhouses/:key/:name",ROUTE_SUPER_ADMIN_DISPENSERS_INVENTORY=ROUTE_SUPER_ADMIN_BASE+"/dispensers-inventory",ROUTE_SUPER_ADMIN_DISPENSERS_SELL_CARCASS=ROUTE_SUPER_ADMIN_BASE+"/dispensers-sell-carcass",ROUTE_SUPER_ADMIN_DISPENSERS_STOCK=ROUTE_SUPER_ADMIN_BASE+"/dispensers/stock",ROUTE_SUPER_ADMIN_DISPENSERS_STOCK_KILLHOUSE=ROUTE_SUPER_ADMIN_BASE+"/dispensers/stock/killhouse",ROUTE_SUPER_ADMIN_DISPENSERS_STOCK_GUILD=ROUTE_SUPER_ADMIN_BASE+"/dispensers/stock/guild",ROUTE_SUPER_ADMIN_DISPENSERS_STOCK_STEWARD=ROUTE_SUPER_ADMIN_BASE+"/dispensers/stock/steward",ROUTE_SUPER_ADMIN_COLD_HOUSES=ROUTE_SUPER_ADMIN_BASE+"/cold-house-management",ROUTE_SUPER_ADMIN_COLD_HOUSES_MANAGEMENT=ROUTE_SUPER_ADMIN_BASE+"/cold-houses-management",ROUTE_SUPER_ADMIN_COLD_HOUSES_MANAGEMENT_VIEW=ROUTE_SUPER_ADMIN_BASE+"/cold-houses-management/:key/:name/:type",ROUTE_SUPER_ADMIN_SUB_SECTORS_WAGE=ROUTE_SUPER_ADMIN_BASE+"/subsectors-wage",ROUTE_SUPER_ADMIN_SUB_SECTORS_CITY_SHARES=ROUTE_SUPER_ADMIN_BASE+"/subsectors-city-shares",ROUTE_SUPER_ADMIN_SUB_SECTORS_STEWARD_SHARES=ROUTE_SUPER_ADMIN_BASE+"/subsectors-steward-shares",ROUTE_SUPER_ADMIN_SUB_SECTORS_VET_FARM_SHARES=ROUTE_SUPER_ADMIN_BASE+"/subsectors-vet-farm-shares",ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO=ROUTE_SUPER_ADMIN_BASE+"/national-info",ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_DETAILS=ROUTE_SUPER_ADMIN_BASE+"/national-info/:key",ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_FARM=ROUTE_SUPER_ADMIN_BASE+"/national-farm-info",ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_FARM_DETAILS=ROUTE_SUPER_ADMIN_BASE+"/national-farm-info/:key/:name",ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_HATCHING_DETAILS=ROUTE_SUPER_ADMIN_BASE+"/national-info/:key/:name",ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_SLAUGHTER=ROUTE_SUPER_ADMIN_BASE+"/national-slaughter-info",ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_SLAUGHTER_DETAILS=ROUTE_SUPER_ADMIN_BASE+"/national-slaughter-info/:unitkey/:name",ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_DISTRIBUTION_DETAILS=ROUTE_SUPER_ADMIN_BASE+"/national-slaughter-info/:unitkey/:name/:type",ROUTE_SUPER_ADMIN_ROUTE_KILLERS_WAGES=ROUTE_SUPER_ADMIN_BASE+"/requests/payment-of-fees-killers",ROUTE_SUPER_ADMIN_ROUTE_KILLERS_WAGES_DETAILS=ROUTE_SUPER_ADMIN_BASE+"/requests/payment-of-fees-killers/:key",ROUTE_SUPER_ADMIN_DIFFRENCE_KILLER=ROUTE_SUPER_ADMIN_BASE+"/manage-hatchings/diffrence-killer",ROUTE_SUPER_ADMIN_DIFFRENCE_KILLER_SLAUGHTER=ROUTE_SUPER_ADMIN_BASE+"/manage-hatchings/diffrence-killer-slaughter",ROUTE_SUPER_ADMIN_INCREASE_HATCHING=ROUTE_SUPER_ADMIN_BASE+"/hatching/increase-hatching",ROUTE_SUPER_ADMIN_DASHBOARD=ROUTE_SUPER_ADMIN_BASE+"/dashbord",ROUTE_SUPER_ADMIN_DASHBOARD_NEWS=ROUTE_SUPER_ADMIN_BASE+"/dashboard/news",ROUTE_SUPER_ADMIN_POULTRY_LIVESTOCK_EXPERTS=ROUTE_SUPER_ADMIN_BASE+"/livestock-experts",ROUTE_SUPER_ADMIN_ROUTE_COMPANY_MANAGE_STEWARDS=ROUTE_SUPER_ADMIN_BASE+"/manage-stewards",ROUTE_SUPER_ADMIN_COMPANY_ROUTE_GUILDS=ROUTE_SUPER_ADMIN_BASE+"/manage-guilds/guilds",ROUTE_SUPER_ADMIN_COMPANY_ROUTE_ACTIVE_SESSION=ROUTE_SUPER_ADMIN_BASE+"/active-session/session",ROUTE_SUPER_ADMIN_COMPANY_ROUTE_DEVICES=ROUTE_SUPER_ADMIN_BASE+"/devices",ROUTE_SUPER_ADMIN_ROUTE_INSPECTION=ROUTE_SUPER_ADMIN_BASE+"/inspection",ROUTE_SUPER_ADMIN_TRADING_PANEL=ROUTE_SUPER_ADMIN_BASE+"/requests/trade-panel",ROUTE_CHAIN_COMPANY_USER_PROFILE="/dashboard/profile"+ROUTE_CHAIN_COMPANY_BASE,ROUTE_CHAIN_COMPANY_POULTRIES=ROUTE_CHAIN_COMPANY_BASE+"/poultries/",ROUTE_CHAIN_COMPANY_POULTRIES_DETAILS=ROUTE_CHAIN_COMPANY_BASE+"/poultries/:key",ROUTE_CHAIN_COMPANY_MANAGE_BARS=ROUTE_CHAIN_COMPANY_BASE+"/bars/",ROUTE_CHAIN_COMPANY_MANAGE_FEES=ROUTE_CHAIN_COMPANY_BASE+"/manage-fee/",ROUTE_ADMINX_REQUESTS=ROUTE_ADMINX_BASE+"/requests",ROUTE_ADMINX_SETTLEMENTS=ROUTE_ADMINX_BASE+"/settlements",ROUTE_ADMINX_ACTIVE_REQUESTS=ROUTE_ADMINX_BASE+"/requests/active",ROUTE_ADMINX_ALLOCATION_REQUESTS=ROUTE_ADMINX_BASE+"/requests/allocation",ROUTE_ADMINX_ALLOCATED_REQUESTS=ROUTE_ADMINX_BASE+"/requests/allocated",ROUTE_ADMINX_AUTO_ALLOCATION_REQUESTS=ROUTE_ADMINX_BASE+"/requests/auto-allocation",ROUTE_ADMINX_CITY_NEW_REQUESTS=ROUTE_ADMINX_BASE+"/requests/city",ROUTE_ADMINX_NEW_REQUESTS=ROUTE_ADMINX_BASE+"/requests/new",ROUTE_ADMINX_STATEMENTـOFـNEED_REQUESTS=ROUTE_ADMINX_BASE+"/requests/statement-of-need",ROUTE_ADMINX_REJECTED_REQUESTS=ROUTE_ADMINX_BASE+"/requests/rejected",ROUTE_ADMINX_ARCHIVED_REQUESTS=ROUTE_ADMINX_BASE+"/requests/archived",ROUTE_ADMINX_ISSUANCE_OF_LETTER=ROUTE_ADMINX_BASE+"/requests/issuance-of-letter",ROUTE_ADMINX_FREE_SALES_REQUESTS=ROUTE_ADMINX_BASE+"/requests/free-sale",ROUTE_ADMINX_FILE_ROUTE=ROUTE_ADMINX_BASE+"/file/:id",ROUTE_ADMINX_SEND_MESSAGE=ROUTE_ADMINX_BASE+"/sendmessage",ROUTE_ADMINX_SEND_ANNOUNCEMENT=ROUTE_ADMINX_BASE+"/announcement",ROUTE_ADMINX_SEND_REPORT=ROUTE_ADMINX_BASE+"/sendreport",ROUTE_ADMINX_TICKET=ROUTE_ADMINX_BASE+"/ticket/",ROUTE_ADMINX_VIEW_TICKET=ROUTE_ADMINX_BASE+"/ticket/:id/:create",ROUTE_ADMINX_AWAITING_PAYMENT_REQUESTS=ROUTE_ADMINX_BASE+"/requests/awaitpayment",ROUTE_ADMINX_AWAITING_INSPECTION_REQUESTS=ROUTE_ADMINX_BASE+"/requests/awaitinspection",ROUTE_ADMINX_STATICS=ROUTE_ADMINX_BASE+"/statics",ROUTE_ADMINX_NATIONAL_STATICS=ROUTE_ADMINX_BASE+"/national-statics",ROUTE_ADMINX_HATCHING=ROUTE_ADMINX_BASE+"/hatching",ROUTE_ADMINXـHATCHINGS=ROUTE_ADMINX_BASE+"/manage-hatchings",ROUTE_ADMINXـHATCHINGS_DETAILS=ROUTE_ADMINX_BASE+"/manage-hatchings/:key",ROUTE_ADMINX_NEW_REQUEST=ROUTE_ADMINX_BASE+"/request",ROUTE_ADMINX_ROUTE_ALLOCATIONS=ROUTE_ADMINX_BASE+"/allocations/",ROUTE_ADMINX_ROUTE_MANAGE_GUILDS=ROUTE_ADMINX_BASE+"/manage-guilds/",ROUTE_ADMINX_ROUTE_IN_PROVINCE_GUILDS=ROUTE_ADMINX_BASE+"/manage-guilds/in-province",ROUTE_ADMINX_ROUTE_OUT_PROVINCE_GUILDS=ROUTE_ADMINX_BASE+"/manage-guilds/out-province",ROUTE_ADMINX_ROUTE_OUT_PROVINCE_LEGAL_GUILDS=ROUTE_ADMINX_BASE+"/manage-guilds/out-province/legal-guilds",ROUTE_ADMINX_ROUTE_OUT_PROVINCE_TRUE_GUILDS=ROUTE_ADMINX_BASE+"/manage-guilds/out-province/true-guilds",ROUTE_ADMINX_ROUTE_IN_PROVINCE_LEGAL_GUILDS=ROUTE_ADMINX_BASE+"/manage-guilds/in-province/legal-guilds",ROUTE_ADMINX_ROUTE_IN_PROVINCE_TRUE_GUILDS=ROUTE_ADMINX_BASE+"/manage-guilds/in-province/true-guilds",ROUTE_ADMINX_ROUTE_GUILDS=ROUTE_ADMINX_BASE+"/manage-guilds/guilds",ROUTE_ADMINX_ROUTE_IN_PROVINCE_STEWARDS=ROUTE_ADMINX_BASE+"/manage-guilds/in-province/stewards",ROUTE_ADMINX_ROUTE_GUILDS_SETTINGS=ROUTE_ADMINX_BASE+"/manage-guilds/settings",ROUTE_ADMINX_ROUTE_AGENT_SHARE=ROUTE_ADMINX_BASE+"/agent-share",ROUTE_ADMINX_ROUTE_STEWARD_SHARE=ROUTE_ADMINX_BASE+"/steward-share",ROUTE_ADMINX_ROUTE_AGENT_SHARE_ID=ROUTE_ADMINX_BASE+"/agent-share/:id/:date",ROUTE_ADMINX_ROUTE_IN_PROVINCE_GUILDS_REQUESTS=ROUTE_ADMINX_BASE+"/manage-guilds/in-province/guilds-requests",ROUTE_ADMINX_ROUTE_IN_PROVINCE_GUILDS_DISTRIBUTIONS=ROUTE_ADMINX_BASE+"/manage-guilds/in-province/guilds-distributions",ROUTE_ADMINX_ROUTE_MANAGE_PROCESS=ROUTE_ADMINX_BASE+"/manage-process/",ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_SLAUGHTER=ROUTE_ADMINX_BASE+"/manage-process/slaughter",ROUTE_ADMINX_ROUTE_SLAUGHTER_TRADE_PANEL=ROUTE_ADMINX_BASE+"/manage-process/slaughter-trade-panel",ROUTE_ADMINX_ROUTE_MANAGE_DISTRIBUTIONS=ROUTE_ADMINX_BASE+"/manage-process/manage-distributions",ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_KILLPLACE=ROUTE_ADMINX_BASE+"/manage-process/killplace",ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_BUY_REQ=ROUTE_ADMINX_BASE+"/manage-process/buy-req",ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_POLICY_COUNCIL=ROUTE_ADMINX_BASE+"/manage-process/policy-council",ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_DOCUMENT_STATES=ROUTE_ADMINX_BASE+"/manage-process/document-states",ROUTE_ADMINX_COLD_HOUSES=ROUTE_ADMINX_BASE+"/cold-house-management",ROUTE_ADMINX_COLD_HOUSES_MANAGEMENT=ROUTE_ADMINX_BASE+"/cold-houses-management",ROUTE_ADMINX_COLD_HOUSES_MANAGEMENT_VIEW=ROUTE_ADMINX_BASE+"/cold-houses-management/:key/:name/:type",ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_WAGE_FRACTIONS=ROUTE_ADMINX_BASE+"/manage-process/wage-fractions",ROUTE_ADMINX_ROUTE_POLICY_COUNCIL_POULTRY_CHOOSE_SLAUGHTER=ROUTE_ADMINX_BASE+"/policy-council/poultry-choose-slaughter",ROUTE_ADMINX_ROUTE_POLICY_COUNCIL_FREE_SALE=ROUTE_ADMINX_BASE+"/policy-council/free-sale",ROUTE_ADMINX_ROUTE_POLICY_COUNCIL_DIRECT_BUY=ROUTE_ADMINX_BASE+"/policy-council/direct-buy",ROUTE_ADMINX_ROUTE_POLICY_COUNCIL_KILLHOUSE_GUILDS=ROUTE_ADMINX_BASE+"/policy-council/killhouse-guilds",ROUTE_ADMINX_ROUTE_FILES_STATE=ROUTE_ADMINX_BASE+"/files-state/",ROUTE_ADMINX_ASSIGN_VET_FARM=ROUTE_ADMINX_BASE+"/assign-farm/",ROUTE_ADMINX_CARS=ROUTE_ADMINX_BASE+"/cars/",ROUTE_ADMINX_USERS=ROUTE_ADMINX_BASE+"/users/",ROUTE_ADMINX_POULTRIES=ROUTE_ADMINX_BASE+"/poultries/",ROUTE_ADMINX_POULTRIES_DETAILS=ROUTE_ADMINX_BASE+"/poultries/:key",ROUTE_ADMINX_GUILD_TRANSACTIONS=ROUTE_ADMINX_BASE+"/transactions/",ROUTE_ADMINX_SLAUGHTERS=ROUTE_ADMINX_BASE+"/slaugter-houses/",ROUTE_ADMINX_SLAUGHTERS_MONITORING_BUYERS=ROUTE_ADMINX_BASE+"/slaugter-houses/monitoring-buyers",ROUTE_ADMINX_SLAUGHTERS_MANAGE=ROUTE_ADMINX_BASE+"/slaugter-houses/manage",ROUTE_ADMINX_ROUTE_SMS=ROUTE_ADMINX_BASE+"/sms",ROUTE_ADMINX_ROUTE_SMS_SEND=ROUTE_ADMINX_BASE+"/sms/send",ROUTE_ADMINX_ROUTE_SMS_MANAGE=ROUTE_ADMINX_BASE+"/sms/manage",ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_MOBILE_MESSAGE=ROUTE_ADMINX_BASE+"/sms/mobile-message",ROUTE_ADMINX_ROUTE_AGE_MESSAGE=ROUTE_ADMINX_BASE+"/sms/age-message",ROUTE_ADMINX_PRICING3=ROUTE_ADMINX_BASE+"/pricing",ROUTE_ADMINX_BARS=ROUTE_ADMINX_BASE+"/bars",ROUTE_ADMINX_USER_FILE_ROUTE=ROUTE_ADMINX_BASE+"/userfile/:userid",ROUTE_ADMINX_OPERATOR_USER_FILE=ROUTE_ADMINX_BASE+"/userfile/",ROUTE_ADMINX_MANAGE_USERS=ROUTE_ADMINX_BASE+"/manage-users/",ROUTE_ADMINX_PAYING_FEES_REQUESTS=ROUTE_ADMINX_BASE+"/requests/payment-of-fees",ROUTE_ADMINX_PAYING_FEES_REQUESTS_VIEW=ROUTE_ADMINX_BASE+"/requests/payment-of-fees/:type/:key",ROUT_ADMINX_FREE_BUY=ROUTE_ADMINX_BASE+"/requests/free-buy",ROUTE_ADMINX_BROADCAST_MANAGEMENT=ROUTE_ADMINX_BASE+"/broadcast-management",ROUTE_ADMINX_REPORT=ROUTE_ADMINX_BASE+"/report",ROUTE_ADMINX_PRODUCTS=ROUTE_ADMINX_BASE+"/products",ROUTE_ADMINX_TRANSACTIONS=ROUTE_ADMINX_BASE+"/requests/transactions",ROUTE_ADMINX_SALE_DESTRIBUTION_DETAILS=ROUTE_ADMINX_BASE+"/requests/distribution",ROUTE_ADMINX_TRANSACTIONS_VIEW=ROUTE_ADMINX_BASE+"/requests/transactions/:key/:name",ROUTE_ADMINX_CHAINS=ROUTE_ADMINX_BASE+"/chains",ROUTE_ADMINX_EXPORT=ROUTE_ADMINX_BASE+"/requests/export",ROUTE_ADMINX_ROUTE_ACCOUNTS=ROUTE_ADMINX_BASE+"/manage-process/accounts",ROUTE_ADMINX_PROVINCE_SWITCH=ROUTE_ADMINX_BASE+"/province-switch/",ROUTE_ADMINX_TRADING_PANEL=ROUTE_ADMINX_BASE+"/requests/trade-panel",ROUTE_ADMINX_TRADING_PANEL_DASHBOARD=ROUTE_ADMINX_BASE+"/requests/trade-panel/dashboard",ROUTE_ADMINX_VISOR_STATICS=ROUTE_ADMINX_BASE+"/visor-statics",ROUTE_ADMINX_VISOR_STATICS_CHARTS=ROUTE_ADMINX_BASE+"/visor-statics/charts",ROUTE_ADMINX_VISOR_STATICS_PREDICTION=ROUTE_ADMINX_BASE+"/visor-statics/prediction/",ROUTE_ADMINX_VISOR_STATICS_PREDICTION_VIEW=ROUTE_ADMINX_BASE+"/visor-statics/prediction/:key/:date",ROUTE_ADMINX_EXCEL_CHECK=ROUTE_ADMINX_BASE+"/excel-check",ROUTE_ADMINX_DISPENSERS=ROUTE_ADMINX_BASE+"/dispensers",ROUTE_ADMINX_DISPENSERS_MANAGEMENT=ROUTE_ADMINX_BASE+"/dispensers-management",ROUTE_ADMINX_DISPENSER_DETAILS=ROUTE_ADMINX_BASE+"/dispenser-data",ROUTE_ADMINX_DISPENSER_DETAILS_VIEW=ROUTE_ADMINX_BASE+"/dispenser-data/:key",ROUTE_ADMINX_DISPENSERS_STEWARDS=ROUTE_ADMINX_BASE+"/dispensers-stewards",ROUTE_ADMINX_DISPENSERS_KILLHOUSES=ROUTE_ADMINX_BASE+"/dispensers-killhouses",ROUTE_ADMINX_DISPENSERS_KILLHOUSES_VIEW=ROUTE_ADMINX_BASE+"/dispensers-killhouses/:key/:name",ROUTE_ADMINX_DISPENSERS_INVENTORY=ROUTE_ADMINX_BASE+"/dispensers-inventory",ROUTE_ADMINX_DISPENSERS_SELL_CARCASS=ROUTE_ADMINX_BASE+"/dispensers-sell-carcass",ROUTE_ADMINX_DISPENSERS_STOCK=ROUTE_ADMINX_BASE+"/dispensers/stock",ROUTE_ADMINX_DISPENSERS_STOCK_KILLHOUSE=ROUTE_ADMINX_BASE+"/dispensers/stock/killhouse",ROUTE_ADMINX_DISPENSERS_STOCK_GUILD=ROUTE_ADMINX_BASE+"/dispensers/stock/guild",ROUTE_ADMINX_DISPENSERS_STOCK_STEWARD=ROUTE_ADMINX_BASE+"/dispensers/stock/steward",ROUTE_ADMINX_SUB_SECTORS_WAGE=ROUTE_ADMINX_BASE+"/subsectors-wage",ROUTE_ADMINX_SUB_SECTORS_CITY_SHARES=ROUTE_ADMINX_BASE+"/subsectors-city-shares",ROUTE_ADMINX_SUB_SECTORS_STEWARD_SHARES=ROUTE_ADMINX_BASE+"/subsectors-steward-shares",ROUTE_ADMINX_SUB_SECTORS_VET_FARM_SHARES=ROUTE_ADMINX_BASE+"/subsectors-vet-farm-shares",ROUTE_ADMINX_ROUTE_TICKET_PERMISSION=ROUTE_ADMINX_BASE+"/manage-process/ticket-permission",ROUTE_ADMINX_ROUTE_CRONJOB=ROUTE_ADMINX_BASE+"/cronjob",ROUTE_ADMINX_ROUTE_Sms_Submission_Management=ROUTE_ADMINX_BASE+"/sms-submission-management",ROUTE_ADMINX_ROUTE_WEIGHT_RANGE=ROUTE_ADMINX_BASE+"/manage-process/weight-range",ROUTE_ADMINX_ROUTE_PENALTY=ROUTE_ADMINX_BASE+"/manage-process/penalty",ROUTE_ADMINX_ROUTE_WEIGHT_CATEGORY=ROUTE_ADMINX_BASE+"/manage-process/weight-category",ROUTE_ADMINX_ROUTE_RESTRICTION_OF_CARCASS_DISTRIBUTION=ROUTE_ADMINX_BASE+"/manage-process/restriction-of-carcass-distribution",ROUTE_ADMINX_ROUTE_NATIONAL_INFO=ROUTE_ADMINX_BASE+"/national-info",ROUTE_ADMINX_ROUTE_NATIONAL_INFO_DETAILS=ROUTE_ADMINX_BASE+"/national-info/:key",ROUTE_ADMINX_ROUTE_NATIONAL_INFO_FARM=ROUTE_ADMINX_BASE+"/national-farm-info",ROUTE_ADMINX_ROUTE_NATIONAL_INFO_FARM_DETAILS=ROUTE_ADMINX_BASE+"/national-farm-info/:key/:name",ROUTE_ADMINX_ROUTE_NATIONAL_INFO_HATCHING_DETAILS=ROUTE_ADMINX_BASE+"/national-info/:key/:name",ROUTE_ADMINX_ROUTE_NATIONAL_INFO_SLAUGHTER=ROUTE_ADMINX_BASE+"/national-slaughter-info",ROUTE_ADMINX_ROUTE_NATIONAL_INFO_SLAUGHTER_DETAILS=ROUTE_ADMINX_BASE+"/national-slaughter-info/:unitkey/:name",ROUTE_ADMINX_ROUTE_NATIONAL_INFO_DISTRIBUTION_DETAILS=ROUTE_ADMINX_BASE+"/national-slaughter-info/:unitkey/:name/:type",ROUTE_ADMINX_ROUTE_KILLERS_WAGES=ROUTE_ADMINX_BASE+"/requests/payment-of-fees-killers",ROUTE_ADMINX_ROUTE_KILLERS_WAGES_DETAILS=ROUTE_ADMINX_BASE+"/requests/payment-of-fees-killers/:key",ROUTE_ADMINX_DIFFRENCE_KILLER=ROUTE_ADMINX_BASE+"/manage-hatchings/diffrence-killer",ROUTE_ADMINX_DIFFRENCE_KILLER_SLAUGHTER=ROUTE_ADMINX_BASE+"/manage-hatchings/diffrence-killer-slaughter",ROUTE_ADMINX_INCREASE_HATCHING=ROUTE_ADMINX_BASE+"/hatching/increase-hatching",ROUTE_ADMINX_DASHBOARD=ROUTE_ADMINX_BASE+"/dashbord",ROUTE_ADMINX_DASHBOARD_NEWS=ROUTE_ADMINX_BASE+"/dashboard/news",ROUTE_ADMINX_POULTRY_LIVESTOCK_EXPERTS=ROUTE_ADMINX_BASE+"/livestock-experts",ROUTE_ADMINX_COMPONENTS_CATALOG=ROUTE_ADMINX_BASE+"/components-catalog",ROUTE_ADMINX_RETURN_PURCHASES=ROUTE_ADMINX_BASE+"/return-purchases",ROUTE_ADMINX_ROUTE_COMPANY_MANAGE_STEWARDS=ROUTE_ADMINX_BASE+"/manage-stewards",ROUTE_ADMINX_COMPANY_ROUTE_GUILDS=ROUTE_ADMINX_BASE+"/manage-guilds/guilds",ROUTE_ADMINX_COMPANY_ROUTE_ACTIVE_SESSION=ROUTE_ADMINX_BASE+"/active-session/session",ROUTE_ADMINX_COMPANY_ROUTE_DEVICES=ROUTE_ADMINX_BASE+"/devices",ROUTE_ADMINX_ROUTE_INSPECTION=ROUTE_ADMINX_BASE+"/inspection",ROUTE_SUPPORTER_ROUTE_ALLOCATIONS=ROUTE_SUPPORTER_BASE+"/allocations/",ROUTE_SUPPORTERـHATCHINGS=ROUTE_SUPPORTER_BASE+"/manage-hatchings",ROUTE_SUPPORTERـHATCHINGS_DETAILS=ROUTE_SUPPORTER_BASE+"/manage-hatchings/:key",ROUTE_DISPENSER_DASHBOARD=ROUTE_DISPENSER_BASE+"/dashboard/",ROUTE_PARENT_COMPANY_PAYING_FEES_REQUESTS=ROUTE_PARENT_COMPANY_BASE+"/requests/payment-of-fees",ROUTE_PARENT_COMPANY_PAYING_FEES_VIEW=ROUTE_PARENT_COMPANY_BASE+"/requests/payment-of-fees/:type/:key",ROUTE_PARENT_COMPANY_ALLOCATIONS=ROUTE_PARENT_COMPANY_BASE+"/allocations/",ROUTE_COLD_HOUSE_STEWARD_MORGUE=ROUTE_COLD_HOUSE_STEWARD_BASE+"/morgue",ROUTE_PROVINCE_JAHAD_UNIONS=ROUTE_PROVINCE_JAHAD_BASE+"/unions",ROUTE_PROVINCE_JAHAD_COOPERATIVES=ROUTE_PROVINCE_JAHAD_BASE+"/cooperatives",ROUTE_PROVINCE_JAHAD_RANCHERS=ROUTE_PROVINCE_JAHAD_BASE+"/ranchers",ROUTE_PROVINCE_JAHAD_HERDS=ROUTE_PROVINCE_JAHAD_BASE+"/herds",ROUTE_PROVINCE_JAHAD_USERS=ROUTE_PROVINCE_JAHAD_BASE+"/users",ROUTE_PROVINCE_JAHAD_PRODUCT_DISTRIBUTION=ROUTE_PROVINCE_JAHAD_BASE+"/product-distributions",ROUTE_PROVINCE_JAHAD_PRODUCT_TRANSACTIONS=ROUTE_PROVINCE_JAHAD_BASE+"/product-transactions",ROUTE_PROVINCE_JAHAD_PRODUCT_DISTRIBUTION_ALLOCATION=ROUTE_PROVINCE_JAHAD_BASE+"/product-distributions/allocation",ROUTE_PROVINCE_JAHAD_PRODUCT_DISTRIBUTION_POLICY=ROUTE_PROVINCE_JAHAD_BASE+"/product-distributions/policy",ROUTE_PROVINCE_JAHAD_PRODUCT_SHARES=ROUTE_PROVINCE_JAHAD_BASE+"/product-distributions/shares",ROUTE_PROVINCE_JAHAD_SELL_REPORT=ROUTE_PROVINCE_JAHAD_BASE+"/sell-reports",ROUTE_UNION_COOPERATIVES=ROUTE_UNION_BASE+"/cooperatives",ROUTE_UNION_RANCHERS=ROUTE_UNION_BASE+"/ranchers",ROUTE_UNION_HERDS=ROUTE_UNION_BASE+"/herds",ROUTE_UNION_USERS=ROUTE_UNION_BASE+"/users",ROUTE_UNION_PRODUCT_DISTRIBUTION=ROUTE_UNION_BASE+"/product-distributions",ROUTE_UNION_PRODUCT_TRANSACTIONS=ROUTE_UNION_BASE+"/product-transactions",ROUTE_UNION_PRODUCT_DISTRIBUTION_ALLOCATION=ROUTE_UNION_BASE+"/product-distributions/allocation",ROUTE_UNION_PRODUCT_DISTRIBUTION_POLICY=ROUTE_UNION_BASE+"/product-distributions/policy",ROUTE_UNION_SELL_REPORT=ROUTE_UNION_BASE+"/sell-reports",ROUTE_COOPERATIVE_RANCHERS=ROUTE_COOPERATIVE_BASE+"/ranchers",ROUTE_COOPERATIVE_HERDS=ROUTE_COOPERATIVE_BASE+"/herds",ROUTE_COOPERATIVE_USERS=ROUTE_COOPERATIVE_BASE+"/users",ROUTE_COOPERATIVE_PRODUCT_DISTRIBUTION=ROUTE_COOPERATIVE_BASE+"/product-distributions",ROUTE_COOPERATIVE_PRODUCT_TRANSACTIONS=ROUTE_COOPERATIVE_BASE+"/product-transactions",ROUTE_COOPERATIVE_PRODUCT_DISTRIBUTION_ALLOCATION=ROUTE_COOPERATIVE_BASE+"/product-distributions/allocation",ROUTE_COOPERATIVE_PRODUCT_DISTRIBUTION_POLICY=ROUTE_COOPERATIVE_BASE+"/product-distributions/policy",ROUTE_BAR_SQUARE_TRANSACTIONS=ROUTE_BAR_SQUARE_BASE+"/transactions",Auth=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Auth-CFWkZDlN.js"),__vite__mapDeps([0,1,2,3,4,5,6])))),Support$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Support-B9DfdFaF.js"),__vite__mapDeps([7,1,2,8,4])))),WagePayment$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./WagePayment-C-ToCy2g.js"),__vite__mapDeps([9,1,2,10,4,11,12,13,14,15,16])))),DownloadReport$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./DownloadReport-Kp5MocZr.js"),__vite__mapDeps([17,1,2,4,18])))),guestRouting=[{path:["/"],Page:Auth,exact:!1,props:{}},{path:[ROUTE_GENERAL_SUPPORT],Page:Support$2,exact:!1,props:{}},{path:[ROUTE_GENERAL_WAGE_PAYMENT],Page:WagePayment$1,exact:!1,props:{}},{path:[ROUTE_GENERAL_DOWNLOAD_REPORT],Page:DownloadReport$1,exact:!1,props:{}}],ProvinceRequests=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceRequests-hAb6-LPy.js"),__vite__mapDeps([19,1,2,20,21,4,22,23,24,25,26,27,13,14,15,16,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,12,60,61,62,63,64,65,66,18,67,68,69,70,71,72,73,74])))),ProvinceManagePricing$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceManagePricing-C6sFsNo-.js"),__vite__mapDeps([75,1,2,4,36,76,42,43,44,46,45])))),ProvinceProducts=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceProducts-CJk-kZIC.js"),__vite__mapDeps([77,1,2,4,12,13,14,15,16])))),CarManagement$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./CarManagement-Chl2SE7Y.js"),__vite__mapDeps([78,1,2,4,40,32,23,45,79,80,42,43,44])))),UserManagement$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceUserManagement-CHb4mhM7.js"),__vite__mapDeps([81,1,2,4,42,43,44,58,82,45,16,35,83,15,36,84,51,40,32,23,85])))),Guilds$5=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Guilds-CrGG7yyR.js"),__vite__mapDeps([86,1,2,55,20,21,4,25,23,87,22,32,46,45,42,43,44,5,51,14,71,88,89,90,8,91,92,93,38,37,33,94,12,13,15,16,95,96])))),AgentShare$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterAgentShare-DjSsZVvD.js"),__vite__mapDeps([97,1,2,4,32,23,42,43,44,27,13,14,15,16,36,12,98,45,46,99,100,101,102,103,104,33,55])))),Hatching$7=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./OperatorNewHatching-Dh3A7QxF.js"),__vite__mapDeps([105,1,2,4,106,15,16,35,38,39,34,36,37,12,13,14,64,107,41,33,56,32,23,57,45,28,46,58,42,43,44,108,109,110,68,69,70,71,30,52,111,112,113,49,114,102,103,115,27,116,117,118,85,55,119,120,5,121,48,74])))),NationalInfo$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./NationalInfo-DSCN5jIW.js"),__vite__mapDeps([122,1,2,119,4,32,23,42,43,44,120,45,112,113,49,5,121,48,46,74,15])))),VetFarmAllocations$a=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VetFarmAllocations-COn5OrGn.js"),__vite__mapDeps([123,1,2,124,5,74,46,4,125,48,12,13,14,15,16,23,32,126,42,43,44,127,102,103,115,111,112,128,41,129,45,130,131,36,69,70,71,30,47,33,72,73,40,132,67,79,133,121,134,135,136,65,66])))),SendMassage=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SendMassage-DcwNiFfb.js"),__vite__mapDeps([137,1,2,21,4,85,35,135,32,23,27,13,14,15,16,24,55,6,138,139,44,45,103,46,42,43])))),ManageProcess=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ManageProcess-BGlzQVMp.js"),__vite__mapDeps([140,1,2,55,4,42,43,44,45,38,141,142,22,23,21,20,24,60,46,32,27,13,14,15,16,56,64,107,134,143,144,104,145,131,12,138,51,146,147,96,148])))),ManageProcessWages=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ManageProcessWageFractions-Cl3DA4uk.js"),__vite__mapDeps([149,1,2,55,4,46,42,43,44,141,146])))),ManageFarm$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ManageFarm-BTM56jv5.js"),__vite__mapDeps([150,1,2,4,15,16,42,43,44,32,23,45,151])))),PolicyCouncil=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./PolicyCouncil-0xtufC-L.js"),__vite__mapDeps([152,1,2,4,27,13,14,15,16,55,42,43,44])))),FilesState$a=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./FilesState-DMM_jfCL.js"),__vite__mapDeps([153,1,2,4,154,32,23,42,43,44,155,156])))),BarInfos=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./BarInfos-BmLW4eH9.js"),__vite__mapDeps([157,1,2,27,13,4,14,15,16])))),Slaughters=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Slaughters-Drh8o5nL.js"),__vite__mapDeps([158,1,2,159,27,13,4,14,15,16,28,55,20,21,22,23,87,5,42,43,44])))),UserFile$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceUserFile-cShttUtU.js"),__vite__mapDeps([160,1,2,161,4,12,13,14,15,16,46,162,83,84,36,40,163,164])))),Users=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Users-CuH8b--q.js"),__vite__mapDeps([165,1,2,4])))),Poultries$3=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Poultries-DB3DCFBq.js"),__vite__mapDeps([166,1,2,4,32,23,42,43,44,45,151,49,50,5])))),ProvinceFees=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceFees-UfT7wk-6.js"),__vite__mapDeps([167,1,2,55,4,42,43,44,113,49,46,168,10,11,32,23,111,112,14,115,102,103,16,45,117,13,15,169,142,12,170,5,139])))),BroadcastManagement=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./BroadcastManagement-RkF4bwmH.js"),__vite__mapDeps([171,1,2,97,4,32,23,42,43,44,27,13,14,15,16,36,12,98,45,46,99,100,101,102,103,104,33,55,25,21,20])))),Reports$3=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceReports-B30xgkxd.js"),__vite__mapDeps([172,1,2,55,4,32,23,173])))),TransactionsPage$4=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Transactions-BSJVJOEU.js"),__vite__mapDeps([174,1,2,4,32,23,42,43,44,113,49,130,55,175])))),GuildTransactions=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceGuildsTransactions-DY4o9JwV.js"),__vite__mapDeps([176,1,2,4,27,13,14,15,16,90,8,71,175,116])))),VisorStatics$4=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VisorStatics-RjLo9w8U.js"),__vite__mapDeps([177,1,2,178,4,179,14,112,32,23,21,22,20,55,42,43,44,36,169,30,180,120,113,49])))),TradePanel$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./TradePanel-nvBox6P7.js"),__vite__mapDeps([181,1,2,55,4,32,23,5,145,116,180,179,42,43,44,58,45,46,16,63,62,65,66,164])))),Dispensers$3=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterHouseDispenserDashboard-JLw8VA3Q.js"),__vite__mapDeps([182,1,2,20,21,4,22,23,24,55,42,43,44,183,40,45,46,32,5,184,185,113,49,79,80,101,36,111,112,14,186,121,48,74,187,188,16])))),AllHatchings$5=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminHatchings-CjLz-abB.js"),__vite__mapDeps([189,1,2,109,4,110,32,23,35,106,15,16,38,39,34,36,37,12,13,14,64,107,41,33,68,45,69,70,71,30,52,46,42,43,44,111,112,113,49,114,102,103,115,27,116,117,121,48,74,55,173])))),ColdHouses=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceColdHousesPage-61BwlOTB.js"),__vite__mapDeps([190,1,2,55,20,21,4,42,43,44,32,23,5,67,46,45])))),SubSectorWage$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SubSectorWage-C6GLWIJC.js"),__vite__mapDeps([191,1,2,55,20,21,4,22,23,42,43,44,170,113,49,102,103,16,115,111,112,14,46,45,32])))),KillersWages=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceKillersWages-DomGWVQy.js"),__vite__mapDeps([192,1,2,55,4,42,43,44,12,13,14,15,16])))),DiffrenceKiller$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./DiffrenceKillerPage-KlaL3_Gy.js"),__vite__mapDeps([193,1,2,20,21,4,22,23,87,114,32,42,43,44,34,102,103,16,115,45,46,111,112,14,55])))),DashboardPage$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./DashboardPage-CBj16f8q.js"),__vite__mapDeps([194,1,2,4,179,195,42,43,44,32,23,185,113,49,173,12,13,14,15,16,180,164])))),SettlementPage$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminSettlement-QnXM2P7E.js"),__vite__mapDeps([196,1,2,113,49,4,32,23,62,70,45,197,14,38,80,136,102,103,16,115,111,112,42,43,44,65,66,55])))),PoultryScienceExpertsPage=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./PoultryScienceExperts-DLgx0ZrE.js"),__vite__mapDeps([198,1,2,4,32,23,42,43,44,35])))),ReturnPurchases$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ReturnPurchases-B5_lL37U.js"),__vite__mapDeps([199,1,2,55,42,43,44,32,23,4,71,45])))),ComponentsCatalog=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ComponentsCatalog-RdvMiEfN.js"),__vite__mapDeps([200,1,2,55,201,26,76,3,37,12,13,4,14,15,16,42,43,44,202,179,203,35,46,146,73,90])))),ExcelCheck=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminXExcelCheck-Dhsh4oVZ.js"),__vite__mapDeps([204,1,2,42,43,44,4])))),AdminXDashboard=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminXDashboard-DfgejEhn.js"),__vite__mapDeps([205,1,2])))),Statics$a=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminStatics-XraSRt5m.js"),__vite__mapDeps([206,1,2,4,179,203,32,23,195,178,112])))),Tickets$5=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Tickets-rkAj5df6.js"),__vite__mapDeps([207,1,2,55,102,103,16,4,70,197,51,111,112,14,42,43,44])))),Message=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceSendMessage-CZGfVdJQ.js"),__vite__mapDeps([208,1,2,4,102,103,16,51,14,209])))),NewFile$6=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./NewFile-DzVKWg18.js"),__vite__mapDeps([210,1,2,211,12,13,4,14,15,16,29,59,201,212,36,30,102,103,213,35,161])))),DispensersStock$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceDispensersStock-BetLU9Ax.js"),__vite__mapDeps([214,1,2,20,21,4,55,22,23,24,215])))),ProvinceDispensersStockSlug$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceDispensersStockSlug-DxEHlpI2.js"),__vite__mapDeps([216,1,2,55,4,42,43,44,102,103,16,115,15])))),PoultriesDetails$3=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./PoultriesDetailsPage-Bu9GJg8X.js"),__vite__mapDeps([217,1,2,4,113,49,15,42,43,44,121,48,46,74,55])))),Inspection=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Inspection-BSxrKtLr.js"),__vite__mapDeps([218,1,2,4,32,23,42,43,44,55,33,14,5])))),PspCompany=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./PspCompany-DFqxFNI1.js"),__vite__mapDeps([219,1,2,55,20,21,4,24,23,32,42,43,44,89,90,8,91,92,93,71,38,37,33,45,46,27,13,14,15,16,12,164,30,35,95])))),consolidatedRouting=[{path:[ROUTE_ADMINX_PROVINCE_SWITCH],Page:AdminXDashboard,exact:!1,props:{}},{path:[ROUTE_ADMINX_STATICS,ROUTE_PROVINCE_STATICS,ROUTE_SUPER_ADMIN_STATICS],Page:Statics$a,exact:!1,props:{}},{path:[ROUTE_ADMINX_TICKET,ROUTE_ADMINX_VIEW_TICKET,ROUTE_PROVINCE_TICKET,ROUTE_PROVINCE_VIEW_TICKET,ROUTE_SUPER_ADMIN_TICKET,ROUTE_SUPER_ADMIN_VIEW_TICKET],Page:Tickets$5,exact:!1,props:{}},{path:[ROUTE_ADMINX_SEND_MESSAGE,ROUTE_PROVINCE_SEND_MESSAGE,ROUTE_SUPER_ADMIN_SEND_MESSAGE],Page:Message,exact:!1,props:{}},{path:[ROUTE_ADMINX_FILE_ROUTE,ROUTE_PROVINCE_FILE_ROUTE,ROUTE_SUPER_ADMIN_FILE_ROUTE],Page:NewFile$6,exact:!1,props:{}},{path:[ROUTE_ADMINX_USERS,ROUTE_PROVINCE_USERS,ROUTE_SUPER_ADMIN_USERS],Page:UserManagement$2,exact:!1,props:{}},{path:[ROUTE_ADMINX_REQUESTS,ROUTE_ADMINX_CITY_NEW_REQUESTS,ROUTE_ADMINX_NEW_REQUESTS,ROUTE_ADMINX_REJECTED_REQUESTS,ROUTE_ADMINX_ARCHIVED_REQUESTS,ROUTE_ADMINX_ISSUANCE_OF_LETTER,ROUTE_ADMINX_AWAITING_PAYMENT_REQUESTS,ROUTE_ADMINX_AWAITING_INSPECTION_REQUESTS,ROUTE_ADMINX_ACTIVE_REQUESTS,ROUTE_ADMINX_STATEMENTـOFـNEED_REQUESTS,ROUTE_ADMINX_ALLOCATION_REQUESTS,ROUTE_ADMINX_FREE_SALES_REQUESTS,ROUTE_ADMINX_AUTO_ALLOCATION_REQUESTS,ROUTE_ADMINX_ALLOCATED_REQUESTS,ROUTE_ADMINX_CHAINS,ROUTE_ADMINX_EXPORT,ROUT_ADMINX_FREE_BUY,ROUTE_PROVINCE_REQUESTS,ROUTE_PROVINCE_CITY_NEW_REQUESTS,ROUTE_PROVINCE_NEW_REQUESTS,ROUTE_PROVINCE_REJECTED_REQUESTS,ROUTE_PROVINCE_ARCHIVED_REQUESTS,ROUTE_PROVINCE_ISSUANCE_OF_LETTER,ROUTE_PROVINCE_AWAITING_PAYMENT_REQUESTS,ROUTE_PROVINCE_AWAITING_INSPECTION_REQUESTS,ROUTE_PROVINCE_ACTIVE_REQUESTS,ROUTE_PROVINCE_STATEMENTـOFـNEED_REQUESTS,ROUTE_PROVINCE_ALLOCATION_REQUESTS,ROUTE_PROVINCE_FREE_SALES_REQUESTS,ROUTE_PROVINCE_AUTO_ALLOCATION_REQUESTS,ROUTE_PROVINCE_ALLOCATED_REQUESTS,ROUTE_PROVINCEـFREE_BUY,ROUTE_PROVINCE_CHAINS,ROUTE_PROVINCEـEXPORT,ROUTE_SUPER_ADMIN_REQUESTS,ROUTE_SUPER_ADMIN_CITY_NEW_REQUESTS,ROUTE_SUPER_ADMIN_NEW_REQUESTS,ROUTE_SUPER_ADMIN_REJECTED_REQUESTS,ROUTE_SUPER_ADMIN_ARCHIVED_REQUESTS,ROUTE_SUPER_ADMIN_ISSUANCE_OF_LETTER,ROUTE_SUPER_ADMIN_AWAITING_PAYMENT_REQUESTS,ROUTE_SUPER_ADMIN_AWAITING_INSPECTION_REQUESTS,ROUTE_SUPER_ADMIN_ACTIVE_REQUESTS,ROUTE_SUPER_ADMIN_STATEMENTـOFـNEED_REQUESTS,ROUTE_SUPER_ADMIN_ALLOCATION_REQUESTS,ROUTE_SUPER_ADMIN_FREE_SALES_REQUESTS,ROUTE_SUPER_ADMIN_AUTO_ALLOCATION_REQUESTS,ROUTE_SUPER_ADMIN_ALLOCATED_REQUESTS,ROUTE_SUPER_ADMIN_CHAINS,ROUTE_SUPER_ADMIN_EXPORT,ROUT_SUPER_ADMIN_FREE_BUY],Page:ProvinceRequests,exact:!1,props:{}},{path:[ROUTE_ADMINX_BROADCAST_MANAGEMENT,ROUTE_PROVINCEـBROADCAST_MANAGEMENT,ROUTE_SUPER_ADMIN_BROADCAST_MANAGEMENT],Page:BroadcastManagement,exact:!1,props:{}},{path:[ROUTE_ADMINX_REPORT,ROUTE_PROVINCE_REPORT,ROUTE_SUPER_ADMIN_REPORT],Page:Reports$3,exact:!1,props:{}},{path:[ROUTE_ADMINX_PRODUCTS,ROUTE_PROVINCE_PRODUCTS,ROUTE_SUPER_ADMIN_PRODUCTS],Page:ProvinceProducts,exact:!1,props:{}},{path:[ROUTE_ADMINX_TRANSACTIONS,ROUTE_ADMINX_TRANSACTIONS_VIEW,ROUTE_PROVINCE_TRANSACTIONS,ROUTE_PROVINCE_TRANSACTIONS_VIEW,ROUTE_SUPER_ADMIN_TRANSACTIONS,ROUTE_SUPER_ADMIN_TRANSACTIONS_VIEW],Page:TransactionsPage$4,exact:!1,props:{}},{path:[ROUTE_ADMINX_GUILD_TRANSACTIONS,ROUTE_PROVINCE_GUILD_TRANSACTIONS,ROUTE_SUPER_ADMIN_GUILD_TRANSACTIONS],Page:GuildTransactions,exact:!1,props:{}},{path:[ROUTE_ADMINX_PAYING_FEES_REQUESTS,ROUTE_ADMINX_PAYING_FEES_REQUESTS_VIEW,ROUTE_PROVINCE_PAYING_FEES_REQUESTS,ROUTE_PROVINCE_PAYING_FEES_REQUESTS_VIEW,ROUTE_SUPER_ADMIN_PAYING_FEES_REQUESTS,ROUTE_SUPER_ADMIN_PAYING_FEES_REQUESTS_VIEW],Page:ProvinceFees,exact:!1,props:{}},{path:[ROUTE_ADMINX_ROUTE_AGENT_SHARE,ROUTE_ADMINX_ROUTE_AGENT_SHARE_ID,ROUTE_ADMINX_ROUTE_STEWARD_SHARE,ROUTE_PROVINCE_ROUTE_AGENT_SHARE,ROUTE_PROVINCE_ROUTE_AGENT_SHARE_ID,ROUTE_PROVINCE_ROUTE_STEWARD_SHARE,ROUTE_SUPER_ADMIN_ROUTE_AGENT_SHARE,ROUTE_SUPER_ADMIN_ROUTE_AGENT_SHARE_ID,ROUTE_SUPER_ADMIN_ROUTE_STEWARD_SHARE],Page:AgentShare$1,exact:!1,props:{}},{path:[ROUTE_ADMINX_ROUTE_MANAGE_GUILDS,ROUTE_ADMINX_ROUTE_GUILDS,ROUTE_ADMINX_ROUTE_IN_PROVINCE_STEWARDS,ROUTE_ADMINX_ROUTE_GUILDS_SETTINGS,ROUTE_ADMINX_ROUTE_IN_PROVINCE_GUILDS_REQUESTS,ROUTE_ADMINX_ROUTE_IN_PROVINCE_GUILDS_DISTRIBUTIONS,ROUTE_PROVINCE_ROUTE_MANAGE_GUILDS,ROUTE_PROVINCE_ROUTE_GUILDS,ROUTE_PROVINCE_ROUTE_IN_PROVINCE_STEWARDS,ROUTE_PROVINCE_ROUTE_GUILDS_SETTINGS,ROUTE_PROVINCE_ROUTE_IN_PROVINCE_GUILDS_REQUESTS,ROUTE_SUPER_ADMIN_ROUTE_MANAGE_GUILDS,ROUTE_SUPER_ADMIN_ROUTE_GUILDS,ROUTE_SUPER_ADMIN_ROUTE_IN_PROVINCE_STEWARDS,ROUTE_SUPER_ADMIN_ROUTE_GUILDS_SETTINGS,ROUTE_SUPER_ADMIN_ROUTE_IN_PROVINCE_GUILDS_REQUESTS,ROUTE_SUPER_ADMIN_ROUTE_IN_PROVINCE_GUILDS_DISTRIBUTIONS,ROUTE_SUPER_ADMIN_ROUTE_OUT_PROVINCE_GUILDS,ROUTE_ADMINX_ROUTE_OUT_PROVINCE_GUILDS,ROUTE_PROVINCE_ROUTE_OUT_PROVINCE_GUILDS,ROUTE_ADMINX_ROUTE_IN_PROVINCE_GUILDS,ROUTE_PROVINCE_ROUTE_IN_PROVINCE_GUILDS,ROUTE_SUPER_ADMIN_ROUTE_IN_PROVINCE_GUILDS,ROUTE_SUPER_ADMIN_ROUTE_IN_PROVINCE_TRUE_GUILDS,ROUTE_ADMINX_ROUTE_IN_PROVINCE_TRUE_GUILDS,ROUTE_PROVINCE_ROUTE_IN_PROVINCE_TRUE_GUILDS,ROUTE_SUPER_ADMIN_ROUTE_OUT_PROVINCE_TRUE_GUILDS,ROUTE_ADMINX_ROUTE_OUT_PROVINCE_TRUE_GUILDS,ROUTE_PROVINCE_ROUTE_OUT_PROVINCE_TRUE_GUILDS,ROUTE_SUPER_ADMIN_ROUTE_IN_PROVINCE_LEGAL_GUILDS,ROUTE_ADMINX_ROUTE_IN_PROVINCE_LEGAL_GUILDS,ROUTE_PROVINCE_ROUTE_IN_PROVINCE_LEGAL_GUILDS,ROUTE_SUPER_ADMIN_ROUTE_OUT_PROVINCE_LEGAL_GUILDS,ROUTE_ADMINX_ROUTE_OUT_PROVINCE_LEGAL_GUILDS,ROUTE_PROVINCE_ROUTE_OUT_PROVINCE_LEGAL_GUILDS],Page:Guilds$5,exact:!1,props:{}},{path:[ROUTE_ADMINX_SLAUGHTERS,ROUTE_SLAUGHTER_ACTIVE_REQUESTS,ROUTE_PROVINCE_SLAUGHTERS,ROUTE_SUPER_ADMIN_SLAUGHTERS,ROUTE_ADMINX_SLAUGHTERS_MONITORING_BUYERS,ROUTE_PROVINCE_SLAUGHTERS_MONITORING_BUYERS,ROUTE_SUPER_ADMIN_SLAUGHTERS_MONITORING_BUYERS],Page:Slaughters,exact:!1,props:{}},{path:[ROUTE_ADMINX_POULTRIES,ROUTE_PROVINCE_POULTRIES,ROUTE_SUPER_ADMIN_POULTRIES],Page:Poultries$3,exact:!1,props:{}},{path:[ROUTE_ADMINX_USERS,ROUTE_PROVINCE_USERS,ROUTE_SUPER_ADMIN_USERS],Page:Users,exact:!1,props:{}},{path:[ROUTE_ADMINX_CARS,ROUTE_PROVINCE_CARS,ROUTE_SUPER_ADMIN_CARS],Page:CarManagement$1,exact:!1,props:{}},{path:[ROUTE_ADMINX_ASSIGN_VET_FARM,ROUTE_PROVINCE_ASSIGN_VET_FARM,ROUTE_SUPER_ADMIN_ASSIGN_VET_FARM],Page:ManageFarm$1,exact:!1,props:{}},{path:[ROUTE_ADMINX_ROUTE_ALLOCATIONS,ROUTE_PROVINCE_ROUTE_ALLOCATIONS,ROUTE_SUPER_ADMIN_ROUTE_ALLOCATIONS],Page:VetFarmAllocations$a,exact:!1,props:{}},{path:[ROUTE_ADMINX_ROUTE_MANAGE_PROCESS,ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_POLICY_COUNCIL,ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_SLAUGHTER,ROUTE_ADMINX_ROUTE_SLAUGHTER_TRADE_PANEL,ROUTE_ADMINX_ROUTE_MANAGE_DISTRIBUTIONS,ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_KILLPLACE,ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_BUY_REQ,ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_DOCUMENT_STATES,ROUTE_ADMINX_ROUTE_ACCOUNTS,ROUTE_ADMINX_ROUTE_TICKET_PERMISSION,ROUTE_ADMINX_ROUTE_CRONJOB,ROUTE_ADMINX_ROUTE_Sms_Submission_Management,ROUTE_ADMINX_ROUTE_WEIGHT_RANGE,ROUTE_ADMINX_ROUTE_WEIGHT_CATEGORY,ROUTE_ADMINX_ROUTE_PENALTY,ROUTE_ADMINX_ROUTE_RESTRICTION_OF_CARCASS_DISTRIBUTION,ROUTE_PROVINCE_ROUTE_MANAGE_PROCESS,ROUTE_PROVINCE_ROUTE_MANAGE_PROCESS_POLICY_COUNCIL,ROUTE_PROVINCE_ROUTE_MANAGE_PROCESS_SLAUGHTER,ROUTE_PROVINCE_ROUTE_MANAGE_PROCESS_KILLPLACE,ROUTE_PROVINCE_ROUTE_MANAGE_PROCESS_BUY_REQ,ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS,ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_POLICY_COUNCIL,ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_SLAUGHTER,ROUTE_SUPER_ADMIN_ROUTE_SLAUGHTER_TRADE_PANEL,ROUTE_SUPER_ADMIN_ROUTE_MANAGE_DISTRIBUTIONS,ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_KILLPLACE,ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_BUY_REQ,ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_DOCUMENT_STATES,ROUTE_SUPER_ADMIN_ROUTE_TICKET_PERMISSION,ROUTE_SUPER_ADMIN_ROUTE_WEIGHT_CATEGORY,ROUTE_SUPER_ADMIN_ROUTE_WEIGHT_RANGE,ROUTE_SUPER_ADMIN_ROUTE_PENALTY,ROUTE_SUPER_ADMIN_ROUTE_RESTRICTION_OF_CARCASS_DISTRIBUTION],Page:ManageProcess,exact:!1,props:{}},{path:[ROUTE_ADMINX_ROUTE_POLICY_COUNCIL_POULTRY_CHOOSE_SLAUGHTER,ROUTE_ADMINX_ROUTE_POLICY_COUNCIL_FREE_SALE,ROUTE_ADMINX_ROUTE_POLICY_COUNCIL_DIRECT_BUY,ROUTE_ADMINX_ROUTE_POLICY_COUNCIL_KILLHOUSE_GUILDS,ROUTE_PROVINCE_ROUTE_POLICY_COUNCIL_POULTRY_CHOOSE_SLAUGHTER,ROUTE_PROVINCE_ROUTE_POLICY_COUNCIL_FREE_SALE,ROUTE_PROVINCE_ROUTE_POLICY_COUNCIL_DIRECT_BUY,ROUTE_PROVINCE_ROUTE_POLICY_COUNCIL_KILLHOUSE_GUILDS,ROUTE_SUPER_ADMIN_ROUTE_POLICY_COUNCIL_POULTRY_CHOOSE_SLAUGHTER,ROUTE_SUPER_ADMIN_ROUTE_POLICY_COUNCIL_FREE_SALE,ROUTE_SUPER_ADMIN_ROUTE_POLICY_COUNCIL_DIRECT_BUY,ROUTE_SUPER_ADMIN_ROUTE_POLICY_COUNCIL_KILLHOUSE_GUILDS],Page:PolicyCouncil,exact:!1,props:{}},{path:[ROUTE_ADMINX_ROUTE_FILES_STATE,ROUTE_PROVINCE_ROUTE_FILES_STATE,ROUTE_SUPER_ADMIN_ROUTE_FILES_STATE],Page:FilesState$a,exact:!1,props:{}},{path:[ROUTE_ADMINX_BARS,ROUTE_PROVINCE_BARS,ROUTE_SUPER_ADMIN_BARS],Page:BarInfos,exact:!1,props:{}},{path:[ROUTE_ADMINX_USER_FILE_ROUTE,ROUTE_PROVINCE_USER_FILE_ROUTE,ROUTE_SUPER_ADMIN_USER_FILE_ROUTE],Page:UserFile$2,exact:!1,props:{}},{path:[ROUTE_ADMINX_MANAGE_USERS,ROUTE_PROVINCE_MANAGE_USERS,ROUTE_SUPER_ADMIN_MANAGE_USERS],Page:UserManagement$2,exact:!1,props:{}},{path:[ROUTE_ADMINX_PRICING3,ROUTE_PROVINCE_PRICING3,ROUTE_SUPER_ADMIN_PRICING3],Page:ProvinceManagePricing$2,exact:!1,props:{}},{path:[ROUTE_ADMINX_VISOR_STATICS,ROUTE_ADMINX_VISOR_STATICS_CHARTS,ROUTE_ADMINX_VISOR_STATICS_PREDICTION,ROUTE_ADMINX_VISOR_STATICS_PREDICTION_VIEW,ROUTE_ADMINX_NATIONAL_STATICS,ROUTE_PROVINCEـVISOR_STATICS,ROUTE_PROVINCEـVISOR_STATICS_CHARTS,ROUTE_PROVINCEـVISOR_STATICS_PREDICTION,ROUTE_PROVINCEـVISOR_STATICS_PREDICTION_VIEW,ROUTE_SUPER_ADMIN_VISOR_STATICS,ROUTE_SUPER_ADMIN_VISOR_STATICS_CHARTS,ROUTE_SUPER_ADMIN_VISOR_STATICS_PREDICTION,ROUTE_SUPER_ADMIN_VISOR_STATICS_PREDICTION_VIEW,ROUTE_SUPER_ADMIN_NATIONAL_STATICS],Page:VisorStatics$4,exact:!1,props:{}},{path:[ROUTE_ADMINX_TRADING_PANEL,ROUTE_ADMINX_TRADING_PANEL_DASHBOARD,ROUTE_PROVINCE_TRADING_PANEL,ROUTE_SUPER_ADMIN_TRADING_PANEL],Page:TradePanel$1,exact:!1,props:{}},{path:[ROUTE_ADMINX_DISPENSERS,ROUTE_ADMINX_DISPENSERS_MANAGEMENT,ROUTE_ADMINX_DISPENSER_DETAILS,ROUTE_ADMINX_DISPENSER_DETAILS_VIEW,ROUTE_ADMINX_DISPENSERS_STEWARDS,ROUTE_ADMINX_DISPENSERS_KILLHOUSES,ROUTE_ADMINX_DISPENSERS_KILLHOUSES_VIEW,ROUTE_ADMINX_DISPENSERS_SELL_CARCASS,ROUTE_ADMINX_DISPENSERS_INVENTORY,ROUTE_ADMINX_SALE_DESTRIBUTION_DETAILS,ROUTE_PROVINCE_DISPENSERS,ROUTE_PROVINCE_DISPENSERS_MANAGEMENT,ROUTE_PROVINCE_DISPENSER_DETAILS,ROUTE_PROVINCE_DISPENSER_DETAILS_VIEW,ROUTE_PROVINCE_DISPENSERS_STEWARDS,ROUTE_PROVINCE_DISPENSERS_KILLHOUSES,ROUTE_PROVINCE_DISPENSERS_KILLHOUSES_VIEW,ROUTE_PROVINCE_DISPENSERS_SELL_CARCASS,ROUTE_PROVINCE_DISPENSERS_INVENTORY,ROUTE_PROVINCE_SALE_DESTRIBUTION_DETAILS,ROUTE_SUPER_ADMIN_DISPENSERS,ROUTE_SUPER_ADMIN_DISPENSERS_MANAGEMENT,ROUTE_SUPER_ADMIN_DISPENSER_DETAILS,ROUTE_SUPER_ADMIN_DISPENSER_DETAILS_VIEW,ROUTE_SUPER_ADMIN_DISPENSERS_STEWARDS,ROUTE_SUPER_ADMIN_DISPENSERS_KILLHOUSES,ROUTE_SUPER_ADMIN_DISPENSERS_KILLHOUSES_VIEW,ROUTE_SUPER_ADMIN_DISPENSERS_SELL_CARCASS,ROUTE_SUPER_ADMIN_DISPENSERS_INVENTORY,ROUTE_SUPER_ADMIN_DESTRIBUTION_DETAILS],Page:Dispensers$3,exact:!1,props:{}},{path:[ROUTE_ADMINX_DISPENSERS_STOCK,ROUTE_SUPER_ADMIN_DISPENSERS_STOCK],Page:DispensersStock$1,exact:!1,props:{}},{path:[ROUTE_ADMINX_DISPENSERS_STOCK_KILLHOUSE,ROUTE_ADMINX_DISPENSERS_STOCK_STEWARD,ROUTE_ADMINX_DISPENSERS_STOCK_GUILD,ROUTE_SUPER_ADMIN_DISPENSERS_STOCK_KILLHOUSE,ROUTE_SUPER_ADMIN_DISPENSERS_STOCK_STEWARD,ROUTE_SUPER_ADMIN_DISPENSERS_STOCK_GUILD],Page:ProvinceDispensersStockSlug$1,exact:!1,props:{}},{path:[ROUTE_ADMINXـHATCHINGS,ROUTE_ADMINXـHATCHINGS_DETAILS,ROUTE_PROVINCEـHATCHINGS,ROUTE_PROVINCEـHATCHINGS_DETAILS,ROUTE_SUPER_ADMINـHATCHINGS,ROUTE_SUPER_ADMINـHATCHINGS_DETAILS],Page:AllHatchings$5,exact:!1,props:{}},{path:[ROUTE_ADMINX_COLD_HOUSES,ROUTE_ADMINX_COLD_HOUSES_MANAGEMENT,ROUTE_ADMINX_COLD_HOUSES_MANAGEMENT_VIEW,ROUTE_PROVINCE_COLD_HOUSES,ROUTE_PROVINCE_COLD_HOUSES_MANAGEMENT,ROUTE_PROVINCE_COLD_HOUSES_MANAGEMENT_VIEW,ROUTE_SUPER_ADMIN_COLD_HOUSES,ROUTE_SUPER_ADMIN_COLD_HOUSES_MANAGEMENT,ROUTE_SUPER_ADMIN_COLD_HOUSES_MANAGEMENT_VIEW],Page:ColdHouses,exact:!1,props:{}},{path:[ROUTE_ADMINX_SUB_SECTORS_WAGE,ROUTE_ADMINX_SUB_SECTORS_CITY_SHARES,ROUTE_ADMINX_SUB_SECTORS_STEWARD_SHARES,ROUTE_ADMINX_SUB_SECTORS_VET_FARM_SHARES,ROUTE_PROVINCE_SUB_SECTORS_WAGE,ROUTE_PROVINCE_SUB_SECTORS_CITY_SHARES,ROUTE_PROVINCE_SUB_SECTORS_STEWARD_SHARES,ROUTE_PROVINCE_SUB_SECTORS_VET_FARM_SHARES,ROUTE_SUPER_ADMIN_SUB_SECTORS_WAGE,ROUTE_SUPER_ADMIN_SUB_SECTORS_CITY_SHARES,ROUTE_SUPER_ADMIN_SUB_SECTORS_STEWARD_SHARES,ROUTE_SUPER_ADMIN_SUB_SECTORS_VET_FARM_SHARES],Page:SubSectorWage$1,exact:!1,props:{}},{path:[ROUTE_ADMINX_ROUTE_KILLERS_WAGES,ROUTE_ADMINX_ROUTE_KILLERS_WAGES_DETAILS,ROUTE_PROVINCE_ROUTE_KILLERS_WAGES,ROUTE_PROVINCE_ROUTE_KILLERS_WAGES_DETAILS,ROUTE_SUPER_ADMIN_ROUTE_KILLERS_WAGES,ROUTE_SUPER_ADMIN_ROUTE_KILLERS_WAGES_DETAILS],Page:KillersWages,exact:!1,props:{}},{path:[ROUTE_ADMINX_DIFFRENCE_KILLER,ROUTE_ADMINX_DIFFRENCE_KILLER_SLAUGHTER,ROUTE_ADMINX_INCREASE_HATCHING,ROUTE_PROVINCE_DIFFRENCE_KILLER,ROUTE_PROVINCE_DIFFRENCE_KILLER_SLAUGHTER,ROUTE_PROVINCE_INCREASE_HATCHING,ROUTE_SUPER_ADMIN_DIFFRENCE_KILLER,ROUTE_SUPER_ADMIN_DIFFRENCE_KILLER_SLAUGHTER,ROUTE_SUPER_ADMIN_INCREASE_HATCHING],Page:DiffrenceKiller$1,exact:!1,props:{}},{path:[ROUTE_ADMINX_DASHBOARD,ROUTE_PROVINCE_DASHBOARD,ROUTE_SUPER_ADMIN_DASHBOARD],Page:DashboardPage$1,exact:!1,props:{}},{path:[ROUTE_ADMINX_SETTLEMENTS,ROUTE_PROVINCE_SETTLEMENTS,ROUTE_SUPER_ADMIN_SETTLEMENTS],Page:SettlementPage$1,exact:!1,props:{}},{path:[ROUTE_ADMINX_POULTRY_LIVESTOCK_EXPERTS,ROUTE_PROVINCE_POULTRY_LIVESTOCK_EXPERTS,ROUTE_SUPER_ADMIN_POULTRY_LIVESTOCK_EXPERTS],Page:PoultryScienceExpertsPage,exact:!1,props:{}},{path:[ROUTE_ADMINX_RETURN_PURCHASES,ROUTE_PROVINCE_RETURN_PURCHASES,ROUTE_SUPER_ADMIN_RETURN_PURCHASES],Page:ReturnPurchases$1,exact:!1,props:{}},{path:[ROUTE_ADMINX_ROUTE_NATIONAL_INFO,ROUTE_ADMINX_ROUTE_NATIONAL_INFO_DETAILS,ROUTE_ADMINX_ROUTE_NATIONAL_INFO_FARM,ROUTE_ADMINX_ROUTE_NATIONAL_INFO_FARM_DETAILS,ROUTE_ADMINX_ROUTE_NATIONAL_INFO_HATCHING_DETAILS,ROUTE_ADMINX_ROUTE_NATIONAL_INFO_SLAUGHTER,ROUTE_ADMINX_ROUTE_NATIONAL_INFO_SLAUGHTER_DETAILS,ROUTE_ADMINX_ROUTE_NATIONAL_INFO_DISTRIBUTION_DETAILS,ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO,ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_DETAILS,ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_FARM,ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_FARM_DETAILS,ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_HATCHING_DETAILS,ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_SLAUGHTER,ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_SLAUGHTER_DETAILS,ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_DISTRIBUTION_DETAILS],Page:NationalInfo$1,exact:!1,props:{}},{path:[ROUTE_ADMINX_HATCHING,ROUTE_ADMINX_NEW_REQUEST,ROUTE_ADMINX_ROUTE_NATIONAL_INFO_DETAILS,ROUTE_ADMINX_ROUTE_NATIONAL_INFO_FARM,ROUTE_ADMINX_ROUTE_NATIONAL_INFO_FARM_DETAILS,ROUTE_PROVINCE_HATCHING,ROUTE_PROVINCE_NEW_REQUEST,ROUTE_SUPER_ADMIN_HATCHING,ROUTE_SUPER_ADMIN_NEW_REQUEST,ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_DETAILS,ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_FARM,ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_FARM_DETAILS],Page:Hatching$7,exact:!1,props:{}},{path:[ROUTE_ADMINX_ROUTE_SMS,ROUTE_ADMINX_ROUTE_SMS_MANAGE,ROUTE_ADMINX_ROUTE_SMS_SEND,ROUTE_ADMINX_SEND_ANNOUNCEMENT,ROUTE_ADMINX_SEND_REPORT,ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_MOBILE_MESSAGE,ROUTE_ADMINX_ROUTE_AGE_MESSAGE,ROUTE_ADMINX_DASHBOARD_NEWS,ROUTE_PROVINCE_ROUTE_SMS,ROUTE_PROVINCE_ROUTE_SMS_MANAGE,ROUTE_PROVINCE_ROUTE_SMS_SEND,ROUTE_PROVINCE_SEND_ANNOUNCEMENT,ROUTE_PROVINCE_SEND_REPORT,ROUTE_PROVINCE_DASHBOARD_NEWS,ROUTE_SUPER_ADMIN_ROUTE_SMS,ROUTE_SUPER_ADMIN_ROUTE_SMS_MANAGE,ROUTE_SUPER_ADMIN_ROUTE_SMS_SEND,ROUTE_SUPER_ADMIN_SEND_ANNOUNCEMENT,ROUTE_SUPER_ADMIN_SEND_REPORT,ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_MOBILE_MESSAGE,ROUTE_SUPER_ADMIN_ROUTE_AGE_MESSAGE,ROUTE_SUPER_ADMIN_DASHBOARD_NEWS],Page:SendMassage,exact:!1,props:{}},{path:[ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_WAGE_FRACTIONS,ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_WAGE_FRACTIONS],Page:ManageProcessWages,exact:!1,props:{}},{path:[ROUTE_ADMINX_COMPONENTS_CATALOG],Page:ComponentsCatalog,exact:!1,props:{}},{path:[ROUTE_ADMINX_EXCEL_CHECK],Page:ExcelCheck,exact:!1,props:{}},{path:[ROUTE_SUPER_ADMIN_ROUTE_COMPANY_MANAGE_STEWARDS,ROUTE_SUPER_ADMIN_COMPANY_ROUTE_GUILDS,ROUTE_SUPER_ADMIN_COMPANY_ROUTE_ACTIVE_SESSION,ROUTE_SUPER_ADMIN_COMPANY_ROUTE_DEVICES,ROUTE_ADMINX_ROUTE_COMPANY_MANAGE_STEWARDS,ROUTE_ADMINX_COMPANY_ROUTE_GUILDS,ROUTE_ADMINX_COMPANY_ROUTE_ACTIVE_SESSION,ROUTE_ADMINX_COMPANY_ROUTE_DEVICES],Page:PspCompany,exact:!1,props:{}},{path:[ROUTE_ADMINX_POULTRIES_DETAILS,ROUTE_PROVINCE_POULTRIES_DETAILS,ROUTE_SUPER_ADMIN_POULTRIES_DETAILS],Page:PoultriesDetails$3,exact:!1,props:{}},{path:[ROUTE_ADMINX_ROUTE_INSPECTION,ROUTE_SUPER_ADMIN_ROUTE_INSPECTION],Page:Inspection,exact:!1,props:{}}],getManagerRouting=e=>{if(!e)return consolidatedRouting;const a={AdminX:"/adminx",provinceOperator:"/province",SuperAdmin:"/superadmin"}[e];return a?consolidatedRouting.map(s=>{const n=s.path.filter(i=>i.startsWith(a));return n.length>0?{...s,path:n}:null}).filter(s=>s!==null):consolidatedRouting};var MS="-ms-",MOZ="-moz-",WEBKIT="-webkit-",COMMENT="comm",RULESET="rule",DECLARATION="decl",PAGE="@page",MEDIA="@media",IMPORT="@import",CHARSET="@charset",VIEWPORT="@viewport",SUPPORTS="@supports",DOCUMENT="@document",NAMESPACE="@namespace",KEYFRAMES="@keyframes",FONT_FACE="@font-face",COUNTER_STYLE="@counter-style",FONT_FEATURE_VALUES="@font-feature-values",LAYER="@layer",SCOPE="@scope",abs$2=Math.abs,from$1=String.fromCharCode,assign$1=Object.assign;function hash(e,t){return charat(e,0)^45?(((t<<2^charat(e,0))<<2^charat(e,1))<<2^charat(e,2))<<2^charat(e,3):0}function trim$2(e){return e.trim()}function match$2(e,t){return(e=t.exec(e))?e[0]:e}function replace$1(e,t,a){return e.replace(t,a)}function indexof(e,t,a){return e.indexOf(t,a)}function charat(e,t){return e.charCodeAt(t)|0}function substr(e,t,a){return e.slice(t,a)}function strlen(e){return e.length}function sizeof(e){return e.length}function append(e,t){return t.push(e),e}function combine(e,t){return e.map(t).join("")}function filter$1(e,t){return e.filter(function(a){return!match$2(a,t)})}var line=1,column=1,length=0,position=0,character=0,characters="";function node(e,t,a,s,n,i,o,u){return{value:e,root:t,parent:a,type:s,props:n,children:i,line,column,length:o,return:"",siblings:u}}function copy(e,t){return assign$1(node("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function lift(e){for(;e.root;)e=copy(e.root,{children:[e]});append(e,e.siblings)}function char(){return character}function prev(){return character=position>0?charat(characters,--position):0,column--,character===10&&(column=1,line--),character}function next(){return character=position2||token$1(character)>3?"":" "}function tokenizer(e){for(;next();)switch(token$1(character)){case 0:append(identifier(position-1),e);break;case 2:append(delimit(character),e);break;default:append(from$1(character),e)}return e}function escaping(e,t){for(;--t&&next()&&!(character<48||character>102||character>57&&character<65||character>70&&character<97););return slice$k(e,caret()+(t<6&&peek()==32&&next()==32))}function delimiter(e){for(;next();)switch(character){case e:return position;case 34:case 39:e!==34&&e!==39&&delimiter(character);break;case 40:e===41&&delimiter(e);break;case 92:next();break}return position}function commenter(e,t){for(;next()&&e+character!==57;)if(e+character===84&&peek()===47)break;return"/*"+slice$k(t,position-1)+"*"+from$1(e===47?e:next())}function identifier(e){for(;!token$1(peek());)next();return slice$k(e,position)}function compile(e){return dealloc(parse$2("",null,null,null,[""],e=alloc(e),0,[0],e))}function parse$2(e,t,a,s,n,i,o,u,l){for(var c=0,_=0,p=o,d=0,E=0,R=0,y=1,I=1,A=1,x=0,g="",T=n,O=i,C=s,U=g;I;)switch(R=x,x=next()){case 40:if(R!=108&&charat(U,p-1)==58){indexof(U+=replace$1(delimit(x),"&","&\f"),"&\f",abs$2(c?u[c-1]:0))!=-1&&(A=-1);break}case 34:case 39:case 91:U+=delimit(x);break;case 9:case 10:case 13:case 32:U+=whitespace(R);break;case 92:U+=escaping(caret()-1,7);continue;case 47:switch(peek()){case 42:case 47:append(comment(commenter(next(),caret()),t,a,l),l),(token$1(R||1)==5||token$1(peek()||1)==5)&&strlen(U)&&substr(U,-1,void 0)!==" "&&(U+=" ");break;default:U+="/"}break;case 123*y:u[c++]=strlen(U)*A;case 125*y:case 59:case 0:switch(x){case 0:case 125:I=0;case 59+_:A==-1&&(U=replace$1(U,/\f/g,"")),E>0&&(strlen(U)-p||y===0&&R===47)&&append(E>32?declaration(U+";",s,a,p-1,l):declaration(replace$1(U," ","")+";",s,a,p-2,l),l);break;case 59:U+=";";default:if(append(C=ruleset(U,t,a,c,_,n,u,g,T=[],O=[],p,i),i),x===123)if(_===0)parse$2(U,t,C,C,T,i,p,u,O);else{switch(d){case 99:if(charat(U,3)===110)break;case 108:if(charat(U,2)===97)break;default:_=0;case 100:case 109:case 115:}_?parse$2(e,C,C,s&&append(ruleset(e,C,C,0,0,n,u,g,n,T=[],p,O),O),n,O,p,u,s?T:O):parse$2(U,C,C,C,[""],O,0,u,O)}}c=_=E=0,y=A=1,g=U="",p=o;break;case 58:p=1+strlen(U),E=R;default:if(y<1){if(x==123)--y;else if(x==125&&y++==0&&prev()==125)continue}switch(U+=from$1(x),x*y){case 38:A=_>0?1:(U+="\f",-1);break;case 44:u[c++]=(strlen(U)-1)*A,A=1;break;case 64:peek()===45&&(U+=delimit(next())),d=peek(),_=p=strlen(g=U+=identifier(caret())),x++;break;case 45:R===45&&strlen(U)==2&&(y=0)}}return i}function ruleset(e,t,a,s,n,i,o,u,l,c,_,p){for(var d=n-1,E=n===0?i:[""],R=sizeof(E),y=0,I=0,A=0;y0?E[x]+" "+g:replace$1(g,/&\f/g,E[x])))&&(l[A++]=T);return node(e,t,a,n===0?RULESET:u,l,c,_,p)}function comment(e,t,a,s){return node(e,t,a,COMMENT,from$1(char()),substr(e,2,-2),0,s)}function declaration(e,t,a,s,n){return node(e,t,a,DECLARATION,substr(e,0,s),substr(e,s+1,-1),s,n)}function prefix(e,t,a){switch(hash(e,t)){case 5103:return WEBKIT+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return WEBKIT+e+e;case 4855:return WEBKIT+e.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+e;case 4789:return MOZ+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return WEBKIT+e+MOZ+e+MS+e+e;case 5936:switch(charat(e,t+11)){case 114:return WEBKIT+e+MS+replace$1(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return WEBKIT+e+MS+replace$1(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return WEBKIT+e+MS+replace$1(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return WEBKIT+e+MS+e+e;case 6165:return WEBKIT+e+MS+"flex-"+e+e;case 5187:return WEBKIT+e+replace$1(e,/(\w+).+(:[^]+)/,WEBKIT+"box-$1$2"+MS+"flex-$1$2")+e;case 5443:return WEBKIT+e+MS+"flex-item-"+replace$1(e,/flex-|-self/g,"")+(match$2(e,/flex-|baseline/)?"":MS+"grid-row-"+replace$1(e,/flex-|-self/g,""))+e;case 4675:return WEBKIT+e+MS+"flex-line-pack"+replace$1(e,/align-content|flex-|-self/g,"")+e;case 5548:return WEBKIT+e+MS+replace$1(e,"shrink","negative")+e;case 5292:return WEBKIT+e+MS+replace$1(e,"basis","preferred-size")+e;case 6060:return WEBKIT+"box-"+replace$1(e,"-grow","")+WEBKIT+e+MS+replace$1(e,"grow","positive")+e;case 4554:return WEBKIT+replace$1(e,/([^-])(transform)/g,"$1"+WEBKIT+"$2")+e;case 6187:return replace$1(replace$1(replace$1(e,/(zoom-|grab)/,WEBKIT+"$1"),/(image-set)/,WEBKIT+"$1"),e,"")+e;case 5495:case 3959:return replace$1(e,/(image-set\([^]*)/,WEBKIT+"$1$`$1");case 4968:return replace$1(replace$1(e,/(.+:)(flex-)?(.*)/,WEBKIT+"box-pack:$3"+MS+"flex-pack:$3"),/space-between/,"justify")+WEBKIT+e+e;case 4200:if(!match$2(e,/flex-|baseline/))return MS+"grid-column-align"+substr(e,t)+e;break;case 2592:case 3360:return MS+replace$1(e,"template-","")+e;case 4384:case 3616:return a&&a.some(function(s,n){return t=n,match$2(s.props,/grid-\w+-end/)})?~indexof(e+(a=a[t].value),"span",0)?e:MS+replace$1(e,"-start","")+e+MS+"grid-row-span:"+(~indexof(a,"span",0)?match$2(a,/\d+/):+match$2(a,/\d+/)-+match$2(e,/\d+/))+";":MS+replace$1(e,"-start","")+e;case 4896:case 4128:return a&&a.some(function(s){return match$2(s.props,/grid-\w+-start/)})?e:MS+replace$1(replace$1(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return replace$1(e,/(.+)-inline(.+)/,WEBKIT+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(strlen(e)-1-t>6)switch(charat(e,t+1)){case 109:if(charat(e,t+4)!==45)break;case 102:return replace$1(e,/(.+:)(.+)-([^]+)/,"$1"+WEBKIT+"$2-$3$1"+MOZ+(charat(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~indexof(e,"stretch",0)?prefix(replace$1(e,"stretch","fill-available"),t,a)+e:e}break;case 5152:case 5920:return replace$1(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(s,n,i,o,u,l,c){return MS+n+":"+i+c+(o?MS+n+"-span:"+(u?l:+l-+i)+c:"")+e});case 4949:if(charat(e,t+6)===121)return replace$1(e,":",":"+WEBKIT)+e;break;case 6444:switch(charat(e,charat(e,14)===45?18:11)){case 120:return replace$1(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+WEBKIT+(charat(e,14)===45?"inline-":"")+"box$3$1"+WEBKIT+"$2$3$1"+MS+"$2box$3")+e;case 100:return replace$1(e,":",":"+MS)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return replace$1(e,"scroll-","scroll-snap-")+e}return e}function serialize(e,t){for(var a="",s=0;s-1&&!e.return)switch(e.type){case DECLARATION:e.return=prefix(e.value,e.length,a);return;case KEYFRAMES:return serialize([copy(e,{value:replace$1(e.value,"@","@"+WEBKIT)})],s);case RULESET:if(e.length)return combine(a=e.props,function(n){switch(match$2(n,s=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":lift(copy(e,{props:[replace$1(n,/:(read-\w+)/,":"+MOZ+"$1")]})),lift(copy(e,{props:[n]})),assign$1(e,{props:filter$1(a,s)});break;case"::placeholder":lift(copy(e,{props:[replace$1(n,/:(plac\w+)/,":"+WEBKIT+"input-$1")]})),lift(copy(e,{props:[replace$1(n,/:(plac\w+)/,":"+MOZ+"$1")]})),lift(copy(e,{props:[replace$1(n,/:(plac\w+)/,MS+"input-$1")]})),lift(copy(e,{props:[n]})),assign$1(e,{props:filter$1(a,s)});break}return""})}}function namespace(e){switch(e.type){case RULESET:e.props=e.props.map(function(t){return combine(tokenize(t),function(a,s,n){switch(charat(a,0)){case 12:return substr(a,1,strlen(a));case 0:case 40:case 43:case 62:case 126:return a;case 58:n[++s]==="global"&&(n[s]="",n[++s]="\f"+substr(n[s],s=1,-1));case 32:return s===1?"":a;default:switch(s){case 0:return e=a,sizeof(n)>1?"":a;case(s=sizeof(n)-1):case 2:return s===2?a+e+e:a+e;default:return a}}})})}}const stylis=Object.freeze(Object.defineProperty({__proto__:null,CHARSET,COMMENT,COUNTER_STYLE,DECLARATION,DOCUMENT,FONT_FACE,FONT_FEATURE_VALUES,IMPORT,KEYFRAMES,LAYER,MEDIA,MOZ,MS,NAMESPACE,PAGE,RULESET,SCOPE,SUPPORTS,VIEWPORT,WEBKIT,abs:abs$2,alloc,append,assign:assign$1,caret,char,get character(){return character},get characters(){return characters},charat,get column(){return column},combine,comment,commenter,compile,copy,dealloc,declaration,delimit,delimiter,escaping,filter:filter$1,from:from$1,hash,identifier,indexof,get length(){return length},lift,get line(){return line},match:match$2,middleware,namespace,next,node,parse:parse$2,peek,get position(){return position},prefix,prefixer,prev,replace:replace$1,ruleset,rulesheet,serialize,sizeof,slice:slice$k,stringify,strlen,substr,token:token$1,tokenize,tokenizer,trim:trim$2,whitespace},Symbol.toStringTag,{value:"Module"}));var stylisRtl={},cssjanus={exports:{}};/*! + * CSSJanus. https://www.mediawiki.org/wiki/CSSJanus + * + * Copyright 2014 Trevor Parscal + * Copyright 2010 Roan Kattouw + * Copyright 2008 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */(function(e,t){var a;function s(i,o){var u=[],l=0;function c(p){return u.push(p),o}function _(){return u[l++]}return{tokenize:function(p){return p.replace(i,c)},detokenize:function(p){return p.replace(new RegExp("("+o+")","g"),_)}}}function n(){var i="`TMP`",o="`TMPLTR`",u="`TMPRTL`",l="`NOFLIP_SINGLE`",c="`NOFLIP_CLASS`",_="`COMMENT`",p="[^\\u0020-\\u007e]",d="(?:(?:\\\\[0-9a-f]{1,6})(?:\\r\\n|\\s)?)",E="(?:[0-9]*\\.[0-9]+|[0-9]+)",R="(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)",y="direction\\s*:\\s*",I="[!#$%&*-~]",A=`['"]?\\s*`,x="(^|[^a-zA-Z])",g="[^\\}]*?",T="\\/\\*\\!?\\s*@noflip\\s*\\*\\/",O="\\/\\*[^*]*\\*+([^\\/*][^*]*\\*+)*\\/",C="(?:"+d+"|\\\\[^\\r\\n\\f0-9a-f])",U="(?:[_a-z]|"+p+"|"+C+")",L="(?:[_a-z0-9-]|"+p+"|"+C+")",j="-?"+U+L+"*",X=E+"(?:\\s*"+R+"|"+j+")?",B="((?:-?"+X+")|(?:inherit|auto))",H="(?:-?"+E+"(?:\\s*"+R+")?)",W="(?:\\+|\\-|\\*|\\/)",K="(?:\\(|\\)|\\t| )",b="(?:"+K+"|"+H+"|"+W+"){3,}",k="(?:calc\\((?:"+b+")\\))",F="((?:-?"+X+")|(?:inherit|auto)|"+k+")",N="((?:margin|padding|border-width)\\s*:\\s*)",M="((?:-color|border-style)\\s*:\\s*)",G="(#?"+L+"+|(?:rgba?|hsla?)\\([ \\d.,%-]+\\))",V="(?:"+I+"|"+p+"|"+C+")*?",ee="(?![a-zA-Z])",ae="(?!("+L+`|\\r?\\n|\\s|#|\\:|\\.|\\,|\\+|>|~|\\(|\\)|\\[|\\]|=|\\*=|~=|\\^=|'[^']*'|"[^"]*"|`+_+")*?{)",ne="(?!"+V+A+"\\))",J="(?="+V+A+"\\))",ue="(\\s*(?:!important\\s*)?[;}])",oe=/`TMP`/g,_e=/`TMPLTR`/g,Y=/`TMPRTL`/g,Z=new RegExp(O,"gi"),te=new RegExp("("+T+ae+"[^;}]+;?)","gi"),q=new RegExp("("+T+g+"})","gi"),Q=new RegExp("("+y+")ltr","gi"),se=new RegExp("("+y+")rtl","gi"),fe=new RegExp(x+"(left)"+ee+ne+ae,"gi"),me=new RegExp(x+"(right)"+ee+ne+ae,"gi"),ve=new RegExp(x+"(left)"+J,"gi"),Ae=new RegExp(x+"(right)"+J,"gi"),ce=/(:dir\( *)ltr( *\))/g,Se=/(:dir\( *)rtl( *\))/g,Te=new RegExp(x+"(ltr)"+J,"gi"),re=new RegExp(x+"(rtl)"+J,"gi"),le=new RegExp(x+"([ns]?)e-resize","gi"),pe=new RegExp(x+"([ns]?)w-resize","gi"),Ee=new RegExp(N+F+"(\\s+)"+F+"(\\s+)"+F+"(\\s+)"+F+ue,"gi"),Re=new RegExp(M+G+"(\\s+)"+G+"(\\s+)"+G+"(\\s+)"+G+ue,"gi"),xe=new RegExp("(background(?:-position)?\\s*:\\s*(?:[^:;}\\s]+\\s+)*?)("+X+")","gi"),Pe=new RegExp("(background-position-x\\s*:\\s*)(-?"+E+"%)","gi"),Oe=new RegExp("(border-radius\\s*:\\s*)"+B+"(?:(?:\\s+"+B+")(?:\\s+"+B+")?(?:\\s+"+B+")?)?(?:(?:(?:\\s*\\/\\s*)"+B+")(?:\\s+"+B+")?(?:\\s+"+B+")?(?:\\s+"+B+")?)?"+ue,"gi"),ye=new RegExp("(box-shadow\\s*:\\s*(?:inset\\s*)?)"+B,"gi"),Le=new RegExp("(text-shadow\\s*:\\s*)"+B+"(\\s*)"+G,"gi"),Be=new RegExp("(text-shadow\\s*:\\s*)"+G+"(\\s*)"+B,"gi"),je=new RegExp("(text-shadow\\s*:\\s*)"+B,"gi"),Ke=new RegExp("(transform\\s*:[^;}]*)(translateX\\s*\\(\\s*)"+B+"(\\s*\\))","gi"),Ge=new RegExp("(transform\\s*:[^;}]*)(translate\\s*\\(\\s*)"+B+"((?:\\s*,\\s*"+B+"){0,2}\\s*\\))","gi");function we(Ie,He,he){var Ye,qe;return he.slice(-1)==="%"&&(Ye=he.indexOf("."),Ye!==-1?(qe=he.length-Ye-2,he=100-parseFloat(he),he=he.toFixed(qe)+"%"):he=100-parseFloat(he)+"%"),He+he}function et(Ie){switch(Ie.length){case 4:Ie=[Ie[1],Ie[0],Ie[3],Ie[2]];break;case 3:Ie=[Ie[1],Ie[0],Ie[1],Ie[2]];break;case 2:Ie=[Ie[1],Ie[0]];break;case 1:Ie=[Ie[0]];break}return Ie.join(" ")}function Et(Ie,He){var he,Ye=[].slice.call(arguments),qe=Ye.slice(2,6).filter(function(Ue){return Ue}),Qe=Ye.slice(6,10).filter(function(Ue){return Ue}),Xe=Ye[10]||"";return Qe.length?he=et(qe)+" / "+et(Qe):he=et(qe),He+he+Xe}function tt(Ie){return parseFloat(Ie)===0?Ie:Ie[0]==="-"?Ie.slice(1):"-"+Ie}function xt(Ie,He,he){return He+tt(he)}function st(Ie,He,he,Ye,qe){return He+he+tt(Ye)+qe}function rt(Ie,He,he,Ye,qe){return He+he+Ye+tt(qe)}return{transform:function(Ie,He){var he=new s(te,l),Ye=new s(q,c),qe=new s(Z,_);return Ie=qe.tokenize(Ye.tokenize(he.tokenize(Ie.replace("`","%60")))),He.transformDirInUrl&&(Ie=Ie.replace(ce,"$1"+o+"$2").replace(Se,"$1"+u+"$2").replace(Te,"$1"+i).replace(re,"$1ltr").replace(oe,"rtl").replace(_e,"ltr").replace(Y,"rtl")),He.transformEdgeInUrl&&(Ie=Ie.replace(ve,"$1"+i).replace(Ae,"$1left").replace(oe,"right")),Ie=Ie.replace(Q,"$1"+i).replace(se,"$1ltr").replace(oe,"rtl").replace(fe,"$1"+i).replace(me,"$1left").replace(oe,"right").replace(le,"$1$2"+i).replace(pe,"$1$2e-resize").replace(oe,"w-resize").replace(Oe,Et).replace(ye,xt).replace(Le,rt).replace(Be,rt).replace(je,xt).replace(Ke,st).replace(Ge,st).replace(Ee,"$1$2$3$8$5$6$7$4$9").replace(Re,"$1$2$3$8$5$6$7$4$9").replace(xe,we).replace(Pe,we),Ie=he.detokenize(Ye.detokenize(qe.detokenize(Ie))),Ie}}}a=new n,e.exports?t.transform=function(i,o,u){var l;return typeof o=="object"?l=o:(l={},typeof o=="boolean"&&(l.transformDirInUrl=o),typeof u=="boolean"&&(l.transformEdgeInUrl=u)),a.transform(i,l)}:typeof window<"u"&&(window.cssjanus=a)})(cssjanus,cssjanus.exports);var cssjanusExports=cssjanus.exports;const require$$1=getAugmentedNamespace(stylis);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=s(cssjanusExports),a=require$$1;function s(u){return u&&u.__esModule?u:{default:u}}function n(u,l,c,_){switch(u.type){case a.IMPORT:case a.DECLARATION:case a.COMMENT:return u.return=u.return||u.value;case a.RULESET:u.value=u.props.join(","),u.children.forEach(function(p){p.type===a.COMMENT&&(p.children=p.value)})}return(0,a.strlen)(c=(0,a.serialize)(u.children,n))?u.return=u.value+"{"+c+"}":""}function i(u,l,c,_){if(!u.root){var p=t.default.transform(n(u,l,c));u.children=p?(0,a.compile)(p)[0].children:[],u.return=""}}Object.defineProperty(i,"name",{value:"stylisRTLPlugin"});var o=i;e.default=o})(stylisRtl);const rtlPlugin=getDefaultExportFromCjs(stylisRtl),faIR={components:{MuiBreadcrumbs:{defaultProps:{expandText:"نمایش مسیر"}},MuiTablePagination:{defaultProps:{getItemAriaLabel:e=>e==="first"?"رفتن به اولین صفحه":e==="last"?"رفتن به آخرین صفحه":e==="next"?"رفتن به صفحه‌ی بعدی":"رفتن به صفحه‌ی قبلی",labelRowsPerPage:"تعداد سطرهای هر صفحه:",labelDisplayedRows:({from:e,to:t,count:a})=>`${e}–${t} از ${a!==-1?a:`بیشتر از ${t}`}`}},MuiRating:{defaultProps:{getLabelText:e=>`${e} ستاره`,emptyLabelText:"خالی"}},MuiAutocomplete:{defaultProps:{clearText:"پاک‌کردن",closeText:"بستن",loadingText:"در حال بارگذاری…",noOptionsText:"بی‌نتیجه",openText:"بازکردن"}},MuiAlert:{defaultProps:{closeText:"بستن"}},MuiPagination:{defaultProps:{"aria-label":"ناوبری صفحه",getItemAriaLabel:(e,t,a)=>e==="page"?`${a?"":"رفتن به "}صفحهٔ ${t}`:e==="first"?"رفتن به اولین صفحه":e==="last"?"رفتن به آخرین صفحه":e==="next"?"رفتن به صفحه‌ی بعدی":"رفتن به صفحه‌ی قبلی"}}}},theme=createTheme({direction:"rtl",typography:{fontFamily:["iranyekan","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"sans-serif","Arial",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(",")},palette:{primary:{light:"#E0E7FF",main:"#244CCC",dark:"#102159",contrastText:"#fff"},secondary:{light:"#E6FAF5",main:"#00CC99",dark:"#ab003c",contrastText:"#000"},error:{light:"#EB5757",main:"#EB5757",dark:"#EB5757",contrastText:"#fff"},info:{light:"#17A2B8",main:"#17A2B8",dark:"#17A2B8",contrastText:"#fff"}},breakpoints:{values:{xs:0,sm:600,md:900,lg:1200,nlg:1400,xl:1536,nxl:1700,xxl:1920,xxxl:2400}},components:{MUIDataTableBodyRow:{styleOverrides:{root:{borderBottom:"1px solid #e3e3e3"}}},MuiFormControl:{styleOverrides:{root:{width:"100%"}}},MuiFormControlLabel:{styleOverrides:{label:{fontSize:"14px"}}},MuiOutlinedInput:{styleOverrides:{root:{backgroundColor:"transparent","&.Mui-focused":{backgroundColor:"transparent"}},input:{backgroundColor:"transparent","&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px white inset",WebkitTextFillColor:"inherit"}},notchedOutline:{borderColor:"#e6e6e6"}}},MuiInputLabel:{styleOverrides:{asterisk:{color:"#EB5757"}}},MuiButton:{styleOverrides:{root:({theme:e})=>({borderRadius:"8px",fontWeight:600,"&.Mui-disabled":{backgroundColor:"rgba(36, 76, 204, 0.3)",color:"rgba(255, 255, 255, 0.7)"},fontSize:"17px",[e.breakpoints.down("sm")]:{fontSize:"13px"}}),outlined:{borderWidth:"2px","&:hover":{borderWidth:"2px"},"&.Mui-disabled":{borderColor:"rgba(36, 76, 204, 0.3)",color:"rgba(36, 76, 204, 0.5)",backgroundColor:"transparent"}}}},MUIDataTable:{styleOverrides:{responsiveBase:{overflow:"hidden"},root:{boxShadow:"none !important",width:"100%"}}},MUIDataTableSearch:{styleOverrides:{searchIcon:{display:"none"},main:{justifyContent:"flex-end"},searchText:{flex:"unset"}}},MUIDataTablePagination:{styleOverrides:{navContainer:{width:"100%",display:"inline-block"}}},MUIDataTableToolbar:{styleOverrides:{root:{alignItems:"center"},actions:{display:"flex",justifyContent:"flex-end",flex:"unset"},titleText:{textAlign:"right",fontSize:"16px",color:"rgba(0, 0, 0, 0.54)"}}},MUIDataTableHeadCell:{styleOverrides:{toolButton:{padding:"0px !important",marginRight:"0px !important",justifyContent:"center !important"},data:({theme:e})=>({fontSize:"14px",[e.breakpoints.down("sm")]:{fontSize:"12px"}}),contentWrapper:{justifyContent:"center"}}},MuiTableCell:{styleOverrides:{head:{backgroundColor:"#e3e3e3 !important",textAlign:"center"},root:{justifyContent:"center",padding:"5px !important"}}},MuiToolbar:{styleOverrides:{root:{}}},MUIDataTableBodyCell:{styleOverrides:{root:{textAlign:"center",fontSize:"12px"}}},MuiTablePagination:{styleOverrides:{root:{justifyContent:"center",display:"flex"},toolbar:{marginTop:"0px",alignItems:"center"}}},MuiDrawer:{styleOverrides:{paperAnchorBottom:{borderTopRightRadius:"25px",borderTopLeftRadius:"25px"}}},MuiTimeline:{styleOverrides:{root:{gap:"0px !important"}}}}},faIR);var axios$3={exports:{}},bind$2=function(t,a){return function(){for(var n=new Array(arguments.length),i=0;i"u"}function isBuffer$4(e){return e!==null&&!isUndefined$1(e)&&e.constructor!==null&&!isUndefined$1(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}var isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(e){var t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&isArrayBuffer(e.buffer),t}function isString$3(e){return typeof e=="string"}function isNumber$1(e){return typeof e=="number"}function isObject$8(e){return e!==null&&typeof e=="object"}function isPlainObject$1(e){if(kindOf(e)!=="object")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}var isDate$4=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList");function isFunction$6(e){return toString$9.call(e)==="[object Function]"}function isStream(e){return isObject$8(e)&&isFunction$6(e.pipe)}function isFormData(e){var t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||toString$9.call(e)===t||isFunction$6(e.toString)&&e.toString()===t)}var isURLSearchParams=kindOfTest("URLSearchParams");function trim$1(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function isStandardBrowserEnv(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function forEach$1(e,t){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),isArray$d(e))for(var a=0,s=e.length;a0;)i=s[n],o[i]||(t[i]=e[i],o[i]=!0);e=Object.getPrototypeOf(e)}while(e&&(!a||a(e,t))&&e!==Object.prototype);return t}function endsWith(e,t,a){e=String(e),(a===void 0||a>e.length)&&(a=e.length),a-=t.length;var s=e.indexOf(t,a);return s!==-1&&s===a}function toArray$2(e){if(!e)return null;var t=e.length;if(isUndefined$1(t))return null;for(var a=new Array(t);t-- >0;)a[t]=e[t];return a}var isTypedArray$4=function(e){return function(t){return e&&t instanceof e}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array)),utils$b={isArray:isArray$d,isArrayBuffer,isBuffer:isBuffer$4,isFormData,isArrayBufferView,isString:isString$3,isNumber:isNumber$1,isObject:isObject$8,isPlainObject:isPlainObject$1,isUndefined:isUndefined$1,isDate:isDate$4,isFile,isBlob,isFunction:isFunction$6,isStream,isURLSearchParams,isStandardBrowserEnv,forEach:forEach$1,merge,extend:extend$1,trim:trim$1,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray:toArray$2,isTypedArray:isTypedArray$4,isFileList},utils$a=utils$b;function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var buildURL$1=function(t,a,s){if(!a)return t;var n;if(s)n=s(a);else if(utils$a.isURLSearchParams(a))n=a.toString();else{var i=[];utils$a.forEach(a,function(l,c){l===null||typeof l>"u"||(utils$a.isArray(l)?c=c+"[]":l=[l],utils$a.forEach(l,function(p){utils$a.isDate(p)?p=p.toISOString():utils$a.isObject(p)&&(p=JSON.stringify(p)),i.push(encode(c)+"="+encode(p))}))}),n=i.join("&")}if(n){var o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+n}return t},utils$9=utils$b;function InterceptorManager$1(){this.handlers=[]}InterceptorManager$1.prototype.use=function(t,a,s){return this.handlers.push({fulfilled:t,rejected:a,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1};InterceptorManager$1.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};InterceptorManager$1.prototype.forEach=function(t){utils$9.forEach(this.handlers,function(s){s!==null&&t(s)})};var InterceptorManager_1=InterceptorManager$1,utils$8=utils$b,normalizeHeaderName$1=function(t,a){utils$8.forEach(t,function(n,i){i!==a&&i.toUpperCase()===a.toUpperCase()&&(t[a]=n,delete t[i])})},utils$7=utils$b;function AxiosError$2(e,t,a,s,n){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),a&&(this.config=a),s&&(this.request=s),n&&(this.response=n)}utils$7.inherits(AxiosError$2,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var prototype=AxiosError$2.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(e){descriptors[e]={value:e}});Object.defineProperties(AxiosError$2,descriptors);Object.defineProperty(prototype,"isAxiosError",{value:!0});AxiosError$2.from=function(e,t,a,s,n,i){var o=Object.create(prototype);return utils$7.toFlatObject(e,o,function(l){return l!==Error.prototype}),AxiosError$2.call(o,e.message,t,a,s,n),o.name=e.name,i&&Object.assign(o,i),o};var AxiosError_1=AxiosError$2,transitional={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},utils$6=utils$b;function toFormData$1(e,t){t=t||new FormData;var a=[];function s(i){return i===null?"":utils$6.isDate(i)?i.toISOString():utils$6.isArrayBuffer(i)||utils$6.isTypedArray(i)?typeof Blob=="function"?new Blob([i]):Buffer.from(i):i}function n(i,o){if(utils$6.isPlainObject(i)||utils$6.isArray(i)){if(a.indexOf(i)!==-1)throw Error("Circular reference detected in "+o);a.push(i),utils$6.forEach(i,function(l,c){if(!utils$6.isUndefined(l)){var _=o?o+"."+c:c,p;if(l&&!o&&typeof l=="object"){if(utils$6.endsWith(c,"{}"))l=JSON.stringify(l);else if(utils$6.endsWith(c,"[]")&&(p=utils$6.toArray(l))){p.forEach(function(d){!utils$6.isUndefined(d)&&t.append(_,s(d))});return}}n(l,_)}}),a.pop()}else t.append(o,s(i))}return n(e),t}var toFormData_1=toFormData$1,settle,hasRequiredSettle;function requireSettle(){if(hasRequiredSettle)return settle;hasRequiredSettle=1;var e=AxiosError_1;return settle=function(a,s,n){var i=n.config.validateStatus;!n.status||!i||i(n.status)?a(n):s(new e("Request failed with status code "+n.status,[e.ERR_BAD_REQUEST,e.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))},settle}var cookies,hasRequiredCookies;function requireCookies(){if(hasRequiredCookies)return cookies;hasRequiredCookies=1;var e=utils$b;return cookies=e.isStandardBrowserEnv()?function(){return{write:function(s,n,i,o,u,l){var c=[];c.push(s+"="+encodeURIComponent(n)),e.isNumber(i)&&c.push("expires="+new Date(i).toGMTString()),e.isString(o)&&c.push("path="+o),e.isString(u)&&c.push("domain="+u),l===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(s){var n=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(s){this.write(s,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),cookies}var isAbsoluteURL$1=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)},combineURLs$1=function(t,a){return a?t.replace(/\/+$/,"")+"/"+a.replace(/^\/+/,""):t},isAbsoluteURL=isAbsoluteURL$1,combineURLs=combineURLs$1,buildFullPath$1=function(t,a){return t&&!isAbsoluteURL(a)?combineURLs(t,a):a},parseHeaders,hasRequiredParseHeaders;function requireParseHeaders(){if(hasRequiredParseHeaders)return parseHeaders;hasRequiredParseHeaders=1;var e=utils$b,t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return parseHeaders=function(s){var n={},i,o,u;return s&&e.forEach(s.split(` +`),function(c){if(u=c.indexOf(":"),i=e.trim(c.substr(0,u)).toLowerCase(),o=e.trim(c.substr(u+1)),i){if(n[i]&&t.indexOf(i)>=0)return;i==="set-cookie"?n[i]=(n[i]?n[i]:[]).concat([o]):n[i]=n[i]?n[i]+", "+o:o}}),n},parseHeaders}var isURLSameOrigin,hasRequiredIsURLSameOrigin;function requireIsURLSameOrigin(){if(hasRequiredIsURLSameOrigin)return isURLSameOrigin;hasRequiredIsURLSameOrigin=1;var e=utils$b;return isURLSameOrigin=e.isStandardBrowserEnv()?function(){var a=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a"),n;function i(o){var u=o;return a&&(s.setAttribute("href",u),u=s.href),s.setAttribute("href",u),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return n=i(window.location.href),function(u){var l=e.isString(u)?i(u):u;return l.protocol===n.protocol&&l.host===n.host}}():function(){return function(){return!0}}(),isURLSameOrigin}var CanceledError_1,hasRequiredCanceledError;function requireCanceledError(){if(hasRequiredCanceledError)return CanceledError_1;hasRequiredCanceledError=1;var e=AxiosError_1,t=utils$b;function a(s){e.call(this,s??"canceled",e.ERR_CANCELED),this.name="CanceledError"}return t.inherits(a,e,{__CANCEL__:!0}),CanceledError_1=a,CanceledError_1}var parseProtocol,hasRequiredParseProtocol;function requireParseProtocol(){return hasRequiredParseProtocol||(hasRequiredParseProtocol=1,parseProtocol=function(t){var a=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return a&&a[1]||""}),parseProtocol}var xhr,hasRequiredXhr;function requireXhr(){if(hasRequiredXhr)return xhr;hasRequiredXhr=1;var e=utils$b,t=requireSettle(),a=requireCookies(),s=buildURL$1,n=buildFullPath$1,i=requireParseHeaders(),o=requireIsURLSameOrigin(),u=transitional,l=AxiosError_1,c=requireCanceledError(),_=requireParseProtocol();return xhr=function(d){return new Promise(function(R,y){var I=d.data,A=d.headers,x=d.responseType,g;function T(){d.cancelToken&&d.cancelToken.unsubscribe(g),d.signal&&d.signal.removeEventListener("abort",g)}e.isFormData(I)&&e.isStandardBrowserEnv()&&delete A["Content-Type"];var O=new XMLHttpRequest;if(d.auth){var C=d.auth.username||"",U=d.auth.password?unescape(encodeURIComponent(d.auth.password)):"";A.Authorization="Basic "+btoa(C+":"+U)}var L=n(d.baseURL,d.url);O.open(d.method.toUpperCase(),s(L,d.params,d.paramsSerializer),!0),O.timeout=d.timeout;function j(){if(O){var H="getAllResponseHeaders"in O?i(O.getAllResponseHeaders()):null,W=!x||x==="text"||x==="json"?O.responseText:O.response,K={data:W,status:O.status,statusText:O.statusText,headers:H,config:d,request:O};t(function(k){R(k),T()},function(k){y(k),T()},K),O=null}}if("onloadend"in O?O.onloadend=j:O.onreadystatechange=function(){!O||O.readyState!==4||O.status===0&&!(O.responseURL&&O.responseURL.indexOf("file:")===0)||setTimeout(j)},O.onabort=function(){O&&(y(new l("Request aborted",l.ECONNABORTED,d,O)),O=null)},O.onerror=function(){y(new l("Network Error",l.ERR_NETWORK,d,O,O)),O=null},O.ontimeout=function(){var W=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded",K=d.transitional||u;d.timeoutErrorMessage&&(W=d.timeoutErrorMessage),y(new l(W,K.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,d,O)),O=null},e.isStandardBrowserEnv()){var X=(d.withCredentials||o(L))&&d.xsrfCookieName?a.read(d.xsrfCookieName):void 0;X&&(A[d.xsrfHeaderName]=X)}"setRequestHeader"in O&&e.forEach(A,function(W,K){typeof I>"u"&&K.toLowerCase()==="content-type"?delete A[K]:O.setRequestHeader(K,W)}),e.isUndefined(d.withCredentials)||(O.withCredentials=!!d.withCredentials),x&&x!=="json"&&(O.responseType=d.responseType),typeof d.onDownloadProgress=="function"&&O.addEventListener("progress",d.onDownloadProgress),typeof d.onUploadProgress=="function"&&O.upload&&O.upload.addEventListener("progress",d.onUploadProgress),(d.cancelToken||d.signal)&&(g=function(H){O&&(y(!H||H&&H.type?new c:H),O.abort(),O=null)},d.cancelToken&&d.cancelToken.subscribe(g),d.signal&&(d.signal.aborted?g():d.signal.addEventListener("abort",g))),I||(I=null);var B=_(L);if(B&&["http","https","file"].indexOf(B)===-1){y(new l("Unsupported protocol "+B+":",l.ERR_BAD_REQUEST,d));return}O.send(I)})},xhr}var _null,hasRequired_null;function require_null(){return hasRequired_null||(hasRequired_null=1,_null=null),_null}var utils$5=utils$b,normalizeHeaderName=normalizeHeaderName$1,AxiosError$1=AxiosError_1,transitionalDefaults=transitional,toFormData=toFormData_1,DEFAULT_CONTENT_TYPE={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(e,t){!utils$5.isUndefined(e)&&utils$5.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function getDefaultAdapter(){var e;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(e=requireXhr()),e}function stringifySafely(e,t,a){if(utils$5.isString(e))try{return(t||JSON.parse)(e),utils$5.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(a||JSON.stringify)(e)}var defaults$4={transitional:transitionalDefaults,adapter:getDefaultAdapter(),transformRequest:[function(t,a){if(normalizeHeaderName(a,"Accept"),normalizeHeaderName(a,"Content-Type"),utils$5.isFormData(t)||utils$5.isArrayBuffer(t)||utils$5.isBuffer(t)||utils$5.isStream(t)||utils$5.isFile(t)||utils$5.isBlob(t))return t;if(utils$5.isArrayBufferView(t))return t.buffer;if(utils$5.isURLSearchParams(t))return setContentTypeIfUnset(a,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var s=utils$5.isObject(t),n=a&&a["Content-Type"],i;if((i=utils$5.isFileList(t))||s&&n==="multipart/form-data"){var o=this.env&&this.env.FormData;return toFormData(i?{"files[]":t}:t,o&&new o)}else if(s||n==="application/json")return setContentTypeIfUnset(a,"application/json"),stringifySafely(t);return t}],transformResponse:[function(t){var a=this.transitional||defaults$4.transitional,s=a&&a.silentJSONParsing,n=a&&a.forcedJSONParsing,i=!s&&this.responseType==="json";if(i||n&&utils$5.isString(t)&&t.length)try{return JSON.parse(t)}catch(o){if(i)throw o.name==="SyntaxError"?AxiosError$1.from(o,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):o}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:require_null()},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};utils$5.forEach(["delete","get","head"],function(t){defaults$4.headers[t]={}});utils$5.forEach(["post","put","patch"],function(t){defaults$4.headers[t]=utils$5.merge(DEFAULT_CONTENT_TYPE)});var defaults_1=defaults$4,utils$4=utils$b,defaults$3=defaults_1,transformData$1=function(t,a,s){var n=this||defaults$3;return utils$4.forEach(s,function(o){t=o.call(n,t,a)}),t},isCancel$1,hasRequiredIsCancel;function requireIsCancel(){return hasRequiredIsCancel||(hasRequiredIsCancel=1,isCancel$1=function(t){return!!(t&&t.__CANCEL__)}),isCancel$1}var utils$3=utils$b,transformData=transformData$1,isCancel=requireIsCancel(),defaults$2=defaults_1,CanceledError=requireCanceledError();function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError}var dispatchRequest$1=function(t){throwIfCancellationRequested(t),t.headers=t.headers||{},t.data=transformData.call(t,t.data,t.headers,t.transformRequest),t.headers=utils$3.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),utils$3.forEach(["delete","get","head","post","put","patch","common"],function(n){delete t.headers[n]});var a=t.adapter||defaults$2.adapter;return a(t).then(function(n){return throwIfCancellationRequested(t),n.data=transformData.call(t,n.data,n.headers,t.transformResponse),n},function(n){return isCancel(n)||(throwIfCancellationRequested(t),n&&n.response&&(n.response.data=transformData.call(t,n.response.data,n.response.headers,t.transformResponse))),Promise.reject(n)})},utils$2=utils$b,mergeConfig$2=function(t,a){a=a||{};var s={};function n(_,p){return utils$2.isPlainObject(_)&&utils$2.isPlainObject(p)?utils$2.merge(_,p):utils$2.isPlainObject(p)?utils$2.merge({},p):utils$2.isArray(p)?p.slice():p}function i(_){if(utils$2.isUndefined(a[_])){if(!utils$2.isUndefined(t[_]))return n(void 0,t[_])}else return n(t[_],a[_])}function o(_){if(!utils$2.isUndefined(a[_]))return n(void 0,a[_])}function u(_){if(utils$2.isUndefined(a[_])){if(!utils$2.isUndefined(t[_]))return n(void 0,t[_])}else return n(void 0,a[_])}function l(_){if(_ in a)return n(t[_],a[_]);if(_ in t)return n(void 0,t[_])}var c={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:l};return utils$2.forEach(Object.keys(t).concat(Object.keys(a)),function(p){var d=c[p]||i,E=d(p);utils$2.isUndefined(E)&&d!==l||(s[p]=E)}),s},data,hasRequiredData;function requireData(){return hasRequiredData||(hasRequiredData=1,data={version:"0.27.2"}),data}var VERSION=requireData().version,AxiosError=AxiosError_1,validators$1={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){validators$1[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});var deprecatedWarnings={};validators$1.transitional=function(t,a,s){function n(i,o){return"[Axios v"+VERSION+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return function(i,o,u){if(t===!1)throw new AxiosError(n(o," has been removed"+(a?" in "+a:"")),AxiosError.ERR_DEPRECATED);return a&&!deprecatedWarnings[o]&&(deprecatedWarnings[o]=!0,console.warn(n(o," has been deprecated since v"+a+" and will be removed in the near future"))),t?t(i,o,u):!0}};function assertOptions(e,t,a){if(typeof e!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);for(var s=Object.keys(e),n=s.length;n-- >0;){var i=s[n],o=t[i];if(o){var u=e[i],l=u===void 0||o(u,i,e);if(l!==!0)throw new AxiosError("option "+i+" must be "+l,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new AxiosError("Unknown option "+i,AxiosError.ERR_BAD_OPTION)}}var validator$1={assertOptions,validators:validators$1},utils$1=utils$b,buildURL=buildURL$1,InterceptorManager=InterceptorManager_1,dispatchRequest=dispatchRequest$1,mergeConfig$1=mergeConfig$2,buildFullPath=buildFullPath$1,validator=validator$1,validators=validator.validators;function Axios$1(e){this.defaults=e,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}Axios$1.prototype.request=function(t,a){typeof t=="string"?(a=a||{},a.url=t):a=t||{},a=mergeConfig$1(this.defaults,a),a.method?a.method=a.method.toLowerCase():this.defaults.method?a.method=this.defaults.method.toLowerCase():a.method="get";var s=a.transitional;s!==void 0&&validator.assertOptions(s,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(a)===!1||(i=i&&E.synchronous,n.unshift(E.fulfilled,E.rejected))});var o=[];this.interceptors.response.forEach(function(E){o.push(E.fulfilled,E.rejected)});var u;if(!i){var l=[dispatchRequest,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(o),u=Promise.resolve(a);l.length;)u=u.then(l.shift(),l.shift());return u}for(var c=a;n.length;){var _=n.shift(),p=n.shift();try{c=_(c)}catch(d){p(d);break}}try{u=dispatchRequest(c)}catch(d){return Promise.reject(d)}for(;o.length;)u=u.then(o.shift(),o.shift());return u};Axios$1.prototype.getUri=function(t){t=mergeConfig$1(this.defaults,t);var a=buildFullPath(t.baseURL,t.url);return buildURL(a,t.params,t.paramsSerializer)};utils$1.forEach(["delete","get","head","options"],function(t){Axios$1.prototype[t]=function(a,s){return this.request(mergeConfig$1(s||{},{method:t,url:a,data:(s||{}).data}))}});utils$1.forEach(["post","put","patch"],function(t){function a(s){return function(i,o,u){return this.request(mergeConfig$1(u||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Axios$1.prototype[t]=a(),Axios$1.prototype[t+"Form"]=a(!0)});var Axios_1=Axios$1,CancelToken_1,hasRequiredCancelToken;function requireCancelToken(){if(hasRequiredCancelToken)return CancelToken_1;hasRequiredCancelToken=1;var e=requireCanceledError();function t(a){if(typeof a!="function")throw new TypeError("executor must be a function.");var s;this.promise=new Promise(function(o){s=o});var n=this;this.promise.then(function(i){if(n._listeners){var o,u=n._listeners.length;for(o=0;o"u"?"undefined":_typeof$1(self))!=="object"||!(e in self))return!1;try{var t=self[e],a="redux-persist ".concat(e," test");t.setItem(a,"test"),t.getItem(a),t.removeItem(a)}catch{return!1}return!0}function getStorage(e){var t="".concat(e,"Storage");return hasStorage(t)?self[t]:noopStorage}createWebStorage$1.__esModule=!0;createWebStorage$1.default=createWebStorage;var _getStorage=_interopRequireDefault$1u(getStorage$1);function _interopRequireDefault$1u(e){return e&&e.__esModule?e:{default:e}}function createWebStorage(e){var t=(0,_getStorage.default)(e);return{getItem:function(s){return new Promise(function(n,i){n(t.getItem(s))})},setItem:function(s,n){return new Promise(function(i,o){i(t.setItem(s,n))})},removeItem:function(s){return new Promise(function(n,i){n(t.removeItem(s))})}}}var default_1$1t=void 0,_createWebStorage=_interopRequireDefault$1t(createWebStorage$1);function _interopRequireDefault$1t(e){return e&&e.__esModule?e:{default:e}}var _default=(0,_createWebStorage.default)("local");default_1$1t=_default;const appReducers={LOADING_START:(e,t)=>{e.loading=!0},LOADING_END:(e,t)=>{e.loading=!1},BACKDROP_SHOW:(e,t)=>{e.backdrop=!0},BACKDROP_HIDE:(e,t)=>{e.backdrop=!1},OPEN_MODAL:(e,t)=>{e.modal={modalState:!0,modalContent:t.payload.content,modalTitle:t.payload.title,modalOnClose:t.payload.onClose,modalSize:t.payload.size}},CLOSE_MODAL:e=>{e.modal={modalState:!1,modalContent:null,modalTitle:null}},DRAWER:(e,t)=>{e.drawer={...e.drawer,...t.payload}},RESET_TIME_TO_LOGOUT:(e,t)=>{e.inActiveTime=1800}},initialState$k={pending:!1,inActiveTime:1800,modal:{modalState:!1,modalContent:null,modalTitle:null,modalOnClose:null,modalSize:500},drawer:{top:!1,left:!1,bottom:!1,right:!1,content:null,title:null}},slice$j=createSlice({name:"app",initialState:initialState$k,reducers:appReducers,extraReducers:{}}),{reducer:appSlice}=slice$j,{LOADING_START,LOADING_END,CLOSE_MODAL,OPEN_MODAL,DRAWER,BACKDROP_HIDE}=slice$j.actions,getUserMovingTextsService=createAsyncThunk("GET_USER_MOVING_TEXTS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("moving-text/?dashboard=true");return t(LOADING_END()),{data:a,status:s}}),getUserProfile=createAsyncThunk("GET_USER_PROFILE",async()=>{const{data:e,status:t}=await axios$1.get("system_user_profile/?self-profile");return{data:e,status:t}}),loginSendMobile=createAsyncThunk("LOGIN_SEND_MOBILE",async({mobile:e,state:t})=>{const{data:a,status:s}=await axios$1.post("api/send/",{mobile:e,state:t});return{data:a,status:s}}),loginWithPassword=createAsyncThunk("LOGIN_WITH_PASSWORD",async({mobile:e,password:t})=>{const{data:a,status:s}=await axios$1.post("api/login/",{username:e,password:t});return{data:a,status:s}});createAsyncThunk("LOGIN_FORGET_PASSWORD",async({mobile:e,state:t})=>{const{data:a,status:s}=await axios$1.post("api/send/",{mobile:e,state:t});return{data:a,status:s}});const checkUserPath=createAsyncThunk("CHECK_USER_PATH",async({mobile:e,state:t})=>{const{data:a,status:s}=await axios$1.post("https://userbackend.rasadyar.com/api/send_otp/",{mobile:e,state:t});return{data:a,status:s}}),checkActiveUsers=createAsyncThunk("CHECK_ACTIVE_USERS",async()=>{const{data:e,status:t}=await axios$1.get("https://userbackend.rasadyar.com/api/active-users/");return{data:e,status:t}});createAsyncThunk("LOGIN_FORGET_PASSWORD_SEND_OTP",async({key:e,code:t})=>{const{data:a,status:s}=await axios$1.post("api/check/",{key:e,code:t});return{data:a,status:s}});createAsyncThunk("LOGIN_FORGET_PASSWORD_CHANGE_PASSWORD",async({username:e,password:t})=>{const{data:a,status:s}=await axios$1.post("api/forget/",{username:e,password:t});return{data:a,status:s}});const changePassword=createAsyncThunk("LOGIN_CHANGE_PASSWORD",async({username:e,password:t})=>{const{data:a,status:s}=await axios$1.post("api/change_password/",{username:e,password:t});return{data:a,status:s}}),userExtraReducers={[loginSendMobile.fulfilled]:(e,{payload:t})=>{e.pending=!1},[loginSendMobile.pending]:e=>{e.pending=!0},[loginWithPassword.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.authToken=t.data.accessToken,e.tokenExpiresIn=t.data.expiresIn;const a=t.data.role.filter(s=>s!=="ProvinceInspector");e.role=a,e.loginUserProfile=t.data},[loginWithPassword.pending]:e=>{e.pending=!0},[getUserProfile.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.userProfile=t.data},[checkUserPath.pending]:e=>{e.pending=!0},[checkUserPath.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.userPath=t.data.backend+"/"},[getUserProfile.pending]:e=>{e.pending=!0},[changePassword.fulfilled]:e=>{e.pending=!1},[changePassword.pending]:e=>{e.pending=!0},[changePassword.pending]:e=>{e.pending=!0},[getUserMovingTextsService.fulfilled]:(e,{payload:t})=>{let a="";t.data.length?t.data.forEach(s=>{s!=="undefined"&&(a=a+"‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ "+(s==null?void 0:s.movingText))}):a=null,e.pending=!1,e.userMovingTexts=a}},userReducers={LOG_OUT:(e,t)=>{default_1$1t.removeItem("persist:root"),e.authToken=null,e.isFirstLogin=!0,e.typeActivitySelected=null,e=null;try{const a=localStorage.getItem("dashboard_custom_order");localStorage.clear(),a&&localStorage.setItem("dashboard_custom_order",a)}catch{}},AUTO_SIGN_IN:(e,t)=>{e.authToken=t.payload.accessToken,e.tokenExpiresIn=t.payload.expiresIn,e.role=t.payload.role,e.loginUserProfile=t.payload},IS_FIRST_LOGIN:(e,t)=>{e.isFirstLogin=t.payload},SET_MEDIATOR_TEXT:(e,t)=>{e.mediatorText=t.payload},SET_SUBMENU_TEXT:(e,t)=>{e.subMenuText=t.payload},SET_USER_PATH:(e,t)=>{e.userPath=t.payload},SET_ADMIN_TOKEN:(e,t)=>{e.adminToken=t.payload},SET_TYPE_ACTIVITY_SELECTED:(e,t)=>{e.typeActivitySelected=t.payload}},initialState$j={statusModal:!1,typeActivitySelected:null,pending:!1,authToken:null,adminToken:null,userProfile:{},loginUserProfile:{},role:null,isFirstLogin:!0,userPath:"https://habackend.rasadyar.com/"},slice$i=createSlice({name:"user",initialState:initialState$j,reducers:userReducers,extraReducers:userExtraReducers}),{LOG_OUT,SET_MEDIATOR_TEXT,SET_SUBMENU_TEXT,SET_ADMIN_TOKEN}=slice$i.actions,{reducer:userSlice}=slice$i,avicultureGetProfile=createAsyncThunk("AVICULTURE_GET_PROFILE",async(e,{dispatch:t})=>{const{data:a,status:s}=await axios$1.get("Poultry/0/?profile",e);return{data:a,status:s}}),avicultureNewRequest=createAsyncThunk("AVICULTURE_NEW_REQUEST",async e=>{try{const{data:t,status:a}=await axios$1.post("Poultry_Request/",e);return{data:t,status:a}}catch(t){return{error:t.response.data.result}}}),getRoleFromUrl=()=>{switch(window.location.pathname.split("/")[1]){case"city":return"CityOperator";case"aviculture":return"Poultry";case"province":return"ProvinceOperator";case"slaughter":return"KillHouse";case"slaughter-house-vet":return"KillHouseVet";case"vetfarm":return"VetFarm";case"financial":return"ProvinceFinancial";case"inspector":return"ProvinceInspector";case"vet-supervisor":return"VetSupervisor";case"commerce":return"Commerce";case"city-commerce":return"CityCommerce";case"city-vet":return"CityVet";case"city-jahad":return"CityJahad";case"observatory":return"Observatory";case"province-supervisor":return"ProvinceSupervisor";case"guild":return"Guilds";case"steward":return"Steward";case"guild-room":return"GuildRoom";case"livestock":return"LiveStockSupport";case"superadmin":return"SuperAdmin";case"chaincompany":return"ChainCompany";case"adminx":return"AdminX";case"supporter":return"Supporter";case"dispenser":return"Dispenser";case"citypoultry":return"CityPoultry";case"driver":return"Driver";case"parent-company":return"ParentCompany";case"cold-house-steward":return"ColdHouseSteward";case"city-guild":return"CityGuild";case"province-jahad":return"LiveStockProvinceJahad";case"union":return"Union";case"cooperative":return"Cooperative";case"rancher":return"Rancher";case"psp-company":return"PosCompany";case"poultry-science":return"PoultryScience";default:return null}},getActualRoleFromRole=e=>{switch(e){case"city":return"CityOperator";case"aviculture":return"Poultry";case"province":return"ProvinceOperator";case"slaughter":return"KillHouse";case"slaughter-house-vet":case"vetfarm":return"Vet";case"financial":return"ProvinceFinancial";default:return null}},avicultureGetRequests=createAsyncThunk("AVICULTURE_REQUESTS_SERVICE",async(e,{dispatch:t})=>{const{data:a,status:s}=await axios$1.get("Poultry_Request/?role="+getRoleFromUrl(),{params:{date1:e.selectedDate1,date2:e.selectedDate2}});return{data:a,status:s}}),avicultureGetHatchings=createAsyncThunk("AVICULTURE_GET_HATCHINGS",async()=>{const{data:e,status:t}=await axios$1.get("poultry_hatching/");return{data:e,status:t}}),avicultureGetChickenPrice=createAsyncThunk("AVICULTURE_GET_CHICKEN_PRICE",async()=>{const{data:e,status:t}=await axios$1.get("pricing/?role=Poultry");return{data:e,status:t}}),avicultureGetHallsInfo=createAsyncThunk("AVICULTURE_GET_HALLS_INFO",async()=>{const{data:e,status:t}=await axios$1.get("Poultry/?info");return{data:e,status:t}}),avicultureGetHallInspects=createAsyncThunk("AVICULTURE_GET_HALL)INSPECTS",async e=>{const{data:t,status:a}=await axios$1.get("vet_farm_inspection/?poultry_key="+e);return{data:t,status:a}}),avicultureGetSlaughters=createAsyncThunk("AVICULTURE_GET_SLAUGHTERS",async e=>{const{data:t,status:a}=await axios$1.get("kill_house_list/?show_poultry",{params:{date:e.date}});return{data:t,status:a}}),avicultureGetReports=createAsyncThunk("AVICULTURE_GET_REPORTS",async()=>{const{data:e,status:t}=await axios$1.get("poultry_report/");return{data:e,status:t}});function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var moment$1={exports:{}};(function(e,t){(function(a,s){e.exports=s()})(commonjsGlobal,function(){var a;function s(){return a.apply(null,arguments)}function n(f){a=f}function i(f){return f instanceof Array||Object.prototype.toString.call(f)==="[object Array]"}function o(f){return f!=null&&Object.prototype.toString.call(f)==="[object Object]"}function u(f,S){return Object.prototype.hasOwnProperty.call(f,S)}function l(f){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(f).length===0;var S;for(S in f)if(u(f,S))return!1;return!0}function c(f){return f===void 0}function _(f){return typeof f=="number"||Object.prototype.toString.call(f)==="[object Number]"}function p(f){return f instanceof Date||Object.prototype.toString.call(f)==="[object Date]"}function d(f,S){var P=[],D,$=f.length;for(D=0;D<$;++D)P.push(S(f[D],D));return P}function E(f,S){for(var P in S)u(S,P)&&(f[P]=S[P]);return u(S,"toString")&&(f.toString=S.toString),u(S,"valueOf")&&(f.valueOf=S.valueOf),f}function R(f,S,P,D){return Pr(f,S,P,D,!0).utc()}function y(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function I(f){return f._pf==null&&(f._pf=y()),f._pf}var A;Array.prototype.some?A=Array.prototype.some:A=function(f){var S=Object(this),P=S.length>>>0,D;for(D=0;D0)for(P=0;P=0;return(z?P?"+":"":"-")+Math.pow(10,Math.max(0,$)).toString().substr(1)+D}var V=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ee=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ae={},ne={};function J(f,S,P,D){var $=D;typeof D=="string"&&($=function(){return this[D]()}),f&&(ne[f]=$),S&&(ne[S[0]]=function(){return G($.apply(this,arguments),S[1],S[2])}),P&&(ne[P]=function(){return this.localeData().ordinal($.apply(this,arguments),f)})}function ue(f){return f.match(/\[[\s\S]/)?f.replace(/^\[|\]$/g,""):f.replace(/\\/g,"")}function oe(f){var S=f.match(V),P,D;for(P=0,D=S.length;P=0&&ee.test(f);)f=f.replace(ee,D),ee.lastIndex=0,P-=1;return f}var Z={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function te(f){var S=this._longDateFormat[f],P=this._longDateFormat[f.toUpperCase()];return S||!P?S:(this._longDateFormat[f]=P.match(V).map(function(D){return D==="MMMM"||D==="MM"||D==="DD"||D==="dddd"?D.slice(1):D}).join(""),this._longDateFormat[f])}var q="Invalid date";function Q(){return this._invalidDate}var se="%d",fe=/\d{1,2}/;function me(f){return this._ordinal.replace("%d",f)}var ve={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Ae(f,S,P,D){var $=this._relativeTime[P];return W($)?$(f,S,P,D):$.replace(/%d/i,f)}function ce(f,S){var P=this._relativeTime[f>0?"future":"past"];return W(P)?P(S):P.replace(/%s/i,S)}var Se={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Te(f){return typeof f=="string"?Se[f]||Se[f.toLowerCase()]:void 0}function re(f){var S={},P,D;for(D in f)u(f,D)&&(P=Te(D),P&&(S[P]=f[D]));return S}var le={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function pe(f){var S=[],P;for(P in f)u(f,P)&&S.push({unit:P,priority:le[P]});return S.sort(function(D,$){return D.priority-$.priority}),S}var Ee=/\d/,Re=/\d\d/,xe=/\d{3}/,Pe=/\d{4}/,Oe=/[+-]?\d{6}/,ye=/\d\d?/,Le=/\d\d\d\d?/,Be=/\d\d\d\d\d\d?/,je=/\d{1,3}/,Ke=/\d{1,4}/,Ge=/[+-]?\d{1,6}/,we=/\d+/,et=/[+-]?\d+/,Et=/Z|[+-]\d\d:?\d\d/gi,tt=/Z|[+-]\d\d(?::?\d\d)?/gi,xt=/[+-]?\d+(\.\d{1,3})?/,st=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,rt=/^[1-9]\d?/,Ie=/^([1-9]\d|\d)/,He;He={};function he(f,S,P){He[f]=W(S)?S:function(D,$){return D&&P?P:S}}function Ye(f,S){return u(He,f)?He[f](S._strict,S._locale):new RegExp(qe(f))}function qe(f){return Qe(f.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(S,P,D,$,z){return P||D||$||z}))}function Qe(f){return f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Xe(f){return f<0?Math.ceil(f)||0:Math.floor(f)}function Ue(f){var S=+f,P=0;return S!==0&&isFinite(S)&&(P=Xe(S)),P}var zt={};function Me(f,S){var P,D=S,$;for(typeof f=="string"&&(f=[f]),_(S)&&(D=function(z,ie){ie[S]=Ue(z)}),$=f.length,P=0;P<$;P++)zt[f[P]]=D}function It(f,S){Me(f,function(P,D,$,z){$._w=$._w||{},S(P,$._w,$,z)})}function Jr(f,S,P){S!=null&&u(zt,f)&&zt[f](S,P._a,P,f)}function kt(f){return f%4===0&&f%100!==0||f%400===0}var We=0,nt=1,at=2,Ve=3,Je=4,it=5,mt=6,Zr=7,ea=8;J("Y",0,0,function(){var f=this.year();return f<=9999?G(f,4):"+"+f}),J(0,["YY",2],0,function(){return this.year()%100}),J(0,["YYYY",4],0,"year"),J(0,["YYYYY",5],0,"year"),J(0,["YYYYYY",6,!0],0,"year"),he("Y",et),he("YY",ye,Re),he("YYYY",Ke,Pe),he("YYYYY",Ge,Oe),he("YYYYYY",Ge,Oe),Me(["YYYYY","YYYYYY"],We),Me("YYYY",function(f,S){S[We]=f.length===2?s.parseTwoDigitYear(f):Ue(f)}),Me("YY",function(f,S){S[We]=s.parseTwoDigitYear(f)}),Me("Y",function(f,S){S[We]=parseInt(f,10)});function Ct(f){return kt(f)?366:365}s.parseTwoDigitYear=function(f){return Ue(f)+(Ue(f)>68?1900:2e3)};var hr=gt("FullYear",!0);function ta(){return kt(this.year())}function gt(f,S){return function(P){return P!=null?(_r(this,f,P),s.updateOffset(this,S),this):Pt(this,f)}}function Pt(f,S){if(!f.isValid())return NaN;var P=f._d,D=f._isUTC;switch(S){case"Milliseconds":return D?P.getUTCMilliseconds():P.getMilliseconds();case"Seconds":return D?P.getUTCSeconds():P.getSeconds();case"Minutes":return D?P.getUTCMinutes():P.getMinutes();case"Hours":return D?P.getUTCHours():P.getHours();case"Date":return D?P.getUTCDate():P.getDate();case"Day":return D?P.getUTCDay():P.getDay();case"Month":return D?P.getUTCMonth():P.getMonth();case"FullYear":return D?P.getUTCFullYear():P.getFullYear();default:return NaN}}function _r(f,S,P){var D,$,z,ie,ge;if(!(!f.isValid()||isNaN(P))){switch(D=f._d,$=f._isUTC,S){case"Milliseconds":return void($?D.setUTCMilliseconds(P):D.setMilliseconds(P));case"Seconds":return void($?D.setUTCSeconds(P):D.setSeconds(P));case"Minutes":return void($?D.setUTCMinutes(P):D.setMinutes(P));case"Hours":return void($?D.setUTCHours(P):D.setHours(P));case"Date":return void($?D.setUTCDate(P):D.setDate(P));case"FullYear":break;default:return}z=P,ie=f.month(),ge=f.date(),ge=ge===29&&ie===1&&!kt(z)?28:ge,$?D.setUTCFullYear(z,ie,ge):D.setFullYear(z,ie,ge)}}function ra(f){return f=Te(f),W(this[f])?this[f]():this}function aa(f,S){if(typeof f=="object"){f=re(f);var P=pe(f),D,$=P.length;for(D=0;D<$;D++)this[P[D].unit](f[P[D].unit])}else if(f=Te(f),W(this[f]))return this[f](S);return this}function sa(f,S){return(f%S+S)%S}var Fe;Array.prototype.indexOf?Fe=Array.prototype.indexOf:Fe=function(f){var S;for(S=0;S=0?(ge=new Date(f+400,S,P,D,$,z,ie),isFinite(ge.getFullYear())&&ge.setFullYear(f)):ge=new Date(f,S,P,D,$,z,ie),ge}function Ut(f){var S,P;return f<100&&f>=0?(P=Array.prototype.slice.call(arguments),P[0]=f+400,S=new Date(Date.UTC.apply(null,P)),isFinite(S.getUTCFullYear())&&S.setUTCFullYear(f)):S=new Date(Date.UTC.apply(null,arguments)),S}function Lt(f,S,P){var D=7+S-P,$=(7+Ut(f,0,D).getUTCDay()-S)%7;return-$+D-1}function gr(f,S,P,D,$){var z=(7+P-D)%7,ie=Lt(f,D,$),ge=1+7*(S-1)+z+ie,Ce,De;return ge<=0?(Ce=f-1,De=Ct(Ce)+ge):ge>Ct(f)?(Ce=f+1,De=ge-Ct(f)):(Ce=f,De=ge),{year:Ce,dayOfYear:De}}function Dt(f,S,P){var D=Lt(f.year(),S,P),$=Math.floor((f.dayOfYear()-D-1)/7)+1,z,ie;return $<1?(ie=f.year()-1,z=$+ot(ie,S,P)):$>ot(f.year(),S,P)?(z=$-ot(f.year(),S,P),ie=f.year()+1):(ie=f.year(),z=$),{week:z,year:ie}}function ot(f,S,P){var D=Lt(f,S,P),$=Lt(f+1,S,P);return(Ct(f)-D+$)/7}J("w",["ww",2],"wo","week"),J("W",["WW",2],"Wo","isoWeek"),he("w",ye,rt),he("ww",ye,Re),he("W",ye,rt),he("WW",ye,Re),It(["w","ww","W","WW"],function(f,S,P,D){S[D.substr(0,1)]=Ue(f)});function Ea(f){return Dt(f,this._week.dow,this._week.doy).week}var ma={dow:0,doy:6};function Ra(){return this._week.dow}function Ta(){return this._week.doy}function ga(f){var S=this.localeData().week(this);return f==null?S:this.add((f-S)*7,"d")}function Sa(f){var S=Dt(this,1,4).week;return f==null?S:this.add((f-S)*7,"d")}J("d",0,"do","day"),J("dd",0,0,function(f){return this.localeData().weekdaysMin(this,f)}),J("ddd",0,0,function(f){return this.localeData().weekdaysShort(this,f)}),J("dddd",0,0,function(f){return this.localeData().weekdays(this,f)}),J("e",0,0,"weekday"),J("E",0,0,"isoWeekday"),he("d",ye),he("e",ye),he("E",ye),he("dd",function(f,S){return S.weekdaysMinRegex(f)}),he("ddd",function(f,S){return S.weekdaysShortRegex(f)}),he("dddd",function(f,S){return S.weekdaysRegex(f)}),It(["dd","ddd","dddd"],function(f,S,P,D){var $=P._locale.weekdaysParse(f,D,P._strict);$!=null?S.d=$:I(P).invalidWeekday=f}),It(["d","e","E"],function(f,S,P,D){S[D]=Ue(f)});function ya(f,S){return typeof f!="string"?f:isNaN(f)?(f=S.weekdaysParse(f),typeof f=="number"?f:null):parseInt(f,10)}function va(f,S){return typeof f=="string"?S.weekdaysParse(f)%7||7:isNaN(f)?null:f}function Xt(f,S){return f.slice(S,7).concat(f.slice(0,S))}var Aa="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Sr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Oa="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),xa=st,Ia=st,Ca=st;function Pa(f,S){var P=i(this._weekdays)?this._weekdays:this._weekdays[f&&f!==!0&&this._weekdays.isFormat.test(S)?"format":"standalone"];return f===!0?Xt(P,this._week.dow):f?P[f.day()]:P}function Ua(f){return f===!0?Xt(this._weekdaysShort,this._week.dow):f?this._weekdaysShort[f.day()]:this._weekdaysShort}function Da(f){return f===!0?Xt(this._weekdaysMin,this._week.dow):f?this._weekdaysMin[f.day()]:this._weekdaysMin}function Na(f,S,P){var D,$,z,ie=f.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],D=0;D<7;++D)z=R([2e3,1]).day(D),this._minWeekdaysParse[D]=this.weekdaysMin(z,"").toLocaleLowerCase(),this._shortWeekdaysParse[D]=this.weekdaysShort(z,"").toLocaleLowerCase(),this._weekdaysParse[D]=this.weekdays(z,"").toLocaleLowerCase();return P?S==="dddd"?($=Fe.call(this._weekdaysParse,ie),$!==-1?$:null):S==="ddd"?($=Fe.call(this._shortWeekdaysParse,ie),$!==-1?$:null):($=Fe.call(this._minWeekdaysParse,ie),$!==-1?$:null):S==="dddd"?($=Fe.call(this._weekdaysParse,ie),$!==-1||($=Fe.call(this._shortWeekdaysParse,ie),$!==-1)?$:($=Fe.call(this._minWeekdaysParse,ie),$!==-1?$:null)):S==="ddd"?($=Fe.call(this._shortWeekdaysParse,ie),$!==-1||($=Fe.call(this._weekdaysParse,ie),$!==-1)?$:($=Fe.call(this._minWeekdaysParse,ie),$!==-1?$:null)):($=Fe.call(this._minWeekdaysParse,ie),$!==-1||($=Fe.call(this._weekdaysParse,ie),$!==-1)?$:($=Fe.call(this._shortWeekdaysParse,ie),$!==-1?$:null))}function ba(f,S,P){var D,$,z;if(this._weekdaysParseExact)return Na.call(this,f,S,P);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),D=0;D<7;D++){if($=R([2e3,1]).day(D),P&&!this._fullWeekdaysParse[D]&&(this._fullWeekdaysParse[D]=new RegExp("^"+this.weekdays($,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[D]=new RegExp("^"+this.weekdaysShort($,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[D]=new RegExp("^"+this.weekdaysMin($,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[D]||(z="^"+this.weekdays($,"")+"|^"+this.weekdaysShort($,"")+"|^"+this.weekdaysMin($,""),this._weekdaysParse[D]=new RegExp(z.replace(".",""),"i")),P&&S==="dddd"&&this._fullWeekdaysParse[D].test(f))return D;if(P&&S==="ddd"&&this._shortWeekdaysParse[D].test(f))return D;if(P&&S==="dd"&&this._minWeekdaysParse[D].test(f))return D;if(!P&&this._weekdaysParse[D].test(f))return D}}function Ma(f){if(!this.isValid())return f!=null?this:NaN;var S=Pt(this,"Day");return f!=null?(f=ya(f,this.localeData()),this.add(f-S,"d")):S}function ka(f){if(!this.isValid())return f!=null?this:NaN;var S=(this.day()+7-this.localeData()._week.dow)%7;return f==null?S:this.add(f-S,"d")}function La(f){if(!this.isValid())return f!=null?this:NaN;if(f!=null){var S=va(f,this.localeData());return this.day(this.day()%7?S:S-7)}else return this.day()||7}function wa(f){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Kt.call(this),f?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=xa),this._weekdaysStrictRegex&&f?this._weekdaysStrictRegex:this._weekdaysRegex)}function $a(f){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Kt.call(this),f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ia),this._weekdaysShortStrictRegex&&f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Fa(f){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Kt.call(this),f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ca),this._weekdaysMinStrictRegex&&f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Kt(){function f(ze,ht){return ht.length-ze.length}var S=[],P=[],D=[],$=[],z,ie,ge,Ce,De;for(z=0;z<7;z++)ie=R([2e3,1]).day(z),ge=Qe(this.weekdaysMin(ie,"")),Ce=Qe(this.weekdaysShort(ie,"")),De=Qe(this.weekdays(ie,"")),S.push(ge),P.push(Ce),D.push(De),$.push(ge),$.push(Ce),$.push(De);S.sort(f),P.sort(f),D.sort(f),$.sort(f),this._weekdaysRegex=new RegExp("^("+$.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+D.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+P.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+S.join("|")+")","i")}function Qt(){return this.hours()%12||12}function Va(){return this.hours()||24}J("H",["HH",2],0,"hour"),J("h",["hh",2],0,Qt),J("k",["kk",2],0,Va),J("hmm",0,0,function(){return""+Qt.apply(this)+G(this.minutes(),2)}),J("hmmss",0,0,function(){return""+Qt.apply(this)+G(this.minutes(),2)+G(this.seconds(),2)}),J("Hmm",0,0,function(){return""+this.hours()+G(this.minutes(),2)}),J("Hmmss",0,0,function(){return""+this.hours()+G(this.minutes(),2)+G(this.seconds(),2)});function yr(f,S){J(f,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),S)})}yr("a",!0),yr("A",!1);function vr(f,S){return S._meridiemParse}he("a",vr),he("A",vr),he("H",ye,Ie),he("h",ye,rt),he("k",ye,rt),he("HH",ye,Re),he("hh",ye,Re),he("kk",ye,Re),he("hmm",Le),he("hmmss",Be),he("Hmm",Le),he("Hmmss",Be),Me(["H","HH"],Ve),Me(["k","kk"],function(f,S,P){var D=Ue(f);S[Ve]=D===24?0:D}),Me(["a","A"],function(f,S,P){P._isPm=P._locale.isPM(f),P._meridiem=f}),Me(["h","hh"],function(f,S,P){S[Ve]=Ue(f),I(P).bigHour=!0}),Me("hmm",function(f,S,P){var D=f.length-2;S[Ve]=Ue(f.substr(0,D)),S[Je]=Ue(f.substr(D)),I(P).bigHour=!0}),Me("hmmss",function(f,S,P){var D=f.length-4,$=f.length-2;S[Ve]=Ue(f.substr(0,D)),S[Je]=Ue(f.substr(D,2)),S[it]=Ue(f.substr($)),I(P).bigHour=!0}),Me("Hmm",function(f,S,P){var D=f.length-2;S[Ve]=Ue(f.substr(0,D)),S[Je]=Ue(f.substr(D))}),Me("Hmmss",function(f,S,P){var D=f.length-4,$=f.length-2;S[Ve]=Ue(f.substr(0,D)),S[Je]=Ue(f.substr(D,2)),S[it]=Ue(f.substr($))});function ja(f){return(f+"").toLowerCase().charAt(0)==="p"}var Ga=/[ap]\.?m?\.?/i,Ba=gt("Hours",!0);function Ha(f,S,P){return f>11?P?"pm":"PM":P?"am":"AM"}var Ar={calendar:N,longDateFormat:Z,invalidDate:q,ordinal:se,dayOfMonthOrdinalParse:fe,relativeTime:ve,months:na,monthsShort:pr,week:ma,weekdays:Aa,weekdaysMin:Oa,weekdaysShort:Sr,meridiemParse:Ga},$e={},Nt={},bt;function Ya(f,S){var P,D=Math.min(f.length,S.length);for(P=0;P0;){if($=wt(z.slice(0,P).join("-")),$)return $;if(D&&D.length>=P&&Ya(z,D)>=P-1)break;P--}S++}return bt}function za(f){return!!(f&&f.match("^[^/\\\\]*$"))}function wt(f){var S=null,P;if($e[f]===void 0&&e&&e.exports&&za(f))try{S=bt._abbr,P=commonjsRequire,P("./locale/"+f),ft(S)}catch{$e[f]=null}return $e[f]}function ft(f,S){var P;return f&&(c(S)?P=ut(f):P=Jt(f,S),P?bt=P:typeof console<"u"&&console.warn&&console.warn("Locale "+f+" not found. Did you forget to load it?")),bt._abbr}function Jt(f,S){if(S!==null){var P,D=Ar;if(S.abbr=f,$e[f]!=null)H("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),D=$e[f]._config;else if(S.parentLocale!=null)if($e[S.parentLocale]!=null)D=$e[S.parentLocale]._config;else if(P=wt(S.parentLocale),P!=null)D=P._config;else return Nt[S.parentLocale]||(Nt[S.parentLocale]=[]),Nt[S.parentLocale].push({name:f,config:S}),null;return $e[f]=new k(b(D,S)),Nt[f]&&Nt[f].forEach(function($){Jt($.name,$.config)}),ft(f),$e[f]}else return delete $e[f],null}function qa(f,S){if(S!=null){var P,D,$=Ar;$e[f]!=null&&$e[f].parentLocale!=null?$e[f].set(b($e[f]._config,S)):(D=wt(f),D!=null&&($=D._config),S=b($,S),D==null&&(S.abbr=f),P=new k(S),P.parentLocale=$e[f],$e[f]=P),ft(f)}else $e[f]!=null&&($e[f].parentLocale!=null?($e[f]=$e[f].parentLocale,f===ft()&&ft(f)):$e[f]!=null&&delete $e[f]);return $e[f]}function ut(f){var S;if(f&&f._locale&&f._locale._abbr&&(f=f._locale._abbr),!f)return bt;if(!i(f)){if(S=wt(f),S)return S;f=[f]}return Wa(f)}function Xa(){return F($e)}function Zt(f){var S,P=f._a;return P&&I(f).overflow===-2&&(S=P[nt]<0||P[nt]>11?nt:P[at]<1||P[at]>qt(P[We],P[nt])?at:P[Ve]<0||P[Ve]>24||P[Ve]===24&&(P[Je]!==0||P[it]!==0||P[mt]!==0)?Ve:P[Je]<0||P[Je]>59?Je:P[it]<0||P[it]>59?it:P[mt]<0||P[mt]>999?mt:-1,I(f)._overflowDayOfYear&&(Sat)&&(S=at),I(f)._overflowWeeks&&S===-1&&(S=Zr),I(f)._overflowWeekday&&S===-1&&(S=ea),I(f).overflow=S),f}var Ka=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Qa=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ja=/Z|[+-]\d\d(?::?\d\d)?/,$t=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],er=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Za=/^\/?Date\((-?\d+)/i,es=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,ts={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function xr(f){var S,P,D=f._i,$=Ka.exec(D)||Qa.exec(D),z,ie,ge,Ce,De=$t.length,ze=er.length;if($){for(I(f).iso=!0,S=0,P=De;SCt(ie)||f._dayOfYear===0)&&(I(f)._overflowDayOfYear=!0),P=Ut(ie,0,f._dayOfYear),f._a[nt]=P.getUTCMonth(),f._a[at]=P.getUTCDate()),S=0;S<3&&f._a[S]==null;++S)f._a[S]=D[S]=$[S];for(;S<7;S++)f._a[S]=D[S]=f._a[S]==null?S===2?1:0:f._a[S];f._a[Ve]===24&&f._a[Je]===0&&f._a[it]===0&&f._a[mt]===0&&(f._nextDay=!0,f._a[Ve]=0),f._d=(f._useUTC?Ut:pa).apply(null,D),z=f._useUTC?f._d.getUTCDay():f._d.getDay(),f._tzm!=null&&f._d.setUTCMinutes(f._d.getUTCMinutes()-f._tzm),f._nextDay&&(f._a[Ve]=24),f._w&&typeof f._w.d<"u"&&f._w.d!==z&&(I(f).weekdayMismatch=!0)}}function cs(f){var S,P,D,$,z,ie,ge,Ce,De;S=f._w,S.GG!=null||S.W!=null||S.E!=null?(z=1,ie=4,P=St(S.GG,f._a[We],Dt(ke(),1,4).year),D=St(S.W,1),$=St(S.E,1),($<1||$>7)&&(Ce=!0)):(z=f._locale._week.dow,ie=f._locale._week.doy,De=Dt(ke(),z,ie),P=St(S.gg,f._a[We],De.year),D=St(S.w,De.week),S.d!=null?($=S.d,($<0||$>6)&&(Ce=!0)):S.e!=null?($=S.e+z,(S.e<0||S.e>6)&&(Ce=!0)):$=z),D<1||D>ot(P,z,ie)?I(f)._overflowWeeks=!0:Ce!=null?I(f)._overflowWeekday=!0:(ge=gr(P,D,$,z,ie),f._a[We]=ge.year,f._dayOfYear=ge.dayOfYear)}s.ISO_8601=function(){},s.RFC_2822=function(){};function rr(f){if(f._f===s.ISO_8601){xr(f);return}if(f._f===s.RFC_2822){Ir(f);return}f._a=[],I(f).empty=!0;var S=""+f._i,P,D,$,z,ie,ge=S.length,Ce=0,De,ze;for($=Y(f._f,f._locale).match(V)||[],ze=$.length,P=0;P0&&I(f).unusedInput.push(ie),S=S.slice(S.indexOf(D)+D.length),Ce+=D.length),ne[z]?(D?I(f).empty=!1:I(f).unusedTokens.push(z),Jr(z,D,f)):f._strict&&!D&&I(f).unusedTokens.push(z);I(f).charsLeftOver=ge-Ce,S.length>0&&I(f).unusedInput.push(S),f._a[Ve]<=12&&I(f).bigHour===!0&&f._a[Ve]>0&&(I(f).bigHour=void 0),I(f).parsedDateParts=f._a.slice(0),I(f).meridiem=f._meridiem,f._a[Ve]=ds(f._locale,f._a[Ve],f._meridiem),De=I(f).era,De!==null&&(f._a[We]=f._locale.erasConvertYear(De,f._a[We])),tr(f),Zt(f)}function ds(f,S,P){var D;return P==null?S:f.meridiemHour!=null?f.meridiemHour(S,P):(f.isPM!=null&&(D=f.isPM(P),D&&S<12&&(S+=12),!D&&S===12&&(S=0)),S)}function hs(f){var S,P,D,$,z,ie,ge=!1,Ce=f._f.length;if(Ce===0){I(f).invalidFormat=!0,f._d=new Date(NaN);return}for($=0;$this?this:f:g()});function Ur(f,S){var P,D;if(S.length===1&&i(S[0])&&(S=S[0]),!S.length)return ke();for(P=S[0],D=1;Dthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function bs(){if(!c(this._isDSTShifted))return this._isDSTShifted;var f={},S;return C(f,this),f=Cr(f),f._a?(S=f._isUTC?R(f._a):ke(f._a),this._isDSTShifted=this.isValid()&&As(f._a,S.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Ms(){return this.isValid()?!this._isUTC:!1}function ks(){return this.isValid()?this._isUTC:!1}function Nr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Ls=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,ws=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ze(f,S){var P=f,D=null,$,z,ie;return Vt(f)?P={ms:f._milliseconds,d:f._days,M:f._months}:_(f)||!isNaN(+f)?(P={},S?P[S]=+f:P.milliseconds=+f):(D=Ls.exec(f))?($=D[1]==="-"?-1:1,P={y:0,d:Ue(D[at])*$,h:Ue(D[Ve])*$,m:Ue(D[Je])*$,s:Ue(D[it])*$,ms:Ue(ar(D[mt]*1e3))*$}):(D=ws.exec(f))?($=D[1]==="-"?-1:1,P={y:Rt(D[2],$),M:Rt(D[3],$),w:Rt(D[4],$),d:Rt(D[5],$),h:Rt(D[6],$),m:Rt(D[7],$),s:Rt(D[8],$)}):P==null?P={}:typeof P=="object"&&("from"in P||"to"in P)&&(ie=$s(ke(P.from),ke(P.to)),P={},P.ms=ie.milliseconds,P.M=ie.months),z=new Ft(P),Vt(f)&&u(f,"_locale")&&(z._locale=f._locale),Vt(f)&&u(f,"_isValid")&&(z._isValid=f._isValid),z}Ze.fn=Ft.prototype,Ze.invalid=vs;function Rt(f,S){var P=f&&parseFloat(f.replace(",","."));return(isNaN(P)?0:P)*S}function br(f,S){var P={};return P.months=S.month()-f.month()+(S.year()-f.year())*12,f.clone().add(P.months,"M").isAfter(S)&&--P.months,P.milliseconds=+S-+f.clone().add(P.months,"M"),P}function $s(f,S){var P;return f.isValid()&&S.isValid()?(S=nr(S,f),f.isBefore(S)?P=br(f,S):(P=br(S,f),P.milliseconds=-P.milliseconds,P.months=-P.months),P):{milliseconds:0,months:0}}function Mr(f,S){return function(P,D){var $,z;return D!==null&&!isNaN(+D)&&(H(S,"moment()."+S+"(period, number) is deprecated. Please use moment()."+S+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),z=P,P=D,D=z),$=Ze(P,D),kr(this,$,f),this}}function kr(f,S,P,D){var $=S._milliseconds,z=ar(S._days),ie=ar(S._months);f.isValid()&&(D=D??!0,ie&&mr(f,Pt(f,"Month")+ie*P),z&&_r(f,"Date",Pt(f,"Date")+z*P),$&&f._d.setTime(f._d.valueOf()+$*P),D&&s.updateOffset(f,z||ie))}var Fs=Mr(1,"add"),Vs=Mr(-1,"subtract");function Lr(f){return typeof f=="string"||f instanceof String}function js(f){return L(f)||p(f)||Lr(f)||_(f)||Bs(f)||Gs(f)||f===null||f===void 0}function Gs(f){var S=o(f)&&!l(f),P=!1,D=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],$,z,ie=D.length;for($=0;$P.valueOf():P.valueOf()9999?_e(P,S?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):W(Date.prototype.toISOString)?S?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",_e(P,"Z")):_e(P,S?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function an(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var f="moment",S="",P,D,$,z;return this.isLocal()||(f=this.utcOffset()===0?"moment.utc":"moment.parseZone",S="Z"),P="["+f+'("]',D=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",$="-MM-DD[T]HH:mm:ss.SSS",z=S+'[")]',this.format(P+D+$+z)}function sn(f){f||(f=this.isUtc()?s.defaultFormatUtc:s.defaultFormat);var S=_e(this,f);return this.localeData().postformat(S)}function nn(f,S){return this.isValid()&&(L(f)&&f.isValid()||ke(f).isValid())?Ze({to:this,from:f}).locale(this.locale()).humanize(!S):this.localeData().invalidDate()}function on(f){return this.from(ke(),f)}function un(f,S){return this.isValid()&&(L(f)&&f.isValid()||ke(f).isValid())?Ze({from:this,to:f}).locale(this.locale()).humanize(!S):this.localeData().invalidDate()}function ln(f){return this.to(ke(),f)}function wr(f){var S;return f===void 0?this._locale._abbr:(S=ut(f),S!=null&&(this._locale=S),this)}var $r=X("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(f){return f===void 0?this.localeData():this.locale(f)});function Fr(){return this._locale}var Gt=1e3,yt=60*Gt,Bt=60*yt,Vr=(365*400+97)*24*Bt;function vt(f,S){return(f%S+S)%S}function jr(f,S,P){return f<100&&f>=0?new Date(f+400,S,P)-Vr:new Date(f,S,P).valueOf()}function Gr(f,S,P){return f<100&&f>=0?Date.UTC(f+400,S,P)-Vr:Date.UTC(f,S,P)}function cn(f){var S,P;if(f=Te(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(P=this._isUTC?Gr:jr,f){case"year":S=P(this.year(),0,1);break;case"quarter":S=P(this.year(),this.month()-this.month()%3,1);break;case"month":S=P(this.year(),this.month(),1);break;case"week":S=P(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":S=P(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":S=P(this.year(),this.month(),this.date());break;case"hour":S=this._d.valueOf(),S-=vt(S+(this._isUTC?0:this.utcOffset()*yt),Bt);break;case"minute":S=this._d.valueOf(),S-=vt(S,yt);break;case"second":S=this._d.valueOf(),S-=vt(S,Gt);break}return this._d.setTime(S),s.updateOffset(this,!0),this}function dn(f){var S,P;if(f=Te(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(P=this._isUTC?Gr:jr,f){case"year":S=P(this.year()+1,0,1)-1;break;case"quarter":S=P(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":S=P(this.year(),this.month()+1,1)-1;break;case"week":S=P(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":S=P(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":S=P(this.year(),this.month(),this.date()+1)-1;break;case"hour":S=this._d.valueOf(),S+=Bt-vt(S+(this._isUTC?0:this.utcOffset()*yt),Bt)-1;break;case"minute":S=this._d.valueOf(),S+=yt-vt(S,yt)-1;break;case"second":S=this._d.valueOf(),S+=Gt-vt(S,Gt)-1;break}return this._d.setTime(S),s.updateOffset(this,!0),this}function hn(){return this._d.valueOf()-(this._offset||0)*6e4}function fn(){return Math.floor(this.valueOf()/1e3)}function _n(){return new Date(this.valueOf())}function pn(){var f=this;return[f.year(),f.month(),f.date(),f.hour(),f.minute(),f.second(),f.millisecond()]}function En(){var f=this;return{years:f.year(),months:f.month(),date:f.date(),hours:f.hours(),minutes:f.minutes(),seconds:f.seconds(),milliseconds:f.milliseconds()}}function mn(){return this.isValid()?this.toISOString():null}function Rn(){return x(this)}function Tn(){return E({},I(this))}function gn(){return I(this).overflow}function Sn(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}J("N",0,0,"eraAbbr"),J("NN",0,0,"eraAbbr"),J("NNN",0,0,"eraAbbr"),J("NNNN",0,0,"eraName"),J("NNNNN",0,0,"eraNarrow"),J("y",["y",1],"yo","eraYear"),J("y",["yy",2],0,"eraYear"),J("y",["yyy",3],0,"eraYear"),J("y",["yyyy",4],0,"eraYear"),he("N",or),he("NN",or),he("NNN",or),he("NNNN",Nn),he("NNNNN",bn),Me(["N","NN","NNN","NNNN","NNNNN"],function(f,S,P,D){var $=P._locale.erasParse(f,D,P._strict);$?I(P).era=$:I(P).invalidEra=f}),he("y",we),he("yy",we),he("yyy",we),he("yyyy",we),he("yo",Mn),Me(["y","yy","yyy","yyyy"],We),Me(["yo"],function(f,S,P,D){var $;P._locale._eraYearOrdinalRegex&&($=f.match(P._locale._eraYearOrdinalRegex)),P._locale.eraYearOrdinalParse?S[We]=P._locale.eraYearOrdinalParse(f,$):S[We]=parseInt(f,10)});function yn(f,S){var P,D,$,z=this._eras||ut("en")._eras;for(P=0,D=z.length;P=0)return z[D]}function An(f,S){var P=f.since<=f.until?1:-1;return S===void 0?s(f.since).year():s(f.since).year()+(S-f.offset)*P}function On(){var f,S,P,D=this.localeData().eras();for(f=0,S=D.length;fz&&(S=z),jn.call(this,f,S,P,D,$))}function jn(f,S,P,D,$){var z=gr(f,S,P,D,$),ie=Ut(z.year,0,z.dayOfYear);return this.year(ie.getUTCFullYear()),this.month(ie.getUTCMonth()),this.date(ie.getUTCDate()),this}J("Q",0,"Qo","quarter"),he("Q",Ee),Me("Q",function(f,S){S[nt]=(Ue(f)-1)*3});function Gn(f){return f==null?Math.ceil((this.month()+1)/3):this.month((f-1)*3+this.month()%3)}J("D",["DD",2],"Do","date"),he("D",ye,rt),he("DD",ye,Re),he("Do",function(f,S){return f?S._dayOfMonthOrdinalParse||S._ordinalParse:S._dayOfMonthOrdinalParseLenient}),Me(["D","DD"],at),Me("Do",function(f,S){S[at]=Ue(f.match(ye)[0])});var Hr=gt("Date",!0);J("DDD",["DDDD",3],"DDDo","dayOfYear"),he("DDD",je),he("DDDD",xe),Me(["DDD","DDDD"],function(f,S,P){P._dayOfYear=Ue(f)});function Bn(f){var S=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return f==null?S:this.add(f-S,"d")}J("m",["mm",2],0,"minute"),he("m",ye,Ie),he("mm",ye,Re),Me(["m","mm"],Je);var Hn=gt("Minutes",!1);J("s",["ss",2],0,"second"),he("s",ye,Ie),he("ss",ye,Re),Me(["s","ss"],it);var Yn=gt("Seconds",!1);J("S",0,0,function(){return~~(this.millisecond()/100)}),J(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),J(0,["SSS",3],0,"millisecond"),J(0,["SSSS",4],0,function(){return this.millisecond()*10}),J(0,["SSSSS",5],0,function(){return this.millisecond()*100}),J(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),J(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),J(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),J(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),he("S",je,Ee),he("SS",je,Re),he("SSS",je,xe);var _t,Yr;for(_t="SSSS";_t.length<=9;_t+="S")he(_t,we);function Wn(f,S){S[mt]=Ue(("0."+f)*1e3)}for(_t="S";_t.length<=9;_t+="S")Me(_t,Wn);Yr=gt("Milliseconds",!1),J("z",0,0,"zoneAbbr"),J("zz",0,0,"zoneName");function zn(){return this._isUTC?"UTC":""}function qn(){return this._isUTC?"Coordinated Universal Time":""}var de=U.prototype;de.add=Fs,de.calendar=Ws,de.clone=zs,de.diff=en,de.endOf=dn,de.format=sn,de.from=nn,de.fromNow=on,de.to=un,de.toNow=ln,de.get=ra,de.invalidAt=gn,de.isAfter=qs,de.isBefore=Xs,de.isBetween=Ks,de.isSame=Qs,de.isSameOrAfter=Js,de.isSameOrBefore=Zs,de.isValid=Rn,de.lang=$r,de.locale=wr,de.localeData=Fr,de.max=ms,de.min=Es,de.parsingFlags=Tn,de.set=aa,de.startOf=cn,de.subtract=Vs,de.toArray=pn,de.toObject=En,de.toDate=_n,de.toISOString=rn,de.inspect=an,typeof Symbol<"u"&&Symbol.for!=null&&(de[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),de.toJSON=mn,de.toString=tn,de.unix=fn,de.valueOf=hn,de.creationData=Sn,de.eraName=On,de.eraNarrow=xn,de.eraAbbr=In,de.eraYear=Cn,de.year=hr,de.isLeapYear=ta,de.weekYear=kn,de.isoWeekYear=Ln,de.quarter=de.quarters=Gn,de.month=Rr,de.daysInMonth=ha,de.week=de.weeks=ga,de.isoWeek=de.isoWeeks=Sa,de.weeksInYear=Fn,de.weeksInWeekYear=Vn,de.isoWeeksInYear=wn,de.isoWeeksInISOWeekYear=$n,de.date=Hr,de.day=de.days=Ma,de.weekday=ka,de.isoWeekday=La,de.dayOfYear=Bn,de.hour=de.hours=Ba,de.minute=de.minutes=Hn,de.second=de.seconds=Yn,de.millisecond=de.milliseconds=Yr,de.utcOffset=xs,de.utc=Cs,de.local=Ps,de.parseZone=Us,de.hasAlignedHourOffset=Ds,de.isDST=Ns,de.isLocal=Ms,de.isUtcOffset=ks,de.isUtc=Nr,de.isUTC=Nr,de.zoneAbbr=zn,de.zoneName=qn,de.dates=X("dates accessor is deprecated. Use date instead.",Hr),de.months=X("months accessor is deprecated. Use month instead",Rr),de.years=X("years accessor is deprecated. Use year instead",hr),de.zone=X("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Is),de.isDSTShifted=X("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",bs);function Xn(f){return ke(f*1e3)}function Kn(){return ke.apply(null,arguments).parseZone()}function Wr(f){return f}var be=k.prototype;be.calendar=M,be.longDateFormat=te,be.invalidDate=Q,be.ordinal=me,be.preparse=Wr,be.postformat=Wr,be.relativeTime=Ae,be.pastFuture=ce,be.set=K,be.eras=yn,be.erasParse=vn,be.erasConvertYear=An,be.erasAbbrRegex=Un,be.erasNameRegex=Pn,be.erasNarrowRegex=Dn,be.months=ua,be.monthsShort=la,be.monthsParse=da,be.monthsRegex=_a,be.monthsShortRegex=fa,be.week=Ea,be.firstDayOfYear=Ta,be.firstDayOfWeek=Ra,be.weekdays=Pa,be.weekdaysMin=Da,be.weekdaysShort=Ua,be.weekdaysParse=ba,be.weekdaysRegex=wa,be.weekdaysShortRegex=$a,be.weekdaysMinRegex=Fa,be.isPM=ja,be.meridiem=Ha;function Yt(f,S,P,D){var $=ut(),z=R().set(D,S);return $[P](z,f)}function zr(f,S,P){if(_(f)&&(S=f,f=void 0),f=f||"",S!=null)return Yt(f,S,P,"month");var D,$=[];for(D=0;D<12;D++)$[D]=Yt(f,D,P,"month");return $}function lr(f,S,P,D){typeof f=="boolean"?(_(S)&&(P=S,S=void 0),S=S||""):(S=f,P=S,f=!1,_(S)&&(P=S,S=void 0),S=S||"");var $=ut(),z=f?$._week.dow:0,ie,ge=[];if(P!=null)return Yt(S,(P+z)%7,D,"day");for(ie=0;ie<7;ie++)ge[ie]=Yt(S,(ie+z)%7,D,"day");return ge}function Qn(f,S){return zr(f,S,"months")}function Jn(f,S){return zr(f,S,"monthsShort")}function Zn(f,S,P){return lr(f,S,P,"weekdays")}function ei(f,S,P){return lr(f,S,P,"weekdaysShort")}function ti(f,S,P){return lr(f,S,P,"weekdaysMin")}ft("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(f){var S=f%10,P=Ue(f%100/10)===1?"th":S===1?"st":S===2?"nd":S===3?"rd":"th";return f+P}}),s.lang=X("moment.lang is deprecated. Use moment.locale instead.",ft),s.langData=X("moment.langData is deprecated. Use moment.localeData instead.",ut);var lt=Math.abs;function ri(){var f=this._data;return this._milliseconds=lt(this._milliseconds),this._days=lt(this._days),this._months=lt(this._months),f.milliseconds=lt(f.milliseconds),f.seconds=lt(f.seconds),f.minutes=lt(f.minutes),f.hours=lt(f.hours),f.months=lt(f.months),f.years=lt(f.years),this}function qr(f,S,P,D){var $=Ze(S,P);return f._milliseconds+=D*$._milliseconds,f._days+=D*$._days,f._months+=D*$._months,f._bubble()}function ai(f,S){return qr(this,f,S,1)}function si(f,S){return qr(this,f,S,-1)}function Xr(f){return f<0?Math.floor(f):Math.ceil(f)}function ni(){var f=this._milliseconds,S=this._days,P=this._months,D=this._data,$,z,ie,ge,Ce;return f>=0&&S>=0&&P>=0||f<=0&&S<=0&&P<=0||(f+=Xr(cr(P)+S)*864e5,S=0,P=0),D.milliseconds=f%1e3,$=Xe(f/1e3),D.seconds=$%60,z=Xe($/60),D.minutes=z%60,ie=Xe(z/60),D.hours=ie%24,S+=Xe(ie/24),Ce=Xe(Kr(S)),P+=Ce,S-=Xr(cr(Ce)),ge=Xe(P/12),P%=12,D.days=S,D.months=P,D.years=ge,this}function Kr(f){return f*4800/146097}function cr(f){return f*146097/4800}function ii(f){if(!this.isValid())return NaN;var S,P,D=this._milliseconds;if(f=Te(f),f==="month"||f==="quarter"||f==="year")switch(S=this._days+D/864e5,P=this._months+Kr(S),f){case"month":return P;case"quarter":return P/3;case"year":return P/12}else switch(S=this._days+Math.round(cr(this._months)),f){case"week":return S/7+D/6048e5;case"day":return S+D/864e5;case"hour":return S*24+D/36e5;case"minute":return S*1440+D/6e4;case"second":return S*86400+D/1e3;case"millisecond":return Math.floor(S*864e5)+D;default:throw new Error("Unknown unit "+f)}}function ct(f){return function(){return this.as(f)}}var Qr=ct("ms"),oi=ct("s"),ui=ct("m"),li=ct("h"),ci=ct("d"),di=ct("w"),hi=ct("M"),fi=ct("Q"),_i=ct("y"),pi=Qr;function Ei(){return Ze(this)}function mi(f){return f=Te(f),this.isValid()?this[f+"s"]():NaN}function Tt(f){return function(){return this.isValid()?this._data[f]:NaN}}var Ri=Tt("milliseconds"),Ti=Tt("seconds"),gi=Tt("minutes"),Si=Tt("hours"),yi=Tt("days"),vi=Tt("months"),Ai=Tt("years");function Oi(){return Xe(this.days()/7)}var dt=Math.round,At={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function xi(f,S,P,D,$){return $.relativeTime(S||1,!!P,f,D)}function Ii(f,S,P,D){var $=Ze(f).abs(),z=dt($.as("s")),ie=dt($.as("m")),ge=dt($.as("h")),Ce=dt($.as("d")),De=dt($.as("M")),ze=dt($.as("w")),ht=dt($.as("y")),pt=z<=P.ss&&["s",z]||z0,pt[4]=D,xi.apply(null,pt)}function Ci(f){return f===void 0?dt:typeof f=="function"?(dt=f,!0):!1}function Pi(f,S){return At[f]===void 0?!1:S===void 0?At[f]:(At[f]=S,f==="s"&&(At.ss=S-1),!0)}function Ui(f,S){if(!this.isValid())return this.localeData().invalidDate();var P=!1,D=At,$,z;return typeof f=="object"&&(S=f,f=!1),typeof f=="boolean"&&(P=f),typeof S=="object"&&(D=Object.assign({},At,S),S.s!=null&&S.ss==null&&(D.ss=S.s-1)),$=this.localeData(),z=Ii(this,!P,D,$),P&&(z=$.pastFuture(+this,z)),$.postformat(z)}var dr=Math.abs;function Ot(f){return(f>0)-(f<0)||+f}function Wt(){if(!this.isValid())return this.localeData().invalidDate();var f=dr(this._milliseconds)/1e3,S=dr(this._days),P=dr(this._months),D,$,z,ie,ge=this.asSeconds(),Ce,De,ze,ht;return ge?(D=Xe(f/60),$=Xe(D/60),f%=60,D%=60,z=Xe(P/12),P%=12,ie=f?f.toFixed(3).replace(/\.?0+$/,""):"",Ce=ge<0?"-":"",De=Ot(this._months)!==Ot(ge)?"-":"",ze=Ot(this._days)!==Ot(ge)?"-":"",ht=Ot(this._milliseconds)!==Ot(ge)?"-":"",Ce+"P"+(z?De+z+"Y":"")+(P?De+P+"M":"")+(S?ze+S+"D":"")+($||D||f?"T":"")+($?ht+$+"H":"")+(D?ht+D+"M":"")+(f?ht+ie+"S":"")):"P0D"}var Ne=Ft.prototype;Ne.isValid=ys,Ne.abs=ri,Ne.add=ai,Ne.subtract=si,Ne.as=ii,Ne.asMilliseconds=Qr,Ne.asSeconds=oi,Ne.asMinutes=ui,Ne.asHours=li,Ne.asDays=ci,Ne.asWeeks=di,Ne.asMonths=hi,Ne.asQuarters=fi,Ne.asYears=_i,Ne.valueOf=pi,Ne._bubble=ni,Ne.clone=Ei,Ne.get=mi,Ne.milliseconds=Ri,Ne.seconds=Ti,Ne.minutes=gi,Ne.hours=Si,Ne.days=yi,Ne.weeks=Oi,Ne.months=vi,Ne.years=Ai,Ne.humanize=Ui,Ne.toISOString=Wt,Ne.toString=Wt,Ne.toJSON=Wt,Ne.locale=wr,Ne.localeData=Fr,Ne.toIsoString=X("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Wt),Ne.lang=$r,J("X",0,0,"unix"),J("x",0,0,"valueOf"),he("x",et),he("X",xt),Me("X",function(f,S,P){P._d=new Date(parseFloat(f)*1e3)}),Me("x",function(f,S,P){P._d=new Date(Ue(f))});//! moment.js +return s.version="2.30.1",n(ke),s.fn=de,s.min=Rs,s.max=Ts,s.now=gs,s.utc=R,s.unix=Xn,s.months=Qn,s.isDate=p,s.locale=ft,s.invalid=g,s.duration=Ze,s.isMoment=L,s.weekdays=Zn,s.parseZone=Kn,s.localeData=ut,s.isDuration=Vt,s.monthsShort=Jn,s.weekdaysMin=ti,s.defineLocale=Jt,s.updateLocale=qa,s.locales=Xa,s.weekdaysShort=ei,s.normalizeUnits=Te,s.relativeTimeRounding=Ci,s.relativeTimeThreshold=Pi,s.calendarFormat=Ys,s.prototype=de,s.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},s})})(moment$1);var momentExports=moment$1.exports;const moment=getDefaultExportFromCjs(momentExports),avicultureHatchingRequestsService=createAsyncThunk("AVICULTURE_HATCHING_REQUESTS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const a="&today";e=e||moment(new Date).format("YYYY-MM-DD");const{data:s,status:n}=await axios$1.get("Poultry_Request/?role="+getRoleFromUrl()+a,{params:{date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:s,status:n}}),avicultureRequestsStateProcessService=createAsyncThunk("AVICULTURE_REQUESTS_STATE_PROCESS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("Poultry_Request/?role="+getRoleFromUrl(),{params:{date1:e.selectedDate1,date2:e.selectedDate2,state_process:!0}});return t(LOADING_END()),{data:a,status:s}}),avicultureExtraReducers={[avicultureNewRequest.fulfilled]:(e,{payload:t})=>{e.pending=!1},[avicultureNewRequest.pending]:e=>{e.pending=!0},[avicultureGetRequests.fulfilled]:(e,{payload:t})=>{e.avicultureRequests=t.data,e.pending=!1},[avicultureRequestsStateProcessService.fulfilled]:(e,{payload:t})=>{e.avicultureRequestsStateProcess=t.data,e.pending=!0},[avicultureRequestsStateProcessService.pending]:(e,{payload:t})=>{e.pending=!1},[avicultureGetRequests.pending]:e=>{e.pending=!0},[avicultureGetHatchings.fulfilled]:(e,{payload:t})=>{e.avicultureHatchings=t.data,e.pending=!1},[avicultureGetHatchings.pending]:e=>{e.pending=!0},[avicultureGetProfile.fulfilled]:(e,{payload:t})=>{e.profile=t.data,e.pending=!1},[avicultureGetProfile.pending]:e=>{e.pending=!0},[avicultureGetChickenPrice.fulfilled]:(e,{payload:t})=>{e.avicultureChickenPrice=t.data,e.pending=!1},[avicultureGetChickenPrice.pending]:e=>{e.pending=!0},[avicultureGetHallsInfo.fulfilled]:(e,{payload:t})=>{e.avicultureHallsInfo=t.data,e.pending=!1},[avicultureGetHallsInfo.pending]:e=>{e.pending=!0},[avicultureGetHallInspects.fulfilled]:(e,{payload:t})=>{e.avicultureHallInspects=t.data,e.pending=!1},[avicultureGetHallInspects.pending]:e=>{e.pending=!0},[avicultureGetSlaughters.fulfilled]:(e,{payload:t})=>{t.data.sort((a,s)=>s.quantitySum-a.quantitySum),e.avicultureSlaughters=t.data,e.pending=!1},[avicultureGetSlaughters.pending]:e=>{e.pending=!0},[avicultureGetReports.fulfilled]:(e,{payload:t})=>{e.reports=t.data,e.pending=!1},[avicultureGetReports.pending]:e=>{e.pending=!0},[avicultureHatchingRequestsService.fulfilled]:(e,{payload:t})=>{e.avicultureHatchingRequests=t.data}},initialState$i={pending:!1,avicultureRequests:[],avicultureChickenPrice:null,avicultureHallsInfo:null,avicultureHallInspects:null,profile:null,tickets:[],reports:[]},slice$h=createSlice({name:"aviculture",initialState:initialState$i,reducers:{},extraReducers:avicultureExtraReducers}),{reducer:avicultureSlice}=slice$h,cityGetArchiveHatchingsService=createAsyncThunk("CITY_GET_ARCHIVE_HATCHINGS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("poultry_hatching/",{params:{archive:!0,role:getRoleFromUrl(),date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),cityGetHatchingInfo=createAsyncThunk("CITY_GET_HATCHING_INFO",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("/hatching-for-dashboard/?type=date-dashboard",{params:{date1:e.selectedDate1,date2:e.selectedDate2,role:getRoleFromUrl()}});return t(LOADING_END()),{data:a,status:s}}),cityGetHatchingInfoFull=createAsyncThunk("CITY_GET_HATCHING_INFO_FULL",async(e={})=>{const{age1:t=0,age2:a=0}=e,{data:s,status:n}=await axios$1.get(`/hatching-for-dashboard/?type=total-dashboard&search=filter&value=${(e==null?void 0:e.textValue)||""}&role=${getRoleFromUrl()}&age1=${t}&age2=${a}${e!=null&&e.unknown?"&unknown=true":""}${e!=null&&e.all?"&all=true":""}${e!=null&&e.tab?`&tab=${e.tab}`:""}&date1=${(e==null?void 0:e.date1)||""}&date2=${(e==null?void 0:e.date2)||""}`);return{data:s,status:n}}),cityGetHatchings=createAsyncThunk("CITY_GET_HATCHINGS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("poultry_hatching/",{params:{role:getRoleFromUrl(),date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),cityGetHatchingsByAge=createAsyncThunk("CITY_GET_HATCHINGS_BY_AGE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("poultry_hatching/",{params:{chicken_age:!0,role:getRoleFromUrl(),chicken_age1:e.selectedAge1,chicken_age2:e.selectedAge2}});return t(LOADING_END()),{data:a,status:s}}),cityGetPoultriesService=createAsyncThunk("CITY_GET_POULTRIES_SERVICE",async(e,{dispatch:t})=>{const a=getRoleFromUrl();let s={role:a};(a==="CityOperator"||a==="ProvinceOperator")&&(s={role:a,active_hatching:!0}),t(LOADING_START());const{data:n,status:i}=await axios$1.get("get-all-poultry/",{params:s});return t(LOADING_END()),{data:n,status:i}}),cityGetPoultryFarm=createAsyncThunk("CITY_GET_POULTRY_FARMS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("Poultry/?operator=CityOperator");return t(LOADING_END()),{data:a,status:s}}),cityGetProfile=createAsyncThunk("CITY_GET_PROFILE",async()=>{const{data:e,status:t}=await axios$1.get("city_operator/0/?profile");return{data:e,status:t}}),cityGetUserProfiles=createAsyncThunk("PROVINCE_GET_USER_PROFILES",async()=>{const{data:e,status:t}=await axios$1.get("system_user_profile/?city_users");return{data:e,status:t}}),getPoultryRequestsTotalQuantityService=createAsyncThunk("GET_POULTRY_REQUESTS_TOTAL_QUANTITY",async(e,{dispatch:t})=>{e=e||moment(new Date).format("YYYY-MM-DD"),t(LOADING_START());const{data:a,status:s}=await axios$1.get("total_poultry_request_quantity/",{params:{date:e}});return t(LOADING_END()),{data:a,status:s}}),getSlaughtersKillRequestService=createAsyncThunk("GET_SLAUGHTERS_KILL_REQUEST_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_request/?role=ProvinceOperator",{params:{date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),hourLimitKillRequestService=createAsyncThunk("HOUR_LIMIT_KILL_REQUEST_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.post("hour_limit/",e);return t(LOADING_END()),{data:a,status:s}}),checkRequestByCity=createAsyncThunk("REJECT_REQUEST_CITY",async e=>{const{data:t,status:a}=await axios$1.post("city_operator_check_request/",e);return{data:t,status:a}}),cityExtraReducers={[checkRequestByCity.fulfilled]:(e,{payload:t})=>{e.pending=!1},[checkRequestByCity.pending]:e=>{e.pending=!0},[cityGetProfile.fulfilled]:(e,{payload:t})=>{e.profile=t.data,e.pending=!1},[cityGetProfile.pending]:e=>{e.pending=!0},[cityGetPoultryFarm.fulfilled]:(e,{payload:t})=>{e.poultryFarms=t.data,e.pending=!1},[cityGetPoultryFarm.pending]:e=>{e.pending=!0},[cityGetUserProfiles.fulfilled]:(e,{payload:t})=>{e.cityUsers=t.data,e.pending=!1},[cityGetUserProfiles.pending]:e=>{e.pending=!0},[cityGetHatchings.fulfilled]:(e,{payload:t})=>{e.hatchings=t.data,e.pending=!1},[cityGetHatchingsByAge.fulfilled]:(e,{payload:t})=>{e.hatchings=t.data,e.pending=!1},[cityGetHatchings.pending]:e=>{e.pending=!0},[getPoultryRequestsTotalQuantityService.fulfilled]:(e,{payload:t})=>{e.poultryRequestsTotalQuantity=t.data},[hourLimitKillRequestService.fulfilled]:(e,{payload:t})=>{e.hourLimitKillRequest=t.data},[getSlaughtersKillRequestService.fulfilled]:(e,{payload:t})=>{e.getSlaughtersKillRequest=t.data},[cityGetArchiveHatchingsService.fulfilled]:(e,{payload:t})=>{e.cityGetArchiveHatchings=t.data},[cityGetPoultriesService.fulfilled]:(e,{payload:t})=>{e.cityGetPoultries=t.data.map(a=>({label:`${a.unitName} (${a.address.city.name}) (${a.user.fullname}) (${a.user.mobile}) / ${a.lastHatchingRemainQuantity} قطعه`,value:a.user.mobile,disabled:a.lastHatchingRemainQuantity}))},[cityGetHatchingInfo.fulfilled]:(e,{payload:t})=>{e.hatchingInfoWithDate=t.data},[cityGetHatchingInfoFull.fulfilled]:(e,{payload:t})=>{e.hatchingInfoFull=t.data}},cityReducers={reloadHatchings:e=>{e.hatchingAdded=!e.hatchingAdded}},initialState$h={pending:!1,modalState:!1,profile:null,cityUsers:null,hatchings:null,hatchingAdded:"false"},slice$g=createSlice({name:"city",initialState:initialState$h,extraReducers:cityExtraReducers,reducers:cityReducers}),{reducer:citySlice}=slice$g,slaughterGetCars=createAsyncThunk("SLAUGHTER_GET_CARS_SERVICE",async e=>{const t=e?{key:e.id,kill_house_key:e.killHouseKey,kill_request_key:e.killRequestKey}:{},{data:a,status:s}=await axios$1.get("kill_house_add_car/",{params:t});return{data:a,status:s}}),slaughterGetRequests=createAsyncThunk("SLAUGHTER_GET_REQUESTS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_request/",{params:{role:getRoleFromUrl(),date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetActiveRequests=createAsyncThunk("SLAUGHTER_GET_ACTIVE_REQUESTS",async(e,{dispatch:t})=>{t(LOADING_START());const a=e.isCar?"&car":"",{data:s,status:n}=await axios$1.get("province_kill_request/?role="+getRoleFromUrl()+a,{params:{date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:s,status:n}}),slaughterGetProfile=createAsyncThunk("SLAUGHTER_GET_PROFILE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_operator/0/?profile");return t(LOADING_END()),{data:a,status:s}}),slaughterGetComplaints=createAsyncThunk("SLAUGHTER_GET_COMLATIONSs",async e=>{const{data:t,status:a}=await axios$1.get("kill_house_assignment_information/?role=KillHouse");return{data:t,status:a}}),slaughterGetRegisteredComplaints=createAsyncThunk("SLAUGHTER_GET_COMLATIONS",async e=>{const{data:t,status:a}=await axios$1.get("kill_house_complaint/?role=KillHouse");return{data:t,status:a}}),slaughterGetInventoryBars=createAsyncThunk("SLAUGHTER_GET_INVENTORY_BARS",async e=>{const{data:t,status:a}=await axios$1.get("/kill_house_assignment_information/",{params:{date:e}});return{data:t,status:a}}),slaughterGetKillerKillhousesService=createAsyncThunk("SLAUGHTER_GET_KILLER_KILLHOUSES_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house/?kill_house");return t(LOADING_END()),{data:a,status:s}}),slaughterFactorsService=createAsyncThunk("SLAUGHTER_FACTORS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_request_factor/",{params:{date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),slaughterFinalFactorsService=createAsyncThunk("SLAUGHTER_FINAL_FACTORS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("province_factor_to_kill_house/",{params:{role:getRoleFromUrl(),date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetBarInfoRequestsService=createAsyncThunk("SLAUGHTER_GET_BAR_INFO_REQUESTS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_request/?operator=KillHouse",{params:{role:getRoleFromUrl(),date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetPayFactorRequestsService=createAsyncThunk("SLAUGHTER_GET_PAY_FACTOR_REQUESTS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("province_factor_to_kill_house/?role="+getRoleFromUrl(),{params:{date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetPermissionToVetService=createAsyncThunk("SLAUGHTER_GET_PERMISSION_TO_VET_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("allow_kill_house_vet/");return t(LOADING_END()),{data:a,status:s}}),slaughterGetAllocatedCarsService=createAsyncThunk("SLAUGHTER_GET_ALLOCATED_CARS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_request/?operator=KillHouse",{params:{role:getRoleFromUrl(),date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetPaiedFactorsService=createAsyncThunk("SLAUGHTER_GET_PAIED_FACTORS",async e=>{const{data:t,status:a}=await axios$1.get("kill_house_factor_province/?role="+getRoleFromUrl(),{params:{date1:e.selectedDate1,date2:e.selectedDate2}});return{data:t,status:a}}),slaughterManageBarsService=createAsyncThunk("SLAUGHTER_MANAGE_BARS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_assignment_information/",{params:{role:getRoleFromUrl(),date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetInventoryStock=createAsyncThunk("SLAUGHTER_GET_INVENTORY_STOCK",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_ware_house/",{params:{kill_house_key:e.kill_house_key,date:e.date}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetInventoryFreeBarsService=createAsyncThunk("SLAUGHTER_GET_INVENTORY_FREE_BARS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_free_bar/",{params:{date:e.selectedDate1,kill_house_key:e.kill_house_key}});return t(LOADING_END()),{data:a,status:s}}),slaughterInventoryBarsService=createAsyncThunk("SLAUGHTER_INVENTORY_BARS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("bars_for_kill_house/",{params:{type:e.type,date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetStewardsService=createAsyncThunk("SLAUGHTER_GET_STEWARDS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("steward/",{params:{role:getRoleFromUrl()}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetKillhouseStewardsService=createAsyncThunk("SLAUGHTER_GET_KILLHOUSE_STEWARDS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("steward/",{params:{kill_house_key:e.kill_house_key,date:e.date,role:getRoleFromUrl()}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetGuildsService=createAsyncThunk("SLAUGHTER_GET_GUILDS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("guilds/",{params:{role:getRoleFromUrl()}});return t(LOADING_END()),{data:a,status:s}}),slaughterManageInventoryAllocationsService=createAsyncThunk("SLAUGHTER_MANAGE_INVENTORY_ALLOCATIONS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("steward-allocation/",{params:{kill_house_key:e.kill_house_key,date:e.date}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetUpdatedInventoryStock=createAsyncThunk("SLAUGHTER_GET_UPDATED_INVENTORY_STOCK",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_ware_house/",{params:{kill_house_key:e.kill_house_key,date:e.date,state:"update"}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetKillhouseGuildsService=createAsyncThunk("SLAUGHTER_GET_KILLHOUSE_GUILDS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("guilds/",{params:{role:getRoleFromUrl(),...e}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetPoultriesService=createAsyncThunk("SLAUGHTER_GET_POULTRIES_SERVICE",async(e={},{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("get-all-poultry-for-increase-hatching/",{params:{role:getRoleFromUrl(),active_hatching:!0,...e}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetKillhousesService=createAsyncThunk("SLAUGHTERـGETـKILLHOUSESـSERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house/",{params:{role:getRoleFromUrl()}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetAggregateLoadInformationService=createAsyncThunk("SLAUGHTER_GET_AGGREGATE_LOAD_INFORMATION_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_request_aggregate_load/",{params:{role:getRoleFromUrl(),date:e.date}});return t(LOADING_END()),{data:a,status:s}}),slaughterManageInventoryAllocationForFreezingService=createAsyncThunk("SLAUGHTER_MANAGE_INVENTORY_ALLOCATIONS_FOR_FREEZING_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("cold-house-allocations/",{params:{role:e.role,date:e.date}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetOutOfProvinceSells=createAsyncThunk("SLAUGHTER_GET_OUT_OF_PROVINCE_SELLS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_free_sale_bar/",{params:{kill_house_key:e.kill_house_key,date:e.date}});return t(LOADING_END()),{data:a,status:s}}),slaughterGetPermisionState=createAsyncThunk("SLAUGHTER_GET_PERMISION_STATE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_purchase_permission/");return t(LOADING_END()),{data:a,status:s}}),slaughterGetPaymentOverviewInfo=createAsyncThunk("SLAUGHTER_GET_PAYMENT_OVERVIEW_INFO",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_wage_dashbord/");return t(LOADING_END()),{data:a,status:s}}),slaughterGetPaymentByWeightOverview=createAsyncThunk("SLAUGHTER_GET_PAYMENT_BY_WEIGHT_OVERVIREW",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get(`kill_house_wage_dashbord_in_weight/?role=${getRoleFromUrl()}`);return t(LOADING_END()),{data:a,status:s}}),slaughterGetProductsService=createAsyncThunk("SLAUGHTER_INVENTORY_GET_PRODUCTS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("roles-products/?role="+getRoleFromUrl());return t(LOADING_END()),{data:a,status:s}}),slaughterGetExclusiveKillersService=createAsyncThunk("SLAUGHTER_GET_EXCLUSIVE_KILLERS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house/?exclusive-killers-free-bar=true");return t(LOADING_END()),{data:a,status:s}}),getApprovedPriceState=createAsyncThunk("GET_APPROVED_PRICE_STATE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("approved-price/");return t(LOADING_END()),{data:a,status:s}}),getKillhouseApprovedPriceState=createAsyncThunk("GET_KILLHOUSE_APPROVED_PRICE_STATE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("broadcast-price/");return t(LOADING_END()),{data:a,status:s}});createAsyncThunk("SLAUGHTER_GET_DISTRIBUTION_INFO",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill-house-distribution-info/",{params:{role:getRoleFromUrl()}});return t(LOADING_END()),{data:a,status:s}});const slaughterGetVBroadcastInfo=createAsyncThunk("SLAUGHTER_GET_BROARDCAST_INFO",async(e,{dispatch:t})=>{const{data:a,status:s}=await axios$1.get("kill-house-sales-info-dashboard/",{params:{role:getRoleFromUrl()}});return{data:a,status:s}}),slaughterGetBarsInfo=createAsyncThunk("SLAUGHTER_GET_BARS_INFO",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("bars_for_kill_house_dashboard/",{params:{role:getRoleFromUrl()}});return t(LOADING_END()),{data:a,status:s}}),fetchSlaughterBroadcastAndProducts=createAsyncThunk("SLAUGHTER_FETCH_BROADCAST_AND_PRODUCTS",async(e,{dispatch:t})=>{try{t(LOADING_START());const[a,s]=await Promise.all([axios$1.get("kill-house-sales-info-dashboard/",{params:{role:getRoleFromUrl()}}),axios$1.get("roles-products/?role="+getRoleFromUrl())]);return t(LOADING_END()),{broadcastData:a.data,productsData:s.data}}catch(a){throw t(LOADING_END()),a}}),slaughterExtraReducer={[slaughterGetCars.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.slaughterHouseCars=t.data},[slaughterGetProfile.fulfilled]:(e,{payload:t})=>{var a;e.profile=t.data,e.inventorySelectedKillHouse=(a=t.data.killHouse[0])==null?void 0:a.key,e.pending=!1},[slaughterGetCars.pending]:e=>{e.pending=!0},[slaughterGetRequests.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.slaughterRequests=t.data},[slaughterGetRequests.pending]:e=>{e.pending=!0},[slaughterGetActiveRequests.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.slaughterActiveRequests=t.data},[slaughterGetKillhousesService.fulfilled]:(e,{payload:t})=>{e.slaughterGetKillhouses=t.data},[slaughterGetAggregateLoadInformationService.fulfilled]:(e,{payload:t})=>{e.slaughterGetAggregateLoadInformation=t.data},[slaughterGetActiveRequests.pending]:e=>{e.pending=!0},[slaughterGetComplaints.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.slaughterHouseComplaints=t.data},[slaughterGetComplaints.pending]:e=>{e.pending=!0},[slaughterGetRegisteredComplaints.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.slaughterHouseRegisteredComplaints=t.data},[slaughterGetRegisteredComplaints.pending]:e=>{e.pending=!0},[slaughterGetInventoryBars.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.slaughterHouseInventoryBars=t.data},[slaughterGetInventoryBars.pending]:e=>{e.pending=!0},[slaughterGetKillerKillhousesService.fulfilled]:(e,{payload:t})=>{e.slaughterGetKillerKillhouses=t.data},[slaughterFactorsService.fulfilled]:(e,{payload:t})=>{e.slaughterFactors=t.data},[slaughterFinalFactorsService.fulfilled]:(e,{payload:t})=>{e.slaughterFinalFactors=t.data},[slaughterGetBarInfoRequestsService.fulfilled]:(e,{payload:t})=>{e.slaughterGetBarInfoRequests=t.data},[slaughterGetPayFactorRequestsService.fulfilled]:(e,{payload:t})=>{e.slaughterGetPayFactorRequests=t.data},[slaughterGetPermissionToVetService.fulfilled]:(e,{payload:t})=>{e.slaughterGetPermissionToVet=t.data},[slaughterGetAllocatedCarsService.fulfilled]:(e,{payload:t})=>{e.slaughterGetAllocatedCars=t.data},[slaughterGetPaiedFactorsService.fulfilled]:(e,{payload:t})=>{e.slaughterGetPaiedFactors=t.data},[slaughterManageBarsService.fulfilled]:(e,{payload:t})=>{e.slaughterManageBars=t.data},[slaughterGetInventoryStock.fulfilled]:(e,{payload:t})=>{e.slaughterGetInventoryStockData=t.data},[slaughterGetInventoryFreeBarsService.fulfilled]:(e,{payload:t})=>{e.slaughterGetInventoryFreeBars=t.data},[slaughterInventoryBarsService.fulfilled]:(e,{payload:t})=>{e.slaughterInventoryBars=t.data},[fetchSlaughterBroadcastAndProducts.fulfilled]:(e,{payload:t})=>{e.slaughterProducts=t.productsData,e.distributionInfo=t.broadcastData},[slaughterGetProductsService.fulfilled]:(e,{payload:t})=>{e.slaughterProducts=t.data},[slaughterGetVBroadcastInfo.fulfilled]:(e,{payload:t})=>{e.distributionInfo=t.data},[getKillhouseApprovedPriceState.fulfilled]:(e,{payload:t})=>{e.priceInfo=t.data},[slaughterGetStewardsService.fulfilled]:(e,{payload:t})=>{e.slaughterGetStewards=t.data.map(a=>({label:`${a.guilds.guildsName} (${a.guilds.user.city}) / ${a.guilds.user.fullname} (${a.guilds.user.mobile})`,value:a.key}))},[slaughterGetKillhouseStewardsService.fulfilled]:(e,{payload:t})=>{e.slaughterGetKillhouseStewards=t.data},[slaughterGetUpdatedInventoryStock.fulfilled]:(e,{payload:t})=>{e.slaughterUpdatedInventoryStock=t.data},[slaughterManageInventoryAllocationsService.fulfilled]:(e,{payload:t})=>{e.slaughterManageInventoryAllocations=t.data},[slaughterManageInventoryAllocationForFreezingService.fulfilled]:(e,{payload:t})=>{e.slaughterManageInventoryAllocationsForFreezing=t.data},[slaughterGetGuildsService.fulfilled]:(e,{payload:t})=>{e.slaughterGetGuilds=t.data.map(a=>({label:`${a.guildsName} (${a.user.city}) / ${a.user.fullname} (${a.user.mobile})`,value:a.key}))},[slaughterGetKillhouseStewardsService.fulfilled]:(e,{payload:t})=>{e.slaughterGetKillhouseStewards=t.data},[slaughterGetOutOfProvinceSells.fulfilled]:(e,{payload:t})=>{e.slaughterOutOfProvinceSellsState=t.data},[slaughterGetKillhouseGuildsService.fulfilled]:(e,{payload:t})=>{e.slaughterGetKillhouseGuilds=t.data},[slaughterGetPoultriesService.fulfilled]:(e,{payload:t})=>{e.slaughterGetPoultries=t.data},[slaughterGetPermisionState.fulfilled]:(e,{payload:t})=>{var a,s;e.slaughterPermissionState=(a=t.data)==null?void 0:a.permission,e.slaughterExclusiveState=(s=t.data)==null?void 0:s.exclusive},[slaughterGetPaymentOverviewInfo.fulfilled]:(e,{payload:t})=>{e.slaughterPaymentOverview=t.data},[slaughterGetPaymentByWeightOverview.fulfilled]:(e,{payload:t})=>{e.slaughterPaymentByWeightOverview=t.data}},initialState$g={pending:!1,modalState:!1,slaughterGetRequests:null,slaughterGetActiveRequests:null,slaughterHouseCars:null,slaughterHouseComplaints:null,slaughterHouseRegisteredComplaints:null,profile:null,inventorySelectedKillHouse:null},slice$f=createSlice({name:"slaughter",initialState:initialState$g,extraReducers:slaughterExtraReducer,reducers:{setInventorySelectedKillHouse:(e,t)=>{e.inventorySelectedKillHouse=t.payload}}}),{reducer:slaughterSlice}=slice$f,provinceGetFieldOfWorks=createAsyncThunk("PROVINCE_GET_FIELD_OF_WORKS",async()=>{const{data:e,status:t}=await axios$1.get("area-activity/");return{data:e,status:t}}),provinceGetCasesOverview=createAsyncThunk("GET_PROVINCE_OVERVIEW_CASES",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("general-statistics-dashboard-for-cases/",{params:{date1:e.date1,date2:e.date2}});return t(LOADING_END()),{data:a,status:s}}),getCitiesService=createAsyncThunk("GET_CITIES_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("city_operator/");return t(LOADING_END()),{data:a,status:s}}),getGuildsSettingsService=createAsyncThunk("GET_GUILDS_SETTINGS_SERVICE",async e=>{const{data:t,status:a}=await axios$1.get("kill_house_choose_steward_guilds/",{params:{kill_house_key:e.kill_house_key}});return{data:t,status:a}}),getManagePoultriesService=createAsyncThunk("GET_MANAGE_POULTRIES_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("total_poultry",{params:{page:e.page,page_size:e.pageSize}});return t(LOADING_END()),{data:a,status:s}}),getPolicyProvinceFeeService=createAsyncThunk("GET_POLICY_PROVINCE_FEE_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("share/");return t(LOADING_END()),{data:a,status:s}}),getProvinceBuyerStewardAllocationService=createAsyncThunk("GET_PROVINCE_BUYER_STEWARD_ALLOCATION_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("automatic-steward-allocation/",{params:{kill_house_key:e.killHouseKey,date:e.date,role:getRoleFromUrl()}});return t(LOADING_END()),{data:a,status:s}}),getProvinceBuyersAllocationsService=createAsyncThunk("GET_PROVINCE_BUYERS_ALLOCATIONS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_ware_house_total_report_daily_broad_cast_in_detail",{params:{date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),getProvinceFeeTotalOverviewService=createAsyncThunk("GET_PROVINCE_FEE_TOTAL_OVERVIEW_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("reporting_province_kill_request_wage/");return t(LOADING_END()),{data:a,status:s}}),getProvinceNewRequests=createAsyncThunk("GET_PROVINCE_NEW_REQUESTS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("city_operator_check_request",{params:{state:"new",date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),getProvinceStewardAllocationsService=createAsyncThunk("GET_PROVINCE_STEWARD_ALLOCATIONS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("steward_ware_house_total_report_daily_broad_cast_in_detail",{params:{date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),manageProcessBuyReqService=createAsyncThunk("MANAGE_PROCESS_BUY_REQ_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_purchase_info/");return t(LOADING_END()),{data:a,status:s}}),provinceCasesGetTableDetails=createAsyncThunk("PROVINCE_CASES_GET_TABLE_DETAILS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("detail_of_killing",{params:{date1:e.selectedDate1,date2:e.selectedDate2,role:getRoleFromUrl()}});return t(LOADING_END()),{data:a,status:s}}),provinceChainsGetCompanies=createAsyncThunk("PROVINCE_CHAINS_GET_COMPANIES",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("chain-company/");return t(LOADING_END()),{data:a,status:s}}),provinceFreeSaleBuyers=createAsyncThunk("PROVINCE_FREE_SALES_GET_BUYERS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("out-province-poultry-request-buyers/");return t(LOADING_END()),{data:a,status:s}}),provinceGetActiveRequestsService=createAsyncThunk("PROVINCE_GET_ACTIVE_REQUESTS_SERVICE",async()=>{const{data:e,status:t}=await axios$1.get("city_operator_check_request",{params:{state:"all"}});return{data:e,status:t}}),provinceGetAllRequests=createAsyncThunk("PROVINCE_GET_ACTIVE_REQUESTS",async(e,{dispatch:t})=>{t(LOADING_START()),e=e||moment(new Date).format("YYYY-MM-DD");const{data:a,status:s}=await axios$1.get("city_operator_check_request",{params:{state:"waiting",date:e}});return t(LOADING_END()),{data:a,status:s}}),provinceGetAllocatedRequestsService=createAsyncThunk("PROVINCE_GET_ALLOCATED_REQUESTS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const a={role:getRoleFromUrl(),date1:e.selectedDate1,date2:e.selectedDate2,filter:"search",value:e.textValue};e.hasDocumentState?a.allocated_car_state=!0:a.allocations=!0;const{data:s,status:n}=await axios$1.get("province_kill_request/",{params:a});return t(LOADING_END()),{data:s,status:n}}),provinceUpdateAllocatedRequestService=createAsyncThunk("PROVINCE_UPDATE_ALLOCATED_REQUEST_SERVICE",async(e,{dispatch:t})=>{try{t(LOADING_START());const{data:a,status:s}=await axios$1.put("province_kill_request/0/",e);return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data.result}}}),provinceGetArchiveAutoAllocationsService=createAsyncThunk("PROVINCE_GET_ARCHIVE_AUTO_ALLOCATIONS_SERVICE",async(e,{dispatch:t})=>{try{t(LOADING_START());const{data:a,status:s}=await axios$1.get("automatic_allocation/",{params:{state:"final_registration",date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data.result}}}),provinceGetAutoAllocationsService=createAsyncThunk("PROVINCE_GET_AUTO_ALLOCATIONS_SERVICE",async(e,{dispatch:t})=>{try{t(LOADING_START());const{data:a,status:s}=await axios$1.get("automatic_allocation/",{params:{state:"temporary"}});return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data.result}}}),provinceGetBuyersService=createAsyncThunk("PROVINCE_GET_BUYERS_SERVICE",async(e,{dispatch:t})=>{try{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house/",{params:e});return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data.result}}}),provinceGetCars=createAsyncThunk("PROVINCE_GET_CARS",async()=>{const{data:e,status:t}=await axios$1.get("kill_house_driver/",{params:{role:getRoleFromUrl()}});return{data:e,status:t}}),provinceGetCaseStatusService=createAsyncThunk("PROVINCE_GET_CASE_STATUS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("case_status/",{params:{date:e,role:getRoleFromUrl()}});return t(LOADING_END()),{data:a,status:s}}),provinceGetCitiesService=createAsyncThunk("PROVINCE_GET_CITIES_SERVICE",async()=>{const{data:e,status:t}=await axios$1.get("province_cities/");return{data:e,status:t}}),provinceGetDeletedAllocatedRequestsService=createAsyncThunk("PROVINCE_GET_DELETED_ALLOCATED_REQUESTS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("province_kill_request/?allocations&deleted_object",{params:{role:getRoleFromUrl(),date1:e.selectedDate1,date2:e.selectedDate2,filter:"search",value:e.textValue}});return t(LOADING_END()),{data:a,status:s}}),provinceGetFilesStateService=createAsyncThunk("PROVINCE_GET_FILES_STATE_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("general_case_status",{params:{date1:e.date1,date2:e.date2,role:getRoleFromUrl()}});return t(LOADING_END()),{data:a,status:s}}),provinceGetFreeSalesRequestsService=createAsyncThunk("PROVINCE_GET_FREE_SALES_REQUESTS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START()),e=e||moment(new Date).format("YYYY-MM-DD");const{data:a,status:s}=await axios$1.get("out-province-poultry-requests",{params:{role:getRoleFromUrl(),date1:e.selectedDate1,date2:e.selectedDate2,out:""}});return t(LOADING_END()),{data:a,status:s}}),provinceGetGuildsService=createAsyncThunk("PROVINCE_GET_GUILD_SERVICE",async(e,{dispatch:t})=>{try{t(LOADING_START());const{data:a,status:s}=await axios$1.get("guilds/",{params:{role:getRoleFromUrl()}});return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data.result}}}),provinceGetGuildsNumbersNamesService=createAsyncThunk("PROVINCE_GET_GUILDS_NUMBERS_NAMES_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START()),e=e||moment(new Date).format("YYYY-MM-DD");const{data:a,status:s}=await axios$1.get("guilds/",{params:{type:"kill_house_percentage",percentage_key:e.key}});return t(LOADING_END()),{data:a,status:s}}),provinceGetKillhousesService=createAsyncThunk("PROVINCE_GET_KILLHOUSES_SERVICE",async(e,{dispatch:t})=>{try{t(LOADING_START());const{data:a,status:s}=await axios$1.get("allow_direct_buying/");return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data.result}}}),provinceGetKillhousesGuildsService=createAsyncThunk("PROVINCE_GET_KILLHOUSES_GUILDS_SERVICE",async(e,{dispatch:t})=>{try{t(LOADING_START());const{data:a,status:s}=await axios$1.get("allow_register_guilds/");return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data.result}}}),provinceGetManageUsersService=createAsyncThunk("PROVINCE_GET_MANAGE_USERS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("system_user_profile/",{params:{users_base_info:!0}});return t(LOADING_END()),{data:a,status:s}}),provinceGetOnlyKillHousesService=createAsyncThunk("PROVINCE_GET_ONLY_KILLHOUSES_SERVICE",async e=>{const{data:t,status:a}=await axios$1.get(`kill_house/?${e}`);return{data:t,status:a}}),provinceGetPaymentByWeightOverview=createAsyncThunk("PROVINCE_GET_PAYMENT_BY_WEIGHT_OVERVIREW",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("total-wage-information/",{params:{...e}});return t(LOADING_END()),{data:a,status:s}}),parentConpanyGetPaymentByWeightOverview=createAsyncThunk("PARENT_COMPANY_GET_PAYMENT_BY_WEIGHT_OVERVIREW",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get(e+`parent-company-total-wage-information/?role=${getRoleFromUrl()}`);return t(LOADING_END()),{data:a,status:s}}),provinceGetPolicyAvicultureCommitService=createAsyncThunk("PROVINCE_GET_POLICY_AVICULTURE_COMMIT_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("free_sale_within_province/");return t(LOADING_END()),{data:a,status:s}}),provinceGetPoultriesService=createAsyncThunk("PROVINCE_GET_POULTRIES_SERVICE",async(e,{dispatch:t})=>{try{t(LOADING_START());const{data:a,status:s}=await axios$1.get("Poultry/?all");return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data.result}}}),provinceGetPricing=createAsyncThunk("PROVINCE_GET_PRICING",async()=>{const{data:e,status:t}=await axios$1.get("chicken-commission-prices/");return{data:e,status:t}}),provinceGetProducts=createAsyncThunk("PROVINCE_GET_PRODUCTS",async()=>{const{data:e,status:t}=await axios$1.get("additional-products/");return{data:e,status:t}}),provinceGetProfile=createAsyncThunk("PROVINCE_GET_PROFILE",async()=>{const{data:e,status:t}=await axios$1.get("province_operator/0/?profile");return{data:e,status:t}}),provinceGetRejectedRequests=createAsyncThunk("PROVINCE_GET_REJECTED_REQUESTS",async()=>{const{data:e,status:t}=await axios$1.get("rejected_requests");return{data:e,status:t}}),provinceGetSlaughterSurveillanceService=createAsyncThunk("PROVINCE_GET_SLAUGHTER_SERVEILLANCE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("comprehensive_report_of_slaughterhouse",{params:{date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),provinceGetSlaughterhousesQuotaService=createAsyncThunk("PROVINCE_GET_SLAUGHTERHOUSES_QUOTA_SERVICE",async(e,{dispatch:t})=>{try{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_percent/",{params:e});return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data.result}}}),provinceGetSmsLincenseService=createAsyncThunk("PROVINCE_GET_SMS_LINCENSE_SERVICE",async(e,{dispatch:t})=>{try{t(LOADING_START());const{data:a,status:s}=await axios$1.get("sms_license/");return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data}}}),provinceGetStewardsService=createAsyncThunk("PROVINCE_GET_STEWARDS_SERVICE",async(e,{dispatch:t})=>{try{t(LOADING_START());const{data:a,status:s}=await axios$1.get("steward/",{params:{...e,role:getRoleFromUrl()}});return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data.result}}}),provinceGetTotalReportAgentShareService=createAsyncThunk("PROVINCE_GET_TOTAL_REPORT_AGENT_SHARE_SERVICE",async(e,{dispatch:t})=>{try{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_total_report_province_kill_requests/",{params:e});return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data.result}}}),provinceGetUserByKey=createAsyncThunk("PROVINCE_CHECK_USER_EXISTENCE",async e=>{const{data:t,status:a}=await axios$1.get("system_user_profile/0/?userprofile_key="+e);return{data:t,status:a}}),provinceGetUserProfiles=createAsyncThunk("PROVINCE_GET_USER_PROFILES",async()=>{const{data:e,status:t}=await axios$1.get("system_user_profile/?users_info");return{data:e,status:t}}),provincePaymentGetKillersOfKillhousesInfo=createAsyncThunk("PROVINCE_GET_KILLERS_OF_KILLHOUSES_INFO",async(e,{dispatch:t})=>{try{t(LOADING_START());const{data:a,status:s}=await axios$1.get("total-wage-exclusive-killer-information/",{params:{...e}});return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data}}}),provincePolicyGetWeightRange=createAsyncThunk("PROVINCE_POLICY_GET_WEIGHT_RANGE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("management_hatching_age_range/");return t(LOADING_END()),{data:a,status:s}}),provincePolicySubmitWeightRange=createAsyncThunk("PROVINCE_POLICY_SUBMIT_WEIGHT_RANGE",async(e,{dispatch:t})=>{t(LOADING_START());try{const{data:a,status:s}=await axios$1.post("management_hatching_age_range/",e);return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data.result}}}),provincePolicyEditWeightRange=createAsyncThunk("PROVINCE_POLICY_EDIT_WEIGHT_RANGE",async(e,{dispatch:t})=>{t(LOADING_START());try{const{data:a,status:s}=await axios$1.put(`management_hatching_age_range/${e.id}/`,e);return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data.result}}}),provincePolicyDeleteWeightRange=createAsyncThunk("PROVINCE_DELETE_WEIGHT_RANGE",async(e,{dispatch:t})=>{t(LOADING_START());try{const{data:a,status:s}=await axios$1.delete(`management_hatching_age_range/${e}/`);return t(LOADING_END()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data.result}}}),provinceGetTypeActivity=createAsyncThunk("PROVINCE_GET_TYPE_ACTIVITY",async()=>{const{data:e,status:t}=await axios$1.get("type-activity/");return{data:e,status:t}}),totalReportDailyBroadCastService=createAsyncThunk("TOTAL_REPORT_DAILY_BROADCAST_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_ware_house_total_report_daily_broad_cast",{params:{date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),totalReportDailyStewardBroadCastService=createAsyncThunk("TOTAL_REPORT_DAILY_STEWARD_BROADCAST_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("steward_ware_house_total_report_daily_broad_cast",{params:{date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),getKillhouseRemainWeight=createAsyncThunk("GET_KILLHOUSE_REMAIN_WEIGHT",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("/api/killhouse-remain-weight");return t(LOADING_END()),{data:a,status:s}}),provinceExtraReducers={[getProvinceNewRequests.fulfilled]:(e,{payload:t})=>{e.provinceNewRequests=t.data,e.pending=!1},[provinceGetProfile.fulfilled]:(e,{payload:t})=>{e.profile=t.data,e.pending=!1},[getProvinceNewRequests.pending]:e=>{e.pending=!0},[provinceGetAllRequests.fulfilled]:(e,{payload:t})=>{e.provinceAllRequests=t.data,e.pending=!1},[provinceGetAllRequests.pending]:e=>{e.pending=!0},[provinceGetPricing.fulfilled]:(e,{payload:t})=>{e.provincePrices=t.data,e.pending=!1},[provinceGetPricing.pending]:e=>{e.pending=!0},[provinceGetRejectedRequests.fulfilled]:(e,{payload:t})=>{e.provinceRejectedRequests=t.data,e.pending=!1},[provinceGetRejectedRequests.pending]:e=>{e.pending=!0},[provinceGetCars.fulfilled]:(e,{payload:t})=>{e.provinceCars=t.data,e.pending=!1},[getProvinceBuyersAllocationsService.fulfilled]:(e,{payload:t})=>{e.getProvinceBuyersAllocations=t.data,e.pending=!1},[getProvinceStewardAllocationsService.fulfilled]:(e,{payload:t})=>{e.getProvinceStewardAllocations=t.data,e.pending=!1},[provinceGetCars.pending]:e=>{e.pending=!0},[provinceGetUserProfiles.fulfilled]:(e,{payload:t})=>{e.provinceUsers=t.data,e.pending=!1},[provinceGetUserProfiles.pending]:e=>{e.pending=!0},[provinceGetUserByKey.fulfilled]:(e,{payload:t})=>{e.provinceUserInfo=t.data,e.pending=!1},[provinceGetUserByKey.pending]:e=>{e.pending=!0},[getPoultryRequestsTotalQuantityService.fulfilled]:(e,{payload:t})=>{e.poultryRequestsTotalQuantity=t.data},[provinceGetSmsLincenseService.fulfilled]:(e,{payload:t})=>{e.provinceGetSmsLincense=t.data},[provinceGetActiveRequestsService.fulfilled]:(e,{payload:t})=>{e.provinceGetActiveRequests=t.data},[provinceGetCaseStatusService.fulfilled]:(e,{payload:t})=>{e.provinceGetCaseStatus=t.data},[provinceGetCitiesService.fulfilled]:(e,{payload:t})=>{e.provinceGetCities=t.data},[provinceGetTypeActivity.fulfilled]:(e,{payload:t})=>{e.provinceTypeActivity=t.data},[provinceGetFieldOfWorks.fulfilled]:(e,{payload:t})=>{e.provinceGetAreActivity=t.data},[provinceGetOnlyKillHousesService.fulfilled]:(e,{payload:t})=>{e.provinceGetOnlyKillHouses=t.data},[provinceGetPoultriesService.fulfilled]:(e,{payload:t})=>{e.provinceGetPoultries=t.data},[provinceGetFreeSalesRequestsService.fulfilled]:(e,{payload:t})=>{e.provinceGetFreeSalesRequests=t.data},[provinceGetSlaughterhousesQuotaService.fulfilled]:(e,{payload:t})=>{e.provinceGetSlaughterhousesQuota=t.data},[provinceGetFilesStateService.fulfilled]:(e,{payload:t})=>{e.provinceGetFilesState=t.data},[provinceGetAutoAllocationsService.fulfilled]:(e,{payload:t})=>{e.provinceGetAutoAllocations=t.data},[provinceGetBuyersService.fulfilled]:(e,{payload:t})=>{e.provinceGetBuyersOptions=t.data.map(a=>({label:a.name,value:a.key})),e.provinceGetBuyers=t.data},[provinceGetAllocatedRequestsService.fulfilled]:(e,{payload:t})=>{e.provinceGetAllocatedRequests=t.data},[provinceGetDeletedAllocatedRequestsService.fulfilled]:(e,{payload:t})=>{e.provinceGetDeletedAllocatedRequests=t.data},[provinceGetArchiveAutoAllocationsService.fulfilled]:(e,{payload:t})=>{e.provinceGetArchiveAutoAllocations=t.data},[provinceGetManageUsersService.fulfilled]:(e,{payload:t})=>{e.provinceGetManageUsers=t.data},[getGuildsSettingsService.fulfilled]:(e,{payload:t})=>{e.getGuildsSettings=t.data},[getManagePoultriesService.fulfilled]:(e,{payload:t})=>{e.getManagePoultries=t.data},[provinceGetKillhousesService.fulfilled]:(e,{payload:t})=>{e.provinceGetKillhouses=t.data},[totalReportDailyBroadCastService.fulfilled]:(e,{payload:t})=>{e.totalReportDailyBroadCast=t.data},[totalReportDailyStewardBroadCastService.fulfilled]:(e,{payload:t})=>{e.totalReportStewardDailyBroadCast=t.data},[provinceGetKillhousesGuildsService.fulfilled]:(e,{payload:t})=>{e.provinceGetKillhousesGuilds=t.data},[provinceGetGuildsNumbersNamesService.fulfilled]:(e,{payload:t})=>{e.provinceGetGuildsNumbersNames=t.data},[getPolicyProvinceFeeService.fulfilled]:(e,{payload:t})=>{e.getPolicyProvinceFee=t.data},[getProvinceFeeTotalOverviewService.fulfilled]:(e,{payload:t})=>{e.getProvinceFeeTotalOverview=t.data},[manageProcessBuyReqService.fulfilled]:(e,{payload:t})=>{e.manageProcessBuyReq=t.data},[provinceGetTotalReportAgentShareService.fulfilled]:(e,{payload:t})=>{e.provinceGetTotalReportAgentShare=t.data},[provinceGetProducts.fulfilled]:(e,{payload:t})=>{e.provinceProductList=t.data},[provinceGetPolicyAvicultureCommitService.fulfilled]:(e,{payload:t})=>{e.provinceGetPolicyAvicultureCommit=t.data},[getProvinceBuyerStewardAllocationService.fulfilled]:(e,{payload:t})=>{e.getProvinceBuyerStewardAllocation=t.data},[provinceCasesGetTableDetails.fulfilled]:(e,{payload:t})=>{e.casesTableDetails=t.data},[provinceGetSlaughterSurveillanceService.fulfilled]:(e,{payload:t})=>{e.slaughterSurveillance=t.data},[provinceGetStewardsService.fulfilled]:(e,{payload:t})=>{e.provinceGetStewards=t.data,e.provinceGetStewardsOptions=t.data.map(a=>({label:`${a.guilds.guildsName}/مالک ${a.guilds.user.fullname}/${a.guilds.user.mobile}`,value:a.key}))},[getCitiesService.fulfilled]:(e,{payload:t})=>{e.getCities=t.data,e.getCitiesOptions=t.data.map(a=>({label:`${a.unitName} (${a.address.city.name})`,value:a.unitName}))},[provinceGetGuildsService.fulfilled]:(e,{payload:t})=>{var a;e.provinceGetGuildsOptions=(a=t==null?void 0:t.data)==null?void 0:a.map(s=>({label:`${s.guildsName} (${s.user.mobile})`,value:s.key})),e.provinceGetGuilds=t==null?void 0:t.data},[provinceGetCasesOverview.fulfilled]:(e,{payload:t})=>{e.casesOverview=t.data},[provinceChainsGetCompanies.fulfilled]:(e,{payload:t})=>{e.chainCompanies=t.data},[provinceGetPaymentByWeightOverview.fulfilled]:(e,{payload:t})=>{e.provincePaymentByWeightOverview=t.data},[parentConpanyGetPaymentByWeightOverview.fulfilled]:(e,{payload:t})=>{e.parentCompanyPaymentByWeightOverview=t.data},[provinceFreeSaleBuyers.fulfilled]:(e,{payload:t})=>{e.provinceFreeSaleAllBuyers=t.data},[provincePolicyGetWeightRange.fulfilled]:(e,{payload:t})=>{var a;e.weightRange=(a=t.data)==null?void 0:a.map(s=>{const{fromAge:n,toAge:i,fromWeight:o,toWeight:u}=s;return{fromAge:n,toAge:i,fromWeight:o,toWeight:u}})},[provincePaymentGetKillersOfKillhousesInfo.fulfilled]:(e,{payload:t})=>{e.provincePaymentKillersOfKillhouses=t.data.wageInfo},[getKillhouseRemainWeight.fulfilled]:(e,{payload:t})=>{e.killhouseRemainWeight=t.data}},initialState$f={pending:!1,provinceNewRequests:null,provinceAllRequests:null,provincePrices:null,provinceUsers:null,provinceUserInfo:null,profile:null,provinceCars:null,killhouseRemainWeight:null},slice$e=createSlice({name:"province",initialState:initialState$f,extraReducers:provinceExtraReducers,reducers:{}}),{reducer:provinceSlice}=slice$e,getFileProcess=createAsyncThunk("GET_FILE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get(`/Poultry_Request/${e}/`);return t(LOADING_END()),{data:a,status:s}}),getFileProcessOther=createAsyncThunk("GET_FILE_OTHER",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("process/?id="+e+`&role=${getRoleFromUrl()}`);return t(LOADING_END()),{data:a,status:s}}),getSlaughterHousesRequest=createAsyncThunk("GET_SLAUGHTER_HOUSES_REQUEST",async e=>{const{data:t,status:a}=await axios$1.get("/kill_request",{params:e});return{data:t,status:a}}),getAllocationInformation=createAsyncThunk("GET_ALLOCATION_INFORMATION",async e=>{const{data:t,status:a}=await axios$1.get("province_check_operator_request/",{params:{...e,role:getRoleFromUrl()}});return{data:t,status:a}}),provinceDoAllocation=createAsyncThunk("PROVINCE_DO_ALLOCATION",async(e,{dispatch:t})=>{try{const{data:a,status:s}=await axios$1.post("province_kill_request/",e);return t(LOADING_START()),{data:a,status:s}}catch(a){return t(LOADING_END()),{error:a.response.data.result}}}),getAcceptedSlaughterRequest=createAsyncThunk("GET_ACCEPTED_SLAUGHTER_REQUEST",async({id:e})=>{const{data:t,status:a}=await axios$1.get("province_kill_request",{params:{id:e,role:getRoleFromUrl()}});return{data:t,status:a}}),getMonthlyPercent=createAsyncThunk("GET_MONTHLY_PERCENT",async e=>{const{data:t,status:a}=await axios$1.get("monthly_percent/");return{data:t,status:a}}),poultryRequestIndexWeightService=createAsyncThunk("POULTRY_REQUEST_INDEX_WEIGHT_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("/poultry_request_index_weight/");return t(LOADING_END()),{data:a,status:s}}),fileExtraReducers={[getFileProcess.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.file=t.data},[getFileProcess.pending]:e=>{e.pending=!0},[getFileProcessOther.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.file=t.data},[getFileProcessOther.pending]:e=>{e.pending=!0},[getAcceptedSlaughterRequest.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.acceptedSlaughterRequest=t.data},[getAcceptedSlaughterRequest.pending]:e=>{e.pending=!0},[getSlaughterHousesRequest.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.slaughterHousesRequest=t.data},[getSlaughterHousesRequest.pending]:e=>{e.pending=!0},[getAllocationInformation.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.allocationInformation=t.data},[getAllocationInformation.pending]:e=>{e.pending=!0},[provinceDoAllocation.fulfilled]:(e,{payload:t})=>{e.pending=!1},[provinceDoAllocation.pending]:e=>{e.pending=!0},[getMonthlyPercent.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.monthlyData=t.data},[poultryRequestIndexWeightService.fulfilled]:(e,{payload:t})=>{e.poultryRequestIndexWeight=t.data},[getMonthlyPercent.pending]:e=>{e.pending=!0}},fileReducers={cleanFile:(e,t)=>{e.file=null},CHANGE_SELECTED_ROLES:(e,t)=>{e.selectedRoles=t.payload}},initialState$e={pending:!1,file:null,slaughterHousesRequest:[],allocationInformation:null,acceptedSlaughterRequest:null,selectedRoles:[]},slice$d=createSlice({name:"file",initialState:initialState$e,extraReducers:fileExtraReducers,reducers:fileReducers}),{reducer:fileSlice}=slice$d,{cleanFile}=slice$d.actions,vetFarmGetAllocatedService=createAsyncThunk("VET_FARM_GET_ALLOCATED_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const a=`?role=${getRoleFromUrl()}&check`,{data:s,status:n}=await axios$1.get(`Poultry_Request/${a}`,{params:{date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:s,status:n}}),vetFarmGetBarsOverview=createAsyncThunk("VET_FARM_GET_OVERVIEW_BARS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("dashboard_detail_of_killing",{params:{date1:e.selectedDate1,date2:e.selectedDate2,role:getRoleFromUrl(),search:"filter",value:e.textValue,without_quarantine_code_state:e.hasDocumentState}});return t(LOADING_END()),{data:a,status:s}}),parentCompanyGetBarsOverview=createAsyncThunk("PARENT_COMPANY_GET_OVERVIEW_BARS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get(`${e.province}parent_company_dashboard_detail_of_killing`,{params:{date1:e.selectedDate1,date2:e.selectedDate2,role:getRoleFromUrl(),search:"filter",value:e.textValue,without_quarantine_code_state:e.hasDocumentState}});return t(LOADING_END()),{data:a,status:s}}),vetFarmGetFinishedBarsOverview=createAsyncThunk("VET_FARM_GET_OVERVIEW_BARS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("dashboard_detail_of_killing",{params:{date1:e.selectedDate1,date2:e.selectedDate2,role:getRoleFromUrl(),search:"filter",value:e.textValue,type:"assignment",without_bar_document:e.hasDocumentState}});return t(LOADING_END()),{data:a,status:s}}),vetFarmGetDeletedBarsService=createAsyncThunk("VET_FARM_GET_DELETED_BARS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("Poultry_Request/?check&deleted_requests",{params:{role:getRoleFromUrl(),date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),getVetFarms=createAsyncThunk("VET_GET_VET_FARMS",async()=>{const{data:e,status:t}=await axios$1.get("vet_farm");return{data:e,status:t}}),getVetFarmInspectionHistory=createAsyncThunk("VET_GET_VET_FARM_INSPECTION_HISTORY",async e=>{const{data:t,status:a}=await axios$1.get("vet_farm_inspection/?key="+e);return{data:t,status:a}}),vetFarmGetOutOfProvinceRequests=createAsyncThunk("VET_FARM_GET_OUT_OF_PROVINCE_REQUESTS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("temporary-out-province-poultry-requests",{params:{role:getRoleFromUrl(),date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),vatFarmGetProfile=createAsyncThunk("VET_FARM_GET_PROFILE",async()=>{const{data:e,status:t}=await axios$1.get("vet/0/?profile");return{data:e,status:t}}),vetFarmExtraReducers={[getVetFarms.fulfilled]:(e,{payload:t})=>{e.vetFarms=t.data,e.pending=!1},[getVetFarms.pending]:e=>{e.pending=!0},[getVetFarmInspectionHistory.fulfilled]:(e,{payload:t})=>{e.vetFarmInspectionHistory=t.data,e.pending=!1},[getVetFarmInspectionHistory.pending]:e=>{e.pending=!0},[vatFarmGetProfile.fulfilled]:(e,{payload:t})=>{e.profile=t.data,e.pending=!1},[vetFarmGetAllocatedService.fulfilled]:(e,{payload:t})=>{e.vetFarmGetAllocated=t.data,e.pending=!1},[vetFarmGetDeletedBarsService.fulfilled]:(e,{payload:t})=>{e.vetFarmGetDeletedBars=t.data},[vetFarmGetOutOfProvinceRequests.fulfilled]:(e,{payload:t})=>{e.vetOutOfProvinceRequests=t.data},[vetFarmGetBarsOverview.fulfilled]:(e,{payload:t})=>{e.vetFarmBarsOverview=t.data},[parentCompanyGetBarsOverview.fulfilled]:(e,{payload:t})=>{e.parentCompanyBarsOverview=t.data}},initialState$d={pending:!1,provinceNewRequests:null,provincePrices:null,profile:null},slice$c=createSlice({name:"vatFarm",initialState:initialState$d,extraReducers:vetFarmExtraReducers,reducers:{}}),{reducer:vetFarmSlice}=slice$c,auctionGetAuctions=createAsyncThunk("AUCTION_GET_AUCTIONS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("Poultry_Request/?type=auction");return t(LOADING_END()),{data:a,status:s}}),auctionSlaughterRequests=createAsyncThunk("AUCTION_SLAUGHTER_REQUESTS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_Request_auction/");return t(LOADING_END()),{data:a,status:s}}),auctionExtraReducers={[auctionSlaughterRequests.fulfilled]:(e,{payload:t})=>{e.auctionSlaughterRequestsData=t.data,e.pending=!1},[auctionSlaughterRequests.pending]:e=>{e.pending=!0},[auctionGetAuctions.fulfilled]:(e,{payload:t})=>{e.auctions=t.data,e.pending=!1},[auctionGetAuctions.pending]:e=>{e.pending=!0}},auctionReducers={auctionFilterByDate:(e,t)=>{e.filterByDate=t.payload},auctionFilterByProvince:(e,t)=>{e.filterByProvince=t.payload},auctionFilterByCity:(e,t)=>{e.filterByCity=t.payload},auctionFilterByQuantity:(e,t)=>{e.filterByQuantity=t.payload},auctionFilterByAge:(e,t)=>{e.filterByAge=t.payload},auctionFilterByRace:(e,t)=>{e.filterByRace=t.payload},auctionFilterByWeight:(e,t)=>{e.filterByWeight=t.payload},auctionFilterByPrice:(e,t)=>{e.filterByPrice=t.payload}},initialState$c={pending:!1,auctions:[],filterByDate:null,filterByProvinceAndCity:null,auctionSlaughterRequestsData:[],provinceFilter:null,cityFilter:null,quantityFilter:null,ageFilter:null,raceFilter:null,weightFilter:null,priceFilter:null},slice$b=createSlice({name:"auction",initialState:initialState$c,extraReducers:auctionExtraReducers,reducers:auctionReducers}),{reducer:auctionSlice}=slice$b,{auctionFilterByDate,auctionFilterByCity,auctionFilterByProvince,auctionFilterByQuantity,auctionFilterByAge,auctionFilterByRace,auctionFilterByWeight,auctionFilterByPrice}=slice$b.actions,driverGetCars=createAsyncThunk("DRIVER_GET_CARS",async()=>{const{data:e,status:t}=await axios$1.get("driver/?my_car");return{data:e,status:t}}),driverGetProfile=createAsyncThunk("DRIVER_GET_PROFILE",async()=>{const{data:e,status:t}=await axios$1.get("driver/0/?profile");return{data:e,status:t}}),driverGetRequests=createAsyncThunk("DRIVER_GET_REQUESTS",async()=>{const{data:e,status:t}=await axios$1.get("driver/?my_allocations");return{data:e,status:t}}),driverExtraReducers={[driverGetRequests.fulfilled]:(e,{payload:t})=>{e.driverRequests=t.data,e.pending=!1},[driverGetRequests.pending]:e=>{e.pending=!0},[driverGetCars.fulfilled]:(e,{payload:t})=>{e.driverCars=t.data,e.pending=!1},[driverGetCars.pending]:e=>{e.pending=!0},[driverGetProfile.fulfilled]:(e,{payload:t})=>{e.profile=t.data.profile,e.pending=!1},[driverGetProfile.pending]:e=>{e.pending=!0}},initialState$b={pending:!1,modalState:!1,driverRequests:[],driverCars:[],profile:null},slice$a=createSlice({name:"driver",initialState:initialState$b,extraReducers:driverExtraReducers,reducers:{}}),{reducer:driverSlice}=slice$a,provinceFinancialGetFinalFactorsService=createAsyncThunk("PROVINCE_FINANCIAL_GET_FINAL_FACTORS_SERVICE",async e=>{const{data:t,status:a}=await axios$1.get("deposit_allocation/");return{data:t,status:a}}),provinceFinancialGetFinancialHistory=createAsyncThunk("PROVINCE_FINANCIAL_GET_FINANCIQAL_HISTORY",async e=>{const{data:t,status:a}=await axios$1.get("financialdocument/?user_id="+e+"&all");return{data:t,status:a}}),provinceFinancialGetPayedFactorsService=createAsyncThunk("PROVINCE_FINANCIAL_GET_PAYED_FACTORS_SERVICE",async e=>{const{data:t,status:a}=await axios$1.get("kill_house_factor_province/",{params:{role:getRoleFromUrl()}});return{data:t,status:a}}),provinceFinancialGetPendingRequestsService=createAsyncThunk("PROVINCE_FINANCIAL_GET_PENDING_REQUESTS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_assignment_information/?role=ProvinceFinancial",{params:{date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),provinceFinancialGetRegisteredComplaints=createAsyncThunk("PROVINCE_FINANCIAL_GET_COMLATIONS",async e=>{const{data:t,status:a}=await axios$1.get("kill_house_complaint/?role=ProvinceFinancial");return{data:t,status:a}}),provinceFinancialGetRequests=createAsyncThunk("PROVINCE_FINANCIAL_GET_REQUESTS",async()=>{const{data:e,status:t}=await axios$1.get("kill_house_assignment_information/?role=ProvinceFinancial");return{data:e,status:t}}),provinceFinancialGetSlaughterSattlementService=createAsyncThunk("PROVINCE_FINANCIAL_GET_SLAUGHTER_SATTLEMENT_SERVICE",async e=>{const{data:t,status:a}=await axios$1.get("kill_house_creditors/");return{data:t,status:a}}),provinceFinancialGetTransactionInfo=createAsyncThunk("PROVINCE_FINANCIAL_GET_TRANSACTION_INFO",async e=>{const{data:t,status:a}=await axios$1.get("financial_transaction/?payment_code="+e);return{data:t,status:a}}),provinceFinancialGetUserFinancialInfo=createAsyncThunk("PROVINCE_FINANCIAL_GET_USER_FINANCIAL_INFO",async e=>{const{data:t,status:a}=await axios$1.get("wallet/?wallet_key="+e);return{data:t,status:a}}),provinceFinancialGetUsersWaletinfo=createAsyncThunk("PROVINCE_FINANCIAL_GET_USERS_WALET_INFO",async()=>{const{data:e,status:t}=await axios$1.get("show_users");return{data:e,status:t}}),ticketGetOperatorTickets=createAsyncThunk("TICKET_GET_OPERATOR_TICKETS",async()=>{const{data:e,status:t}=await axios$1.get("/respond/",{params:{all:!0}});return{data:e,status:t}}),provinceFinancialExtraReducers={[provinceFinancialGetRequests.fulfilled]:(e,{payload:t})=>{e.provinceFinancial=t.data,e.pending=!1},[provinceFinancialGetRequests.pending]:e=>{e.pending=!0},[ticketGetOperatorTickets.fulfilled]:(e,{payload:t})=>{e.tickets=t.data,e.pending=!1},[ticketGetOperatorTickets.pending]:e=>{e.pending=!0},[provinceFinancialGetUsersWaletinfo.fulfilled]:(e,{payload:t})=>{e.userWaletInfo=t.data,e.pending=!1},[provinceFinancialGetUsersWaletinfo.pending]:e=>{e.pending=!0},[provinceFinancialGetRegisteredComplaints.fulfilled]:(e,{payload:t})=>{e.registeredComplaints=t.data,e.pending=!1},[provinceFinancialGetRegisteredComplaints.pending]:e=>{e.pending=!0},[provinceFinancialGetUserFinancialInfo.fulfilled]:(e,{payload:t})=>{e.userFinancialInfo=t.data,e.pending=!1},[provinceFinancialGetUserFinancialInfo.pending]:e=>{e.pending=!0},[provinceFinancialGetFinancialHistory.fulfilled]:(e,{payload:t})=>{e.financialHistory=t.data,e.pending=!1},[provinceFinancialGetFinancialHistory.pending]:e=>{e.pending=!0},[provinceFinancialGetTransactionInfo.fulfilled]:(e,{payload:t})=>{e.transactionInfo=t.data,e.pending=!1},[provinceFinancialGetTransactionInfo.pending]:e=>{e.pending=!0},[provinceFinancialGetPendingRequestsService.fulfilled]:(e,{payload:t})=>{var s;const a=Array.isArray(t.data)?t.data:((s=t.data)==null?void 0:s.results)||[];e.provinceFinancialGetPendingRequests=a},[provinceFinancialGetPayedFactorsService.fulfilled]:(e,{payload:t})=>{e.provinceFinancialGetPayedFactors=t.data},[provinceFinancialGetFinalFactorsService.fulfilled]:(e,{payload:t})=>{e.provinceFinancialGetFinalFactors=t.data},[provinceFinancialGetSlaughterSattlementService.fulfilled]:(e,{payload:t})=>{e.provinceFinancialGetSlaughterSattlement=t.data}},initialState$a={loading:!0,modalState:!1,provinceFinancial:[],tickets:[],debts:null,registeredComplaints:null,userWaletInfo:null,userFinancialInfo:null,financialHistory:null,transactionInfo:null},slice$9=createSlice({name:"provinceFinancial",initialState:initialState$a,extraReducers:provinceFinancialExtraReducers,reducers:{}}),{reducer:provinceFinancialSlice}=slice$9,messagesGetSenderMessages=createAsyncThunk("MESSAGES_GET_SENDER_MESSAGES",async()=>{const{data:e,status:t}=await axios$1.get("user_message/?sender");return{data:e,status:t}}),messagesGetReciverMessages=createAsyncThunk("MESSAGES_GET_RECIVER_MESSAGES",async()=>{const{data:e,status:t}=await axios$1.get("user_message/?receiver");return{data:e,status:t}}),messageExtraReducers={[messagesGetSenderMessages.fulfilled]:(e,{payload:t})=>{e.senderMessages=t.data,e.pending=!1},[messagesGetSenderMessages.pending]:e=>{e.pending=!0},[messagesGetReciverMessages.fulfilled]:(e,{payload:t})=>{e.reciverMessages=t.data,e.pending=!1},[messagesGetReciverMessages.pending]:e=>{e.pending=!0}},initialState$9={pending:!1,senderMessages:null,reciverMessages:null},slice$8=createSlice({name:"province",initialState:initialState$9,extraReducers:messageExtraReducers,reducers:{}}),{reducer:messageSlice}=slice$8,inspectorGetKillHousesService=createAsyncThunk("INSPECTOR_GET_KILL_HOUSES",async()=>{const{data:e,status:t}=await axios$1.get(`kill_house/?role=${getRoleFromUrl()}`);return{data:e,status:t}}),inspectorGetProfile=createAsyncThunk("INSPECTOR_GET_PROFILE",async()=>{const{data:e,status:t}=await axios$1.get("inspector_operator/0/?profile");return{data:e,status:t}}),inspectorGetNewRequests=createAsyncThunk("INSPECTOR_GET_NEW_REQUESTS",async()=>{const{data:e,status:t}=await axios$1.get("Poultry_Request/?role=ProvinceInspector");return{data:e,status:t}}),manageFarmGetFarmsService=createAsyncThunk("MANAGE_FARM_GET_FARMS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("vet/");return t(LOADING_END()),{data:a,status:s}}),inspectorExtraReducers={[inspectorGetNewRequests.fulfilled]:(e,{payload:t})=>{e.inspectorNewRequests=t.data,e.pending=!1},[inspectorGetNewRequests.pending]:e=>{e.pending=!0},[inspectorGetProfile.fulfilled]:(e,{payload:t})=>{e.profile=t.data,e.pending=!1},[manageFarmGetFarmsService.fulfilled]:(e,{payload:t})=>{e.manageFarmGetFarms=t.data},[inspectorGetKillHousesService.fulfilled]:(e,{payload:t})=>{e.inspectorGetKillHouses=t.data}},initialState$8={inspectorNewRequests:null,pending:!1,profile:null},slice$7=createSlice({name:"inspector",initialState:initialState$8,extraReducers:inspectorExtraReducers,reducers:{}}),{reducer:inspectorSlice}=slice$7,slaughterHouseVetGetComplaints=createAsyncThunk("SLAUGHTER_VET_GET_COMLATIONS",async e=>{const{data:t,status:a}=await axios$1.get("kill_house_assignment_information/?role=KillHouseVet");return{data:t,status:a}}),slaughterHouseVetGetProfile=createAsyncThunk("SLAUGHTER_HOUSE_VET_GET_PROFILE",async()=>{const{data:e,status:t}=await axios$1.get("vet/0/?profile");return{data:e,status:t}}),slaughterHouseVetNewRequests=createAsyncThunk("SLAUGHTER_HOUSE_VET_NEW_REQUESTS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("kill_house_request/?operator=KillHouseVet",{params:{date1:e.selectedDate1,date2:e.selectedDate2}});return t(LOADING_END()),{data:a,status:s}}),slaughterHouseVetExtraReducers={[slaughterHouseVetGetProfile.fulfilled]:(e,{payload:t})=>{e.profile=t.data,e.pending=!1},[slaughterHouseVetGetProfile.pending]:e=>{e.pending=!0},[slaughterHouseVetNewRequests.fulfilled]:(e,{payload:t})=>{e.newRequests=t.data,e.pending=!1},[slaughterHouseVetNewRequests.pending]:e=>{e.pending=!0},[slaughterHouseVetGetComplaints.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.slaughterHouseVetComplaints=t.data},[slaughterHouseVetGetComplaints.pending]:e=>{e.pending=!0}},initialState$7={pending:!1,profile:null,newRequests:[],slaughterHouseVetComplaints:null},slice$6=createSlice({name:"slaughterHouseVet",initialState:initialState$7,extraReducers:slaughterHouseVetExtraReducers,reducers:{}}),{reducer:slaughterHouseVetSlice}=slice$6,ticketGetCreatedTickets=createAsyncThunk("TICKET_GET_CREATED_TICKETS",async()=>{const{data:e,status:t}=await axios$1.get("/create_ticket/",{params:{all:!0}});return{data:e,status:t}}),ticketExtraReducers={[ticketGetCreatedTickets.fulfilled]:(e,{payload:t})=>{e.tickets=t.data,e.pending=!1},[ticketGetCreatedTickets.pending]:e=>{e.pending=!0},[ticketGetOperatorTickets.fulfilled]:(e,{payload:t})=>{e.operatorTickets=t.data,e.pending=!1},[ticketGetOperatorTickets.pending]:e=>{e.pending=!0}},initialState$6={pending:!1,tickets:[],operatorTickets:[]},slice$5=createSlice({name:"tickets",initialState:initialState$6,extraReducers:ticketExtraReducers,reducers:{}}),{reducer:ticketSlice}=slice$5,getRequestsAwaitingInspection=createAsyncThunk("GET_REQUESTS_AWAITING_INSPECTION",async e=>{const{data:t,status:a}=await axios$1.get("Poultry_Request/?role="+e);return{data:t,status:a}}),getRequestsAwaitingPayment=createAsyncThunk("GET_REQUESTS_AWAITING_PAYMENT",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("province_factor_to_kill_house/",{params:{role:getRoleFromUrl()}});return t(LOADING_END()),{data:a,status:s}}),cityVetGetProfileService=createAsyncThunk("CITY_VET_GET_PROFILE",async()=>{const{data:e,status:t}=await axios$1.get("city_vet/0/?profile");return{data:e,status:t}}),guildGetFreeBars=createAsyncThunk("GUILD_GET_FREE_BARS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("steward_free_bar/",{params:{date:e.date}});return t(LOADING_END()),{data:a,status:s}}),guildGetFreeSaleBarService=createAsyncThunk("GUILD_GET_FREE_SALE_BARS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("steward_free_sale_bar/",{params:e});return t(LOADING_END()),{data:a,status:s}}),guildGetStewardsService=createAsyncThunk("GUILD_GET_GUILDS_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("guilds/?other_guilds_for_steward=true/",{params:{role:getRoleFromUrl()}});return t(LOADING_END()),{data:a,status:s}}),guildGetInventoryAllocatedService=createAsyncThunk("GUILD_GET_INVENTORY_ALLOCATED_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("steward-allocation/",{params:{date:e.date,steward:!0}});return t(LOADING_END()),{data:a,status:s}}),guildGetInventoryStockService=createAsyncThunk("GUILD_GET_INVENTORY_STOCK_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("steward_warehouse/",{params:{date:e.date}});return t(LOADING_END()),{data:a,status:s}}),guildGetProfile=createAsyncThunk("GUILD_GET_PROFILE",async()=>{const{data:e,status:t}=await axios$1.get("guilds/0/?profile");return{data:e,status:t}}),guildGetStewards=createAsyncThunk("GUILD_GET_STEWARDS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("guilds/",{params:{date:e.date,steward_sub_guilds:!0}});return t(LOADING_END()),{data:a,status:s}}),guildGetAllocationData=createAsyncThunk("GUILD_GET_ALLOCATION_DATA",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("steward-allocation/?steward_guilds_allocations=true/",{params:{date:e.date}});return t(LOADING_END()),{data:a,status:s}}),senfGetInventoryAllocatedService=createAsyncThunk("SENF_GET_INVENTORY_ALLOCATED_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("steward-allocation/",{params:{date:e.date,guild:!0}});return t(LOADING_END()),{data:a,status:s}}),senfGetInventoryStockService=createAsyncThunk("SENF_GET_INVENTORY_STOCK_SERVICE",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("guilds_warehouse/",{params:{date:e.date}});return t(LOADING_END()),{data:a,status:s}}),generalExtraReducers={[guildGetProfile.fulfilled]:(e,{payload:t})=>{e.guildProfile=t.data},[getRequestsAwaitingPayment.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.awaitingPaymentRequests=t.data},[getRequestsAwaitingPayment.pending]:e=>{e.pending=!0},[getRequestsAwaitingInspection.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.awaitingInspectionRequests=t.data},[getRequestsAwaitingInspection.pending]:e=>{e.pending=!0},[cityVetGetProfileService.fulfilled]:(e,{payload:t})=>{e.cityVetGetProfile=t.data},[guildGetInventoryStockService.fulfilled]:(e,{payload:t})=>{e.guildGetInventoryStock=t.data},[guildGetFreeSaleBarService.fulfilled]:(e,{payload:t})=>{e.guildFreeSaleBars=t.data},[senfGetInventoryStockService.fulfilled]:(e,{payload:t})=>{e.senfGetInventoryStock=t.data},[guildGetStewards.fulfilled]:(e,{payload:t})=>{e.guildStewards=t.data},[guildGetInventoryAllocatedService.fulfilled]:(e,{payload:t})=>{e.guildGetInventoryAllocated=t.data},[guildGetFreeBars.fulfilled]:(e,{payload:t})=>{e.guildFreeBars=t.data},[senfGetInventoryAllocatedService.fulfilled]:(e,{payload:t})=>{e.senfGetInventoryAllocated=t.data},[guildGetStewardsService.fulfilled]:(e,{payload:t})=>{e.guildGetStewardsState=t.data.map(a=>{var s,n,i;return{label:`${a==null?void 0:a.guildsName} (${(s=a==null?void 0:a.user)==null?void 0:s.city}) / ${(n=a==null?void 0:a.user)==null?void 0:n.fullname} (${(i=a==null?void 0:a.user)==null?void 0:i.mobile})`,value:a.key}})},[guildGetAllocationData.fulfilled]:(e,{payload:t})=>{e.guildGetGuildData=t.data,e.pending=!1}},initialState$5={pending:!1,awaitingPaymentRequests:null,awaitingInspectionRequests:null},slice$4=createSlice({name:"general",initialState:initialState$5,extraReducers:generalExtraReducers}),{reducer:generalSlice}=slice$4,adminGetCharts=createAsyncThunk("ADMIN_GET_CHARTS",async()=>{const{data:e,status:t}=await axios$1.get("chart");return{data:e,status:t}}),adminGetHatchingByPeriod=createAsyncThunk("ADMIN_GET_HATCHING_BY_PERIOD",async e=>{const{data:t,status:a}=await axios$1.get("forcast_hatching/?date1="+e.date1+"&date2="+e.date2+"&day="+e.age);return{data:t,status:a}}),adminExtraReducers={[adminGetCharts.fulfilled]:(e,{payload:t})=>{e.statics=t.data,e.pending=!1},[adminGetCharts.pending]:e=>{e.pending=!0},[adminGetHatchingByPeriod.fulfilled]:(e,{payload:t})=>{e.hatchingByPeriod=t.data,e.pending=!1},[adminGetHatchingByPeriod.pending]:e=>{e.pending=!0}},adminReducers={EMPTY_HATCHING:(e,t)=>{e.hatchingByPeriod=[]}},initialState$4={pending:!1,statics:null,hatchingByPeriod:null},slice$3=createSlice({name:"admin",initialState:initialState$4,reducers:adminReducers,extraReducers:adminExtraReducers}),{reducer:adminSlice}=slice$3,jahadIllegalKillingService=createAsyncThunk("JAHAD_ILLEGAL_KILLING_SERVICE",async e=>{const{data:t,status:a}=await axios$1.get("poultry_hatching/?illegal");return{data:t,status:a}}),jahadGetProfile=createAsyncThunk("JAHAD_GET_PROFILE",async e=>{const{data:t,status:a}=await axios$1.get("jahad/0/?profile");return{data:t,status:a}}),killsDailyReportService=createAsyncThunk("KILLS_DAILY_REPORT_SERVICE",async e=>{const{data:t,status:a}=await axios$1.get("letter_report/?daily_report");return{data:t,status:a}}),jahadExtraReducers={[jahadGetProfile.fulfilled]:(e,{payload:t})=>{e.profile=t.data,e.pending=!1},[killsDailyReportService.fulfilled]:(e,{payload:t})=>{e.killsDailyReport=t.data,e.pending=!1},[jahadIllegalKillingService.fulfilled]:(e,{payload:t})=>{e.jahadIllegalKilling=t.data,e.pending=!1}},initialState$3={profile:null,jahadIllegalKilling:[]},slice$2=createSlice({name:"jahad",initialState:initialState$3,extraReducers:jahadExtraReducers,reducers:{}}),{reducer:jahadSlice}=slice$2,liveStockGetFreezingRequests=createAsyncThunk("LIVE_STOCK_GET_FREEZING_REQUESTS",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("cold-house-allocations/",{params:e});return t(LOADING_END()),{data:a,status:s}}),liveStockGetInventoryData=createAsyncThunk("SLAUGHTER_GET_COLD_HOUSES",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("cold-house/",{params:{role:getRoleFromUrl(),...e}});return t(LOADING_END()),{data:a,status:s}}),liveStockGetInventoryDataDashboard=createAsyncThunk("SLAUGHTER_GET_COLD_HOUSES",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.get("cold-house-dashboard/",{params:{role:getRoleFromUrl(),...e}});return t(LOADING_END()),{data:a,status:s}}),liveStockExtraReducers={[liveStockGetFreezingRequests.fulfilled]:(e,{payload:t})=>{e.freezingRequests=t.data,e.pending=!1},[liveStockGetInventoryData.fulfilled]:(e,{payload:t})=>{e.inventoryData=t.data,e.pending=!1}},initialState$2={pending:!1},slice$1=createSlice({name:"liveStock",initialState:initialState$2,extraReducers:liveStockExtraReducers,reducers:{}}),{reducer:liveStockSlice}=slice$1,fetchStewardBroadcastAndProducts=createAsyncThunk("STEWARD_FETCH_BROADCAST_AND_PRODUCTS",async(e,{dispatch:t})=>{try{t(LOADING_START());const[a,s]=await Promise.all([axios$1.get("steward-sales-info-dashboard/",{params:{role:getRoleFromUrl()}}),axios$1.get("roles-products/?role="+getRoleFromUrl())]);return t(LOADING_END()),{broadcastData:a.data,productsData:s.data}}catch(a){throw t(LOADING_END()),a}}),stewardGetVBroadcastInfo=createAsyncThunk("STEWARD_GET_BROARDCAST_INFO",async(e,{dispatch:t})=>{const{data:a,status:s}=await axios$1.get("steward-sales-info-dashboard/",{params:{role:getRoleFromUrl()}});return{data:a,status:s}}),stewardExtraReducer={[stewardGetVBroadcastInfo.fulfilled]:(e,{payload:t})=>{e.pending=!1,e.distributionInfo=t.data},[fetchStewardBroadcastAndProducts.fulfilled]:(e,{payload:t})=>{e.stewardProducts=t.productsData,e.distributionInfo=t.broadcastData}},initialState$1={pending:!1,modalState:!1},slice=createSlice({name:"province",initialState:initialState$1,extraReducers:stewardExtraReducer,reducers:{}}),{reducer:stewardSlice}=slice,reducer=combineReducers({userSlice,appSlice,avicultureSlice,citySlice,slaughterSlice,provinceSlice,fileSlice,vetFarmSlice,auctionSlice,driverSlice,provinceFinancialSlice,messageSlice,inspectorSlice,slaughterHouseVetSlice,ticketSlice,generalSlice,adminSlice,jahadSlice,liveStockSlice,stewardSlice}),persistConfig={key:"root",storage:default_1$1t},persistedReducer=persistReducer(persistConfig,reducer),store=configureStore({reducer:persistedReducer,middleware:[thunk]}),persistor=persistStore(store);var ExpandMore={},createSvgIcon={};const require$$0=getAugmentedNamespace(utils$c);var hasRequiredCreateSvgIcon;function requireCreateSvgIcon(){return hasRequiredCreateSvgIcon||(hasRequiredCreateSvgIcon=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=require$$0}(createSvgIcon)),createSvgIcon}var _interopRequireDefault$1s=interopRequireDefaultExports;Object.defineProperty(ExpandMore,"__esModule",{value:!0});var default_1$1s=ExpandMore.default=void 0,_createSvgIcon$1s=_interopRequireDefault$1s(requireCreateSvgIcon()),_jsxRuntime$1s=jsxRuntimeExports;default_1$1s=ExpandMore.default=(0,_createSvgIcon$1s.default)((0,_jsxRuntime$1s.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var ExpandLess={},_interopRequireDefault$1r=interopRequireDefaultExports;Object.defineProperty(ExpandLess,"__esModule",{value:!0});var default_1$1r=ExpandLess.default=void 0,_createSvgIcon$1r=_interopRequireDefault$1r(requireCreateSvgIcon()),_jsxRuntime$1r=jsxRuntimeExports;default_1$1r=ExpandLess.default=(0,_createSvgIcon$1r.default)((0,_jsxRuntime$1r.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");const ToggleButton=styled(Button)({position:"absolute",opacity:"50%",bottom:0,right:0,transform:"translateX(-50%)",minWidth:"auto",padding:"2px 8px",backgroundColor:"white",border:"1px solid #B0B0B0",borderRadius:"10px 10px 0 0","&:hover":{backgroundColor:"#f5f5f5"},zIndex:100}),StyledGrid=styled(Grid2)(({theme:e,isDashboard:t,isPolicy:a,isLocked:s,isExpanded:n})=>({...t?{position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,pointerEvents:"none",zIndex:-1},padding:e.spacing(2),background:e.palette.background.paper,boxShadow:"rgba(100, 100, 111, 0.2) 2px 6px 6px 2px",borderRadius:"2px 2px 10px 10px",zIndex:0}:a&&{padding:"10px",color:"#727272",borderStyle:"solid",borderColor:"#B0B0B0",borderWidth:"1px",borderRadius:"8px",width:"270px",background:s?"#EAEFFF":"white",height:n?"auto":"100px",overflow:n?"unset":"hidden",position:"relative","&:hover":{backgroundColor:s?"#EAEFFF":"#f5f5f5"}}})),Grid=e=>{var E;const{children:t,isDashboard:a,isPolicy:s,...n}=e,[i,o]=reactExports.useState(!1),[u,l]=reactExports.useState(!1),[c,_]=reactExports.useState(!0),p=reactExports.useRef(null);reactExports.useEffect(()=>{if(s&&p.current){const R=p.current.scrollHeight;l(R>120)}},[t,s]),setTimeout(()=>{_(!1)},3e3);const d=()=>{o(!i)};return reactExports.useEffect(()=>{p.current&&(p.current.scrollHeight>120?c||o(!0):o(!1))},[(E=p==null?void 0:p.current)==null?void 0:E.scrollHeight]),jsxRuntimeExports.jsxs(StyledGrid,{isDashboard:a,isPolicy:s,isExpanded:i,ref:p,...n,children:[t,s&&u&&jsxRuntimeExports.jsx(ToggleButton,{onClick:d,children:i?jsxRuntimeExports.jsx(default_1$1r,{}):jsxRuntimeExports.jsx(default_1$1s,{})})]})};Grid.propTypes={children:propTypesExports.PropTypes.any,isDashboard:propTypesExports.PropTypes.bool,isPolicy:propTypesExports.PropTypes.bool,isLocked:propTypesExports.PropTypes.bool};Grid.defaultProps={isDashboard:!1,isPolicy:!1,isLocked:!1};const assets$1=[],layers$1=[{ddd:0,ind:0,ty:4,nm:"形状图层 5",ks:{o:{k:[{i:{x:[.833],y:[.833]},o:{x:[.333],y:[0]},n:["0p833_0p833_0p333_0"],t:8,s:[100],e:[30]},{i:{x:[.833],y:[.833]},o:{x:[.333],y:[0]},n:["0p833_0p833_0p333_0"],t:24,s:[30],e:[100]},{t:40}]},r:{k:0},p:{k:[187.875,77.125,0]},a:{k:[-76.375,-2.875,0]},s:{k:[{i:{x:[.833,.833,.833],y:[.833,.833,.833]},o:{x:[.333,.333,.333],y:[0,0,.333]},n:["0p833_0p833_0p333_0","0p833_0p833_0p333_0","0p833_0p833_0p333_0p333"],t:8,s:[100,100,100],e:[200,200,100]},{i:{x:[.833,.833,.833],y:[.833,.833,.833]},o:{x:[.333,.333,.333],y:[0,0,.333]},n:["0p833_0p833_0p333_0","0p833_0p833_0p333_0","0p833_0p833_0p333_0p333"],t:24,s:[200,200,100],e:[100,100,100]},{t:40}]}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{k:[18,18]},p:{k:[0,0]},nm:"椭圆路径 1",mn:"ADBE Vector Shape - Ellipse"},{ty:"st",c:{k:[1,1,1,1]},o:{k:100},w:{k:0},lc:1,lj:1,ml:4,nm:"描边 1",mn:"ADBE Vector Graphic - Stroke"},{ty:"fl",c:{k:[.87,.42,.56,1]},o:{k:100},nm:"填充 1",mn:"ADBE Vector Graphic - Fill"},{ty:"tr",p:{k:[-76.482,-3.482],ix:2},a:{k:[0,0],ix:1},s:{k:[100,100],ix:3},r:{k:0,ix:6},o:{k:100,ix:7},sk:{k:0,ix:4},sa:{k:0,ix:5},nm:"变换"}],nm:"椭圆 1",np:3,mn:"ADBE Vector Group"}],ip:0,op:40,st:0,bm:0,sr:1},{ddd:0,ind:1,ty:4,nm:"形状图层 4",ks:{o:{k:[{i:{x:[.833],y:[.833]},o:{x:[.333],y:[0]},n:["0p833_0p833_0p333_0"],t:6,s:[100],e:[30]},{i:{x:[.833],y:[.833]},o:{x:[.333],y:[0]},n:["0p833_0p833_0p333_0"],t:22,s:[30],e:[100]},{t:36}]},r:{k:0},p:{k:[162.125,76.625,0]},a:{k:[-76.375,-2.875,0]},s:{k:[{i:{x:[.833,.833,.833],y:[.833,.833,.833]},o:{x:[.333,.333,.333],y:[0,0,.333]},n:["0p833_0p833_0p333_0","0p833_0p833_0p333_0","0p833_0p833_0p333_0p333"],t:6,s:[100,100,100],e:[200,200,100]},{i:{x:[.833,.833,.833],y:[.833,.833,.833]},o:{x:[.333,.333,.333],y:[0,0,.333]},n:["0p833_0p833_0p333_0","0p833_0p833_0p333_0","0p833_0p833_0p333_0p333"],t:22,s:[200,200,100],e:[100,100,100]},{t:36}]}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{k:[18,18]},p:{k:[0,0]},nm:"椭圆路径 1",mn:"ADBE Vector Shape - Ellipse"},{ty:"st",c:{k:[1,1,1,1]},o:{k:100},w:{k:0},lc:1,lj:1,ml:4,nm:"描边 1",mn:"ADBE Vector Graphic - Stroke"},{ty:"fl",c:{k:[.81,.55,.82,1]},o:{k:100},nm:"填充 1",mn:"ADBE Vector Graphic - Fill"},{ty:"tr",p:{k:[-76.482,-3.482],ix:2},a:{k:[0,0],ix:1},s:{k:[100,100],ix:3},r:{k:0,ix:6},o:{k:100,ix:7},sk:{k:0,ix:4},sa:{k:0,ix:5},nm:"变换"}],nm:"椭圆 1",np:3,mn:"ADBE Vector Group"}],ip:0,op:40,st:0,bm:0,sr:1},{ddd:0,ind:2,ty:4,nm:"形状图层 3",ks:{o:{k:[{i:{x:[.833],y:[.833]},o:{x:[.333],y:[0]},n:["0p833_0p833_0p333_0"],t:4,s:[100],e:[30]},{i:{x:[.833],y:[.833]},o:{x:[.333],y:[0]},n:["0p833_0p833_0p333_0"],t:20,s:[30],e:[100]},{t:32}]},r:{k:0},p:{k:[135.625,76.625,0]},a:{k:[-76.375,-2.875,0]},s:{k:[{i:{x:[.833,.833,.833],y:[.833,.833,.833]},o:{x:[.333,.333,.333],y:[0,0,.333]},n:["0p833_0p833_0p333_0","0p833_0p833_0p333_0","0p833_0p833_0p333_0p333"],t:4,s:[100,100,100],e:[200,200,100]},{i:{x:[.833,.833,.833],y:[.833,.833,.833]},o:{x:[.333,.333,.333],y:[0,0,.333]},n:["0p833_0p833_0p333_0","0p833_0p833_0p333_0","0p833_0p833_0p333_0p333"],t:20,s:[200,200,100],e:[100,100,100]},{t:32}]}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{k:[18,18]},p:{k:[0,0]},nm:"椭圆路径 1",mn:"ADBE Vector Shape - Ellipse"},{ty:"st",c:{k:[1,1,1,1]},o:{k:100},w:{k:0},lc:1,lj:1,ml:4,nm:"描边 1",mn:"ADBE Vector Graphic - Stroke"},{ty:"fl",c:{k:[.47,.31,.62,1]},o:{k:100},nm:"填充 1",mn:"ADBE Vector Graphic - Fill"},{ty:"tr",p:{k:[-76.482,-3.482],ix:2},a:{k:[0,0],ix:1},s:{k:[100,100],ix:3},r:{k:0,ix:6},o:{k:100,ix:7},sk:{k:0,ix:4},sa:{k:0,ix:5},nm:"变换"}],nm:"椭圆 1",np:3,mn:"ADBE Vector Group"}],ip:0,op:40,st:0,bm:0,sr:1},{ddd:0,ind:3,ty:4,nm:"形状图层 2",ks:{o:{k:[{i:{x:[.833],y:[.833]},o:{x:[.333],y:[0]},n:["0p833_0p833_0p333_0"],t:2,s:[100],e:[30]},{i:{x:[.833],y:[.833]},o:{x:[.333],y:[0]},n:["0p833_0p833_0p333_0"],t:16,s:[30],e:[100]},{t:28}]},r:{k:0},p:{k:[109.375,76.625,0]},a:{k:[-76.625,-3.125,0]},s:{k:[{i:{x:[.833,.833,.833],y:[.833,.833,.833]},o:{x:[.333,.333,.333],y:[0,0,.333]},n:["0p833_0p833_0p333_0","0p833_0p833_0p333_0","0p833_0p833_0p333_0p333"],t:2,s:[100,100,100],e:[200,200,100]},{i:{x:[.833,.833,.833],y:[.833,.833,.833]},o:{x:[.333,.333,.333],y:[0,0,.333]},n:["0p833_0p833_0p333_0","0p833_0p833_0p333_0","0p833_0p833_0p333_0p333"],t:16,s:[200,200,100],e:[100,100,100]},{t:28}]}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{k:[18,18]},p:{k:[0,0]},nm:"椭圆路径 1",mn:"ADBE Vector Shape - Ellipse"},{ty:"st",c:{k:[1,1,1,1]},o:{k:100},w:{k:0},lc:1,lj:1,ml:4,nm:"描边 1",mn:"ADBE Vector Graphic - Stroke"},{ty:"fl",c:{k:[.54,.81,.89,1]},o:{k:100},nm:"填充 1",mn:"ADBE Vector Graphic - Fill"},{ty:"tr",p:{k:[-76.482,-3.482],ix:2},a:{k:[0,0],ix:1},s:{k:[100,100],ix:3},r:{k:0,ix:6},o:{k:100,ix:7},sk:{k:0,ix:4},sa:{k:0,ix:5},nm:"变换"}],nm:"椭圆 1",np:3,mn:"ADBE Vector Group"}],ip:0,op:40,st:0,bm:0,sr:1},{ddd:0,ind:4,ty:4,nm:"形状图层 1",ks:{o:{k:[{i:{x:[.833],y:[.833]},o:{x:[.333],y:[0]},n:["0p833_0p833_0p333_0"],t:0,s:[100],e:[30]},{i:{x:[.833],y:[.833]},o:{x:[.333],y:[0]},n:["0p833_0p833_0p333_0"],t:12,s:[30],e:[100]},{t:24}]},r:{k:0},p:{k:[82.625,76.625,0]},a:{k:[-76.625,-3.375,0]},s:{k:[{i:{x:[.833,.833,.833],y:[.833,.833,.833]},o:{x:[.333,.333,.333],y:[0,0,.333]},n:["0p833_0p833_0p333_0","0p833_0p833_0p333_0","0p833_0p833_0p333_0p333"],t:0,s:[100,100,100],e:[200,200,100]},{i:{x:[.833,.833,.833],y:[.833,.833,.833]},o:{x:[.333,.333,.333],y:[0,0,.333]},n:["0p833_0p833_0p333_0","0p833_0p833_0p333_0","0p833_0p833_0p333_0p333"],t:12,s:[200,200,100],e:[100,100,100]},{t:24}]}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{k:[18,18]},p:{k:[0,0]},nm:"椭圆路径 1",mn:"ADBE Vector Shape - Ellipse"},{ty:"st",c:{k:[1,1,1,1]},o:{k:100},w:{k:0},lc:1,lj:1,ml:4,nm:"描边 1",mn:"ADBE Vector Graphic - Stroke"},{ty:"fl",c:{k:[.34,.45,.78,1]},o:{k:100},nm:"填充 1",mn:"ADBE Vector Graphic - Fill"},{ty:"tr",p:{k:[-76.482,-3.482],ix:2},a:{k:[0,0],ix:1},s:{k:[100,100],ix:3},r:{k:0,ix:6},o:{k:100,ix:7},sk:{k:0,ix:4},sa:{k:0,ix:5},nm:"变换"}],nm:"椭圆 1",np:3,mn:"ADBE Vector Group"}],ip:0,op:40,st:0,bm:0,sr:1}],v$1="4.5.4",ddd$1=0,ip$1=0,op$1=40,fr$1=24,w$1=280,h$1=160,loading={assets:assets$1,layers:layers$1,v:v$1,ddd:ddd$1,ip:ip$1,op:op$1,fr:fr$1,w:w$1,h:h$1};var lottie$1={exports:{}};(function(module,exports){typeof document<"u"&&typeof navigator<"u"&&function(e,t){module.exports=t()}(commonjsGlobal,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(t){_useWebWorker=!!t},getWebWorker=function(){return _useWebWorker},setLocationHref=function(t){locationHref=t},getLocationHref=function(){return locationHref};function createTag(e){return document.createElement(e)}function extendPrototype(e,t){var a,s=e.length,n;for(a=0;a1?a[1]=1:a[1]<=0&&(a[1]=0),HSVtoRGB(a[0],a[1],a[2])}function addBrightnessToRGB(e,t){var a=RGBtoHSV(e[0]*255,e[1]*255,e[2]*255);return a[2]+=t,a[2]>1?a[2]=1:a[2]<0&&(a[2]=0),HSVtoRGB(a[0],a[1],a[2])}function addHueToRGB(e,t){var a=RGBtoHSV(e[0]*255,e[1]*255,e[2]*255);return a[0]+=t/360,a[0]>1?a[0]-=1:a[0]<0&&(a[0]+=1),HSVtoRGB(a[0],a[1],a[2])}var rgbToHex=function(){var e=[],t,a;for(t=0;t<256;t+=1)a=t.toString(16),e[t]=a.length===1?"0"+a:a;return function(s,n,i){return s<0&&(s=0),n<0&&(n=0),i<0&&(i=0),"#"+e[s]+e[n]+e[i]}}(),setSubframeEnabled=function(t){subframeEnabled=!!t},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(t){expressionsPlugin=t},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(t){expressionsInterfaces=t},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(t){defaultCurveSegments=t},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(t){idPrefix$1=t};function createNS(e){return document.createElementNS(svgNS,e)}function _typeof$5(e){"@babel/helpers - typeof";return _typeof$5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$5(e)}var dataManager=function(){var e=1,t=[],a,s,n={onmessage:function(){},postMessage:function(E){a({data:E})}},i={postMessage:function(E){n.onmessage({data:E})}};function o(d){if(window.Worker&&window.Blob&&getWebWorker()){var E=new Blob(["var _workerSelf = self; self.onmessage = ",d.toString()],{type:"text/javascript"}),R=URL.createObjectURL(E);return new Worker(R)}return a=d,n}function u(){s||(s=o(function(E){function R(){function I(b,k){var F,N,M=b.length,G,V,ee,ae;for(N=0;N=0;k-=1)if(b[k].ty==="sh")if(b[k].ks.k.i)O(b[k].ks.k);else for(M=b[k].ks.k.length,N=0;NF[0]?!0:F[0]>b[0]?!1:b[1]>F[1]?!0:F[1]>b[1]?!1:b[2]>F[2]?!0:F[2]>b[2]?!1:null}var U=function(){var b=[4,4,14];function k(N){var M=N.t.d;N.t.d={k:[{s:M,t:0}]}}function F(N){var M,G=N.length;for(M=0;M=0;M-=1)if(N[M].ty==="sh")if(N[M].ks.k.i)N[M].ks.k.c=N[M].closed;else for(ee=N[M].ks.k.length,V=0;V500)&&(this._imageLoaded(),clearInterval(g)),x+=1}).bind(this),50)}function i(A){var x=s(A,this.assetsPath,this.path),g=createNS("image");isSafari?this.testImageLoaded(g):g.addEventListener("load",this._imageLoaded,!1),g.addEventListener("error",(function(){T.img=e,this._imageLoaded()}).bind(this),!1),g.setAttributeNS("http://www.w3.org/1999/xlink","href",x),this._elementHelper.append?this._elementHelper.append(g):this._elementHelper.appendChild(g);var T={img:g,assetData:A};return T}function o(A){var x=s(A,this.assetsPath,this.path),g=createTag("img");g.crossOrigin="anonymous",g.addEventListener("load",this._imageLoaded,!1),g.addEventListener("error",(function(){T.img=e,this._imageLoaded()}).bind(this),!1),g.src=x;var T={img:g,assetData:A};return T}function u(A){var x={assetData:A},g=s(A,this.assetsPath,this.path);return dataManager.loadData(g,(function(T){x.img=T,this._footageLoaded()}).bind(this),(function(){x.img={},this._footageLoaded()}).bind(this)),x}function l(A,x){this.imagesLoadedCb=x;var g,T=A.length;for(g=0;gthis.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t=this.animationData.layers,a,s=t.length,n=e.layers,i,o=n.length;for(i=0;ithis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},AnimationItem.prototype.play=function(e){e&&this.name!==e||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(e){e&&this.name!==e||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(e){e&&this.name!==e||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(e){for(var t,a=0;a=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(a=!0,t=this.totalFrames-1):t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(t):t<0?this.checkSegments(t%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(a=!0,t=0)):this.setCurrentRawFrameValue(t),a&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=e[0]-e[1],this.timeCompleted=this.totalFrames,this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(e,t){var a=-1;this.isPaused&&(this.currentRawFrame+this.firstFramet&&(a=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,a!==-1&&this.goToAndStop(a,!0)},AnimationItem.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),_typeof$4(e[0])==="object"){var a,s=e.length;for(a=0;a=0;F-=1)t[F].animation.destroy(k)}function L(k,F,N){var M=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),G,V=M.length;for(G=0;G0?T=L:g=L;while(Math.abs(U)>i&&++j=n?I(g,B,T,O):H===0?B:y(g,U,U+l,T,O)}},e}(),pooling=function(){function e(t){return t.concat(createSizedArray(t.length))}return{double:e}}(),poolFactory=function(){return function(e,t,a){var s=0,n=e,i=createSizedArray(n),o={newElement:u,release:l};function u(){var c;return s?(s-=1,c=i[s]):c=t(),c}function l(c){s===n&&(i=pooling.double(i),n*=2),a&&a(c),i[s]=c,s+=1}return o}}(),bezierLengthPool=function(){function e(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,e)}(),segmentsLengthPool=function(){function e(){return{lengths:[],totalLength:0}}function t(a){var s,n=a.lengths.length;for(s=0;s-.001&&x<.001}function a(d,E,R,y,I,A,x,g,T){if(R===0&&A===0&&T===0)return t(d,E,y,I,x,g);var O=e.sqrt(e.pow(y-d,2)+e.pow(I-E,2)+e.pow(A-R,2)),C=e.sqrt(e.pow(x-d,2)+e.pow(g-E,2)+e.pow(T-R,2)),U=e.sqrt(e.pow(x-y,2)+e.pow(g-I,2)+e.pow(T-A,2)),L;return O>C?O>U?L=O-C-U:L=U-C-O:U>C?L=U-C-O:L=C-O-U,L>-1e-4&&L<1e-4}var s=function(){return function(d,E,R,y){var I=getDefaultCurveSegments(),A,x,g,T,O,C=0,U,L=[],j=[],X=bezierLengthPool.newElement();for(g=R.length,A=0;Ax?-1:1,O=!0;O;)if(y[A]<=x&&y[A+1]>x?(g=(x-y[A])/(y[A+1]-y[A]),O=!1):A+=T,A<0||A>=I-1){if(A===I-1)return R[A];O=!1}return R[A]+(R[A+1]-R[A])*g}function c(d,E,R,y,I,A){var x=l(I,A),g=1-x,T=e.round((g*g*g*d[0]+(x*g*g+g*x*g+g*g*x)*R[0]+(x*x*g+g*x*x+x*g*x)*y[0]+x*x*x*E[0])*1e3)/1e3,O=e.round((g*g*g*d[1]+(x*g*g+g*x*g+g*g*x)*R[1]+(x*x*g+g*x*x+x*g*x)*y[1]+x*x*x*E[1])*1e3)/1e3;return[T,O]}var _=createTypedArray("float32",8);function p(d,E,R,y,I,A,x){I<0?I=0:I>1&&(I=1);var g=l(I,x);A=A>1?1:A;var T=l(A,x),O,C=d.length,U=1-g,L=1-T,j=U*U*U,X=g*U*U*3,B=g*g*U*3,H=g*g*g,W=U*U*L,K=g*U*L+U*g*L+U*U*T,b=g*g*L+U*g*T+g*U*T,k=g*g*T,F=U*L*L,N=g*L*L+U*T*L+U*L*T,M=g*T*L+U*T*T+g*L*T,G=g*T*T,V=L*L*L,ee=T*L*L+L*T*L+L*L*T,ae=T*T*L+L*T*T+T*L*T,ne=T*T*T;for(O=0;O=c.t-a){l.h&&(l=c),n=0;break}if(c.t-a>e){n=i;break}i=A||e=A?T.points.length-1:0;for(d=T.points[O].point.length,p=0;p=L&&C=A)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(e<=x)s[0]=l.s[0],s[1]=l.s[1],s[2]=l.s[2];else{var K=createQuaternion(l.s),b=createQuaternion(g),k=(e-x)/(A-x);quaternionToEuler(s,slerp(K,b,k))}else for(i=0;i=A?E=1:e1e-6?(d=Math.acos(E),R=Math.sin(d),y=Math.sin((1-a)*d)/R,I=Math.sin(a*d)/R):(y=1-a,I=a),s[0]=y*n+I*l,s[1]=y*i+I*c,s[2]=y*o+I*_,s[3]=y*u+I*p,s}function quaternionToEuler(e,t){var a=t[0],s=t[1],n=t[2],i=t[3],o=Math.atan2(2*s*i-2*a*n,1-2*s*s-2*n*n),u=Math.asin(2*a*s+2*n*i),l=Math.atan2(2*a*i-2*s*n,1-2*a*a-2*n*n);e[0]=o/degToRads,e[1]=u/degToRads,e[2]=l/degToRads}function createQuaternion(e){var t=e[0]*degToRads,a=e[1]*degToRads,s=e[2]*degToRads,n=Math.cos(t/2),i=Math.cos(a/2),o=Math.cos(s/2),u=Math.sin(t/2),l=Math.sin(a/2),c=Math.sin(s/2),_=n*i*o-u*l*c,p=u*l*o+n*i*c,d=u*i*o+n*l*c,E=n*l*o-u*i*c;return[p,d,E,_]}function getValueAtCurrentTime(){var e=this.comp.renderedFrame-this.offsetTime,t=this.keyframes[0].t-this.offsetTime,a=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(e===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=a&&e>=a||this._caching.lastFrame=e&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(e,this._caching);this.pv=s}return this._caching.lastFrame=e,this.pv}function setVValue(e){var t;if(this.propType==="unidimensional")t=e*this.mult,mathAbs(this.v-t)>1e-5&&(this.v=t,this._mdf=!0);else for(var a=0,s=this.v.length;a1e-5&&(this.v[a]=t,this._mdf=!0),a+=1}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var e,t=this.effectsSequence.length,a=this.kf?this.pv:this.data.k;for(e=0;e=this._maxLength&&this.doubleArrayLength(),a){case"v":i=this.v;break;case"i":i=this.i;break;case"o":i=this.o;break;default:i=[];break}(!i[s]||i[s]&&!n)&&(i[s]=pointPool.newElement()),i[s][0]=e,i[s][1]=t},ShapePath.prototype.setTripleAt=function(e,t,a,s,n,i,o,u){this.setXYAt(e,t,"v",o,u),this.setXYAt(a,s,"o",o,u),this.setXYAt(n,i,"i",o,u)},ShapePath.prototype.reverse=function(){var e=new ShapePath;e.setPathData(this.c,this._length);var t=this.v,a=this.o,s=this.i,n=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],s[0][0],s[0][1],a[0][0],a[0][1],0,!1),n=1);var i=this._length-1,o=this._length,u;for(u=n;u=K[K.length-1].t-this.offsetTime)O=K[K.length-1].s?K[K.length-1].s[0]:K[K.length-2].e[0],U=!0;else{for(var b=T,k=K.length-1,F=!0,N,M,G;F&&(N=K[b],M=K[b+1],!(M.t-this.offsetTime>A));)b=M.t-this.offsetTime)H=1;else if(Ag&&A>g)||(this._caching.lastIndex=T0||N>-1e-6&&N<0?s(N*M)/M:N}function F(){var N=this.props,M=k(N[0]),G=k(N[1]),V=k(N[4]),ee=k(N[5]),ae=k(N[12]),ne=k(N[13]);return"matrix("+M+","+G+","+V+","+ee+","+ae+","+ne+")"}return function(){this.reset=n,this.rotate=i,this.rotateX=o,this.rotateY=u,this.rotateZ=l,this.skew=_,this.skewFromAxis=p,this.shear=c,this.scale=d,this.setTransform=E,this.translate=R,this.transform=y,this.multiply=I,this.applyToPoint=O,this.applyToX=C,this.applyToY=U,this.applyToZ=L,this.applyToPointArray=W,this.applyToTriplePoints=H,this.applyToPointStringified=K,this.toCSS=b,this.to2dCSS=F,this.clone=g,this.cloneFromProps=T,this.equals=x,this.inversePoints=B,this.inversePoint=X,this.getInverseMatrix=j,this._t=this.transform,this.isIdentity=A,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(e){"@babel/helpers - typeof";return _typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$3(e)}var lottie={};function setLocation(e){setLocationHref(e)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(e){setSubframeEnabled(e)}function setPrefix(e){setIdPrefix(e)}function loadAnimation(e){return animationManager.loadAnimation(e)}function setQuality(e){if(typeof e=="string")switch(e){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else!isNaN(e)&&e>1&&setDefaultCurveSegments(e)}function inBrowser(){return typeof navigator<"u"}function installPlugin(e,t){e==="expressions"&&setExpressionsPlugin(t)}function getFactory(e){switch(e){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.13.0";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(e){for(var t=queryString.split("&"),a=0;a=1?i.push({s:e-1,e:t-1}):(i.push({s:e,e:1}),i.push({s:0,e:t-1}));var o=[],u,l=i.length,c;for(u=0;us+a)){var _,p;c.s*n<=s?_=0:_=(c.s*n-s)/a,c.e*n>=s+a?p=1:p=(c.e*n-s)/a,o.push([_,p])}return o.length||o.push([0,0]),o},TrimModifier.prototype.releasePathsData=function(e){var t,a=e.length;for(t=0;t1?t=1+s:this.s.v<0?t=0+s:t=this.s.v+s,this.e.v>1?a=1+s:this.e.v<0?a=0+s:a=this.e.v+s,t>a){var n=t;t=a,a=n}t=Math.round(t*1e4)*1e-4,a=Math.round(a*1e4)*1e-4,this.sValue=t,this.eValue=a}else t=this.sValue,a=this.eValue;var i,o,u=this.shapes.length,l,c,_,p,d,E=0;if(a===t)for(o=0;o=0;o-=1)if(y=this.shapes[o],y.shape._mdf){for(I=y.localShapeCollection,I.releaseShapes(),this.m===2&&u>1?(T=this.calculateShapeEdges(t,a,y.totalShapeLength,g,E),g+=y.totalShapeLength):T=[[A,x]],c=T.length,l=0;l=1?R.push({s:y.totalShapeLength*(A-1),e:y.totalShapeLength*(x-1)}):(R.push({s:y.totalShapeLength*A,e:y.totalShapeLength}),R.push({s:0,e:y.totalShapeLength*(x-1)}));var O=this.addShapes(y,R[0]);if(R[0].s!==R[0].e){if(R.length>1){var C=y.shape.paths.shapes[y.shape.paths._length-1];if(C.c){var U=O.pop();this.addPaths(O,I),O=this.addShapes(y,R[1],U)}else this.addPaths(O,I),O=this.addShapes(y,R[1])}this.addPaths(O,I)}}y.shape.paths=I}}},TrimModifier.prototype.addPaths=function(e,t){var a,s=e.length;for(a=0;at.e){a.c=!1;break}else t.s<=c&&t.e>=c+_.addedLength?(this.addSegment(n[i].v[u-1],n[i].o[u-1],n[i].i[u],n[i].v[u],a,p,I),I=!1):(E=bez.getNewSegment(n[i].v[u-1],n[i].v[u],n[i].o[u-1],n[i].i[u],(t.s-c)/_.addedLength,(t.e-c)/_.addedLength,d[u-1]),this.addSegmentFromArray(E,a,p,I),I=!1,a.c=!1),c+=_.addedLength,p+=1;if(n[i].c&&d.length){if(_=d[u-1],c<=t.e){var A=d[u-1].addedLength;t.s<=c&&t.e>=c+A?(this.addSegment(n[i].v[u-1],n[i].o[u-1],n[i].i[0],n[i].v[0],a,p,I),I=!1):(E=bez.getNewSegment(n[i].v[u-1],n[i].v[0],n[i].o[u-1],n[i].i[0],(t.s-c)/A,(t.e-c)/A,d[u-1]),this.addSegmentFromArray(E,a,p,I),I=!1,a.c=!1)}else a.c=!1;c+=_.addedLength,p+=1}if(a._length&&(a.setXYAt(a.v[y][0],a.v[y][1],"i",y),a.setXYAt(a.v[a._length-1][0],a.v[a._length-1][1],"o",a._length-1)),c>t.e)break;i=this.p.keyframes[this.p.keyframes.length-1].t?(_=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/c,0),p=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/c,0)):(_=this.p.pv,p=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/c,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){_=[],p=[];var d=this.px,E=this.py;d._caching.lastFrame+d.offsetTime<=d.keyframes[0].t?(_[0]=d.getValueAtTime((d.keyframes[0].t+.01)/c,0),_[1]=E.getValueAtTime((E.keyframes[0].t+.01)/c,0),p[0]=d.getValueAtTime(d.keyframes[0].t/c,0),p[1]=E.getValueAtTime(E.keyframes[0].t/c,0)):d._caching.lastFrame+d.offsetTime>=d.keyframes[d.keyframes.length-1].t?(_[0]=d.getValueAtTime(d.keyframes[d.keyframes.length-1].t/c,0),_[1]=E.getValueAtTime(E.keyframes[E.keyframes.length-1].t/c,0),p[0]=d.getValueAtTime((d.keyframes[d.keyframes.length-1].t-.01)/c,0),p[1]=E.getValueAtTime((E.keyframes[E.keyframes.length-1].t-.01)/c,0)):(_=[d.pv,E.pv],p[0]=d.getValueAtTime((d._caching.lastFrame+d.offsetTime-.01)/c,d.offsetTime),p[1]=E.getValueAtTime((E._caching.lastFrame+E.offsetTime-.01)/c,E.offsetTime))}else p=e,_=p;this.v.rotate(-Math.atan2(_[1]-p[1],_[0]-p[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function s(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}function n(){}function i(l){this._addDynamicProperty(l),this.elem.addDynamicProperty(l),this._isDirty=!0}function o(l,c,_){if(this.elem=l,this.frameId=-1,this.propType="transform",this.data=c,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(_||l),c.p&&c.p.s?(this.px=PropertyFactory.getProp(l,c.p.x,0,0,this),this.py=PropertyFactory.getProp(l,c.p.y,0,0,this),c.p.z&&(this.pz=PropertyFactory.getProp(l,c.p.z,0,0,this))):this.p=PropertyFactory.getProp(l,c.p||{k:[0,0,0]},1,0,this),c.rx){if(this.rx=PropertyFactory.getProp(l,c.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(l,c.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(l,c.rz,0,degToRads,this),c.or.k[0].ti){var p,d=c.or.k.length;for(p=0;p0;)a-=1,this._elements.unshift(t[a]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(e){var t,a=e.length;for(t=0;t0?Math.floor(d):Math.ceil(d),y=this.pMatrix.props,I=this.rMatrix.props,A=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var x=0;if(d>0){for(;xR;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),x-=1;E&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-E,!0),x-=E)}s=this.data.m===1?0:this._currentCopies-1,n=this.data.m===1?1:-1,i=this._currentCopies;for(var g,T;i;){if(t=this.elemsData[s].it,a=t[t.length-1].transform.mProps.v.props,T=a.length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),x!==0){for((s!==0&&n===1||s!==this._currentCopies-1&&n===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(I[0],I[1],I[2],I[3],I[4],I[5],I[6],I[7],I[8],I[9],I[10],I[11],I[12],I[13],I[14],I[15]),this.matrix.transform(A[0],A[1],A[2],A[3],A[4],A[5],A[6],A[7],A[8],A[9],A[10],A[11],A[12],A[13],A[14],A[15]),this.matrix.transform(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),g=0;g0&&s<1?[t]:[]:[t-s,t+s].filter(function(n){return n>0&&n<1})},PolynomialBezier.prototype.split=function(e){if(e<=0)return[singlePoint(this.points[0]),this];if(e>=1)return[this,singlePoint(this.points[this.points.length-1])];var t=lerpPoint(this.points[0],this.points[1],e),a=lerpPoint(this.points[1],this.points[2],e),s=lerpPoint(this.points[2],this.points[3],e),n=lerpPoint(t,a,e),i=lerpPoint(a,s,e),o=lerpPoint(n,i,e);return[new PolynomialBezier(this.points[0],t,n,o,!0),new PolynomialBezier(o,i,s,this.points[3],!0)]};function extrema(e,t){var a=e.points[0][t],s=e.points[e.points.length-1][t];if(a>s){var n=s;s=a,a=n}for(var i=quadRoots(3*e.a[t],2*e.b[t],e.c[t]),o=0;o0&&i[o]<1){var u=e.point(i[o])[t];us&&(s=u)}return{min:a,max:s}}PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var e=this.bounds();return{left:e.x.min,right:e.x.max,top:e.y.min,bottom:e.y.max,width:e.x.max-e.x.min,height:e.y.max-e.y.min,cx:(e.x.max+e.x.min)/2,cy:(e.y.max+e.y.min)/2}};function intersectData(e,t,a){var s=e.boundingBox();return{cx:s.cx,cy:s.cy,width:s.width,height:s.height,bez:e,t:(t+a)/2,t1:t,t2:a}}function splitData(e){var t=e.bez.split(.5);return[intersectData(t[0],e.t1,e.t),intersectData(t[1],e.t,e.t2)]}function boxIntersect(e,t){return Math.abs(e.cx-t.cx)*2=i||e.width<=s&&e.height<=s&&t.width<=s&&t.height<=s){n.push([e.t,t.t]);return}var o=splitData(e),u=splitData(t);intersectsImpl(o[0],u[0],a+1,s,n,i),intersectsImpl(o[0],u[1],a+1,s,n,i),intersectsImpl(o[1],u[0],a+1,s,n,i),intersectsImpl(o[1],u[1],a+1,s,n,i)}}PolynomialBezier.prototype.intersections=function(e,t,a){t===void 0&&(t=2),a===void 0&&(a=7);var s=[];return intersectsImpl(intersectData(this,0,1),intersectData(e,0,1),0,t,s,a),s},PolynomialBezier.shapeSegment=function(e,t){var a=(t+1)%e.length();return new PolynomialBezier(e.v[t],e.o[t],e.i[a],e.v[a],!0)},PolynomialBezier.shapeSegmentInverted=function(e,t){var a=(t+1)%e.length();return new PolynomialBezier(e.v[a],e.i[a],e.o[t],e.v[t],!0)};function crossProduct(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function lineIntersection(e,t,a,s){var n=[e[0],e[1],1],i=[t[0],t[1],1],o=[a[0],a[1],1],u=[s[0],s[1],1],l=crossProduct(crossProduct(n,i),crossProduct(o,u));return floatZero(l[2])?null:[l[0]/l[2],l[1]/l[2]]}function polarOffset(e,t,a){return[e[0]+Math.cos(t)*a,e[1]-Math.sin(t)*a]}function pointDistance(e,t){return Math.hypot(e[0]-t[0],e[1]-t[1])}function pointEqual(e,t){return floatEqual(e[0],t[0])&&floatEqual(e[1],t[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(e,t.s,0,null,this),this.frequency=PropertyFactory.getProp(e,t.r,0,null,this),this.pointsType=PropertyFactory.getProp(e,t.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function setPoint(e,t,a,s,n,i,o){var u=a-Math.PI/2,l=a+Math.PI/2,c=t[0]+Math.cos(a)*s*n,_=t[1]-Math.sin(a)*s*n;e.setTripleAt(c,_,c+Math.cos(u)*i,_-Math.sin(u)*i,c+Math.cos(l)*o,_-Math.sin(l)*o,e.length())}function getPerpendicularVector(e,t){var a=[t[0]-e[0],t[1]-e[1]],s=-Math.PI*.5,n=[Math.cos(s)*a[0]-Math.sin(s)*a[1],Math.sin(s)*a[0]+Math.cos(s)*a[1]];return n}function getProjectingAngle(e,t){var a=t===0?e.length()-1:t-1,s=(t+1)%e.length(),n=e.v[a],i=e.v[s],o=getPerpendicularVector(n,i);return Math.atan2(0,1)-Math.atan2(o[1],o[0])}function zigZagCorner(e,t,a,s,n,i,o){var u=getProjectingAngle(t,a),l=t.v[a%t._length],c=t.v[a===0?t._length-1:a-1],_=t.v[(a+1)%t._length],p=i===2?Math.sqrt(Math.pow(l[0]-c[0],2)+Math.pow(l[1]-c[1],2)):0,d=i===2?Math.sqrt(Math.pow(l[0]-_[0],2)+Math.pow(l[1]-_[1],2)):0;setPoint(e,t.v[a%t._length],u,o,s,d/((n+1)*2),p/((n+1)*2))}function zigZagSegment(e,t,a,s,n,i){for(var o=0;o1&&t.length>1&&(n=getIntersection(e[0],t[t.length-1]),n)?[[e[0].split(n[0])[0]],[t[t.length-1].split(n[1])[1]]]:[a,s]}function pruneIntersections(e){for(var t,a=1;a1&&(t=pruneSegmentIntersection(e[e.length-1],e[0]),e[e.length-1]=t[0],e[0]=t[1]),e}function offsetSegmentSplit(e,t){var a=e.inflectionPoints(),s,n,i,o;if(a.length===0)return[offsetSegment(e,t)];if(a.length===1||floatEqual(a[1],1))return i=e.split(a[0]),s=i[0],n=i[1],[offsetSegment(s,t),offsetSegment(n,t)];i=e.split(a[0]),s=i[0];var u=(a[1]-a[0])/(1-a[0]);return i=i[1].split(u),o=i[0],n=i[1],[offsetSegment(s,t),offsetSegment(o,t),offsetSegment(n,t)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(e,t.a,0,null,this),this.miterLimit=PropertyFactory.getProp(e,t.ml,0,null,this),this.lineJoin=t.lj,this._isAnimated=this.amount.effectsSequence.length!==0},OffsetPathModifier.prototype.processPath=function(e,t,a,s){var n=shapePool.newElement();n.c=e.c;var i=e.length();e.c||(i-=1);var o,u,l,c=[];for(o=0;o=0;o-=1)l=PolynomialBezier.shapeSegmentInverted(e,o),c.push(offsetSegmentSplit(l,t));c=pruneIntersections(c);var _=null,p=null;for(o=0;o0&&(ee=!1),ee){var J=createTag("style");J.setAttribute("f-forigin",N[M].fOrigin),J.setAttribute("f-origin",N[M].origin),J.setAttribute("f-family",N[M].fFamily),J.type="text/css",J.innerText="@font-face {font-family: "+N[M].fFamily+"; font-style: normal; src: url('"+N[M].fPath+"');}",F.appendChild(J)}}else if(N[M].fOrigin==="g"||N[M].origin===1){for(ae=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),ne=0;ne=55296&&N<=56319){var M=k.charCodeAt(1);M>=56320&&M<=57343&&(F=(N-55296)*1024+M-56320+65536)}return F}function C(k,F){var N=k.toString(16)+F.toString(16);return p.indexOf(N)!==-1}function U(k){return k===l}function L(k){return k===u}function j(k){var F=O(k);return F>=c&&F<=_}function X(k){return j(k.substr(0,2))&&j(k.substr(2,2))}function B(k){return a.indexOf(k)!==-1}function H(k,F){var N=O(k.substr(F,2));if(N!==s)return!1;var M=0;for(F+=2;M<5;){if(N=O(k.substr(F,2)),No)return!1;M+=1,F+=2}return O(k.substr(F,2))===n}function W(){this.isLoaded=!0}var K=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};K.isModifier=C,K.isZeroWidthJoiner=U,K.isFlagEmoji=X,K.isRegionalCode=j,K.isCombinedCharacter=B,K.isRegionalFlag=H,K.isVariationSelector=L,K.BLACK_FLAG_CODE_POINT=s;var b={addChars:A,addFonts:I,getCharData:x,getFontByName:T,measureText:g,checkLoadedFonts:R,setIsLoaded:W};return K.prototype=b,K}();function SlotManager(e){this.animationData=e}SlotManager.prototype.getProp=function(e){return this.animationData.slots&&this.animationData.slots[e.sid]?Object.assign(e,this.animationData.slots[e.sid].p):e};function slotFactory(e){return new SlotManager(e)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){this.renderableComponents.indexOf(t)===-1&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){this.renderableComponents.indexOf(t)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,a=this.renderableComponents.length;for(t=0;t.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(e){this.audio.rate(e)},AudioElement.prototype.volume=function(e){this._volumeMultiplier=e,this._previousVolume=e*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(e){var t,a=this.layers.length,s;for(this.completeLayers=!0,t=a-1;t>=0;t-=1)this.elements[t]||(s=this.layers[t],s.ip-s.st<=e-this.layers[t].st&&s.op-s.st>e-this.layers[t].st&&this.buildItem(t)),this.completeLayers=this.elements[t]?this.completeLayers:!1;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e);default:return this.createNull(e)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(e){return new AudioElement(e,this.globalData,this)},BaseRenderer.prototype.createFootage=function(e){return new FootageElement(e,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e0&&(this.maskElement.setAttribute("id",d),this.element.maskedElement.setAttribute(x,"url("+getLocationHref()+"#"+d+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}MaskElement.prototype.getMaskProperty=function(e){return this.viewData[e].prop},MaskElement.prototype.renderFrame=function(e){var t=this.element.finalTransform.mat,a,s=this.masksProperties.length;for(a=0;a1&&(s+=" C"+t.o[n-1][0]+","+t.o[n-1][1]+" "+t.i[0][0]+","+t.i[0][1]+" "+t.v[0][0]+","+t.v[0][1]),a.lastPath!==s){var o="";a.elem&&(t.c&&(o=e.inv?this.solidPath+s:s),a.elem.setAttribute("d",o)),a.lastPath=s}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var e={};e.createFilter=t,e.createAlphaToLuminanceFilter=a;function t(s,n){var i=createNS("filter");return i.setAttribute("id",s),n!==!0&&(i.setAttribute("filterUnits","objectBoundingBox"),i.setAttribute("x","0%"),i.setAttribute("y","0%"),i.setAttribute("width","100%"),i.setAttribute("height","100%")),i}function a(){var s=createNS("feColorMatrix");return s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),s}return e}(),featureSupport=function(){var e={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(e.maskType=!1),/firefox/i.test(navigator.userAgent)&&(e.svgLumaHidden=!1),e}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(e){var t,a="SourceGraphic",s=e.data.ef?e.data.ef.length:0,n=createElementID(),i=filtersFactory.createFilter(n,!0),o=0;this.filters=[];var u;for(t=0;t=0&&(s=this.shapeModifiers[t].processShapes(this._isFirstFrame),!s);t-=1);}},searchProcessedElement:function(t){for(var a=this.processedElements,s=0,n=a.length;s.01)return!1;a+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e0;)A=d.transformers[j].mProps._mdf||A,L-=1,j-=1;if(A)for(L=O-d.styles[g].lvl,j=d.transformers.length-1;L>0;)U.multiply(d.transformers[j].mProps.v),L-=1,j-=1}else U=e;if(C=d.sh.paths,y=C._length,A){for(I="",R=0;R=1?W=.99:W<=-1&&(W=-.99);var K=B*W,b=Math.cos(H+d.a.v)*K+I[0],k=Math.sin(H+d.a.v)*K+I[1];R.setAttribute("fx",b),R.setAttribute("fy",k),y&&!d.g._collapsable&&(d.of.setAttribute("fx",b),d.of.setAttribute("fy",k))}}}function _(p,d,E){var R=d.style,y=d.d;y&&(y._mdf||E)&&y.dashStr&&(R.pElem.setAttribute("stroke-dasharray",y.dashStr),R.pElem.setAttribute("stroke-dashoffset",y.dashoffset[0])),d.c&&(d.c._mdf||E)&&R.pElem.setAttribute("stroke","rgb("+bmFloor(d.c.v[0])+","+bmFloor(d.c.v[1])+","+bmFloor(d.c.v[2])+")"),(d.o._mdf||E)&&R.pElem.setAttribute("stroke-opacity",d.o.v),(d.w._mdf||E)&&(R.pElem.setAttribute("stroke-width",d.w.v),R.msElem&&R.msElem.setAttribute("stroke-width",d.w.v))}return a}();function SVGShapeElement(e,t,a){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(e,t,a),this.prevViewData=[]}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var e,t=this.shapes.length,a,s,n=this.stylesList.length,i,o=[],u=!1;for(s=0;s1&&u&&this.setShapesAsAnimated(o)}},SVGShapeElement.prototype.setShapesAsAnimated=function(e){var t,a=e.length;for(t=0;t=0;l-=1){if(I=this.searchProcessedElement(e[l]),I?t[l]=a[I-1]:e[l]._render=o,e[l].ty==="fl"||e[l].ty==="st"||e[l].ty==="gf"||e[l].ty==="gs"||e[l].ty==="no")I?t[l].style.closed=e[l].hd:t[l]=this.createStyleElement(e[l],n),e[l]._render&&t[l].style.pElem.parentNode!==s&&s.appendChild(t[l].style.pElem),d.push(t[l].style);else if(e[l].ty==="gr"){if(!I)t[l]=this.createGroupElement(e[l]);else for(p=t[l].it.length,_=0;_1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(e){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!e)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,a=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var s,n=this.effectsSequence.length,i=e||this.data.d.k[this.keysIndex].s;for(s=0;st);)a+=1;return this.keysIndex!==a&&(this.keysIndex=a),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(e){for(var t=[],a=0,s=e.length,n,i,o=!1,u=!1,l="";a=55296&&n<=56319?FontManager.isRegionalFlag(e,a)?l=e.substr(a,14):(i=e.charCodeAt(a+1),i>=56320&&i<=57343&&(FontManager.isModifier(n,i)?(l=e.substr(a,2),o=!0):FontManager.isFlagEmoji(e.substr(a,4))?l=e.substr(a,4):l=e.substr(a,2))):n>56319?(i=e.charCodeAt(a+1),FontManager.isVariationSelector(n)&&(o=!0)):FontManager.isZeroWidthJoiner(n)&&(o=!0,u=!0),o?(t[t.length-1]+=l,o=!1):t.push(l),a+=l.length;return t},TextProperty.prototype.completeTextData=function(e){e.__complete=!0;var t=this.elem.globalData.fontManager,a=this.data,s=[],n,i,o,u=0,l,c=a.m.g,_=0,p=0,d=0,E=[],R=0,y=0,I,A,x=t.getFontByName(e.f),g,T=0,O=getFontProperties(x);e.fWeight=O.weight,e.fStyle=O.style,e.finalSize=e.s,e.finalText=this.buildFinalText(e.t),i=e.finalText.length,e.finalLineHeight=e.lh;var C=e.tr/1e3*e.finalSize,U;if(e.sz)for(var L=!0,j=e.sz[0],X=e.sz[1],B,H;L;){H=this.buildFinalText(e.t),B=0,R=0,i=H.length,C=e.tr/1e3*e.finalSize;var W=-1;for(n=0;nj&&H[n]!==" "?(W===-1?i+=1:n=W,B+=e.finalLineHeight||e.finalSize*1.2,H.splice(n,W===n?1:0,"\r"),W=-1,R=0):(R+=T,R+=C);B+=x.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&Xy?R:y,R=-2*C,l="",o=!0,d+=1):l=b,t.chars?(g=t.getCharData(b,x.fStyle,t.getFontByName(e.f).fFamily),T=o?0:g.w*e.finalSize/100):T=t.measureText(l,e.f,e.finalSize),b===" "?K+=T+C:(R+=T+C+K,K=0),s.push({l:T,an:T,add:_,n:o,anIndexes:[],val:l,line:d,animatorJustifyOffset:0}),c==2){if(_+=T,l===""||l===" "||n===i-1){for((l===""||l===" ")&&(_-=T);p<=n;)s[p].an=_,s[p].ind=u,s[p].extra=T,p+=1;u+=1,_=0}}else if(c==3){if(_+=T,l===""||n===i-1){for(l===""&&(_-=T);p<=n;)s[p].an=_,s[p].ind=u,s[p].extra=T,p+=1;_=0,u+=1}}else s[u].ind=u,s[u].extra=0,u+=1;if(e.l=s,y=R>y?R:y,E.push(R),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=y,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=E;var k=a.a,F,N;A=k.length;var M,G,V=[];for(I=0;I0?u=this.ne.v/100:l=-this.ne.v/100,this.xe.v>0?c=1-this.xe.v/100:_=1+this.xe.v/100;var p=BezierFactory.getBezierEasing(u,l,c,_).get,d=0,E=this.finalS,R=this.finalE,y=this.data.sh;if(y===2)R===E?d=o>=R?1:0:d=e(0,t(.5/(R-E)+(o-E)/(R-E),1)),d=p(d);else if(y===3)R===E?d=o>=R?0:1:d=1-e(0,t(.5/(R-E)+(o-E)/(R-E),1)),d=p(d);else if(y===4)R===E?d=0:(d=e(0,t(.5/(R-E)+(o-E)/(R-E),1)),d<.5?d*=2:d=1-2*(d-.5)),d=p(d);else if(y===5){if(R===E)d=0;else{var I=R-E;o=t(e(0,o+.5-E),R-E);var A=-I/2+o,x=I/2;d=Math.sqrt(1-A*A/(x*x))}d=p(d)}else y===6?(R===E?d=0:(o=t(e(0,o+.5-E),R-E),d=(1+Math.cos(Math.PI+Math.PI*2*o/(R-E)))/2),d=p(d)):(o>=a(E)&&(o-E<0?d=e(0,t(t(R,1)-(E-o),1)):d=e(0,t(R-o,1))),d=p(d));if(this.sm.v!==100){var g=this.sm.v*.01;g===0&&(g=1e-8);var T=.5-g*.5;d1&&(d=1))}return d*this.a.v},getValue:function(o){this.iterateDynamicProperties(),this._mdf=o||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,o&&this.data.r===2&&(this.e.v=this._currentTextLength);var u=this.data.r===2?1:100/this.data.totalChars,l=this.o.v/u,c=this.s.v/u+l,_=this.e.v/u+l;if(c>_){var p=c;c=_,_=p}this.finalS=c,this.finalE=_}},extendPrototype([DynamicPropertyContainer],s);function n(i,o,u){return new s(i,o)}return{getTextSelectorProp:n}}();function TextAnimatorDataProperty(e,t,a){var s={propType:!1},n=PropertyFactory.getProp,i=t.a;this.a={r:i.r?n(e,i.r,0,degToRads,a):s,rx:i.rx?n(e,i.rx,0,degToRads,a):s,ry:i.ry?n(e,i.ry,0,degToRads,a):s,sk:i.sk?n(e,i.sk,0,degToRads,a):s,sa:i.sa?n(e,i.sa,0,degToRads,a):s,s:i.s?n(e,i.s,1,.01,a):s,a:i.a?n(e,i.a,1,0,a):s,o:i.o?n(e,i.o,0,.01,a):s,p:i.p?n(e,i.p,1,0,a):s,sw:i.sw?n(e,i.sw,0,0,a):s,sc:i.sc?n(e,i.sc,1,0,a):s,fc:i.fc?n(e,i.fc,1,0,a):s,fh:i.fh?n(e,i.fh,0,0,a):s,fs:i.fs?n(e,i.fs,0,.01,a):s,fb:i.fb?n(e,i.fb,0,.01,a):s,t:i.t?n(e,i.t,0,0,a):s},this.s=TextSelectorProp.getTextSelectorProp(e,t.s,a),this.s.t=t.s.t}function TextAnimatorProperty(e,t,a){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=e,this._renderType=t,this._elem=a,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(a)}TextAnimatorProperty.prototype.searchProperties=function(){var e,t=this._textData.a.length,a,s=PropertyFactory.getProp;for(e=0;e=R+Re||!O?(j=(R+Re-I)/y.partialLength,ne=T.point[0]+(y.point[0]-T.point[0])*j,J=T.point[1]+(y.point[1]-T.point[1])*j,i.translate(-a[0]*d[_].an*.005,-(a[1]*K)*.01),A=!1):O&&(I+=y.partialLength,x+=1,x>=O.length&&(x=0,g+=1,C[g]?O=C[g].points:B.v.c?(x=0,g=0,O=C[g].points):(I-=y.partialLength,O=null)),O&&(T=y,y=O[x],U=y.partialLength));ae=d[_].an/2-d[_].add,i.translate(-ae,0,0)}else ae=d[_].an/2-d[_].add,i.translate(-ae,0,0),i.translate(-a[0]*d[_].an*.005,-a[1]*K*.01,0);for(N=0;Ne?this.textSpans[e].span:createNS(u?"g":"text"),g<=e){if(l.setAttribute("stroke-linecap","butt"),l.setAttribute("stroke-linejoin","round"),l.setAttribute("stroke-miterlimit","4"),this.textSpans[e].span=l,u){var O=createNS("g");l.appendChild(O),this.textSpans[e].childSpan=O}this.textSpans[e].span=l,this.layerElement.appendChild(l)}l.style.display="inherit"}if(c.reset(),p&&(o[e].n&&(d=-y,E+=a.yOffset,E+=R?1:0,R=!1),this.applyTextPropertiesToMatrix(a,c,o[e].line,d,E),d+=o[e].l||0,d+=y),u){T=this.globalData.fontManager.getCharData(a.finalText[e],s.fStyle,this.globalData.fontManager.getFontByName(a.f).fFamily);var C;if(T.t===1)C=new SVGCompElement(T.data,this.globalData,this);else{var U=emptyShapeData;T.data&&T.data.shapes&&(U=this.buildShapeData(T.data,a.finalSize)),C=new SVGShapeElement(U,this.globalData,this)}if(this.textSpans[e].glyph){var L=this.textSpans[e].glyph;this.textSpans[e].childSpan.removeChild(L.layerElement),L.destroy()}this.textSpans[e].glyph=C,C._debug=!0,C.prepareFrame(0),C.renderFrame(),this.textSpans[e].childSpan.appendChild(C.layerElement),T.t===1&&this.textSpans[e].childSpan.setAttribute("transform","scale("+a.finalSize/100+","+a.finalSize/100+")")}else p&&l.setAttribute("transform","translate("+c.props[12]+","+c.props[13]+")"),l.textContent=o[e].val,l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}p&&l&&l.setAttribute("d",_)}for(;e=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;t=0;a-=1)(this.completeLayers||this.elements[a])&&(this.elements[a].prepareFrame(this.renderedFrame-this.layers[a].st),this.elements[a]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;e=0;s-=1)t.finalTransform.multiply(t.transforms[s].transform.mProps.v);t._mdf=i},processSequences:function(t){var a,s=this.sequenceList.length;for(a=0;a=1){this.buffers=[];var t=this.globalData.canvasContext,a=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(a);var s=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(s),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var a=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=a}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(t){t.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var t=this.buffers[0],a=t.getContext("2d");this.clearCanvas(a),a.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var t=this.buffers[1],a=t.getContext("2d");this.clearCanvas(a),a.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);var s=this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1);if(s.renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var n=assetLoader.getLumaCanvas(this.canvasContext.canvas),i=n.getContext("2d");i.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(n,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(t,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(t){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!t)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var a=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(a),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(a),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement;function CVShapeData(e,t,a,s){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var n=4;t.ty==="rc"?n=5:t.ty==="el"?n=6:t.ty==="sr"&&(n=7),this.sh=ShapePropertyFactory.getShapeProp(e,t,n,e);var i,o=a.length,u;for(i=0;i=0;i-=1){if(p=this.searchProcessedElement(e[i]),p?t[i]=a[p-1]:e[i]._shouldRender=s,e[i].ty==="fl"||e[i].ty==="st"||e[i].ty==="gf"||e[i].ty==="gs")p?t[i].style.closed=!1:t[i]=this.createStyleElement(e[i],R),c.push(t[i].style);else if(e[i].ty==="gr"){if(!p)t[i]=this.createGroupElement(e[i]);else for(l=t[i].it.length,u=0;u=0;n-=1)t[n].ty==="tr"?(o=a[n].transform,this.renderShapeTransform(e,o)):t[n].ty==="sh"||t[n].ty==="el"||t[n].ty==="rc"||t[n].ty==="sr"?this.renderPath(t[n],a[n]):t[n].ty==="fl"?this.renderFill(t[n],a[n],o):t[n].ty==="st"?this.renderStroke(t[n],a[n],o):t[n].ty==="gf"||t[n].ty==="gs"?this.renderGradientFill(t[n],a[n],o):t[n].ty==="gr"?this.renderShape(o,t[n].it,a[n].it):t[n].ty;s&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(e,t){if(this._isFirstFrame||t._mdf||e.transforms._mdf){var a=e.trNodes,s=t.paths,n,i,o,u=s._length;a.length=0;var l=e.transforms.finalTransform;for(o=0;o=1?_=.99:_<=-1&&(_=-.99);var p=l*_,d=Math.cos(c+t.a.v)*p+o[0],E=Math.sin(c+t.a.v)*p+o[1];n=i.createRadialGradient(d,E,0,o[0],o[1],l)}var R,y=e.g.p,I=t.g.c,A=1;for(R=0;Ri&&l==="xMidYMid slice"||nn&&u==="meet"||in&&u==="slice")?this.transformCanvas.tx=(a-this.transformCanvas.w*(s/this.transformCanvas.h))/2*this.renderConfig.dpr:c==="xMax"&&(in&&u==="slice")?this.transformCanvas.tx=(a-this.transformCanvas.w*(s/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,_==="YMid"&&(i>n&&u==="meet"||in&&u==="meet"||i=0;e-=1)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(e,t){if(!(this.renderedFrame===e&&this.renderConfig.clearCanvas===!0&&!t||this.destroyed||e===-1)){this.renderedFrame=e,this.globalData.frameNum=e-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||t,this.globalData.projectInterface.currentFrame=e;var a,s=this.layers.length;for(this.completeLayers||this.checkLayers(e),a=s-1;a>=0;a-=1)(this.completeLayers||this.elements[a])&&this.elements[a].prepareFrame(e-this.layers[a].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),a=s-1;a>=0;a-=1)(this.completeLayers||this.elements[a])&&this.elements[a].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(e){var t=this.elements;if(!(t[e]||this.layers[e].ty===99)){var a=this.createItem(this.layers[e],this,this.globalData);t[e]=a,a.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var e=this.pendingElements.pop();e.checkParenting()}},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"};function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random()}function CVContextData(){this.stack=[],this.cArrPos=0,this.cTr=new Matrix;var e,t=15;for(e=0;e=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},CVCompElement.prototype.destroy=function(){var e,t=this.layers.length;for(e=t-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)};function CanvasRenderer(e,t){this.animationItem=e,this.renderConfig={clearCanvas:t&&t.clearCanvas!==void 0?t.clearCanvas:!0,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",className:t&&t.className||"",id:t&&t.id||"",runExpressions:!t||t.runExpressions===void 0||t.runExpressions},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)};function HBaseElement(){}HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.bm!==0&&this.setBlendMode()},renderElement:function(){var t=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var a=this.finalTransform.mat.toCSS();t.transform=a,t.webkitTransform=a}this.finalTransform._opMdf&&(t.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting;function HSolidElement(e,t,a){this.initElement(e,t,a)}extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var e;this.data.hasMask?(e=createNS("rect"),e.setAttribute("width",this.data.sw),e.setAttribute("height",this.data.sh),e.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):(e=createTag("div"),e.style.width=this.data.sw+"px",e.style.height=this.data.sh+"px",e.style.backgroundColor=this.data.sc),this.layerElement.appendChild(e)};function HShapeElement(e,t,a){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(e,t,a),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var e;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),e=this.svgElement;else{e=createNS("svg");var t=this.comp.data?this.comp.data:this.globalData.compSize;e.setAttribute("width",t.w),e.setAttribute("height",t.h),e.appendChild(this.shapesContainer),this.layerElement.appendChild(e)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=e},HShapeElement.prototype.getTransformedPoint=function(e,t){var a,s=e.length;for(a=0;a0&&l<1&&n[d].push(this.calculateF(l,e,t,a,s,d))):(c=o*o-4*u*i,c>=0&&(_=(-o+bmSqrt(c))/(2*i),_>0&&_<1&&n[d].push(this.calculateF(_,e,t,a,s,d)),p=(-o-bmSqrt(c))/(2*i),p>0&&p<1&&n[d].push(this.calculateF(p,e,t,a,s,d)))));this.shapeBoundingBox.left=bmMin.apply(null,n[0]),this.shapeBoundingBox.top=bmMin.apply(null,n[1]),this.shapeBoundingBox.right=bmMax.apply(null,n[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,n[1])},HShapeElement.prototype.calculateF=function(e,t,a,s,n,i){return bmPow(1-e,3)*t[i]+3*bmPow(1-e,2)*e*a[i]+3*(1-e)*bmPow(e,2)*s[i]+bmPow(e,3)*n[i]},HShapeElement.prototype.calculateBoundingBox=function(e,t){var a,s=e.length;for(a=0;aa&&(a=n)}a*=e.mult}else a=e.v*e.mult;t.x-=a,t.xMax+=a,t.y-=a,t.yMax+=a},HShapeElement.prototype.currentBoxContains=function(e){return this.currentBBox.x<=e.x&&this.currentBBox.y<=e.y&&this.currentBBox.width+this.currentBBox.x>=e.x+e.width&&this.currentBBox.height+this.currentBBox.y>=e.y+e.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var e=this.tempBoundingBox,t=999999;if(e.x=t,e.xMax=-t,e.y=t,e.yMax=-t,this.calculateBoundingBox(this.itemsData,e),e.width=e.xMax=0;t-=1){var s=this.hierarchy[t].finalTransform.mProp;this.mat.translate(-s.p.v[0],-s.p.v[1],s.p.v[2]),this.mat.rotateX(-s.or.v[0]).rotateY(-s.or.v[1]).rotateZ(s.or.v[2]),this.mat.rotateX(-s.rx.v).rotateY(-s.ry.v).rotateZ(s.rz.v),this.mat.scale(1/s.s.v[0],1/s.s.v[1],1/s.s.v[2]),this.mat.translate(s.a.v[0],s.a.v[1],s.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var n;this.p?n=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:n=[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var i=Math.sqrt(Math.pow(n[0],2)+Math.pow(n[1],2)+Math.pow(n[2],2)),o=[n[0]/i,n[1]/i,n[2]/i],u=Math.sqrt(o[2]*o[2]+o[0]*o[0]),l=Math.atan2(o[1],u),c=Math.atan2(o[0],-o[2]);this.mat.rotateY(c).rotateX(-l)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var _=!this._prevMat.equals(this.mat);if((_||this.pe._mdf)&&this.comp.threeDElements){a=this.comp.threeDElements.length;var p,d,E;for(t=0;t=e)return this.threeDElements[t].perspectiveElem;t+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(e,t){var a=createTag("div"),s,n;styleDiv(a);var i=createTag("div");if(styleDiv(i),t==="3d"){s=a.style,s.width=this.globalData.compSize.w+"px",s.height=this.globalData.compSize.h+"px";var o="50% 50%";s.webkitTransformOrigin=o,s.mozTransformOrigin=o,s.transformOrigin=o,n=i.style;var u="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";n.transform=u,n.webkitTransform=u}a.appendChild(i);var l={container:i,perspectiveElem:a,startPos:e,endPos:e,type:t};return this.threeDElements.push(l),l},HybridRendererBase.prototype.build3dContainers=function(){var e,t=this.layers.length,a,s="";for(e=0;e=0;e-=1)this.resizerElem.appendChild(this.threeDElements[e].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(e,t){for(var a=0,s=this.threeDElements.length;aa?(n=e/this.globalData.compSize.w,i=e/this.globalData.compSize.w,o=0,u=(t-this.globalData.compSize.h*(e/this.globalData.compSize.w))/2):(n=t/this.globalData.compSize.h,i=t/this.globalData.compSize.h,o=(e-this.globalData.compSize.w*(t/this.globalData.compSize.h))/2,u=0);var l=this.resizerElem.style;l.webkitTransform="matrix3d("+n+",0,0,0,0,"+i+",0,0,0,0,1,0,"+o+","+u+",0,1)",l.transform=l.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var e=this.globalData.compSize.w,t=this.globalData.compSize.h,a,s=this.threeDElements.length;for(a=0;a=c;)B/=2,H/=2,W>>>=1;return(B+W)/H};return j.int32=function(){return L.g(4)|0},j.quick=function(){return L.g(4)/4294967296},j.double=j,I(x(L.S),e),(T.pass||O||function(X,B,H,W){return W&&(W.S&&R(W,L),X.state=function(){return R(L,{})}),H?(t[o]=X,B):X})(j,U,"global"in T?T.global:this==t,T.state)}t["seed"+o]=d;function E(g){var T,O=g.length,C=this,U=0,L=C.i=C.j=0,j=C.S=[];for(O||(g=[O++]);Ua){var s=a;a=t,t=s}return Math.min(Math.max(e,t),a)}function radiansToDegrees(e){return e/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(e){return e*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(e,t){if(typeof e=="number"||e instanceof Number)return t=t||0,Math.abs(e-t);t||(t=helperLengthArray);var a,s=Math.min(e.length,t.length),n=0;for(a=0;a.5?c/(2-n-i):c/(n+i),n){case t:o=(a-s)/c+(a1&&(a-=1),a<1/6?e+(t-e)*6*a:a<1/2?t:a<2/3?e+(t-e)*(2/3-a)*6:e}function hslToRgb(e){var t=e[0],a=e[1],s=e[2],n,i,o;if(a===0)n=s,o=s,i=s;else{var u=s<.5?s*(1+a):s+a-s*a,l=2*s-u;n=hue2rgb(l,u,t+1/3),i=hue2rgb(l,u,t),o=hue2rgb(l,u,t-1/3)}return[n,i,o,e[3]]}function linear(e,t,a,s,n){if((s===void 0||n===void 0)&&(s=t,n=a,t=0,a=1),a=a)return n;var o=a===t?0:(e-t)/(a-t);if(!s.length)return s+(n-s)*o;var u,l=s.length,c=createTypedArray("float32",l);for(u=0;u1){for(n=0;n1?t=1:t<0&&(t=0);var o=e(t);if($bm_isInstanceOfArray(n)){var u,l=n.length,c=createTypedArray("float32",l);for(u=0;udata.k[t].t&&edata.k[t+1].t-e?(s=t+2,n=data.k[t+1].t):(s=t+1,n=data.k[t].t);break}s===-1&&(s=t+1,n=data.k[t].t)}var i={};return i.index=s,i.time=n/elem.comp.globalData.frameRate,i}function key(e){var t,a,s;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+e);e-=1,t={time:data.k[e].t/elem.comp.globalData.frameRate,value:[]};var n=Object.prototype.hasOwnProperty.call(data.k[e],"s")?data.k[e].s:data.k[e-1].e;for(s=n.length,a=0;aI.length-1)&&(E=I.length-1),g=I[I.length-1-E].t,x=A-g);var T,O,C;if(d==="pingpong"){var U=Math.floor((y-g)/x);if(U%2!==0)return this.getValueAtTime((x-(y-g)%x+g)/this.comp.globalData.frameRate,0)}else if(d==="offset"){var L=this.getValueAtTime(g/this.comp.globalData.frameRate,0),j=this.getValueAtTime(A/this.comp.globalData.frameRate,0),X=this.getValueAtTime(((y-g)%x+g)/this.comp.globalData.frameRate,0),B=Math.floor((y-g)/x);if(this.pv.length){for(C=new Array(L.length),O=C.length,T=0;T=A)return this.pv;var x,g;R?(E?x=Math.abs(this.elem.comp.globalData.frameRate*E):x=Math.max(0,this.elem.data.op-A),g=A+x):((!E||E>I.length-1)&&(E=I.length-1),g=I[E].t,x=g-A);var T,O,C;if(d==="pingpong"){var U=Math.floor((A-y)/x);if(U%2===0)return this.getValueAtTime(((A-y)%x+A)/this.comp.globalData.frameRate,0)}else if(d==="offset"){var L=this.getValueAtTime(A/this.comp.globalData.frameRate,0),j=this.getValueAtTime(g/this.comp.globalData.frameRate,0),X=this.getValueAtTime((x-(A-y)%x+A)/this.comp.globalData.frameRate,0),B=Math.floor((A-y)/x)+1;if(this.pv.length){for(C=new Array(L.length),O=C.length,T=0;T1?(I-y)/(E-1):1,x=0,g=0,T;this.pv.length?T=createTypedArray("float32",this.pv.length):T=0;for(var O;xx){var U=g,L=y.c&&g===T-1?0:g+1,j=(x-O)/A[g].addedLength;C=bez.getPointInSegment(y.v[U],y.v[L],y.o[U],y.i[L],j,A[g]);break}else O+=A[g].addedLength;g+=1}return C||(C=y.c?[y.v[0][0],y.v[0][1]]:[y.v[y._length-1][0],y.v[y._length-1][1]]),C},vectorOnPath:function(E,R,y){E==1?E=this.v.c:E==0&&(E=.999);var I=this.pointOnPath(E,R),A=this.pointOnPath(E+.001,R),x=A[0]-I[0],g=A[1]-I[1],T=Math.sqrt(Math.pow(x,2)+Math.pow(g,2));if(T===0)return[0,0];var O=y==="tangent"?[x/T,g/T]:[-g/T,x/T];return O},tangentOnPath:function(E,R){return this.vectorOnPath(E,R,"tangent")},normalOnPath:function(E,R){return this.vectorOnPath(E,R,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([_],l),extendPrototype([_],c),c.prototype.getValueAtTime=u,c.prototype.initiateExpression=ExpressionManager.initiateExpression;var p=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(d,E,R,y,I){var A=p(d,E,R,y,I);return A.propertyIndex=E.ix,A.lock=!1,R===3?expressionHelpers.searchExpressions(d,E.pt,A):R===4&&expressionHelpers.searchExpressions(d,E.ks,A),A.k&&d.addDynamicProperty(A),A}}function initialize$1(){addPropertyDecorator()}function addDecorator(){function e(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(t,a){var s=this.calculateExpression(a);if(t.t!==s){var n={};return this.copyData(n,t),n.t=s.toString(),n.__complete=!1,n}return t},TextProperty.prototype.searchProperty=function(){var t=this.searchKeyframes(),a=this.searchExpressions();return this.kf=t||a,this.kf},TextProperty.prototype.searchExpressions=e}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function e(t,a){var s=createNS("feMerge");s.setAttribute("result",t);var n,i;for(i=0;i=c?p=R<0?s:n:p=s+E*Math.pow((u-e)/R,1/a),_[d]=p,d+=1,i+=256/(o-1);return _.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t,a=this.filterManager.effectElements;this.feFuncRComposed&&(e||a[3].p._mdf||a[4].p._mdf||a[5].p._mdf||a[6].p._mdf||a[7].p._mdf)&&(t=this.getTableValue(a[3].p.v,a[4].p.v,a[5].p.v,a[6].p.v,a[7].p.v),this.feFuncRComposed.setAttribute("tableValues",t),this.feFuncGComposed.setAttribute("tableValues",t),this.feFuncBComposed.setAttribute("tableValues",t)),this.feFuncR&&(e||a[10].p._mdf||a[11].p._mdf||a[12].p._mdf||a[13].p._mdf||a[14].p._mdf)&&(t=this.getTableValue(a[10].p.v,a[11].p.v,a[12].p.v,a[13].p.v,a[14].p.v),this.feFuncR.setAttribute("tableValues",t)),this.feFuncG&&(e||a[17].p._mdf||a[18].p._mdf||a[19].p._mdf||a[20].p._mdf||a[21].p._mdf)&&(t=this.getTableValue(a[17].p.v,a[18].p.v,a[19].p.v,a[20].p.v,a[21].p.v),this.feFuncG.setAttribute("tableValues",t)),this.feFuncB&&(e||a[24].p._mdf||a[25].p._mdf||a[26].p._mdf||a[27].p._mdf||a[28].p._mdf)&&(t=this.getTableValue(a[24].p.v,a[25].p.v,a[26].p.v,a[27].p.v,a[28].p.v),this.feFuncB.setAttribute("tableValues",t)),this.feFuncA&&(e||a[31].p._mdf||a[32].p._mdf||a[33].p._mdf||a[34].p._mdf||a[35].p._mdf)&&(t=this.getTableValue(a[31].p.v,a[32].p.v,a[33].p.v,a[34].p.v,a[35].p.v),this.feFuncA.setAttribute("tableValues",t))}};function SVGDropShadowEffect(e,t,a,s,n){var i=t.container.globalData.renderConfig.filterSize,o=t.data.fs||i;e.setAttribute("x",o.x||i.x),e.setAttribute("y",o.y||i.y),e.setAttribute("width",o.width||i.width),e.setAttribute("height",o.height||i.height),this.filterManager=t;var u=createNS("feGaussianBlur");u.setAttribute("in","SourceAlpha"),u.setAttribute("result",s+"_drop_shadow_1"),u.setAttribute("stdDeviation","0"),this.feGaussianBlur=u,e.appendChild(u);var l=createNS("feOffset");l.setAttribute("dx","25"),l.setAttribute("dy","0"),l.setAttribute("in",s+"_drop_shadow_1"),l.setAttribute("result",s+"_drop_shadow_2"),this.feOffset=l,e.appendChild(l);var c=createNS("feFlood");c.setAttribute("flood-color","#00ff00"),c.setAttribute("flood-opacity","1"),c.setAttribute("result",s+"_drop_shadow_3"),this.feFlood=c,e.appendChild(c);var _=createNS("feComposite");_.setAttribute("in",s+"_drop_shadow_3"),_.setAttribute("in2",s+"_drop_shadow_2"),_.setAttribute("operator","in"),_.setAttribute("result",s+"_drop_shadow_4"),e.appendChild(_);var p=this.createMergeNode(s,[s+"_drop_shadow_4",n]);e.appendChild(p)}extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){if((e||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),e||this.filterManager.effectElements[0].p._mdf){var t=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(t[0]*255),Math.round(t[1]*255),Math.round(t[2]*255)))}if((e||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),e||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var a=this.filterManager.effectElements[3].p.v,s=(this.filterManager.effectElements[2].p.v-90)*degToRads,n=a*Math.cos(s),i=a*Math.sin(s);this.feOffset.setAttribute("dx",n),this.feOffset.setAttribute("dy",i)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(e,t,a){this.initialized=!1,this.filterManager=t,this.filterElem=e,this.elem=a,a.matteElement=createNS("g"),a.matteElement.appendChild(a.layerElement),a.matteElement.appendChild(a.transformedElement),a.baseElement=a.matteElement}SVGMatte3Effect.prototype.findSymbol=function(e){for(var t=0,a=_svgMatteSymbols.length;te.length)&&(t=e.length);for(var a=0,s=Array(t);a0&&arguments[0]!==void 0?arguments[0]:{},ae;if(U.current){(ae=C.current)===null||ae===void 0||ae.destroy();var ne=_objectSpread2(_objectSpread2(_objectSpread2({},t),ee),{},{container:U.current});return C.current=lottie.loadAnimation(ne),O(!!C.current),function(){var J;(J=C.current)===null||J===void 0||J.destroy(),C.current=void 0}}};reactExports.useEffect(function(){var V=M();return function(){return V==null?void 0:V()}},[s,n]),reactExports.useEffect(function(){C.current&&(C.current.autoplay=!!i)},[i]),reactExports.useEffect(function(){if(C.current){if(!o){C.current.resetSegments(!0);return}!Array.isArray(o)||!o.length||((C.current.currentRawFrameo[1])&&(C.current.currentRawFrame=o[0]),C.current.setSegment(o[0],o[1]))}},[o]),reactExports.useEffect(function(){var V=[{name:"complete",handler:u},{name:"loopComplete",handler:l},{name:"enterFrame",handler:c},{name:"segmentStart",handler:_},{name:"config_ready",handler:p},{name:"data_ready",handler:d},{name:"data_failed",handler:E},{name:"loaded_images",handler:R},{name:"DOMLoaded",handler:y},{name:"destroy",handler:I}],ee=V.filter(function(ne){return ne.handler!=null});if(ee.length){var ae=ee.map(function(ne){var J;return(J=C.current)===null||J===void 0||J.addEventListener(ne.name,ne.handler),function(){var ue;(ue=C.current)===null||ue===void 0||ue.removeEventListener(ne.name,ne.handler)}});return function(){ae.forEach(function(ne){return ne()})}}},[u,l,c,_,p,d,E,R,y,I]);var G=React.createElement("div",_objectSpread2({style:a,ref:U},A));return{View:G,play:L,stop:j,pause:X,setSpeed:B,goToAndStop:W,goToAndPlay:H,setDirection:K,playSegments:b,setSubframe:k,getDuration:F,destroy:N,animationContainerRef:U,animationLoaded:T,animationItem:C.current}};function getContainerVisibility(e){var t=e.getBoundingClientRect(),a=t.top,s=t.height,n=window.innerHeight-a,i=window.innerHeight+s;return n/i}function getContainerCursorPosition(e,t,a){var s=e.getBoundingClientRect(),n=s.top,i=s.left,o=s.width,u=s.height,l=(t-i)/o,c=(a-n)/u;return{x:l,y:c}}var useInitInteractivity=function e(t){var a=t.wrapperRef,s=t.animationItem,n=t.mode,i=t.actions;reactExports.useEffect(function(){var o=a.current;if(!(!o||!s||!i.length)){s.stop();var u=function(){var _=null,p=function(){var E=getContainerVisibility(o),R=i.find(function(I){var A=I.visibility;return A&&E>=A[0]&&E<=A[1]});if(R){if(R.type==="seek"&&R.visibility&&R.frames.length===2){var y=R.frames[0]+Math.ceil((E-R.visibility[0])/(R.visibility[1]-R.visibility[0])*R.frames[1]);//! goToAndStop must be relative to the start of the current segment +s.goToAndStop(y-s.firstFrame-1,!0)}R.type==="loop"&&(_===null||_!==R.frames||s.isPaused)&&(s.playSegments(R.frames,!0),_=R.frames),R.type==="play"&&s.isPaused&&(s.resetSegments(!0),s.play()),R.type==="stop"&&s.goToAndStop(R.frames[0]-s.firstFrame-1,!0)}};return document.addEventListener("scroll",p),function(){document.removeEventListener("scroll",p)}},l=function(){var _=function(R,y){var I=R,A=y;if(I!==-1&&A!==-1){var x=getContainerCursorPosition(o,I,A);I=x.x,A=x.y}var g=i.find(function(C){var U=C.position;return U&&Array.isArray(U.x)&&Array.isArray(U.y)?I>=U.x[0]&&I<=U.x[1]&&A>=U.y[0]&&A<=U.y[1]:U&&!Number.isNaN(U.x)&&!Number.isNaN(U.y)?I===U.x&&A===U.y:!1});if(g){if(g.type==="seek"&&g.position&&Array.isArray(g.position.x)&&Array.isArray(g.position.y)&&g.frames.length===2){var T=(I-g.position.x[0])/(g.position.x[1]-g.position.x[0]),O=(A-g.position.y[0])/(g.position.y[1]-g.position.y[0]);s.playSegments(g.frames,!0),s.goToAndStop(Math.ceil((T+O)/2*(g.frames[1]-g.frames[0])),!0)}g.type==="loop"&&s.playSegments(g.frames,!0),g.type==="play"&&(s.isPaused&&s.resetSegments(!1),s.playSegments(g.frames)),g.type==="stop"&&s.goToAndStop(g.frames[0],!0)}},p=function(R){_(R.clientX,R.clientY)},d=function(){_(-1,-1)};return o.addEventListener("mousemove",p),o.addEventListener("mouseout",d),function(){o.removeEventListener("mousemove",p),o.removeEventListener("mouseout",d)}};switch(n){case"scroll":return u();case"cursor":return l()}}},[n,s])},useLottieInteractivity=function e(t){var a=t.actions,s=t.mode,n=t.lottieObj,i=n.animationItem,o=n.View,u=n.animationContainerRef;return useInitInteractivity({actions:a,animationItem:i,mode:s,wrapperRef:u}),o},_excluded$i=["style","interactivity"],Lottie=function e(t){var a,s,n,i=t.style,o=t.interactivity,u=_objectWithoutProperties(t,_excluded$i),l=useLottie(u,i),c=l.View,_=l.play,p=l.stop,d=l.pause,E=l.setSpeed,R=l.goToAndStop,y=l.goToAndPlay,I=l.setDirection,A=l.playSegments,x=l.setSubframe,g=l.getDuration,T=l.destroy,O=l.animationContainerRef,C=l.animationLoaded,U=l.animationItem;return reactExports.useEffect(function(){t.lottieRef&&(t.lottieRef.current={play:_,stop:p,pause:d,setSpeed:E,goToAndPlay:y,goToAndStop:R,setDirection:I,playSegments:A,setSubframe:x,getDuration:g,destroy:T,animationContainerRef:O,animationLoaded:C,animationItem:U})},[(a=t.lottieRef)===null||a===void 0?void 0:a.current]),useLottieInteractivity({lottieObj:{View:c,play:_,stop:p,pause:d,setSpeed:E,goToAndStop:R,goToAndPlay:y,setDirection:I,playSegments:A,setSubframe:x,getDuration:g,destroy:T,animationContainerRef:O,animationLoaded:C,animationItem:U},actions:(s=o==null?void 0:o.actions)!==null&&s!==void 0?s:[],mode:(n=o==null?void 0:o.mode)!==null&&n!==void 0?n:"scroll"})};const LoadingText=styled(Typography)(({theme:e})=>({color:"#fdfdff",fontSize:"1.2rem",fontWeight:600,textShadow:"0 0 8px rgba(255, 255, 255, 0.7)"})),Loading=()=>{const e=useDispatch(),t=useSelector(a=>a.appSlice.loading);return reactExports.useEffect(()=>{e(LOADING_END())},[]),jsxRuntimeExports.jsx(Backdrop,{sx:{color:"#fff",zIndex:a=>a.zIndex.drawer+999999},open:t,children:jsxRuntimeExports.jsxs(Grid,{container:!0,justifyContent:"center",direction:"column",alignItems:"center",children:[jsxRuntimeExports.jsx(Grid,{width:"400px",alignSelf:"center",children:jsxRuntimeExports.jsx(Lottie,{animationData:loading,loop:!0})}),jsxRuntimeExports.jsx(Grid,{children:jsxRuntimeExports.jsx(LoadingText,{children:"لطفاً صبر کنید"})})]})})},AvicultureRequests=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AvicultureRequests-BpPrjqVS.js"),__vite__mapDeps([220,1,2,20,21,4,24,23,147,32,118,34,106,15,16,35,38,39,36,37,12,13,14,64,107,41,33,85,221,42,43,44,27,28,179,53,54,55])))),NewFile$5=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./NewFile-DzVKWg18.js"),__vite__mapDeps([210,1,2,211,12,13,4,14,15,16,29,59,201,212,36,30,102,103,213,35,161])))),Inspects=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AvicultureHallInspects-JeacJRRj.js"),__vite__mapDeps([222,1,2,4,161,12,13,14,15,16])))),Auction$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Auction-CSwFRyO3.js"),__vite__mapDeps([223,1,2,4,27,13,14,15,16,201,83])))),Tickets$4=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Tickets-rkAj5df6.js"),__vite__mapDeps([207,1,2,55,102,103,16,4,70,197,51,111,112,14,42,43,44])))),Halls=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AvicultureHalls-BI0mP85Q.js"),__vite__mapDeps([224,1,2,4,42,43,44])))),Reports$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AvicultureReports-Ca1oaxvj.js"),__vite__mapDeps([225,1,2,4,27,13,14,15,16,28,202,179,203])))),AviculturePricing=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceManagePricing-C6sFsNo-.js"),__vite__mapDeps([75,1,2,4,36,76,42,43,44,46,45])))),avicultureRouting=[{path:[ROUTE_AVICULTURE_REQUESTS,ROUTE_AVICULTURE_HATCHING,ROUTE_AVICULTURE_CREATE_NEW_REQUEST,ROUTE_AVICULTURE_REJECTED_REQUESTS,ROUTE_AVICULTURE_ARCHIVED_REQUESTS,ROUTE_AVICULTURE_AWAITING_PAYMENT_REQUESTS,ROUTE_AVICULTURE_AWAITING_INSPECTION_REQUESTS,ROUTE_AVICULTURE_SUBMIT_REQUEST,ROUTE_AVICULTURE_GIVE_PERMISSION],Page:AvicultureRequests,exact:!1,props:{}},{path:[ROUTE_AVICULTURE_AUCTION],Page:Auction$1,exact:!1,props:{}},{path:[ROUTE_AVICULTURE_FILE_ROUTE],Page:NewFile$5,exact:!1,props:{}},{path:[ROUTE_AVICULTURE_VIEW_TICKET,ROUTE_AVICULTURE_TICKET],Page:Tickets$4,exact:!1,props:{}},{path:[ROUTE_AVICULTURE_ROUTE_HALLS],Page:Halls,exact:!1,props:{}},{path:[ROUTE_AVICULTURE_INSPECTS_ROUTE],Page:Inspects,exact:!1,props:{}},{path:[ROUTE_AVICULTURE_REPORTS],Page:Reports$2,exact:!1,props:{}},{path:[ROUTE_AVICULTURE_PRICING],Page:AviculturePricing,exact:!1,props:{}}],logo$1="/assets/logo-C6BrLS5z.png",iranView="/assets/IranOutlined-CUL7OBR7.png";var Home={},_interopRequireDefault$1q=interopRequireDefaultExports;Object.defineProperty(Home,"__esModule",{value:!0});var default_1$1q=Home.default=void 0,_createSvgIcon$1q=_interopRequireDefault$1q(requireCreateSvgIcon()),_jsxRuntime$1q=jsxRuntimeExports;default_1$1q=Home.default=(0,_createSvgIcon$1q.default)((0,_jsxRuntime$1q.jsx)("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),"Home");var PermPhoneMsg={},_interopRequireDefault$1p=interopRequireDefaultExports;Object.defineProperty(PermPhoneMsg,"__esModule",{value:!0});var default_1$1p=PermPhoneMsg.default=void 0,_createSvgIcon$1p=_interopRequireDefault$1p(requireCreateSvgIcon()),_jsxRuntime$1p=jsxRuntimeExports;default_1$1p=PermPhoneMsg.default=(0,_createSvgIcon$1p.default)((0,_jsxRuntime$1p.jsx)("path",{d:"M20 15.5c-1.25 0-2.45-.2-3.57-.57-.35-.11-.74-.03-1.02.24l-2.2 2.2c-2.83-1.44-5.15-3.75-6.59-6.58l2.2-2.21c.28-.27.36-.66.25-1.01C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.5c0-.55-.45-1-1-1M12 3v10l3-3h6V3z"}),"PermPhoneMsg");var Email={},_interopRequireDefault$1o=interopRequireDefaultExports;Object.defineProperty(Email,"__esModule",{value:!0});var default_1$1o=Email.default=void 0,_createSvgIcon$1o=_interopRequireDefault$1o(requireCreateSvgIcon()),_jsxRuntime$1o=jsxRuntimeExports;default_1$1o=Email.default=(0,_createSvgIcon$1o.default)((0,_jsxRuntime$1o.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4-8 5-8-5V6l8 5 8-5z"}),"Email");var AccountCircleRounded={},_interopRequireDefault$1n=interopRequireDefaultExports;Object.defineProperty(AccountCircleRounded,"__esModule",{value:!0});var default_1$1n=AccountCircleRounded.default=void 0,_createSvgIcon$1n=_interopRequireDefault$1n(requireCreateSvgIcon()),_jsxRuntime$1n=jsxRuntimeExports;default_1$1n=AccountCircleRounded.default=(0,_createSvgIcon$1n.default)((0,_jsxRuntime$1n.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6m0 14c-2.03 0-4.43-.82-6.14-2.88C7.55 15.8 9.68 15 12 15s4.45.8 6.14 2.12C16.43 19.18 14.03 20 12 20"}),"AccountCircleRounded");var ExitToApp={},_interopRequireDefault$1m=interopRequireDefaultExports;Object.defineProperty(ExitToApp,"__esModule",{value:!0});var default_1$1m=ExitToApp.default=void 0,_createSvgIcon$1m=_interopRequireDefault$1m(requireCreateSvgIcon()),_jsxRuntime$1m=jsxRuntimeExports;default_1$1m=ExitToApp.default=(0,_createSvgIcon$1m.default)((0,_jsxRuntime$1m.jsx)("path",{d:"M10.09 15.59 11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"ExitToApp");var PlayCircle={},_interopRequireDefault$1l=interopRequireDefaultExports;Object.defineProperty(PlayCircle,"__esModule",{value:!0});var default_1$1l=PlayCircle.default=void 0,_createSvgIcon$1l=_interopRequireDefault$1l(requireCreateSvgIcon()),_jsxRuntime$1l=jsxRuntimeExports;default_1$1l=PlayCircle.default=(0,_createSvgIcon$1l.default)((0,_jsxRuntime$1l.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M9.5 16.5v-9l7 4.5z"}),"PlayCircle");var KeyboardReturn={},_interopRequireDefault$1k=interopRequireDefaultExports;Object.defineProperty(KeyboardReturn,"__esModule",{value:!0});var default_1$1k=KeyboardReturn.default=void 0,_createSvgIcon$1k=_interopRequireDefault$1k(requireCreateSvgIcon()),_jsxRuntime$1k=jsxRuntimeExports;default_1$1k=KeyboardReturn.default=(0,_createSvgIcon$1k.default)((0,_jsxRuntime$1k.jsx)("path",{d:"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z"}),"KeyboardReturn");var Drafts={},_interopRequireDefault$1j=interopRequireDefaultExports;Object.defineProperty(Drafts,"__esModule",{value:!0});var default_1$1j=Drafts.default=void 0,_createSvgIcon$1j=_interopRequireDefault$1j(requireCreateSvgIcon()),_jsxRuntime$1j=jsxRuntimeExports;default_1$1j=Drafts.default=(0,_createSvgIcon$1j.default)((0,_jsxRuntime$1j.jsx)("path",{d:"M21.99 8c0-.72-.37-1.35-.94-1.7L12 1 2.95 6.3C2.38 6.65 2 7.28 2 8v10c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2zM12 13 3.74 7.84 12 3l8.26 4.84z"}),"Drafts");const MotionConfigContext=reactExports.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),MotionContext=reactExports.createContext({});function useVisualElementContext(){return reactExports.useContext(MotionContext).visualElement}const PresenceContext=reactExports.createContext(null),isBrowser=typeof document<"u",useIsomorphicLayoutEffect$1=isBrowser?reactExports.useLayoutEffect:reactExports.useEffect,LazyContext=reactExports.createContext({strict:!1});function useVisualElement(e,t,a,s){const n=useVisualElementContext(),i=reactExports.useContext(LazyContext),o=reactExports.useContext(PresenceContext),u=reactExports.useContext(MotionConfigContext).reducedMotion,l=reactExports.useRef();s=s||i.renderer,!l.current&&s&&(l.current=s(e,{visualState:t,parent:n,props:a,presenceId:o?o.id:void 0,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:u}));const c=l.current;return useIsomorphicLayoutEffect$1(()=>{c&&c.render()}),useIsomorphicLayoutEffect$1(()=>{c&&c.animationState&&c.animationState.animateChanges()}),useIsomorphicLayoutEffect$1(()=>()=>c&&c.notify("Unmount"),[]),c}function isRefObject(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function useMotionRef(e,t,a){return reactExports.useCallback(s=>{s&&e.mount&&e.mount(s),t&&(s?t.mount(s):t.unmount()),a&&(typeof a=="function"?a(s):isRefObject(a)&&(a.current=s))},[t])}function isVariantLabel(e){return typeof e=="string"||Array.isArray(e)}function isAnimationControls(e){return typeof e=="object"&&typeof e.start=="function"}const variantProps$1=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function isControllingVariants(e){return isAnimationControls(e.animate)||variantProps$1.some(t=>isVariantLabel(e[t]))}function isVariantNode(e){return!!(isControllingVariants(e)||e.variants)}function getCurrentTreeVariants(e,t){if(isControllingVariants(e)){const{initial:a,animate:s}=e;return{initial:a===!1||isVariantLabel(a)?a:void 0,animate:isVariantLabel(s)?s:void 0}}return e.inherit!==!1?t:{}}function useCreateMotionContext(e){const{initial:t,animate:a}=getCurrentTreeVariants(e,reactExports.useContext(MotionContext));return reactExports.useMemo(()=>({initial:t,animate:a}),[variantLabelsAsDependency(t),variantLabelsAsDependency(a)])}function variantLabelsAsDependency(e){return Array.isArray(e)?e.join(" "):e}const createDefinition=e=>({isEnabled:t=>e.some(a=>!!t[a])}),featureDefinitions={measureLayout:createDefinition(["layout","layoutId","drag"]),animation:createDefinition(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:createDefinition(["exit"]),drag:createDefinition(["drag","dragControls"]),focus:createDefinition(["whileFocus"]),hover:createDefinition(["whileHover","onHoverStart","onHoverEnd"]),tap:createDefinition(["whileTap","onTap","onTapStart","onTapCancel"]),pan:createDefinition(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:createDefinition(["whileInView","onViewportEnter","onViewportLeave"])};function loadFeatures(e){for(const t in e)t==="projectionNodeConstructor"?featureDefinitions.projectionNodeConstructor=e[t]:featureDefinitions[t].Component=e[t]}function useConstant(e){const t=reactExports.useRef(null);return t.current===null&&(t.current=e()),t.current}const globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let id$1=1;function useProjectionId(){return useConstant(()=>{if(globalProjectionState.hasEverUpdated)return id$1++})}const LayoutGroupContext=reactExports.createContext({});class VisualElementHandler extends React.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:a}=this.props;return t&&t.setProps(a),null}componentDidUpdate(){}render(){return this.props.children}}const SwitchLayoutGroupContext=reactExports.createContext({}),motionComponentSymbol=Symbol.for("motionComponentSymbol");function createMotionComponent({preloadedFeatures:e,createVisualElement:t,projectionNodeConstructor:a,useRender:s,useVisualState:n,Component:i}){e&&loadFeatures(e);function o(l,c){const _={...reactExports.useContext(MotionConfigContext),...l,layoutId:useLayoutId(l)},{isStatic:p}=_;let d=null;const E=useCreateMotionContext(l),R=p?void 0:useProjectionId(),y=n(l,p);if(!p&&isBrowser){E.visualElement=useVisualElement(i,y,_,t);const I=reactExports.useContext(LazyContext).strict,A=reactExports.useContext(SwitchLayoutGroupContext);E.visualElement&&(d=E.visualElement.loadFeatures(_,I,e,R,a||featureDefinitions.projectionNodeConstructor,A))}return reactExports.createElement(VisualElementHandler,{visualElement:E.visualElement,props:_},d,reactExports.createElement(MotionContext.Provider,{value:E},s(i,l,R,useMotionRef(y,E.visualElement,c),y,p,E.visualElement)))}const u=reactExports.forwardRef(o);return u[motionComponentSymbol]=i,u}function useLayoutId({layoutId:e}){const t=reactExports.useContext(LayoutGroupContext).id;return t&&e!==void 0?t+"-"+e:e}function createMotionProxy(e){function t(s,n={}){return createMotionComponent(e(s,n))}if(typeof Proxy>"u")return t;const a=new Map;return new Proxy(t,{get:(s,n)=>(a.has(n)||a.set(n,t(n)),a.get(n))})}const lowercaseSVGElements=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function isSVGComponent(e){return typeof e!="string"||e.includes("-")?!1:!!(lowercaseSVGElements.indexOf(e)>-1||/[A-Z]/.test(e))}const scaleCorrectors={};function addScaleCorrector(e){Object.assign(scaleCorrectors,e)}const transformPropOrder=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],transformProps=new Set(transformPropOrder);function isForcedMotionValue(e,{layout:t,layoutId:a}){return transformProps.has(e)||e.startsWith("origin")||(t||a!==void 0)&&(!!scaleCorrectors[e]||e==="opacity")}const isMotionValue=e=>!!(e!=null&&e.getVelocity),translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},sortTransformProps=(e,t)=>transformPropOrder.indexOf(e)-transformPropOrder.indexOf(t);function buildTransform({transform:e,transformKeys:t},{enableHardwareAcceleration:a=!0,allowTransformNone:s=!0},n,i){let o="";t.sort(sortTransformProps);for(const u of t)o+=`${translateAlias[u]||u}(${e[u]}) `;return a&&!e.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(e,n?"":o):s&&n&&(o="none"),o}function isCSSVariable$1(e){return e.startsWith("--")}const getValueAsType=(e,t)=>t&&typeof e=="number"?t.transform(e):e,clamp=(e,t,a)=>Math.min(Math.max(a,e),t),number$1={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},alpha={...number$1,transform:e=>clamp(0,1,e)},scale={...number$1,default:1},sanitize=e=>Math.round(e*1e5)/1e5,floatRegex=/(-)?([\d]*\.?[\d])+/g,colorRegex=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,singleColorRegex=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function isString$2(e){return typeof e=="string"}const createUnitType=e=>({test:t=>isString$2(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage={...percent,parse:e=>percent.parse(e)/100,transform:e=>percent.transform(e*100)},int={...number$1,transform:Math.round},numberValueTypes={borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int};function buildHTMLStyles(e,t,a,s){const{style:n,vars:i,transform:o,transformKeys:u,transformOrigin:l}=e;u.length=0;let c=!1,_=!1,p=!0;for(const d in t){const E=t[d];if(isCSSVariable$1(d)){i[d]=E;continue}const R=numberValueTypes[d],y=getValueAsType(E,R);if(transformProps.has(d)){if(c=!0,o[d]=y,u.push(d),!p)continue;E!==(R.default||0)&&(p=!1)}else d.startsWith("origin")?(_=!0,l[d]=y):n[d]=y}if(t.transform||(c||s?n.transform=buildTransform(e,a,p,s):n.transform&&(n.transform="none")),_){const{originX:d="50%",originY:E="50%",originZ:R=0}=l;n.transformOrigin=`${d} ${E} ${R}`}}const createHtmlRenderState=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function copyRawValuesOnly(e,t,a){for(const s in t)!isMotionValue(t[s])&&!isForcedMotionValue(s,a)&&(e[s]=t[s])}function useInitialMotionValues({transformTemplate:e},t,a){return reactExports.useMemo(()=>{const s=createHtmlRenderState();return buildHTMLStyles(s,t,{enableHardwareAcceleration:!a},e),Object.assign({},s.vars,s.style)},[t])}function useStyle(e,t,a){const s=e.style||{},n={};return copyRawValuesOnly(n,s,e),Object.assign(n,useInitialMotionValues(e,t,a)),e.transformValues?e.transformValues(n):n}function useHTMLProps(e,t,a){const s={},n=useStyle(e,t,a);return e.drag&&e.dragListener!==!1&&(s.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),s.style=n,s}const animationProps=["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],tapProps=["whileTap","onTap","onTapStart","onTapCancel"],panProps=["onPan","onPanStart","onPanSessionStart","onPanEnd"],inViewProps=["whileInView","onViewportEnter","onViewportLeave","viewport"],validMotionProps=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll",...inViewProps,...tapProps,...animationProps,...panProps]);function isValidMotionProp(e){return validMotionProps.has(e)}let shouldForward=e=>!isValidMotionProp(e);function loadExternalIsValidProp(e){e&&(shouldForward=t=>t.startsWith("on")?!isValidMotionProp(t):e(t))}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch(e){}function filterProps(e,t,a){const s={};for(const n in e)(shouldForward(n)||a===!0&&isValidMotionProp(n)||!t&&!isValidMotionProp(n)||e.draggable&&n.startsWith("onDrag"))&&(s[n]=e[n]);return s}function calcOrigin$1(e,t,a){return typeof e=="string"?e:px.transform(t+a*e)}function calcSVGTransformOrigin(e,t,a){const s=calcOrigin$1(t,e.x,e.width),n=calcOrigin$1(a,e.y,e.height);return`${s} ${n}`}const dashKeys={offset:"stroke-dashoffset",array:"stroke-dasharray"},camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(e,t,a=1,s=0,n=!0){e.pathLength=1;const i=n?dashKeys:camelKeys;e[i.offset]=px.transform(-s);const o=px.transform(t),u=px.transform(a);e[i.array]=`${o} ${u}`}function buildSVGAttrs(e,{attrX:t,attrY:a,originX:s,originY:n,pathLength:i,pathSpacing:o=1,pathOffset:u=0,...l},c,_,p){if(buildHTMLStyles(e,l,c,p),_){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:E,dimensions:R}=e;d.transform&&(R&&(E.transform=d.transform),delete d.transform),R&&(s!==void 0||n!==void 0||E.transform)&&(E.transformOrigin=calcSVGTransformOrigin(R,s!==void 0?s:.5,n!==void 0?n:.5)),t!==void 0&&(d.x=t),a!==void 0&&(d.y=a),i!==void 0&&buildSVGPath(d,i,o,u,!1)}const createSvgRenderState=()=>({...createHtmlRenderState(),attrs:{}}),isSVGTag=e=>typeof e=="string"&&e.toLowerCase()==="svg";function useSVGProps(e,t,a,s){const n=reactExports.useMemo(()=>{const i=createSvgRenderState();return buildSVGAttrs(i,t,{enableHardwareAcceleration:!1},isSVGTag(s),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};copyRawValuesOnly(i,e.style,e),n.style={...i,...n.style}}return n}function createUseRender(e=!1){return(a,s,n,i,{latestValues:o},u)=>{const c=(isSVGComponent(a)?useSVGProps:useHTMLProps)(s,o,u,a),p={...filterProps(s,typeof a=="string",e),...c,ref:i};return n&&(p["data-projection-id"]=n),reactExports.createElement(a,p)}}const camelToDash=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function renderHTML(e,{style:t,vars:a},s,n){Object.assign(e.style,t,n&&n.getProjectionStyles(s));for(const i in a)e.style.setProperty(i,a[i])}const camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function renderSVG(e,t,a,s){renderHTML(e,t,void 0,s);for(const n in t.attrs)e.setAttribute(camelCaseAttributes.has(n)?n:camelToDash(n),t.attrs[n])}function scrapeMotionValuesFromProps$1(e){const{style:t}=e,a={};for(const s in t)(isMotionValue(t[s])||isForcedMotionValue(s,e))&&(a[s]=t[s]);return a}function scrapeMotionValuesFromProps(e){const t=scrapeMotionValuesFromProps$1(e);for(const a in e)if(isMotionValue(e[a])){const s=a==="x"||a==="y"?"attr"+a.toUpperCase():a;t[s]=e[a]}return t}function resolveVariantFromProps(e,t,a,s={},n={}){return typeof t=="function"&&(t=t(a!==void 0?a:e.custom,s,n)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(a!==void 0?a:e.custom,s,n)),t}const isKeyframesTarget=e=>Array.isArray(e),isCustomValue=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),resolveFinalValueInKeyframes=e=>isKeyframesTarget(e)?e[e.length-1]||0:e;function resolveMotionValue(e){const t=isMotionValue(e)?e.get():e;return isCustomValue(t)?t.toValue():t}function makeState({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:a},s,n,i){const o={latestValues:makeLatestValues(s,n,i,e),renderState:t()};return a&&(o.mount=u=>a(s,u,o)),o}const makeUseVisualState=e=>(t,a)=>{const s=reactExports.useContext(MotionContext),n=reactExports.useContext(PresenceContext),i=()=>makeState(e,t,s,n);return a?i():useConstant(i)};function makeLatestValues(e,t,a,s){const n={},i=s(e);for(const d in i)n[d]=resolveMotionValue(i[d]);let{initial:o,animate:u}=e;const l=isControllingVariants(e),c=isVariantNode(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),u===void 0&&(u=t.animate));let _=a?a.initial===!1:!1;_=_||o===!1;const p=_?u:o;return p&&typeof p!="boolean"&&!isAnimationControls(p)&&(Array.isArray(p)?p:[p]).forEach(E=>{const R=resolveVariantFromProps(e,E);if(!R)return;const{transitionEnd:y,transition:I,...A}=R;for(const x in A){let g=A[x];if(Array.isArray(g)){const T=_?g.length-1:0;g=g[T]}g!==null&&(n[x]=g)}for(const x in y)n[x]=y[x]}),n}const svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:(e,t,{renderState:a,latestValues:s})=>{try{a.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{a.dimensions={x:0,y:0,width:0,height:0}}buildSVGAttrs(a,s,{enableHardwareAcceleration:!1},isSVGTag(t.tagName),e.transformTemplate),renderSVG(t,a)}})},htmlMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function createDomMotionConfig(e,{forwardMotionProps:t=!1},a,s,n){return{...isSVGComponent(e)?svgMotionConfig:htmlMotionConfig,preloadedFeatures:a,useRender:createUseRender(t),createVisualElement:s,projectionNodeConstructor:n,Component:e}}var AnimationType;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(AnimationType||(AnimationType={}));function addDomEvent(e,t,a,s={passive:!0}){return e.addEventListener(t,a,s),()=>e.removeEventListener(t,a)}function useDomEvent(e,t,a,s){reactExports.useEffect(()=>{const n=e.current;if(a&&n)return addDomEvent(n,t,a,s)},[e,t,a,s])}function useFocusGesture({whileFocus:e,visualElement:t}){const{animationState:a}=t,s=()=>{a&&a.setActive(AnimationType.Focus,!0)},n=()=>{a&&a.setActive(AnimationType.Focus,!1)};useDomEvent(t,"focus",e?s:void 0),useDomEvent(t,"blur",e?n:void 0)}function isMouseEvent(e){return typeof PointerEvent<"u"&&e instanceof PointerEvent?e.pointerType==="mouse":e instanceof MouseEvent}function isTouchEvent(e){return!!e.touches}function filterPrimaryPointer(e){return t=>{const a=t instanceof MouseEvent;(!a||a&&t.button===0)&&e(t)}}const defaultPagePoint={pageX:0,pageY:0};function pointFromTouch(e,t="page"){const s=e.touches[0]||e.changedTouches[0]||defaultPagePoint;return{x:s[t+"X"],y:s[t+"Y"]}}function pointFromMouse(e,t="page"){return{x:e[t+"X"],y:e[t+"Y"]}}function extractEventInfo(e,t="page"){return{point:isTouchEvent(e)?pointFromTouch(e,t):pointFromMouse(e,t)}}const wrapHandler=(e,t=!1)=>{const a=s=>e(s,extractEventInfo(s));return t?filterPrimaryPointer(a):a},supportsPointerEvents=()=>isBrowser&&window.onpointerdown===null,supportsTouchEvents=()=>isBrowser&&window.ontouchstart===null,supportsMouseEvents=()=>isBrowser&&window.onmousedown===null,mouseEventNames={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},touchEventNames={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function getPointerEventName(e){return supportsPointerEvents()?e:supportsTouchEvents()?touchEventNames[e]:supportsMouseEvents()?mouseEventNames[e]:e}function addPointerEvent(e,t,a,s){return addDomEvent(e,getPointerEventName(t),wrapHandler(a,t==="pointerdown"),s)}function usePointerEvent(e,t,a,s){return useDomEvent(e,getPointerEventName(t),a&&wrapHandler(a,t==="pointerdown"),s)}function createLock(e){let t=null;return()=>{const a=()=>{t=null};return t===null?(t=e,a):!1}}const globalHorizontalLock=createLock("dragHorizontal"),globalVerticalLock=createLock("dragVertical");function getGlobalLock(e){let t=!1;if(e==="y")t=globalVerticalLock();else if(e==="x")t=globalHorizontalLock();else{const a=globalHorizontalLock(),s=globalVerticalLock();a&&s?t=()=>{a(),s()}:(a&&a(),s&&s())}return t}function isDragActive(){const e=getGlobalLock(!0);return e?(e(),!1):!0}function createHoverEvent(e,t,a){return(s,n)=>{!isMouseEvent(s)||isDragActive()||(e.animationState&&e.animationState.setActive(AnimationType.Hover,t),a&&a(s,n))}}function useHoverGesture({onHoverStart:e,onHoverEnd:t,whileHover:a,visualElement:s}){usePointerEvent(s,"pointerenter",e||a?createHoverEvent(s,!0,e):void 0,{passive:!e}),usePointerEvent(s,"pointerleave",t||a?createHoverEvent(s,!1,t):void 0,{passive:!t})}const isNodeOrChild=(e,t)=>t?e===t?!0:isNodeOrChild(e,t.parentElement):!1;function useUnmountEffect(e){return reactExports.useEffect(()=>()=>e(),[])}const combineFunctions=(e,t)=>a=>t(e(a)),pipe=(...e)=>e.reduce(combineFunctions);function useTapGesture({onTap:e,onTapStart:t,onTapCancel:a,whileTap:s,visualElement:n}){const i=e||t||a||s,o=reactExports.useRef(!1),u=reactExports.useRef(null),l={passive:!(t||e||a||E)};function c(){u.current&&u.current(),u.current=null}function _(){return c(),o.current=!1,n.animationState&&n.animationState.setActive(AnimationType.Tap,!1),!isDragActive()}function p(R,y){_()&&(isNodeOrChild(n.current,R.target)?e&&e(R,y):a&&a(R,y))}function d(R,y){_()&&a&&a(R,y)}function E(R,y){c(),!o.current&&(o.current=!0,u.current=pipe(addPointerEvent(window,"pointerup",p,l),addPointerEvent(window,"pointercancel",d,l)),n.animationState&&n.animationState.setActive(AnimationType.Tap,!0),t&&t(R,y))}usePointerEvent(n,"pointerdown",i?E:void 0,l),useUnmountEffect(c)}const observerCallbacks=new WeakMap,observers=new WeakMap,fireObserverCallback=e=>{const t=observerCallbacks.get(e.target);t&&t(e)},fireAllObserverCallbacks=e=>{e.forEach(fireObserverCallback)};function initIntersectionObserver({root:e,...t}){const a=e||document;observers.has(a)||observers.set(a,{});const s=observers.get(a),n=JSON.stringify(t);return s[n]||(s[n]=new IntersectionObserver(fireAllObserverCallbacks,{root:e,...t})),s[n]}function observeIntersection(e,t,a){const s=initIntersectionObserver(t);return observerCallbacks.set(e,a),s.observe(e),()=>{observerCallbacks.delete(e),s.unobserve(e)}}function useViewport({visualElement:e,whileInView:t,onViewportEnter:a,onViewportLeave:s,viewport:n={}}){const i=reactExports.useRef({hasEnteredView:!1,isInView:!1});let o=!!(t||a||s);n.once&&i.current.hasEnteredView&&(o=!1),(typeof IntersectionObserver>"u"?useMissingIntersectionObserver:useIntersectionObserver)(o,i.current,e,n)}const thresholdNames={some:0,all:1};function useIntersectionObserver(e,t,a,{root:s,margin:n,amount:i="some",once:o}){reactExports.useEffect(()=>{if(!e||!a.current)return;const u={root:s==null?void 0:s.current,rootMargin:n,threshold:typeof i=="number"?i:thresholdNames[i]},l=c=>{const{isIntersecting:_}=c;if(t.isInView===_||(t.isInView=_,o&&!_&&t.hasEnteredView))return;_&&(t.hasEnteredView=!0),a.animationState&&a.animationState.setActive(AnimationType.InView,_);const p=a.getProps(),d=_?p.onViewportEnter:p.onViewportLeave;d&&d(c)};return observeIntersection(a.current,u,l)},[e,s,n,i])}function useMissingIntersectionObserver(e,t,a,{fallback:s=!0}){reactExports.useEffect(()=>{!e||!s||requestAnimationFrame(()=>{t.hasEnteredView=!0;const{onViewportEnter:n}=a.getProps();n&&n(null),a.animationState&&a.animationState.setActive(AnimationType.InView,!0)})},[e])}const makeRenderlessComponent=e=>t=>(e(t),null),gestureAnimations={inView:makeRenderlessComponent(useViewport),tap:makeRenderlessComponent(useTapGesture),focus:makeRenderlessComponent(useFocusGesture),hover:makeRenderlessComponent(useHoverGesture)};function usePresence(){const e=reactExports.useContext(PresenceContext);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:a,register:s}=e,n=reactExports.useId();return reactExports.useEffect(()=>s(n),[]),!t&&a?[!1,()=>a&&a(n)]:[!0]}function shallowCompare(e,t){if(!Array.isArray(t))return!1;const a=t.length;if(a!==e.length)return!1;for(let s=0;s/^\-?\d*\.?\d+$/.test(e),isZeroValueString=e=>/^0[^.\s]+$/.test(e),frameData={delta:0,timestamp:0},defaultTimestep=1/60*1e3,getCurrentTime=typeof performance<"u"?()=>performance.now():()=>Date.now(),onNextFrame=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(getCurrentTime()),defaultTimestep);function createRenderStep(e){let t=[],a=[],s=0,n=!1,i=!1;const o=new WeakSet,u={schedule:(l,c=!1,_=!1)=>{const p=_&&n,d=p?t:a;return c&&o.add(l),d.indexOf(l)===-1&&(d.push(l),p&&n&&(s=t.length)),l},cancel:l=>{const c=a.indexOf(l);c!==-1&&a.splice(c,1),o.delete(l)},process:l=>{if(n){i=!0;return}if(n=!0,[t,a]=[a,t],a.length=0,s=t.length,s)for(let c=0;c(e[t]=createRenderStep(()=>runNextFrame=!0),e),{}),sync=stepsOrder.reduce((e,t)=>{const a=steps[t];return e[t]=(s,n=!1,i=!1)=>(runNextFrame||startLoop(),a.schedule(s,n,i)),e},{}),cancelSync=stepsOrder.reduce((e,t)=>(e[t]=steps[t].cancel,e),{}),flushSync=stepsOrder.reduce((e,t)=>(e[t]=()=>steps[t].process(frameData),e),{}),processStep=e=>steps[e].process(frameData),processFrame=e=>{runNextFrame=!1,frameData.delta=useDefaultElapsed?defaultTimestep:Math.max(Math.min(e-frameData.timestamp,maxElapsed),1),frameData.timestamp=e,isProcessing=!0,stepsOrder.forEach(processStep),isProcessing=!1,runNextFrame&&(useDefaultElapsed=!1,onNextFrame(processFrame))},startLoop=()=>{runNextFrame=!0,useDefaultElapsed=!0,isProcessing||onNextFrame(processFrame)};function addUniqueItem(e,t){e.indexOf(t)===-1&&e.push(t)}function removeItem(e,t){const a=e.indexOf(t);a>-1&&e.splice(a,1)}class SubscriptionManager{constructor(){this.subscriptions=[]}add(t){return addUniqueItem(this.subscriptions,t),()=>removeItem(this.subscriptions,t)}notify(t,a,s){const n=this.subscriptions.length;if(n)if(n===1)this.subscriptions[0](t,a,s);else for(let i=0;i!isNaN(parseFloat(e));class MotionValue{constructor(t,a={}){this.version="7.10.3",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(s,n=!0)=>{this.prev=this.current,this.current=s;const{delta:i,timestamp:o}=frameData;this.lastUpdated!==o&&(this.timeDelta=i,this.lastUpdated=o,sync.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),n&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>sync.postRender(this.velocityCheck),this.velocityCheck=({timestamp:s})=>{s!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=isFloat(this.current),this.owner=a.owner}onChange(t){return this.on("change",t)}on(t,a){return this.events[t]||(this.events[t]=new SubscriptionManager),this.events[t].add(a)}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t){this.passiveEffect=t}set(t,a=!0){!a||!this.passiveEffect?this.updateAndNotify(t,a):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,a,s){this.set(a),this.prev=t,this.timeDelta=s}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?velocityPerSecond(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.stopAnimation=t(a),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.stopAnimation&&(this.stopAnimation(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.clearListeners(),this.stop()}}function motionValue(e,t){return new MotionValue(e,t)}const isColorString=(e,t)=>a=>!!(isString$2(a)&&singleColorRegex.test(a)&&a.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(a,t)),splitColor=(e,t,a)=>s=>{if(!isString$2(s))return s;const[n,i,o,u]=s.match(floatRegex);return{[e]:parseFloat(n),[t]:parseFloat(i),[a]:parseFloat(o),alpha:u!==void 0?parseFloat(u):1}},clampRgbUnit=e=>clamp(0,255,e),rgbUnit={...number$1,transform:e=>Math.round(clampRgbUnit(e))},rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:e,green:t,blue:a,alpha:s=1})=>"rgba("+rgbUnit.transform(e)+", "+rgbUnit.transform(t)+", "+rgbUnit.transform(a)+", "+sanitize(alpha.transform(s))+")"};function parseHex(e){let t="",a="",s="",n="";return e.length>5?(t=e.substring(1,3),a=e.substring(3,5),s=e.substring(5,7),n=e.substring(7,9)):(t=e.substring(1,2),a=e.substring(2,3),s=e.substring(3,4),n=e.substring(4,5),t+=t,a+=a,s+=s,n+=n),{red:parseInt(t,16),green:parseInt(a,16),blue:parseInt(s,16),alpha:n?parseInt(n,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex,transform:rgba.transform},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:s=1})=>"hsla("+Math.round(e)+", "+percent.transform(sanitize(t))+", "+percent.transform(sanitize(a))+", "+sanitize(alpha.transform(s))+")"},color={test:e=>rgba.test(e)||hex.test(e)||hsla.test(e),parse:e=>rgba.test(e)?rgba.parse(e):hsla.test(e)?hsla.parse(e):hex.parse(e),transform:e=>isString$2(e)?e:e.hasOwnProperty("red")?rgba.transform(e):hsla.transform(e)},colorToken="${c}",numberToken="${n}";function test(e){var t,a;return isNaN(e)&&isString$2(e)&&(((t=e.match(floatRegex))===null||t===void 0?void 0:t.length)||0)+(((a=e.match(colorRegex))===null||a===void 0?void 0:a.length)||0)>0}function analyseComplexValue(e){typeof e=="number"&&(e=`${e}`);const t=[];let a=0,s=0;const n=e.match(colorRegex);n&&(a=n.length,e=e.replace(colorRegex,colorToken),t.push(...n.map(color.parse)));const i=e.match(floatRegex);return i&&(s=i.length,e=e.replace(floatRegex,numberToken),t.push(...i.map(number$1.parse))),{values:t,numColors:a,numNumbers:s,tokenised:e}}function parse$1(e){return analyseComplexValue(e).values}function createTransformer(e){const{values:t,numColors:a,tokenised:s}=analyseComplexValue(e),n=t.length;return i=>{let o=s;for(let u=0;utypeof e=="number"?0:e;function getAnimatableNone$1(e){const t=parse$1(e);return createTransformer(e)(t.map(convertNumbersToZero))}const complex={test,parse:parse$1,createTransformer,getAnimatableNone:getAnimatableNone$1},maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(e){const[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=a.match(floatRegex)||[];if(!s)return e;const n=a.replace(s,"");let i=maxDefaults.has(t)?1:0;return s!==a&&(i*=100),t+"("+i+n+")"}const functionRegex=/([a-z-]*)\(.*?\)/g,filter={...complex,getAnimatableNone:e=>{const t=e.match(functionRegex);return t?t.map(applyDefaultFilter).join(" "):e}},defaultValueTypes={...numberValueTypes,color,backgroundColor:color,outlineColor:color,fill:color,stroke:color,borderColor:color,borderTopColor:color,borderRightColor:color,borderBottomColor:color,borderLeftColor:color,filter,WebkitFilter:filter},getDefaultValueType=e=>defaultValueTypes[e];function getAnimatableNone(e,t){var a;let s=getDefaultValueType(e);return s!==filter&&(s=complex),(a=s.getAnimatableNone)===null||a===void 0?void 0:a.call(s,t)}const testValueType=e=>t=>t.test(e),auto={test:e=>e==="auto",parse:e=>e},dimensionValueTypes=[number$1,px,percent,degrees,vw,vh,auto],findDimensionValueType=e=>dimensionValueTypes.find(testValueType(e)),valueTypes=[...dimensionValueTypes,color,complex],findValueType=e=>valueTypes.find(testValueType(e));function getCurrent(e){const t={};return e.values.forEach((a,s)=>t[s]=a.get()),t}function getVelocity$1(e){const t={};return e.values.forEach((a,s)=>t[s]=a.getVelocity()),t}function resolveVariant(e,t,a){const s=e.getProps();return resolveVariantFromProps(s,t,a!==void 0?a:s.custom,getCurrent(e),getVelocity$1(e))}function setMotionValue(e,t,a){e.hasValue(t)?e.getValue(t).set(a):e.addValue(t,motionValue(a))}function setTarget(e,t){const a=resolveVariant(e,t);let{transitionEnd:s={},transition:n={},...i}=a?e.makeTargetAnimatable(a,!1):{};i={...i,...s};for(const o in i){const u=resolveFinalValueInKeyframes(i[o]);setMotionValue(e,o,u)}}function checkTargetForNewValues(e,t,a){var s,n;const i=Object.keys(t).filter(u=>!e.hasValue(u)),o=i.length;if(o)for(let u=0;u`${e}: ${t}`;function handoffOptimizedAppearAnimation(e,t){const{MotionAppearAnimations:a}=window,s=appearStoreId(e,transformProps.has(t)?"transform":t),n=a&&a.get(s);return n?(sync.render(()=>{try{n.cancel(),a.delete(s)}catch{}}),n.currentTime||0):0}const optimizedAppearDataId="framerAppearId",optimizedAppearDataAttribute="data-"+camelToDash(optimizedAppearDataId);var invariant=function(){};const secondsToMilliseconds=e=>e*1e3,instantAnimationState={current:!1},mirrorEasing=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,reverseEasing=e=>t=>1-e(1-t),easeIn=e=>e*e,easeOut=reverseEasing(easeIn),easeInOut=mirrorEasing(easeIn),mix=(e,t,a)=>-a*e+a*t+e;function hueToRgb(e,t,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+(t-e)*6*a:a<1/2?t:a<2/3?e+(t-e)*(2/3-a)*6:e}function hslaToRgba({hue:e,saturation:t,lightness:a,alpha:s}){e/=360,t/=100,a/=100;let n=0,i=0,o=0;if(!t)n=i=o=a;else{const u=a<.5?a*(1+t):a+t-a*t,l=2*a-u;n=hueToRgb(l,u,e+1/3),i=hueToRgb(l,u,e),o=hueToRgb(l,u,e-1/3)}return{red:Math.round(n*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:s}}const mixLinearColor=(e,t,a)=>{const s=e*e;return Math.sqrt(Math.max(0,a*(t*t-s)+s))},colorTypes=[hex,rgba,hsla],getColorType=e=>colorTypes.find(t=>t.test(e));function asRGBA(e){const t=getColorType(e);let a=t.parse(e);return t===hsla&&(a=hslaToRgba(a)),a}const mixColor=(e,t)=>{const a=asRGBA(e),s=asRGBA(t),n={...a};return i=>(n.red=mixLinearColor(a.red,s.red,i),n.green=mixLinearColor(a.green,s.green,i),n.blue=mixLinearColor(a.blue,s.blue,i),n.alpha=mix(a.alpha,s.alpha,i),rgba.transform(n))};function getMixer(e,t){return typeof e=="number"?a=>mix(e,t,a):color.test(e)?mixColor(e,t):mixComplex(e,t)}const mixArray=(e,t)=>{const a=[...e],s=a.length,n=e.map((i,o)=>getMixer(i,t[o]));return i=>{for(let o=0;o{const a={...e,...t},s={};for(const n in a)e[n]!==void 0&&t[n]!==void 0&&(s[n]=getMixer(e[n],t[n]));return n=>{for(const i in s)a[i]=s[i](n);return a}},mixComplex=(e,t)=>{const a=complex.createTransformer(t),s=analyseComplexValue(e),n=analyseComplexValue(t);return s.numColors===n.numColors&&s.numNumbers>=n.numNumbers?pipe(mixArray(s.values,n.values),a):o=>`${o>0?t:e}`},progress=(e,t,a)=>{const s=t-e;return s===0?1:(a-e)/s},mixNumber=(e,t)=>a=>mix(e,t,a);function detectMixerFactory(e){return typeof e=="number"?mixNumber:typeof e=="string"?color.test(e)?mixColor:mixComplex:Array.isArray(e)?mixArray:typeof e=="object"?mixObject:mixNumber}function createMixers(e,t,a){const s=[],n=a||detectMixerFactory(e[0]),i=e.length-1;for(let o=0;oe[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=createMixers(t,s,n),u=o.length,l=c=>{let _=0;if(u>1)for(;_l(clamp(e[0],e[i-1],c)):l}const noop$3=e=>e,calcBezier=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,subdivisionPrecision=1e-7,subdivisionMaxIterations=12;function binarySubdivide(e,t,a,s,n){let i,o,u=0;do o=t+(a-t)/2,i=calcBezier(o,s,n)-e,i>0?a=o:t=o;while(Math.abs(i)>subdivisionPrecision&&++ubinarySubdivide(i,0,1,e,a);return i=>i===0||i===1?i:calcBezier(n(i),t,s)}const circIn=e=>1-Math.sin(Math.acos(e)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circOut),backOut=cubicBezier(.33,1.53,.69,.99),backIn=reverseEasing(backOut),backInOut=mirrorEasing(backIn),anticipate=e=>(e*=2)<1?.5*backIn(e):.5*(2-Math.pow(2,-10*(e-1))),easingLookup={linear:noop$3,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate},easingDefinitionToFunction=e=>{if(Array.isArray(e)){invariant(e.length===4);const[t,a,s,n]=e;return cubicBezier(t,a,s,n)}else if(typeof e=="string")return easingLookup[e];return e},isEasingArray=e=>Array.isArray(e)&&typeof e[0]!="number";function defaultEasing(e,t){return e.map(()=>t||easeInOut).splice(0,e.length-1)}function defaultOffset(e){const t=e.length;return e.map((a,s)=>s!==0?s/(t-1):0)}function convertOffsetToTimes(e,t){return e.map(a=>a*t)}function keyframes({keyframes:e,ease:t=easeInOut,times:a,duration:s=300}){e=[...e];const n=keyframes[0],i=isEasingArray(t)?t.map(easingDefinitionToFunction):easingDefinitionToFunction(t),o={done:!1,value:n},u=convertOffsetToTimes(a&&a.length===keyframes.length?a:defaultOffset(e),s);function l(){return interpolate(u,e,{ease:Array.isArray(i)?i:defaultEasing(e,i)})}let c=l();return{next:_=>(o.value=c(_),o.done=_>=s,o),flipTarget:()=>{e.reverse(),c=l()}}}const safeMin=.001,minDuration=.01,maxDuration=10,minDamping=.05,maxDamping=1;function findSpring({duration:e=800,bounce:t=.25,velocity:a=0,mass:s=1}){let n,i,o=1-t;o=clamp(minDamping,maxDamping,o),e=clamp(minDuration,maxDuration,e/1e3),o<1?(n=c=>{const _=c*o,p=_*e,d=_-a,E=calcAngularFreq(c,o),R=Math.exp(-p);return safeMin-d/E*R},i=c=>{const p=c*o*e,d=p*a+a,E=Math.pow(o,2)*Math.pow(c,2)*e,R=Math.exp(-p),y=calcAngularFreq(Math.pow(c,2),o);return(-n(c)+safeMin>0?-1:1)*((d-E)*R)/y}):(n=c=>{const _=Math.exp(-c*e),p=(c-a)*e+1;return-safeMin+_*p},i=c=>{const _=Math.exp(-c*e),p=(a-c)*(e*e);return _*p});const u=5/e,l=approximateRoot(n,i,u);if(e=e*1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:o*2*Math.sqrt(s*c),duration:e}}}const rootIterations=12;function approximateRoot(e,t,a){let s=a;for(let n=1;ne[a]!==void 0)}function getSpringOptions(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!isSpringType(e,physicsKeys)&&isSpringType(e,durationKeys)){const a=findSpring(e);t={...t,...a,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}const velocitySampleDuration=5;function spring({keyframes:e,restSpeed:t=2,restDelta:a=.01,...s}){let n=e[0],i=e[e.length-1];const o={done:!1,value:n},{stiffness:u,damping:l,mass:c,velocity:_,duration:p,isResolvedFromDuration:d}=getSpringOptions(s);let E=zero,R=_?-(_/1e3):0;const y=l/(2*Math.sqrt(u*c));function I(){const A=i-n,x=Math.sqrt(u/c)/1e3;if(a===void 0&&(a=Math.min(Math.abs(i-n)/100,.4)),y<1){const g=calcAngularFreq(x,y);E=T=>{const O=Math.exp(-y*x*T);return i-O*((R+y*x*A)/g*Math.sin(g*T)+A*Math.cos(g*T))}}else if(y===1)E=g=>i-Math.exp(-x*g)*(A+(R+x*A)*g);else{const g=x*Math.sqrt(y*y-1);E=T=>{const O=Math.exp(-y*x*T),C=Math.min(g*T,300);return i-O*((R+y*x*A)*Math.sinh(C)+g*A*Math.cosh(C))/g}}}return I(),{next:A=>{const x=E(A);if(d)o.done=A>=p;else{let g=R;if(A!==0)if(y<1){const C=Math.max(0,A-velocitySampleDuration);g=velocityPerSecond(x-E(C),A-C)}else g=0;const T=Math.abs(g)<=t,O=Math.abs(i-x)<=a;o.done=T&&O}return o.value=o.done?i:x,o},flipTarget:()=>{R=-R,[n,i]=[i,n],I()}}}spring.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const zero=e=>0;function decay({keyframes:e=[0],velocity:t=0,power:a=.8,timeConstant:s=350,restDelta:n=.5,modifyTarget:i}){const o=e[0],u={done:!1,value:o};let l=a*t;const c=o+l,_=i===void 0?c:i(c);return _!==c&&(l=_-o),{next:p=>{const d=-l*Math.exp(-p/s);return u.done=!(d>n||d<-n),u.value=u.done?_:_+d,u},flipTarget:()=>{}}}const types={decay,keyframes,tween:keyframes,spring};function loopElapsed(e,t,a=0){return e-t-a}function reverseElapsed(e,t=0,a=0,s=!0){return s?loopElapsed(t+-e,t,a):t-(e-t)+a}function hasRepeatDelayElapsed(e,t,a,s){return s?e>=t+a:e<=-a}const framesync=e=>{const t=({delta:a})=>e(a);return{start:()=>sync.update(t,!0),stop:()=>cancelSync.update(t)}};function animate$1({duration:e,driver:t=framesync,elapsed:a=0,repeat:s=0,repeatType:n="loop",repeatDelay:i=0,keyframes:o,autoplay:u=!0,onPlay:l,onStop:c,onComplete:_,onRepeat:p,onUpdate:d,type:E="keyframes",...R}){var y,I;let A,x=0,g=e,T,O=!1,C=!0,U;const L=types[o.length>2?"keyframes":E],j=o[0],X=o[o.length-1];!((I=(y=L).needsInterpolation)===null||I===void 0)&&I.call(y,j,X)&&(U=interpolate([0,100],[j,X],{clamp:!1}),o=[0,100]);const B=L({...R,duration:e,keyframes:o});function H(){x++,n==="reverse"?(C=x%2===0,a=reverseElapsed(a,g,i,C)):(a=loopElapsed(a,g,i),n==="mirror"&&B.flipTarget()),O=!1,p&&p()}function W(){A.stop(),_&&_()}function K(k){if(C||(k=-k),a+=k,!O){const F=B.next(Math.max(0,a));T=F.value,U&&(T=U(T)),O=C?F.done:a<=0}d&&d(T),O&&(x===0&&(g=g!==void 0?g:a),x{c&&c(),A.stop()},sample:k=>B.next(Math.max(0,k))}}function isWaapiSupportedEasing(e){return!e||Array.isArray(e)||typeof e=="string"&&supportedWaapiEasing[e]}const cubicBezierAsString=([e,t,a,s])=>`cubic-bezier(${e}, ${t}, ${a}, ${s})`,supportedWaapiEasing={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cubicBezierAsString([0,.65,.55,1]),circOut:cubicBezierAsString([.55,0,1,.45]),backIn:cubicBezierAsString([.31,.01,.66,-.59]),backOut:cubicBezierAsString([.33,1.53,.69,.99])};function mapEasingToNativeEasing(e){if(e)return Array.isArray(e)?cubicBezierAsString(e):supportedWaapiEasing[e]}function animateStyle(e,t,a,{delay:s=0,duration:n,repeat:i=0,repeatType:o="loop",ease:u,times:l}={}){return e.animate({[t]:a,offset:l},{delay:s,duration:n,easing:mapEasingToNativeEasing(u),fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const sampleDelta=10;function createAcceleratedAnimation(e,t,{onUpdate:a,onComplete:s,...n}){let{keyframes:i,duration:o=.3,elapsed:u=0,ease:l}=n;if(n.type==="spring"||!isWaapiSupportedEasing(n.ease)){const _=animate$1(n);let p={done:!1,value:i[0]};const d=[];let E=0;for(;!p.done;)p=_.sample(E),d.push(p.value),E+=sampleDelta;i=d,o=E-sampleDelta,l="linear"}const c=animateStyle(e.owner.current,t,i,{...n,delay:-u,duration:o,ease:l});return c.onfinish=()=>{e.set(i[i.length-1]),s&&s()},()=>{const{currentTime:_}=c;if(_){const p=animate$1(n);e.setWithVelocity(p.sample(_-sampleDelta).value,p.sample(_).value,sampleDelta)}sync.update(()=>c.cancel())}}function delay(e,t){const a=performance.now(),s=({timestamp:n})=>{const i=n-a;i>=t&&(cancelSync.read(s),e(i-t))};return sync.read(s,!0),()=>cancelSync.read(s)}function createInstantAnimation({keyframes:e,elapsed:t,onUpdate:a,onComplete:s}){const n=()=>(a&&a(e[e.length-1]),s&&s(),()=>{});return t?delay(n,-t):n()}function inertia({keyframes:e,velocity:t=0,min:a,max:s,power:n=.8,timeConstant:i=750,bounceStiffness:o=500,bounceDamping:u=10,restDelta:l=1,modifyTarget:c,driver:_,onUpdate:p,onComplete:d,onStop:E}){const R=e[0];let y;function I(T){return a!==void 0&&Ts}function A(T){return a===void 0?s:s===void 0||Math.abs(a-T){var C;p==null||p(O),(C=T.onUpdate)===null||C===void 0||C.call(T,O)},onComplete:d,onStop:E})}function g(T){x({type:"spring",stiffness:o,damping:u,restDelta:l,...T})}if(I(R))g({velocity:t,keyframes:[R,A(R)]});else{let T=n*t+R;typeof c<"u"&&(T=c(T));const O=A(T),C=O===a?-1:1;let U,L;const j=X=>{U=L,L=X,t=velocityPerSecond(X-U,frameData.delta),(C===1&&X>O||C===-1&&Xy==null?void 0:y.stop()}}const underDampedSpring=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),criticallyDampedSpring=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),linearTween=()=>({type:"keyframes",ease:"linear",duration:.3}),keyframesTransition={type:"keyframes",duration:.8},defaultTransitions={x:underDampedSpring,y:underDampedSpring,z:underDampedSpring,rotate:underDampedSpring,rotateX:underDampedSpring,rotateY:underDampedSpring,rotateZ:underDampedSpring,scaleX:criticallyDampedSpring,scaleY:criticallyDampedSpring,scale:criticallyDampedSpring,opacity:linearTween,backgroundColor:linearTween,color:linearTween,default:criticallyDampedSpring},getDefaultTransition=(e,{keyframes:t})=>t.length>2?keyframesTransition:(defaultTransitions[e]||defaultTransitions.default)(t[1]),isAnimatable=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&complex.test(t)&&!t.startsWith("url("));function isTransitionDefined({when:e,delay:t,delayChildren:a,staggerChildren:s,staggerDirection:n,repeat:i,repeatType:o,repeatDelay:u,from:l,...c}){return!!Object.keys(c).length}function isZero(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function getZeroUnit(e){return typeof e=="number"?0:getAnimatableNone("",e)}function getValueTransition(e,t){return e[t]||e.default||e}function getKeyframes(e,t,a,s){const n=isAnimatable(t,a);let i=s.from!==void 0?s.from:e.get();return i==="none"&&n&&typeof a=="string"?i=getAnimatableNone(t,a):isZero(i)&&typeof a=="string"?i=getZeroUnit(a):!Array.isArray(a)&&isZero(a)&&typeof i=="string"&&(a=getZeroUnit(i)),Array.isArray(a)?(a[0]===null&&(a[0]=i),a):[i,a]}const featureTests={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},results={},supports={};for(const e in featureTests)supports[e]=()=>(results[e]===void 0&&(results[e]=featureTests[e]()),results[e]);const acceleratedValues=new Set(["opacity"]),createMotionValueAnimation=(e,t,a,s={})=>n=>{const i=getValueTransition(s,e)||{},o=i.delay||s.delay||0;let{elapsed:u=0}=s;u=u-secondsToMilliseconds(o);const l=getKeyframes(t,e,a,i),c=l[0],_=l[l.length-1],p=isAnimatable(e,c),d=isAnimatable(e,_);let E={keyframes:l,velocity:t.getVelocity(),...i,elapsed:u,onUpdate:A=>{t.set(A),i.onUpdate&&i.onUpdate(A)},onComplete:()=>{n(),i.onComplete&&i.onComplete()}};if(!p||!d||instantAnimationState.current||i.type===!1)return createInstantAnimation(E);if(i.type==="inertia"){const A=inertia(E);return()=>A.stop()}isTransitionDefined(i)||(E={...E,...getDefaultTransition(e,E)}),E.duration&&(E.duration=secondsToMilliseconds(E.duration)),E.repeatDelay&&(E.repeatDelay=secondsToMilliseconds(E.repeatDelay));const R=t.owner,y=R&&R.current;if(supports.waapi()&&acceleratedValues.has(e)&&!E.repeatDelay&&E.repeatType!=="mirror"&&E.damping!==0&&R&&y instanceof HTMLElement&&!R.getProps().onUpdate)return createAcceleratedAnimation(t,e,E);{const A=animate$1(E);return()=>A.stop()}};function animateVisualElement(e,t,a={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const n=t.map(i=>animateVariant(e,i,a));s=Promise.all(n)}else if(typeof t=="string")s=animateVariant(e,t,a);else{const n=typeof t=="function"?resolveVariant(e,t,a.custom):t;s=animateTarget(e,n,a)}return s.then(()=>e.notify("AnimationComplete",t))}function animateVariant(e,t,a={}){var s;const n=resolveVariant(e,t,a.custom);let{transition:i=e.getDefaultTransition()||{}}=n||{};a.transitionOverride&&(i=a.transitionOverride);const o=n?()=>animateTarget(e,n,a):()=>Promise.resolve(),u=!((s=e.variantChildren)===null||s===void 0)&&s.size?(c=0)=>{const{delayChildren:_=0,staggerChildren:p,staggerDirection:d}=i;return animateChildren(e,t,_+c,p,d,a)}:()=>Promise.resolve(),{when:l}=i;if(l){const[c,_]=l==="beforeChildren"?[o,u]:[u,o];return c().then(_)}else return Promise.all([o(),u(a.delay)])}function animateTarget(e,t,{delay:a=0,transitionOverride:s,type:n}={}){var i;let{transition:o=e.getDefaultTransition(),transitionEnd:u,...l}=e.makeTargetAnimatable(t);const c=e.getValue("willChange");s&&(o=s);const _=[],p=n&&((i=e.animationState)===null||i===void 0?void 0:i.getState()[n]);for(const d in l){const E=e.getValue(d),R=l[d];if(!E||R===void 0||p&&shouldBlockAnimation(p,d))continue;let y={delay:a,elapsed:0,...o};if(e.shouldReduceMotion&&transformProps.has(d)&&(y={...y,type:!1,delay:0}),!E.hasAnimated){const A=e.getProps()[optimizedAppearDataAttribute];A&&(y.elapsed=handoffOptimizedAppearAnimation(A,d))}let I=E.start(createMotionValueAnimation(d,E,R,y));isWillChangeMotionValue(c)&&(c.add(d),I=I.then(()=>c.remove(d))),_.push(I)}return Promise.all(_).then(()=>{u&&setTarget(e,u)})}function animateChildren(e,t,a=0,s=0,n=1,i){const o=[],u=(e.variantChildren.size-1)*s,l=n===1?(c=0)=>c*s:(c=0)=>u-c*s;return Array.from(e.variantChildren).sort(sortByTreeOrder).forEach((c,_)=>{o.push(animateVariant(c,t,{...i,delay:a+l(_)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function sortByTreeOrder(e,t){return e.sortNodePosition(t)}function shouldBlockAnimation({protectedKeys:e,needsAnimating:t},a){const s=e.hasOwnProperty(a)&&t[a]!==!0;return t[a]=!1,s}const variantPriorityOrder=[AnimationType.Animate,AnimationType.InView,AnimationType.Focus,AnimationType.Hover,AnimationType.Tap,AnimationType.Drag,AnimationType.Exit],reversePriorityOrder=[...variantPriorityOrder].reverse(),numAnimationTypes=variantPriorityOrder.length;function animateList(e){return t=>Promise.all(t.map(({animation:a,options:s})=>animateVisualElement(e,a,s)))}function createAnimationState(e){let t=animateList(e);const a=createState();let s=!0;const n=(l,c)=>{const _=resolveVariant(e,c);if(_){const{transition:p,transitionEnd:d,...E}=_;l={...l,...E,...d}}return l};function i(l){t=l(e)}function o(l,c){const _=e.getProps(),p=e.getVariantContext(!0)||{},d=[],E=new Set;let R={},y=1/0;for(let A=0;Ay&&O;const X=Array.isArray(T)?T:[T];let B=X.reduce(n,{});C===!1&&(B={});const{prevResolvedValues:H={}}=g,W={...H,...B},K=b=>{j=!0,E.delete(b),g.needsAnimating[b]=!0};for(const b in W){const k=B[b],F=H[b];R.hasOwnProperty(b)||(k!==F?isKeyframesTarget(k)&&isKeyframesTarget(F)?!shallowCompare(k,F)||L?K(b):g.protectedKeys[b]=!0:k!==void 0?K(b):E.add(b):k!==void 0&&E.has(b)?K(b):g.protectedKeys[b]=!0)}g.prevProp=T,g.prevResolvedValues=B,g.isActive&&(R={...R,...B}),s&&e.blockInitialAnimation&&(j=!1),j&&!U&&d.push(...X.map(b=>({animation:b,options:{type:x,...l}})))}if(E.size){const A={};E.forEach(x=>{const g=e.getBaseTarget(x);g!==void 0&&(A[x]=g)}),d.push({animation:A})}let I=!!d.length;return s&&_.initial===!1&&!e.manuallyAnimateOnMount&&(I=!1),s=!1,I?t(d):Promise.resolve()}function u(l,c,_){var p;if(a[l].isActive===c)return Promise.resolve();(p=e.variantChildren)===null||p===void 0||p.forEach(E=>{var R;return(R=E.animationState)===null||R===void 0?void 0:R.setActive(l,c)}),a[l].isActive=c;const d=o(_,l);for(const E in a)a[E].protectedKeys={};return d}return{animateChanges:o,setActive:u,setAnimateFunction:i,getState:()=>a}}function checkVariantsDidChange(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!shallowCompare(t,e):!1}function createTypeState(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function createState(){return{[AnimationType.Animate]:createTypeState(!0),[AnimationType.InView]:createTypeState(),[AnimationType.Hover]:createTypeState(),[AnimationType.Tap]:createTypeState(),[AnimationType.Drag]:createTypeState(),[AnimationType.Focus]:createTypeState(),[AnimationType.Exit]:createTypeState()}}const animations={animation:makeRenderlessComponent(({visualElement:e,animate:t})=>{e.animationState||(e.animationState=createAnimationState(e)),isAnimationControls(t)&&reactExports.useEffect(()=>t.subscribe(e),[t])}),exit:makeRenderlessComponent(e=>{const{custom:t,visualElement:a}=e,[s,n]=usePresence(),i=reactExports.useContext(PresenceContext);reactExports.useEffect(()=>{a.isPresent=s;const o=a.animationState&&a.animationState.setActive(AnimationType.Exit,!s,{custom:i&&i.custom||t});o&&!s&&o.then(n)},[s])})},distance=(e,t)=>Math.abs(e-t);function distance2D(e,t){const a=distance(e.x,t.x),s=distance(e.y,t.y);return Math.sqrt(a**2+s**2)}class PanSession{constructor(t,a,{transformPagePoint:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const c=getPanInfo(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,p=distance2D(c.offset,{x:0,y:0})>=3;if(!_&&!p)return;const{point:d}=c,{timestamp:E}=frameData;this.history.push({...d,timestamp:E});const{onStart:R,onMove:y}=this.handlers;_||(R&&R(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,c)},this.handlePointerMove=(c,_)=>{if(this.lastMoveEvent=c,this.lastMoveEventInfo=transformPoint(_,this.transformPagePoint),isMouseEvent(c)&&c.buttons===0){this.handlePointerUp(c,_);return}sync.update(this.updatePoint,!0)},this.handlePointerUp=(c,_)=>{this.end();const{onEnd:p,onSessionEnd:d}=this.handlers,E=getPanInfo(transformPoint(_,this.transformPagePoint),this.history);this.startEvent&&p&&p(c,E),d&&d(c,E)},isTouchEvent(t)&&t.touches.length>1)return;this.handlers=a,this.transformPagePoint=s;const n=extractEventInfo(t),i=transformPoint(n,this.transformPagePoint),{point:o}=i,{timestamp:u}=frameData;this.history=[{...o,timestamp:u}];const{onSessionStart:l}=a;l&&l(t,getPanInfo(i,this.history)),this.removeListeners=pipe(addPointerEvent(window,"pointermove",this.handlePointerMove),addPointerEvent(window,"pointerup",this.handlePointerUp),addPointerEvent(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),cancelSync.update(this.updatePoint)}}function transformPoint(e,t){return t?{point:t(e.point)}:e}function subtractPoint(e,t){return{x:e.x-t.x,y:e.y-t.y}}function getPanInfo({point:e},t){return{point:e,delta:subtractPoint(e,lastDevicePoint(t)),offset:subtractPoint(e,startDevicePoint(t)),velocity:getVelocity(t,.1)}}function startDevicePoint(e){return e[0]}function lastDevicePoint(e){return e[e.length-1]}function getVelocity(e,t){if(e.length<2)return{x:0,y:0};let a=e.length-1,s=null;const n=lastDevicePoint(e);for(;a>=0&&(s=e[a],!(n.timestamp-s.timestamp>secondsToMilliseconds(t)));)a--;if(!s)return{x:0,y:0};const i=(n.timestamp-s.timestamp)/1e3;if(i===0)return{x:0,y:0};const o={x:(n.x-s.x)/i,y:(n.y-s.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function calcLength(e){return e.max-e.min}function isNear(e,t=0,a=.01){return Math.abs(e-t)<=a}function calcAxisDelta(e,t,a,s=.5){e.origin=s,e.originPoint=mix(t.min,t.max,e.origin),e.scale=calcLength(a)/calcLength(t),(isNear(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=mix(a.min,a.max,e.origin)-e.originPoint,(isNear(e.translate)||isNaN(e.translate))&&(e.translate=0)}function calcBoxDelta(e,t,a,s){calcAxisDelta(e.x,t.x,a.x,s==null?void 0:s.originX),calcAxisDelta(e.y,t.y,a.y,s==null?void 0:s.originY)}function calcRelativeAxis(e,t,a){e.min=a.min+t.min,e.max=e.min+calcLength(t)}function calcRelativeBox(e,t,a){calcRelativeAxis(e.x,t.x,a.x),calcRelativeAxis(e.y,t.y,a.y)}function calcRelativeAxisPosition(e,t,a){e.min=t.min-a.min,e.max=e.min+calcLength(t)}function calcRelativePosition(e,t,a){calcRelativeAxisPosition(e.x,t.x,a.x),calcRelativeAxisPosition(e.y,t.y,a.y)}function applyConstraints(e,{min:t,max:a},s){return t!==void 0&&ea&&(e=s?mix(a,e,s.max):Math.min(e,a)),e}function calcRelativeAxisConstraints(e,t,a){return{min:t!==void 0?e.min+t:void 0,max:a!==void 0?e.max+a-(e.max-e.min):void 0}}function calcRelativeConstraints(e,{top:t,left:a,bottom:s,right:n}){return{x:calcRelativeAxisConstraints(e.x,a,n),y:calcRelativeAxisConstraints(e.y,t,s)}}function calcViewportAxisConstraints(e,t){let a=t.min-e.min,s=t.max-e.max;return t.max-t.mins?a=progress(t.min,t.max-s,e.min):s>n&&(a=progress(e.min,e.max-n,t.min)),clamp(0,1,a)}function rebaseAxisConstraints(e,t){const a={};return t.min!==void 0&&(a.min=t.min-e.min),t.max!==void 0&&(a.max=t.max-e.min),a}const defaultElastic=.35;function resolveDragElastic(e=defaultElastic){return e===!1?e=0:e===!0&&(e=defaultElastic),{x:resolveAxisElastic(e,"left","right"),y:resolveAxisElastic(e,"top","bottom")}}function resolveAxisElastic(e,t,a){return{min:resolvePointElastic(e,t),max:resolvePointElastic(e,a)}}function resolvePointElastic(e,t){return typeof e=="number"?e:e[t]||0}const createAxisDelta=()=>({translate:0,scale:1,origin:0,originPoint:0}),createDelta=()=>({x:createAxisDelta(),y:createAxisDelta()}),createAxis=()=>({min:0,max:0}),createBox=()=>({x:createAxis(),y:createAxis()});function eachAxis(e){return[e("x"),e("y")]}function convertBoundingBoxToBox({top:e,left:t,right:a,bottom:s}){return{x:{min:t,max:a},y:{min:e,max:s}}}function convertBoxToBoundingBox({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function transformBoxPoints(e,t){if(!t)return e;const a=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}function isIdentityScale(e){return e===void 0||e===1}function hasScale({scale:e,scaleX:t,scaleY:a}){return!isIdentityScale(e)||!isIdentityScale(t)||!isIdentityScale(a)}function hasTransform(e){return hasScale(e)||has2DTranslate(e)||e.z||e.rotate||e.rotateX||e.rotateY}function has2DTranslate(e){return is2DTranslate(e.x)||is2DTranslate(e.y)}function is2DTranslate(e){return e&&e!=="0%"}function scalePoint(e,t,a){const s=e-a,n=t*s;return a+n}function applyPointDelta(e,t,a,s,n){return n!==void 0&&(e=scalePoint(e,n,s)),scalePoint(e,a,s)+t}function applyAxisDelta(e,t=0,a=1,s,n){e.min=applyPointDelta(e.min,t,a,s,n),e.max=applyPointDelta(e.max,t,a,s,n)}function applyBoxDelta(e,{x:t,y:a}){applyAxisDelta(e.x,t.translate,t.scale,t.originPoint),applyAxisDelta(e.y,a.translate,a.scale,a.originPoint)}function applyTreeDeltas(e,t,a,s=!1){var n,i;const o=a.length;if(!o)return;t.x=t.y=1;let u,l;for(let c=0;c1.0000000000001||e<.999999999999?e:1}function translateAxis(e,t){e.min=e.min+t,e.max=e.max+t}function transformAxis(e,t,[a,s,n]){const i=t[n]!==void 0?t[n]:.5,o=mix(e.min,e.max,i);applyAxisDelta(e,t[a],t[s],o,t.scale)}const xKeys$1=["x","scaleX","originX"],yKeys$1=["y","scaleY","originY"];function transformBox(e,t){transformAxis(e.x,t,xKeys$1),transformAxis(e.y,t,yKeys$1)}function measureViewportBox(e,t){return convertBoundingBoxToBox(transformBoxPoints(e.getBoundingClientRect(),t))}function measurePageBox(e,t,a){const s=measureViewportBox(e,a),{scroll:n}=t;return n&&(translateAxis(s.x,n.offset.x),translateAxis(s.y,n.offset.y)),s}const elementDragControls=new WeakMap;class VisualElementDragControls{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=createBox(),this.visualElement=t}start(t,{snapToCursor:a=!1}={}){if(this.visualElement.isPresent===!1)return;const s=u=>{this.stopAnimation(),a&&this.snapToCursor(extractEventInfo(u,"page").point)},n=(u,l)=>{var c;const{drag:_,dragPropagation:p,onDragStart:d}=this.getProps();_&&!p&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=getGlobalLock(_),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),eachAxis(E=>{var R,y;let I=this.getAxisMotionValue(E).get()||0;if(percent.test(I)){const A=(y=(R=this.visualElement.projection)===null||R===void 0?void 0:R.layout)===null||y===void 0?void 0:y.layoutBox[E];A&&(I=calcLength(A)*(parseFloat(I)/100))}this.originPoint[E]=I}),d==null||d(u,l),(c=this.visualElement.animationState)===null||c===void 0||c.setActive(AnimationType.Drag,!0))},i=(u,l)=>{const{dragPropagation:c,dragDirectionLock:_,onDirectionLock:p,onDrag:d}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:E}=l;if(_&&this.currentDirection===null){this.currentDirection=getCurrentDirection(E),this.currentDirection!==null&&(p==null||p(this.currentDirection));return}this.updateAxis("x",l.point,E),this.updateAxis("y",l.point,E),this.visualElement.render(),d==null||d(u,l)},o=(u,l)=>this.stop(u,l);this.panSession=new PanSession(t,{onSessionStart:s,onStart:n,onMove:i,onSessionEnd:o},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,a){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:n}=a;this.startAnimation(n);const{onDragEnd:i}=this.getProps();i==null||i(t,a)}cancel(){var t,a;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(t=this.panSession)===null||t===void 0||t.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(a=this.visualElement.animationState)===null||a===void 0||a.setActive(AnimationType.Drag,!1)}updateAxis(t,a,s){const{drag:n}=this.getProps();if(!s||!shouldDrag(t,n,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(o=applyConstraints(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:a}=this.getProps(),{layout:s}=this.visualElement.projection||{},n=this.constraints;t&&isRefObject(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=calcRelativeConstraints(s.layoutBox,t):this.constraints=!1,this.elastic=resolveDragElastic(a),n!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&eachAxis(i=>{this.getAxisMotionValue(i)&&(this.constraints[i]=rebaseAxisConstraints(s.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:a}=this.getProps();if(!t||!isRefObject(t))return!1;const s=t.current,{projection:n}=this.visualElement;if(!n||!n.layout)return!1;const i=measurePageBox(s,n.root,this.visualElement.getTransformPagePoint());let o=calcViewportConstraints(n.layout.layoutBox,i);if(a){const u=a(convertBoxToBoundingBox(o));this.hasMutatedConstraints=!!u,u&&(o=convertBoundingBoxToBox(u))}return o}startAnimation(t){const{drag:a,dragMomentum:s,dragElastic:n,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:u}=this.getProps(),l=this.constraints||{},c=eachAxis(_=>{if(!shouldDrag(_,a,this.currentDirection))return;let p=(l==null?void 0:l[_])||{};o&&(p={min:0,max:0});const d=n?200:1e6,E=n?40:1e7,R={type:"inertia",velocity:s?t[_]:0,bounceStiffness:d,bounceDamping:E,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(_,R)});return Promise.all(c).then(u)}startAxisValueAnimation(t,a){const s=this.getAxisMotionValue(t);return s.start(createMotionValueAnimation(t,s,0,a))}stopAnimation(){eachAxis(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var a;const s="_drag"+t.toUpperCase(),n=this.visualElement.getProps()[s];return n||this.visualElement.getValue(t,((a=this.visualElement.getProps().initial)===null||a===void 0?void 0:a[t])||0)}snapToCursor(t){eachAxis(a=>{const{drag:s}=this.getProps();if(!shouldDrag(a,s,this.currentDirection))return;const{projection:n}=this.visualElement,i=this.getAxisMotionValue(a);if(n&&n.layout){const{min:o,max:u}=n.layout.layoutBox[a];i.set(t[a]-mix(o,u,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:a,dragConstraints:s}=this.getProps(),{projection:n}=this.visualElement;if(!isRefObject(s)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};eachAxis(u=>{const l=this.getAxisMotionValue(u);if(l){const c=l.get();i[u]=calcOrigin({min:c,max:c},this.constraints[u])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",(t=n.root)===null||t===void 0||t.updateScroll(),n.updateLayout(),this.resolveConstraints(),eachAxis(u=>{if(!shouldDrag(u,a,null))return;const l=this.getAxisMotionValue(u),{min:c,max:_}=this.constraints[u];l.set(mix(c,_,i[u]))})}addListeners(){var t;if(!this.visualElement.current)return;elementDragControls.set(this.visualElement,this);const a=this.visualElement.current,s=addPointerEvent(a,"pointerdown",c=>{const{drag:_,dragListener:p=!0}=this.getProps();_&&p&&this.start(c)}),n=()=>{const{dragConstraints:c}=this.getProps();isRefObject(c)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",n);i&&!i.layout&&((t=i.root)===null||t===void 0||t.updateScroll(),i.updateLayout()),n();const u=addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:_})=>{this.isDragging&&_&&(eachAxis(p=>{const d=this.getAxisMotionValue(p);d&&(this.originPoint[p]+=c[p].translate,d.set(d.get()+c[p].translate))}),this.visualElement.render())});return()=>{u(),s(),o(),l==null||l()}}getProps(){const t=this.visualElement.getProps(),{drag:a=!1,dragDirectionLock:s=!1,dragPropagation:n=!1,dragConstraints:i=!1,dragElastic:o=defaultElastic,dragMomentum:u=!0}=t;return{...t,drag:a,dragDirectionLock:s,dragPropagation:n,dragConstraints:i,dragElastic:o,dragMomentum:u}}}function shouldDrag(e,t,a){return(t===!0||t===e)&&(a===null||a===e)}function getCurrentDirection(e,t=10){let a=null;return Math.abs(e.y)>t?a="y":Math.abs(e.x)>t&&(a="x"),a}function useDrag(e){const{dragControls:t,visualElement:a}=e,s=useConstant(()=>new VisualElementDragControls(a));reactExports.useEffect(()=>t&&t.subscribe(s),[s,t]),reactExports.useEffect(()=>s.addListeners(),[s])}function usePanGesture({onPan:e,onPanStart:t,onPanEnd:a,onPanSessionStart:s,visualElement:n}){const i=e||t||a||s,o=reactExports.useRef(null),{transformPagePoint:u}=reactExports.useContext(MotionConfigContext),l={onSessionStart:s,onStart:t,onMove:e,onEnd:(_,p)=>{o.current=null,a&&a(_,p)}};reactExports.useEffect(()=>{o.current!==null&&o.current.updateHandlers(l)});function c(_){o.current=new PanSession(_,l,{transformPagePoint:u})}usePointerEvent(n,"pointerdown",i&&c),useUnmountEffect(()=>o.current&&o.current.end())}const drag={pan:makeRenderlessComponent(usePanGesture),drag:makeRenderlessComponent(useDrag)};function isCSSVariable(e){return typeof e=="string"&&e.startsWith("var(--")}const cssVariableRegex=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function parseCSSVariable(e){const t=cssVariableRegex.exec(e);if(!t)return[,];const[,a,s]=t;return[a,s]}function getVariableValue(e,t,a=1){const[s,n]=parseCSSVariable(e);if(!s)return;const i=window.getComputedStyle(t).getPropertyValue(s);return i?i.trim():isCSSVariable(n)?getVariableValue(n,t,a+1):n}function resolveCSSVariables(e,{...t},a){const s=e.current;if(!(s instanceof Element))return{target:t,transitionEnd:a};a&&(a={...a}),e.values.forEach(n=>{const i=n.get();if(!isCSSVariable(i))return;const o=getVariableValue(i,s);o&&n.set(o)});for(const n in t){const i=t[n];if(!isCSSVariable(i))continue;const o=getVariableValue(i,s);o&&(t[n]=o,a&&a[n]===void 0&&(a[n]=i))}return{target:t,transitionEnd:a}}const positionalKeys=new Set(["width","height","top","left","right","bottom","x","y"]),isPositionalKey=e=>positionalKeys.has(e),hasPositionalKey=e=>Object.keys(e).some(isPositionalKey),setAndResetVelocity=(e,t)=>{e.set(t,!1),e.set(t)},isNumOrPxType=e=>e===number$1||e===px;var BoundingBoxDimension;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})(BoundingBoxDimension||(BoundingBoxDimension={}));const getPosFromMatrix=(e,t)=>parseFloat(e.split(", ")[t]),getTranslateFromMatrix=(e,t)=>(a,{transform:s})=>{if(s==="none"||!s)return 0;const n=s.match(/^matrix3d\((.+)\)$/);if(n)return getPosFromMatrix(n[1],t);{const i=s.match(/^matrix\((.+)\)$/);return i?getPosFromMatrix(i[1],e):0}},transformKeys=new Set(["x","y","z"]),nonTranslationalTransformKeys=transformPropOrder.filter(e=>!transformKeys.has(e));function removeNonTranslationalTransform(e){const t=[];return nonTranslationalTransformKeys.forEach(a=>{const s=e.getValue(a);s!==void 0&&(t.push([a,s.get()]),s.set(a.startsWith("scale")?1:0))}),t.length&&e.render(),t}const positionalValues={width:({x:e},{paddingLeft:t="0",paddingRight:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),height:({y:e},{paddingTop:t="0",paddingBottom:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:getTranslateFromMatrix(4,13),y:getTranslateFromMatrix(5,14)},convertChangedValueTypes=(e,t,a)=>{const s=t.measureViewportBox(),n=t.current,i=getComputedStyle(n),{display:o}=i,u={};o==="none"&&t.setStaticValue("display",e.display||"block"),a.forEach(c=>{u[c]=positionalValues[c](s,i)}),t.render();const l=t.measureViewportBox();return a.forEach(c=>{const _=t.getValue(c);setAndResetVelocity(_,u[c]),e[c]=positionalValues[c](l,i)}),e},checkAndConvertChangedValueTypes=(e,t,a={},s={})=>{t={...t},s={...s};const n=Object.keys(t).filter(isPositionalKey);let i=[],o=!1;const u=[];if(n.forEach(l=>{const c=e.getValue(l);if(!e.hasValue(l))return;let _=a[l],p=findDimensionValueType(_);const d=t[l];let E;if(isKeyframesTarget(d)){const R=d.length,y=d[0]===null?1:0;_=d[y],p=findDimensionValueType(_);for(let I=y;I=0?window.pageYOffset:null,c=convertChangedValueTypes(t,e,u);return i.length&&i.forEach(([_,p])=>{e.getValue(_).set(p)}),e.render(),isBrowser&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:s}}else return{target:t,transitionEnd:s}};function unitConversion(e,t,a,s){return hasPositionalKey(t)?checkAndConvertChangedValueTypes(e,t,a,s):{target:t,transitionEnd:s}}const parseDomVariant=(e,t,a,s)=>{const n=resolveCSSVariables(e,t,s);return t=n.target,s=n.transitionEnd,unitConversion(e,t,a,s)},prefersReducedMotion={current:null},hasReducedMotionListener={current:!1};function initPrefersReducedMotion(){if(hasReducedMotionListener.current=!0,!!isBrowser)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>prefersReducedMotion.current=e.matches;e.addListener(t),t()}else prefersReducedMotion.current=!1}function updateMotionValuesFromProps(e,t,a){const{willChange:s}=t;for(const n in t){const i=t[n],o=a[n];if(isMotionValue(i))e.addValue(n,i),isWillChangeMotionValue(s)&&s.add(n);else if(isMotionValue(o))e.addValue(n,motionValue(i,{owner:e})),isWillChangeMotionValue(s)&&s.remove(n);else if(o!==i)if(e.hasValue(n)){const u=e.getValue(n);!u.hasAnimated&&u.set(i)}else{const u=e.getStaticValue(n);e.addValue(n,motionValue(u!==void 0?u:i))}}for(const n in a)t[n]===void 0&&e.removeValue(n);return t}const featureNames=Object.keys(featureDefinitions),numFeatures=featureNames.length,propEventHandlers=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class VisualElement{constructor({parent:t,props:a,reducedMotionConfig:s,visualState:n},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>sync.render(this.render,!1,!0);const{latestValues:o,renderState:u}=n;this.latestValues=o,this.baseTarget={...o},this.initialValues=a.initial?{...o}:{},this.renderState=u,this.parent=t,this.props=a,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=i,this.isControllingVariants=isControllingVariants(a),this.isVariantNode=isVariantNode(a),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:l,...c}=this.scrapeMotionValuesFromProps(a);for(const _ in c){const p=c[_];o[_]!==void 0&&isMotionValue(p)&&(p.set(o[_],!1),isWillChangeMotionValue(l)&&l.add(_))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var a;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(a=this.parent)===null||a===void 0?void 0:a.addVariantChild(this)),this.values.forEach((s,n)=>this.bindToMotionValue(n,s)),hasReducedMotionListener.current||initPrefersReducedMotion(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:prefersReducedMotion.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,a,s;(t=this.projection)===null||t===void 0||t.unmount(),cancelSync.update(this.notifyUpdate),cancelSync.render(this.render),this.valueSubscriptions.forEach(n=>n()),(a=this.removeFromVariantTree)===null||a===void 0||a.call(this),(s=this.parent)===null||s===void 0||s.children.delete(this);for(const n in this.events)this.events[n].clear();this.current=null}bindToMotionValue(t,a){const s=transformProps.has(t),n=a.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&sync.update(this.notifyUpdate,!1,!0),s&&this.projection&&(this.projection.isTransformDirty=!0)}),i=a.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{n(),i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures(t,a,s,n,i,o){const u=[];for(let l=0;lthis.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:o,layoutScroll:d})}return u}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):createBox()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,a){this.latestValues[t]=a}makeTargetAnimatable(t,a=!0){return this.makeTargetAnimatableFromInstance(t,this.props,a)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let a=0;as.variantChildren.delete(t)}addValue(t,a){this.hasValue(t)&&this.removeValue(t),this.values.set(t,a),this.latestValues[t]=a.get(),this.bindToMotionValue(t,a)}removeValue(t){var a;this.values.delete(t),(a=this.valueSubscriptions.get(t))===null||a===void 0||a(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,a){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&a!==void 0&&(s=motionValue(a,{owner:this}),this.addValue(t,s)),s}readValue(t){return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,a){this.baseTarget[t]=a}getBaseTarget(t){var a;const{initial:s}=this.props,n=typeof s=="string"||typeof s=="object"?(a=resolveVariantFromProps(this.props,s))===null||a===void 0?void 0:a[t]:void 0;if(s&&n!==void 0)return n;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!isMotionValue(i)?i:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,a){return this.events[t]||(this.events[t]=new SubscriptionManager),this.events[t].add(a)}notify(t,...a){var s;(s=this.events[t])===null||s===void 0||s.notify(...a)}}const variantProps=["initial",...variantPriorityOrder],numVariantProps=variantProps.length;class DOMVisualElement extends VisualElement{sortInstanceNodePosition(t,a){return t.compareDocumentPosition(a)&2?1:-1}getBaseTargetFromProps(t,a){var s;return(s=t.style)===null||s===void 0?void 0:s[a]}removeValueFromRenderState(t,{vars:a,style:s}){delete a[t],delete s[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:a,...s},{transformValues:n},i){let o=getOrigin(s,t||{},this);if(n&&(a&&(a=n(a)),s&&(s=n(s)),o&&(o=n(o))),i){checkTargetForNewValues(this,s,o);const u=parseDomVariant(this,s,o,a);a=u.transitionEnd,s=u.target}return{transition:t,transitionEnd:a,...s}}}function getComputedStyle$1(e){return window.getComputedStyle(e)}class HTMLVisualElement extends DOMVisualElement{readValueFromInstance(t,a){if(transformProps.has(a)){const s=getDefaultValueType(a);return s&&s.default||0}else{const s=getComputedStyle$1(t),n=(isCSSVariable$1(a)?s.getPropertyValue(a):s[a])||0;return typeof n=="string"?n.trim():n}}measureInstanceViewportBox(t,{transformPagePoint:a}){return measureViewportBox(t,a)}build(t,a,s,n){buildHTMLStyles(t,a,s,n.transformTemplate)}scrapeMotionValuesFromProps(t){return scrapeMotionValuesFromProps$1(t)}renderInstance(t,a,s,n){renderHTML(t,a,s,n)}}class SVGVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,a){return t[a]}readValueFromInstance(t,a){var s;return transformProps.has(a)?((s=getDefaultValueType(a))===null||s===void 0?void 0:s.default)||0:(a=camelCaseAttributes.has(a)?a:camelToDash(a),t.getAttribute(a))}measureInstanceViewportBox(){return createBox()}scrapeMotionValuesFromProps(t){return scrapeMotionValuesFromProps(t)}build(t,a,s,n){buildSVGAttrs(t,a,s,this.isSVGTag,n.transformTemplate)}renderInstance(t,a,s,n){renderSVG(t,a,s,n)}mount(t){this.isSVGTag=isSVGTag(t.tagName),super.mount(t)}}const createDomVisualElement=(e,t)=>isSVGComponent(e)?new SVGVisualElement(t,{enableHardwareAcceleration:!1}):new HTMLVisualElement(t,{enableHardwareAcceleration:!0});function pixelsToPercent(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const correctBorderRadius={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(px.test(e))e=parseFloat(e);else return e;const a=pixelsToPercent(e,t.target.x),s=pixelsToPercent(e,t.target.y);return`${a}% ${s}%`}},varToken="_$css",correctBoxShadow={correct:(e,{treeScale:t,projectionDelta:a})=>{const s=e,n=e.includes("var("),i=[];n&&(e=e.replace(cssVariableRegex,E=>(i.push(E),varToken)));const o=complex.parse(e);if(o.length>5)return s;const u=complex.createTransformer(e),l=typeof o[0]!="number"?1:0,c=a.x.scale*t.x,_=a.y.scale*t.y;o[0+l]/=c,o[1+l]/=_;const p=mix(c,_,.5);typeof o[2+l]=="number"&&(o[2+l]/=p),typeof o[3+l]=="number"&&(o[3+l]/=p);let d=u(o);if(n){let E=0;d=d.replace(varToken,()=>{const R=i[E];return E++,R})}return d}};class MeasureLayoutWithContext extends React.Component{componentDidMount(){const{visualElement:t,layoutGroup:a,switchLayoutGroup:s,layoutId:n}=this.props,{projection:i}=t;addScaleCorrector(defaultScaleCorrectors),i&&(a.group&&a.group.add(i),s&&s.register&&n&&s.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),globalProjectionState.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:a,visualElement:s,drag:n,isPresent:i}=this.props,o=s.projection;return o&&(o.isPresent=i,n||t.layoutDependency!==a||a===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||sync.postRender(()=>{var u;!((u=o.getStack())===null||u===void 0)&&u.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:a,switchLayoutGroup:s}=this.props,{projection:n}=t;n&&(n.scheduleCheckAfterUnmount(),a!=null&&a.group&&a.group.remove(n),s!=null&&s.deregister&&s.deregister(n))}safeToRemove(){const{safeToRemove:t}=this.props;t==null||t()}render(){return null}}function MeasureLayout(e){const[t,a]=usePresence(),s=reactExports.useContext(LayoutGroupContext);return React.createElement(MeasureLayoutWithContext,{...e,layoutGroup:s,switchLayoutGroup:reactExports.useContext(SwitchLayoutGroupContext),isPresent:t,safeToRemove:a})}const defaultScaleCorrectors={borderRadius:{...correctBorderRadius,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},layoutFeatures={measureLayout:MeasureLayout};function animate(e,t,a={}){const s=isMotionValue(e)?e:motionValue(e);return s.start(createMotionValueAnimation("",s,t,a)),{stop:()=>s.stop(),isAnimating:()=>s.isAnimating()}}const borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=e=>typeof e=="string"?parseFloat(e):e,isPx=e=>typeof e=="number"||px.test(e);function mixValues(e,t,a,s,n,i){n?(e.opacity=mix(0,a.opacity!==void 0?a.opacity:1,easeCrossfadeIn(s)),e.opacityExit=mix(t.opacity!==void 0?t.opacity:1,0,easeCrossfadeOut(s))):i&&(e.opacity=mix(t.opacity!==void 0?t.opacity:1,a.opacity!==void 0?a.opacity:1,s));for(let o=0;ost?1:a(progress(e,t,s))}function copyAxisInto(e,t){e.min=t.min,e.max=t.max}function copyBoxInto(e,t){copyAxisInto(e.x,t.x),copyAxisInto(e.y,t.y)}function removePointDelta(e,t,a,s,n){return e-=t,e=scalePoint(e,1/a,s),n!==void 0&&(e=scalePoint(e,1/n,s)),e}function removeAxisDelta(e,t=0,a=1,s=.5,n,i=e,o=e){if(percent.test(t)&&(t=parseFloat(t),t=mix(o.min,o.max,t/100)-o.min),typeof t!="number")return;let u=mix(i.min,i.max,s);e===i&&(u-=t),e.min=removePointDelta(e.min,t,a,u,n),e.max=removePointDelta(e.max,t,a,u,n)}function removeAxisTransforms(e,t,[a,s,n],i,o){removeAxisDelta(e,t[a],t[s],t[n],t.scale,i,o)}const xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(e,t,a,s){removeAxisTransforms(e.x,t,xKeys,a==null?void 0:a.x,s==null?void 0:s.x),removeAxisTransforms(e.y,t,yKeys,a==null?void 0:a.y,s==null?void 0:s.y)}function isAxisDeltaZero(e){return e.translate===0&&e.scale===1}function isDeltaZero(e){return isAxisDeltaZero(e.x)&&isAxisDeltaZero(e.y)}function boxEquals(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function aspectRatio(e){return calcLength(e.x)/calcLength(e.y)}class NodeStack{constructor(){this.members=[]}add(t){addUniqueItem(this.members,t),t.scheduleRender()}remove(t){if(removeItem(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const a=this.members[this.members.length-1];a&&this.promote(a)}}relegate(t){const a=this.members.findIndex(n=>t===n);if(a===0)return!1;let s;for(let n=a;n>=0;n--){const i=this.members[n];if(i.isPresent!==!1){s=i;break}}return s?(this.promote(s),!0):!1}promote(t,a){var s;const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,a&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),!((s=t.root)===null||s===void 0)&&s.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var a,s,n,i,o;(s=(a=t.options).onExitComplete)===null||s===void 0||s.call(a),(o=(n=t.resumingFrom)===null||n===void 0?void 0:(i=n.options).onExitComplete)===null||o===void 0||o.call(i)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function buildProjectionTransform(e,t,a){let s="";const n=e.x.translate/t.x,i=e.y.translate/t.y;if((n||i)&&(s=`translate3d(${n}px, ${i}px, 0) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),a){const{rotate:l,rotateX:c,rotateY:_}=a;l&&(s+=`rotate(${l}deg) `),c&&(s+=`rotateX(${c}deg) `),_&&(s+=`rotateY(${_}deg) `)}const o=e.x.scale*t.x,u=e.y.scale*t.y;return(o!==1||u!==1)&&(s+=`scale(${o}, ${u})`),s||"none"}const compareByDepth=(e,t)=>e.depth-t.depth;class FlatTree{constructor(){this.children=[],this.isDirty=!1}add(t){addUniqueItem(this.children,t),this.isDirty=!0}remove(t){removeItem(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(t)}}const transformAxes=["","X","Y","Z"],animationTarget=1e3;let id=0;function createProjectionNode({attachResizeListener:e,defaultParent:t,measureScroll:a,checkIsScrollRoot:s,resetTransform:n}){return class{constructor(o,u={},l=t==null?void 0:t()){this.id=id++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(propagateDirtyNodes),this.nodes.forEach(resolveTargetDelta),this.nodes.forEach(calcProjection)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=o,this.latestValues=u,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0,o&&this.root.registerPotentialNode(o,this);for(let c=0;cthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=delay(E,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,this.nodes.forEach(finishAnimation))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&p&&(c||_)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:E,hasRelativeTargetChanged:R,layout:y})=>{var I,A,x,g,T;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const O=(A=(I=this.options.transition)!==null&&I!==void 0?I:p.getDefaultTransition())!==null&&A!==void 0?A:defaultLayoutTransition,{onLayoutAnimationStart:C,onLayoutAnimationComplete:U}=p.getProps(),L=!this.targetLayout||!boxEquals(this.targetLayout,y)||R,j=!E&&R;if(!((x=this.resumeFrom)===null||x===void 0)&&x.instance||j||E&&(L||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,j);const X={...getValueTransition(O,"layout"),onPlay:C,onComplete:U};p.shouldReduceMotion&&(X.delay=0,X.type=!1),this.startAnimation(X)}else!E&&this.animationProgress===0&&finishAnimation(this),this.isLead()&&((T=(g=this.options).onExitComplete)===null||T===void 0||T.call(g));this.targetLayout=y})}unmount(){var o,u;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(o=this.getStack())===null||o===void 0||o.remove(this),(u=this.parent)===null||u===void 0||u.children.delete(this),this.instance=void 0,cancelSync.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var o;return this.isAnimationBlocked||((o=this.parent)===null||o===void 0?void 0:o.isTreeAnimationBlocked())||!1}startUpdate(){var o;this.isUpdateBlocked()||(this.isUpdating=!0,(o=this.nodes)===null||o===void 0||o.forEach(resetRotation),this.animationId++)}willUpdate(o=!0){var u,l,c;if(this.root.isUpdateBlocked()){(l=(u=this.options).onExitComplete)===null||l===void 0||l.call(u);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let E=0;E{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var o;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{var g;const T=x/1e3;mixAxisDelta(E.x,o.x,T),mixAxisDelta(E.y,o.y,T),this.setTargetDelta(E),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(!((g=this.relativeParent)===null||g===void 0)&&g.layout)&&(calcRelativePosition(R,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mixBox(this.relativeTarget,this.relativeTargetOrigin,R,T)),y&&(this.animationValues=d,mixValues(d,p,this.latestValues,T,A,I)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(0)}startAnimation(o){var u,l;this.notifyListeners("animationStart"),(u=this.currentAnimation)===null||u===void 0||u.stop(),this.resumingFrom&&((l=this.resumingFrom.currentAnimation)===null||l===void 0||l.stop()),this.pendingAnimation&&(cancelSync.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=sync.update(()=>{globalProjectionState.hasAnimatedSinceResize=!0,this.currentAnimation=animate(0,animationTarget,{...o,onUpdate:c=>{var _;this.mixTargetDelta(c),(_=o.onUpdate)===null||_===void 0||_.call(o,c)},onComplete:()=>{var c;(c=o.onComplete)===null||c===void 0||c.call(o),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var o;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(o=this.getStack())===null||o===void 0||o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var o;this.currentAnimation&&((o=this.mixTargetDelta)===null||o===void 0||o.call(this,animationTarget),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:u,target:l,layout:c,latestValues:_}=o;if(!(!u||!l||!c)){if(this!==o&&this.layout&&c&&shouldAnimatePositionOnly(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||createBox();const p=calcLength(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+p;const d=calcLength(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}copyBoxInto(u,l),transformBox(u,_),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,u,_)}}registerSharedNode(o,u){var l,c,_;this.sharedNodes.has(o)||this.sharedNodes.set(o,new NodeStack),this.sharedNodes.get(o).add(u),u.promote({transition:(l=u.options.initialPromotionConfig)===null||l===void 0?void 0:l.transition,preserveFollowOpacity:(_=(c=u.options.initialPromotionConfig)===null||c===void 0?void 0:c.shouldPreserveFollowOpacity)===null||_===void 0?void 0:_.call(c,u)})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:u}=this.options;return u?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:u}=this.options;return u?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:u,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let u=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(u=!0),!u)return;const c={};for(let _=0;_{var u;return(u=o.currentAnimation)===null||u===void 0?void 0:u.stop()}),this.root.nodes.forEach(clearMeasurements),this.root.sharedNodes.clear()}}}function updateLayout(e){e.updateLayout()}function notifyLayoutUpdate(e){var t,a,s;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:o}=e.layout,{animationType:u}=e.options,l=n.source!==e.layout.source;u==="size"?eachAxis(E=>{const R=l?n.measuredBox[E]:n.layoutBox[E],y=calcLength(R);R.min=i[E].min,R.max=R.min+y}):shouldAnimatePositionOnly(u,n.layoutBox,i)&&eachAxis(E=>{const R=l?n.measuredBox[E]:n.layoutBox[E],y=calcLength(i[E]);R.max=R.min+y});const c=createDelta();calcBoxDelta(c,i,n.layoutBox);const _=createDelta();l?calcBoxDelta(_,e.applyTransform(o,!0),n.measuredBox):calcBoxDelta(_,i,n.layoutBox);const p=!isDeltaZero(c);let d=!1;if(!e.resumeFrom){const E=e.getClosestProjectingParent();if(E&&!E.resumeFrom){const{snapshot:R,layout:y}=E;if(R&&y){const I=createBox();calcRelativePosition(I,n.layoutBox,R.layoutBox);const A=createBox();calcRelativePosition(A,i,y.layoutBox),boxEquals(I,A)||(d=!0)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:_,layoutDelta:c,hasLayoutChanged:p,hasRelativeTargetChanged:d})}else e.isLead()&&((s=(a=e.options).onExitComplete)===null||s===void 0||s.call(a));e.options.transition=void 0}function propagateDirtyNodes(e){e.isProjectionDirty||(e.isProjectionDirty=!!(e.parent&&e.parent.isProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=!!(e.parent&&e.parent.isTransformDirty))}function clearSnapshot(e){e.clearSnapshot()}function clearMeasurements(e){e.clearMeasurements()}function resetTransformStyle(e){const{visualElement:t}=e.options;t!=null&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function finishAnimation(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function resolveTargetDelta(e){e.resolveTargetDelta()}function calcProjection(e){e.calcProjection()}function resetRotation(e){e.resetRotation()}function removeLeadSnapshots(e){e.removeLeadSnapshot()}function mixAxisDelta(e,t,a){e.translate=mix(t.translate,0,a),e.scale=mix(t.scale,1,a),e.origin=t.origin,e.originPoint=t.originPoint}function mixAxis(e,t,a,s){e.min=mix(t.min,a.min,s),e.max=mix(t.max,a.max,s)}function mixBox(e,t,a,s){mixAxis(e.x,t.x,a.x,s),mixAxis(e.y,t.y,a.y,s)}function hasOpacityCrossfade(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const defaultLayoutTransition={duration:.45,ease:[.4,0,.1,1]};function mountNodeEarly(e,t){let a=e.root;for(let i=e.path.length-1;i>=0;i--)if(e.path[i].instance){a=e.path[i];break}const n=(a&&a!==e.root?a.instance:document).querySelector(`[data-projection-id="${t}"]`);n&&e.mount(n,!0)}function roundAxis(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function roundBox(e){roundAxis(e.x),roundAxis(e.y)}function shouldAnimatePositionOnly(e,t,a){return e==="position"||e==="preserve-aspect"&&!isNear(aspectRatio(t),aspectRatio(a),.2)}const DocumentProjectionNode=createProjectionNode({attachResizeListener:(e,t)=>addDomEvent(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!rootProjectionNode.current){const e=new DocumentProjectionNode(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),rootProjectionNode.current=e}return rootProjectionNode.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),featureBundle={...animations,...gestureAnimations,...drag,...layoutFeatures},motion=createMotionProxy((e,t)=>createDomMotionConfig(e,t,featureBundle,createDomVisualElement,HTMLProjectionNode)),getUnseenMessages=createAsyncThunk("GET_UNSEEN_MESSAGES",async(e,{dispatch:t})=>{const{data:a,status:s}=await axios$1.get("get_num_message/");return{data:a,status:s}}),HeaderOperations=()=>{const[e,t]=reactExports.useState(null),a=!!e,s=useDispatch(),n=useSelector(d=>d.userSlice.loginUserProfile),i=useNavigate(),o=d=>{t(d.currentTarget)},[u,l]=reactExports.useState({state:!1,num:0}),c=useSelector(d=>d.userSlice.role),_=()=>{t(null)};reactExports.useEffect(()=>{s(getUnseenMessages()).then(d=>{var E;(E=d==null?void 0:d.payload)!=null&&E.data&&l(d.payload.data)}).catch(d=>{console.error("Error fetching unseen messages:",d),l({state:!1,num:0})})},[s]);function p(d){var E,R;if(d){const y=(R=(E=d==null?void 0:d.split(" "))==null?void 0:E.filter(I=>I))==null?void 0:R.map(I=>I[0]);return{sx:{bgcolor:"#353b48"},children:y[0]}}return{}}return jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:{xs:"flex-start",sm:"center"},padding:{xs:"0 16px",sm:"0"}},children:[jsxRuntimeExports.jsx(Tooltip,{placement:"bottom",title:"مدیریت تیکت",children:jsxRuntimeExports.jsx(IconButton,{sx:{color:"white"},onClick:()=>{i(ROUTE_GENERAL_TICKET_LIST)},children:u!=null&&u.state?jsxRuntimeExports.jsx(motion.div,{initial:{y:0},animate:{y:[0,-2,0]},transition:{duration:.5,repeat:1/0,repeatType:"loop"},children:jsxRuntimeExports.jsx(Badge,{badgeContent:u==null?void 0:u.num,color:"error",anchorOrigin:{vertical:"top",horizontal:"left"},children:jsxRuntimeExports.jsx(default_1$1j,{sx:{fontSize:26}})})}):jsxRuntimeExports.jsx(default_1$1j,{sx:{fontSize:26}})})}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.5,cursor:"pointer"},"aria-controls":a?"app-menu":void 0,"aria-haspopup":"true","aria-expanded":a?"true":void 0,onClick:o,children:[jsxRuntimeExports.jsx(IconButton,{sx:{color:"white"},children:jsxRuntimeExports.jsx(default_1$1n,{sx:{fontSize:26}})}),jsxRuntimeExports.jsxs(Box,{sx:{display:{xs:"none",sm:"flex"},flexDirection:"column",alignItems:"flex-start",color:"white"},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:"bold",fontSize:11.5},children:(n==null?void 0:n.fullname)||"-"}),jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{fontSize:11,mt:-.5},children:(n==null?void 0:n.mobile)||"-"})]})]}),jsxRuntimeExports.jsxs(Menu,{disableScrollLock:!0,id:"app-menu",anchorEl:e,open:a,onClose:_,PaperProps:{sx:{width:{xs:"90%",sm:"auto"},height:{xs:"50vh",sm:"auto"},borderRadius:2,boxShadow:3,overflowY:"auto"}},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:[jsxRuntimeExports.jsxs(Box,{display:"flex",justifyContent:"space-between",alignItems:"center",px:1.4,pb:1.4,gap:4,onClick:()=>{i(ROUTE_GENERAL_USER_PROFILE),_()},sx:{cursor:"pointer"},children:[jsxRuntimeExports.jsxs(Grid,{container:!0,gap:1,alignItems:"center",children:[n!=null&&n.image&&(n==null?void 0:n.image)!=="empty"&&(n!=null&&n.fullname)?jsxRuntimeExports.jsx(Avatar,{alt:"User Profile",src:n==null?void 0:n.image,color:"secondary",sx:{width:32,height:32}}):jsxRuntimeExports.jsx(Avatar,{...p(n==null?void 0:n.fullname),sx:{width:32,height:32}}),jsxRuntimeExports.jsxs(Grid,{direction:"column",children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",style:{fontSize:13,lineHeight:.7},mt:.5,children:n==null?void 0:n.fullname}),jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"#666",style:{fontSize:11},children:["موبایل: ",n==null?void 0:n.mobile]})]})]}),jsxRuntimeExports.jsx(ChevronLeft,{sx:{fontSize:20,mr:-1}})]}),jsxRuntimeExports.jsxs(Grid,{direction:"column",gap:1,px:1,py:.5,sx:{borderTop:"1px solid #f0f0f0",borderBottom:"1px solid #f0f0f0"},children:[jsxRuntimeExports.jsx(Grid,{container:!0,justifyContent:"center",children:jsxRuntimeExports.jsx(Button,{startIcon:jsxRuntimeExports.jsx(default_1$1o,{}),color:"primary",fullWidth:!0,onClick:()=>{i(ROUTE_GENERAL_MESSAGES),_()},variant:"text",sx:{justifyContent:"flex-start",fontSize:12},children:"پیام های شما"})}),(c==null?void 0:c.includes("KillHouse"))&&jsxRuntimeExports.jsx(Grid,{container:!0,justifyContent:"center",children:jsxRuntimeExports.jsx(Button,{startIcon:jsxRuntimeExports.jsx(default_1$1l,{}),color:"primary",fullWidth:!0,onClick:()=>{i(ROUTE_GENERAL_TRAINING),_()},variant:"text",sx:{justifyContent:"flex-start",fontSize:12},children:"آموزش"})}),jsxRuntimeExports.jsx(Grid,{container:!0,justifyContent:"center",children:jsxRuntimeExports.jsx(Button,{startIcon:jsxRuntimeExports.jsx(default_1$1p,{}),color:"primary",fullWidth:!0,onClick:()=>{i(ROUTE_GENERAL_SUPPORT),_()},variant:"text",sx:{justifyContent:"flex-start",fontSize:12},children:"پشتیبانی"})})]}),jsxRuntimeExports.jsx(Grid,{container:!0,justifyContent:"center",alignItems:"center",px:1.4,py:1,children:jsxRuntimeExports.jsx(Button,{startIcon:jsxRuntimeExports.jsx(default_1$1m,{sx:{fontSize:16}}),variant:"outlined",fullWidth:!0,sx:{fontSize:12,padding:"3px 0px"},color:"error",onClick:()=>{s(DRAWER({right:!1,bottom:!1,content:null})),_(),s(OPEN_MODAL({title:"مایل به خروج از سامانه هستید؟",size:"320px",content:jsxRuntimeExports.jsxs(Grid,{container:!0,xs:12,justifyContent:"space-around",sx:{maxWidth:"320px"},children:[jsxRuntimeExports.jsx(Grid,{item:!0,container:!0,xs:4,children:jsxRuntimeExports.jsx(Button,{fullWidth:!0,color:"error",variant:"contained",startIcon:jsxRuntimeExports.jsx(default_1$1m,{}),onClick:()=>{_(),s(BACKDROP_HIDE()),s(CLOSE_MODAL()),s(SET_ADMIN_TOKEN(null)),s(LOG_OUT())},children:"بله"})}),jsxRuntimeExports.jsx(Grid,{item:!0,container:!0,xs:4,children:jsxRuntimeExports.jsx(Button,{fullWidth:!0,startIcon:jsxRuntimeExports.jsx(default_1$1k,{}),variant:"outlined",onClick:()=>{s(CLOSE_MODAL())},children:"لغو"})})]})}))},children:"خروج"})})]})]})};var Warehouse={},_interopRequireDefault$1i=interopRequireDefaultExports;Object.defineProperty(Warehouse,"__esModule",{value:!0});var default_1$1i=Warehouse.default=void 0,_createSvgIcon$1i=_interopRequireDefault$1i(requireCreateSvgIcon()),_jsxRuntime$1i=jsxRuntimeExports;default_1$1i=Warehouse.default=(0,_createSvgIcon$1i.default)((0,_jsxRuntime$1i.jsx)("path",{d:"M22 21V7L12 3 2 7v14h5v-9h10v9zm-11-2H9v2h2zm2-3h-2v2h2zm2 3h-2v2h2z"}),"Warehouse");var Egg={},_interopRequireDefault$1h=interopRequireDefaultExports;Object.defineProperty(Egg,"__esModule",{value:!0});var default_1$1h=Egg.default=void 0,_createSvgIcon$1h=_interopRequireDefault$1h(requireCreateSvgIcon()),_jsxRuntime$1h=jsxRuntimeExports;default_1$1h=Egg.default=(0,_createSvgIcon$1h.default)((0,_jsxRuntime$1h.jsx)("path",{d:"M12 3C8.5 3 5 9.33 5 14c0 3.87 3.13 7 7 7s7-3.13 7-7c0-4.67-3.5-11-7-11m1 15c-3 0-5-1.99-5-5 0-.55.45-1 1-1s1 .45 1 1c0 2.92 2.42 3 3 3 .55 0 1 .45 1 1s-.45 1-1 1"}),"Egg");var LocalShipping={},_interopRequireDefault$1g=interopRequireDefaultExports;Object.defineProperty(LocalShipping,"__esModule",{value:!0});var default_1$1g=LocalShipping.default=void 0,_createSvgIcon$1g=_interopRequireDefault$1g(requireCreateSvgIcon()),_jsxRuntime$1g=jsxRuntimeExports;default_1$1g=LocalShipping.default=(0,_createSvgIcon$1g.default)((0,_jsxRuntime$1g.jsx)("path",{d:"M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5zM6 18.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m13.5-9 1.96 2.5H17V9.5zm-1.5 9c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5"}),"LocalShipping");var AttachMoney={},_interopRequireDefault$1f=interopRequireDefaultExports;Object.defineProperty(AttachMoney,"__esModule",{value:!0});var default_1$1f=AttachMoney.default=void 0,_createSvgIcon$1f=_interopRequireDefault$1f(requireCreateSvgIcon()),_jsxRuntime$1f=jsxRuntimeExports;default_1$1f=AttachMoney.default=(0,_createSvgIcon$1f.default)((0,_jsxRuntime$1f.jsx)("path",{d:"M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4"}),"AttachMoney");var Assignment={},_interopRequireDefault$1e=interopRequireDefaultExports;Object.defineProperty(Assignment,"__esModule",{value:!0});var default_1$1e=Assignment.default=void 0,_createSvgIcon$1e=_interopRequireDefault$1e(requireCreateSvgIcon()),_jsxRuntime$1e=jsxRuntimeExports;default_1$1e=Assignment.default=(0,_createSvgIcon$1e.default)((0,_jsxRuntime$1e.jsx)("path",{d:"M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m2 14H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"}),"Assignment");var AssignmentTurnedIn={},_interopRequireDefault$1d=interopRequireDefaultExports;Object.defineProperty(AssignmentTurnedIn,"__esModule",{value:!0});var default_1$1d=AssignmentTurnedIn.default=void 0,_createSvgIcon$1d=_interopRequireDefault$1d(requireCreateSvgIcon()),_jsxRuntime$1d=jsxRuntimeExports;default_1$1d=AssignmentTurnedIn.default=(0,_createSvgIcon$1d.default)((0,_jsxRuntime$1d.jsx)("path",{d:"M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m-2 14-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z"}),"AssignmentTurnedIn");var Archive={},_interopRequireDefault$1c=interopRequireDefaultExports;Object.defineProperty(Archive,"__esModule",{value:!0});var default_1$1c=Archive.default=void 0,_createSvgIcon$1c=_interopRequireDefault$1c(requireCreateSvgIcon()),_jsxRuntime$1c=jsxRuntimeExports;default_1$1c=Archive.default=(0,_createSvgIcon$1c.default)((0,_jsxRuntime$1c.jsx)("path",{d:"m20.54 5.23-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27M12 17.5 6.5 12H10v-2h4v2h3.5zM5.12 5l.81-1h12l.94 1z"}),"Archive");var FolderOpen={},_interopRequireDefault$1b=interopRequireDefaultExports;Object.defineProperty(FolderOpen,"__esModule",{value:!0});var default_1$1b=FolderOpen.default=void 0,_createSvgIcon$1b=_interopRequireDefault$1b(requireCreateSvgIcon()),_jsxRuntime$1b=jsxRuntimeExports;default_1$1b=FolderOpen.default=(0,_createSvgIcon$1b.default)((0,_jsxRuntime$1b.jsx)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 12H4V8h16z"}),"FolderOpen");var NewReleases={},_interopRequireDefault$1a=interopRequireDefaultExports;Object.defineProperty(NewReleases,"__esModule",{value:!0});var default_1$1a=NewReleases.default=void 0,_createSvgIcon$1a=_interopRequireDefault$1a(requireCreateSvgIcon()),_jsxRuntime$1a=jsxRuntimeExports;default_1$1a=NewReleases.default=(0,_createSvgIcon$1a.default)((0,_jsxRuntime$1a.jsx)("path",{d:"m23 12-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68zm-10 5h-2v-2h2zm0-4h-2V7h2z"}),"NewReleases");var TaskAlt={},_interopRequireDefault$19=interopRequireDefaultExports;Object.defineProperty(TaskAlt,"__esModule",{value:!0});var default_1$19=TaskAlt.default=void 0,_createSvgIcon$19=_interopRequireDefault$19(requireCreateSvgIcon()),_jsxRuntime$19=jsxRuntimeExports;default_1$19=TaskAlt.default=(0,_createSvgIcon$19.default)((0,_jsxRuntime$19.jsx)("path",{d:"M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39z"}),"TaskAlt");var AttachFile={},_interopRequireDefault$18=interopRequireDefaultExports;Object.defineProperty(AttachFile,"__esModule",{value:!0});var default_1$18=AttachFile.default=void 0,_createSvgIcon$18=_interopRequireDefault$18(requireCreateSvgIcon()),_jsxRuntime$18=jsxRuntimeExports;default_1$18=AttachFile.default=(0,_createSvgIcon$18.default)((0,_jsxRuntime$18.jsx)("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"}),"AttachFile");var MeetingRoom={},_interopRequireDefault$17=interopRequireDefaultExports;Object.defineProperty(MeetingRoom,"__esModule",{value:!0});var default_1$17=MeetingRoom.default=void 0,_createSvgIcon$17=_interopRequireDefault$17(requireCreateSvgIcon()),_jsxRuntime$17=jsxRuntimeExports;default_1$17=MeetingRoom.default=(0,_createSvgIcon$17.default)((0,_jsxRuntime$17.jsx)("path",{d:"M14 6v15H3v-2h2V3h9v1h5v15h2v2h-4V6zm-4 5v2h2v-2z"}),"MeetingRoom");var PendingActions={},_interopRequireDefault$16=interopRequireDefaultExports;Object.defineProperty(PendingActions,"__esModule",{value:!0});var default_1$16=PendingActions.default=void 0,_createSvgIcon$16=_interopRequireDefault$16(requireCreateSvgIcon()),_jsxRuntime$16=jsxRuntimeExports;default_1$16=PendingActions.default=(0,_createSvgIcon$16.default)((0,_jsxRuntime$16.jsx)("path",{d:"M17 12c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m1.65 7.35L16.5 17.2V14h1v2.79l1.85 1.85zM18 3h-3.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H6c-1.1 0-2 .9-2 2v15c0 1.1.9 2 2 2h6.11c-.59-.57-1.07-1.25-1.42-2H6V5h2v3h8V5h2v5.08c.71.1 1.38.31 2 .6V5c0-1.1-.9-2-2-2m-6 2c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"}),"PendingActions");var Paid={},_interopRequireDefault$15=interopRequireDefaultExports;Object.defineProperty(Paid,"__esModule",{value:!0});var default_1$15=Paid.default=void 0,_createSvgIcon$15=_interopRequireDefault$15(requireCreateSvgIcon()),_jsxRuntime$15=jsxRuntimeExports;default_1$15=Paid.default=(0,_createSvgIcon$15.default)((0,_jsxRuntime$15.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m.88 15.76V19h-1.75v-1.29c-.74-.18-2.39-.77-3.02-2.96l1.65-.67c.06.22.58 2.09 2.4 2.09.93 0 1.98-.48 1.98-1.61 0-.96-.7-1.46-2.28-2.03-1.1-.39-3.35-1.03-3.35-3.31 0-.1.01-2.4 2.62-2.96V5h1.75v1.24c1.84.32 2.51 1.79 2.66 2.23l-1.58.67c-.11-.35-.59-1.34-1.9-1.34-.7 0-1.81.37-1.81 1.39 0 .95.86 1.31 2.64 1.9 2.4.83 3.01 2.05 3.01 3.45 0 2.63-2.5 3.13-3.02 3.22"}),"Paid");var FlightTakeoff={},_interopRequireDefault$14=interopRequireDefaultExports;Object.defineProperty(FlightTakeoff,"__esModule",{value:!0});var default_1$14=FlightTakeoff.default=void 0,_createSvgIcon$14=_interopRequireDefault$14(requireCreateSvgIcon()),_jsxRuntime$14=jsxRuntimeExports;default_1$14=FlightTakeoff.default=(0,_createSvgIcon$14.default)((0,_jsxRuntime$14.jsx)("path",{d:"M2.5 19h19v2h-19zm19.57-9.36c-.21-.8-1.04-1.28-1.84-1.06L14.92 10l-6.9-6.43-1.93.51 4.14 7.17-4.97 1.33-1.97-1.54-1.45.39 2.59 4.49s7.12-1.9 16.57-4.43c.81-.23 1.28-1.05 1.07-1.85"}),"FlightTakeoff");var AcUnit={},_interopRequireDefault$13=interopRequireDefaultExports;Object.defineProperty(AcUnit,"__esModule",{value:!0});var default_1$13=AcUnit.default=void 0,_createSvgIcon$13=_interopRequireDefault$13(requireCreateSvgIcon()),_jsxRuntime$13=jsxRuntimeExports;default_1$13=AcUnit.default=(0,_createSvgIcon$13.default)((0,_jsxRuntime$13.jsx)("path",{d:"M22 11h-4.17l3.24-3.24-1.41-1.42L15 11h-2V9l4.66-4.66-1.42-1.41L13 6.17V2h-2v4.17L7.76 2.93 6.34 4.34 11 9v2H9L4.34 6.34 2.93 7.76 6.17 11H2v2h4.17l-3.24 3.24 1.41 1.42L9 13h2v2l-4.66 4.66 1.42 1.41L11 17.83V22h2v-4.17l3.24 3.24 1.42-1.41L13 15v-2h2l4.66 4.66 1.41-1.42L17.83 13H22z"}),"AcUnit");var SettingsSuggest={},_interopRequireDefault$12=interopRequireDefaultExports;Object.defineProperty(SettingsSuggest,"__esModule",{value:!0});var default_1$12=SettingsSuggest.default=void 0,_createSvgIcon$12=_interopRequireDefault$12(requireCreateSvgIcon()),_jsxRuntime$12=jsxRuntimeExports;default_1$12=SettingsSuggest.default=(0,_createSvgIcon$12.default)((0,_jsxRuntime$12.jsx)("path",{d:"M17.41 6.59 15 5.5l2.41-1.09L18.5 2l1.09 2.41L22 5.5l-2.41 1.09L18.5 9zm3.87 6.13L20.5 11l-.78 1.72-1.72.78 1.72.78.78 1.72.78-1.72L23 13.5zm-5.04 1.65 1.94 1.47-2.5 4.33-2.24-.94c-.2.13-.42.26-.64.37l-.3 2.4h-5l-.3-2.41c-.22-.11-.43-.23-.64-.37l-2.24.94-2.5-4.33 1.94-1.47c-.01-.11-.01-.24-.01-.36s0-.25.01-.37l-1.94-1.47 2.5-4.33 2.24.94c.2-.13.42-.26.64-.37L7.5 6h5l.3 2.41c.22.11.43.23.64.37l2.24-.94 2.5 4.33-1.94 1.47c.01.12.01.24.01.37s0 .24-.01.36M13 14c0-1.66-1.34-3-3-3s-3 1.34-3 3 1.34 3 3 3 3-1.34 3-3"}),"SettingsSuggest");var Vaccines={},_interopRequireDefault$11=interopRequireDefaultExports;Object.defineProperty(Vaccines,"__esModule",{value:!0});var default_1$11=Vaccines.default=void 0,_createSvgIcon$11=_interopRequireDefault$11(requireCreateSvgIcon()),_jsxRuntime$11=jsxRuntimeExports;default_1$11=Vaccines.default=(0,_createSvgIcon$11.default)((0,_jsxRuntime$11.jsx)("path",{d:"M11 5.5H8V4h.5c.55 0 1-.45 1-1s-.45-1-1-1h-3c-.55 0-1 .45-1 1s.45 1 1 1H6v1.5H3c-.55 0-1 .45-1 1s.45 1 1 1V15c0 1.1.9 2 2 2h1v4l2 1.5V17h1c1.1 0 2-.9 2-2V7.5c.55 0 1-.45 1-1s-.45-1-1-1M9 9H7.25c-.41 0-.75.34-.75.75s.34.75.75.75H9V12H7.25c-.41 0-.75.34-.75.75s.34.75.75.75H9V15H5V7.5h4zm10.5 1.5V10c.55 0 1-.45 1-1s-.45-1-1-1h-5c-.55 0-1 .45-1 1s.45 1 1 1v.5c0 .5-1.5 1.16-1.5 3V20c0 1.1.9 2 2 2h4c1.1 0 2-.9 2-2v-6.5c0-1.84-1.5-2.5-1.5-3m-3 0V10h1v.5c0 1.6 1.5 2 1.5 3v.5h-4v-.5c0-1 1.5-1.4 1.5-3M15 20v-1.5h4V20z"}),"Vaccines");var _Error={},_interopRequireDefault$10=interopRequireDefaultExports;Object.defineProperty(_Error,"__esModule",{value:!0});var default_1$10=_Error.default=void 0,_createSvgIcon$10=_interopRequireDefault$10(requireCreateSvgIcon()),_jsxRuntime$10=jsxRuntimeExports;default_1$10=_Error.default=(0,_createSvgIcon$10.default)((0,_jsxRuntime$10.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error");var Kitchen={},_interopRequireDefault$$=interopRequireDefaultExports;Object.defineProperty(Kitchen,"__esModule",{value:!0});var default_1$$=Kitchen.default=void 0,_createSvgIcon$$=_interopRequireDefault$$(requireCreateSvgIcon()),_jsxRuntime$$=jsxRuntimeExports;default_1$$=Kitchen.default=(0,_createSvgIcon$$.default)((0,_jsxRuntime$$.jsx)("path",{d:"M20 9V4c0-1.1-.9-2-2-2H6c-1.1 0-2 .9-2 2v5zM8 5h2v3H8zm-4 6v9c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-9zm6 6H8v-5h2z"}),"Kitchen");var SpaceDashboard={},_interopRequireDefault$_=interopRequireDefaultExports;Object.defineProperty(SpaceDashboard,"__esModule",{value:!0});var default_1$_=SpaceDashboard.default=void 0,_createSvgIcon$_=_interopRequireDefault$_(requireCreateSvgIcon()),_jsxRuntime$_=jsxRuntimeExports;default_1$_=SpaceDashboard.default=(0,_createSvgIcon$_.default)((0,_jsxRuntime$_.jsx)("path",{d:"M11 21H5c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h6zm2 0h6c1.1 0 2-.9 2-2v-7h-8zm8-11V5c0-1.1-.9-2-2-2h-6v7z"}),"SpaceDashboard");var ManageAccounts={},_interopRequireDefault$Z=interopRequireDefaultExports;Object.defineProperty(ManageAccounts,"__esModule",{value:!0});var default_1$Z=ManageAccounts.default=void 0,_createSvgIcon$Z=_interopRequireDefault$Z(requireCreateSvgIcon()),_jsxRuntime$Z=jsxRuntimeExports;default_1$Z=ManageAccounts.default=(0,_createSvgIcon$Z.default)([(0,_jsxRuntime$Z.jsx)("circle",{cx:"10",cy:"8",r:"4"},"0"),(0,_jsxRuntime$Z.jsx)("path",{d:"M10.67 13.02c-.22-.01-.44-.02-.67-.02-2.42 0-4.68.67-6.61 1.82-.88.52-1.39 1.5-1.39 2.53V20h9.26c-.79-1.13-1.26-2.51-1.26-4 0-1.07.25-2.07.67-2.98M20.75 16c0-.22-.03-.42-.06-.63l1.14-1.01-1-1.73-1.45.49c-.32-.27-.68-.48-1.08-.63L18 11h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49-1 1.73 1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01 1 1.73 1.45-.49c.32.27.68.48 1.08.63L16 21h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49 1-1.73-1.14-1.01c.03-.21.06-.41.06-.63M17 18c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"},"1")],"ManageAccounts");var ReportProblem={},_interopRequireDefault$Y=interopRequireDefaultExports;Object.defineProperty(ReportProblem,"__esModule",{value:!0});var default_1$Y=ReportProblem.default=void 0,_createSvgIcon$Y=_interopRequireDefault$Y(requireCreateSvgIcon()),_jsxRuntime$Y=jsxRuntimeExports;default_1$Y=ReportProblem.default=(0,_createSvgIcon$Y.default)((0,_jsxRuntime$Y.jsx)("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"ReportProblem");var Campaign={},_interopRequireDefault$X=interopRequireDefaultExports;Object.defineProperty(Campaign,"__esModule",{value:!0});var default_1$X=Campaign.default=void 0,_createSvgIcon$X=_interopRequireDefault$X(requireCreateSvgIcon()),_jsxRuntime$X=jsxRuntimeExports;default_1$X=Campaign.default=(0,_createSvgIcon$X.default)((0,_jsxRuntime$X.jsx)("path",{d:"M18 11v2h4v-2zm-2 6.61c.96.71 2.21 1.65 3.2 2.39.4-.53.8-1.07 1.2-1.6-.99-.74-2.24-1.68-3.2-2.4-.4.54-.8 1.08-1.2 1.61M20.4 5.6c-.4-.53-.8-1.07-1.2-1.6-.99.74-2.24 1.68-3.2 2.4.4.53.8 1.07 1.2 1.6.96-.72 2.21-1.65 3.2-2.4M4 9c-1.1 0-2 .9-2 2v2c0 1.1.9 2 2 2h1v4h2v-4h1l5 3V6L8 9zm11.5 3c0-1.33-.58-2.53-1.5-3.35v6.69c.92-.81 1.5-2.01 1.5-3.34"}),"Campaign");var AccountBalanceWallet={},_interopRequireDefault$W=interopRequireDefaultExports;Object.defineProperty(AccountBalanceWallet,"__esModule",{value:!0});var default_1$W=AccountBalanceWallet.default=void 0,_createSvgIcon$W=_interopRequireDefault$W(requireCreateSvgIcon()),_jsxRuntime$W=jsxRuntimeExports;default_1$W=AccountBalanceWallet.default=(0,_createSvgIcon$W.default)((0,_jsxRuntime$W.jsx)("path",{d:"M21 18v1c0 1.1-.9 2-2 2H5c-1.11 0-2-.9-2-2V5c0-1.1.89-2 2-2h14c1.1 0 2 .9 2 2v1h-9c-1.11 0-2 .9-2 2v8c0 1.1.89 2 2 2zm-9-2h10V8H12zm4-2.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5"}),"AccountBalanceWallet");var DeviceHub={},_interopRequireDefault$V=interopRequireDefaultExports;Object.defineProperty(DeviceHub,"__esModule",{value:!0});var default_1$V=DeviceHub.default=void 0,_createSvgIcon$V=_interopRequireDefault$V(requireCreateSvgIcon()),_jsxRuntime$V=jsxRuntimeExports;default_1$V=DeviceHub.default=(0,_createSvgIcon$V.default)((0,_jsxRuntime$V.jsx)("path",{d:"m17 16-4-4V8.82C14.16 8.4 15 7.3 15 6c0-1.66-1.34-3-3-3S9 4.34 9 6c0 1.3.84 2.4 2 2.82V12l-4 4H3v5h5v-3.05l4-4.2 4 4.2V21h5v-5z"}),"DeviceHub");var Public={},_interopRequireDefault$U=interopRequireDefaultExports;Object.defineProperty(Public,"__esModule",{value:!0});var default_1$U=Public.default=void 0,_createSvgIcon$U=_interopRequireDefault$U(requireCreateSvgIcon()),_jsxRuntime$U=jsxRuntimeExports;default_1$U=Public.default=(0,_createSvgIcon$U.default)((0,_jsxRuntime$U.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39"}),"Public");var Money={},_interopRequireDefault$T=interopRequireDefaultExports;Object.defineProperty(Money,"__esModule",{value:!0});var default_1$T=Money.default=void 0,_createSvgIcon$T=_interopRequireDefault$T(requireCreateSvgIcon()),_jsxRuntime$T=jsxRuntimeExports;default_1$T=Money.default=(0,_createSvgIcon$T.default)([(0,_jsxRuntime$T.jsx)("path",{d:"M5 8h2v8H5zm7 0H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1m-1 6h-1v-4h1zm7-6h-3c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1m-1 6h-1v-4h1z"},"0"),(0,_jsxRuntime$T.jsx)("path",{d:"M2 4v16h20V4zm2 14V6h16v12z"},"1")],"Money");var Folder={},_interopRequireDefault$S=interopRequireDefaultExports;Object.defineProperty(Folder,"__esModule",{value:!0});var default_1$S=Folder.default=void 0,_createSvgIcon$S=_interopRequireDefault$S(requireCreateSvgIcon()),_jsxRuntime$S=jsxRuntimeExports;default_1$S=Folder.default=(0,_createSvgIcon$S.default)((0,_jsxRuntime$S.jsx)("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"Folder");var Inventory={},_interopRequireDefault$R=interopRequireDefaultExports;Object.defineProperty(Inventory,"__esModule",{value:!0});var default_1$R=Inventory.default=void 0,_createSvgIcon$R=_interopRequireDefault$R(requireCreateSvgIcon()),_jsxRuntime$R=jsxRuntimeExports;default_1$R=Inventory.default=(0,_createSvgIcon$R.default)((0,_jsxRuntime$R.jsx)("path",{d:"M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2m-5 12H9v-2h6zm5-7H4V4l16-.02z"}),"Inventory");var AssignmentInd={},_interopRequireDefault$Q=interopRequireDefaultExports;Object.defineProperty(AssignmentInd,"__esModule",{value:!0});var default_1$Q=AssignmentInd.default=void 0,_createSvgIcon$Q=_interopRequireDefault$Q(requireCreateSvgIcon()),_jsxRuntime$Q=jsxRuntimeExports;default_1$Q=AssignmentInd.default=(0,_createSvgIcon$Q.default)((0,_jsxRuntime$Q.jsx)("path",{d:"M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m0 4c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3m6 12H6v-1.4c0-2 4-3.1 6-3.1s6 1.1 6 3.1z"}),"AssignmentInd");var Autorenew={},_interopRequireDefault$P=interopRequireDefaultExports;Object.defineProperty(Autorenew,"__esModule",{value:!0});var default_1$P=Autorenew.default=void 0,_createSvgIcon$P=_interopRequireDefault$P(requireCreateSvgIcon()),_jsxRuntime$P=jsxRuntimeExports;default_1$P=Autorenew.default=(0,_createSvgIcon$P.default)((0,_jsxRuntime$P.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6m6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26"}),"Autorenew");var MarkEmailRead={},_interopRequireDefault$O=interopRequireDefaultExports;Object.defineProperty(MarkEmailRead,"__esModule",{value:!0});var default_1$O=MarkEmailRead.default=void 0,_createSvgIcon$O=_interopRequireDefault$O(requireCreateSvgIcon()),_jsxRuntime$O=jsxRuntimeExports;default_1$O=MarkEmailRead.default=(0,_createSvgIcon$O.default)((0,_jsxRuntime$O.jsx)("path",{d:"M12 19c0-3.87 3.13-7 7-7 1.08 0 2.09.25 3 .68V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h8.08c-.05-.33-.08-.66-.08-1M4 6l8 5 8-5v2l-8 5-8-5zm13.34 16-3.54-3.54 1.41-1.41 2.12 2.12 4.24-4.24L23 16.34z"}),"MarkEmailRead");var LocationOn={},_interopRequireDefault$N=interopRequireDefaultExports;Object.defineProperty(LocationOn,"__esModule",{value:!0});var default_1$N=LocationOn.default=void 0,_createSvgIcon$N=_interopRequireDefault$N(requireCreateSvgIcon()),_jsxRuntime$N=jsxRuntimeExports;default_1$N=LocationOn.default=(0,_createSvgIcon$N.default)((0,_jsxRuntime$N.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"LocationOn");var QueryStats={},_interopRequireDefault$M=interopRequireDefaultExports;Object.defineProperty(QueryStats,"__esModule",{value:!0});var default_1$M=QueryStats.default=void 0,_createSvgIcon$M=_interopRequireDefault$M(requireCreateSvgIcon()),_jsxRuntime$M=jsxRuntimeExports;default_1$M=QueryStats.default=(0,_createSvgIcon$M.default)((0,_jsxRuntime$M.jsx)("path",{d:"M19.88 18.47c.44-.7.7-1.51.7-2.39 0-2.49-2.01-4.5-4.5-4.5s-4.5 2.01-4.5 4.5 2.01 4.5 4.49 4.5c.88 0 1.7-.26 2.39-.7L21.58 23 23 21.58zm-3.8.11c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5m-.36-8.5c-.74.02-1.45.18-2.1.45l-.55-.83-3.8 6.18-3.01-3.52-3.63 5.81L1 17l5-8 3 3.5L13 6zm2.59.5c-.64-.28-1.33-.45-2.05-.49L21.38 2 23 3.18z"}),"QueryStats");var PriceCheck={},_interopRequireDefault$L=interopRequireDefaultExports;Object.defineProperty(PriceCheck,"__esModule",{value:!0});var default_1$L=PriceCheck.default=void 0,_createSvgIcon$L=_interopRequireDefault$L(requireCreateSvgIcon()),_jsxRuntime$L=jsxRuntimeExports;default_1$L=PriceCheck.default=(0,_createSvgIcon$L.default)((0,_jsxRuntime$L.jsx)("path",{d:"M12 13V9c0-.55-.45-1-1-1H7V6h5V4H9.5V3h-2v1H6c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h4v2H5v2h2.5v1h2v-1H11c.55 0 1-.45 1-1m7.59-.48-5.66 5.65-2.83-2.83-1.41 1.42L13.93 21 21 13.93z"}),"PriceCheck");var Assessment={},_interopRequireDefault$K=interopRequireDefaultExports;Object.defineProperty(Assessment,"__esModule",{value:!0});var default_1$K=Assessment.default=void 0,_createSvgIcon$K=_interopRequireDefault$K(requireCreateSvgIcon()),_jsxRuntime$K=jsxRuntimeExports;default_1$K=Assessment.default=(0,_createSvgIcon$K.default)((0,_jsxRuntime$K.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M9 17H7v-7h2zm4 0h-2V7h2zm4 0h-2v-4h2z"}),"Assessment");var ManageSearch={},_interopRequireDefault$J=interopRequireDefaultExports;Object.defineProperty(ManageSearch,"__esModule",{value:!0});var default_1$J=ManageSearch.default=void 0,_createSvgIcon$J=_interopRequireDefault$J(requireCreateSvgIcon()),_jsxRuntime$J=jsxRuntimeExports;default_1$J=ManageSearch.default=(0,_createSvgIcon$J.default)((0,_jsxRuntime$J.jsx)("path",{d:"M7 9H2V7h5zm0 3H2v2h5zm13.59 7-3.83-3.83c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L22 17.59zM17 11c0-1.65-1.35-3-3-3s-3 1.35-3 3 1.35 3 3 3 3-1.35 3-3M2 19h10v-2H2z"}),"ManageSearch");var Store={},_interopRequireDefault$I=interopRequireDefaultExports;Object.defineProperty(Store,"__esModule",{value:!0});var default_1$I=Store.default=void 0,_createSvgIcon$I=_interopRequireDefault$I(requireCreateSvgIcon()),_jsxRuntime$I=jsxRuntimeExports;default_1$I=Store.default=(0,_createSvgIcon$I.default)((0,_jsxRuntime$I.jsx)("path",{d:"M20 4H4v2h16zm1 10v-2l-1-5H4l-1 5v2h1v6h10v-6h4v6h2v-6zm-9 4H6v-4h6z"}),"Store");var People={},_interopRequireDefault$H=interopRequireDefaultExports;Object.defineProperty(People,"__esModule",{value:!0});var default_1$H=People.default=void 0,_createSvgIcon$H=_interopRequireDefault$H(requireCreateSvgIcon()),_jsxRuntime$H=jsxRuntimeExports;default_1$H=People.default=(0,_createSvgIcon$H.default)((0,_jsxRuntime$H.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"People");var FactCheck={},_interopRequireDefault$G=interopRequireDefaultExports;Object.defineProperty(FactCheck,"__esModule",{value:!0});var default_1$G=FactCheck.default=void 0,_createSvgIcon$G=_interopRequireDefault$G(requireCreateSvgIcon()),_jsxRuntime$G=jsxRuntimeExports;default_1$G=FactCheck.default=(0,_createSvgIcon$G.default)((0,_jsxRuntime$G.jsx)("path",{fillRule:"evenodd",d:"M20 3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M10 17H5v-2h5zm0-4H5v-2h5zm0-4H5V7h5zm4.82 6L12 12.16l1.41-1.41 1.41 1.42L17.99 9l1.42 1.42z"}),"FactCheck");var ShoppingBag={},_interopRequireDefault$F=interopRequireDefaultExports;Object.defineProperty(ShoppingBag,"__esModule",{value:!0});var default_1$F=ShoppingBag.default=void 0,_createSvgIcon$F=_interopRequireDefault$F(requireCreateSvgIcon()),_jsxRuntime$F=jsxRuntimeExports;default_1$F=ShoppingBag.default=(0,_createSvgIcon$F.default)((0,_jsxRuntime$F.jsx)("path",{d:"M18 6h-2c0-2.21-1.79-4-4-4S8 3.79 8 6H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m-8 4c0 .55-.45 1-1 1s-1-.45-1-1V8h2zm2-6c1.1 0 2 .9 2 2h-4c0-1.1.9-2 2-2m4 6c0 .55-.45 1-1 1s-1-.45-1-1V8h2z"}),"ShoppingBag");var Category={},_interopRequireDefault$E=interopRequireDefaultExports;Object.defineProperty(Category,"__esModule",{value:!0});var default_1$E=Category.default=void 0,_createSvgIcon$E=_interopRequireDefault$E(requireCreateSvgIcon()),_jsxRuntime$E=jsxRuntimeExports;default_1$E=Category.default=(0,_createSvgIcon$E.default)([(0,_jsxRuntime$E.jsx)("path",{d:"m12 2-5.5 9h11z"},"0"),(0,_jsxRuntime$E.jsx)("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),(0,_jsxRuntime$E.jsx)("path",{d:"M3 13.5h8v8H3z"},"2")],"Category");var MedicalServices={},_interopRequireDefault$D=interopRequireDefaultExports;Object.defineProperty(MedicalServices,"__esModule",{value:!0});var default_1$D=MedicalServices.default=void 0,_createSvgIcon$D=_interopRequireDefault$D(requireCreateSvgIcon()),_jsxRuntime$D=jsxRuntimeExports;default_1$D=MedicalServices.default=(0,_createSvgIcon$D.default)((0,_jsxRuntime$D.jsx)("path",{d:"M20 6h-4V4c0-1.1-.9-2-2-2h-4c-1.1 0-2 .9-2 2v2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2M10 4h4v2h-4zm6 11h-3v3h-2v-3H8v-2h3v-3h2v3h3z"}),"MedicalServices");var Notifications={},_interopRequireDefault$C=interopRequireDefaultExports;Object.defineProperty(Notifications,"__esModule",{value:!0});var default_1$C=Notifications.default=void 0,_createSvgIcon$C=_interopRequireDefault$C(requireCreateSvgIcon()),_jsxRuntime$C=jsxRuntimeExports;default_1$C=Notifications.default=(0,_createSvgIcon$C.default)((0,_jsxRuntime$C.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2m6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1z"}),"Notifications");var TableChart={},_interopRequireDefault$B=interopRequireDefaultExports;Object.defineProperty(TableChart,"__esModule",{value:!0});var default_1$B=TableChart.default=void 0,_createSvgIcon$B=_interopRequireDefault$B(requireCreateSvgIcon()),_jsxRuntime$B=jsxRuntimeExports;default_1$B=TableChart.default=(0,_createSvgIcon$B.default)((0,_jsxRuntime$B.jsx)("path",{d:"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2M3 19c0 1.1.9 2 2 2h3V10H3z"}),"TableChart");const getRoleItems=e=>{switch(e){case"AdminX":return[{text:"داشبورد",route:ROUTE_ADMINX_DASHBOARD,icon:jsxRuntimeExports.jsx(default_1$_,{})},{text:"درخواست های کشتار",route:ROUTE_ADMINX_CITY_NEW_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1e,{})},{text:"تخصیص",route:ROUTE_ADMINX_ALLOCATION_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1d,{})},{text:"مدیریت کشتار",route:ROUTE_ADMINX_HATCHING,icon:jsxRuntimeExports.jsx(default_1$Z,{})},{text:"مدیریت جوجه ریزی",route:ROUTE_ADMINXـHATCHINGS,icon:jsxRuntimeExports.jsx(default_1$1h,{})},{text:"اختلاف کشتار",route:ROUTE_ADMINX_DIFFRENCE_KILLER,icon:jsxRuntimeExports.jsx(default_1$Y,{})},{text:"اعلام نیاز خریداران",route:ROUTE_ADMINX_STATEMENTـOFـNEED_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$X,{})},{text:"خرید مستقیم",route:ROUT_ADMINX_FREE_BUY,icon:jsxRuntimeExports.jsx(ShoppingBasket,{})},{text:"پنل معاملات",route:ROUTE_ADMINX_TRADING_PANEL,icon:jsxRuntimeExports.jsx(default_1$W,{})},{text:"فروش به خارج استان",route:ROUTE_ADMINX_FREE_SALES_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$U,{})},{text:"زنجیره ها",route:ROUTE_ADMINX_CHAINS,icon:jsxRuntimeExports.jsx(default_1$V,{})},{text:"تعرفه ها",route:ROUTE_ADMINX_PAYING_FEES_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1f,{})},{text:"پایش کشوری",route:ROUTE_ADMINX_ROUTE_NATIONAL_INFO,icon:jsxRuntimeExports.jsx(TravelExplore,{})},{text:"تعرفه زیربخش ها",route:ROUTE_ADMINX_SUB_SECTORS_WAGE,icon:jsxRuntimeExports.jsx(default_1$T,{})},{text:"تسویه حساب",route:ROUTE_ADMINX_SETTLEMENTS,icon:jsxRuntimeExports.jsx(Payment$3,{})},{text:"پرونده های کشتار",route:ROUTE_ADMINX_ROUTE_FILES_STATE,icon:jsxRuntimeExports.jsx(default_1$S,{})},{text:"مدیریت بازرسی",route:ROUTE_ADMINX_ROUTE_INSPECTION,icon:jsxRuntimeExports.jsx(default_1$1d,{})},{text:"مدیریت بارها",route:ROUTE_ADMINX_ROUTE_ALLOCATIONS,icon:jsxRuntimeExports.jsx(SettingsApplications,{})},{text:"صادرات",route:ROUTE_ADMINX_EXPORT,icon:jsxRuntimeExports.jsx(default_1$14,{})},{text:"مدیریت تخصیصات",route:ROUTE_ADMINX_ALLOCATED_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$Q,{})},{text:"تخصیصات خودکار",route:ROUTE_ADMINX_AUTO_ALLOCATION_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$P,{})},{text:"صدور نامه",route:ROUTE_ADMINX_ISSUANCE_OF_LETTER,icon:jsxRuntimeExports.jsx(default_1$O,{})},{text:"انتخاب استان",route:ROUTE_ADMINX_PROVINCE_SWITCH,icon:jsxRuntimeExports.jsx(default_1$N,{})},{text:"تحلیل داده",route:ROUTE_ADMINX_VISOR_STATICS,icon:jsxRuntimeExports.jsx(default_1$M,{})},{text:"کارشناسان علوم دام",route:ROUTE_ADMINX_POULTRY_LIVESTOCK_EXPERTS,icon:jsxRuntimeExports.jsx(Engineering,{})},{text:"قیمت روز",route:ROUTE_ADMINX_PRICING3,icon:jsxRuntimeExports.jsx(default_1$L,{})},{text:"گزارشات",route:ROUTE_ADMINX_REPORT,icon:jsxRuntimeExports.jsx(default_1$K,{})},{text:"مدیریت توزیع",route:ROUTE_ADMINX_DISPENSERS,icon:jsxRuntimeExports.jsx(default_1$J,{})},{text:"مدیریت اصناف",route:ROUTE_ADMINX_ROUTE_MANAGE_GUILDS,icon:jsxRuntimeExports.jsx(default_1$I,{})},{text:"مدیریت سردخانه ها",icon:jsxRuntimeExports.jsx(default_1$13,{}),route:ROUTE_ADMINX_COLD_HOUSES},{text:"شرکت‌های پرداخت الکترونیک",route:ROUTE_ADMINX_ROUTE_COMPANY_MANAGE_STEWARDS,icon:jsxRuntimeExports.jsx(Storefront$1,{})},{text:"خودروها",route:ROUTE_ADMINX_CARS,icon:jsxRuntimeExports.jsx(DriveEta,{})},{text:"کاربران",route:ROUTE_ADMINX_USERS,icon:jsxRuntimeExports.jsx(default_1$H,{})},{text:"مدیریت فارم ها",route:ROUTE_ADMINX_POULTRIES,icon:jsxRuntimeExports.jsx(default_1$G,{})},{text:"خریداران",route:ROUTE_ADMINX_SLAUGHTERS,icon:jsxRuntimeExports.jsx(default_1$F,{})},{text:"خریدهای بازگشتی",route:ROUTE_ADMINX_RETURN_PURCHASES,icon:jsxRuntimeExports.jsx(AssignmentReturn,{})},{text:"محصولات",route:ROUTE_ADMINX_PRODUCTS,icon:jsxRuntimeExports.jsx(default_1$E,{})},{text:"دامپزشکان",route:ROUTE_ADMINX_ASSIGN_VET_FARM,icon:jsxRuntimeExports.jsx(default_1$D,{})},{text:"پنل اطلاع رسانی",route:ROUTE_ADMINX_ROUTE_SMS,icon:jsxRuntimeExports.jsx(default_1$C,{})},{text:"مدیریت فرآیند",route:ROUTE_ADMINX_ROUTE_MANAGE_PROCESS,icon:jsxRuntimeExports.jsx(default_1$12,{})},{text:"بررسی اکسل",route:ROUTE_ADMINX_EXCEL_CHECK,icon:jsxRuntimeExports.jsx(default_1$B,{})}];case"Admin":return[{text:"تحلیل داده",route:ROUTE_ADMIN_VISOR_STATICS,icon:jsxRuntimeExports.jsx(default_1$M,{})}];case"CityOperator":return[{route:ROUTE_CITY_NEW_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1a,{}),text:"درخواست های کشتار"},{route:ROUTE_CITY_ACTIVE_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$19,{}),text:"درخواست های فعال"},{route:ROUTE_CITY_FREE_SALES_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1b,{}),text:"فروش به خارج استان"},{route:ROUTE_CITY_VISOR_STATICS,icon:jsxRuntimeExports.jsx(default_1$M,{}),text:"تحلیل داده"},{route:ROUTE_CITY_HATCHING,icon:jsxRuntimeExports.jsx(default_1$Z,{}),text:"مدیریت کشتار"},{route:ROUTE_CITYـHATCHINGS,icon:jsxRuntimeExports.jsx(default_1$1h,{}),text:"مدیریت جوجه ریزی"},{text:"اختلاف کشتار",route:ROUTE_CITY_DIFFRENCE_KILLER,icon:jsxRuntimeExports.jsx(default_1$Y,{})},{route:ROUTE_CITY_ROUTE_ALLOCATIONS,icon:jsxRuntimeExports.jsx(SettingsApplications,{}),text:"مدیریت بارها"},{route:ROUTE_CITY_ROUTE_INSPECTION,icon:jsxRuntimeExports.jsx(default_1$1d,{}),text:"مدیریت بازرسی"},{route:ROUTE_CITY_PRICING,icon:jsxRuntimeExports.jsx(default_1$L,{}),text:"قیمت روز"},{route:ROUTE_CITY_POULTRIES,icon:jsxRuntimeExports.jsx(default_1$G,{}),text:"مدیریت فارم ها"},{route:ROUTE_CITY_POULTRY_FARMS,icon:jsxRuntimeExports.jsx(default_1$1i,{}),text:"مرغداران"},{route:ROUTE_CITY_USER_MANAGEMENT,icon:jsxRuntimeExports.jsx(default_1$H,{}),text:"کاربران"}];case"Poultry":return[{route:ROUTE_AVICULTURE_HATCHING,icon:jsxRuntimeExports.jsx(default_1$1h,{}),text:"جوجه ریزی"},{route:ROUTE_AVICULTURE_SUBMIT_REQUEST,icon:jsxRuntimeExports.jsx(default_1$18,{}),text:"درخواست های کشتار"},{route:ROUTE_AVICULTURE_PRICING,icon:jsxRuntimeExports.jsx(default_1$L,{}),text:"قیمت روز"},{route:ROUTE_AVICULTURE_ROUTE_HALLS,icon:jsxRuntimeExports.jsx(default_1$17,{}),text:"سالن ها"}];case"ProvinceOperator":return[{text:"داشبورد",route:ROUTE_PROVINCE_DASHBOARD,icon:jsxRuntimeExports.jsx(default_1$_,{})},{text:"درخواست های کشتار",route:ROUTE_PROVINCE_CITY_NEW_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1e,{})},{text:"تخصیص",route:ROUTE_PROVINCE_ALLOCATION_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1d,{})},{text:"مدیریت کشتار",icon:jsxRuntimeExports.jsx(default_1$Z,{}),route:ROUTE_PROVINCE_HATCHING},{text:"مدیریت جوجه ریزی",icon:jsxRuntimeExports.jsx(default_1$1h,{}),route:ROUTE_PROVINCEـHATCHINGS},{text:"اختلاف کشتار",route:ROUTE_PROVINCE_DIFFRENCE_KILLER,icon:jsxRuntimeExports.jsx(default_1$Y,{})},{text:"اعلام نیاز خریداران",route:ROUTE_PROVINCE_STATEMENTـOFـNEED_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$X,{})},{text:"خرید مستقیم",route:ROUTE_PROVINCEـFREE_BUY,icon:jsxRuntimeExports.jsx(ShoppingBasket,{})},{text:"پنل معاملات",route:ROUTE_PROVINCE_TRADING_PANEL,icon:jsxRuntimeExports.jsx(default_1$W,{})},{text:"فروش به خارج استان",route:ROUTE_PROVINCE_FREE_SALES_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1g,{})},{text:"زنجیره ها",route:ROUTE_PROVINCE_CHAINS,icon:jsxRuntimeExports.jsx(default_1$V,{})},{text:"مدیریت تخصیصات",route:ROUTE_PROVINCE_ALLOCATED_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$Q,{})},{text:"تعرفه ها",route:ROUTE_PROVINCE_PAYING_FEES_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1f,{})},{text:"تعرفه زیربخش ها",route:ROUTE_PROVINCE_SUB_SECTORS_WAGE,icon:jsxRuntimeExports.jsx(default_1$T,{})},{text:"تسویه حساب",route:ROUTE_PROVINCE_SETTLEMENTS,icon:jsxRuntimeExports.jsx(Payment$3,{})},{text:"صادرات",route:ROUTE_PROVINCEـEXPORT,icon:jsxRuntimeExports.jsx(default_1$14,{})},{text:"گزارشات",icon:jsxRuntimeExports.jsx(default_1$K,{}),route:ROUTE_PROVINCE_REPORT},{text:"مدیریت بارها",icon:jsxRuntimeExports.jsx(SettingsApplications,{}),route:ROUTE_PROVINCE_ROUTE_ALLOCATIONS},{text:"تحلیل داده",icon:jsxRuntimeExports.jsx(default_1$M,{}),tooltip:"آمار",route:ROUTE_PROVINCEـVISOR_STATICS},{text:"کارشناسان علوم دام",route:ROUTE_PROVINCE_POULTRY_LIVESTOCK_EXPERTS,icon:jsxRuntimeExports.jsx(Engineering,{})},{text:"مدیریت توزیع",icon:jsxRuntimeExports.jsx(default_1$J,{}),route:ROUTE_PROVINCE_DISPENSERS},{text:"مدیریت سردخانه ها",icon:jsxRuntimeExports.jsx(default_1$13,{}),route:ROUTE_PROVINCE_COLD_HOUSES},{text:"مدیریت اصناف",icon:jsxRuntimeExports.jsx(default_1$I,{}),route:ROUTE_PROVINCE_ROUTE_MANAGE_GUILDS},{text:"خودروها",icon:jsxRuntimeExports.jsx(DriveEta,{}),route:ROUTE_PROVINCE_CARS},{text:"کاربران",icon:jsxRuntimeExports.jsx(default_1$H,{}),route:ROUTE_PROVINCE_USERS},{text:"مدیریت فارم ها",icon:jsxRuntimeExports.jsx(default_1$G,{}),route:ROUTE_PROVINCE_POULTRIES},{text:"خریداران",icon:jsxRuntimeExports.jsx(default_1$F,{}),route:ROUTE_PROVINCE_SLAUGHTERS},{text:"دامپزشکان",icon:jsxRuntimeExports.jsx(default_1$D,{}),route:ROUTE_PROVINCE_ASSIGN_VET_FARM},{text:"پنل اطلاع رسانی",icon:jsxRuntimeExports.jsx(default_1$C,{}),route:ROUTE_PROVINCE_ROUTE_SMS},{text:"خریدهای بازگشتی",route:ROUTE_PROVINCE_RETURN_PURCHASES,icon:jsxRuntimeExports.jsx(AssignmentReturn,{})}];case"ProvinceFinancial":return[{route:ROUTE_PROVINCE_FINANCIAL_PENDING_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$16,{}),text:"صدور فاکتور"},{route:ROUTE_PROVINCE_FINANCIAL_AWAITING_PAYMENT_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1f,{}),text:"در انتظار پرداخت"},{route:ROUTE_PROVINCE_FINANCIAL_CHECK_PAYED_FACTOR_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$15,{}),text:"فاکتورهای پرداخت شده"},{route:ROUTE_PROVINCE_FINANCIAL_FINAL_FACTORS_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$G,{}),text:"اسناد مالی"},{text:"تعرفه زیربخش ها",route:ROUTE_PROVINCE_FINANCIAL_SUB_SECTORS_WAGE,icon:jsxRuntimeExports.jsx(default_1$T,{})},{route:ROUTE_PROVINCE_FINANCIAL_ACTIVE_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1b,{}),text:"درخواست های فعال"},{route:ROUTE_PROVINCE_FINANCIAL_AWAITING_INSPECTION_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$16,{}),text:"در انتظار بازرسی"},{route:ROUTE_PROVINCE_FINANCIAL_ARCHIVED_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1c,{}),text:"بایگانی"},{route:ROUTE_PROVINCE_FINANCIAL_SETTLEMENT,icon:jsxRuntimeExports.jsx(Payment$3,{}),text:"تسویه حساب"},{route:ROUTE_PROVINCE_PRICING,icon:jsxRuntimeExports.jsx(default_1$L,{}),text:"قیمت گذاری"},{route:ROUTE_PROVINCE_FINANCIAL_DOCUMENT_REGISTRATION,icon:jsxRuntimeExports.jsx(default_1$1f,{}),text:"ثبت سند مالی"}];case"KillHouse":return[{text:"ثبت درخواست",route:ROUTE_SLAUGHTER_NEW_REQUESTS,icon:jsxRuntimeExports.jsx(AddCircleOutline,{})},{text:"سفارش های دریافت شده",route:ROUTE_SLAUGHTER_PENDING_REQUESTS,icon:jsxRuntimeExports.jsx(AssignmentTurnedIn$1,{})},{text:"خرید مستقیم",route:ROUTE_SLAUGHTERـFREE_BUY,icon:jsxRuntimeExports.jsx(ShoppingBasket,{})},{text:"پنل معاملات",route:ROUTE_SLAUGHTER_TRADING_PANEL,icon:jsxRuntimeExports.jsx(default_1$W,{})},{text:"تخصیص خودرو",route:ROUTE_SLAUGHTER_ALLOCATE_CAR_REQUESTS,icon:jsxRuntimeExports.jsx(DirectionsCarFilled,{})},{text:"وارد کردن اطلاعات بار",route:ROUTE_SLAUGHTER_ENTER_BAR_INFO,icon:jsxRuntimeExports.jsx(UploadFile,{})},{text:"انبار و توزیع",route:ROUTE_SLAUGHTER_INVENTORY,icon:jsxRuntimeExports.jsx(default_1$1i,{})},{text:"مدیریت تعرفه ها",route:ROUTE_SLAUGHTER_PAYING_FEES_REQUESTS,icon:jsxRuntimeExports.jsx(PriceChange,{})},{text:"مدیریت بارها",route:ROUTE_SLAUGHTER_ROUTE_MANAGE_BARS,icon:jsxRuntimeExports.jsx(default_1$G,{})},{text:"مدیریت اصناف",route:ROUTE_SLAUGHTER_ROUTE_MANAGE_GUILDS,icon:jsxRuntimeExports.jsx(Storefront$1,{})},{text:"خودروها",route:ROUTE_SLAUGHTER_CAR_MANAGEMENT,icon:jsxRuntimeExports.jsx(DriveEta,{})},{text:"صادرات",route:ROUTE_SLAUGHTERـEXPORT,icon:jsxRuntimeExports.jsx(default_1$14,{})},{text:"تخصیص",route:ROUTE_SLAUGHTER_ALLOCATION_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1d,{})},{text:"سردخانه",route:ROUTE_SLAUGHTER_MORGUE,icon:jsxRuntimeExports.jsx(default_1$13,{})},{text:"تسویه حساب",route:ROUTE_SLAUGHTER_SETTLEMENTS,icon:jsxRuntimeExports.jsx(Payment$3,{})},{text:"خریدهای بازگشتی",route:ROUTE_SLAUGHTER_RETURN_PURCHASES,icon:jsxRuntimeExports.jsx(AssignmentReturn,{})}];case"KillHouseVet":return[{route:ROUTE_SLAUGHTER_HOUSE_VET_FREE_BUY_ROUTE,icon:jsxRuntimeExports.jsx(Folder$1,{}),text:"بارهای خارج استان"},{route:ROUTE_SLAUGHTER_HOUSE_VET_NEW_REQUESTS,icon:jsxRuntimeExports.jsx(AddBox,{}),text:"بارهای کشتار"},{route:ROUTE_SLAUGHTER_HOUSE_VET_ENTER_BAR_INFO,icon:jsxRuntimeExports.jsx(UploadFile,{}),text:"وارد کردن اطلاعات بار"}];case"VetFarm":return[{route:ROUTE_VETFARM_ROUTE_ALLOCATIONS,icon:jsxRuntimeExports.jsx(default_1$12,{}),text:"کدرهگیری قرنطینه"},{route:ROUTE_VETFARM_REGISTER_INFO,icon:jsxRuntimeExports.jsx(default_1$11,{}),text:"مدیریت فارم"},{text:"مدیریت بازرسی",route:ROUTE_VETFARM_ROUTE_INSPECTION,icon:jsxRuntimeExports.jsx(default_1$1d,{})}];case"Driver":return[{route:ROUTE_DRIVER_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$12,{}),text:"پنل مدیریت"}];case"VetSupervisor":return[{text:"مدیریت جوجه ریزی",icon:jsxRuntimeExports.jsx(default_1$1h,{}),route:ROUTE_VETـSUPERVISOR_HATCHING},{text:"مدیریت فارم ها",route:void 0,icon:jsxRuntimeExports.jsx(default_1$G,{})},{text:"مدیریت بارها",icon:jsxRuntimeExports.jsx(default_1$G,{}),route:ROUTE_VETـSUPERVISOR_ALLOCATIONS},{text:"گزارشات",icon:jsxRuntimeExports.jsx(default_1$K,{}),route:ROUTE_VETـSUPERVISOR_REPORTING}];case"ProvinceInspector":return[{route:ROUTE_INSPECTOR_REQUESTS_NEW_REQUESTS,icon:jsxRuntimeExports.jsx(Folder$1,{}),text:"درخواست های کشتار"},{route:ROUTE_PROVINCE_INSPECTOR_AWAITING_PAYMENT_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1f,{}),text:"در انتظار پرداخت"},{route:ROUTE_PROVINCE_INSPECTOR_AWAITING_INSPECTION_REQUESTS,icon:jsxRuntimeExports.jsx(FileCopy,{}),text:"در انتظار بازرسی"},{route:ROUTE_INSPECTOR_REJECTED_REQUESTS,icon:jsxRuntimeExports.jsx(Warning,{}),text:"درخواست های رد شده"},{route:ROUTE_INSPECTOR_ARCHIVED_REQUESTS,icon:jsxRuntimeExports.jsx(Archive$1,{}),text:"بایگانی"},{route:ROUTE_PROVINCE_INSPECTOR_REPORTING,icon:jsxRuntimeExports.jsx(default_1$K,{}),text:"گزارشات"}];case"Jahad":return[{route:ROUTE_JAHAD_ILLEGALـKILLING,icon:jsxRuntimeExports.jsx(default_1$10,{}),text:"کشتار غیرمجاز"},{route:ROUTE_JAHAD_PRICING,icon:jsxRuntimeExports.jsx(default_1$L,{}),text:"قیمت روز"}];case"ProvincialGovernment":return[{route:ROUTE_JAHAD_ILLEGALـKILLING,icon:jsxRuntimeExports.jsx(default_1$10,{}),text:"کشتار غیرمجاز"},{route:ROUTE_JAHAD_PRICING,icon:jsxRuntimeExports.jsx(default_1$L,{}),text:"قیمت روز"}];case"Guilds":return[{route:ROUTE_SENF_INVENTORY,icon:jsxRuntimeExports.jsx(default_1$1i,{}),text:"انبار"}];case"Steward":return[{route:ROUTE_STEWARD_INVENTORY,icon:jsxRuntimeExports.jsx(default_1$1i,{}),text:"انبار"}];case"Commerce":return[{route:ROUTE_COMMERCE_ROUTE_MANAGE_GUILDS,icon:jsxRuntimeExports.jsx(Storefront$1,{}),text:"مدیریت اصناف"},{route:ROUTE_COMMERCE_ROUTE_ALLOCATIONS,icon:jsxRuntimeExports.jsx(default_1$G,{}),text:"مدیریت بارها"},{route:ROUTE_COMMERCE_HATCHING,icon:jsxRuntimeExports.jsx(default_1$1h,{}),text:"مدیریت جوجه ریزی"}];case"ProvinceSupervisor":return[{text:"داشبورد",route:ROUTE_PROVINCE_SUPERVISOR_DASHBOARD,icon:jsxRuntimeExports.jsx(default_1$_,{})},{route:ROUTE_PROVINCE_SUPERVISORـHATCHINGS,icon:jsxRuntimeExports.jsx(default_1$1h,{}),text:"مدیریت جوجه ریزی"},{route:ROUTE_PROVINCE_SUPERVISOR_ROUTE_ALLOCATIONS,icon:jsxRuntimeExports.jsx(default_1$G,{}),text:"مدیریت بارها"},{text:"مدیریت بازرسی",route:ROUTE_PROVINCE_SUPERVISOR_ROUTE_INSPECTION,icon:jsxRuntimeExports.jsx(default_1$1d,{})},{route:ROUTE_PROVINCE_SUPERVISOR_ROUTE_MANAGE_GUILDS,icon:jsxRuntimeExports.jsx(Storefront$1,{}),text:"مدیریت اصناف"},{text:"پایش کشوری",route:ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO,icon:jsxRuntimeExports.jsx(TravelExplore,{})},{route:ROUTE_PROVINCE_SUPERVISOR_REPORTING,icon:jsxRuntimeExports.jsx(default_1$K,{}),text:"گزارشات"},{text:"قیمت روز",route:ROUTE_PROVINCE_SUPERVISOR_PRICING,icon:jsxRuntimeExports.jsx(default_1$L,{})},{text:"مدیریت توزیع",route:ROUTE_PROVINCE_SUPERVISOR_DISPENSERS,icon:jsxRuntimeExports.jsx(default_1$J,{})}];case"CityCommerce":return[{route:ROUTE_CITY_COMMERCE_ROUTE_MANAGE_GUILDS,icon:jsxRuntimeExports.jsx(Storefront$1,{}),text:"مدیریت اصناف"},{route:ROUTE_CITY_COMMERCE_ROUTE_ALLOCATIONS,icon:jsxRuntimeExports.jsx(default_1$G,{}),text:"مدیریت بارها"}];case"CityVet":return[{text:"مدیریت جوجه ریزی",icon:jsxRuntimeExports.jsx(default_1$1h,{}),route:ROUTE_CITYVET_HATCHING},{route:ROUTE_CITYVET_ROUTE_ALLOCATIONS,icon:jsxRuntimeExports.jsx(default_1$G,{}),text:"مدیریت بارها"},{route:ROUTE_CITYVET_REGISTER_INFO,icon:jsxRuntimeExports.jsx(default_1$11,{}),text:"مدیریت فارم"}];case"CityJahad":return[{route:ROUTE_CITY_JIHAD_ROUTE_ALLOCATIONS,icon:jsxRuntimeExports.jsx(default_1$G,{}),text:"مدیریت بارها"},{text:"مدیریت بازرسی",route:void 0,icon:jsxRuntimeExports.jsx(default_1$1d,{})},{route:ROUTE_CITY_JIHAD_ROUTE_MANAGE_GUILDS,icon:jsxRuntimeExports.jsx(Storefront$1,{}),text:"مدیریت اصناف"},{route:ROUTE_CITY_JIHADـHATCHINGS,icon:jsxRuntimeExports.jsx(default_1$1h,{}),text:"مدیریت جوجه ریزی"},{text:"مدیریت توزیع",route:ROUTE_CITY_JIHAD_DISPENSERS,icon:jsxRuntimeExports.jsx(default_1$J,{})}];case"Observatory":return[{route:ROUTE_OBSERVATORY_VISOR_STATICS,icon:jsxRuntimeExports.jsx(default_1$M,{}),text:"تحلیل داده"}];case"GuildRoom":return[{route:ROUTE_GUILD_ROOM_ROUTE_MANAGE_GUILDS,icon:jsxRuntimeExports.jsx(Storefront$1,{}),text:"اتاق اصناف"}];case"PosCompany":return[{route:ROUTE_PSP_ROUTE_COMPANY_MANAGE_STEWARDS,icon:jsxRuntimeExports.jsx(Storefront$1,{}),text:"اتاق اصناف"}];case"LiveStockSupport":return[{route:ROUTE_LIVE_STOCK_SUPPORT_MANAGE_BARS,icon:jsxRuntimeExports.jsx(default_1$G,{}),text:"مدیریت بارها"},{route:ROUTE_LIVE_STOCK_FREEZING_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$$,{}),text:"درخواست های انجماد"},{route:ROUTE_LIVE_STOCK_COLD_HOUSE,icon:jsxRuntimeExports.jsx(default_1$13,{}),text:"سردخانه"}];case"SuperAdmin":return[{text:"داشبورد",route:ROUTE_SUPER_ADMIN_DASHBOARD,icon:jsxRuntimeExports.jsx(default_1$_,{})},{text:"درخواست های کشتار",route:ROUTE_SUPER_ADMIN_CITY_NEW_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1e,{})},{text:"تخصیص",route:ROUTE_SUPER_ADMIN_ALLOCATION_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1d,{})},{text:"مدیریت کشتار",icon:jsxRuntimeExports.jsx(default_1$Z,{}),route:ROUTE_SUPER_ADMIN_HATCHING},{text:"مدیریت جوجه ریزی",icon:jsxRuntimeExports.jsx(default_1$1h,{}),route:ROUTE_SUPER_ADMINـHATCHINGS},{text:"اختلاف کشتار",route:ROUTE_SUPER_ADMIN_DIFFRENCE_KILLER,icon:jsxRuntimeExports.jsx(default_1$Y,{})},{text:"اعلام نیاز خریداران",route:ROUTE_SUPER_ADMIN_STATEMENTـOFـNEED_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$X,{})},{text:"خرید مستقیم",route:ROUT_SUPER_ADMIN_FREE_BUY,icon:jsxRuntimeExports.jsx(ShoppingBasket,{})},{text:"پنل معاملات",route:ROUTE_SUPER_ADMIN_TRADING_PANEL,icon:jsxRuntimeExports.jsx(default_1$W,{})},{text:"فروش به خارج استان",route:ROUTE_SUPER_ADMIN_FREE_SALES_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1g,{})},{text:"زنجیره ها",route:ROUTE_SUPER_ADMIN_CHAINS,icon:jsxRuntimeExports.jsx(default_1$V,{})},{text:"تعرفه ها",route:ROUTE_SUPER_ADMIN_PAYING_FEES_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1f,{})},{text:"پایش کشوری",route:ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO,icon:jsxRuntimeExports.jsx(TravelExplore,{})},{text:"تعرفه زیربخش ها",route:ROUTE_SUPER_ADMIN_SUB_SECTORS_WAGE,icon:jsxRuntimeExports.jsx(default_1$T,{})},{text:"تسویه حساب",route:ROUTE_SUPER_ADMIN_SETTLEMENTS,icon:jsxRuntimeExports.jsx(Payment$3,{})},{text:"صادرات",route:ROUTE_SUPER_ADMIN_EXPORT,icon:jsxRuntimeExports.jsx(default_1$14,{})},{text:"مدیریت تخصیصات",route:ROUTE_SUPER_ADMIN_ALLOCATED_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1d,{})},{text:"تخصیصات خودکار",route:ROUTE_SUPER_ADMIN_AUTO_ALLOCATION_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$P,{})},{text:"صدور نامه",route:ROUTE_SUPER_ADMIN_ISSUANCE_OF_LETTER,icon:jsxRuntimeExports.jsx(default_1$O,{})},{text:"تحلیل داده",icon:jsxRuntimeExports.jsx(default_1$M,{}),route:ROUTE_SUPER_ADMIN_VISOR_STATICS},{text:"کارشناسان علوم دام",route:ROUTE_SUPER_ADMIN_POULTRY_LIVESTOCK_EXPERTS,icon:jsxRuntimeExports.jsx(Engineering,{})},{text:"قیمت روز",icon:jsxRuntimeExports.jsx(default_1$L,{}),route:ROUTE_SUPER_ADMIN_PRICING3},{text:"گزارشات",icon:jsxRuntimeExports.jsx(default_1$K,{}),route:ROUTE_SUPER_ADMIN_REPORT},{text:"مدیریت فرآیند",route:ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS,icon:jsxRuntimeExports.jsx(default_1$12,{})},{text:"مدیریت بارها",icon:jsxRuntimeExports.jsx(default_1$G,{}),route:ROUTE_SUPER_ADMIN_ROUTE_ALLOCATIONS},{text:"مدیریت بازرسی",route:ROUTE_SUPER_ADMIN_ROUTE_INSPECTION,icon:jsxRuntimeExports.jsx(default_1$1d,{})},{text:"مدیریت توزیع",icon:jsxRuntimeExports.jsx(default_1$J,{}),route:ROUTE_SUPER_ADMIN_DISPENSERS},{text:"مدیریت اصناف",icon:jsxRuntimeExports.jsx(Storefront$1,{}),route:ROUTE_SUPER_ADMIN_ROUTE_MANAGE_GUILDS},{text:"مدیریت سردخانه ها",icon:jsxRuntimeExports.jsx(default_1$13,{}),route:ROUTE_SUPER_ADMIN_COLD_HOUSES},{route:ROUTE_SUPER_ADMIN_ROUTE_COMPANY_MANAGE_STEWARDS,icon:jsxRuntimeExports.jsx(Storefront$1,{}),text:"شرکت‌های پرداخت الکترونیک"},{text:"خودروها",icon:jsxRuntimeExports.jsx(DriveEta,{}),route:ROUTE_SUPER_ADMIN_CARS},{text:"کاربران",icon:jsxRuntimeExports.jsx(default_1$H,{}),route:ROUTE_SUPER_ADMIN_USERS},{text:"مدیریت فارم ها",icon:jsxRuntimeExports.jsx(default_1$G,{}),route:ROUTE_SUPER_ADMIN_POULTRIES},{text:"خریداران",icon:jsxRuntimeExports.jsx(default_1$F,{}),route:ROUTE_SUPER_ADMIN_SLAUGHTERS},{text:"محصولات",icon:jsxRuntimeExports.jsx(default_1$R,{}),route:ROUTE_SUPER_ADMIN_PRODUCTS},{text:"دامپزشکان",icon:jsxRuntimeExports.jsx(default_1$D,{}),route:ROUTE_SUPER_ADMIN_ASSIGN_VET_FARM},{text:"پنل اطلاع رسانی",icon:jsxRuntimeExports.jsx(default_1$C,{}),route:ROUTE_SUPER_ADMIN_ROUTE_SMS},{text:"خریدهای بازگشتی",route:ROUTE_SUPER_ADMIN_RETURN_PURCHASES,icon:jsxRuntimeExports.jsx(AssignmentReturn,{})}];case"ChainCompany":return[{text:"مرغداران زیرمجموعه",route:ROUTE_CHAIN_COMPANY_POULTRIES,icon:jsxRuntimeExports.jsx(default_1$1i,{})},{text:"مدیریت بارها",route:ROUTE_CHAIN_COMPANY_MANAGE_BARS,icon:jsxRuntimeExports.jsx(default_1$G,{})},{text:"مدیریت تعرفه",route:ROUTE_CHAIN_COMPANY_MANAGE_FEES,icon:jsxRuntimeExports.jsx(default_1$1f,{})}];case"Supporter":return[{text:"مدیریت بارها",route:ROUTE_SUPPORTER_ROUTE_ALLOCATIONS,icon:jsxRuntimeExports.jsx(default_1$G,{})},{text:"مدیریت جوجه ریزی",route:ROUTE_SUPPORTERـHATCHINGS,icon:jsxRuntimeExports.jsx(default_1$1h,{})}];case"CityPoultry":return[{text:"مدیریت کشتار",icon:jsxRuntimeExports.jsx(default_1$Z,{}),route:ROUTE_CITY_POULTRY_HATCHING},{text:"مدیریت جوجه ریزی",icon:jsxRuntimeExports.jsx(default_1$1h,{}),route:ROUTE_CITY_POULTRYـHATCHINGS},{text:"مدیریت بارها",icon:jsxRuntimeExports.jsx(default_1$G,{}),route:ROUTE_CITY_POULTRY_ROUTE_ALLOCATIONS},{text:"مدیریت اصناف",icon:jsxRuntimeExports.jsx(Storefront$1,{}),route:ROUTE_CITY_POULTRY_ROUTE_MANAGE_GUILDS}];case"ParentCompany":return[{text:"تعرفه ها",route:ROUTE_PARENT_COMPANY_PAYING_FEES_REQUESTS,icon:jsxRuntimeExports.jsx(default_1$1f,{})},{text:"مدیریت بارها",route:ROUTE_PARENT_COMPANY_ALLOCATIONS,icon:jsxRuntimeExports.jsx(default_1$G,{})}];case"ColdHouseSteward":return[{text:"سردخانه",route:ROUTE_COLD_HOUSE_STEWARD_MORGUE,icon:jsxRuntimeExports.jsx(default_1$13,{})}];default:return[]}},sortRoles=e=>{if(e){const t=["AdminX","SuperAdmin","ProvinceOperator","LiveStockProvinceJahad","Union","Cooperative","Rancher","KillHouse","KillHouseVet","VetFarm","VetSupervisor","CityVet","ParentCompany","Steward","Guilds","ProvinceSupervisor","Commerce","PoultryScience"];return[...e].sort((a,s)=>{const n=t.indexOf(a),i=t.indexOf(s);return n!==-1&&i!==-1?n-i:n!==-1?-1:i!==-1?1:a.localeCompare(s)})}return[]},useSystemName=()=>{const e=useSelector(t=>t.userSlice.userPath);return e==="https://testbackend.rasadyar.com/"?"تست":e==="https://mabackend.rasadyar.com/"?"استان مرکزی":e==="https://bubackend.rasadyar.com/"?"استان بوشهر":e==="https://habackend.rasadyar.com/"?"استان همدان":e==="https://kubackend.rasadyar.com/"?"استان کردستان":"تست"};var CloudSync={},_interopRequireDefault$A=interopRequireDefaultExports;Object.defineProperty(CloudSync,"__esModule",{value:!0});var default_1$A=CloudSync.default=void 0,_createSvgIcon$A=_interopRequireDefault$A(requireCreateSvgIcon()),_jsxRuntime$A=jsxRuntimeExports;default_1$A=CloudSync.default=(0,_createSvgIcon$A.default)((0,_jsxRuntime$A.jsx)("path",{d:"M21.5 14.98c-.02 0-.03 0-.05.01C21.2 13.3 19.76 12 18 12c-1.4 0-2.6.83-3.16 2.02C13.26 14.1 12 15.4 12 17c0 1.66 1.34 3 3 3l6.5-.02c1.38 0 2.5-1.12 2.5-2.5s-1.12-2.5-2.5-2.5M10 4.26v2.09C7.67 7.18 6 9.39 6 12c0 1.77.78 3.34 2 4.44V14h2v6H4v-2h2.73C5.06 16.54 4 14.4 4 12c0-3.73 2.55-6.85 6-7.74M20 6h-2.73c1.43 1.26 2.41 3.01 2.66 5h-2.02c-.23-1.36-.93-2.55-1.91-3.44V10h-2V4h6z"}),"CloudSync");const tokenVerifiction=createAsyncThunk("GET_USER_RAVANDNO_INFO",async e=>{const{data:t,status:a}=await axios$1.post("token-verification/",{token:e.token});return{data:t,status:a}});function getUserTypeOfActivity(e){const t=["CityOperator","Poultry","ProvinceOperator","KillHouse","KillHouseVet","VetFarm","ProvinceFinancial","ProvinceInspector","VetSupervisor","Commerce","CityCommerce","CityVet","CityJahad","Observatory","ProvinceSupervisor","Guilds","GuildRoom","LiveStockSupport","SuperAdmin","ChainCompany","AdminX","Supporter","Dispenser","CityPoultry","ParentCompany","ColdHouseSteward","PosCompany"],a=["LiveStockProvinceJahad","Union","Cooperative","Rancher"],s=e==null?void 0:e.some(i=>t==null?void 0:t.includes(i)),n=e==null?void 0:e.some(i=>a==null?void 0:a.includes(i));return s&&n?"Both":s?"Poultry":n?"LiveStock":""}function getLiveStockRoles(e){const t=["LiveStockProvinceJahad","Union","Cooperative","Rancher"];return e.filter(a=>t.includes(a))}function getBarSquareRoles(e){const t=["BarSquareProvinceJahad"];return e.filter(a=>t.includes(a))}function getPoultryRoles(e){const t=["CityOperator","Poultry","ProvinceOperator","KillHouse","KillHouseVet","VetFarm","ProvinceFinancial","ProvinceInspector","VetSupervisor","Commerce","CityCommerce","CityVet","CityJahad","Observatory","ProvinceSupervisor","Guilds","GuildRoom","LiveStockSupport","SuperAdmin","ChainCompany","AdminX","Supporter","Dispenser","CityPoultry","ParentCompany","ColdHouseSteward","PosCompany","Steward"];return e.filter(a=>t.includes(a))}var CorporateFare={},_interopRequireDefault$z=interopRequireDefaultExports;Object.defineProperty(CorporateFare,"__esModule",{value:!0});var default_1$z=CorporateFare.default=void 0,_createSvgIcon$z=_interopRequireDefault$z(requireCreateSvgIcon()),_jsxRuntime$z=jsxRuntimeExports;default_1$z=CorporateFare.default=(0,_createSvgIcon$z.default)((0,_jsxRuntime$z.jsx)("path",{d:"M12 7V3H2v18h20V7zm-2 12H4v-2h6zm0-4H4v-2h6zm0-4H4V9h6zm0-4H4V5h6zm10 12h-8V9h8zm-2-8h-4v2h4zm0 4h-4v2h4z"}),"CorporateFare");var Apartment={},_interopRequireDefault$y=interopRequireDefaultExports;Object.defineProperty(Apartment,"__esModule",{value:!0});var default_1$y=Apartment.default=void 0,_createSvgIcon$y=_interopRequireDefault$y(requireCreateSvgIcon()),_jsxRuntime$y=jsxRuntimeExports;default_1$y=Apartment.default=(0,_createSvgIcon$y.default)((0,_jsxRuntime$y.jsx)("path",{d:"M17 11V3H7v4H3v14h8v-4h2v4h8V11zM7 19H5v-2h2zm0-4H5v-2h2zm0-4H5V9h2zm4 4H9v-2h2zm0-4H9V9h2zm0-4H9V5h2zm4 8h-2v-2h2zm0-4h-2V9h2zm0-4h-2V5h2zm4 12h-2v-2h2zm0-4h-2v-2h2z"}),"Apartment");var ListAlt={},_interopRequireDefault$x=interopRequireDefaultExports;Object.defineProperty(ListAlt,"__esModule",{value:!0});var default_1$x=ListAlt.default=void 0,_createSvgIcon$x=_interopRequireDefault$x(requireCreateSvgIcon()),_jsxRuntime$x=jsxRuntimeExports;default_1$x=ListAlt.default=(0,_createSvgIcon$x.default)((0,_jsxRuntime$x.jsx)("path",{d:"M19 5v14H5V5zm1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z"}),"ListAlt");var Face5={},_interopRequireDefault$w=interopRequireDefaultExports;Object.defineProperty(Face5,"__esModule",{value:!0});var default_1$w=Face5.default=void 0,_createSvgIcon$w=_interopRequireDefault$w(requireCreateSvgIcon()),_jsxRuntime$w=jsxRuntimeExports;default_1$w=Face5.default=(0,_createSvgIcon$w.default)([(0,_jsxRuntime$w.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8 0-1.12.23-2.18.65-3.15.09.09.21.15.35.15.28 0 .5-.22.5-.5 0-.25-.19-.45-.43-.49.15-.26.32-.51.49-.75-.03.08-.06.15-.06.24 0 .28.22.5.5.5s.5-.22.5-.5S6.28 7 6 7c-.13 0-.25.05-.34.13.52-.68 1.15-1.28 1.86-1.76-.01.04-.02.08-.02.13 0 .28.22.5.5.5s.5-.22.5-.5c0-.24-.17-.43-.4-.48.16-.09.32-.17.49-.25.09.14.24.23.41.23.28 0 .5-.22.5-.5 0-.03-.01-.06-.02-.09.39-.13.79-.23 1.21-.3-.11.1-.19.23-.19.39 0 .28.22.5.5.5s.5-.22.5-.5c0-.21-.13-.38-.3-.46.26-.03.53-.04.8-.04s.54.01.8.04c-.18.08-.3.25-.3.46 0 .28.22.5.5.5s.5-.22.5-.5c0-.16-.08-.29-.19-.38.41.07.82.17 1.21.3-.01.02-.02.05-.02.08 0 .28.22.5.5.5.17 0 .32-.09.41-.23.17.08.33.16.49.25-.23.05-.4.24-.4.48 0 .28.22.5.5.5s.5-.22.5-.5c0-.05-.01-.09-.03-.13.71.48 1.34 1.08 1.86 1.76-.08-.08-.2-.13-.33-.13-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5c0-.09-.03-.16-.07-.23.18.24.34.49.49.75-.23.03-.42.23-.42.48 0 .28.22.5.5.5.14 0 .26-.06.35-.15.42.97.65 2.03.65 3.15 0 4.41-3.59 8-8 8"},"0"),(0,_jsxRuntime$w.jsx)("circle",{cx:"9",cy:"13",r:"1.25"},"1"),(0,_jsxRuntime$w.jsx)("circle",{cx:"12",cy:"5.5",r:".5"},"2"),(0,_jsxRuntime$w.jsx)("circle",{cx:"14",cy:"5.5",r:".5"},"3"),(0,_jsxRuntime$w.jsx)("circle",{cx:"10",cy:"5.5",r:".5"},"4"),(0,_jsxRuntime$w.jsx)("circle",{cx:"17",cy:"6.5",r:".5"},"5"),(0,_jsxRuntime$w.jsx)("circle",{cx:"9",cy:"6.5",r:".5"},"6"),(0,_jsxRuntime$w.jsx)("circle",{cx:"7",cy:"6.5",r:".5"},"7"),(0,_jsxRuntime$w.jsx)("circle",{cx:"11",cy:"6.5",r:".5"},"8"),(0,_jsxRuntime$w.jsx)("circle",{cx:"13",cy:"6.5",r:".5"},"9"),(0,_jsxRuntime$w.jsx)("circle",{cx:"15",cy:"6.5",r:".5"},"10"),(0,_jsxRuntime$w.jsx)("circle",{cx:"12",cy:"7.5",r:".5"},"11"),(0,_jsxRuntime$w.jsx)("circle",{cx:"14",cy:"7.5",r:".5"},"12"),(0,_jsxRuntime$w.jsx)("circle",{cx:"16",cy:"7.5",r:".5"},"13"),(0,_jsxRuntime$w.jsx)("circle",{cx:"10",cy:"7.5",r:".5"},"14"),(0,_jsxRuntime$w.jsx)("circle",{cx:"8",cy:"7.5",r:".5"},"15"),(0,_jsxRuntime$w.jsx)("circle",{cx:"9",cy:"8.5",r:".5"},"16"),(0,_jsxRuntime$w.jsx)("circle",{cx:"7",cy:"8.5",r:".5"},"17"),(0,_jsxRuntime$w.jsx)("circle",{cx:"11",cy:"8.5",r:".5"},"18"),(0,_jsxRuntime$w.jsx)("circle",{cx:"13",cy:"8.5",r:".5"},"19"),(0,_jsxRuntime$w.jsx)("circle",{cx:"15",cy:"8.5",r:".5"},"20"),(0,_jsxRuntime$w.jsx)("circle",{cx:"17",cy:"8.5",r:".5"},"21"),(0,_jsxRuntime$w.jsx)("circle",{cx:"15",cy:"13",r:"1.25"},"22")],"Face5");var BlurOn={},_interopRequireDefault$v=interopRequireDefaultExports;Object.defineProperty(BlurOn,"__esModule",{value:!0});var default_1$v=BlurOn.default=void 0,_createSvgIcon$v=_interopRequireDefault$v(requireCreateSvgIcon()),_jsxRuntime$v=jsxRuntimeExports;default_1$v=BlurOn.default=(0,_createSvgIcon$v.default)((0,_jsxRuntime$v.jsx)("path",{d:"M6 13c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m0 4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m0-8c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m-3 .5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5M6 5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m15 5.5c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5M14 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1m0-3.5c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5m-11 10c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5m7 7c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5m0-17c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5M10 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1m0 5.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m8 .5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m0 4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m0-8c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m0-4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m3 8.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5M14 17c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m0 3.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5m-4-12c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m0 8.5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m4-4.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m0-4c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5"}),"BlurOn");var CompareArrows={},_interopRequireDefault$u=interopRequireDefaultExports;Object.defineProperty(CompareArrows,"__esModule",{value:!0});var default_1$u=CompareArrows.default=void 0,_createSvgIcon$u=_interopRequireDefault$u(requireCreateSvgIcon()),_jsxRuntime$u=jsxRuntimeExports;default_1$u=CompareArrows.default=(0,_createSvgIcon$u.default)((0,_jsxRuntime$u.jsx)("path",{d:"M9.01 14H2v2h7.01v3L13 15l-3.99-4zm5.98-1v-3H22V8h-7.01V5L11 9z"}),"CompareArrows");const getLiveStockItems=e=>{switch(e){case"LiveStockProvinceJahad":return[{text:"اتحادیه ها",icon:jsxRuntimeExports.jsx(default_1$z,{}),route:ROUTE_PROVINCE_JAHAD_UNIONS},{text:"تعاونی ها",icon:jsxRuntimeExports.jsx(default_1$y,{}),route:ROUTE_PROVINCE_JAHAD_COOPERATIVES},{text:"دامداران",icon:jsxRuntimeExports.jsx(default_1$w,{}),route:ROUTE_PROVINCE_JAHAD_RANCHERS},{text:"گله ها",icon:jsxRuntimeExports.jsx(default_1$x,{}),route:ROUTE_PROVINCE_JAHAD_HERDS},{text:"محصولات",icon:jsxRuntimeExports.jsx(default_1$v,{}),route:ROUTE_PROVINCE_JAHAD_PRODUCT_DISTRIBUTION},{text:"تراکنش ها",icon:jsxRuntimeExports.jsx(default_1$u,{}),route:ROUTE_PROVINCE_JAHAD_PRODUCT_TRANSACTIONS},{text:"کاربران",icon:jsxRuntimeExports.jsx(default_1$H,{}),route:ROUTE_PROVINCE_JAHAD_USERS}];case"Union":return[{text:"تعاونی ها",icon:jsxRuntimeExports.jsx(default_1$y,{}),route:ROUTE_UNION_COOPERATIVES},{text:"دامداران",icon:jsxRuntimeExports.jsx(default_1$w,{}),route:ROUTE_UNION_RANCHERS},{text:"گله ها",icon:jsxRuntimeExports.jsx(default_1$x,{}),route:ROUTE_UNION_HERDS},{text:"محصولات",icon:jsxRuntimeExports.jsx(default_1$v,{}),route:ROUTE_UNION_PRODUCT_DISTRIBUTION},{text:"تراکنش ها",icon:jsxRuntimeExports.jsx(default_1$u,{}),route:ROUTE_UNION_PRODUCT_TRANSACTIONS},{text:"کاربران",icon:jsxRuntimeExports.jsx(default_1$H,{}),route:ROUTE_UNION_USERS,disabled:!0}];case"Cooperative":return[{text:"دامداران",icon:jsxRuntimeExports.jsx(default_1$w,{}),route:ROUTE_COOPERATIVE_RANCHERS,disabled:!0,disabledText:"شما مجوز دسترسی به این بخش را ندارید!"},{text:"گله ها",icon:jsxRuntimeExports.jsx(default_1$x,{}),route:ROUTE_COOPERATIVE_HERDS,disabled:!0,disabledText:"شما مجوز دسترسی به این بخش را ندارید!"},{text:"محصولات",icon:jsxRuntimeExports.jsx(default_1$v,{}),route:ROUTE_COOPERATIVE_PRODUCT_DISTRIBUTION},{text:"تراکنش ها",icon:jsxRuntimeExports.jsx(default_1$u,{}),route:ROUTE_COOPERATIVE_PRODUCT_TRANSACTIONS},{text:"کاربران",icon:jsxRuntimeExports.jsx(default_1$H,{}),route:ROUTE_COOPERATIVE_USERS,disabled:!0}];default:return[]}};var Widgets={},_interopRequireDefault$t=interopRequireDefaultExports;Object.defineProperty(Widgets,"__esModule",{value:!0});var default_1$t=Widgets.default=void 0,_createSvgIcon$t=_interopRequireDefault$t(requireCreateSvgIcon()),_jsxRuntime$t=jsxRuntimeExports;default_1$t=Widgets.default=(0,_createSvgIcon$t.default)((0,_jsxRuntime$t.jsx)("path",{d:"M13 13v8h8v-8zM3 21h8v-8H3zM3 3v8h8V3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66z"}),"Widgets");const useUserProfile=()=>{const e=useDispatch(),{role:t,userProfile:a}=useSelector(s=>s.userSlice);return reactExports.useEffect(()=>{a||e(getUserProfile())},[]),[t,a]};function getFaUserRole(e){switch(e){case"Admin":return"ادمین استان";case"CityOperator":return"تعاونی";case"Poultry":return"مرغدار";case"ProvinceOperator":return"مدیر اجرایی";case"ProvinceFinancial":return"مالی اتحادیه";case"KillHouse":return"کشتارگاه";case"KillHouseVet":return"دامپزشک کشتارگاه";case"VetFarm":return"دامپزشک فارم";case"Driver":return"راننده";case"ProvinceInspector":return"بازرس اتحادیه ";case"VetSupervisor":return"دامپزشک کل";case"Jahad":return"جهاد کشاورزی استان";case"CityJahad":return"جهاد کشاورزی شهرستان";case"ProvincialGovernment":return"استانداری";case"Guilds":return"صنف";case"Steward":return"مباشر";case"Commerce":return"معاونت بازرگانی استان";case"CityCommerce":return"بازرگانی شهرستان";case"UnitWindow":return"پنجره واحد";case"CityVet":return"دامپزشک شهرستان";case"Observatory":return"رصدخانه";case"ProvinceSupervisor":return"ناظر استان";case"GuildRoom":return"اتاق اصناف";case"PosCompany":return"شرکت psp";case"LiveStockSupport":return"پشتیبانی امور دام";case"SuperAdmin":return"ادمین کل";case"ChainCompany":return"شرکت زنجیره";case"AdminX":return"ادمین ایکس";case"Supporter":return"پشتیبان سامانه";case"Dispenser":return"پخش کننده";case"CityPoultry":return"طیور شهرستان";case"ParentCompany":return"شرکت مادر";case"ColdHouseSteward":return"مباشر سردخانه";case"CityGuild":return"اتحادیه پروتئینی";case"LiveStockProvinceJahad":return"جهاد استان";case"Union":return"اتحادیه دامداران";case"Cooperative":return"تعاونی دامداران";case"Rancher":return"دامدار";case"BarSquareProvinceJahad":return"جهاد میدان بار";case"PoultryScience":return"کارشناس علوم دامی";default:return""}}var ReduceCapacity={},_interopRequireDefault$s=interopRequireDefaultExports;Object.defineProperty(ReduceCapacity,"__esModule",{value:!0});var default_1$s=ReduceCapacity.default=void 0,_createSvgIcon$s=_interopRequireDefault$s(requireCreateSvgIcon()),_jsxRuntime$s=jsxRuntimeExports;default_1$s=ReduceCapacity.default=(0,_createSvgIcon$s.default)((0,_jsxRuntime$s.jsx)("path",{d:"M16 4c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2m4.78 3.58C19.93 7.21 18.99 7 18 7c-.67 0-1.31.1-1.92.28.58.55.92 1.32.92 2.15V10h5v-.57c0-.81-.48-1.53-1.22-1.85M6 6c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m1.92 1.28C7.31 7.1 6.67 7 6 7c-.99 0-1.93.21-2.78.58C2.48 7.9 2 8.62 2 9.43V10h5v-.57c0-.83.34-1.6.92-2.15M10 4c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2m6 6H8v-.57c0-.81.48-1.53 1.22-1.85C10.07 7.21 11.01 7 12 7c.99 0 1.93.21 2.78.58.74.32 1.22 1.04 1.22 1.85zm-1 6c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2m6 6h-8v-.57c0-.81.48-1.53 1.22-1.85.85-.37 1.79-.58 2.78-.58.99 0 1.93.21 2.78.58.74.32 1.22 1.04 1.22 1.85zM5 16c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2m6 6H3v-.57c0-.81.48-1.53 1.22-1.85C5.07 19.21 6.01 19 7 19c.99 0 1.93.21 2.78.58.74.32 1.22 1.04 1.22 1.85zm1.75-9v-2h-1.5v2H9l3 3 3-3z"}),"ReduceCapacity");var Factory={},_interopRequireDefault$r=interopRequireDefaultExports;Object.defineProperty(Factory,"__esModule",{value:!0});var default_1$r=Factory.default=void 0,_createSvgIcon$r=_interopRequireDefault$r(requireCreateSvgIcon()),_jsxRuntime$r=jsxRuntimeExports;default_1$r=Factory.default=(0,_createSvgIcon$r.default)((0,_jsxRuntime$r.jsx)("path",{d:"M22 10v12H2V10l7-3v2l5-2v3zm-4.8-1.5L18 2h3l.8 6.5zM11 18h2v-4h-2zm-4 0h2v-4H7zm10-4h-2v4h2z"}),"Factory");var HdrStrong={},_interopRequireDefault$q=interopRequireDefaultExports;Object.defineProperty(HdrStrong,"__esModule",{value:!0});var default_1$q=HdrStrong.default=void 0,_createSvgIcon$q=_interopRequireDefault$q(requireCreateSvgIcon()),_jsxRuntime$q=jsxRuntimeExports;default_1$q=HdrStrong.default=(0,_createSvgIcon$q.default)((0,_jsxRuntime$q.jsx)("path",{d:"M17 6c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6M5 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"HdrStrong");var RemoveRedEye={},_interopRequireDefault$p=interopRequireDefaultExports;Object.defineProperty(RemoveRedEye,"__esModule",{value:!0});var default_1$p=RemoveRedEye.default=void 0,_createSvgIcon$p=_interopRequireDefault$p(requireCreateSvgIcon()),_jsxRuntime$p=jsxRuntimeExports;default_1$p=RemoveRedEye.default=(0,_createSvgIcon$p.default)((0,_jsxRuntime$p.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"RemoveRedEye");var Support$1={},_interopRequireDefault$o=interopRequireDefaultExports;Object.defineProperty(Support$1,"__esModule",{value:!0});var default_1$o=Support$1.default=void 0,_createSvgIcon$o=_interopRequireDefault$o(requireCreateSvgIcon()),_jsxRuntime$o=jsxRuntimeExports;default_1$o=Support$1.default=(0,_createSvgIcon$o.default)((0,_jsxRuntime$o.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m7.46 7.12-2.78 1.15c-.51-1.36-1.58-2.44-2.95-2.94l1.15-2.78c2.1.8 3.77 2.47 4.58 4.57M12 15c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3M9.13 4.54l1.17 2.78c-1.38.5-2.47 1.59-2.98 2.97L4.54 9.13c.81-2.11 2.48-3.78 4.59-4.59M4.54 14.87l2.78-1.15c.51 1.38 1.59 2.46 2.97 2.96l-1.17 2.78c-2.1-.81-3.77-2.48-4.58-4.59m10.34 4.59-1.15-2.78c1.37-.51 2.45-1.59 2.95-2.97l2.78 1.17c-.81 2.1-2.48 3.77-4.58 4.58"}),"Support");var Window={},_interopRequireDefault$n=interopRequireDefaultExports;Object.defineProperty(Window,"__esModule",{value:!0});var default_1$n=Window.default=void 0,_createSvgIcon$n=_interopRequireDefault$n(requireCreateSvgIcon()),_jsxRuntime$n=jsxRuntimeExports;default_1$n=Window.default=(0,_createSvgIcon$n.default)((0,_jsxRuntime$n.jsx)("path",{d:"M11 11V3H5c-1.1 0-2 .9-2 2v6zm2 0h8V5c0-1.1-.9-2-2-2h-6zm-2 2H3v6c0 1.1.9 2 2 2h6zm2 0v8h6c1.1 0 2-.9 2-2v-6z"}),"Window");var Payment$2={},_interopRequireDefault$m=interopRequireDefaultExports;Object.defineProperty(Payment$2,"__esModule",{value:!0});var default_1$m=Payment$2.default=void 0,_createSvgIcon$m=_interopRequireDefault$m(requireCreateSvgIcon()),_jsxRuntime$m=jsxRuntimeExports;default_1$m=Payment$2.default=(0,_createSvgIcon$m.default)((0,_jsxRuntime$m.jsx)("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m0 14H4v-6h16zm0-10H4V6h16z"}),"Payment");var Animation={},_interopRequireDefault$l=interopRequireDefaultExports;Object.defineProperty(Animation,"__esModule",{value:!0});var default_1$l=Animation.default=void 0,_createSvgIcon$l=_interopRequireDefault$l(requireCreateSvgIcon()),_jsxRuntime$l=jsxRuntimeExports;default_1$l=Animation.default=(0,_createSvgIcon$l.default)((0,_jsxRuntime$l.jsx)("path",{d:"M15 2c-2.71 0-5.05 1.54-6.22 3.78-1.28.67-2.34 1.72-3 3C3.54 9.95 2 12.29 2 15c0 3.87 3.13 7 7 7 2.71 0 5.05-1.54 6.22-3.78 1.28-.67 2.34-1.72 3-3C20.46 14.05 22 11.71 22 9c0-3.87-3.13-7-7-7M9 20c-2.76 0-5-2.24-5-5 0-1.12.37-2.16 1-3 0 3.87 3.13 7 7 7-.84.63-1.88 1-3 1m3-3c-2.76 0-5-2.24-5-5 0-1.12.37-2.16 1-3 0 3.86 3.13 6.99 7 7-.84.63-1.88 1-3 1m4.7-3.3c-.53.19-1.1.3-1.7.3-2.76 0-5-2.24-5-5 0-.6.11-1.17.3-1.7.53-.19 1.1-.3 1.7-.3 2.76 0 5 2.24 5 5 0 .6-.11 1.17-.3 1.7M19 12c0-3.86-3.13-6.99-7-7 .84-.63 1.87-1 3-1 2.76 0 5 2.24 5 5 0 1.12-.37 2.16-1 3"}),"Animation");var CoPresent={},_interopRequireDefault$k=interopRequireDefaultExports;Object.defineProperty(CoPresent,"__esModule",{value:!0});var default_1$k=CoPresent.default=void 0,_createSvgIcon$k=_interopRequireDefault$k(requireCreateSvgIcon()),_jsxRuntime$k=jsxRuntimeExports;default_1$k=CoPresent.default=(0,_createSvgIcon$k.default)([(0,_jsxRuntime$k.jsx)("path",{d:"M21 3H3c-1.1 0-2 .9-2 2v8h2V5h18v16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),(0,_jsxRuntime$k.jsx)("circle",{cx:"9",cy:"10",r:"4"},"1"),(0,_jsxRuntime$k.jsx)("path",{d:"M15.39 16.56C13.71 15.7 11.53 15 9 15s-4.71.7-6.39 1.56C1.61 17.07 1 18.1 1 19.22V22h16v-2.78c0-1.12-.61-2.15-1.61-2.66"},"2")],"CoPresent");var Diversity3={},_interopRequireDefault$j=interopRequireDefaultExports;Object.defineProperty(Diversity3,"__esModule",{value:!0});var default_1$j=Diversity3.default=void 0,_createSvgIcon$j=_interopRequireDefault$j(requireCreateSvgIcon()),_jsxRuntime$j=jsxRuntimeExports;default_1$j=Diversity3.default=(0,_createSvgIcon$j.default)([(0,_jsxRuntime$j.jsx)("path",{d:"M6.32 13.01c.96.02 1.85.5 2.45 1.34C9.5 15.38 10.71 16 12 16s2.5-.62 3.23-1.66c.6-.84 1.49-1.32 2.45-1.34-.72-1.22-3.6-2-5.68-2-2.07 0-4.96.78-5.68 2.01M4 13c1.66 0 3-1.34 3-3S5.66 7 4 7s-3 1.34-3 3 1.34 3 3 3m16 0c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3m-8-3c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3"},"0"),(0,_jsxRuntime$j.jsx)("path",{d:"M21 14h-3.27c-.77 0-1.35.45-1.68.92-.04.06-1.36 2.08-4.05 2.08-1.43 0-3.03-.64-4.05-2.08-.39-.55-1-.92-1.68-.92H3c-1.1 0-2 .9-2 2v4h7v-2.26c1.15.8 2.54 1.26 4 1.26s2.85-.46 4-1.26V20h7v-4c0-1.1-.9-2-2-2"},"1")],"Diversity3");var BrightnessLow={},_interopRequireDefault$i=interopRequireDefaultExports;Object.defineProperty(BrightnessLow,"__esModule",{value:!0});var default_1$i=BrightnessLow.default=void 0,_createSvgIcon$i=_interopRequireDefault$i(requireCreateSvgIcon()),_jsxRuntime$i=jsxRuntimeExports;default_1$i=BrightnessLow.default=(0,_createSvgIcon$i.default)((0,_jsxRuntime$i.jsx)("path",{d:"M20 15.31 23.31 12 20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6"}),"BrightnessLow");var MedicalInformation={},_interopRequireDefault$h=interopRequireDefaultExports;Object.defineProperty(MedicalInformation,"__esModule",{value:!0});var default_1$h=MedicalInformation.default=void 0,_createSvgIcon$h=_interopRequireDefault$h(requireCreateSvgIcon()),_jsxRuntime$h=jsxRuntimeExports;default_1$h=MedicalInformation.default=(0,_createSvgIcon$h.default)((0,_jsxRuntime$h.jsx)("path",{d:"M20 7h-5V4c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v3H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2m-9-3h2v5h-2zm0 12H9v2H7v-2H5v-2h2v-2h2v2h2zm2-1.5V13h6v1.5zm0 3V16h4v1.5z"}),"MedicalInformation");var MonetizationOn={},_interopRequireDefault$g=interopRequireDefaultExports;Object.defineProperty(MonetizationOn,"__esModule",{value:!0});var default_1$g=MonetizationOn.default=void 0,_createSvgIcon$g=_interopRequireDefault$g(requireCreateSvgIcon()),_jsxRuntime$g=jsxRuntimeExports;default_1$g=MonetizationOn.default=(0,_createSvgIcon$g.default)((0,_jsxRuntime$g.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1.41 16.09V20h-2.67v-1.93c-1.71-.36-3.16-1.46-3.27-3.4h1.96c.1 1.05.82 1.87 2.65 1.87 1.96 0 2.4-.98 2.4-1.59 0-.83-.44-1.61-2.67-2.14-2.48-.6-4.18-1.62-4.18-3.67 0-1.72 1.39-2.84 3.11-3.21V4h2.67v1.95c1.86.45 2.79 1.86 2.85 3.39H14.3c-.05-1.11-.64-1.87-2.22-1.87-1.5 0-2.4.68-2.4 1.64 0 .84.65 1.39 2.67 1.91s4.18 1.39 4.18 3.91c-.01 1.83-1.38 2.83-3.12 3.16"}),"MonetizationOn");var Policy={},_interopRequireDefault$f=interopRequireDefaultExports;Object.defineProperty(Policy,"__esModule",{value:!0});var default_1$f=Policy.default=void 0,_createSvgIcon$f=_interopRequireDefault$f(requireCreateSvgIcon()),_jsxRuntime$f=jsxRuntimeExports;default_1$f=Policy.default=(0,_createSvgIcon$f.default)([(0,_jsxRuntime$f.jsx)("path",{d:"m21 5-9-4-9 4v6c0 5.55 3.84 10.74 9 12 2.3-.56 4.33-1.9 5.88-3.71l-3.12-3.12c-1.94 1.29-4.58 1.07-6.29-.64-1.95-1.95-1.95-5.12 0-7.07 1.95-1.95 5.12-1.95 7.07 0 1.71 1.71 1.92 4.35.64 6.29l2.9 2.9C20.29 15.69 21 13.38 21 11z"},"0"),(0,_jsxRuntime$f.jsx)("circle",{cx:"12",cy:"12",r:"3"},"1")],"Policy");var LocalTaxi={},_interopRequireDefault$e=interopRequireDefaultExports;Object.defineProperty(LocalTaxi,"__esModule",{value:!0});var default_1$e=LocalTaxi.default=void 0,_createSvgIcon$e=_interopRequireDefault$e(requireCreateSvgIcon()),_jsxRuntime$e=jsxRuntimeExports;default_1$e=LocalTaxi.default=(0,_createSvgIcon$e.default)((0,_jsxRuntime$e.jsx)("path",{d:"M18.92 6.01C18.72 5.42 18.16 5 17.5 5H15V3H9v2H6.5c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8zM6.5 16c-.83 0-1.5-.67-1.5-1.5S5.67 13 6.5 13s1.5.67 1.5 1.5S7.33 16 6.5 16m11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M5 11l1.5-4.5h11L19 11z"}),"LocalTaxi");var AdminPanelSettings={},_interopRequireDefault$d=interopRequireDefaultExports;Object.defineProperty(AdminPanelSettings,"__esModule",{value:!0});var default_1$d=AdminPanelSettings.default=void 0,_createSvgIcon$d=_interopRequireDefault$d(requireCreateSvgIcon()),_jsxRuntime$d=jsxRuntimeExports;default_1$d=AdminPanelSettings.default=(0,_createSvgIcon$d.default)([(0,_jsxRuntime$d.jsx)("path",{d:"M17 11c.34 0 .67.04 1 .09V6.27L10.5 3 3 6.27v4.91c0 4.54 3.2 8.79 7.5 9.82.55-.13 1.08-.32 1.6-.55-.69-.98-1.1-2.17-1.1-3.45 0-3.31 2.69-6 6-6"},"0"),(0,_jsxRuntime$d.jsx)("path",{d:"M17 13c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 1.38c.62 0 1.12.51 1.12 1.12s-.51 1.12-1.12 1.12-1.12-.51-1.12-1.12.5-1.12 1.12-1.12m0 5.37c-.93 0-1.74-.46-2.24-1.17.05-.72 1.51-1.08 2.24-1.08s2.19.36 2.24 1.08c-.5.71-1.31 1.17-2.24 1.17"},"1")],"AdminPanelSettings");var Agriculture={},_interopRequireDefault$c=interopRequireDefaultExports;Object.defineProperty(Agriculture,"__esModule",{value:!0});var default_1$c=Agriculture.default=void 0,_createSvgIcon$c=_interopRequireDefault$c(requireCreateSvgIcon()),_jsxRuntime$c=jsxRuntimeExports;default_1$c=Agriculture.default=(0,_createSvgIcon$c.default)([(0,_jsxRuntime$c.jsx)("path",{d:"M19.5 12c.93 0 1.78.28 2.5.76V8c0-1.1-.9-2-2-2h-6.29l-1.06-1.06 1.41-1.41-.71-.71-3.53 3.53.71.71 1.41-1.41L13 6.71V9c0 1.1-.9 2-2 2h-.54c.95 1.06 1.54 2.46 1.54 4 0 .34-.04.67-.09 1h3.14c.25-2.25 2.14-4 4.45-4"},"0"),(0,_jsxRuntime$c.jsx)("path",{d:"M19.5 13c-1.93 0-3.5 1.57-3.5 3.5s1.57 3.5 3.5 3.5 3.5-1.57 3.5-3.5-1.57-3.5-3.5-3.5m0 5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M4 9h5c0-1.1-.9-2-2-2H4c-.55 0-1 .45-1 1s.45 1 1 1m5.83 4.82-.18-.47.93-.35c-.46-1.06-1.28-1.91-2.31-2.43l-.4.89-.46-.21.4-.9C7.26 10.13 6.64 10 6 10c-.53 0-1.04.11-1.52.26l.34.91-.47.18-.35-.93c-1.06.46-1.91 1.28-2.43 2.31l.89.4-.21.46-.9-.4C1.13 13.74 1 14.36 1 15c0 .53.11 1.04.26 1.52l.91-.34.18.47-.93.35c.46 1.06 1.28 1.91 2.31 2.43l.4-.89.46.21-.4.9c.55.22 1.17.35 1.81.35.53 0 1.04-.11 1.52-.26l-.34-.91.47-.18.35.93c1.06-.46 1.91-1.28 2.43-2.31l-.89-.4.21-.46.9.4c.22-.55.35-1.17.35-1.81 0-.53-.11-1.04-.26-1.52zm-2.68 3.95c-1.53.63-3.29-.09-3.92-1.62-.63-1.53.09-3.29 1.62-3.92 1.53-.63 3.29.09 3.92 1.62.64 1.53-.09 3.29-1.62 3.92"},"1")],"Agriculture");var Storefront={},_interopRequireDefault$b=interopRequireDefaultExports;Object.defineProperty(Storefront,"__esModule",{value:!0});var default_1$b=Storefront.default=void 0,_createSvgIcon$b=_interopRequireDefault$b(requireCreateSvgIcon()),_jsxRuntime$b=jsxRuntimeExports;default_1$b=Storefront.default=(0,_createSvgIcon$b.default)((0,_jsxRuntime$b.jsx)("path",{d:"m21.9 8.89-1.05-4.37c-.22-.9-1-1.52-1.91-1.52H5.05c-.9 0-1.69.63-1.9 1.52L2.1 8.89c-.24 1.02-.02 2.06.62 2.88.08.11.19.19.28.29V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6.94c.09-.09.2-.18.28-.28.64-.82.87-1.87.62-2.89m-2.99-3.9 1.05 4.37c.1.42.01.84-.25 1.17-.14.18-.44.47-.94.47-.61 0-1.14-.49-1.21-1.14L16.98 5zM13 5h1.96l.54 4.52c.05.39-.07.78-.33 1.07-.22.26-.54.41-.95.41-.67 0-1.22-.59-1.22-1.31zM8.49 9.52 9.04 5H11v4.69c0 .72-.55 1.31-1.29 1.31-.34 0-.65-.15-.89-.41-.25-.29-.37-.68-.33-1.07m-4.45-.16L5.05 5h1.97l-.58 4.86c-.08.65-.6 1.14-1.21 1.14-.49 0-.8-.29-.93-.47-.27-.32-.36-.75-.26-1.17M5 19v-6.03c.08.01.15.03.23.03.87 0 1.66-.36 2.24-.95.6.6 1.4.95 2.31.95.87 0 1.65-.36 2.23-.93.59.57 1.39.93 2.29.93.84 0 1.64-.35 2.24-.95.58.59 1.37.95 2.24.95.08 0 .15-.02.23-.03V19z"}),"Storefront");var CurrencyExchange={},_interopRequireDefault$a=interopRequireDefaultExports;Object.defineProperty(CurrencyExchange,"__esModule",{value:!0});var default_1$a=CurrencyExchange.default=void 0,_createSvgIcon$a=_interopRequireDefault$a(requireCreateSvgIcon()),_jsxRuntime$a=jsxRuntimeExports;default_1$a=CurrencyExchange.default=(0,_createSvgIcon$a.default)((0,_jsxRuntime$a.jsx)("path",{d:"M12.89 11.1c-1.78-.59-2.64-.96-2.64-1.9 0-1.02 1.11-1.39 1.81-1.39 1.31 0 1.79.99 1.9 1.34l1.58-.67c-.15-.45-.82-1.92-2.54-2.24V5h-2v1.26c-2.48.56-2.49 2.86-2.49 2.96 0 2.27 2.25 2.91 3.35 3.31 1.58.56 2.28 1.07 2.28 2.03 0 1.13-1.05 1.61-1.98 1.61-1.82 0-2.34-1.87-2.4-2.09l-1.66.67c.63 2.19 2.28 2.78 2.9 2.96V19h2v-1.24c.4-.09 2.9-.59 2.9-3.22 0-1.39-.61-2.61-3.01-3.44M3 21H1v-6h6v2H4.52c1.61 2.41 4.36 4 7.48 4 4.97 0 9-4.03 9-9h2c0 6.08-4.92 11-11 11-3.72 0-7.01-1.85-9-4.67zm-2-9C1 5.92 5.92 1 12 1c3.72 0 7.01 1.85 9 4.67V3h2v6h-6V7h2.48C17.87 4.59 15.12 3 12 3c-4.97 0-9 4.03-9 9z"}),"CurrencyExchange");var LocalAtm={},_interopRequireDefault$9=interopRequireDefaultExports;Object.defineProperty(LocalAtm,"__esModule",{value:!0});var default_1$9=LocalAtm.default=void 0,_createSvgIcon$9=_interopRequireDefault$9(requireCreateSvgIcon()),_jsxRuntime$9=jsxRuntimeExports;default_1$9=LocalAtm.default=(0,_createSvgIcon$9.default)((0,_jsxRuntime$9.jsx)("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m0 14H4V6h16z"}),"LocalAtm");var Preview={},_interopRequireDefault$8=interopRequireDefaultExports;Object.defineProperty(Preview,"__esModule",{value:!0});var default_1$8=Preview.default=void 0,_createSvgIcon$8=_interopRequireDefault$8(requireCreateSvgIcon()),_jsxRuntime$8=jsxRuntimeExports;default_1$8=Preview.default=(0,_createSvgIcon$8.default)((0,_jsxRuntime$8.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.89-2-2-2m0 16H5V7h14zm-5.5-6c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5 1.5.67 1.5 1.5M12 9c-2.73 0-5.06 1.66-6 4 .94 2.34 3.27 4 6 4s5.06-1.66 6-4c-.94-2.34-3.27-4-6-4m0 6.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"Preview");var Domain={},_interopRequireDefault$7=interopRequireDefaultExports;Object.defineProperty(Domain,"__esModule",{value:!0});var default_1$7=Domain.default=void 0,_createSvgIcon$7=_interopRequireDefault$7(requireCreateSvgIcon()),_jsxRuntime$7=jsxRuntimeExports;default_1$7=Domain.default=(0,_createSvgIcon$7.default)((0,_jsxRuntime$7.jsx)("path",{d:"M12 7V3H2v18h20V7zM6 19H4v-2h2zm0-4H4v-2h2zm0-4H4V9h2zm0-4H4V5h2zm4 12H8v-2h2zm0-4H8v-2h2zm0-4H8V9h2zm0-4H8V5h2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8zm-2-8h-2v2h2zm0 4h-2v2h2z"}),"Domain");var FoodBank={},_interopRequireDefault$6=interopRequireDefaultExports;Object.defineProperty(FoodBank,"__esModule",{value:!0});var default_1$6=FoodBank.default=void 0,_createSvgIcon$6=_interopRequireDefault$6(requireCreateSvgIcon()),_jsxRuntime$6=jsxRuntimeExports;default_1$6=FoodBank.default=(0,_createSvgIcon$6.default)((0,_jsxRuntime$6.jsx)("path",{d:"M12 3 4 9v12h16V9zm.5 9.5c0 .83-.67 1.5-1.5 1.5v4h-1v-4c-.83 0-1.5-.67-1.5-1.5v-3h1v3h.5v-3h1v3h.5v-3h1zM15 18h-1v-3.5h-1v-3c0-1.1.9-2 2-2z"}),"FoodBank");var HowToReg={},_interopRequireDefault$5=interopRequireDefaultExports;Object.defineProperty(HowToReg,"__esModule",{value:!0});var default_1$5=HowToReg.default=void 0,_createSvgIcon$5=_interopRequireDefault$5(requireCreateSvgIcon()),_jsxRuntime$5=jsxRuntimeExports;default_1$5=HowToReg.default=(0,_createSvgIcon$5.default)((0,_jsxRuntime$5.jsx)("path",{fillRule:"evenodd",d:"m9 17 3-2.94c-.39-.04-.68-.06-1-.06-2.67 0-8 1.34-8 4v2h9zm2-5c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m4.47 8.5L12 17l1.4-1.41 2.07 2.08 5.13-5.17 1.4 1.41z"}),"HowToReg");function getIconUserRole(e){switch(e){case"Admin":return jsxRuntimeExports.jsx(default_1$d,{});case"CityOperator":return jsxRuntimeExports.jsx(default_1$i,{});case"Poultry":return jsxRuntimeExports.jsx(default_1$1h,{});case"ProvinceOperator":return jsxRuntimeExports.jsx(default_1$j,{});case"ProvinceFinancial":return jsxRuntimeExports.jsx(default_1$g,{});case"KillHouse":return jsxRuntimeExports.jsx(default_1$r,{});case"KillHouseVet":return jsxRuntimeExports.jsx(default_1$11,{});case"VetFarm":return jsxRuntimeExports.jsx(default_1$h,{});case"Driver":return jsxRuntimeExports.jsx(default_1$e,{});case"ProvinceInspector":return jsxRuntimeExports.jsx(default_1$f,{});case"VetSupervisor":return jsxRuntimeExports.jsx(default_1$h,{});case"Jahad":return jsxRuntimeExports.jsx(default_1$c,{});case"CityJahad":return jsxRuntimeExports.jsx(default_1$c,{});case"ProvincialGovernment":return jsxRuntimeExports.jsx(default_1$s,{});case"Guilds":return jsxRuntimeExports.jsx(default_1$b,{});case"Steward":return jsxRuntimeExports.jsx(default_1$I,{});case"Commerce":return jsxRuntimeExports.jsx(default_1$a,{});case"CityCommerce":return jsxRuntimeExports.jsx(default_1$9,{});case"UnitWindow":return jsxRuntimeExports.jsx(default_1$n,{});case"CityVet":return jsxRuntimeExports.jsx(default_1$h,{});case"Observatory":return jsxRuntimeExports.jsx(default_1$8,{});case"ProvinceSupervisor":return jsxRuntimeExports.jsx(default_1$p,{});case"GuildRoom":return jsxRuntimeExports.jsx(default_1$b,{});case"PosCompany":return jsxRuntimeExports.jsx(default_1$m,{});case"LiveStockSupport":return jsxRuntimeExports.jsx(default_1$o,{});case"SuperAdmin":return jsxRuntimeExports.jsx(default_1$d,{});case"AdminX":return jsxRuntimeExports.jsx(default_1$d,{});case"ChainCompany":return jsxRuntimeExports.jsx(default_1$l,{});case"Supporter":return jsxRuntimeExports.jsx(default_1$o,{});case"Dispenser":return jsxRuntimeExports.jsx(default_1$k,{});case"CityPoultry":return jsxRuntimeExports.jsx(default_1$c,{});case"ParentCompany":return jsxRuntimeExports.jsx(default_1$7,{});case"ColdHouseSteward":return jsxRuntimeExports.jsx(default_1$13,{});case"CityGuild":return jsxRuntimeExports.jsx(default_1$6,{});case"LiveStockProvinceJahad":return jsxRuntimeExports.jsx(CorporateFare$1,{});case"Union":return jsxRuntimeExports.jsx(default_1$i,{});case"Cooperative":return jsxRuntimeExports.jsx(default_1$i,{});case"ranRanchercher":return jsxRuntimeExports.jsx(default_1$c,{});case"PoultryScience":return jsxRuntimeExports.jsx(default_1$5,{});default:return jsxRuntimeExports.jsx(default_1$q,{})}}function r(e){var t,a,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;te.indexOf(a)!==-1):e.indexOf(t)!==-1}const onSpaceOrEnter=(e,t)=>a=>{(a.key==="Enter"||a.key===" ")&&(e(a),a.preventDefault(),a.stopPropagation())},getActiveElement=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?getActiveElement(t.shadowRoot):t:null};function getPickersMonthUtilityClass(e){return generateUtilityClass("PrivatePickersMonth",e)}const pickersMonthClasses=generateUtilityClasses("PrivatePickersMonth",["root","selected"]),_excluded$h=["disabled","onSelect","selected","value","tabIndex","hasFocus","onFocus","onBlur"],useUtilityClasses$i=e=>{const{classes:t,selected:a}=e;return composeClasses({root:["root",a&&"selected"]},getPickersMonthUtilityClass,t)},PickersMonthRoot=styled(Typography,{name:"PrivatePickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${pickersMonthClasses.selected}`]:t.selected}]})(({theme:e})=>_extends$6({flex:"1 0 33.33%",display:"flex",alignItems:"center",justifyContent:"center",color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:alpha$1(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{pointerEvents:"none",color:e.palette.text.secondary},[`&.${pickersMonthClasses.selected}`]:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:focus, &:hover":{backgroundColor:e.palette.primary.dark}}})),noop$2=()=>{},PickersMonth=e=>{const{disabled:t,onSelect:a,selected:s,value:n,tabIndex:i,hasFocus:o,onFocus:u=noop$2,onBlur:l=noop$2}=e,c=_objectWithoutPropertiesLoose$3(e,_excluded$h),_=useUtilityClasses$i(e),p=()=>{a(n)},d=reactExports.useRef(null);return useEnhancedEffect(()=>{if(o){var E;(E=d.current)==null||E.focus()}},[o]),jsxRuntimeExports.jsx(PickersMonthRoot,_extends$6({ref:d,component:"button",type:"button",className:_.root,tabIndex:i,onClick:p,onKeyDown:onSpaceOrEnter(p),color:s?"primary":void 0,variant:s?"h5":"subtitle1",disabled:t,onFocus:E=>u(E,n),onBlur:E=>l(E,n)},c))},getPickersLocalization=e=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:_extends$6({},e)}}}}),enUSPickers={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"open previous view",openNextView:"open next view",calendarViewSwitchingButtonAriaLabel:e=>e==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",inputModeToggleButtonAriaLabel:(e,t)=>e?`text input view is open, go to ${t} view`:`${t} view is open, go to text input view`,start:"Start",end:"End",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerDefaultToolbarTitle:"Select date",dateTimePickerDefaultToolbarTitle:"Select date & time",timePickerDefaultToolbarTitle:"Select time",dateRangePickerDefaultToolbarTitle:"Select date range",clockLabelText:(e,t,a)=>`Select ${e}. ${t===null?"No time selected":`Selected time is ${a.format(t,"fullTime")}`}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,openDatePickerDialogue:(e,t)=>e&&t.isValid(t.date(e))?`Choose date, selected date is ${t.format(t.date(e),"fullDate")}`:"Choose date",openTimePickerDialogue:(e,t)=>e&&t.isValid(t.date(e))?`Choose time, selected time is ${t.format(t.date(e),"fullTime")}`:"Choose time",timeTableLabel:"pick time",dateTableLabel:"pick date"},DEFAULT_LOCALE=enUSPickers;getPickersLocalization(enUSPickers);const MuiPickersAdapterContext=reactExports.createContext(null);function LocalizationProvider(e){const t=useThemeProps({props:e,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:s,dateFormats:n,dateLibInstance:i,locale:o,adapterLocale:u,localeText:l}=t,c=reactExports.useMemo(()=>new s({locale:u??o,formats:n,instance:i}),[s,o,u,n,i]),_=reactExports.useMemo(()=>({minDate:c.date("1900-01-01T00:00:00.000"),maxDate:c.date("2099-12-31T00:00:00.000")}),[c]),p=reactExports.useMemo(()=>({utils:c,defaultDates:_,localeText:_extends$6({},DEFAULT_LOCALE,l??{})}),[_,c,l]);return jsxRuntimeExports.jsx(MuiPickersAdapterContext.Provider,{value:p,children:a})}const useLocalizationContext=()=>{const e=reactExports.useContext(MuiPickersAdapterContext);if(e===null)throw new Error("MUI: Can not find utils in context. It looks like you forgot to wrap your component in LocalizationProvider, or pass dateAdapter prop directly.");return e},useUtils=()=>useLocalizationContext().utils,useDefaultDates=()=>useLocalizationContext().defaultDates,useLocaleText=()=>useLocalizationContext().localeText,useNow=()=>{const e=useUtils();return reactExports.useRef(e.date()).current};function getMonthPickerUtilityClass(e){return generateUtilityClass("MuiMonthPicker",e)}generateUtilityClasses("MuiMonthPicker",["root"]);const findClosestEnabledDate=({date:e,disableFuture:t,disablePast:a,maxDate:s,minDate:n,isDateDisabled:i,utils:o})=>{const u=o.startOfDay(o.date());a&&o.isBefore(n,u)&&(n=u),t&&o.isAfter(s,u)&&(s=u);let l=e,c=e;for(o.isBefore(e,n)&&(l=o.date(n),c=null),o.isAfter(e,s)&&(c&&(c=o.date(s)),l=null);l||c;){if(l&&o.isAfter(l,s)&&(l=null),c&&o.isBefore(c,n)&&(c=null),l){if(!i(l))return l;l=o.addDays(l,1)}if(c){if(!i(c))return c;c=o.addDays(c,-1)}}return null},parsePickerInputValue=(e,t)=>{const a=e.date(t);return e.isValid(a)?a:null},parseNonNullablePickerDate=(e,t,a)=>{if(t==null)return a;const s=e.date(t);return e.isValid(s)?s:a},_excluded$g=["className","date","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange"],useUtilityClasses$h=e=>{const{classes:t}=e;return composeClasses({root:["root"]},getMonthPickerUtilityClass,t)};function useMonthPickerDefaultizedProps(e,t){const a=useUtils(),s=useDefaultDates(),n=useThemeProps({props:e,name:t});return _extends$6({disableFuture:!1,disablePast:!1},n,{minDate:parseNonNullablePickerDate(a,n.minDate,s.minDate),maxDate:parseNonNullablePickerDate(a,n.maxDate,s.maxDate)})}const MonthPickerRoot=styled("div",{name:"MuiMonthPicker",slot:"Root",overridesResolver:(e,t)=>t.root})({width:310,display:"flex",flexWrap:"wrap",alignContent:"stretch",margin:"0 4px"}),MonthPicker=reactExports.forwardRef(function e(t,a){const s=useUtils(),n=useNow(),i=useMonthPickerDefaultizedProps(t,"MuiMonthPicker"),{className:o,date:u,disabled:l,disableFuture:c,disablePast:_,maxDate:p,minDate:d,onChange:E,shouldDisableMonth:R,readOnly:y,disableHighlightToday:I,autoFocus:A=!1,onMonthFocus:x,hasFocus:g,onFocusedViewChange:T}=i,O=_objectWithoutPropertiesLoose$3(i,_excluded$g),C=i,U=useUtilityClasses$h(C),L=useTheme(),j=reactExports.useMemo(()=>u??s.startOfMonth(n),[n,s,u]),X=reactExports.useMemo(()=>u!=null?s.getMonth(u):I?null:s.getMonth(n),[n,u,s,I]),[B,H]=reactExports.useState(()=>X||s.getMonth(n)),W=reactExports.useCallback(ae=>{const ne=s.startOfMonth(_&&s.isAfter(n,d)?n:d),J=s.startOfMonth(c&&s.isBefore(n,p)?n:p);return s.isBefore(ae,ne)||s.isAfter(ae,J)?!0:R?R(ae):!1},[c,_,p,d,n,R,s]),K=ae=>{if(y)return;const ne=s.setMonth(j,ae);E(ne,"finish")},[b,k]=useControlled({name:"MonthPicker",state:"hasFocus",controlled:g,default:A}),F=reactExports.useCallback(ae=>{k(ae),T&&T(ae)},[k,T]),N=reactExports.useCallback(ae=>{W(s.setMonth(j,ae))||(H(ae),F(!0),x&&x(ae))},[W,s,j,F,x]);reactExports.useEffect(()=>{H(ae=>X!==null&&ae!==X?X:ae)},[X]);const M=useEventCallback$1(ae=>{switch(ae.key){case"ArrowUp":N((12+B-3)%12),ae.preventDefault();break;case"ArrowDown":N((12+B+3)%12),ae.preventDefault();break;case"ArrowLeft":N((12+B+(L.direction==="ltr"?-1:1))%12),ae.preventDefault();break;case"ArrowRight":N((12+B+(L.direction==="ltr"?1:-1))%12),ae.preventDefault();break}}),G=reactExports.useCallback((ae,ne)=>{N(ne)},[N]),V=reactExports.useCallback(()=>{F(!1)},[F]),ee=s.getMonth(n);return jsxRuntimeExports.jsx(MonthPickerRoot,_extends$6({ref:a,className:clsx(U.root,o),ownerState:C,onKeyDown:M},O,{children:s.getMonthArray(j).map(ae=>{const ne=s.getMonth(ae),J=s.format(ae,"monthShort"),ue=l||W(ae);return jsxRuntimeExports.jsx(PickersMonth,{value:ne,selected:ne===X,tabIndex:ne===B&&!ue?0:-1,hasFocus:b&&ne===B,onSelect:K,onFocus:G,onBlur:V,disabled:ue,"aria-current":ee===ne?"date":void 0,children:J},J)})}))});function useValidation(e,t,a){const{value:s,onError:n}=e,i=useLocalizationContext(),o=reactExports.useRef(null),u=t({adapter:i,value:s,props:e});return reactExports.useEffect(()=>{n&&!a(u,o.current)&&n(u,s),o.current=u},[a,n,o,u,s]),u}const validateDate$1=({props:e,value:t,adapter:a})=>{const s=a.utils.date(),n=a.utils.date(t),i=parseNonNullablePickerDate(a.utils,e.minDate,a.defaultDates.minDate),o=parseNonNullablePickerDate(a.utils,e.maxDate,a.defaultDates.maxDate);if(n===null)return null;switch(!0){case!a.utils.isValid(t):return"invalidDate";case!!(e.shouldDisableDate&&e.shouldDisableDate(n)):return"shouldDisableDate";case!!(e.disableFuture&&a.utils.isAfterDay(n,s)):return"disableFuture";case!!(e.disablePast&&a.utils.isBeforeDay(n,s)):return"disablePast";case!!(i&&a.utils.isBeforeDay(n,i)):return"minDate";case!!(o&&a.utils.isAfterDay(n,o)):return"maxDate";default:return null}},useIsDayDisabled=({shouldDisableDate:e,minDate:t,maxDate:a,disableFuture:s,disablePast:n})=>{const i=useLocalizationContext();return reactExports.useCallback(o=>validateDate$1({adapter:i,value:o,props:{shouldDisableDate:e,minDate:t,maxDate:a,disableFuture:s,disablePast:n}})!==null,[i,e,t,a,s,n])},isSameDateError=(e,t)=>e===t,useDateValidation=e=>useValidation(e,validateDate$1,isSameDateError),createCalendarStateReducer=(e,t,a)=>(s,n)=>{switch(n.type){case"changeMonth":return _extends$6({},s,{slideDirection:n.direction,currentMonth:n.newMonth,isMonthSwitchingAnimating:!e});case"finishMonthSwitchingAnimation":return _extends$6({},s,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(s.focusedDay!=null&&n.focusedDay!=null&&a.isSameDay(n.focusedDay,s.focusedDay))return s;const i=n.focusedDay!=null&&!t&&!a.isSameMonth(s.currentMonth,n.focusedDay);return _extends$6({},s,{focusedDay:n.focusedDay,isMonthSwitchingAnimating:i&&!e&&!n.withoutMonthSwitchingAnimation,currentMonth:i?a.startOfMonth(n.focusedDay):s.currentMonth,slideDirection:n.focusedDay!=null&&a.isAfterDay(n.focusedDay,s.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},useCalendarState=({date:e,defaultCalendarMonth:t,disableFuture:a,disablePast:s,disableSwitchToMonthOnDayFocus:n=!1,maxDate:i,minDate:o,onMonthChange:u,reduceAnimations:l,shouldDisableDate:c})=>{var _;const p=useNow(),d=useUtils(),E=reactExports.useRef(createCalendarStateReducer(!!l,n,d)).current,[R,y]=reactExports.useReducer(E,{isMonthSwitchingAnimating:!1,focusedDay:e||p,currentMonth:d.startOfMonth((_=e??t)!=null?_:p),slideDirection:"left"}),I=reactExports.useCallback(O=>{y(_extends$6({type:"changeMonth"},O)),u&&u(O.newMonth)},[u]),A=reactExports.useCallback(O=>{const C=O??p;d.isSameMonth(C,R.currentMonth)||I({newMonth:d.startOfMonth(C),direction:d.isAfterDay(C,R.currentMonth)?"left":"right"})},[R.currentMonth,I,p,d]),x=useIsDayDisabled({shouldDisableDate:c,minDate:o,maxDate:i,disableFuture:a,disablePast:s}),g=reactExports.useCallback(()=>{y({type:"finishMonthSwitchingAnimation"})},[]),T=reactExports.useCallback((O,C)=>{x(O)||y({type:"changeFocusedDay",focusedDay:O,withoutMonthSwitchingAnimation:C})},[x]);return{calendarState:R,changeMonth:A,changeFocusedDay:T,isDateDisabled:x,onMonthSwitchingAnimationEnd:g,handleChangeMonth:I}},getPickersFadeTransitionGroupUtilityClass=e=>generateUtilityClass("MuiPickersFadeTransitionGroup",e);generateUtilityClasses("MuiPickersFadeTransitionGroup",["root"]);const useUtilityClasses$g=e=>{const{classes:t}=e;return composeClasses({root:["root"]},getPickersFadeTransitionGroupUtilityClass,t)},animationDuration=500,PickersFadeTransitionGroupRoot=styled(TransitionGroup,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function PickersFadeTransitionGroup(e){const t=useThemeProps({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:a,className:s,reduceAnimations:n,transKey:i}=t,o=useUtilityClasses$g(t);return n?a:jsxRuntimeExports.jsx(PickersFadeTransitionGroupRoot,{className:clsx(o.root,s),children:jsxRuntimeExports.jsx(Fade,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:animationDuration,enter:animationDuration/2,exit:0},children:a},i)})}const DAY_SIZE=36,DAY_MARGIN=2,DIALOG_WIDTH=320,VIEW_HEIGHT=358;function getPickersDayUtilityClass(e){return generateUtilityClass("MuiPickersDay",e)}const pickersDayClasses=generateUtilityClasses("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),_excluded$f=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today"],useUtilityClasses$f=e=>{const{selected:t,disableMargin:a,disableHighlightToday:s,today:n,disabled:i,outsideCurrentMonth:o,showDaysOutsideCurrentMonth:u,classes:l}=e;return composeClasses({root:["root",t&&"selected",i&&"disabled",!a&&"dayWithMargin",!s&&n&&"today",o&&u&&"dayOutsideMonth",o&&!u&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},getPickersDayUtilityClass,l)},styleArg=({theme:e,ownerState:t})=>_extends$6({},e.typography.caption,{width:DAY_SIZE,height:DAY_SIZE,borderRadius:"50%",padding:0,backgroundColor:e.palette.background.paper,color:e.palette.text.primary,"&:hover":{backgroundColor:alpha$1(e.palette.action.active,e.palette.action.hoverOpacity)},"&:focus":{backgroundColor:alpha$1(e.palette.action.active,e.palette.action.hoverOpacity),[`&.${pickersDayClasses.selected}`]:{willChange:"background-color",backgroundColor:e.palette.primary.dark}},[`&.${pickersDayClasses.selected}`]:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,fontWeight:e.typography.fontWeightMedium,transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),"&:hover":{willChange:"background-color",backgroundColor:e.palette.primary.dark}},[`&.${pickersDayClasses.disabled}`]:{color:e.palette.text.disabled}},!t.disableMargin&&{margin:`0 ${DAY_MARGIN}px`},t.outsideCurrentMonth&&t.showDaysOutsideCurrentMonth&&{color:e.palette.text.secondary},!t.disableHighlightToday&&t.today&&{[`&:not(.${pickersDayClasses.selected})`]:{border:`1px solid ${e.palette.text.secondary}`}}),overridesResolver=(e,t)=>{const{ownerState:a}=e;return[t.root,!a.disableMargin&&t.dayWithMargin,!a.disableHighlightToday&&a.today&&t.today,!a.outsideCurrentMonth&&a.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,a.outsideCurrentMonth&&!a.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},PickersDayRoot=styled(ButtonBase,{name:"MuiPickersDay",slot:"Root",overridesResolver})(styleArg),PickersDayFiller=styled("div",{name:"MuiPickersDay",slot:"Root",overridesResolver})(({theme:e,ownerState:t})=>_extends$6({},styleArg({theme:e,ownerState:t}),{opacity:0,pointerEvents:"none"})),noop$1=()=>{},PickersDayRaw=reactExports.forwardRef(function e(t,a){const s=useThemeProps({props:t,name:"MuiPickersDay"}),{autoFocus:n=!1,className:i,day:o,disabled:u=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:_,onClick:p,onDaySelect:d,onFocus:E=noop$1,onBlur:R=noop$1,onKeyDown:y=noop$1,onMouseDown:I,outsideCurrentMonth:A,selected:x=!1,showDaysOutsideCurrentMonth:g=!1,children:T,today:O=!1}=s,C=_objectWithoutPropertiesLoose$3(s,_excluded$f),U=_extends$6({},s,{autoFocus:n,disabled:u,disableHighlightToday:l,disableMargin:c,selected:x,showDaysOutsideCurrentMonth:g,today:O}),L=useUtilityClasses$f(U),j=useUtils(),X=reactExports.useRef(null),B=useForkRef(X,a);useEnhancedEffect(()=>{n&&!u&&!_&&!A&&X.current.focus()},[n,u,_,A]);const H=K=>{I&&I(K),A&&K.preventDefault()},W=K=>{u||d(o,"finish"),A&&K.currentTarget.focus(),p&&p(K)};return A&&!g?jsxRuntimeExports.jsx(PickersDayFiller,{className:clsx(L.root,L.hiddenDaySpacingFiller,i),ownerState:U,role:C.role}):jsxRuntimeExports.jsx(PickersDayRoot,_extends$6({className:clsx(L.root,i),ownerState:U,ref:B,centerRipple:!0,disabled:u,tabIndex:x?0:-1,onKeyDown:K=>y(K,o),onFocus:K=>E(K,o),onBlur:K=>R(K,o),onClick:W,onMouseDown:H},C,{children:T||j.format(o,"dayOfMonth")}))}),areDayPropsEqual=(e,t)=>e.autoFocus===t.autoFocus&&e.isAnimating===t.isAnimating&&e.today===t.today&&e.disabled===t.disabled&&e.selected===t.selected&&e.disableMargin===t.disableMargin&&e.showDaysOutsideCurrentMonth===t.showDaysOutsideCurrentMonth&&e.disableHighlightToday===t.disableHighlightToday&&e.className===t.className&&e.sx===t.sx&&e.outsideCurrentMonth===t.outsideCurrentMonth&&e.onFocus===t.onFocus&&e.onBlur===t.onBlur&&e.onDaySelect===t.onDaySelect,PickersDay=reactExports.memo(PickersDayRaw,areDayPropsEqual),getPickersSlideTransitionUtilityClass=e=>generateUtilityClass("PrivatePickersSlideTransition",e),pickersSlideTransitionClasses=generateUtilityClasses("PrivatePickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),_excluded$e=["children","className","reduceAnimations","slideDirection","transKey"],useUtilityClasses$e=e=>{const{classes:t}=e;return composeClasses({root:["root"]},getPickersSlideTransitionUtilityClass,t)},slideAnimationDuration=350,PickersSlideTransitionRoot=styled(TransitionGroup,{name:"PrivatePickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${pickersSlideTransitionClasses["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${pickersSlideTransitionClasses["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${pickersSlideTransitionClasses.slideEnterActive}`]:t.slideEnterActive},{[`.${pickersSlideTransitionClasses.slideExit}`]:t.slideExit},{[`.${pickersSlideTransitionClasses["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${pickersSlideTransitionClasses["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{const t=e.transitions.create("transform",{duration:slideAnimationDuration,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${pickersSlideTransitionClasses["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${pickersSlideTransitionClasses["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${pickersSlideTransitionClasses.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${pickersSlideTransitionClasses.slideExit}`]:{transform:"translate(0%)"},[`& .${pickersSlideTransitionClasses["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${pickersSlideTransitionClasses["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}}),PickersSlideTransition=e=>{const{children:t,className:a,reduceAnimations:s,slideDirection:n,transKey:i}=e,o=_objectWithoutPropertiesLoose$3(e,_excluded$e),u=useUtilityClasses$e(e);if(s)return jsxRuntimeExports.jsx("div",{className:clsx(u.root,a),children:t});const l={exit:pickersSlideTransitionClasses.slideExit,enterActive:pickersSlideTransitionClasses.slideEnterActive,enter:pickersSlideTransitionClasses[`slideEnter-${n}`],exitActive:pickersSlideTransitionClasses[`slideExitActiveLeft-${n}`]};return jsxRuntimeExports.jsx(PickersSlideTransitionRoot,{className:clsx(u.root,a),childFactory:c=>reactExports.cloneElement(c,{classNames:l}),role:"presentation",children:jsxRuntimeExports.jsx(CSSTransition,_extends$6({mountOnEnter:!0,unmountOnExit:!0,timeout:slideAnimationDuration,classNames:l},o,{children:t}),i)})},getDayPickerUtilityClass=e=>generateUtilityClass("MuiDayPicker",e);generateUtilityClasses("MuiDayPicker",["header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer"]);const useUtilityClasses$d=e=>{const{classes:t}=e;return composeClasses({header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"]},getDayPickerUtilityClass,t)},defaultDayOfWeekFormatter=e=>e.charAt(0).toUpperCase(),weeksContainerHeight=(DAY_SIZE+DAY_MARGIN*2)*6,PickersCalendarDayHeader=styled("div",{name:"MuiDayPicker",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),PickersCalendarWeekDayLabel=styled(Typography,{name:"MuiDayPicker",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.secondary})),PickersCalendarLoadingContainer=styled("div",{name:"MuiDayPicker",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:weeksContainerHeight}),PickersCalendarSlideTransition=styled(PickersSlideTransition,{name:"MuiDayPicker",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:weeksContainerHeight}),PickersCalendarWeekContainer=styled("div",{name:"MuiDayPicker",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),PickersCalendarWeek=styled("div",{name:"MuiDayPicker",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:`${DAY_MARGIN}px 0`,display:"flex",justifyContent:"center"});function DayPicker(e){const t=useNow(),a=useUtils(),s=useThemeProps({props:e,name:"MuiDayPicker"}),n=useUtilityClasses$d(s),{onFocusedDayChange:i,className:o,currentMonth:u,selectedDays:l,disabled:c,disableHighlightToday:_,focusedDay:p,isMonthSwitchingAnimating:d,loading:E,onSelectedDaysChange:R,onMonthSwitchingAnimationEnd:y,readOnly:I,reduceAnimations:A,renderDay:x,renderLoading:g=()=>jsxRuntimeExports.jsx("span",{children:"..."}),showDaysOutsideCurrentMonth:T,slideDirection:O,TransitionProps:C,disablePast:U,disableFuture:L,minDate:j,maxDate:X,shouldDisableDate:B,dayOfWeekFormatter:H=defaultDayOfWeekFormatter,hasFocus:W,onFocusedViewChange:K,gridLabelId:b}=s,k=useIsDayDisabled({shouldDisableDate:B,minDate:j,maxDate:X,disablePast:U,disableFuture:L}),[F,N]=reactExports.useState(()=>p||t),M=reactExports.useCallback(q=>{K&&K(q)},[K]),G=reactExports.useCallback((q,Q="finish")=>{I||R(q,Q)},[R,I]),V=reactExports.useCallback(q=>{k(q)||(i(q),N(q),M(!0))},[k,i,M]),ee=useTheme$1();function ae(q,Q){switch(q.key){case"ArrowUp":V(a.addDays(Q,-7)),q.preventDefault();break;case"ArrowDown":V(a.addDays(Q,7)),q.preventDefault();break;case"ArrowLeft":{const se=a.addDays(Q,ee.direction==="ltr"?-1:1),fe=ee.direction==="ltr"?a.getPreviousMonth(Q):a.getNextMonth(Q),me=findClosestEnabledDate({utils:a,date:se,minDate:ee.direction==="ltr"?a.startOfMonth(fe):se,maxDate:ee.direction==="ltr"?se:a.endOfMonth(fe),isDateDisabled:k});V(me||se),q.preventDefault();break}case"ArrowRight":{const se=a.addDays(Q,ee.direction==="ltr"?1:-1),fe=ee.direction==="ltr"?a.getNextMonth(Q):a.getPreviousMonth(Q),me=findClosestEnabledDate({utils:a,date:se,minDate:ee.direction==="ltr"?se:a.startOfMonth(fe),maxDate:ee.direction==="ltr"?a.endOfMonth(fe):se,isDateDisabled:k});V(me||se),q.preventDefault();break}case"Home":V(a.startOfWeek(Q)),q.preventDefault();break;case"End":V(a.endOfWeek(Q)),q.preventDefault();break;case"PageUp":V(a.getNextMonth(Q)),q.preventDefault();break;case"PageDown":V(a.getPreviousMonth(Q)),q.preventDefault();break}}function ne(q,Q){V(Q)}function J(q,Q){W&&a.isSameDay(F,Q)&&M(!1)}const ue=a.getMonth(u),oe=l.filter(q=>!!q).map(q=>a.startOfDay(q)),_e=ue,Y=reactExports.useMemo(()=>reactExports.createRef(),[_e]),Z=a.startOfWeek(t),te=reactExports.useMemo(()=>{const q=a.startOfMonth(u),Q=a.endOfMonth(u);return k(F)||a.isAfterDay(F,Q)||a.isBeforeDay(F,q)?findClosestEnabledDate({utils:a,date:F,minDate:q,maxDate:Q,disablePast:U,disableFuture:L,isDateDisabled:k}):F},[u,L,U,F,k,a]);return jsxRuntimeExports.jsxs("div",{role:"grid","aria-labelledby":b,children:[jsxRuntimeExports.jsx(PickersCalendarDayHeader,{role:"row",className:n.header,children:a.getWeekdays().map((q,Q)=>{var se;return jsxRuntimeExports.jsx(PickersCalendarWeekDayLabel,{variant:"caption",role:"columnheader","aria-label":a.format(a.addDays(Z,Q),"weekday"),className:n.weekDayLabel,children:(se=H==null?void 0:H(q))!=null?se:q},q+Q.toString())})}),E?jsxRuntimeExports.jsx(PickersCalendarLoadingContainer,{className:n.loadingContainer,children:g()}):jsxRuntimeExports.jsx(PickersCalendarSlideTransition,_extends$6({transKey:_e,onExited:y,reduceAnimations:A,slideDirection:O,className:clsx(o,n.slideTransition)},C,{nodeRef:Y,children:jsxRuntimeExports.jsx(PickersCalendarWeekContainer,{ref:Y,role:"rowgroup",className:n.monthContainer,children:a.getWeekArray(u).map(q=>jsxRuntimeExports.jsx(PickersCalendarWeek,{role:"row",className:n.weekContainer,children:q.map(Q=>{const se=te!==null&&a.isSameDay(Q,te),fe=oe.some(Ae=>a.isSameDay(Ae,Q)),me=a.isSameDay(Q,t),ve={key:Q==null?void 0:Q.toString(),day:Q,isAnimating:d,disabled:c||k(Q),autoFocus:W&&se,today:me,outsideCurrentMonth:a.getMonth(Q)!==ue,selected:fe,disableHighlightToday:_,showDaysOutsideCurrentMonth:T,onKeyDown:ae,onFocus:ne,onBlur:J,onDaySelect:G,tabIndex:se?0:-1,role:"gridcell","aria-selected":fe};return me&&(ve["aria-current"]="date"),x?x(Q,oe,ve):reactExports.createElement(PickersDay,_extends$6({},ve,{key:ve.key}))})},`week-${q[0]}`))})}))]})}function useViews({onChange:e,onViewChange:t,openTo:a,view:s,views:n}){var i,o;const[u,l]=useControlled({name:"Picker",state:"view",controlled:s,default:a&&arrayIncludes(n,a)?a:n[0]}),c=(i=n[n.indexOf(u)-1])!=null?i:null,_=(o=n[n.indexOf(u)+1])!=null?o:null,p=reactExports.useCallback(R=>{l(R),t&&t(R)},[l,t]),d=reactExports.useCallback(()=>{_&&p(_)},[_,p]);return{handleChangeAndOpenNext:reactExports.useCallback((R,y)=>{const I=y==="finish";e(R,I&&_?"partial":y),I&&d()},[_,e,d]),nextView:_,previousView:c,openNext:d,openView:u,setOpenView:p}}const ArrowDropDown=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),ArrowLeft=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),ArrowRight=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),Calendar=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar"),Clock$1=createSvgIcon$1(jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),jsxRuntimeExports.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange");const Pen=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 00-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Pen");createSvgIcon$1(jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),jsxRuntimeExports.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time");function getPickersArrowSwitcherUtilityClass(e){return generateUtilityClass("MuiPickersArrowSwitcher",e)}generateUtilityClasses("MuiPickersArrowSwitcher",["root","spacer","button"]);const _excluded$d=["children","className","components","componentsProps","isLeftDisabled","isLeftHidden","isRightDisabled","isRightHidden","leftArrowButtonText","onLeftClick","onRightClick","rightArrowButtonText"],useUtilityClasses$c=e=>{const{classes:t}=e;return composeClasses({root:["root"],spacer:["spacer"],button:["button"]},getPickersArrowSwitcherUtilityClass,t)},PickersArrowSwitcherRoot=styled("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),PickersArrowSwitcherSpacer=styled("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),PickersArrowSwitcherButton=styled(IconButton,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})(({ownerState:e})=>_extends$6({},e.hidden&&{visibility:"hidden"})),PickersArrowSwitcher=reactExports.forwardRef(function e(t,a){const s=useThemeProps({props:t,name:"MuiPickersArrowSwitcher"}),{children:n,className:i,components:o,componentsProps:u,isLeftDisabled:l,isLeftHidden:c,isRightDisabled:_,isRightHidden:p,leftArrowButtonText:d,onLeftClick:E,onRightClick:R,rightArrowButtonText:y}=s,I=_objectWithoutPropertiesLoose$3(s,_excluded$d),x=useTheme$1().direction==="rtl",g=(u==null?void 0:u.leftArrowButton)||{},T=(o==null?void 0:o.LeftArrowIcon)||ArrowLeft,O=(u==null?void 0:u.rightArrowButton)||{},C=(o==null?void 0:o.RightArrowIcon)||ArrowRight,U=s,L=useUtilityClasses$c(U);return jsxRuntimeExports.jsxs(PickersArrowSwitcherRoot,_extends$6({ref:a,className:clsx(L.root,i),ownerState:U},I,{children:[jsxRuntimeExports.jsx(PickersArrowSwitcherButton,_extends$6({as:o==null?void 0:o.LeftArrowButton,size:"small","aria-label":d,title:d,disabled:l,edge:"end",onClick:E},g,{className:clsx(L.button,g.className),ownerState:_extends$6({},U,g,{hidden:c}),children:x?jsxRuntimeExports.jsx(C,{}):jsxRuntimeExports.jsx(T,{})})),n?jsxRuntimeExports.jsx(Typography,{variant:"subtitle1",component:"span",children:n}):jsxRuntimeExports.jsx(PickersArrowSwitcherSpacer,{className:L.spacer,ownerState:U}),jsxRuntimeExports.jsx(PickersArrowSwitcherButton,_extends$6({as:o==null?void 0:o.RightArrowButton,size:"small","aria-label":y,title:y,edge:"start",disabled:_,onClick:R},O,{className:clsx(L.button,O.className),ownerState:_extends$6({},U,O,{hidden:p}),children:x?jsxRuntimeExports.jsx(T,{}):jsxRuntimeExports.jsx(C,{})}))]}))}),getMeridiem=(e,t)=>e?t.getHours(e)>=12?"pm":"am":null,convertValueToMeridiem=(e,t,a)=>a&&(e>=12?"pm":"am")!==t?t==="am"?e-12:e+12:e,convertToMeridiem=(e,t,a,s)=>{const n=convertValueToMeridiem(s.getHours(e),t,a);return s.setHours(e,n)},getSecondsInDay=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),createIsAfterIgnoreDatePart=(e=!1,t)=>(a,s)=>e?t.isAfter(a,s):getSecondsInDay(a,t)>getSecondsInDay(s,t);function useNextMonthDisabled(e,{disableFuture:t,maxDate:a}){const s=useUtils();return reactExports.useMemo(()=>{const n=s.date(),i=s.startOfMonth(t&&s.isBefore(n,a)?n:a);return!s.isAfter(i,e)},[t,a,e,s])}function usePreviousMonthDisabled(e,{disablePast:t,minDate:a}){const s=useUtils();return reactExports.useMemo(()=>{const n=s.date(),i=s.startOfMonth(t&&s.isAfter(n,a)?n:a);return!s.isBefore(i,e)},[t,a,e,s])}function useMeridiemMode(e,t,a){const s=useUtils(),n=getMeridiem(e,s),i=reactExports.useCallback(o=>{const u=e==null?null:convertToMeridiem(e,o,!!t,s);a(u,"partial")},[t,e,a,s]);return{meridiemMode:n,handleMeridiemChange:i}}const buildDeprecatedPropsWarning=e=>()=>{},getPickersCalendarHeaderUtilityClass=e=>generateUtilityClass("MuiPickersCalendarHeader",e);generateUtilityClasses("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);const useUtilityClasses$b=e=>{const{classes:t}=e;return composeClasses({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},getPickersCalendarHeaderUtilityClass,t)},PickersCalendarHeaderRoot=styled("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:16,marginBottom:8,paddingLeft:24,paddingRight:12,maxHeight:30,minHeight:30}),PickersCalendarHeaderLabelContainer=styled("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>_extends$6({display:"flex",maxHeight:30,overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),PickersCalendarHeaderLabel=styled("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),PickersCalendarHeaderSwitchViewButton=styled(IconButton,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto"}),PickersCalendarHeaderSwitchViewIcon=styled(ArrowDropDown,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e,ownerState:t})=>_extends$6({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"},t.openView==="year"&&{transform:"rotate(180deg)"})),deprecatedPropsWarning$1=buildDeprecatedPropsWarning();function PickersCalendarHeader(e){const t=useThemeProps({props:e,name:"MuiPickersCalendarHeader"}),{components:a={},componentsProps:s={},currentMonth:n,disabled:i,disableFuture:o,disablePast:u,getViewSwitchingButtonText:l,leftArrowButtonText:c,maxDate:_,minDate:p,onMonthChange:d,onViewChange:E,openView:R,reduceAnimations:y,rightArrowButtonText:I,views:A,labelId:x}=t;deprecatedPropsWarning$1({leftArrowButtonText:c,rightArrowButtonText:I,getViewSwitchingButtonText:l});const g=useLocaleText(),T=c??g.previousMonth,O=I??g.nextMonth,C=l??g.calendarViewSwitchingButtonAriaLabel,U=useUtils(),L=useUtilityClasses$b(t),j=s.switchViewButton||{},X=()=>d(U.getNextMonth(n),"left"),B=()=>d(U.getPreviousMonth(n),"right"),H=useNextMonthDisabled(n,{disableFuture:o,maxDate:_}),W=usePreviousMonthDisabled(n,{disablePast:u,minDate:p}),K=()=>{if(!(A.length===1||!E||i))if(A.length===2)E(A.find(k=>k!==R)||A[0]);else{const k=A.indexOf(R)!==0?0:1;E(A[k])}};if(A.length===1&&A[0]==="year")return null;const b=t;return jsxRuntimeExports.jsxs(PickersCalendarHeaderRoot,{ownerState:b,className:L.root,children:[jsxRuntimeExports.jsxs(PickersCalendarHeaderLabelContainer,{role:"presentation",onClick:K,ownerState:b,"aria-live":"polite",className:L.labelContainer,children:[jsxRuntimeExports.jsx(PickersFadeTransitionGroup,{reduceAnimations:y,transKey:U.format(n,"monthAndYear"),children:jsxRuntimeExports.jsx(PickersCalendarHeaderLabel,{id:x,ownerState:b,className:L.label,children:U.format(n,"monthAndYear")})}),A.length>1&&!i&&jsxRuntimeExports.jsx(PickersCalendarHeaderSwitchViewButton,_extends$6({size:"small",as:a.SwitchViewButton,"aria-label":C(R),className:L.switchViewButton},j,{children:jsxRuntimeExports.jsx(PickersCalendarHeaderSwitchViewIcon,{as:a.SwitchViewIcon,ownerState:b,className:L.switchViewIcon})}))]}),jsxRuntimeExports.jsx(Fade,{in:R==="day",children:jsxRuntimeExports.jsx(PickersArrowSwitcher,{leftArrowButtonText:T,rightArrowButtonText:O,components:a,componentsProps:s,onLeftClick:B,onRightClick:X,isLeftDisabled:W,isRightDisabled:H})})]})}const WrapperVariantContext=reactExports.createContext(null);function getPickersYearUtilityClass(e){return generateUtilityClass("PrivatePickersYear",e)}const pickersYearClasses=generateUtilityClasses("PrivatePickersYear",["root","modeDesktop","modeMobile","yearButton","selected","disabled"]),_excluded$c=["autoFocus","className","children","disabled","onClick","onKeyDown","value","tabIndex","onFocus","onBlur"],useUtilityClasses$a=e=>{const{wrapperVariant:t,disabled:a,selected:s,classes:n}=e,i={root:["root",t&&`mode${capitalize$2(t)}`],yearButton:["yearButton",a&&"disabled",s&&"selected"]};return composeClasses(i,getPickersYearUtilityClass,n)},PickersYearRoot=styled("div",{name:"PrivatePickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${pickersYearClasses.modeDesktop}`]:t.modeDesktop},{[`&.${pickersYearClasses.modeMobile}`]:t.modeMobile}]})(({ownerState:e})=>_extends$6({flexBasis:"33.3%",display:"flex",alignItems:"center",justifyContent:"center"},(e==null?void 0:e.wrapperVariant)==="desktop"&&{flexBasis:"25%"})),PickersYearButton=styled("button",{name:"PrivatePickersYear",slot:"Button",overridesResolver:(e,t)=>[t.button,{[`&.${pickersYearClasses.disabled}`]:t.disabled},{[`&.${pickersYearClasses.selected}`]:t.selected}]})(({theme:e})=>_extends$6({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:alpha$1(e.palette.action.active,e.palette.action.hoverOpacity)},[`&.${pickersYearClasses.disabled}`]:{color:e.palette.text.secondary},[`&.${pickersYearClasses.selected}`]:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:focus, &:hover":{backgroundColor:e.palette.primary.dark}}})),noop=()=>{},PickersYear=reactExports.forwardRef(function e(t,a){const{autoFocus:s,className:n,children:i,disabled:o,onClick:u,onKeyDown:l,value:c,tabIndex:_,onFocus:p=noop,onBlur:d=noop}=t,E=_objectWithoutPropertiesLoose$3(t,_excluded$c),R=reactExports.useRef(null),y=useForkRef(R,a),I=reactExports.useContext(WrapperVariantContext),A=_extends$6({},t,{wrapperVariant:I}),x=useUtilityClasses$a(A);return reactExports.useEffect(()=>{s&&R.current.focus()},[s]),jsxRuntimeExports.jsx(PickersYearRoot,{className:clsx(x.root,n),ownerState:A,children:jsxRuntimeExports.jsx(PickersYearButton,_extends$6({ref:y,disabled:o,type:"button",tabIndex:o?-1:_,onClick:g=>u(g,c),onKeyDown:g=>l(g,c),onFocus:g=>p(g,c),onBlur:g=>d(g,c),className:x.yearButton,ownerState:A},E,{children:i}))})});function getYearPickerUtilityClass(e){return generateUtilityClass("MuiYearPicker",e)}generateUtilityClasses("MuiYearPicker",["root"]);const useUtilityClasses$9=e=>{const{classes:t}=e;return composeClasses({root:["root"]},getYearPickerUtilityClass,t)};function useYearPickerDefaultizedProps(e,t){const a=useUtils(),s=useDefaultDates(),n=useThemeProps({props:e,name:t});return _extends$6({disablePast:!1,disableFuture:!1},n,{minDate:parseNonNullablePickerDate(a,n.minDate,s.minDate),maxDate:parseNonNullablePickerDate(a,n.maxDate,s.maxDate)})}const YearPickerRoot=styled("div",{name:"MuiYearPicker",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",maxHeight:"304px"}),YearPicker=reactExports.forwardRef(function e(t,a){const s=useNow(),n=useTheme$1(),i=useUtils(),o=useYearPickerDefaultizedProps(t,"MuiYearPicker"),{autoFocus:u,className:l,date:c,disabled:_,disableFuture:p,disablePast:d,maxDate:E,minDate:R,onChange:y,readOnly:I,shouldDisableYear:A,disableHighlightToday:x,onYearFocus:g,hasFocus:T,onFocusedViewChange:O}=o,C=o,U=useUtilityClasses$9(C),L=reactExports.useMemo(()=>c??i.startOfYear(s),[s,i,c]),j=reactExports.useMemo(()=>c!=null?i.getYear(c):x?null:i.getYear(s),[s,c,i,x]),X=reactExports.useContext(WrapperVariantContext),B=reactExports.useRef(null),[H,W]=reactExports.useState(()=>j||i.getYear(s)),[K,b]=useControlled({name:"YearPicker",state:"hasFocus",controlled:T,default:u}),k=reactExports.useCallback(oe=>{b(oe),O&&O(oe)},[b,O]),F=reactExports.useCallback(oe=>!!(d&&i.isBeforeYear(oe,s)||p&&i.isAfterYear(oe,s)||R&&i.isBeforeYear(oe,R)||E&&i.isAfterYear(oe,E)||A&&A(oe)),[p,d,E,R,s,A,i]),N=(oe,_e,Y="finish")=>{if(I)return;const Z=i.setYear(L,_e);y(Z,Y)},M=reactExports.useCallback(oe=>{F(i.setYear(L,oe))||(W(oe),k(!0),g==null||g(oe))},[F,i,L,k,g]);reactExports.useEffect(()=>{W(oe=>j!==null&&oe!==j?j:oe)},[j]);const G=X==="desktop"?4:3,V=reactExports.useCallback((oe,_e)=>{switch(oe.key){case"ArrowUp":M(_e-G),oe.preventDefault();break;case"ArrowDown":M(_e+G),oe.preventDefault();break;case"ArrowLeft":M(_e+(n.direction==="ltr"?-1:1)),oe.preventDefault();break;case"ArrowRight":M(_e+(n.direction==="ltr"?1:-1)),oe.preventDefault();break}},[M,n.direction,G]),ee=reactExports.useCallback((oe,_e)=>{M(_e)},[M]),ae=reactExports.useCallback((oe,_e)=>{H===_e&&k(!1)},[H,k]),ne=i.getYear(s),J=reactExports.useRef(null),ue=useForkRef(a,J);return reactExports.useEffect(()=>{if(u||J.current===null)return;const oe=J.current.querySelector('[tabindex="0"]');if(!oe)return;const _e=oe.offsetHeight,Y=oe.offsetTop,Z=J.current.clientHeight,te=J.current.scrollTop,q=Y+_e;_e>Z||Y{const _e=i.getYear(oe),Y=_e===j;return jsxRuntimeExports.jsx(PickersYear,{selected:Y,value:_e,onClick:N,onKeyDown:V,autoFocus:K&&_e===H,ref:Y?B:void 0,disabled:_||F(oe),tabIndex:_e===H?0:-1,onFocus:ee,onBlur:ae,"aria-current":ne===_e?"date":void 0,children:i.format(oe,"year")},i.format(oe,"year"))})})}),PickerViewRoot=styled("div")({overflowX:"hidden",width:DIALOG_WIDTH,maxHeight:VIEW_HEIGHT,display:"flex",flexDirection:"column",margin:"0 auto"}),defaultReduceAnimations=typeof navigator<"u"&&/(android)/i.test(navigator.userAgent),getCalendarPickerUtilityClass=e=>generateUtilityClass("MuiCalendarPicker",e);generateUtilityClasses("MuiCalendarPicker",["root","viewTransitionContainer"]);const _excluded$b=["autoFocus","onViewChange","date","disableFuture","disablePast","defaultCalendarMonth","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","classes"],useUtilityClasses$8=e=>{const{classes:t}=e;return composeClasses({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},getCalendarPickerUtilityClass,t)};function useCalendarPickerDefaultizedProps(e,t){const a=useUtils(),s=useDefaultDates(),n=useThemeProps({props:e,name:t});return _extends$6({loading:!1,disablePast:!1,disableFuture:!1,openTo:"day",views:["year","day"],reduceAnimations:defaultReduceAnimations,renderLoading:()=>jsxRuntimeExports.jsx("span",{children:"..."})},n,{minDate:parseNonNullablePickerDate(a,n.minDate,s.minDate),maxDate:parseNonNullablePickerDate(a,n.maxDate,s.maxDate)})}const CalendarPickerRoot=styled(PickerViewRoot,{name:"MuiCalendarPicker",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column"}),CalendarPickerViewTransitionContainer=styled(PickersFadeTransitionGroup,{name:"MuiCalendarPicker",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),CalendarPicker=reactExports.forwardRef(function e(t,a){const s=useUtils(),n=useId(),i=useCalendarPickerDefaultizedProps(t,"MuiCalendarPicker"),{autoFocus:o,onViewChange:u,date:l,disableFuture:c,disablePast:_,defaultCalendarMonth:p,onChange:d,onYearChange:E,onMonthChange:R,reduceAnimations:y,shouldDisableDate:I,shouldDisableMonth:A,shouldDisableYear:x,view:g,views:T,openTo:O,className:C,disabled:U,readOnly:L,minDate:j,maxDate:X,disableHighlightToday:B,focusedView:H,onFocusedViewChange:W}=i,K=_objectWithoutPropertiesLoose$3(i,_excluded$b),{openView:b,setOpenView:k,openNext:F}=useViews({view:g,views:T,openTo:O,onChange:d,onViewChange:u}),{calendarState:N,changeFocusedDay:M,changeMonth:G,handleChangeMonth:V,isDateDisabled:ee,onMonthSwitchingAnimationEnd:ae}=useCalendarState({date:l,defaultCalendarMonth:p,reduceAnimations:y,onMonthChange:R,minDate:j,maxDate:X,shouldDisableDate:I,disablePast:_,disableFuture:c}),ne=reactExports.useCallback((ce,Se)=>{const Te=s.startOfMonth(ce),re=s.endOfMonth(ce),le=ee(ce)?findClosestEnabledDate({utils:s,date:ce,minDate:s.isBefore(j,Te)?Te:j,maxDate:s.isAfter(X,re)?re:X,disablePast:_,disableFuture:c,isDateDisabled:ee}):ce;le?(d(le,Se),R==null||R(Te)):(F(),G(Te)),M(le,!0)},[M,c,_,ee,X,j,d,R,G,F,s]),J=reactExports.useCallback((ce,Se)=>{const Te=s.startOfYear(ce),re=s.endOfYear(ce),le=ee(ce)?findClosestEnabledDate({utils:s,date:ce,minDate:s.isBefore(j,Te)?Te:j,maxDate:s.isAfter(X,re)?re:X,disablePast:_,disableFuture:c,isDateDisabled:ee}):ce;le?(d(le,Se),E==null||E(le)):(F(),G(Te)),M(le,!0)},[M,c,_,ee,X,j,d,E,F,s,G]),ue=reactExports.useCallback((ce,Se)=>d(l&&ce?s.mergeDateAndTime(ce,l):ce,Se),[s,l,d]);reactExports.useEffect(()=>{l&&G(l)},[l]);const oe=i,_e=useUtilityClasses$8(oe),Y={disablePast:_,disableFuture:c,maxDate:X,minDate:j},Z=U&&l||j,te=U&&l||X,q={disableHighlightToday:B,readOnly:L,disabled:U},Q=`${n}-grid-label`,[se,fe]=useControlled({name:"DayPicker",state:"focusedView",controlled:H,default:o?b:null}),me=se!==null,ve=useEventCallback$1(ce=>Se=>{if(W){W(ce)(Se);return}fe(Se?ce:Te=>Te===ce?null:Te)}),Ae=reactExports.useRef(b);return reactExports.useEffect(()=>{Ae.current!==b&&(Ae.current=b,ve(b)(!0))},[b,ve]),jsxRuntimeExports.jsxs(CalendarPickerRoot,{ref:a,className:clsx(_e.root,C),ownerState:oe,children:[jsxRuntimeExports.jsx(PickersCalendarHeader,_extends$6({},K,{views:T,openView:b,currentMonth:N.currentMonth,onViewChange:k,onMonthChange:(ce,Se)=>V({newMonth:ce,direction:Se}),minDate:Z,maxDate:te,disabled:U,disablePast:_,disableFuture:c,reduceAnimations:y,labelId:Q})),jsxRuntimeExports.jsx(CalendarPickerViewTransitionContainer,{reduceAnimations:y,className:_e.viewTransitionContainer,transKey:b,ownerState:oe,children:jsxRuntimeExports.jsxs("div",{children:[b==="year"&&jsxRuntimeExports.jsx(YearPicker,_extends$6({},K,Y,q,{autoFocus:o,date:l,onChange:J,shouldDisableYear:x,hasFocus:me,onFocusedViewChange:ve("year")})),b==="month"&&jsxRuntimeExports.jsx(MonthPicker,_extends$6({},Y,q,{autoFocus:o,hasFocus:me,className:C,date:l,onChange:ne,shouldDisableMonth:A,onFocusedViewChange:ve("month")})),b==="day"&&jsxRuntimeExports.jsx(DayPicker,_extends$6({},K,N,Y,q,{autoFocus:o,onMonthSwitchingAnimationEnd:ae,onFocusedDayChange:M,reduceAnimations:y,selectedDays:[l],onSelectedDaysChange:ue,shouldDisableDate:I,hasFocus:me,onFocusedViewChange:ve("day"),gridLabelId:Q}))]})})]})}),CLOCK_WIDTH=220,CLOCK_HOUR_WIDTH=36,clockCenter={x:CLOCK_WIDTH/2,y:CLOCK_WIDTH/2},baseClockPoint={x:clockCenter.x,y:0},cx=baseClockPoint.x-clockCenter.x,cy=baseClockPoint.y-clockCenter.y,rad2deg=e=>e*(180/Math.PI),getAngleValue=(e,t,a)=>{const s=t-clockCenter.x,n=a-clockCenter.y,i=Math.atan2(cx,cy)-Math.atan2(s,n);let o=rad2deg(i);o=Math.round(o/e)*e,o%=360;const u=Math.floor(o/e)||0,l=s**2+n**2,c=Math.sqrt(l);return{value:u,distance:c}},getMinutes$1=(e,t,a=1)=>{const s=a*6;let{value:n}=getAngleValue(s,e,t);return n=n*a%60,n},getHours$1=(e,t,a)=>{const{value:s,distance:n}=getAngleValue(30,e,t);let i=s||12;return a?i%=12:n{const{classes:t}=e;return composeClasses({root:["root"],thumb:["thumb"]},getClockPointerUtilityClass,t)},ClockPointerRoot=styled("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>_extends$6({width:2,backgroundColor:e.palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px"},t.shouldAnimate&&{transition:e.transitions.create(["transform","height"])})),ClockPointerThumb=styled("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(({theme:e,ownerState:t})=>_extends$6({width:4,height:4,backgroundColor:e.palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${CLOCK_HOUR_WIDTH/2}px)`,border:`${(CLOCK_HOUR_WIDTH-4)/2}px solid ${e.palette.primary.main}`,boxSizing:"content-box"},t.hasSelected&&{backgroundColor:e.palette.primary.main}));function ClockPointer(e){const t=useThemeProps({props:e,name:"MuiClockPointer"}),{className:a,isInner:s,type:n,value:i}=t,o=_objectWithoutPropertiesLoose$3(t,_excluded$a),u=reactExports.useRef(n);reactExports.useEffect(()=>{u.current=n},[n]);const l=_extends$6({},t,{shouldAnimate:u.current!==n}),c=useUtilityClasses$7(l),_=()=>{let d=360/(n==="hours"?12:60)*i;return n==="hours"&&i>12&&(d-=360),{height:Math.round((s?.26:.4)*CLOCK_WIDTH),transform:`rotateZ(${d}deg)`}};return jsxRuntimeExports.jsx(ClockPointerRoot,_extends$6({style:_(),className:clsx(a,c.root),ownerState:l},o,{children:jsxRuntimeExports.jsx(ClockPointerThumb,{ownerState:l,className:c.thumb})}))}function getClockUtilityClass(e){return generateUtilityClass("MuiClock",e)}generateUtilityClasses("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton"]);const useUtilityClasses$6=e=>{const{classes:t}=e;return composeClasses({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton"],pmButton:["pmButton"]},getClockUtilityClass,t)},ClockRoot=styled("div",{name:"MuiClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:e.spacing(2)})),ClockClock=styled("div",{name:"MuiClock",slot:"Clock",overridesResolver:(e,t)=>t.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),ClockWrapper=styled("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({"&:focus":{outline:"none"}}),ClockSquareMask=styled("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(e,t)=>t.squareMask})(({ownerState:e})=>_extends$6({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none"},e.disabled?{}:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}})),ClockPin=styled("div",{name:"MuiClock",slot:"Pin",overridesResolver:(e,t)=>t.pin})(({theme:e})=>({width:6,height:6,borderRadius:"50%",backgroundColor:e.palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),ClockAmButton=styled(IconButton,{name:"MuiClock",slot:"AmButton",overridesResolver:(e,t)=>t.amButton})(({theme:e,ownerState:t})=>_extends$6({zIndex:1,position:"absolute",bottom:t.ampmInClock?64:8,left:8},t.meridiemMode==="am"&&{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.light}})),ClockPmButton=styled(IconButton,{name:"MuiClock",slot:"PmButton",overridesResolver:(e,t)=>t.pmButton})(({theme:e,ownerState:t})=>_extends$6({zIndex:1,position:"absolute",bottom:t.ampmInClock?64:8,right:8},t.meridiemMode==="pm"&&{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.light}}));function Clock(e){const t=useThemeProps({props:e,name:"MuiClock"}),{ampm:a,ampmInClock:s,autoFocus:n,children:i,date:o,getClockLabelText:u,handleMeridiemChange:l,isTimeDisabled:c,meridiemMode:_,minutesStep:p=1,onChange:d,selectedId:E,type:R,value:y,disabled:I,readOnly:A,className:x}=t,g=t,T=useUtils(),O=reactExports.useContext(WrapperVariantContext),C=reactExports.useRef(!1),U=useUtilityClasses$6(g),L=c(y,R),j=!a&&R==="hours"&&(y<1||y>12),X=(G,V)=>{I||A||c(G,R)||d(G,V)},B=(G,V)=>{let{offsetX:ee,offsetY:ae}=G;if(ee===void 0){const J=G.target.getBoundingClientRect();ee=G.changedTouches[0].clientX-J.left,ae=G.changedTouches[0].clientY-J.top}const ne=R==="seconds"||R==="minutes"?getMinutes$1(ee,ae,p):getHours$1(ee,ae,!!a);X(ne,V)},H=G=>{C.current=!0,B(G,"shallow")},W=G=>{C.current&&(B(G,"finish"),C.current=!1)},K=G=>{G.buttons>0&&B(G.nativeEvent,"shallow")},b=G=>{C.current&&(C.current=!1),B(G.nativeEvent,"finish")},k=reactExports.useMemo(()=>R==="hours"?!0:y%5===0,[R,y]),F=R==="minutes"?p:1,N=reactExports.useRef(null);useEnhancedEffect(()=>{n&&N.current.focus()},[n]);const M=G=>{if(!C.current)switch(G.key){case"Home":X(0,"partial"),G.preventDefault();break;case"End":X(R==="minutes"?59:23,"partial"),G.preventDefault();break;case"ArrowUp":X(y+F,"partial"),G.preventDefault();break;case"ArrowDown":X(y-F,"partial"),G.preventDefault();break}};return jsxRuntimeExports.jsxs(ClockRoot,{className:clsx(x,U.root),children:[jsxRuntimeExports.jsxs(ClockClock,{className:U.clock,children:[jsxRuntimeExports.jsx(ClockSquareMask,{onTouchMove:H,onTouchEnd:W,onMouseUp:b,onMouseMove:K,ownerState:{disabled:I},className:U.squareMask}),!L&&jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(ClockPin,{className:U.pin}),o&&jsxRuntimeExports.jsx(ClockPointer,{type:R,value:y,isInner:j,hasSelected:k})]}),jsxRuntimeExports.jsx(ClockWrapper,{"aria-activedescendant":E,"aria-label":u(R,o,T),ref:N,role:"listbox",onKeyDown:M,tabIndex:0,className:U.wrapper,children:i})]}),a&&(O==="desktop"||s)&&jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(ClockAmButton,{onClick:A?void 0:()=>l("am"),disabled:I||_===null,ownerState:g,className:U.amButton,children:jsxRuntimeExports.jsx(Typography,{variant:"caption",children:"AM"})}),jsxRuntimeExports.jsx(ClockPmButton,{disabled:I||_===null,onClick:A?void 0:()=>l("pm"),ownerState:g,className:U.pmButton,children:jsxRuntimeExports.jsx(Typography,{variant:"caption",children:"PM"})})]})]})}function getClockNumberUtilityClass(e){return generateUtilityClass("MuiClockNumber",e)}const clockNumberClasses=generateUtilityClasses("MuiClockNumber",["root","selected","disabled"]),_excluded$9=["className","disabled","index","inner","label","selected"],useUtilityClasses$5=e=>{const{classes:t,selected:a,disabled:s}=e;return composeClasses({root:["root",a&&"selected",s&&"disabled"]},getClockNumberUtilityClass,t)},ClockNumberRoot=styled("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${clockNumberClasses.disabled}`]:t.disabled},{[`&.${clockNumberClasses.selected}`]:t.selected}]})(({theme:e,ownerState:t})=>_extends$6({height:CLOCK_HOUR_WIDTH,width:CLOCK_HOUR_WIDTH,position:"absolute",left:`calc((100% - ${CLOCK_HOUR_WIDTH}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:e.palette.text.primary,fontFamily:e.typography.fontFamily,"&:focused":{backgroundColor:e.palette.background.paper},[`&.${clockNumberClasses.selected}`]:{color:e.palette.primary.contrastText},[`&.${clockNumberClasses.disabled}`]:{pointerEvents:"none",color:e.palette.text.disabled}},t.inner&&_extends$6({},e.typography.body2,{color:e.palette.text.secondary})));function ClockNumber(e){const t=useThemeProps({props:e,name:"MuiClockNumber"}),{className:a,disabled:s,index:n,inner:i,label:o,selected:u}=t,l=_objectWithoutPropertiesLoose$3(t,_excluded$9),c=t,_=useUtilityClasses$5(c),p=n%12/12*Math.PI*2-Math.PI/2,d=(CLOCK_WIDTH-CLOCK_HOUR_WIDTH-2)/2*(i?.65:1),E=Math.round(Math.cos(p)*d),R=Math.round(Math.sin(p)*d);return jsxRuntimeExports.jsx(ClockNumberRoot,_extends$6({className:clsx(a,_.root),"aria-disabled":s?!0:void 0,"aria-selected":u?!0:void 0,role:"option",style:{transform:`translate(${E}px, ${R+(CLOCK_WIDTH-CLOCK_HOUR_WIDTH)/2}px`},ownerState:c},l,{children:o}))}const getHourNumbers=({ampm:e,date:t,getClockNumberText:a,isDisabled:s,selectedId:n,utils:i})=>{const o=t?i.getHours(t):null,u=[],l=e?1:0,c=e?12:23,_=p=>o===null?!1:e?p===12?o===12||o===0:o===p||o-12===p:o===p;for(let p=l;p<=c;p+=1){let d=p.toString();p===0&&(d="00");const E=!e&&(p===0||p>12);d=i.formatNumber(d);const R=_(p);u.push(jsxRuntimeExports.jsx(ClockNumber,{id:R?n:void 0,index:p,inner:E,selected:R,disabled:s(p),label:d,"aria-label":a(d)},p))}return u},getMinutesNumbers=({utils:e,value:t,isDisabled:a,getClockNumberText:s,selectedId:n})=>{const i=e.formatNumber;return[[5,i("05")],[10,i("10")],[15,i("15")],[20,i("20")],[25,i("25")],[30,i("30")],[35,i("35")],[40,i("40")],[45,i("45")],[50,i("50")],[55,i("55")],[0,i("00")]].map(([o,u],l)=>{const c=o===t;return jsxRuntimeExports.jsx(ClockNumber,{label:u,id:c?n:void 0,index:l+1,inner:!1,disabled:a(o),selected:c,"aria-label":s(u)},o)})};function getClockPickerUtilityClass(e){return generateUtilityClass("MuiClockPicker",e)}generateUtilityClasses("MuiClockPicker",["root","arrowSwitcher"]);const useUtilityClasses$4=e=>{const{classes:t}=e;return composeClasses({root:["root"],arrowSwitcher:["arrowSwitcher"]},getClockPickerUtilityClass,t)},ClockPickerRoot=styled(PickerViewRoot,{name:"MuiClockPicker",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column"}),ClockPickerArrowSwitcher=styled(PickersArrowSwitcher,{name:"MuiClockPicker",slot:"ArrowSwitcher",overridesResolver:(e,t)=>t.arrowSwitcher})({position:"absolute",right:12,top:15}),deprecatedPropsWarning=buildDeprecatedPropsWarning(),ClockPicker=reactExports.forwardRef(function e(t,a){const s=useThemeProps({props:t,name:"MuiClockPicker"}),{ampm:n=!1,ampmInClock:i=!1,autoFocus:o,components:u,componentsProps:l,date:c,disableIgnoringDatePartForTimeValidation:_,getClockLabelText:p,getHoursClockNumberText:d,getMinutesClockNumberText:E,getSecondsClockNumberText:R,leftArrowButtonText:y,maxTime:I,minTime:A,minutesStep:x=1,rightArrowButtonText:g,shouldDisableTime:T,showViewSwitcher:O,onChange:C,view:U,views:L=["hours","minutes"],openTo:j,onViewChange:X,className:B,disabled:H,readOnly:W}=s;deprecatedPropsWarning({leftArrowButtonText:y,rightArrowButtonText:g,getClockLabelText:p,getHoursClockNumberText:d,getMinutesClockNumberText:E,getSecondsClockNumberText:R});const K=useLocaleText(),b=y??K.openPreviousView,k=g??K.openNextView,F=p??K.clockLabelText,N=d??K.hoursClockNumberText,M=E??K.minutesClockNumberText,G=R??K.secondsClockNumberText,{openView:V,setOpenView:ee,nextView:ae,previousView:ne,handleChangeAndOpenNext:J}=useViews({view:U,views:L,openTo:j,onViewChange:X,onChange:C}),ue=useNow(),oe=useUtils(),_e=reactExports.useMemo(()=>c||oe.setSeconds(oe.setMinutes(oe.setHours(ue,0),0),0),[c,ue,oe]),{meridiemMode:Y,handleMeridiemChange:Z}=useMeridiemMode(_e,n,J),te=reactExports.useCallback((me,ve)=>{const Ae=createIsAfterIgnoreDatePart(_,oe),ce=({start:Te,end:re})=>!(A&&Ae(A,re)||I&&Ae(Te,I)),Se=(Te,re=1)=>Te%re!==0?!1:T?!T(Te,ve):!0;switch(ve){case"hours":{const Te=convertValueToMeridiem(me,Y,n),re=oe.setHours(_e,Te),le=oe.setSeconds(oe.setMinutes(re,0),0),pe=oe.setSeconds(oe.setMinutes(re,59),59);return!ce({start:le,end:pe})||!Se(Te)}case"minutes":{const Te=oe.setMinutes(_e,me),re=oe.setSeconds(Te,0),le=oe.setSeconds(Te,59);return!ce({start:re,end:le})||!Se(me,x)}case"seconds":{const Te=oe.setSeconds(_e,me);return!ce({start:Te,end:Te})||!Se(me)}default:throw new Error("not supported")}},[n,_e,_,I,Y,A,x,T,oe]),q=useId(),Q=reactExports.useMemo(()=>{switch(V){case"hours":return{onChange:(ve,Ae)=>{const ce=convertValueToMeridiem(ve,Y,n);J(oe.setHours(_e,ce),Ae)},value:oe.getHours(_e),children:getHourNumbers({date:c,utils:oe,ampm:n,getClockNumberText:N,isDisabled:ve=>H||te(ve,"hours"),selectedId:q})};case"minutes":{const me=oe.getMinutes(_e);return{value:me,onChange:(Ae,ce)=>{J(oe.setMinutes(_e,Ae),ce)},children:getMinutesNumbers({utils:oe,value:me,getClockNumberText:M,isDisabled:Ae=>H||te(Ae,"minutes"),selectedId:q})}}case"seconds":{const me=oe.getSeconds(_e);return{value:me,onChange:(Ae,ce)=>{J(oe.setSeconds(_e,Ae),ce)},children:getMinutesNumbers({utils:oe,value:me,getClockNumberText:G,isDisabled:Ae=>H||te(Ae,"seconds"),selectedId:q})}}default:throw new Error("You must provide the type for ClockView")}},[V,oe,c,n,N,M,G,Y,J,_e,te,q,H]),se=s,fe=useUtilityClasses$4(se);return jsxRuntimeExports.jsxs(ClockPickerRoot,{ref:a,className:clsx(fe.root,B),ownerState:se,children:[O&&jsxRuntimeExports.jsx(ClockPickerArrowSwitcher,{className:fe.arrowSwitcher,leftArrowButtonText:b,rightArrowButtonText:k,components:u,componentsProps:l,onLeftClick:()=>ee(ne),onRightClick:()=>ee(ae),isLeftDisabled:!ne,isRightDisabled:!ae,ownerState:se}),jsxRuntimeExports.jsx(Clock,_extends$6({autoFocus:o,date:c,ampmInClock:i,type:V,ampm:n,getClockLabelText:F,minutesStep:x,isTimeDisabled:te,meridiemMode:Y,handleMeridiemChange:Z,selectedId:q,disabled:H,readOnly:W},Q))]})}),isYearOnlyView=e=>e.length===1&&e[0]==="year",isYearAndMonthViews=e=>e.length===2&&e.indexOf("month")!==-1&&e.indexOf("year")!==-1,getFormatAndMaskByViews=(e,t)=>isYearOnlyView(e)?{inputFormat:t.formats.year}:isYearAndMonthViews(e)?{disableMaskedInput:!0,inputFormat:t.formats.monthAndYear}:{inputFormat:t.formats.keyboardDate};function useDatePickerDefaultizedProps(e,t){var a;const s=useUtils(),n=useDefaultDates(),i=useThemeProps({props:e,name:t}),o=(a=i.views)!=null?a:["year","day"];return _extends$6({openTo:"day",disableFuture:!1,disablePast:!1},getFormatAndMaskByViews(o,s),i,{views:o,minDate:parseNonNullablePickerDate(s,i.minDate,n.minDate),maxDate:parseNonNullablePickerDate(s,i.maxDate,n.maxDate)})}const datePickerValueManager={emptyValue:null,getTodayValue:e=>e.date(),parseInput:parsePickerInputValue,areValuesEqual:(e,t,a)=>e.isEqual(t,a)};function getPickersToolbarUtilityClass(e){return generateUtilityClass("MuiPickersToolbar",e)}const pickersToolbarClasses=generateUtilityClasses("MuiPickersToolbar",["root","content","penIconButton","penIconButtonLandscape"]),useUtilityClasses$3=e=>{const{classes:t,isLandscape:a}=e;return composeClasses({root:["root"],content:["content"],penIconButton:["penIconButton",a&&"penIconButtonLandscape"]},getPickersToolbarUtilityClass,t)},PickersToolbarRoot=styled("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>_extends$6({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3)},t.isLandscape&&{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"})),PickersToolbarContent=styled(Grid$1,{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})(({ownerState:e})=>_extends$6({flex:1},!e.isLandscape&&{alignItems:"center"})),PickersToolbarPenIconButton=styled(IconButton,{name:"MuiPickersToolbar",slot:"PenIconButton",overridesResolver:(e,t)=>[{[`&.${pickersToolbarClasses.penIconButtonLandscape}`]:t.penIconButtonLandscape},t.penIconButton]})({}),getViewTypeIcon=e=>e==="clock"?jsxRuntimeExports.jsx(Clock$1,{color:"inherit"}):jsxRuntimeExports.jsx(Calendar,{color:"inherit"}),PickersToolbar=reactExports.forwardRef(function e(t,a){const s=useThemeProps({props:t,name:"MuiPickersToolbar"}),{children:n,className:i,getMobileKeyboardInputViewButtonText:o,isLandscape:u,isMobileKeyboardViewOpen:l,landscapeDirection:c="column",toggleMobileKeyboardView:_,toolbarTitle:p,viewType:d="calendar"}=s,E=s,R=useLocaleText(),y=useUtilityClasses$3(E);return jsxRuntimeExports.jsxs(PickersToolbarRoot,{ref:a,className:clsx(y.root,i),ownerState:E,children:[jsxRuntimeExports.jsx(Typography,{color:"text.secondary",variant:"overline",children:p}),jsxRuntimeExports.jsxs(PickersToolbarContent,{container:!0,justifyContent:"space-between",className:y.content,ownerState:E,direction:u?c:"row",alignItems:u?"flex-start":"flex-end",children:[n,jsxRuntimeExports.jsx(PickersToolbarPenIconButton,{onClick:_,className:y.penIconButton,ownerState:E,color:"inherit","aria-label":o?o(l,d):R.inputModeToggleButtonAriaLabel(l,d),children:l?getViewTypeIcon(d):jsxRuntimeExports.jsx(Pen,{color:"inherit"})})]})]})});function getDatePickerToolbarUtilityClass(e){return generateUtilityClass("MuiDatePickerToolbar",e)}generateUtilityClasses("MuiDatePickerToolbar",["root","title"]);const _excluded$8=["parsedValue","isLandscape","isMobileKeyboardViewOpen","onChange","toggleMobileKeyboardView","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],useUtilityClasses$2=e=>{const{classes:t}=e;return composeClasses({root:["root"],title:["title"]},getDatePickerToolbarUtilityClass,t)},DatePickerToolbarRoot=styled(PickersToolbar,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),DatePickerToolbarTitle=styled(Typography,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(e,t)=>t.title})(({ownerState:e})=>_extends$6({},e.isLandscape&&{margin:"auto 16px auto auto"})),DatePickerToolbar=reactExports.forwardRef(function e(t,a){const s=useThemeProps({props:t,name:"MuiDatePickerToolbar"}),{parsedValue:n,isLandscape:i,isMobileKeyboardViewOpen:o,toggleMobileKeyboardView:u,toolbarFormat:l,toolbarPlaceholder:c="––",toolbarTitle:_,views:p}=s,d=_objectWithoutPropertiesLoose$3(s,_excluded$8),E=useUtils(),R=useLocaleText(),y=useUtilityClasses$2(s),I=_??R.datePickerDefaultToolbarTitle,A=reactExports.useMemo(()=>n?l?E.formatByString(n,l):isYearOnlyView(p)?E.format(n,"year"):isYearAndMonthViews(p)?E.format(n,"month"):/en/.test(E.getCurrentLocaleCode())?E.format(n,"normalDateWithWeekday"):E.format(n,"normalDate"):c,[n,l,c,E,p]),x=s;return jsxRuntimeExports.jsx(DatePickerToolbarRoot,_extends$6({ref:a,toolbarTitle:I,isMobileKeyboardViewOpen:o,toggleMobileKeyboardView:u,isLandscape:i,className:y.root},d,{children:jsxRuntimeExports.jsx(DatePickerToolbarTitle,{variant:"h4",align:i?"left":"center",ownerState:x,className:y.title,children:A})}))}),_excluded$7=["onAccept","onClear","onCancel","onSetToday","actions"],PickersActionBar=e=>{const{onAccept:t,onClear:a,onCancel:s,onSetToday:n,actions:i}=e,o=_objectWithoutPropertiesLoose$3(e,_excluded$7),u=reactExports.useContext(WrapperVariantContext),l=useLocaleText(),c=typeof i=="function"?i(u):i;if(c==null||c.length===0)return null;const _=c==null?void 0:c.map(p=>{switch(p){case"clear":return jsxRuntimeExports.jsx(Button,{onClick:a,children:l.clearButtonLabel},p);case"cancel":return jsxRuntimeExports.jsx(Button,{onClick:s,children:l.cancelButtonLabel},p);case"accept":return jsxRuntimeExports.jsx(Button,{onClick:t,children:l.okButtonLabel},p);case"today":return jsxRuntimeExports.jsx(Button,{onClick:n,children:l.todayButtonLabel},p);default:return null}});return jsxRuntimeExports.jsx(DialogActions,_extends$6({},o,{children:_}))};function getPickersPopperUtilityClass(e){return generateUtilityClass("MuiPickersPopper",e)}generateUtilityClasses("MuiPickersPopper",["root","paper"]);const _excluded$6=["onClick","onTouchStart"],useUtilityClasses$1=e=>{const{classes:t}=e;return composeClasses({root:["root"],paper:["paper"]},getPickersPopperUtilityClass,t)},PickersPopperRoot=styled(Popper,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({zIndex:e.zIndex.modal})),PickersPopperPaper=styled(Paper,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({ownerState:e})=>_extends$6({transformOrigin:"top center",outline:0},e.placement==="top"&&{transformOrigin:"bottom center"}));function clickedRootScrollbar(e,t){return t.documentElement.clientWidth{if(!e)return;function l(){i.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),i.current=!1}},[e]);const o=useEventCallback$1(l=>{if(!i.current)return;const c=s.current;s.current=!1;const _=ownerDocument(n.current);if(!n.current||"clientX"in l&&clickedRootScrollbar(l,_))return;if(a.current){a.current=!1;return}let p;l.composedPath?p=l.composedPath().indexOf(n.current)>-1:p=!_.documentElement.contains(l.target)||n.current.contains(l.target),!p&&!c&&t(l)}),u=()=>{s.current=!0};return reactExports.useEffect(()=>{if(e){const l=ownerDocument(n.current),c=()=>{a.current=!0};return l.addEventListener("touchstart",o),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",o),l.removeEventListener("touchmove",c)}}},[e,o]),reactExports.useEffect(()=>{if(e){const l=ownerDocument(n.current);return l.addEventListener("click",o),()=>{l.removeEventListener("click",o),s.current=!1}}},[e,o]),[n,u,u]}function PickersPopper(e){var t;const a=useThemeProps({props:e,name:"MuiPickersPopper"}),{anchorEl:s,children:n,containerRef:i=null,onBlur:o,onClose:u,onClear:l,onAccept:c,onCancel:_,onSetToday:p,open:d,PopperProps:E,role:R,TransitionComponent:y=Grow,TrapFocusProps:I,PaperProps:A={},components:x,componentsProps:g}=a;reactExports.useEffect(()=>{function M(G){d&&(G.key==="Escape"||G.key==="Esc")&&u()}return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[u,d]);const T=reactExports.useRef(null);reactExports.useEffect(()=>{R!=="tooltip"&&(d?T.current=getActiveElement(document):T.current&&T.current instanceof HTMLElement&&setTimeout(()=>{T.current instanceof HTMLElement&&T.current.focus()}))},[d,R]);const[O,C,U]=useClickAwayListener(d,o??u),L=reactExports.useRef(null),j=useForkRef(L,i),X=useForkRef(j,O),B=a,H=useUtilityClasses$1(B),{onClick:W,onTouchStart:K}=A,b=_objectWithoutPropertiesLoose$3(A,_excluded$6),k=M=>{M.key==="Escape"&&(M.stopPropagation(),u())},F=(t=x==null?void 0:x.ActionBar)!=null?t:PickersActionBar,N=(x==null?void 0:x.PaperContent)||reactExports.Fragment;return jsxRuntimeExports.jsx(PickersPopperRoot,_extends$6({transition:!0,role:R,open:d,anchorEl:s,onKeyDown:k,className:H.root},E,{children:({TransitionProps:M,placement:G})=>jsxRuntimeExports.jsx(FocusTrap,_extends$6({open:d,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:R==="tooltip",isEnabled:()=>!0},I,{children:jsxRuntimeExports.jsx(y,_extends$6({},M,{children:jsxRuntimeExports.jsx(PickersPopperPaper,_extends$6({tabIndex:-1,elevation:8,ref:X,onClick:V=>{C(V),W&&W(V)},onTouchStart:V=>{U(V),K&&K(V)},ownerState:_extends$6({},B,{placement:G}),className:H.paper},b,{children:jsxRuntimeExports.jsxs(N,_extends$6({},g==null?void 0:g.paperContent,{children:[n,jsxRuntimeExports.jsx(F,_extends$6({onAccept:c,onClear:l,onCancel:_,onSetToday:p,actions:[]},g==null?void 0:g.actionBar))]}))}))}))}))}))}function DesktopWrapper(e){const{children:t,DateInputProps:a,KeyboardDateInputComponent:s,onClear:n,onDismiss:i,onCancel:o,onAccept:u,onSetToday:l,open:c,PopperProps:_,PaperProps:p,TransitionComponent:d,components:E,componentsProps:R}=e,y=reactExports.useRef(null),I=useForkRef(a.inputRef,y);return jsxRuntimeExports.jsxs(WrapperVariantContext.Provider,{value:"desktop",children:[jsxRuntimeExports.jsx(s,_extends$6({},a,{inputRef:I})),jsxRuntimeExports.jsx(PickersPopper,{role:"dialog",open:c,anchorEl:y.current,TransitionComponent:d,PopperProps:_,PaperProps:p,onClose:i,onCancel:o,onClear:n,onAccept:u,onSetToday:l,components:E,componentsProps:R,children:t})]})}const useRifm=e=>{const[,t]=reactExports.useReducer(l=>l+1,0),a=reactExports.useRef(null),{replace:s,append:n}=e,i=s?s(e.format(e.value)):e.format(e.value),o=reactExports.useRef(!1),u=l=>{const c=l.target.value;a.current=[c,l.target,c.length>i.length,o.current,i===e.format(c)],t()};return reactExports.useLayoutEffect(()=>{if(a.current==null)return;let[l,c,_,p,d]=a.current;a.current=null;const E=p&&d,y=l.slice(c.selectionStart).search(e.accept||/\d/g),I=y!==-1?y:0,A=C=>(C.match(e.accept||/\d/g)||[]).join(""),x=A(l.substr(0,c.selectionStart)),g=C=>{let U=0,L=0;for(let j=0;j!==x.length;++j){let X=C.indexOf(x[j],U)+1,B=A(C).indexOf(x[j],L)+1;B-L>1&&(X=U,B=L),L=Math.max(B,L),U=Math.max(U,X)}return U};if(e.mask===!0&&_&&!d){let C=g(l);const U=A(l.substr(C))[0];C=l.indexOf(U,C),l=`${l.substr(0,C)}${l.substr(C+1)}`}let T=e.format(l);n!=null&&c.selectionStart===l.length&&!d&&(_?T=n(T):A(T.slice(-1))===""&&(T=T.slice(0,-1)));const O=s?s(T):T;return i===O?t():e.onChange(O),()=>{let C=g(T);if(e.mask!=null&&(_||p&&!E))for(;T[C]&&A(T[C])==="";)C+=1;c.selectionStart=c.selectionEnd=C+(E?1+I:0)}}),reactExports.useEffect(()=>{const l=_=>{_.code==="Delete"&&(o.current=!0)},c=_=>{_.code==="Delete"&&(o.current=!1)};return document.addEventListener("keydown",l),document.addEventListener("keyup",c),()=>{document.removeEventListener("keydown",l),document.removeEventListener("keyup",c)}},[]),{value:a.current!=null?a.current[0]:i,onChange:u}},getDisplayDate=(e,t,a)=>{const s=e.date(t);return t===null?"":e.isValid(s)?e.formatByString(s,a):""},MASK_USER_INPUT_SYMBOL="_",staticDateWith2DigitTokens="2019-11-21T22:30:00.000",staticDateWith1DigitTokens="2019-01-01T09:00:00.000";function getMaskFromCurrentFormat(e,t,a,s){if(e)return e;const i=s.formatByString(s.date(staticDateWith1DigitTokens),t).replace(a,MASK_USER_INPUT_SYMBOL),o=s.formatByString(s.date(staticDateWith2DigitTokens),t).replace(a,"_");return i===o?i:""}function checkMaskIsValidForCurrentFormat(e,t,a,s){if(!e)return!1;const i=s.formatByString(s.date(staticDateWith1DigitTokens),t).replace(a,MASK_USER_INPUT_SYMBOL),o=s.formatByString(s.date(staticDateWith2DigitTokens),t).replace(a,"_"),u=o===i&&e===o;return!u&&s.lib,u}const maskedDateFormatter=(e,t)=>a=>{let s=0;return a.split("").map((n,i)=>{if(t.lastIndex=0,s>e.length-1)return"";const o=e[s],u=e[s+1],l=t.test(n)?n:"",c=o===MASK_USER_INPUT_SYMBOL?l:o+l;return s+=c.length,i===a.length-1&&u&&u!==MASK_USER_INPUT_SYMBOL?c?c+u:"":c}).join("")},useMaskedInput=({acceptRegex:e=/[\d]/gi,disabled:t,disableMaskedInput:a,ignoreInvalidInputs:s,inputFormat:n,inputProps:i,label:o,mask:u,onChange:l,rawValue:c,readOnly:_,rifmFormatter:p,TextFieldProps:d,validationError:E})=>{const R=useUtils(),y=R.getFormatHelperText(n),{shouldUseMaskedInput:I,maskToUse:A}=reactExports.useMemo(()=>{if(a)return{shouldUseMaskedInput:!1,maskToUse:""};const K=getMaskFromCurrentFormat(u,n,e,R);return{shouldUseMaskedInput:checkMaskIsValidForCurrentFormat(K,n,e,R),maskToUse:K}},[e,a,n,u,R]),x=reactExports.useMemo(()=>I&&A?maskedDateFormatter(A,e):K=>K,[e,A,I]),g=c===null?null:R.date(c),[T,O]=reactExports.useState(g),[C,U]=reactExports.useState(getDisplayDate(R,c,n)),L=reactExports.useRef(),j=reactExports.useRef(R.locale),X=reactExports.useRef(n);reactExports.useEffect(()=>{const K=c!==L.current,b=R.locale!==j.current,k=n!==X.current;if(L.current=c,j.current=R.locale,X.current=n,!K&&!b&&!k)return;const F=c===null?null:R.date(c),N=c===null||R.isValid(F);let M=T===null&&F===null;if(T!==null&&F!==null){const V=R.isEqual(T,F);if(V)M=!0;else{const ee=Math.abs(R.getDiff(T,F));M=ee===0?V:ee<1e3}}if(!b&&!k&&(!N||M))return;const G=getDisplayDate(R,c,n);O(F),U(G)},[R,c,n,T]);const B=K=>{const b=K===""||K===u?"":K;U(b);const k=b===null?null:R.parse(b,n);s&&!R.isValid(k)||(O(k),l(k,b||void 0))},H=useRifm({value:C,onChange:B,format:p||x});return _extends$6({label:o,disabled:t,error:E,inputProps:_extends$6({},I?H:{value:C,onChange:K=>{B(K.currentTarget.value)}},{disabled:t,placeholder:y,readOnly:_,type:I?"tel":"text"},i)},d)},_excluded$5=["className","components","disableOpenPicker","getOpenDialogAriaText","InputAdornmentProps","InputProps","inputRef","openPicker","OpenPickerButtonProps","renderInput"],KeyboardDateInput=reactExports.forwardRef(function e(t,a){const{className:s,components:n={},disableOpenPicker:i,getOpenDialogAriaText:o,InputAdornmentProps:u,InputProps:l,inputRef:c,openPicker:_,OpenPickerButtonProps:p,renderInput:d}=t,E=_objectWithoutPropertiesLoose$3(t,_excluded$5),R=useLocaleText(),y=o??R.openDatePickerDialogue,I=useUtils(),A=useMaskedInput(E),x=(u==null?void 0:u.position)||"end",g=n.OpenPickerIcon||Calendar;return d(_extends$6({ref:a,inputRef:c,className:s},A,{InputProps:_extends$6({},l,{[`${x}Adornment`]:i?void 0:jsxRuntimeExports.jsx(InputAdornment,_extends$6({position:x},u,{children:jsxRuntimeExports.jsx(IconButton,_extends$6({edge:x,disabled:E.disabled||E.readOnly,"aria-label":y(E.rawValue,I)},p,{onClick:_,children:jsxRuntimeExports.jsx(g,{})}))}))})}))});function getOrientation(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const useIsLandscape=(e,t)=>{const[a,s]=reactExports.useState(getOrientation);return useEnhancedEffect(()=>{const i=()=>{s(getOrientation())};return window.addEventListener("orientationchange",i),()=>{window.removeEventListener("orientationchange",i)}},[]),arrayIncludes(e,["hours","minutes","seconds"])?!1:(t||a)==="landscape"},useFocusManagement=({autoFocus:e,openView:t})=>{const[a,s]=reactExports.useState(e?t:null),n=reactExports.useCallback(i=>o=>{s(o?i:u=>i===u?null:u)},[]);return{focusedView:a,setFocusedView:n}};function getCalendarOrClockPickerUtilityClass(e){return generateUtilityClass("MuiCalendarOrClockPicker",e)}generateUtilityClasses("MuiCalendarOrClockPicker",["root","mobileKeyboardInputView"]);const _excluded$4=["autoFocus","className","parsedValue","DateInputProps","isMobileKeyboardViewOpen","onDateChange","onViewChange","openTo","orientation","showToolbar","toggleMobileKeyboardView","ToolbarComponent","toolbarFormat","toolbarPlaceholder","toolbarTitle","views","dateRangeIcon","timeIcon","hideTabs","classes"],useUtilityClasses=e=>{const{classes:t}=e;return composeClasses({root:["root"],mobileKeyboardInputView:["mobileKeyboardInputView"]},getCalendarOrClockPickerUtilityClass,t)},MobileKeyboardInputView=styled("div",{name:"MuiCalendarOrClockPicker",slot:"MobileKeyboardInputView",overridesResolver:(e,t)=>t.mobileKeyboardInputView})({padding:"16px 24px"}),PickerRoot=styled("div",{name:"MuiCalendarOrClockPicker",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e})=>_extends$6({display:"flex",flexDirection:"column"},e.isLandscape&&{flexDirection:"row"})),MobileKeyboardTextFieldProps={fullWidth:!0},isDatePickerView=e=>e==="year"||e==="month"||e==="day",isTimePickerView=e=>e==="hours"||e==="minutes"||e==="seconds";function CalendarOrClockPicker(e){var t,a;const s=useThemeProps({props:e,name:"MuiCalendarOrClockPicker"}),{autoFocus:n,parsedValue:i,DateInputProps:o,isMobileKeyboardViewOpen:u,onDateChange:l,onViewChange:c,openTo:_,orientation:p,showToolbar:d,toggleMobileKeyboardView:E,ToolbarComponent:R=()=>null,toolbarFormat:y,toolbarPlaceholder:I,toolbarTitle:A,views:x,dateRangeIcon:g,timeIcon:T,hideTabs:O}=s,C=_objectWithoutPropertiesLoose$3(s,_excluded$4),U=(t=C.components)==null?void 0:t.Tabs,L=useIsLandscape(x,p),j=reactExports.useContext(WrapperVariantContext),X=useUtilityClasses(s),B=d??j!=="desktop",H=!O&&typeof window<"u"&&window.innerHeight>667,W=reactExports.useCallback((G,V)=>{l(G,j,V)},[l,j]),K=reactExports.useCallback(G=>{u&&E(),c&&c(G)},[u,c,E]),{openView:b,setOpenView:k,handleChangeAndOpenNext:F}=useViews({view:void 0,views:x,openTo:_,onChange:W,onViewChange:K}),{focusedView:N,setFocusedView:M}=useFocusManagement({autoFocus:n,openView:b});return jsxRuntimeExports.jsxs(PickerRoot,{ownerState:{isLandscape:L},className:X.root,children:[B&&jsxRuntimeExports.jsx(R,_extends$6({},C,{views:x,isLandscape:L,parsedValue:i,onChange:W,setOpenView:k,openView:b,toolbarTitle:A,toolbarFormat:y,toolbarPlaceholder:I,isMobileKeyboardViewOpen:u,toggleMobileKeyboardView:E})),H&&!!U&&jsxRuntimeExports.jsx(U,_extends$6({dateRangeIcon:g,timeIcon:T,view:b,onChange:k},(a=C.componentsProps)==null?void 0:a.tabs)),jsxRuntimeExports.jsx(PickerViewRoot,{children:u?jsxRuntimeExports.jsx(MobileKeyboardInputView,{className:X.mobileKeyboardInputView,children:jsxRuntimeExports.jsx(KeyboardDateInput,_extends$6({},o,{ignoreInvalidInputs:!0,disableOpenPicker:!0,TextFieldProps:MobileKeyboardTextFieldProps}))}):jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[isDatePickerView(b)&&jsxRuntimeExports.jsx(CalendarPicker,_extends$6({autoFocus:n,date:i,onViewChange:k,onChange:F,view:b,views:x.filter(isDatePickerView),focusedView:N,onFocusedViewChange:M},C)),isTimePickerView(b)&&jsxRuntimeExports.jsx(ClockPicker,_extends$6({},C,{autoFocus:n,date:i,view:b,views:x.filter(isTimePickerView),onChange:F,onViewChange:k,showViewSwitcher:j==="desktop"}))]})})]})}const useOpenState=({open:e,onOpen:t,onClose:a})=>{const s=reactExports.useRef(typeof e=="boolean").current,[n,i]=reactExports.useState(!1);reactExports.useEffect(()=>{if(s){if(typeof e!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");i(e)}},[s,e]);const o=reactExports.useCallback(u=>{s||i(u),u&&t&&t(),!u&&a&&a()},[s,t,a]);return{isOpen:n,setIsOpen:o}},usePickerState=(e,t)=>{const{onAccept:a,onChange:s,value:n,closeOnSelect:i}=e,o=useUtils(),{isOpen:u,setIsOpen:l}=useOpenState(e),c=reactExports.useMemo(()=>t.parseInput(o,n),[t,o,n]),[_,p]=reactExports.useState(c),[d,E]=reactExports.useState(()=>({committed:c,draft:c,resetFallback:c})),R=reactExports.useCallback(C=>{E(U=>{switch(C.action){case"setAll":case"acceptAndClose":return{draft:C.value,committed:C.value,resetFallback:C.value};case"setCommitted":return _extends$6({},U,{draft:C.value,committed:C.value});case"setDraft":return _extends$6({},U,{draft:C.value});default:return U}}),(C.forceOnChangeCall||!C.skipOnChangeCall&&!t.areValuesEqual(o,d.committed,C.value))&&s(C.value),C.action==="acceptAndClose"&&(l(!1),a&&!t.areValuesEqual(o,d.resetFallback,C.value)&&a(C.value))},[a,s,l,d,o,t]);reactExports.useEffect(()=>{o.isValid(c)&&p(c)},[o,c]),reactExports.useEffect(()=>{u&&R({action:"setAll",value:c,skipOnChangeCall:!0})},[u]),t.areValuesEqual(o,d.committed,c)||R({action:"setCommitted",value:c,skipOnChangeCall:!0});const y=reactExports.useMemo(()=>({open:u,onClear:()=>{R({value:t.emptyValue,action:"acceptAndClose",forceOnChangeCall:!t.areValuesEqual(o,n,t.emptyValue)})},onAccept:()=>{R({value:d.draft,action:"acceptAndClose",forceOnChangeCall:!t.areValuesEqual(o,n,c)})},onDismiss:()=>{R({value:d.committed,action:"acceptAndClose"})},onCancel:()=>{R({value:d.resetFallback,action:"acceptAndClose"})},onSetToday:()=>{R({value:t.getTodayValue(o),action:"acceptAndClose"})}}),[R,u,o,d,t,n,c]),[I,A]=reactExports.useState(!1),x=reactExports.useMemo(()=>({parsedValue:d.draft,isMobileKeyboardViewOpen:I,toggleMobileKeyboardView:()=>A(!I),onDateChange:(C,U,L="partial")=>{switch(L){case"shallow":return R({action:"setDraft",value:C,skipOnChangeCall:!0});case"partial":return R({action:"setDraft",value:C});case"finish":return R(i??U==="desktop"?{value:C,action:"acceptAndClose"}:{value:C,action:"setCommitted"});default:throw new Error("MUI: Invalid selectionState passed to `onDateChange`")}}}),[R,I,d.draft,i]),g=reactExports.useCallback((C,U)=>{const L=t.valueReducer?t.valueReducer(o,_,C):C;s(L,U)},[s,t,_,o]),T=reactExports.useMemo(()=>({onChange:g,open:u,rawValue:n,openPicker:()=>l(!0)}),[g,u,n,l]),O={pickerProps:x,inputProps:T,wrapperProps:y};return reactExports.useDebugValue(O,()=>({MuiPickerState:{dateState:d,other:O}})),O},_excluded$3=["onChange","PopperProps","PaperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps"],DesktopDatePicker=reactExports.forwardRef(function e(t,a){const s=useDatePickerDefaultizedProps(t,"MuiDesktopDatePicker"),n=useDateValidation(s)!==null,{pickerProps:i,inputProps:o,wrapperProps:u}=usePickerState(s,datePickerValueManager),{PopperProps:l,PaperProps:c,ToolbarComponent:_=DatePickerToolbar,TransitionComponent:p,components:d,componentsProps:E}=s,R=_objectWithoutPropertiesLoose$3(s,_excluded$3),y=_extends$6({},o,R,{components:d,componentsProps:E,ref:a,validationError:n});return jsxRuntimeExports.jsx(DesktopWrapper,_extends$6({},u,{DateInputProps:y,KeyboardDateInputComponent:KeyboardDateInput,PopperProps:l,PaperProps:c,TransitionComponent:p,components:d,componentsProps:E,children:jsxRuntimeExports.jsx(CalendarOrClockPicker,_extends$6({},i,{autoFocus:!0,toolbarTitle:s.label||s.toolbarTitle,ToolbarComponent:_,DateInputProps:y,components:d,componentsProps:E},R))}))}),PickersModalDialogRoot=styled(Dialog)({[`& .${dialogClasses.container}`]:{outline:0},[`& .${dialogClasses.paper}`]:{outline:0,minWidth:DIALOG_WIDTH}}),PickersModalDialogContent=styled(DialogContent)({"&:first-of-type":{padding:0}}),PickersModalDialog=e=>{var t;const{children:a,DialogProps:s={},onAccept:n,onClear:i,onDismiss:o,onCancel:u,onSetToday:l,open:c,components:_,componentsProps:p}=e,d=(t=_==null?void 0:_.ActionBar)!=null?t:PickersActionBar;return jsxRuntimeExports.jsxs(PickersModalDialogRoot,_extends$6({open:c,onClose:o},s,{children:[jsxRuntimeExports.jsx(PickersModalDialogContent,{children:a}),jsxRuntimeExports.jsx(d,_extends$6({onAccept:n,onClear:i,onCancel:u,onSetToday:l,actions:["cancel","accept"]},p==null?void 0:p.actionBar))]}))},_excluded$2=["children","DateInputProps","DialogProps","onAccept","onClear","onDismiss","onCancel","onSetToday","open","PureDateInputComponent","components","componentsProps"];function MobileWrapper(e){const{children:t,DateInputProps:a,DialogProps:s,onAccept:n,onClear:i,onDismiss:o,onCancel:u,onSetToday:l,open:c,PureDateInputComponent:_,components:p,componentsProps:d}=e,E=_objectWithoutPropertiesLoose$3(e,_excluded$2);return jsxRuntimeExports.jsxs(WrapperVariantContext.Provider,{value:"mobile",children:[jsxRuntimeExports.jsx(_,_extends$6({components:p},E,a)),jsxRuntimeExports.jsx(PickersModalDialog,{DialogProps:s,onAccept:n,onClear:i,onDismiss:o,onCancel:u,onSetToday:l,open:c,components:p,componentsProps:d,children:t})]})}const PureDateInput=reactExports.forwardRef(function e(t,a){const{disabled:s,getOpenDialogAriaText:n,inputFormat:i,InputProps:o,inputRef:u,label:l,openPicker:c,rawValue:_,renderInput:p,TextFieldProps:d={},validationError:E,className:R}=t,y=useLocaleText(),I=n??y.openDatePickerDialogue,A=useUtils(),x=reactExports.useMemo(()=>_extends$6({},o,{readOnly:!0}),[o]),g=getDisplayDate(A,_,i),T=useEventCallback$1(O=>{O.stopPropagation(),c()});return p(_extends$6({label:l,disabled:s,ref:a,inputRef:u,error:E,InputProps:x,className:R},!t.readOnly&&!t.disabled&&{onClick:T},{inputProps:_extends$6({disabled:s,readOnly:!0,"aria-readonly":!0,"aria-label":I(_,A),value:g},!t.readOnly&&{onClick:T},{onKeyDown:onSpaceOrEnter(c)})},d))}),_excluded$1=["ToolbarComponent","value","onChange","components","componentsProps"],MobileDatePicker=reactExports.forwardRef(function e(t,a){const s=useDatePickerDefaultizedProps(t,"MuiMobileDatePicker"),n=useDateValidation(s)!==null,{pickerProps:i,inputProps:o,wrapperProps:u}=usePickerState(s,datePickerValueManager),{ToolbarComponent:l=DatePickerToolbar,components:c,componentsProps:_}=s,p=_objectWithoutPropertiesLoose$3(s,_excluded$1),d=_extends$6({},o,p,{components:c,componentsProps:_,ref:a,validationError:n});return jsxRuntimeExports.jsx(MobileWrapper,_extends$6({},p,u,{DateInputProps:d,PureDateInputComponent:PureDateInput,components:c,componentsProps:_,children:jsxRuntimeExports.jsx(CalendarOrClockPicker,_extends$6({},i,{autoFocus:!0,toolbarTitle:s.label||s.toolbarTitle,ToolbarComponent:l,DateInputProps:d,components:c,componentsProps:_},p))}))}),_excluded=["desktopModeMediaQuery","DialogProps","PopperProps","TransitionComponent"],DatePicker=reactExports.forwardRef(function e(t,a){const s=useThemeProps({props:t,name:"MuiDatePicker"}),{desktopModeMediaQuery:n="@media (pointer: fine)",DialogProps:i,PopperProps:o,TransitionComponent:u}=s,l=_objectWithoutPropertiesLoose$3(s,_excluded);return useMediaQuery(n,{defaultMatches:!0})?jsxRuntimeExports.jsx(DesktopDatePicker,_extends$6({ref:a,PopperProps:o,TransitionComponent:u},l)):jsxRuntimeExports.jsx(MobileDatePicker,_extends$6({ref:a,DialogProps:i},l))}),AppContext=reactExports.createContext(),AppContextProvider=e=>{const[t,a]=reactExports.useState({open:!1,vertical:"top",horizontal:"center",severity:"success",msg:""}),[s,n]=reactExports.useState(moment(new Date).format("YYYY-MM-DD")),[i,o]=reactExports.useState(moment(new Date).format("YYYY-MM-DD")),u=l=>{a({open:!0,...l})};return jsxRuntimeExports.jsx(AppContext.Provider,{value:[u,t,s,n,i,o],children:e.children})};AppContextProvider.propTypes={children:propTypesExports.PropTypes.any};//! moment.js +//! version : 2.30.1 +//! authors : Tim Wood, Iskren Chernev, Moment.js contributors +//! license : MIT +//! momentjs.com +var hookCallback;function hooks(){return hookCallback.apply(null,arguments)}function setHookCallback(e){hookCallback=e}function isArray$c(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function isObject$7(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function hasOwnProp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function isObjectEmpty(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(hasOwnProp(e,t))return!1;return!0}function isUndefined(e){return e===void 0}function isNumber(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function isDate$3(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function map$2(e,t){var a=[],s,n=e.length;for(s=0;s>>0,s;for(s=0;s0)for(a=0;a=0;return(i?a?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+s}var formattingTokens=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,localFormattingTokens=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,formatFunctions={},formatTokenFunctions={};function addFormatToken(e,t,a,s){var n=s;typeof s=="string"&&(n=function(){return this[s]()}),e&&(formatTokenFunctions[e]=n),t&&(formatTokenFunctions[t[0]]=function(){return zeroFill(n.apply(this,arguments),t[1],t[2])}),a&&(formatTokenFunctions[a]=function(){return this.localeData().ordinal(n.apply(this,arguments),e)})}function removeFormattingTokens(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function makeFormatFunction(e){var t=e.match(formattingTokens),a,s;for(a=0,s=t.length;a=0&&localFormattingTokens.test(e);)e=e.replace(localFormattingTokens,s),localFormattingTokens.lastIndex=0,a-=1;return e}var defaultLongDateFormat={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function longDateFormat(e){var t=this._longDateFormat[e],a=this._longDateFormat[e.toUpperCase()];return t||!a?t:(this._longDateFormat[e]=a.match(formattingTokens).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[e])}var defaultInvalidDate="Invalid date";function invalidDate$1(){return this._invalidDate}var defaultOrdinal="%d",defaultDayOfMonthOrdinalParse=/\d{1,2}/;function ordinal(e){return this._ordinal.replace("%d",e)}var defaultRelativeTime={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function relativeTime(e,t,a,s){var n=this._relativeTime[a];return isFunction$5(n)?n(e,t,a,s):n.replace(/%d/i,e)}function pastFuture(e,t){var a=this._relativeTime[e>0?"future":"past"];return isFunction$5(a)?a(t):a.replace(/%s/i,t)}var aliases={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function normalizeUnits(e){return typeof e=="string"?aliases[e]||aliases[e.toLowerCase()]:void 0}function normalizeObjectUnits(e){var t={},a,s;for(s in e)hasOwnProp(e,s)&&(a=normalizeUnits(s),a&&(t[a]=e[s]));return t}var priorities={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function getPrioritizedUnits(e){var t=[],a;for(a in e)hasOwnProp(e,a)&&t.push({unit:a,priority:priorities[a]});return t.sort(function(s,n){return s.priority-n.priority}),t}var match1=/\d/,match2=/\d\d/,match3=/\d{3}/,match4=/\d{4}/,match6=/[+-]?\d{6}/,match1to2=/\d\d?/,match3to4=/\d\d\d\d?/,match5to6=/\d\d\d\d\d\d?/,match1to3=/\d{1,3}/,match1to4=/\d{1,4}/,match1to6=/[+-]?\d{1,6}/,matchUnsigned=/\d+/,matchSigned=/[+-]?\d+/,matchOffset=/Z|[+-]\d\d:?\d\d/gi,matchShortOffset=/Z|[+-]\d\d(?::?\d\d)?/gi,matchTimestamp=/[+-]?\d+(\.\d{1,3})?/,matchWord=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,match1to2NoLeadingZero=/^[1-9]\d?/,match1to2HasZero=/^([1-9]\d|\d)/,regexes;regexes={};function addRegexToken(e,t,a){regexes[e]=isFunction$5(t)?t:function(s,n){return s&&a?a:t}}function getParseRegexForToken(e,t){return hasOwnProp(regexes,e)?regexes[e](t._strict,t._locale):new RegExp(unescapeFormat(e))}function unescapeFormat(e){return regexEscape(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,a,s,n,i){return a||s||n||i}))}function regexEscape(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function absFloor(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function toInt(e){var t=+e,a=0;return t!==0&&isFinite(t)&&(a=absFloor(t)),a}var tokens={};function addParseToken(e,t){var a,s=t,n;for(typeof e=="string"&&(e=[e]),isNumber(t)&&(s=function(i,o){o[t]=toInt(i)}),n=e.length,a=0;a68?1900:2e3)};var getSetYear=makeGetSet("FullYear",!0);function getIsLeapYear(){return isLeapYear$2(this.year())}function makeGetSet(e,t){return function(a){return a!=null?(set$1$1(this,e,a),hooks.updateOffset(this,t),this):get$2(this,e)}}function get$2(e,t){if(!e.isValid())return NaN;var a=e._d,s=e._isUTC;switch(t){case"Milliseconds":return s?a.getUTCMilliseconds():a.getMilliseconds();case"Seconds":return s?a.getUTCSeconds():a.getSeconds();case"Minutes":return s?a.getUTCMinutes():a.getMinutes();case"Hours":return s?a.getUTCHours():a.getHours();case"Date":return s?a.getUTCDate():a.getDate();case"Day":return s?a.getUTCDay():a.getDay();case"Month":return s?a.getUTCMonth():a.getMonth();case"FullYear":return s?a.getUTCFullYear():a.getFullYear();default:return NaN}}function set$1$1(e,t,a){var s,n,i,o,u;if(!(!e.isValid()||isNaN(a))){switch(s=e._d,n=e._isUTC,t){case"Milliseconds":return void(n?s.setUTCMilliseconds(a):s.setMilliseconds(a));case"Seconds":return void(n?s.setUTCSeconds(a):s.setSeconds(a));case"Minutes":return void(n?s.setUTCMinutes(a):s.setMinutes(a));case"Hours":return void(n?s.setUTCHours(a):s.setHours(a));case"Date":return void(n?s.setUTCDate(a):s.setDate(a));case"FullYear":break;default:return}i=a,o=e.month(),u=e.date(),u=u===29&&o===1&&!isLeapYear$2(i)?28:u,n?s.setUTCFullYear(i,o,u):s.setFullYear(i,o,u)}}function stringGet(e){return e=normalizeUnits(e),isFunction$5(this[e])?this[e]():this}function stringSet(e,t){if(typeof e=="object"){e=normalizeObjectUnits(e);var a=getPrioritizedUnits(e),s,n=a.length;for(s=0;s=0?(u=new Date(e+400,t,a,s,n,i,o),isFinite(u.getFullYear())&&u.setFullYear(e)):u=new Date(e,t,a,s,n,i,o),u}function createUTCDate(e){var t,a;return e<100&&e>=0?(a=Array.prototype.slice.call(arguments),a[0]=e+400,t=new Date(Date.UTC.apply(null,a)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function firstWeekOffset(e,t,a){var s=7+t-a,n=(7+createUTCDate(e,0,s).getUTCDay()-t)%7;return-n+s-1}function dayOfYearFromWeeks(e,t,a,s,n){var i=(7+a-s)%7,o=firstWeekOffset(e,s,n),u=1+7*(t-1)+i+o,l,c;return u<=0?(l=e-1,c=daysInYear(l)+u):u>daysInYear(e)?(l=e+1,c=u-daysInYear(e)):(l=e,c=u),{year:l,dayOfYear:c}}function weekOfYear(e,t,a){var s=firstWeekOffset(e.year(),t,a),n=Math.floor((e.dayOfYear()-s-1)/7)+1,i,o;return n<1?(o=e.year()-1,i=n+weeksInYear(o,t,a)):n>weeksInYear(e.year(),t,a)?(i=n-weeksInYear(e.year(),t,a),o=e.year()+1):(o=e.year(),i=n),{week:i,year:o}}function weeksInYear(e,t,a){var s=firstWeekOffset(e,t,a),n=firstWeekOffset(e+1,t,a);return(daysInYear(e)-s+n)/7}addFormatToken("w",["ww",2],"wo","week");addFormatToken("W",["WW",2],"Wo","isoWeek");addRegexToken("w",match1to2,match1to2NoLeadingZero);addRegexToken("ww",match1to2,match2);addRegexToken("W",match1to2,match1to2NoLeadingZero);addRegexToken("WW",match1to2,match2);addWeekParseToken(["w","ww","W","WW"],function(e,t,a,s){t[s.substr(0,1)]=toInt(e)});function localeWeek(e){return weekOfYear(e,this._week.dow,this._week.doy).week}var defaultLocaleWeek={dow:0,doy:6};function localeFirstDayOfWeek(){return this._week.dow}function localeFirstDayOfYear(){return this._week.doy}function getSetWeek(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function getSetISOWeek(e){var t=weekOfYear(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}addFormatToken("d",0,"do","day");addFormatToken("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});addFormatToken("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});addFormatToken("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});addFormatToken("e",0,0,"weekday");addFormatToken("E",0,0,"isoWeekday");addRegexToken("d",match1to2);addRegexToken("e",match1to2);addRegexToken("E",match1to2);addRegexToken("dd",function(e,t){return t.weekdaysMinRegex(e)});addRegexToken("ddd",function(e,t){return t.weekdaysShortRegex(e)});addRegexToken("dddd",function(e,t){return t.weekdaysRegex(e)});addWeekParseToken(["dd","ddd","dddd"],function(e,t,a,s){var n=a._locale.weekdaysParse(e,s,a._strict);n!=null?t.d=n:getParsingFlags(a).invalidWeekday=e});addWeekParseToken(["d","e","E"],function(e,t,a,s){t[s]=toInt(e)});function parseWeekday(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function parseIsoWeekday(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function shiftWeekdays(e,t){return e.slice(t,7).concat(e.slice(0,t))}var defaultLocaleWeekdays="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),defaultLocaleWeekdaysShort="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),defaultLocaleWeekdaysMin="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),defaultWeekdaysRegex=matchWord,defaultWeekdaysShortRegex=matchWord,defaultWeekdaysMinRegex=matchWord;function localeWeekdays(e,t){var a=isArray$c(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?shiftWeekdays(a,this._week.dow):e?a[e.day()]:a}function localeWeekdaysShort(e){return e===!0?shiftWeekdays(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function localeWeekdaysMin(e){return e===!0?shiftWeekdays(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function handleStrictParse$1(e,t,a){var s,n,i,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)i=createUTC([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(i,"").toLocaleLowerCase();return a?t==="dddd"?(n=indexOf.call(this._weekdaysParse,o),n!==-1?n:null):t==="ddd"?(n=indexOf.call(this._shortWeekdaysParse,o),n!==-1?n:null):(n=indexOf.call(this._minWeekdaysParse,o),n!==-1?n:null):t==="dddd"?(n=indexOf.call(this._weekdaysParse,o),n!==-1||(n=indexOf.call(this._shortWeekdaysParse,o),n!==-1)?n:(n=indexOf.call(this._minWeekdaysParse,o),n!==-1?n:null)):t==="ddd"?(n=indexOf.call(this._shortWeekdaysParse,o),n!==-1||(n=indexOf.call(this._weekdaysParse,o),n!==-1)?n:(n=indexOf.call(this._minWeekdaysParse,o),n!==-1?n:null)):(n=indexOf.call(this._minWeekdaysParse,o),n!==-1||(n=indexOf.call(this._weekdaysParse,o),n!==-1)?n:(n=indexOf.call(this._shortWeekdaysParse,o),n!==-1?n:null))}function localeWeekdaysParse(e,t,a){var s,n,i;if(this._weekdaysParseExact)return handleStrictParse$1.call(this,e,t,a);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(n=createUTC([2e3,1]).day(s),a&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(n,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(n,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(n,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(i="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[s]=new RegExp(i.replace(".",""),"i")),a&&t==="dddd"&&this._fullWeekdaysParse[s].test(e))return s;if(a&&t==="ddd"&&this._shortWeekdaysParse[s].test(e))return s;if(a&&t==="dd"&&this._minWeekdaysParse[s].test(e))return s;if(!a&&this._weekdaysParse[s].test(e))return s}}function getSetDayOfWeek(e){if(!this.isValid())return e!=null?this:NaN;var t=get$2(this,"Day");return e!=null?(e=parseWeekday(e,this.localeData()),this.add(e-t,"d")):t}function getSetLocaleDayOfWeek(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function getSetISODayOfWeek(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=parseIsoWeekday(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function weekdaysRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(hasOwnProp(this,"_weekdaysRegex")||(this._weekdaysRegex=defaultWeekdaysRegex),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function weekdaysShortRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(hasOwnProp(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=defaultWeekdaysShortRegex),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function weekdaysMinRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(hasOwnProp(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=defaultWeekdaysMinRegex),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function computeWeekdaysParse(){function e(_,p){return p.length-_.length}var t=[],a=[],s=[],n=[],i,o,u,l,c;for(i=0;i<7;i++)o=createUTC([2e3,1]).day(i),u=regexEscape(this.weekdaysMin(o,"")),l=regexEscape(this.weekdaysShort(o,"")),c=regexEscape(this.weekdays(o,"")),t.push(u),a.push(l),s.push(c),n.push(u),n.push(l),n.push(c);t.sort(e),a.sort(e),s.sort(e),n.sort(e),this._weekdaysRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function hFormat(){return this.hours()%12||12}function kFormat(){return this.hours()||24}addFormatToken("H",["HH",2],0,"hour");addFormatToken("h",["hh",2],0,hFormat);addFormatToken("k",["kk",2],0,kFormat);addFormatToken("hmm",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)});addFormatToken("hmmss",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});addFormatToken("Hmm",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)});addFormatToken("Hmmss",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});function meridiem(e,t){addFormatToken(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}meridiem("a",!0);meridiem("A",!1);function matchMeridiem(e,t){return t._meridiemParse}addRegexToken("a",matchMeridiem);addRegexToken("A",matchMeridiem);addRegexToken("H",match1to2,match1to2HasZero);addRegexToken("h",match1to2,match1to2NoLeadingZero);addRegexToken("k",match1to2,match1to2NoLeadingZero);addRegexToken("HH",match1to2,match2);addRegexToken("hh",match1to2,match2);addRegexToken("kk",match1to2,match2);addRegexToken("hmm",match3to4);addRegexToken("hmmss",match5to6);addRegexToken("Hmm",match3to4);addRegexToken("Hmmss",match5to6);addParseToken(["H","HH"],HOUR);addParseToken(["k","kk"],function(e,t,a){var s=toInt(e);t[HOUR]=s===24?0:s});addParseToken(["a","A"],function(e,t,a){a._isPm=a._locale.isPM(e),a._meridiem=e});addParseToken(["h","hh"],function(e,t,a){t[HOUR]=toInt(e),getParsingFlags(a).bigHour=!0});addParseToken("hmm",function(e,t,a){var s=e.length-2;t[HOUR]=toInt(e.substr(0,s)),t[MINUTE]=toInt(e.substr(s)),getParsingFlags(a).bigHour=!0});addParseToken("hmmss",function(e,t,a){var s=e.length-4,n=e.length-2;t[HOUR]=toInt(e.substr(0,s)),t[MINUTE]=toInt(e.substr(s,2)),t[SECOND]=toInt(e.substr(n)),getParsingFlags(a).bigHour=!0});addParseToken("Hmm",function(e,t,a){var s=e.length-2;t[HOUR]=toInt(e.substr(0,s)),t[MINUTE]=toInt(e.substr(s))});addParseToken("Hmmss",function(e,t,a){var s=e.length-4,n=e.length-2;t[HOUR]=toInt(e.substr(0,s)),t[MINUTE]=toInt(e.substr(s,2)),t[SECOND]=toInt(e.substr(n))});function localeIsPM(e){return(e+"").toLowerCase().charAt(0)==="p"}var defaultLocaleMeridiemParse=/[ap]\.?m?\.?/i,getSetHour=makeGetSet("Hours",!0);function localeMeridiem(e,t,a){return e>11?a?"pm":"PM":a?"am":"AM"}var baseConfig={calendar:defaultCalendar,longDateFormat:defaultLongDateFormat,invalidDate:defaultInvalidDate,ordinal:defaultOrdinal,dayOfMonthOrdinalParse:defaultDayOfMonthOrdinalParse,relativeTime:defaultRelativeTime,months:defaultLocaleMonths,monthsShort:defaultLocaleMonthsShort,week:defaultLocaleWeek,weekdays:defaultLocaleWeekdays,weekdaysMin:defaultLocaleWeekdaysMin,weekdaysShort:defaultLocaleWeekdaysShort,meridiemParse:defaultLocaleMeridiemParse},locales={},localeFamilies={},globalLocale;function commonPrefix(e,t){var a,s=Math.min(e.length,t.length);for(a=0;a0;){if(n=loadLocale(i.slice(0,a).join("-")),n)return n;if(s&&s.length>=a&&commonPrefix(i,s)>=a-1)break;a--}t++}return globalLocale}function isLocaleNameSane(e){return!!(e&&e.match("^[^/\\\\]*$"))}function loadLocale(e){var t=null,a;if(locales[e]===void 0&&typeof module<"u"&&module&&module.exports&&isLocaleNameSane(e))try{t=globalLocale._abbr,a=require,a("./locale/"+e),getSetGlobalLocale(t)}catch{locales[e]=null}return locales[e]}function getSetGlobalLocale(e,t){var a;return e&&(isUndefined(t)?a=getLocale(e):a=defineLocale(e,t),a?globalLocale=a:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),globalLocale._abbr}function defineLocale(e,t){if(t!==null){var a,s=baseConfig;if(t.abbr=e,locales[e]!=null)deprecateSimple("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=locales[e]._config;else if(t.parentLocale!=null)if(locales[t.parentLocale]!=null)s=locales[t.parentLocale]._config;else if(a=loadLocale(t.parentLocale),a!=null)s=a._config;else return localeFamilies[t.parentLocale]||(localeFamilies[t.parentLocale]=[]),localeFamilies[t.parentLocale].push({name:e,config:t}),null;return locales[e]=new Locale(mergeConfigs(s,t)),localeFamilies[e]&&localeFamilies[e].forEach(function(n){defineLocale(n.name,n.config)}),getSetGlobalLocale(e),locales[e]}else return delete locales[e],null}function updateLocale(e,t){if(t!=null){var a,s,n=baseConfig;locales[e]!=null&&locales[e].parentLocale!=null?locales[e].set(mergeConfigs(locales[e]._config,t)):(s=loadLocale(e),s!=null&&(n=s._config),t=mergeConfigs(n,t),s==null&&(t.abbr=e),a=new Locale(t),a.parentLocale=locales[e],locales[e]=a),getSetGlobalLocale(e)}else locales[e]!=null&&(locales[e].parentLocale!=null?(locales[e]=locales[e].parentLocale,e===getSetGlobalLocale()&&getSetGlobalLocale(e)):locales[e]!=null&&delete locales[e]);return locales[e]}function getLocale(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return globalLocale;if(!isArray$c(e)){if(t=loadLocale(e),t)return t;e=[e]}return chooseLocale(e)}function listLocales(){return keys$5(locales)}function checkOverflow(e){var t,a=e._a;return a&&getParsingFlags(e).overflow===-2&&(t=a[MONTH]<0||a[MONTH]>11?MONTH:a[DATE]<1||a[DATE]>daysInMonth(a[YEAR],a[MONTH])?DATE:a[HOUR]<0||a[HOUR]>24||a[HOUR]===24&&(a[MINUTE]!==0||a[SECOND]!==0||a[MILLISECOND]!==0)?HOUR:a[MINUTE]<0||a[MINUTE]>59?MINUTE:a[SECOND]<0||a[SECOND]>59?SECOND:a[MILLISECOND]<0||a[MILLISECOND]>999?MILLISECOND:-1,getParsingFlags(e)._overflowDayOfYear&&(tDATE)&&(t=DATE),getParsingFlags(e)._overflowWeeks&&t===-1&&(t=WEEK),getParsingFlags(e)._overflowWeekday&&t===-1&&(t=WEEKDAY),getParsingFlags(e).overflow=t),e}var extendedIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,basicIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,tzRegex=/Z|[+-]\d\d(?::?\d\d)?/,isoDates=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],isoTimes=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],aspNetJsonRegex=/^\/?Date\((-?\d+)/i,rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,obsOffsets={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function configFromISO(e){var t,a,s=e._i,n=extendedIsoRegex.exec(s)||basicIsoRegex.exec(s),i,o,u,l,c=isoDates.length,_=isoTimes.length;if(n){for(getParsingFlags(e).iso=!0,t=0,a=c;tdaysInYear(o)||e._dayOfYear===0)&&(getParsingFlags(e)._overflowDayOfYear=!0),a=createUTCDate(o,0,e._dayOfYear),e._a[MONTH]=a.getUTCMonth(),e._a[DATE]=a.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=s[t]=n[t];for(;t<7;t++)e._a[t]=s[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[HOUR]===24&&e._a[MINUTE]===0&&e._a[SECOND]===0&&e._a[MILLISECOND]===0&&(e._nextDay=!0,e._a[HOUR]=0),e._d=(e._useUTC?createUTCDate:createDate).apply(null,s),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[HOUR]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==i&&(getParsingFlags(e).weekdayMismatch=!0)}}function dayOfYearFromWeekInfo(e){var t,a,s,n,i,o,u,l,c;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(i=1,o=4,a=defaults(t.GG,e._a[YEAR],weekOfYear(createLocal(),1,4).year),s=defaults(t.W,1),n=defaults(t.E,1),(n<1||n>7)&&(l=!0)):(i=e._locale._week.dow,o=e._locale._week.doy,c=weekOfYear(createLocal(),i,o),a=defaults(t.gg,e._a[YEAR],c.year),s=defaults(t.w,c.week),t.d!=null?(n=t.d,(n<0||n>6)&&(l=!0)):t.e!=null?(n=t.e+i,(t.e<0||t.e>6)&&(l=!0)):n=i),s<1||s>weeksInYear(a,i,o)?getParsingFlags(e)._overflowWeeks=!0:l!=null?getParsingFlags(e)._overflowWeekday=!0:(u=dayOfYearFromWeeks(a,s,n,i,o),e._a[YEAR]=u.year,e._dayOfYear=u.dayOfYear)}hooks.ISO_8601=function(){};hooks.RFC_2822=function(){};function configFromStringAndFormat(e){if(e._f===hooks.ISO_8601){configFromISO(e);return}if(e._f===hooks.RFC_2822){configFromRFC2822(e);return}e._a=[],getParsingFlags(e).empty=!0;var t=""+e._i,a,s,n,i,o,u=t.length,l=0,c,_;for(n=expandFormat(e._f,e._locale).match(formattingTokens)||[],_=n.length,a=0;a<_;a++)i=n[a],s=(t.match(getParseRegexForToken(i,e))||[])[0],s&&(o=t.substr(0,t.indexOf(s)),o.length>0&&getParsingFlags(e).unusedInput.push(o),t=t.slice(t.indexOf(s)+s.length),l+=s.length),formatTokenFunctions[i]?(s?getParsingFlags(e).empty=!1:getParsingFlags(e).unusedTokens.push(i),addTimeToArrayFromToken(i,s,e)):e._strict&&!s&&getParsingFlags(e).unusedTokens.push(i);getParsingFlags(e).charsLeftOver=u-l,t.length>0&&getParsingFlags(e).unusedInput.push(t),e._a[HOUR]<=12&&getParsingFlags(e).bigHour===!0&&e._a[HOUR]>0&&(getParsingFlags(e).bigHour=void 0),getParsingFlags(e).parsedDateParts=e._a.slice(0),getParsingFlags(e).meridiem=e._meridiem,e._a[HOUR]=meridiemFixWrap(e._locale,e._a[HOUR],e._meridiem),c=getParsingFlags(e).era,c!==null&&(e._a[YEAR]=e._locale.erasConvertYear(c,e._a[YEAR])),configFromArray(e),checkOverflow(e)}function meridiemFixWrap(e,t,a){var s;return a==null?t:e.meridiemHour!=null?e.meridiemHour(t,a):(e.isPM!=null&&(s=e.isPM(a),s&&t<12&&(t+=12),!s&&t===12&&(t=0)),t)}function configFromStringAndArray(e){var t,a,s,n,i,o,u=!1,l=e._f.length;if(l===0){getParsingFlags(e).invalidFormat=!0,e._d=new Date(NaN);return}for(n=0;nthis?this:e:createInvalid()});function pickBy(e,t){var a,s;if(t.length===1&&isArray$c(t[0])&&(t=t[0]),!t.length)return createLocal();for(a=t[0],s=1;sthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function isDaylightSavingTimeShifted(){if(!isUndefined(this._isDSTShifted))return this._isDSTShifted;var e={},t;return copyConfig(e,this),e=prepareConfig(e),e._a?(t=e._isUTC?createUTC(e._a):createLocal(e._a),this._isDSTShifted=this.isValid()&&compareArrays(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function isLocal(){return this.isValid()?!this._isUTC:!1}function isUtcOffset(){return this.isValid()?this._isUTC:!1}function isUtc(){return this.isValid()?this._isUTC&&this._offset===0:!1}var aspNetRegex=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,isoRegex=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function createDuration(e,t){var a=e,s=null,n,i,o;return isDuration(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:isNumber(e)||!isNaN(+e)?(a={},t?a[t]=+e:a.milliseconds=+e):(s=aspNetRegex.exec(e))?(n=s[1]==="-"?-1:1,a={y:0,d:toInt(s[DATE])*n,h:toInt(s[HOUR])*n,m:toInt(s[MINUTE])*n,s:toInt(s[SECOND])*n,ms:toInt(absRound(s[MILLISECOND]*1e3))*n}):(s=isoRegex.exec(e))?(n=s[1]==="-"?-1:1,a={y:parseIso(s[2],n),M:parseIso(s[3],n),w:parseIso(s[4],n),d:parseIso(s[5],n),h:parseIso(s[6],n),m:parseIso(s[7],n),s:parseIso(s[8],n)}):a==null?a={}:typeof a=="object"&&("from"in a||"to"in a)&&(o=momentsDifference(createLocal(a.from),createLocal(a.to)),a={},a.ms=o.milliseconds,a.M=o.months),i=new Duration(a),isDuration(e)&&hasOwnProp(e,"_locale")&&(i._locale=e._locale),isDuration(e)&&hasOwnProp(e,"_isValid")&&(i._isValid=e._isValid),i}createDuration.fn=Duration.prototype;createDuration.invalid=createInvalid$1;function parseIso(e,t){var a=e&&parseFloat(e.replace(",","."));return(isNaN(a)?0:a)*t}function positiveMomentsDifference(e,t){var a={};return a.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(a.months,"M").isAfter(t)&&--a.months,a.milliseconds=+t-+e.clone().add(a.months,"M"),a}function momentsDifference(e,t){var a;return e.isValid()&&t.isValid()?(t=cloneWithOffset(t,e),e.isBefore(t)?a=positiveMomentsDifference(e,t):(a=positiveMomentsDifference(t,e),a.milliseconds=-a.milliseconds,a.months=-a.months),a):{milliseconds:0,months:0}}function createAdder(e,t){return function(a,s){var n,i;return s!==null&&!isNaN(+s)&&(deprecateSimple(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=a,a=s,s=i),n=createDuration(a,s),addSubtract(this,n,e),this}}function addSubtract(e,t,a,s){var n=t._milliseconds,i=absRound(t._days),o=absRound(t._months);e.isValid()&&(s=s??!0,o&&setMonth$2(e,get$2(e,"Month")+o*a),i&&set$1$1(e,"Date",get$2(e,"Date")+i*a),n&&e._d.setTime(e._d.valueOf()+n*a),s&&hooks.updateOffset(e,i||o))}var add=createAdder(1,"add"),subtract=createAdder(-1,"subtract");function isString$1(e){return typeof e=="string"||e instanceof String}function isMomentInput(e){return isMoment(e)||isDate$3(e)||isString$1(e)||isNumber(e)||isNumberOrStringArray(e)||isMomentInputObject(e)||e===null||e===void 0}function isMomentInputObject(e){var t=isObject$7(e)&&!isObjectEmpty(e),a=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],n,i,o=s.length;for(n=0;na.valueOf():a.valueOf()9999?formatMoment(a,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):isFunction$5(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",formatMoment(a,"Z")):formatMoment(a,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function inspect(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",a,s,n,i;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),a="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",i=t+'[")]',this.format(a+s+n+i)}function format$1(e){e||(e=this.isUtc()?hooks.defaultFormatUtc:hooks.defaultFormat);var t=formatMoment(this,e);return this.localeData().postformat(t)}function from(e,t){return this.isValid()&&(isMoment(e)&&e.isValid()||createLocal(e).isValid())?createDuration({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function fromNow(e){return this.from(createLocal(),e)}function to(e,t){return this.isValid()&&(isMoment(e)&&e.isValid()||createLocal(e).isValid())?createDuration({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function toNow(e){return this.to(createLocal(),e)}function locale$2(e){var t;return e===void 0?this._locale._abbr:(t=getLocale(e),t!=null&&(this._locale=t),this)}var lang=deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function localeData(){return this._locale}var MS_PER_SECOND=1e3,MS_PER_MINUTE=60*MS_PER_SECOND,MS_PER_HOUR=60*MS_PER_MINUTE,MS_PER_400_YEARS=(365*400+97)*24*MS_PER_HOUR;function mod$1$1(e,t){return(e%t+t)%t}function localStartOfDate(e,t,a){return e<100&&e>=0?new Date(e+400,t,a)-MS_PER_400_YEARS:new Date(e,t,a).valueOf()}function utcStartOfDate(e,t,a){return e<100&&e>=0?Date.UTC(e+400,t,a)-MS_PER_400_YEARS:Date.UTC(e,t,a)}function startOf(e){var t,a;if(e=normalizeUnits(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(a=this._isUTC?utcStartOfDate:localStartOfDate,e){case"year":t=a(this.year(),0,1);break;case"quarter":t=a(this.year(),this.month()-this.month()%3,1);break;case"month":t=a(this.year(),this.month(),1);break;case"week":t=a(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=a(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=mod$1$1(t+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR);break;case"minute":t=this._d.valueOf(),t-=mod$1$1(t,MS_PER_MINUTE);break;case"second":t=this._d.valueOf(),t-=mod$1$1(t,MS_PER_SECOND);break}return this._d.setTime(t),hooks.updateOffset(this,!0),this}function endOf(e){var t,a;if(e=normalizeUnits(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(a=this._isUTC?utcStartOfDate:localStartOfDate,e){case"year":t=a(this.year()+1,0,1)-1;break;case"quarter":t=a(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=a(this.year(),this.month()+1,1)-1;break;case"week":t=a(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=a(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=MS_PER_HOUR-mod$1$1(t+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR)-1;break;case"minute":t=this._d.valueOf(),t+=MS_PER_MINUTE-mod$1$1(t,MS_PER_MINUTE)-1;break;case"second":t=this._d.valueOf(),t+=MS_PER_SECOND-mod$1$1(t,MS_PER_SECOND)-1;break}return this._d.setTime(t),hooks.updateOffset(this,!0),this}function valueOf(){return this._d.valueOf()-(this._offset||0)*6e4}function unix(){return Math.floor(this.valueOf()/1e3)}function toDate$1(){return new Date(this.valueOf())}function toArray$1(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function toObject(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function toJSON(){return this.isValid()?this.toISOString():null}function isValid$2(){return isValid$1(this)}function parsingFlags(){return extend({},getParsingFlags(this))}function invalidAt(){return getParsingFlags(this).overflow}function creationData(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}addFormatToken("N",0,0,"eraAbbr");addFormatToken("NN",0,0,"eraAbbr");addFormatToken("NNN",0,0,"eraAbbr");addFormatToken("NNNN",0,0,"eraName");addFormatToken("NNNNN",0,0,"eraNarrow");addFormatToken("y",["y",1],"yo","eraYear");addFormatToken("y",["yy",2],0,"eraYear");addFormatToken("y",["yyy",3],0,"eraYear");addFormatToken("y",["yyyy",4],0,"eraYear");addRegexToken("N",matchEraAbbr);addRegexToken("NN",matchEraAbbr);addRegexToken("NNN",matchEraAbbr);addRegexToken("NNNN",matchEraName);addRegexToken("NNNNN",matchEraNarrow);addParseToken(["N","NN","NNN","NNNN","NNNNN"],function(e,t,a,s){var n=a._locale.erasParse(e,s,a._strict);n?getParsingFlags(a).era=n:getParsingFlags(a).invalidEra=e});addRegexToken("y",matchUnsigned);addRegexToken("yy",matchUnsigned);addRegexToken("yyy",matchUnsigned);addRegexToken("yyyy",matchUnsigned);addRegexToken("yo",matchEraYearOrdinal);addParseToken(["y","yy","yyy","yyyy"],YEAR);addParseToken(["yo"],function(e,t,a,s){var n;a._locale._eraYearOrdinalRegex&&(n=e.match(a._locale._eraYearOrdinalRegex)),a._locale.eraYearOrdinalParse?t[YEAR]=a._locale.eraYearOrdinalParse(e,n):t[YEAR]=parseInt(e,10)});function localeEras(e,t){var a,s,n,i=this._eras||getLocale("en")._eras;for(a=0,s=i.length;a=0)return i[s]}function localeErasConvertYear(e,t){var a=e.since<=e.until?1:-1;return t===void 0?hooks(e.since).year():hooks(e.since).year()+(t-e.offset)*a}function getEraName(){var e,t,a,s=this.localeData().eras();for(e=0,t=s.length;ei&&(t=i),setWeekAll.call(this,e,t,a,s,n))}function setWeekAll(e,t,a,s,n){var i=dayOfYearFromWeeks(e,t,a,s,n),o=createUTCDate(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}addFormatToken("Q",0,"Qo","quarter");addRegexToken("Q",match1);addParseToken("Q",function(e,t){t[MONTH]=(toInt(e)-1)*3});function getSetQuarter(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}addFormatToken("D",["DD",2],"Do","date");addRegexToken("D",match1to2,match1to2NoLeadingZero);addRegexToken("DD",match1to2,match2);addRegexToken("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});addParseToken(["D","DD"],DATE);addParseToken("Do",function(e,t){t[DATE]=toInt(e.match(match1to2)[0])});var getSetDayOfMonth=makeGetSet("Date",!0);addFormatToken("DDD",["DDDD",3],"DDDo","dayOfYear");addRegexToken("DDD",match1to3);addRegexToken("DDDD",match3);addParseToken(["DDD","DDDD"],function(e,t,a){a._dayOfYear=toInt(e)});function getSetDayOfYear(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}addFormatToken("m",["mm",2],0,"minute");addRegexToken("m",match1to2,match1to2HasZero);addRegexToken("mm",match1to2,match2);addParseToken(["m","mm"],MINUTE);var getSetMinute=makeGetSet("Minutes",!1);addFormatToken("s",["ss",2],0,"second");addRegexToken("s",match1to2,match1to2HasZero);addRegexToken("ss",match1to2,match2);addParseToken(["s","ss"],SECOND);var getSetSecond=makeGetSet("Seconds",!1);addFormatToken("S",0,0,function(){return~~(this.millisecond()/100)});addFormatToken(0,["SS",2],0,function(){return~~(this.millisecond()/10)});addFormatToken(0,["SSS",3],0,"millisecond");addFormatToken(0,["SSSS",4],0,function(){return this.millisecond()*10});addFormatToken(0,["SSSSS",5],0,function(){return this.millisecond()*100});addFormatToken(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});addFormatToken(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});addFormatToken(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});addFormatToken(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});addRegexToken("S",match1to3,match1);addRegexToken("SS",match1to3,match2);addRegexToken("SSS",match1to3,match3);var token,getSetMillisecond;for(token="SSSS";token.length<=9;token+="S")addRegexToken(token,matchUnsigned);function parseMs(e,t){t[MILLISECOND]=toInt(("0."+e)*1e3)}for(token="S";token.length<=9;token+="S")addParseToken(token,parseMs);getSetMillisecond=makeGetSet("Milliseconds",!1);addFormatToken("z",0,0,"zoneAbbr");addFormatToken("zz",0,0,"zoneName");function getZoneAbbr(){return this._isUTC?"UTC":""}function getZoneName(){return this._isUTC?"Coordinated Universal Time":""}var proto=Moment.prototype;proto.add=add;proto.calendar=calendar$1;proto.clone=clone$2;proto.diff=diff;proto.endOf=endOf;proto.format=format$1;proto.from=from;proto.fromNow=fromNow;proto.to=to;proto.toNow=toNow;proto.get=stringGet;proto.invalidAt=invalidAt;proto.isAfter=isAfter$1;proto.isBefore=isBefore$1;proto.isBetween=isBetween;proto.isSame=isSame;proto.isSameOrAfter=isSameOrAfter;proto.isSameOrBefore=isSameOrBefore;proto.isValid=isValid$2;proto.lang=lang;proto.locale=locale$2;proto.localeData=localeData;proto.max=prototypeMax;proto.min=prototypeMin;proto.parsingFlags=parsingFlags;proto.set=stringSet;proto.startOf=startOf;proto.subtract=subtract;proto.toArray=toArray$1;proto.toObject=toObject;proto.toDate=toDate$1;proto.toISOString=toISOString;proto.inspect=inspect;typeof Symbol<"u"&&Symbol.for!=null&&(proto[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});proto.toJSON=toJSON;proto.toString=toString$8;proto.unix=unix;proto.valueOf=valueOf;proto.creationData=creationData;proto.eraName=getEraName;proto.eraNarrow=getEraNarrow;proto.eraAbbr=getEraAbbr;proto.eraYear=getEraYear;proto.year=getSetYear;proto.isLeapYear=getIsLeapYear;proto.weekYear=getSetWeekYear;proto.isoWeekYear=getSetISOWeekYear;proto.quarter=proto.quarters=getSetQuarter;proto.month=getSetMonth;proto.daysInMonth=getDaysInMonth$1;proto.week=proto.weeks=getSetWeek;proto.isoWeek=proto.isoWeeks=getSetISOWeek;proto.weeksInYear=getWeeksInYear;proto.weeksInWeekYear=getWeeksInWeekYear;proto.isoWeeksInYear=getISOWeeksInYear;proto.isoWeeksInISOWeekYear=getISOWeeksInISOWeekYear;proto.date=getSetDayOfMonth;proto.day=proto.days=getSetDayOfWeek;proto.weekday=getSetLocaleDayOfWeek;proto.isoWeekday=getSetISODayOfWeek;proto.dayOfYear=getSetDayOfYear;proto.hour=proto.hours=getSetHour;proto.minute=proto.minutes=getSetMinute;proto.second=proto.seconds=getSetSecond;proto.millisecond=proto.milliseconds=getSetMillisecond;proto.utcOffset=getSetOffset;proto.utc=setOffsetToUTC;proto.local=setOffsetToLocal;proto.parseZone=setOffsetToParsedOffset;proto.hasAlignedHourOffset=hasAlignedHourOffset;proto.isDST=isDaylightSavingTime;proto.isLocal=isLocal;proto.isUtcOffset=isUtcOffset;proto.isUtc=isUtc;proto.isUTC=isUtc;proto.zoneAbbr=getZoneAbbr;proto.zoneName=getZoneName;proto.dates=deprecate("dates accessor is deprecated. Use date instead.",getSetDayOfMonth);proto.months=deprecate("months accessor is deprecated. Use month instead",getSetMonth);proto.years=deprecate("years accessor is deprecated. Use year instead",getSetYear);proto.zone=deprecate("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",getSetZone);proto.isDSTShifted=deprecate("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",isDaylightSavingTimeShifted);function createUnix(e){return createLocal(e*1e3)}function createInZone(){return createLocal.apply(null,arguments).parseZone()}function preParsePostFormat(e){return e}var proto$1=Locale.prototype;proto$1.calendar=calendar;proto$1.longDateFormat=longDateFormat;proto$1.invalidDate=invalidDate$1;proto$1.ordinal=ordinal;proto$1.preparse=preParsePostFormat;proto$1.postformat=preParsePostFormat;proto$1.relativeTime=relativeTime;proto$1.pastFuture=pastFuture;proto$1.set=set$1;proto$1.eras=localeEras;proto$1.erasParse=localeErasParse;proto$1.erasConvertYear=localeErasConvertYear;proto$1.erasAbbrRegex=erasAbbrRegex;proto$1.erasNameRegex=erasNameRegex;proto$1.erasNarrowRegex=erasNarrowRegex;proto$1.months=localeMonths;proto$1.monthsShort=localeMonthsShort;proto$1.monthsParse=localeMonthsParse;proto$1.monthsRegex=monthsRegex;proto$1.monthsShortRegex=monthsShortRegex;proto$1.week=localeWeek;proto$1.firstDayOfYear=localeFirstDayOfYear;proto$1.firstDayOfWeek=localeFirstDayOfWeek;proto$1.weekdays=localeWeekdays;proto$1.weekdaysMin=localeWeekdaysMin;proto$1.weekdaysShort=localeWeekdaysShort;proto$1.weekdaysParse=localeWeekdaysParse;proto$1.weekdaysRegex=weekdaysRegex;proto$1.weekdaysShortRegex=weekdaysShortRegex;proto$1.weekdaysMinRegex=weekdaysMinRegex;proto$1.isPM=localeIsPM;proto$1.meridiem=localeMeridiem;function get$1$1(e,t,a,s){var n=getLocale(),i=createUTC().set(s,t);return n[a](i,e)}function listMonthsImpl(e,t,a){if(isNumber(e)&&(t=e,e=void 0),e=e||"",t!=null)return get$1$1(e,t,a,"month");var s,n=[];for(s=0;s<12;s++)n[s]=get$1$1(e,s,a,"month");return n}function listWeekdaysImpl(e,t,a,s){typeof e=="boolean"?(isNumber(t)&&(a=t,t=void 0),t=t||""):(t=e,a=t,e=!1,isNumber(t)&&(a=t,t=void 0),t=t||"");var n=getLocale(),i=e?n._week.dow:0,o,u=[];if(a!=null)return get$1$1(t,(a+i)%7,s,"day");for(o=0;o<7;o++)u[o]=get$1$1(t,(o+i)%7,s,"day");return u}function listMonths(e,t){return listMonthsImpl(e,t,"months")}function listMonthsShort(e,t){return listMonthsImpl(e,t,"monthsShort")}function listWeekdays(e,t,a){return listWeekdaysImpl(e,t,a,"weekdays")}function listWeekdaysShort(e,t,a){return listWeekdaysImpl(e,t,a,"weekdaysShort")}function listWeekdaysMin(e,t,a){return listWeekdaysImpl(e,t,a,"weekdaysMin")}getSetGlobalLocale("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,a=toInt(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+a}});hooks.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",getSetGlobalLocale);hooks.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",getLocale);var mathAbs=Math.abs;function abs(){var e=this._data;return this._milliseconds=mathAbs(this._milliseconds),this._days=mathAbs(this._days),this._months=mathAbs(this._months),e.milliseconds=mathAbs(e.milliseconds),e.seconds=mathAbs(e.seconds),e.minutes=mathAbs(e.minutes),e.hours=mathAbs(e.hours),e.months=mathAbs(e.months),e.years=mathAbs(e.years),this}function addSubtract$1(e,t,a,s){var n=createDuration(t,a);return e._milliseconds+=s*n._milliseconds,e._days+=s*n._days,e._months+=s*n._months,e._bubble()}function add$1(e,t){return addSubtract$1(this,e,t,1)}function subtract$1(e,t){return addSubtract$1(this,e,t,-1)}function absCeil(e){return e<0?Math.floor(e):Math.ceil(e)}function bubble(){var e=this._milliseconds,t=this._days,a=this._months,s=this._data,n,i,o,u,l;return e>=0&&t>=0&&a>=0||e<=0&&t<=0&&a<=0||(e+=absCeil(monthsToDays(a)+t)*864e5,t=0,a=0),s.milliseconds=e%1e3,n=absFloor(e/1e3),s.seconds=n%60,i=absFloor(n/60),s.minutes=i%60,o=absFloor(i/60),s.hours=o%24,t+=absFloor(o/24),l=absFloor(daysToMonths(t)),a+=l,t-=absCeil(monthsToDays(l)),u=absFloor(a/12),a%=12,s.days=t,s.months=a,s.years=u,this}function daysToMonths(e){return e*4800/146097}function monthsToDays(e){return e*146097/4800}function as(e){if(!this.isValid())return NaN;var t,a,s=this._milliseconds;if(e=normalizeUnits(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+s/864e5,a=this._months+daysToMonths(t),e){case"month":return a;case"quarter":return a/3;case"year":return a/12}else switch(t=this._days+Math.round(monthsToDays(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return t*24+s/36e5;case"minute":return t*1440+s/6e4;case"second":return t*86400+s/1e3;case"millisecond":return Math.floor(t*864e5)+s;default:throw new Error("Unknown unit "+e)}}function makeAs(e){return function(){return this.as(e)}}var asMilliseconds=makeAs("ms"),asSeconds=makeAs("s"),asMinutes=makeAs("m"),asHours=makeAs("h"),asDays=makeAs("d"),asWeeks=makeAs("w"),asMonths=makeAs("M"),asQuarters=makeAs("Q"),asYears=makeAs("y"),valueOf$1=asMilliseconds;function clone$1$1(){return createDuration(this)}function get$2$1(e){return e=normalizeUnits(e),this.isValid()?this[e+"s"]():NaN}function makeGetter(e){return function(){return this.isValid()?this._data[e]:NaN}}var milliseconds=makeGetter("milliseconds"),seconds=makeGetter("seconds"),minutes=makeGetter("minutes"),hours=makeGetter("hours"),days=makeGetter("days"),months=makeGetter("months"),years=makeGetter("years");function weeks(){return absFloor(this.days()/7)}var round=Math.round,thresholds={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function substituteTimeAgo(e,t,a,s,n){return n.relativeTime(t||1,!!a,e,s)}function relativeTime$1(e,t,a,s){var n=createDuration(e).abs(),i=round(n.as("s")),o=round(n.as("m")),u=round(n.as("h")),l=round(n.as("d")),c=round(n.as("M")),_=round(n.as("w")),p=round(n.as("y")),d=i<=a.ss&&["s",i]||i0,d[4]=s,substituteTimeAgo.apply(null,d)}function getSetRelativeTimeRounding(e){return e===void 0?round:typeof e=="function"?(round=e,!0):!1}function getSetRelativeTimeThreshold(e,t){return thresholds[e]===void 0?!1:t===void 0?thresholds[e]:(thresholds[e]=t,e==="s"&&(thresholds.ss=t-1),!0)}function humanize(e,t){if(!this.isValid())return this.localeData().invalidDate();var a=!1,s=thresholds,n,i;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(a=e),typeof t=="object"&&(s=Object.assign({},thresholds,t),t.s!=null&&t.ss==null&&(s.ss=t.s-1)),n=this.localeData(),i=relativeTime$1(this,!a,s,n),a&&(i=n.pastFuture(+this,i)),n.postformat(i)}var abs$1=Math.abs;function sign(e){return(e>0)-(e<0)||+e}function toISOString$1(){if(!this.isValid())return this.localeData().invalidDate();var e=abs$1(this._milliseconds)/1e3,t=abs$1(this._days),a=abs$1(this._months),s,n,i,o,u=this.asSeconds(),l,c,_,p;return u?(s=absFloor(e/60),n=absFloor(s/60),e%=60,s%=60,i=absFloor(a/12),a%=12,o=e?e.toFixed(3).replace(/\.?0+$/,""):"",l=u<0?"-":"",c=sign(this._months)!==sign(u)?"-":"",_=sign(this._days)!==sign(u)?"-":"",p=sign(this._milliseconds)!==sign(u)?"-":"",l+"P"+(i?c+i+"Y":"")+(a?c+a+"M":"")+(t?_+t+"D":"")+(n||s||e?"T":"")+(n?p+n+"H":"")+(s?p+s+"M":"")+(e?p+o+"S":"")):"P0D"}var proto$2=Duration.prototype;proto$2.isValid=isValid$1$1;proto$2.abs=abs;proto$2.add=add$1;proto$2.subtract=subtract$1;proto$2.as=as;proto$2.asMilliseconds=asMilliseconds;proto$2.asSeconds=asSeconds;proto$2.asMinutes=asMinutes;proto$2.asHours=asHours;proto$2.asDays=asDays;proto$2.asWeeks=asWeeks;proto$2.asMonths=asMonths;proto$2.asQuarters=asQuarters;proto$2.asYears=asYears;proto$2.valueOf=valueOf$1;proto$2._bubble=bubble;proto$2.clone=clone$1$1;proto$2.get=get$2$1;proto$2.milliseconds=milliseconds;proto$2.seconds=seconds;proto$2.minutes=minutes;proto$2.hours=hours;proto$2.days=days;proto$2.weeks=weeks;proto$2.months=months;proto$2.years=years;proto$2.humanize=humanize;proto$2.toISOString=toISOString$1;proto$2.toString=toISOString$1;proto$2.toJSON=toISOString$1;proto$2.locale=locale$2;proto$2.localeData=localeData;proto$2.toIsoString=deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",toISOString$1);proto$2.lang=lang;addFormatToken("X",0,0,"unix");addFormatToken("x",0,0,"valueOf");addRegexToken("x",matchSigned);addRegexToken("X",matchTimestamp);addParseToken("X",function(e,t,a){a._d=new Date(parseFloat(e)*1e3)});addParseToken("x",function(e,t,a){a._d=new Date(toInt(e))});//! moment.js +hooks.version="2.30.1";setHookCallback(createLocal);hooks.fn=proto;hooks.min=min;hooks.max=max;hooks.now=now;hooks.utc=createUTC;hooks.unix=createUnix;hooks.months=listMonths;hooks.isDate=isDate$3;hooks.locale=getSetGlobalLocale;hooks.invalid=createInvalid;hooks.duration=createDuration;hooks.isMoment=isMoment;hooks.weekdays=listWeekdays;hooks.parseZone=createInZone;hooks.localeData=getLocale;hooks.isDuration=isDuration;hooks.monthsShort=listMonthsShort;hooks.weekdaysMin=listWeekdaysMin;hooks.defineLocale=defineLocale;hooks.updateLocale=updateLocale;hooks.locales=listLocales;hooks.weekdaysShort=listWeekdaysShort;hooks.normalizeUnits=normalizeUnits;hooks.relativeTimeRounding=getSetRelativeTimeRounding;hooks.relativeTimeThreshold=getSetRelativeTimeThreshold;hooks.calendarFormat=getCalendarFormat;hooks.prototype=proto;hooks.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const SPACING={TINY:1,SMALL:2,MEDIUM:4,LARGE:8};var lib={exports:{}};(function(e,t){(function(a,s){e.exports=s(reactExports,reactDomExports)})(typeof self<"u"?self:commonjsGlobal,function(a,s){return function(){var n={328:function(l,c,_){Object.defineProperty(c,"__esModule",{value:!0}),c.PrintContextConsumer=c.PrintContext=void 0;var p=_(496),d=Object.prototype.hasOwnProperty.call(p,"createContext");c.PrintContext=d?p.createContext({}):null,c.PrintContextConsumer=c.PrintContext?c.PrintContext.Consumer:function(){return null}},428:function(l,c,_){Object.defineProperty(c,"__esModule",{value:!0}),c.ReactToPrint=void 0;var p=_(316),d=_(496),E=_(190),R=_(328),y=_(940),I=function(A){function x(){var g=A.apply(this,p.__spreadArray([],p.__read(arguments),!1))||this;return g.startPrint=function(T){var O=g.props,C=O.onAfterPrint,U=O.onPrintError,L=O.print,j=O.documentTitle;setTimeout(function(){var X,B;if(T.contentWindow)if(T.contentWindow.focus(),L)L(T).then(function(){return C==null?void 0:C()}).then(function(){return g.handleRemoveIframe()}).catch(function(K){U?U("print",K):g.logMessages(["An error was thrown by the specified `print` function"])});else{if(T.contentWindow.print){var H=(B=(X=T.contentDocument)===null||X===void 0?void 0:X.title)!==null&&B!==void 0?B:"",W=T.ownerDocument.title;j&&(T.ownerDocument.title=j,T.contentDocument&&(T.contentDocument.title=j)),T.contentWindow.print(),j&&(T.ownerDocument.title=W,T.contentDocument&&(T.contentDocument.title=H))}else g.logMessages(["Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes."]);C==null||C(),g.handleRemoveIframe()}else g.logMessages(["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/gregnb/react-to-print/issues/"])},500)},g.triggerPrint=function(T){var O=g.props,C=O.onBeforePrint,U=O.onPrintError;if(C){var L=C();L&&typeof L.then=="function"?L.then(function(){g.startPrint(T)}).catch(function(j){U&&U("onBeforePrint",j)}):g.startPrint(T)}else g.startPrint(T)},g.handlePrint=function(T){var O=g.props,C=O.bodyClass,U=O.content,L=O.copyStyles,j=O.fonts,X=O.pageStyle,B=O.nonce,H=typeof T=="function"?T():null;if(H&&typeof U=="function"&&g.logMessages(['"react-to-print" received a `content` prop and a content param passed the callback return by `useReactToPrint. The `content` prop will be ignored.'],"warning"),H||typeof U!="function"||(H=U()),H!==void 0)if(H!==null){var W=document.createElement("iframe");W.width="".concat(document.documentElement.clientWidth,"px"),W.height="".concat(document.documentElement.clientHeight,"px"),W.style.position="absolute",W.style.top="-".concat(document.documentElement.clientHeight+100,"px"),W.style.left="-".concat(document.documentElement.clientWidth+100,"px"),W.id="printWindow",W.srcdoc="";var K=(0,E.findDOMNode)(H);if(K){var b=K.cloneNode(!0),k=b instanceof Text,F=document.querySelectorAll("link[rel~='stylesheet'], link[as='style']"),N=k?[]:b.querySelectorAll("img"),M=k?[]:b.querySelectorAll("video"),G=j?j.length:0;g.numResourcesToLoad=F.length+N.length+M.length+G,g.resourcesLoaded=[],g.resourcesErrored=[];var V=function(ee,ae){g.resourcesLoaded.includes(ee)?g.logMessages(["Tried to mark a resource that has already been handled",ee],"debug"):(ae?(g.logMessages(p.__spreadArray(['"react-to-print" was unable to load a resource but will continue attempting to print the page'],p.__read(ae),!1)),g.resourcesErrored.push(ee)):g.resourcesLoaded.push(ee),g.resourcesLoaded.length+g.resourcesErrored.length===g.numResourcesToLoad&&g.triggerPrint(W))};W.onload=function(){var ee,ae,ne,J;W.onload=null;var ue=W.contentDocument||((ae=W.contentWindow)===null||ae===void 0?void 0:ae.document);if(ue){ue.body.appendChild(b),j&&(!((ne=W.contentDocument)===null||ne===void 0)&&ne.fonts&&(!((J=W.contentWindow)===null||J===void 0)&&J.FontFace)?j.forEach(function(Pe){var Oe=new FontFace(Pe.family,Pe.source,{weight:Pe.weight,style:Pe.style});W.contentDocument.fonts.add(Oe),Oe.loaded.then(function(){V(Oe)}).catch(function(ye){V(Oe,["Failed loading the font:",Oe,"Load error:",ye])})}):(j.forEach(function(Pe){return V(Pe)}),g.logMessages(['"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'])));var oe=typeof X=="function"?X():X;if(typeof oe!="string")g.logMessages(['"react-to-print" expected a "string" from `pageStyle` but received "'.concat(typeof oe,'". Styles from `pageStyle` will not be applied.')]);else{var _e=ue.createElement("style");B&&(_e.setAttribute("nonce",B),ue.head.setAttribute("nonce",B)),_e.appendChild(ue.createTextNode(oe)),ue.head.appendChild(_e)}if(C&&(ee=ue.body.classList).add.apply(ee,p.__spreadArray([],p.__read(C.split(" ")),!1)),!k){for(var Y=k?[]:K.querySelectorAll("canvas"),Z=ue.querySelectorAll("canvas"),te=0;te",Oe,"Error",we])},Le.src=ye}else V(Oe,['Found an tag with an empty "src" attribute. This prevents pre-loading it. The is:',Oe])};for(te=0;te=2?V(Oe):(Oe.onloadeddata=function(){return V(Oe)},Oe.onerror=function(Be,je,Ke,Ge,we){return V(Oe,["Error loading video",Oe,"Error",we])},Oe.onstalled=function(){return V(Oe,["Loading video stalled, skipping",Oe])})};for(te=0;te tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The is:",ye],"warning"),V(ye);else{for(var we=ue.createElement(ye.tagName),et=(Ge=0,ye.attributes.length);Ge tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the was not loaded. The is:",ye],"warning"),V(ye)},xe=(te=0,Ee.length);te=0;me--)(Q=Y[me])&&(fe=(se<3?Q(fe):se>3?Q(Z,te,fe):Q(Z,te))||fe);return se>3&&fe&&Object.defineProperty(Z,te,fe),fe}function I(Y,Z){return function(te,q){Z(te,q,Y)}}function A(Y,Z,te,q,Q,se){function fe(Re){if(Re!==void 0&&typeof Re!="function")throw new TypeError("Function expected");return Re}for(var me,ve=q.kind,Ae=ve==="getter"?"get":ve==="setter"?"set":"value",ce=!Z&&Y?q.static?Y:Y.prototype:null,Se=Z||(ce?Object.getOwnPropertyDescriptor(ce,q.name):{}),Te=!1,re=te.length-1;re>=0;re--){var le={};for(var pe in q)le[pe]=pe==="access"?{}:q[pe];for(var pe in q.access)le.access[pe]=q.access[pe];le.addInitializer=function(Re){if(Te)throw new TypeError("Cannot add initializers after decoration has completed");se.push(fe(Re||null))};var Ee=(0,te[re])(ve==="accessor"?{get:Se.get,set:Se.set}:Se[Ae],le);if(ve==="accessor"){if(Ee===void 0)continue;if(Ee===null||typeof Ee!="object")throw new TypeError("Object expected");(me=fe(Ee.get))&&(Se.get=me),(me=fe(Ee.set))&&(Se.set=me),(me=fe(Ee.init))&&Q.unshift(me)}else(me=fe(Ee))&&(ve==="field"?Q.unshift(me):Se[Ae]=me)}ce&&Object.defineProperty(ce,q.name,Se),Te=!0}function x(Y,Z,te){for(var q=arguments.length>2,Q=0;Q0&&Q[Q.length-1])||ce[0]!==6&&ce[0]!==2)){fe=0;continue}if(ce[0]===3&&(!Q||ce[1]>Q[0]&&ce[1]=Y.length&&(Y=void 0),{value:Y&&Y[q++],done:!Y}}};throw new TypeError(Z?"Object is not iterable.":"Symbol.iterator is not defined.")}function B(Y,Z){var te=typeof Symbol=="function"&&Y[Symbol.iterator];if(!te)return Y;var q,Q,se=te.call(Y),fe=[];try{for(;(Z===void 0||Z-- >0)&&!(q=se.next()).done;)fe.push(q.value)}catch(me){Q={error:me}}finally{try{q&&!q.done&&(te=se.return)&&te.call(se)}finally{if(Q)throw Q.error}}return fe}function H(){for(var Y=[],Z=0;Z1||me(Se,Te)})})}function me(Se,Te){try{(re=Q[Se](Te)).value instanceof b?Promise.resolve(re.value.v).then(ve,Ae):ce(se[0][2],re)}catch(le){ce(se[0][3],le)}var re}function ve(Se){me("next",Se)}function Ae(Se){me("throw",Se)}function ce(Se,Te){Se(Te),se.shift(),se.length&&me(se[0][0],se[0][1])}}function F(Y){var Z,te;return Z={},q("next"),q("throw",function(Q){throw Q}),q("return"),Z[Symbol.iterator]=function(){return this},Z;function q(Q,se){Z[Q]=Y[Q]?function(fe){return(te=!te)?{value:b(Y[Q](fe)),done:!1}:se?se(fe):fe}:se}}function N(Y){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Z,te=Y[Symbol.asyncIterator];return te?te.call(Y):(Y=X(Y),Z={},q("next"),q("throw"),q("return"),Z[Symbol.asyncIterator]=function(){return this},Z);function q(Q){Z[Q]=Y[Q]&&function(se){return new Promise(function(fe,me){(function(ve,Ae,ce,Se){Promise.resolve(Se).then(function(Te){ve({value:Te,done:ce})},Ae)})(fe,me,(se=Y[Q](se)).done,se.value)})}}}function M(Y,Z){return Object.defineProperty?Object.defineProperty(Y,"raw",{value:Z}):Y.raw=Z,Y}var G=Object.create?function(Y,Z){Object.defineProperty(Y,"default",{enumerable:!0,value:Z})}:function(Y,Z){Y.default=Z};function V(Y){if(Y&&Y.__esModule)return Y;var Z={};if(Y!=null)for(var te in Y)te!=="default"&&Object.prototype.hasOwnProperty.call(Y,te)&&L(Z,Y,te);return G(Z,Y),Z}function ee(Y){return Y&&Y.__esModule?Y:{default:Y}}function ae(Y,Z,te,q){if(te==="a"&&!q)throw new TypeError("Private accessor was defined without a getter");if(typeof Z=="function"?Y!==Z||!q:!Z.has(Y))throw new TypeError("Cannot read private member from an object whose class did not declare it");return te==="m"?q:te==="a"?q.call(Y):q?q.value:Z.get(Y)}function ne(Y,Z,te,q,Q){if(q==="m")throw new TypeError("Private method is not writable");if(q==="a"&&!Q)throw new TypeError("Private accessor was defined without a setter");if(typeof Z=="function"?Y!==Z||!Q:!Z.has(Y))throw new TypeError("Cannot write private member to an object whose class did not declare it");return q==="a"?Q.call(Y,te):Q?Q.value=te:Z.set(Y,te),te}function J(Y,Z){if(Z===null||typeof Z!="object"&&typeof Z!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof Y=="function"?Z===Y:Y.has(Z)}function ue(Y,Z,te){if(Z!=null){if(typeof Z!="object"&&typeof Z!="function")throw new TypeError("Object expected.");var q;if(te){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");q=Z[Symbol.asyncDispose]}if(q===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");q=Z[Symbol.dispose]}if(typeof q!="function")throw new TypeError("Object not disposable.");Y.stack.push({value:Z,dispose:q,async:te})}else te&&Y.stack.push({async:!0});return Z}var oe=typeof SuppressedError=="function"?SuppressedError:function(Y,Z,te){var q=new Error(te);return q.name="SuppressedError",q.error=Y,q.suppressed=Z,q};function _e(Y){function Z(te){Y.error=Y.hasError?new oe(te,Y.error,"An error was suppressed during disposal."):te,Y.hasError=!0}return function te(){for(;Y.stack.length;){var q=Y.stack.pop();try{var Q=q.dispose&&q.dispose.call(q.value);if(q.async)return Promise.resolve(Q).then(te,function(se){return Z(se),te()})}catch(se){Z(se)}}if(Y.hasError)throw Y.error}()}c.default={__extends:d,__assign:E,__rest:R,__decorate:y,__param:I,__metadata:O,__awaiter:C,__generator:U,__createBinding:L,__exportStar:j,__values:X,__read:B,__spread:H,__spreadArrays:W,__spreadArray:K,__await:b,__asyncGenerator:k,__asyncDelegator:F,__asyncValues:N,__makeTemplateObject:M,__importStar:V,__importDefault:ee,__classPrivateFieldGet:ae,__classPrivateFieldSet:ne,__classPrivateFieldIn:J,__addDisposableResource:ue,__disposeResources:_e}}},i={};function o(l){var c=i[l];if(c!==void 0)return c.exports;var _=i[l]={exports:{}};return n[l](_,_.exports,o),_.exports}o.d=function(l,c){for(var _ in c)o.o(c,_)&&!o.o(l,_)&&Object.defineProperty(l,_,{enumerable:!0,get:c[_]})},o.o=function(l,c){return Object.prototype.hasOwnProperty.call(l,c)},o.r=function(l){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})};var u={};return function(){var l=u;Object.defineProperty(l,"__esModule",{value:!0}),l.useReactToPrint=l.ReactToPrint=l.PrintContextConsumer=void 0;var c=o(328);Object.defineProperty(l,"PrintContextConsumer",{enumerable:!0,get:function(){return c.PrintContextConsumer}});var _=o(428);Object.defineProperty(l,"ReactToPrint",{enumerable:!0,get:function(){return _.ReactToPrint}});var p=o(892);Object.defineProperty(l,"useReactToPrint",{enumerable:!0,get:function(){return p.useReactToPrint}});var d=o(428);l.default=d.ReactToPrint}(),u}()})})(lib);var libExports=lib.exports;const logo="/assets/reportHeader-2i1CV-AL.png",logoFooter="/assets/reportFooter-C8jIFeXy.png";function toInteger(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function requiredArgs(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}var breaks=[-61,9,38,199,426,686,756,818,1111,1181,1210,1635,2060,2097,2192,2262,2324,2394,2456,3178];function toJalaali(e,t,a){return d2j(g2d(e,t,a))}function toGregorian(e,t,a){return d2g(j2d(e,t,a))}function isLeapJalaaliYear(e){return jalCalLeap(e)===0}function jalCalLeap(e){var t=breaks.length,a=breaks[0],s,n=0,i,o,u;for(u=1;u=0){if(u<=185)return o=1+div(u,31),i=mod(u,31)+1,{jy:a,jm:o,jd:i};u-=186}else a-=1,u+=179,s.leap===1&&(u+=1);return o=7+div(u,30),i=mod(u,30)+1,{jy:a,jm:o,jd:i}}function g2d(e,t,a){var s=div((e+div(t-8,6)+100100)*1461,4)+div(153*mod(t+9,12)+2,5)+a-34840408;return s=s-div(div(e+100100+div(t-8,6),100)*3,4)+752,s}function d2g(e){if(isNaN(e))return{gy:NaN,gm:NaN,gd:NaN};var t,a,s,n,i;return t=4*e+139361631,t=t+div(div(4*e+183187720,146097)*3,4)*4-3908,a=div(mod(t,1461),4)*5+308,s=div(mod(a,153),5)+1,n=mod(div(a,153),12)+1,i=div(t,1461)-100100+div(8-n,6),{gy:i,gm:n,gd:s}}function div(e,t){return~~(e/t)}function mod(e,t){return e-~~(e/t)*t}function _toArray(e){return _arrayWithHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(e,t)}}function _arrayLikeToArray(e,t){(t==null||t>e.length)&&(t=e.length);for(var a=0,s=new Array(t);a1){var s=t,n=_toArray(s),i=n[0],o=n[1],u=n[2],l=u===void 0?1:u,c=n.slice(3),_=toGregorian(i,o+1,l);return new Date(_.gy,_.gm-1,_.gd,...c)}return new Date(...t)}function toDate(e){requiredArgs(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?newDate(e.getTime()):typeof e=="number"||t==="[object Number]"?newDate(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),newDate(NaN))}function getDate$1(e){var t=e.getDate(),a=e.getMonth()+1,s=e.getFullYear();return toJalaali(s,a,t).jd}function setDate$1(e){for(var t=e.getDate(),a=e.getMonth()+1,s=e.getFullYear(),n=toJalaali(s,a,t),i=arguments.length,o=new Array(i>1?i-1:0),u=1;u1?i-1:0),u=1;u1?i-1:0),u=1;u=o?i:(setFullYear(a,getFullYear(i),getMonth$1(i),n),a)}function addMilliseconds(e,t){requiredArgs(2,arguments);var a=toDate(e).getTime(),s=toInteger(t);return newDate(a+s)}var MILLISECONDS_IN_HOUR=36e5;function addHours(e,t){requiredArgs(2,arguments);var a=toInteger(t);return addMilliseconds(e,a*MILLISECONDS_IN_HOUR)}var defaultOptions={};function getDefaultOptions(){return defaultOptions}function startOfWeek(e,t){var a,s,n,i,o,u,l,c;requiredArgs(1,arguments);var _=getDefaultOptions(),p=toInteger((a=(s=(n=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:_.weekStartsOn)!==null&&s!==void 0?s:(l=_.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&a!==void 0?a:6);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=toDate(e),E=d.getDay(),R=(E1?i-1:0),u=1;u0?1:n}var millisecondsInMinute=6e4,millisecondsInHour=36e5,millisecondsInSecond=1e3;function isSameDay(e,t){requiredArgs(2,arguments);var a=startOfDay(e),s=startOfDay(t);return a.getTime()===s.getTime()}function isDate$2(e){return requiredArgs(1,arguments),e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function isValid(e){if(requiredArgs(1,arguments),!isDate$2(e)&&typeof e!="number")return!1;var t=toDate(e);return!isNaN(Number(t))}function differenceInCalendarMonths(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toDate(t),n=getFullYear(a)-getFullYear(s),i=getMonth$1(a)-getMonth$1(s);return n*12+i}function differenceInCalendarYears(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toDate(t);return getFullYear(a)-getFullYear(s)}function compareLocalAsc(e,t){var a=getFullYear(e)-getFullYear(t)||getMonth$1(e)-getMonth$1(t)||getDate$1(e)-getDate$1(t)||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return a<0?-1:a>0?1:a}function differenceInDays(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toDate(t),n=compareLocalAsc(a,s),i=Math.abs(differenceInCalendarDays(a,s));setDate$1(a,getDate$1(a)-n*i);var o=+(compareLocalAsc(a,s)===-n),u=n*(i-o);return u===0?0:u}function differenceInMilliseconds(e,t){return requiredArgs(2,arguments),toDate(e).getTime()-toDate(t).getTime()}var roundingMap={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},defaultRoundingMethod="trunc";function getRoundingMethod(e){return e?roundingMap[e]:roundingMap[defaultRoundingMethod]}function differenceInHours(e,t,a){requiredArgs(2,arguments);var s=differenceInMilliseconds(e,t)/millisecondsInHour;return getRoundingMethod(void 0)(s)}function differenceInMinutes(e,t,a){requiredArgs(2,arguments);var s=differenceInMilliseconds(e,t)/millisecondsInMinute;return getRoundingMethod(void 0)(s)}function endOfDay(e){requiredArgs(1,arguments);var t=toDate(e);return t.setHours(23,59,59,999),t}function endOfMonth(e){requiredArgs(1,arguments);var t=toDate(e),a=getMonth$1(t);return setFullYear(t,getFullYear(t),a+1,0),t.setHours(23,59,59,999),t}function isLastDayOfMonth(e){requiredArgs(1,arguments);var t=toDate(e);return endOfDay(t).getTime()===endOfMonth(t).getTime()}function differenceInMonths(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toDate(t),n=compareAsc(a,s),i=Math.abs(differenceInCalendarMonths(a,s)),o;if(i<1)o=0;else{getMonth$1(a)===11&&getDate$1(a)>28&&setDate$1(a,30),setMonth$1(a,getMonth$1(a)-n*i);var u=compareAsc(a,s)===-n;isLastDayOfMonth(toDate(e))&&i===1&&compareAsc(e,s)===1&&(u=!1),o=n*(i-Number(u))}return o===0?0:o}function differenceInQuarters(e,t,a){requiredArgs(2,arguments);var s=differenceInMonths(e,t)/3;return getRoundingMethod(void 0)(s)}function differenceInSeconds(e,t,a){requiredArgs(2,arguments);var s=differenceInMilliseconds(e,t)/1e3;return getRoundingMethod(void 0)(s)}function differenceInWeeks(e,t,a){requiredArgs(2,arguments);var s=differenceInDays(e,t)/7;return getRoundingMethod(void 0)(s)}function differenceInYears(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toDate(t),n=compareAsc(a,s),i=Math.abs(differenceInCalendarYears(a,s));setFullYear(a,1399),setFullYear(s,1399);var o=compareAsc(a,s)===-n,u=n*(i-Number(o));return u===0?0:u}function eachDayOfInterval(e,t){var a;requiredArgs(1,arguments);var s=e||{},n=toDate(s.start),i=toDate(s.end),o=i.getTime();if(!(n.getTime()<=o))throw new RangeError("Invalid interval");var u=[],l=n;l.setHours(0,0,0,0);var c=Number((a=void 0)!==null&&a!==void 0?a:1);if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number greater than 1");for(;l.getTime()<=o;)u.push(toDate(l)),setDate$1(l,getDate$1(l)+c),l.setHours(0,0,0,0);return u}function startOfMonth(e){requiredArgs(1,arguments);var t=toDate(e);return setDate$1(t,1),t.setHours(0,0,0,0),t}function endOfYear(e){requiredArgs(1,arguments);var t=toDate(e),a=getFullYear(t);return setFullYear(t,a+1,0,0),t.setHours(23,59,59,999),t}function startOfYear(e){requiredArgs(1,arguments);var t=toDate(e),a=newDate(0);return setFullYear(a,getFullYear(t),0,1),a.setHours(0,0,0,0),a}function endOfWeek(e,t){var a,s,n,i,o,u,l,c;requiredArgs(1,arguments);var _=getDefaultOptions(),p=toInteger((a=(s=(n=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:_.weekStartsOn)!==null&&s!==void 0?s:(l=_.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&a!==void 0?a:6);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=toDate(e),E=d.getDay(),R=(E1?i-1:0),u=1;u=n.getTime()?a+1:t.getTime()>=o.getTime()?a:a-1}function startOfUTCISOWeekYear(e){requiredArgs(1,arguments);var t=getUTCISOWeekYear(e),a=new Date(0);a.setUTCFullYear(t,0,4),a.setUTCHours(0,0,0,0);var s=startOfUTCISOWeek(a);return s}var MILLISECONDS_IN_WEEK$1=6048e5;function getUTCISOWeek(e){requiredArgs(1,arguments);var t=toDate(e),a=startOfUTCISOWeek(t).getTime()-startOfUTCISOWeekYear(t).getTime();return Math.round(a/MILLISECONDS_IN_WEEK$1)+1}function getUTCDate(e){var t=e.getUTCDate(),a=e.getUTCMonth()+1,s=e.getUTCFullYear();return toJalaali(s,a,t).jd}function setUTCDate(e){for(var t=e.getUTCDate(),a=e.getUTCMonth()+1,s=e.getUTCFullYear(),n=toJalaali(s,a,t),i=arguments.length,o=new Array(i>1?i-1:0),u=1;u=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=toDate(e),E=d.getUTCDay(),R=(E=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var R=newDate(0);setUTCFullYear(R,p+1,0,E),R.setUTCHours(0,0,0,0);var y=startOfUTCWeek(R,t),I=newDate(0);setUTCFullYear(I,p,0,E),I.setUTCHours(0,0,0,0);var A=startOfUTCWeek(I,t);return _.getTime()>=y.getTime()?p+1:_.getTime()>=A.getTime()?p:p-1}function startOfUTCWeekYear(e,t){var a,s,n,i,o,u,l,c;requiredArgs(1,arguments);var _=getDefaultOptions(),p=toInteger((a=(s=(n=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:_.firstWeekContainsDate)!==null&&s!==void 0?s:(l=_.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&a!==void 0?a:1),d=getUTCWeekYear(e,t),E=newDate(0);setUTCFullYear(E,d,0,p),E.setUTCHours(0,0,0,0);var R=startOfUTCWeek(E,t);return R}var MILLISECONDS_IN_WEEK=6048e5;function getUTCWeek(e,t){requiredArgs(1,arguments);var a=toDate(e),s=startOfUTCWeek(a,t).getTime()-startOfUTCWeekYear(a,t).getTime();return Math.round(s/MILLISECONDS_IN_WEEK)+1}function addLeadingZeros(e,t){for(var a=e<0?"-":"",s=Math.abs(e).toString();s.length0?a:1-a;return addLeadingZeros(t==="yy"?s%100:s,t.length)},M:function(e,t){var a=getUTCMonth(e);return t==="M"?String(a+1):addLeadingZeros(a+1,2)},d:function(e,t){return addLeadingZeros(getUTCDate(e),t.length)},a:function(e,t){var a=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h:function(e,t){return addLeadingZeros(e.getUTCHours()%12||12,t.length)},H:function(e,t){return addLeadingZeros(e.getUTCHours(),t.length)},m:function(e,t){return addLeadingZeros(e.getUTCMinutes(),t.length)},s:function(e,t){return addLeadingZeros(e.getUTCSeconds(),t.length)},S:function(e,t){var a=t.length,s=e.getUTCMilliseconds(),n=Math.floor(s*Math.pow(10,a-3));return addLeadingZeros(n,t.length)}},dayPeriodEnum={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters={G:function(e,t,a){var s=getUTCFullYear(e)>0?1:0;switch(t){case"G":case"GG":case"GGG":return a.era(s,{width:"abbreviated"});case"GGGGG":return a.era(s,{width:"narrow"});case"GGGG":default:return a.era(s,{width:"wide"})}},y:function(e,t,a){if(t==="yo"){var s=getUTCFullYear(e),n=s>0?s:1-s;return a.ordinalNumber(n,{unit:"year"})}return formatters$1.y(e,t)},Y:function(e,t,a,s){var n=getUTCWeekYear(e,s),i=n>0?n:1-n;if(t==="YY"){var o=i%100;return addLeadingZeros(o,2)}return t==="Yo"?a.ordinalNumber(i,{unit:"year"}):addLeadingZeros(i,t.length)},R:function(e,t){var a=getUTCISOWeekYear(e);return addLeadingZeros(a,t.length)},u:function(e,t){var a=getUTCFullYear(e);return addLeadingZeros(a,t.length)},Q:function(e,t,a){var s=Math.ceil((getUTCMonth(e)+1)/3);switch(t){case"Q":return String(s);case"QQ":return addLeadingZeros(s,2);case"Qo":return a.ordinalNumber(s,{unit:"quarter"});case"QQQ":return a.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(s,{width:"wide",context:"formatting"})}},q:function(e,t,a){var s=Math.ceil((getUTCMonth(e)+1)/3);switch(t){case"q":return String(s);case"qq":return addLeadingZeros(s,2);case"qo":return a.ordinalNumber(s,{unit:"quarter"});case"qqq":return a.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(s,{width:"wide",context:"standalone"})}},M:function(e,t,a){var s=getUTCMonth(e);switch(t){case"M":case"MM":return formatters$1.M(e,t);case"Mo":return a.ordinalNumber(s+1,{unit:"month"});case"MMM":return a.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(s,{width:"wide",context:"formatting"})}},L:function(e,t,a){var s=getUTCMonth(e);switch(t){case"L":return String(s+1);case"LL":return addLeadingZeros(s+1,2);case"Lo":return a.ordinalNumber(s+1,{unit:"month"});case"LLL":return a.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(s,{width:"wide",context:"standalone"})}},w:function(e,t,a,s){var n=getUTCWeek(e,s);return t==="wo"?a.ordinalNumber(n,{unit:"week"}):addLeadingZeros(n,t.length)},I:function(e,t,a){var s=getUTCISOWeek(e);return t==="Io"?a.ordinalNumber(s,{unit:"week"}):addLeadingZeros(s,t.length)},d:function(e,t,a){return t==="do"?a.ordinalNumber(getUTCDate(e),{unit:"date"}):formatters$1.d(e,t)},D:function(e,t,a){var s=getUTCDayOfYear(e);return t==="Do"?a.ordinalNumber(s,{unit:"dayOfYear"}):addLeadingZeros(s,t.length)},E:function(e,t,a){var s=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return a.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(s,{width:"short",context:"formatting"});case"EEEE":default:return a.day(s,{width:"wide",context:"formatting"})}},e:function(e,t,a,s){var n=e.getUTCDay(),i=(n-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return addLeadingZeros(i,2);case"eo":return a.ordinalNumber(i,{unit:"day"});case"eee":return a.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(n,{width:"short",context:"formatting"});case"eeee":default:return a.day(n,{width:"wide",context:"formatting"})}},c:function(e,t,a,s){var n=e.getUTCDay(),i=(n-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return addLeadingZeros(i,t.length);case"co":return a.ordinalNumber(i,{unit:"day"});case"ccc":return a.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(n,{width:"narrow",context:"standalone"});case"cccccc":return a.day(n,{width:"short",context:"standalone"});case"cccc":default:return a.day(n,{width:"wide",context:"standalone"})}},i:function(e,t,a){var s=e.getUTCDay(),n=s===0?7:s;switch(t){case"i":return String(n);case"ii":return addLeadingZeros(n,t.length);case"io":return a.ordinalNumber(n,{unit:"day"});case"iii":return a.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(s,{width:"short",context:"formatting"});case"iiii":default:return a.day(s,{width:"wide",context:"formatting"})}},a:function(e,t,a){var s=e.getUTCHours(),n=s/12>=1?"pm":"am";switch(t){case"a":case"aa":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,a){var s=e.getUTCHours(),n;switch(s===12?n=dayPeriodEnum.noon:s===0?n=dayPeriodEnum.midnight:n=s/12>=1?"pm":"am",t){case"b":case"bb":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,a){var s=e.getUTCHours(),n;switch(s>=17?n=dayPeriodEnum.evening:s>=12?n=dayPeriodEnum.afternoon:s>=4?n=dayPeriodEnum.morning:n=dayPeriodEnum.night,t){case"B":case"BB":case"BBB":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,a){if(t==="ho"){var s=e.getUTCHours()%12;return s===0&&(s=12),a.ordinalNumber(s,{unit:"hour"})}return formatters$1.h(e,t)},H:function(e,t,a){return t==="Ho"?a.ordinalNumber(e.getUTCHours(),{unit:"hour"}):formatters$1.H(e,t)},K:function(e,t,a){var s=e.getUTCHours()%12;return t==="Ko"?a.ordinalNumber(s,{unit:"hour"}):addLeadingZeros(s,t.length)},k:function(e,t,a){var s=e.getUTCHours();return s===0&&(s=24),t==="ko"?a.ordinalNumber(s,{unit:"hour"}):addLeadingZeros(s,t.length)},m:function(e,t,a){return t==="mo"?a.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):formatters$1.m(e,t)},s:function(e,t,a){return t==="so"?a.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):formatters$1.s(e,t)},S:function(e,t){return formatters$1.S(e,t)},X:function(e,t,a,s){var n=s._originalDate||e,i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return formatTimezoneWithOptionalMinutes(i);case"XXXX":case"XX":return formatTimezone(i);case"XXXXX":case"XXX":default:return formatTimezone(i,":")}},x:function(e,t,a,s){var n=s._originalDate||e,i=n.getTimezoneOffset();switch(t){case"x":return formatTimezoneWithOptionalMinutes(i);case"xxxx":case"xx":return formatTimezone(i);case"xxxxx":case"xxx":default:return formatTimezone(i,":")}},O:function(e,t,a,s){var n=s._originalDate||e,i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(i,":");case"OOOO":default:return"GMT"+formatTimezone(i,":")}},z:function(e,t,a,s){var n=s._originalDate||e,i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(i,":");case"zzzz":default:return"GMT"+formatTimezone(i,":")}},t:function(e,t,a,s){var n=s._originalDate||e,i=Math.floor(n.getTime()/1e3);return addLeadingZeros(i,t.length)},T:function(e,t,a,s){var n=s._originalDate||e,i=n.getTime();return addLeadingZeros(i,t.length)}};function formatTimezoneShort(e,t){var a=e>0?"-":"+",s=Math.abs(e),n=Math.floor(s/60),i=s%60;if(i===0)return a+String(n);var o=t;return a+String(n)+o+addLeadingZeros(i,2)}function formatTimezoneWithOptionalMinutes(e,t){if(e%60===0){var a=e>0?"-":"+";return a+addLeadingZeros(Math.abs(e)/60,2)}return formatTimezone(e,t)}function formatTimezone(e,t){var a=t||"",s=e>0?"-":"+",n=Math.abs(e),i=addLeadingZeros(Math.floor(n/60),2),o=addLeadingZeros(n%60,2);return s+i+a+o}var dateLongFormatter=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},timeLongFormatter=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},dateTimeLongFormatter=function(e,t){var a=e.match(/(P+)(p+)?/)||[],s=a[1],n=a[2];if(!n)return dateLongFormatter(e,t);var i;switch(s){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",dateLongFormatter(s,t)).replace("{{time}}",timeLongFormatter(n,t))},longFormatters$2={p:timeLongFormatter,P:dateTimeLongFormatter},protectedDayOfYearTokens=["D","DD"],protectedWeekYearTokens=["YY","YYYY"];function isProtectedDayOfYearToken(e){return protectedDayOfYearTokens.indexOf(e)!==-1}function isProtectedWeekYearToken(e){return protectedWeekYearTokens.indexOf(e)!==-1}function throwProtectedError(e,t,a){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(a,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(a,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(a,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(a,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var formatDistanceLocale$1={lessThanXSeconds:{one:"کمتر از یک ثانیه",other:"کمتر از {{count}} ثانیه"},xSeconds:{one:"1 ثانیه",other:"{{count}} ثانیه"},halfAMinute:"نیم دقیقه",lessThanXMinutes:{one:"کمتر از یک دقیقه",other:"کمتر از {{count}} دقیقه"},xMinutes:{one:"1 دقیقه",other:"{{count}} دقیقه"},aboutXHours:{one:"حدود 1 ساعت",other:"حدود {{count}} ساعت"},xHours:{one:"1 ساعت",other:"{{count}} ساعت"},xDays:{one:"1 روز",other:"{{count}} روز"},aboutXWeeks:{one:"حدود 1 هفته",other:"حدود {{count}} هفته"},xWeeks:{one:"1 هفته",other:"{{count}} هفته"},aboutXMonths:{one:"حدود 1 ماه",other:"حدود {{count}} ماه"},xMonths:{one:"1 ماه",other:"{{count}} ماه"},aboutXYears:{one:"حدود 1 سال",other:"حدود {{count}} سال"},xYears:{one:"1 سال",other:"{{count}} سال"},overXYears:{one:"بیشتر از 1 سال",other:"بیشتر از {{count}} سال"},almostXYears:{one:"نزدیک 1 سال",other:"نزدیک {{count}} سال"}},formatDistance$1=function(e,t,a){var s,n=formatDistanceLocale$1[e];return typeof n=="string"?s=n:t===1?s=n.one:s=n.other.replace("{{count}}",t.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"در "+s:s+" قبل":s};function buildFormatLongFn$1(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=t.width?String(t.width):e.defaultWidth,s=e.formats[a]||e.formats[e.defaultWidth];return s}}var dateFormats$1={full:"EEEE do MMMM y",long:"do MMMM y",medium:"d MMM y",short:"yyyy/MM/dd"},timeFormats$1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats$1={full:"{{date}} 'در' {{time}}",long:"{{date}} 'در' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$1={date:buildFormatLongFn$1({formats:dateFormats$1,defaultWidth:"full"}),time:buildFormatLongFn$1({formats:timeFormats$1,defaultWidth:"full"}),dateTime:buildFormatLongFn$1({formats:dateTimeFormats$1,defaultWidth:"full"})},formatRelativeLocale$1={lastWeek:"eeee 'گذشته در' p",yesterday:"'دیروز در' p",today:"'امروز در' p",tomorrow:"'فردا در' p",nextWeek:"eeee 'در' p",other:"P"},formatRelative$1=function(e,t,a,s){return formatRelativeLocale$1[e]};function buildLocalizeFn$1(e){return function(t,a){var s=a!=null&&a.context?String(a.context):"standalone",n;if(s==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,o=a!=null&&a.width?String(a.width):i;n=e.formattingValues[o]||e.formattingValues[i]}else{var u=e.defaultWidth,l=a!=null&&a.width?String(a.width):e.defaultWidth;n=e.values[l]||e.values[u]}var c=e.argumentCallback?e.argumentCallback(t):t;return n[c]}}var eraValues$1={narrow:["ق","ب"],abbreviated:["ق.ه.","ب.ه."],wide:["قبل از هجرت","بعد از هجرت"]},quarterValues$1={narrow:["1","2","3","4"],abbreviated:["س‌م1","س‌م2","س‌م3","س‌م4"],wide:["سه‌ماهه 1","سه‌ماهه 2","سه‌ماهه 3","سه‌ماهه 4"]},monthValues$1={narrow:["فر","ار","خر","تی","مر","شه","مه","آب","آذ","دی","به","اس"],abbreviated:["فرو","ارد","خرد","تیر","مرد","شهر","مهر","آبا","آذر","دی","بهم","اسف"],wide:["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"]},dayValues$1={narrow:["ی","د","س","چ","پ","ج","ش"],short:["1ش","2ش","3ش","4ش","5ش","ج","ش"],abbreviated:["یک‌شنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنج‌شنبه","جمعه","شنبه"],wide:["یک‌شنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنج‌شنبه","جمعه","شنبه"]},dayPeriodValues$1={narrow:{am:"ق",pm:"ب",midnight:"ن",noon:"ظ",morning:"ص",afternoon:"ب.ظ.",evening:"ع",night:"ش"},abbreviated:{am:"ق.ظ.",pm:"ب.ظ.",midnight:"نیمه‌شب",noon:"ظهر",morning:"صبح",afternoon:"بعدازظهر",evening:"عصر",night:"شب"},wide:{am:"قبل‌ازظهر",pm:"بعدازظهر",midnight:"نیمه‌شب",noon:"ظهر",morning:"صبح",afternoon:"بعدازظهر",evening:"عصر",night:"شب"}},formattingDayPeriodValues$1={narrow:{am:"ق",pm:"ب",midnight:"ن",noon:"ظ",morning:"ص",afternoon:"ب.ظ.",evening:"ع",night:"ش"},abbreviated:{am:"ق.ظ.",pm:"ب.ظ.",midnight:"نیمه‌شب",noon:"ظهر",morning:"صبح",afternoon:"بعدازظهر",evening:"عصر",night:"شب"},wide:{am:"قبل‌ازظهر",pm:"بعدازظهر",midnight:"نیمه‌شب",noon:"ظهر",morning:"صبح",afternoon:"بعدازظهر",evening:"عصر",night:"شب"}},ordinalNumber$1=function(e,t){var a=Number(e);return a+"-ام"},localize$1={ordinalNumber:ordinalNumber$1,era:buildLocalizeFn$1({values:eraValues$1,defaultWidth:"wide"}),quarter:buildLocalizeFn$1({values:quarterValues$1,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:buildLocalizeFn$1({values:monthValues$1,defaultWidth:"wide"}),day:buildLocalizeFn$1({values:dayValues$1,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn$1({values:dayPeriodValues$1,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$1,defaultFormattingWidth:"wide"})};function buildMatchFn$1(e){return function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=a.width,n=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(n);if(!i)return null;var o=i[0],u=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(u)?findIndex$2(u,function(p){return p.test(o)}):findKey$1(u,function(p){return p.test(o)}),c;c=e.valueCallback?e.valueCallback(l):l,c=a.valueCallback?a.valueCallback(c):c;var _=t.slice(o.length);return{value:c,rest:_}}}function findKey$1(e,t){for(var a in e)if(e.hasOwnProperty(a)&&t(e[a]))return a}function findIndex$2(e,t){for(var a=0;a1&&arguments[1]!==void 0?arguments[1]:{},s=t.match(e.matchPattern);if(!s)return null;var n=s[0],i=t.match(e.parsePattern);if(!i)return null;var o=e.valueCallback?e.valueCallback(i[0]):i[0];o=a.valueCallback?a.valueCallback(o):o;var u=t.slice(n.length);return{value:o,rest:u}}}var matchOrdinalNumberPattern$1=/^(\d+)(-?ام)?/i,parseOrdinalNumberPattern$1=/\d+/i,matchEraPatterns$1={narrow:/^(ق|ب)/i,abbreviated:/^(ق\.?\s?ه\.?|ب\.?\s?ه\.?|ه\.?)/i,wide:/^(قبل از هجرت|هجری شمسی|بعد از هجرت)/i},parseEraPatterns$1={any:[/^قبل/i,/^بعد/i]},matchQuarterPatterns$1={narrow:/^[1234]/i,abbreviated:/^(ف|Q|س‌م)[1234]/i,wide:/^(فصل|quarter|سه‌ماهه) [1234](-ام|ام)?/i},parseQuarterPatterns$1={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$1={narrow:/^(فر|ار|خر|تی|مر|شه|مه|آب|آذ|دی|به|اس)/i,abbreviated:/^(فرو|ارد|خرد|تیر|مرد|شهر|مهر|آبا|آذر|دی|بهم|اسف)/i,wide:/^(فروردین|اردیبهشت|خرداد|تیر|مرداد|شهریور|مهر|آبان|آذر|دی|بهمن|اسفند)/i},parseMonthPatterns$1={narrow:[/^فر/i,/^ار/i,/^خر/i,/^تی/i,/^مر/i,/^شه/i,/^مه/i,/^آب/i,/^آذ/i,/^دی/i,/^به/i,/^اس/i],any:[/^فر/i,/^ار/i,/^خر/i,/^تی/i,/^مر/i,/^شه/i,/^مه/i,/^آب/i,/^آذ/i,/^دی/i,/^به/i,/^اس/i]},matchDayPatterns$1={narrow:/^[شیدسچپج]/i,short:/^(ش|ج|1ش|2ش|3ش|4ش|5ش)/i,abbreviated:/^(یکشنبه|دوشنبه|سه‌شنبه|چهارشنبه|پنج‌شنبه|جمعه|شنبه)/i,wide:/^(یکشنبه|دوشنبه|سه‌شنبه|چهارشنبه|پنج‌شنبه|جمعه|شنبه)/i},parseDayPatterns$1={narrow:[/^ی/i,/^دو/i,/^س/i,/^چ/i,/^پ/i,/^ج/i,/^ش/i],any:[/^(ی|1ش|یکشنبه)/i,/^(د|2ش|دوشنبه)/i,/^(س|3ش|سه‌شنبه)/i,/^(چ|4ش|چهارشنبه)/i,/^(پ|5ش|پنجشنبه)/i,/^(ج|جمعه)/i,/^(ش|شنبه)/i]},matchDayPeriodPatterns$1={narrow:/^(ب|ق|ن|ظ|ص|ب.ظ.|ع|ش)/i,any:/^(ق.ظ.|ب.ظ.|قبل‌ازظهر|نیمه‌شب|ظهر|صبح|بعدازظهر|عصر|شب)/i},parseDayPeriodPatterns$1={any:{am:/^(ق|ق.ظ.|قبل‌ازظهر)/i,pm:/^(ب|ب.ظ.|بعدازظهر)/i,midnight:/^(‌نیمه‌شب|ن)/i,noon:/^(ظ|ظهر)/i,morning:/^(ص|صبح)/i,afternoon:/^(ب|ب.ظ.|بعدازظهر)/i,evening:/^(ع|عصر)/i,night:/^(ش|شب)/i}},match$1={ordinalNumber:buildMatchPatternFn$1({matchPattern:matchOrdinalNumberPattern$1,parsePattern:parseOrdinalNumberPattern$1,valueCallback:function(e){return parseInt(e,10)}}),era:buildMatchFn$1({matchPatterns:matchEraPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$1,defaultParseWidth:"any"}),quarter:buildMatchFn$1({matchPatterns:matchQuarterPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$1,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:buildMatchFn$1({matchPatterns:matchMonthPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$1,defaultParseWidth:"any"}),day:buildMatchFn$1({matchPatterns:matchDayPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$1,defaultParseWidth:"any"}),dayPeriod:buildMatchFn$1({matchPatterns:matchDayPeriodPatterns$1,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$1,defaultParseWidth:"any"})},locale$1={code:"fa-IR",formatDistance:formatDistance$1,formatLong:formatLong$1,formatRelative:formatRelative$1,localize:localize$1,match:match$1,options:{weekStartsOn:6,firstWeekContainsDate:1}},formattingTokensRegExp$1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp$1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp$1=/^'([^]*?)'?$/,doubleQuoteRegExp$1=/''/g,unescapedLatinCharacterRegExp$1=/[a-zA-Z]/;function format(e,t,a){var s,n,i,o,u,l,c,_,p,d,E,R,y,I,A,x,g,T;requiredArgs(2,arguments);var O=String(t),C=getDefaultOptions(),U=(s=(n=a==null?void 0:a.locale)!==null&&n!==void 0?n:C.locale)!==null&&s!==void 0?s:locale$1,L=toInteger((i=(o=(u=(l=a==null?void 0:a.firstWeekContainsDate)!==null&&l!==void 0?l:a==null||(c=a.locale)===null||c===void 0||(_=c.options)===null||_===void 0?void 0:_.firstWeekContainsDate)!==null&&u!==void 0?u:C.firstWeekContainsDate)!==null&&o!==void 0?o:(p=C.locale)===null||p===void 0||(d=p.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(L>=1&&L<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=toInteger((E=(R=(y=(I=a==null?void 0:a.weekStartsOn)!==null&&I!==void 0?I:a==null||(A=a.locale)===null||A===void 0||(x=A.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&y!==void 0?y:C.weekStartsOn)!==null&&R!==void 0?R:(g=C.locale)===null||g===void 0||(T=g.options)===null||T===void 0?void 0:T.weekStartsOn)!==null&&E!==void 0?E:6);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!U.localize)throw new RangeError("locale must contain localize property");if(!U.formatLong)throw new RangeError("locale must contain formatLong property");var X=toDate(e);if(!isValid(X))throw new RangeError("Invalid time value");var B=getTimezoneOffsetInMilliseconds(X),H=subMilliseconds(X,B),W={firstWeekContainsDate:L,weekStartsOn:j,locale:U,_originalDate:X},K=O.match(longFormattingTokensRegExp$1).map(function(b){var k=b[0];if(k==="p"||k==="P"){var F=longFormatters$2[k];return F(b,U.formatLong)}return b}).join("").match(formattingTokensRegExp$1).map(function(b){if(b==="''")return"'";var k=b[0];if(k==="'")return cleanEscapedString$1(b);var F=formatters[k];if(F)return!(a!=null&&a.useAdditionalWeekYearTokens)&&isProtectedWeekYearToken(b)&&throwProtectedError(b,t,String(e)),!(a!=null&&a.useAdditionalDayOfYearTokens)&&isProtectedDayOfYearToken(b)&&throwProtectedError(b,t,String(e)),F(H,b,U.localize,W);if(k.match(unescapedLatinCharacterRegExp$1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return b}).join("");return K}function cleanEscapedString$1(e){var t=e.match(escapedStringRegExp$1);return t?t[1].replace(doubleQuoteRegExp$1,"'"):e}function assign(e,t){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}function formatISO(e,t){var a,s;requiredArgs(1,arguments);var n=toDate(e);if(isNaN(n.getTime()))throw new RangeError("Invalid time value");var i=String((a=t==null?void 0:t.format)!==null&&a!==void 0?a:"extended"),o=String((s=t==null?void 0:t.representation)!==null&&s!==void 0?s:"complete");if(i!=="extended"&&i!=="basic")throw new RangeError("format must be 'extended' or 'basic'");if(o!=="date"&&o!=="time"&&o!=="complete")throw new RangeError("representation must be 'date', 'time', or 'complete'");var u="",l="",c=i==="extended"?"-":"",_=i==="extended"?":":"";if(o!=="time"){var p=addLeadingZeros(n.getDate(),2),d=addLeadingZeros(n.getMonth()+1,2),E=addLeadingZeros(n.getFullYear(),4);u="".concat(E).concat(c).concat(d).concat(c).concat(p)}if(o!=="date"){var R=n.getTimezoneOffset();if(R!==0){var y=Math.abs(R),I=addLeadingZeros(Math.floor(y/60),2),A=addLeadingZeros(y%60,2),x=R<0?"+":"-";l="".concat(x).concat(I,":").concat(A)}else l="Z";var g=addLeadingZeros(n.getHours(),2),T=addLeadingZeros(n.getMinutes(),2),O=addLeadingZeros(n.getSeconds(),2),C=u===""?"":"T",U=[g,T,O].join(_);u="".concat(u).concat(C).concat(U).concat(l)}return u}function getDate(e){requiredArgs(1,arguments);var t=toDate(e),a=getDate$1(t);return a}function getDay(e){requiredArgs(1,arguments);var t=toDate(e),a=t.getDay();return a}function getDaysInMonth(e){requiredArgs(1,arguments);var t=toDate(e),a=getFullYear(t),s=getMonth$1(t),n=newDate(0);return setFullYear(n,a,s+1,0),n.setHours(0,0,0,0),getDate$1(n)}function isLeapYear$1(e){return isLeapJalaaliYear(e)}function isLeapYear(e){requiredArgs(1,arguments);var t=toDate(e),a=getFullYear(t);return isLeapYear$1(a)}function getHours(e){requiredArgs(1,arguments);var t=toDate(e),a=t.getHours();return a}function getMinutes(e){requiredArgs(1,arguments);var t=toDate(e),a=t.getMinutes();return a}function getMonth(e){requiredArgs(1,arguments);var t=toDate(e),a=getMonth$1(t);return a}function getSeconds(e){requiredArgs(1,arguments);var t=toDate(e),a=t.getSeconds();return a}function getYear(e){return requiredArgs(1,arguments),getFullYear(toDate(e))}function isAfter(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toDate(t);return a.getTime()>s.getTime()}function isBefore(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toDate(t);return a.getTime()0,s=a?t:1-t,n;if(s<=50)n=e||100;else{var i=s+50,o=Math.floor(i/100)*100,u=e>=i%100;n=e+o-(u?100:0)}return a?n:1-n}function isLeapYearIndex$1(e){return isLeapYear(newDate(e,0))}function _defineProperty$v(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class YearParser extends Parser{constructor(){super(...arguments),_defineProperty$v(this,"priority",130),_defineProperty$v(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(t,a,s){var n=function(i){return{year:i,isTwoDigitYear:a==="yy"}};switch(a){case"y":return mapValue(parseNDigits(4,t),n);case"yo":return mapValue(s.ordinalNumber(t,{unit:"year"}),n);default:return mapValue(parseNDigits(a.length,t),n)}}validate(t,a){return a.isTwoDigitYear||a.year>0}set(t,a,s){var n=getUTCFullYear(t);if(s.isTwoDigitYear){var i=normalizeTwoDigitYear(s.year,n);return setUTCFullYear(t,i,0,1),t.setUTCHours(0,0,0,0),t}var o=!("era"in a)||a.era===1?s.year:1-s.year;return setUTCFullYear(t,o,0,1),t.setUTCHours(0,0,0,0),t}}function _defineProperty$u(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class LocalWeekYearParser extends Parser{constructor(){super(...arguments),_defineProperty$u(this,"priority",130),_defineProperty$u(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(t,a,s){var n=function(i){return{year:i,isTwoDigitYear:a==="YY"}};switch(a){case"Y":return mapValue(parseNDigits(4,t),n);case"Yo":return mapValue(s.ordinalNumber(t,{unit:"year"}),n);default:return mapValue(parseNDigits(a.length,t),n)}}validate(t,a){return a.isTwoDigitYear||a.year>0}set(t,a,s,n){var i=getUTCWeekYear(t,n);if(s.isTwoDigitYear){var o=normalizeTwoDigitYear(s.year,i);return setUTCFullYear(t,o,0,n.firstWeekContainsDate),t.setUTCHours(0,0,0,0),startOfUTCWeek(t,n)}var u=!("era"in a)||a.era===1?s.year:1-s.year;return setUTCFullYear(t,u,0,n.firstWeekContainsDate),t.setUTCHours(0,0,0,0),startOfUTCWeek(t,n)}}function _defineProperty$t(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class ISOWeekYearParser extends Parser{constructor(){super(...arguments),_defineProperty$t(this,"priority",130),_defineProperty$t(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(t,a){return parseNDigitsSigned(a==="R"?4:a.length,t)}set(t,a,s){var n=newDate(0);return setUTCFullYear(n,s,0,4),n.setUTCHours(0,0,0,0),startOfUTCISOWeek(n)}}function _defineProperty$s(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class ExtendedYearParser extends Parser{constructor(){super(...arguments),_defineProperty$s(this,"priority",130),_defineProperty$s(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(t,a){return parseNDigitsSigned(a==="u"?4:a.length,t)}set(t,a,s){return setUTCFullYear(t,s,0,1),t.setUTCHours(0,0,0,0),t}}function _defineProperty$r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class QuarterParser extends Parser{constructor(){super(...arguments),_defineProperty$r(this,"priority",120),_defineProperty$r(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,a,s){switch(a){case"Q":case"QQ":return parseNDigits(a.length,t);case"Qo":return s.ordinalNumber(t,{unit:"quarter"});case"QQQ":return s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(t,{width:"wide",context:"formatting"})||s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,a){return a>=1&&a<=4}set(t,a,s){return setUTCMonth(t,(s-1)*3,1),t.setUTCHours(0,0,0,0),t}}function _defineProperty$q(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class StandAloneQuarterParser extends Parser{constructor(){super(...arguments),_defineProperty$q(this,"priority",120),_defineProperty$q(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,a,s){switch(a){case"q":case"qq":return parseNDigits(a.length,t);case"qo":return s.ordinalNumber(t,{unit:"quarter"});case"qqq":return s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(t,{width:"wide",context:"standalone"})||s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,a){return a>=1&&a<=4}set(t,a,s){return setUTCMonth(t,(s-1)*3,1),t.setUTCHours(0,0,0,0),t}}function _defineProperty$p(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class MonthParser extends Parser{constructor(){super(...arguments),_defineProperty$p(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),_defineProperty$p(this,"priority",110)}parse(t,a,s){var n=function(i){return i-1};switch(a){case"M":return mapValue(parseNumericPattern(numericPatterns.month,t),n);case"MM":return mapValue(parseNDigits(2,t),n);case"Mo":return mapValue(s.ordinalNumber(t,{unit:"month"}),n);case"MMM":return s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(t,{width:"wide",context:"formatting"})||s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"})}}validate(t,a){return a>=0&&a<=11}set(t,a,s){return setUTCMonth(t,s,1),t.setUTCHours(0,0,0,0),t}}function _defineProperty$o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class StandAloneMonthParser extends Parser{constructor(){super(...arguments),_defineProperty$o(this,"priority",110),_defineProperty$o(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(t,a,s){var n=function(i){return i-1};switch(a){case"L":return mapValue(parseNumericPattern(numericPatterns.month,t),n);case"LL":return mapValue(parseNDigits(2,t),n);case"Lo":return mapValue(s.ordinalNumber(t,{unit:"month"}),n);case"LLL":return s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(t,{width:"wide",context:"standalone"})||s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"})}}validate(t,a){return a>=0&&a<=11}set(t,a,s){return setUTCMonth(t,s,1),t.setUTCHours(0,0,0,0),t}}function setUTCWeek(e,t,a){requiredArgs(2,arguments);var s=toDate(e),n=toInteger(t),i=getUTCWeek(s,a)-n;return setUTCDate(s,getUTCDate(s)-i*7),s}function _defineProperty$n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class LocalWeekParser extends Parser{constructor(){super(...arguments),_defineProperty$n(this,"priority",100),_defineProperty$n(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(t,a,s){switch(a){case"w":return parseNumericPattern(numericPatterns.week,t);case"wo":return s.ordinalNumber(t,{unit:"week"});default:return parseNDigits(a.length,t)}}validate(t,a){return a>=1&&a<=53}set(t,a,s,n){return startOfUTCWeek(setUTCWeek(t,s,n),n)}}function setUTCISOWeek(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toInteger(t),n=getUTCISOWeek(a)-s;return a.setUTCDate(a.getUTCDate()-n*7),a}function _defineProperty$m(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class ISOWeekParser extends Parser{constructor(){super(...arguments),_defineProperty$m(this,"priority",100),_defineProperty$m(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(t,a,s){switch(a){case"I":return parseNumericPattern(numericPatterns.week,t);case"Io":return s.ordinalNumber(t,{unit:"week"});default:return parseNDigits(a.length,t)}}validate(t,a){return a>=1&&a<=53}set(t,a,s){return startOfUTCISOWeek(setUTCISOWeek(t,s))}}function _defineProperty$l(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var DAYS_IN_MONTH=[31,31,31,31,31,31,30,30,30,30,30,29],DAYS_IN_MONTH_LEAP_YEAR=[31,31,31,31,31,31,30,30,30,30,30,30];class DateParser extends Parser{constructor(){super(...arguments),_defineProperty$l(this,"priority",90),_defineProperty$l(this,"subPriority",1),_defineProperty$l(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(t,a,s){switch(a){case"d":return parseNumericPattern(numericPatterns.date,t);case"do":return s.ordinalNumber(t,{unit:"date"});default:return parseNDigits(a.length,t)}}validate(t,a){var s=getUTCFullYear(t),n=isLeapYearIndex$1(s),i=getUTCMonth(t);return n?a>=1&&a<=DAYS_IN_MONTH_LEAP_YEAR[i]:a>=1&&a<=DAYS_IN_MONTH[i]}set(t,a,s){return setUTCDate(t,s),t.setUTCHours(0,0,0,0),t}}function _defineProperty$k(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class DayOfYearParser extends Parser{constructor(){super(...arguments),_defineProperty$k(this,"priority",90),_defineProperty$k(this,"subpriority",1),_defineProperty$k(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(t,a,s){switch(a){case"D":case"DD":return parseNumericPattern(numericPatterns.dayOfYear,t);case"Do":return s.ordinalNumber(t,{unit:"date"});default:return parseNDigits(a.length,t)}}validate(t,a){var s=getUTCFullYear(t),n=isLeapYearIndex$1(s);return n?a>=1&&a<=366:a>=1&&a<=365}set(t,a,s){return setUTCMonth(t,0,s),t.setUTCHours(0,0,0,0),t}}function setUTCDay(e,t,a){var s,n,i,o,u,l,c,_;requiredArgs(2,arguments);var p=getDefaultOptions(),d=toInteger((s=(n=(i=(o=a==null?void 0:a.weekStartsOn)!==null&&o!==void 0?o:a==null||(u=a.locale)===null||u===void 0||(l=u.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&i!==void 0?i:p.weekStartsOn)!==null&&n!==void 0?n:(c=p.locale)===null||c===void 0||(_=c.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&s!==void 0?s:6);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var E=toDate(e),R=toInteger(t),y=E.getUTCDay(),I=R%7,A=(I+7)%7,x=7-d,g=R<0||R>6?R-(y+x)%7:(A+x)%7-(y+x)%7;return setUTCDate(E,getUTCDate(E)+g),E}function _defineProperty$j(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class DayParser extends Parser{constructor(){super(...arguments),_defineProperty$j(this,"priority",90),_defineProperty$j(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(t,a,s){switch(a){case"E":case"EE":case"EEE":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,a){return a>=0&&a<=6}set(t,a,s,n){return t=setUTCDay(t,s,n),t.setUTCHours(0,0,0,0),t}}function _defineProperty$i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class LocalDayParser extends Parser{constructor(){super(...arguments),_defineProperty$i(this,"priority",90),_defineProperty$i(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(t,a,s,n){var i=function(o){var u=Math.floor((o-1)/7)*7;return(o+n.weekStartsOn+6+1)%7+u};switch(a){case"e":case"ee":return mapValue(parseNDigits(a.length,t),i);case"eo":return mapValue(s.ordinalNumber(t,{unit:"day"}),i);case"eee":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeeee":return s.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,a){return a>=0&&a<=6}set(t,a,s,n){return t=setUTCDay(t,s,n),t.setUTCHours(0,0,0,0),t}}function _defineProperty$h(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class StandAloneLocalDayParser extends Parser{constructor(){super(...arguments),_defineProperty$h(this,"priority",90),_defineProperty$h(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(t,a,s,n){var i=function(o){var u=Math.floor((o-1)/7)*7;return(o+n.weekStartsOn+6+1)%7+u};switch(a){case"c":case"cc":return mapValue(parseNDigits(a.length,t),i);case"co":return mapValue(s.ordinalNumber(t,{unit:"day"}),i);case"ccc":return s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"ccccc":return s.day(t,{width:"narrow",context:"standalone"});case"cccccc":return s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(t,{width:"wide",context:"standalone"})||s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"})}}validate(t,a){return a>=0&&a<=6}set(t,a,s,n){return t=setUTCDay(t,s,n),t.setUTCHours(0,0,0,0),t}}function setUTCISODay(e,t){requiredArgs(2,arguments);var a=toInteger(t);a%7===0&&(a=a-7);var s=1,n=toDate(e),i=n.getUTCDay(),o=a%7,u=(o+7)%7,l=(u=1&&a<=7}set(t,a,s){return t=setUTCISODay(t,s),t.setUTCHours(0,0,0,0),t}}function _defineProperty$f(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class AMPMParser extends Parser{constructor(){super(...arguments),_defineProperty$f(this,"priority",80),_defineProperty$f(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(t,a,s){switch(a){case"a":case"aa":case"aaa":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,a,s){return t.setUTCHours(dayPeriodEnumToHours(s),0,0,0),t}}function _defineProperty$e(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class AMPMMidnightParser extends Parser{constructor(){super(...arguments),_defineProperty$e(this,"priority",80),_defineProperty$e(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(t,a,s){switch(a){case"b":case"bb":case"bbb":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,a,s){return t.setUTCHours(dayPeriodEnumToHours(s),0,0,0),t}}function _defineProperty$d(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class DayPeriodParser extends Parser{constructor(){super(...arguments),_defineProperty$d(this,"priority",80),_defineProperty$d(this,"incompatibleTokens",["a","b","t","T"])}parse(t,a,s){switch(a){case"B":case"BB":case"BBB":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,a,s){return t.setUTCHours(dayPeriodEnumToHours(s),0,0,0),t}}function _defineProperty$c(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Hour1to12Parser extends Parser{constructor(){super(...arguments),_defineProperty$c(this,"priority",70),_defineProperty$c(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,a,s){switch(a){case"h":return parseNumericPattern(numericPatterns.hour12h,t);case"ho":return s.ordinalNumber(t,{unit:"hour"});default:return parseNDigits(a.length,t)}}validate(t,a){return a>=1&&a<=12}set(t,a,s){var n=t.getUTCHours()>=12;return n&&s<12?t.setUTCHours(s+12,0,0,0):!n&&s===12?t.setUTCHours(0,0,0,0):t.setUTCHours(s,0,0,0),t}}function _defineProperty$b(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Hour0to23Parser extends Parser{constructor(){super(...arguments),_defineProperty$b(this,"priority",70),_defineProperty$b(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(t,a,s){switch(a){case"H":return parseNumericPattern(numericPatterns.hour23h,t);case"Ho":return s.ordinalNumber(t,{unit:"hour"});default:return parseNDigits(a.length,t)}}validate(t,a){return a>=0&&a<=23}set(t,a,s){return t.setUTCHours(s,0,0,0),t}}function _defineProperty$a(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Hour0To11Parser extends Parser{constructor(){super(...arguments),_defineProperty$a(this,"priority",70),_defineProperty$a(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,a,s){switch(a){case"K":return parseNumericPattern(numericPatterns.hour11h,t);case"Ko":return s.ordinalNumber(t,{unit:"hour"});default:return parseNDigits(a.length,t)}}validate(t,a){return a>=0&&a<=11}set(t,a,s){var n=t.getUTCHours()>=12;return n&&s<12?t.setUTCHours(s+12,0,0,0):t.setUTCHours(s,0,0,0),t}}function _defineProperty$9(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Hour1To24Parser extends Parser{constructor(){super(...arguments),_defineProperty$9(this,"priority",70),_defineProperty$9(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(t,a,s){switch(a){case"k":return parseNumericPattern(numericPatterns.hour24h,t);case"ko":return s.ordinalNumber(t,{unit:"hour"});default:return parseNDigits(a.length,t)}}validate(t,a){return a>=1&&a<=24}set(t,a,s){var n=s<=24?s%24:s;return t.setUTCHours(n,0,0,0),t}}function _defineProperty$8(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class MinuteParser extends Parser{constructor(){super(...arguments),_defineProperty$8(this,"priority",60),_defineProperty$8(this,"incompatibleTokens",["t","T"])}parse(t,a,s){switch(a){case"m":return parseNumericPattern(numericPatterns.minute,t);case"mo":return s.ordinalNumber(t,{unit:"minute"});default:return parseNDigits(a.length,t)}}validate(t,a){return a>=0&&a<=59}set(t,a,s){return t.setUTCMinutes(s,0,0),t}}function _defineProperty$7(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class SecondParser extends Parser{constructor(){super(...arguments),_defineProperty$7(this,"priority",50),_defineProperty$7(this,"incompatibleTokens",["t","T"])}parse(t,a,s){switch(a){case"s":return parseNumericPattern(numericPatterns.second,t);case"so":return s.ordinalNumber(t,{unit:"second"});default:return parseNDigits(a.length,t)}}validate(t,a){return a>=0&&a<=59}set(t,a,s){return t.setUTCSeconds(s,0),t}}function _defineProperty$6(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class FractionOfSecondParser extends Parser{constructor(){super(...arguments),_defineProperty$6(this,"priority",30),_defineProperty$6(this,"incompatibleTokens",["t","T"])}parse(t,a){var s=function(n){return Math.floor(n*Math.pow(10,-a.length+3))};return mapValue(parseNDigits(a.length,t),s)}set(t,a,s){return t.setUTCMilliseconds(s),t}}function _defineProperty$5(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class ISOTimezoneWithZParser extends Parser{constructor(){super(...arguments),_defineProperty$5(this,"priority",10),_defineProperty$5(this,"incompatibleTokens",["t","T","x"])}parse(t,a){switch(a){case"X":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,t);case"XX":return parseTimezonePattern(timezonePatterns.basic,t);case"XXXX":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,t);case"XXXXX":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,t);case"XXX":default:return parseTimezonePattern(timezonePatterns.extended,t)}}set(t,a,s){return a.timestampIsSet?t:newDate(t.getTime()-s)}}function _defineProperty$4(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class ISOTimezoneParser extends Parser{constructor(){super(...arguments),_defineProperty$4(this,"priority",10),_defineProperty$4(this,"incompatibleTokens",["t","T","X"])}parse(t,a){switch(a){case"x":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,t);case"xx":return parseTimezonePattern(timezonePatterns.basic,t);case"xxxx":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,t);case"xxxxx":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,t);case"xxx":default:return parseTimezonePattern(timezonePatterns.extended,t)}}set(t,a,s){return a.timestampIsSet?t:newDate(t.getTime()-s)}}function _defineProperty$3(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class TimestampSecondsParser extends Parser{constructor(){super(...arguments),_defineProperty$3(this,"priority",40),_defineProperty$3(this,"incompatibleTokens","*")}parse(t){return parseAnyDigitsSigned(t)}set(t,a,s){return[newDate(s*1e3),{timestampIsSet:!0}]}}function _defineProperty$2(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class TimestampMillisecondsParser extends Parser{constructor(){super(...arguments),_defineProperty$2(this,"priority",20),_defineProperty$2(this,"incompatibleTokens","*")}parse(t){return parseAnyDigitsSigned(t)}set(t,a,s){return[newDate(s),{timestampIsSet:!0}]}}var parsers={G:new EraParser,y:new YearParser,Y:new LocalWeekYearParser,R:new ISOWeekYearParser,u:new ExtendedYearParser,Q:new QuarterParser,q:new StandAloneQuarterParser,M:new MonthParser,L:new StandAloneMonthParser,w:new LocalWeekParser,I:new ISOWeekParser,d:new DateParser,D:new DayOfYearParser,E:new DayParser,e:new LocalDayParser,c:new StandAloneLocalDayParser,i:new ISODayParser,a:new AMPMParser,b:new AMPMMidnightParser,B:new DayPeriodParser,h:new Hour1to12Parser,H:new Hour0to23Parser,K:new Hour0To11Parser,k:new Hour1To24Parser,m:new MinuteParser,s:new SecondParser,S:new FractionOfSecondParser,X:new ISOTimezoneWithZParser,x:new ISOTimezoneParser,t:new TimestampSecondsParser,T:new TimestampMillisecondsParser},formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,notWhitespaceRegExp=/\S/,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function parse(e,t,a,s){var n,i,o,u,l,c,_,p,d,E,R,y,I,A,x,g,T,O;requiredArgs(3,arguments);var C=String(e),U=String(t),L=getDefaultOptions(),j=(n=(i=s==null?void 0:s.locale)!==null&&i!==void 0?i:L.locale)!==null&&n!==void 0?n:locale$1;if(!j.match)throw new RangeError("locale must contain match property");var X=toInteger((o=(u=(l=(c=s==null?void 0:s.firstWeekContainsDate)!==null&&c!==void 0?c:s==null||(_=s.locale)===null||_===void 0||(p=_.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&l!==void 0?l:L.firstWeekContainsDate)!==null&&u!==void 0?u:(d=L.locale)===null||d===void 0||(E=d.options)===null||E===void 0?void 0:E.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(X>=1&&X<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var B=toInteger((R=(y=(I=(A=s==null?void 0:s.weekStartsOn)!==null&&A!==void 0?A:s==null||(x=s.locale)===null||x===void 0||(g=x.options)===null||g===void 0?void 0:g.weekStartsOn)!==null&&I!==void 0?I:L.weekStartsOn)!==null&&y!==void 0?y:(T=L.locale)===null||T===void 0||(O=T.options)===null||O===void 0?void 0:O.weekStartsOn)!==null&&R!==void 0?R:6);if(!(B>=0&&B<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(U==="")return C===""?toDate(a):newDate(NaN);var H={firstWeekContainsDate:X,weekStartsOn:B,locale:j},W=[new DateToSystemTimezoneSetter],K=U.match(longFormattingTokensRegExp).map(function(J){var ue=J[0];if(ue in longFormatters$2){var oe=longFormatters$2[ue];return oe(J,j.formatLong)}return J}).join("").match(formattingTokensRegExp),b=[],k=function(J){!(s!=null&&s.useAdditionalWeekYearTokens)&&isProtectedWeekYearToken(J)&&throwProtectedError(J,U,e),!(s!=null&&s.useAdditionalDayOfYearTokens)&&isProtectedDayOfYearToken(J)&&throwProtectedError(J,U,e);var ue=J[0],oe=parsers[ue];if(oe){var _e=oe.incompatibleTokens;if(Array.isArray(_e)){var Y=b.find(function(te){return _e.includes(te.token)||te.token===ue});if(Y)throw new RangeError("The format string mustn't contain `".concat(Y.fullToken,"` and `").concat(J,"` at the same time"))}else if(oe.incompatibleTokens==="*"&&b.length>0)throw new RangeError("The format string mustn't contain `".concat(J,"` and any other token at the same time"));b.push({token:ue,fullToken:J});var Z=oe.run(C,J,j.match,H);if(!Z)return F=J,{v:newDate(NaN)};W.push(Z.setter),C=Z.rest}else{if(ue.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ue+"`");if(J==="''"?J="'":ue==="'"&&(J=cleanEscapedString(J)),C.indexOf(J)===0)C=C.slice(J.length);else return F=J,{v:newDate(NaN)}}F=J};for(var F of K){var N=k(F);if(typeof N=="object")return N.v}if(C.length>0&¬WhitespaceRegExp.test(C))return newDate(NaN);var M=W.map(function(J){return J.priority}).sort(function(J,ue){return ue-J}).filter(function(J,ue,oe){return oe.indexOf(J)===ue}).map(function(J){return W.filter(function(ue){return ue.priority===J}).sort(function(ue,oe){return oe.subPriority-ue.subPriority})}).map(function(J){return J[0]}),G=toDate(a);if(isNaN(G.getTime()))return newDate(NaN);var V=subMilliseconds(G,getTimezoneOffsetInMilliseconds(G)),ee={};for(var ae of M){if(!ae.validate(V,H))return newDate(NaN);var ne=ae.set(V,ee,H);Array.isArray(ne)?(V=ne[0],assign(ee,ne[1])):V=ne}return V}function cleanEscapedString(e){return e.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}function startOfHour(e){requiredArgs(1,arguments);var t=toDate(e);return t.setMinutes(0,0,0),t}function isSameHour(e,t){requiredArgs(2,arguments);var a=startOfHour(e),s=startOfHour(t);return a.getTime()===s.getTime()}function isSameMonth(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toDate(t);return getFullYear(a)===getFullYear(s)&&getMonth$1(a)===getMonth$1(s)}function isSameYear(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toDate(t);return getFullYear(a)===getFullYear(s)}function isWithinInterval(e,t){requiredArgs(2,arguments);var a=toDate(e).getTime(),s=toDate(t.start).getTime(),n=toDate(t.end).getTime();if(!(s<=n))throw new RangeError("Invalid interval");return a>=s&&a<=n}function parseISO(e,t){var a;requiredArgs(1,arguments);var s=toInteger((a=void 0)!==null&&a!==void 0?a:2);if(s!==2&&s!==1&&s!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var n=splitDateString(e),i;if(n.date){var o=parseYear(n.date,s);i=parseDate(o.restDateString,o.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var u=i.getTime(),l=0,c;if(n.time&&(l=parseTime(n.time),isNaN(l)))return new Date(NaN);if(n.timezone){if(c=parseTimezone(n.timezone),isNaN(c))return new Date(NaN)}else{var _=new Date(u+l),p=new Date(0);return p.setFullYear(_.getUTCFullYear(),_.getUTCMonth(),_.getUTCDate()),p.setHours(_.getUTCHours(),_.getUTCMinutes(),_.getUTCSeconds(),_.getUTCMilliseconds()),p}return new Date(u+l+c)}var patterns={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},dateRegex=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,timeRegex=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,timezoneRegex=/^([+-])(\d{2})(?::?(\d{2}))?$/;function splitDateString(e){var t={},a=e.split(patterns.dateTimeDelimiter),s;if(a.length>2)return t;if(/:/.test(a[0])?s=a[0]:(t.date=a[0],s=a[1],patterns.timeZoneDelimiter.test(t.date)&&(t.date=e.split(patterns.timeZoneDelimiter)[0],s=e.substr(t.date.length,e.length))),s){var n=patterns.timezone.exec(s);n?(t.time=s.replace(n[1],""),t.timezone=n[1]):t.time=s}return t}function parseYear(e,t){var a=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),s=e.match(a);if(!s)return{year:NaN,restDateString:""};var n=s[1]?parseInt(s[1]):null,i=s[2]?parseInt(s[2]):null;return{year:i===null?n:i*100,restDateString:e.slice((s[1]||s[2]).length)}}function parseDate(e,t){if(t===null)return new Date(NaN);var a=e.match(dateRegex);if(!a)return new Date(NaN);var s=!!a[4],n=parseDateUnit(a[1]),i=parseDateUnit(a[2])-1,o=parseDateUnit(a[3]),u=parseDateUnit(a[4]),l=parseDateUnit(a[5])-1;if(s)return validateWeekDate(t,u,l)?dayOfISOWeekYear(t,u,l):new Date(NaN);var c=new Date(0);return!validateDate(t,i,o)||!validateDayOfYearDate(t,n)?new Date(NaN):(c.setUTCFullYear(t,i,Math.max(n,o)),c)}function parseDateUnit(e){return e?parseInt(e):1}function parseTime(e){var t=e.match(timeRegex);if(!t)return NaN;var a=parseTimeUnit(t[1]),s=parseTimeUnit(t[2]),n=parseTimeUnit(t[3]);return validateTime(a,s,n)?a*millisecondsInHour+s*millisecondsInMinute+n*1e3:NaN}function parseTimeUnit(e){return e&&parseFloat(e.replace(",","."))||0}function parseTimezone(e){if(e==="Z")return 0;var t=e.match(timezoneRegex);if(!t)return 0;var a=t[1]==="+"?-1:1,s=parseInt(t[2]),n=t[3]&&parseInt(t[3])||0;return validateTimezone(s,n)?a*(s*millisecondsInHour+n*millisecondsInMinute):NaN}function dayOfISOWeekYear(e,t,a){var s=new Date(0);s.setUTCFullYear(e,0,4);var n=s.getUTCDay()||7,i=(t-1)*7+a+1-n;return s.setUTCDate(s.getUTCDate()+i),s}var daysInMonths=[31,null,31,30,31,30,31,31,30,31,30,31];function isLeapYearIndex(e){return e%400===0||e%4===0&&e%100!==0}function validateDate(e,t,a){return t>=0&&t<=11&&a>=1&&a<=(daysInMonths[t]||(isLeapYearIndex(e)?29:28))}function validateDayOfYearDate(e,t){return t>=1&&t<=(isLeapYearIndex(e)?366:365)}function validateWeekDate(e,t,a){return t>=1&&t<=53&&a>=0&&a<=6}function validateTime(e,t,a){return e===24?t===0&&a===0:a>=0&&a<60&&t>=0&&t<60&&e>=0&&e<25}function validateTimezone(e,t){return t>=0&&t<=59}function setMonth(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toInteger(t),n=getFullYear(a),i=getDate$1(a),o=newDate(0);setFullYear(o,n,s,15),o.setHours(0,0,0,0);var u=getDaysInMonth(o);return setMonth$1(a,s,Math.min(i,u)),a}function setDate(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toInteger(t);return setDate$1(a,s),a}function setHours(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toInteger(t);return a.setHours(s),a}function setMinutes(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toInteger(t);return a.setMinutes(s),a}function setSeconds(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toInteger(t);return a.setSeconds(s),a}function setYear(e,t){requiredArgs(2,arguments);var a=toDate(e),s=toInteger(t);return isNaN(a.getTime())?newDate(NaN):(setFullYear(a,s),a)}function buildFormatLongFn(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=t.width?String(t.width):e.defaultWidth,s=e.formats[a]||e.formats[e.defaultWidth];return s}}function buildLocalizeFn(e){return function(t,a){var s=a!=null&&a.context?String(a.context):"standalone",n;if(s==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,o=a!=null&&a.width?String(a.width):i;n=e.formattingValues[o]||e.formattingValues[i]}else{var u=e.defaultWidth,l=a!=null&&a.width?String(a.width):e.defaultWidth;n=e.values[l]||e.values[u]}var c=e.argumentCallback?e.argumentCallback(t):t;return n[c]}}function buildMatchFn(e){return function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=a.width,n=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(n);if(!i)return null;var o=i[0],u=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(u)?findIndex$1(u,function(p){return p.test(o)}):findKey(u,function(p){return p.test(o)}),c;c=e.valueCallback?e.valueCallback(l):l,c=a.valueCallback?a.valueCallback(c):c;var _=t.slice(o.length);return{value:c,rest:_}}}function findKey(e,t){for(var a in e)if(e.hasOwnProperty(a)&&t(e[a]))return a}function findIndex$1(e,t){for(var a=0;a1&&arguments[1]!==void 0?arguments[1]:{},s=t.match(e.matchPattern);if(!s)return null;var n=s[0],i=t.match(e.parsePattern);if(!i)return null;var o=e.valueCallback?e.valueCallback(i[0]):i[0];o=a.valueCallback?a.valueCallback(o):o;var u=t.slice(n.length);return{value:o,rest:u}}}var formatDistanceLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},formatDistance=function e(t,a,s){var n,i=formatDistanceLocale[t];return typeof i=="string"?n=i:a===1?n=i.one:n=i.other.replace("{{count}}",a.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+n:n+" ago":n},dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})},formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative=function e(t,a,s,n){return formatRelativeLocale[t]},eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ordinalNumber=function e(t,a){var s=Number(t),n=s%100;if(n>20||n<10)switch(n%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:function e(t){return t-1}}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:function e(t){return parseInt(t,10)}}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:function e(t){return t+1}}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},locale={code:"en-US",formatDistance,formatLong,formatRelative,localize,match,options:{weekStartsOn:0,firstWeekContainsDate:1}},persianDate={exports:{}};/*! + * + * persian-date - 1.1.0 + * Reza Babakhani + * http://babakhani.github.io/PersianWebToolkit/docs/persian-date/ + * Under MIT license + * + * + */(function(e,t){(function(s,n){e.exports=n()})(commonjsGlobal,function(){return function(a){var s={};function n(i){if(s[i])return s[i].exports;var o=s[i]={i,l:!1,exports:{}};return a[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=a,n.c=s,n.i=function(i){return i},n.d=function(i,o,u){n.o(i,o)||Object.defineProperty(i,o,{configurable:!1,enumerable:!0,get:u})},n.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(o,"a",o),o},n.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},n.p="",n(n.s=8)}([function(a,s,n){var i=function(){function c(_,p){for(var d=0;d1&&arguments[1]!==void 0?arguments[1]:!1;return p.toString().replace(/\d+/g,function(E){var R=[],y=[],I=void 0,A=void 0;for(I=0;I-1?p="year":u.month.indexOf(p)>-1?p="month":u.week.indexOf(p)>-1?p="week":u.day.indexOf(p)>-1?p="day":u.hour.indexOf(p)>-1?p="hour":u.minute.indexOf(p)>-1?p="minute":u.second.indexOf(p)>-1?p="second":u.millisecond.indexOf(p)>-1&&(p="millisecond"),{unit:p,value:d}}},{key:"absRound",value:function(p){return p<0?Math.ceil(p):Math.floor(p)}},{key:"absFloor",value:function(p){return p<0?Math.ceil(p)||0:Math.floor(p)}}]),c}();a.exports=l},function(a,s,n){var i=function(){function x(g,T){for(var O=0;O1||T==6&&O<31||T<6&&T>=2}},{key:"isLeapYear",value:function(T){if(T===void 0&&(T=this.year()),this.calendarType=="persian"&&this.leapYearMode==="algorithmic")return this.algorithms.leap_persian(T);if(this.calendarType=="persian"&&this.leapYearMode==="astronomical")return this.algorithms.leap_persiana(T);if(this.calendarType=="gregorian")return this.algorithms.leap_gregorian(T)}},{key:"daysInMonth",value:function(T,O){var C=T||this.year(),U=O||this.month();if(this.calendarType==="persian")return U<1||U>12?0:U<7?31:U<12||this.isLeapYear(C)?30:29;if(this.calendarType==="gregorian")return new Date(C,U,0).getDate()}},{key:"toDate",value:function(){return this.State.gDate}},{key:"toArray",value:function(){return[this.year(),this.month(),this.date(),this.hour(),this.minute(),this.second(),this.millisecond()]}},{key:"formatNumber",value:function(){var T=void 0,O=this;return this.formatPersian==="_default"?typeof a<"u"&&typeof a.exports<"u"?O.formatPersian===!1?T=!1:T=!0:window.formatPersian===!1?T=!1:T=!0:this.formatPersian===!0?T=!0:this.formatPersian===!1&&(T=!1),T}},{key:"format",value:function(T){if(this.State.isInvalidDate)return!1;var O=this,C=/([[^[]*])|(\\)?(Mo|MM?M?M?|Do|DD?D?D?|dddddd?|ddddd?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?|X|LT|ll?l?l?|LL?L?L?)/g,U={year:O.year(),month:O.month(),hour:O.hours(),minute:O.minutes(),second:O.seconds(),date:O.date(),timezone:O.zone(),unix:O.unix()},L=O.formatNumber(),j=function(W){return L?d(W):W};function X(H){switch(H){case"a":return L?U.hour>=12?"ب ظ":"ق ظ":U.hour>=12?"PM":"AM";case"H":return j(U.hour);case"HH":return j(E(U.hour,2));case"h":return j(U.hour%12);case"hh":return j(E(U.hour%12,2));case"m":return j(E(U.minute,2));case"mm":return j(E(U.minute,2));case"s":return j(U.second);case"ss":return j(E(U.second,2));case"D":return j(E(U.date));case"DD":return j(E(U.date,2));case"DDD":{var W=O.startOf("year");return j(E(O.diff(W,"days"),3))}case"DDDD":{var K=O.startOf("year");return j(E(O.diff(K,"days"),3))}case"d":return j(O.calendar().weekday);case"ddd":return O._weekNameShort(O.calendar().weekday);case"dddd":return O._weekName(O.calendar().weekday);case"ddddd":return O._dayName(O.calendar().day);case"dddddd":return O._weekNameMin(O.calendar().weekday);case"w":{var b=O.startOf("year"),k=parseInt(O.diff(b,"days")/7)+1;return j(k)}case"ww":{var F=O.startOf("year"),N=E(parseInt(O.diff(F,"days")/7)+1,2);return j(N)}case"M":return j(U.month);case"MM":return j(E(U.month,2));case"MMM":return O._monthNameShort(U.month);case"MMMM":return O._monthName(U.month);case"YY":{var M=U.year.toString().split("");return j(M[2]+M[3])}case"YYYY":return j(U.year);case"Z":{var G="+",V=Math.round(U.timezone/60),ee=U.timezone%60;ee<0&&(ee*=-1),V<0&&(G="-",V*=-1);var ae=G+E(V,2)+":"+E(ee,2);return j(ae)}case"ZZ":{var ne="+",J=Math.round(U.timezone/60),ue=U.timezone%60;ue<0&&(ue*=-1),J<0&&(ne="-",J*=-1);var oe=ne+E(J,2)+""+E(ue,2);return j(oe)}case"X":return O.unix();case"LT":return O.format("H:m a");case"L":return O.format("YYYY/MM/DD");case"l":return O.format("YYYY/M/D");case"LL":return O.format("MMMM DD YYYY");case"ll":return O.format("MMM DD YYYY");case"LLL":return O.format("MMMM YYYY DD H:m a");case"lll":return O.format("MMM YYYY DD H:m a");case"LLLL":return O.format("dddd D MMMM YYYY H:m a");case"llll":return O.format("ddd D MMM YYYY H:m a")}}if(T)return T.replace(C,X);var B="YYYY-MM-DD HH:mm:ss a";return B.replace(C,X)}},{key:"add",value:function(T,O){if(O===0)return this;var C=R(T,O).unit,U=this.toArray();if(O=R(T,O).value,C==="year"){var L=U[2],j=this.daysInMonth(U[0]+O,U[1]);U[2]>j&&(L=j);var X=new x([U[0]+O,U[1],L,U[3],U[4],U[5],U[6],U[7]]);return X}if(C==="month"){var B=Math.floor(O/12),H=O-B*12,W=null;U[1]+H>12?(B+=1,W=U[1]+H-12):W=U[1]+H;var K=U[2],b=new x([U[0]+B,W,1,U[3],U[4],U[5],U[6],U[7]]).toArray(),k=this.daysInMonth(U[0]+B,W);return U[2]>k&&(K=k),new x([b[0],b[1],K,b[3],b[4],b[5],b[6],b[7]])}if(C==="day"){var F=new x(this.valueOf()).hour(12),N=F.valueOf()+O*864e5,M=new x(N);return M.hour(U[3])}if(C==="week"){var G=new x(this.valueOf()).hour(12),V=G.valueOf()+7*O*864e5,ee=new x(V);return ee.hour(U[3])}if(C==="hour"){var ae=this.valueOf()+O*36e5;return this.unix(ae/1e3)}if(C==="minute"){var ne=this.valueOf()+O*6e4;return this.unix(ne/1e3)}if(C==="second"){var J=this.valueOf()+O*1e3;return this.unix(J/1e3)}if(C==="millisecond"){var ue=this.valueOf()+O;return this.unix(ue/1e3)}return this._getSyncedClass(this.valueOf())}},{key:"subtract",value:function(T,O){return this.add(T,O*-1)}},{key:"isSameDay",value:function(T){return this&&T&&this.date()==T.date()&&this.year()==T.year()&&this.month()==T.month()}},{key:"isSameMonth",value:function(T){return this&&T&&this.year()==this.year()&&this.month()==T.month()}}],[{key:"rangeName",value:function(){var T=x,O=T.calendarType;return T.localType==="fa"?O==="persian"?y.persian:y.gregorian:O==="persian"?I.persian:I.gregorian}},{key:"toLeapYearMode",value:function(T){var O=x;return O.leapYearMode=T,O}},{key:"toCalendar",value:function(T){var O=x;return O.calendarType=T,O}},{key:"toLocale",value:function(T){var O=x;return O.localType=T,O.localType!=="fa"?O.formatPersian=!1:O.formatPersian="_default",O}},{key:"isPersianDate",value:function(T){return T instanceof x}},{key:"duration",value:function(T,O){return new _(T,O)}},{key:"isDuration",value:function(T){return T instanceof _}},{key:"unix",value:function(T){return T?new x(T*1e3):new x().unix()}},{key:"getFirstWeekDayOfMonth",value:function(T,O){return new x([T,O,1]).day()}},{key:"utc",value:function(T){return T?new x(T).utc():new x().utc()}},{key:"isSameDay",value:function(T,O){return T&&O&&T.date()==O.date()&&T.year()==O.year()&&T.month()==O.month()}},{key:"isSameMonth",value:function(T,O){return T&&O&&T.year()==O.year()&&T.month()==O.month()}}]),x}();a.exports=A},function(a,s,n){var i=function(){function _(p,d){for(var E=0;Ed;)E--,R=this.tehran_equinox_jd(E);for(y=R-1;!(R<=d&&d365}},{key:"leap_persian",value:function(d){return((d-(d>0?474:473))%2820+474+38)*682%2816<682}},{key:"persian_to_jd",value:function(d,E,R){var y=void 0,I=void 0;return y=d-(d>=0?474:473),I=474+this.ASTRO.mod(y,2820),R+(E<=7?(E-1)*31:(E-1)*30+6)+Math.floor((I*682-110)/2816)+(I-1)*365+Math.floor(y/2820)*1029983+(this.PERSIAN_EPOCH-1)}},{key:"jd_to_persian",value:function(d){var E=void 0,R=void 0,y=void 0,I=void 0,A=void 0,x=void 0,g=void 0,T=void 0,O=void 0,C=void 0;return d=Math.floor(d)+.5,I=d-this.persian_to_jd(475,1,1),A=Math.floor(I/1029983),x=this.ASTRO.mod(I,1029983),x===1029982?g=2820:(T=Math.floor(x/366),O=this.ASTRO.mod(x,366),g=Math.floor((2134*T+2816*O+2815)/1028522)+T+1),E=g+2820*A+474,E<=0&&E--,C=d-this.persian_to_jd(E,1,1)+1,R=C<=186?Math.ceil(C/31):Math.ceil((C-6)/30),y=d-this.persian_to_jd(E,R,1)+1,[E,R,y]}},{key:"gWeekDayToPersian",value:function(d){return d+2===8?1:d+2===7?7:d+2}},{key:"updateFromGregorian",value:function(){var d=void 0,E=void 0,R=void 0,y=void 0,I=void 0,A=void 0,x=void 0,g=void 0,T=void 0,O=void 0;E=this.State.gregorian.year,R=this.State.gregorian.month,y=this.State.gregorian.day,I=0,A=0,x=0,this.State.gDate=new Date(E,R,y,this.State.gregorian.hour,this.State.gregorian.minute,this.State.gregorian.second,this.State.gregorian.millisecond),this.parent._utcMode===!1&&(this.State.zone=this.State.gDate.getTimezoneOffset()),this.State.gregorian.year=this.State.gDate.getFullYear(),this.State.gregorian.month=this.State.gDate.getMonth(),this.State.gregorian.day=this.State.gDate.getDate(),d=this.gregorian_to_jd(E,R+1,y)+Math.floor(x+60*(A+60*I)+.5)/86400,this.State.julianday=d,this.State.modifiedjulianday=d-this.JMJD,g=this.ASTRO.jwday(d),this.State.gregorian.weekday=g+1,this.State.gregorian.leap=this.NormLeap[this.leap_gregorian(E)?1:0],g=this.ASTRO.jwday(d),this.parent.calendarType=="persian"&&this.parent.leapYearMode=="algorithmic"&&(O=this.jd_to_persian(d),this.State.persian.year=O[0],this.State.persian.month=O[1]-1,this.State.persian.day=O[2],this.State.persian.weekday=this.gWeekDayToPersian(g),this.State.persian.leap=this.NormLeap[this.leap_persian(O[0])?1:0]),this.parent.calendarType=="persian"&&this.parent.leapYearMode=="astronomical"&&(O=this.jd_to_persiana(d),this.State.persianAstro.year=O[0],this.State.persianAstro.month=O[1]-1,this.State.persianAstro.day=O[2],this.State.persianAstro.weekday=this.gWeekDayToPersian(g),this.State.persianAstro.leap=this.NormLeap[this.leap_persiana(O[0])?1:0]),this.State.gregserial.day!==null&&(this.State.gregserial.day=d-this.J0000),T=(d-this.J1970)*(60*60*24*1e3),this.State.unixtime=Math.round(T/1e3)}},{key:"calcGregorian",value:function(d){(d[0]||d[0]===0)&&(this.State.gregorian.year=d[0]),(d[1]||d[1]===0)&&(this.State.gregorian.month=d[1]),(d[2]||d[2]===0)&&(this.State.gregorian.day=d[2]),(d[3]||d[3]===0)&&(this.State.gregorian.hour=d[3]),(d[4]||d[4]===0)&&(this.State.gregorian.minute=d[4]),(d[5]||d[5]===0)&&(this.State.gregorian.second=d[5]),(d[6]||d[6]===0)&&(this.State.gregorian.millisecond=d[6]),this.updateFromGregorian()}},{key:"calcJulian",value:function(){var d=void 0,E=void 0;d=this.State.julianday,E=this.jd_to_gregorian(d),this.State.gregorian.year=E[0],this.State.gregorian.month=E[1]-1,this.State.gregorian.day=E[2],this.updateFromGregorian()}},{key:"setJulian",value:function(d){this.State.julianday=d,this.calcJulian()}},{key:"calcPersian",value:function(d){(d[0]||d[0]===0)&&(this.State.persian.year=d[0]),(d[1]||d[1]===0)&&(this.State.persian.month=d[1]),(d[2]||d[2]===0)&&(this.State.persian.day=d[2]),(d[3]||d[3]===0)&&(this.State.gregorian.hour=d[3]),(d[4]||d[4]===0)&&(this.State.gregorian.minute=d[4]),(d[5]||d[5]===0)&&(this.State.gregorian.second=d[5]),(d[6]||d[6]===0)&&(this.State.gregorian.millisecond=d[6]),this.setJulian(this.persian_to_jd(this.State.persian.year,this.State.persian.month,this.State.persian.day))}},{key:"calcPersiana",value:function(d){(d[0]||d[0]===0)&&(this.State.persianAstro.year=d[0]),(d[1]||d[1]===0)&&(this.State.persianAstro.month=d[1]),(d[2]||d[2]===0)&&(this.State.persianAstro.day=d[2]),(d[3]||d[3]===0)&&(this.State.gregorian.hour=d[3]),(d[4]||d[4]===0)&&(this.State.gregorian.minute=d[4]),(d[5]||d[5]===0)&&(this.State.gregorian.second=d[5]),(d[6]||d[6]===0)&&(this.State.gregorian.millisecond=d[6]),this.setJulian(this.persiana_to_jd(this.State.persianAstro.year,this.State.persianAstro.month,this.State.persianAstro.day+.5))}}]),_}();a.exports=c},function(a,s,n){var i=function(){function l(c,_){for(var p=0;p<_.length;p++){var d=_[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(c,d.key,d)}}return function(c,_,p){return _&&l(c.prototype,_),p&&l(c,p),c}}();function o(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}var u=function(){function l(){o(this,l),this.J2000=2451545,this.JulianCentury=36525,this.JulianMillennium=this.JulianCentury*10,this.TropicalYear=365.24219878,this.oterms=[-4680.93,-1.55,1999.25,-51.38,-249.67,-39.05,7.12,27.87,5.79,2.45],this.nutArgMult=[0,0,0,0,1,-2,0,0,2,2,0,0,0,2,2,0,0,0,0,2,0,1,0,0,0,0,0,1,0,0,-2,1,0,2,2,0,0,0,2,1,0,0,1,2,2,-2,-1,0,2,2,-2,0,1,0,0,-2,0,0,2,1,0,0,-1,2,2,2,0,0,0,0,0,0,1,0,1,2,0,-1,2,2,0,0,-1,0,1,0,0,1,2,1,-2,0,2,0,0,0,0,-2,2,1,2,0,0,2,2,0,0,2,2,2,0,0,2,0,0,-2,0,1,2,2,0,0,0,2,0,-2,0,0,2,0,0,0,-1,2,1,0,2,0,0,0,2,0,-1,0,1,-2,2,0,2,2,0,1,0,0,1,-2,0,1,0,1,0,-1,0,0,1,0,0,2,-2,0,2,0,-1,2,1,2,0,1,2,2,0,1,0,2,2,-2,1,1,0,0,0,-1,0,2,2,2,0,0,2,1,2,0,1,0,0,-2,0,2,2,2,-2,0,1,2,1,2,0,-2,0,1,2,0,0,0,1,0,-1,1,0,0,-2,-1,0,2,1,-2,0,0,0,1,0,0,2,2,1,-2,0,2,0,1,-2,1,0,2,1,0,0,1,-2,0,-1,0,1,0,0,-2,1,0,0,0,1,0,0,0,0,0,0,1,2,0,-1,-1,1,0,0,0,1,1,0,0,0,-1,1,2,2,2,-1,-1,2,2,0,0,-2,2,2,0,0,3,2,2,2,-1,0,2,2],this.nutArgCoeff=[-171996,-1742,92095,89,-13187,-16,5736,-31,-2274,-2,977,-5,2062,2,-895,5,1426,-34,54,-1,712,1,-7,0,-517,12,224,-6,-386,-4,200,0,-301,0,129,-1,217,-5,-95,3,-158,0,0,0,129,1,-70,0,123,0,-53,0,63,0,0,0,63,1,-33,0,-59,0,26,0,-58,-1,32,0,-51,0,27,0,48,0,0,0,46,0,-24,0,-38,0,16,0,-31,0,13,0,29,0,0,0,29,0,-12,0,26,0,0,0,-22,0,0,0,21,0,-10,0,17,-1,0,0,16,0,-8,0,-16,1,7,0,-15,0,9,0,-13,0,7,0,-12,0,6,0,11,0,0,0,-10,0,5,0,-8,0,3,0,7,0,-3,0,-7,0,0,0,-7,0,3,0,-7,0,3,0,6,0,0,0,6,0,-3,0,6,0,-3,0,-6,0,3,0,-6,0,3,0,5,0,0,0,-5,0,3,0,-5,0,3,0,-5,0,3,0,4,0,0,0,4,0,0,0,4,0,0,0,-4,0,0,0,-4,0,0,0,-4,0,0,0,3,0,0,0,-3,0,0,0,-3,0,0,0,-3,0,0,0,-3,0,0,0,-3,0,0,0,-3,0,0,0,-3,0,0,0],this.deltaTtab=[121,112,103,95,88,82,77,72,68,63,60,56,53,51,48,46,44,42,40,38,35,33,31,29,26,24,22,20,18,16,14,12,11,10,9,8,7,7,7,7,7,7,8,8,9,9,9,9,9,10,10,10,10,10,10,10,10,11,11,11,11,11,12,12,12,12,13,13,13,14,14,14,14,15,15,15,15,15,16,16,16,16,16,16,16,16,15,15,14,13,13.1,12.5,12.2,12,12,12,12,12,12,11.9,11.6,11,10.2,9.2,8.2,7.1,6.2,5.6,5.4,5.3,5.4,5.6,5.9,6.2,6.5,6.8,7.1,7.3,7.5,7.6,7.7,7.3,6.2,5.2,2.7,1.4,-1.2,-2.8,-3.8,-4.8,-5.5,-5.3,-5.6,-5.7,-5.9,-6,-6.3,-6.5,-6.2,-4.7,-2.8,-.1,2.6,5.3,7.7,10.4,13.3,16,18.2,20.2,21.1,22.4,23.5,23.8,24.3,24,23.9,23.9,23.7,24,24.3,25.3,26.2,27.3,28.2,29.1,30,30.7,31.4,32.2,33.1,34,35,36.5,38.3,40.2,42.2,44.5,46.5,48.5,50.5,52.2,53.8,54.9,55.8,56.9,58.3,60,61.6,63,65,66.6],this.EquinoxpTerms=[485,324.96,1934.136,203,337.23,32964.467,199,342.08,20.186,182,27.85,445267.112,156,73.14,45036.886,136,171.52,22518.443,77,222.54,65928.934,74,296.72,3034.906,70,243.58,9037.513,58,119.81,33718.147,52,297.17,150.678,50,21.02,2281.226,45,247.54,29929.562,44,325.15,31555.956,29,60.93,4443.417,18,155.12,67555.328,17,288.79,4562.452,16,198.04,62894.029,14,199.76,31436.921,12,95.39,14577.848,12,287.11,31931.756,12,320.81,34777.259,9,227.73,1222.114,8,15.45,16859.074],this.JDE0tab1000=[new Array(172113929189e-5,365242.1374,.06134,.00111,-71e-5),new Array(172123325401e-5,365241.72562,-.05323,.00907,25e-5),new Array(172132570455e-5,365242.49558,-.11677,-.00297,74e-5),new Array(172141439987e-5,365242.88257,-.00769,-.00933,-6e-5)],this.JDE0tab2000=[new Array(245162380984e-5,365242.37404,.05169,-.00411,-57e-5),new Array(245171656767e-5,365241.62603,.00325,.00888,-3e-4),new Array(245181021715e-5,365242.01767,-.11575,.00337,78e-5),new Array(245190005952e-5,365242.74049,-.06223,-.00823,32e-5)]}return i(l,[{key:"dtr",value:function(_){return _*Math.PI/180}},{key:"rtd",value:function(_){return _*180/Math.PI}},{key:"fixangle",value:function(_){return _-360*Math.floor(_/360)}},{key:"fixangr",value:function(_){return _-2*Math.PI*Math.floor(_/(2*Math.PI))}},{key:"dsin",value:function(_){return Math.sin(this.dtr(_))}},{key:"dcos",value:function(_){return Math.cos(this.dtr(_))}},{key:"mod",value:function(_,p){return _-p*Math.floor(_/p)}},{key:"jwday",value:function(_){return this.mod(Math.floor(_+1.5),7)}},{key:"obliqeq",value:function(_){var p,d,E,R;if(E=d=(_-this.J2000)/(this.JulianCentury*100),p=23+26/60+21.448/3600,Math.abs(d)<1)for(R=0;R<10;R++)p+=this.oterms[R]/3600*E,E*=d;return p}},{key:"nutation",value:function(_){var p,d,E,R,y=(_-2451545)/36525,I,A,x,g=[],T=0,O=0,C;for(A=y*(I=y*y),g[0]=this.dtr(297.850363+445267.11148*y-.0019142*I+A/189474),g[1]=this.dtr(357.52772+35999.05034*y-1603e-7*I-A/3e5),g[2]=this.dtr(134.96298+477198.867398*y+.0086972*I+A/56250),g[3]=this.dtr(93.27191+483202.017538*y-.0036825*I+A/327270),g[4]=this.dtr(125.04452-1934.136261*y+.0020708*I+A/45e4),E=0;E<5;E++)g[E]=this.fixangr(g[E]);for(x=y/10,E=0;E<63;E++){for(C=0,R=0;R<5;R++)this.nutArgMult[E*5+R]!==0&&(C+=this.nutArgMult[E*5+R]*g[R]);T+=(this.nutArgCoeff[E*4+0]+this.nutArgCoeff[E*4+1]*x)*Math.sin(C),O+=(this.nutArgCoeff[E*4+2]+this.nutArgCoeff[E*4+3]*x)*Math.cos(C)}return p=T/(3600*1e4),d=O/(3600*1e4),[p,d]}},{key:"deltat",value:function(_){var p,d,E,R;return _>=1620&&_<=2e3?(E=Math.floor((_-1620)/2),d=(_-1620)/2-E,p=this.deltaTtab[E]+(this.deltaTtab[E+1]-this.deltaTtab[E])*d):(R=(_-2e3)/100,_<948?p=2177+497*R+44.1*R*R:(p=102+102*R+25.3*R*R,_>2e3&&_<2100&&(p+=.37*(_-2100)))),p}},{key:"equinox",value:function(_,p){var d=void 0,E=void 0,R=void 0,y=void 0,I=void 0,A=void 0,x=void 0,g=void 0,T=void 0,O=void 0;for(_<1e3?(A=this.JDE0tab1000,O=_/1e3):(A=this.JDE0tab2000,O=(_-2e3)/1e3),y=A[p][0]+A[p][1]*O+A[p][2]*O*O+A[p][3]*O*O*O+A[p][4]*O*O*O*O,g=(y-2451545)/36525,T=35999.373*g-2.47,d=1+.0334*this.dcos(T)+7e-4*this.dcos(2*T),x=0,E=R=0;E<24;E++)x+=this.EquinoxpTerms[R]*this.dcos(this.EquinoxpTerms[R+1]+this.EquinoxpTerms[R+2]*g),R+=3;return I=y+x*1e-5/d,I}},{key:"sunpos",value:function(_){var p=void 0,d=void 0,E=void 0,R=void 0,y=void 0,I=void 0,A=void 0,x=void 0,g=void 0,T=void 0,O=void 0,C=void 0,U=void 0,L=void 0,j=void 0,X=void 0,B=void 0;return p=(_-this.J2000)/this.JulianCentury,d=p*p,E=280.46646+36000.76983*p+3032e-7*d,E=this.fixangle(E),R=357.52911+35999.05029*p+-1537e-7*d,R=this.fixangle(R),y=.016708634+-42037e-9*p+-1267e-10*d,I=(1.914602+-.004817*p+-14e-6*d)*this.dsin(R)+(.019993-101e-6*p)*this.dsin(2*R)+289e-6*this.dsin(3*R),A=E+I,x=R+I,g=1.000001018*(1-y*y)/(1+y*this.dcos(x)),T=125.04-1934.136*p,O=A+-.00569+-.00478*this.dsin(T),U=this.obliqeq(_),C=U+.00256*this.dcos(T),L=this.rtd(Math.atan2(this.dcos(U)*this.dsin(A),this.dcos(A))),L=this.fixangle(L),j=this.rtd(Math.asin(this.dsin(U)*this.dsin(A))),X=this.rtd(Math.atan2(this.dcos(C)*this.dsin(O),this.dcos(O))),X=this.fixangle(X),B=this.rtd(Math.asin(this.dsin(C)*this.dsin(O))),[E,R,y,I,A,x,g,O,L,j,X,B]}},{key:"equationOfTime",value:function(_){var p=void 0,d=void 0,E=void 0,R=void 0,y=void 0,I=void 0;return I=(_-this.J2000)/this.JulianMillennium,y=280.4664567+360007.6982779*I+.03032028*I*I+I*I*I/49931+-(I*I*I*I/15300)+-(I*I*I*I*I/2e6),y=this.fixangle(y),p=this.sunpos(_)[10],d=this.nutation(_)[0],R=this.obliqeq(_)+this.nutation(_)[1],E=y+-.0057183+-p+d*this.dcos(R),E=E-20*Math.floor(E/20),E=E/(24*60),E}}]),l}();a.exports=u},function(a,s,n){a.exports={durationUnit:{year:["y","years","year"],month:["M","months","month"],day:["d","days","day"],hour:["h","hours","hour"],minute:["m","minutes","minute"],second:["s","second","seconds"],millisecond:["ms","milliseconds","millisecond"],week:["W","w","weeks","week"]}}},function(a,s,n){var i=function(){function d(E,R){for(var y=0;y12)&&(u=!1),(o[2]<1||o[1]>31)&&(u=!1),(o[3]<0||o[3]>24)&&(u=!1),(o[4]<0||o[4]>60)&&(u=!1),(o[5]<0||o[5]>60)&&(u=!1),u}}}])})})(persianDate);var persianDateExports=persianDate.exports;const PersianDate=getDefaultExportFromCjs(persianDateExports),persianLocale={...locale,localize:{...locale.localize,month:e=>["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"][e]},formatLong:{...locale.formatLong,date:()=>"d MMMM yyyy"}},formatTime=e=>{const t=new Date(e),a=t.getHours().toString().padStart(2,"0"),s=t.getMinutes().toString().padStart(2,"0");return format(new Date(e),"yyyy/MM/dd ")+`(${a}:${s})`},formatTimeFull=e=>{const t=new Date(e),a=t.getHours().toString().padStart(2,"0"),s=t.getMinutes().toString().padStart(2,"0"),n=t.getSeconds().toString().padStart(2,"0");return format(new Date(e),"yyyy/MM/dd ")+`(${a}:${s}:${n})`},formatJustDate=e=>e?format(new Date(e),"yyyy/MM/dd"):null,formatJustTime=e=>format(new Date(e),"HH:MM");function convertToIranianTime(e){const t=new Date(e);return new PersianDate(t).format("YYYY/MM/DD").replace(/[۰-۹]/g,function(i){return String.fromCharCode(i.charCodeAt(0)-1728)})}function getPersianMonth(e){const t=new Date(e);return format(t,"MMMM",{locale:persianLocale})+" "+format(new Date(t),"yyyy")}function convertDaysToYMD(e){const s=Math.floor(e/365);e=e%365;const n=Math.floor(e/30);e=e%30;const i=e,o=[];return s>0&&o.push(`${s} سال`),n>0&&o.push(`${n} ماه`),i>0&&o.push(`${i} روز`),o.join(" و ")}function convertPersianToEnglishNumerals(e){if(!e||typeof e!="string")return e;const t={"۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};return e.replace(/[۰-۹]/g,a=>t[a]||a)}const useCeoName=()=>{const e=useSelector(t=>t.userSlice.userPath);return e==="https://check.rasadyaar.ir"||e.includes("localhost")?"محمد میرانی":e==="https://mabackend.rasadyar.com/"?"علی حیدری":e==="https://arbackend.rasadyar.com/"?"علیرضا سقایی":e==="https://habackend.rasadyar.com/"?"داوود شعبانلو":e==="https://shabackend.rasadyar.com/"?"جواد سلطانی مجد":e==="https://ghabackend.rasadyar.com/"?"آقای/خانم":e==="https://bubackend.rasadyar.com/"?"حسین تمجیدی پور":"محمد میرانی"},styles={page:{width:"214mm",height:"302mm",display:"flex",margin:"0 auto",flexDirection:"column",position:"relative",direction:"rtl",fontFamily:"titr",fontWeight:"bold"},pageData:{margin:"20px",position:"relative",display:"flex",direction:"rtl",flexDirection:"column"},tableInNewPage:{pageBreakAfter:"always",paddingLeft:"40px",paddingRight:"40px",direction:"rtl",fontFamily:"titr",fontWeight:"bold"},container:{width:"95%",alignSelf:"center",pageBreakInside:"avoid"},invoiceTable:{width:"100%",borderCollapse:"collapse",alignSelf:"center",marginBottom:"2px"},tableCell:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:10},tableCellMobile:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:10},tableInnerCell:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:8,whiteSpace:"nowrap"},tableHeader:{backgroundColor:"rgba(211, 211, 211, 0.3)",pageBreakAfter:"auto"},headerRow:{backgroundColor:"rgba(211, 211, 211, 0.3)",color:"black",pageBreakInside:"avoid",pageBreakAfter:"auto"},logo:{width:"300px",height:"auto"},logoFooter:{width:"100px",height:"auto"},contentContainer:{alignItems:"center",display:"flex",justifyContent:"space-between",marginRight:"20px"},contentInLine:{display:"flex",flexDirection:"column",alignItems:"center"},watermarkContainer:{position:"fixed",top:250,left:30,right:0,bottom:0,justifyContent:"center",alignItems:"center",opacity:.15,zIndex:-1,userSelect:"none"},watermarkp:{fontFamily:"nazanin",fontSize:100,fontWeight:"bolder",color:"grey",transform:"rotate(-45deg)",left:"50%",userSelect:"none"},firsttitle:{marginLeft:"40px",pAlign:"center",color:"#00008b",fontWeight:"800"},divider:{width:"100%",height:"2px",backgroundColor:"red"},pTitleContainer:{pAlign:"center",margin:"15px",textAlign:"justify",textJustify:"inter-word",fontFamily:"nazanin",fontSize:"20px",fontWeight:"bolder"},tableHeaderCell:{backgroundColor:"rgba(211, 211, 211, 0.3)",fontSize:10,border:"1px solid #000",padding:"4px",textAlign:"center",fontWeight:"bold"},footer:{left:0,bottom:0,width:"100%",position:"absolute"},footerContainer:{alignItems:"center",display:"flex"},circle:{borderRadius:"50%",width:"20px",height:"20px",padding:"10px",background:"#ecf0f1",border:" 1px solid #000",color:"#000",textAlign:"center",marginRight:"130px"},tableRowEven:{backgroundColor:"rgba(170, 183, 255, 0.3)"}},ProvinceGetReportFile=reactExports.forwardRef((e,t)=>{var C,U,L,j,X;const{item:a}=e,{inDate:s}=e,{targetperson:n}=e,{reportType:i}=e,o=useSystemName(),u=useCeoName(),l=B=>{let H="";return B!=null&&B.directBuying?H="خرید مستقیم":B!=null&&B.union?H="خرید خارج از استان":H="اتحادیه",H};function c(B){return B==null?void 0:B.reduce((H,W)=>H+((W==null?void 0:W.quantity)||0),0)}function _(B){let H=0;return B==null||B.forEach(W=>{var K,b,k;(K=W==null?void 0:W.hatching)!=null&&K.totalWeight&&((b=W==null?void 0:W.hatching)==null?void 0:b.totalWeight)!==void 0&&(H+=(k=W==null?void 0:W.hatching)==null?void 0:k.totalWeight)}),H}function p(B){let H=0;return B==null||B.forEach(W=>{W!=null&&W.provinceKillRequests&&W.provinceKillRequests.forEach(K=>{var b;((b=K.info)==null?void 0:b.quantity)!==void 0&&(H+=K.info.quantity)})}),H}function d(B){let H=0;return B==null||B.forEach(W=>{W!=null&&W.provinceKillRequests&&W.provinceKillRequests.forEach(K=>{var b;((b=K.info)==null?void 0:b.weight)!==void 0&&(H+=K.info.weight)})}),H}function E(){return a==null?void 0:a.serializerKillHouseRequestsThirdLetter.reduce((B,H)=>{var W;return B+(((W=H==null?void 0:H.weightInfo)==null?void 0:W.weight)||0)},0)}const R=()=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{style:styles.contentContainer,children:[jsxRuntimeExports.jsxs("div",{style:styles.contentInLine,children:[jsxRuntimeExports.jsx("span",{style:{...styles.firsttitle,fontSize:19,zIndex:1},children:"گزارش فرآیند کشتار وتوزیع مرغ گوشتی سامانه رصدیار"}),jsxRuntimeExports.jsxs("span",{style:{fontSize:"20px"},children:[o," "," - ","مورخ ",formatJustDate(s)]}),jsxRuntimeExports.jsxs("span",{style:{fontSize:"12px",color:"red",alignSelf:"start",marginTop:"30px"},children:["این گزارش در تاریخ ",formatJustDate(hooks())," ساعت"," ",formatJustTime(hooks())," صادر شده است."]})]}),jsxRuntimeExports.jsx("div",{style:styles.contentInLine,children:jsxRuntimeExports.jsx("img",{alt:"logo",src:logo,style:styles.logo})})]}),jsxRuntimeExports.jsx("hr",{style:styles.divider})]});let y=0;const I=()=>(y++,jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{style:styles.footer,children:[jsxRuntimeExports.jsx("div",{style:styles.divider}),jsxRuntimeExports.jsxs("div",{style:styles.footerContainer,children:[jsxRuntimeExports.jsx("img",{alt:"logo",src:logoFooter,style:styles.logoFooter}),jsxRuntimeExports.jsx("p",{style:{fontSize:15,padding:"10px",marginRight:"10px"},children:"گزارش فرآیند کامل کشتار و پخش مرغ گوشتی سامانه رصدیار www.rasadyaar.ir"}),jsxRuntimeExports.jsx("div",{style:styles.circle,children:y})]})]})})),A=({items:B,start:H,end:W})=>{const K=B==null?void 0:B.slice(H-1,W);return jsxRuntimeExports.jsxs("table",{style:styles.invoiceTable,children:[jsxRuntimeExports.jsx("thead",{style:styles.tableHeader,children:jsxRuntimeExports.jsxs("tr",{style:styles.headerRow,children:[jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"ردیف"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"کد سفارش"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"نوع فروش"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"تاریخ کشتار"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"مرغدار"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"شهر/تعاونی"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"سن مرغ"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"میانگین وزن"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"وزن تقریبی"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"مانده در سالن"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"تعداد درخواست کشتار"})]})}),jsxRuntimeExports.jsx("tbody",{children:K==null?void 0:K.map((b,k)=>{var F,N,M,G,V,ee,ae,ne,J,ue,oe,_e,Y,Z;return jsxRuntimeExports.jsxs("tr",{style:k%2===0?styles.tableRowEven:{},children:[jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:k+H}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:b.orderCode}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:l(b)}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:formatJustDate(b==null?void 0:b.sendDate)}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:`${(F=b==null?void 0:b.poultry)==null?void 0:F.unitName} (${(M=(N=b==null?void 0:b.poultry)==null?void 0:N.user)==null?void 0:M.mobile})`}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:`${(ee=(V=(G=b==null?void 0:b.poultry)==null?void 0:G.address)==null?void 0:V.city)==null?void 0:ee.name}/${(ae=b==null?void 0:b.poultry)!=null&&ae.cityOperator?(ne=b==null?void 0:b.poultry)==null?void 0:ne.cityOperator:"بدون تعاونی"}`}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(J=b==null?void 0:b.hatching)==null?void 0:J.age}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:b==null?void 0:b.IndexWeight}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(oe=(ue=b==null?void 0:b.hatching)==null?void 0:ue.totalWeight)==null?void 0:oe.toLocaleString()}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(Y=(_e=b==null?void 0:b.hatching)==null?void 0:_e.leftOver)==null?void 0:Y.toLocaleString()}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(Z=b==null?void 0:b.firstQuantity)==null?void 0:Z.toLocaleString()})]},k)})})]})},x=({items:B,start:H,end:W})=>{const K=B==null?void 0:B.slice(H-1,W);return jsxRuntimeExports.jsxs("table",{style:styles.invoiceTable,children:[jsxRuntimeExports.jsx("thead",{style:styles.tableHeader,children:jsxRuntimeExports.jsxs("tr",{style:styles.headerRow,children:[jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"ردیف"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"مرغدار"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"تلفن"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"شهر"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"تعداد"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"میانگین وزنی"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"سن"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"خریدار"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"تعداد"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"وزن تقریبی بار"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"محل کشتار"})]})}),jsxRuntimeExports.jsx("tbody",{children:K==null?void 0:K.map((b,k)=>{var F,N,M,G,V,ee,ae,ne,J,ue,oe,_e;return jsxRuntimeExports.jsxs("tr",{style:k%2===0?styles.tableRowEven:{},children:[jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:k+H}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(N=(F=b==null?void 0:b.poultry)==null?void 0:F.user)==null?void 0:N.fullname}),jsxRuntimeExports.jsx("td",{style:styles.tableCellMobile,children:(G=(M=b==null?void 0:b.poultry)==null?void 0:M.user)==null?void 0:G.mobile}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(ae=(ee=(V=b==null?void 0:b.poultry)==null?void 0:V.address)==null?void 0:ee.city)==null?void 0:ae.name}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:b==null?void 0:b.quantity.toLocaleString()}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:b==null?void 0:b.IndexWeight.toLocaleString()}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(ne=b==null?void 0:b.hatching)==null?void 0:ne.age}),jsxRuntimeExports.jsx("td",{style:styles.tableInnerCell,children:(J=b==null?void 0:b.provinceKillRequests)==null?void 0:J.map((Y,Z,te)=>{var q,Q,se,fe,me,ve;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(se=(Q=(q=Y==null?void 0:Y.killhouseUser)==null?void 0:q.killHouseOperator)==null?void 0:Q.user)!=null&&se.fullname?(ve=(me=(fe=Y==null?void 0:Y.killhouseUser)==null?void 0:fe.killHouseOperator)==null?void 0:me.user)==null?void 0:ve.fullname:"............",jsxRuntimeExports.jsx("br",{}),Z{var q,Q;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(q=Y==null?void 0:Y.info)!=null&&q.quantity?(Q=Y==null?void 0:Y.info)==null?void 0:Q.quantity.toLocaleString():"............",jsxRuntimeExports.jsx("br",{}),Z{var q,Q;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Math.round((q=Y==null?void 0:Y.info)==null?void 0:q.weight)?Math.round((Q=Y==null?void 0:Y.info)==null?void 0:Q.weight).toLocaleString():"............",jsxRuntimeExports.jsx("br",{}),Z{var q,Q;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(q=Y==null?void 0:Y.info)!=null&&q.killPlace?(Q=Y==null?void 0:Y.info)==null?void 0:Q.killPlace:"............",jsxRuntimeExports.jsx("br",{}),Z{const K=B==null?void 0:B.slice(H-1,W);return jsxRuntimeExports.jsxs("table",{style:styles.invoiceTable,children:[jsxRuntimeExports.jsx("thead",{style:styles.tableHeader,children:jsxRuntimeExports.jsxs("tr",{style:styles.headerRow,children:[jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"ردیف"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"کد بار"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"خریدار"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"ماشین"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"راننده"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"نژاد"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"تعداد"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"وزن بار"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"میانگین وزن"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"مرغدار"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"محل کشتار"})]})}),jsxRuntimeExports.jsx("tbody",{children:K==null?void 0:K.map((b,k)=>{var F,N,M,G,V,ee,ae,ne,J,ue,oe,_e,Y,Z,te,q,Q,se;return jsxRuntimeExports.jsxs("tr",{style:k%2===0?styles.tableRowEven:{},children:[jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:k+H}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:b==null?void 0:b.barCode}),jsxRuntimeExports.jsxs("td",{style:styles.tableCell,children:[(F=b.killhouseUser)==null?void 0:F.name," (",(G=(M=(N=b.killhouseUser)==null?void 0:N.killHouseOperator)==null?void 0:M.user)==null?void 0:G.mobile,")"]}),jsxRuntimeExports.jsxs("td",{style:styles.tableCell,children:[b.addCar.driver.typeCar," ",b==null?void 0:b.addCar.driver.pelak]}),jsxRuntimeExports.jsxs("td",{style:styles.tableCell,children:[(ee=(V=b==null?void 0:b.addCar)==null?void 0:V.driver)==null?void 0:ee.driverName," (",(ne=(ae=b==null?void 0:b.addCar)==null?void 0:ae.driver)==null?void 0:ne.driverMobile,")"]}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(J=b==null?void 0:b.poultryRequest)==null?void 0:J.chickenBreed}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(ue=b==null?void 0:b.quantity)==null?void 0:ue.toLocaleString()}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(_e=(oe=b==null?void 0:b.weightInfo)==null?void 0:oe.weight)==null?void 0:_e.toLocaleString()}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(Z=(Y=b==null?void 0:b.weightInfo)==null?void 0:Y.indexWeight)==null?void 0:Z.toLocaleString()}),jsxRuntimeExports.jsxs("td",{style:styles.tableCell,children:[(q=(te=b==null?void 0:b.poultryRequest)==null?void 0:te.poultry)==null?void 0:q.unitName," (",(se=(Q=b.poultryRequest.poultry)==null?void 0:Q.user)==null?void 0:se.mobile,")"]}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:b==null?void 0:b.killPlace})]},k)})})]})},T=({items:B,start:H,end:W})=>{const K=B==null?void 0:B.slice(H-1,W);return jsxRuntimeExports.jsxs("table",{style:styles.invoiceTable,children:[jsxRuntimeExports.jsx("thead",{style:styles.tableHeader,children:jsxRuntimeExports.jsxs("tr",{style:styles.headerRow,children:[jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"ردیف"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"خریدار/تلفن"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"شهر"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"حجم لاشه ها"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"وزن لاشه ها"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"لاشه های تخصیص داده شده"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"وزن تخصیص داده شده"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"لاشه قابل تخصیص"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"وزن قابل تخصیص"})]})}),jsxRuntimeExports.jsx("tbody",{children:K==null?void 0:K.map((b,k)=>{var F,N,M,G,V,ee,ae,ne,J;return jsxRuntimeExports.jsxs("tr",{style:k%2===0?styles.tableRowEven:{},children:[jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:k+H}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:`${(F=b==null?void 0:b.killHouseOperator.user)==null?void 0:F.fullname} (${(N=b==null?void 0:b.killHouseOperator.user)==null?void 0:N.mobile})`}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(M=b==null?void 0:b.systemAddress)==null?void 0:M.address}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(G=b==null?void 0:b.provinceKillRequestInformation)==null?void 0:G.totalNumberOfCarcasses.toLocaleString()}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(V=b==null?void 0:b.provinceKillRequestInformation)==null?void 0:V.totalWeightOfCarcasses.toLocaleString()}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(ee=b==null?void 0:b.provinceKillRequestInformation)==null?void 0:ee.allocatedTotalNumberOfCarcasses.toLocaleString()}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(ae=b==null?void 0:b.provinceKillRequestInformation)==null?void 0:ae.allocatedTotalWeightOfCarcasses.toLocaleString()}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(ne=b==null?void 0:b.provinceKillRequestInformation)==null?void 0:ne.remainTotalNumberOfCarcasses.toLocaleString()}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(J=b==null?void 0:b.provinceKillRequestInformation)==null?void 0:J.remainTotalWeightOfCarcasses.toLocaleString()})]},k)})})]})},O=({items:B,start:H,end:W})=>{const K=B==null?void 0:B.slice(H-1,W);return jsxRuntimeExports.jsxs("table",{style:styles.invoiceTable,children:[jsxRuntimeExports.jsx("thead",{style:styles.tableHeader,children:jsxRuntimeExports.jsxs("tr",{style:styles.headerRow,children:[jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"ردیف"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"خریدار"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"تاریخ تخصیص"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"ماهیت"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"نوع تخصیص"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"نام واحد صنفی"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"موبایل مالک"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"شناسه صنف"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"نوع فعالیت"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"حوزه فعالیت"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"شهرستان"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"حجم لاشه"}),jsxRuntimeExports.jsx("th",{style:styles.tableHeaderCell,children:"وزن لاشه"})]})}),jsxRuntimeExports.jsx("tbody",{children:K==null?void 0:K.map((b,k)=>{var F,N,M,G,V,ee,ae,ne,J,ue,oe,_e,Y,Z,te,q,Q,se,fe,me,ve,Ae,ce,Se,Te,re,le,pe,Ee,Re,xe,Pe,Oe,ye,Le,Be,je;return jsxRuntimeExports.jsxs("tr",{style:k%2===0?styles.tableRowEven:{},children:[jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:k+H}),jsxRuntimeExports.jsxs("td",{style:styles.tableCell,children:[((N=(F=b==null?void 0:b.wareHouse)==null?void 0:F.killHouse)==null?void 0:N.killer)==="true"?"کشتارکن":"کشتارگاه"," ",(G=(M=b==null?void 0:b.wareHouse)==null?void 0:M.killHouse)==null?void 0:G.name]}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:formatJustDate(b==null?void 0:b.date)}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:b!=null&&b.steward?"مباشر":"صنف"}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(b==null?void 0:b.type)==="manual"?"دستی":"اتوماتیک"}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(ee=(V=b==null?void 0:b.steward)==null?void 0:V.guilds)!=null&&ee.guildsName?(ne=(ae=b==null?void 0:b.steward)==null?void 0:ae.guilds)==null?void 0:ne.guildsName:(J=b==null?void 0:b.guilds)==null?void 0:J.guildsName}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(oe=(ue=b==null?void 0:b.steward)==null?void 0:ue.guilds)!=null&&oe.user.mobile?(Y=(_e=b==null?void 0:b.steward)==null?void 0:_e.guilds)==null?void 0:Y.user.mobile:(Z=b==null?void 0:b.guilds)==null?void 0:Z.user.mobile}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(q=(te=b==null?void 0:b.steward)==null?void 0:te.guilds)!=null&&q.guildsId?(se=(Q=b==null?void 0:b.steward)==null?void 0:Q.guilds)==null?void 0:se.guildsId:(fe=b==null?void 0:b.guilds)==null?void 0:fe.guildsId}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(ve=(me=b==null?void 0:b.steward)==null?void 0:me.guilds)!=null&&ve.typeActivity?(ce=(Ae=b==null?void 0:b.steward)==null?void 0:Ae.guilds)==null?void 0:ce.typeActivity:(Se=b==null?void 0:b.guilds)==null?void 0:Se.typeActivity}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(re=(Te=b==null?void 0:b.steward)==null?void 0:Te.guilds)!=null&&re.areaActivity?(pe=(le=b==null?void 0:b.steward)==null?void 0:le.guilds)==null?void 0:pe.areaActivity:(Ee=b==null?void 0:b.guilds)==null?void 0:Ee.areaActivity}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:(Pe=(xe=(Re=b==null?void 0:b.steward)==null?void 0:Re.guilds)==null?void 0:xe.user)!=null&&Pe.city?(Le=(ye=(Oe=b==null?void 0:b.steward)==null?void 0:Oe.guilds)==null?void 0:ye.user)==null?void 0:Le.city:(je=(Be=b==null?void 0:b.guilds)==null?void 0:Be.user)==null?void 0:je.city}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:b==null?void 0:b.numberOfCarcasses}),jsxRuntimeExports.jsx("td",{style:styles.tableCell,children:b==null?void 0:b.weightOfCarcasses})]},k)})})]})};return jsxRuntimeExports.jsxs("div",{ref:t,children:[jsxRuntimeExports.jsx("div",{style:styles.watermarkContainer,children:jsxRuntimeExports.jsx("p",{style:styles.watermarkp,children:"سامانه رصدیار "})}),jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.pageData,children:[jsxRuntimeExports.jsx("h3",{style:{margin:"10px"},children:n}),jsxRuntimeExports.jsx("h3",{style:{margin:"10px",fontSize:"15px"},children:"با سلام"}),jsxRuntimeExports.jsx("h3",{style:{margin:"10px",fontSize:"16px"},children:"احتراماً به پیوست، گزارش کامل فرآیند کشتار و توزیع مرغ گوشتی استان جهت استحضار بحضورتان ارسال میگردد."}),jsxRuntimeExports.jsx("h3",{style:{margin:"10px",fontSize:"15px"},children:"خلاصه گزارش:"}),jsxRuntimeExports.jsxs("p",{style:styles.pTitleContainer,children:["در مورخ"," ",formatJustDate(i==="slaughter"?hooks(s):hooks(s).subtract(1,"days"))," ","تعداد",a==null?void 0:a.serializerPoultryRequestsFirstLetter.length," درخواست کشتار توسط مرغداران استان برای کشتار"," ",c(a==null?void 0:a.serializerPoultryRequestsFirstLetter)!==void 0&&c(a==null?void 0:a.serializerPoultryRequestsFirstLetter).toLocaleString()," ","قطعه مرغ زنده با وزن تقریبی"," ",_(a==null?void 0:a.serializerPoultryRequestsFirstLetter).toLocaleString()," ","کیلوگرم به اتحادیه مرغداران گوشتی استان ارسال گردید بعد از پایش اطلاعات تعداد"," ",p(a==null?void 0:a.serializerPoultryRequestsSecondeLetter).toLocaleString()," ","قطعه مرغ با وزن تقریبی"," ",Math.round(d(a==null?void 0:a.serializerPoultryRequestsSecondeLetter)).toLocaleString()," ","کیلوگرم به ",a==null?void 0:a.serializerKillHouseRequestsFourthPartOne.buyers," ","خریدار تخصیص داده شد .از مجموع ذکر شده تخصیصی به خریداران،"," ",a==null?void 0:a.serializerKillHouseRequestsThirdLetter.length,"بار (خودرو) به تعداد"," ",a==null?void 0:a.killHouseRequestsThirdLetterQuantity.toLocaleString()," قطعه و وزن ",(C=E())==null?void 0:C.toLocaleString()," کیلوگرم ایجاد شد از بارهای ایجاد شده تعداد"," ",a==null?void 0:a.serializerKillHouseRequestsThirdLetterPartThree," بار توسط دامپزشک فارم کد قرنطینه دریافت کرده اند و"," ",a==null?void 0:a.serializerKillHouseRequestsThirdLetterPartTwo," بار به تعداد"," ",a==null?void 0:a.killHouseRequestsThirdLetterPartTwoQuantity.toLocaleString()," ","قطعه و وزن"," ",(U=a==null?void 0:a.killHouseRequestsThirdLetterPartTwoWeight)==null?void 0:U.toLocaleString()," ","کیلوگرم توسط دامپزشک کشتارگاه یا کاربر کشتارگاه عملیات تخلیه و تکمیل اطلاعات انجام پذیرفته است.از بار های تخلیه (تکمیل) شده توسط خریداران و کشتارگاه ها بعد از کسر 25 % افت مرغ زنده، مقدار"," ",Math.floor((a==null?void 0:a.killHouseRequestsThirdLetterPartTwoWeight)/100*75).toLocaleString()," ","کیلوگرم لاشه مرغ برای توزیع در بین مباشرین و اصناف",i==="broadcast"?` در انبار امروز (${formatJustDate(s)}) خریداران موجود گردید`:" در انبار خریداران موجود گردید",i==="slaughter"?".":` ، از مجموع موجودی انبار خریداران + و کشتارگاه ها مقدار ${Math.floor(a==null?void 0:a.serializerKillHouseRequestsFourthPartFifth).toLocaleString()} کیلوگرم به تعداد ${a==null?void 0:a.serializerKillHouseRequestsFourthPartFourth.toLocaleString()} قطعه + بین ${a==null?void 0:a.serializerKillHouseRequestsFourthPartSixth} مباشر و صنف توزیع شد.`,jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsx("br",{}),i==="broadcast"&&jsxRuntimeExports.jsxs("span",{style:{color:"red"},children:["*باتوجه به اینکه گوشت مرغ پخش شده در تاریخ امروز (",formatJustDate(s),") مربوط به اطلاعات و کشتار دیروز (",formatJustDate(i==="slaughter"?hooks(s):hooks(s).subtract(1,"days")),") میباشد مبنای گزارش، تاریخ توزیع گوشت مرغ گرم در بین مباشرین است."]})]}),jsxRuntimeExports.jsxs("div",{style:{...styles.contentInLine,alignSelf:"end",fontFamily:"nazanin",marginLeft:"50px"},children:[jsxRuntimeExports.jsx("span",{style:{fontSize:"16 px"},children:"✒️ مدیرعامل"}),jsxRuntimeExports.jsx("span",{style:{fontSize:"22px"},children:u})]})]}),jsxRuntimeExports.jsx(I,{})]}),jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.pageData,children:[jsxRuntimeExports.jsx("h3",{style:{margin:"10px"},children:"درخواست کشتار مرغداران:"}),jsxRuntimeExports.jsxs("div",{style:styles.container,children:[jsxRuntimeExports.jsxs("p",{style:{marginTop:"10px"},children:["اطلاعات درخواست:"," ",jsxRuntimeExports.jsxs("span",{style:{color:"green",fontWeight:"boler"},children:[" ","تعداد درخواست کشتار (",c(a==null?void 0:a.serializerPoultryRequestsFirstLetter)!==void 0&&c(a==null?void 0:a.serializerPoultryRequestsFirstLetter).toLocaleString()," ","قطعه)، وزن کل (",_(a==null?void 0:a.serializerPoultryRequestsFirstLetter).toLocaleString()," ","کیلوگرم)."]})]}),jsxRuntimeExports.jsx(A,{items:a==null?void 0:a.serializerPoultryRequestsFirstLetter,start:1,end:18})]})]}),jsxRuntimeExports.jsx(I,{})]}),(a==null?void 0:a.serializerPoultryRequestsFirstLetter.length)>18&&jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.tableInNewPage,children:[jsxRuntimeExports.jsx("h3",{children:"درخواست کشتار مرغداران:"}),jsxRuntimeExports.jsx(A,{items:a==null?void 0:a.serializerPoultryRequestsFirstLetter,start:19,end:40})]}),jsxRuntimeExports.jsx(I,{})]}),(a==null?void 0:a.serializerPoultryRequestsFirstLetter.length)>40&&jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.tableInNewPage,children:[jsxRuntimeExports.jsx("h3",{children:"درخواست کشتار مرغداران:"}),jsxRuntimeExports.jsx(A,{items:a==null?void 0:a.serializerPoultryRequestsFirstLetter,start:41,end:65})]}),jsxRuntimeExports.jsx(I,{})]}),jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.pageData,children:[jsxRuntimeExports.jsx("h3",{style:{margin:"10px"},children:"تخصیص به خریداران توسط اتحادیه:"}),jsxRuntimeExports.jsxs("div",{style:styles.container,children:[jsxRuntimeExports.jsxs("p",{style:{marginTop:"10px"},children:["اطلاعات تخصیص:"," ",jsxRuntimeExports.jsxs("span",{style:{color:"green",fontWeight:"boler"},children:[" ","تعداد درخواست کشتار (",c(a==null?void 0:a.serializerPoultryRequestsSecondeLetter)!==void 0&&c(a==null?void 0:a.serializerPoultryRequestsSecondeLetter).toLocaleString()," ","قطعه)، تخصیص داده شده (",p(a==null?void 0:a.serializerPoultryRequestsSecondeLetter).toLocaleString()," ","قطعه)، وزن کل تخصیص ("," ",Math.round(d(a==null?void 0:a.serializerPoultryRequestsSecondeLetter)).toLocaleString()," ","کیلوگرم)."]})]}),jsxRuntimeExports.jsx(x,{items:a==null?void 0:a.serializerPoultryRequestsSecondeLetter,start:1,end:25})]})]})]}),jsxRuntimeExports.jsx(I,{})]}),(a==null?void 0:a.serializerPoultryRequestsSecondeLetter.length)>25&&jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.tableInNewPage,children:[jsxRuntimeExports.jsx("h3",{children:"تخصیص به خریداران توسط اتحادیه:"}),jsxRuntimeExports.jsx(x,{items:a==null?void 0:a.serializerPoultryRequestsSecondeLetter,start:26,end:50})]}),jsxRuntimeExports.jsx(I,{})]}),(a==null?void 0:a.serializerPoultryRequestsSecondeLetter.length)>50&&jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.tableInNewPage,children:[jsxRuntimeExports.jsx("h3",{children:"تخصیص به خریداران توسط اتحادیه:"}),jsxRuntimeExports.jsx(x,{items:a==null?void 0:a.serializerPoultryRequestsSecondeLetter,start:51,end:75})]}),jsxRuntimeExports.jsx(I,{})]}),jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.pageData,children:[jsxRuntimeExports.jsx("h3",{style:{margin:"10px"},children:"ثبت خودرو توسط خریدار (ایجاد بار):"}),jsxRuntimeExports.jsx("div",{style:styles.container,children:jsxRuntimeExports.jsx(g,{items:a==null?void 0:a.serializerKillHouseRequestsThirdLetter,start:1,end:16})})]})]}),jsxRuntimeExports.jsx(I,{})]}),(a==null?void 0:a.serializerKillHouseRequestsThirdLetter.length)>16&&jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.tableInNewPage,children:[jsxRuntimeExports.jsx("h3",{children:"ثبت خودرو توسط خریدار (ایجاد بار):"}),jsxRuntimeExports.jsx(g,{items:a==null?void 0:a.serializerKillHouseRequestsThirdLetter,start:17,end:34})]}),jsxRuntimeExports.jsx(I,{})]}),(a==null?void 0:a.serializerKillHouseRequestsThirdLetter.length)>34&&jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.tableInNewPage,children:[jsxRuntimeExports.jsx("h3",{children:"ثبت خودرو توسط خریدار (ایجاد بار):"}),jsxRuntimeExports.jsx(g,{items:a==null?void 0:a.serializerKillHouseRequestsThirdLetter,start:35,end:54})]}),jsxRuntimeExports.jsx(I,{})]}),(a==null?void 0:a.serializerKillHouseRequestsThirdLetter.length)>54&&jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.tableInNewPage,children:[jsxRuntimeExports.jsx("h3",{children:"ثبت خودرو توسط خریدار (ایجاد بار):"}),jsxRuntimeExports.jsx(g,{items:a==null?void 0:a.serializerKillHouseRequestsThirdLetter,start:55,end:75})]}),jsxRuntimeExports.jsx(I,{})]}),(a==null?void 0:a.serializerKillHouseRequestsThirdLetter.length)>75&&jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.tableInNewPage,children:[jsxRuntimeExports.jsx("h3",{children:"ثبت خودرو توسط خریدار (ایجاد بار):"}),jsxRuntimeExports.jsx(g,{items:a==null?void 0:a.serializerKillHouseRequestsThirdLetter,start:76,end:95})]}),jsxRuntimeExports.jsx(I,{})]}),i==="broadcast"&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.pageData,children:[jsxRuntimeExports.jsx("h3",{style:{margin:"10px"},children:"اطلاعات انبار خریداران و پخش به مباشرین:"}),jsxRuntimeExports.jsxs("div",{style:styles.container,children:[jsxRuntimeExports.jsxs("p",{style:{marginTop:"10px"},children:["اطلاعات :"," ",jsxRuntimeExports.jsxs("span",{style:{color:"green",fontWeight:"boler",fontSize:"14px"},children:["تعداد خریداران (",(L=a==null?void 0:a.serializerKillHouseRequestsFourthPartOne)==null?void 0:L.buyers,")، حجم لاشه ها (",Math.floor((j=a==null?void 0:a.serializerKillHouseRequestsFourthPartOne)==null?void 0:j.totalNumberOfCarcasses).toLocaleString(),") ، وزن لاشه ها (",Math.floor((X=a==null?void 0:a.serializerKillHouseRequestsFourthPartOne)==null?void 0:X.totalWeightOfCarcasses).toLocaleString(),") کیلوگرم."]})]}),jsxRuntimeExports.jsx(T,{items:a==null?void 0:a.serializerKillHouseRequestsFourthPartTwo,start:1,end:25})]})]}),jsxRuntimeExports.jsx(I,{})]}),(a==null?void 0:a.serializerKillHouseRequestsFourthPartTwo.length)>25&&jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.tableInNewPage,children:[jsxRuntimeExports.jsx("h3",{style:{margin:"10px"},children:"اطلاعات انبار خریداران و پخش به مباشرین:"}),jsxRuntimeExports.jsx(T,{items:a==null?void 0:a.serializerKillHouseRequestsThirdLetter,start:26,end:50})]}),jsxRuntimeExports.jsx(I,{})]}),(a==null?void 0:a.serializerKillHouseRequestsFourthPartTwo.length)>50&&jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.tableInNewPage,children:[jsxRuntimeExports.jsx("h3",{style:{margin:"10px"},children:"اطلاعات انبار خریداران و پخش به مباشرین:"}),jsxRuntimeExports.jsx(T,{items:a==null?void 0:a.serializerKillHouseRequestsThirdLetter,start:51,end:75})]}),jsxRuntimeExports.jsx(I,{})]})]}),jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.pageData,children:[jsxRuntimeExports.jsxs("h3",{style:{margin:"10px"},children:["گزارش توزیع و پخش گوشت مرغ گرم به مباشرین و اصناف:"," "]}),jsxRuntimeExports.jsxs("div",{style:styles.container,children:[jsxRuntimeExports.jsxs("p",{style:{marginTop:"10px"},children:["اطلاعات :"," ",jsxRuntimeExports.jsxs("span",{style:{color:"green",fontWeight:"boler",fontSize:"14px"},children:["تعداد تخصیصات: (",a==null?void 0:a.serializerKillHouseRequestsFourthPartSixth.toLocaleString(),") مورد، حجم لاشه ها (",a==null?void 0:a.serializerKillHouseRequestsFourthPartFourth.toLocaleString(),") قطعه، وزن لاشه ها (",Math.floor(a==null?void 0:a.serializerKillHouseRequestsFourthPartFifth).toLocaleString(),") کیلوگرم."]})]}),jsxRuntimeExports.jsx(O,{items:a==null?void 0:a.serializerKillHouseRequestsFourthPartThree,start:1,end:26})]})]}),jsxRuntimeExports.jsx(I,{})]}),(a==null?void 0:a.serializerKillHouseRequestsFourthPartThree.length)>26&&jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.tableInNewPage,children:[jsxRuntimeExports.jsxs("h3",{style:{margin:"10px"},children:["گزارش توزیع و پخش گوشت مرغ گرم به مباشرین و اصناف:"," "]}),jsxRuntimeExports.jsx(O,{items:a==null?void 0:a.serializerKillHouseRequestsFourthPartThree,start:27,end:55})]}),jsxRuntimeExports.jsx(I,{})]}),(a==null?void 0:a.serializerKillHouseRequestsFourthPartThree.length)>55&&jsxRuntimeExports.jsxs("div",{style:styles.page,children:[jsxRuntimeExports.jsx(R,{}),jsxRuntimeExports.jsxs("div",{style:styles.tableInNewPage,children:[jsxRuntimeExports.jsxs("h3",{style:{margin:"10px"},children:["گزارش توزیع و پخش گوشت مرغ گرم به مباشرین و اصناف:"," "]}),jsxRuntimeExports.jsx(O,{items:a==null?void 0:a.serializerKillHouseRequestsFourthPartThree,start:56,end:100})]}),jsxRuntimeExports.jsx(I,{})]})]})});ProvinceGetReportFile.displayName="ProvinceGetReportFile";ProvinceGetReportFile.propTypes={item:propTypesExports.PropTypes.any};const provinceGetProcessData=createAsyncThunk("PROVINCE_GET_REPORT_PROCESS",async(e,{dispatch:t})=>{t(LOADING_START());try{const{data:a,status:s}=await axios$1.get(`general_poultry_request_letter_report/?date=${e.selectedDate1}&type=${e.value}`);return t(LOADING_END()),{data:a,status:s}}catch(a){throw t(LOADING_END()),a}});var ArrowBack={},_interopRequireDefault$4=interopRequireDefaultExports;Object.defineProperty(ArrowBack,"__esModule",{value:!0});var default_1$4=ArrowBack.default=void 0,_createSvgIcon$4=_interopRequireDefault$4(requireCreateSvgIcon()),_jsxRuntime$4=jsxRuntimeExports;default_1$4=ArrowBack.default=(0,_createSvgIcon$4.default)((0,_jsxRuntime$4.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack");var isMergeableObject=function e(t){return isNonNullObject(t)&&!isSpecial(t)};function isNonNullObject(e){return!!e&&typeof e=="object"}function isSpecial(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||isReactElement(e)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(e){return e.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(e){return Array.isArray(e)?[]:{}}function cloneUnlessOtherwiseSpecified(e,t){return t.clone!==!1&&t.isMergeableObject(e)?deepmerge(emptyTarget(e),e,t):e}function defaultArrayMerge(e,t,a){return e.concat(t).map(function(s){return cloneUnlessOtherwiseSpecified(s,a)})}function mergeObject(e,t,a){var s={};return a.isMergeableObject(e)&&Object.keys(e).forEach(function(n){s[n]=cloneUnlessOtherwiseSpecified(e[n],a)}),Object.keys(t).forEach(function(n){!a.isMergeableObject(t[n])||!e[n]?s[n]=cloneUnlessOtherwiseSpecified(t[n],a):s[n]=deepmerge(e[n],t[n],a)}),s}function deepmerge(e,t,a){a=a||{},a.arrayMerge=a.arrayMerge||defaultArrayMerge,a.isMergeableObject=a.isMergeableObject||isMergeableObject;var s=Array.isArray(t),n=Array.isArray(e),i=s===n;return i?s?a.arrayMerge(e,t,a):mergeObject(e,t,a):cloneUnlessOtherwiseSpecified(t,a)}deepmerge.all=function e(t,a){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(s,n){return deepmerge(s,n,a)},{})};var deepmerge_1=deepmerge,freeGlobal$2=typeof global=="object"&&global&&global.Object===Object&&global,freeSelf$1=typeof self=="object"&&self&&self.Object===Object&&self,root$a=freeGlobal$2||freeSelf$1||Function("return this")(),Symbol$6=root$a.Symbol,objectProto$q=Object.prototype,hasOwnProperty$k=objectProto$q.hasOwnProperty,nativeObjectToString$3=objectProto$q.toString,symToStringTag$3=Symbol$6?Symbol$6.toStringTag:void 0;function getRawTag$2(e){var t=hasOwnProperty$k.call(e,symToStringTag$3),a=e[symToStringTag$3];try{e[symToStringTag$3]=void 0;var s=!0}catch{}var n=nativeObjectToString$3.call(e);return s&&(t?e[symToStringTag$3]=a:delete e[symToStringTag$3]),n}var objectProto$p=Object.prototype,nativeObjectToString$2=objectProto$p.toString;function objectToString$2(e){return nativeObjectToString$2.call(e)}var nullTag$1="[object Null]",undefinedTag$1="[object Undefined]",symToStringTag$2=Symbol$6?Symbol$6.toStringTag:void 0;function baseGetTag$6(e){return e==null?e===void 0?undefinedTag$1:nullTag$1:symToStringTag$2&&symToStringTag$2 in Object(e)?getRawTag$2(e):objectToString$2(e)}function overArg$2(e,t){return function(a){return e(t(a))}}var getPrototype=overArg$2(Object.getPrototypeOf,Object);function isObjectLike$6(e){return e!=null&&typeof e=="object"}var objectTag$6="[object Object]",funcProto$4=Function.prototype,objectProto$o=Object.prototype,funcToString$4=funcProto$4.toString,hasOwnProperty$j=objectProto$o.hasOwnProperty,objectCtorString=funcToString$4.call(Object);function isPlainObject(e){if(!isObjectLike$6(e)||baseGetTag$6(e)!=objectTag$6)return!1;var t=getPrototype(e);if(t===null)return!0;var a=hasOwnProperty$j.call(t,"constructor")&&t.constructor;return typeof a=="function"&&a instanceof a&&funcToString$4.call(a)==objectCtorString}function listCacheClear$2(){this.__data__=[],this.size=0}function eq$3(e,t){return e===t||e!==e&&t!==t}function assocIndexOf$5(e,t){for(var a=e.length;a--;)if(eq$3(e[a][0],t))return a;return-1}var arrayProto$1=Array.prototype,splice$1=arrayProto$1.splice;function listCacheDelete$2(e){var t=this.__data__,a=assocIndexOf$5(t,e);if(a<0)return!1;var s=t.length-1;return a==s?t.pop():splice$1.call(t,a,1),--this.size,!0}function listCacheGet$2(e){var t=this.__data__,a=assocIndexOf$5(t,e);return a<0?void 0:t[a][1]}function listCacheHas$2(e){return assocIndexOf$5(this.__data__,e)>-1}function listCacheSet$2(e,t){var a=this.__data__,s=assocIndexOf$5(a,e);return s<0?(++this.size,a.push([e,t])):a[s][1]=t,this}function ListCache$5(e){var t=-1,a=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=MAX_SAFE_INTEGER$2}var argsTag$4="[object Arguments]",arrayTag$3="[object Array]",boolTag$4="[object Boolean]",dateTag$4="[object Date]",errorTag$3="[object Error]",funcTag$3="[object Function]",mapTag$7="[object Map]",numberTag$4="[object Number]",objectTag$5="[object Object]",regexpTag$4="[object RegExp]",setTag$7="[object Set]",stringTag$4="[object String]",weakMapTag$4="[object WeakMap]",arrayBufferTag$4="[object ArrayBuffer]",dataViewTag$6="[object DataView]",float32Tag$3="[object Float32Array]",float64Tag$3="[object Float64Array]",int8Tag$3="[object Int8Array]",int16Tag$3="[object Int16Array]",int32Tag$3="[object Int32Array]",uint8Tag$3="[object Uint8Array]",uint8ClampedTag$3="[object Uint8ClampedArray]",uint16Tag$3="[object Uint16Array]",uint32Tag$3="[object Uint32Array]",typedArrayTags$1={};typedArrayTags$1[float32Tag$3]=typedArrayTags$1[float64Tag$3]=typedArrayTags$1[int8Tag$3]=typedArrayTags$1[int16Tag$3]=typedArrayTags$1[int32Tag$3]=typedArrayTags$1[uint8Tag$3]=typedArrayTags$1[uint8ClampedTag$3]=typedArrayTags$1[uint16Tag$3]=typedArrayTags$1[uint32Tag$3]=!0;typedArrayTags$1[argsTag$4]=typedArrayTags$1[arrayTag$3]=typedArrayTags$1[arrayBufferTag$4]=typedArrayTags$1[boolTag$4]=typedArrayTags$1[dataViewTag$6]=typedArrayTags$1[dateTag$4]=typedArrayTags$1[errorTag$3]=typedArrayTags$1[funcTag$3]=typedArrayTags$1[mapTag$7]=typedArrayTags$1[numberTag$4]=typedArrayTags$1[objectTag$5]=typedArrayTags$1[regexpTag$4]=typedArrayTags$1[setTag$7]=typedArrayTags$1[stringTag$4]=typedArrayTags$1[weakMapTag$4]=!1;function baseIsTypedArray$2(e){return isObjectLike$6(e)&&isLength$4(e.length)&&!!typedArrayTags$1[baseGetTag$6(e)]}function baseUnary$2(e){return function(t){return e(t)}}var freeExports$1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,freeProcess=moduleExports$1&&freeGlobal$2.process,nodeUtil$1=function(){try{var e=freeModule$1&&freeModule$1.require&&freeModule$1.require("util").types;return e||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch{}}(),nodeIsTypedArray$1=nodeUtil$1&&nodeUtil$1.isTypedArray,isTypedArray$3=nodeIsTypedArray$1?baseUnary$2(nodeIsTypedArray$1):baseIsTypedArray$2,objectProto$i=Object.prototype,hasOwnProperty$d=objectProto$i.hasOwnProperty;function arrayLikeKeys$2(e,t){var a=isArray$b(e),s=!a&&isArguments$3(e),n=!a&&!s&&isBuffer$3(e),i=!a&&!s&&!n&&isTypedArray$3(e),o=a||s||n||i,u=o?baseTimes$2(e.length,String):[],l=u.length;for(var c in e)(t||hasOwnProperty$d.call(e,c))&&!(o&&(c=="length"||n&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||isIndex$3(c,l)))&&u.push(c);return u}var objectProto$h=Object.prototype;function isPrototype$2(e){var t=e&&e.constructor,a=typeof t=="function"&&t.prototype||objectProto$h;return e===a}var nativeKeys$2=overArg$2(Object.keys,Object),objectProto$g=Object.prototype,hasOwnProperty$c=objectProto$g.hasOwnProperty;function baseKeys$2(e){if(!isPrototype$2(e))return nativeKeys$2(e);var t=[];for(var a in Object(e))hasOwnProperty$c.call(e,a)&&a!="constructor"&&t.push(a);return t}function isArrayLike$2(e){return e!=null&&isLength$4(e.length)&&!isFunction$4(e)}function keys$4(e){return isArrayLike$2(e)?arrayLikeKeys$2(e):baseKeys$2(e)}function baseAssign(e,t){return e&©Object(t,keys$4(t),e)}function nativeKeysIn(e){var t=[];if(e!=null)for(var a in Object(e))t.push(a);return t}var objectProto$f=Object.prototype,hasOwnProperty$b=objectProto$f.hasOwnProperty;function baseKeysIn(e){if(!isObject$6(e))return nativeKeysIn(e);var t=isPrototype$2(e),a=[];for(var s in e)s=="constructor"&&(t||!hasOwnProperty$b.call(e,s))||a.push(s);return a}function keysIn(e){return isArrayLike$2(e)?arrayLikeKeys$2(e,!0):baseKeysIn(e)}function baseAssignIn(e,t){return e&©Object(t,keysIn(t),e)}var freeExports=typeof exports=="object"&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&typeof module=="object"&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer$1=moduleExports?root$a.Buffer:void 0,allocUnsafe=Buffer$1?Buffer$1.allocUnsafe:void 0;function cloneBuffer(e,t){if(t)return e.slice();var a=e.length,s=allocUnsafe?allocUnsafe(a):new e.constructor(a);return e.copy(s),s}function copyArray(e,t){var a=-1,s=e.length;for(t||(t=Array(s));++a=0)&&(a[n]=e[n]);return a}function _assertThisInitialized$1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var FormikContext=reactExports.createContext(void 0);FormikContext.displayName="FormikContext";var FormikProvider=FormikContext.Provider,FormikConsumer=FormikContext.Consumer;function useFormikContext(){var e=reactExports.useContext(FormikContext);return e}var isEmptyArray=function e(t){return Array.isArray(t)&&t.length===0},isFunction$3=function e(t){return typeof t=="function"},isObject$5=function e(t){return t!==null&&typeof t=="object"},isInteger=function e(t){return String(Math.floor(Number(t)))===t},isString=function e(t){return Object.prototype.toString.call(t)==="[object String]"},isEmptyChildren=function e(t){return reactExports.Children.count(t)===0},isPromise=function e(t){return isObject$5(t)&&isFunction$3(t.then)};function getIn$1(e,t,a,s){s===void 0&&(s=0);for(var n=toPath(t);e&&s=0?[]:{}}}return(i===0?e:n)[o[i]]===a?e:(a===void 0?delete n[o[i]]:n[o[i]]=a,i===0&&a===void 0&&delete s[o[i]],s)}function setNestedObjectValues(e,t,a,s){a===void 0&&(a=new WeakMap),s===void 0&&(s={});for(var n=0,i=Object.keys(e);n0?le.map(function(Ee){return X(Ee,getIn$1(re,Ee))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(pe).then(function(Ee){return Ee.reduce(function(Re,xe,Pe){return xe==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||xe&&(Re=setIn(Re,le[Pe],xe)),Re},{})})},[X]),H=reactExports.useCallback(function(re){return Promise.all([B(re),d.validationSchema?j(re):{},d.validate?L(re):{}]).then(function(le){var pe=le[0],Ee=le[1],Re=le[2],xe=deepmerge_1.all([pe,Ee,Re],{arrayMerge});return xe})},[d.validate,d.validationSchema,B,L,j]),W=useEventCallback(function(re){return re===void 0&&(re=C.values),U({type:"SET_ISVALIDATING",payload:!0}),H(re).then(function(le){return A.current&&(U({type:"SET_ISVALIDATING",payload:!1}),U({type:"SET_ERRORS",payload:le})),le})});reactExports.useEffect(function(){o&&A.current===!0&&isEqual(E.current,d.initialValues)&&W(E.current)},[o,W]);var K=reactExports.useCallback(function(re){var le=re&&re.values?re.values:E.current,pe=re&&re.errors?re.errors:R.current?R.current:d.initialErrors||{},Ee=re&&re.touched?re.touched:y.current?y.current:d.initialTouched||{},Re=re&&re.status?re.status:I.current?I.current:d.initialStatus;E.current=le,R.current=pe,y.current=Ee,I.current=Re;var xe=function(){U({type:"RESET_FORM",payload:{isSubmitting:!!re&&!!re.isSubmitting,errors:pe,touched:Ee,status:Re,values:le,isValidating:!!re&&!!re.isValidating,submitCount:re&&re.submitCount&&typeof re.submitCount=="number"?re.submitCount:0}})};if(d.onReset){var Pe=d.onReset(C.values,Q);isPromise(Pe)?Pe.then(xe):xe()}else xe()},[d.initialErrors,d.initialStatus,d.initialTouched,d.onReset]);reactExports.useEffect(function(){A.current===!0&&!isEqual(E.current,d.initialValues)&&c&&(E.current=d.initialValues,K(),o&&W(E.current))},[c,d.initialValues,K,o,W]),reactExports.useEffect(function(){c&&A.current===!0&&!isEqual(R.current,d.initialErrors)&&(R.current=d.initialErrors||emptyErrors,U({type:"SET_ERRORS",payload:d.initialErrors||emptyErrors}))},[c,d.initialErrors]),reactExports.useEffect(function(){c&&A.current===!0&&!isEqual(y.current,d.initialTouched)&&(y.current=d.initialTouched||emptyTouched,U({type:"SET_TOUCHED",payload:d.initialTouched||emptyTouched}))},[c,d.initialTouched]),reactExports.useEffect(function(){c&&A.current===!0&&!isEqual(I.current,d.initialStatus)&&(I.current=d.initialStatus,U({type:"SET_STATUS",payload:d.initialStatus}))},[c,d.initialStatus,d.initialTouched]);var b=useEventCallback(function(re){if(x.current[re]&&isFunction$3(x.current[re].validate)){var le=getIn$1(C.values,re),pe=x.current[re].validate(le);return isPromise(pe)?(U({type:"SET_ISVALIDATING",payload:!0}),pe.then(function(Ee){return Ee}).then(function(Ee){U({type:"SET_FIELD_ERROR",payload:{field:re,value:Ee}}),U({type:"SET_ISVALIDATING",payload:!1})})):(U({type:"SET_FIELD_ERROR",payload:{field:re,value:pe}}),Promise.resolve(pe))}else if(d.validationSchema)return U({type:"SET_ISVALIDATING",payload:!0}),j(C.values,re).then(function(Ee){return Ee}).then(function(Ee){U({type:"SET_FIELD_ERROR",payload:{field:re,value:getIn$1(Ee,re)}}),U({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),k=reactExports.useCallback(function(re,le){var pe=le.validate;x.current[re]={validate:pe}},[]),F=reactExports.useCallback(function(re){delete x.current[re]},[]),N=useEventCallback(function(re,le){U({type:"SET_TOUCHED",payload:re});var pe=le===void 0?n:le;return pe?W(C.values):Promise.resolve()}),M=reactExports.useCallback(function(re){U({type:"SET_ERRORS",payload:re})},[]),G=useEventCallback(function(re,le){var pe=isFunction$3(re)?re(C.values):re;U({type:"SET_VALUES",payload:pe});var Ee=le===void 0?a:le;return Ee?W(pe):Promise.resolve()}),V=reactExports.useCallback(function(re,le){U({type:"SET_FIELD_ERROR",payload:{field:re,value:le}})},[]),ee=useEventCallback(function(re,le,pe){U({type:"SET_FIELD_VALUE",payload:{field:re,value:le}});var Ee=pe===void 0?a:pe;return Ee?W(setIn(C.values,re,le)):Promise.resolve()}),ae=reactExports.useCallback(function(re,le){var pe=le,Ee=re,Re;if(!isString(re)){re.persist&&re.persist();var xe=re.target?re.target:re.currentTarget,Pe=xe.type,Oe=xe.name,ye=xe.id,Le=xe.value,Be=xe.checked;xe.outerHTML;var je=xe.options,Ke=xe.multiple;pe=le||Oe||ye,Ee=/number|range/.test(Pe)?(Re=parseFloat(Le),isNaN(Re)?"":Re):/checkbox/.test(Pe)?getValueForCheckbox(getIn$1(C.values,pe),Be,Le):je&&Ke?getSelectedValues(je):Le}pe&&ee(pe,Ee)},[ee,C.values]),ne=useEventCallback(function(re){if(isString(re))return function(le){return ae(le,re)};ae(re)}),J=useEventCallback(function(re,le,pe){le===void 0&&(le=!0),U({type:"SET_FIELD_TOUCHED",payload:{field:re,value:le}});var Ee=pe===void 0?n:pe;return Ee?W(C.values):Promise.resolve()}),ue=reactExports.useCallback(function(re,le){re.persist&&re.persist();var pe=re.target,Ee=pe.name,Re=pe.id;pe.outerHTML;var xe=le||Ee||Re;J(xe,!0)},[J]),oe=useEventCallback(function(re){if(isString(re))return function(le){return ue(le,re)};ue(re)}),_e=reactExports.useCallback(function(re){isFunction$3(re)?U({type:"SET_FORMIK_STATE",payload:re}):U({type:"SET_FORMIK_STATE",payload:function(){return re}})},[]),Y=reactExports.useCallback(function(re){U({type:"SET_STATUS",payload:re})},[]),Z=reactExports.useCallback(function(re){U({type:"SET_ISSUBMITTING",payload:re})},[]),te=useEventCallback(function(){return U({type:"SUBMIT_ATTEMPT"}),W().then(function(re){var le=re instanceof Error,pe=!le&&Object.keys(re).length===0;if(pe){var Ee;try{if(Ee=se(),Ee===void 0)return}catch(Re){throw Re}return Promise.resolve(Ee).then(function(Re){return A.current&&U({type:"SUBMIT_SUCCESS"}),Re}).catch(function(Re){if(A.current)throw U({type:"SUBMIT_FAILURE"}),Re})}else if(A.current&&(U({type:"SUBMIT_FAILURE"}),le))throw re})}),q=useEventCallback(function(re){re&&re.preventDefault&&isFunction$3(re.preventDefault)&&re.preventDefault(),re&&re.stopPropagation&&isFunction$3(re.stopPropagation)&&re.stopPropagation(),te().catch(function(le){console.warn("Warning: An unhandled error was caught from submitForm()",le)})}),Q={resetForm:K,validateForm:W,validateField:b,setErrors:M,setFieldError:V,setFieldTouched:J,setFieldValue:ee,setStatus:Y,setSubmitting:Z,setTouched:N,setValues:G,setFormikState:_e,submitForm:te},se=useEventCallback(function(){return _(C.values,Q)}),fe=useEventCallback(function(re){re&&re.preventDefault&&isFunction$3(re.preventDefault)&&re.preventDefault(),re&&re.stopPropagation&&isFunction$3(re.stopPropagation)&&re.stopPropagation(),K()}),me=reactExports.useCallback(function(re){return{value:getIn$1(C.values,re),error:getIn$1(C.errors,re),touched:!!getIn$1(C.touched,re),initialValue:getIn$1(E.current,re),initialTouched:!!getIn$1(y.current,re),initialError:getIn$1(R.current,re)}},[C.errors,C.touched,C.values]),ve=reactExports.useCallback(function(re){return{setValue:function(pe,Ee){return ee(re,pe,Ee)},setTouched:function(pe,Ee){return J(re,pe,Ee)},setError:function(pe){return V(re,pe)}}},[ee,J,V]),Ae=reactExports.useCallback(function(re){var le=isObject$5(re),pe=le?re.name:re,Ee=getIn$1(C.values,pe),Re={name:pe,value:Ee,onChange:ne,onBlur:oe};if(le){var xe=re.type,Pe=re.value,Oe=re.as,ye=re.multiple;xe==="checkbox"?Pe===void 0?Re.checked=!!Ee:(Re.checked=!!(Array.isArray(Ee)&&~Ee.indexOf(Pe)),Re.value=Pe):xe==="radio"?(Re.checked=Ee===Pe,Re.value=Pe):Oe==="select"&&ye&&(Re.value=Re.value||[],Re.multiple=!0)}return Re},[oe,ne,C.values]),ce=reactExports.useMemo(function(){return!isEqual(E.current,C.values)},[E.current,C.values]),Se=reactExports.useMemo(function(){return typeof u<"u"?ce?C.errors&&Object.keys(C.errors).length===0:u!==!1&&isFunction$3(u)?u(d):u:C.errors&&Object.keys(C.errors).length===0},[u,ce,C.errors,d]),Te=_extends$5({},C,{initialValues:E.current,initialErrors:R.current,initialTouched:y.current,initialStatus:I.current,handleBlur:oe,handleChange:ne,handleReset:fe,handleSubmit:q,resetForm:K,setErrors:M,setFormikState:_e,setFieldTouched:J,setFieldValue:ee,setFieldError:V,setStatus:Y,setSubmitting:Z,setTouched:N,setValues:G,submitForm:te,validateForm:W,validateField:b,isValid:Se,dirty:ce,unregisterField:F,registerField:k,getFieldProps:Ae,getFieldMeta:me,getFieldHelpers:ve,validateOnBlur:n,validateOnChange:a,validateOnMount:o});return Te}function Formik(e){var t=useFormik(e),a=e.component,s=e.children,n=e.render,i=e.innerRef;return reactExports.useImperativeHandle(i,function(){return t}),reactExports.createElement(FormikProvider,{value:t},a?reactExports.createElement(a,t):n?n(t):s?isFunction$3(s)?s(t):isEmptyChildren(s)?null:reactExports.Children.only(s):null)}function yupToFormErrors(e){var t={};if(e.inner){if(e.inner.length===0)return setIn(t,e.path,e.message);for(var n=e.inner,a=Array.isArray(n),s=0,n=a?n:n[Symbol.iterator]();;){var i;if(a){if(s>=n.length)break;i=n[s++]}else{if(s=n.next(),s.done)break;i=s.value}var o=i;getIn$1(t,o.path)||(t=setIn(t,o.path,o.message))}}return t}function validateYupSchema(e,t,a,s){a===void 0&&(a=!1);var n=prepareDataForValidation(e);return t[a?"validateSync":"validate"](n,{abortEarly:!1,context:n})}function prepareDataForValidation(e){var t=Array.isArray(e)?[]:{};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var s=String(a);Array.isArray(e[s])===!0?t[s]=e[s].map(function(n){return Array.isArray(n)===!0||isPlainObject(n)?prepareDataForValidation(n):n!==""?n:void 0}):isPlainObject(e[s])?t[s]=prepareDataForValidation(e[s]):t[s]=e[s]!==""?e[s]:void 0}return t}function arrayMerge(e,t,a){var s=e.slice();return t.forEach(function(i,o){if(typeof s[o]>"u"){var u=a.clone!==!1,l=u&&a.isMergeableObject(i);s[o]=l?deepmerge_1(Array.isArray(i)?[]:{},i,a):i}else a.isMergeableObject(i)?s[o]=deepmerge_1(e[o],i,a):e.indexOf(i)===-1&&s.push(i)}),s}function getSelectedValues(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function getValueForCheckbox(e,t,a){if(typeof e=="boolean")return!!t;var s=[],n=!1,i=-1;if(Array.isArray(e))s=e,i=e.indexOf(a),n=i>=0;else if(!a||a=="true"||a=="false")return!!t;return t&&a&&!n?s.concat(a):n?s.slice(0,i).concat(s.slice(i+1)):s}var useIsomorphicLayoutEffect=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function useEventCallback(e){var t=reactExports.useRef(e);return useIsomorphicLayoutEffect(function(){t.current=e}),reactExports.useCallback(function(){for(var a=arguments.length,s=new Array(a),n=0;ns?n:s},0);return Array.from(_extends$5({},t,{length:a+1}))}else return[]},createAlterationHandler=function e(t,a){var s=typeof t=="function"?t:a;return function(n){if(Array.isArray(n)||isObject$5(n)){var i=copyArrayLike(n);return s(i)}return n}},FieldArrayInner=function(e){_inheritsLoose(t,e);function t(s){var n;return n=e.call(this,s)||this,n.updateArrayField=function(i,o,u){var l=n.props,c=l.name,_=l.formik.setFormikState;_(function(p){var d=createAlterationHandler(u,i),E=createAlterationHandler(o,i),R=setIn(p.values,c,i(getIn$1(p.values,c))),y=u?d(getIn$1(p.errors,c)):void 0,I=o?E(getIn$1(p.touched,c)):void 0;return isEmptyArray(y)&&(y=void 0),isEmptyArray(I)&&(I=void 0),_extends$5({},p,{values:R,errors:u?setIn(p.errors,c,y):p.errors,touched:o?setIn(p.touched,c,I):p.touched})})},n.push=function(i){return n.updateArrayField(function(o){return[].concat(copyArrayLike(o),[cloneDeep(i)])},!1,!1)},n.handlePush=function(i){return function(){return n.push(i)}},n.swap=function(i,o){return n.updateArrayField(function(u){return swap(u,i,o)},!0,!0)},n.handleSwap=function(i,o){return function(){return n.swap(i,o)}},n.move=function(i,o){return n.updateArrayField(function(u){return move(u,i,o)},!0,!0)},n.handleMove=function(i,o){return function(){return n.move(i,o)}},n.insert=function(i,o){return n.updateArrayField(function(u){return insert(u,i,o)},function(u){return insert(u,i,null)},function(u){return insert(u,i,null)})},n.handleInsert=function(i,o){return function(){return n.insert(i,o)}},n.replace=function(i,o){return n.updateArrayField(function(u){return replace(u,i,o)},!1,!1)},n.handleReplace=function(i,o){return function(){return n.replace(i,o)}},n.unshift=function(i){var o=-1;return n.updateArrayField(function(u){var l=u?[i].concat(u):[i];return o=l.length,l},function(u){return u?[null].concat(u):[null]},function(u){return u?[null].concat(u):[null]}),o},n.handleUnshift=function(i){return function(){return n.unshift(i)}},n.handleRemove=function(i){return function(){return n.remove(i)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(_assertThisInitialized$1(n)),n.pop=n.pop.bind(_assertThisInitialized$1(n)),n}var a=t.prototype;return a.componentDidUpdate=function(n){this.props.validateOnChange&&this.props.formik.validateOnChange&&!isEqual(getIn$1(n.formik.values,n.name),getIn$1(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},a.remove=function(n){var i;return this.updateArrayField(function(o){var u=o?copyArrayLike(o):[];return i||(i=u[n]),isFunction$3(u.splice)&&u.splice(n,1),isFunction$3(u.every)&&u.every(function(l){return l===void 0})?[]:u},!0,!0),i},a.pop=function(){var n;return this.updateArrayField(function(i){var o=i.slice();return n||(n=o&&o.pop&&o.pop()),o},!0,!0),n},a.render=function(){var n={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},i=this.props,o=i.component,u=i.render,l=i.children,c=i.name,_=i.formik,p=_objectWithoutPropertiesLoose$1(_,["validate","validationSchema"]),d=_extends$5({},n,{form:p,name:c});return o?reactExports.createElement(o,d):u?u(d):l?typeof l=="function"?l(d):isEmptyChildren(l)?null:reactExports.Children.only(l):null},t}(reactExports.Component);FieldArrayInner.defaultProps={validateOnChange:!0};var ErrorMessageImpl=function(e){_inheritsLoose(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;return a.shouldComponentUpdate=function(n){return getIn$1(this.props.formik.errors,this.props.name)!==getIn$1(n.formik.errors,this.props.name)||getIn$1(this.props.formik.touched,this.props.name)!==getIn$1(n.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(n).length},a.render=function(){var n=this.props,i=n.component,o=n.formik,u=n.render,l=n.children,c=n.name,_=_objectWithoutPropertiesLoose$1(n,["component","formik","render","children","name"]),p=getIn$1(o.touched,c),d=getIn$1(o.errors,c);return p&&d?u?isFunction$3(u)?u(d):null:l?isFunction$3(l)?l(d):null:i?reactExports.createElement(i,_,d):d:null},t}(reactExports.Component),ErrorMessage=connect(ErrorMessageImpl),map$1;try{map$1=Map}catch(e){}var set;try{set=Set}catch(e){}function baseClone(e,t,a){if(!e||typeof e!="object"||typeof e=="function")return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(clone);if(map$1&&e instanceof map$1)return new Map(Array.from(e.entries()));if(set&&e instanceof set)return new Set(Array.from(e.values()));if(e instanceof Object){t.push(e);var s=Object.create(e);a.push(s);for(var n in e){var i=t.findIndex(function(o){return o===e[n]});s[n]=i>-1?a[i]:baseClone(e[n],t,a)}return s}return e}function clone(e){return baseClone(e,[],[])}const toString$6=Object.prototype.toString,errorToString=Error.prototype.toString,regExpToString=RegExp.prototype.toString,symbolToString$1=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",SYMBOL_REGEXP=/^Symbol\((.*)\)(.*)$/;function printNumber(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function printSimpleValue(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const a=typeof e;if(a==="number")return printNumber(e);if(a==="string")return t?`"${e}"`:e;if(a==="function")return"[Function "+(e.name||"anonymous")+"]";if(a==="symbol")return symbolToString$1.call(e).replace(SYMBOL_REGEXP,"Symbol($1)");const s=toString$6.call(e).slice(8,-1);return s==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):s==="Error"||e instanceof Error?"["+errorToString.call(e)+"]":s==="RegExp"?regExpToString.call(e):null}function printValue(e,t){let a=printSimpleValue(e,t);return a!==null?a:JSON.stringify(e,function(s,n){let i=printSimpleValue(this[s],t);return i!==null?i:n},2)}let mixed={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:a,originalValue:s})=>{let n=s!=null&&s!==a,i=`${e} must be a \`${t}\` type, but the final value was: \`${printValue(a,!0)}\``+(n?` (cast from the value \`${printValue(s,!0)}\`).`:".");return a===null&&(i+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),i},defined:"${path} must be defined"},string={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},number={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},boolean={isValue:"${path} field must be ${value}"},object={noUnknown:"${path} field has unspecified keys: ${unknown}"},array={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};Object.assign(Object.create(null),{mixed,string,number,date,object,array,boolean});var objectProto$c=Object.prototype,hasOwnProperty$9=objectProto$c.hasOwnProperty;function baseHas$1(e,t){return e!=null&&hasOwnProperty$9.call(e,t)}var _baseHas=baseHas$1,isArray$9=Array.isArray,isArray_1=isArray$9,freeGlobal$1=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal$1,freeGlobal=_freeGlobal,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root$9=freeGlobal||freeSelf||Function("return this")(),_root=root$9,root$8=_root,Symbol$5=root$8.Symbol,_Symbol=Symbol$5,Symbol$4=_Symbol,objectProto$b=Object.prototype,hasOwnProperty$8=objectProto$b.hasOwnProperty,nativeObjectToString$1=objectProto$b.toString,symToStringTag$1=Symbol$4?Symbol$4.toStringTag:void 0;function getRawTag$1(e){var t=hasOwnProperty$8.call(e,symToStringTag$1),a=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var s=!0}catch{}var n=nativeObjectToString$1.call(e);return s&&(t?e[symToStringTag$1]=a:delete e[symToStringTag$1]),n}var _getRawTag=getRawTag$1,objectProto$a=Object.prototype,nativeObjectToString=objectProto$a.toString;function objectToString$1(e){return nativeObjectToString.call(e)}var _objectToString=objectToString$1,Symbol$3=_Symbol,getRawTag=_getRawTag,objectToString=_objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$3?Symbol$3.toStringTag:void 0;function baseGetTag$5(e){return e==null?e===void 0?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}var _baseGetTag=baseGetTag$5;function isObjectLike$5(e){return e!=null&&typeof e=="object"}var isObjectLike_1=isObjectLike$5,baseGetTag$4=_baseGetTag,isObjectLike$4=isObjectLike_1,symbolTag$1="[object Symbol]";function isSymbol$3(e){return typeof e=="symbol"||isObjectLike$4(e)&&baseGetTag$4(e)==symbolTag$1}var isSymbol_1=isSymbol$3,isArray$8=isArray_1,isSymbol$2=isSymbol_1,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey$3(e,t){if(isArray$8(e))return!1;var a=typeof e;return a=="number"||a=="symbol"||a=="boolean"||e==null||isSymbol$2(e)?!0:reIsPlainProp.test(e)||!reIsDeepProp.test(e)||t!=null&&e in Object(t)}var _isKey=isKey$3;function isObject$4(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var isObject_1=isObject$4,baseGetTag$3=_baseGetTag,isObject$3=isObject_1,asyncTag="[object AsyncFunction]",funcTag$1="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$2(e){if(!isObject$3(e))return!1;var t=baseGetTag$3(e);return t==funcTag$1||t==genTag||t==asyncTag||t==proxyTag}var isFunction_1=isFunction$2,root$7=_root,coreJsData$1=root$7["__core-js_shared__"],_coreJsData=coreJsData$1,coreJsData=_coreJsData,maskSrcKey=function(){var e=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function isMasked$1(e){return!!maskSrcKey&&maskSrcKey in e}var _isMasked=isMasked$1,funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource$2(e){if(e!=null){try{return funcToString$1.call(e)}catch{}try{return e+""}catch{}}return""}var _toSource=toSource$2,isFunction$1=isFunction_1,isMasked=_isMasked,isObject$2=isObject_1,toSource$1=_toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$9=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$7=objectProto$9.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$7).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative$1(e){if(!isObject$2(e)||isMasked(e))return!1;var t=isFunction$1(e)?reIsNative:reIsHostCtor;return t.test(toSource$1(e))}var _baseIsNative=baseIsNative$1;function getValue$1(e,t){return e==null?void 0:e[t]}var _getValue=getValue$1,baseIsNative=_baseIsNative,getValue=_getValue;function getNative$7(e,t){var a=getValue(e,t);return baseIsNative(a)?a:void 0}var _getNative=getNative$7,getNative$6=_getNative,nativeCreate$4=getNative$6(Object,"create"),_nativeCreate=nativeCreate$4,nativeCreate$3=_nativeCreate;function hashClear$1(){this.__data__=nativeCreate$3?nativeCreate$3(null):{},this.size=0}var _hashClear=hashClear$1;function hashDelete$1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _hashDelete=hashDelete$1,nativeCreate$2=_nativeCreate,HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty;function hashGet$1(e){var t=this.__data__;if(nativeCreate$2){var a=t[e];return a===HASH_UNDEFINED$2?void 0:a}return hasOwnProperty$6.call(t,e)?t[e]:void 0}var _hashGet=hashGet$1,nativeCreate$1=_nativeCreate,objectProto$7=Object.prototype,hasOwnProperty$5=objectProto$7.hasOwnProperty;function hashHas$1(e){var t=this.__data__;return nativeCreate$1?t[e]!==void 0:hasOwnProperty$5.call(t,e)}var _hashHas=hashHas$1,nativeCreate=_nativeCreate,HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet$1(e,t){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=nativeCreate&&t===void 0?HASH_UNDEFINED$1:t,this}var _hashSet=hashSet$1,hashClear=_hashClear,hashDelete=_hashDelete,hashGet=_hashGet,hashHas=_hashHas,hashSet=_hashSet;function Hash$1(e){var t=-1,a=e==null?0:e.length;for(this.clear();++t-1}var _listCacheHas=listCacheHas$1,assocIndexOf=_assocIndexOf;function listCacheSet$1(e,t){var a=this.__data__,s=assocIndexOf(a,e);return s<0?(++this.size,a.push([e,t])):a[s][1]=t,this}var _listCacheSet=listCacheSet$1,listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$4(e){var t=-1,a=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=MAX_SAFE_INTEGER}var isLength_1=isLength$3,isSymbol=isSymbol_1;function toKey$4(e){if(typeof e=="string"||isSymbol(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var _toKey=toKey$4,castPath$1=_castPath,isArguments$1=isArguments_1,isArray$5=isArray_1,isIndex$1=_isIndex,isLength$2=isLength_1,toKey$3=_toKey;function hasPath$2(e,t,a){t=castPath$1(t,e);for(var s=-1,n=t.length,i=!1;++se&&e.__isYupSchema__;class Condition{constructor(t,a){if(this.fn=void 0,this.refs=t,this.refs=t,typeof a=="function"){this.fn=a;return}if(!has$2(a,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!a.then&&!a.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:n,otherwise:i}=a,o=typeof s=="function"?s:(...u)=>u.every(l=>l===s);this.fn=function(...u){let l=u.pop(),c=u.pop(),_=o(...u)?n:i;if(_)return typeof _=="function"?_(c):c.concat(_.resolve(l))}}resolve(t,a){let s=this.refs.map(i=>i.getValue(a==null?void 0:a.value,a==null?void 0:a.parent,a==null?void 0:a.context)),n=this.fn.apply(t,s.concat(t,a));if(n===void 0||n===t)return t;if(!isSchema(n))throw new TypeError("conditions must return a schema object");return n.resolve(a)}}function toArray(e){return e==null?[]:[].concat(e)}function _extends$4(){return _extends$4=Object.assign||function(e){for(var t=1;tprintValue(a[i])):typeof t=="function"?t(a):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,a,s,n){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=a,this.path=s,this.type=n,this.errors=[],this.inner=[],toArray(t).forEach(i=>{ValidationError.isError(i)?(this.errors.push(...i.errors),this.inner=this.inner.concat(i.inner.length?i.inner:i)):this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,ValidationError)}}const once=e=>{let t=!1;return(...a)=>{t||(t=!0,e(...a))}};function runTests(e,t){let{endEarly:a,tests:s,args:n,value:i,errors:o,sort:u,path:l}=e,c=once(t),_=s.length;const p=[];if(o=o||[],!_)return o.length?c(new ValidationError(o,i,l)):c(null,i);for(let d=0;du))return!1;var c=i.get(e),_=i.get(t);if(c&&_)return c==t&&_==e;var p=-1,d=!0,E=a&COMPARE_UNORDERED_FLAG$3?new SetCache:void 0;for(i.set(e,t),i.set(t,e);++p=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var SPLIT_REGEX=/[^.^\]^[]+|(?=\[\]|\.\.)/g,DIGIT_REGEX=/^\d+$/,LEAD_DIGIT_REGEX=/^\d/,SPEC_CHAR_REGEX=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,CLEAN_QUOTES_REGEX=/^\s*(['"]?)(.*?)(\1)\s*$/,MAX_CACHE_SIZE=512,pathCache=new Cache(MAX_CACHE_SIZE),setCache=new Cache(MAX_CACHE_SIZE),getCache=new Cache(MAX_CACHE_SIZE),propertyExpr={Cache,split,normalizePath,setter:function(e){var t=normalizePath(e);return setCache.get(e)||setCache.set(e,function(s,n){for(var i=0,o=t.length,u=s;i=0)&&(a[n]=e[n]);return a}function createValidation(e){function t(a,s){let{value:n,path:i="",label:o,options:u,originalValue:l,sync:c}=a,_=_objectWithoutPropertiesLoose(a,["value","path","label","options","originalValue","sync"]);const{name:p,test:d,params:E,message:R}=e;let{parent:y,context:I}=u;function A(C){return Reference.isRef(C)?C.getValue(n,y,I):C}function x(C={}){const U=mapValues$1(_extends$3({value:n,originalValue:l,label:o,path:C.path||i},E,C.params),A),L=new ValidationError(ValidationError.formatError(C.message||R,U),n,U.path,C.type||p);return L.params=U,L}let g=_extends$3({path:i,parent:y,type:p,createError:x,resolve:A,options:u,originalValue:l},_);if(!c){try{Promise.resolve(d.call(g,n,g)).then(C=>{ValidationError.isError(C)?s(C):C?s(null,C):s(x())}).catch(s)}catch(C){s(C)}return}let T;try{var O;if(T=d.call(g,n,g),typeof((O=T)==null?void 0:O.then)=="function")throw new Error(`Validation test of type: "${g.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(C){s(C);return}ValidationError.isError(T)?s(T):T?s(null,T):s(x())}return t.OPTIONS=e,t}let trim=e=>e.substr(0,e.length-1).substr(1);function getIn(e,t,a,s=a){let n,i,o;return t?(propertyExpr.forEach(t,(u,l,c)=>{let _=l?trim(u):u;if(e=e.resolve({context:s,parent:n,value:a}),e.innerType){let p=c?parseInt(_,10):0;if(a&&p>=a.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${u}, in the path: ${t}. because there is no value at that index. `);n=a,a=a&&a[p],e=e.innerType}if(!c){if(!e.fields||!e.fields[_])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e._type}")`);n=a,a=a&&a[_],e=e.fields[_]}i=_,o=l?"["+u+"]":"."+u}),{schema:e,parent:n,parentPath:i}):{parent:n,parentPath:t,schema:e}}class ReferenceSet{constructor(){this.list=void 0,this.refs=void 0,this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){const t=[];for(const a of this.list)t.push(a);for(const[,a]of this.refs)t.push(a.describe());return t}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}resolveAll(t){return this.toArray().reduce((a,s)=>a.concat(Reference.isRef(s)?t(s):s),[])}add(t){Reference.isRef(t)?this.refs.set(t.key,t):this.list.add(t)}delete(t){Reference.isRef(t)?this.refs.delete(t.key):this.list.delete(t)}clone(){const t=new ReferenceSet;return t.list=new Set(this.list),t.refs=new Map(this.refs),t}merge(t,a){const s=this.clone();return t.list.forEach(n=>s.add(n)),t.refs.forEach(n=>s.add(n)),a.list.forEach(n=>s.delete(n)),a.refs.forEach(n=>s.delete(n)),s}}function _extends$2(){return _extends$2=Object.assign||function(e){for(var t=1;t{this.typeError(mixed.notType)}),this.type=(t==null?void 0:t.type)||"mixed",this.spec=_extends$2({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},t==null?void 0:t.spec)}get _type(){return this.type}_typeCheck(t){return!0}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const a=Object.create(Object.getPrototypeOf(this));return a.type=this.type,a._typeError=this._typeError,a._whitelistError=this._whitelistError,a._blacklistError=this._blacklistError,a._whitelist=this._whitelist.clone(),a._blacklist=this._blacklist.clone(),a.exclusiveTests=_extends$2({},this.exclusiveTests),a.deps=[...this.deps],a.conditions=[...this.conditions],a.tests=[...this.tests],a.transforms=[...this.transforms],a.spec=clone(_extends$2({},this.spec,t)),a}label(t){let a=this.clone();return a.spec.label=t,a}meta(...t){if(t.length===0)return this.spec.meta;let a=this.clone();return a.spec.meta=Object.assign(a.spec.meta||{},t[0]),a}withMutation(t){let a=this._mutate;this._mutate=!0;let s=t(this);return this._mutate=a,s}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let a=this,s=t.clone();const n=_extends$2({},a.spec,s.spec);return s.spec=n,s._typeError||(s._typeError=a._typeError),s._whitelistError||(s._whitelistError=a._whitelistError),s._blacklistError||(s._blacklistError=a._blacklistError),s._whitelist=a._whitelist.merge(t._whitelist,t._blacklist),s._blacklist=a._blacklist.merge(t._blacklist,t._whitelist),s.tests=a.tests,s.exclusiveTests=a.exclusiveTests,s.withMutation(i=>{t.tests.forEach(o=>{i.test(o.OPTIONS)})}),s.transforms=[...a.transforms,...s.transforms],s}isType(t){return this.spec.nullable&&t===null?!0:this._typeCheck(t)}resolve(t){let a=this;if(a.conditions.length){let s=a.conditions;a=a.clone(),a.conditions=[],a=s.reduce((n,i)=>i.resolve(n,t),a),a=a.resolve(t)}return a}cast(t,a={}){let s=this.resolve(_extends$2({value:t},a)),n=s._cast(t,a);if(t!==void 0&&a.assert!==!1&&s.isType(n)!==!0){let i=printValue(t),o=printValue(n);throw new TypeError(`The value of ${a.path||"field"} could not be cast to a value that satisfies the schema type: "${s._type}". + +attempted value: ${i} +`+(o!==i?`result of cast: ${o}`:""))}return n}_cast(t,a){let s=t===void 0?t:this.transforms.reduce((n,i)=>i.call(this,n,t,this),t);return s===void 0&&(s=this.getDefault()),s}_validate(t,a={},s){let{sync:n,path:i,from:o=[],originalValue:u=t,strict:l=this.spec.strict,abortEarly:c=this.spec.abortEarly}=a,_=t;l||(_=this._cast(_,_extends$2({assert:!1},a)));let p={value:_,path:i,options:a,originalValue:u,schema:this,label:this.spec.label,sync:n,from:o},d=[];this._typeError&&d.push(this._typeError);let E=[];this._whitelistError&&E.push(this._whitelistError),this._blacklistError&&E.push(this._blacklistError),runTests({args:p,value:_,path:i,tests:d,endEarly:c},R=>{if(R)return void s(R,_);runTests({tests:this.tests.concat(E),args:p,path:i,sync:n,value:_,endEarly:c},s)})}validate(t,a,s){let n=this.resolve(_extends$2({},a,{value:t}));return typeof s=="function"?n._validate(t,a,s):new Promise((i,o)=>n._validate(t,a,(u,l)=>{u?o(u):i(l)}))}validateSync(t,a){let s=this.resolve(_extends$2({},a,{value:t})),n;return s._validate(t,_extends$2({},a,{sync:!0}),(i,o)=>{if(i)throw i;n=o}),n}isValid(t,a){return this.validate(t,a).then(()=>!0,s=>{if(ValidationError.isError(s))return!1;throw s})}isValidSync(t,a){try{return this.validateSync(t,a),!0}catch(s){if(ValidationError.isError(s))return!1;throw s}}_getDefault(){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this):clone(t)}getDefault(t){return this.resolve(t||{})._getDefault()}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){let a=this.clone();return a.spec.strict=t,a}_isPresent(t){return t!=null}defined(t=mixed.defined){return this.test({message:t,name:"defined",exclusive:!0,test(a){return a!==void 0}})}required(t=mixed.required){return this.clone({presence:"required"}).withMutation(a=>a.test({message:t,name:"required",exclusive:!0,test(s){return this.schema._isPresent(s)}}))}notRequired(){let t=this.clone({presence:"optional"});return t.tests=t.tests.filter(a=>a.OPTIONS.name!=="required"),t}nullable(t=!0){return this.clone({nullable:t!==!1})}transform(t){let a=this.clone();return a.transforms.push(t),a}test(...t){let a;if(t.length===1?typeof t[0]=="function"?a={test:t[0]}:a=t[0]:t.length===2?a={name:t[0],test:t[1]}:a={name:t[0],message:t[1],test:t[2]},a.message===void 0&&(a.message=mixed.default),typeof a.test!="function")throw new TypeError("`test` is a required parameters");let s=this.clone(),n=createValidation(a),i=a.exclusive||a.name&&s.exclusiveTests[a.name]===!0;if(a.exclusive&&!a.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return a.name&&(s.exclusiveTests[a.name]=!!a.exclusive),s.tests=s.tests.filter(o=>!(o.OPTIONS.name===a.name&&(i||o.OPTIONS.test===n.OPTIONS.test))),s.tests.push(n),s}when(t,a){!Array.isArray(t)&&typeof t!="string"&&(a=t,t=".");let s=this.clone(),n=toArray(t).map(i=>new Reference(i));return n.forEach(i=>{i.isSibling&&s.deps.push(i.key)}),s.conditions.push(new Condition(n,a)),s}typeError(t){let a=this.clone();return a._typeError=createValidation({message:t,name:"typeError",test(s){return s!==void 0&&!this.schema.isType(s)?this.createError({params:{type:this.schema._type}}):!0}}),a}oneOf(t,a=mixed.oneOf){let s=this.clone();return t.forEach(n=>{s._whitelist.add(n),s._blacklist.delete(n)}),s._whitelistError=createValidation({message:a,name:"oneOf",test(n){if(n===void 0)return!0;let i=this.schema._whitelist,o=i.resolveAll(this.resolve);return o.includes(n)?!0:this.createError({params:{values:i.toArray().join(", "),resolved:o}})}}),s}notOneOf(t,a=mixed.notOneOf){let s=this.clone();return t.forEach(n=>{s._blacklist.add(n),s._whitelist.delete(n)}),s._blacklistError=createValidation({message:a,name:"notOneOf",test(n){let i=this.schema._blacklist,o=i.resolveAll(this.resolve);return o.includes(n)?this.createError({params:{values:i.toArray().join(", "),resolved:o}}):!0}}),s}strip(t=!0){let a=this.clone();return a.spec.strip=t,a}describe(){const t=this.clone(),{label:a,meta:s}=t.spec;return{meta:s,label:a,type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(i=>({name:i.OPTIONS.name,params:i.OPTIONS.params})).filter((i,o,u)=>u.findIndex(l=>l.name===i.name)===o)}}}BaseSchema.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])BaseSchema.prototype[`${e}At`]=function(t,a,s={}){const{parent:n,parentPath:i,schema:o}=getIn(this,t,a,s.context);return o[e](n&&n[i],_extends$2({},s,{parent:n,path:t}))};for(const e of["equals","is"])BaseSchema.prototype[e]=BaseSchema.prototype.oneOf;for(const e of["not","nope"])BaseSchema.prototype[e]=BaseSchema.prototype.notOneOf;BaseSchema.prototype.optional=BaseSchema.prototype.notRequired;const Mixed=BaseSchema;function create$6(){return new Mixed}create$6.prototype=Mixed.prototype;const isAbsent=e=>e==null;function create$5(){return new BooleanSchema}class BooleanSchema extends BaseSchema{constructor(){super({type:"boolean"}),this.withMutation(()=>{this.transform(function(t){if(!this.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}_typeCheck(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}isTrue(t=boolean.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(a){return isAbsent(a)||a===!0}})}isFalse(t=boolean.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(a){return isAbsent(a)||a===!1}})}}create$5.prototype=BooleanSchema.prototype;let rEmail=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,rUrl=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,rUUID=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,isTrimmed=e=>isAbsent(e)||e===e.trim(),objStringTag={}.toString();function create$4(){return new StringSchema}class StringSchema extends BaseSchema{constructor(){super({type:"string"}),this.withMutation(()=>{this.transform(function(t){if(this.isType(t)||Array.isArray(t))return t;const a=t!=null&&t.toString?t.toString():t;return a===objStringTag?t:a})})}_typeCheck(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}_isPresent(t){return super._isPresent(t)&&!!t.length}length(t,a=string.length){return this.test({message:a,name:"length",exclusive:!0,params:{length:t},test(s){return isAbsent(s)||s.length===this.resolve(t)}})}min(t,a=string.min){return this.test({message:a,name:"min",exclusive:!0,params:{min:t},test(s){return isAbsent(s)||s.length>=this.resolve(t)}})}max(t,a=string.max){return this.test({name:"max",exclusive:!0,message:a,params:{max:t},test(s){return isAbsent(s)||s.length<=this.resolve(t)}})}matches(t,a){let s=!1,n,i;return a&&(typeof a=="object"?{excludeEmptyString:s=!1,message:n,name:i}=a:n=a),this.test({name:i||"matches",message:n||string.matches,params:{regex:t},test:o=>isAbsent(o)||o===""&&s||o.search(t)!==-1})}email(t=string.email){return this.matches(rEmail,{name:"email",message:t,excludeEmptyString:!0})}url(t=string.url){return this.matches(rUrl,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=string.uuid){return this.matches(rUUID,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=string.trim){return this.transform(a=>a!=null?a.trim():a).test({message:t,name:"trim",test:isTrimmed})}lowercase(t=string.lowercase){return this.transform(a=>isAbsent(a)?a:a.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,test:a=>isAbsent(a)||a===a.toLowerCase()})}uppercase(t=string.uppercase){return this.transform(a=>isAbsent(a)?a:a.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,test:a=>isAbsent(a)||a===a.toUpperCase()})}}create$4.prototype=StringSchema.prototype;let isNaN$1=e=>e!=+e;function create$3(){return new NumberSchema}class NumberSchema extends BaseSchema{constructor(){super({type:"number"}),this.withMutation(()=>{this.transform(function(t){let a=t;if(typeof a=="string"){if(a=a.replace(/\s/g,""),a==="")return NaN;a=+a}return this.isType(a)?a:parseFloat(a)})})}_typeCheck(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!isNaN$1(t)}min(t,a=number.min){return this.test({message:a,name:"min",exclusive:!0,params:{min:t},test(s){return isAbsent(s)||s>=this.resolve(t)}})}max(t,a=number.max){return this.test({message:a,name:"max",exclusive:!0,params:{max:t},test(s){return isAbsent(s)||s<=this.resolve(t)}})}lessThan(t,a=number.lessThan){return this.test({message:a,name:"max",exclusive:!0,params:{less:t},test(s){return isAbsent(s)||sthis.resolve(t)}})}positive(t=number.positive){return this.moreThan(0,t)}negative(t=number.negative){return this.lessThan(0,t)}integer(t=number.integer){return this.test({name:"integer",message:t,test:a=>isAbsent(a)||Number.isInteger(a)})}truncate(){return this.transform(t=>isAbsent(t)?t:t|0)}round(t){var a;let s=["ceil","floor","round","trunc"];if(t=((a=t)==null?void 0:a.toLowerCase())||"round",t==="trunc")return this.truncate();if(s.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+s.join(", "));return this.transform(n=>isAbsent(n)?n:Math[t](n))}}create$3.prototype=NumberSchema.prototype;var isoReg=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function parseIsoDate(e){var t=[1,4,5,6,7,10,11],a=0,s,n;if(n=isoReg.exec(e)){for(var i=0,o;o=t[i];++i)n[o]=+n[o]||0;n[2]=(+n[2]||1)-1,n[3]=+n[3]||1,n[7]=n[7]?String(n[7]).substr(0,3):0,(n[8]===void 0||n[8]==="")&&(n[9]===void 0||n[9]==="")?s=+new Date(n[1],n[2],n[3],n[4],n[5],n[6],n[7]):(n[8]!=="Z"&&n[9]!==void 0&&(a=n[10]*60+n[11],n[9]==="+"&&(a=0-a)),s=Date.UTC(n[1],n[2],n[3],n[4],n[5]+a,n[6],n[7]))}else s=Date.parse?Date.parse(e):NaN;return s}let invalidDate=new Date(""),isDate$1=e=>Object.prototype.toString.call(e)==="[object Date]";function create$2(){return new DateSchema}class DateSchema extends BaseSchema{constructor(){super({type:"date"}),this.withMutation(()=>{this.transform(function(t){return this.isType(t)?t:(t=parseIsoDate(t),isNaN(t)?invalidDate:new Date(t))})})}_typeCheck(t){return isDate$1(t)&&!isNaN(t.getTime())}prepareParam(t,a){let s;if(Reference.isRef(t))s=t;else{let n=this.cast(t);if(!this._typeCheck(n))throw new TypeError(`\`${a}\` must be a Date or a value that can be \`cast()\` to a Date`);s=n}return s}min(t,a=date.min){let s=this.prepareParam(t,"min");return this.test({message:a,name:"min",exclusive:!0,params:{min:t},test(n){return isAbsent(n)||n>=this.resolve(s)}})}max(t,a=date.max){let s=this.prepareParam(t,"max");return this.test({message:a,name:"max",exclusive:!0,params:{max:t},test(n){return isAbsent(n)||n<=this.resolve(s)}})}}DateSchema.INVALID_DATE=invalidDate;create$2.prototype=DateSchema.prototype;create$2.INVALID_DATE=invalidDate;function arrayReduce$1(e,t,a,s){var n=-1,i=e==null?0:e.length;for(s&&i&&(a=e[++n]);++nn?0:n+t),a=a>n?n:a,a<0&&(a+=n),n=t>a?0:a-t>>>0,t>>>=0;for(var i=Array(n);++s=s?e:baseSlice(e,t,a)}var _castSlice=castSlice$1,rsAstralRange$1="\\ud800-\\udfff",rsComboMarksRange$1="\\u0300-\\u036f",reComboHalfMarksRange$1="\\ufe20-\\ufe2f",rsComboSymbolsRange$1="\\u20d0-\\u20ff",rsComboRange$1=rsComboMarksRange$1+reComboHalfMarksRange$1+rsComboSymbolsRange$1,rsVarRange$1="\\ufe0e\\ufe0f",rsZWJ$1="\\u200d",reHasUnicode=RegExp("["+rsZWJ$1+rsAstralRange$1+rsComboRange$1+rsVarRange$1+"]");function hasUnicode$2(e){return reHasUnicode.test(e)}var _hasUnicode=hasUnicode$2;function asciiToArray$1(e){return e.split("")}var _asciiToArray=asciiToArray$1,rsAstralRange="\\ud800-\\udfff",rsComboMarksRange="\\u0300-\\u036f",reComboHalfMarksRange="\\ufe20-\\ufe2f",rsComboSymbolsRange="\\u20d0-\\u20ff",rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,rsVarRange="\\ufe0e\\ufe0f",rsAstral="["+rsAstralRange+"]",rsCombo="["+rsComboRange+"]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsModifier="(?:"+rsCombo+"|"+rsFitz+")",rsNonAstral="[^"+rsAstralRange+"]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsZWJ="\\u200d",reOptMod=rsModifier+"?",rsOptVar="["+rsVarRange+"]?",rsOptJoin="(?:"+rsZWJ+"(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")"+rsOptVar+reOptMod+")*",rsSeq=rsOptVar+reOptMod+rsOptJoin,rsSymbol="(?:"+[rsNonAstral+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,rsAstral].join("|")+")",reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g");function unicodeToArray$1(e){return e.match(reUnicode)||[]}var _unicodeToArray=unicodeToArray$1,asciiToArray=_asciiToArray,hasUnicode$1=_hasUnicode,unicodeToArray=_unicodeToArray;function stringToArray$1(e){return hasUnicode$1(e)?unicodeToArray(e):asciiToArray(e)}var _stringToArray=stringToArray$1,castSlice=_castSlice,hasUnicode=_hasUnicode,stringToArray=_stringToArray,toString$1=toString_1;function createCaseFirst$1(e){return function(t){t=toString$1(t);var a=hasUnicode(t)?stringToArray(t):void 0,s=a?a[0]:t.charAt(0),n=a?castSlice(a,1).join(""):t.slice(1);return s[e]()+n}}var _createCaseFirst=createCaseFirst$1,createCaseFirst=_createCaseFirst,upperFirst$1=createCaseFirst("toUpperCase"),upperFirst_1=upperFirst$1,toString=toString_1,upperFirst=upperFirst_1;function capitalize$1(e){return upperFirst(toString(e).toLowerCase())}var capitalize_1=capitalize$1,capitalize=capitalize_1,createCompounder=_createCompounder,camelCase$1=createCompounder(function(e,t,a){return t=t.toLowerCase(),e+(a?capitalize(t):t)}),camelCase_1=camelCase$1;const camelCase$2=getDefaultExportFromCjs(camelCase_1);var baseAssignValue=_baseAssignValue,baseForOwn=_baseForOwn,baseIteratee=_baseIteratee;function mapKeys(e,t){var a={};return t=baseIteratee(t),baseForOwn(e,function(s,n,i){baseAssignValue(a,t(s,n,i),s)}),a}var mapKeys_1=mapKeys;const mapKeys$1=getDefaultExportFromCjs(mapKeys_1);var toposort$2={exports:{}};toposort$2.exports=function(e){return toposort(uniqueNodes(e),e)};toposort$2.exports.array=toposort;function toposort(e,t){var a=e.length,s=new Array(a),n={},i=a,o=makeOutgoingEdges(t),u=makeNodesHash(e);for(t.forEach(function(c){if(!u.has(c[0])||!u.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)n[i]||l(e[i],i,new Set);return s;function l(c,_,p){if(p.has(c)){var d;try{d=", node was:"+JSON.stringify(c)}catch{d=""}throw new Error("Cyclic dependency"+d)}if(!u.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!n[_]){n[_]=!0;var E=o.get(c)||new Set;if(E=Array.from(E),_=E.length){p.add(c);do{var R=E[--_];l(R,u.get(R),p)}while(_);p.delete(c)}s[--a]=c}}}function uniqueNodes(e){for(var t=new Set,a=0,s=e.length;a`${o}-${u}`));function i(o,u){let l=propertyExpr.split(o)[0];s.add(l),n.has(`${u}-${l}`)||a.push([u,l])}for(const o in e)if(has$2(e,o)){let u=e[o];s.add(o),Reference.isRef(u)&&u.isSibling?i(u.path,o):isSchema(u)&&"deps"in u&&u.deps.forEach(l=>i(l,o))}return toposort$1.array(Array.from(s),a).reverse()}function findIndex(e,t){let a=1/0;return e.some((s,n)=>{var i;if(((i=t.path)==null?void 0:i.indexOf(s))!==-1)return a=n,!0}),a}function sortByKeyOrder(e){return(t,a)=>findIndex(e,t)-findIndex(e,a)}function _extends$1(){return _extends$1=Object.assign||function(e){for(var t=1;tObject.prototype.toString.call(e)==="[object Object]";function unknown(e,t){let a=Object.keys(e.fields);return Object.keys(t).filter(s=>a.indexOf(s)===-1)}const defaultSort=sortByKeyOrder([]);class ObjectSchema extends BaseSchema{constructor(t){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=defaultSort,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{this.transform(function(s){if(typeof s=="string")try{s=JSON.parse(s)}catch{s=null}return this.isType(s)?s:null}),t&&this.shape(t)})}_typeCheck(t){return isObject(t)||typeof t=="function"}_cast(t,a={}){var s;let n=super._cast(t,a);if(n===void 0)return this.getDefault();if(!this._typeCheck(n))return n;let i=this.fields,o=(s=a.stripUnknown)!=null?s:this.spec.noUnknown,u=this._nodes.concat(Object.keys(n).filter(p=>this._nodes.indexOf(p)===-1)),l={},c=_extends$1({},a,{parent:l,__validating:a.__validating||!1}),_=!1;for(const p of u){let d=i[p],E=has$2(n,p);if(d){let R,y=n[p];c.path=(a.path?`${a.path}.`:"")+p,d=d.resolve({value:y,context:a.context,parent:l});let I="spec"in d?d.spec:void 0,A=I==null?void 0:I.strict;if(I!=null&&I.strip){_=_||p in n;continue}R=!a.__validating||!A?d.cast(n[p],c):n[p],R!==void 0&&(l[p]=R)}else E&&!o&&(l[p]=n[p]);l[p]!==n[p]&&(_=!0)}return _?l:n}_validate(t,a={},s){let n=[],{sync:i,from:o=[],originalValue:u=t,abortEarly:l=this.spec.abortEarly,recursive:c=this.spec.recursive}=a;o=[{schema:this,value:u},...o],a.__validating=!0,a.originalValue=u,a.from=o,super._validate(t,a,(_,p)=>{if(_){if(!ValidationError.isError(_)||l)return void s(_,p);n.push(_)}if(!c||!isObject(p)){s(n[0]||null,p);return}u=u||p;let d=this._nodes.map(E=>(R,y)=>{let I=E.indexOf(".")===-1?(a.path?`${a.path}.`:"")+E:`${a.path||""}["${E}"]`,A=this.fields[E];if(A&&"validate"in A){A.validate(p[E],_extends$1({},a,{path:I,from:o,strict:!0,parent:p,originalValue:u[E]}),y);return}y(null)});runTests({tests:d,value:p,errors:n,endEarly:l,sort:this._sortErrors,path:a.path},s)})}clone(t){const a=super.clone(t);return a.fields=_extends$1({},this.fields),a._nodes=this._nodes,a._excludedEdges=this._excludedEdges,a._sortErrors=this._sortErrors,a}concat(t){let a=super.concat(t),s=a.fields;for(let[n,i]of Object.entries(this.fields)){const o=s[n];o===void 0?s[n]=i:o instanceof BaseSchema&&i instanceof BaseSchema&&(s[n]=i.concat(o))}return a.withMutation(()=>a.shape(s,this._excludedEdges))}getDefaultFromShape(){let t={};return this._nodes.forEach(a=>{const s=this.fields[a];t[a]="default"in s?s.getDefault():void 0}),t}_getDefault(){if("default"in this.spec)return super._getDefault();if(this._nodes.length)return this.getDefaultFromShape()}shape(t,a=[]){let s=this.clone(),n=Object.assign(s.fields,t);return s.fields=n,s._sortErrors=sortByKeyOrder(Object.keys(n)),a.length&&(Array.isArray(a[0])||(a=[a]),s._excludedEdges=[...s._excludedEdges,...a]),s._nodes=sortFields(n,s._excludedEdges),s}pick(t){const a={};for(const s of t)this.fields[s]&&(a[s]=this.fields[s]);return this.clone().withMutation(s=>(s.fields={},s.shape(a)))}omit(t){const a=this.clone(),s=a.fields;a.fields={};for(const n of t)delete s[n];return a.withMutation(()=>a.shape(s))}from(t,a,s){let n=propertyExpr.getter(t,!0);return this.transform(i=>{if(i==null)return i;let o=i;return has$2(i,t)&&(o=_extends$1({},i),s||delete o[t],o[a]=n(i)),o})}noUnknown(t=!0,a=object.noUnknown){typeof t=="string"&&(a=t,t=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:a,test(n){if(n==null)return!0;const i=unknown(this.schema,n);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return s.spec.noUnknown=t,s}unknown(t=!0,a=object.noUnknown){return this.noUnknown(!t,a)}transformKeys(t){return this.transform(a=>a&&mapKeys$1(a,(s,n)=>t(n)))}camelCase(){return this.transformKeys(camelCase$2)}snakeCase(){return this.transformKeys(snakeCase$1)}constantCase(){return this.transformKeys(t=>snakeCase$1(t).toUpperCase())}describe(){let t=super.describe();return t.fields=mapValues$1(this.fields,a=>a.describe()),t}}function create$1(e){return new ObjectSchema(e)}create$1.prototype=ObjectSchema.prototype;function _extends(){return _extends=Object.assign||function(e){for(var t=1;t{this.transform(function(a){if(typeof a=="string")try{a=JSON.parse(a)}catch{a=null}return this.isType(a)?a:null})})}_typeCheck(t){return Array.isArray(t)}get _subType(){return this.innerType}_cast(t,a){const s=super._cast(t,a);if(!this._typeCheck(s)||!this.innerType)return s;let n=!1;const i=s.map((o,u)=>{const l=this.innerType.cast(o,_extends({},a,{path:`${a.path||""}[${u}]`}));return l!==o&&(n=!0),l});return n?i:s}_validate(t,a={},s){var n,i;let o=[];a.sync;let u=a.path,l=this.innerType,c=(n=a.abortEarly)!=null?n:this.spec.abortEarly,_=(i=a.recursive)!=null?i:this.spec.recursive,p=a.originalValue!=null?a.originalValue:t;super._validate(t,a,(d,E)=>{if(d){if(!ValidationError.isError(d)||c)return void s(d,E);o.push(d)}if(!_||!l||!this._typeCheck(E)){s(o[0]||null,E);return}p=p||E;let R=new Array(E.length);for(let y=0;yl.validate(I,x,T)}runTests({path:u,value:E,errors:o,endEarly:c,tests:R},s)})}clone(t){const a=super.clone(t);return a.innerType=this.innerType,a}concat(t){let a=super.concat(t);return a.innerType=this.innerType,t.innerType&&(a.innerType=a.innerType?a.innerType.concat(t.innerType):t.innerType),a}of(t){let a=this.clone();if(!isSchema(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+printValue(t));return a.innerType=t,a}length(t,a=array.length){return this.test({message:a,name:"length",exclusive:!0,params:{length:t},test(s){return isAbsent(s)||s.length===this.resolve(t)}})}min(t,a){return a=a||array.min,this.test({message:a,name:"min",exclusive:!0,params:{min:t},test(s){return isAbsent(s)||s.length>=this.resolve(t)}})}max(t,a){return a=a||array.max,this.test({message:a,name:"max",exclusive:!0,params:{max:t},test(s){return isAbsent(s)||s.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,a)=>this._typeCheck(t)?t:a==null?[]:[].concat(a))}compact(t){let a=t?(s,n,i)=>!t(s,n,i):s=>!!s;return this.transform(s=>s!=null?s.filter(a):s)}describe(){let t=super.describe();return this.innerType&&(t.innerType=this.innerType.describe()),t}nullable(t=!0){return super.nullable(t)}defined(){return super.defined()}required(t){return super.required(t)}}create.prototype=ArraySchema.prototype;function PorvinceGetReportOperations(){var R;const{pathname:e}=useLocation(),[,,t,a]=reactExports.useContext(AppContext),s=useSelector(y=>y.userSlice),n=useDispatch(),[i,o]=reactExports.useState(),u=reactExports.useRef(),l=libExports.useReactToPrint({content:()=>u.current,documentTitle:`گزارش روزانه ${formatJustDate(t)}`,onAfterPrint:()=>{o(null)}}),c=y=>{n(LOADING_START()),n(provinceGetProcessData({selectedDate1:t,value:p})).then(I=>{o(I.payload.data),n(LOADING_END())})};reactExports.useEffect(()=>{i&&l()},[i,l]);const _=useFormik({initialValues:{target:""},validationSchema:create$1({target:create$4().typeError("لطفا فیلد را به درستی وارد کنید.!").required("این فیلد اجباری است!")})}),[p,d]=React.useState("slaughter"),E=y=>{d(y.target.value)};return reactExports.useEffect(()=>{_.validateForm()},[]),jsxRuntimeExports.jsxs(Grid,{container:!0,gap:SPACING.SMALL,justifyContent:"center",alignItems:"center",children:[jsxRuntimeExports.jsx("div",{style:{visibility:"hidden",position:"absolute"},children:jsxRuntimeExports.jsx(ProvinceGetReportFile,{ref:u,item:i,inDate:t,targetperson:e===ROUTE_COMMERCE_REQUESTS?"معاونت محترم توسعه بازرگانی و صنایع کشاورزی":_.values.target,reportType:p})}),jsxRuntimeExports.jsxs(Grid,{container:!0,xs:12,alignItems:"center",spacing:2,children:[jsxRuntimeExports.jsx(Grid,{xs:12,alignItems:"center",children:jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsxs(RadioGroup,{size:"small",row:!0,"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:p,onChange:E,children:[jsxRuntimeExports.jsx(FormControlLabel,{label:"گزارش کشتار",control:jsxRuntimeExports.jsx(Radio,{size:"small"}),value:"slaughter"}),jsxRuntimeExports.jsx(FormControlLabel,{label:"گزارش پخش",control:jsxRuntimeExports.jsx(Radio,{size:"small"}),value:"broadcast"})]})})}),e!==ROUTE_COMMERCE_REQUESTS&&jsxRuntimeExports.jsxs(Grid,{xs:12,container:!0,alignItems:"center",children:[jsxRuntimeExports.jsx(Grid,{xs:2,children:jsxRuntimeExports.jsx(Typography,{sx:{fontSize:"12px"},children:"گیرنده گزارش:"})}),jsxRuntimeExports.jsx(Grid,{xs:10,children:jsxRuntimeExports.jsx(TextField,{id:"target",size:"small",label:"مثال: معاونت محترم توسعه بازگانی ",variant:"outlined",sx:{width:"100%",height:"100%"},value:_.values.target,error:_.touched.target?!!_.errors.target:null,onChange:_.handleChange,onBlur:_.handleBlur,helperText:_.touched.target&&_.errors.target?_.errors.target:null})})]}),jsxRuntimeExports.jsxs(Grid,{xs:12,container:!0,mt:1,children:[jsxRuntimeExports.jsx(Grid,{xs:2,children:jsxRuntimeExports.jsx(Typography,{sx:{fontSize:"12px"},children:"تاریخ گزارش:"})}),jsxRuntimeExports.jsx(Grid,{xs:9,children:jsxRuntimeExports.jsx(DatePicker,{label:"تاریخ گزارش",id:"date",renderInput:y=>jsxRuntimeExports.jsx(TextField,{size:"small",...y,fullWidth:!0}),value:t,onChange:y=>{a(hooks(y).format("YYYY-MM-DD"))}})}),jsxRuntimeExports.jsx(Grid,{xs:1,children:jsxRuntimeExports.jsx(Tooltip,{title:"رفتن به روز قبل",placement:"bottom",children:jsxRuntimeExports.jsx(IconButton,{onClick:()=>{a(hooks(t).subtract(1,"days").format("YYYY-MM-DD"))},"aria-label":"delete",color:"secondary",children:jsxRuntimeExports.jsx(default_1$4,{})})})})]})]}),jsxRuntimeExports.jsx(Grid,{xs:12,mt:2,children:jsxRuntimeExports.jsx(Typography,{color:"red",sx:{fontSize:"12px",userSelect:"none"},children:"📌 توجه: بمنظور پرینت صحیح، مشخصه Page size را بر روی A4 تنظیم کنید."})}),jsxRuntimeExports.jsx(Button,{disabled:e!==ROUTE_COMMERCE_REQUESTS?!_.isValid:!1,variant:"contained",onClick:()=>{c()},children:"پرینت"}),jsxRuntimeExports.jsx("a",{href:`${axios$1.defaults.baseURL}${p==="broadcast"?"daily_process_excel/":"daily_process_klling_proccess_excel"}?date=${t}&key=${(R=s==null?void 0:s.userProfile)==null?void 0:R.key}`,rel:"noreferrer",children:jsxRuntimeExports.jsx(Button,{color:"success",variant:"contained",children:"خروجی اکسل"})})]})}var Summarize={},_interopRequireDefault$3=interopRequireDefaultExports;Object.defineProperty(Summarize,"__esModule",{value:!0});var default_1$3=Summarize.default=void 0,_createSvgIcon$3=_interopRequireDefault$3(requireCreateSvgIcon()),_jsxRuntime$3=jsxRuntimeExports;default_1$3=Summarize.default=(0,_createSvgIcon$3.default)((0,_jsxRuntime$3.jsx)("path",{d:"M15 3H5c-1.1 0-1.99.9-1.99 2L3 19c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V9zM8 17c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m0-4c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m0-4c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m6 1V4.5l5.5 5.5z"}),"Summarize");var PushPin={},_interopRequireDefault$2=interopRequireDefaultExports;Object.defineProperty(PushPin,"__esModule",{value:!0});var default_1$2=PushPin.default=void 0,_createSvgIcon$2=_interopRequireDefault$2(requireCreateSvgIcon()),_jsxRuntime$2=jsxRuntimeExports;default_1$2=PushPin.default=(0,_createSvgIcon$2.default)((0,_jsxRuntime$2.jsx)("path",{fillRule:"evenodd",d:"M16 9V4h1c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3"}),"PushPin");var PushPinOutlined={},_interopRequireDefault$1=interopRequireDefaultExports;Object.defineProperty(PushPinOutlined,"__esModule",{value:!0});var default_1$1=PushPinOutlined.default=void 0,_createSvgIcon$1=_interopRequireDefault$1(requireCreateSvgIcon()),_jsxRuntime$1=jsxRuntimeExports;default_1$1=PushPinOutlined.default=(0,_createSvgIcon$1.default)((0,_jsxRuntime$1.jsx)("path",{d:"M14 4v5c0 1.12.37 2.16 1 3H9c.65-.86 1-1.9 1-3V4zm3-2H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3V4h1c.55 0 1-.45 1-1s-.45-1-1-1"}),"PushPinOutlined");const AppMenu=({color:e})=>{const[t,a]=reactExports.useState(null),[s,n]=reactExports.useState(!1),i=!!t,o=useDispatch(),u=useNavigate(),{pathname:l}=useLocation(),[c,_]=reactExports.useState(null),[p,d]=reactExports.useState(null),[E]=useUserProfile(),R=p||c,y=[];if(E)for(let O=0;O{y.push({...L,role:E[O]})}),getLiveStockItems(E[O]).forEach(L=>{y.push({...L,role:E[O]})});reactExports.useEffect(()=>{(E==null?void 0:E.length)===1?_(E[0]):(E==null?void 0:E.length)>1&&_(sortRoles(E)[0])},[E]);const I=O=>{a(O.currentTarget)},A=()=>{s||a(null)},x=()=>{n(O=>!O)},g=(O,C)=>{C!=null&&C.route&&(u(C.route),_(C.role),s||a(null))},T=jsxRuntimeExports.jsxs(Grid,{container:!0,justifyContent:"space-between",alignItems:"center",mr:"10px",children:[jsxRuntimeExports.jsx(Grid,{item:!0,xs:2,children:jsxRuntimeExports.jsx(IconButton,{color:"primary",onClick:x,size:"small",children:s?jsxRuntimeExports.jsx(default_1$2,{}):jsxRuntimeExports.jsx(default_1$1,{})})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:10,children:jsxRuntimeExports.jsx(Autocomplete,{fullWidth:!0,size:"small",options:y.map((O,C)=>({label:O.text,route:O.route,role:O.role,disabled:O.disabled||!1,index:C})),groupBy:O=>(E==null?void 0:E.length)!==1?getFaUserRole(O.role):!1,getOptionDisabled:O=>O.disabled,getOptionLabel:O=>O.label||"",onChange:g,renderInput:O=>jsxRuntimeExports.jsx(TextField,{...O,placeholder:"جستجو ..."}),renderOption:(O,C)=>jsxRuntimeExports.jsx(Typography,{color:"primary",...O,sx:{fontSize:14,fontWeight:"700"},children:C.label})})})]});return jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:{xs:"flex-start",sm:"center"},padding:{xs:"0 16px",sm:"0"}},children:[jsxRuntimeExports.jsx(Button,{startIcon:jsxRuntimeExports.jsx(default_1$t,{}),sx:{color:e==="white"?"white":"primary.main","& .MuiButton-startIcon":{color:e==="white"?"white":"primary.main"}},"aria-controls":i?"app-menu":void 0,"aria-haspopup":"true","aria-expanded":i?"true":void 0,onClick:I,children:"منو"}),jsxRuntimeExports.jsxs(Menu,{disableScrollLock:!0,id:"app-menu",anchorEl:t,open:i,onClose:A,PaperProps:{sx:{width:{xs:"90%",sm:(E==null?void 0:E.length)===1?"350px":"500px"},maxHeight:{xs:"70vh",sm:"80vh"},padding:0,borderRadius:2,boxShadow:3,overflow:"hidden"}},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:[jsxRuntimeExports.jsx(Box,{sx:{p:2,pb:1},children:T}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",height:{xs:"calc(70vh - 80px)",sm:"auto"},maxHeight:{xs:"calc(70vh - 80px)",sm:"calc(80vh - 80px)"}},children:[(E==null?void 0:E.length)>1&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Box,{sx:{width:"200px",borderLeft:"1px solid",borderColor:"divider",overflowY:"auto",bgcolor:"grey.50"},children:jsxRuntimeExports.jsx(List,{dense:!0,sx:{p:0},children:sortRoles(E).map((O,C)=>jsxRuntimeExports.jsxs(ListItem,{button:!0,selected:c===O,onClick:()=>_(O),onMouseEnter:()=>d(O),sx:{p:1.5,borderBottom:"1px solid",borderColor:"divider",bgcolor:c===O?"primary.light":p===O?"action.hover":"transparent",transition:"all 0.2s"},children:[jsxRuntimeExports.jsx(ListItemIcon,{sx:{color:c===O?"primary.main":"#6D214F",minWidth:40},children:getIconUserRole(O)}),jsxRuntimeExports.jsx(ListItemText,{sx:{color:c===O?"primary.main":"#6D214F"},primary:getFaUserRole(O),primaryTypographyProps:{fontSize:"0.85rem",fontWeight:c===O?700:500}})]},C))})})}),jsxRuntimeExports.jsx(Box,{sx:{flex:1,overflowY:"auto",p:1},children:R&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(E==null?void 0:E.length)===1&&jsxRuntimeExports.jsx(Box,{sx:{px:1,py:.5,mb:1},children:jsxRuntimeExports.jsx(Chip,{label:getFaUserRole(R),size:"small",color:"primary",variant:"outlined"})}),jsxRuntimeExports.jsx(List,{dense:!0,children:jsxRuntimeExports.jsxs(motion.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3,ease:"easeOut"},children:[(()=>{const O=getPoultryRoles([R]).length?getRoleItems(R):getLiveStockItems(R);return!O||O.length===0?jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",p:4,textAlign:"center"},children:jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{fontWeight:500},children:"آیتم منویی برای نمایش وجود ندارد"})}):O.map((C,U)=>jsxRuntimeExports.jsxs(ListItem,{disabled:C==null?void 0:C.disabled,selected:l==null?void 0:l.includes(C==null?void 0:C.route),button:!0,onClick:()=>{_(R),A(),o(DRAWER({right:!1,bottom:!1,content:null})),u(C==null?void 0:C.route)},sx:{p:1,borderRadius:1,mb:.5,"&:hover":{bgcolor:"action.hover"}},children:[jsxRuntimeExports.jsx(ListItemIcon,{sx:{color:"#30336b",minWidth:36},children:C==null?void 0:C.icon}),jsxRuntimeExports.jsx(ListItemText,{sx:{color:"#30336b"},primary:C==null?void 0:C.text,primaryTypographyProps:{fontSize:"0.85rem"}})]},U))})(),(R==="ProvinceOperator"||R==="SuperAdmin"||R==="Commerce"||R==="ProvinceSupervisor"||R==="AdminX")&&jsxRuntimeExports.jsxs(ListItem,{button:!0,onClick:()=>{_(R),A(),o(DRAWER({right:!1,bottom:!1,content:null})),o(OPEN_MODAL({title:"اطلاعات گزارش",content:jsxRuntimeExports.jsx(PorvinceGetReportOperations,{})}))},sx:{p:1,borderRadius:1,mb:.5,"&:hover":{bgcolor:"action.hover"}},children:[jsxRuntimeExports.jsx(ListItemIcon,{sx:{color:"#30336b",minWidth:36},children:jsxRuntimeExports.jsx(default_1$3,{})}),jsxRuntimeExports.jsx(ListItemText,{sx:{color:"#30336b"},primary:"گزارش روزانه",primaryTypographyProps:{fontSize:"0.85rem"}})]})]},R)})]})})]})]})]})},Header=()=>{const e=useSelector(l=>l.userSlice.role),t=useNavigate(),{pathname:a}=useLocation(),s=useSystemName(),n=useSelector(l=>l.userSlice.adminToken),i=useDispatch(),{typeActivitySelected:o}=useSelector(l=>l.userSlice),u=getUserTypeOfActivity([getRoleFromUrl()]);return jsxRuntimeExports.jsxs(AppBar,{position:"relative",size:"small",children:[jsxRuntimeExports.jsxs(Grid,{m:1,container:!0,alignItems:"center",justifyContent:"space-between",alignSelf:"center",xs:12,sm:10,sx:{position:"relative"},children:[jsxRuntimeExports.jsx(Box,{sx:{display:{xs:"flex",sm:"flex",md:"flex",xl:"none"}},children:jsxRuntimeExports.jsx(AppMenu,{color:"white"})}),jsxRuntimeExports.jsx(Grid,{sx:{xs:"none",sm:"none",md:"none",lg:"flex"}}),jsxRuntimeExports.jsxs(Grid,{item:!0,container:!0,alignItems:"center",gap:1,children:[jsxRuntimeExports.jsx(Box,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundImage:`url(${iranView})`,backgroundSize:"contain",backgroundRepeat:"repeat",backgroundPosition:"center",opacity:.1,zIndex:0,pointerEvents:"none"}}),jsxRuntimeExports.jsxs(Box,{sx:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:1,display:"flex",alignItems:"center",height:"100%"},children:[jsxRuntimeExports.jsx(Box,{component:"img",sx:{width:50,display:{xs:"none",md:"flex"},mr:1},alt:"logo",src:logo$1}),jsxRuntimeExports.jsx(Typography,{display:{xs:"none",lg:"flex"},variant:"h6",noWrap:!0,component:"a",onClick:()=>{t("/")},sx:{fontSize:18,fontWeight:700,color:"inherit",textDecoration:"none",mr:2,cursor:"pointer"},children:`رصـــد یـــار (سامانه رصد و پایش زنجیره تامین، تولید و توزیع کالای اساسی ) ${e.length===1&&e[0]==="ParentCompany"?"شرکت مادر":s}`}),jsxRuntimeExports.jsx(Typography,{display:{xs:"flex",lg:"none"},variant:"h6",noWrap:!0,component:"a",onClick:()=>{t("/")},sx:{fontSize:18,fontWeight:700,color:"inherit",textDecoration:"none",mr:2,cursor:"pointer"},children:"سامانه رصدیار"})]})]}),jsxRuntimeExports.jsxs(Grid,{container:!0,item:!0,children:[jsxRuntimeExports.jsx(HeaderOperations,{}),n&&jsxRuntimeExports.jsx(IconButton,{sx:{color:"white"},onClick:()=>{i(LOADING_START()),i(tokenVerifiction({token:n})).then(l=>{var c,_;i(SET_ADMIN_TOKEN(null)),i(loginWithPassword({mobile:(c=l.payload.data)==null?void 0:c.username,password:(_=l.payload.data)==null?void 0:_.password})).then(()=>{i(LOADING_END()),i(SET_ADMIN_TOKEN(null)),t("/")})})},children:jsxRuntimeExports.jsx(default_1$A,{})})]})]}),jsxRuntimeExports.jsx(Grid,{style:{backgroundColor:"#f9f9f9"},container:!0,justifyContent:"center",children:jsxRuntimeExports.jsxs(Grid,{container:!0,alignItems:"center",display:{xs:"none",sm:"none",md:"none",lg:"flex"},style:{height:"40px"},justifyContent:"space-between",alignSelf:"center",xs:12,sm:10,children:[jsxRuntimeExports.jsx(Box,{sx:{display:{xs:"none",sm:"none",md:"none",xl:"flex"}},children:jsxRuntimeExports.jsx(AppMenu,{})}),jsxRuntimeExports.jsx(Box,{sx:{display:{xs:"none",lg:"inline",xl:"none"}}}),jsxRuntimeExports.jsxs(Grid,{container:!0,justifyContent:"center",alignItems:"center",children:[jsxRuntimeExports.jsxs(Grid,{mx:{xs:0,sm:0,md:.5,nlg:1},container:!0,justifyContent:"center",alignItems:"center",gap:1,sx:{height:"100%",p:"3px",color:l=>l.palette.primary.main,borderRadius:"8px",backgroundColor:l=>a==="/"?l.palette.primary.light:"transparent",cursor:"pointer","&:hover":{backgroundColor:"#EFEFEF"}},onClick:()=>{t("/")},children:[a==="/"&&jsxRuntimeExports.jsx(default_1$1q,{}),jsxRuntimeExports.jsx(Typography,{className:"header-menu",sx:{fontWeight:"500",fontSize:{xs:"12px",sm:"12px",xl:"14px"}},children:"خانه"})]}),(u?!!getRoleItems(getRoleFromUrl()).length&&getRoleItems(getRoleFromUrl())||getLiveStockItems(getRoleFromUrl()):o==="Livestock"?getLiveStockItems(getLiveStockRoles(e)[0]):getRoleItems(sortRoles(e)[0])).slice(0,10).map((l,c)=>jsxRuntimeExports.jsxs(Grid,{mx:{xs:0,sm:0,md:.6,nlg:1},className:"header-menu",container:!0,justifyContent:"center",alignItems:"center",gap:1,sx:{height:"100%",p:"3px",borderRadius:"8px",color:_=>_.palette.primary.main,backgroundColor:_=>a===(l==null?void 0:l.route)?_.palette.primary.light:"transparent","&:hover":{backgroundColor:"#EFEFEF"},cursor:"pointer"},onClick:()=>{t(l==null?void 0:l.route)},children:[a===(l==null?void 0:l.route)&&(l==null?void 0:l.icon),jsxRuntimeExports.jsx(Typography,{className:"header-menu",sx:{fontWeight:"500",fontSize:{lg:"12px",xl:"14px"}},children:l==null?void 0:l.text})]},c))]}),jsxRuntimeExports.jsx(Grid,{})]})})]})};var longFormatters$1={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(u,l){switch(u){case"P":return l.date({width:"short"});case"PP":return l.date({width:"medium"});case"PPP":return l.date({width:"long"});case"PPPP":default:return l.date({width:"full"})}},s=function(u,l){switch(u){case"p":return l.time({width:"short"});case"pp":return l.time({width:"medium"});case"ppp":return l.time({width:"long"});case"pppp":default:return l.time({width:"full"})}},n=function(u,l){var c=u.match(/(P+)(p+)?/)||[],_=c[1],p=c[2];if(!p)return a(u,l);var d;switch(_){case"P":d=l.dateTime({width:"short"});break;case"PP":d=l.dateTime({width:"medium"});break;case"PPP":d=l.dateTime({width:"long"});break;case"PPPP":default:d=l.dateTime({width:"full"});break}return d.replace("{{date}}",a(_,l)).replace("{{time}}",s(p,l))},i={p:s,P:n},o=i;t.default=o,e.exports=t.default})(longFormatters$1,longFormatters$1.exports);var longFormattersExports=longFormatters$1.exports;const longFormatters=getDefaultExportFromCjs(longFormattersExports),defaultFormats={dayOfMonth:"d",fullDate:"PPP",fullDateWithWeekday:"PPPP",fullDateTime:"PPP p",fullDateTime12h:"PPP hh:mm aaa",fullDateTime24h:"PPP HH:mm",fullTime:"p",fullTime12h:"hh:mm aaa",fullTime24h:"HH:mm",hours12h:"hh",hours24h:"HH",keyboardDate:"P",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aaa",keyboardDateTime24h:"P HH:mm",minutes:"mm",month:"LLLL",monthAndDate:"d MMMM",monthAndYear:"LLLL yyyy",monthShort:"MMM",weekday:"EEEE",weekdayShort:"EEE",normalDate:"d MMMM",normalDateWithWeekday:"EEE, d MMMM",seconds:"ss",shortDate:"d MMM",year:"yyyy"};var symbolMap={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"};class DateFnsJalaliUtils{constructor({locale:t,formats:a}={}){this.lib="date-fns-jalali",this.is12HourCycleInCurrentLocale=()=>{var s;return this.locale?/a/.test((s=this.locale.formatLong)===null||s===void 0?void 0:s.time()):!0},this.getFormatHelperText=s=>{var n,i;const o=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,u=this.locale||locale$1;return(i=(n=s.match(o))===null||n===void 0?void 0:n.map(l=>{const c=l[0];if(c==="p"||c==="P"){const _=longFormatters[c];return _(l,u.formatLong,{})}return l}).join("").replace(/(aaa|aa|a)/g,"(a|p)m").toLocaleLowerCase())!==null&&i!==void 0?i:s},this.getCurrentLocaleCode=()=>{var s;return((s=this.locale)===null||s===void 0?void 0:s.code)||"fa-IR"},this.addSeconds=(s,n)=>addSeconds(s,n),this.addMinutes=(s,n)=>addMinutes(s,n),this.addHours=(s,n)=>addHours(s,n),this.addDays=(s,n)=>addDays(s,n),this.addWeeks=(s,n)=>addWeeks(s,n),this.addMonths=(s,n)=>addMonths(s,n),this.addYears=(s,n)=>addYears(s,n),this.isValid=s=>isValid(this.date(s)),this.getDiff=(s,n,i)=>{var o;const u=(o=this.date(n))!==null&&o!==void 0?o:s;switch(i){case"years":return differenceInYears(s,u);case"quarters":return differenceInQuarters(s,u);case"months":return differenceInMonths(s,u);case"weeks":return differenceInWeeks(s,u);case"days":return differenceInDays(s,u);case"hours":return differenceInHours(s,u);case"minutes":return differenceInMinutes(s,u);case"seconds":return differenceInSeconds(s,u);default:return differenceInMilliseconds(s,u)}},this.isAfter=(s,n)=>isAfter(s,n),this.isBefore=(s,n)=>isBefore(s,n),this.startOfDay=s=>startOfDay(s),this.endOfDay=s=>endOfDay(s),this.getHours=s=>getHours(s),this.setHours=(s,n)=>setHours(s,n),this.setMinutes=(s,n)=>setMinutes(s,n),this.getSeconds=s=>getSeconds(s),this.setSeconds=(s,n)=>setSeconds(s,n),this.isSameDay=(s,n)=>isSameDay(s,n),this.isSameMonth=(s,n)=>isSameMonth(s,n),this.isSameYear=(s,n)=>isSameYear(s,n),this.isSameHour=(s,n)=>isSameHour(s,n),this.startOfYear=s=>startOfYear(s),this.endOfYear=s=>endOfYear(s),this.startOfMonth=s=>startOfMonth(s),this.endOfMonth=s=>endOfMonth(s),this.startOfWeek=s=>startOfWeek(s,{locale:this.locale}),this.endOfWeek=s=>endOfWeek(s,{locale:this.locale}),this.getYear=s=>getYear(s),this.setYear=(s,n)=>setYear(s,n),this.getDate=s=>getDate(s),this.setDate=(s,n)=>setDate(s,n),this.date=s=>typeof s>"u"?new Date:s===null?null:new Date(s),this.toJsDate=s=>s,this.parseISO=s=>parseISO(s),this.toISO=s=>formatISO(s,{format:"extended"}),this.parse=(s,n)=>s===""?null:parse(s,n,new Date,{locale:this.locale}),this.format=(s,n)=>this.formatByString(s,this.formats[n]),this.formatByString=(s,n)=>format(s,n,{locale:this.locale}),this.isEqual=(s,n)=>s===null&&n===null?!0:isEqual$1(s,n),this.isNull=s=>s===null,this.isAfterDay=(s,n)=>isAfter(s,endOfDay(n)),this.isBeforeDay=(s,n)=>isBefore(s,startOfDay(n)),this.isBeforeYear=(s,n)=>isBefore(s,startOfYear(n)),this.isAfterYear=(s,n)=>isAfter(s,endOfYear(n)),this.isWithinRange=(s,[n,i])=>isWithinInterval(s,{start:n,end:i}),this.formatNumber=s=>s.replace(/\d/g,n=>symbolMap[n]).replace(/,/g,"،"),this.getMinutes=s=>getMinutes(s),this.getMonth=s=>getMonth(s),this.getDaysInMonth=s=>getDaysInMonth(s),this.setMonth=(s,n)=>setMonth(s,n),this.getMeridiemText=s=>s==="am"?"ق.ظ.":"ب.ظ.",this.getNextMonth=s=>addMonths(s,1),this.getPreviousMonth=s=>addMonths(s,-1),this.getMonthArray=s=>{const i=[startOfYear(s)];for(;i.length<12;){const o=i[i.length-1];i.push(this.getNextMonth(o))}return i},this.mergeDateAndTime=(s,n)=>this.setSeconds(this.setMinutes(this.setHours(s,this.getHours(n)),this.getMinutes(n)),this.getSeconds(n)),this.getWeekdays=()=>{const s=new Date;return eachDayOfInterval({start:startOfWeek(s,{locale:this.locale}),end:endOfWeek(s,{locale:this.locale})}).map(n=>this.formatByString(n,"EEEEEE"))},this.getWeekArray=s=>{const n=startOfWeek(startOfMonth(s),{locale:this.locale}),i=endOfWeek(endOfMonth(s),{locale:this.locale});let o=0,u=n;const l=[];let c=null;for(;isBefore(u,i);){const _=Math.floor(o/7);l[_]=l[_]||[];const p=getDay(u);c!==p&&(c=p,l[_].push(u),o+=1),u=addDays(u,1)}return l},this.getYearRange=(s,n)=>{const i=startOfYear(s),o=endOfYear(n),u=[];let l=i;for(;isBefore(l,o);)u.push(l),l=addYears(l,1);return u},this.locale=t,this.formats=Object.assign({},defaultFormats,a)}isBeforeMonth(t,a){return isBefore(t,startOfMonth(a))}isAfterMonth(t,a){return isAfter(t,startOfMonth(a))}}const CityRequests=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./CityRequests-IZEUUx3s.js"),__vite__mapDeps([226,1,2,20,21,4,22,23,215,147,32,24,28,31,29,30,33,34,16,35,36,37,38,39,40,13,14,15,41,42,43,44,45,46,47,48,49,50,51,52,139,53,27,211,12,54,55])))),CityAvicultureManagement=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./CityAvicultureManagement-BOhjmwTw.js"),__vite__mapDeps([227,1,2,4,27,13,14,15,16,163,83,45,79])))),NewFile$4=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./NewFile-DzVKWg18.js"),__vite__mapDeps([210,1,2,211,12,13,4,14,15,16,29,59,201,212,36,30,102,103,213,35,161])))),Tickets$3=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Tickets-rkAj5df6.js"),__vite__mapDeps([207,1,2,55,102,103,16,4,70,197,51,111,112,14,42,43,44])))),UserManagement$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./CityUserManagement-CRqW-IWG.js"),__vite__mapDeps([228,1,2,4,82,27,13,14,15,16,35,51,83])))),UserFile$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./CityUserFile-DzU1_wlZ.js"),__vite__mapDeps([229,1,2,161,4,46,164,162,83,12,13,14,15,16,163])))),Poultries$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Poultries-DB3DCFBq.js"),__vite__mapDeps([166,1,2,4,32,23,42,43,44,45,151,49,50,5])))),Statics$9=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminStatics-XraSRt5m.js"),__vite__mapDeps([206,1,2,4,179,203,32,23,195,178,112])))),Hatching$6=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./OperatorNewHatching-Dh3A7QxF.js"),__vite__mapDeps([105,1,2,4,106,15,16,35,38,39,34,36,37,12,13,14,64,107,41,33,56,32,23,57,45,28,46,58,42,43,44,108,109,110,68,69,70,71,30,52,111,112,113,49,114,102,103,115,27,116,117,118,85,55,119,120,5,121,48,74])))),CityPricing=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceManagePricing-C6sFsNo-.js"),__vite__mapDeps([75,1,2,4,36,76,42,43,44,46,45])))),VetFarmAllocations$9=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VetFarmAllocations-COn5OrGn.js"),__vite__mapDeps([123,1,2,124,5,74,46,4,125,48,12,13,14,15,16,23,32,126,42,43,44,127,102,103,115,111,112,128,41,129,45,130,131,36,69,70,71,30,47,33,72,73,40,132,67,79,133,121,134,135,136,65,66])))),FilesState$9=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./FilesState-DMM_jfCL.js"),__vite__mapDeps([153,1,2,4,154,32,23,42,43,44,155,156])))),VisorStatics$3=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VisorStatics-RjLo9w8U.js"),__vite__mapDeps([177,1,2,178,4,179,14,112,32,23,21,22,20,55,42,43,44,36,169,30,180,120,113,49])))),AllHatchings$4=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminHatchings-CjLz-abB.js"),__vite__mapDeps([189,1,2,109,4,110,32,23,35,106,15,16,38,39,34,36,37,12,13,14,64,107,41,33,68,45,69,70,71,30,52,46,42,43,44,111,112,113,49,114,102,103,115,27,116,117,121,48,74,55,173])))),DiffrenceKiller=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./DiffrenceKillerPage-KlaL3_Gy.js"),__vite__mapDeps([193,1,2,20,21,4,22,23,87,114,32,42,43,44,34,102,103,16,115,45,46,111,112,14,55])))),PoultriesDetails$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./PoultriesDetailsPage-Bu9GJg8X.js"),__vite__mapDeps([217,1,2,4,113,49,15,42,43,44,121,48,46,74,55])))),cityRouting=[{path:[ROUTE_CITY_REQUESTS,ROUTE_CITY_ACTIVE_REQUESTS,ROUTE_CITY_REJECTED_REQUESTS,ROUTE_CITY_ARCHIVED_REQUESTS,ROUTE_CITY_AWAITING_PAYMENT_REQUESTS,ROUTE_CITY_AWAITING_INSPECTION_REQUESTS,ROUTE_CITY_NEW_REQUESTS,ROUTE_CITY_FREE_SALES_REQUESTS],Page:CityRequests,exact:!1,props:{}},{path:[ROUTE_CITYـHATCHINGS,ROUTE_CITY_VISOR_STATICSـHATCHINGS_DETAILS],Page:AllHatchings$4,exact:!1,props:{}},{path:[ROUTE_CITY_FILE_ROUTE],Page:NewFile$4,exact:!1,props:{}},{path:[ROUTE_CITY_POULTRY_FARMS],Page:CityAvicultureManagement,exact:!1,props:{}},{path:[ROUTE_CITY_VIEW_TICKET,ROUTE_CITY_TICKET],Page:Tickets$3,exact:!1,props:{}},{path:[ROUTE_CITY_VIEW_TICKET,ROUTE_CITY_TICKET],Page:Tickets$3,exact:!1,props:{}},{path:[ROUTE_CITY_USER_MANAGEMENT],Page:UserManagement$1,exact:!1,props:{}},{path:[ROUTE_CITY_USER_FILE_ROUTE],Page:UserFile$1,exact:!1,props:{}},{path:[ROUTE_CITY_STATICS],Page:Statics$9,exact:!1,props:{}},{path:[ROUTE_CITY_POULTRIES],Page:Poultries$2,exact:!1,props:{}},{path:[ROUTE_CITY_HATCHING,ROUTE_CITY_NEW_REQUEST],Page:Hatching$6,exact:!1,props:{}},{path:[ROUTE_CITY_PRICING],Page:CityPricing,exact:!1,props:{}},{path:[ROUTE_CITY_ROUTE_ALLOCATIONS],Page:VetFarmAllocations$9,exact:!1,props:{}},{path:[ROUTE_CITY_ROUTE_FILES_STATE],Page:FilesState$9,exact:!1,props:{}},{path:[ROUTE_CITY_VISOR_STATICS,ROUTE_CITY_VISOR_STATICS_CHARTS,ROUTE_CITY_VISOR_STATICS_PREDICTION,ROUTE_CITY_VISOR_STATICS_PREDICTION_VIEW],Page:VisorStatics$3,exact:!1,props:{}},{path:[ROUTE_CITY_DIFFRENCE_KILLER,ROUTE_CITY_DIFFRENCE_KILLER_SLAUGHTER,ROUTE_CITY_INCREASE_HATCHING],Page:DiffrenceKiller,exact:!1,props:{}},{path:[ROUTE_CITY_POULTRIES_DETAILS],Page:PoultriesDetails$2,exact:!1,props:{}}],TradePanel=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./TradePanel-nvBox6P7.js"),__vite__mapDeps([181,1,2,55,4,32,23,5,145,116,180,179,42,43,44,58,45,46,16,63,62,65,66,164])))),Cars=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./CarManagement-Chl2SE7Y.js"),__vite__mapDeps([78,1,2,4,40,32,23,45,79,80,42,43,44])))),SlaughterRequestsPage=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterRequestsPage-DSn1nwnQ.js"),__vite__mapDeps([230,1,2,16,4,108,37,38,36,76,42,43,44,20,21,25,23,24,26,22,159,27,13,14,15,28,46,30,66,18,231,100,101,102,103,104,33,98,45,99,32,111,112,232,116,52,186,170,143,74,127,115,128,41,129,130,131,12,69,70,71,233,213,35,55,61,62,63,34,64,65])))),NewFile$3=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./NewFile-DzVKWg18.js"),__vite__mapDeps([210,1,2,211,12,13,4,14,15,16,29,59,201,212,36,30,102,103,213,35,161])))),Auction=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Auction-CSwFRyO3.js"),__vite__mapDeps([223,1,2,4,27,13,14,15,16,201,83])))),Tickets$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Tickets-rkAj5df6.js"),__vite__mapDeps([207,1,2,55,102,103,16,4,70,197,51,111,112,14,42,43,44])))),AgentShare=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterAgentShare-DjSsZVvD.js"),__vite__mapDeps([97,1,2,4,32,23,42,43,44,27,13,14,15,16,36,12,98,45,46,99,100,101,102,103,104,33,55])))),SlaughterInventoryPage=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterInventoryPage-CLOKxd-H.js"),__vite__mapDeps([234,1,2,55,231,4,42,43,44,100,36,101,102,103,16,104,33,98,45,46,99,32,23,111,112,14,232,116,52,186,170,144,73,132,67,40,79,133,121,48,74,113,49,15,235,184,187,88,164,35,71,5,20,21])))),SlaughterMorguePage$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterMorgue-G6AVluZe.js"),__vite__mapDeps([236,1,2,42,43,44,4,32,23,45,101,100,36,102,103,16,104,33,55,5])))),SlaughterManageBars=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterManageBars-B2jDKFOF.js"),__vite__mapDeps([237,1,2,4,16,32,23,139,44,12,13,14,15,129,128,45,130,42,43,111,112,126,114,34,102,103,115,46,121,48,74])))),Complaints$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterComplaints-7R6Gs51u.js"),__vite__mapDeps([238,1,2,4,12,13,14,15,16,201,239,102,103,27])))),SlaughterPricing$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceManagePricing-C6sFsNo-.js"),__vite__mapDeps([75,1,2,4,36,76,42,43,44,46,45])))),Payment$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceFees-UfT7wk-6.js"),__vite__mapDeps([167,1,2,55,4,42,43,44,113,49,46,168,10,11,32,23,111,112,14,115,102,103,16,45,117,13,15,169,142,12,170,5,139])))),Wallet=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Wallet-C8rTBC_i.js"),__vite__mapDeps([240,1,2,23,4,55,11,10,12,13,14,15,16,32])))),Guilds$4=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Guilds-CrGG7yyR.js"),__vite__mapDeps([86,1,2,55,20,21,4,25,23,87,22,32,46,45,42,43,44,5,51,14,71,88,89,90,8,91,92,93,38,37,33,94,12,13,15,16,95,96])))),TransactionsPage$3=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Transactions-BSJVJOEU.js"),__vite__mapDeps([174,1,2,4,32,23,42,43,44,113,49,130,55,175])))),FreeBuy$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterFreeBuy-DL-UuT_T.js"),__vite__mapDeps([241,1,2,55,132,4,42,43,44,102,103,16,67,40,45,79,133,111,112,14,32,23,121,48,46,74])))),Dispensers$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterHouseDispenserDashboard-JLw8VA3Q.js"),__vite__mapDeps([182,1,2,20,21,4,22,23,24,55,42,43,44,183,40,45,46,32,5,184,185,113,49,79,80,101,36,111,112,14,186,121,48,74,187,188,16])))),SettlementPage=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminSettlement-QnXM2P7E.js"),__vite__mapDeps([196,1,2,113,49,4,32,23,62,70,45,197,14,38,80,136,102,103,16,115,111,112,42,43,44,65,66,55])))),ReturnPurchases=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ReturnPurchases-B5_lL37U.js"),__vite__mapDeps([199,1,2,55,42,43,44,32,23,4,71,45])))),ManageDispensers$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterManageDispensers-CeviUzsS.js"),__vite__mapDeps([242,1,2,4,55,90,91,93,183,42,43,44,32,23])))),slaughterRouting=[{path:[ROUTE_SLAUGHTER_ADD_CAR,ROUTE_SLAUGHTER_CAR_MANAGEMENT],Page:Cars,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_REQUESTS,ROUTE_SLAUGHTERـFREE_BUY,ROUTE_SLAUGHTER_ACTIVE_REQUESTS,ROUTE_SLAUGHTER_REJECTED_REQUESTS,ROUTE_SLAUGHTER_ARCHIVED_REQUESTS,ROUTE_SLAUGHTER_PENDING_REQUESTS,ROUTE_SLAUGHTER_ALLOCATE_CAR_REQUESTS,ROUTE_SLAUGHTER_ENTER_BAR_INFO,ROUTE_SLAUGHTER_SELL_CARCASS,ROUTE_SLAUGHTER_PAY_FACTORS_REQUESTS,ROUTE_SLAUGHTER_NEW_REQUESTS,ROUTE_SLAUGHTER_FACTORS,ROUTE_SLAUGHTER_FINAL_FACTORS,ROUTE_SLAUGHTERـEXPORT,ROUTE_SLAUGHTER_ALLOCATION_REQUESTS],Page:SlaughterRequestsPage,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_TRADING_PANEL],Page:TradePanel,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_SETTLEMENTS],Page:SettlementPage,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_AUCTION],Page:Auction,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_DISPENSERS,ROUTE_SLAUGHTER_DISPENSERS_MANAGEMENT,ROUTE_SLAUGHTER_DISPENSER_DETAILS,ROUTE_SLAUGHTER_DISPENSER_DETAILS_VIEW,ROUTE_SLAUGHTER_DISPENSERS_STEWARDS,ROUTE_SLAUGHTER_DISPENSERS_KILLHOUSES],Page:Dispensers$2,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_FILE_ROUTE],Page:NewFile$3,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_VIEW_TICKET,ROUTE_SLAUGHTER_TICKET],Page:Tickets$2,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_COMPLAINTS],Page:Complaints$1,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_INVENTORY,ROUTE_SLAUGHTER_INVENTORY_SELL_CARCASS_OUT_PROVINCE,ROUTE_SLAUGHTER_INVENTORY_STOCK,ROUTE_SLAUGHTER_INVENTORY_SELL_CARCASS_IN_PROVINCE,ROUTE_SLAUGHTER_DAILY_LIST,ROUTE_SLAUGHTER_SEGMENTATION],Page:SlaughterInventoryPage,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_PRICING],Page:SlaughterPricing$1,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_PAYING_FEES_REQUESTS],Page:Payment$1,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_WALLET],Page:Wallet,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_ROUTE_MANAGE_GUILDS],Page:Guilds$4,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_FINANCIAL_TRANSACTIONS],Page:TransactionsPage$3,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_AGENT_SHARE,ROUTE_SLAUGHTER_AGENT_SHARE_ID],Page:AgentShare,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_MORGUE,ROUTE_SLAUGHTER_MORGUE_STOCK,ROUTE_SLAUGHTER_MORGUE_BROADCAST_MANAGEMENT,ROUTE_SLAUGHTER_MORGUE_VIEW],Page:SlaughterMorguePage$2,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_ROUTE_MANAGE_BARS],Page:SlaughterManageBars,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_OUT_PROVINCE_BUY],Page:FreeBuy$1,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_RETURN_PURCHASES],Page:ReturnPurchases,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_INVENTORY_SUMMARY],Page:SlaughterInventoryPage,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_ORDERS],Page:SlaughterInventoryPage,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_ROUTE_MANAGE_DISPENSERS],Page:ManageDispensers$1,exact:!1,props:{}}];var Cancel={},_interopRequireDefault=interopRequireDefaultExports;Object.defineProperty(Cancel,"__esModule",{value:!0});var default_1=Cancel.default=void 0,_createSvgIcon=_interopRequireDefault(requireCreateSvgIcon()),_jsxRuntime=jsxRuntimeExports;default_1=Cancel.default=(0,_createSvgIcon.default)((0,_jsxRuntime.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel");const isMobile=window.innerWidth<=600,Modal=()=>{const{modalState:e,modalContent:t,modalTitle:a,modalOnClose:s,modalSize:n}=useSelector(p=>p.appSlice.modal),o={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:isMobile?"90%":n||500,bgcolor:"background.paper",boxShadow:24,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:SPACING.SMALL,borderRadius:2,p:2},u=useDispatch();reactExports.useEffect(()=>{u(CLOSE_MODAL())},[]);const l=()=>{u(CLOSE_MODAL()),s&&s()},c=jsxRuntimeExports.jsxs(Box,{display:"inline-block",width:"100%",mb:SPACING.SMALL,children:[jsxRuntimeExports.jsx(default_1,{fontSize:"medium",sx:{cursor:"pointer",float:"left",position:"absolute"},onClick:l}),jsxRuntimeExports.jsx(Typography,{sx:{display:"inline-block",mt:"6px",fontWeight:"bold",textAlign:"center",width:"100%",color:p=>p.palette.success.main},children:"عملیات با موفقیت انجام شد!"})]}),_=jsxRuntimeExports.jsxs(Box,{display:"inline-block",width:"100%",mb:SPACING.SMALL,children:[jsxRuntimeExports.jsx(default_1,{fontSize:"medium",sx:{cursor:"pointer",float:"left",position:"absolute"},onClick:l}),jsxRuntimeExports.jsx(Typography,{sx:{display:"inline-block",mt:"5px",fontWeight:"bold",textAlign:"center",width:"100%",color:p=>p.palette.error.main},children:"مشکلی پیش آمده است!"})]});return jsxRuntimeExports.jsx(Modal$1,{open:e,onClose:l,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:jsxRuntimeExports.jsxs(Box,{sx:o,children:[a==="success"&&c,a==="error"&&_,a!=="success"&&a!=="error"&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Box,{display:"inline-block",width:"100%",mb:SPACING.SMALL,children:[jsxRuntimeExports.jsx(default_1,{fontSize:"medium",sx:{cursor:"pointer",float:"left",position:"absolute"},onClick:l}),jsxRuntimeExports.jsx(Typography,{sx:{display:"inline-block",mt:"5px",fontWeight:"bold",textAlign:"center",width:"100%"},children:a})]}),t]})]})})},ProvinceFinancial=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceFinancial-D2wtnzpF.js"),__vite__mapDeps([243,1,2,20,21,4,25,23,215,22,147,24,26,27,13,14,15,16,28,53,54,212,36,12,30,102,103,29,46,42,43,44,55])))),NewFile$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./NewFile-DzVKWg18.js"),__vite__mapDeps([210,1,2,211,12,13,4,14,15,16,29,59,201,212,36,30,102,103,213,35,161])))),ProvinceManagePricing$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceManagePricing-C6sFsNo-.js"),__vite__mapDeps([75,1,2,4,36,76,42,43,44,46,45])))),Tickets$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Tickets-rkAj5df6.js"),__vite__mapDeps([207,1,2,55,102,103,16,4,70,197,51,111,112,14,42,43,44])))),Debts=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceFinancialDebts-BtSseWWb.js"),__vite__mapDeps([244,1,2,4,12,13,14,15,16])))),Complaints=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceFinancialComplaints-D204yz0f.js"),__vite__mapDeps([245,1,2,4,12,13,14,15,16,28])))),DoucumentRegister=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceFinancialDocumentRegister-B88BVveg.js"),__vite__mapDeps([246,1,2,27,13,4,14,15,16,83,43,161,12,164,102,103,36,10,112])))),Statics$8=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminStatics-XraSRt5m.js"),__vite__mapDeps([206,1,2,4,179,203,32,23,195,178,112])))),ProvinceSettlementPage=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceSettlementPage-aomMVXar.js"),__vite__mapDeps([247,1,2,4,27,13,14,15,16,36,46])))),TransactionsPage$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Transactions-BSJVJOEU.js"),__vite__mapDeps([174,1,2,4,32,23,42,43,44,113,49,130,55,175])))),ProvincePricing=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceManagePricing-C6sFsNo-.js"),__vite__mapDeps([75,1,2,4,36,76,42,43,44,46,45])))),SubSectorWage=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SubSectorWage-C6GLWIJC.js"),__vite__mapDeps([191,1,2,55,20,21,4,22,23,42,43,44,170,113,49,102,103,16,115,111,112,14,46,45,32])))),provinceFinancialRouting=[{path:[ROUTE_PROVINCE_FINANCIAL_REQUESTS,ROUTE_PROVINCE_FINANCIAL_REJECTED_REQUESTS,ROUTE_PROVINCE_FINANCIAL_ARCHIVED_REQUESTS,ROUTE_PROVINCE_FINANCIAL_NEW_REQUESTS,ROUTE_PROVINCE_FINANCIAL_AWAITING_PAYMENT_REQUESTS,ROUTE_PROVINCE_FINANCIAL_AWAITING_INSPECTION_REQUESTS,ROUTE_PROVINCE_FINANCIAL_PENDING_REQUESTS,ROUTE_PROVINCE_FINANCIAL_CHECK_PAYED_FACTOR_REQUESTS,ROUTE_PROVINCE_FINANCIAL_FINAL_FACTORS_REQUESTS,ROUTE_PROVINCE_FINANCIAL_ACTIVE_REQUESTS],Page:ProvinceFinancial,exact:!1,props:{}},{path:[ROUTE_PROVINCE_FINANCIAL_SUB_SECTORS_WAGE,ROUTE_PROVINCE_FINANCIAL_SUB_SECTORS_CITY_SHARES,ROUTE_PROVINCE_FINANCIAL_SUB_SECTORS_STEWARD_SHARES,ROUTE_PROVINCE_FINANCIAL_SUB_SECTORS_VET_FARM_SHARES],Page:SubSectorWage,exact:!1,props:{}},{path:[ROUTE_PROVINCE_FINANCIAL_FILE_ROUTE],Page:NewFile$2,exact:!1,props:{}},{path:[ROUTE_PROVINCE_PRICING],Page:ProvinceManagePricing$1,exact:!1,props:{}},{path:[ROUTE_PROVINCE_FINANCIAL_VIEW_TICKET,ROUTE_PROVINCE_FINANCIAL_TICKET],Page:Tickets$1,exact:!1,props:{}},{path:[ROUTE_PROVINCE_FINANCIAL_ROUTE_DEBT],Page:Debts,exact:!1,props:{}},{path:[ROUTE_PROVINCE_FINANCIAL_COMPLAINTS],Page:Complaints,exact:!1,props:{}},{path:[ROUTE_PROVINCE_FINANCIAL_DOCUMENT_REGISTRATION,ROUTE_PROVINCE__FINANCIAL_USER_FINACIAL_FILE_ROUTE],Page:DoucumentRegister,exact:!1,props:{}},{path:[ROUTE_PROVINCE_FINANCIAL_STATICS],Page:Statics$8,exact:!1,props:{}},{path:[ROUTE_PROVINCE_PRICING3],Page:ProvincePricing,exact:!1,props:{}},{path:[ROUTE_PROVINCE_FINANCIAL_SETTLEMENT],Page:ProvinceSettlementPage,exact:!1,props:{}},{path:[ROUTE_PROVINCE_FINANCIAL_TRANSACTIONS,ROUTE_PROVINCE_FINANCIAL_TRANSACTIONS_VIEW],Page:TransactionsPage$2,exact:!1,props:{}}],VetFarm$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VetFarm-DwS6N0cZ.js"),__vite__mapDeps([248,1,2,4,42,43,44,102,103,16,133,5,45,32,23])))),VetFarmAllocations$8=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VetFarmAllocations-COn5OrGn.js"),__vite__mapDeps([123,1,2,124,5,74,46,4,125,48,12,13,14,15,16,23,32,126,42,43,44,127,102,103,115,111,112,128,41,129,45,130,131,36,69,70,71,30,47,33,72,73,40,132,67,79,133,121,134,135,136,65,66])))),VetFarmInspections=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VetFarmInspections-C5LeABjH.js"),__vite__mapDeps([249,1,2,4,12,13,14,15,16,161])))),Hatching$5=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./OperatorNewHatching-Dh3A7QxF.js"),__vite__mapDeps([105,1,2,4,106,15,16,35,38,39,34,36,37,12,13,14,64,107,41,33,56,32,23,57,45,28,46,58,42,43,44,108,109,110,68,69,70,71,30,52,111,112,113,49,114,102,103,115,27,116,117,118,85,55,119,120,5,121,48,74])))),ChickenHatching=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Hatching-CKVP0ju2.js"),__vite__mapDeps([250,1,2,55,110,32,23,4,35,106,15,16,38,39,34,36,37,12,13,14,64,107,41,33,68,45,69,70,71,30,52,46,42,43,44,111,112,113,49])))),vetFarmRouting=[{path:[ROUTE_VETFARM_HATCHING],Page:ChickenHatching,exact:!1,props:{}},{path:[ROUTE_VETFARM_REGISTER_INFO],Page:VetFarm$1,exact:!1,props:{}},{path:[ROUTE_VETFARM_INSPECTIONS_ROUTE],Page:VetFarmInspections,exact:!1,props:{}},{path:[ROUTE_VETFARM_ROUTE_HATCHING],Page:Hatching$5,exact:!1,props:{}},{path:[ROUTE_VETFARM_ROUTE_ALLOCATIONS],Page:VetFarmAllocations$8,exact:!1,props:{}}];function TemporaryDrawer(){const{drawer:e}=useSelector(o=>o.appSlice),t=useDispatch(),[a,s]=reactExports.useState({top:!1,left:!1,bottom:!1,right:!1,size:!1,content:!1});reactExports.useEffect(()=>{t(DRAWER({top:!1,left:!1,bottom:!1,right:!1,title:null,content:null,size:310}))},[]),reactExports.useEffect(()=>{s(e||{top:!1,left:!1,bottom:!1,right:!1,size:null,content:null})},[e]);const n=(o,u)=>l=>{l.type==="keydown"&&(l.key==="Tab"||l.key==="Shift")||t(DRAWER({[o]:u}))},i=o=>jsxRuntimeExports.jsxs(Grid,{sx:{width:o==="top"||o==="bottom"?"auto":e.size?e.size:310,height:e.bottom?"90vh":"100%"},role:"presentation",p:SPACING.SMALL,children:[jsxRuntimeExports.jsxs(Grid,{container:!0,justifyContent:"space-between",alignItems:"center",mb:2,children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",color:"primary",sx:{fontSize:"18px",fontWeight:600},children:e.title}),jsxRuntimeExports.jsx(Box,{sx:{width:"70%",height:"3px",backgroundColor:"#00A991",marginTop:"4px"}})]}),jsxRuntimeExports.jsx(Button,{color:"error",onClick:()=>{t(DRAWER({top:!1,left:!1,bottom:!1,right:!1,title:null,content:null,size:null}))},sx:{fontSize:"15px",fontWeight:500},children:"بازگشت"})]}),jsxRuntimeExports.jsx(Grid,{py:SPACING.SMALL,children:e==null?void 0:e.content})]});return jsxRuntimeExports.jsx("div",{children:["left","right","top","bottom"].map(o=>jsxRuntimeExports.jsx(reactExports.Fragment,{children:jsxRuntimeExports.jsx(Drawer,{anchor:o,open:a[o],onClose:n(o,!1),children:i(o)})},o))})}propTypesExports.PropTypes.any;const Support=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Support-B9DfdFaF.js"),__vite__mapDeps([7,1,2,8,4])))),GeneralDashboard=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./GeneralDashboard-C-xEqVw5.js"),__vite__mapDeps([251,1,2,46,90,8,91,92,4,102,103,16,146,67,20,12,13,14,15,55])))),Messages=reactExports.lazy(()=>__vitePreload(()=>import("./Messages-kMYYq0zn.js"),__vite__mapDeps([252,1,2,4,209]))),Training=reactExports.lazy(()=>__vitePreload(()=>import("./Training-Yw94DwCN.js"),__vite__mapDeps([253,1,2,4]))),Payment=reactExports.lazy(()=>__vitePreload(()=>import("./Payment-BnucYNy2.js"),__vite__mapDeps([254,1,2,4]))),WagePayment=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./WagePayment-C-ToCy2g.js"),__vite__mapDeps([9,1,2,10,4,11,12,13,14,15,16])))),DownloadReport=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./DownloadReport-Kp5MocZr.js"),__vite__mapDeps([17,1,2,4,18])))),Ticket=reactExports.lazy(()=>__vitePreload(()=>import("./Tickets-rkAj5df6.js"),__vite__mapDeps([207,1,2,55,102,103,16,4,70,197,51,111,112,14,42,43,44]))),generalRouting=[{path:[ROUTE_GENERAL_USER_PROFILE,ROUTE_AVICULTURE_USER_PROFILE,ROUTE_CITY_USER_PROFILE,ROUTE_SLAUGHTER_USER_PROFILE,ROUTE_PROVINCE_USER_PROFILE,ROUTE_INSPECTOR_USER_PROFILE,ROUTE_VETFARM_USER_PROFILE,ROUTE_PROVINCE_FINANCIAL_USER_PROFILE,ROUTE_SLAUGHTER_HOUSE_VET_USER_PROFILE,ROUTE_STEWARD_USER_PROFILE,DRIVER_USER_PROFILE,ROUTE_CITYVET_USER_PROFILE,ROUTE_LIVE_STOCK_USER_PROFILE,ROUTE_CHAIN_COMPANY_USER_PROFILE,"/"],Page:GeneralDashboard,exact:!1,props:{}},{path:[ROUTE_GENERAL_TICKET_LIST,ROUTE_GENERAL_TICKET],Page:Ticket,exact:!1,props:{}},{path:[ROUTE_GENERAL_SUPPORT],Page:Support,exact:!1,props:{}},{path:[ROUTE_GENERAL_MESSAGES],Page:Messages,exact:!1,props:{}},{path:[ROUTE_GENERAL_TRAINING],Page:Training,exact:!1,props:{}},{path:[ROUTE_GENERAL_PAYMENT],Page:Payment,exact:!1,props:{}},{path:[ROUTE_GENERAL_WAGE_PAYMENT],Page:WagePayment,exact:!1,props:{}},{path:[ROUTE_GENERAL_DOWNLOAD_REPORT],Page:DownloadReport,exact:!1,props:{}}],StrictModal=({content:e,title:t,open:a})=>{const s={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",boxShadow:24,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:SPACING.SMALL,borderRadius:2,p:3};return jsxRuntimeExports.jsx(Modal$1,{open:a,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:jsxRuntimeExports.jsx(Box,{sx:s,children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{display:"inline-block",width:"100%",mb:SPACING.SMALL,children:jsxRuntimeExports.jsx(Typography,{sx:{display:"inline-block",mt:"5px",fontWeight:"bold",textAlign:"center",width:"100%"},children:t})}),e]})})})};StrictModal.propTypes={title:propTypesExports.PropTypes.any,content:propTypesExports.PropTypes.any,open:propTypesExports.PropTypes.any};const avicultureSetHallNumber=createAsyncThunk("AVICULTURE_SET_HALL_NUMBER",async(e,{dispatch:t})=>{t(LOADING_START());const{data:a,status:s}=await axios$1.put("Poultry/0/",e);return t(LOADING_END()),{data:a,status:s}}),StrictMissingHallNumber=({name:e,id:t,avicultureKey:a,handleClose:s})=>{const[n]=reactExports.useContext(AppContext),i=useDispatch(),o=useFormik({initialValues:{number_of_halls:1},validationSchema:create$1({number_of_halls:create$3().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!")})});return reactExports.useEffect(()=>{o.validateForm()},[]),jsxRuntimeExports.jsxs(Grid,{container:!0,gap:SPACING.SMALL,children:[jsxRuntimeExports.jsx(Grid,{children:jsxRuntimeExports.jsxs(Typography,{variant:"body2",children:["تعداد سالن های ",e," با شناسه جوجه ریزی ",t," را وارد کنید."]})}),jsxRuntimeExports.jsx(Grid,{container:!0,justifyContent:"center",alignItems:"center",xs:12,mt:SPACING.SMALL,children:jsxRuntimeExports.jsxs(FormControl,{sx:{minWidth:"100%"},children:[jsxRuntimeExports.jsx(InputLabel,{id:"demo-simple-select-label",children:"تعداد سالن"}),jsxRuntimeExports.jsxs(Select,{labelId:"demo-simple-select-label",id:"type_car",label:"تعداد سالن",value:o.values.number_of_halls,onChange:u=>{o.setFieldValue("number_of_halls",u.target.value)},error:o.touched.number_of_halls?!!o.errors.number_of_halls:null,onBlur:o.handleBlur,helperText:o.touched.number_of_halls&&o.errors.number_of_halls?o.errors.number_of_halls:null,children:[jsxRuntimeExports.jsx(MenuItem,{value:"1",children:"1"}),jsxRuntimeExports.jsx(MenuItem,{value:"2",children:"2"}),jsxRuntimeExports.jsx(MenuItem,{value:"3",children:"3"}),jsxRuntimeExports.jsx(MenuItem,{value:"4",children:"4"}),jsxRuntimeExports.jsx(MenuItem,{value:"5",children:"5"}),jsxRuntimeExports.jsx(MenuItem,{value:"6",children:"6"}),jsxRuntimeExports.jsx(MenuItem,{value:"7",children:"7"}),jsxRuntimeExports.jsx(MenuItem,{value:"8",children:"8"}),jsxRuntimeExports.jsx(MenuItem,{value:"9",children:"9"}),jsxRuntimeExports.jsx(MenuItem,{value:"10",children:"10"})]})]})}),jsxRuntimeExports.jsx(Button,{fullWidth:!0,variant:"contained",onClick:()=>{i(avicultureSetHallNumber({key:a,number_of_halls:o.values.number_of_halls})).then(u=>{u.error?n({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(n({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),i(avicultureGetProfile()),s())})},children:"ثبت"})]})};StrictMissingHallNumber.propTypes={name:propTypesExports.PropTypes.any,id:propTypesExports.PropTypes.any,avicultureKey:propTypesExports.PropTypes.any,handleClose:propTypesExports.PropTypes.any};const Driver=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Driver-CHyVUqPi.js"),__vite__mapDeps([255,1,2,20,27,13,4,14,15,16])))),driverRouting=[{path:[ROUTE_DRIVER_REQUESTS,ROUTE_DRIVER_CARS],Page:Driver,exact:!1,props:{}}],SidebarContext=reactExports.createContext(),SidebarContextProvider=e=>{const[t,a]=reactExports.useState(!1);return jsxRuntimeExports.jsx(SidebarContext.Provider,{value:[t,a],children:e.children})};SidebarContextProvider.propTypes={children:propTypesExports.PropTypes.any};const BackDrop=()=>{const e=useSelector(s=>s.appSlice.backdrop),[,t]=reactExports.useContext(SidebarContext),a=useDispatch();return reactExports.useEffect(()=>{a(BACKDROP_HIDE())},[]),jsxRuntimeExports.jsx(Backdrop,{sx:{color:"#fff",zIndex:s=>s.zIndex.drawer+1},open:e,onClick:()=>t(!1)})},Notif=()=>{const e=React.forwardRef(function(_,p){return jsxRuntimeExports.jsx(Alert,{elevation:6,ref:p,variant:"filled",..._})}),[t,a]=reactExports.useContext(AppContext),{vertical:s,horizontal:n,open:i,severity:o,msg:u}=a,l=()=>{t({...a,open:!1})};return jsxRuntimeExports.jsx(Snackbar,{anchorOrigin:{vertical:s,horizontal:n},open:i,autoHideDuration:6e3,onClose:l,children:jsxRuntimeExports.jsx(e,{onClose:l,severity:o,sx:{width:"100%"},children:u})},s+n)},Inspector=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Inspector-DMOgCEzJ.js"),__vite__mapDeps([256,1,2,28,4,12,13,14,15,16,29,30,46,20,22,23,21,215,147,32,24,54,27,55])))),NewFile$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./NewFile-DzVKWg18.js"),__vite__mapDeps([210,1,2,211,12,13,4,14,15,16,29,59,201,212,36,30,102,103,213,35,161])))),CarManagement=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./CarManagement-Chl2SE7Y.js"),__vite__mapDeps([78,1,2,4,40,32,23,45,79,80,42,43,44])))),UserManagement=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceUserManagement-CHb4mhM7.js"),__vite__mapDeps([81,1,2,4,42,43,44,58,82,45,16,35,83,15,36,84,51,40,32,23,85])))),UserFile=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceUserFile-cShttUtU.js"),__vite__mapDeps([160,1,2,161,4,12,13,14,15,16,46,162,83,84,36,40,163,164])))),Tickets=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Tickets-rkAj5df6.js"),__vite__mapDeps([207,1,2,55,102,103,16,4,70,197,51,111,112,14,42,43,44])))),Reporting=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./InspectorReporting-Cw7P2uCF.js"),__vite__mapDeps([257,1,2,4,35,13,14,15,16,27])))),Statics$7=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminStatics-XraSRt5m.js"),__vite__mapDeps([206,1,2,4,179,203,32,23,195,178,112])))),InspectorPricing$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceManagePricing-C6sFsNo-.js"),__vite__mapDeps([75,1,2,4,36,76,42,43,44,46,45])))),ManageFarm=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ManageFarm-BTM56jv5.js"),__vite__mapDeps([150,1,2,4,15,16,42,43,44,32,23,45,151])))),inspectorRouting=[{path:[ROUTE_INSPECTOR_REQUESTS,ROUTE_INSPECTOR_REJECTED_REQUESTS,ROUTE_INSPECTOR_REQUESTS_NEW_REQUESTS,ROUTE_INSPECTOR_ARCHIVED_REQUESTS,ROUTE_PROVINCE_INSPECTOR_AWAITING_PAYMENT_REQUESTS,ROUTE_PROVINCE_INSPECTOR_AWAITING_INSPECTION_REQUESTS],Page:Inspector,exact:!1,props:{}},{path:[ROUTE_INSPECTOR_FILE_ROUTE],Page:NewFile$1,exact:!1,props:{}},{path:[ROUTE_PROVINCE_CAR_MANAGEMENT],Page:CarManagement,exact:!1,props:{}},{path:[ROUTE_PROVINCE_USER_MANAGEMENT],Page:UserManagement,exact:!1,props:{}},{path:[ROUTE_INSPECTOR_ASSIGN_VET_FARM],Page:ManageFarm,exact:!1,props:{}},{path:[ROUTE_PROVINCE_USER_FILE_ROUTE],Page:UserFile,exact:!1,props:{}},{path:[ROUTE_PROVINCE_INSPECTOR_VIEW_TICKET,ROUTE_PROVINCE_INSPECTOR_TICKET],Page:Tickets,exact:!1,props:{}},{path:[ROUTE_PROVINCE_INSPECTOR_REPORTING],Page:Reporting,exact:!1,props:{}},{path:[ROUTE_INSPECTOR_STATICS],Page:Statics$7,exact:!1,props:{}},{path:[ROUTE_PROVINCE_INSPECTOR_PRICING],Page:InspectorPricing$1,exact:!1,props:{}}],Fallback=()=>jsxRuntimeExports.jsx(Grid,{mt:SPACING.MEDIUM,children:jsxRuntimeExports.jsx(CircularProgress,{color:"primary"})}),SlaughterHouseVetPage=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterHouseVet-BNaV_ELx.js"),__vite__mapDeps([258,1,2,20,21,4,22,23,73,28,46,129,128,45,130,32,42,43,44,111,112,14,30,55,12,13,15,16,201,239,102,103,27,233,127,115,74,41,131,36,69,70,71])))),NewFile=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./NewFile-DzVKWg18.js"),__vite__mapDeps([210,1,2,211,12,13,4,14,15,16,29,59,201,212,36,30,102,103,213,35,161])))),SlaughterPricing=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceManagePricing-C6sFsNo-.js"),__vite__mapDeps([75,1,2,4,36,76,42,43,44,46,45])))),FreeBuy=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterFreeBuy-DL-UuT_T.js"),__vite__mapDeps([241,1,2,55,132,4,42,43,44,102,103,16,67,40,45,79,133,111,112,14,32,23,121,48,46,74])))),slaughterHouseVetRouting=[{path:[ROUTE_SLAUGHTER_HOUSE_VET_REQUESTS,ROUTE_SLAUGHTER_HOUSE_VET_NEW_REQUESTS,ROUTE_SLAUGHTER_HOUSE_VET_ACTIVE_REQUESTS,ROUTE_SLAUGHTER_HOUSE_VET_REJECTED_REQUESTS,ROUTE_SLAUGHTER_HOUSE_VET_ARCHIVED_REQUESTS,ROUTE_SLAUGHTER_HOUSE_VET_ENTER_BAR_INFO,ROUTE_SLAUGHTER_HOUSE_VET_COMPLAINTS],Page:SlaughterHouseVetPage,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_HOUSE_VET_FILE_ROUTE],Page:NewFile,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_PRICING],Page:SlaughterPricing,exact:!1,props:{}},{path:[ROUTE_SLAUGHTER_HOUSE_VET_FREE_BUY_ROUTE],Page:FreeBuy,exact:!1,props:{}}];var changedArray=function e(t,a){return t===void 0&&(t=[]),a===void 0&&(a=[]),t.length!==a.length||t.some(function(s,n){return!Object.is(s,a[n])})},initialState={error:null},ErrorBoundary=function(e){_inheritsLoose$1(t,e);function t(){for(var s,n=arguments.length,i=new Array(n),o=0;o{const R=document.body;return R.style.background="#341f97",()=>{R.style.background=""}},[]);const a=navigator.appVersion,s=navigator.userAgent;let n=navigator.appName,i=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10),u,l,c;(l=s.indexOf("OPR"))!==-1?(n="Opera",i=s.substring(l+4),(l=s.indexOf("Version"))!==-1&&(i=s.substring(l+8))):(l=s.indexOf("Edg"))!==-1?(n="Microsoft Edge",i=s.substring(l+4)):(l=s.indexOf("MSIE"))!==-1?(n="Microsoft Internet Explorer",i=s.substring(l+5)):(l=s.indexOf("Chrome"))!==-1?(n="Chrome",i=s.substring(l+7)):(l=s.indexOf("Safari"))!==-1?(n="Safari",i=s.substring(l+7),(l=s.indexOf("Version"))!==-1&&(i=s.substring(l+8))):(l=s.indexOf("Firefox"))!==-1?(n="Firefox",i=s.substring(l+8)):(u=s.lastIndexOf(" ")+1)<(l=s.lastIndexOf("/"))&&(n=s.substring(u,l),i=s.substring(l+1),n.toLowerCase()===n.toUpperCase()&&(n=navigator.appName)),(c=i.indexOf(";"))!==-1&&(i=i.substring(0,c)),(c=i.indexOf(" "))!==-1&&(i=i.substring(0,c)),o=parseInt(""+i,10),isNaN(o)&&(i=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10));let _="Unknown OS";navigator.appVersion.indexOf("Win")!==-1&&(_="Windows"),navigator.appVersion.indexOf("Mac")!==-1&&(_="MacOS"),navigator.appVersion.indexOf("X11")!==-1&&(_="UNIX"),navigator.appVersion.indexOf("Linux")!==-1&&(_="Linux");const[,p]=useUserProfile(),d={error:{stack:(e==null?void 0:e.stack)||"No stack trace available",msg:(e==null?void 0:e.message)||"Unknown error"},url:((E=window.location)==null?void 0:E.href)||window.location,userProfile:p||null,date:new Date,os:_,browserName:n,browserVersion:i+"-"+o,navigatorAppName:navigator.appName,navigatorAppVersion:a,navigatorUserAgent:s};return reactExports.useEffect(()=>{console.log({error:e,reportObj:d},JSON.stringify(e,null,2),"Current Error")},[e]),reactExports.useEffect(()=>{},[e]),jsxRuntimeExports.jsx(Grid,{container:!0,sx:{backgroundColor:"#341f97",alignItems:"center",justifyContent:"center",minHeight:"100vh",width:"100%",position:"fixed",top:0,left:0,zIndex:9999},children:jsxRuntimeExports.jsxs(Grid,{display:"flex",flexDirection:"column",xs:8,gap:2,justifyContent:"center",children:[jsxRuntimeExports.jsx(Grid,{width:"300px",alignSelf:"center",children:groovyWalkAnimation?jsxRuntimeExports.jsx(Lottie,{animationData:groovyWalkAnimation,loop:!0}):jsxRuntimeExports.jsx(Typography,{variant:"h3",color:"white",children:"⚠️"})}),jsxRuntimeExports.jsx(Grid,{children:jsxRuntimeExports.jsx(Typography,{variant:"h5",color:"#DC6E56",children:"متاسفیم، این بخش در دست توسعه است!"})}),jsxRuntimeExports.jsx(Grid,{children:jsxRuntimeExports.jsx(Typography,{variant:"body1",color:"white",children:"مشکل شما به بخش فنی گزارش داده شد و در حال رفع مشکل هستیم، لطفا چند لحظه دیگر تلاش کنید."})}),jsxRuntimeExports.jsx(Grid,{children:jsxRuntimeExports.jsx(Typography,{variant:"body1",color:"white",children:"در صورت رفع نشدن مشکل با شماره 02128421237 تماس حاصل فرمایید."})}),jsxRuntimeExports.jsx(Grid,{mt:2,children:jsxRuntimeExports.jsx(Button,{variant:"contained",onClick:t,color:"primary",children:"تلاش دوباره"})})]})})}ErrorFallback.propTypes={error:propTypesExports.PropTypes.any,resetErrorBoundary:propTypesExports.PropTypes.any};const Requests=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminRequests-Bx6KBll9.js"),__vite__mapDeps([259,1,2,118,4,34,106,15,16,35,38,39,36,37,12,13,14,64,107,41,33,85,221,42,43,44,27,28,179,53,54,20])))),Statics$6=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminStatics-XraSRt5m.js"),__vite__mapDeps([206,1,2,4,179,203,32,23,195,178,112])))),VisorStatics$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VisorStatics-RjLo9w8U.js"),__vite__mapDeps([177,1,2,178,4,179,14,112,32,23,21,22,20,55,42,43,44,36,169,30,180,120,113,49])))),adminRouting=[{path:[ROUTE_ADMIN_REQUESTS,ROUTE_ADMIN_CREATE_NEW_REQUEST,ROUTE_ADMIN_HATCHING,ROUTE_ADMIN_NEW_REQUESTS,ROUTE_ADMIN_REJECTED_REQUESTS,ROUTE_ADMIN_AWAITING_PAYMENT_REQUESTS,ROUTE_ADMIN_AWAITING_INSPECTION_REQUESTS,ROUTE_ADMIN_ARCHIVED_REQUESTS,ROUTE_ADMIN_ACTIVE_REQUESTS],Page:Requests,exact:!1,props:{}},{path:[ROUTE_ADMIN_STATICS],Page:Statics$6,exact:!1,props:{}},{path:[ROUTE_ADMIN_VISOR_STATICS,ROUTE_ADMIN_VISOR_STATICS_PREDICTION,ROUTE_ADMIN_VISOR_STATICS_CHARTS],Page:VisorStatics$2,exact:!1,props:{}}];function showSnackbar(e,t="warning"){const a=document.createElement("div");document.body.appendChild(a);const s=()=>{ReactDOM.unmountComponentAtNode(a),document.body.removeChild(a)};ReactDOM.render(jsxRuntimeExports.jsx(Snackbar,{open:!0,autoHideDuration:6e3,onClose:s,children:jsxRuntimeExports.jsx(Alert,{onClose:s,severity:t,sx:{width:"100%"},children:e})}),a)}var camelize=function(e){return typeof e=="string"?camelCase(e):walk(e)};function walk(e){return!e||typeof e!="object"||isDate(e)||isRegex(e)?e:isArray(e)?map(e,walk):reduce(objectKeys(e),function(t,a){var s=camelCase(a);return t[s]=walk(e[a]),t},{})}function camelCase(e){return e.replace(/[_.-](\w|$)/g,function(t,a){return a.toUpperCase()})}var isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},isDate=function(e){return Object.prototype.toString.call(e)==="[object Date]"},isRegex=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},has=Object.prototype.hasOwnProperty,objectKeys=Object.keys||function(e){var t=[];for(var a in e)has.call(e,a)&&t.push(a);return t};function map(e,t){if(e.map)return e.map(t);for(var a=[],s=0;s{const s=store.getState().userSlice.userPath;e.defaults.baseURL=s};t();const a=store.subscribe(()=>{store.getState().userSlice.userPath!==e.defaults.baseURL&&t()});return e.interceptors.request.use(s=>{const{userSlice:{authToken:n}}=store.getState();return n?(s.headers.Authorization=`Bearer ${n}`,s.headers.Accept="application/json"):s.headers.Authorization="Bearer null",s},s=>Promise.reject(s)),e.interceptors.response.use(s=>camelize$1(s),s=>(s.response&&s.response.status===401&&(showSnackbar("مدت زمان فعالیت شما به اتمام رسیده است.","error"),store.dispatch(LOADING_END()),setTimeout(()=>{store.dispatch(LOG_OUT())},3e3)),Promise.reject(s))),a}const Statics$5=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminStatics-XraSRt5m.js"),__vite__mapDeps([206,1,2,4,179,203,32,23,195,178,112])))),Reports$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceReports-B30xgkxd.js"),__vite__mapDeps([172,1,2,55,4,32,23,173])))),VetFarmAllocations$7=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VetFarmAllocations-COn5OrGn.js"),__vite__mapDeps([123,1,2,124,5,74,46,4,125,48,12,13,14,15,16,23,32,126,42,43,44,127,102,103,115,111,112,128,41,129,45,130,131,36,69,70,71,30,47,33,72,73,40,132,67,79,133,121,134,135,136,65,66])))),JahadKillStats$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./JahadKillStats-BePuGWF-.js"),__vite__mapDeps([260,1,2,179,27,13,4,14,15,16,203,66])))),Poultries$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Poultries-DB3DCFBq.js"),__vite__mapDeps([166,1,2,4,32,23,42,43,44,45,151,49,50,5])))),JahadIllegalKilling$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./JahadIllegalKilling-BZcreoc1.js"),__vite__mapDeps([261,1,2,4,27,13,14,15,16])))),FilesState$8=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./FilesState-DMM_jfCL.js"),__vite__mapDeps([153,1,2,4,154,32,23,42,43,44,155,156])))),Hatching$4=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Hatching-CKVP0ju2.js"),__vite__mapDeps([250,1,2,55,110,32,23,4,35,106,15,16,38,39,34,36,37,12,13,14,64,107,41,33,68,45,69,70,71,30,52,46,42,43,44,111,112,113,49])))),PoultriesDetails$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./PoultriesDetailsPage-Bu9GJg8X.js"),__vite__mapDeps([217,1,2,4,113,49,15,42,43,44,121,48,46,74,55])))),vetSupervisorRouting=[{path:[ROUTE_VETـSUPERVISOR_HATCHING],Page:Hatching$4,exact:!1,props:{}},{path:[ROUTEـVET_SUPERVISOR_POULTRIES],Page:Poultries$1,exact:!1,props:{}},{path:[ROUTE_VETـSUPERVISOR_ALLOCATIONS],Page:VetFarmAllocations$7,exact:!1,props:{}},{path:[ROUTE_VETـSUPERVISOR_ILLEGALـKILLING],Page:JahadIllegalKilling$1,exact:!1,props:{}},{path:[ROUTE_VETـSUPERVISOR_KILLS_STATS],Page:JahadKillStats$1,exact:!1,props:{}},{path:[ROUTE_VETـSUPERVISOR_STATICS,ROUTE_VETـSUPERVISOR_STATICS_PREDICTION,ROUTE_VETـSUPERVISOR_STATICS_PREDICTION_VIEW,ROUTE_VETـSUPERVISOR_STATICS_CHARTS],Page:Statics$5,exact:!1,props:{}},{path:[ROUTE_VETـSUPERVISOR_ROUTE_FILES_STATE],Page:FilesState$8,exact:!1,props:{}},{path:[ROUTE_VETـSUPERVISOR_REPORTING],Page:Reports$1,exact:!1,props:{}},{path:[ROUTEـVET_SUPERVISOR_POULTRIES_DETAILS],Page:PoultriesDetails$1,exact:!1,props:{}}],JahadKillStats=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./JahadKillStats-BePuGWF-.js"),__vite__mapDeps([260,1,2,179,27,13,4,14,15,16,203,66])))),JahadIllegalKilling=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./JahadIllegalKilling-BZcreoc1.js"),__vite__mapDeps([261,1,2,4,27,13,14,15,16])))),InspectorPricing=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceManagePricing-C6sFsNo-.js"),__vite__mapDeps([75,1,2,4,36,76,42,43,44,46,45])))),FilesState$7=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./FilesState-DMM_jfCL.js"),__vite__mapDeps([153,1,2,4,154,32,23,42,43,44,155,156])))),jahadRouting=[{path:[ROUTE_JAHAD_KILLS_STATS],Page:JahadKillStats,exact:!1,props:{}},{path:[ROUTE_JAHAD_ILLEGALـKILLING],Page:JahadIllegalKilling,exact:!1,props:{}},{path:[ROUTE_JAHAD_PRICING],Page:InspectorPricing,exact:!1,props:{}},{path:[ROUTE_JAHAD_FILES_STATE],Page:FilesState$7,exact:!1,props:{}}],Guilds$3=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Guilds-CrGG7yyR.js"),__vite__mapDeps([86,1,2,55,20,21,4,25,23,87,22,32,46,45,42,43,44,5,51,14,71,88,89,90,8,91,92,93,38,37,33,94,12,13,15,16,95,96])))),FilesState$6=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./FilesState-DMM_jfCL.js"),__vite__mapDeps([153,1,2,4,154,32,23,42,43,44,155,156])))),VetFarmAllocations$6=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VetFarmAllocations-COn5OrGn.js"),__vite__mapDeps([123,1,2,124,5,74,46,4,125,48,12,13,14,15,16,23,32,126,42,43,44,127,102,103,115,111,112,128,41,129,45,130,131,36,69,70,71,30,47,33,72,73,40,132,67,79,133,121,134,135,136,65,66])))),Statics$4=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminStatics-XraSRt5m.js"),__vite__mapDeps([206,1,2,4,179,203,32,23,195,178,112])))),Commerce$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Commerce-DWYrSvnH.js"),__vite__mapDeps([262,1,2,55,20,21,4,24,23])))),Hatching$3=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Hatching-CKVP0ju2.js"),__vite__mapDeps([250,1,2,55,110,32,23,4,35,106,15,16,38,39,34,36,37,12,13,14,64,107,41,33,68,45,69,70,71,30,52,46,42,43,44,111,112,113,49])))),VisorStatics$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VisorStatics-RjLo9w8U.js"),__vite__mapDeps([177,1,2,178,4,179,14,112,32,23,21,22,20,55,42,43,44,36,169,30,180,120,113,49])))),commerceRouting=[{path:[ROUTE_COMMERCE_REQUESTS],Page:Commerce$1,exact:!1,props:{}},{path:[ROUTE_COMMERCE_ROUTE_MANAGE_GUILDS,ROUTE_COMMERCE_ROUTE_GUILDS,ROUTE_COMMERCE_ROUTE_STEWARDS,ROUTE_COMMERCE_ROUTE_GUILDS_SETTINGS],Page:Guilds$3,exact:!1,props:{}},{path:[ROUTE_COMMERCE_ROUTE_FILES_STATE],Page:FilesState$6,exact:!1,props:{}},{path:[ROUTE_COMMERCE_ROUTE_ALLOCATIONS],Page:VetFarmAllocations$6,exact:!1,props:{}},{path:[ROUTE_COMMERCE_STATICS],Page:Statics$4,exact:!1,props:{}},{path:[ROUTE_COMMERCE_HATCHING],Page:Hatching$3,exact:!1,props:{}},{path:[ROUTE_COMMERCE_VISOR_STATICS,ROUTE_COMMERCE_VISOR_STATICS_PREDICTION,ROUTE_COMMERCE_VISOR_STATICS_PREDICTION_VIEW,ROUTE_COMMERCE_VISOR_STATICS_CHARTS],Page:VisorStatics$1,exact:!1,props:{}}],Guilds$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Guilds-CrGG7yyR.js"),__vite__mapDeps([86,1,2,55,20,21,4,25,23,87,22,32,46,45,42,43,44,5,51,14,71,88,89,90,8,91,92,93,38,37,33,94,12,13,15,16,95,96])))),FilesState$5=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./FilesState-DMM_jfCL.js"),__vite__mapDeps([153,1,2,4,154,32,23,42,43,44,155,156])))),VetFarmAllocations$5=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VetFarmAllocations-COn5OrGn.js"),__vite__mapDeps([123,1,2,124,5,74,46,4,125,48,12,13,14,15,16,23,32,126,42,43,44,127,102,103,115,111,112,128,41,129,45,130,131,36,69,70,71,30,47,33,72,73,40,132,67,79,133,121,134,135,136,65,66])))),cityCommerceRouting=[{path:[ROUTE_CITY_COMMERCE_ROUTE_MANAGE_GUILDS,ROUTE_CITY_COMMERCE_ROUTE_GUILDS,ROUTE_CITY_COMMERCE_ROUTE_STEWARDS,ROUTE_CITY_COMMERCE_ROUTE_GUILDS_SETTINGS],Page:Guilds$2,exact:!1,props:{}},{path:[ROUTE_CITY_COMMERCE_ROUTE_FILES_STATE],Page:FilesState$5,exact:!1,props:{}},{path:[ROUTE_CITY_COMMERCE_ROUTE_ALLOCATIONS],Page:VetFarmAllocations$5,exact:!1,props:{}}],FilesState$4=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./FilesState-DMM_jfCL.js"),__vite__mapDeps([153,1,2,4,154,32,23,42,43,44,155,156])))),StewardInventoryPage$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./StewardInventoryPage-CK0n2VdV.js"),__vite__mapDeps([263,1,2,55,4,22,23,21,20,42,43,44,164,15,35,71,16,235,100,36,101,102,103,104,33,45,79,133,32,187,170,232,186,111,112,14,67,121,48,46,74,188,88])))),VetFarmAllocations$4=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VetFarmAllocations-COn5OrGn.js"),__vite__mapDeps([123,1,2,124,5,74,46,4,125,48,12,13,14,15,16,23,32,126,42,43,44,127,102,103,115,111,112,128,41,129,45,130,131,36,69,70,71,30,47,33,72,73,40,132,67,79,133,121,134,135,136,65,66])))),Hatching$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Hatching-CKVP0ju2.js"),__vite__mapDeps([250,1,2,55,110,32,23,4,35,106,15,16,38,39,34,36,37,12,13,14,64,107,41,33,68,45,69,70,71,30,52,46,42,43,44,111,112,113,49])))),VetFarm=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VetFarm-DwS6N0cZ.js"),__vite__mapDeps([248,1,2,4,42,43,44,102,103,16,133,5,45,32,23])))),cityVetRouting=[{path:[ROUTE_CITYVET_HATCHING],Page:Hatching$2,exact:!1,props:{}},{path:[ROUTE_CITYVET_REGISTER_INFO],Page:VetFarm,exact:!1,props:{}},{path:[ROUTE_JAHAD_FILES_STATE],Page:FilesState$4,exact:!1,props:{}},{path:[ROUTE_STEWARD_INVENTORY,ROUTE_STEWARD_SALE_IN_PROVINCE,ROUTE_STEWARD_INVENTORY_STOCK,ROUTE_STEWARD_SALE_OUT_PROVINCE,ROUTE_STEWARD_PURCHASE_OUT_PROVINCE,ROUTE_STEWARD_SEGMENT],Page:StewardInventoryPage$1,exact:!1,props:{}},{path:[ROUTE_CITYVET_ROUTE_ALLOCATIONS],Page:VetFarmAllocations$4,exact:!1,props:{}}],Statics$3=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminStatics-XraSRt5m.js"),__vite__mapDeps([206,1,2,4,179,203,32,23,195,178,112])))),FilesState$3=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./FilesState-DMM_jfCL.js"),__vite__mapDeps([153,1,2,4,154,32,23,42,43,44,155,156])))),VetFarmAllocations$3=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VetFarmAllocations-COn5OrGn.js"),__vite__mapDeps([123,1,2,124,5,74,46,4,125,48,12,13,14,15,16,23,32,126,42,43,44,127,102,103,115,111,112,128,41,129,45,130,131,36,69,70,71,30,47,33,72,73,40,132,67,79,133,121,134,135,136,65,66])))),Dispensers$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterHouseDispenserDashboard-JLw8VA3Q.js"),__vite__mapDeps([182,1,2,20,21,4,22,23,24,55,42,43,44,183,40,45,46,32,5,184,185,113,49,79,80,101,36,111,112,14,186,121,48,74,187,188,16])))),AllHatchings$3=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminHatchings-CjLz-abB.js"),__vite__mapDeps([189,1,2,109,4,110,32,23,35,106,15,16,38,39,34,36,37,12,13,14,64,107,41,33,68,45,69,70,71,30,52,46,42,43,44,111,112,113,49,114,102,103,115,27,116,117,121,48,74,55,173])))),cityJihadRouting=[{path:[ROUTE_CITY_JIHAD_STATICS],Page:Statics$3,exact:!1,props:{}},{path:[ROUTE_CITY_JIHAD_ROUTE_FILES_STATE],Page:FilesState$3,exact:!1,props:{}},{path:[ROUTE_CITY_JIHAD_ROUTE_ALLOCATIONS],Page:VetFarmAllocations$3,exact:!1,props:{}},{path:[ROUTE_CITY_JIHAD_DISPENSERS,ROUTE_CITY_JIHAD_DISPENSERS_MANAGEMENT,ROUTE_CITY_JIHAD_DISPENSER_DETAILS_VIEW,ROUTE_CITY_JIHAD_DISPENSER_DETAILS_VIEW,ROUTE_CITY_JIHAD_DISPENSERS_STEWARDS,ROUTE_CITY_JIHAD_DISPENSERS_KILLHOUSES,ROUTE_CITY_JIHAD_DISPENSER_DETAILS_VIEW,ROUTE_CITY_JIHAD_DISPENSERS_SELL_CARCASS,ROUTE_CITY_JIHAD_DISPENSERS_INVENTORY,ROUTE_CITY_JIHAD_SALE_DESTRIBUTION_DETAILS],Page:Dispensers$1,exact:!1,props:{}},{path:[ROUTE_CITY_JIHADـHATCHINGS,ROUTE_CITY_JIHAD_HATCHINGS_DETAILS],Page:AllHatchings$3,exact:!1,props:{}}],Statics$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminStatics-XraSRt5m.js"),__vite__mapDeps([206,1,2,4,179,203,32,23,195,178,112])))),VisorStatics=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VisorStatics-RjLo9w8U.js"),__vite__mapDeps([177,1,2,178,4,179,14,112,32,23,21,22,20,55,42,43,44,36,169,30,180,120,113,49])))),observatoryRouting=[{path:[ROUTE_OBSERVATORY_STATICS],Page:Statics$2,exact:!1,props:{}},{path:[ROUTE_OBSERVATORY_VISOR_STATICS,ROUTE_OBSERVATORY_VISOR_STATICS_PREDICTION,ROUTE_OBSERVATORY_VISOR_STATICS_PREDICTION_VIEW,ROUTE_OBSERVATORY_VISOR_STATICS_CHARTS],Page:VisorStatics,exact:!1,props:{}}],Dispensers=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterHouseDispenserDashboard-JLw8VA3Q.js"),__vite__mapDeps([182,1,2,20,21,4,22,23,24,55,42,43,44,183,40,45,46,32,5,184,185,113,49,79,80,101,36,111,112,14,186,121,48,74,187,188,16])))),Guilds$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Guilds-CrGG7yyR.js"),__vite__mapDeps([86,1,2,55,20,21,4,25,23,87,22,32,46,45,42,43,44,5,51,14,71,88,89,90,8,91,92,93,38,37,33,94,12,13,15,16,95,96])))),FilesState$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./FilesState-DMM_jfCL.js"),__vite__mapDeps([153,1,2,4,154,32,23,42,43,44,155,156])))),VetFarmAllocations$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VetFarmAllocations-COn5OrGn.js"),__vite__mapDeps([123,1,2,124,5,74,46,4,125,48,12,13,14,15,16,23,32,126,42,43,44,127,102,103,115,111,112,128,41,129,45,130,131,36,69,70,71,30,47,33,72,73,40,132,67,79,133,121,134,135,136,65,66])))),Statics$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminStatics-XraSRt5m.js"),__vite__mapDeps([206,1,2,4,179,203,32,23,195,178,112])))),Commerce=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Commerce-DWYrSvnH.js"),__vite__mapDeps([262,1,2,55,20,21,4,24,23])))),Hatching$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Hatching-CKVP0ju2.js"),__vite__mapDeps([250,1,2,55,110,32,23,4,35,106,15,16,38,39,34,36,37,12,13,14,64,107,41,33,68,45,69,70,71,30,52,46,42,43,44,111,112,113,49])))),Reports=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceReports-B30xgkxd.js"),__vite__mapDeps([172,1,2,55,4,32,23,173])))),OperatorHatching=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./OperatorNewHatching-Dh3A7QxF.js"),__vite__mapDeps([105,1,2,4,106,15,16,35,38,39,34,36,37,12,13,14,64,107,41,33,56,32,23,57,45,28,46,58,42,43,44,108,109,110,68,69,70,71,30,52,111,112,113,49,114,102,103,115,27,116,117,118,85,55,119,120,5,121,48,74])))),AllHatchings$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminHatchings-CjLz-abB.js"),__vite__mapDeps([189,1,2,109,4,110,32,23,35,106,15,16,38,39,34,36,37,12,13,14,64,107,41,33,68,45,69,70,71,30,52,46,42,43,44,111,112,113,49,114,102,103,115,27,116,117,121,48,74,55,173])))),DashboardPage=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./DashboardPage-CBj16f8q.js"),__vite__mapDeps([194,1,2,4,179,195,42,43,44,32,23,185,113,49,173,12,13,14,15,16,180,164])))),ProvinceManagePricing=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceManagePricing-C6sFsNo-.js"),__vite__mapDeps([75,1,2,4,36,76,42,43,44,46,45])))),NationalInfo=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./NationalInfo-DSCN5jIW.js"),__vite__mapDeps([122,1,2,119,4,32,23,42,43,44,120,45,112,113,49,5,121,48,46,74,15])))),ProvinceDispensersStockSlug=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceDispensersStockSlug-DxEHlpI2.js"),__vite__mapDeps([216,1,2,55,4,42,43,44,102,103,16,115,15])))),DispensersStock=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceDispensersStock-BetLU9Ax.js"),__vite__mapDeps([214,1,2,20,21,4,55,22,23,24,215])))),TransactionsPage$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Transactions-BSJVJOEU.js"),__vite__mapDeps([174,1,2,4,32,23,42,43,44,113,49,130,55,175])))),provinceSupervisorRouting=[{path:[ROUTE_PROVINCE_SUPERVISOR_REQUESTS],Page:Commerce,exact:!1,props:{}},{path:[ROUTE_PROVINCE_SUPERVISOR_ROUTE_MANAGE_GUILDS,ROUTE_PROVINCE_SUPERVISOR_ROUTE_GUILDS,ROUTE_PROVINCE_SUPERVISOR_ROUTE_STEWARDS,ROUTE_PROVINCE_SUPERVISOR_ROUTE_GUILDS_SETTINGS],Page:Guilds$1,exact:!1,props:{}},{path:[ROUTE_PROVINCE_SUPERVISOR_PRICING],Page:ProvinceManagePricing,exact:!1,props:{}},{path:[ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_DETAILS,ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_FARM,ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_FARM_DETAILS],Page:OperatorHatching,exact:!1,props:{}},{path:[ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO,ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_HATCHING_DETAILS,ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_SLAUGHTER,ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_SLAUGHTER_DETAILS],Page:NationalInfo,exact:!1,props:{}},{path:[ROUTE_PROVINCE_SUPERVISOR_ROUTE_FILES_STATE],Page:FilesState$2,exact:!1,props:{}},{path:[ROUTE_PROVINCE_SUPERVISOR_ROUTE_ALLOCATIONS],Page:VetFarmAllocations$2,exact:!1,props:{}},{path:[ROUTE_PROVINCE_SUPERVISOR_STATICS,ROUTE_PROVINCE_SUPERVISOR_STATICS_PREDICTION,ROUTE_PROVINCE_SUPERVISOR_STATICS_PREDICTION_VIEW,ROUTE_PROVINCE_SUPERVISOR_STATICS_CHARTS],Page:Statics$1,exact:!1,props:{}},{path:[ROUTE_PROVINCE_SUPERVISOR_HATCHING],Page:Hatching$1,exact:!1,props:{}},{path:[ROUTE_PROVINCE_SUPERVISOR_REPORTING],Page:Reports,exact:!1,props:{}},{path:[ROUTE_PROVINCE_SUPERVISORـHATCHINGS,ROUTE_PROVINCE_SUPERVISORـHATCHINGS_DETAILS],Page:AllHatchings$2,exact:!1,props:{}},{path:[ROUTE_PROVINCE_SUPERVISOR_DASHBOARD],Page:DashboardPage,exact:!1,props:{}},{path:[ROUTE_PROVINCE_SUPERVISOR_DISPENSERS,ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_MANAGEMENT,ROUTE_PROVINCE_SUPERVISOR_DISPENSER_DETAILS_VIEW,ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STEWARDS,ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_KILLHOUSES,ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_SELL_CARCASS,ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_INVENTORY,ROUTE_PROVINCE_SUPERVISOR_SALE_DESTRIBUTION_DETAILS,ROUTE_PROVINCE_SUPERVISOR_REQUEST_DISTRIBUTION],Page:Dispensers,exact:!1,props:{}},{path:[ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK],Page:DispensersStock,exact:!1,props:{}},{path:[ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK_KILLHOUSE,ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK_STEWARD,ROUTE_PROVINCE_SUPERVISOR_DISPENSERS_STOCK_GUILD],Page:ProvinceDispensersStockSlug,exact:!1,props:{}},{path:[ROUTE_PROVINCE_SUPERVISOR_REQUEST_TRANSACTIONS],Page:TransactionsPage$1,exact:!1,props:{}}],SenfInventoryPage$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SenfInventoryPage-BGQA4pLz.js"),__vite__mapDeps([264,1,2,55,22,23,21,4,20,12,13,14,15,16,27,232])))),senfRouting=[{path:[ROUTE_SENF_INVENTORY,ROUTE_SENF_INVENTORY_STOCK],Page:SenfInventoryPage$1,exact:!1,props:{}}],versionNumber="data:text/plain;base64,Ni45Ng==",ManageGuilds$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Guilds-CrGG7yyR.js"),__vite__mapDeps([86,1,2,55,20,21,4,25,23,87,22,32,46,45,42,43,44,5,51,14,71,88,89,90,8,91,92,93,38,37,33,94,12,13,15,16,95,96])))),guildRoomRouting=[{path:[ROUTE_GUILD_ROOM_ROUTE_MANAGE_GUILDS,ROUTE_GUILD_ROOM_ROUTE_GUILDS_REQUESTS,ROUTE_GUILD_ROOM_ROUTE_GUILDS,ROUTE_GUILD_ROOM_ROUTE_STEWARDS],Page:ManageGuilds$1,exact:!1,props:{}}],Stewards=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./PspCompany-DFqxFNI1.js"),__vite__mapDeps([219,1,2,55,20,21,4,24,23,32,42,43,44,89,90,8,91,92,93,71,38,37,33,45,46,27,13,14,15,16,12,164,30,35,95])))),posCompanyRouting=[{path:[ROUTE_PSP_ROUTE_COMPANY_MANAGE_STEWARDS,ROUTE_PSP_COMPANY_ROUTE_GUILDS,ROUTE_PSP_COMPANY_ROUTE_ACTIVE_SESSION,ROUTE_PSP_COMPANY_ROUTE_DEVICES],Page:Stewards,exact:!1,props:{}}],Bars=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./LiveStockSupportManageBars-DPW4OFsD.js"),__vite__mapDeps([265,1,2,124,5,74,46,4,125,48,12,13,14,15,16,23,32,126,42,43,44,127,102,103,115,111,112,128,41,129,45,130,131,36,69,70,71,30,47,33,72,73,40,132,67,79,133,121,134,135,136,65,66])))),Cases=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./LiveStockSupportCases-AKSvycFW.js"),__vite__mapDeps([266,1,2,154,32,23,4,42,43,44,155])))),Freezing=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./LiveStockFreezingRequests-DG4F8ICf.js"),__vite__mapDeps([267,1,2,4,42,43,44,45,99])))),ColdHouse=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./LiveStockColdHouse-BgWIbVgg.js"),__vite__mapDeps([268,1,2,4,12,13,14,15,16])))),liveStockSupportRouting=[{path:[ROUTE_LIVE_STOCK_SUPPORT_MANAGE_BARS],Page:Bars,exact:!1,props:{}},{path:[ROUTE_LIVE_STOCK_SUPPORT_ROUTE_FILES_STATE],Page:Cases,exact:!1,props:{}},{path:[ROUTE_LIVE_STOCK_FREEZING_REQUESTS],Page:Freezing,exact:!1,props:{}},{path:[ROUTE_LIVE_STOCK_COLD_HOUSE],Page:ColdHouse,exact:!1,props:{}}],Poultries=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ChainCompany-B42vuLDw.js"),__vite__mapDeps([269,1,2,4,32,23,139,44,72,42,43,46,73,45,16,40,48,74])))),Fees=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceFees-UfT7wk-6.js"),__vite__mapDeps([167,1,2,55,4,42,43,44,113,49,46,168,10,11,32,23,111,112,14,115,102,103,16,45,117,13,15,169,142,12,170,5,139])))),PoultriesDetails=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./PoultriesDetailsPage-Bu9GJg8X.js"),__vite__mapDeps([217,1,2,4,113,49,15,42,43,44,121,48,46,74,55])))),chainCompanyRouting=[{path:[ROUTE_CHAIN_COMPANY_POULTRIES,ROUTE_CHAIN_COMPANY_MANAGE_BARS],Page:Poultries,exact:!1,props:{}},{path:[ROUTE_CHAIN_COMPANY_MANAGE_FEES],Page:Fees,exact:!1,props:{}},{path:[ROUTE_CHAIN_COMPANY_POULTRIES_DETAILS],Page:PoultriesDetails,exact:!1,props:{}}],VetFarmAllocations$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VetFarmAllocations-COn5OrGn.js"),__vite__mapDeps([123,1,2,124,5,74,46,4,125,48,12,13,14,15,16,23,32,126,42,43,44,127,102,103,115,111,112,128,41,129,45,130,131,36,69,70,71,30,47,33,72,73,40,132,67,79,133,121,134,135,136,65,66])))),AllHatchings$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminHatchings-CjLz-abB.js"),__vite__mapDeps([189,1,2,109,4,110,32,23,35,106,15,16,38,39,34,36,37,12,13,14,64,107,41,33,68,45,69,70,71,30,52,46,42,43,44,111,112,113,49,114,102,103,115,27,116,117,121,48,74,55,173])))),supporterRouting=[{path:[ROUTE_SUPPORTER_ROUTE_ALLOCATIONS],Page:VetFarmAllocations$1,exact:!1,props:{}},{path:[ROUTE_SUPPORTERـHATCHINGS,ROUTE_SUPPORTERـHATCHINGS_DETAILS],Page:AllHatchings$1,exact:!1,props:{}}],Dashboard=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./DispenserDashboard-B53mNsdU.js"),__vite__mapDeps([270,1,2])))),dispenserRouting=[{path:[ROUTE_DISPENSER_DASHBOARD],Page:Dashboard,exact:!1,props:{}}],Statics=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminStatics-XraSRt5m.js"),__vite__mapDeps([206,1,2,4,179,203,32,23,195,178,112])))),FilesState$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./FilesState-DMM_jfCL.js"),__vite__mapDeps([153,1,2,4,154,32,23,42,43,44,155,156])))),VetFarmAllocations=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./VetFarmAllocations-COn5OrGn.js"),__vite__mapDeps([123,1,2,124,5,74,46,4,125,48,12,13,14,15,16,23,32,126,42,43,44,127,102,103,115,111,112,128,41,129,45,130,131,36,69,70,71,30,47,33,72,73,40,132,67,79,133,121,134,135,136,65,66])))),Guilds=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Guilds-CrGG7yyR.js"),__vite__mapDeps([86,1,2,55,20,21,4,25,23,87,22,32,46,45,42,43,44,5,51,14,71,88,89,90,8,91,92,93,38,37,33,94,12,13,15,16,95,96])))),Hatching=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./OperatorNewHatching-Dh3A7QxF.js"),__vite__mapDeps([105,1,2,4,106,15,16,35,38,39,34,36,37,12,13,14,64,107,41,33,56,32,23,57,45,28,46,58,42,43,44,108,109,110,68,69,70,71,30,52,111,112,113,49,114,102,103,115,27,116,117,118,85,55,119,120,5,121,48,74])))),AllHatchings=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./AdminHatchings-CjLz-abB.js"),__vite__mapDeps([189,1,2,109,4,110,32,23,35,106,15,16,38,39,34,36,37,12,13,14,64,107,41,33,68,45,69,70,71,30,52,46,42,43,44,111,112,113,49,114,102,103,115,27,116,117,121,48,74,55,173])))),TransactionsPage=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./Transactions-BSJVJOEU.js"),__vite__mapDeps([174,1,2,4,32,23,42,43,44,113,49,130,55,175])))),SlaughterHouseDispenserDashboard=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterHouseDispenserDashboard-JLw8VA3Q.js"),__vite__mapDeps([182,1,2,20,21,4,22,23,24,55,42,43,44,183,40,45,46,32,5,184,185,113,49,79,80,101,36,111,112,14,186,121,48,74,187,188,16])))),cityPoultryRouting=[{path:[ROUTE_CITY_POULTRY_STATICS],Page:Statics,exact:!1,props:{}},{path:[ROUTE_CITY_POULTRY_ROUTE_FILES_STATE],Page:FilesState$1,exact:!1,props:{}},{path:[ROUTE_CITY_POULTRY_ROUTE_ALLOCATIONS],Page:VetFarmAllocations,exact:!1,props:{}},{path:[ROUTE_CITY_POULTRY_ROUTE_MANAGE_GUILDS,ROUTE_CITY_POULTRY_ROUTE_GUILDS,ROUTE_CITY_POULTRY_ROUTE_STEWARDS,ROUTE_CITY_POULTRY_ROUTE_GUILDS_SETTINGS],Page:Guilds,exact:!1,props:{}},{path:[ROUTE_CITY_POULTRY_HATCHING],Page:Hatching,exact:!1,props:{}},{path:[ROUTE_CITY_POULTRYـHATCHINGS,ROUTE_CITY_POULTRYـHATCHINGS_DETAILS],Page:AllHatchings,exact:!1,props:{}},{path:[ROUTE_CITY_REQUEST_TRANSACTIONS],Page:TransactionsPage,exact:!1,props:{}},{path:[ROUTE_CITY_DISPENSERS_INVENTORY],Page:SlaughterHouseDispenserDashboard,exact:!1,props:{}},{path:[ROUTE_CITY_REQUEST_DISTRIBUTION],Page:SlaughterHouseDispenserDashboard,exact:!1,props:{}},{path:[ROUTE_CITY_DISPENSERS],Page:SlaughterHouseDispenserDashboard,exact:!1,props:{}},{path:[ROUTE_CITY_REQUEST_TRANSACTION_DETAILS],Page:TransactionsPage,exact:!1,props:{}}],arrow="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAABgCAYAAACucnrAAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAQESURBVHgB5Zy7UZtBEID30AOYIaAEQofQAeoAKrAIHWFXYFGBcQWIzJnJ7My4AtOBKYGAGdADnXcPCcRYSL929+72xJfAjOUZvtn/dZ9OclAYfjDYB+9/gYA1KAh/e7uLwt9BxlEx0kG42aQJbwMX709cs9l1UAD+7m4HajUS3gEuJLy+3qFfzUtrCxOmpWMIE2alYwkTJqW999swGPwBmfA5Crdn/ZO5q/dYWDrhV4UJU5OeEt4FPld4W9qb9wJbkx4MvoBQGBqN1qIXmZm07/fP8Ecb+ARh59zNoheamLR/nHAb+FzDw8NhFWEiuzQKf8aT+SPwIeGW29y8rvofsh7eY+EO8FlamMgmnUuYyCKtIHyDwnscYSL5OY1X6WOxcL/f4goTSSfth8P3MBp1gc+j8NbWFQioQSJ8r3eAP76BjA844Z8gJMmkVaoHZh6qHqBA9HNaRXg0+qQlTNQhIuM1MYU8Wdfa2DgFRaId3jEjgJQo0paFCXVp68KEqrSS8NzqoYHafTpUD+9/4K/vgEsCYUJl0iqZx7kL12gcQgJ07tPDIVUPWeap148gEWLpkHm8PwA+lTOPFiLp1JlHC7Z0jsyjBetClrN6aLC0dOnCxFLSqyBMVJYOmQdAstpRqR4aVJK2knm0WCgdMo9zss0t3h/i4+UFGGHuLStUD+fOQMaRJWHiVWmLmUeLmbnIaubR4r9zuoQIIOWF9FsQJl5K9/t/YcWFiacLGU65DRJhgK8lCBNPk8Yp0xYmXghIlHm0mJb2wCFh5tFCnouojxXGtPQl8Ngf7wwqhmdp738Dn3ZJ4s/ntMZ+TOc6eH6fgHGeJh3iHC7wgRb6XDAwhNBgnDiPocYnPnM9PRanQ51/ZTYsPvOWFRoWlg6g4sGFDvX7e0kijsbccqKypl5ba7t6/RwMMffhJDQt72XvMWFbC43NENXCIC1GajXJfbisMDhhlcQrP3vjxa1L62Xgs03Xh3BnyMxSC46wXpaK4zNAbnHeG3i9Xgfvw5Inr7LewJtQsrhozwmKd1FccjvKIi6KCCERYSoCPqGv+8QhQmd3kXziSfed2NlSheUG3wJqQQJUtlSFCT1+8k3y4JEsO+luk9SoLwBdnHjUPWWqm9xV6gv1tsj1RXXSE6zXlyjShGXxaNKEVfGo0oTajgbFN/ijSxPWslMSaQIP9f3xoc5HSTzZZy1xUXGJtzNpbzsNR430b4HEWMhOyT9VayE7Zfl6gNzZKfnhPU2u+pJVmsghnl2awCUlPXgcA5+lxE1IEynrixlpIpX4Kn5h08LsZOoLm1JlJ1OTnhA7O5n8Cs3Y2cnkpCfEihCmpYkY4ualCW3xIqQJzexUjDShlp2gMDSy0z+Q2qP+0RRLDgAAAABJRU5ErkJggg==",SiteMap=()=>{var o,u,l,c,_,p,d,E,R,y;const{pathname:e}=useLocation(),t=useNavigate(),{subMenuText:a,mediatorText:s}=useSelector(I=>I.userSlice),n=!((o=getRoleItems(getRoleFromUrl()))!=null&&o.find(I=>I.route===e))&&!((u=getLiveStockItems(getRoleFromUrl()))!=null&&u.find(I=>I.route===e)),i=((c=(l=getRoleItems(getRoleFromUrl()))==null?void 0:l.find(I=>I.route===s))==null?void 0:c.text)||((p=(_=getLiveStockItems(getRoleFromUrl()))==null?void 0:_.find(I=>I.route===s))==null?void 0:p.text);return jsxRuntimeExports.jsx(Grid,{container:!0,xs:12,sx:{justifyContent:{xs:"start",sm:"center"}},px:2,mt:1,children:jsxRuntimeExports.jsx(Grid,{container:!0,xs:10,justifyContent:"start",alignItems:"center",style:{color:"gray",userSelect:"none"},children:jsxRuntimeExports.jsxs(Grid,{container:!0,justifyContent:"start",alignItems:"center",gap:1,style:{color:"gray",userSelect:"none",background:"#E4E4E4",paddingInline:"10px",borderRadius:"5px"},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",onClick:()=>t("/"),sx:{cursor:"pointer"},children:getFaUserRole(getRoleFromUrl())}),jsxRuntimeExports.jsx("img",{alt:"arrow",src:arrow,style:{width:"20px"}}),n&&i&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",onClick:()=>t(-1),style:{cursor:"pointer"},children:i}),jsxRuntimeExports.jsx("img",{alt:"arrow",src:arrow,style:{width:"20px"}})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",children:/\d/.test(e)?"نمایش":((E=(d=getRoleItems(getRoleFromUrl()))==null?void 0:d.find(I=>I.route===e))==null?void 0:E.text)||((y=(R=getLiveStockItems(getRoleFromUrl()))==null?void 0:R.find(I=>I.route===e))==null?void 0:y.text)||a})]})})})},ParentCompanyRequests=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ParentCompany-BF1TX0KI.js"),__vite__mapDeps([271,1,2,55,168,10,11,4,32,23,46,111,112,14,115,102,103,16,45,42,43,44,125,48,74,12,13,15,128,72,73,40,169,135,139,47,33])))),parentCompanyRouting=[{path:[ROUTE_PARENT_COMPANY_PAYING_FEES_VIEW,ROUTE_PARENT_COMPANY_PAYING_FEES_REQUESTS,ROUTE_PARENT_COMPANY_ALLOCATIONS],Page:ParentCompanyRequests,exact:!1,props:{}}],SlaughterMorguePage$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterMorgue-G6AVluZe.js"),__vite__mapDeps([236,1,2,42,43,44,4,32,23,45,101,100,36,102,103,16,104,33,55,5])))),coldHouseStewardRouting=[{path:[ROUTE_COLD_HOUSE_STEWARD_MORGUE],Page:SlaughterMorguePage$1,exact:!1,props:{}}],SenfInventoryPage=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SenfInventoryPage-BGQA4pLz.js"),__vite__mapDeps([264,1,2,55,22,23,21,4,20,12,13,14,15,16,27,232])))),cityGuildRouting=[{path:[ROUTE_SENF_INVENTORY,ROUTE_SENF_INVENTORY_STOCK],Page:SenfInventoryPage,exact:!1,props:{}}],RequestsPage$3=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceJahadRequests-zfkXqXU8.js"),__vite__mapDeps([272,1,2,32,23,42,43,44,4,45,46,16,83,12,13,14,15,35,20,21,22,55,36,113,49])))),liveStockProvinceJahadRouting=[{path:[ROUTE_PROVINCE_JAHAD_UNIONS,ROUTE_PROVINCE_JAHAD_COOPERATIVES,ROUTE_PROVINCE_JAHAD_RANCHERS,ROUTE_PROVINCE_JAHAD_HERDS,ROUTE_PROVINCE_JAHAD_USERS,ROUTE_PROVINCE_JAHAD_PRODUCT_DISTRIBUTION,ROUTE_PROVINCE_JAHAD_PRODUCT_DISTRIBUTION_ALLOCATION,ROUTE_PROVINCE_JAHAD_PRODUCT_DISTRIBUTION_POLICY,ROUTE_PROVINCE_JAHAD_PRODUCT_SHARES,ROUTE_PROVINCE_JAHAD_PRODUCT_TRANSACTIONS,ROUTE_PROVINCE_JAHAD_SELL_REPORT],Page:RequestsPage$3,exact:!1,props:{}}],RequestsPage$2=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceJahadRequests-zfkXqXU8.js"),__vite__mapDeps([272,1,2,32,23,42,43,44,4,45,46,16,83,12,13,14,15,35,20,21,22,55,36,113,49])))),unionRouting=[{path:[ROUTE_UNION_COOPERATIVES,ROUTE_UNION_RANCHERS,ROUTE_UNION_HERDS,ROUTE_UNION_USERS,ROUTE_UNION_PRODUCT_DISTRIBUTION,ROUTE_UNION_PRODUCT_DISTRIBUTION_ALLOCATION,ROUTE_UNION_PRODUCT_DISTRIBUTION_POLICY,ROUTE_UNION_PRODUCT_TRANSACTIONS,ROUTE_UNION_SELL_REPORT],Page:RequestsPage$2,exact:!1,props:{}}],RequestsPage$1=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceJahadRequests-zfkXqXU8.js"),__vite__mapDeps([272,1,2,32,23,42,43,44,4,45,46,16,83,12,13,14,15,35,20,21,22,55,36,113,49])))),cooperativeRouting=[{path:[ROUTE_COOPERATIVE_RANCHERS,ROUTE_COOPERATIVE_HERDS,ROUTE_COOPERATIVE_USERS,ROUTE_COOPERATIVE_PRODUCT_DISTRIBUTION,ROUTE_COOPERATIVE_PRODUCT_DISTRIBUTION_ALLOCATION,ROUTE_COOPERATIVE_PRODUCT_DISTRIBUTION_POLICY,ROUTE_COOPERATIVE_PRODUCT_TRANSACTIONS],Page:RequestsPage$1,exact:!1,props:{}}],RequestsPage=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./ProvinceJahadRequests-zfkXqXU8.js"),__vite__mapDeps([272,1,2,32,23,42,43,44,4,45,46,16,83,12,13,14,15,35,20,21,22,55,36,113,49])))),rancherRouting=[{path:[ROUTE_COOPERATIVE_RANCHERS,ROUTE_COOPERATIVE_HERDS,ROUTE_COOPERATIVE_USERS,ROUTE_COOPERATIVE_PRODUCT_DISTRIBUTION,ROUTE_COOPERATIVE_PRODUCT_DISTRIBUTION_ALLOCATION,ROUTE_COOPERATIVE_PRODUCT_DISTRIBUTION_POLICY],Page:RequestsPage,exact:!1,props:{}}],SlaughterMorguePage=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./BarSquareTransactions-DgqWT2Jp.js"),__vite__mapDeps([273,1,2,55,42,43,44,4])))),barSquareRouting=[{path:[ROUTE_BAR_SQUARE_TRANSACTIONS],Page:SlaughterMorguePage,exact:!1,props:{}}],FilesState=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./FilesState-DMM_jfCL.js"),__vite__mapDeps([153,1,2,4,154,32,23,42,43,44,155,156])))),StewardInventoryPage=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./StewardInventoryPage-CK0n2VdV.js"),__vite__mapDeps([263,1,2,55,4,22,23,21,20,42,43,44,164,15,35,71,16,235,100,36,101,102,103,104,33,45,79,133,32,187,170,232,186,111,112,14,67,121,48,46,74,188,88])))),ManageGuilds=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./GuildManageGuildsPage-D2fbeDME.js"),__vite__mapDeps([274,1,2,32,23,4,94,46,89,90,8,91,92,93,71,38,37,33,5,88,45,139,44])))),ManageDispensers=reactExports.lazy(()=>lazyRetry(()=>__vitePreload(()=>import("./SlaughterManageDispensers-CeviUzsS.js"),__vite__mapDeps([242,1,2,4,55,90,91,93,183,42,43,44,32,23])))),stewardRouting=[{path:[ROUTE_JAHAD_FILES_STATE],Page:FilesState,exact:!1,props:{}},{path:[ROUTE_STEWARD_MANAGE_GUILDS],Page:ManageGuilds,exact:!1,props:{}},{path:[ROUTE_STEWARD_INVENTORY,ROUTE_STEWARD_SALE_IN_PROVINCE,ROUTE_STEWARD_INVENTORY_STOCK,ROUTE_STEWARD_PURCHASE_OUT_PROVINCE,ROUTE_STEWARD_SALE_OUT_PROVINCE,ROUTE_STEWARD_DAILY_LIST,ROUTE_STEWARD_SEGMENT],Page:StewardInventoryPage,exact:!1,props:{}},{path:[ROUTE_STEWARD_ROUTE_MANAGE_DISPENSERS],Page:ManageDispensers,exact:!1,props:{}}],AppRouter=()=>{const e=useSelector(n=>n.userSlice.authToken),t=useSelector(n=>n.userSlice.role);let a=[...guestRouting],s="/";if(e){a=[...generalRouting,...barSquareRouting];for(const n in t)if(Object.hasOwnProperty.call(t,n))switch(t[n]){case"Admin":a=[...a,...adminRouting,...inspectorRouting];break;case"Poultry":a=[...a,...avicultureRouting];break;case"CityOperator":a=[...a,...cityRouting];break;case"KillHouse":a=[...a,...slaughterRouting];break;case"ProvinceOperator":a=[...a,...getManagerRouting("provinceOperator")];break;case"ProvinceFinancial":a=[...a,...provinceFinancialRouting];break;case"ProvinceInspector":a=[...a,...inspectorRouting];break;case"KillHouseVet":a=[...a,...slaughterHouseVetRouting];break;case"VetFarm":a=[...a,...vetFarmRouting];break;case"Driver":a=[...a,...driverRouting];break;case"VetSupervisor":a=[...a,...vetSupervisorRouting];break;case"Jahad":a=[...a,...jahadRouting];break;case"Guilds":a=[...a,...senfRouting];break;case"Steward":a=[...a,...stewardRouting];break;case"Commerce":a=[...a,...commerceRouting];break;case"ProvinceSupervisor":a=[...a,...provinceSupervisorRouting];break;case"CityCommerce":a=[...a,...cityCommerceRouting];break;case"CityVet":a=[...a,...cityVetRouting];break;case"CityJahad":a=[...a,...cityJihadRouting];break;case"Observatory":a=[...a,...observatoryRouting];break;case"GuildRoom":a=[...a,...guildRoomRouting];break;case"PosCompany":a=[...a,...posCompanyRouting];break;case"LiveStockSupport":a=[...a,...liveStockSupportRouting];break;case"SuperAdmin":a=[...a,...getManagerRouting("SuperAdmin")];break;case"ChainCompany":a=[...a,...chainCompanyRouting];break;case"AdminX":a=[...a,...getManagerRouting("AdminX")];break;case"Supporter":a=[...a,...supporterRouting];break;case"Dispenser":a=[...a,...dispenserRouting];break;case"CityPoultry":a=[...a,...cityPoultryRouting];break;case"ParentCompany":a=[...a,...parentCompanyRouting];break;case"ColdHouseSteward":a=[...a,...coldHouseStewardRouting];break;case"cityGuildRouting":a=[...a,...cityGuildRouting];break;case"LiveStockProvinceJahad":a=[...a,...liveStockProvinceJahadRouting];break;case"Union":a=[...a,...unionRouting];break;case"Cooperative":a=[...a,...cooperativeRouting];break;case"Rancher":a=[...a,...rancherRouting];break}}return jsxRuntimeExports.jsxs(Routes,{children:[a==null?void 0:a.map(n=>{const{exact:i,Page:o,props:u}=n;return n.path.map(l=>jsxRuntimeExports.jsx(Route,{exact:i,path:l,element:jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(Fallback,{}),children:jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(o,{...u})})})},l))}),jsxRuntimeExports.jsx(Route,{path:"*",element:jsxRuntimeExports.jsx(Navigate,{to:s,replace:!0})})]})},cacheRtl=createCache({key:"muirtl",stylisPlugins:[prefixer,rtlPlugin]}),App=()=>{const e=useDispatch(),t=useSelector(d=>d.userSlice.authToken),{pathname:a}=useLocation(),{profile:s}=useSelector(d=>d.avicultureSlice),[n,i]=reactExports.useState([]);reactExports.useEffect(()=>{if(_(!1),t&&s)for(const d of s.aviculture)d.numberOfHalls||(_(!0),i([{title:"NUMBER_OF_HALLS",data:{...d}}]))},[t,s]),reactExports.useEffect(()=>{(!t||s===null)&&_(!1)},[t,s]);const[o,u]=reactExports.useState(!1);reactExports.useEffect(()=>{u(t&&getRoleFromUrl())},[window.location.href,window.location.pathname,a]),reactExports.useEffect(()=>{window.location.search.includes("refresh")&&!window.location.search.includes("finalAmount")&&(window.location.href=window.location.pathname)},[]);const l=()=>{const E=`${window.location.href}?refresh=${new Date().getTime()}`;window.location.href=E};reactExports.useEffect(()=>{const d=`?v=${new Date().getTime()}`;fetch(`${versionNumber}${d}`).then(E=>E.text()).then(E=>{const R=E.toString(),y=localStorage.getItem("AppVersion");console.log("compare versions",R,y),(!y||y.toString()!==R.toString())&&(localStorage.setItem("AppVersion",R.toString()),"caches"in window&&(caches.keys().then(I=>{I.forEach(A=>{caches.delete(A)})}),l()))}).catch(E=>{console.error("Error:",E)})},[window.location.pathname]);const[c,_]=React.useState(!1),p=()=>_(!1);return jsxRuntimeExports.jsx(CacheProvider,{value:cacheRtl,children:jsxRuntimeExports.jsx(ThemeProvider,{theme,children:jsxRuntimeExports.jsx(LocalizationProvider,{dateAdapter:DateFnsJalaliUtils,children:jsxRuntimeExports.jsx(ErrorBoundary,{FallbackComponent:ErrorFallback,onReset:()=>{e(LOG_OUT())},children:jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(Fallback,{}),children:jsxRuntimeExports.jsxs(AppContextProvider,{children:[jsxRuntimeExports.jsxs("div",{className:"App",style:{},children:[jsxRuntimeExports.jsxs(SidebarContextProvider,{children:[t&&jsxRuntimeExports.jsx(Header,{}),o&&jsxRuntimeExports.jsx(SiteMap,{}),jsxRuntimeExports.jsx(BackDrop,{}),jsxRuntimeExports.jsx(Notif,{})]}),jsxRuntimeExports.jsx(AppRouter,{})]}),n.map((d,E)=>{var I,A,x;let R="";const y=jsxRuntimeExports.jsx(StrictMissingHallNumber,{avicultureKey:(I=d.data)==null?void 0:I.key,name:(A=d.data)==null?void 0:A.unitName,id:(x=d.data)==null?void 0:x.breedingUniqueId,handleClose:p});return d.title==="NUMBER_OF_HALLS"&&(R="ثبت تعداد سالن ها"),jsxRuntimeExports.jsx(StrictModal,{title:R,content:y,open:c},"modal"+E)}),jsxRuntimeExports.jsx(TemporaryDrawer,{}),jsxRuntimeExports.jsx(Modal,{}),jsxRuntimeExports.jsx(Loading,{})]})})})})})})};SetupAxios(axios$1);var define_process_env_default={};const isLocalhost=!!(window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function register(e){if("serviceWorker"in navigator){if(new URL(define_process_env_default.PUBLIC_URL,window.location.href).origin!==window.location.origin)return;window.addEventListener("load",()=>{const a=`${define_process_env_default.PUBLIC_URL}/service-worker.js`;isLocalhost?(checkValidServiceWorker(a),navigator.serviceWorker.ready.then(()=>{console.log("This web app is being served cache-first by a service worker. To learn more, visit https://cra.link/PWA")})):registerValidSW(a)})}}function registerValidSW(e,t){navigator.serviceWorker.register(e).then(a=>{a.onupdatefound=()=>{const s=a.installing;s!=null&&(s.onstatechange=()=>{s.state==="installed"&&(navigator.serviceWorker.controller?console.log("New content is available and will be used when all tabs for this page are closed. See https://cra.link/PWA."):console.log("Content is cached for offline use."))})}}).catch(a=>{console.error("Error during service worker registration:",a)})}function checkValidServiceWorker(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then(a=>{const s=a.headers.get("content-type");a.status===404||s!=null&&s.indexOf("javascript")===-1?navigator.serviceWorker.ready.then(n=>{n.unregister().then(()=>{window.location.reload()})}):registerValidSW(e)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}function _typeof(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof=function(a){return typeof a}:_typeof=function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var a=0;a{if(!Array.isArray(o)||typeof r!="number"||typeof e!="number")return!1;const t=o.find(n=>r>=n.fromAge&&r<=n.toAge);if(!t)return!1;const f=t.toWeight*1.2;return e>=t.fromWeight&&e<=f};export{i}; diff --git a/build/assets/killedInProvinceIcon1-B9sbsEGz.png b/build/assets/killedInProvinceIcon1-B9sbsEGz.png new file mode 100644 index 0000000..a6d4500 Binary files /dev/null and b/build/assets/killedInProvinceIcon1-B9sbsEGz.png differ diff --git a/build/assets/killedInProvinceIcon2-Swe8GaJ9.png b/build/assets/killedInProvinceIcon2-Swe8GaJ9.png new file mode 100644 index 0000000..60036cc Binary files /dev/null and b/build/assets/killedInProvinceIcon2-Swe8GaJ9.png differ diff --git a/build/assets/killedInProvinceIcon3-yCrbkLto.png b/build/assets/killedInProvinceIcon3-yCrbkLto.png new file mode 100644 index 0000000..58360f1 Binary files /dev/null and b/build/assets/killedInProvinceIcon3-yCrbkLto.png differ diff --git a/build/assets/lock-anbar-DjAoyX-H.svg b/build/assets/lock-anbar-DjAoyX-H.svg new file mode 100644 index 0000000..39bd5b5 --- /dev/null +++ b/build/assets/lock-anbar-DjAoyX-H.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/build/assets/login-logo-DUVGAcPT.png b/build/assets/login-logo-DUVGAcPT.png new file mode 100644 index 0000000..bc5d2ac Binary files /dev/null and b/build/assets/login-logo-DUVGAcPT.png differ diff --git a/build/assets/login-rasadyar-DKN6yNCU.png b/build/assets/login-rasadyar-DKN6yNCU.png new file mode 100644 index 0000000..093a5b3 Binary files /dev/null and b/build/assets/login-rasadyar-DKN6yNCU.png differ diff --git a/build/assets/logo-C6BrLS5z.png b/build/assets/logo-C6BrLS5z.png new file mode 100644 index 0000000..b2cae35 Binary files /dev/null and b/build/assets/logo-C6BrLS5z.png differ diff --git a/build/assets/mui-vendor-CkIVaoQP.js b/build/assets/mui-vendor-CkIVaoQP.js new file mode 100644 index 0000000..e6077a1 --- /dev/null +++ b/build/assets/mui-vendor-CkIVaoQP.js @@ -0,0 +1,203 @@ +import{r as p,g as yu,R as Ks,a as Ao,b as lo,c as jn,d as lf}from"./react-vendor-CmFgShSM.js";var xu={exports:{}},Ma={};/** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var cf=p,uf=Symbol.for("react.element"),df=Symbol.for("react.fragment"),pf=Object.prototype.hasOwnProperty,ff=cf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,mf={key:!0,ref:!0,__self:!0,__source:!0};function Cu(e,t,o){var r,n={},a=null,s=null;o!==void 0&&(a=""+o),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)pf.call(t,r)&&!mf.hasOwnProperty(r)&&(n[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)n[r]===void 0&&(n[r]=t[r]);return{$$typeof:uf,type:e,key:a,ref:s,props:n,_owner:ff.current}}Ma.Fragment=df;Ma.jsx=Cu;Ma.jsxs=Cu;xu.exports=Ma;var g=xu.exports;const gn={black:"#000",white:"#fff"},mr={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},gr={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},hr={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},vr={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},br={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},Zr={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},gf={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function Pt(e){let t="https://mui.com/production-error/?code="+e;for(let o=1;o0?yt(Hr,--Lt):0,Br--,ft===10&&(Br=1,Oa--),ft}function jt(){return ft=Lt2||vn(ft)>3?"":" "}function Of(e,t){for(;--t&&jt()&&!(ft<48||ft>102||ft>57&&ft<65||ft>70&&ft<97););return Pn(e,na()+(t<6&&xo()==32&&jt()==32))}function Ys(e){for(;jt();)switch(ft){case e:return Lt;case 34:case 39:e!==34&&e!==39&&Ys(ft);break;case 40:e===41&&Ys(e);break;case 92:jt();break}return Lt}function Ef(e,t){for(;jt()&&e+ft!==57;)if(e+ft===84&&xo()===47)break;return"/*"+Pn(t,Lt-1)+"*"+Ia(e===47?e:jt())}function Lf(e){for(;!vn(xo());)jt();return Pn(e,Lt)}function Af(e){return Tu(sa("",null,null,null,[""],e=ku(e),0,[0],e))}function sa(e,t,o,r,n,a,s,i,l){for(var c=0,d=0,m=s,v=0,y=0,b=0,h=1,C=1,x=1,P=0,$="",S=n,k=a,f=r,R=$;C;)switch(b=P,P=jt()){case 40:if(b!=108&&yt(R,m-1)==58){qs(R+=Ve(aa(P),"&","&\f"),"&\f")!=-1&&(x=-1);break}case 34:case 39:case 91:R+=aa(P);break;case 9:case 10:case 13:case 32:R+=If(b);break;case 92:R+=Of(na()-1,7);continue;case 47:switch(xo()){case 42:case 47:Dn(Bf(Ef(jt(),na()),t,o),l);break;default:R+="/"}break;case 123*h:i[c++]=bo(R)*x;case 125*h:case 59:case 0:switch(P){case 0:case 125:C=0;case 59+d:x==-1&&(R=Ve(R,/\f/g,"")),y>0&&bo(R)-m&&Dn(y>32?hl(R+";",r,o,m-1):hl(Ve(R," ","")+";",r,o,m-2),l);break;case 59:R+=";";default:if(Dn(f=gl(R,t,o,c,d,n,i,$,S=[],k=[],m),a),P===123)if(d===0)sa(R,t,f,f,S,a,m,i,k);else switch(v===99&&yt(R,3)===110?100:v){case 100:case 108:case 109:case 115:sa(e,f,f,r&&Dn(gl(e,f,f,0,0,n,i,$,n,S=[],m),k),n,k,m,i,r?S:k);break;default:sa(R,f,f,f,[""],k,0,i,k)}}c=d=y=0,h=x=1,$=R="",m=s;break;case 58:m=1+bo(R),y=b;default:if(h<1){if(P==123)--h;else if(P==125&&h++==0&&Mf()==125)continue}switch(R+=Ia(P),P*h){case 38:x=d>0?1:(R+="\f",-1);break;case 44:i[c++]=(bo(R)-1)*x,x=1;break;case 64:xo()===45&&(R+=aa(jt())),v=xo(),d=m=bo($=R+=Lf(na())),P++;break;case 45:b===45&&bo(R)==2&&(h=0)}}return a}function gl(e,t,o,r,n,a,s,i,l,c,d){for(var m=n-1,v=n===0?a:[""],y=hi(v),b=0,h=0,C=0;b0?v[x]+" "+P:Ve(P,/&\f/g,v[x])))&&(l[C++]=$);return Ea(e,t,o,n===0?mi:i,l,c,d)}function Bf(e,t,o){return Ea(e,t,o,$u,Ia(wf()),hn(e,2,-2),0)}function hl(e,t,o,r){return Ea(e,t,o,gi,hn(e,0,r),hn(e,r+1,-1),r)}function Or(e,t){for(var o="",r=hi(e),n=0;n6)switch(yt(e,t+1)){case 109:if(yt(e,t+4)!==45)break;case 102:return Ve(e,/(.+:)(.+)-([^]+)/,"$1"+He+"$2-$3$1"+fa+(yt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~qs(e,"stretch")?Mu(Ve(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(yt(e,t+1)!==115)break;case 6444:switch(yt(e,bo(e)-3-(~qs(e,"!important")&&10))){case 107:return Ve(e,":",":"+He)+e;case 101:return Ve(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+He+(yt(e,14)===45?"inline-":"")+"box$3$1"+He+"$2$3$1"+$t+"$2box$3")+e}break;case 5936:switch(yt(e,t+11)){case 114:return He+e+$t+Ve(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return He+e+$t+Ve(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return He+e+$t+Ve(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return He+e+$t+e+e}return e}var Vf=function(t,o,r,n){if(t.length>-1&&!t.return)switch(t.type){case gi:t.return=Mu(t.value,t.length);break;case Su:return Or([Jr(t,{value:Ve(t.value,"@","@"+He)})],n);case mi:if(t.length)return Tf(t.props,function(a){switch(kf(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Or([Jr(t,{props:[Ve(a,/:(read-\w+)/,":"+fa+"$1")]})],n);case"::placeholder":return Or([Jr(t,{props:[Ve(a,/:(plac\w+)/,":"+He+"input-$1")]}),Jr(t,{props:[Ve(a,/:(plac\w+)/,":"+fa+"$1")]}),Jr(t,{props:[Ve(a,/:(plac\w+)/,$t+"input-$1")]})],n)}return""})}},Uf=[Vf],vi=function(t){var o=t.key;if(o==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(h){var C=h.getAttribute("data-emotion");C.indexOf(" ")!==-1&&(document.head.appendChild(h),h.setAttribute("data-s",""))})}var n=t.stylisPlugins||Uf,a={},s,i=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+o+' "]'),function(h){for(var C=h.getAttribute("data-emotion").split(" "),x=1;x=4;++r,n-=4)o=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,o=(o&65535)*1540483477+((o>>>16)*59797<<16),o^=o>>>24,t=(o&65535)*1540483477+((o>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(n){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var um={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},dm=/[A-Z]|^ms/g,pm=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Au=function(t){return t.charCodeAt(1)===45},$l=function(t){return t!=null&&typeof t!="boolean"},ks=wu(function(e){return Au(e)?e:e.replace(dm,"-$&").toLowerCase()}),Sl=function(t,o){switch(t){case"animation":case"animationName":if(typeof o=="string")return o.replace(pm,function(r,n,a){return yo={name:n,styles:a,next:yo},n})}return um[t]!==1&&!Au(t)&&typeof o=="number"&&o!==0?o+"px":o};function bn(e,t,o){if(o==null)return"";var r=o;if(r.__emotion_styles!==void 0)return r;switch(typeof o){case"boolean":return"";case"object":{var n=o;if(n.anim===1)return yo={name:n.name,styles:n.styles,next:yo},n.name;var a=o;if(a.styles!==void 0){var s=a.next;if(s!==void 0)for(;s!==void 0;)yo={name:s.name,styles:s.styles,next:yo},s=s.next;var i=a.styles+";";return i}return fm(e,t,o)}case"function":{if(e!==void 0){var l=yo,c=o(e);return yo=l,bn(e,t,c)}break}}var d=o;if(t==null)return d;var m=t[d];return m!==void 0?m:d}function fm(e,t,o){var r="";if(Array.isArray(o))for(var n=0;n96?Om:Em},Tl=function(t,o,r){var n;if(o){var a=o.shouldForwardProp;n=t.__emotion_forwardProp&&a?function(s){return t.__emotion_forwardProp(s)&&a(s)}:a}return typeof n!="function"&&r&&(n=t.__emotion_forwardProp),n},Lm=function(t){var o=t.cache,r=t.serialized,n=t.isStringTag;return kn(o,r,n),Si(function(){return Tn(o,r,n)}),null},Am=function e(t,o){var r=t.__emotion_real===t,n=r&&t.__emotion_base||t,a,s;o!==void 0&&(a=o.label,s=o.target);var i=Tl(t,o,r),l=i||kl(n),c=!l("as");return function(){var d=arguments,m=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(a!==void 0&&m.push("label:"+a+";"),d[0]==null||d[0].raw===void 0)m.push.apply(m,d);else{var v=d[0];m.push(v[0]);for(var y=d.length,b=1;b(n[1].styles.match(/^@layer\s+[^{]*$/)||(n[1].styles=`@layer mui {${n[1].styles}}`),r(...n))}return o}const Ts=new Map;function Fu(e){const{injectFirst:t,enableCssLayer:o,children:r}=e,n=p.useMemo(()=>{const a=`${t}-${o}`;if(typeof document=="object"&&Ts.has(a))return Ts.get(a);const s=Fm(t,o);return Ts.set(a,s),s},[t,o]);return t||o?g.jsx(_u,{value:n,children:r}):r}function Wm(e){return e==null||Object.keys(e).length===0}function cn(e){const{styles:t,defaultTheme:o={}}=e,r=typeof t=="function"?n=>t(Wm(n)?o:n):t;return g.jsx(Nu,{styles:r})}function ki(e,t){return Zs(e,t)}const Wu=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},wl=[];function ga(e){return wl[0]=e,pr(wl)}const Hm=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:cn,StyledEngineProvider:Fu,ThemeContext:Xt,css:Bo,default:ki,internal_processStyles:Wu,internal_serializeStyles:ga,keyframes:po},Symbol.toStringTag,{value:"Module"}));function To(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Hu(e){if(p.isValidElement(e)||!To(e))return e;const t={};return Object.keys(e).forEach(o=>{t[o]=Hu(e[o])}),t}function ct(e,t,o={clone:!0}){const r=o.clone?u({},e):e;return To(e)&&To(t)&&Object.keys(t).forEach(n=>{p.isValidElement(t[n])?r[n]=t[n]:To(t[n])&&Object.prototype.hasOwnProperty.call(e,n)&&To(e[n])?r[n]=ct(e[n],t[n],o):o.clone?r[n]=To(t[n])?Hu(t[n]):t[n]:r[n]=t[n]}),r}const Vm=Object.freeze(Object.defineProperty({__proto__:null,default:ct,isPlainObject:To},Symbol.toStringTag,{value:"Module"})),Um=["values","unit","step"],Gm=e=>{const t=Object.keys(e).map(o=>({key:o,val:e[o]}))||[];return t.sort((o,r)=>o.val-r.val),t.reduce((o,r)=>u({},o,{[r.key]:r.val}),{})};function Ti(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:o="px",step:r=5}=e,n=F(e,Um),a=Gm(t),s=Object.keys(a);function i(v){return`@media (min-width:${typeof t[v]=="number"?t[v]:v}${o})`}function l(v){return`@media (max-width:${(typeof t[v]=="number"?t[v]:v)-r/100}${o})`}function c(v,y){const b=s.indexOf(y);return`@media (min-width:${typeof t[v]=="number"?t[v]:v}${o}) and (max-width:${(b!==-1&&typeof t[s[b]]=="number"?t[s[b]]:y)-r/100}${o})`}function d(v){return s.indexOf(v)+1`@media (min-width:${wi[e]}px)`};function At(e,t,o){const r=e.theme||{};if(Array.isArray(t)){const a=r.breakpoints||Ml;return t.reduce((s,i,l)=>(s[a.up(a.keys[l])]=o(t[l]),s),{})}if(typeof t=="object"){const a=r.breakpoints||Ml;return Object.keys(t).reduce((s,i)=>{if(Object.keys(a.values||wi).indexOf(i)!==-1){const l=a.up(i);s[l]=o(t[i],i)}else{const l=i;s[l]=t[l]}return s},{})}return o(t)}function Vu(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((r,n)=>{const a=e.up(n);return r[a]={},r},{}))||{}}function Js(e,t){return e.reduce((o,r)=>{const n=o[r];return(!n||Object.keys(n).length===0)&&delete o[r],o},t)}function qm(e,...t){const o=Vu(e),r=[o,...t].reduce((n,a)=>ct(n,a),{});return Js(Object.keys(o),r)}function Ym(e,t){if(typeof e!="object")return{};const o={},r=Object.keys(t);return Array.isArray(e)?r.forEach((n,a)=>{a{e[n]!=null&&(o[n]=!0)}),o}function ar({values:e,breakpoints:t,base:o}){const r=o||Ym(e,t),n=Object.keys(r);if(n.length===0)return e;let a;return n.reduce((s,i,l)=>(Array.isArray(e)?(s[i]=e[l]!=null?e[l]:e[a],a=l):typeof e=="object"?(s[i]=e[i]!=null?e[i]:e[a],a=i):s[i]=e,s),{})}function I(e){if(typeof e!="string")throw new Error(Pt(7));return e.charAt(0).toUpperCase()+e.slice(1)}const Xm=Object.freeze(Object.defineProperty({__proto__:null,default:I},Symbol.toStringTag,{value:"Module"}));function Va(e,t,o=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&o){const r=`vars.${t}`.split(".").reduce((n,a)=>n&&n[a]?n[a]:null,e);if(r!=null)return r}return t.split(".").reduce((r,n)=>r&&r[n]!=null?r[n]:null,e)}function ha(e,t,o,r=o){let n;return typeof e=="function"?n=e(o):Array.isArray(e)?n=e[o]||r:n=Va(e,o)||r,t&&(n=t(n,r,e)),n}function ut(e){const{prop:t,cssProperty:o=e.prop,themeKey:r,transform:n}=e,a=s=>{if(s[t]==null)return null;const i=s[t],l=s.theme,c=Va(l,r)||{};return At(s,i,m=>{let v=ha(c,n,m);return m===v&&typeof m=="string"&&(v=ha(c,n,`${t}${m==="default"?"":I(m)}`,m)),o===!1?v:{[o]:v}})};return a.propTypes={},a.filterProps=[t],a}function Zm(e){const t={};return o=>(t[o]===void 0&&(t[o]=e(o)),t[o])}const Jm={m:"margin",p:"padding"},Qm={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Il={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},eg=Zm(e=>{if(e.length>2)if(Il[e])e=Il[e];else return[e];const[t,o]=e.split(""),r=Jm[t],n=Qm[o]||"";return Array.isArray(n)?n.map(a=>r+a):[r+n]}),Mi=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ii=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Mi,...Ii];function Mn(e,t,o,r){var n;const a=(n=Va(e,t,!1))!=null?n:o;return typeof a=="number"?s=>typeof s=="string"?s:a*s:Array.isArray(a)?s=>typeof s=="string"?s:a[s]:typeof a=="function"?a:()=>{}}function Oi(e){return Mn(e,"spacing",8)}function cr(e,t){if(typeof t=="string"||t==null)return t;const o=Math.abs(t),r=e(o);return t>=0?r:typeof r=="number"?-r:`-${r}`}function tg(e,t){return o=>e.reduce((r,n)=>(r[n]=cr(t,o),r),{})}function og(e,t,o,r){if(t.indexOf(o)===-1)return null;const n=eg(o),a=tg(n,r),s=e[o];return At(e,s,a)}function Uu(e,t){const o=Oi(e.theme);return Object.keys(e).map(r=>og(e,t,r,o)).reduce(un,{})}function st(e){return Uu(e,Mi)}st.propTypes={};st.filterProps=Mi;function it(e){return Uu(e,Ii)}it.propTypes={};it.filterProps=Ii;function Gu(e=8){if(e.mui)return e;const t=Oi({spacing:e}),o=(...r)=>(r.length===0?[1]:r).map(a=>{const s=t(a);return typeof s=="number"?`${s}px`:s}).join(" ");return o.mui=!0,o}function Ua(...e){const t=e.reduce((r,n)=>(n.filterProps.forEach(a=>{r[a]=n}),r),{}),o=r=>Object.keys(r).reduce((n,a)=>t[a]?un(n,t[a](r)):n,{});return o.propTypes={},o.filterProps=e.reduce((r,n)=>r.concat(n.filterProps),[]),o}function Gt(e){return typeof e!="number"?e:`${e}px solid`}function to(e,t){return ut({prop:e,themeKey:"borders",transform:t})}const rg=to("border",Gt),ng=to("borderTop",Gt),ag=to("borderRight",Gt),sg=to("borderBottom",Gt),ig=to("borderLeft",Gt),lg=to("borderColor"),cg=to("borderTopColor"),ug=to("borderRightColor"),dg=to("borderBottomColor"),pg=to("borderLeftColor"),fg=to("outline",Gt),mg=to("outlineColor"),Ga=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Mn(e.theme,"shape.borderRadius",4),o=r=>({borderRadius:cr(t,r)});return At(e,e.borderRadius,o)}return null};Ga.propTypes={};Ga.filterProps=["borderRadius"];Ua(rg,ng,ag,sg,ig,lg,cg,ug,dg,pg,Ga,fg,mg);const Ka=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Mn(e.theme,"spacing",8),o=r=>({gap:cr(t,r)});return At(e,e.gap,o)}return null};Ka.propTypes={};Ka.filterProps=["gap"];const qa=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Mn(e.theme,"spacing",8),o=r=>({columnGap:cr(t,r)});return At(e,e.columnGap,o)}return null};qa.propTypes={};qa.filterProps=["columnGap"];const Ya=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Mn(e.theme,"spacing",8),o=r=>({rowGap:cr(t,r)});return At(e,e.rowGap,o)}return null};Ya.propTypes={};Ya.filterProps=["rowGap"];const gg=ut({prop:"gridColumn"}),hg=ut({prop:"gridRow"}),vg=ut({prop:"gridAutoFlow"}),bg=ut({prop:"gridAutoColumns"}),yg=ut({prop:"gridAutoRows"}),xg=ut({prop:"gridTemplateColumns"}),Cg=ut({prop:"gridTemplateRows"}),$g=ut({prop:"gridTemplateAreas"}),Sg=ut({prop:"gridArea"});Ua(Ka,qa,Ya,gg,hg,vg,bg,yg,xg,Cg,$g,Sg);function Er(e,t){return t==="grey"?t:e}const Rg=ut({prop:"color",themeKey:"palette",transform:Er}),Pg=ut({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Er}),kg=ut({prop:"backgroundColor",themeKey:"palette",transform:Er});Ua(Rg,Pg,kg);function zt(e){return e<=1&&e!==0?`${e*100}%`:e}const Tg=ut({prop:"width",transform:zt}),Ei=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=o=>{var r,n;const a=((r=e.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[o])||wi[o];return a?((n=e.theme)==null||(n=n.breakpoints)==null?void 0:n.unit)!=="px"?{maxWidth:`${a}${e.theme.breakpoints.unit}`}:{maxWidth:a}:{maxWidth:zt(o)}};return At(e,e.maxWidth,t)}return null};Ei.filterProps=["maxWidth"];const wg=ut({prop:"minWidth",transform:zt}),Mg=ut({prop:"height",transform:zt}),Ig=ut({prop:"maxHeight",transform:zt}),Og=ut({prop:"minHeight",transform:zt});ut({prop:"size",cssProperty:"width",transform:zt});ut({prop:"size",cssProperty:"height",transform:zt});const Eg=ut({prop:"boxSizing"});Ua(Tg,Ei,wg,Mg,Ig,Og,Eg);const Vr={border:{themeKey:"borders",transform:Gt},borderTop:{themeKey:"borders",transform:Gt},borderRight:{themeKey:"borders",transform:Gt},borderBottom:{themeKey:"borders",transform:Gt},borderLeft:{themeKey:"borders",transform:Gt},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Gt},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ga},color:{themeKey:"palette",transform:Er},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Er},backgroundColor:{themeKey:"palette",transform:Er},p:{style:it},pt:{style:it},pr:{style:it},pb:{style:it},pl:{style:it},px:{style:it},py:{style:it},padding:{style:it},paddingTop:{style:it},paddingRight:{style:it},paddingBottom:{style:it},paddingLeft:{style:it},paddingX:{style:it},paddingY:{style:it},paddingInline:{style:it},paddingInlineStart:{style:it},paddingInlineEnd:{style:it},paddingBlock:{style:it},paddingBlockStart:{style:it},paddingBlockEnd:{style:it},m:{style:st},mt:{style:st},mr:{style:st},mb:{style:st},ml:{style:st},mx:{style:st},my:{style:st},margin:{style:st},marginTop:{style:st},marginRight:{style:st},marginBottom:{style:st},marginLeft:{style:st},marginX:{style:st},marginY:{style:st},marginInline:{style:st},marginInlineStart:{style:st},marginInlineEnd:{style:st},marginBlock:{style:st},marginBlockStart:{style:st},marginBlockEnd:{style:st},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Ka},rowGap:{style:Ya},columnGap:{style:qa},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:zt},maxWidth:{style:Ei},minWidth:{transform:zt},height:{transform:zt},maxHeight:{transform:zt},minHeight:{transform:zt},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function Lg(...e){const t=e.reduce((r,n)=>r.concat(Object.keys(n)),[]),o=new Set(t);return e.every(r=>o.size===Object.keys(r).length)}function Ag(e,t){return typeof e=="function"?e(t):e}function Ku(){function e(o,r,n,a){const s={[o]:r,theme:n},i=a[o];if(!i)return{[o]:r};const{cssProperty:l=o,themeKey:c,transform:d,style:m}=i;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[o]:r};const v=Va(n,c)||{};return m?m(s):At(s,r,b=>{let h=ha(v,d,b);return b===h&&typeof b=="string"&&(h=ha(v,d,`${o}${b==="default"?"":I(b)}`,b)),l===!1?h:{[l]:h}})}function t(o){var r;const{sx:n,theme:a={},nested:s}=o||{};if(!n)return null;const i=(r=a.unstable_sxConfig)!=null?r:Vr;function l(c){let d=c;if(typeof c=="function")d=c(a);else if(typeof c!="object")return c;if(!d)return null;const m=Vu(a.breakpoints),v=Object.keys(m);let y=m;return Object.keys(d).forEach(b=>{const h=Ag(d[b],a);if(h!=null)if(typeof h=="object")if(i[b])y=un(y,e(b,h,a,i));else{const C=At({theme:a},h,x=>({[b]:x}));Lg(C,h)?y[b]=t({sx:h,theme:a,nested:!0}):y=un(y,C)}else y=un(y,e(b,h,a,i))}),!s&&a.modularCssLayers?{"@layer sx":Js(v,y)}:Js(v,y)}return Array.isArray(n)?n.map(l):l(n)}return t}const Xo=Ku();Xo.filterProps=["sx"];function qu(e,t){const o=this;return o.vars&&typeof o.getColorSchemeSelector=="function"?{[o.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)")]:t}:o.palette.mode===e?t:{}}const Bg=["breakpoints","palette","spacing","shape"];function fr(e={},...t){const{breakpoints:o={},palette:r={},spacing:n,shape:a={}}=e,s=F(e,Bg),i=Ti(o),l=Gu(n);let c=ct({breakpoints:i,direction:"ltr",components:{},palette:u({mode:"light"},r),spacing:l,shape:u({},Km,a)},s);return c.applyStyles=qu,c=t.reduce((d,m)=>ct(d,m),c),c.unstable_sxConfig=u({},Vr,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(m){return Xo({sx:m,theme:this})},c}const _g=Object.freeze(Object.defineProperty({__proto__:null,default:fr,private_createBreakpoints:Ti,unstable_applyStyles:qu},Symbol.toStringTag,{value:"Module"}));function Ng(e){return Object.keys(e).length===0}function Xa(e=null){const t=p.useContext(Xt);return!t||Ng(t)?e:t}const zg=fr();function In(e=zg){return Xa(e)}function ws(e){const t=ga(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function Yu({styles:e,themeId:t,defaultTheme:o={}}){const r=In(o),n=t&&r[t]||r;let a=typeof e=="function"?e(n):e;return n.modularCssLayers&&(Array.isArray(a)?a=a.map(s=>ws(typeof s=="function"?s(n):s)):a=ws(a)),g.jsx(cn,{styles:a})}const jg=["sx"],Dg=e=>{var t,o;const r={systemProps:{},otherProps:{}},n=(t=e==null||(o=e.theme)==null?void 0:o.unstable_sxConfig)!=null?t:Vr;return Object.keys(e).forEach(a=>{n[a]?r.systemProps[a]=e[a]:r.otherProps[a]=e[a]}),r};function Ur(e){const{sx:t}=e,o=F(e,jg),{systemProps:r,otherProps:n}=Dg(o);let a;return Array.isArray(t)?a=[r,...t]:typeof t=="function"?a=(...s)=>{const i=t(...s);return To(i)?u({},r,i):r}:a=u({},r,t),u({},n,{sx:a})}const Fg=Object.freeze(Object.defineProperty({__proto__:null,default:Xo,extendSxProp:Ur,unstable_createStyleFunctionSx:Ku,unstable_defaultSxConfig:Vr},Symbol.toStringTag,{value:"Module"})),Ol=e=>e,Wg=()=>{let e=Ol;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Ol}}},Za=Wg();function Xu(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;ti!=="theme"&&i!=="sx"&&i!=="as"})(Xo);return p.forwardRef(function(l,c){const d=In(o),m=Ur(l),{className:v,component:y="div"}=m,b=F(m,Hg);return g.jsx(a,u({as:y,ref:c,className:D(v,n?n(r):r),theme:t&&d[t]||d},b))})}const Vg={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Y(e,t,o="Mui"){const r=Vg[t];return r?`${o}-${r}`:`${Za.generate(e)}-${t}`}function X(e,t,o="Mui"){const r={};return t.forEach(n=>{r[n]=Y(e,n,o)}),r}const Ug=X("MuiBox",["root"]),Gw=Zu({defaultClassName:Ug.root,generateClassName:Za.generate});var Ju={exports:{}},Je={};/** + * @license React + * react-is.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Li=Symbol.for("react.transitional.element"),Ai=Symbol.for("react.portal"),Ja=Symbol.for("react.fragment"),Qa=Symbol.for("react.strict_mode"),es=Symbol.for("react.profiler"),ts=Symbol.for("react.consumer"),os=Symbol.for("react.context"),rs=Symbol.for("react.forward_ref"),ns=Symbol.for("react.suspense"),as=Symbol.for("react.suspense_list"),ss=Symbol.for("react.memo"),is=Symbol.for("react.lazy"),Gg=Symbol.for("react.view_transition"),Kg=Symbol.for("react.client.reference");function oo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Li:switch(e=e.type,e){case Ja:case es:case Qa:case ns:case as:case Gg:return e;default:switch(e=e&&e.$$typeof,e){case os:case rs:case is:case ss:return e;case ts:return e;default:return t}}case Ai:return t}}}Je.ContextConsumer=ts;Je.ContextProvider=os;Je.Element=Li;Je.ForwardRef=rs;Je.Fragment=Ja;Je.Lazy=is;Je.Memo=ss;Je.Portal=Ai;Je.Profiler=es;Je.StrictMode=Qa;Je.Suspense=ns;Je.SuspenseList=as;Je.isContextConsumer=function(e){return oo(e)===ts};Je.isContextProvider=function(e){return oo(e)===os};Je.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Li};Je.isForwardRef=function(e){return oo(e)===rs};Je.isFragment=function(e){return oo(e)===Ja};Je.isLazy=function(e){return oo(e)===is};Je.isMemo=function(e){return oo(e)===ss};Je.isPortal=function(e){return oo(e)===Ai};Je.isProfiler=function(e){return oo(e)===es};Je.isStrictMode=function(e){return oo(e)===Qa};Je.isSuspense=function(e){return oo(e)===ns};Je.isSuspenseList=function(e){return oo(e)===as};Je.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ja||e===es||e===Qa||e===ns||e===as||typeof e=="object"&&e!==null&&(e.$$typeof===is||e.$$typeof===ss||e.$$typeof===os||e.$$typeof===ts||e.$$typeof===rs||e.$$typeof===Kg||e.getModuleId!==void 0)};Je.typeOf=oo;Ju.exports=Je;var El=Ju.exports;const qg=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function Qu(e){const t=`${e}`.match(qg);return t&&t[1]||""}function ed(e,t=""){return e.displayName||e.name||Qu(e)||t}function Ll(e,t,o){const r=ed(t);return e.displayName||(r!==""?`${o}(${r})`:o)}function Yg(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return ed(e,"Component");if(typeof e=="object")switch(e.$$typeof){case El.ForwardRef:return Ll(e,e.render,"ForwardRef");case El.Memo:return Ll(e,e.type,"memo");default:return}}}const Xg=Object.freeze(Object.defineProperty({__proto__:null,default:Yg,getFunctionName:Qu},Symbol.toStringTag,{value:"Module"})),Zg=["ownerState"],Jg=["variants"],Qg=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function eh(e){return Object.keys(e).length===0}function th(e){return typeof e=="string"&&e.charCodeAt(0)>96}function Ms(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function Al(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}const oh=fr(),rh=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function Fn({defaultTheme:e,theme:t,themeId:o}){return eh(t)?e:t[o]||t}function nh(e){return e?(t,o)=>o[e]:null}function ia(e,t,o){let{ownerState:r}=t,n=F(t,Zg);const a=typeof e=="function"?e(u({ownerState:r},n)):e;if(Array.isArray(a))return a.flatMap(s=>ia(s,u({ownerState:r},n),o));if(a&&typeof a=="object"&&Array.isArray(a.variants)){const{variants:s=[]}=a;let l=F(a,Jg);return s.forEach(c=>{let d=!0;if(typeof c.props=="function"?d=c.props(u({ownerState:r},n,r)):Object.keys(c.props).forEach(m=>{(r==null?void 0:r[m])!==c.props[m]&&n[m]!==c.props[m]&&(d=!1)}),d){Array.isArray(l)||(l=[l]);const m=typeof c.style=="function"?c.style(u({ownerState:r},n,r)):c.style;l.push(o?Al(ga(m),o):m)}}),l}return o?Al(ga(a),o):a}function ah(e={}){const{themeId:t,defaultTheme:o=oh,rootShouldForwardProp:r=Ms,slotShouldForwardProp:n=Ms}=e,a=s=>Xo(u({},s,{theme:Fn(u({},s,{defaultTheme:o,themeId:t}))}));return a.__mui_systemSx=!0,(s,i={})=>{Wu(s,f=>f.filter(R=>!(R!=null&&R.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:d,skipSx:m,overridesResolver:v=nh(rh(c))}=i,y=F(i,Qg),b=l&&l.startsWith("Mui")||c?"components":"custom",h=d!==void 0?d:c&&c!=="Root"&&c!=="root"||!1,C=m||!1;let x,P=Ms;c==="Root"||c==="root"?P=r:c?P=n:th(s)&&(P=void 0);const $=ki(s,u({shouldForwardProp:P,label:x},y)),S=f=>typeof f=="function"&&f.__emotion_real!==f||To(f)?R=>{const T=Fn({theme:R.theme,defaultTheme:o,themeId:t});return ia(f,u({},R,{theme:T}),T.modularCssLayers?b:void 0)}:f,k=(f,...R)=>{let T=S(f);const w=R?R.map(S):[];l&&v&&w.push(L=>{const E=Fn(u({},L,{defaultTheme:o,themeId:t}));if(!E.components||!E.components[l]||!E.components[l].styleOverrides)return null;const B=E.components[l].styleOverrides,z={};return Object.entries(B).forEach(([W,H])=>{z[W]=ia(H,u({},L,{theme:E}),E.modularCssLayers?"theme":void 0)}),v(L,z)}),l&&!h&&w.push(L=>{var E;const B=Fn(u({},L,{defaultTheme:o,themeId:t})),z=B==null||(E=B.components)==null||(E=E[l])==null?void 0:E.variants;return ia({variants:z},u({},L,{theme:B}),B.modularCssLayers?"theme":void 0)}),C||w.push(a);const O=w.length-R.length;if(Array.isArray(f)&&O>0){const L=new Array(O).fill("");T=[...f,...L],T.raw=[...f.raw,...L]}const j=$(T,...w);return s.muiName&&(j.muiName=s.muiName),j};return $.withConfig&&(k.withConfig=$.withConfig),k}}const Bi=ah();function _r(e,t){const o=u({},t);return Object.keys(e).forEach(r=>{if(r.toString().match(/^(components|slots)$/))o[r]=u({},e[r],o[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const n=e[r]||{},a=t[r];o[r]={},!a||!Object.keys(a)?o[r]=n:!n||!Object.keys(n)?o[r]=a:(o[r]=u({},a),Object.keys(n).forEach(s=>{o[r][s]=_r(n[s],a[s])}))}else o[r]===void 0&&(o[r]=e[r])}),o}function td(e){const{theme:t,name:o,props:r}=e;return!t||!t.components||!t.components[o]||!t.components[o].defaultProps?r:_r(t.components[o].defaultProps,r)}function ls({props:e,name:t,defaultTheme:o,themeId:r}){let n=In(o);return r&&(n=n[r]||n),td({theme:n,name:t,props:e})}const xt=typeof window<"u"?p.useLayoutEffect:p.useEffect;function sh(e,t,o,r,n){const[a,s]=p.useState(()=>n&&o?o(e).matches:r?r(e).matches:t);return xt(()=>{let i=!0;if(!o)return;const l=o(e),c=()=>{i&&s(l.matches)};return c(),l.addListener(c),()=>{i=!1,l.removeListener(c)}},[e,o]),a}const od=p.useSyncExternalStore;function ih(e,t,o,r,n){const a=p.useCallback(()=>t,[t]),s=p.useMemo(()=>{if(n&&o)return()=>o(e).matches;if(r!==null){const{matches:d}=r(e);return()=>d}return a},[a,e,r,n,o]),[i,l]=p.useMemo(()=>{if(o===null)return[a,()=>()=>{}];const d=o(e);return[()=>d.matches,m=>(d.addListener(m),()=>{d.removeListener(m)})]},[a,o,e]);return od(l,i,s)}function Kw(e,t={}){const o=Xa(),r=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:n=!1,matchMedia:a=r?window.matchMedia:null,ssrMatchMedia:s=null,noSsr:i=!1}=td({name:"MuiUseMediaQuery",props:t,theme:o});let l=typeof e=="function"?e(o):e;return l=l.replace(/^@media( ?)/m,""),(od!==void 0?ih:sh)(l,n,a,s,i)}function rr(e,t=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,o))}const lh=Object.freeze(Object.defineProperty({__proto__:null,default:rr},Symbol.toStringTag,{value:"Module"}));function _i(e,t=0,o=1){return rr(e,t,o)}function rd(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let o=e.match(t);return o&&o[0].length===1&&(o=o.map(r=>r+r)),o?`rgb${o.length===4?"a":""}(${o.map((r,n)=>n<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function ch(e){const t=e.toString(16);return t.length===1?`0${t}`:t}function Oo(e){if(e.type)return e;if(e.charAt(0)==="#")return Oo(rd(e));const t=e.indexOf("("),o=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(o)===-1)throw new Error(Pt(9,e));let r=e.substring(t+1,e.length-1),n;if(o==="color"){if(r=r.split(" "),n=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(n)===-1)throw new Error(Pt(10,n))}else r=r.split(",");return r=r.map(a=>parseFloat(a)),{type:o,values:r,colorSpace:n}}function On(e){const{type:t,colorSpace:o}=e;let{values:r}=e;return t.indexOf("rgb")!==-1?r=r.map((n,a)=>a<3?parseInt(n,10):n):t.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.indexOf("color")!==-1?r=`${o} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function uh(e){if(e.indexOf("#")===0)return e;const{values:t}=Oo(e);return`#${t.map((o,r)=>ch(r===3?Math.round(255*o):o)).join("")}`}function nd(e){e=Oo(e);const{values:t}=e,o=t[0],r=t[1]/100,n=t[2]/100,a=r*Math.min(n,1-n),s=(c,d=(c+o/30)%12)=>n-a*Math.max(Math.min(d-3,9-d,1),-1);let i="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(i+="a",l.push(t[3])),On({type:i,values:l})}function va(e){e=Oo(e);let t=e.type==="hsl"||e.type==="hsla"?Oo(nd(e)).values:e.values;return t=t.map(o=>(e.type!=="color"&&(o/=255),o<=.03928?o/12.92:((o+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function dh(e,t){const o=va(e),r=va(t);return(Math.max(o,r)+.05)/(Math.min(o,r)+.05)}function nn(e,t){return e=Oo(e),t=_i(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,On(e)}function ad(e,t){if(e=Oo(e),t=_i(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let o=0;o<3;o+=1)e.values[o]*=1-t;return On(e)}function sd(e,t){if(e=Oo(e),t=_i(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let o=0;o<3;o+=1)e.values[o]+=(255-e.values[o])*t;else if(e.type.indexOf("color")!==-1)for(let o=0;o<3;o+=1)e.values[o]+=(1-e.values[o])*t;return On(e)}function ph(e,t=.15){return va(e)>.5?ad(e,t):sd(e,t)}function ba(...e){return e.reduce((t,o)=>o==null?t:function(...n){t.apply(this,n),o.apply(this,n)},()=>{})}function Gr(e,t=166){let o;function r(...n){const a=()=>{e.apply(this,n)};clearTimeout(o),o=setTimeout(a,t)}return r.clear=()=>{clearTimeout(o)},r}function fh(e,t){return()=>null}function sr(e,t){var o,r;return p.isValidElement(e)&&t.indexOf((o=e.type.muiName)!=null?o:(r=e.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function rt(e){return e&&e.ownerDocument||document}function Zt(e){return rt(e).defaultView||window}function mh(e,t){return()=>null}function yn(e,t){typeof e=="function"?e(t):e&&(e.current=t)}let Bl=0;function gh(e){const[t,o]=p.useState(e),r=e||t;return p.useEffect(()=>{t==null&&(Bl+=1,o(`mui-${Bl}`))},[t]),r}const _l=Ks.useId;function $o(e){if(_l!==void 0){const t=_l();return e??t}return gh(e)}function hh(e,t,o,r,n){return null}function qt({controlled:e,default:t,name:o,state:r="value"}){const{current:n}=p.useRef(e!==void 0),[a,s]=p.useState(t),i=n?e:a,l=p.useCallback(c=>{n||s(c)},[]);return[i,l]}function at(e){const t=p.useRef(e);return xt(()=>{t.current=e}),p.useRef((...o)=>(0,t.current)(...o)).current}function Ue(...e){return p.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(o=>{yn(o,t)})},e)}const Nl={};function vh(e,t){const o=p.useRef(Nl);return o.current===Nl&&(o.current=e(t)),o}const bh=[];function yh(e){p.useEffect(e,bh)}class En{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new En}start(t,o){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,o()},t)}}function Uo(){const e=vh(En.create).current;return yh(e.disposeEffect),e}let cs=!0,Qs=!1;const xh=new En,Ch={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function $h(e){const{type:t,tagName:o}=e;return!!(o==="INPUT"&&Ch[t]&&!e.readOnly||o==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function Sh(e){e.metaKey||e.altKey||e.ctrlKey||(cs=!0)}function Is(){cs=!1}function Rh(){this.visibilityState==="hidden"&&Qs&&(cs=!0)}function Ph(e){e.addEventListener("keydown",Sh,!0),e.addEventListener("mousedown",Is,!0),e.addEventListener("pointerdown",Is,!0),e.addEventListener("touchstart",Is,!0),e.addEventListener("visibilitychange",Rh,!0)}function kh(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return cs||$h(t)}function us(){const e=p.useCallback(n=>{n!=null&&Ph(n.ownerDocument)},[]),t=p.useRef(!1);function o(){return t.current?(Qs=!0,xh.start(100,()=>{Qs=!1}),t.current=!1,!0):!1}function r(n){return kh(n)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:r,onBlur:o,ref:e}}function id(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}let yr;function ld(){if(yr)return yr;const e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),yr="reverse",e.scrollLeft>0?yr="default":(e.scrollLeft=1,e.scrollLeft===0&&(yr="negative")),document.body.removeChild(e),yr}function Th(e,t){const o=e.scrollLeft;if(t!=="rtl")return o;switch(ld()){case"negative":return e.scrollWidth-e.clientWidth+o;case"reverse":return e.scrollWidth-e.clientWidth-o;default:return o}}const Ni=e=>{const t=p.useRef({});return p.useEffect(()=>{t.current=e}),t.current};function cd(e){return p.Children.toArray(e).filter(t=>p.isValidElement(t))}const wh={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function Z(e,t,o=void 0){const r={};return Object.keys(e).forEach(n=>{r[n]=e[n].reduce((a,s)=>{if(s){const i=t(s);i!==""&&a.push(i),o&&o[s]&&a.push(o[s])}return a},[]).join(" ")}),r}function co(e){return typeof e=="string"}function kr(e,t,o){return e===void 0||co(e)?t:u({},t,{ownerState:u({},t.ownerState,o)})}function ir(e,t=[]){if(e===void 0)return{};const o={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{o[r]=e[r]}),o}function zl(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(o=>!(o.match(/^on[A-Z]/)&&typeof e[o]=="function")).forEach(o=>{t[o]=e[o]}),t}function ud(e){const{getSlotProps:t,additionalProps:o,externalSlotProps:r,externalForwardedProps:n,className:a}=e;if(!t){const y=D(o==null?void 0:o.className,a,n==null?void 0:n.className,r==null?void 0:r.className),b=u({},o==null?void 0:o.style,n==null?void 0:n.style,r==null?void 0:r.style),h=u({},o,n,r);return y.length>0&&(h.className=y),Object.keys(b).length>0&&(h.style=b),{props:h,internalRef:void 0}}const s=ir(u({},n,r)),i=zl(r),l=zl(n),c=t(s),d=D(c==null?void 0:c.className,o==null?void 0:o.className,a,n==null?void 0:n.className,r==null?void 0:r.className),m=u({},c==null?void 0:c.style,o==null?void 0:o.style,n==null?void 0:n.style,r==null?void 0:r.style),v=u({},c,o,l,i);return d.length>0&&(v.className=d),Object.keys(m).length>0&&(v.style=m),{props:v,internalRef:c.ref}}function dd(e,t,o){return typeof e=="function"?e(t,o):e}const Mh=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function lt(e){var t;const{elementType:o,externalSlotProps:r,ownerState:n,skipResolvingSlotProps:a=!1}=e,s=F(e,Mh),i=a?{}:dd(r,n),{props:l,internalRef:c}=ud(u({},s,{externalSlotProps:i})),d=Ue(c,i==null?void 0:i.ref,(t=e.additionalProps)==null?void 0:t.ref);return kr(o,u({},l,{ref:d}),n)}function _o(e){if(parseInt(p.version,10)>=19){var t;return(e==null||(t=e.props)==null?void 0:t.ref)||null}return(e==null?void 0:e.ref)||null}const pd=p.createContext(null);function zi(){return p.useContext(pd)}const Ih=typeof Symbol=="function"&&Symbol.for,Oh=Ih?Symbol.for("mui.nested"):"__THEME_NESTED__";function Eh(e,t){return typeof t=="function"?t(e):u({},e,t)}function Lh(e){const{children:t,theme:o}=e,r=zi(),n=p.useMemo(()=>{const a=r===null?o:Eh(r,o);return a!=null&&(a[Oh]=r!==null),a},[o,r]);return g.jsx(pd.Provider,{value:n,children:t})}const Ah=["value"],fd=p.createContext();function Bh(e){let{value:t}=e,o=F(e,Ah);return g.jsx(fd.Provider,u({value:t??!0},o))}const No=()=>{const e=p.useContext(fd);return e??!1},md=p.createContext(void 0);function _h({value:e,children:t}){return g.jsx(md.Provider,{value:e,children:t})}function Nh(e){const{theme:t,name:o,props:r}=e;if(!t||!t.components||!t.components[o])return r;const n=t.components[o];return n.defaultProps?_r(n.defaultProps,r):!n.styleOverrides&&!n.variants?_r(n,r):r}function zh({props:e,name:t}){const o=p.useContext(md);return Nh({props:e,name:t,theme:{components:o}})}function jh(e){const t=Xa(),o=$o()||"",{modularCssLayers:r}=e;let n="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!r||t!==null?n="":typeof r=="string"?n=r.replace(/mui(?!\.)/g,n):n=`@layer ${n};`,xt(()=>{const a=document.querySelector("head");if(!a)return;const s=a.firstChild;if(n){var i;if(s&&(i=s.hasAttribute)!=null&&i.call(s,"data-mui-layer-order")&&s.getAttribute("data-mui-layer-order")===o)return;const c=document.createElement("style");c.setAttribute("data-mui-layer-order",o),c.textContent=n,a.prepend(c)}else{var l;(l=a.querySelector(`style[data-mui-layer-order="${o}"]`))==null||l.remove()}},[n,o]),n?g.jsx(Yu,{styles:n}):null}const jl={};function Dl(e,t,o,r=!1){return p.useMemo(()=>{const n=e&&t[e]||t;if(typeof o=="function"){const a=o(n),s=e?u({},t,{[e]:a}):a;return r?()=>s:s}return e?u({},t,{[e]:o}):u({},t,o)},[e,t,o,r])}function gd(e){const{children:t,theme:o,themeId:r}=e,n=Xa(jl),a=zi()||jl,s=Dl(r,n,o),i=Dl(r,a,o,!0),l=s.direction==="rtl",c=jh(s);return g.jsx(Lh,{theme:i,children:g.jsx(Xt.Provider,{value:s,children:g.jsx(Bh,{value:l,children:g.jsxs(_h,{value:s==null?void 0:s.components,children:[c,t]})})})})}const ji="mode",Di="color-scheme",hd="data-color-scheme";function Dh(e){const{defaultMode:t="light",defaultLightColorScheme:o="light",defaultDarkColorScheme:r="dark",modeStorageKey:n=ji,colorSchemeStorageKey:a=Di,attribute:s=hd,colorSchemeNode:i="document.documentElement",nonce:l}=e||{};return g.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?l:"",dangerouslySetInnerHTML:{__html:`(function() { +try { + var mode = localStorage.getItem('${n}') || '${t}'; + var colorScheme = ''; + if (mode === 'system') { + // handle system mode + var mql = window.matchMedia('(prefers-color-scheme: dark)'); + if (mql.matches) { + colorScheme = localStorage.getItem('${a}-dark') || '${r}'; + } else { + colorScheme = localStorage.getItem('${a}-light') || '${o}'; + } + } + if (mode === 'light') { + colorScheme = localStorage.getItem('${a}-light') || '${o}'; + } + if (mode === 'dark') { + colorScheme = localStorage.getItem('${a}-dark') || '${r}'; + } + if (colorScheme) { + ${i}.setAttribute('${s}', colorScheme); + } +} catch(e){}})();`}},"mui-color-scheme-init")}function Fl(e){if(typeof window<"u"&&e==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function vd(e,t){if(e.mode==="light"||e.mode==="system"&&e.systemMode==="light")return t("light");if(e.mode==="dark"||e.mode==="system"&&e.systemMode==="dark")return t("dark")}function Fh(e){return vd(e,t=>{if(t==="light")return e.lightColorScheme;if(t==="dark")return e.darkColorScheme})}function Os(e,t){if(typeof window>"u")return;let o;try{o=localStorage.getItem(e)||void 0,o||localStorage.setItem(e,t)}catch{}return o||t}function Wh(e){const{defaultMode:t="light",defaultLightColorScheme:o,defaultDarkColorScheme:r,supportedColorSchemes:n=[],modeStorageKey:a=ji,colorSchemeStorageKey:s=Di,storageWindow:i=typeof window>"u"?void 0:window}=e,l=n.join(","),[c,d]=p.useState(()=>{const C=Os(a,t),x=Os(`${s}-light`,o),P=Os(`${s}-dark`,r);return{mode:C,systemMode:Fl(C),lightColorScheme:x,darkColorScheme:P}}),m=Fh(c),v=p.useCallback(C=>{d(x=>{if(C===x.mode)return x;const P=C??t;try{localStorage.setItem(a,P)}catch{}return u({},x,{mode:P,systemMode:Fl(P)})})},[a,t]),y=p.useCallback(C=>{C?typeof C=="string"?C&&!l.includes(C)?console.error(`\`${C}\` does not exist in \`theme.colorSchemes\`.`):d(x=>{const P=u({},x);return vd(x,$=>{try{localStorage.setItem(`${s}-${$}`,C)}catch{}$==="light"&&(P.lightColorScheme=C),$==="dark"&&(P.darkColorScheme=C)}),P}):d(x=>{const P=u({},x),$=C.light===null?o:C.light,S=C.dark===null?r:C.dark;if($)if(!l.includes($))console.error(`\`${$}\` does not exist in \`theme.colorSchemes\`.`);else{P.lightColorScheme=$;try{localStorage.setItem(`${s}-light`,$)}catch{}}if(S)if(!l.includes(S))console.error(`\`${S}\` does not exist in \`theme.colorSchemes\`.`);else{P.darkColorScheme=S;try{localStorage.setItem(`${s}-dark`,S)}catch{}}return P}):d(x=>{try{localStorage.setItem(`${s}-light`,o),localStorage.setItem(`${s}-dark`,r)}catch{}return u({},x,{lightColorScheme:o,darkColorScheme:r})})},[l,s,o,r]),b=p.useCallback(C=>{c.mode==="system"&&d(x=>{const P=C!=null&&C.matches?"dark":"light";return x.systemMode===P?x:u({},x,{systemMode:P})})},[c.mode]),h=p.useRef(b);return h.current=b,p.useEffect(()=>{const C=(...P)=>h.current(...P),x=window.matchMedia("(prefers-color-scheme: dark)");return x.addListener(C),C(x),()=>{x.removeListener(C)}},[]),p.useEffect(()=>{if(i){const C=x=>{const P=x.newValue;typeof x.key=="string"&&x.key.startsWith(s)&&(!P||l.match(P))&&(x.key.endsWith("light")&&y({light:P}),x.key.endsWith("dark")&&y({dark:P})),x.key===a&&(!P||["light","dark","system"].includes(P))&&v(P||t)};return i.addEventListener("storage",C),()=>{i.removeEventListener("storage",C)}}},[y,v,a,s,l,t,i]),u({},c,{colorScheme:m,setMode:v,setColorScheme:y})}const Hh=["colorSchemes","components","generateCssVars","cssVarPrefix"],Vh="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Uh(e){const{themeId:t,theme:o={},attribute:r=hd,modeStorageKey:n=ji,colorSchemeStorageKey:a=Di,defaultMode:s="light",defaultColorScheme:i,disableTransitionOnChange:l=!1,resolveTheme:c,excludeVariablesFromRoot:d}=e;(!o.colorSchemes||typeof i=="string"&&!o.colorSchemes[i]||typeof i=="object"&&!o.colorSchemes[i==null?void 0:i.light]||typeof i=="object"&&!o.colorSchemes[i==null?void 0:i.dark])&&console.error(`MUI: \`${i}\` does not exist in \`theme.colorSchemes\`.`);const m=p.createContext(void 0),v=()=>{const x=p.useContext(m);if(!x)throw new Error(Pt(19));return x};function y(x){const{children:P,theme:$=o,modeStorageKey:S=n,colorSchemeStorageKey:k=a,attribute:f=r,defaultMode:R=s,defaultColorScheme:T=i,disableTransitionOnChange:w=l,storageWindow:O=typeof window>"u"?void 0:window,documentNode:j=typeof document>"u"?void 0:document,colorSchemeNode:L=typeof document>"u"?void 0:document.documentElement,colorSchemeSelector:E=":root",disableNestedContext:B=!1,disableStyleSheetGeneration:z=!1}=x,W=p.useRef(!1),H=zi(),_=p.useContext(m),G=!!_&&!B,se=$[t],ve=se||$,{colorSchemes:Re={},components:Se={},generateCssVars:re=()=>({vars:{},css:{}}),cssVarPrefix:pe}=ve,te=F(ve,Hh),be=Object.keys(Re),ae=typeof T=="string"?T:T.light,de=typeof T=="string"?T:T.dark,{mode:Ee,setMode:fe,systemMode:xe,lightColorScheme:he,darkColorScheme:me,colorScheme:le,setColorScheme:ce}=Wh({supportedColorSchemes:be,defaultLightColorScheme:ae,defaultDarkColorScheme:de,modeStorageKey:S,colorSchemeStorageKey:k,defaultMode:R,storageWindow:O});let Ae=Ee,ie=le;G&&(Ae=_.mode,ie=_.colorScheme);const ze=Ae||(R==="system"?s:R),Pe=ie||(ze==="dark"?de:ae),{css:Oe,vars:je}=re(),Ie=u({},te,{components:Se,colorSchemes:Re,cssVarPrefix:pe,vars:je,getColorSchemeSelector:N=>`[${f}="${N}"] &`}),Le={},Ke={};Object.entries(Re).forEach(([N,Q])=>{const{css:$e,vars:Te}=re(N);Ie.vars=ct(Ie.vars,Te),N===Pe&&(Object.keys(Q).forEach(ge=>{Q[ge]&&typeof Q[ge]=="object"?Ie[ge]=u({},Ie[ge],Q[ge]):Ie[ge]=Q[ge]}),Ie.palette&&(Ie.palette.colorScheme=N));const J=typeof T=="string"?T:R==="dark"?T.dark:T.light;if(N===J){if(d){const ge={};d(pe).forEach(q=>{ge[q]=$e[q],delete $e[q]}),Le[`[${f}="${N}"]`]=ge}Le[`${E}, [${f}="${N}"]`]=$e}else Ke[`${E===":root"?"":E}[${f}="${N}"]`]=$e}),Ie.vars=ct(Ie.vars,je),p.useEffect(()=>{ie&&L&&L.setAttribute(f,ie)},[ie,f,L]),p.useEffect(()=>{let N;if(w&&W.current&&j){const Q=j.createElement("style");Q.appendChild(j.createTextNode(Vh)),j.head.appendChild(Q),window.getComputedStyle(j.body),N=setTimeout(()=>{j.head.removeChild(Q)},1)}return()=>{clearTimeout(N)}},[ie,w,j]),p.useEffect(()=>(W.current=!0,()=>{W.current=!1}),[]);const qe=p.useMemo(()=>({allColorSchemes:be,colorScheme:ie,darkColorScheme:me,lightColorScheme:he,mode:Ae,setColorScheme:ce,setMode:fe,systemMode:xe}),[be,ie,me,he,Ae,ce,fe,xe]);let We=!0;(z||G&&(H==null?void 0:H.cssVarPrefix)===pe)&&(We=!1);const U=g.jsxs(p.Fragment,{children:[We&&g.jsxs(p.Fragment,{children:[g.jsx(cn,{styles:{[E]:Oe}}),g.jsx(cn,{styles:Le}),g.jsx(cn,{styles:Ke})]}),g.jsx(gd,{themeId:se?t:void 0,theme:c?c(Ie):Ie,children:P})]});return G?U:g.jsx(m.Provider,{value:qe,children:U})}const b=typeof i=="string"?i:i.light,h=typeof i=="string"?i:i.dark;return{CssVarsProvider:y,useColorScheme:v,getInitColorSchemeScript:x=>Dh(u({attribute:r,colorSchemeStorageKey:a,defaultMode:s,defaultLightColorScheme:b,defaultDarkColorScheme:h,modeStorageKey:n},x))}}function Gh(e=""){function t(...r){if(!r.length)return"";const n=r[0];return typeof n=="string"&&!n.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${n}${t(...r.slice(1))})`:`, ${n}`}return(r,...n)=>`var(--${e?`${e}-`:""}${r}${t(...n)})`}const Wl=(e,t,o,r=[])=>{let n=e;t.forEach((a,s)=>{s===t.length-1?Array.isArray(n)?n[Number(a)]=o:n&&typeof n=="object"&&(n[a]=o):n&&typeof n=="object"&&(n[a]||(n[a]=r.includes(a)?[]:{}),n=n[a])})},Kh=(e,t,o)=>{function r(n,a=[],s=[]){Object.entries(n).forEach(([i,l])=>{(!o||o&&!o([...a,i]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...a,i],Array.isArray(l)?[...s,i]:s):t([...a,i],l,s))})}r(e)},qh=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().indexOf("opacity")>=0?t:`${t}px`:t;function Es(e,t){const{prefix:o,shouldSkipGeneratingVar:r}=t||{},n={},a={},s={};return Kh(e,(i,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(i,l))){const d=`--${o?`${o}-`:""}${i.join("-")}`;Object.assign(n,{[d]:qh(i,l)}),Wl(a,i,`var(${d})`,c),Wl(s,i,`var(${d}, ${l})`,c)}},i=>i[0]==="vars"),{css:n,vars:a,varsWithDefaults:s}}function xn(e){"@babel/helpers - typeof";return xn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xn(e)}function Yh(e,t){if(xn(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var r=o.call(e,t);if(xn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xh(e){var t=Yh(e,"string");return xn(t)=="symbol"?t:t+""}const Zh=["colorSchemes","components","defaultColorScheme"];function Jh(e,t){const{colorSchemes:o={},defaultColorScheme:r="light"}=e,n=F(e,Zh),{vars:a,css:s,varsWithDefaults:i}=Es(n,t);let l=i;const c={},{[r]:d}=o,m=F(o,[r].map(Xh));if(Object.entries(m||{}).forEach(([y,b])=>{const{vars:h,css:C,varsWithDefaults:x}=Es(b,t);l=ct(l,x),c[y]={css:C,vars:h}}),d){const{css:y,vars:b,varsWithDefaults:h}=Es(d,t);l=ct(l,h),c[r]={css:y,vars:b}}return{vars:l,generateCssVars:y=>{var b;if(!y){var h;const x=u({},s);return{css:x,vars:a,selector:(t==null||(h=t.getSelector)==null?void 0:h.call(t,y,x))||":root"}}const C=u({},c[y].css);return{css:C,vars:c[y].vars,selector:(t==null||(b=t.getSelector)==null?void 0:b.call(t,y,C))||":root"}}}}const Qh=["className","component","disableGutters","fixed","maxWidth","classes"],ev=fr(),tv=Bi("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[`maxWidth${I(String(o.maxWidth))}`],o.fixed&&t.fixed,o.disableGutters&&t.disableGutters]}}),ov=e=>ls({props:e,name:"MuiContainer",defaultTheme:ev}),rv=(e,t)=>{const o=l=>Y(t,l),{classes:r,fixed:n,disableGutters:a,maxWidth:s}=e,i={root:["root",s&&`maxWidth${I(String(s))}`,n&&"fixed",a&&"disableGutters"]};return Z(i,o,r)};function nv(e={}){const{createStyledComponent:t=tv,useThemeProps:o=ov,componentName:r="MuiContainer"}=e,n=t(({theme:s,ownerState:i})=>u({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!i.disableGutters&&{paddingLeft:s.spacing(2),paddingRight:s.spacing(2),[s.breakpoints.up("sm")]:{paddingLeft:s.spacing(3),paddingRight:s.spacing(3)}}),({theme:s,ownerState:i})=>i.fixed&&Object.keys(s.breakpoints.values).reduce((l,c)=>{const d=c,m=s.breakpoints.values[d];return m!==0&&(l[s.breakpoints.up(d)]={maxWidth:`${m}${s.breakpoints.unit}`}),l},{}),({theme:s,ownerState:i})=>u({},i.maxWidth==="xs"&&{[s.breakpoints.up("xs")]:{maxWidth:Math.max(s.breakpoints.values.xs,444)}},i.maxWidth&&i.maxWidth!=="xs"&&{[s.breakpoints.up(i.maxWidth)]:{maxWidth:`${s.breakpoints.values[i.maxWidth]}${s.breakpoints.unit}`}}));return p.forwardRef(function(i,l){const c=o(i),{className:d,component:m="div",disableGutters:v=!1,fixed:y=!1,maxWidth:b="lg"}=c,h=F(c,Qh),C=u({},c,{component:m,disableGutters:v,fixed:y,maxWidth:b}),x=rv(C,r);return g.jsx(n,u({as:m,ownerState:C,className:D(x.root,d),ref:l},h))})}const av=(e,t)=>e.filter(o=>t.includes(o)),Kr=(e,t,o)=>{const r=e.keys[0];Array.isArray(t)?t.forEach((n,a)=>{o((s,i)=>{a<=e.keys.length-1&&(a===0?Object.assign(s,i):s[e.up(e.keys[a])]=i)},n)}):t&&typeof t=="object"?(Object.keys(t).length>e.keys.length?e.keys:av(e.keys,Object.keys(t))).forEach(a=>{if(e.keys.indexOf(a)!==-1){const s=t[a];s!==void 0&&o((i,l)=>{r===a?Object.assign(i,l):i[e.up(a)]=l},s)}}):(typeof t=="number"||typeof t=="string")&&o((n,a)=>{Object.assign(n,a)},t)};function Eo(e){return e?`Level${e}`:""}function Ln(e){return e.unstable_level>0&&e.container}function bd(e){return function(o){return`var(--Grid-${o}Spacing${Eo(e.unstable_level)})`}}function Fi(e){return function(o){return e.unstable_level===0?`var(--Grid-${o}Spacing)`:`var(--Grid-${o}Spacing${Eo(e.unstable_level-1)})`}}function Wi(e){return e.unstable_level===0?"var(--Grid-columns)":`var(--Grid-columns${Eo(e.unstable_level-1)})`}const sv=({theme:e,ownerState:t})=>{const o=bd(t),r={};return Kr(e.breakpoints,t.gridSize,(n,a)=>{let s={};a===!0&&(s={flexBasis:0,flexGrow:1,maxWidth:"100%"}),a==="auto"&&(s={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"}),typeof a=="number"&&(s={flexGrow:0,flexBasis:"auto",width:`calc(100% * ${a} / ${Wi(t)}${Ln(t)?` + ${o("column")}`:""})`}),n(r,s)}),r},iv=({theme:e,ownerState:t})=>{const o={};return Kr(e.breakpoints,t.gridOffset,(r,n)=>{let a={};n==="auto"&&(a={marginLeft:"auto"}),typeof n=="number"&&(a={marginLeft:n===0?"0px":`calc(100% * ${n} / ${Wi(t)})`}),r(o,a)}),o},lv=({theme:e,ownerState:t})=>{if(!t.container)return{};const o=Ln(t)?{[`--Grid-columns${Eo(t.unstable_level)}`]:Wi(t)}:{"--Grid-columns":12};return Kr(e.breakpoints,t.columns,(r,n)=>{r(o,{[`--Grid-columns${Eo(t.unstable_level)}`]:n})}),o},cv=({theme:e,ownerState:t})=>{if(!t.container)return{};const o=Fi(t),r=Ln(t)?{[`--Grid-rowSpacing${Eo(t.unstable_level)}`]:o("row")}:{};return Kr(e.breakpoints,t.rowSpacing,(n,a)=>{var s;n(r,{[`--Grid-rowSpacing${Eo(t.unstable_level)}`]:typeof a=="string"?a:(s=e.spacing)==null?void 0:s.call(e,a)})}),r},uv=({theme:e,ownerState:t})=>{if(!t.container)return{};const o=Fi(t),r=Ln(t)?{[`--Grid-columnSpacing${Eo(t.unstable_level)}`]:o("column")}:{};return Kr(e.breakpoints,t.columnSpacing,(n,a)=>{var s;n(r,{[`--Grid-columnSpacing${Eo(t.unstable_level)}`]:typeof a=="string"?a:(s=e.spacing)==null?void 0:s.call(e,a)})}),r},dv=({theme:e,ownerState:t})=>{if(!t.container)return{};const o={};return Kr(e.breakpoints,t.direction,(r,n)=>{r(o,{flexDirection:n})}),o},pv=({ownerState:e})=>{const t=bd(e),o=Fi(e);return u({minWidth:0,boxSizing:"border-box"},e.container&&u({display:"flex",flexWrap:"wrap"},e.wrap&&e.wrap!=="wrap"&&{flexWrap:e.wrap},{margin:`calc(${t("row")} / -2) calc(${t("column")} / -2)`},e.disableEqualOverflow&&{margin:`calc(${t("row")} * -1) 0px 0px calc(${t("column")} * -1)`}),(!e.container||Ln(e))&&u({padding:`calc(${o("row")} / 2) calc(${o("column")} / 2)`},(e.disableEqualOverflow||e.parentDisableEqualOverflow)&&{padding:`${o("row")} 0px 0px ${o("column")}`}))},fv=e=>{const t=[];return Object.entries(e).forEach(([o,r])=>{r!==!1&&r!==void 0&&t.push(`grid-${o}-${String(r)}`)}),t},mv=(e,t="xs")=>{function o(r){return r===void 0?!1:typeof r=="string"&&!Number.isNaN(Number(r))||typeof r=="number"&&r>0}if(o(e))return[`spacing-${t}-${String(e)}`];if(typeof e=="object"&&!Array.isArray(e)){const r=[];return Object.entries(e).forEach(([n,a])=>{o(a)&&r.push(`spacing-${n}-${String(a)}`)}),r}return[]},gv=e=>e===void 0?[]:typeof e=="object"?Object.entries(e).map(([t,o])=>`direction-${t}-${o}`):[`direction-xs-${String(e)}`],hv=["className","children","columns","container","component","direction","wrap","spacing","rowSpacing","columnSpacing","disableEqualOverflow","unstable_level"],vv=fr(),bv=Bi("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>t.root});function yv(e){return ls({props:e,name:"MuiGrid",defaultTheme:vv})}function xv(e={}){const{createStyledComponent:t=bv,useThemeProps:o=yv,componentName:r="MuiGrid"}=e,n=p.createContext(void 0),a=(l,c)=>{const{container:d,direction:m,spacing:v,wrap:y,gridSize:b}=l,h={root:["root",d&&"container",y!=="wrap"&&`wrap-xs-${String(y)}`,...gv(m),...fv(b),...d?mv(v,c.breakpoints.keys[0]):[]]};return Z(h,C=>Y(r,C),{})},s=t(lv,uv,cv,sv,dv,pv,iv),i=p.forwardRef(function(c,d){var m,v,y,b,h,C,x,P;const $=In(),S=o(c),k=Ur(S),f=p.useContext(n),{className:R,children:T,columns:w=12,container:O=!1,component:j="div",direction:L="row",wrap:E="wrap",spacing:B=0,rowSpacing:z=B,columnSpacing:W=B,disableEqualOverflow:H,unstable_level:_=0}=k,G=F(k,hv);let se=H;_&&H!==void 0&&(se=c.disableEqualOverflow);const ve={},Re={},Se={};Object.entries(G).forEach(([fe,xe])=>{$.breakpoints.values[fe]!==void 0?ve[fe]=xe:$.breakpoints.values[fe.replace("Offset","")]!==void 0?Re[fe.replace("Offset","")]=xe:Se[fe]=xe});const re=(m=c.columns)!=null?m:_?void 0:w,pe=(v=c.spacing)!=null?v:_?void 0:B,te=(y=(b=c.rowSpacing)!=null?b:c.spacing)!=null?y:_?void 0:z,be=(h=(C=c.columnSpacing)!=null?C:c.spacing)!=null?h:_?void 0:W,ae=u({},k,{level:_,columns:re,container:O,direction:L,wrap:E,spacing:pe,rowSpacing:te,columnSpacing:be,gridSize:ve,gridOffset:Re,disableEqualOverflow:(x=(P=se)!=null?P:f)!=null?x:!1,parentDisableEqualOverflow:f}),de=a(ae,$);let Ee=g.jsx(s,u({ref:d,as:j,ownerState:ae,className:D(de.root,R)},Se,{children:p.Children.map(T,fe=>{if(p.isValidElement(fe)&&sr(fe,["Grid"])){var xe,he;return p.cloneElement(fe,{unstable_level:(xe=(he=fe.props)==null?void 0:he.unstable_level)!=null?xe:_+1})}return fe})}));return se!==void 0&&se!==(f??!1)&&(Ee=g.jsx(n.Provider,{value:se,children:Ee})),Ee});return i.muiName="Grid",i}const Cv=["component","direction","spacing","divider","children","className","useFlexGap"],$v=fr(),Sv=Bi("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function Rv(e){return ls({props:e,name:"MuiStack",defaultTheme:$v})}function Pv(e,t){const o=p.Children.toArray(e).filter(Boolean);return o.reduce((r,n,a)=>(r.push(n),a({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],Tv=({ownerState:e,theme:t})=>{let o=u({display:"flex",flexDirection:"column"},At({theme:t},ar({values:e.direction,breakpoints:t.breakpoints.values}),r=>({flexDirection:r})));if(e.spacing){const r=Oi(t),n=Object.keys(t.breakpoints.values).reduce((l,c)=>((typeof e.spacing=="object"&&e.spacing[c]!=null||typeof e.direction=="object"&&e.direction[c]!=null)&&(l[c]=!0),l),{}),a=ar({values:e.direction,base:n}),s=ar({values:e.spacing,base:n});typeof a=="object"&&Object.keys(a).forEach((l,c,d)=>{if(!a[l]){const v=c>0?a[d[c-1]]:"column";a[l]=v}}),o=ct(o,At({theme:t},s,(l,c)=>e.useFlexGap?{gap:cr(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${kv(c?a[c]:e.direction)}`]:cr(r,l)}}))}return o=qm(t.breakpoints,o),o};function wv(e={}){const{createStyledComponent:t=Sv,useThemeProps:o=Rv,componentName:r="MuiStack"}=e,n=()=>Z({root:["root"]},l=>Y(r,l),{}),a=t(Tv);return p.forwardRef(function(l,c){const d=o(l),m=Ur(d),{component:v="div",direction:y="column",spacing:b=0,divider:h,children:C,className:x,useFlexGap:P=!1}=m,$=F(m,Cv),S={direction:y,spacing:b,useFlexGap:P},k=n();return g.jsx(a,u({as:v,ownerState:S,ref:c,className:D(k.root,x)},$,{children:h?Pv(C,h):C}))})}const Mv=["defaultProps","mixins","overrides","palette","props","styleOverrides"],Iv=["type","mode"];function Ov(e){const{defaultProps:t={},mixins:o={},overrides:r={},palette:n={},props:a={},styleOverrides:s={}}=e,i=F(e,Mv),l=u({},i,{components:{}});Object.keys(t).forEach(h=>{const C=l.components[h]||{};C.defaultProps=t[h],l.components[h]=C}),Object.keys(a).forEach(h=>{const C=l.components[h]||{};C.defaultProps=a[h],l.components[h]=C}),Object.keys(s).forEach(h=>{const C=l.components[h]||{};C.styleOverrides=s[h],l.components[h]=C}),Object.keys(r).forEach(h=>{const C=l.components[h]||{};C.styleOverrides=r[h],l.components[h]=C}),l.spacing=Gu(e.spacing);const c=Ti(e.breakpoints||{}),d=l.spacing;l.mixins=u({gutters:(h={})=>u({paddingLeft:d(2),paddingRight:d(2)},h,{[c.up("sm")]:u({paddingLeft:d(3),paddingRight:d(3)},h[c.up("sm")])})},o);const{type:m,mode:v}=n,y=F(n,Iv),b=v||m||"light";return l.palette=u({text:{hint:b==="dark"?"rgba(255, 255, 255, 0.5)":"rgba(0, 0, 0, 0.38)"},mode:b,type:b},y),l}function yd(e,t){return u({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}var dt={},xd={exports:{}};(function(e){function t(o){return o&&o.__esModule?o:{default:o}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(xd);var Cd=xd.exports;const Ev=Ao(hf),Lv=Ao(lh);var $d=Cd;Object.defineProperty(dt,"__esModule",{value:!0});var we=dt.alpha=kd;dt.blend=Gv;dt.colorChannel=void 0;var qo=dt.darken=Vi;dt.decomposeColor=Jt;var Av=dt.emphasize=Td,Bv=dt.getContrastRatio=Fv;dt.getLuminance=ya;dt.hexToRgb=Sd;var _v=dt.hslToRgb=Pd,Yo=dt.lighten=Ui,Wn=dt.private_safeAlpha=Wv,Tr=dt.private_safeColorChannel=void 0,Xe=dt.private_safeDarken=Hv,Hn=dt.private_safeEmphasize=Uv,Ze=dt.private_safeLighten=Vv;dt.recomposeColor=qr;dt.rgbToHex=Dv;var Hl=$d(Ev),Nv=$d(Lv);function Hi(e,t=0,o=1){return(0,Nv.default)(e,t,o)}function Sd(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let o=e.match(t);return o&&o[0].length===1&&(o=o.map(r=>r+r)),o?`rgb${o.length===4?"a":""}(${o.map((r,n)=>n<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function zv(e){const t=e.toString(16);return t.length===1?`0${t}`:t}function Jt(e){if(e.type)return e;if(e.charAt(0)==="#")return Jt(Sd(e));const t=e.indexOf("("),o=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(o)===-1)throw new Error((0,Hl.default)(9,e));let r=e.substring(t+1,e.length-1),n;if(o==="color"){if(r=r.split(" "),n=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(n)===-1)throw new Error((0,Hl.default)(10,n))}else r=r.split(",");return r=r.map(a=>parseFloat(a)),{type:o,values:r,colorSpace:n}}const Rd=e=>{const t=Jt(e);return t.values.slice(0,3).map((o,r)=>t.type.indexOf("hsl")!==-1&&r!==0?`${o}%`:o).join(" ")};dt.colorChannel=Rd;const jv=(e,t)=>{try{return Rd(e)}catch{return e}};Tr=dt.private_safeColorChannel=jv;function qr(e){const{type:t,colorSpace:o}=e;let{values:r}=e;return t.indexOf("rgb")!==-1?r=r.map((n,a)=>a<3?parseInt(n,10):n):t.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.indexOf("color")!==-1?r=`${o} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function Dv(e){if(e.indexOf("#")===0)return e;const{values:t}=Jt(e);return`#${t.map((o,r)=>zv(r===3?Math.round(255*o):o)).join("")}`}function Pd(e){e=Jt(e);const{values:t}=e,o=t[0],r=t[1]/100,n=t[2]/100,a=r*Math.min(n,1-n),s=(c,d=(c+o/30)%12)=>n-a*Math.max(Math.min(d-3,9-d,1),-1);let i="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(i+="a",l.push(t[3])),qr({type:i,values:l})}function ya(e){e=Jt(e);let t=e.type==="hsl"||e.type==="hsla"?Jt(Pd(e)).values:e.values;return t=t.map(o=>(e.type!=="color"&&(o/=255),o<=.03928?o/12.92:((o+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Fv(e,t){const o=ya(e),r=ya(t);return(Math.max(o,r)+.05)/(Math.min(o,r)+.05)}function kd(e,t){return e=Jt(e),t=Hi(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,qr(e)}function Wv(e,t,o){try{return kd(e,t)}catch{return e}}function Vi(e,t){if(e=Jt(e),t=Hi(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let o=0;o<3;o+=1)e.values[o]*=1-t;return qr(e)}function Hv(e,t,o){try{return Vi(e,t)}catch{return e}}function Ui(e,t){if(e=Jt(e),t=Hi(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let o=0;o<3;o+=1)e.values[o]+=(255-e.values[o])*t;else if(e.type.indexOf("color")!==-1)for(let o=0;o<3;o+=1)e.values[o]+=(1-e.values[o])*t;return qr(e)}function Vv(e,t,o){try{return Ui(e,t)}catch{return e}}function Td(e,t=.15){return ya(e)>.5?Vi(e,t):Ui(e,t)}function Uv(e,t,o){try{return Td(e,t)}catch{return e}}function Gv(e,t,o,r=1){const n=(l,c)=>Math.round((l**(1/r)*(1-o)+c**(1/r)*o)**r),a=Jt(e),s=Jt(t),i=[n(a.values[0],s.values[0]),n(a.values[1],s.values[1]),n(a.values[2],s.values[2])];return qr({type:"rgb",values:i})}const Kv=["mode","contrastThreshold","tonalOffset"],Vl={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:gn.white,default:gn.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},Ls={text:{primary:gn.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:gn.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function Ul(e,t,o,r){const n=r.light||r,a=r.dark||r*1.5;e[t]||(e.hasOwnProperty(o)?e[t]=e[o]:t==="light"?e.light=Yo(e.main,n):t==="dark"&&(e.dark=qo(e.main,a)))}function qv(e="light"){return e==="dark"?{main:hr[200],light:hr[50],dark:hr[400]}:{main:hr[700],light:hr[400],dark:hr[800]}}function Yv(e="light"){return e==="dark"?{main:gr[200],light:gr[50],dark:gr[400]}:{main:gr[500],light:gr[300],dark:gr[700]}}function Xv(e="light"){return e==="dark"?{main:mr[500],light:mr[300],dark:mr[700]}:{main:mr[700],light:mr[400],dark:mr[800]}}function Zv(e="light"){return e==="dark"?{main:vr[400],light:vr[300],dark:vr[700]}:{main:vr[700],light:vr[500],dark:vr[900]}}function Jv(e="light"){return e==="dark"?{main:br[400],light:br[300],dark:br[700]}:{main:br[800],light:br[500],dark:br[900]}}function Qv(e="light"){return e==="dark"?{main:Zr[400],light:Zr[300],dark:Zr[700]}:{main:"#ed6c02",light:Zr[500],dark:Zr[900]}}function eb(e){const{mode:t="light",contrastThreshold:o=3,tonalOffset:r=.2}=e,n=F(e,Kv),a=e.primary||qv(t),s=e.secondary||Yv(t),i=e.error||Xv(t),l=e.info||Zv(t),c=e.success||Jv(t),d=e.warning||Qv(t);function m(h){return Bv(h,Ls.text.primary)>=o?Ls.text.primary:Vl.text.primary}const v=({color:h,name:C,mainShade:x=500,lightShade:P=300,darkShade:$=700})=>{if(h=u({},h),!h.main&&h[x]&&(h.main=h[x]),!h.hasOwnProperty("main"))throw new Error(Pt(11,C?` (${C})`:"",x));if(typeof h.main!="string")throw new Error(Pt(12,C?` (${C})`:"",JSON.stringify(h.main)));return Ul(h,"light",P,r),Ul(h,"dark",$,r),h.contrastText||(h.contrastText=m(h.main)),h},y={dark:Ls,light:Vl};return ct(u({common:u({},gn),mode:t,primary:v({color:a,name:"primary"}),secondary:v({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:v({color:i,name:"error"}),warning:v({color:d,name:"warning"}),info:v({color:l,name:"info"}),success:v({color:c,name:"success"}),grey:gf,contrastThreshold:o,getContrastText:m,augmentColor:v,tonalOffset:r},y[t]),n)}const tb=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function ob(e){return Math.round(e*1e5)/1e5}const Gl={textTransform:"uppercase"},Kl='"Roboto", "Helvetica", "Arial", sans-serif';function Gi(e,t){const o=typeof t=="function"?t(e):t,{fontFamily:r=Kl,fontSize:n=14,fontWeightLight:a=300,fontWeightRegular:s=400,fontWeightMedium:i=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:d,pxToRem:m}=o,v=F(o,tb),y=n/14,b=m||(x=>`${x/c*y}rem`),h=(x,P,$,S,k)=>u({fontFamily:r,fontWeight:x,fontSize:b(P),lineHeight:$},r===Kl?{letterSpacing:`${ob(S/P)}em`}:{},k,d),C={h1:h(a,96,1.167,-1.5),h2:h(a,60,1.2,-.5),h3:h(s,48,1.167,0),h4:h(s,34,1.235,.25),h5:h(s,24,1.334,0),h6:h(i,20,1.6,.15),subtitle1:h(s,16,1.75,.15),subtitle2:h(i,14,1.57,.1),body1:h(s,16,1.5,.15),body2:h(s,14,1.43,.15),button:h(i,14,1.75,.4,Gl),caption:h(s,12,1.66,.4),overline:h(s,12,2.66,1,Gl),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ct(u({htmlFontSize:c,pxToRem:b,fontFamily:r,fontSize:n,fontWeightLight:a,fontWeightRegular:s,fontWeightMedium:i,fontWeightBold:l},C),v,{clone:!1})}const rb=.2,nb=.14,ab=.12;function tt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${rb})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${nb})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${ab})`].join(",")}const sb=["none",tt(0,2,1,-1,0,1,1,0,0,1,3,0),tt(0,3,1,-2,0,2,2,0,0,1,5,0),tt(0,3,3,-2,0,3,4,0,0,1,8,0),tt(0,2,4,-1,0,4,5,0,0,1,10,0),tt(0,3,5,-1,0,5,8,0,0,1,14,0),tt(0,3,5,-1,0,6,10,0,0,1,18,0),tt(0,4,5,-2,0,7,10,1,0,2,16,1),tt(0,5,5,-3,0,8,10,1,0,3,14,2),tt(0,5,6,-3,0,9,12,1,0,3,16,2),tt(0,6,6,-3,0,10,14,1,0,4,18,3),tt(0,6,7,-4,0,11,15,1,0,4,20,3),tt(0,7,8,-4,0,12,17,2,0,5,22,4),tt(0,7,8,-4,0,13,19,2,0,5,24,4),tt(0,7,9,-4,0,14,21,2,0,5,26,4),tt(0,8,9,-5,0,15,22,2,0,6,28,5),tt(0,8,10,-5,0,16,24,2,0,6,30,5),tt(0,8,11,-5,0,17,26,2,0,6,32,5),tt(0,9,11,-5,0,18,28,2,0,7,34,6),tt(0,9,12,-6,0,19,29,2,0,7,36,6),tt(0,10,13,-6,0,20,31,3,0,8,38,7),tt(0,10,13,-6,0,21,33,3,0,8,40,7),tt(0,10,14,-6,0,22,35,3,0,8,42,7),tt(0,11,14,-7,0,23,36,3,0,9,44,8),tt(0,11,15,-7,0,24,38,3,0,9,46,8)],ib=["duration","easing","delay"],wd={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Ki={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function ql(e){return`${Math.round(e)}ms`}function lb(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function cb(e){const t=u({},wd,e.easing),o=u({},Ki,e.duration);return u({getAutoHeightDuration:lb,create:(n=["all"],a={})=>{const{duration:s=o.standard,easing:i=t.easeInOut,delay:l=0}=a;return F(a,ib),(Array.isArray(n)?n:[n]).map(c=>`${c} ${typeof s=="string"?s:ql(s)} ${i} ${typeof l=="string"?l:ql(l)}`).join(",")}},e,{easing:t,duration:o})}const ub={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},db=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function ur(e={},...t){const{mixins:o={},palette:r={},transitions:n={},typography:a={}}=e,s=F(e,db);if(e.vars&&e.generateCssVars===void 0)throw new Error(Pt(18));const i=eb(r),l=fr(e);let c=ct(l,{mixins:yd(l.breakpoints,o),palette:i,shadows:sb.slice(),typography:Gi(i,a),transitions:cb(n),zIndex:u({},ub)});return c=ct(c,s),c=t.reduce((d,m)=>ct(d,m),c),c.unstable_sxConfig=u({},Vr,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(m){return Xo({sx:m,theme:this})},c}function pb(...e){return ur(...e)}function fb(e,...t){return ur(ct({unstable_strictMode:!0},e),...t)}let Yl=!1;function mb(e){return Yl||(console.warn(["MUI: createStyles from @mui/material/styles is deprecated.","Please use @mui/styles/createStyles"].join(` +`)),Yl=!0),e}function Xl(e){return String(parseFloat(e)).length===String(e).length}function Md(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function Vo(e){return parseFloat(e)}function gb(e){return(t,o)=>{const r=Md(t);if(r===o)return t;let n=Vo(t);r!=="px"&&(r==="em"||r==="rem")&&(n=Vo(t)*Vo(e));let a=n;if(o!=="px")if(o==="em")a=n/Vo(e);else if(o==="rem")a=n/Vo(e);else return t;return parseFloat(a.toFixed(5))+o}}function hb({size:e,grid:t}){const o=e-e%t,r=o+t;return e-o{let c=t+i*l;a!==null&&(c=a(c)),s[`@media (min-width:${l}px)`]={[e]:`${Math.round(c*1e4)/1e4}${r}`}}),s}function yb(e,t={}){const{breakpoints:o=["sm","md","lg"],disableAlign:r=!1,factor:n=2,variants:a=["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","caption","button","overline"]}=t,s=u({},e);s.typography=u({},s.typography);const i=s.typography,l=gb(i.htmlFontSize),c=o.map(d=>s.breakpoints.values[d]);return a.forEach(d=>{const m=i[d];if(!m)return;const v=parseFloat(l(m.fontSize,"rem"));if(v<=1)return;const y=v,b=1+(y-1)/n;let{lineHeight:h}=m;if(!Xl(h)&&!r)throw new Error(Pt(6));Xl(h)||(h=parseFloat(l(h,"rem"))/parseFloat(v));let C=null;r||(C=x=>hb({size:x,grid:vb({pixels:4,lineHeight:h,htmlFontSize:i.htmlFontSize})})),i[d]=u({},m,bb({cssProperty:"fontSize",min:b,max:y,unit:"rem",breakpoints:c,transform:C}))}),s}const ds=ur();function ro(){const e=In(ds);return e[Io]||e}function zo({props:e,name:t}){return ls({props:e,name:t,defaultTheme:ds,themeId:Io})}var An={};const xb=Ao(vf);var As={exports:{}},Zl;function Cb(){return Zl||(Zl=1,function(e){function t(o,r){if(o==null)return{};var n={};for(var a in o)if({}.hasOwnProperty.call(o,a)){if(r.indexOf(a)!==-1)continue;n[a]=o[a]}return n}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(As)),As.exports}const Id=Ao(Hm),$b=Ao(Vm),Sb=Ao(Xm),Rb=Ao(Xg),Pb=Ao(_g),kb=Ao(Fg);var Yr=Cd;Object.defineProperty(An,"__esModule",{value:!0});var Tb=An.default=Db;An.shouldForwardProp=la;An.systemDefaultTheme=void 0;var Vt=Yr(xb),ei=Yr(Cb()),xa=Ab(Id),wb=$b;Yr(Sb);Yr(Rb);var Mb=Yr(Pb),Ib=Yr(kb);const Ob=["ownerState"],Eb=["variants"],Lb=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function Od(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,o=new WeakMap;return(Od=function(r){return r?o:t})(e)}function Ab(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var o=Od(t);if(o&&o.has(e))return o.get(e);var r={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var s=n?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,o&&o.set(e,r),r}function Bb(e){return Object.keys(e).length===0}function _b(e){return typeof e=="string"&&e.charCodeAt(0)>96}function la(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function Jl(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}const Nb=An.systemDefaultTheme=(0,Mb.default)(),zb=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function Vn({defaultTheme:e,theme:t,themeId:o}){return Bb(t)?e:t[o]||t}function jb(e){return e?(t,o)=>o[e]:null}function ca(e,t,o){let{ownerState:r}=t,n=(0,ei.default)(t,Ob);const a=typeof e=="function"?e((0,Vt.default)({ownerState:r},n)):e;if(Array.isArray(a))return a.flatMap(s=>ca(s,(0,Vt.default)({ownerState:r},n),o));if(a&&typeof a=="object"&&Array.isArray(a.variants)){const{variants:s=[]}=a;let l=(0,ei.default)(a,Eb);return s.forEach(c=>{let d=!0;if(typeof c.props=="function"?d=c.props((0,Vt.default)({ownerState:r},n,r)):Object.keys(c.props).forEach(m=>{(r==null?void 0:r[m])!==c.props[m]&&n[m]!==c.props[m]&&(d=!1)}),d){Array.isArray(l)||(l=[l]);const m=typeof c.style=="function"?c.style((0,Vt.default)({ownerState:r},n,r)):c.style;l.push(o?Jl((0,xa.internal_serializeStyles)(m),o):m)}}),l}return o?Jl((0,xa.internal_serializeStyles)(a),o):a}function Db(e={}){const{themeId:t,defaultTheme:o=Nb,rootShouldForwardProp:r=la,slotShouldForwardProp:n=la}=e,a=s=>(0,Ib.default)((0,Vt.default)({},s,{theme:Vn((0,Vt.default)({},s,{defaultTheme:o,themeId:t}))}));return a.__mui_systemSx=!0,(s,i={})=>{(0,xa.internal_processStyles)(s,f=>f.filter(R=>!(R!=null&&R.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:d,skipSx:m,overridesResolver:v=jb(zb(c))}=i,y=(0,ei.default)(i,Lb),b=l&&l.startsWith("Mui")||c?"components":"custom",h=d!==void 0?d:c&&c!=="Root"&&c!=="root"||!1,C=m||!1;let x,P=la;c==="Root"||c==="root"?P=r:c?P=n:_b(s)&&(P=void 0);const $=(0,xa.default)(s,(0,Vt.default)({shouldForwardProp:P,label:x},y)),S=f=>typeof f=="function"&&f.__emotion_real!==f||(0,wb.isPlainObject)(f)?R=>{const T=Vn({theme:R.theme,defaultTheme:o,themeId:t});return ca(f,(0,Vt.default)({},R,{theme:T}),T.modularCssLayers?b:void 0)}:f,k=(f,...R)=>{let T=S(f);const w=R?R.map(S):[];l&&v&&w.push(L=>{const E=Vn((0,Vt.default)({},L,{defaultTheme:o,themeId:t}));if(!E.components||!E.components[l]||!E.components[l].styleOverrides)return null;const B=E.components[l].styleOverrides,z={};return Object.entries(B).forEach(([W,H])=>{z[W]=ca(H,(0,Vt.default)({},L,{theme:E}),E.modularCssLayers?"theme":void 0)}),v(L,z)}),l&&!h&&w.push(L=>{var E;const B=Vn((0,Vt.default)({},L,{defaultTheme:o,themeId:t})),z=B==null||(E=B.components)==null||(E=E[l])==null?void 0:E.variants;return ca({variants:z},(0,Vt.default)({},L,{theme:B}),B.modularCssLayers?"theme":void 0)}),C||w.push(a);const O=w.length-R.length;if(Array.isArray(f)&&O>0){const L=new Array(O).fill("");T=[...f,...L],T.raw=[...f.raw,...L]}const j=$(T,...w);return s.muiName&&(j.muiName=s.muiName),j};return $.withConfig&&(k.withConfig=$.withConfig),k}}function ps(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const gt=e=>ps(e)&&e!=="classes",M=Tb({themeId:Io,defaultTheme:ds,rootShouldForwardProp:gt}),Fb=["theme"];function Wb(e){let{theme:t}=e,o=F(e,Fb);const r=t[Io];let n=r||t;return typeof t!="function"&&(r&&!r.vars?n=u({},r,{vars:null}):t&&!t.vars&&(n=u({},t,{vars:null}))),g.jsx(gd,u({},o,{themeId:r?Io:void 0,theme:n}))}function Hb(){throw new Error(Pt(14))}function Vb(){throw new Error(Pt(15))}function Ub(){throw new Error(Pt(16))}function Ed(e){var t;return!!e[0].match(/(cssVarPrefix|modularCssLayers|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const Ca=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},Gb=["colorSchemes","cssVarPrefix","shouldSkipGeneratingVar"],Kb=["palette"],qb=[...Array(25)].map((e,t)=>{if(t===0)return;const o=Ca(t);return`linear-gradient(rgba(255 255 255 / ${o}), rgba(255 255 255 / ${o}))`});function Yb(e,t){t.forEach(o=>{e[o]||(e[o]={})})}function K(e,t,o){!e[t]&&o&&(e[t]=o)}function an(e){return!e||!e.startsWith("hsl")?e:_v(e)}function ko(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Tr(an(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color(). +To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}const ho=e=>{try{return e()}catch{}},Xb=(e="mui")=>Gh(e);function Ld(e={},...t){var o,r,n,a,s,i;const{colorSchemes:l={},cssVarPrefix:c="mui",shouldSkipGeneratingVar:d=Ed}=e,m=F(e,Gb),v=Xb(c),y=ur(u({},m,l.light&&{palette:(o=l.light)==null?void 0:o.palette})),{palette:b}=y,h=F(y,Kb),{palette:C}=ur({palette:u({mode:"dark"},(r=l.dark)==null?void 0:r.palette)});let x=u({},h,{cssVarPrefix:c,getCssVar:v,colorSchemes:u({},l,{light:u({},l.light,{palette:b,opacity:u({inputPlaceholder:.42,inputUnderline:.42,switchTrackDisabled:.12,switchTrack:.38},(n=l.light)==null?void 0:n.opacity),overlays:((a=l.light)==null?void 0:a.overlays)||[]}),dark:u({},l.dark,{palette:C,opacity:u({inputPlaceholder:.5,inputUnderline:.7,switchTrackDisabled:.2,switchTrack:.3},(s=l.dark)==null?void 0:s.opacity),overlays:((i=l.dark)==null?void 0:i.overlays)||qb})})});Object.keys(x.colorSchemes).forEach(k=>{const f=x.colorSchemes[k].palette,R=T=>{const w=T.split("-"),O=w[1],j=w[2];return v(T,f[O][j])};if(k==="light"?(K(f.common,"background","#fff"),K(f.common,"onBackground","#000")):(K(f.common,"background","#000"),K(f.common,"onBackground","#fff")),Yb(f,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),k==="light"){K(f.Alert,"errorColor",Xe(f.error.light,.6)),K(f.Alert,"infoColor",Xe(f.info.light,.6)),K(f.Alert,"successColor",Xe(f.success.light,.6)),K(f.Alert,"warningColor",Xe(f.warning.light,.6)),K(f.Alert,"errorFilledBg",R("palette-error-main")),K(f.Alert,"infoFilledBg",R("palette-info-main")),K(f.Alert,"successFilledBg",R("palette-success-main")),K(f.Alert,"warningFilledBg",R("palette-warning-main")),K(f.Alert,"errorFilledColor",ho(()=>b.getContrastText(f.error.main))),K(f.Alert,"infoFilledColor",ho(()=>b.getContrastText(f.info.main))),K(f.Alert,"successFilledColor",ho(()=>b.getContrastText(f.success.main))),K(f.Alert,"warningFilledColor",ho(()=>b.getContrastText(f.warning.main))),K(f.Alert,"errorStandardBg",Ze(f.error.light,.9)),K(f.Alert,"infoStandardBg",Ze(f.info.light,.9)),K(f.Alert,"successStandardBg",Ze(f.success.light,.9)),K(f.Alert,"warningStandardBg",Ze(f.warning.light,.9)),K(f.Alert,"errorIconColor",R("palette-error-main")),K(f.Alert,"infoIconColor",R("palette-info-main")),K(f.Alert,"successIconColor",R("palette-success-main")),K(f.Alert,"warningIconColor",R("palette-warning-main")),K(f.AppBar,"defaultBg",R("palette-grey-100")),K(f.Avatar,"defaultBg",R("palette-grey-400")),K(f.Button,"inheritContainedBg",R("palette-grey-300")),K(f.Button,"inheritContainedHoverBg",R("palette-grey-A100")),K(f.Chip,"defaultBorder",R("palette-grey-400")),K(f.Chip,"defaultAvatarColor",R("palette-grey-700")),K(f.Chip,"defaultIconColor",R("palette-grey-700")),K(f.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),K(f.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),K(f.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),K(f.LinearProgress,"primaryBg",Ze(f.primary.main,.62)),K(f.LinearProgress,"secondaryBg",Ze(f.secondary.main,.62)),K(f.LinearProgress,"errorBg",Ze(f.error.main,.62)),K(f.LinearProgress,"infoBg",Ze(f.info.main,.62)),K(f.LinearProgress,"successBg",Ze(f.success.main,.62)),K(f.LinearProgress,"warningBg",Ze(f.warning.main,.62)),K(f.Skeleton,"bg",`rgba(${R("palette-text-primaryChannel")} / 0.11)`),K(f.Slider,"primaryTrack",Ze(f.primary.main,.62)),K(f.Slider,"secondaryTrack",Ze(f.secondary.main,.62)),K(f.Slider,"errorTrack",Ze(f.error.main,.62)),K(f.Slider,"infoTrack",Ze(f.info.main,.62)),K(f.Slider,"successTrack",Ze(f.success.main,.62)),K(f.Slider,"warningTrack",Ze(f.warning.main,.62));const T=Hn(f.background.default,.8);K(f.SnackbarContent,"bg",T),K(f.SnackbarContent,"color",ho(()=>b.getContrastText(T))),K(f.SpeedDialAction,"fabHoverBg",Hn(f.background.paper,.15)),K(f.StepConnector,"border",R("palette-grey-400")),K(f.StepContent,"border",R("palette-grey-400")),K(f.Switch,"defaultColor",R("palette-common-white")),K(f.Switch,"defaultDisabledColor",R("palette-grey-100")),K(f.Switch,"primaryDisabledColor",Ze(f.primary.main,.62)),K(f.Switch,"secondaryDisabledColor",Ze(f.secondary.main,.62)),K(f.Switch,"errorDisabledColor",Ze(f.error.main,.62)),K(f.Switch,"infoDisabledColor",Ze(f.info.main,.62)),K(f.Switch,"successDisabledColor",Ze(f.success.main,.62)),K(f.Switch,"warningDisabledColor",Ze(f.warning.main,.62)),K(f.TableCell,"border",Ze(Wn(f.divider,1),.88)),K(f.Tooltip,"bg",Wn(f.grey[700],.92))}else{K(f.Alert,"errorColor",Ze(f.error.light,.6)),K(f.Alert,"infoColor",Ze(f.info.light,.6)),K(f.Alert,"successColor",Ze(f.success.light,.6)),K(f.Alert,"warningColor",Ze(f.warning.light,.6)),K(f.Alert,"errorFilledBg",R("palette-error-dark")),K(f.Alert,"infoFilledBg",R("palette-info-dark")),K(f.Alert,"successFilledBg",R("palette-success-dark")),K(f.Alert,"warningFilledBg",R("palette-warning-dark")),K(f.Alert,"errorFilledColor",ho(()=>C.getContrastText(f.error.dark))),K(f.Alert,"infoFilledColor",ho(()=>C.getContrastText(f.info.dark))),K(f.Alert,"successFilledColor",ho(()=>C.getContrastText(f.success.dark))),K(f.Alert,"warningFilledColor",ho(()=>C.getContrastText(f.warning.dark))),K(f.Alert,"errorStandardBg",Xe(f.error.light,.9)),K(f.Alert,"infoStandardBg",Xe(f.info.light,.9)),K(f.Alert,"successStandardBg",Xe(f.success.light,.9)),K(f.Alert,"warningStandardBg",Xe(f.warning.light,.9)),K(f.Alert,"errorIconColor",R("palette-error-main")),K(f.Alert,"infoIconColor",R("palette-info-main")),K(f.Alert,"successIconColor",R("palette-success-main")),K(f.Alert,"warningIconColor",R("palette-warning-main")),K(f.AppBar,"defaultBg",R("palette-grey-900")),K(f.AppBar,"darkBg",R("palette-background-paper")),K(f.AppBar,"darkColor",R("palette-text-primary")),K(f.Avatar,"defaultBg",R("palette-grey-600")),K(f.Button,"inheritContainedBg",R("palette-grey-800")),K(f.Button,"inheritContainedHoverBg",R("palette-grey-700")),K(f.Chip,"defaultBorder",R("palette-grey-700")),K(f.Chip,"defaultAvatarColor",R("palette-grey-300")),K(f.Chip,"defaultIconColor",R("palette-grey-300")),K(f.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),K(f.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),K(f.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),K(f.LinearProgress,"primaryBg",Xe(f.primary.main,.5)),K(f.LinearProgress,"secondaryBg",Xe(f.secondary.main,.5)),K(f.LinearProgress,"errorBg",Xe(f.error.main,.5)),K(f.LinearProgress,"infoBg",Xe(f.info.main,.5)),K(f.LinearProgress,"successBg",Xe(f.success.main,.5)),K(f.LinearProgress,"warningBg",Xe(f.warning.main,.5)),K(f.Skeleton,"bg",`rgba(${R("palette-text-primaryChannel")} / 0.13)`),K(f.Slider,"primaryTrack",Xe(f.primary.main,.5)),K(f.Slider,"secondaryTrack",Xe(f.secondary.main,.5)),K(f.Slider,"errorTrack",Xe(f.error.main,.5)),K(f.Slider,"infoTrack",Xe(f.info.main,.5)),K(f.Slider,"successTrack",Xe(f.success.main,.5)),K(f.Slider,"warningTrack",Xe(f.warning.main,.5));const T=Hn(f.background.default,.98);K(f.SnackbarContent,"bg",T),K(f.SnackbarContent,"color",ho(()=>C.getContrastText(T))),K(f.SpeedDialAction,"fabHoverBg",Hn(f.background.paper,.15)),K(f.StepConnector,"border",R("palette-grey-600")),K(f.StepContent,"border",R("palette-grey-600")),K(f.Switch,"defaultColor",R("palette-grey-300")),K(f.Switch,"defaultDisabledColor",R("palette-grey-600")),K(f.Switch,"primaryDisabledColor",Xe(f.primary.main,.55)),K(f.Switch,"secondaryDisabledColor",Xe(f.secondary.main,.55)),K(f.Switch,"errorDisabledColor",Xe(f.error.main,.55)),K(f.Switch,"infoDisabledColor",Xe(f.info.main,.55)),K(f.Switch,"successDisabledColor",Xe(f.success.main,.55)),K(f.Switch,"warningDisabledColor",Xe(f.warning.main,.55)),K(f.TableCell,"border",Xe(Wn(f.divider,1),.68)),K(f.Tooltip,"bg",Wn(f.grey[700],.92))}ko(f.background,"default"),ko(f.background,"paper"),ko(f.common,"background"),ko(f.common,"onBackground"),ko(f,"divider"),Object.keys(f).forEach(T=>{const w=f[T];w&&typeof w=="object"&&(w.main&&K(f[T],"mainChannel",Tr(an(w.main))),w.light&&K(f[T],"lightChannel",Tr(an(w.light))),w.dark&&K(f[T],"darkChannel",Tr(an(w.dark))),w.contrastText&&K(f[T],"contrastTextChannel",Tr(an(w.contrastText))),T==="text"&&(ko(f[T],"primary"),ko(f[T],"secondary")),T==="action"&&(w.active&&ko(f[T],"active"),w.selected&&ko(f[T],"selected")))})}),x=t.reduce((k,f)=>ct(k,f),x);const P={prefix:c,shouldSkipGeneratingVar:d},{vars:$,generateCssVars:S}=Jh(x,P);return x.vars=$,x.generateCssVars=S,x.shouldSkipGeneratingVar=d,x.unstable_sxConfig=u({},Vr,m==null?void 0:m.unstable_sxConfig),x.unstable_sx=function(f){return Xo({sx:f,theme:this})},x}const Ad=e=>[...[...Array(24)].map((t,o)=>`--${e?`${e}-`:""}overlays-${o+1}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],Qr={attribute:"data-mui-color-scheme",colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},Zb=Ld(),{CssVarsProvider:Jb,useColorScheme:Qb,getInitColorSchemeScript:e1}=Uh({themeId:Io,theme:Zb,attribute:Qr.attribute,colorSchemeStorageKey:Qr.colorSchemeStorageKey,modeStorageKey:Qr.modeStorageKey,defaultColorScheme:{light:Qr.defaultLightColorScheme,dark:Qr.defaultDarkColorScheme},resolveTheme:e=>{const t=u({},e,{typography:Gi(e.palette,e.typography)});return t.unstable_sx=function(r){return Xo({sx:r,theme:this})},t},excludeVariablesFromRoot:Ad}),t1=e1;function o1(){throw new Error(Pt(20))}const qw=Object.freeze(Object.defineProperty({__proto__:null,Experimental_CssVarsProvider:Jb,StyledEngineProvider:Fu,THEME_ID:Io,ThemeProvider:Wb,adaptV4Theme:Ov,alpha:nn,createMuiTheme:pb,createStyles:mb,createTheme:ur,css:Bo,darken:ad,decomposeColor:Oo,duration:Ki,easing:wd,emphasize:ph,experimentalStyled:M,experimental_extendTheme:Ld,experimental_sx:o1,getContrastRatio:dh,getInitColorSchemeScript:t1,getLuminance:va,getOverlayAlpha:Ca,hexToRgb:rd,hslToRgb:nd,keyframes:po,lighten:sd,makeStyles:Hb,private_createMixins:yd,private_createTypography:Gi,private_excludeVariablesFromRoot:Ad,recomposeColor:On,responsiveFontSizes:yb,rgbToHex:uh,shouldSkipGeneratingVar:Ed,styled:M,unstable_createMuiStrictModeTheme:fb,unstable_getUnit:Md,unstable_toUnitless:Vo,useColorScheme:Qb,useTheme:ro,useThemeProps:zo,withStyles:Vb,withTheme:Ub},Symbol.toStringTag,{value:"Module"}));function oe(e){return zh(e)}function r1(e){return Y("MuiSvgIcon",e)}X("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const n1=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],a1=e=>{const{color:t,fontSize:o,classes:r}=e,n={root:["root",t!=="inherit"&&`color${I(t)}`,`fontSize${I(o)}`]};return Z(n,r1,r)},s1=M("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.color!=="inherit"&&t[`color${I(o.color)}`],t[`fontSize${I(o.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var o,r,n,a,s,i,l,c,d,m,v,y,b;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(o=e.transitions)==null||(r=o.create)==null?void 0:r.call(o,"fill",{duration:(n=e.transitions)==null||(n=n.duration)==null?void 0:n.shorter}),fontSize:{inherit:"inherit",small:((a=e.typography)==null||(s=a.pxToRem)==null?void 0:s.call(a,20))||"1.25rem",medium:((i=e.typography)==null||(l=i.pxToRem)==null?void 0:l.call(i,24))||"1.5rem",large:((c=e.typography)==null||(d=c.pxToRem)==null?void 0:d.call(c,35))||"2.1875rem"}[t.fontSize],color:(m=(v=(e.vars||e).palette)==null||(v=v[t.color])==null?void 0:v.main)!=null?m:{action:(y=(e.vars||e).palette)==null||(y=y.action)==null?void 0:y.active,disabled:(b=(e.vars||e).palette)==null||(b=b.action)==null?void 0:b.disabled,inherit:void 0}[t.color]}}),$a=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiSvgIcon"}),{children:n,className:a,color:s="inherit",component:i="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:d=!1,titleAccess:m,viewBox:v="0 0 24 24"}=r,y=F(r,n1),b=p.isValidElement(n)&&n.type==="svg",h=u({},r,{color:s,component:i,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:d,viewBox:v,hasSvgAsChild:b}),C={};d||(C.viewBox=v);const x=a1(h);return g.jsxs(s1,u({as:i,className:D(x.root,a),focusable:"false",color:c,"aria-hidden":m?void 0:!0,role:m?"img":void 0,ref:o},C,y,b&&n.props,{ownerState:h,children:[b?n.props.children:n,m?g.jsx("title",{children:m}):null]}))});$a.muiName="SvgIcon";function ue(e,t){function o(r,n){return g.jsx($a,u({"data-testid":`${t}Icon`,ref:n},r,{children:e}))}return o.muiName=$a.muiName,p.memo(p.forwardRef(o))}const i1={configure:e=>{Za.configure(e)}},Yw=Object.freeze(Object.defineProperty({__proto__:null,capitalize:I,createChainedFunction:ba,createSvgIcon:ue,debounce:Gr,deprecatedPropType:fh,isMuiElement:sr,ownerDocument:rt,ownerWindow:Zt,requirePropFactory:mh,setRef:yn,unstable_ClassNameGenerator:i1,unstable_useEnhancedEffect:xt,unstable_useId:$o,unsupportedProp:hh,useControlled:qt,useEventCallback:at,useForkRef:Ue,useIsFocusVisible:us},Symbol.toStringTag,{value:"Module"}));function ti(e,t){return ti=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},ti(e,t)}function qi(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ti(e,t)}function l1(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function c1(e,t){e.classList?e.classList.add(t):l1(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function Ql(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function u1(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=Ql(e.className,t):e.setAttribute("class",Ql(e.className&&e.className.baseVal||"",t))}const ec={disabled:!1},Sa=lo.createContext(null);var Bd=function(t){return t.scrollTop},sn="unmounted",tr="exited",or="entering",Cr="entered",oi="exiting",Bt=function(e){qi(t,e);function t(r,n){var a;a=e.call(this,r,n)||this;var s=n,i=s&&!s.isMounting?r.enter:r.appear,l;return a.appearStatus=null,r.in?i?(l=tr,a.appearStatus=or):l=Cr:r.unmountOnExit||r.mountOnEnter?l=sn:l=tr,a.state={status:l},a.nextCallback=null,a}t.getDerivedStateFromProps=function(n,a){var s=n.in;return s&&a.status===sn?{status:tr}:null};var o=t.prototype;return o.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},o.componentDidUpdate=function(n){var a=null;if(n!==this.props){var s=this.state.status;this.props.in?s!==or&&s!==Cr&&(a=or):(s===or||s===Cr)&&(a=oi)}this.updateStatus(!1,a)},o.componentWillUnmount=function(){this.cancelNextCallback()},o.getTimeouts=function(){var n=this.props.timeout,a,s,i;return a=s=i=n,n!=null&&typeof n!="number"&&(a=n.exit,s=n.enter,i=n.appear!==void 0?n.appear:s),{exit:a,enter:s,appear:i}},o.updateStatus=function(n,a){if(n===void 0&&(n=!1),a!==null)if(this.cancelNextCallback(),a===or){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:jn.findDOMNode(this);s&&Bd(s)}this.performEnter(n)}else this.performExit();else this.props.unmountOnExit&&this.state.status===tr&&this.setState({status:sn})},o.performEnter=function(n){var a=this,s=this.props.enter,i=this.context?this.context.isMounting:n,l=this.props.nodeRef?[i]:[jn.findDOMNode(this),i],c=l[0],d=l[1],m=this.getTimeouts(),v=i?m.appear:m.enter;if(!n&&!s||ec.disabled){this.safeSetState({status:Cr},function(){a.props.onEntered(c)});return}this.props.onEnter(c,d),this.safeSetState({status:or},function(){a.props.onEntering(c,d),a.onTransitionEnd(v,function(){a.safeSetState({status:Cr},function(){a.props.onEntered(c,d)})})})},o.performExit=function(){var n=this,a=this.props.exit,s=this.getTimeouts(),i=this.props.nodeRef?void 0:jn.findDOMNode(this);if(!a||ec.disabled){this.safeSetState({status:tr},function(){n.props.onExited(i)});return}this.props.onExit(i),this.safeSetState({status:oi},function(){n.props.onExiting(i),n.onTransitionEnd(s.exit,function(){n.safeSetState({status:tr},function(){n.props.onExited(i)})})})},o.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},o.safeSetState=function(n,a){a=this.setNextCallback(a),this.setState(n,a)},o.setNextCallback=function(n){var a=this,s=!0;return this.nextCallback=function(i){s&&(s=!1,a.nextCallback=null,n(i))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},o.onTransitionEnd=function(n,a){this.setNextCallback(a);var s=this.props.nodeRef?this.props.nodeRef.current:jn.findDOMNode(this),i=n==null&&!this.props.addEndListener;if(!s||i){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],d=l[1];this.props.addEndListener(c,d)}n!=null&&setTimeout(this.nextCallback,n)},o.render=function(){var n=this.state.status;if(n===sn)return null;var a=this.props,s=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var i=F(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return lo.createElement(Sa.Provider,{value:null},typeof s=="function"?s(n,i):lo.cloneElement(lo.Children.only(s),i))},t}(lo.Component);Bt.contextType=Sa;Bt.propTypes={};function xr(){}Bt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:xr,onEntering:xr,onEntered:xr,onExit:xr,onExiting:xr,onExited:xr};Bt.UNMOUNTED=sn;Bt.EXITED=tr;Bt.ENTERING=or;Bt.ENTERED=Cr;Bt.EXITING=oi;var d1=function(t,o){return t&&o&&o.split(" ").forEach(function(r){return c1(t,r)})},Bs=function(t,o){return t&&o&&o.split(" ").forEach(function(r){return u1(t,r)})},_d=function(e){qi(t,e);function t(){for(var r,n=arguments.length,a=new Array(n),s=0;se.scrollTop;function So(e,t){var o,r;const{timeout:n,easing:a,style:s={}}=e;return{duration:(o=s.transitionDuration)!=null?o:typeof n=="number"?n:n[t.mode]||0,easing:(r=s.transitionTimingFunction)!=null?r:typeof a=="object"?a[t.mode]:a,delay:s.transitionDelay}}function b1(e){return Y("MuiCollapse",e)}X("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const y1=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],x1=e=>{const{orientation:t,classes:o}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Z(r,b1,o)},C1=M("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[o.orientation],o.state==="entered"&&t.entered,o.state==="exited"&&!o.in&&o.collapsedSize==="0px"&&t.hidden]}})(({theme:e,ownerState:t})=>u({height:0,overflow:"hidden",transition:e.transitions.create("height")},t.orientation==="horizontal"&&{height:"auto",width:0,transition:e.transitions.create("width")},t.state==="entered"&&u({height:"auto",overflow:"visible"},t.orientation==="horizontal"&&{width:"auto"}),t.state==="exited"&&!t.in&&t.collapsedSize==="0px"&&{visibility:"hidden"})),$1=M("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})(({ownerState:e})=>u({display:"flex",width:"100%"},e.orientation==="horizontal"&&{width:"auto",height:"100%"})),S1=M("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(e,t)=>t.wrapperInner})(({ownerState:e})=>u({width:"100%"},e.orientation==="horizontal"&&{width:"auto",height:"100%"})),Nd=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiCollapse"}),{addEndListener:n,children:a,className:s,collapsedSize:i="0px",component:l,easing:c,in:d,onEnter:m,onEntered:v,onEntering:y,onExit:b,onExited:h,onExiting:C,orientation:x="vertical",style:P,timeout:$=Ki.standard,TransitionComponent:S=Bt}=r,k=F(r,y1),f=u({},r,{orientation:x,collapsedSize:i}),R=x1(f),T=ro(),w=Uo(),O=p.useRef(null),j=p.useRef(),L=typeof i=="number"?`${i}px`:i,E=x==="horizontal",B=E?"width":"height",z=p.useRef(null),W=Ue(o,z),H=te=>be=>{if(te){const ae=z.current;be===void 0?te(ae):te(ae,be)}},_=()=>O.current?O.current[E?"clientWidth":"clientHeight"]:0,G=H((te,be)=>{O.current&&E&&(O.current.style.position="absolute"),te.style[B]=L,m&&m(te,be)}),se=H((te,be)=>{const ae=_();O.current&&E&&(O.current.style.position="");const{duration:de,easing:Ee}=So({style:P,timeout:$,easing:c},{mode:"enter"});if($==="auto"){const fe=T.transitions.getAutoHeightDuration(ae);te.style.transitionDuration=`${fe}ms`,j.current=fe}else te.style.transitionDuration=typeof de=="string"?de:`${de}ms`;te.style[B]=`${ae}px`,te.style.transitionTimingFunction=Ee,y&&y(te,be)}),ve=H((te,be)=>{te.style[B]="auto",v&&v(te,be)}),Re=H(te=>{te.style[B]=`${_()}px`,b&&b(te)}),Se=H(h),re=H(te=>{const be=_(),{duration:ae,easing:de}=So({style:P,timeout:$,easing:c},{mode:"exit"});if($==="auto"){const Ee=T.transitions.getAutoHeightDuration(be);te.style.transitionDuration=`${Ee}ms`,j.current=Ee}else te.style.transitionDuration=typeof ae=="string"?ae:`${ae}ms`;te.style[B]=L,te.style.transitionTimingFunction=de,C&&C(te)}),pe=te=>{$==="auto"&&w.start(j.current||0,te),n&&n(z.current,te)};return g.jsx(S,u({in:d,onEnter:G,onEntered:ve,onEntering:se,onExit:Re,onExited:Se,onExiting:re,addEndListener:pe,nodeRef:z,timeout:$==="auto"?null:$},k,{children:(te,be)=>g.jsx(C1,u({as:l,className:D(R.root,s,{entered:R.entered,exited:!d&&L==="0px"&&R.hidden}[te]),style:u({[E?"minWidth":"minHeight"]:L},P),ref:W},be,{ownerState:u({},f,{state:te}),children:g.jsx($1,{ownerState:u({},f,{state:te}),className:R.wrapper,ref:O,children:g.jsx(S1,{ownerState:u({},f,{state:te}),className:R.wrapperInner,children:a})})}))}))});Nd.muiSupportAuto=!0;function zd(e){return Y("MuiPaper",e)}const R1=X("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]),P1=["className","component","elevation","square","variant"],k1=e=>{const{square:t,elevation:o,variant:r,classes:n}=e,a={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${o}`]};return Z(a,zd,n)},T1=M("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[o.variant],!o.square&&t.rounded,o.variant==="elevation"&&t[`elevation${o.elevation}`]]}})(({theme:e,ownerState:t})=>{var o;return u({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&u({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${we("#fff",Ca(t.elevation))}, ${we("#fff",Ca(t.elevation))})`},e.vars&&{backgroundImage:(o=e.vars.overlays)==null?void 0:o[t.elevation]}))}),no=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiPaper"}),{className:n,component:a="div",elevation:s=1,square:i=!1,variant:l="elevation"}=r,c=F(r,P1),d=u({},r,{component:a,elevation:s,square:i,variant:l}),m=k1(d);return g.jsx(T1,u({as:a,ownerState:d,className:D(m.root,n),ref:o},c))}),Xw=Object.freeze(Object.defineProperty({__proto__:null,default:no,getPaperUtilityClass:zd,paperClasses:R1},Symbol.toStringTag,{value:"Module"})),jd=p.createContext({}),w1=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],M1=["component","slots","slotProps"],I1=["component"];function Ra(e,t){const{className:o,elementType:r,ownerState:n,externalForwardedProps:a,getSlotOwnerState:s,internalForwardedProps:i}=t,l=F(t,w1),{component:c,slots:d={[e]:void 0},slotProps:m={[e]:void 0}}=a,v=F(a,M1),y=d[e]||r,b=dd(m[e],n),h=ud(u({className:o},l,{externalForwardedProps:e==="root"?v:void 0,externalSlotProps:b})),{props:{component:C},internalRef:x}=h,P=F(h.props,I1),$=Ue(x,b==null?void 0:b.ref,t.ref),S=s?s(P):{},k=u({},n,S),f=e==="root"?C||c:C,R=kr(y,u({},e==="root"&&!c&&!d[e]&&i,e!=="root"&&!d[e]&&i,P,f&&{as:f},{ref:$}),k);return Object.keys(S).forEach(T=>{delete R[T]}),[y,R]}function O1(e){return Y("MuiAccordion",e)}const Un=X("MuiAccordion",["root","rounded","expanded","disabled","gutters","region"]),E1=["children","className","defaultExpanded","disabled","disableGutters","expanded","onChange","square","slots","slotProps","TransitionComponent","TransitionProps"],L1=e=>{const{classes:t,square:o,expanded:r,disabled:n,disableGutters:a}=e;return Z({root:["root",!o&&"rounded",r&&"expanded",n&&"disabled",!a&&"gutters"],region:["region"]},O1,t)},A1=M(no,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{[`& .${Un.region}`]:t.region},t.root,!o.square&&t.rounded,!o.disableGutters&&t.gutters]}})(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],t),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${Un.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${Un.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}},({theme:e})=>({variants:[{props:t=>!t.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:t=>!t.disableGutters,style:{[`&.${Un.expanded}`]:{margin:"16px 0"}}}]})),Zw=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiAccordion"}),{children:n,className:a,defaultExpanded:s=!1,disabled:i=!1,disableGutters:l=!1,expanded:c,onChange:d,square:m=!1,slots:v={},slotProps:y={},TransitionComponent:b,TransitionProps:h}=r,C=F(r,E1),[x,P]=qt({controlled:c,default:s,name:"Accordion",state:"expanded"}),$=p.useCallback(E=>{P(!x),d&&d(E,!x)},[x,d,P]),[S,...k]=p.Children.toArray(n),f=p.useMemo(()=>({expanded:x,disabled:i,disableGutters:l,toggle:$}),[x,i,l,$]),R=u({},r,{square:m,disabled:i,disableGutters:l,expanded:x}),T=L1(R),w=u({transition:b},v),O=u({transition:h},y),[j,L]=Ra("transition",{elementType:Nd,externalForwardedProps:{slots:w,slotProps:O},ownerState:R});return g.jsxs(A1,u({className:D(T.root,a),ref:o,ownerState:R,square:m},C,{children:[g.jsx(jd.Provider,{value:f,children:S}),g.jsx(j,u({in:x,timeout:"auto"},L,{children:g.jsx("div",{"aria-labelledby":S.props.id,id:S.props["aria-controls"],role:"region",className:T.region,children:k})}))]}))});function B1(e){return Y("MuiAccordionDetails",e)}X("MuiAccordionDetails",["root"]);const _1=["className"],N1=e=>{const{classes:t}=e;return Z({root:["root"]},B1,t)},z1=M("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({padding:e.spacing(1,2,2)})),Jw=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiAccordionDetails"}),{className:n}=r,a=F(r,_1),s=r,i=N1(s);return g.jsx(z1,u({className:D(i.root,n),ref:o,ownerState:s},a))});function j1(e){const{className:t,classes:o,pulsate:r=!1,rippleX:n,rippleY:a,rippleSize:s,in:i,onExited:l,timeout:c}=e,[d,m]=p.useState(!1),v=D(t,o.ripple,o.rippleVisible,r&&o.ripplePulsate),y={width:s,height:s,top:-(s/2)+a,left:-(s/2)+n},b=D(o.child,d&&o.childLeaving,r&&o.childPulsate);return!i&&!d&&m(!0),p.useEffect(()=>{if(!i&&l!=null){const h=setTimeout(l,c);return()=>{clearTimeout(h)}}},[l,i,c]),g.jsx("span",{className:v,style:y,children:g.jsx("span",{className:b})})}const Ut=X("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),D1=["center","classes","className"];let ms=e=>e,tc,oc,rc,nc;const ri=550,F1=80,W1=po(tc||(tc=ms` + 0% { + transform: scale(0); + opacity: 0.1; + } + + 100% { + transform: scale(1); + opacity: 0.3; + } +`)),H1=po(oc||(oc=ms` + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +`)),V1=po(rc||(rc=ms` + 0% { + transform: scale(1); + } + + 50% { + transform: scale(0.92); + } + + 100% { + transform: scale(1); + } +`)),U1=M("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),G1=M(j1,{name:"MuiTouchRipple",slot:"Ripple"})(nc||(nc=ms` + opacity: 0; + position: absolute; + + &.${0} { + opacity: 0.3; + transform: scale(1); + animation-name: ${0}; + animation-duration: ${0}ms; + animation-timing-function: ${0}; + } + + &.${0} { + animation-duration: ${0}ms; + } + + & .${0} { + opacity: 1; + display: block; + width: 100%; + height: 100%; + border-radius: 50%; + background-color: currentColor; + } + + & .${0} { + opacity: 0; + animation-name: ${0}; + animation-duration: ${0}ms; + animation-timing-function: ${0}; + } + + & .${0} { + position: absolute; + /* @noflip */ + left: 0px; + top: 0; + animation-name: ${0}; + animation-duration: 2500ms; + animation-timing-function: ${0}; + animation-iteration-count: infinite; + animation-delay: 200ms; + } +`),Ut.rippleVisible,W1,ri,({theme:e})=>e.transitions.easing.easeInOut,Ut.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,Ut.child,Ut.childLeaving,H1,ri,({theme:e})=>e.transitions.easing.easeInOut,Ut.childPulsate,V1,({theme:e})=>e.transitions.easing.easeInOut),K1=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiTouchRipple"}),{center:n=!1,classes:a={},className:s}=r,i=F(r,D1),[l,c]=p.useState([]),d=p.useRef(0),m=p.useRef(null);p.useEffect(()=>{m.current&&(m.current(),m.current=null)},[l]);const v=p.useRef(!1),y=Uo(),b=p.useRef(null),h=p.useRef(null),C=p.useCallback(S=>{const{pulsate:k,rippleX:f,rippleY:R,rippleSize:T,cb:w}=S;c(O=>[...O,g.jsx(G1,{classes:{ripple:D(a.ripple,Ut.ripple),rippleVisible:D(a.rippleVisible,Ut.rippleVisible),ripplePulsate:D(a.ripplePulsate,Ut.ripplePulsate),child:D(a.child,Ut.child),childLeaving:D(a.childLeaving,Ut.childLeaving),childPulsate:D(a.childPulsate,Ut.childPulsate)},timeout:ri,pulsate:k,rippleX:f,rippleY:R,rippleSize:T},d.current)]),d.current+=1,m.current=w},[a]),x=p.useCallback((S={},k={},f=()=>{})=>{const{pulsate:R=!1,center:T=n||k.pulsate,fakeElement:w=!1}=k;if((S==null?void 0:S.type)==="mousedown"&&v.current){v.current=!1;return}(S==null?void 0:S.type)==="touchstart"&&(v.current=!0);const O=w?null:h.current,j=O?O.getBoundingClientRect():{width:0,height:0,left:0,top:0};let L,E,B;if(T||S===void 0||S.clientX===0&&S.clientY===0||!S.clientX&&!S.touches)L=Math.round(j.width/2),E=Math.round(j.height/2);else{const{clientX:z,clientY:W}=S.touches&&S.touches.length>0?S.touches[0]:S;L=Math.round(z-j.left),E=Math.round(W-j.top)}if(T)B=Math.sqrt((2*j.width**2+j.height**2)/3),B%2===0&&(B+=1);else{const z=Math.max(Math.abs((O?O.clientWidth:0)-L),L)*2+2,W=Math.max(Math.abs((O?O.clientHeight:0)-E),E)*2+2;B=Math.sqrt(z**2+W**2)}S!=null&&S.touches?b.current===null&&(b.current=()=>{C({pulsate:R,rippleX:L,rippleY:E,rippleSize:B,cb:f})},y.start(F1,()=>{b.current&&(b.current(),b.current=null)})):C({pulsate:R,rippleX:L,rippleY:E,rippleSize:B,cb:f})},[n,C,y]),P=p.useCallback(()=>{x({},{pulsate:!0})},[x]),$=p.useCallback((S,k)=>{if(y.clear(),(S==null?void 0:S.type)==="touchend"&&b.current){b.current(),b.current=null,y.start(0,()=>{$(S,k)});return}b.current=null,c(f=>f.length>0?f.slice(1):f),m.current=k},[y]);return p.useImperativeHandle(o,()=>({pulsate:P,start:x,stop:$}),[P,x,$]),g.jsx(U1,u({className:D(Ut.root,a.root,s),ref:h},i,{children:g.jsx(Xi,{component:null,exit:!0,children:l})}))});function q1(e){return Y("MuiButtonBase",e)}const Y1=X("MuiButtonBase",["root","disabled","focusVisible"]),X1=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],Z1=e=>{const{disabled:t,focusVisible:o,focusVisibleClassName:r,classes:n}=e,s=Z({root:["root",t&&"disabled",o&&"focusVisible"]},q1,n);return o&&r&&(s.root+=` ${r}`),s},J1=M("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Y1.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),kt=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiButtonBase"}),{action:n,centerRipple:a=!1,children:s,className:i,component:l="button",disabled:c=!1,disableRipple:d=!1,disableTouchRipple:m=!1,focusRipple:v=!1,LinkComponent:y="a",onBlur:b,onClick:h,onContextMenu:C,onDragLeave:x,onFocus:P,onFocusVisible:$,onKeyDown:S,onKeyUp:k,onMouseDown:f,onMouseLeave:R,onMouseUp:T,onTouchEnd:w,onTouchMove:O,onTouchStart:j,tabIndex:L=0,TouchRippleProps:E,touchRippleRef:B,type:z}=r,W=F(r,X1),H=p.useRef(null),_=p.useRef(null),G=Ue(_,B),{isFocusVisibleRef:se,onFocus:ve,onBlur:Re,ref:Se}=us(),[re,pe]=p.useState(!1);c&&re&&pe(!1),p.useImperativeHandle(n,()=>({focusVisible:()=>{pe(!0),H.current.focus()}}),[]);const[te,be]=p.useState(!1);p.useEffect(()=>{be(!0)},[]);const ae=te&&!d&&!c;p.useEffect(()=>{re&&v&&!d&&te&&_.current.pulsate()},[d,v,re,te]);function de(N,Q,$e=m){return at(Te=>(Q&&Q(Te),!$e&&_.current&&_.current[N](Te),!0))}const Ee=de("start",f),fe=de("stop",C),xe=de("stop",x),he=de("stop",T),me=de("stop",N=>{re&&N.preventDefault(),R&&R(N)}),le=de("start",j),ce=de("stop",w),Ae=de("stop",O),ie=de("stop",N=>{Re(N),se.current===!1&&pe(!1),b&&b(N)},!1),ze=at(N=>{H.current||(H.current=N.currentTarget),ve(N),se.current===!0&&(pe(!0),$&&$(N)),P&&P(N)}),Pe=()=>{const N=H.current;return l&&l!=="button"&&!(N.tagName==="A"&&N.href)},Oe=p.useRef(!1),je=at(N=>{v&&!Oe.current&&re&&_.current&&N.key===" "&&(Oe.current=!0,_.current.stop(N,()=>{_.current.start(N)})),N.target===N.currentTarget&&Pe()&&N.key===" "&&N.preventDefault(),S&&S(N),N.target===N.currentTarget&&Pe()&&N.key==="Enter"&&!c&&(N.preventDefault(),h&&h(N))}),Ie=at(N=>{v&&N.key===" "&&_.current&&re&&!N.defaultPrevented&&(Oe.current=!1,_.current.stop(N,()=>{_.current.pulsate(N)})),k&&k(N),h&&N.target===N.currentTarget&&Pe()&&N.key===" "&&!N.defaultPrevented&&h(N)});let Le=l;Le==="button"&&(W.href||W.to)&&(Le=y);const Ke={};Le==="button"?(Ke.type=z===void 0?"button":z,Ke.disabled=c):(!W.href&&!W.to&&(Ke.role="button"),c&&(Ke["aria-disabled"]=c));const qe=Ue(o,Se,H),We=u({},r,{centerRipple:a,component:l,disabled:c,disableRipple:d,disableTouchRipple:m,focusRipple:v,tabIndex:L,focusVisible:re}),U=Z1(We);return g.jsxs(J1,u({as:Le,className:D(U.root,i),ownerState:We,onBlur:ie,onClick:h,onContextMenu:fe,onFocus:ze,onKeyDown:je,onKeyUp:Ie,onMouseDown:Ee,onMouseLeave:me,onMouseUp:he,onDragLeave:xe,onTouchEnd:ce,onTouchMove:Ae,onTouchStart:le,ref:qe,tabIndex:c?-1:L,type:z},Ke,W,{children:[s,ae?g.jsx(K1,u({ref:G,center:a},E)):null]}))});function Q1(e){return Y("MuiAccordionSummary",e)}const wr=X("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),e0=["children","className","expandIcon","focusVisibleClassName","onClick"],t0=e=>{const{classes:t,expanded:o,disabled:r,disableGutters:n}=e;return Z({root:["root",o&&"expanded",r&&"disabled",!n&&"gutters"],focusVisible:["focusVisible"],content:["content",o&&"expanded",!n&&"contentGutters"],expandIconWrapper:["expandIconWrapper",o&&"expanded"]},Q1,t)},o0=M(kt,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{display:"flex",minHeight:48,padding:e.spacing(0,2),transition:e.transitions.create(["min-height","background-color"],t),[`&.${wr.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${wr.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`&:hover:not(.${wr.disabled})`]:{cursor:"pointer"},variants:[{props:o=>!o.disableGutters,style:{[`&.${wr.expanded}`]:{minHeight:64}}}]}}),r0=M("div",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(e,t)=>t.content})(({theme:e})=>({display:"flex",flexGrow:1,margin:"12px 0",variants:[{props:t=>!t.disableGutters,style:{transition:e.transitions.create(["margin"],{duration:e.transitions.duration.shortest}),[`&.${wr.expanded}`]:{margin:"20px 0"}}}]})),n0=M("div",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(e,t)=>t.expandIconWrapper})(({theme:e})=>({display:"flex",color:(e.vars||e).palette.action.active,transform:"rotate(0deg)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),[`&.${wr.expanded}`]:{transform:"rotate(180deg)"}})),Qw=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiAccordionSummary"}),{children:n,className:a,expandIcon:s,focusVisibleClassName:i,onClick:l}=r,c=F(r,e0),{disabled:d=!1,disableGutters:m,expanded:v,toggle:y}=p.useContext(jd),b=x=>{y&&y(x),l&&l(x)},h=u({},r,{expanded:v,disabled:d,disableGutters:m}),C=t0(h);return g.jsxs(o0,u({focusRipple:!1,disableRipple:!0,disabled:d,component:"div","aria-expanded":v,className:D(C.root,a),focusVisibleClassName:D(C.focusVisible,i),onClick:b,ref:o,ownerState:h},c,{children:[g.jsx(r0,{className:C.content,ownerState:h,children:n}),s&&g.jsx(n0,{className:C.expandIconWrapper,ownerState:h,children:s})]}))});function a0(e){return Y("MuiAlert",e)}const ac=X("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function Dd(e){return Y("MuiIconButton",e)}const Fd=X("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),s0=["edge","children","className","color","disabled","disableFocusRipple","size"],i0=e=>{const{classes:t,disabled:o,color:r,edge:n,size:a}=e,s={root:["root",o&&"disabled",r!=="default"&&`color${I(r)}`,n&&`edge${I(n)}`,`size${I(a)}`]};return Z(s,Dd,t)},l0=M(kt,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.color!=="default"&&t[`color${I(o.color)}`],o.edge&&t[`edge${I(o.edge)}`],t[`size${I(o.size)}`]]}})(({theme:e,ownerState:t})=>u({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:we(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12}),({theme:e,ownerState:t})=>{var o;const r=(o=(e.vars||e).palette)==null?void 0:o[t.color];return u({},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&t.color!=="default"&&u({color:r==null?void 0:r.main},!t.disableRipple&&{"&:hover":u({},r&&{backgroundColor:e.vars?`rgba(${r.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:we(r.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),t.size==="small"&&{padding:5,fontSize:e.typography.pxToRem(18)},t.size==="large"&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${Fd.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),Go=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiIconButton"}),{edge:n=!1,children:a,className:s,color:i="default",disabled:l=!1,disableFocusRipple:c=!1,size:d="medium"}=r,m=F(r,s0),v=u({},r,{edge:n,color:i,disabled:l,disableFocusRipple:c,size:d}),y=i0(v);return g.jsx(l0,u({className:D(y.root,s),centerRipple:!0,focusRipple:!c,disabled:l,ref:o},m,{ownerState:v,children:a}))}),e4=Object.freeze(Object.defineProperty({__proto__:null,default:Go,getIconButtonUtilityClass:Dd,iconButtonClasses:Fd},Symbol.toStringTag,{value:"Module"})),c0=ue(g.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),u0=ue(g.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),d0=ue(g.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),p0=ue(g.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Wd=ue(g.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),f0=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],m0=e=>{const{variant:t,color:o,severity:r,classes:n}=e,a={root:["root",`color${I(o||r)}`,`${t}${I(o||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return Z(a,a0,n)},g0=M(no,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[o.variant],t[`${o.variant}${I(o.color||o.severity)}`]]}})(({theme:e})=>{const t=e.palette.mode==="light"?qo:Yo,o=e.palette.mode==="light"?Yo:qo;return u({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(e.palette).filter(([,r])=>r.main&&r.light).map(([r])=>({props:{colorSeverity:r,variant:"standard"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${r}StandardBg`]:o(e.palette[r].light,.9),[`& .${ac.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(([,r])=>r.main&&r.light).map(([r])=>({props:{colorSeverity:r,variant:"outlined"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),border:`1px solid ${(e.vars||e).palette[r].light}`,[`& .${ac.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(([,r])=>r.main&&r.dark).map(([r])=>({props:{colorSeverity:r,variant:"filled"},style:u({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${r}FilledColor`],backgroundColor:e.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:e.palette.mode==="dark"?e.palette[r].dark:e.palette[r].main,color:e.palette.getContrastText(e.palette[r].main)})}))]})}),h0=M("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),v0=M("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),sc=M("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),ic={success:g.jsx(c0,{fontSize:"inherit"}),warning:g.jsx(u0,{fontSize:"inherit"}),error:g.jsx(d0,{fontSize:"inherit"}),info:g.jsx(p0,{fontSize:"inherit"})},t4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiAlert"}),{action:n,children:a,className:s,closeText:i="Close",color:l,components:c={},componentsProps:d={},icon:m,iconMapping:v=ic,onClose:y,role:b="alert",severity:h="success",slotProps:C={},slots:x={},variant:P="standard"}=r,$=F(r,f0),S=u({},r,{color:l,severity:h,variant:P,colorSeverity:l||h}),k=m0(S),f={slots:u({closeButton:c.CloseButton,closeIcon:c.CloseIcon},x),slotProps:u({},d,C)},[R,T]=Ra("closeButton",{elementType:Go,externalForwardedProps:f,ownerState:S}),[w,O]=Ra("closeIcon",{elementType:Wd,externalForwardedProps:f,ownerState:S});return g.jsxs(g0,u({role:b,elevation:0,ownerState:S,className:D(k.root,s),ref:o},$,{children:[m!==!1?g.jsx(h0,{ownerState:S,className:k.icon,children:m||v[h]||ic[h]}):null,g.jsx(v0,{ownerState:S,className:k.message,children:a}),n!=null?g.jsx(sc,{ownerState:S,className:k.action,children:n}):null,n==null&&y?g.jsx(sc,{ownerState:S,className:k.action,children:g.jsx(R,u({size:"small","aria-label":i,title:i,color:"inherit",onClick:y},T,{children:g.jsx(w,u({fontSize:"small"},O))}))}):null]}))});function Hd(e){return Y("MuiTypography",e)}const b0=X("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),y0=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],x0=e=>{const{align:t,gutterBottom:o,noWrap:r,paragraph:n,variant:a,classes:s}=e,i={root:["root",a,e.align!=="inherit"&&`align${I(t)}`,o&&"gutterBottom",r&&"noWrap",n&&"paragraph"]};return Z(i,Hd,s)},C0=M("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.variant&&t[o.variant],o.align!=="inherit"&&t[`align${I(o.align)}`],o.noWrap&&t.noWrap,o.gutterBottom&&t.gutterBottom,o.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>u({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),lc={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},$0={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},S0=e=>$0[e]||e,St=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiTypography"}),n=S0(r.color),a=Ur(u({},r,{color:n})),{align:s="inherit",className:i,component:l,gutterBottom:c=!1,noWrap:d=!1,paragraph:m=!1,variant:v="body1",variantMapping:y=lc}=a,b=F(a,y0),h=u({},a,{align:s,color:n,className:i,component:l,gutterBottom:c,noWrap:d,paragraph:m,variant:v,variantMapping:y}),C=l||(m?"p":y[v]||lc[v])||"span",x=x0(h);return g.jsx(C0,u({as:C,ref:o,ownerState:h,className:D(x.root,i)},b))}),o4=Object.freeze(Object.defineProperty({__proto__:null,default:St,getTypographyUtilityClass:Hd,typographyClasses:b0},Symbol.toStringTag,{value:"Module"}));function R0(e){return Y("MuiAppBar",e)}X("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const P0=["className","color","enableColorOnDark","position"],k0=e=>{const{color:t,position:o,classes:r}=e,n={root:["root",`color${I(t)}`,`position${I(o)}`]};return Z(n,R0,r)},Gn=(e,t)=>e?`${e==null?void 0:e.replace(")","")}, ${t})`:t,T0=M(no,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[`position${I(o.position)}`],t[`color${I(o.color)}`]]}})(({theme:e,ownerState:t})=>{const o=e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[900];return u({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},t.position==="fixed"&&{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},t.position==="absolute"&&{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},t.position==="sticky"&&{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},t.position==="static"&&{position:"static"},t.position==="relative"&&{position:"relative"},!e.vars&&u({},t.color==="default"&&{backgroundColor:o,color:e.palette.getContrastText(o)},t.color&&t.color!=="default"&&t.color!=="inherit"&&t.color!=="transparent"&&{backgroundColor:e.palette[t.color].main,color:e.palette[t.color].contrastText},t.color==="inherit"&&{color:"inherit"},e.palette.mode==="dark"&&!t.enableColorOnDark&&{backgroundColor:null,color:null},t.color==="transparent"&&u({backgroundColor:"transparent",color:"inherit"},e.palette.mode==="dark"&&{backgroundImage:"none"})),e.vars&&u({},t.color==="default"&&{"--AppBar-background":t.enableColorOnDark?e.vars.palette.AppBar.defaultBg:Gn(e.vars.palette.AppBar.darkBg,e.vars.palette.AppBar.defaultBg),"--AppBar-color":t.enableColorOnDark?e.vars.palette.text.primary:Gn(e.vars.palette.AppBar.darkColor,e.vars.palette.text.primary)},t.color&&!t.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":t.enableColorOnDark?e.vars.palette[t.color].main:Gn(e.vars.palette.AppBar.darkBg,e.vars.palette[t.color].main),"--AppBar-color":t.enableColorOnDark?e.vars.palette[t.color].contrastText:Gn(e.vars.palette.AppBar.darkColor,e.vars.palette[t.color].contrastText)},!["inherit","transparent"].includes(t.color)&&{backgroundColor:"var(--AppBar-background)"},{color:t.color==="inherit"?"inherit":"var(--AppBar-color)"},t.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),r4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiAppBar"}),{className:n,color:a="primary",enableColorOnDark:s=!1,position:i="fixed"}=r,l=F(r,P0),c=u({},r,{color:a,position:i,enableColorOnDark:s}),d=k0(c);return g.jsx(T0,u({square:!0,component:"header",ownerState:c,elevation:4,className:D(d.root,n,i==="fixed"&&"mui-fixed"),ref:o},l))});function cc(e){return typeof e.normalize<"u"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function w0(e={}){const{ignoreAccents:t=!0,ignoreCase:o=!0,limit:r,matchFrom:n="any",stringify:a,trim:s=!1}=e;return(i,{inputValue:l,getOptionLabel:c})=>{let d=s?l.trim():l;o&&(d=d.toLowerCase()),t&&(d=cc(d));const m=d?i.filter(v=>{let y=(a||c)(v);return o&&(y=y.toLowerCase()),t&&(y=cc(y)),n==="start"?y.indexOf(d)===0:y.indexOf(d)>-1}):i;return typeof r=="number"?m.slice(0,r):m}}function Kn(e,t){for(let o=0;o{var t;return e.current!==null&&((t=e.current.parentElement)==null?void 0:t.contains(document.activeElement))},O0=[];function E0(e){const{unstable_isActiveElementInListbox:t=I0,unstable_classNamePrefix:o="Mui",autoComplete:r=!1,autoHighlight:n=!1,autoSelect:a=!1,blurOnSelect:s=!1,clearOnBlur:i=!e.freeSolo,clearOnEscape:l=!1,componentName:c="useAutocomplete",defaultValue:d=e.multiple?O0:null,disableClearable:m=!1,disableCloseOnSelect:v=!1,disabled:y,disabledItemsFocusable:b=!1,disableListWrap:h=!1,filterOptions:C=M0,filterSelectedOptions:x=!1,freeSolo:P=!1,getOptionDisabled:$,getOptionKey:S,getOptionLabel:k=V=>{var A;return(A=V.label)!=null?A:V},groupBy:f,handleHomeEndKeys:R=!e.freeSolo,id:T,includeInputInList:w=!1,inputValue:O,isOptionEqualToValue:j=(V,A)=>V===A,multiple:L=!1,onChange:E,onClose:B,onHighlightChange:z,onInputChange:W,onOpen:H,open:_,openOnFocus:G=!1,options:se,readOnly:ve=!1,selectOnFocus:Re=!e.freeSolo,value:Se}=e,re=$o(T);let pe=k;pe=V=>{const A=k(V);return typeof A!="string"?String(A):A};const te=p.useRef(!1),be=p.useRef(!0),ae=p.useRef(null),de=p.useRef(null),[Ee,fe]=p.useState(null),[xe,he]=p.useState(-1),me=n?0:-1,le=p.useRef(me),[ce,Ae]=qt({controlled:Se,default:d,name:c}),[ie,ze]=qt({controlled:O,default:"",name:c,state:"inputValue"}),[Pe,Oe]=p.useState(!1),je=p.useCallback((V,A)=>{if(!(L?ce.length!(x&&(L?ce:[ce]).some(A=>A!==null&&j(V,A)))),{inputValue:We&&Ke?"":ie,getOptionLabel:pe}):[],Q=Ni({filteredOptions:N,value:ce,inputValue:ie});p.useEffect(()=>{const V=ce!==Q.value;Pe&&!V||P&&!V||je(null,ce)},[ce,je,Pe,Q.value,P]);const $e=Ie&&N.length>0&&!ve,Te=at(V=>{V===-1?ae.current.focus():Ee.querySelector(`[data-tag-index="${V}"]`).focus()});p.useEffect(()=>{L&&xe>ce.length-1&&(he(-1),Te(-1))},[ce,L,xe,Te]);function J(V,A){if(!de.current||V<0||V>=N.length)return-1;let ne=V;for(;;){const ye=de.current.querySelector(`[data-option-index="${ne}"]`),Me=b?!1:!ye||ye.disabled||ye.getAttribute("aria-disabled")==="true";if(ye&&ye.hasAttribute("tabindex")&&!Me)return ne;if(A==="next"?ne=(ne+1)%N.length:ne=(ne-1+N.length)%N.length,ne===V)return-1}}const ge=at(({event:V,index:A,reason:ne="auto"})=>{if(le.current=A,A===-1?ae.current.removeAttribute("aria-activedescendant"):ae.current.setAttribute("aria-activedescendant",`${re}-option-${A}`),z&&z(V,A===-1?null:N[A],ne),!de.current)return;const ye=de.current.querySelector(`[role="option"].${o}-focused`);ye&&(ye.classList.remove(`${o}-focused`),ye.classList.remove(`${o}-focusVisible`));let Me=de.current;if(de.current.getAttribute("role")!=="listbox"&&(Me=de.current.parentElement.querySelector('[role="listbox"]')),!Me)return;if(A===-1){Me.scrollTop=0;return}const Ce=de.current.querySelector(`[data-option-index="${A}"]`);if(Ce&&(Ce.classList.add(`${o}-focused`),ne==="keyboard"&&Ce.classList.add(`${o}-focusVisible`),Me.scrollHeight>Me.clientHeight&&ne!=="mouse"&&ne!=="touch")){const De=Ce,go=Me.clientHeight+Me.scrollTop,ml=De.offsetTop+De.offsetHeight;ml>go?Me.scrollTop=ml-Me.clientHeight:De.offsetTop-De.offsetHeight*(f?1.3:0){if(!U)return;const Ce=J((()=>{const De=N.length-1;if(A==="reset")return me;if(A==="start")return 0;if(A==="end")return De;const go=le.current+A;return go<0?go===-1&&w?-1:h&&le.current!==-1||Math.abs(A)>1?0:De:go>De?go===De+1&&w?-1:h||Math.abs(A)>1?De:0:go})(),ne);if(ge({index:Ce,reason:ye,event:V}),r&&A!=="reset")if(Ce===-1)ae.current.value=ie;else{const De=pe(N[Ce]);ae.current.value=De,De.toLowerCase().indexOf(ie.toLowerCase())===0&&ie.length>0&&ae.current.setSelectionRange(ie.length,De.length)}}),ee=()=>{const V=(A,ne)=>{const ye=A?pe(A):"",Me=ne?pe(ne):"";return ye===Me};if(le.current!==-1&&Q.filteredOptions&&Q.filteredOptions.length!==N.length&&Q.inputValue===ie&&(L?ce.length===Q.value.length&&Q.value.every((A,ne)=>pe(ce[ne])===pe(A)):V(Q.value,ce))){const A=Q.filteredOptions[le.current];if(A)return Kn(N,ne=>pe(ne)===pe(A))}return-1},ke=p.useCallback(()=>{if(!U)return;const V=ee();if(V!==-1){le.current=V;return}const A=L?ce[0]:ce;if(N.length===0||A==null){q({diff:"reset"});return}if(de.current){if(A!=null){const ne=N[le.current];if(L&&ne&&Kn(ce,Me=>j(ne,Me))!==-1)return;const ye=Kn(N,Me=>j(Me,A));ye===-1?q({diff:"reset"}):ge({index:ye});return}if(le.current>=N.length-1){ge({index:N.length-1});return}ge({index:le.current})}},[N.length,L?!1:ce,x,q,ge,U,ie,L]),Be=at(V=>{yn(de,V),V&&ke()});p.useEffect(()=>{ke()},[ke]);const Ne=V=>{Ie||(Le(!0),qe(!0),H&&H(V))},Ge=(V,A)=>{Ie&&(Le(!1),B&&B(V,A))},Qe=(V,A,ne,ye)=>{if(L){if(ce.length===A.length&&ce.every((Me,Ce)=>Me===A[Ce]))return}else if(ce===A)return;E&&E(V,A,ne,ye),Ae(A)},mt=p.useRef(!1),nt=(V,A,ne="selectOption",ye="options")=>{let Me=ne,Ce=A;if(L){Ce=Array.isArray(ce)?ce.slice():[];const De=Kn(Ce,go=>j(A,go));De===-1?Ce.push(A):ye!=="freeSolo"&&(Ce.splice(De,1),Me="removeOption")}je(V,Ce),Qe(V,Ce,Me,{option:A}),!v&&(!V||!V.ctrlKey&&!V.metaKey)&&Ge(V,Me),(s===!0||s==="touch"&&mt.current||s==="mouse"&&!mt.current)&&ae.current.blur()};function Tt(V,A){if(V===-1)return-1;let ne=V;for(;;){if(A==="next"&&ne===ce.length||A==="previous"&&ne===-1)return-1;const ye=Ee.querySelector(`[data-tag-index="${ne}"]`);if(!ye||!ye.hasAttribute("tabindex")||ye.disabled||ye.getAttribute("aria-disabled")==="true")ne+=A==="next"?1:-1;else return ne}}const ao=(V,A)=>{if(!L)return;ie===""&&Ge(V,"toggleInput");let ne=xe;xe===-1?ie===""&&A==="previous"&&(ne=ce.length-1):(ne+=A==="next"?1:-1,ne<0&&(ne=0),ne===ce.length&&(ne=-1)),ne=Tt(ne,A),he(ne),Te(ne)},jo=V=>{te.current=!0,ze(""),W&&W(V,"","clear"),Qe(V,L?[]:null,"clear")},Po=V=>A=>{if(V.onKeyDown&&V.onKeyDown(A),!A.defaultMuiPrevented&&(xe!==-1&&["ArrowLeft","ArrowRight"].indexOf(A.key)===-1&&(he(-1),Te(-1)),A.which!==229))switch(A.key){case"Home":U&&R&&(A.preventDefault(),q({diff:"start",direction:"next",reason:"keyboard",event:A}));break;case"End":U&&R&&(A.preventDefault(),q({diff:"end",direction:"previous",reason:"keyboard",event:A}));break;case"PageUp":A.preventDefault(),q({diff:-uc,direction:"previous",reason:"keyboard",event:A}),Ne(A);break;case"PageDown":A.preventDefault(),q({diff:uc,direction:"next",reason:"keyboard",event:A}),Ne(A);break;case"ArrowDown":A.preventDefault(),q({diff:1,direction:"next",reason:"keyboard",event:A}),Ne(A);break;case"ArrowUp":A.preventDefault(),q({diff:-1,direction:"previous",reason:"keyboard",event:A}),Ne(A);break;case"ArrowLeft":ao(A,"previous");break;case"ArrowRight":ao(A,"next");break;case"Enter":if(le.current!==-1&&U){const ne=N[le.current],ye=$?$(ne):!1;if(A.preventDefault(),ye)return;nt(A,ne,"selectOption"),r&&ae.current.setSelectionRange(ae.current.value.length,ae.current.value.length)}else P&&ie!==""&&We===!1&&(L&&A.preventDefault(),nt(A,ie,"createOption","freeSolo"));break;case"Escape":U?(A.preventDefault(),A.stopPropagation(),Ge(A,"escape")):l&&(ie!==""||L&&ce.length>0)&&(A.preventDefault(),A.stopPropagation(),jo(A));break;case"Backspace":if(L&&!ve&&ie===""&&ce.length>0){const ne=xe===-1?ce.length-1:xe,ye=ce.slice();ye.splice(ne,1),Qe(A,ye,"removeOption",{option:ce[ne]})}break;case"Delete":if(L&&!ve&&ie===""&&ce.length>0&&xe!==-1){const ne=xe,ye=ce.slice();ye.splice(ne,1),Qe(A,ye,"removeOption",{option:ce[ne]})}break}},Do=V=>{Oe(!0),G&&!te.current&&Ne(V)},wt=V=>{if(t(de)){ae.current.focus();return}Oe(!1),be.current=!0,te.current=!1,a&&le.current!==-1&&U?nt(V,N[le.current],"blur"):a&&P&&ie!==""?nt(V,ie,"blur","freeSolo"):i&&je(V,ce),Ge(V,"blur")},pt=V=>{const A=V.target.value;ie!==A&&(ze(A),qe(!1),W&&W(V,A,"input")),A===""?!m&&!L&&Qe(V,null,"clear"):Ne(V)},et=V=>{const A=Number(V.currentTarget.getAttribute("data-option-index"));le.current!==A&&ge({event:V,index:A,reason:"mouse"})},vt=V=>{ge({event:V,index:Number(V.currentTarget.getAttribute("data-option-index")),reason:"touch"}),mt.current=!0},Ct=V=>{const A=Number(V.currentTarget.getAttribute("data-option-index"));nt(V,N[A],"selectOption"),mt.current=!1},so=V=>A=>{const ne=ce.slice();ne.splice(V,1),Qe(A,ne,"removeOption",{option:ce[V]})},er=V=>{Ie?Ge(V,"toggleInput"):Ne(V)},_t=V=>{V.currentTarget.contains(V.target)&&V.target.getAttribute("id")!==re&&V.preventDefault()},mo=V=>{V.currentTarget.contains(V.target)&&(ae.current.focus(),Re&&be.current&&ae.current.selectionEnd-ae.current.selectionStart===0&&ae.current.select(),be.current=!1)},Wt=V=>{!y&&(ie===""||!Ie)&&er(V)};let Mt=P&&ie.length>0;Mt=Mt||(L?ce.length>0:ce!==null);let io=N;return f&&(io=N.reduce((V,A,ne)=>{const ye=f(A);return V.length>0&&V[V.length-1].group===ye?V[V.length-1].options.push(A):V.push({key:ne,index:ne,group:ye,options:[A]}),V},[])),y&&Pe&&wt(),{getRootProps:(V={})=>u({"aria-owns":$e?`${re}-listbox`:null},V,{onKeyDown:Po(V),onMouseDown:_t,onClick:mo}),getInputLabelProps:()=>({id:`${re}-label`,htmlFor:re}),getInputProps:()=>({id:re,value:ie,onBlur:wt,onFocus:Do,onChange:pt,onMouseDown:Wt,"aria-activedescendant":U?"":null,"aria-autocomplete":r?"both":"list","aria-controls":$e?`${re}-listbox`:void 0,"aria-expanded":$e,autoComplete:"off",ref:ae,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:y}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:jo}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:er}),getTagProps:({index:V})=>u({key:V,"data-tag-index":V,tabIndex:-1},!ve&&{onDelete:so(V)}),getListboxProps:()=>({role:"listbox",id:`${re}-listbox`,"aria-labelledby":`${re}-label`,ref:Be,onMouseDown:V=>{V.preventDefault()}}),getOptionProps:({index:V,option:A})=>{var ne;const ye=(L?ce:[ce]).some(Ce=>Ce!=null&&j(A,Ce)),Me=$?$(A):!1;return{key:(ne=S==null?void 0:S(A))!=null?ne:pe(A),tabIndex:-1,role:"option",id:`${re}-option-${V}`,onMouseMove:et,onClick:Ct,onTouchStart:vt,"data-option-index":V,"aria-disabled":Me,"aria-selected":ye}},id:re,inputValue:ie,value:ce,dirty:Mt,expanded:U&&Ee,popupOpen:U,focused:Pe||xe!==-1,anchorEl:Ee,setAnchorEl:fe,focusedTag:xe,groupedOptions:io}}var Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});var Vd=Zi.default=void 0,L0=B0(p),A0=Id;function Ud(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,o=new WeakMap;return(Ud=function(r){return r?o:t})(e)}function B0(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var o=Ud(t);if(o&&o.has(e))return o.get(e);var r={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var s=n?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,o&&o.set(e,r),r}function _0(e){return Object.keys(e).length===0}function N0(e=null){const t=L0.useContext(A0.ThemeContext);return!t||_0(t)?e:t}Vd=Zi.default=N0;var Ot="top",Qt="bottom",eo="right",Et="left",Ji="auto",Bn=[Ot,Qt,eo,Et],Nr="start",Cn="end",z0="clippingParents",Gd="viewport",en="popper",j0="reference",dc=Bn.reduce(function(e,t){return e.concat([t+"-"+Nr,t+"-"+Cn])},[]),Kd=[].concat(Bn,[Ji]).reduce(function(e,t){return e.concat([t,t+"-"+Nr,t+"-"+Cn])},[]),D0="beforeRead",F0="read",W0="afterRead",H0="beforeMain",V0="main",U0="afterMain",G0="beforeWrite",K0="write",q0="afterWrite",Y0=[D0,F0,W0,H0,V0,U0,G0,K0,q0];function Ro(e){return e?(e.nodeName||"").toLowerCase():null}function Dt(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function dr(e){var t=Dt(e).Element;return e instanceof t||e instanceof Element}function Yt(e){var t=Dt(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Qi(e){if(typeof ShadowRoot>"u")return!1;var t=Dt(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function X0(e){var t=e.state;Object.keys(t.elements).forEach(function(o){var r=t.styles[o]||{},n=t.attributes[o]||{},a=t.elements[o];!Yt(a)||!Ro(a)||(Object.assign(a.style,r),Object.keys(n).forEach(function(s){var i=n[s];i===!1?a.removeAttribute(s):a.setAttribute(s,i===!0?"":i)}))})}function Z0(e){var t=e.state,o={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,o.popper),t.styles=o,t.elements.arrow&&Object.assign(t.elements.arrow.style,o.arrow),function(){Object.keys(t.elements).forEach(function(r){var n=t.elements[r],a=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:o[r]),i=s.reduce(function(l,c){return l[c]="",l},{});!Yt(n)||!Ro(n)||(Object.assign(n.style,i),Object.keys(a).forEach(function(l){n.removeAttribute(l)}))})}}const J0={name:"applyStyles",enabled:!0,phase:"write",fn:X0,effect:Z0,requires:["computeStyles"]};function Co(e){return e.split("-")[0]}var lr=Math.max,Pa=Math.min,zr=Math.round;function ni(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function qd(){return!/^((?!chrome|android).)*safari/i.test(ni())}function jr(e,t,o){t===void 0&&(t=!1),o===void 0&&(o=!1);var r=e.getBoundingClientRect(),n=1,a=1;t&&Yt(e)&&(n=e.offsetWidth>0&&zr(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&zr(r.height)/e.offsetHeight||1);var s=dr(e)?Dt(e):window,i=s.visualViewport,l=!qd()&&o,c=(r.left+(l&&i?i.offsetLeft:0))/n,d=(r.top+(l&&i?i.offsetTop:0))/a,m=r.width/n,v=r.height/a;return{width:m,height:v,top:d,right:c+m,bottom:d+v,left:c,x:c,y:d}}function el(e){var t=jr(e),o=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-o)<=1&&(o=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:o,height:r}}function Yd(e,t){var o=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(o&&Qi(o)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Lo(e){return Dt(e).getComputedStyle(e)}function Q0(e){return["table","td","th"].indexOf(Ro(e))>=0}function Zo(e){return((dr(e)?e.ownerDocument:e.document)||window.document).documentElement}function gs(e){return Ro(e)==="html"?e:e.assignedSlot||e.parentNode||(Qi(e)?e.host:null)||Zo(e)}function pc(e){return!Yt(e)||Lo(e).position==="fixed"?null:e.offsetParent}function ey(e){var t=/firefox/i.test(ni()),o=/Trident/i.test(ni());if(o&&Yt(e)){var r=Lo(e);if(r.position==="fixed")return null}var n=gs(e);for(Qi(n)&&(n=n.host);Yt(n)&&["html","body"].indexOf(Ro(n))<0;){var a=Lo(n);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return n;n=n.parentNode}return null}function _n(e){for(var t=Dt(e),o=pc(e);o&&Q0(o)&&Lo(o).position==="static";)o=pc(o);return o&&(Ro(o)==="html"||Ro(o)==="body"&&Lo(o).position==="static")?t:o||ey(e)||t}function tl(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function dn(e,t,o){return lr(e,Pa(t,o))}function ty(e,t,o){var r=dn(e,t,o);return r>o?o:r}function Xd(){return{top:0,right:0,bottom:0,left:0}}function Zd(e){return Object.assign({},Xd(),e)}function Jd(e,t){return t.reduce(function(o,r){return o[r]=e,o},{})}var oy=function(t,o){return t=typeof t=="function"?t(Object.assign({},o.rects,{placement:o.placement})):t,Zd(typeof t!="number"?t:Jd(t,Bn))};function ry(e){var t,o=e.state,r=e.name,n=e.options,a=o.elements.arrow,s=o.modifiersData.popperOffsets,i=Co(o.placement),l=tl(i),c=[Et,eo].indexOf(i)>=0,d=c?"height":"width";if(!(!a||!s)){var m=oy(n.padding,o),v=el(a),y=l==="y"?Ot:Et,b=l==="y"?Qt:eo,h=o.rects.reference[d]+o.rects.reference[l]-s[l]-o.rects.popper[d],C=s[l]-o.rects.reference[l],x=_n(a),P=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0,$=h/2-C/2,S=m[y],k=P-v[d]-m[b],f=P/2-v[d]/2+$,R=dn(S,f,k),T=l;o.modifiersData[r]=(t={},t[T]=R,t.centerOffset=R-f,t)}}function ny(e){var t=e.state,o=e.options,r=o.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=t.elements.popper.querySelector(n),!n)||Yd(t.elements.popper,n)&&(t.elements.arrow=n))}const ay={name:"arrow",enabled:!0,phase:"main",fn:ry,effect:ny,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Dr(e){return e.split("-")[1]}var sy={top:"auto",right:"auto",bottom:"auto",left:"auto"};function iy(e,t){var o=e.x,r=e.y,n=t.devicePixelRatio||1;return{x:zr(o*n)/n||0,y:zr(r*n)/n||0}}function fc(e){var t,o=e.popper,r=e.popperRect,n=e.placement,a=e.variation,s=e.offsets,i=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,m=e.isFixed,v=s.x,y=v===void 0?0:v,b=s.y,h=b===void 0?0:b,C=typeof d=="function"?d({x:y,y:h}):{x:y,y:h};y=C.x,h=C.y;var x=s.hasOwnProperty("x"),P=s.hasOwnProperty("y"),$=Et,S=Ot,k=window;if(c){var f=_n(o),R="clientHeight",T="clientWidth";if(f===Dt(o)&&(f=Zo(o),Lo(f).position!=="static"&&i==="absolute"&&(R="scrollHeight",T="scrollWidth")),f=f,n===Ot||(n===Et||n===eo)&&a===Cn){S=Qt;var w=m&&f===k&&k.visualViewport?k.visualViewport.height:f[R];h-=w-r.height,h*=l?1:-1}if(n===Et||(n===Ot||n===Qt)&&a===Cn){$=eo;var O=m&&f===k&&k.visualViewport?k.visualViewport.width:f[T];y-=O-r.width,y*=l?1:-1}}var j=Object.assign({position:i},c&&sy),L=d===!0?iy({x:y,y:h},Dt(o)):{x:y,y:h};if(y=L.x,h=L.y,l){var E;return Object.assign({},j,(E={},E[S]=P?"0":"",E[$]=x?"0":"",E.transform=(k.devicePixelRatio||1)<=1?"translate("+y+"px, "+h+"px)":"translate3d("+y+"px, "+h+"px, 0)",E))}return Object.assign({},j,(t={},t[S]=P?h+"px":"",t[$]=x?y+"px":"",t.transform="",t))}function ly(e){var t=e.state,o=e.options,r=o.gpuAcceleration,n=r===void 0?!0:r,a=o.adaptive,s=a===void 0?!0:a,i=o.roundOffsets,l=i===void 0?!0:i,c={placement:Co(t.placement),variation:Dr(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,fc(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,fc(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const cy={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ly,data:{}};var qn={passive:!0};function uy(e){var t=e.state,o=e.instance,r=e.options,n=r.scroll,a=n===void 0?!0:n,s=r.resize,i=s===void 0?!0:s,l=Dt(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach(function(d){d.addEventListener("scroll",o.update,qn)}),i&&l.addEventListener("resize",o.update,qn),function(){a&&c.forEach(function(d){d.removeEventListener("scroll",o.update,qn)}),i&&l.removeEventListener("resize",o.update,qn)}}const dy={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:uy,data:{}};var py={left:"right",right:"left",bottom:"top",top:"bottom"};function ua(e){return e.replace(/left|right|bottom|top/g,function(t){return py[t]})}var fy={start:"end",end:"start"};function mc(e){return e.replace(/start|end/g,function(t){return fy[t]})}function ol(e){var t=Dt(e),o=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:o,scrollTop:r}}function rl(e){return jr(Zo(e)).left+ol(e).scrollLeft}function my(e,t){var o=Dt(e),r=Zo(e),n=o.visualViewport,a=r.clientWidth,s=r.clientHeight,i=0,l=0;if(n){a=n.width,s=n.height;var c=qd();(c||!c&&t==="fixed")&&(i=n.offsetLeft,l=n.offsetTop)}return{width:a,height:s,x:i+rl(e),y:l}}function gy(e){var t,o=Zo(e),r=ol(e),n=(t=e.ownerDocument)==null?void 0:t.body,a=lr(o.scrollWidth,o.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),s=lr(o.scrollHeight,o.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),i=-r.scrollLeft+rl(e),l=-r.scrollTop;return Lo(n||o).direction==="rtl"&&(i+=lr(o.clientWidth,n?n.clientWidth:0)-a),{width:a,height:s,x:i,y:l}}function nl(e){var t=Lo(e),o=t.overflow,r=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(o+n+r)}function Qd(e){return["html","body","#document"].indexOf(Ro(e))>=0?e.ownerDocument.body:Yt(e)&&nl(e)?e:Qd(gs(e))}function pn(e,t){var o;t===void 0&&(t=[]);var r=Qd(e),n=r===((o=e.ownerDocument)==null?void 0:o.body),a=Dt(r),s=n?[a].concat(a.visualViewport||[],nl(r)?r:[]):r,i=t.concat(s);return n?i:i.concat(pn(gs(s)))}function ai(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function hy(e,t){var o=jr(e,!1,t==="fixed");return o.top=o.top+e.clientTop,o.left=o.left+e.clientLeft,o.bottom=o.top+e.clientHeight,o.right=o.left+e.clientWidth,o.width=e.clientWidth,o.height=e.clientHeight,o.x=o.left,o.y=o.top,o}function gc(e,t,o){return t===Gd?ai(my(e,o)):dr(t)?hy(t,o):ai(gy(Zo(e)))}function vy(e){var t=pn(gs(e)),o=["absolute","fixed"].indexOf(Lo(e).position)>=0,r=o&&Yt(e)?_n(e):e;return dr(r)?t.filter(function(n){return dr(n)&&Yd(n,r)&&Ro(n)!=="body"}):[]}function by(e,t,o,r){var n=t==="clippingParents"?vy(e):[].concat(t),a=[].concat(n,[o]),s=a[0],i=a.reduce(function(l,c){var d=gc(e,c,r);return l.top=lr(d.top,l.top),l.right=Pa(d.right,l.right),l.bottom=Pa(d.bottom,l.bottom),l.left=lr(d.left,l.left),l},gc(e,s,r));return i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}function ep(e){var t=e.reference,o=e.element,r=e.placement,n=r?Co(r):null,a=r?Dr(r):null,s=t.x+t.width/2-o.width/2,i=t.y+t.height/2-o.height/2,l;switch(n){case Ot:l={x:s,y:t.y-o.height};break;case Qt:l={x:s,y:t.y+t.height};break;case eo:l={x:t.x+t.width,y:i};break;case Et:l={x:t.x-o.width,y:i};break;default:l={x:t.x,y:t.y}}var c=n?tl(n):null;if(c!=null){var d=c==="y"?"height":"width";switch(a){case Nr:l[c]=l[c]-(t[d]/2-o[d]/2);break;case Cn:l[c]=l[c]+(t[d]/2-o[d]/2);break}}return l}function $n(e,t){t===void 0&&(t={});var o=t,r=o.placement,n=r===void 0?e.placement:r,a=o.strategy,s=a===void 0?e.strategy:a,i=o.boundary,l=i===void 0?z0:i,c=o.rootBoundary,d=c===void 0?Gd:c,m=o.elementContext,v=m===void 0?en:m,y=o.altBoundary,b=y===void 0?!1:y,h=o.padding,C=h===void 0?0:h,x=Zd(typeof C!="number"?C:Jd(C,Bn)),P=v===en?j0:en,$=e.rects.popper,S=e.elements[b?P:v],k=by(dr(S)?S:S.contextElement||Zo(e.elements.popper),l,d,s),f=jr(e.elements.reference),R=ep({reference:f,element:$,placement:n}),T=ai(Object.assign({},$,R)),w=v===en?T:f,O={top:k.top-w.top+x.top,bottom:w.bottom-k.bottom+x.bottom,left:k.left-w.left+x.left,right:w.right-k.right+x.right},j=e.modifiersData.offset;if(v===en&&j){var L=j[n];Object.keys(O).forEach(function(E){var B=[eo,Qt].indexOf(E)>=0?1:-1,z=[Ot,Qt].indexOf(E)>=0?"y":"x";O[E]+=L[z]*B})}return O}function yy(e,t){t===void 0&&(t={});var o=t,r=o.placement,n=o.boundary,a=o.rootBoundary,s=o.padding,i=o.flipVariations,l=o.allowedAutoPlacements,c=l===void 0?Kd:l,d=Dr(r),m=d?i?dc:dc.filter(function(b){return Dr(b)===d}):Bn,v=m.filter(function(b){return c.indexOf(b)>=0});v.length===0&&(v=m);var y=v.reduce(function(b,h){return b[h]=$n(e,{placement:h,boundary:n,rootBoundary:a,padding:s})[Co(h)],b},{});return Object.keys(y).sort(function(b,h){return y[b]-y[h]})}function xy(e){if(Co(e)===Ji)return[];var t=ua(e);return[mc(e),t,mc(t)]}function Cy(e){var t=e.state,o=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var n=o.mainAxis,a=n===void 0?!0:n,s=o.altAxis,i=s===void 0?!0:s,l=o.fallbackPlacements,c=o.padding,d=o.boundary,m=o.rootBoundary,v=o.altBoundary,y=o.flipVariations,b=y===void 0?!0:y,h=o.allowedAutoPlacements,C=t.options.placement,x=Co(C),P=x===C,$=l||(P||!b?[ua(C)]:xy(C)),S=[C].concat($).reduce(function(re,pe){return re.concat(Co(pe)===Ji?yy(t,{placement:pe,boundary:d,rootBoundary:m,padding:c,flipVariations:b,allowedAutoPlacements:h}):pe)},[]),k=t.rects.reference,f=t.rects.popper,R=new Map,T=!0,w=S[0],O=0;O=0,z=B?"width":"height",W=$n(t,{placement:j,boundary:d,rootBoundary:m,altBoundary:v,padding:c}),H=B?E?eo:Et:E?Qt:Ot;k[z]>f[z]&&(H=ua(H));var _=ua(H),G=[];if(a&&G.push(W[L]<=0),i&&G.push(W[H]<=0,W[_]<=0),G.every(function(re){return re})){w=j,T=!1;break}R.set(j,G)}if(T)for(var se=b?3:1,ve=function(pe){var te=S.find(function(be){var ae=R.get(be);if(ae)return ae.slice(0,pe).every(function(de){return de})});if(te)return w=te,"break"},Re=se;Re>0;Re--){var Se=ve(Re);if(Se==="break")break}t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}const $y={name:"flip",enabled:!0,phase:"main",fn:Cy,requiresIfExists:["offset"],data:{_skip:!1}};function hc(e,t,o){return o===void 0&&(o={x:0,y:0}),{top:e.top-t.height-o.y,right:e.right-t.width+o.x,bottom:e.bottom-t.height+o.y,left:e.left-t.width-o.x}}function vc(e){return[Ot,eo,Qt,Et].some(function(t){return e[t]>=0})}function Sy(e){var t=e.state,o=e.name,r=t.rects.reference,n=t.rects.popper,a=t.modifiersData.preventOverflow,s=$n(t,{elementContext:"reference"}),i=$n(t,{altBoundary:!0}),l=hc(s,r),c=hc(i,n,a),d=vc(l),m=vc(c);t.modifiersData[o]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":m})}const Ry={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Sy};function Py(e,t,o){var r=Co(e),n=[Et,Ot].indexOf(r)>=0?-1:1,a=typeof o=="function"?o(Object.assign({},t,{placement:e})):o,s=a[0],i=a[1];return s=s||0,i=(i||0)*n,[Et,eo].indexOf(r)>=0?{x:i,y:s}:{x:s,y:i}}function ky(e){var t=e.state,o=e.options,r=e.name,n=o.offset,a=n===void 0?[0,0]:n,s=Kd.reduce(function(d,m){return d[m]=Py(m,t.rects,a),d},{}),i=s[t.placement],l=i.x,c=i.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}const Ty={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ky};function wy(e){var t=e.state,o=e.name;t.modifiersData[o]=ep({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const My={name:"popperOffsets",enabled:!0,phase:"read",fn:wy,data:{}};function Iy(e){return e==="x"?"y":"x"}function Oy(e){var t=e.state,o=e.options,r=e.name,n=o.mainAxis,a=n===void 0?!0:n,s=o.altAxis,i=s===void 0?!1:s,l=o.boundary,c=o.rootBoundary,d=o.altBoundary,m=o.padding,v=o.tether,y=v===void 0?!0:v,b=o.tetherOffset,h=b===void 0?0:b,C=$n(t,{boundary:l,rootBoundary:c,padding:m,altBoundary:d}),x=Co(t.placement),P=Dr(t.placement),$=!P,S=tl(x),k=Iy(S),f=t.modifiersData.popperOffsets,R=t.rects.reference,T=t.rects.popper,w=typeof h=="function"?h(Object.assign({},t.rects,{placement:t.placement})):h,O=typeof w=="number"?{mainAxis:w,altAxis:w}:Object.assign({mainAxis:0,altAxis:0},w),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(f){if(a){var E,B=S==="y"?Ot:Et,z=S==="y"?Qt:eo,W=S==="y"?"height":"width",H=f[S],_=H+C[B],G=H-C[z],se=y?-T[W]/2:0,ve=P===Nr?R[W]:T[W],Re=P===Nr?-T[W]:-R[W],Se=t.elements.arrow,re=y&&Se?el(Se):{width:0,height:0},pe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Xd(),te=pe[B],be=pe[z],ae=dn(0,R[W],re[W]),de=$?R[W]/2-se-ae-te-O.mainAxis:ve-ae-te-O.mainAxis,Ee=$?-R[W]/2+se+ae+be+O.mainAxis:Re+ae+be+O.mainAxis,fe=t.elements.arrow&&_n(t.elements.arrow),xe=fe?S==="y"?fe.clientTop||0:fe.clientLeft||0:0,he=(E=j==null?void 0:j[S])!=null?E:0,me=H+de-he-xe,le=H+Ee-he,ce=dn(y?Pa(_,me):_,H,y?lr(G,le):G);f[S]=ce,L[S]=ce-H}if(i){var Ae,ie=S==="x"?Ot:Et,ze=S==="x"?Qt:eo,Pe=f[k],Oe=k==="y"?"height":"width",je=Pe+C[ie],Ie=Pe-C[ze],Le=[Ot,Et].indexOf(x)!==-1,Ke=(Ae=j==null?void 0:j[k])!=null?Ae:0,qe=Le?je:Pe-R[Oe]-T[Oe]-Ke+O.altAxis,We=Le?Pe+R[Oe]+T[Oe]-Ke-O.altAxis:Ie,U=y&&Le?ty(qe,Pe,We):dn(y?qe:je,Pe,y?We:Ie);f[k]=U,L[k]=U-Pe}t.modifiersData[r]=L}}const Ey={name:"preventOverflow",enabled:!0,phase:"main",fn:Oy,requiresIfExists:["offset"]};function Ly(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ay(e){return e===Dt(e)||!Yt(e)?ol(e):Ly(e)}function By(e){var t=e.getBoundingClientRect(),o=zr(t.width)/e.offsetWidth||1,r=zr(t.height)/e.offsetHeight||1;return o!==1||r!==1}function _y(e,t,o){o===void 0&&(o=!1);var r=Yt(t),n=Yt(t)&&By(t),a=Zo(t),s=jr(e,n,o),i={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!o)&&((Ro(t)!=="body"||nl(a))&&(i=Ay(t)),Yt(t)?(l=jr(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):a&&(l.x=rl(a))),{x:s.left+i.scrollLeft-l.x,y:s.top+i.scrollTop-l.y,width:s.width,height:s.height}}function Ny(e){var t=new Map,o=new Set,r=[];e.forEach(function(a){t.set(a.name,a)});function n(a){o.add(a.name);var s=[].concat(a.requires||[],a.requiresIfExists||[]);s.forEach(function(i){if(!o.has(i)){var l=t.get(i);l&&n(l)}}),r.push(a)}return e.forEach(function(a){o.has(a.name)||n(a)}),r}function zy(e){var t=Ny(e);return Y0.reduce(function(o,r){return o.concat(t.filter(function(n){return n.phase===r}))},[])}function jy(e){var t;return function(){return t||(t=new Promise(function(o){Promise.resolve().then(function(){t=void 0,o(e())})})),t}}function Dy(e){var t=e.reduce(function(o,r){var n=o[r.name];return o[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,o},{});return Object.keys(t).map(function(o){return t[o]})}var bc={placement:"bottom",modifiers:[],strategy:"absolute"};function yc(){for(var e=arguments.length,t=new Array(e),o=0;o{a||i(Vy(n)||document.body)},[n,a]),xt(()=>{if(s&&!a)return yn(o,s),()=>{yn(o,null)}},[o,s,a]),a){if(p.isValidElement(r)){const c={ref:l};return p.cloneElement(r,c)}return g.jsx(p.Fragment,{children:r})}return g.jsx(p.Fragment,{children:s&&lf.createPortal(r,s)})});function Uy(e){return Y("MuiPopper",e)}X("MuiPopper",["root"]);const Gy=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],Ky=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function qy(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function si(e){return typeof e=="function"?e():e}function Yy(e){return e.nodeType!==void 0}const Xy=e=>{const{classes:t}=e;return Z({root:["root"]},Uy,t)},Zy={},Jy=p.forwardRef(function(t,o){var r;const{anchorEl:n,children:a,direction:s,disablePortal:i,modifiers:l,open:c,placement:d,popperOptions:m,popperRef:v,slotProps:y={},slots:b={},TransitionProps:h}=t,C=F(t,Gy),x=p.useRef(null),P=Ue(x,o),$=p.useRef(null),S=Ue($,v),k=p.useRef(S);xt(()=>{k.current=S},[S]),p.useImperativeHandle(v,()=>$.current,[]);const f=qy(d,s),[R,T]=p.useState(f),[w,O]=p.useState(si(n));p.useEffect(()=>{$.current&&$.current.forceUpdate()}),p.useEffect(()=>{n&&O(si(n))},[n]),xt(()=>{if(!w||!c)return;const z=_=>{T(_.placement)};let W=[{name:"preventOverflow",options:{altBoundary:i}},{name:"flip",options:{altBoundary:i}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:_})=>{z(_)}}];l!=null&&(W=W.concat(l)),m&&m.modifiers!=null&&(W=W.concat(m.modifiers));const H=Hy(w,x.current,u({placement:f},m,{modifiers:W}));return k.current(H),()=>{H.destroy(),k.current(null)}},[w,i,l,c,m,f]);const j={placement:R};h!==null&&(j.TransitionProps=h);const L=Xy(t),E=(r=b.root)!=null?r:"div",B=lt({elementType:E,externalSlotProps:y.root,externalForwardedProps:C,additionalProps:{role:"tooltip",ref:P},ownerState:t,className:L.root});return g.jsx(E,u({},B,{children:typeof a=="function"?a(j):a}))}),Qy=p.forwardRef(function(t,o){const{anchorEl:r,children:n,container:a,direction:s="ltr",disablePortal:i=!1,keepMounted:l=!1,modifiers:c,open:d,placement:m="bottom",popperOptions:v=Zy,popperRef:y,style:b,transition:h=!1,slotProps:C={},slots:x={}}=t,P=F(t,Ky),[$,S]=p.useState(!0),k=()=>{S(!1)},f=()=>{S(!0)};if(!l&&!d&&(!h||$))return null;let R;if(a)R=a;else if(r){const O=si(r);R=O&&Yy(O)?rt(O).body:rt(null).body}const T=!d&&l&&(!h||$)?"none":void 0,w=h?{in:d,onEnter:k,onExited:f}:void 0;return g.jsx(tp,{disablePortal:i,container:R,children:g.jsx(Jy,u({anchorEl:r,direction:s,disablePortal:i,modifiers:c,ref:o,open:h?!$:d,placement:m,popperOptions:v,popperRef:y,slotProps:C,slots:x},P,{style:u({position:"fixed",top:0,left:0,display:T},b),TransitionProps:w,children:n}))})}),ex=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],tx=M(Qy,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),hs=p.forwardRef(function(t,o){var r;const n=Vd(),a=oe({props:t,name:"MuiPopper"}),{anchorEl:s,component:i,components:l,componentsProps:c,container:d,disablePortal:m,keepMounted:v,modifiers:y,open:b,placement:h,popperOptions:C,popperRef:x,transition:P,slots:$,slotProps:S}=a,k=F(a,ex),f=(r=$==null?void 0:$.root)!=null?r:l==null?void 0:l.Root,R=u({anchorEl:s,container:d,disablePortal:m,keepMounted:v,modifiers:y,open:b,placement:h,popperOptions:C,popperRef:x,transition:P},k);return g.jsx(tx,u({as:i,direction:n==null?void 0:n.direction,slots:{root:f},slotProps:S??c},R,{ref:o}))});function ox(e){return Y("MuiListSubheader",e)}X("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const rx=["className","color","component","disableGutters","disableSticky","inset"],nx=e=>{const{classes:t,color:o,disableGutters:r,inset:n,disableSticky:a}=e,s={root:["root",o!=="default"&&`color${I(o)}`,!r&&"gutters",n&&"inset",!a&&"sticky"]};return Z(s,ox,t)},ax=M("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.color!=="default"&&t[`color${I(o.color)}`],!o.disableGutters&&t.gutters,o.inset&&t.inset,!o.disableSticky&&t.sticky]}})(({theme:e,ownerState:t})=>u({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14)},t.color==="primary"&&{color:(e.vars||e).palette.primary.main},t.color==="inherit"&&{color:"inherit"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.inset&&{paddingLeft:72},!t.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper})),op=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiListSubheader"}),{className:n,color:a="default",component:s="li",disableGutters:i=!1,disableSticky:l=!1,inset:c=!1}=r,d=F(r,rx),m=u({},r,{color:a,component:s,disableGutters:i,disableSticky:l,inset:c}),v=nx(m);return g.jsx(ax,u({as:s,className:D(v.root,n),ref:o,ownerState:m},d))});op.muiSkipListHighlight=!0;const sx=ue(g.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function rp(e){return Y("MuiChip",e)}const Fe=X("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),ix=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],lx=e=>{const{classes:t,disabled:o,size:r,color:n,iconColor:a,onDelete:s,clickable:i,variant:l}=e,c={root:["root",l,o&&"disabled",`size${I(r)}`,`color${I(n)}`,i&&"clickable",i&&`clickableColor${I(n)}`,s&&"deletable",s&&`deletableColor${I(n)}`,`${l}${I(n)}`],label:["label",`label${I(r)}`],avatar:["avatar",`avatar${I(r)}`,`avatarColor${I(n)}`],icon:["icon",`icon${I(r)}`,`iconColor${I(a)}`],deleteIcon:["deleteIcon",`deleteIcon${I(r)}`,`deleteIconColor${I(n)}`,`deleteIcon${I(l)}Color${I(n)}`]};return Z(c,rp,t)},cx=M("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e,{color:r,iconColor:n,clickable:a,onDelete:s,size:i,variant:l}=o;return[{[`& .${Fe.avatar}`]:t.avatar},{[`& .${Fe.avatar}`]:t[`avatar${I(i)}`]},{[`& .${Fe.avatar}`]:t[`avatarColor${I(r)}`]},{[`& .${Fe.icon}`]:t.icon},{[`& .${Fe.icon}`]:t[`icon${I(i)}`]},{[`& .${Fe.icon}`]:t[`iconColor${I(n)}`]},{[`& .${Fe.deleteIcon}`]:t.deleteIcon},{[`& .${Fe.deleteIcon}`]:t[`deleteIcon${I(i)}`]},{[`& .${Fe.deleteIcon}`]:t[`deleteIconColor${I(r)}`]},{[`& .${Fe.deleteIcon}`]:t[`deleteIcon${I(l)}Color${I(r)}`]},t.root,t[`size${I(i)}`],t[`color${I(r)}`],a&&t.clickable,a&&r!=="default"&&t[`clickableColor${I(r)})`],s&&t.deletable,s&&r!=="default"&&t[`deletableColor${I(r)}`],t[l],t[`${l}${I(r)}`]]}})(({theme:e,ownerState:t})=>{const o=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return u({maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Fe.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Fe.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:o,fontSize:e.typography.pxToRem(12)},[`& .${Fe.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${Fe.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${Fe.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${Fe.icon}`]:u({marginLeft:5,marginRight:-6},t.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},t.iconColor===t.color&&u({color:e.vars?e.vars.palette.Chip.defaultIconColor:o},t.color!=="default"&&{color:"inherit"})),[`& .${Fe.deleteIcon}`]:u({WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:we(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:we(e.palette.text.primary,.4)}},t.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},t.color!=="default"&&{color:e.vars?`rgba(${e.vars.palette[t.color].contrastTextChannel} / 0.7)`:we(e.palette[t.color].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].contrastText}})},t.size==="small"&&{height:24},t.color!=="default"&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.onDelete&&{[`&.${Fe.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:we(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},t.onDelete&&t.color!=="default"&&{[`&.${Fe.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}})},({theme:e,ownerState:t})=>u({},t.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:we(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${Fe.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:we(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}},t.clickable&&t.color!=="default"&&{[`&:hover, &.${Fe.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}}),({theme:e,ownerState:t})=>u({},t.variant==="outlined"&&{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${Fe.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${Fe.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${Fe.avatar}`]:{marginLeft:4},[`& .${Fe.avatarSmall}`]:{marginLeft:2},[`& .${Fe.icon}`]:{marginLeft:4},[`& .${Fe.iconSmall}`]:{marginLeft:2},[`& .${Fe.deleteIcon}`]:{marginRight:5},[`& .${Fe.deleteIconSmall}`]:{marginRight:3}},t.variant==="outlined"&&t.color!=="default"&&{color:(e.vars||e).palette[t.color].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:we(e.palette[t.color].main,.7)}`,[`&.${Fe.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:we(e.palette[t.color].main,e.palette.action.hoverOpacity)},[`&.${Fe.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.focusOpacity})`:we(e.palette[t.color].main,e.palette.action.focusOpacity)},[`& .${Fe.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:we(e.palette[t.color].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].main}}})),ux=M("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:o}=e,{size:r}=o;return[t.label,t[`label${I(r)}`]]}})(({ownerState:e})=>u({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},e.variant==="outlined"&&{paddingLeft:11,paddingRight:11},e.size==="small"&&{paddingLeft:8,paddingRight:8},e.size==="small"&&e.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function xc(e){return e.key==="Backspace"||e.key==="Delete"}const np=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiChip"}),{avatar:n,className:a,clickable:s,color:i="default",component:l,deleteIcon:c,disabled:d=!1,icon:m,label:v,onClick:y,onDelete:b,onKeyDown:h,onKeyUp:C,size:x="medium",variant:P="filled",tabIndex:$,skipFocusWhenDisabled:S=!1}=r,k=F(r,ix),f=p.useRef(null),R=Ue(f,o),T=G=>{G.stopPropagation(),b&&b(G)},w=G=>{G.currentTarget===G.target&&xc(G)&&G.preventDefault(),h&&h(G)},O=G=>{G.currentTarget===G.target&&(b&&xc(G)?b(G):G.key==="Escape"&&f.current&&f.current.blur()),C&&C(G)},j=s!==!1&&y?!0:s,L=j||b?kt:l||"div",E=u({},r,{component:L,disabled:d,size:x,color:i,iconColor:p.isValidElement(m)&&m.props.color||i,onDelete:!!b,clickable:j,variant:P}),B=lx(E),z=L===kt?u({component:l||"div",focusVisibleClassName:B.focusVisible},b&&{disableRipple:!0}):{};let W=null;b&&(W=c&&p.isValidElement(c)?p.cloneElement(c,{className:D(c.props.className,B.deleteIcon),onClick:T}):g.jsx(sx,{className:D(B.deleteIcon),onClick:T}));let H=null;n&&p.isValidElement(n)&&(H=p.cloneElement(n,{className:D(B.avatar,n.props.className)}));let _=null;return m&&p.isValidElement(m)&&(_=p.cloneElement(m,{className:D(B.icon,m.props.className)})),g.jsxs(cx,u({as:L,className:D(B.root,a),disabled:j&&d?!0:void 0,onClick:y,onKeyDown:w,onKeyUp:O,ref:R,tabIndex:S&&d?-1:$,ownerState:E},z,k,{children:[H||_,g.jsx(ux,{className:D(B.label),ownerState:E,children:v}),W]}))}),n4=Object.freeze(Object.defineProperty({__proto__:null,chipClasses:Fe,default:np,getChipUtilityClass:rp},Symbol.toStringTag,{value:"Module"})),dx=["onChange","maxRows","minRows","style","value"];function Yn(e){return parseInt(e,10)||0}const px={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function fx(e){for(const t in e)return!1;return!0}function Cc(e){return fx(e)||e.outerHeightStyle===0&&!e.overflowing}const mx=p.forwardRef(function(t,o){const{onChange:r,maxRows:n,minRows:a=1,style:s,value:i}=t,l=F(t,dx),{current:c}=p.useRef(i!=null),d=p.useRef(null),m=Ue(o,d),v=p.useRef(null),y=p.useRef(null),b=p.useCallback(()=>{const $=d.current,S=y.current;if(!$||!S)return;const f=Zt($).getComputedStyle($);if(f.width==="0px")return{outerHeightStyle:0,overflowing:!1};S.style.width=f.width,S.value=$.value||t.placeholder||"x",S.value.slice(-1)===` +`&&(S.value+=" ");const R=f.boxSizing,T=Yn(f.paddingBottom)+Yn(f.paddingTop),w=Yn(f.borderBottomWidth)+Yn(f.borderTopWidth),O=S.scrollHeight;S.value="x";const j=S.scrollHeight;let L=O;a&&(L=Math.max(Number(a)*j,L)),n&&(L=Math.min(Number(n)*j,L)),L=Math.max(L,j);const E=L+(R==="border-box"?T+w:0),B=Math.abs(L-O)<=1;return{outerHeightStyle:E,overflowing:B}},[n,a,t.placeholder]),h=at(()=>{const $=d.current,S=b();if(!$||!S||Cc(S))return!1;const k=S.outerHeightStyle;return v.current!=null&&v.current!==k}),C=p.useCallback(()=>{const $=d.current,S=b();if(!$||!S||Cc(S))return;const k=S.outerHeightStyle;v.current!==k&&(v.current=k,$.style.height=`${k}px`),$.style.overflow=S.overflowing?"hidden":""},[b]),x=p.useRef(-1);xt(()=>{const $=Gr(C),S=d==null?void 0:d.current;if(!S)return;const k=Zt(S);k.addEventListener("resize",$);let f;return typeof ResizeObserver<"u"&&(f=new ResizeObserver(()=>{h()&&(f.unobserve(S),cancelAnimationFrame(x.current),C(),x.current=requestAnimationFrame(()=>{f.observe(S)}))}),f.observe(S)),()=>{$.clear(),cancelAnimationFrame(x.current),k.removeEventListener("resize",$),f&&f.disconnect()}},[b,C,h]),xt(()=>{C()});const P=$=>{c||C(),r&&r($)};return g.jsxs(p.Fragment,{children:[g.jsx("textarea",u({value:i,onChange:P,ref:m,rows:a,style:s},l)),g.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:y,tabIndex:-1,style:u({},px.shadow,s,{paddingTop:0,paddingBottom:0})})]})});function Jo({props:e,states:t,muiFormControl:o}){return t.reduce((r,n)=>(r[n]=e[n],o&&typeof e[n]>"u"&&(r[n]=o[n]),r),{})}const vs=p.createContext(void 0);function fo(){return p.useContext(vs)}function gx(e){return g.jsx(Yu,u({},e,{defaultTheme:ds,themeId:Io}))}function $c(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function ka(e,t=!1){return e&&($c(e.value)&&e.value!==""||t&&$c(e.defaultValue)&&e.defaultValue!=="")}function hx(e){return e.startAdornment}function ap(e){return Y("MuiInputBase",e)}const It=X("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),vx=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],bs=(e,t)=>{const{ownerState:o}=e;return[t.root,o.formControl&&t.formControl,o.startAdornment&&t.adornedStart,o.endAdornment&&t.adornedEnd,o.error&&t.error,o.size==="small"&&t.sizeSmall,o.multiline&&t.multiline,o.color&&t[`color${I(o.color)}`],o.fullWidth&&t.fullWidth,o.hiddenLabel&&t.hiddenLabel]},ys=(e,t)=>{const{ownerState:o}=e;return[t.input,o.size==="small"&&t.inputSizeSmall,o.multiline&&t.inputMultiline,o.type==="search"&&t.inputTypeSearch,o.startAdornment&&t.inputAdornedStart,o.endAdornment&&t.inputAdornedEnd,o.hiddenLabel&&t.inputHiddenLabel]},bx=e=>{const{classes:t,color:o,disabled:r,error:n,endAdornment:a,focused:s,formControl:i,fullWidth:l,hiddenLabel:c,multiline:d,readOnly:m,size:v,startAdornment:y,type:b}=e,h={root:["root",`color${I(o)}`,r&&"disabled",n&&"error",l&&"fullWidth",s&&"focused",i&&"formControl",v&&v!=="medium"&&`size${I(v)}`,d&&"multiline",y&&"adornedStart",a&&"adornedEnd",c&&"hiddenLabel",m&&"readOnly"],input:["input",r&&"disabled",b==="search"&&"inputTypeSearch",d&&"inputMultiline",v==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",y&&"inputAdornedStart",a&&"inputAdornedEnd",m&&"readOnly"]};return Z(h,ap,t)},xs=M("div",{name:"MuiInputBase",slot:"Root",overridesResolver:bs})(({theme:e,ownerState:t})=>u({},e.typography.body1,{color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${It.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"}},t.multiline&&u({padding:"4px 0 5px"},t.size==="small"&&{paddingTop:1}),t.fullWidth&&{width:"100%"})),Cs=M("input",{name:"MuiInputBase",slot:"Input",overridesResolver:ys})(({theme:e,ownerState:t})=>{const o=e.palette.mode==="light",r=u({color:"currentColor"},e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:o?.42:.5},{transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})}),n={opacity:"0 !important"},a=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:o?.42:.5};return u({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${It.formControl} &`]:{"&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&:-ms-input-placeholder":n,"&::-ms-input-placeholder":n,"&:focus::-webkit-input-placeholder":a,"&:focus::-moz-placeholder":a,"&:focus:-ms-input-placeholder":a,"&:focus::-ms-input-placeholder":a},[`&.${It.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},t.size==="small"&&{paddingTop:1},t.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},t.type==="search"&&{MozAppearance:"textfield"})}),yx=g.jsx(gx,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),Nn=p.forwardRef(function(t,o){var r;const n=oe({props:t,name:"MuiInputBase"}),{"aria-describedby":a,autoComplete:s,autoFocus:i,className:l,components:c={},componentsProps:d={},defaultValue:m,disabled:v,disableInjectingGlobalStyles:y,endAdornment:b,fullWidth:h=!1,id:C,inputComponent:x="input",inputProps:P={},inputRef:$,maxRows:S,minRows:k,multiline:f=!1,name:R,onBlur:T,onChange:w,onClick:O,onFocus:j,onKeyDown:L,onKeyUp:E,placeholder:B,readOnly:z,renderSuffix:W,rows:H,slotProps:_={},slots:G={},startAdornment:se,type:ve="text",value:Re}=n,Se=F(n,vx),re=P.value!=null?P.value:Re,{current:pe}=p.useRef(re!=null),te=p.useRef(),be=p.useCallback(U=>{},[]),ae=Ue(te,$,P.ref,be),[de,Ee]=p.useState(!1),fe=fo(),xe=Jo({props:n,muiFormControl:fe,states:["color","disabled","error","hiddenLabel","size","required","filled"]});xe.focused=fe?fe.focused:de,p.useEffect(()=>{!fe&&v&&de&&(Ee(!1),T&&T())},[fe,v,de,T]);const he=fe&&fe.onFilled,me=fe&&fe.onEmpty,le=p.useCallback(U=>{ka(U)?he&&he():me&&me()},[he,me]);xt(()=>{pe&&le({value:re})},[re,le,pe]);const ce=U=>{if(xe.disabled){U.stopPropagation();return}j&&j(U),P.onFocus&&P.onFocus(U),fe&&fe.onFocus?fe.onFocus(U):Ee(!0)},Ae=U=>{T&&T(U),P.onBlur&&P.onBlur(U),fe&&fe.onBlur?fe.onBlur(U):Ee(!1)},ie=(U,...N)=>{if(!pe){const Q=U.target||te.current;if(Q==null)throw new Error(Pt(1));le({value:Q.value})}P.onChange&&P.onChange(U,...N),w&&w(U,...N)};p.useEffect(()=>{le(te.current)},[]);const ze=U=>{te.current&&U.currentTarget===U.target&&te.current.focus(),O&&O(U)};let Pe=x,Oe=P;f&&Pe==="input"&&(H?Oe=u({type:void 0,minRows:H,maxRows:H},Oe):Oe=u({type:void 0,maxRows:S,minRows:k},Oe),Pe=mx);const je=U=>{le(U.animationName==="mui-auto-fill-cancel"?te.current:{value:"x"})};p.useEffect(()=>{fe&&fe.setAdornedStart(!!se)},[fe,se]);const Ie=u({},n,{color:xe.color||"primary",disabled:xe.disabled,endAdornment:b,error:xe.error,focused:xe.focused,formControl:fe,fullWidth:h,hiddenLabel:xe.hiddenLabel,multiline:f,size:xe.size,startAdornment:se,type:ve}),Le=bx(Ie),Ke=G.root||c.Root||xs,qe=_.root||d.root||{},We=G.input||c.Input||Cs;return Oe=u({},Oe,(r=_.input)!=null?r:d.input),g.jsxs(p.Fragment,{children:[!y&&yx,g.jsxs(Ke,u({},qe,!co(Ke)&&{ownerState:u({},Ie,qe.ownerState)},{ref:o,onClick:ze},Se,{className:D(Le.root,qe.className,l,z&&"MuiInputBase-readOnly"),children:[se,g.jsx(vs.Provider,{value:null,children:g.jsx(We,u({ownerState:Ie,"aria-invalid":xe.error,"aria-describedby":a,autoComplete:s,autoFocus:i,defaultValue:m,disabled:xe.disabled,id:C,onAnimationStart:je,name:R,placeholder:B,readOnly:z,required:xe.required,rows:H,value:re,onKeyDown:L,onKeyUp:E,type:ve},Oe,!co(We)&&{as:Pe,ownerState:u({},Ie,Oe.ownerState)},{ref:ae,className:D(Le.input,Oe.className,z&&"MuiInputBase-readOnly"),onBlur:Ae,onChange:ie,onFocus:ce}))}),b,W?W(u({},xe,{startAdornment:se})):null]}))]})}),a4=Object.freeze(Object.defineProperty({__proto__:null,default:Nn,getInputBaseUtilityClass:ap,inputBaseClasses:It},Symbol.toStringTag,{value:"Module"}));function sp(e){return Y("MuiInput",e)}const wo=u({},It,X("MuiInput",["root","underline","input"]));function xx(e){return Y("MuiOutlinedInput",e)}const vo=u({},It,X("MuiOutlinedInput",["root","notchedOutline","input"]));function Cx(e){return Y("MuiFilledInput",e)}const Nt=u({},It,X("MuiFilledInput",["root","underline","input"])),ip=ue(g.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function $x(e){return Y("MuiAutocomplete",e)}const _e=X("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var Sc,Rc;const Sx=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],Rx=["ref"],Px=["key"],kx=["key"],Tx=e=>{const{classes:t,disablePortal:o,expanded:r,focused:n,fullWidth:a,hasClearIcon:s,hasPopupIcon:i,inputFocused:l,popupOpen:c,size:d}=e,m={root:["root",r&&"expanded",n&&"focused",a&&"fullWidth",s&&"hasClearIcon",i&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${I(d)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",c&&"popupIndicatorOpen"],popper:["popper",o&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Z(m,$x,t)},wx=M("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e,{fullWidth:r,hasClearIcon:n,hasPopupIcon:a,inputFocused:s,size:i}=o;return[{[`& .${_e.tag}`]:t.tag},{[`& .${_e.tag}`]:t[`tagSize${I(i)}`]},{[`& .${_e.inputRoot}`]:t.inputRoot},{[`& .${_e.input}`]:t.input},{[`& .${_e.input}`]:s&&t.inputFocused},t.root,r&&t.fullWidth,a&&t.hasPopupIcon,n&&t.hasClearIcon]}})({[`&.${_e.focused} .${_e.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${_e.clearIndicator}`]:{visibility:"visible"}},[`& .${_e.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${_e.inputRoot}`]:{[`.${_e.hasPopupIcon}&, .${_e.hasClearIcon}&`]:{paddingRight:30},[`.${_e.hasPopupIcon}.${_e.hasClearIcon}&`]:{paddingRight:56},[`& .${_e.input}`]:{width:0,minWidth:30}},[`& .${wo.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${wo.root}.${It.sizeSmall}`]:{[`& .${wo.input}`]:{padding:"2px 4px 3px 0"}},[`& .${vo.root}`]:{padding:9,[`.${_e.hasPopupIcon}&, .${_e.hasClearIcon}&`]:{paddingRight:39},[`.${_e.hasPopupIcon}.${_e.hasClearIcon}&`]:{paddingRight:65},[`& .${_e.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${_e.endAdornment}`]:{right:9}},[`& .${vo.root}.${It.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${_e.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${Nt.root}`]:{paddingTop:19,paddingLeft:8,[`.${_e.hasPopupIcon}&, .${_e.hasClearIcon}&`]:{paddingRight:39},[`.${_e.hasPopupIcon}.${_e.hasClearIcon}&`]:{paddingRight:65},[`& .${Nt.input}`]:{padding:"7px 4px"},[`& .${_e.endAdornment}`]:{right:9}},[`& .${Nt.root}.${It.sizeSmall}`]:{paddingBottom:1,[`& .${Nt.input}`]:{padding:"2.5px 4px"}},[`& .${It.hiddenLabel}`]:{paddingTop:8},[`& .${Nt.root}.${It.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${_e.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${Nt.root}.${It.hiddenLabel}.${It.sizeSmall}`]:{[`& .${_e.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${_e.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${_e.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${_e.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${_e.inputRoot}`]:{flexWrap:"wrap"}}}]}),Mx=M("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,t)=>t.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),Ix=M(Go,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,t)=>t.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),Ox=M(Go,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:e},t)=>u({},t.popupIndicator,e.popupOpen&&t.popupIndicatorOpen)})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),Ex=M(hs,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{[`& .${_e.option}`]:t.option},t.popper,o.disablePortal&&t.popperDisablePortal]}})(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]})),Lx=M(no,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>u({},e.typography.body1,{overflow:"auto"})),Ax=M("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,t)=>t.loading})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),Bx=M("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,t)=>t.noOptions})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),_x=M("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,t)=>t.listbox})(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${_e.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${_e.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${_e.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:we(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${_e.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:we(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${_e.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:we(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}})),Nx=M(op,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,t)=>t.groupLabel})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8})),zx=M("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,t)=>t.groupUl})({padding:0,[`& .${_e.option}`]:{paddingLeft:24}}),s4=p.forwardRef(function(t,o){var r,n,a,s;const i=oe({props:t,name:"MuiAutocomplete"}),{autoComplete:l=!1,autoHighlight:c=!1,autoSelect:d=!1,blurOnSelect:m=!1,ChipProps:v,className:y,clearIcon:b=Sc||(Sc=g.jsx(Wd,{fontSize:"small"})),clearOnBlur:h=!i.freeSolo,clearOnEscape:C=!1,clearText:x="Clear",closeText:P="Close",componentsProps:$={},defaultValue:S=i.multiple?[]:null,disableClearable:k=!1,disableCloseOnSelect:f=!1,disabled:R=!1,disabledItemsFocusable:T=!1,disableListWrap:w=!1,disablePortal:O=!1,filterSelectedOptions:j=!1,forcePopupIcon:L="auto",freeSolo:E=!1,fullWidth:B=!1,getLimitTagsText:z=A=>`+${A}`,getOptionLabel:W,groupBy:H,handleHomeEndKeys:_=!i.freeSolo,includeInputInList:G=!1,limitTags:se=-1,ListboxComponent:ve="ul",ListboxProps:Re,loading:Se=!1,loadingText:re="Loading…",multiple:pe=!1,noOptionsText:te="No options",openOnFocus:be=!1,openText:ae="Open",PaperComponent:de=no,PopperComponent:Ee=hs,popupIcon:fe=Rc||(Rc=g.jsx(ip,{})),readOnly:xe=!1,renderGroup:he,renderInput:me,renderOption:le,renderTags:ce,selectOnFocus:Ae=!i.freeSolo,size:ie="medium",slotProps:ze={}}=i,Pe=F(i,Sx),{getRootProps:Oe,getInputProps:je,getInputLabelProps:Ie,getPopupIndicatorProps:Le,getClearProps:Ke,getTagProps:qe,getListboxProps:We,getOptionProps:U,value:N,dirty:Q,expanded:$e,id:Te,popupOpen:J,focused:ge,focusedTag:q,anchorEl:ee,setAnchorEl:ke,inputValue:Be,groupedOptions:Ne}=E0(u({},i,{componentName:"Autocomplete"})),Ge=!k&&!R&&Q&&!xe,Qe=(!E||L===!0)&&L!==!1,{onMouseDown:mt}=je(),{ref:nt}=Re??{},Tt=We(),{ref:ao}=Tt,jo=F(Tt,Rx),Po=Ue(ao,nt),wt=W||(A=>{var ne;return(ne=A.label)!=null?ne:A}),pt=u({},i,{disablePortal:O,expanded:$e,focused:ge,fullWidth:B,getOptionLabel:wt,hasClearIcon:Ge,hasPopupIcon:Qe,inputFocused:q===-1,popupOpen:J,size:ie}),et=Tx(pt);let vt;if(pe&&N.length>0){const A=ne=>u({className:et.tag,disabled:R},qe(ne));ce?vt=ce(N,A,pt):vt=N.map((ne,ye)=>{const Me=A({index:ye}),{key:Ce}=Me,De=F(Me,Px);return g.jsx(np,u({label:wt(ne),size:ie},De,v),Ce)})}if(se>-1&&Array.isArray(vt)){const A=vt.length-se;!ge&&A>0&&(vt=vt.splice(0,se),vt.push(g.jsx("span",{className:et.tag,children:z(A)},vt.length)))}const so=he||(A=>g.jsxs("li",{children:[g.jsx(Nx,{className:et.groupLabel,ownerState:pt,component:"div",children:A.group}),g.jsx(zx,{className:et.groupUl,ownerState:pt,children:A.children})]},A.key)),_t=le||((A,ne)=>{const{key:ye}=A,Me=F(A,kx);return g.jsx("li",u({},Me,{children:wt(ne)}),ye)}),mo=(A,ne)=>{const ye=U({option:A,index:ne});return _t(u({},ye,{className:et.option}),A,{selected:ye["aria-selected"],index:ne,inputValue:Be},pt)},Wt=(r=ze.clearIndicator)!=null?r:$.clearIndicator,Mt=(n=ze.paper)!=null?n:$.paper,io=(a=ze.popper)!=null?a:$.popper,V=(s=ze.popupIndicator)!=null?s:$.popupIndicator;return g.jsxs(p.Fragment,{children:[g.jsx(wx,u({ref:o,className:D(et.root,y),ownerState:pt},Oe(Pe),{children:me({id:Te,disabled:R,fullWidth:!0,size:ie==="small"?"small":void 0,InputLabelProps:Ie(),InputProps:u({ref:ke,className:et.inputRoot,startAdornment:vt,onClick:A=>{A.target===A.currentTarget&&mt(A)}},(Ge||Qe)&&{endAdornment:g.jsxs(Mx,{className:et.endAdornment,ownerState:pt,children:[Ge?g.jsx(Ix,u({},Ke(),{"aria-label":x,title:x,ownerState:pt},Wt,{className:D(et.clearIndicator,Wt==null?void 0:Wt.className),children:b})):null,Qe?g.jsx(Ox,u({},Le(),{disabled:R,"aria-label":J?P:ae,title:J?P:ae,ownerState:pt},V,{className:D(et.popupIndicator,V==null?void 0:V.className),children:fe})):null]})}),inputProps:u({className:et.input,disabled:R,readOnly:xe},je())})})),ee?g.jsx(Ex,u({as:Ee,disablePortal:O,style:{width:ee?ee.clientWidth:null},ownerState:pt,role:"presentation",anchorEl:ee,open:J},io,{className:D(et.popper,io==null?void 0:io.className),children:g.jsxs(Lx,u({ownerState:pt,as:de},Mt,{className:D(et.paper,Mt==null?void 0:Mt.className),children:[Se&&Ne.length===0?g.jsx(Ax,{className:et.loading,ownerState:pt,children:re}):null,Ne.length===0&&!E&&!Se?g.jsx(Bx,{className:et.noOptions,ownerState:pt,role:"presentation",onMouseDown:A=>{A.preventDefault()},children:te}):null,Ne.length>0?g.jsx(_x,u({as:ve,className:et.listbox,ownerState:pt},jo,Re,{ref:Po,children:Ne.map((A,ne)=>H?so({key:A.key,group:A.group,children:A.options.map((ye,Me)=>mo(ye,A.index+Me))}):mo(A,ne))})):null]}))})):null]})}),jx=ue(g.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function Dx(e){return Y("MuiAvatar",e)}X("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const Fx=["alt","children","className","component","slots","slotProps","imgProps","sizes","src","srcSet","variant"],Wx=e=>{const{classes:t,variant:o,colorDefault:r}=e;return Z({root:["root",o,r&&"colorDefault"],img:["img"],fallback:["fallback"]},Dx,t)},Hx=M("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[o.variant],o.colorDefault&&t.colorDefault]}})(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:u({color:(e.vars||e).palette.background.default},e.vars?{backgroundColor:e.vars.palette.Avatar.defaultBg}:u({backgroundColor:e.palette.grey[400]},e.applyStyles("dark",{backgroundColor:e.palette.grey[600]})))}]})),Vx=M("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(e,t)=>t.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),Ux=M(jx,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(e,t)=>t.fallback})({width:"75%",height:"75%"});function Gx({crossOrigin:e,referrerPolicy:t,src:o,srcSet:r}){const[n,a]=p.useState(!1);return p.useEffect(()=>{if(!o&&!r)return;a(!1);let s=!0;const i=new Image;return i.onload=()=>{s&&a("loaded")},i.onerror=()=>{s&&a("error")},i.crossOrigin=e,i.referrerPolicy=t,i.src=o,r&&(i.srcset=r),()=>{s=!1}},[e,t,o,r]),n}const i4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiAvatar"}),{alt:n,children:a,className:s,component:i="div",slots:l={},slotProps:c={},imgProps:d,sizes:m,src:v,srcSet:y,variant:b="circular"}=r,h=F(r,Fx);let C=null;const x=Gx(u({},d,{src:v,srcSet:y})),P=v||y,$=P&&x!=="error",S=u({},r,{colorDefault:!$,component:i,variant:b}),k=Wx(S),[f,R]=Ra("img",{className:k.img,elementType:Vx,externalForwardedProps:{slots:l,slotProps:{img:u({},d,c.img)}},additionalProps:{alt:n,src:v,srcSet:y,sizes:m},ownerState:S});return $?C=g.jsx(f,u({},R)):a||a===0?C=a:P&&n?C=n[0]:C=g.jsx(Ux,{ownerState:S,className:k.fallback}),g.jsx(Hx,u({as:i,ownerState:S,className:D(k.root,s),ref:o},h,{children:C}))}),Kx=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],qx={entering:{opacity:1},entered:{opacity:1}},lp=p.forwardRef(function(t,o){const r=ro(),n={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:a,appear:s=!0,children:i,easing:l,in:c,onEnter:d,onEntered:m,onEntering:v,onExit:y,onExited:b,onExiting:h,style:C,timeout:x=n,TransitionComponent:P=Bt}=t,$=F(t,Kx),S=p.useRef(null),k=Ue(S,_o(i),o),f=B=>z=>{if(B){const W=S.current;z===void 0?B(W):B(W,z)}},R=f(v),T=f((B,z)=>{fs(B);const W=So({style:C,timeout:x,easing:l},{mode:"enter"});B.style.webkitTransition=r.transitions.create("opacity",W),B.style.transition=r.transitions.create("opacity",W),d&&d(B,z)}),w=f(m),O=f(h),j=f(B=>{const z=So({style:C,timeout:x,easing:l},{mode:"exit"});B.style.webkitTransition=r.transitions.create("opacity",z),B.style.transition=r.transitions.create("opacity",z),y&&y(B)}),L=f(b),E=B=>{a&&a(S.current,B)};return g.jsx(P,u({appear:s,in:c,nodeRef:S,onEnter:T,onEntered:w,onEntering:R,onExit:j,onExited:L,onExiting:O,addEndListener:E,timeout:x},$,{children:(B,z)=>p.cloneElement(i,u({style:u({opacity:0,visibility:B==="exited"&&!c?"hidden":void 0},qx[B],C,i.props.style),ref:k},z))}))});function Yx(e){return Y("MuiBackdrop",e)}X("MuiBackdrop",["root","invisible"]);const Xx=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],Zx=e=>{const{classes:t,invisible:o}=e;return Z({root:["root",o&&"invisible"]},Yx,t)},Jx=M("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.invisible&&t.invisible]}})(({ownerState:e})=>u({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),cp=p.forwardRef(function(t,o){var r,n,a;const s=oe({props:t,name:"MuiBackdrop"}),{children:i,className:l,component:c="div",components:d={},componentsProps:m={},invisible:v=!1,open:y,slotProps:b={},slots:h={},TransitionComponent:C=lp,transitionDuration:x}=s,P=F(s,Xx),$=u({},s,{component:c,invisible:v}),S=Zx($),k=(r=b.root)!=null?r:m.root;return g.jsx(C,u({in:y,timeout:x},P,{children:g.jsx(Jx,u({"aria-hidden":!0},k,{as:(n=(a=h.root)!=null?a:d.Root)!=null?n:c,className:D(S.root,l,k==null?void 0:k.className),ownerState:u({},$,k==null?void 0:k.ownerState),classes:S,ref:o,children:i}))}))});function Qx(e){const{badgeContent:t,invisible:o=!1,max:r=99,showZero:n=!1}=e,a=Ni({badgeContent:t,max:r});let s=o;o===!1&&t===0&&!n&&(s=!0);const{badgeContent:i,max:l=r}=s?a:e,c=i&&Number(i)>l?`${l}+`:i;return{badgeContent:i,invisible:s,max:l,displayValue:c}}function eC(e){return Y("MuiBadge",e)}const Fo=X("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),tC=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],_s=10,Ns=4,oC=e=>{const{color:t,anchorOrigin:o,invisible:r,overlap:n,variant:a,classes:s={}}=e,i={root:["root"],badge:["badge",a,r&&"invisible",`anchorOrigin${I(o.vertical)}${I(o.horizontal)}`,`anchorOrigin${I(o.vertical)}${I(o.horizontal)}${I(n)}`,`overlap${I(n)}`,t!=="default"&&`color${I(t)}`]};return Z(i,eC,s)},rC=M("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),nC=M("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.badge,t[o.variant],t[`anchorOrigin${I(o.anchorOrigin.vertical)}${I(o.anchorOrigin.horizontal)}${I(o.overlap)}`],o.color!=="default"&&t[`color${I(o.color)}`],o.invisible&&t.invisible]}})(({theme:e})=>{var t;return{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:_s*2,lineHeight:1,padding:"0 6px",height:_s*2,borderRadius:_s,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen}),variants:[...Object.keys(((t=e.vars)!=null?t:e).palette).filter(o=>{var r,n;return((r=e.vars)!=null?r:e).palette[o].main&&((n=e.vars)!=null?n:e).palette[o].contrastText}).map(o=>({props:{color:o},style:{backgroundColor:(e.vars||e).palette[o].main,color:(e.vars||e).palette[o].contrastText}})),{props:{variant:"dot"},style:{borderRadius:Ns,height:Ns*2,minWidth:Ns*2,padding:0}},{props:({ownerState:o})=>o.anchorOrigin.vertical==="top"&&o.anchorOrigin.horizontal==="right"&&o.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${Fo.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:o})=>o.anchorOrigin.vertical==="bottom"&&o.anchorOrigin.horizontal==="right"&&o.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${Fo.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:o})=>o.anchorOrigin.vertical==="top"&&o.anchorOrigin.horizontal==="left"&&o.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${Fo.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:o})=>o.anchorOrigin.vertical==="bottom"&&o.anchorOrigin.horizontal==="left"&&o.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${Fo.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:o})=>o.anchorOrigin.vertical==="top"&&o.anchorOrigin.horizontal==="right"&&o.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${Fo.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:o})=>o.anchorOrigin.vertical==="bottom"&&o.anchorOrigin.horizontal==="right"&&o.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${Fo.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:o})=>o.anchorOrigin.vertical==="top"&&o.anchorOrigin.horizontal==="left"&&o.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${Fo.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:o})=>o.anchorOrigin.vertical==="bottom"&&o.anchorOrigin.horizontal==="left"&&o.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${Fo.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})}}]}}),l4=p.forwardRef(function(t,o){var r,n,a,s,i,l;const c=oe({props:t,name:"MuiBadge"}),{anchorOrigin:d={vertical:"top",horizontal:"right"},className:m,component:v,components:y={},componentsProps:b={},children:h,overlap:C="rectangular",color:x="default",invisible:P=!1,max:$=99,badgeContent:S,slots:k,slotProps:f,showZero:R=!1,variant:T="standard"}=c,w=F(c,tC),{badgeContent:O,invisible:j,max:L,displayValue:E}=Qx({max:$,invisible:P,badgeContent:S,showZero:R}),B=Ni({anchorOrigin:d,color:x,overlap:C,variant:T,badgeContent:S}),z=j||O==null&&T!=="dot",{color:W=x,overlap:H=C,anchorOrigin:_=d,variant:G=T}=z?B:c,se=G!=="dot"?E:void 0,ve=u({},c,{badgeContent:O,invisible:z,max:L,displayValue:se,showZero:R,anchorOrigin:_,color:W,overlap:H,variant:G}),Re=oC(ve),Se=(r=(n=k==null?void 0:k.root)!=null?n:y.Root)!=null?r:rC,re=(a=(s=k==null?void 0:k.badge)!=null?s:y.Badge)!=null?a:nC,pe=(i=f==null?void 0:f.root)!=null?i:b.root,te=(l=f==null?void 0:f.badge)!=null?l:b.badge,be=lt({elementType:Se,externalSlotProps:pe,externalForwardedProps:w,additionalProps:{ref:o,as:v},ownerState:ve,className:D(pe==null?void 0:pe.className,Re.root,m)}),ae=lt({elementType:re,externalSlotProps:te,ownerState:ve,className:D(Re.badge,te==null?void 0:te.className)});return g.jsxs(Se,u({},be,{children:[h,g.jsx(re,u({},ae,{children:se}))]}))}),aC=X("MuiBox",["root"]),sC=ur(),c4=Zu({themeId:Io,defaultTheme:sC,defaultClassName:aC.root,generateClassName:Za.generate});function up(e){return Y("MuiButton",e)}const ln=X("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),dp=p.createContext({}),pp=p.createContext(void 0),iC=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],lC=e=>{const{color:t,disableElevation:o,fullWidth:r,size:n,variant:a,classes:s}=e,i={root:["root",a,`${a}${I(t)}`,`size${I(n)}`,`${a}Size${I(n)}`,`color${I(t)}`,o&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${I(n)}`],endIcon:["icon","endIcon",`iconSize${I(n)}`]},l=Z(i,up,s);return u({},s,l)},fp=e=>u({},e.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},e.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},e.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),cC=M(kt,{shouldForwardProp:e=>gt(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[o.variant],t[`${o.variant}${I(o.color)}`],t[`size${I(o.size)}`],t[`${o.variant}Size${I(o.size)}`],o.color==="inherit"&&t.colorInherit,o.disableElevation&&t.disableElevation,o.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var o,r;const n=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],a=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return u({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":u({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:we(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="text"&&t.color!=="inherit"&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:we(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="outlined"&&t.color!=="inherit"&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:we(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="contained"&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:a,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},t.variant==="contained"&&t.color!=="inherit"&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":u({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${ln.focusVisible}`]:u({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${ln.disabled}`]:u({color:(e.vars||e).palette.action.disabled},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},t.variant==="contained"&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},t.variant==="text"&&{padding:"6px 8px"},t.variant==="text"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main},t.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},t.variant==="outlined"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${we(e.palette[t.color].main,.5)}`},t.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(o=(r=e.palette).getContrastText)==null?void 0:o.call(r,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:n,boxShadow:(e.vars||e).shadows[2]},t.variant==="contained"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},t.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},t.size==="small"&&t.variant==="text"&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="text"&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="outlined"&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="outlined"&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="contained"&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="contained"&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${ln.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${ln.disabled}`]:{boxShadow:"none"}}),uC=M("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.startIcon,t[`iconSize${I(o.size)}`]]}})(({ownerState:e})=>u({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},fp(e))),dC=M("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.endIcon,t[`iconSize${I(o.size)}`]]}})(({ownerState:e})=>u({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},fp(e))),pC=p.forwardRef(function(t,o){const r=p.useContext(dp),n=p.useContext(pp),a=_r(r,t),s=oe({props:a,name:"MuiButton"}),{children:i,color:l="primary",component:c="button",className:d,disabled:m=!1,disableElevation:v=!1,disableFocusRipple:y=!1,endIcon:b,focusVisibleClassName:h,fullWidth:C=!1,size:x="medium",startIcon:P,type:$,variant:S="text"}=s,k=F(s,iC),f=u({},s,{color:l,component:c,disabled:m,disableElevation:v,disableFocusRipple:y,fullWidth:C,size:x,type:$,variant:S}),R=lC(f),T=P&&g.jsx(uC,{className:R.startIcon,ownerState:f,children:P}),w=b&&g.jsx(dC,{className:R.endIcon,ownerState:f,children:b}),O=n||"";return g.jsxs(cC,u({ownerState:f,className:D(r.className,R.root,d,O),component:c,disabled:m,focusRipple:!y,focusVisibleClassName:D(R.focusVisible,h),ref:o,type:$},k,{classes:R,children:[T,i,w]}))}),u4=Object.freeze(Object.defineProperty({__proto__:null,buttonClasses:ln,default:pC,getButtonUtilityClass:up},Symbol.toStringTag,{value:"Module"}));function fC(e){return Y("MuiButtonGroup",e)}const bt=X("MuiButtonGroup",["root","contained","outlined","text","disableElevation","disabled","firstButton","fullWidth","vertical","grouped","groupedHorizontal","groupedVertical","groupedText","groupedTextHorizontal","groupedTextVertical","groupedTextPrimary","groupedTextSecondary","groupedOutlined","groupedOutlinedHorizontal","groupedOutlinedVertical","groupedOutlinedPrimary","groupedOutlinedSecondary","groupedContained","groupedContainedHorizontal","groupedContainedVertical","groupedContainedPrimary","groupedContainedSecondary","lastButton","middleButton"]),mC=["children","className","color","component","disabled","disableElevation","disableFocusRipple","disableRipple","fullWidth","orientation","size","variant"],gC=(e,t)=>{const{ownerState:o}=e;return[{[`& .${bt.grouped}`]:t.grouped},{[`& .${bt.grouped}`]:t[`grouped${I(o.orientation)}`]},{[`& .${bt.grouped}`]:t[`grouped${I(o.variant)}`]},{[`& .${bt.grouped}`]:t[`grouped${I(o.variant)}${I(o.orientation)}`]},{[`& .${bt.grouped}`]:t[`grouped${I(o.variant)}${I(o.color)}`]},{[`& .${bt.firstButton}`]:t.firstButton},{[`& .${bt.lastButton}`]:t.lastButton},{[`& .${bt.middleButton}`]:t.middleButton},t.root,t[o.variant],o.disableElevation===!0&&t.disableElevation,o.fullWidth&&t.fullWidth,o.orientation==="vertical"&&t.vertical]},hC=e=>{const{classes:t,color:o,disabled:r,disableElevation:n,fullWidth:a,orientation:s,variant:i}=e,l={root:["root",i,s==="vertical"&&"vertical",a&&"fullWidth",n&&"disableElevation"],grouped:["grouped",`grouped${I(s)}`,`grouped${I(i)}`,`grouped${I(i)}${I(s)}`,`grouped${I(i)}${I(o)}`,r&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return Z(l,fC,t)},vC=M("div",{name:"MuiButtonGroup",slot:"Root",overridesResolver:gC})(({theme:e,ownerState:t})=>u({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[2]},t.disableElevation&&{boxShadow:"none"},t.fullWidth&&{width:"100%"},t.orientation==="vertical"&&{flexDirection:"column"},{[`& .${bt.grouped}`]:u({minWidth:40,"&:hover":u({},t.variant==="contained"&&{boxShadow:"none"})},t.variant==="contained"&&{boxShadow:"none"}),[`& .${bt.firstButton},& .${bt.middleButton}`]:u({},t.orientation==="horizontal"&&{borderTopRightRadius:0,borderBottomRightRadius:0},t.orientation==="vertical"&&{borderBottomRightRadius:0,borderBottomLeftRadius:0},t.variant==="text"&&t.orientation==="horizontal"&&{borderRight:e.vars?`1px solid rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:`1px solid ${e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${bt.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}},t.variant==="text"&&t.orientation==="vertical"&&{borderBottom:e.vars?`1px solid rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:`1px solid ${e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${bt.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}},t.variant==="text"&&t.color!=="inherit"&&{borderColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:we(e.palette[t.color].main,.5)},t.variant==="outlined"&&t.orientation==="horizontal"&&{borderRightColor:"transparent"},t.variant==="outlined"&&t.orientation==="vertical"&&{borderBottomColor:"transparent"},t.variant==="contained"&&t.orientation==="horizontal"&&{borderRight:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${bt.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}},t.variant==="contained"&&t.orientation==="vertical"&&{borderBottom:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${bt.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}},t.variant==="contained"&&t.color!=="inherit"&&{borderColor:(e.vars||e).palette[t.color].dark},{"&:hover":u({},t.variant==="outlined"&&t.orientation==="horizontal"&&{borderRightColor:"currentColor"},t.variant==="outlined"&&t.orientation==="vertical"&&{borderBottomColor:"currentColor"})}),[`& .${bt.lastButton},& .${bt.middleButton}`]:u({},t.orientation==="horizontal"&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t.orientation==="vertical"&&{borderTopRightRadius:0,borderTopLeftRadius:0},t.variant==="outlined"&&t.orientation==="horizontal"&&{marginLeft:-1},t.variant==="outlined"&&t.orientation==="vertical"&&{marginTop:-1})})),d4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiButtonGroup"}),{children:n,className:a,color:s="primary",component:i="div",disabled:l=!1,disableElevation:c=!1,disableFocusRipple:d=!1,disableRipple:m=!1,fullWidth:v=!1,orientation:y="horizontal",size:b="medium",variant:h="outlined"}=r,C=F(r,mC),x=u({},r,{color:s,component:i,disabled:l,disableElevation:c,disableFocusRipple:d,disableRipple:m,fullWidth:v,orientation:y,size:b,variant:h}),P=hC(x),$=p.useMemo(()=>({className:P.grouped,color:s,disabled:l,disableElevation:c,disableFocusRipple:d,disableRipple:m,fullWidth:v,size:b,variant:h}),[s,l,c,d,m,v,b,h,P.grouped]),S=cd(n),k=S.length,f=R=>{const T=R===0,w=R===k-1;return T&&w?"":T?P.firstButton:w?P.lastButton:P.middleButton};return g.jsx(vC,u({as:i,role:"group",className:D(P.root,a),ref:o,ownerState:x},C,{children:g.jsx(dp.Provider,{value:$,children:S.map((R,T)=>g.jsx(pp.Provider,{value:f(T),children:R},T))})}))});function bC(e){return Y("MuiCard",e)}X("MuiCard",["root"]);const yC=["className","raised"],xC=e=>{const{classes:t}=e;return Z({root:["root"]},bC,t)},CC=M(no,{name:"MuiCard",slot:"Root",overridesResolver:(e,t)=>t.root})(()=>({overflow:"hidden"})),p4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiCard"}),{className:n,raised:a=!1}=r,s=F(r,yC),i=u({},r,{raised:a}),l=xC(i);return g.jsx(CC,u({className:D(l.root,n),elevation:a?8:void 0,ref:o,ownerState:i},s))});function $C(e){return Y("MuiCardActionArea",e)}const zs=X("MuiCardActionArea",["root","focusVisible","focusHighlight"]),SC=["children","className","focusVisibleClassName"],RC=e=>{const{classes:t}=e;return Z({root:["root"],focusHighlight:["focusHighlight"]},$C,t)},PC=M(kt,{name:"MuiCardActionArea",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"block",textAlign:"inherit",borderRadius:"inherit",width:"100%",[`&:hover .${zs.focusHighlight}`]:{opacity:(e.vars||e).palette.action.hoverOpacity,"@media (hover: none)":{opacity:0}},[`&.${zs.focusVisible} .${zs.focusHighlight}`]:{opacity:(e.vars||e).palette.action.focusOpacity}})),kC=M("span",{name:"MuiCardActionArea",slot:"FocusHighlight",overridesResolver:(e,t)=>t.focusHighlight})(({theme:e})=>({overflow:"hidden",pointerEvents:"none",position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:"inherit",opacity:0,backgroundColor:"currentcolor",transition:e.transitions.create("opacity",{duration:e.transitions.duration.short})})),f4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiCardActionArea"}),{children:n,className:a,focusVisibleClassName:s}=r,i=F(r,SC),l=r,c=RC(l);return g.jsxs(PC,u({className:D(c.root,a),focusVisibleClassName:D(s,c.focusVisible),ref:o,ownerState:l},i,{children:[n,g.jsx(kC,{className:c.focusHighlight,ownerState:l})]}))});function TC(e){return Y("MuiCardActions",e)}X("MuiCardActions",["root","spacing"]);const wC=["disableSpacing","className"],MC=e=>{const{classes:t,disableSpacing:o}=e;return Z({root:["root",!o&&"spacing"]},TC,t)},IC=M("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,!o.disableSpacing&&t.spacing]}})(({ownerState:e})=>u({display:"flex",alignItems:"center",padding:8},!e.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),m4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiCardActions"}),{disableSpacing:n=!1,className:a}=r,s=F(r,wC),i=u({},r,{disableSpacing:n}),l=MC(i);return g.jsx(IC,u({className:D(l.root,a),ownerState:i,ref:o},s))});function OC(e){return Y("MuiCardContent",e)}X("MuiCardContent",["root"]);const EC=["className","component"],LC=e=>{const{classes:t}=e;return Z({root:["root"]},OC,t)},AC=M("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,t)=>t.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),g4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiCardContent"}),{className:n,component:a="div"}=r,s=F(r,EC),i=u({},r,{component:a}),l=LC(i);return g.jsx(AC,u({as:a,className:D(l.root,n),ownerState:i,ref:o},s))});function BC(e){return Y("MuiCardHeader",e)}const Pc=X("MuiCardHeader",["root","avatar","action","content","title","subheader"]),_C=["action","avatar","className","component","disableTypography","subheader","subheaderTypographyProps","title","titleTypographyProps"],NC=e=>{const{classes:t}=e;return Z({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},BC,t)},zC=M("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(e,t)=>u({[`& .${Pc.title}`]:t.title,[`& .${Pc.subheader}`]:t.subheader},t.root)})({display:"flex",alignItems:"center",padding:16}),jC=M("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(e,t)=>t.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),DC=M("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(e,t)=>t.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),FC=M("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(e,t)=>t.content})({flex:"1 1 auto"}),h4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiCardHeader"}),{action:n,avatar:a,className:s,component:i="div",disableTypography:l=!1,subheader:c,subheaderTypographyProps:d,title:m,titleTypographyProps:v}=r,y=F(r,_C),b=u({},r,{component:i,disableTypography:l}),h=NC(b);let C=m;C!=null&&C.type!==St&&!l&&(C=g.jsx(St,u({variant:a?"body2":"h5",className:h.title,component:"span",display:"block"},v,{children:C})));let x=c;return x!=null&&x.type!==St&&!l&&(x=g.jsx(St,u({variant:a?"body2":"body1",className:h.subheader,color:"text.secondary",component:"span",display:"block"},d,{children:x}))),g.jsxs(zC,u({className:D(h.root,s),as:i,ref:o,ownerState:b},y,{children:[a&&g.jsx(jC,{className:h.avatar,ownerState:b,children:a}),g.jsxs(FC,{className:h.content,ownerState:b,children:[C,x]}),n&&g.jsx(DC,{className:h.action,ownerState:b,children:n})]}))});function WC(e){return Y("MuiCardMedia",e)}X("MuiCardMedia",["root","media","img"]);const HC=["children","className","component","image","src","style"],VC=e=>{const{classes:t,isMediaComponent:o,isImageComponent:r}=e;return Z({root:["root",o&&"media",r&&"img"]},WC,t)},UC=M("div",{name:"MuiCardMedia",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e,{isMediaComponent:r,isImageComponent:n}=o;return[t.root,r&&t.media,n&&t.img]}})(({ownerState:e})=>u({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"},e.isMediaComponent&&{width:"100%"},e.isImageComponent&&{objectFit:"cover"})),GC=["video","audio","picture","iframe","img"],KC=["picture","img"],v4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiCardMedia"}),{children:n,className:a,component:s="div",image:i,src:l,style:c}=r,d=F(r,HC),m=GC.indexOf(s)!==-1,v=!m&&i?u({backgroundImage:`url("${i}")`},c):c,y=u({},r,{component:s,isMediaComponent:m,isImageComponent:KC.indexOf(s)!==-1}),b=VC(y);return g.jsx(UC,u({className:D(b.root,a),as:s,role:!m&&i?"img":void 0,ref:o,style:v,ownerState:y,src:m?i||l:void 0},d,{children:n}))});function qC(e){return Y("PrivateSwitchBase",e)}X("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const YC=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],XC=e=>{const{classes:t,checked:o,disabled:r,edge:n}=e,a={root:["root",o&&"checked",r&&"disabled",n&&`edge${I(n)}`],input:["input"]};return Z(a,qC,t)},ZC=M(kt,{name:"MuiSwitchBase"})(({ownerState:e})=>u({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),JC=M("input",{name:"MuiSwitchBase",shouldForwardProp:gt})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),al=p.forwardRef(function(t,o){const{autoFocus:r,checked:n,checkedIcon:a,className:s,defaultChecked:i,disabled:l,disableFocusRipple:c=!1,edge:d=!1,icon:m,id:v,inputProps:y,inputRef:b,name:h,onBlur:C,onChange:x,onFocus:P,readOnly:$,required:S=!1,tabIndex:k,type:f,value:R}=t,T=F(t,YC),[w,O]=qt({controlled:n,default:!!i,name:"SwitchBase",state:"checked"}),j=fo(),L=G=>{P&&P(G),j&&j.onFocus&&j.onFocus(G)},E=G=>{C&&C(G),j&&j.onBlur&&j.onBlur(G)},B=G=>{if(G.nativeEvent.defaultPrevented)return;const se=G.target.checked;O(se),x&&x(G,se)};let z=l;j&&typeof z>"u"&&(z=j.disabled);const W=f==="checkbox"||f==="radio",H=u({},t,{checked:w,disabled:z,disableFocusRipple:c,edge:d}),_=XC(H);return g.jsxs(ZC,u({component:"span",className:D(_.root,s),centerRipple:!0,focusRipple:!c,disabled:z,tabIndex:null,role:void 0,onFocus:L,onBlur:E,ownerState:H,ref:o},T,{children:[g.jsx(JC,u({autoFocus:r,checked:n,defaultChecked:i,className:_.input,disabled:z,id:W?v:void 0,name:h,onChange:B,readOnly:$,ref:b,required:S,ownerState:H,tabIndex:k,type:f},f==="checkbox"&&R===void 0?{}:{value:R},y)),w?a:m]}))}),QC=ue(g.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),e2=ue(g.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),t2=ue(g.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function mp(e){return Y("MuiCheckbox",e)}const da=X("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),o2=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],r2=e=>{const{classes:t,indeterminate:o,color:r,size:n}=e,a={root:["root",o&&"indeterminate",`color${I(r)}`,`size${I(n)}`]},s=Z(a,mp,t);return u({},t,s)},n2=M(al,{shouldForwardProp:e=>gt(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.indeterminate&&t.indeterminate,t[`size${I(o.size)}`],o.color!=="default"&&t[`color${I(o.color)}`]]}})(({theme:e,ownerState:t})=>u({color:(e.vars||e).palette.text.secondary},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${t.color==="default"?e.vars.palette.action.activeChannel:e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:we(t.color==="default"?e.palette.action.active:e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.color!=="default"&&{[`&.${da.checked}, &.${da.indeterminate}`]:{color:(e.vars||e).palette[t.color].main},[`&.${da.disabled}`]:{color:(e.vars||e).palette.action.disabled}})),a2=g.jsx(e2,{}),s2=g.jsx(QC,{}),i2=g.jsx(t2,{}),l2=p.forwardRef(function(t,o){var r,n;const a=oe({props:t,name:"MuiCheckbox"}),{checkedIcon:s=a2,color:i="primary",icon:l=s2,indeterminate:c=!1,indeterminateIcon:d=i2,inputProps:m,size:v="medium",className:y}=a,b=F(a,o2),h=c?d:l,C=c?d:s,x=u({},a,{color:i,indeterminate:c,size:v}),P=r2(x);return g.jsx(n2,u({type:"checkbox",inputProps:u({"data-indeterminate":c},m),icon:p.cloneElement(h,{fontSize:(r=h.props.fontSize)!=null?r:v}),checkedIcon:p.cloneElement(C,{fontSize:(n=C.props.fontSize)!=null?n:v}),ownerState:x,ref:o,className:D(P.root,y)},b,{classes:P}))}),b4=Object.freeze(Object.defineProperty({__proto__:null,checkboxClasses:da,default:l2,getCheckboxUtilityClass:mp},Symbol.toStringTag,{value:"Module"}));function c2(e){return Y("MuiCircularProgress",e)}X("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const u2=["className","color","disableShrink","size","style","thickness","value","variant"];let $s=e=>e,kc,Tc,wc,Mc;const Wo=44,d2=po(kc||(kc=$s` + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +`)),p2=po(Tc||(Tc=$s` + 0% { + stroke-dasharray: 1px, 200px; + stroke-dashoffset: 0; + } + + 50% { + stroke-dasharray: 100px, 200px; + stroke-dashoffset: -15px; + } + + 100% { + stroke-dasharray: 100px, 200px; + stroke-dashoffset: -125px; + } +`)),f2=e=>{const{classes:t,variant:o,color:r,disableShrink:n}=e,a={root:["root",o,`color${I(r)}`],svg:["svg"],circle:["circle",`circle${I(o)}`,n&&"circleDisableShrink"]};return Z(a,c2,t)},m2=M("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[o.variant],t[`color${I(o.color)}`]]}})(({ownerState:e,theme:t})=>u({display:"inline-block"},e.variant==="determinate"&&{transition:t.transitions.create("transform")},e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main}),({ownerState:e})=>e.variant==="indeterminate"&&Bo(wc||(wc=$s` + animation: ${0} 1.4s linear infinite; + `),d2)),g2=M("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),h2=M("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.circle,t[`circle${I(o.variant)}`],o.disableShrink&&t.circleDisableShrink]}})(({ownerState:e,theme:t})=>u({stroke:"currentColor"},e.variant==="determinate"&&{transition:t.transitions.create("stroke-dashoffset")},e.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink&&Bo(Mc||(Mc=$s` + animation: ${0} 1.4s ease-in-out infinite; + `),p2)),y4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiCircularProgress"}),{className:n,color:a="primary",disableShrink:s=!1,size:i=40,style:l,thickness:c=3.6,value:d=0,variant:m="indeterminate"}=r,v=F(r,u2),y=u({},r,{color:a,disableShrink:s,size:i,thickness:c,value:d,variant:m}),b=f2(y),h={},C={},x={};if(m==="determinate"){const P=2*Math.PI*((Wo-c)/2);h.strokeDasharray=P.toFixed(3),x["aria-valuenow"]=Math.round(d),h.strokeDashoffset=`${((100-d)/100*P).toFixed(3)}px`,C.transform="rotate(-90deg)"}return g.jsx(m2,u({className:D(b.root,n),style:u({width:i,height:i},C,l),ownerState:y,ref:o,role:"progressbar"},x,v,{children:g.jsx(g2,{className:b.svg,ownerState:y,viewBox:`${Wo/2} ${Wo/2} ${Wo} ${Wo}`,children:g.jsx(h2,{className:b.circle,style:h,ownerState:y,cx:Wo,cy:Wo,r:(Wo-c)/2,fill:"none",strokeWidth:c})})}))});function Ic(e){return e.substring(2).toLowerCase()}function v2(e,t){return t.documentElement.clientWidth(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const d=Ue(_o(t),i),m=at(b=>{const h=c.current;c.current=!1;const C=rt(i.current);if(!l.current||!i.current||"clientX"in b&&v2(b,C))return;if(s.current){s.current=!1;return}let x;b.composedPath?x=b.composedPath().indexOf(i.current)>-1:x=!C.documentElement.contains(b.target)||i.current.contains(b.target),!x&&(o||!h)&&n(b)}),v=b=>h=>{c.current=!0;const C=t.props[b];C&&C(h)},y={ref:d};return a!==!1&&(y[a]=v(a)),p.useEffect(()=>{if(a!==!1){const b=Ic(a),h=rt(i.current),C=()=>{s.current=!0};return h.addEventListener(b,m),h.addEventListener("touchmove",C),()=>{h.removeEventListener(b,m),h.removeEventListener("touchmove",C)}}},[m,a]),r!==!1&&(y[r]=v(r)),p.useEffect(()=>{if(r!==!1){const b=Ic(r),h=rt(i.current);return h.addEventListener(b,m),()=>{h.removeEventListener(b,m)}}},[m,r]),g.jsx(p.Fragment,{children:p.cloneElement(t,y)})}const x4=nv({createStyledComponent:M("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[`maxWidth${I(String(o.maxWidth))}`],o.fixed&&t.fixed,o.disableGutters&&t.disableGutters]}}),useThemeProps:e=>oe({props:e,name:"MuiContainer"})});function y2(e){const t=rt(e);return t.body===e?Zt(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function fn(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function Oc(e){return parseInt(Zt(e).getComputedStyle(e).paddingRight,10)||0}function x2(e){const o=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return o||r}function Ec(e,t,o,r,n){const a=[t,o,...r];[].forEach.call(e.children,s=>{const i=a.indexOf(s)===-1,l=!x2(s);i&&l&&fn(s,n)})}function js(e,t){let o=-1;return e.some((r,n)=>t(r)?(o=n,!0):!1),o}function C2(e,t){const o=[],r=e.container;if(!t.disableScrollLock){if(y2(r)){const s=id(rt(r));o.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${Oc(r)+s}px`;const i=rt(r).querySelectorAll(".mui-fixed");[].forEach.call(i,l=>{o.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${Oc(l)+s}px`})}let a;if(r.parentNode instanceof DocumentFragment)a=rt(r).body;else{const s=r.parentElement,i=Zt(r);a=(s==null?void 0:s.nodeName)==="HTML"&&i.getComputedStyle(s).overflowY==="scroll"?s:r}o.push({value:a.style.overflow,property:"overflow",el:a},{value:a.style.overflowX,property:"overflow-x",el:a},{value:a.style.overflowY,property:"overflow-y",el:a}),a.style.overflow="hidden"}return()=>{o.forEach(({value:a,el:s,property:i})=>{a?s.style.setProperty(i,a):s.style.removeProperty(i)})}}function $2(e){const t=[];return[].forEach.call(e.children,o=>{o.getAttribute("aria-hidden")==="true"&&t.push(o)}),t}class S2{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,o){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&fn(t.modalRef,!1);const n=$2(o);Ec(o,t.mount,t.modalRef,n,!0);const a=js(this.containers,s=>s.container===o);return a!==-1?(this.containers[a].modals.push(t),r):(this.containers.push({modals:[t],container:o,restore:null,hiddenSiblings:n}),r)}mount(t,o){const r=js(this.containers,a=>a.modals.indexOf(t)!==-1),n=this.containers[r];n.restore||(n.restore=C2(n,o))}remove(t,o=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const n=js(this.containers,s=>s.modals.indexOf(t)!==-1),a=this.containers[n];if(a.modals.splice(a.modals.indexOf(t),1),this.modals.splice(r,1),a.modals.length===0)a.restore&&a.restore(),t.modalRef&&fn(t.modalRef,o),Ec(a.container,t.mount,t.modalRef,a.hiddenSiblings,!1),this.containers.splice(n,1);else{const s=a.modals[a.modals.length-1];s.modalRef&&fn(s.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}const R2=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function P2(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function k2(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let o=t(`[name="${e.name}"]:checked`);return o||(o=t(`[name="${e.name}"]`)),o!==e}function T2(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||k2(e))}function w2(e){const t=[],o=[];return Array.from(e.querySelectorAll(R2)).forEach((r,n)=>{const a=P2(r);a===-1||!T2(r)||(a===0?t.push(r):o.push({documentOrder:n,tabIndex:a,node:r}))}),o.sort((r,n)=>r.tabIndex===n.tabIndex?r.documentOrder-n.documentOrder:r.tabIndex-n.tabIndex).map(r=>r.node).concat(t)}function M2(){return!0}function I2(e){const{children:t,disableAutoFocus:o=!1,disableEnforceFocus:r=!1,disableRestoreFocus:n=!1,getTabbable:a=w2,isEnabled:s=M2,open:i}=e,l=p.useRef(!1),c=p.useRef(null),d=p.useRef(null),m=p.useRef(null),v=p.useRef(null),y=p.useRef(!1),b=p.useRef(null),h=Ue(_o(t),b),C=p.useRef(null);p.useEffect(()=>{!i||!b.current||(y.current=!o)},[o,i]),p.useEffect(()=>{if(!i||!b.current)return;const $=rt(b.current);return b.current.contains($.activeElement)||(b.current.hasAttribute("tabIndex")||b.current.setAttribute("tabIndex","-1"),y.current&&b.current.focus()),()=>{n||(m.current&&m.current.focus&&(l.current=!0,m.current.focus()),m.current=null)}},[i]),p.useEffect(()=>{if(!i||!b.current)return;const $=rt(b.current),S=R=>{C.current=R,!(r||!s()||R.key!=="Tab")&&$.activeElement===b.current&&R.shiftKey&&(l.current=!0,d.current&&d.current.focus())},k=()=>{const R=b.current;if(R===null)return;if(!$.hasFocus()||!s()||l.current){l.current=!1;return}if(R.contains($.activeElement)||r&&$.activeElement!==c.current&&$.activeElement!==d.current)return;if($.activeElement!==v.current)v.current=null;else if(v.current!==null)return;if(!y.current)return;let T=[];if(($.activeElement===c.current||$.activeElement===d.current)&&(T=a(b.current)),T.length>0){var w,O;const j=!!((w=C.current)!=null&&w.shiftKey&&((O=C.current)==null?void 0:O.key)==="Tab"),L=T[0],E=T[T.length-1];typeof L!="string"&&typeof E!="string"&&(j?E.focus():L.focus())}else R.focus()};$.addEventListener("focusin",k),$.addEventListener("keydown",S,!0);const f=setInterval(()=>{$.activeElement&&$.activeElement.tagName==="BODY"&&k()},50);return()=>{clearInterval(f),$.removeEventListener("focusin",k),$.removeEventListener("keydown",S,!0)}},[o,r,n,s,i,a]);const x=$=>{m.current===null&&(m.current=$.relatedTarget),y.current=!0,v.current=$.target;const S=t.props.onFocus;S&&S($)},P=$=>{m.current===null&&(m.current=$.relatedTarget),y.current=!0};return g.jsxs(p.Fragment,{children:[g.jsx("div",{tabIndex:i?0:-1,onFocus:P,ref:c,"data-testid":"sentinelStart"}),p.cloneElement(t,{ref:h,onFocus:x}),g.jsx("div",{tabIndex:i?0:-1,onFocus:P,ref:d,"data-testid":"sentinelEnd"})]})}function O2(e){return typeof e=="function"?e():e}function E2(e){return e?e.props.hasOwnProperty("in"):!1}const L2=new S2;function A2(e){const{container:t,disableEscapeKeyDown:o=!1,disableScrollLock:r=!1,manager:n=L2,closeAfterTransition:a=!1,onTransitionEnter:s,onTransitionExited:i,children:l,onClose:c,open:d,rootRef:m}=e,v=p.useRef({}),y=p.useRef(null),b=p.useRef(null),h=Ue(b,m),[C,x]=p.useState(!d),P=E2(l);let $=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&($=!1);const S=()=>rt(y.current),k=()=>(v.current.modalRef=b.current,v.current.mount=y.current,v.current),f=()=>{n.mount(k(),{disableScrollLock:r}),b.current&&(b.current.scrollTop=0)},R=at(()=>{const W=O2(t)||S().body;n.add(k(),W),b.current&&f()}),T=p.useCallback(()=>n.isTopModal(k()),[n]),w=at(W=>{y.current=W,W&&(d&&T()?f():b.current&&fn(b.current,$))}),O=p.useCallback(()=>{n.remove(k(),$)},[$,n]);p.useEffect(()=>()=>{O()},[O]),p.useEffect(()=>{d?R():(!P||!a)&&O()},[d,O,P,a,R]);const j=W=>H=>{var _;(_=W.onKeyDown)==null||_.call(W,H),!(H.key!=="Escape"||H.which===229||!T())&&(o||(H.stopPropagation(),c&&c(H,"escapeKeyDown")))},L=W=>H=>{var _;(_=W.onClick)==null||_.call(W,H),H.target===H.currentTarget&&c&&c(H,"backdropClick")};return{getRootProps:(W={})=>{const H=ir(e);delete H.onTransitionEnter,delete H.onTransitionExited;const _=u({},H,W);return u({role:"presentation"},_,{onKeyDown:j(_),ref:h})},getBackdropProps:(W={})=>{const H=W;return u({"aria-hidden":!0},H,{onClick:L(H),open:d})},getTransitionProps:()=>{const W=()=>{x(!1),s&&s()},H=()=>{x(!0),i&&i(),a&&O()};return{onEnter:ba(W,l==null?void 0:l.props.onEnter),onExited:ba(H,l==null?void 0:l.props.onExited)}},rootRef:h,portalRef:w,isTopModal:T,exited:C,hasTransition:P}}function B2(e){return Y("MuiModal",e)}X("MuiModal",["root","hidden","backdrop"]);const _2=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],N2=e=>{const{open:t,exited:o,classes:r}=e;return Z({root:["root",!t&&o&&"hidden"],backdrop:["backdrop"]},B2,r)},z2=M("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,!o.open&&o.exited&&t.hidden]}})(({theme:e,ownerState:t})=>u({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),j2=M(cp,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),sl=p.forwardRef(function(t,o){var r,n,a,s,i,l;const c=oe({name:"MuiModal",props:t}),{BackdropComponent:d=j2,BackdropProps:m,className:v,closeAfterTransition:y=!1,children:b,container:h,component:C,components:x={},componentsProps:P={},disableAutoFocus:$=!1,disableEnforceFocus:S=!1,disableEscapeKeyDown:k=!1,disablePortal:f=!1,disableRestoreFocus:R=!1,disableScrollLock:T=!1,hideBackdrop:w=!1,keepMounted:O=!1,onBackdropClick:j,open:L,slotProps:E,slots:B}=c,z=F(c,_2),W=u({},c,{closeAfterTransition:y,disableAutoFocus:$,disableEnforceFocus:S,disableEscapeKeyDown:k,disablePortal:f,disableRestoreFocus:R,disableScrollLock:T,hideBackdrop:w,keepMounted:O}),{getRootProps:H,getBackdropProps:_,getTransitionProps:G,portalRef:se,isTopModal:ve,exited:Re,hasTransition:Se}=A2(u({},W,{rootRef:o})),re=u({},W,{exited:Re}),pe=N2(re),te={};if(b.props.tabIndex===void 0&&(te.tabIndex="-1"),Se){const{onEnter:he,onExited:me}=G();te.onEnter=he,te.onExited=me}const be=(r=(n=B==null?void 0:B.root)!=null?n:x.Root)!=null?r:z2,ae=(a=(s=B==null?void 0:B.backdrop)!=null?s:x.Backdrop)!=null?a:d,de=(i=E==null?void 0:E.root)!=null?i:P.root,Ee=(l=E==null?void 0:E.backdrop)!=null?l:P.backdrop,fe=lt({elementType:be,externalSlotProps:de,externalForwardedProps:z,getSlotProps:H,additionalProps:{ref:o,as:C},ownerState:re,className:D(v,de==null?void 0:de.className,pe==null?void 0:pe.root,!re.open&&re.exited&&(pe==null?void 0:pe.hidden))}),xe=lt({elementType:ae,externalSlotProps:Ee,additionalProps:m,getSlotProps:he=>_(u({},he,{onClick:me=>{j&&j(me),he!=null&&he.onClick&&he.onClick(me)}})),className:D(Ee==null?void 0:Ee.className,m==null?void 0:m.className,pe==null?void 0:pe.backdrop),ownerState:re});return!O&&!L&&(!Se||Re)?null:g.jsx(tp,{ref:se,container:h,disablePortal:f,children:g.jsxs(be,u({},fe,{children:[!w&&d?g.jsx(ae,u({},xe)):null,g.jsx(I2,{disableEnforceFocus:S,disableAutoFocus:$,disableRestoreFocus:R,isEnabled:ve,open:L,children:p.cloneElement(b,te)})]}))})});function D2(e){return Y("MuiDialog",e)}const Ds=X("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),gp=p.createContext({}),F2=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],W2=M(cp,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),H2=e=>{const{classes:t,scroll:o,maxWidth:r,fullWidth:n,fullScreen:a}=e,s={root:["root"],container:["container",`scroll${I(o)}`],paper:["paper",`paperScroll${I(o)}`,`paperWidth${I(String(r))}`,n&&"paperFullWidth",a&&"paperFullScreen"]};return Z(s,D2,t)},V2=M(sl,{name:"MuiDialog",slot:"Root",overridesResolver:(e,t)=>t.root})({"@media print":{position:"absolute !important"}}),U2=M("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.container,t[`scroll${I(o.scroll)}`]]}})(({ownerState:e})=>u({height:"100%","@media print":{height:"auto"},outline:0},e.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},e.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),G2=M(no,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.paper,t[`scrollPaper${I(o.scroll)}`],t[`paperWidth${I(String(o.maxWidth))}`],o.fullWidth&&t.paperFullWidth,o.fullScreen&&t.paperFullScreen]}})(({theme:e,ownerState:t})=>u({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},t.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},t.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!t.maxWidth&&{maxWidth:"calc(100% - 64px)"},t.maxWidth==="xs"&&{maxWidth:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${Ds.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},t.maxWidth&&t.maxWidth!=="xs"&&{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`,[`&.${Ds.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},t.fullWidth&&{width:"calc(100% - 64px)"},t.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${Ds.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),C4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiDialog"}),n=ro(),a={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{"aria-describedby":s,"aria-labelledby":i,BackdropComponent:l,BackdropProps:c,children:d,className:m,disableEscapeKeyDown:v=!1,fullScreen:y=!1,fullWidth:b=!1,maxWidth:h="sm",onBackdropClick:C,onClick:x,onClose:P,open:$,PaperComponent:S=no,PaperProps:k={},scroll:f="paper",TransitionComponent:R=lp,transitionDuration:T=a,TransitionProps:w}=r,O=F(r,F2),j=u({},r,{disableEscapeKeyDown:v,fullScreen:y,fullWidth:b,maxWidth:h,scroll:f}),L=H2(j),E=p.useRef(),B=_=>{E.current=_.target===_.currentTarget},z=_=>{x&&x(_),E.current&&(E.current=null,C&&C(_),P&&P(_,"backdropClick"))},W=$o(i),H=p.useMemo(()=>({titleId:W}),[W]);return g.jsx(V2,u({className:D(L.root,m),closeAfterTransition:!0,components:{Backdrop:W2},componentsProps:{backdrop:u({transitionDuration:T,as:l},c)},disableEscapeKeyDown:v,onClose:P,open:$,ref:o,onClick:z,ownerState:j},O,{children:g.jsx(R,u({appear:!0,in:$,timeout:T,role:"presentation"},w,{children:g.jsx(U2,{className:D(L.container),onMouseDown:B,ownerState:j,children:g.jsx(G2,u({as:S,elevation:24,role:"dialog","aria-describedby":s,"aria-labelledby":W},k,{className:D(L.paper,k.className),ownerState:j,children:g.jsx(gp.Provider,{value:H,children:d})}))})}))}))});function K2(e){return Y("MuiDialogActions",e)}X("MuiDialogActions",["root","spacing"]);const q2=["className","disableSpacing"],Y2=e=>{const{classes:t,disableSpacing:o}=e;return Z({root:["root",!o&&"spacing"]},K2,t)},X2=M("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,!o.disableSpacing&&t.spacing]}})(({ownerState:e})=>u({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!e.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),$4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiDialogActions"}),{className:n,disableSpacing:a=!1}=r,s=F(r,q2),i=u({},r,{disableSpacing:a}),l=Y2(i);return g.jsx(X2,u({className:D(l.root,n),ownerState:i,ref:o},s))});function Z2(e){return Y("MuiDialogContent",e)}X("MuiDialogContent",["root","dividers"]);function J2(e){return Y("MuiDialogTitle",e)}const Q2=X("MuiDialogTitle",["root"]),e$=["className","dividers"],t$=e=>{const{classes:t,dividers:o}=e;return Z({root:["root",o&&"dividers"]},Z2,t)},o$=M("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.dividers&&t.dividers]}})(({theme:e,ownerState:t})=>u({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},t.dividers?{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}:{[`.${Q2.root} + &`]:{paddingTop:0}})),S4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiDialogContent"}),{className:n,dividers:a=!1}=r,s=F(r,e$),i=u({},r,{dividers:a}),l=t$(i);return g.jsx(o$,u({className:D(l.root,n),ownerState:i,ref:o},s))});function r$(e){return Y("MuiDialogContentText",e)}X("MuiDialogContentText",["root"]);const n$=["children","className"],a$=e=>{const{classes:t}=e,r=Z({root:["root"]},r$,t);return u({},t,r)},s$=M(St,{shouldForwardProp:e=>gt(e)||e==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(e,t)=>t.root})({}),R4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiDialogContentText"}),{className:n}=r,a=F(r,n$),s=a$(a);return g.jsx(s$,u({component:"p",variant:"body1",color:"text.secondary",ref:o,ownerState:a,className:D(s.root,n)},r,{classes:s}))}),i$=["className","id"],l$=e=>{const{classes:t}=e;return Z({root:["root"]},J2,t)},c$=M(St,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:"16px 24px",flex:"0 0 auto"}),P4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiDialogTitle"}),{className:n,id:a}=r,s=F(r,i$),i=r,l=l$(i),{titleId:c=a}=p.useContext(gp);return g.jsx(c$,u({component:"h2",className:D(l.root,n),ownerState:i,ref:o,variant:"h6",id:a??c},s))});function u$(e){return Y("MuiDivider",e)}const Lc=X("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),d$=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],p$=e=>{const{absolute:t,children:o,classes:r,flexItem:n,light:a,orientation:s,textAlign:i,variant:l}=e;return Z({root:["root",t&&"absolute",l,a&&"light",s==="vertical"&&"vertical",n&&"flexItem",o&&"withChildren",o&&s==="vertical"&&"withChildrenVertical",i==="right"&&s!=="vertical"&&"textAlignRight",i==="left"&&s!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",s==="vertical"&&"wrapperVertical"]},u$,r)},f$=M("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.absolute&&t.absolute,t[o.variant],o.light&&t.light,o.orientation==="vertical"&&t.vertical,o.flexItem&&t.flexItem,o.children&&t.withChildren,o.children&&o.orientation==="vertical"&&t.withChildrenVertical,o.textAlign==="right"&&o.orientation!=="vertical"&&t.textAlignRight,o.textAlign==="left"&&o.orientation!=="vertical"&&t.textAlignLeft]}})(({theme:e,ownerState:t})=>u({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin"},t.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},t.light&&{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:we(e.palette.divider,.08)},t.variant==="inset"&&{marginLeft:72},t.variant==="middle"&&t.orientation==="horizontal"&&{marginLeft:e.spacing(2),marginRight:e.spacing(2)},t.variant==="middle"&&t.orientation==="vertical"&&{marginTop:e.spacing(1),marginBottom:e.spacing(1)},t.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},t.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:e})=>u({},e.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:e,ownerState:t})=>u({},t.children&&t.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}),({theme:e,ownerState:t})=>u({},t.children&&t.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}),({ownerState:e})=>u({},e.textAlign==="right"&&e.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},e.textAlign==="left"&&e.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),m$=M("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.wrapper,o.orientation==="vertical"&&t.wrapperVertical]}})(({theme:e,ownerState:t})=>u({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`},t.orientation==="vertical"&&{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`})),g$=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiDivider"}),{absolute:n=!1,children:a,className:s,component:i=a?"div":"hr",flexItem:l=!1,light:c=!1,orientation:d="horizontal",role:m=i!=="hr"?"separator":void 0,textAlign:v="center",variant:y="fullWidth"}=r,b=F(r,d$),h=u({},r,{absolute:n,component:i,flexItem:l,light:c,orientation:d,role:m,textAlign:v,variant:y}),C=p$(h);return g.jsx(f$,u({as:i,className:D(C.root,s),role:m,ref:o,ownerState:h},b,{children:a?g.jsx(m$,{className:C.wrapper,ownerState:h,children:a}):null}))});g$.muiSkipListHighlight=!0;const h$=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function v$(e,t,o){const r=t.getBoundingClientRect(),n=o&&o.getBoundingClientRect(),a=Zt(t);let s;if(t.fakeTransform)s=t.fakeTransform;else{const c=a.getComputedStyle(t);s=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let i=0,l=0;if(s&&s!=="none"&&typeof s=="string"){const c=s.split("(")[1].split(")")[0].split(",");i=parseInt(c[4],10),l=parseInt(c[5],10)}return e==="left"?n?`translateX(${n.right+i-r.left}px)`:`translateX(${a.innerWidth+i-r.left}px)`:e==="right"?n?`translateX(-${r.right-n.left-i}px)`:`translateX(-${r.left+r.width-i}px)`:e==="up"?n?`translateY(${n.bottom+l-r.top}px)`:`translateY(${a.innerHeight+l-r.top}px)`:n?`translateY(-${r.top-n.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function b$(e){return typeof e=="function"?e():e}function Xn(e,t,o){const r=b$(o),n=v$(e,t,r);n&&(t.style.webkitTransform=n,t.style.transform=n)}const y$=p.forwardRef(function(t,o){const r=ro(),n={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},a={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:i=!0,children:l,container:c,direction:d="down",easing:m=n,in:v,onEnter:y,onEntered:b,onEntering:h,onExit:C,onExited:x,onExiting:P,style:$,timeout:S=a,TransitionComponent:k=Bt}=t,f=F(t,h$),R=p.useRef(null),T=Ue(_o(l),R,o),w=_=>G=>{_&&(G===void 0?_(R.current):_(R.current,G))},O=w((_,G)=>{Xn(d,_,c),fs(_),y&&y(_,G)}),j=w((_,G)=>{const se=So({timeout:S,style:$,easing:m},{mode:"enter"});_.style.webkitTransition=r.transitions.create("-webkit-transform",u({},se)),_.style.transition=r.transitions.create("transform",u({},se)),_.style.webkitTransform="none",_.style.transform="none",h&&h(_,G)}),L=w(b),E=w(P),B=w(_=>{const G=So({timeout:S,style:$,easing:m},{mode:"exit"});_.style.webkitTransition=r.transitions.create("-webkit-transform",G),_.style.transition=r.transitions.create("transform",G),Xn(d,_,c),C&&C(_)}),z=w(_=>{_.style.webkitTransition="",_.style.transition="",x&&x(_)}),W=_=>{s&&s(R.current,_)},H=p.useCallback(()=>{R.current&&Xn(d,R.current,c)},[d,c]);return p.useEffect(()=>{if(v||d==="down"||d==="right")return;const _=Gr(()=>{R.current&&Xn(d,R.current,c)}),G=Zt(R.current);return G.addEventListener("resize",_),()=>{_.clear(),G.removeEventListener("resize",_)}},[d,v,c]),p.useEffect(()=>{v||H()},[v,H]),g.jsx(k,u({nodeRef:R,onEnter:O,onEntered:L,onEntering:j,onExit:B,onExited:z,onExiting:E,addEndListener:W,appear:i,in:v,timeout:S},f,{children:(_,G)=>p.cloneElement(l,u({ref:T,style:u({visibility:_==="exited"&&!v?"hidden":void 0},$,l.props.style)},G))}))});function x$(e){return Y("MuiDrawer",e)}X("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const C$=["BackdropProps"],$$=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],hp=(e,t)=>{const{ownerState:o}=e;return[t.root,(o.variant==="permanent"||o.variant==="persistent")&&t.docked,t.modal]},S$=e=>{const{classes:t,anchor:o,variant:r}=e,n={root:["root"],docked:[(r==="permanent"||r==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${I(o)}`,r!=="temporary"&&`paperAnchorDocked${I(o)}`]};return Z(n,x$,t)},R$=M(sl,{name:"MuiDrawer",slot:"Root",overridesResolver:hp})(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer})),Ac=M("div",{shouldForwardProp:gt,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:hp})({flex:"0 0 auto"}),P$=M(no,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.paper,t[`paperAnchor${I(o.anchor)}`],o.variant!=="temporary"&&t[`paperAnchorDocked${I(o.anchor)}`]]}})(({theme:e,ownerState:t})=>u({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},t.anchor==="left"&&{left:0},t.anchor==="top"&&{top:0,left:0,right:0,height:"auto",maxHeight:"100%"},t.anchor==="right"&&{right:0},t.anchor==="bottom"&&{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},t.anchor==="left"&&t.variant!=="temporary"&&{borderRight:`1px solid ${(e.vars||e).palette.divider}`},t.anchor==="top"&&t.variant!=="temporary"&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`},t.anchor==="right"&&t.variant!=="temporary"&&{borderLeft:`1px solid ${(e.vars||e).palette.divider}`},t.anchor==="bottom"&&t.variant!=="temporary"&&{borderTop:`1px solid ${(e.vars||e).palette.divider}`})),vp={left:"right",right:"left",top:"down",bottom:"up"};function k$(e){return["left","right"].indexOf(e)!==-1}function T$({direction:e},t){return e==="rtl"&&k$(t)?vp[t]:t}const k4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiDrawer"}),n=ro(),a=No(),s={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{anchor:i="left",BackdropProps:l,children:c,className:d,elevation:m=16,hideBackdrop:v=!1,ModalProps:{BackdropProps:y}={},onClose:b,open:h=!1,PaperProps:C={},SlideProps:x,TransitionComponent:P=y$,transitionDuration:$=s,variant:S="temporary"}=r,k=F(r.ModalProps,C$),f=F(r,$$),R=p.useRef(!1);p.useEffect(()=>{R.current=!0},[]);const T=T$({direction:a?"rtl":"ltr"},i),O=u({},r,{anchor:i,elevation:m,open:h,variant:S},f),j=S$(O),L=g.jsx(P$,u({elevation:S==="temporary"?m:0,square:!0},C,{className:D(j.paper,C.className),ownerState:O,children:c}));if(S==="permanent")return g.jsx(Ac,u({className:D(j.root,j.docked,d),ownerState:O,ref:o},f,{children:L}));const E=g.jsx(P,u({in:h,direction:vp[T],timeout:$,appear:R.current},x,{children:L}));return S==="persistent"?g.jsx(Ac,u({className:D(j.root,j.docked,d),ownerState:O,ref:o},f,{children:E})):g.jsx(R$,u({BackdropProps:u({},l,y,{transitionDuration:$}),className:D(j.root,j.modal,d),open:h,ownerState:O,onClose:b,hideBackdrop:v,ref:o},f,k,{children:E}))}),w$=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],M$=e=>{const{classes:t,disableUnderline:o}=e,n=Z({root:["root",!o&&"underline"],input:["input"]},Cx,t);return u({},t,n)},I$=M(xs,{shouldForwardProp:e=>gt(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[...bs(e,t),!o.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{var o;const r=e.palette.mode==="light",n=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",a=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",s=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return u({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:a,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:s,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:a}},[`&.${Nt.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:a},[`&.${Nt.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i}},!t.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(o=(e.vars||e).palette[t.color||"primary"])==null?void 0:o.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Nt.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Nt.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Nt.disabled}, .${Nt.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${Nt.disabled}:before`]:{borderBottomStyle:"dotted"}},t.startAdornment&&{paddingLeft:12},t.endAdornment&&{paddingRight:12},t.multiline&&u({padding:"25px 12px 8px"},t.size==="small"&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17},t.hiddenLabel&&t.size==="small"&&{paddingTop:8,paddingBottom:9}))}),O$=M(Cs,{name:"MuiFilledInput",slot:"Input",overridesResolver:ys})(({theme:e,ownerState:t})=>u({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},t.size==="small"&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0},t.hiddenLabel&&t.size==="small"&&{paddingTop:8,paddingBottom:9},t.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),il=p.forwardRef(function(t,o){var r,n,a,s;const i=oe({props:t,name:"MuiFilledInput"}),{components:l={},componentsProps:c,fullWidth:d=!1,inputComponent:m="input",multiline:v=!1,slotProps:y,slots:b={},type:h="text"}=i,C=F(i,w$),x=u({},i,{fullWidth:d,inputComponent:m,multiline:v,type:h}),P=M$(i),$={root:{ownerState:x},input:{ownerState:x}},S=y??c?ct($,y??c):$,k=(r=(n=b.root)!=null?n:l.Root)!=null?r:I$,f=(a=(s=b.input)!=null?s:l.Input)!=null?a:O$;return g.jsx(Nn,u({slots:{root:k,input:f},componentsProps:S,fullWidth:d,inputComponent:m,multiline:v,ref:o,type:h},C,{classes:P}))});il.muiName="Input";function bp(e){return Y("MuiFormControl",e)}const E$=X("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]),L$=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],A$=e=>{const{classes:t,margin:o,fullWidth:r}=e,n={root:["root",o!=="none"&&`margin${I(o)}`,r&&"fullWidth"]};return Z(n,bp,t)},B$=M("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},t)=>u({},t.root,t[`margin${I(e.margin)}`],e.fullWidth&&t.fullWidth)})(({ownerState:e})=>u({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},e.margin==="normal"&&{marginTop:16,marginBottom:8},e.margin==="dense"&&{marginTop:8,marginBottom:4},e.fullWidth&&{width:"100%"})),yp=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiFormControl"}),{children:n,className:a,color:s="primary",component:i="div",disabled:l=!1,error:c=!1,focused:d,fullWidth:m=!1,hiddenLabel:v=!1,margin:y="none",required:b=!1,size:h="medium",variant:C="outlined"}=r,x=F(r,L$),P=u({},r,{color:s,component:i,disabled:l,error:c,fullWidth:m,hiddenLabel:v,margin:y,required:b,size:h,variant:C}),$=A$(P),[S,k]=p.useState(()=>{let E=!1;return n&&p.Children.forEach(n,B=>{if(!sr(B,["Input","Select"]))return;const z=sr(B,["Select"])?B.props.input:B;z&&hx(z.props)&&(E=!0)}),E}),[f,R]=p.useState(()=>{let E=!1;return n&&p.Children.forEach(n,B=>{sr(B,["Input","Select"])&&(ka(B.props,!0)||ka(B.props.inputProps,!0))&&(E=!0)}),E}),[T,w]=p.useState(!1);l&&T&&w(!1);const O=d!==void 0&&!l?d:T;let j;const L=p.useMemo(()=>({adornedStart:S,setAdornedStart:k,color:s,disabled:l,error:c,filled:f,focused:O,fullWidth:m,hiddenLabel:v,size:h,onBlur:()=>{w(!1)},onEmpty:()=>{R(!1)},onFilled:()=>{R(!0)},onFocus:()=>{w(!0)},registerEffect:j,required:b,variant:C}),[S,s,l,c,f,O,m,v,j,b,h,C]);return g.jsx(vs.Provider,{value:L,children:g.jsx(B$,u({as:i,ownerState:P,className:D($.root,a),ref:o},x,{children:n}))})}),T4=Object.freeze(Object.defineProperty({__proto__:null,default:yp,formControlClasses:E$,getFormControlUtilityClasses:bp,useFormControl:fo},Symbol.toStringTag,{value:"Module"})),_$=wv({createStyledComponent:M("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>oe({props:e,name:"MuiStack"})});function xp(e){return Y("MuiFormControlLabel",e)}const Mr=X("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),N$=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],z$=e=>{const{classes:t,disabled:o,labelPlacement:r,error:n,required:a}=e,s={root:["root",o&&"disabled",`labelPlacement${I(r)}`,n&&"error",a&&"required"],label:["label",o&&"disabled"],asterisk:["asterisk",n&&"error"]};return Z(s,xp,t)},j$=M("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{[`& .${Mr.label}`]:t.label},t.root,t[`labelPlacement${I(o.labelPlacement)}`]]}})(({theme:e,ownerState:t})=>u({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Mr.disabled}`]:{cursor:"default"}},t.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},t.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},t.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${Mr.label}`]:{[`&.${Mr.disabled}`]:{color:(e.vars||e).palette.text.disabled}}})),D$=M("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(({theme:e})=>({[`&.${Mr.error}`]:{color:(e.vars||e).palette.error.main}})),F$=p.forwardRef(function(t,o){var r,n;const a=oe({props:t,name:"MuiFormControlLabel"}),{className:s,componentsProps:i={},control:l,disabled:c,disableTypography:d,label:m,labelPlacement:v="end",required:y,slotProps:b={}}=a,h=F(a,N$),C=fo(),x=(r=c??l.props.disabled)!=null?r:C==null?void 0:C.disabled,P=y??l.props.required,$={disabled:x,required:P};["checked","name","onChange","value","inputRef"].forEach(w=>{typeof l.props[w]>"u"&&typeof a[w]<"u"&&($[w]=a[w])});const S=Jo({props:a,muiFormControl:C,states:["error"]}),k=u({},a,{disabled:x,labelPlacement:v,required:P,error:S.error}),f=z$(k),R=(n=b.typography)!=null?n:i.typography;let T=m;return T!=null&&T.type!==St&&!d&&(T=g.jsx(St,u({component:"span"},R,{className:D(f.label,R==null?void 0:R.className),children:T}))),g.jsxs(j$,u({className:D(f.root,s),ownerState:k,ref:o},h,{children:[p.cloneElement(l,$),P?g.jsxs(_$,{display:"block",children:[T,g.jsxs(D$,{ownerState:k,"aria-hidden":!0,className:f.asterisk,children:[" ","*"]})]}):T]}))}),w4=Object.freeze(Object.defineProperty({__proto__:null,default:F$,formControlLabelClasses:Mr,getFormControlLabelUtilityClasses:xp},Symbol.toStringTag,{value:"Module"}));function Cp(e){return Y("MuiFormGroup",e)}const W$=X("MuiFormGroup",["root","row","error"]),H$=["className","row"],V$=e=>{const{classes:t,row:o,error:r}=e;return Z({root:["root",o&&"row",r&&"error"]},Cp,t)},U$=M("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.row&&t.row]}})(({ownerState:e})=>u({display:"flex",flexDirection:"column",flexWrap:"wrap"},e.row&&{flexDirection:"row"})),$p=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiFormGroup"}),{className:n,row:a=!1}=r,s=F(r,H$),i=fo(),l=Jo({props:r,muiFormControl:i,states:["error"]}),c=u({},r,{row:a,error:l.error}),d=V$(c);return g.jsx(U$,u({className:D(d.root,n),ownerState:c,ref:o},s))}),M4=Object.freeze(Object.defineProperty({__proto__:null,default:$p,formGroupClasses:W$,getFormGroupUtilityClass:Cp},Symbol.toStringTag,{value:"Module"}));function G$(e){return Y("MuiFormHelperText",e)}const Bc=X("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var _c;const K$=["children","className","component","disabled","error","filled","focused","margin","required","variant"],q$=e=>{const{classes:t,contained:o,size:r,disabled:n,error:a,filled:s,focused:i,required:l}=e,c={root:["root",n&&"disabled",a&&"error",r&&`size${I(r)}`,o&&"contained",i&&"focused",s&&"filled",l&&"required"]};return Z(c,G$,t)},Y$=M("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.size&&t[`size${I(o.size)}`],o.contained&&t.contained,o.filled&&t.filled]}})(({theme:e,ownerState:t})=>u({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Bc.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Bc.error}`]:{color:(e.vars||e).palette.error.main}},t.size==="small"&&{marginTop:4},t.contained&&{marginLeft:14,marginRight:14})),X$=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiFormHelperText"}),{children:n,className:a,component:s="p"}=r,i=F(r,K$),l=fo(),c=Jo({props:r,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),d=u({},r,{component:s,contained:c.variant==="filled"||c.variant==="outlined",variant:c.variant,size:c.size,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),m=q$(d);return g.jsx(Y$,u({as:s,ownerState:d,className:D(m.root,a),ref:o},i,{children:n===" "?_c||(_c=g.jsx("span",{className:"notranslate",children:"​"})):n}))});function Z$(e){return Y("MuiFormLabel",e)}const mn=X("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),J$=["children","className","color","component","disabled","error","filled","focused","required"],Q$=e=>{const{classes:t,color:o,focused:r,disabled:n,error:a,filled:s,required:i}=e,l={root:["root",`color${I(o)}`,n&&"disabled",a&&"error",s&&"filled",r&&"focused",i&&"required"],asterisk:["asterisk",a&&"error"]};return Z(l,Z$,t)},eS=M("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},t)=>u({},t.root,e.color==="secondary"&&t.colorSecondary,e.filled&&t.filled)})(({theme:e,ownerState:t})=>u({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${mn.focused}`]:{color:(e.vars||e).palette[t.color].main},[`&.${mn.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${mn.error}`]:{color:(e.vars||e).palette.error.main}})),tS=M("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(({theme:e})=>({[`&.${mn.error}`]:{color:(e.vars||e).palette.error.main}})),oS=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiFormLabel"}),{children:n,className:a,component:s="label"}=r,i=F(r,J$),l=fo(),c=Jo({props:r,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),d=u({},r,{color:c.color||"primary",component:s,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),m=Q$(d);return g.jsxs(eS,u({as:s,ownerState:d,className:D(m.root,a),ref:o},i,{children:[n,c.required&&g.jsxs(tS,{ownerState:d,"aria-hidden":!0,className:m.asterisk,children:[" ","*"]})]}))}),Nc=p.createContext();function Sp(e){return Y("MuiGrid",e)}const rS=[0,1,2,3,4,5,6,7,8,9,10],nS=["column-reverse","column","row-reverse","row"],aS=["nowrap","wrap-reverse","wrap"],tn=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],Fr=X("MuiGrid",["root","container","item","zeroMinWidth",...rS.map(e=>`spacing-xs-${e}`),...nS.map(e=>`direction-xs-${e}`),...aS.map(e=>`wrap-xs-${e}`),...tn.map(e=>`grid-xs-${e}`),...tn.map(e=>`grid-sm-${e}`),...tn.map(e=>`grid-md-${e}`),...tn.map(e=>`grid-lg-${e}`),...tn.map(e=>`grid-xl-${e}`)]),sS=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function Lr(e){const t=parseFloat(e);return`${t}${String(e).replace(String(t),"")||"px"}`}function iS({theme:e,ownerState:t}){let o;return e.breakpoints.keys.reduce((r,n)=>{let a={};if(t[n]&&(o=t[n]),!o)return r;if(o===!0)a={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(o==="auto")a={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=ar({values:t.columns,breakpoints:e.breakpoints.values}),i=typeof s=="object"?s[n]:s;if(i==null)return r;const l=`${Math.round(o/i*1e8)/1e6}%`;let c={};if(t.container&&t.item&&t.columnSpacing!==0){const d=e.spacing(t.columnSpacing);if(d!=="0px"){const m=`calc(${l} + ${Lr(d)})`;c={flexBasis:m,maxWidth:m}}}a=u({flexBasis:l,flexGrow:0,maxWidth:l},c)}return e.breakpoints.values[n]===0?Object.assign(r,a):r[e.breakpoints.up(n)]=a,r},{})}function lS({theme:e,ownerState:t}){const o=ar({values:t.direction,breakpoints:e.breakpoints.values});return At({theme:e},o,r=>{const n={flexDirection:r};return r.indexOf("column")===0&&(n[`& > .${Fr.item}`]={maxWidth:"none"}),n})}function Rp({breakpoints:e,values:t}){let o="";Object.keys(t).forEach(n=>{o===""&&t[n]!==0&&(o=n)});const r=Object.keys(e).sort((n,a)=>e[n]-e[a]);return r.slice(0,r.indexOf(o))}function cS({theme:e,ownerState:t}){const{container:o,rowSpacing:r}=t;let n={};if(o&&r!==0){const a=ar({values:r,breakpoints:e.breakpoints.values});let s;typeof a=="object"&&(s=Rp({breakpoints:e.breakpoints.values,values:a})),n=At({theme:e},a,(i,l)=>{var c;const d=e.spacing(i);return d!=="0px"?{marginTop:`-${Lr(d)}`,[`& > .${Fr.item}`]:{paddingTop:Lr(d)}}:(c=s)!=null&&c.includes(l)?{}:{marginTop:0,[`& > .${Fr.item}`]:{paddingTop:0}}})}return n}function uS({theme:e,ownerState:t}){const{container:o,columnSpacing:r}=t;let n={};if(o&&r!==0){const a=ar({values:r,breakpoints:e.breakpoints.values});let s;typeof a=="object"&&(s=Rp({breakpoints:e.breakpoints.values,values:a})),n=At({theme:e},a,(i,l)=>{var c;const d=e.spacing(i);return d!=="0px"?{width:`calc(100% + ${Lr(d)})`,marginLeft:`-${Lr(d)}`,[`& > .${Fr.item}`]:{paddingLeft:Lr(d)}}:(c=s)!=null&&c.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${Fr.item}`]:{paddingLeft:0}}})}return n}function dS(e,t,o={}){if(!e||e<=0)return[];if(typeof e=="string"&&!Number.isNaN(Number(e))||typeof e=="number")return[o[`spacing-xs-${String(e)}`]];const r=[];return t.forEach(n=>{const a=e[n];Number(a)>0&&r.push(o[`spacing-${n}-${String(a)}`])}),r}const pS=M("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e,{container:r,direction:n,item:a,spacing:s,wrap:i,zeroMinWidth:l,breakpoints:c}=o;let d=[];r&&(d=dS(s,c,t));const m=[];return c.forEach(v=>{const y=o[v];y&&m.push(t[`grid-${v}-${String(y)}`])}),[t.root,r&&t.container,a&&t.item,l&&t.zeroMinWidth,...d,n!=="row"&&t[`direction-xs-${String(n)}`],i!=="wrap"&&t[`wrap-xs-${String(i)}`],...m]}})(({ownerState:e})=>u({boxSizing:"border-box"},e.container&&{display:"flex",flexWrap:"wrap",width:"100%"},e.item&&{margin:0},e.zeroMinWidth&&{minWidth:0},e.wrap!=="wrap"&&{flexWrap:e.wrap}),lS,cS,uS,iS);function fS(e,t){if(!e||e<=0)return[];if(typeof e=="string"&&!Number.isNaN(Number(e))||typeof e=="number")return[`spacing-xs-${String(e)}`];const o=[];return t.forEach(r=>{const n=e[r];if(Number(n)>0){const a=`spacing-${r}-${String(n)}`;o.push(a)}}),o}const mS=e=>{const{classes:t,container:o,direction:r,item:n,spacing:a,wrap:s,zeroMinWidth:i,breakpoints:l}=e;let c=[];o&&(c=fS(a,l));const d=[];l.forEach(v=>{const y=e[v];y&&d.push(`grid-${v}-${String(y)}`)});const m={root:["root",o&&"container",n&&"item",i&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...d]};return Z(m,Sp,t)},gS=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiGrid"}),{breakpoints:n}=ro(),a=Ur(r),{className:s,columns:i,columnSpacing:l,component:c="div",container:d=!1,direction:m="row",item:v=!1,rowSpacing:y,spacing:b=0,wrap:h="wrap",zeroMinWidth:C=!1}=a,x=F(a,sS),P=y||b,$=l||b,S=p.useContext(Nc),k=d?i||12:S,f={},R=u({},x);n.keys.forEach(O=>{x[O]!=null&&(f[O]=x[O],delete R[O])});const T=u({},a,{columns:k,container:d,direction:m,item:v,rowSpacing:P,columnSpacing:$,wrap:h,zeroMinWidth:C,spacing:b},f,{breakpoints:n.keys}),w=mS(T);return g.jsx(Nc.Provider,{value:k,children:g.jsx(pS,u({ownerState:T,className:D(w.root,s),as:c,ref:o},R))})}),I4=Object.freeze(Object.defineProperty({__proto__:null,default:gS,getGridUtilityClass:Sp,gridClasses:Fr},Symbol.toStringTag,{value:"Module"})),O4=xv({createStyledComponent:M("div",{name:"MuiGrid2",slot:"Root",overridesResolver:(e,t)=>t.root}),componentName:"MuiGrid2",useThemeProps:e=>oe({props:e,name:"MuiGrid2"})}),hS=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function ii(e){return`scale(${e}, ${e**2})`}const vS={entering:{opacity:1,transform:ii(1)},entered:{opacity:1,transform:"none"}},Fs=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Wr=p.forwardRef(function(t,o){const{addEndListener:r,appear:n=!0,children:a,easing:s,in:i,onEnter:l,onEntered:c,onEntering:d,onExit:m,onExited:v,onExiting:y,style:b,timeout:h="auto",TransitionComponent:C=Bt}=t,x=F(t,hS),P=Uo(),$=p.useRef(),S=ro(),k=p.useRef(null),f=Ue(k,_o(a),o),R=z=>W=>{if(z){const H=k.current;W===void 0?z(H):z(H,W)}},T=R(d),w=R((z,W)=>{fs(z);const{duration:H,delay:_,easing:G}=So({style:b,timeout:h,easing:s},{mode:"enter"});let se;h==="auto"?(se=S.transitions.getAutoHeightDuration(z.clientHeight),$.current=se):se=H,z.style.transition=[S.transitions.create("opacity",{duration:se,delay:_}),S.transitions.create("transform",{duration:Fs?se:se*.666,delay:_,easing:G})].join(","),l&&l(z,W)}),O=R(c),j=R(y),L=R(z=>{const{duration:W,delay:H,easing:_}=So({style:b,timeout:h,easing:s},{mode:"exit"});let G;h==="auto"?(G=S.transitions.getAutoHeightDuration(z.clientHeight),$.current=G):G=W,z.style.transition=[S.transitions.create("opacity",{duration:G,delay:H}),S.transitions.create("transform",{duration:Fs?G:G*.666,delay:Fs?H:H||G*.333,easing:_})].join(","),z.style.opacity=0,z.style.transform=ii(.75),m&&m(z)}),E=R(v),B=z=>{h==="auto"&&P.start($.current||0,z),r&&r(k.current,z)};return g.jsx(C,u({appear:n,in:i,nodeRef:k,onEnter:w,onEntered:O,onEntering:T,onExit:L,onExited:E,onExiting:j,addEndListener:B,timeout:h==="auto"?null:h},x,{children:(z,W)=>p.cloneElement(a,u({style:u({opacity:0,transform:ii(.75),visibility:z==="exited"&&!i?"hidden":void 0},vS[z],b,a.props.style),ref:f},W))}))});Wr.muiSupportAuto=!0;const E4=Object.freeze(Object.defineProperty({__proto__:null,default:Wr},Symbol.toStringTag,{value:"Module"})),bS=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],yS=e=>{const{classes:t,disableUnderline:o}=e,n=Z({root:["root",!o&&"underline"],input:["input"]},sp,t);return u({},t,n)},xS=M(xs,{shouldForwardProp:e=>gt(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[...bs(e,t),!o.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{let r=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(r=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),u({position:"relative"},t.formControl&&{"label + &":{marginTop:16}},!t.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${wo.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${wo.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${wo.disabled}, .${wo.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${wo.disabled}:before`]:{borderBottomStyle:"dotted"}})}),CS=M(Cs,{name:"MuiInput",slot:"Input",overridesResolver:ys})({}),Ss=p.forwardRef(function(t,o){var r,n,a,s;const i=oe({props:t,name:"MuiInput"}),{disableUnderline:l,components:c={},componentsProps:d,fullWidth:m=!1,inputComponent:v="input",multiline:y=!1,slotProps:b,slots:h={},type:C="text"}=i,x=F(i,bS),P=yS(i),S={root:{ownerState:{disableUnderline:l}}},k=b??d?ct(b??d,S):S,f=(r=(n=h.root)!=null?n:c.Root)!=null?r:xS,R=(a=(s=h.input)!=null?s:c.Input)!=null?a:CS;return g.jsx(Nn,u({slots:{root:f,input:R},slotProps:k,fullWidth:m,inputComponent:v,multiline:y,ref:o,type:C},x,{classes:P}))});Ss.muiName="Input";const L4=Object.freeze(Object.defineProperty({__proto__:null,default:Ss,getInputUtilityClass:sp,inputClasses:wo},Symbol.toStringTag,{value:"Module"}));function $S(e){return Y("MuiInputAdornment",e)}const zc=X("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var jc;const SS=["children","className","component","disablePointerEvents","disableTypography","position","variant"],RS=(e,t)=>{const{ownerState:o}=e;return[t.root,t[`position${I(o.position)}`],o.disablePointerEvents===!0&&t.disablePointerEvents,t[o.variant]]},PS=e=>{const{classes:t,disablePointerEvents:o,hiddenLabel:r,position:n,size:a,variant:s}=e,i={root:["root",o&&"disablePointerEvents",n&&`position${I(n)}`,s,r&&"hiddenLabel",a&&`size${I(a)}`]};return Z(i,$S,t)},kS=M("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:RS})(({theme:e,ownerState:t})=>u({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active},t.variant==="filled"&&{[`&.${zc.positionStart}&:not(.${zc.hiddenLabel})`]:{marginTop:16}},t.position==="start"&&{marginRight:8},t.position==="end"&&{marginLeft:8},t.disablePointerEvents===!0&&{pointerEvents:"none"})),A4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiInputAdornment"}),{children:n,className:a,component:s="div",disablePointerEvents:i=!1,disableTypography:l=!1,position:c,variant:d}=r,m=F(r,SS),v=fo()||{};let y=d;d&&v.variant,v&&!y&&(y=v.variant);const b=u({},r,{hiddenLabel:v.hiddenLabel,size:v.size,disablePointerEvents:i,position:c,variant:y}),h=PS(b);return g.jsx(vs.Provider,{value:null,children:g.jsx(kS,u({as:s,ownerState:b,className:D(h.root,a),ref:o},m,{children:typeof n=="string"&&!l?g.jsx(St,{color:"text.secondary",children:n}):g.jsxs(p.Fragment,{children:[c==="start"?jc||(jc=g.jsx("span",{className:"notranslate",children:"​"})):null,n]})}))})});function Pp(e){return Y("MuiInputLabel",e)}const TS=X("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]),wS=["disableAnimation","margin","shrink","variant","className"],MS=e=>{const{classes:t,formControl:o,size:r,shrink:n,disableAnimation:a,variant:s,required:i}=e,l={root:["root",o&&"formControl",!a&&"animated",n&&"shrink",r&&r!=="normal"&&`size${I(r)}`,s],asterisk:[i&&"asterisk"]},c=Z(l,Pp,t);return u({},t,c)},IS=M(oS,{shouldForwardProp:e=>gt(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{[`& .${mn.asterisk}`]:t.asterisk},t.root,o.formControl&&t.formControl,o.size==="small"&&t.sizeSmall,o.shrink&&t.shrink,!o.disableAnimation&&t.animated,o.focused&&t.focused,t[o.variant]]}})(({theme:e,ownerState:t})=>u({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},t.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},t.size==="small"&&{transform:"translate(0, 17px) scale(1)"},t.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!t.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},t.variant==="filled"&&u({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},t.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},t.shrink&&u({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},t.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),t.variant==="outlined"&&u({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},t.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},t.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),kp=p.forwardRef(function(t,o){const r=oe({name:"MuiInputLabel",props:t}),{disableAnimation:n=!1,shrink:a,className:s}=r,i=F(r,wS),l=fo();let c=a;typeof c>"u"&&l&&(c=l.filled||l.focused||l.adornedStart);const d=Jo({props:r,muiFormControl:l,states:["size","variant","required","focused"]}),m=u({},r,{disableAnimation:n,formControl:l,shrink:c,size:d.size,variant:d.variant,required:d.required,focused:d.focused}),v=MS(m);return g.jsx(IS,u({"data-shrink":c,ownerState:m,ref:o,className:D(v.root,s)},i,{classes:v}))}),B4=Object.freeze(Object.defineProperty({__proto__:null,default:kp,getInputLabelUtilityClasses:Pp,inputLabelClasses:TS},Symbol.toStringTag,{value:"Module"}));function OS(e){return Y("MuiLinearProgress",e)}X("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const ES=["className","color","value","valueBuffer","variant"];let Xr=e=>e,Dc,Fc,Wc,Hc,Vc,Uc;const li=4,LS=po(Dc||(Dc=Xr` + 0% { + left: -35%; + right: 100%; + } + + 60% { + left: 100%; + right: -90%; + } + + 100% { + left: 100%; + right: -90%; + } +`)),AS=po(Fc||(Fc=Xr` + 0% { + left: -200%; + right: 100%; + } + + 60% { + left: 107%; + right: -8%; + } + + 100% { + left: 107%; + right: -8%; + } +`)),BS=po(Wc||(Wc=Xr` + 0% { + opacity: 1; + background-position: 0 -23px; + } + + 60% { + opacity: 0; + background-position: 0 -23px; + } + + 100% { + opacity: 1; + background-position: -200px -23px; + } +`)),_S=e=>{const{classes:t,variant:o,color:r}=e,n={root:["root",`color${I(r)}`,o],dashed:["dashed",`dashedColor${I(r)}`],bar1:["bar",`barColor${I(r)}`,(o==="indeterminate"||o==="query")&&"bar1Indeterminate",o==="determinate"&&"bar1Determinate",o==="buffer"&&"bar1Buffer"],bar2:["bar",o!=="buffer"&&`barColor${I(r)}`,o==="buffer"&&`color${I(r)}`,(o==="indeterminate"||o==="query")&&"bar2Indeterminate",o==="buffer"&&"bar2Buffer"]};return Z(n,OS,t)},ll=(e,t)=>t==="inherit"?"currentColor":e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:e.palette.mode==="light"?Yo(e.palette[t].main,.62):qo(e.palette[t].main,.5),NS=M("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[`color${I(o.color)}`],t[o.variant]]}})(({ownerState:e,theme:t})=>u({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},backgroundColor:ll(t,e.color)},e.color==="inherit"&&e.variant!=="buffer"&&{backgroundColor:"none","&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}},e.variant==="buffer"&&{backgroundColor:"transparent"},e.variant==="query"&&{transform:"rotate(180deg)"})),zS=M("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.dashed,t[`dashedColor${I(o.color)}`]]}})(({ownerState:e,theme:t})=>{const o=ll(t,e.color);return u({position:"absolute",marginTop:0,height:"100%",width:"100%"},e.color==="inherit"&&{opacity:.3},{backgroundImage:`radial-gradient(${o} 0%, ${o} 16%, transparent 42%)`,backgroundSize:"10px 10px",backgroundPosition:"0 -23px"})},Bo(Hc||(Hc=Xr` + animation: ${0} 3s infinite linear; + `),BS)),jS=M("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.bar,t[`barColor${I(o.color)}`],(o.variant==="indeterminate"||o.variant==="query")&&t.bar1Indeterminate,o.variant==="determinate"&&t.bar1Determinate,o.variant==="buffer"&&t.bar1Buffer]}})(({ownerState:e,theme:t})=>u({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",backgroundColor:e.color==="inherit"?"currentColor":(t.vars||t).palette[e.color].main},e.variant==="determinate"&&{transition:`transform .${li}s linear`},e.variant==="buffer"&&{zIndex:1,transition:`transform .${li}s linear`}),({ownerState:e})=>(e.variant==="indeterminate"||e.variant==="query")&&Bo(Vc||(Vc=Xr` + width: auto; + animation: ${0} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; + `),LS)),DS=M("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.bar,t[`barColor${I(o.color)}`],(o.variant==="indeterminate"||o.variant==="query")&&t.bar2Indeterminate,o.variant==="buffer"&&t.bar2Buffer]}})(({ownerState:e,theme:t})=>u({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},e.variant!=="buffer"&&{backgroundColor:e.color==="inherit"?"currentColor":(t.vars||t).palette[e.color].main},e.color==="inherit"&&{opacity:.3},e.variant==="buffer"&&{backgroundColor:ll(t,e.color),transition:`transform .${li}s linear`}),({ownerState:e})=>(e.variant==="indeterminate"||e.variant==="query")&&Bo(Uc||(Uc=Xr` + width: auto; + animation: ${0} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite; + `),AS)),_4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiLinearProgress"}),{className:n,color:a="primary",value:s,valueBuffer:i,variant:l="indeterminate"}=r,c=F(r,ES),d=u({},r,{color:a,variant:l}),m=_S(d),v=No(),y={},b={bar1:{},bar2:{}};if((l==="determinate"||l==="buffer")&&s!==void 0){y["aria-valuenow"]=Math.round(s),y["aria-valuemin"]=0,y["aria-valuemax"]=100;let h=s-100;v&&(h=-h),b.bar1.transform=`translateX(${h}%)`}if(l==="buffer"&&i!==void 0){let h=(i||0)-100;v&&(h=-h),b.bar2.transform=`translateX(${h}%)`}return g.jsxs(NS,u({className:D(m.root,n),ownerState:d,role:"progressbar"},y,{ref:o},c,{children:[l==="buffer"?g.jsx(zS,{className:m.dashed,ownerState:d}):null,g.jsx(jS,{className:m.bar1,ownerState:d,style:b.bar1}),l==="determinate"?null:g.jsx(DS,{className:m.bar2,ownerState:d,style:b.bar2})]}))}),uo=p.createContext({});function FS(e){return Y("MuiList",e)}X("MuiList",["root","padding","dense","subheader"]);const WS=["children","className","component","dense","disablePadding","subheader"],HS=e=>{const{classes:t,disablePadding:o,dense:r,subheader:n}=e;return Z({root:["root",!o&&"padding",r&&"dense",n&&"subheader"]},FS,t)},VS=M("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,!o.disablePadding&&t.padding,o.dense&&t.dense,o.subheader&&t.subheader]}})(({ownerState:e})=>u({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),US=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiList"}),{children:n,className:a,component:s="ul",dense:i=!1,disablePadding:l=!1,subheader:c}=r,d=F(r,WS),m=p.useMemo(()=>({dense:i}),[i]),v=u({},r,{component:s,dense:i,disablePadding:l}),y=HS(v);return g.jsx(uo.Provider,{value:m,children:g.jsxs(VS,u({as:s,className:D(y.root,a),ref:o,ownerState:v},d,{children:[c,n]}))})});function GS(e){return Y("MuiListItem",e)}const $r=X("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]);function KS(e){return Y("MuiListItemButton",e)}const Sr=X("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),qS=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],YS=(e,t)=>{const{ownerState:o}=e;return[t.root,o.dense&&t.dense,o.alignItems==="flex-start"&&t.alignItemsFlexStart,o.divider&&t.divider,!o.disableGutters&&t.gutters]},XS=e=>{const{alignItems:t,classes:o,dense:r,disabled:n,disableGutters:a,divider:s,selected:i}=e,c=Z({root:["root",r&&"dense",!a&&"gutters",s&&"divider",n&&"disabled",t==="flex-start"&&"alignItemsFlexStart",i&&"selected"]},KS,o);return u({},o,c)},ZS=M(kt,{shouldForwardProp:e=>gt(e)||e==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:YS})(({theme:e,ownerState:t})=>u({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Sr.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:we(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Sr.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:we(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Sr.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:we(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:we(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Sr.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Sr.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},t.alignItems==="flex-start"&&{alignItems:"flex-start"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.dense&&{paddingTop:4,paddingBottom:4})),N4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiListItemButton"}),{alignItems:n="center",autoFocus:a=!1,component:s="div",children:i,dense:l=!1,disableGutters:c=!1,divider:d=!1,focusVisibleClassName:m,selected:v=!1,className:y}=r,b=F(r,qS),h=p.useContext(uo),C=p.useMemo(()=>({dense:l||h.dense||!1,alignItems:n,disableGutters:c}),[n,h.dense,l,c]),x=p.useRef(null);xt(()=>{a&&x.current&&x.current.focus()},[a]);const P=u({},r,{alignItems:n,dense:C.dense,disableGutters:c,divider:d,selected:v}),$=XS(P),S=Ue(x,o);return g.jsx(uo.Provider,{value:C,children:g.jsx(ZS,u({ref:S,href:b.href||b.to,component:(b.href||b.to)&&s==="div"?"button":s,focusVisibleClassName:D($.focusVisible,m),ownerState:P,className:D($.root,y)},b,{classes:$,children:i}))})});function JS(e){return Y("MuiListItemSecondaryAction",e)}X("MuiListItemSecondaryAction",["root","disableGutters"]);const QS=["className"],e5=e=>{const{disableGutters:t,classes:o}=e;return Z({root:["root",t&&"disableGutters"]},JS,o)},t5=M("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.disableGutters&&t.disableGutters]}})(({ownerState:e})=>u({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},e.disableGutters&&{right:0})),Tp=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiListItemSecondaryAction"}),{className:n}=r,a=F(r,QS),s=p.useContext(uo),i=u({},r,{disableGutters:s.disableGutters}),l=e5(i);return g.jsx(t5,u({className:D(l.root,n),ownerState:i,ref:o},a))});Tp.muiName="ListItemSecondaryAction";const o5=["className"],r5=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],n5=(e,t)=>{const{ownerState:o}=e;return[t.root,o.dense&&t.dense,o.alignItems==="flex-start"&&t.alignItemsFlexStart,o.divider&&t.divider,!o.disableGutters&&t.gutters,!o.disablePadding&&t.padding,o.button&&t.button,o.hasSecondaryAction&&t.secondaryAction]},a5=e=>{const{alignItems:t,button:o,classes:r,dense:n,disabled:a,disableGutters:s,disablePadding:i,divider:l,hasSecondaryAction:c,selected:d}=e;return Z({root:["root",n&&"dense",!s&&"gutters",!i&&"padding",l&&"divider",a&&"disabled",o&&"button",t==="flex-start"&&"alignItemsFlexStart",c&&"secondaryAction",d&&"selected"],container:["container"]},GS,r)},s5=M("div",{name:"MuiListItem",slot:"Root",overridesResolver:n5})(({theme:e,ownerState:t})=>u({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!t.disablePadding&&u({paddingTop:8,paddingBottom:8},t.dense&&{paddingTop:4,paddingBottom:4},!t.disableGutters&&{paddingLeft:16,paddingRight:16},!!t.secondaryAction&&{paddingRight:48}),!!t.secondaryAction&&{[`& > .${Sr.root}`]:{paddingRight:48}},{[`&.${$r.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${$r.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:we(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${$r.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:we(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${$r.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.alignItems==="flex-start"&&{alignItems:"flex-start"},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},t.button&&{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${$r.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:we(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:we(e.palette.primary.main,e.palette.action.selectedOpacity)}}},t.hasSecondaryAction&&{paddingRight:48})),i5=M("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),z4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiListItem"}),{alignItems:n="center",autoFocus:a=!1,button:s=!1,children:i,className:l,component:c,components:d={},componentsProps:m={},ContainerComponent:v="li",ContainerProps:{className:y}={},dense:b=!1,disabled:h=!1,disableGutters:C=!1,disablePadding:x=!1,divider:P=!1,focusVisibleClassName:$,secondaryAction:S,selected:k=!1,slotProps:f={},slots:R={}}=r,T=F(r.ContainerProps,o5),w=F(r,r5),O=p.useContext(uo),j=p.useMemo(()=>({dense:b||O.dense||!1,alignItems:n,disableGutters:C}),[n,O.dense,b,C]),L=p.useRef(null);xt(()=>{a&&L.current&&L.current.focus()},[a]);const E=p.Children.toArray(i),B=E.length&&sr(E[E.length-1],["ListItemSecondaryAction"]),z=u({},r,{alignItems:n,autoFocus:a,button:s,dense:j.dense,disabled:h,disableGutters:C,disablePadding:x,divider:P,hasSecondaryAction:B,selected:k}),W=a5(z),H=Ue(L,o),_=R.root||d.Root||s5,G=f.root||m.root||{},se=u({className:D(W.root,G.className,l),disabled:h},w);let ve=c||"li";return s&&(se.component=c||"div",se.focusVisibleClassName=D($r.focusVisible,$),ve=kt),B?(ve=!se.component&&!c?"div":ve,v==="li"&&(ve==="li"?ve="div":se.component==="li"&&(se.component="div")),g.jsx(uo.Provider,{value:j,children:g.jsxs(i5,u({as:v,className:D(W.container,y),ref:H,ownerState:z},T,{children:[g.jsx(_,u({},G,!co(_)&&{as:ve,ownerState:u({},z,G.ownerState)},se,{children:E})),E.pop()]}))})):g.jsx(uo.Provider,{value:j,children:g.jsxs(_,u({},G,{as:ve,ref:H},!co(_)&&{ownerState:u({},z,G.ownerState)},se,{children:[E,S&&g.jsx(Tp,{children:S})]}))})});function l5(e){return Y("MuiListItemIcon",e)}const Gc=X("MuiListItemIcon",["root","alignItemsFlexStart"]),c5=["className"],u5=e=>{const{alignItems:t,classes:o}=e;return Z({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},l5,o)},d5=M("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(({theme:e,ownerState:t})=>u({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex"},t.alignItems==="flex-start"&&{marginTop:8})),j4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiListItemIcon"}),{className:n}=r,a=F(r,c5),s=p.useContext(uo),i=u({},r,{alignItems:s.alignItems}),l=u5(i);return g.jsx(d5,u({className:D(l.root,n),ownerState:i,ref:o},a))});function wp(e){return Y("MuiListItemText",e)}const Sn=X("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),p5=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],f5=e=>{const{classes:t,inset:o,primary:r,secondary:n,dense:a}=e;return Z({root:["root",o&&"inset",a&&"dense",r&&n&&"multiline"],primary:["primary"],secondary:["secondary"]},wp,t)},m5=M("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{[`& .${Sn.primary}`]:t.primary},{[`& .${Sn.secondary}`]:t.secondary},t.root,o.inset&&t.inset,o.primary&&o.secondary&&t.multiline,o.dense&&t.dense]}})(({ownerState:e})=>u({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},e.primary&&e.secondary&&{marginTop:6,marginBottom:6},e.inset&&{paddingLeft:56})),g5=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiListItemText"}),{children:n,className:a,disableTypography:s=!1,inset:i=!1,primary:l,primaryTypographyProps:c,secondary:d,secondaryTypographyProps:m}=r,v=F(r,p5),{dense:y}=p.useContext(uo);let b=l??n,h=d;const C=u({},r,{disableTypography:s,inset:i,primary:!!b,secondary:!!h,dense:y}),x=f5(C);return b!=null&&b.type!==St&&!s&&(b=g.jsx(St,u({variant:y?"body2":"body1",className:x.primary,component:c!=null&&c.variant?void 0:"span",display:"block"},c,{children:b}))),h!=null&&h.type!==St&&!s&&(h=g.jsx(St,u({variant:"body2",className:x.secondary,color:"text.secondary",display:"block"},m,{children:h}))),g.jsxs(m5,u({className:D(x.root,a),ownerState:C,ref:o},v,{children:[b,h]}))}),D4=Object.freeze(Object.defineProperty({__proto__:null,default:g5,getListItemTextUtilityClass:wp,listItemTextClasses:Sn},Symbol.toStringTag,{value:"Module"})),h5=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function Ws(e,t,o){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:o?null:e.firstChild}function Kc(e,t,o){return e===t?o?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:o?null:e.lastChild}function Mp(e,t){if(t===void 0)return!0;let o=e.innerText;return o===void 0&&(o=e.textContent),o=o.trim().toLowerCase(),o.length===0?!1:t.repeating?o[0]===t.keys[0]:o.indexOf(t.keys.join(""))===0}function on(e,t,o,r,n,a){let s=!1,i=n(e,t,t?o:!1);for(;i;){if(i===e.firstChild){if(s)return!1;s=!0}const l=r?!1:i.disabled||i.getAttribute("aria-disabled")==="true";if(!i.hasAttribute("tabindex")||!Mp(i,a)||l)i=n(e,i,o);else return i.focus(),!0}return!1}const v5=p.forwardRef(function(t,o){const{actions:r,autoFocus:n=!1,autoFocusItem:a=!1,children:s,className:i,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:d,variant:m="selectedMenu"}=t,v=F(t,h5),y=p.useRef(null),b=p.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});xt(()=>{n&&y.current.focus()},[n]),p.useImperativeHandle(r,()=>({adjustStyleForScrollbar:($,{direction:S})=>{const k=!y.current.style.width;if($.clientHeight{const S=y.current,k=$.key,f=rt(S).activeElement;if(k==="ArrowDown")$.preventDefault(),on(S,f,c,l,Ws);else if(k==="ArrowUp")$.preventDefault(),on(S,f,c,l,Kc);else if(k==="Home")$.preventDefault(),on(S,null,c,l,Ws);else if(k==="End")$.preventDefault(),on(S,null,c,l,Kc);else if(k.length===1){const R=b.current,T=k.toLowerCase(),w=performance.now();R.keys.length>0&&(w-R.lastTime>500?(R.keys=[],R.repeating=!0,R.previousKeyMatched=!0):R.repeating&&T!==R.keys[0]&&(R.repeating=!1)),R.lastTime=w,R.keys.push(T);const O=f&&!R.repeating&&Mp(f,R);R.previousKeyMatched&&(O||on(S,f,!1,l,Ws,R))?$.preventDefault():R.previousKeyMatched=!1}d&&d($)},C=Ue(y,o);let x=-1;p.Children.forEach(s,($,S)=>{if(!p.isValidElement($)){x===S&&(x+=1,x>=s.length&&(x=-1));return}$.props.disabled||(m==="selectedMenu"&&$.props.selected||x===-1)&&(x=S),x===S&&($.props.disabled||$.props.muiSkipListHighlight||$.type.muiSkipListHighlight)&&(x+=1,x>=s.length&&(x=-1))});const P=p.Children.map(s,($,S)=>{if(S===x){const k={};return a&&(k.autoFocus=!0),$.props.tabIndex===void 0&&m==="selectedMenu"&&(k.tabIndex=0),p.cloneElement($,k)}return $});return g.jsx(US,u({role:"menu",ref:C,className:i,onKeyDown:h,tabIndex:n?0:-1},v,{children:P}))});function Ip(e){return Y("MuiPopover",e)}const b5=X("MuiPopover",["root","paper"]),y5=["onEntering"],x5=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],C5=["slotProps"];function ci(e,t){let o=0;return typeof t=="number"?o=t:t==="center"?o=e.height/2:t==="bottom"&&(o=e.height),o}function ui(e,t){let o=0;return typeof t=="number"?o=t:t==="center"?o=e.width/2:t==="right"&&(o=e.width),o}function qc(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function Hs(e){return typeof e=="function"?e():e}const $5=e=>{const{classes:t}=e;return Z({root:["root"],paper:["paper"]},Ip,t)},Op=M(sl,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),cl=M(no,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Ep=p.forwardRef(function(t,o){var r,n,a;const s=oe({props:t,name:"MuiPopover"}),{action:i,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:d,anchorReference:m="anchorEl",children:v,className:y,container:b,elevation:h=8,marginThreshold:C=16,open:x,PaperProps:P={},slots:$,slotProps:S,transformOrigin:k={vertical:"top",horizontal:"left"},TransitionComponent:f=Wr,transitionDuration:R="auto",TransitionProps:{onEntering:T}={},disableScrollLock:w=!1}=s,O=F(s.TransitionProps,y5),j=F(s,x5),L=(r=S==null?void 0:S.paper)!=null?r:P,E=p.useRef(),B=Ue(E,L.ref),z=u({},s,{anchorOrigin:c,anchorReference:m,elevation:h,marginThreshold:C,externalPaperSlotProps:L,transformOrigin:k,TransitionComponent:f,transitionDuration:R,TransitionProps:O}),W=$5(z),H=p.useCallback(()=>{if(m==="anchorPosition")return d;const he=Hs(l),le=(he&&he.nodeType===1?he:rt(E.current).body).getBoundingClientRect();return{top:le.top+ci(le,c.vertical),left:le.left+ui(le,c.horizontal)}},[l,c.horizontal,c.vertical,d,m]),_=p.useCallback(he=>({vertical:ci(he,k.vertical),horizontal:ui(he,k.horizontal)}),[k.horizontal,k.vertical]),G=p.useCallback(he=>{const me={width:he.offsetWidth,height:he.offsetHeight},le=_(me);if(m==="none")return{top:null,left:null,transformOrigin:qc(le)};const ce=H();let Ae=ce.top-le.vertical,ie=ce.left-le.horizontal;const ze=Ae+me.height,Pe=ie+me.width,Oe=Zt(Hs(l)),je=Oe.innerHeight-C,Ie=Oe.innerWidth-C;if(C!==null&&Aeje){const Le=ze-je;Ae-=Le,le.vertical+=Le}if(C!==null&&ieIe){const Le=Pe-Ie;ie-=Le,le.horizontal+=Le}return{top:`${Math.round(Ae)}px`,left:`${Math.round(ie)}px`,transformOrigin:qc(le)}},[l,m,H,_,C]),[se,ve]=p.useState(x),Re=p.useCallback(()=>{const he=E.current;if(!he)return;const me=G(he);me.top!==null&&(he.style.top=me.top),me.left!==null&&(he.style.left=me.left),he.style.transformOrigin=me.transformOrigin,ve(!0)},[G]);p.useEffect(()=>(w&&window.addEventListener("scroll",Re),()=>window.removeEventListener("scroll",Re)),[l,w,Re]);const Se=(he,me)=>{T&&T(he,me),Re()},re=()=>{ve(!1)};p.useEffect(()=>{x&&Re()}),p.useImperativeHandle(i,()=>x?{updatePosition:()=>{Re()}}:null,[x,Re]),p.useEffect(()=>{if(!x)return;const he=Gr(()=>{Re()}),me=Zt(l);return me.addEventListener("resize",he),()=>{he.clear(),me.removeEventListener("resize",he)}},[l,x,Re]);let pe=R;R==="auto"&&!f.muiSupportAuto&&(pe=void 0);const te=b||(l?rt(Hs(l)).body:void 0),be=(n=$==null?void 0:$.root)!=null?n:Op,ae=(a=$==null?void 0:$.paper)!=null?a:cl,de=lt({elementType:ae,externalSlotProps:u({},L,{style:se?L.style:u({},L.style,{opacity:0})}),additionalProps:{elevation:h,ref:B},ownerState:z,className:D(W.paper,L==null?void 0:L.className)}),Ee=lt({elementType:be,externalSlotProps:(S==null?void 0:S.root)||{},externalForwardedProps:j,additionalProps:{ref:o,slotProps:{backdrop:{invisible:!0}},container:te,open:x},ownerState:z,className:D(W.root,y)}),{slotProps:fe}=Ee,xe=F(Ee,C5);return g.jsx(be,u({},xe,!co(be)&&{slotProps:fe,disableScrollLock:w},{children:g.jsx(f,u({appear:!0,in:x,onEntering:Se,onExited:re,timeout:pe},O,{children:g.jsx(ae,u({},de,{children:v}))}))}))}),F4=Object.freeze(Object.defineProperty({__proto__:null,PopoverPaper:cl,PopoverRoot:Op,default:Ep,getOffsetLeft:ui,getOffsetTop:ci,getPopoverUtilityClass:Ip,popoverClasses:b5},Symbol.toStringTag,{value:"Module"}));function S5(e){return Y("MuiMenu",e)}X("MuiMenu",["root","paper","list"]);const R5=["onEntering"],P5=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],k5={vertical:"top",horizontal:"right"},T5={vertical:"top",horizontal:"left"},w5=e=>{const{classes:t}=e;return Z({root:["root"],paper:["paper"],list:["list"]},S5,t)},M5=M(Ep,{shouldForwardProp:e=>gt(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),I5=M(cl,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),O5=M(v5,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),E5=p.forwardRef(function(t,o){var r,n;const a=oe({props:t,name:"MuiMenu"}),{autoFocus:s=!0,children:i,className:l,disableAutoFocusItem:c=!1,MenuListProps:d={},onClose:m,open:v,PaperProps:y={},PopoverClasses:b,transitionDuration:h="auto",TransitionProps:{onEntering:C}={},variant:x="selectedMenu",slots:P={},slotProps:$={}}=a,S=F(a.TransitionProps,R5),k=F(a,P5),f=No(),R=u({},a,{autoFocus:s,disableAutoFocusItem:c,MenuListProps:d,onEntering:C,PaperProps:y,transitionDuration:h,TransitionProps:S,variant:x}),T=w5(R),w=s&&!c&&v,O=p.useRef(null),j=(_,G)=>{O.current&&O.current.adjustStyleForScrollbar(_,{direction:f?"rtl":"ltr"}),C&&C(_,G)},L=_=>{_.key==="Tab"&&(_.preventDefault(),m&&m(_,"tabKeyDown"))};let E=-1;p.Children.map(i,(_,G)=>{p.isValidElement(_)&&(_.props.disabled||(x==="selectedMenu"&&_.props.selected||E===-1)&&(E=G))});const B=(r=P.paper)!=null?r:I5,z=(n=$.paper)!=null?n:y,W=lt({elementType:P.root,externalSlotProps:$.root,ownerState:R,className:[T.root,l]}),H=lt({elementType:B,externalSlotProps:z,ownerState:R,className:T.paper});return g.jsx(M5,u({onClose:m,anchorOrigin:{vertical:"bottom",horizontal:f?"right":"left"},transformOrigin:f?k5:T5,slots:{paper:B,root:P.root},slotProps:{root:W,paper:H},open:v,ref:o,transitionDuration:h,TransitionProps:u({onEntering:j},S),ownerState:R},k,{classes:b,children:g.jsx(O5,u({onKeyDown:L,actions:O,autoFocus:s&&(E===-1||c),autoFocusItem:w,variant:x},d,{className:D(T.list,d.className),children:i}))}))});function Lp(e){return Y("MuiMenuItem",e)}const Rr=X("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),L5=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],A5=(e,t)=>{const{ownerState:o}=e;return[t.root,o.dense&&t.dense,o.divider&&t.divider,!o.disableGutters&&t.gutters]},B5=e=>{const{disabled:t,dense:o,divider:r,disableGutters:n,selected:a,classes:s}=e,l=Z({root:["root",o&&"dense",t&&"disabled",!n&&"gutters",r&&"divider",a&&"selected"]},Lp,s);return u({},s,l)},_5=M(kt,{shouldForwardProp:e=>gt(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:A5})(({theme:e,ownerState:t})=>u({},e.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Rr.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:we(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Rr.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:we(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Rr.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:we(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:we(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Rr.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Rr.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${Lc.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${Lc.inset}`]:{marginLeft:52},[`& .${Sn.root}`]:{marginTop:0,marginBottom:0},[`& .${Sn.inset}`]:{paddingLeft:36},[`& .${Gc.root}`]:{minWidth:36}},!t.dense&&{[e.breakpoints.up("sm")]:{minHeight:"auto"}},t.dense&&u({minHeight:32,paddingTop:4,paddingBottom:4},e.typography.body2,{[`& .${Gc.root} svg`]:{fontSize:"1.25rem"}}))),Ap=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiMenuItem"}),{autoFocus:n=!1,component:a="li",dense:s=!1,divider:i=!1,disableGutters:l=!1,focusVisibleClassName:c,role:d="menuitem",tabIndex:m,className:v}=r,y=F(r,L5),b=p.useContext(uo),h=p.useMemo(()=>({dense:s||b.dense||!1,disableGutters:l}),[b.dense,s,l]),C=p.useRef(null);xt(()=>{n&&C.current&&C.current.focus()},[n]);const x=u({},r,{dense:h.dense,divider:i,disableGutters:l}),P=B5(r),$=Ue(C,o);let S;return r.disabled||(S=m!==void 0?m:-1),g.jsx(uo.Provider,{value:h,children:g.jsx(_5,u({ref:$,role:d,tabIndex:S,component:a,focusVisibleClassName:D(P.focusVisible,c),className:D(P.root,v)},y,{ownerState:x,classes:P}))})}),W4=Object.freeze(Object.defineProperty({__proto__:null,default:Ap,getMenuItemUtilityClass:Lp,menuItemClasses:Rr},Symbol.toStringTag,{value:"Module"}));function N5(e){return Y("MuiNativeSelect",e)}const ul=X("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),z5=["className","disabled","error","IconComponent","inputRef","variant"],j5=e=>{const{classes:t,variant:o,disabled:r,multiple:n,open:a,error:s}=e,i={select:["select",o,r&&"disabled",n&&"multiple",s&&"error"],icon:["icon",`icon${I(o)}`,a&&"iconOpen",r&&"disabled"]};return Z(i,N5,t)},Bp=({ownerState:e,theme:t})=>u({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":u({},t.vars?{backgroundColor:`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:t.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${ul.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},e.variant==="filled"&&{"&&&":{paddingRight:32}},e.variant==="outlined"&&{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}),D5=M("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:gt,overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.select,t[o.variant],o.error&&t.error,{[`&.${ul.multiple}`]:t.multiple}]}})(Bp),_p=({ownerState:e,theme:t})=>u({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${ul.disabled}`]:{color:(t.vars||t).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},e.variant==="filled"&&{right:7},e.variant==="outlined"&&{right:7}),F5=M("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.icon,o.variant&&t[`icon${I(o.variant)}`],o.open&&t.iconOpen]}})(_p),W5=p.forwardRef(function(t,o){const{className:r,disabled:n,error:a,IconComponent:s,inputRef:i,variant:l="standard"}=t,c=F(t,z5),d=u({},t,{disabled:n,variant:l,error:a}),m=j5(d);return g.jsxs(p.Fragment,{children:[g.jsx(D5,u({ownerState:d,className:D(m.select,r),disabled:n,ref:i||o},c)),t.multiple?null:g.jsx(F5,{as:s,ownerState:d,className:m.icon})]})});var Yc;const H5=["children","classes","className","label","notched"],V5=M("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:gt})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),U5=M("legend",{name:"MuiNotchedOutlined",shouldForwardProp:gt})(({ownerState:e,theme:t})=>u({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})},e.withLabel&&u({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})})));function G5(e){const{className:t,label:o,notched:r}=e,n=F(e,H5),a=o!=null&&o!=="",s=u({},e,{notched:r,withLabel:a});return g.jsx(V5,u({"aria-hidden":!0,className:t,ownerState:s},n,{children:g.jsx(U5,{ownerState:s,children:a?g.jsx("span",{children:o}):Yc||(Yc=g.jsx("span",{className:"notranslate",children:"​"}))})}))}const K5=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],q5=e=>{const{classes:t}=e,r=Z({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},xx,t);return u({},t,r)},Y5=M(xs,{shouldForwardProp:e=>gt(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:bs})(({theme:e,ownerState:t})=>{const o=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return u({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${vo.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${vo.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:o}},[`&.${vo.focused} .${vo.notchedOutline}`]:{borderColor:(e.vars||e).palette[t.color].main,borderWidth:2},[`&.${vo.error} .${vo.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${vo.disabled} .${vo.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},t.startAdornment&&{paddingLeft:14},t.endAdornment&&{paddingRight:14},t.multiline&&u({padding:"16.5px 14px"},t.size==="small"&&{padding:"8.5px 14px"}))}),X5=M(G5,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),Z5=M(Cs,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:ys})(({theme:e,ownerState:t})=>u({padding:"16.5px 14px"},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},t.size==="small"&&{padding:"8.5px 14px"},t.multiline&&{padding:0},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0})),dl=p.forwardRef(function(t,o){var r,n,a,s,i;const l=oe({props:t,name:"MuiOutlinedInput"}),{components:c={},fullWidth:d=!1,inputComponent:m="input",label:v,multiline:y=!1,notched:b,slots:h={},type:C="text"}=l,x=F(l,K5),P=q5(l),$=fo(),S=Jo({props:l,muiFormControl:$,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),k=u({},l,{color:S.color||"primary",disabled:S.disabled,error:S.error,focused:S.focused,formControl:$,fullWidth:d,hiddenLabel:S.hiddenLabel,multiline:y,size:S.size,type:C}),f=(r=(n=h.root)!=null?n:c.Root)!=null?r:Y5,R=(a=(s=h.input)!=null?s:c.Input)!=null?a:Z5;return g.jsx(Nn,u({slots:{root:f,input:R},renderSuffix:T=>g.jsx(X5,{ownerState:k,className:P.notchedOutline,label:v!=null&&v!==""&&S.required?i||(i=g.jsxs(p.Fragment,{children:[v," ","*"]})):v,notched:typeof b<"u"?b:!!(T.startAdornment||T.filled||T.focused)}),fullWidth:d,inputComponent:m,multiline:y,ref:o,type:C},x,{classes:u({},P,{notchedOutline:null})}))});dl.muiName="Input";function J5(e){return Y("MuiPagination",e)}X("MuiPagination",["root","ul","outlined","text"]);const Q5=["boundaryCount","componentName","count","defaultPage","disabled","hideNextButton","hidePrevButton","onChange","page","showFirstButton","showLastButton","siblingCount"];function eR(e={}){const{boundaryCount:t=1,componentName:o="usePagination",count:r=1,defaultPage:n=1,disabled:a=!1,hideNextButton:s=!1,hidePrevButton:i=!1,onChange:l,page:c,showFirstButton:d=!1,showLastButton:m=!1,siblingCount:v=1}=e,y=F(e,Q5),[b,h]=qt({controlled:c,default:n,name:o,state:"page"}),C=(w,O)=>{c||h(O),l&&l(w,O)},x=(w,O)=>{const j=O-w+1;return Array.from({length:j},(L,E)=>w+E)},P=x(1,Math.min(t,r)),$=x(Math.max(r-t+1,t+1),r),S=Math.max(Math.min(b-v,r-t-v*2-1),t+2),k=Math.min(Math.max(b+v,t+v*2+2),$.length>0?$[0]-2:r-1),f=[...d?["first"]:[],...i?[]:["previous"],...P,...S>t+2?["start-ellipsis"]:t+1t?[r-t]:[],...$,...s?[]:["next"],...m?["last"]:[]],R=w=>{switch(w){case"first":return 1;case"previous":return b-1;case"next":return b+1;case"last":return r;default:return null}},T=f.map(w=>typeof w=="number"?{onClick:O=>{C(O,w)},type:"page",page:w,selected:w===b,disabled:a,"aria-current":w===b?"true":void 0}:{onClick:O=>{C(O,R(w))},type:w,page:R(w),selected:!1,disabled:a||w.indexOf("ellipsis")===-1&&(w==="next"||w==="last"?b>=r:b<=1)});return u({items:T},y)}function tR(e){return Y("MuiPaginationItem",e)}const Ht=X("MuiPaginationItem",["root","page","sizeSmall","sizeLarge","text","textPrimary","textSecondary","outlined","outlinedPrimary","outlinedSecondary","rounded","ellipsis","firstLast","previousNext","focusVisible","disabled","selected","icon","colorPrimary","colorSecondary"]),di=ue(g.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),pi=ue(g.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),Xc=ue(g.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"NavigateBefore"),Zc=ue(g.jsx("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext"),oR=["className","color","component","components","disabled","page","selected","shape","size","slots","type","variant"],Np=(e,t)=>{const{ownerState:o}=e;return[t.root,t[o.variant],t[`size${I(o.size)}`],o.variant==="text"&&t[`text${I(o.color)}`],o.variant==="outlined"&&t[`outlined${I(o.color)}`],o.shape==="rounded"&&t.rounded,o.type==="page"&&t.page,(o.type==="start-ellipsis"||o.type==="end-ellipsis")&&t.ellipsis,(o.type==="previous"||o.type==="next")&&t.previousNext,(o.type==="first"||o.type==="last")&&t.firstLast]},rR=e=>{const{classes:t,color:o,disabled:r,selected:n,size:a,shape:s,type:i,variant:l}=e,c={root:["root",`size${I(a)}`,l,s,o!=="standard"&&`color${I(o)}`,o!=="standard"&&`${l}${I(o)}`,r&&"disabled",n&&"selected",{page:"page",first:"firstLast",last:"firstLast","start-ellipsis":"ellipsis","end-ellipsis":"ellipsis",previous:"previousNext",next:"previousNext"}[i]],icon:["icon"]};return Z(c,tR,t)},nR=M("div",{name:"MuiPaginationItem",slot:"Root",overridesResolver:Np})(({theme:e,ownerState:t})=>u({},e.typography.body2,{borderRadius:32/2,textAlign:"center",boxSizing:"border-box",minWidth:32,padding:"0 6px",margin:"0 3px",color:(e.vars||e).palette.text.primary,height:"auto",[`&.${Ht.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.size==="small"&&{minWidth:26,borderRadius:26/2,margin:"0 1px",padding:"0 4px"},t.size==="large"&&{minWidth:40,borderRadius:40/2,padding:"0 10px",fontSize:e.typography.pxToRem(15)})),aR=M(kt,{name:"MuiPaginationItem",slot:"Root",overridesResolver:Np})(({theme:e,ownerState:t})=>u({},e.typography.body2,{borderRadius:32/2,textAlign:"center",boxSizing:"border-box",minWidth:32,height:32,padding:"0 6px",margin:"0 3px",color:(e.vars||e).palette.text.primary,[`&.${Ht.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Ht.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},transition:e.transitions.create(["color","background-color"],{duration:e.transitions.duration.short}),"&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Ht.selected}`]:{backgroundColor:(e.vars||e).palette.action.selected,"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:we(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${Ht.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:we(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},[`&.${Ht.disabled}`]:{opacity:1,color:(e.vars||e).palette.action.disabled,backgroundColor:(e.vars||e).palette.action.selected}}},t.size==="small"&&{minWidth:26,height:26,borderRadius:26/2,margin:"0 1px",padding:"0 4px"},t.size==="large"&&{minWidth:40,height:40,borderRadius:40/2,padding:"0 10px",fontSize:e.typography.pxToRem(15)},t.shape==="rounded"&&{borderRadius:(e.vars||e).shape.borderRadius}),({theme:e,ownerState:t})=>u({},t.variant==="text"&&{[`&.${Ht.selected}`]:u({},t.color!=="standard"&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main,"&:hover":{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}},[`&.${Ht.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}},{[`&.${Ht.disabled}`]:{color:(e.vars||e).palette.action.disabled}})},t.variant==="outlined"&&{border:e.vars?`1px solid rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:`1px solid ${e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${Ht.selected}`]:u({},t.color!=="standard"&&{color:(e.vars||e).palette[t.color].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:we(e.palette[t.color].main,.5)}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.activatedOpacity})`:we(e.palette[t.color].main,e.palette.action.activatedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / calc(${e.vars.palette.action.activatedOpacity} + ${e.vars.palette.action.focusOpacity}))`:we(e.palette[t.color].main,e.palette.action.activatedOpacity+e.palette.action.focusOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Ht.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / calc(${e.vars.palette.action.activatedOpacity} + ${e.vars.palette.action.focusOpacity}))`:we(e.palette[t.color].main,e.palette.action.activatedOpacity+e.palette.action.focusOpacity)}},{[`&.${Ht.disabled}`]:{borderColor:(e.vars||e).palette.action.disabledBackground,color:(e.vars||e).palette.action.disabled}})})),sR=M("div",{name:"MuiPaginationItem",slot:"Icon",overridesResolver:(e,t)=>t.icon})(({theme:e,ownerState:t})=>u({fontSize:e.typography.pxToRem(20),margin:"0 -8px"},t.size==="small"&&{fontSize:e.typography.pxToRem(18)},t.size==="large"&&{fontSize:e.typography.pxToRem(22)})),iR=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiPaginationItem"}),{className:n,color:a="standard",component:s,components:i={},disabled:l=!1,page:c,selected:d=!1,shape:m="circular",size:v="medium",slots:y={},type:b="page",variant:h="text"}=r,C=F(r,oR),x=u({},r,{color:a,disabled:l,selected:d,shape:m,size:v,type:b,variant:h}),P=No(),$=rR(x),k=(P?{previous:y.next||i.next||Zc,next:y.previous||i.previous||Xc,last:y.first||i.first||di,first:y.last||i.last||pi}:{previous:y.previous||i.previous||Xc,next:y.next||i.next||Zc,first:y.first||i.first||di,last:y.last||i.last||pi})[b];return b==="start-ellipsis"||b==="end-ellipsis"?g.jsx(nR,{ref:o,ownerState:x,className:D($.root,n),children:"…"}):g.jsxs(aR,u({ref:o,ownerState:x,component:s,disabled:l,className:D($.root,n)},C,{children:[b==="page"&&c,k?g.jsx(sR,{as:k,ownerState:x,className:$.icon}):null]}))}),lR=["boundaryCount","className","color","count","defaultPage","disabled","getItemAriaLabel","hideNextButton","hidePrevButton","onChange","page","renderItem","shape","showFirstButton","showLastButton","siblingCount","size","variant"],cR=e=>{const{classes:t,variant:o}=e;return Z({root:["root",o],ul:["ul"]},J5,t)},uR=M("nav",{name:"MuiPagination",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[o.variant]]}})({}),dR=M("ul",{name:"MuiPagination",slot:"Ul",overridesResolver:(e,t)=>t.ul})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"});function pR(e,t,o){return e==="page"?`${o?"":"Go to "}page ${t}`:`Go to ${e} page`}const H4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiPagination"}),{boundaryCount:n=1,className:a,color:s="standard",count:i=1,defaultPage:l=1,disabled:c=!1,getItemAriaLabel:d=pR,hideNextButton:m=!1,hidePrevButton:v=!1,renderItem:y=T=>g.jsx(iR,u({},T)),shape:b="circular",showFirstButton:h=!1,showLastButton:C=!1,siblingCount:x=1,size:P="medium",variant:$="text"}=r,S=F(r,lR),{items:k}=eR(u({},r,{componentName:"Pagination"})),f=u({},r,{boundaryCount:n,color:s,count:i,defaultPage:l,disabled:c,getItemAriaLabel:d,hideNextButton:m,hidePrevButton:v,renderItem:y,shape:b,showFirstButton:h,showLastButton:C,siblingCount:x,size:P,variant:$}),R=cR(f);return g.jsx(uR,u({"aria-label":"pagination navigation",className:D(R.root,a),ownerState:f,ref:o},S,{children:g.jsx(dR,{className:R.ul,ownerState:f,children:k.map((T,w)=>g.jsx("li",{children:y(u({},T,{color:s,"aria-label":d(T.type,T.page,T.selected),shape:b,size:P,variant:$}))},w))})}))}),fR=ue(g.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),mR=ue(g.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),gR=M("span",{name:"MuiRadioButtonIcon",shouldForwardProp:gt})({position:"relative",display:"flex"}),hR=M(fR,{name:"MuiRadioButtonIcon"})({transform:"scale(1)"}),vR=M(mR,{name:"MuiRadioButtonIcon"})(({theme:e,ownerState:t})=>u({left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest})},t.checked&&{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}));function zp(e){const{checked:t=!1,classes:o={},fontSize:r}=e,n=u({},e,{checked:t});return g.jsxs(gR,{className:o.root,ownerState:n,children:[g.jsx(hR,{fontSize:r,className:o.background,ownerState:n}),g.jsx(vR,{fontSize:r,className:o.dot,ownerState:n})]})}const jp=p.createContext(void 0);function bR(){return p.useContext(jp)}function yR(e){return Y("MuiRadio",e)}const Jc=X("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),xR=["checked","checkedIcon","color","icon","name","onChange","size","className"],CR=e=>{const{classes:t,color:o,size:r}=e,n={root:["root",`color${I(o)}`,r!=="medium"&&`size${I(r)}`]};return u({},t,Z(n,yR,t))},$R=M(al,{shouldForwardProp:e=>gt(e)||e==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.size!=="medium"&&t[`size${I(o.size)}`],t[`color${I(o.color)}`]]}})(({theme:e,ownerState:t})=>u({color:(e.vars||e).palette.text.secondary},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${t.color==="default"?e.vars.palette.action.activeChannel:e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:we(t.color==="default"?e.palette.action.active:e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.color!=="default"&&{[`&.${Jc.checked}`]:{color:(e.vars||e).palette[t.color].main}},{[`&.${Jc.disabled}`]:{color:(e.vars||e).palette.action.disabled}}));function SR(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}const Qc=g.jsx(zp,{checked:!0}),eu=g.jsx(zp,{}),V4=p.forwardRef(function(t,o){var r,n;const a=oe({props:t,name:"MuiRadio"}),{checked:s,checkedIcon:i=Qc,color:l="primary",icon:c=eu,name:d,onChange:m,size:v="medium",className:y}=a,b=F(a,xR),h=u({},a,{color:l,size:v}),C=CR(h),x=bR();let P=s;const $=ba(m,x&&x.onChange);let S=d;return x&&(typeof P>"u"&&(P=SR(x.value,a.value)),typeof S>"u"&&(S=x.name)),g.jsx($R,u({type:"radio",icon:p.cloneElement(c,{fontSize:(r=eu.props.fontSize)!=null?r:v}),checkedIcon:p.cloneElement(i,{fontSize:(n=Qc.props.fontSize)!=null?n:v}),ownerState:h,classes:C,name:S,checked:P,onChange:$,ref:o,className:D(C.root,y)},b))});function RR(e){return Y("MuiRadioGroup",e)}X("MuiRadioGroup",["root","row","error"]);const PR=["actions","children","className","defaultValue","name","onChange","value"],kR=e=>{const{classes:t,row:o,error:r}=e;return Z({root:["root",o&&"row",r&&"error"]},RR,t)},U4=p.forwardRef(function(t,o){const{actions:r,children:n,className:a,defaultValue:s,name:i,onChange:l,value:c}=t,d=F(t,PR),m=p.useRef(null),v=kR(t),[y,b]=qt({controlled:c,default:s,name:"RadioGroup"});p.useImperativeHandle(r,()=>({focus:()=>{let P=m.current.querySelector("input:not(:disabled):checked");P||(P=m.current.querySelector("input:not(:disabled)")),P&&P.focus()}}),[]);const h=Ue(o,m),C=$o(i),x=p.useMemo(()=>({name:C,onChange(P){b(P.target.value),l&&l(P,P.target.value)},value:y}),[C,l,b,y]);return g.jsx(jp.Provider,{value:x,children:g.jsx($p,u({role:"radiogroup",ref:h,className:D(v.root,a)},d,{children:n}))})});function Dp(e){return Y("MuiSelect",e)}const Pr=X("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var tu;const TR=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],wR=M("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{[`&.${Pr.select}`]:t.select},{[`&.${Pr.select}`]:t[o.variant]},{[`&.${Pr.error}`]:t.error},{[`&.${Pr.multiple}`]:t.multiple}]}})(Bp,{[`&.${Pr.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),MR=M("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.icon,o.variant&&t[`icon${I(o.variant)}`],o.open&&t.iconOpen]}})(_p),IR=M("input",{shouldForwardProp:e=>ps(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function ou(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function OR(e){return e==null||typeof e=="string"&&!e.trim()}const ER=e=>{const{classes:t,variant:o,disabled:r,multiple:n,open:a,error:s}=e,i={select:["select",o,r&&"disabled",n&&"multiple",s&&"error"],icon:["icon",`icon${I(o)}`,a&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Z(i,Dp,t)},LR=p.forwardRef(function(t,o){var r;const{"aria-describedby":n,"aria-label":a,autoFocus:s,autoWidth:i,children:l,className:c,defaultOpen:d,defaultValue:m,disabled:v,displayEmpty:y,error:b=!1,IconComponent:h,inputRef:C,labelId:x,MenuProps:P={},multiple:$,name:S,onBlur:k,onChange:f,onClose:R,onFocus:T,onOpen:w,open:O,readOnly:j,renderValue:L,SelectDisplayProps:E={},tabIndex:B,value:z,variant:W="standard"}=t,H=F(t,TR),[_,G]=qt({controlled:z,default:m,name:"Select"}),[se,ve]=qt({controlled:O,default:d,name:"Select"}),Re=p.useRef(null),Se=p.useRef(null),[re,pe]=p.useState(null),{current:te}=p.useRef(O!=null),[be,ae]=p.useState(),de=Ue(o,C),Ee=p.useCallback(J=>{Se.current=J,J&&pe(J)},[]),fe=re==null?void 0:re.parentNode;p.useImperativeHandle(de,()=>({focus:()=>{Se.current.focus()},node:Re.current,value:_}),[_]),p.useEffect(()=>{d&&se&&re&&!te&&(ae(i?null:fe.clientWidth),Se.current.focus())},[re,i]),p.useEffect(()=>{s&&Se.current.focus()},[s]),p.useEffect(()=>{if(!x)return;const J=rt(Se.current).getElementById(x);if(J){const ge=()=>{getSelection().isCollapsed&&Se.current.focus()};return J.addEventListener("click",ge),()=>{J.removeEventListener("click",ge)}}},[x]);const xe=(J,ge)=>{J?w&&w(ge):R&&R(ge),te||(ae(i?null:fe.clientWidth),ve(J))},he=J=>{J.button===0&&(J.preventDefault(),Se.current.focus(),xe(!0,J))},me=J=>{xe(!1,J)},le=p.Children.toArray(l),ce=J=>{const ge=le.find(q=>q.props.value===J.target.value);ge!==void 0&&(G(ge.props.value),f&&f(J,ge))},Ae=J=>ge=>{let q;if(ge.currentTarget.hasAttribute("tabindex")){if($){q=Array.isArray(_)?_.slice():[];const ee=_.indexOf(J.props.value);ee===-1?q.push(J.props.value):q.splice(ee,1)}else q=J.props.value;if(J.props.onClick&&J.props.onClick(ge),_!==q&&(G(q),f)){const ee=ge.nativeEvent||ge,ke=new ee.constructor(ee.type,ee);Object.defineProperty(ke,"target",{writable:!0,value:{value:q,name:S}}),f(ke,J)}$||xe(!1,ge)}},ie=J=>{j||[" ","ArrowUp","ArrowDown","Enter"].indexOf(J.key)!==-1&&(J.preventDefault(),xe(!0,J))},ze=re!==null&&se,Pe=J=>{!ze&&k&&(Object.defineProperty(J,"target",{writable:!0,value:{value:_,name:S}}),k(J))};delete H["aria-invalid"];let Oe,je;const Ie=[];let Le=!1;(ka({value:_})||y)&&(L?Oe=L(_):Le=!0);const Ke=le.map(J=>{if(!p.isValidElement(J))return null;let ge;if($){if(!Array.isArray(_))throw new Error(Pt(2));ge=_.some(q=>ou(q,J.props.value)),ge&&Le&&Ie.push(J.props.children)}else ge=ou(_,J.props.value),ge&&Le&&(je=J.props.children);return p.cloneElement(J,{"aria-selected":ge?"true":"false",onClick:Ae(J),onKeyUp:q=>{q.key===" "&&q.preventDefault(),J.props.onKeyUp&&J.props.onKeyUp(q)},role:"option",selected:ge,value:void 0,"data-value":J.props.value})});Le&&($?Ie.length===0?Oe=null:Oe=Ie.reduce((J,ge,q)=>(J.push(ge),q{const{classes:t}=e;return t},pl={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>gt(e)&&e!=="variant",slot:"Root"},NR=M(Ss,pl)(""),zR=M(dl,pl)(""),jR=M(il,pl)(""),Rs=p.forwardRef(function(t,o){const r=oe({name:"MuiSelect",props:t}),{autoWidth:n=!1,children:a,classes:s={},className:i,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:d=ip,id:m,input:v,inputProps:y,label:b,labelId:h,MenuProps:C,multiple:x=!1,native:P=!1,onClose:$,onOpen:S,open:k,renderValue:f,SelectDisplayProps:R,variant:T="outlined"}=r,w=F(r,AR),O=P?W5:LR,j=fo(),L=Jo({props:r,muiFormControl:j,states:["variant","error"]}),E=L.variant||T,B=u({},r,{variant:E,classes:s}),z=_R(B),W=F(z,BR),H=v||{standard:g.jsx(NR,{ownerState:B}),outlined:g.jsx(zR,{label:b,ownerState:B}),filled:g.jsx(jR,{ownerState:B})}[E],_=Ue(o,_o(H));return g.jsx(p.Fragment,{children:p.cloneElement(H,u({inputComponent:O,inputProps:u({children:a,error:L.error,IconComponent:d,variant:E,type:void 0,multiple:x},P?{id:m}:{autoWidth:n,defaultOpen:l,displayEmpty:c,labelId:h,MenuProps:C,onClose:$,onOpen:S,open:k,renderValue:f,SelectDisplayProps:u({id:m},R)},y,{classes:y?ct(W,y.classes):W},v?v.props.inputProps:{})},(x&&P||c)&&E==="outlined"?{notched:!0}:{},{ref:_,className:D(H.props.className,i,z.root)},!v&&{variant:E},w))})});Rs.muiName="Select";const G4=Object.freeze(Object.defineProperty({__proto__:null,default:Rs,getSelectUtilityClasses:Dp,selectClasses:Pr},Symbol.toStringTag,{value:"Module"}));function DR(e,t,o=(r,n)=>r===n){return e.length===t.length&&e.every((r,n)=>o(r,t[n]))}const FR=2;function Fp(e,t){return e-t}function ru(e,t){var o;const{index:r}=(o=e.reduce((n,a,s)=>{const i=Math.abs(t-a);return n===null||i({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},GR=e=>e;let ea;function au(){return ea===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?ea=CSS.supports("touch-action","none"):ea=!0),ea}function KR(e){const{"aria-labelledby":t,defaultValue:o,disabled:r=!1,disableSwap:n=!1,isRtl:a=!1,marks:s=!1,max:i=100,min:l=0,name:c,onChange:d,onChangeCommitted:m,orientation:v="horizontal",rootRef:y,scale:b=GR,step:h=1,shiftStep:C=10,tabIndex:x,value:P}=e,$=p.useRef(void 0),[S,k]=p.useState(-1),[f,R]=p.useState(-1),[T,w]=p.useState(!1),O=p.useRef(0),[j,L]=qt({controlled:P,default:o??l,name:"Slider"}),E=d&&((U,N,Q)=>{const $e=U.nativeEvent||U,Te=new $e.constructor($e.type,$e);Object.defineProperty(Te,"target",{writable:!0,value:{value:N,name:c}}),d(Te,N,Q)}),B=Array.isArray(j);let z=B?j.slice().sort(Fp):[j];z=z.map(U=>U==null?l:rr(U,l,i));const W=s===!0&&h!==null?[...Array(Math.floor((i-l)/h)+1)].map((U,N)=>({value:l+h*N})):s||[],H=W.map(U=>U.value),{isFocusVisibleRef:_,onBlur:G,onFocus:se,ref:ve}=us(),[Re,Se]=p.useState(-1),re=p.useRef(null),pe=Ue(ve,re),te=Ue(y,pe),be=U=>N=>{var Q;const $e=Number(N.currentTarget.getAttribute("data-index"));se(N),_.current===!0&&Se($e),R($e),U==null||(Q=U.onFocus)==null||Q.call(U,N)},ae=U=>N=>{var Q;G(N),_.current===!1&&Se(-1),R(-1),U==null||(Q=U.onBlur)==null||Q.call(U,N)},de=(U,N)=>{const Q=Number(U.currentTarget.getAttribute("data-index")),$e=z[Q],Te=H.indexOf($e);let J=N;if(W&&h==null){const ge=H[H.length-1];J>ge?J=ge:JN=>{var Q;if(h!==null){const $e=Number(N.currentTarget.getAttribute("data-index")),Te=z[$e];let J=null;(N.key==="ArrowLeft"||N.key==="ArrowDown")&&N.shiftKey||N.key==="PageDown"?J=Math.max(Te-C,l):((N.key==="ArrowRight"||N.key==="ArrowUp")&&N.shiftKey||N.key==="PageUp")&&(J=Math.min(Te+C,i)),J!==null&&(de(N,J),N.preventDefault())}U==null||(Q=U.onKeyDown)==null||Q.call(U,N)};xt(()=>{if(r&&re.current.contains(document.activeElement)){var U;(U=document.activeElement)==null||U.blur()}},[r]),r&&S!==-1&&k(-1),r&&Re!==-1&&Se(-1);const fe=U=>N=>{var Q;(Q=U.onChange)==null||Q.call(U,N),de(N,N.target.valueAsNumber)},xe=p.useRef(void 0);let he=v;a&&v==="horizontal"&&(he+="-reverse");const me=({finger:U,move:N=!1})=>{const{current:Q}=re,{width:$e,height:Te,bottom:J,left:ge}=Q.getBoundingClientRect();let q;he.indexOf("vertical")===0?q=(J-U.y)/Te:q=(U.x-ge)/$e,he.indexOf("-reverse")!==-1&&(q=1-q);let ee;if(ee=WR(q,l,i),h)ee=VR(ee,h,l);else{const Be=ru(H,ee);ee=H[Be]}ee=rr(ee,l,i);let ke=0;if(B){N?ke=xe.current:ke=ru(z,ee),n&&(ee=rr(ee,z[ke-1]||-1/0,z[ke+1]||1/0));const Be=ee;ee=nu({values:z,newValue:ee,index:ke}),n&&N||(ke=ee.indexOf(Be),xe.current=ke)}return{newValue:ee,activeIndex:ke}},le=at(U=>{const N=Zn(U,$);if(!N)return;if(O.current+=1,U.type==="mousemove"&&U.buttons===0){ce(U);return}const{newValue:Q,activeIndex:$e}=me({finger:N,move:!0});Jn({sliderRef:re,activeIndex:$e,setActive:k}),L(Q),!T&&O.current>FR&&w(!0),E&&!Qn(Q,j)&&E(U,Q,$e)}),ce=at(U=>{const N=Zn(U,$);if(w(!1),!N)return;const{newValue:Q}=me({finger:N,move:!0});k(-1),U.type==="touchend"&&R(-1),m&&m(U,Q),$.current=void 0,ie()}),Ae=at(U=>{if(r)return;au()||U.preventDefault();const N=U.changedTouches[0];N!=null&&($.current=N.identifier);const Q=Zn(U,$);if(Q!==!1){const{newValue:Te,activeIndex:J}=me({finger:Q});Jn({sliderRef:re,activeIndex:J,setActive:k}),L(Te),E&&!Qn(Te,j)&&E(U,Te,J)}O.current=0;const $e=rt(re.current);$e.addEventListener("touchmove",le,{passive:!0}),$e.addEventListener("touchend",ce,{passive:!0})}),ie=p.useCallback(()=>{const U=rt(re.current);U.removeEventListener("mousemove",le),U.removeEventListener("mouseup",ce),U.removeEventListener("touchmove",le),U.removeEventListener("touchend",ce)},[ce,le]);p.useEffect(()=>{const{current:U}=re;return U.addEventListener("touchstart",Ae,{passive:au()}),()=>{U.removeEventListener("touchstart",Ae),ie()}},[ie,Ae]),p.useEffect(()=>{r&&ie()},[r,ie]);const ze=U=>N=>{var Q;if((Q=U.onMouseDown)==null||Q.call(U,N),r||N.defaultPrevented||N.button!==0)return;N.preventDefault();const $e=Zn(N,$);if($e!==!1){const{newValue:J,activeIndex:ge}=me({finger:$e});Jn({sliderRef:re,activeIndex:ge,setActive:k}),L(J),E&&!Qn(J,j)&&E(N,J,ge)}O.current=0;const Te=rt(re.current);Te.addEventListener("mousemove",le,{passive:!0}),Te.addEventListener("mouseup",ce)},Pe=Ta(B?z[0]:l,l,i),Oe=Ta(z[z.length-1],l,i)-Pe,je=(U={})=>{const N=ir(U),Q={onMouseDown:ze(N||{})},$e=u({},N,Q);return u({},U,{ref:te},$e)},Ie=U=>N=>{var Q;(Q=U.onMouseOver)==null||Q.call(U,N);const $e=Number(N.currentTarget.getAttribute("data-index"));R($e)},Le=U=>N=>{var Q;(Q=U.onMouseLeave)==null||Q.call(U,N),R(-1)};return{active:S,axis:he,axisProps:UR,dragging:T,focusedThumbIndex:Re,getHiddenInputProps:(U={})=>{var N;const Q=ir(U),$e={onChange:fe(Q||{}),onFocus:be(Q||{}),onBlur:ae(Q||{}),onKeyDown:Ee(Q||{})},Te=u({},Q,$e);return u({tabIndex:x,"aria-labelledby":t,"aria-orientation":v,"aria-valuemax":b(i),"aria-valuemin":b(l),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":(N=e.step)!=null?N:void 0,disabled:r},U,Te,{style:u({},wh,{direction:a?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:je,getThumbProps:(U={})=>{const N=ir(U),Q={onMouseOver:Ie(N||{}),onMouseLeave:Le(N||{})};return u({},U,N,Q)},marks:W,open:f,range:B,rootRef:te,trackLeap:Oe,trackOffset:Pe,values:z,getThumbStyle:U=>({pointerEvents:S!==-1&&S!==U?"none":void 0})}}const qR=e=>!e||!co(e);function YR(e){return Y("MuiSlider",e)}const Kt=X("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),XR=e=>{const{open:t}=e;return{offset:D(t&&Kt.valueLabelOpen),circle:Kt.valueLabelCircle,label:Kt.valueLabelLabel}};function ZR(e){const{children:t,className:o,value:r}=e,n=XR(e);return t?p.cloneElement(t,{className:D(t.props.className)},g.jsxs(p.Fragment,{children:[t.props.children,g.jsx("span",{className:D(n.offset,o),"aria-hidden":!0,children:g.jsx("span",{className:n.circle,children:g.jsx("span",{className:n.label,children:r})})})]})):null}const JR=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","shiftStep","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"];function su(e){return e}const QR=M("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[`color${I(o.color)}`],o.size!=="medium"&&t[`size${I(o.size)}`],o.marked&&t.marked,o.orientation==="vertical"&&t.vertical,o.track==="inverted"&&t.trackInverted,o.track===!1&&t.trackFalse]}})(({theme:e})=>{var t;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${Kt.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Kt.dragging}`]:{[`& .${Kt.thumb}, & .${Kt.track}`]:{transition:"none"}},variants:[...Object.keys(((t=e.vars)!=null?t:e).palette).filter(o=>{var r;return((r=e.vars)!=null?r:e).palette[o].main}).map(o=>({props:{color:o},style:{color:(e.vars||e).palette[o].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}}),eP=M("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(e,t)=>t.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),tP=M("span",{name:"MuiSlider",slot:"Track",overridesResolver:(e,t)=>t.track})(({theme:e})=>{var t;return{display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.keys(((t=e.vars)!=null?t:e).palette).filter(o=>{var r;return((r=e.vars)!=null?r:e).palette[o].main}).map(o=>({props:{color:o,track:"inverted"},style:u({},e.vars?{backgroundColor:e.vars.palette.Slider[`${o}Track`],borderColor:e.vars.palette.Slider[`${o}Track`]}:u({backgroundColor:Yo(e.palette[o].main,.62),borderColor:Yo(e.palette[o].main,.62)},e.applyStyles("dark",{backgroundColor:qo(e.palette[o].main,.5)}),e.applyStyles("dark",{borderColor:qo(e.palette[o].main,.5)})))}))]}}),oP=M("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.thumb,t[`thumbColor${I(o.color)}`],o.size!=="medium"&&t[`thumbSize${I(o.size)}`]]}})(({theme:e})=>{var t;return{position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${Kt.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.keys(((t=e.vars)!=null?t:e).palette).filter(o=>{var r;return((r=e.vars)!=null?r:e).palette[o].main}).map(o=>({props:{color:o},style:{[`&:hover, &.${Kt.focusVisible}`]:u({},e.vars?{boxShadow:`0px 0px 0px 8px rgba(${e.vars.palette[o].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${we(e.palette[o].main,.16)}`},{"@media (hover: none)":{boxShadow:"none"}}),[`&.${Kt.active}`]:u({},e.vars?{boxShadow:`0px 0px 0px 14px rgba(${e.vars.palette[o].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${we(e.palette[o].main,.16)}`})}}))]}}),rP=M(ZR,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(e,t)=>t.valueLabel})(({theme:e})=>u({zIndex:1,whiteSpace:"nowrap"},e.typography.body2,{fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${Kt.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${Kt.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})),nP=M("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>ps(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:o}=e;return[t.mark,o&&t.markActive]}})(({theme:e})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]})),aP=M("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>ps(e)&&e!=="markLabelActive",overridesResolver:(e,t)=>t.markLabel})(({theme:e})=>u({},e.typography.body2,{color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]})),sP=e=>{const{disabled:t,dragging:o,marked:r,orientation:n,track:a,classes:s,color:i,size:l}=e,c={root:["root",t&&"disabled",o&&"dragging",r&&"marked",n==="vertical"&&"vertical",a==="inverted"&&"trackInverted",a===!1&&"trackFalse",i&&`color${I(i)}`,l&&`size${I(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${I(l)}`,i&&`thumbColor${I(i)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Z(c,YR,s)},iP=({children:e})=>e,K4=p.forwardRef(function(t,o){var r,n,a,s,i,l,c,d,m,v,y,b,h,C,x,P,$,S,k,f,R,T,w,O;const j=oe({props:t,name:"MuiSlider"}),L=No(),{"aria-label":E,"aria-valuetext":B,"aria-labelledby":z,component:W="span",components:H={},componentsProps:_={},color:G="primary",classes:se,className:ve,disableSwap:Re=!1,disabled:Se=!1,getAriaLabel:re,getAriaValueText:pe,marks:te=!1,max:be=100,min:ae=0,orientation:de="horizontal",shiftStep:Ee=10,size:fe="medium",step:xe=1,scale:he=su,slotProps:me,slots:le,track:ce="normal",valueLabelDisplay:Ae="off",valueLabelFormat:ie=su}=j,ze=F(j,JR),Pe=u({},j,{isRtl:L,max:be,min:ae,classes:se,disabled:Se,disableSwap:Re,orientation:de,marks:te,color:G,size:fe,step:xe,shiftStep:Ee,scale:he,track:ce,valueLabelDisplay:Ae,valueLabelFormat:ie}),{axisProps:Oe,getRootProps:je,getHiddenInputProps:Ie,getThumbProps:Le,open:Ke,active:qe,axis:We,focusedThumbIndex:U,range:N,dragging:Q,marks:$e,values:Te,trackOffset:J,trackLeap:ge,getThumbStyle:q}=KR(u({},Pe,{rootRef:o}));Pe.marked=$e.length>0&&$e.some(V=>V.label),Pe.dragging=Q,Pe.focusedThumbIndex=U;const ee=sP(Pe),ke=(r=(n=le==null?void 0:le.root)!=null?n:H.Root)!=null?r:QR,Be=(a=(s=le==null?void 0:le.rail)!=null?s:H.Rail)!=null?a:eP,Ne=(i=(l=le==null?void 0:le.track)!=null?l:H.Track)!=null?i:tP,Ge=(c=(d=le==null?void 0:le.thumb)!=null?d:H.Thumb)!=null?c:oP,Qe=(m=(v=le==null?void 0:le.valueLabel)!=null?v:H.ValueLabel)!=null?m:rP,mt=(y=(b=le==null?void 0:le.mark)!=null?b:H.Mark)!=null?y:nP,nt=(h=(C=le==null?void 0:le.markLabel)!=null?C:H.MarkLabel)!=null?h:aP,Tt=(x=(P=le==null?void 0:le.input)!=null?P:H.Input)!=null?x:"input",ao=($=me==null?void 0:me.root)!=null?$:_.root,jo=(S=me==null?void 0:me.rail)!=null?S:_.rail,Po=(k=me==null?void 0:me.track)!=null?k:_.track,Do=(f=me==null?void 0:me.thumb)!=null?f:_.thumb,wt=(R=me==null?void 0:me.valueLabel)!=null?R:_.valueLabel,pt=(T=me==null?void 0:me.mark)!=null?T:_.mark,et=(w=me==null?void 0:me.markLabel)!=null?w:_.markLabel,vt=(O=me==null?void 0:me.input)!=null?O:_.input,Ct=lt({elementType:ke,getSlotProps:je,externalSlotProps:ao,externalForwardedProps:ze,additionalProps:u({},qR(ke)&&{as:W}),ownerState:u({},Pe,ao==null?void 0:ao.ownerState),className:[ee.root,ve]}),so=lt({elementType:Be,externalSlotProps:jo,ownerState:Pe,className:ee.rail}),er=lt({elementType:Ne,externalSlotProps:Po,additionalProps:{style:u({},Oe[We].offset(J),Oe[We].leap(ge))},ownerState:u({},Pe,Po==null?void 0:Po.ownerState),className:ee.track}),_t=lt({elementType:Ge,getSlotProps:Le,externalSlotProps:Do,ownerState:u({},Pe,Do==null?void 0:Do.ownerState),className:ee.thumb}),mo=lt({elementType:Qe,externalSlotProps:wt,ownerState:u({},Pe,wt==null?void 0:wt.ownerState),className:ee.valueLabel}),Wt=lt({elementType:mt,externalSlotProps:pt,ownerState:Pe,className:ee.mark}),Mt=lt({elementType:nt,externalSlotProps:et,ownerState:Pe,className:ee.markLabel}),io=lt({elementType:Tt,getSlotProps:Ie,externalSlotProps:vt,ownerState:Pe});return g.jsxs(ke,u({},Ct,{children:[g.jsx(Be,u({},so)),g.jsx(Ne,u({},er)),$e.filter(V=>V.value>=ae&&V.value<=be).map((V,A)=>{const ne=Ta(V.value,ae,be),ye=Oe[We].offset(ne);let Me;return ce===!1?Me=Te.indexOf(V.value)!==-1:Me=ce==="normal"&&(N?V.value>=Te[0]&&V.value<=Te[Te.length-1]:V.value<=Te[0])||ce==="inverted"&&(N?V.value<=Te[0]||V.value>=Te[Te.length-1]:V.value>=Te[0]),g.jsxs(p.Fragment,{children:[g.jsx(mt,u({"data-index":A},Wt,!co(mt)&&{markActive:Me},{style:u({},ye,Wt.style),className:D(Wt.className,Me&&ee.markActive)})),V.label!=null?g.jsx(nt,u({"aria-hidden":!0,"data-index":A},Mt,!co(nt)&&{markLabelActive:Me},{style:u({},ye,Mt.style),className:D(ee.markLabel,Mt.className,Me&&ee.markLabelActive),children:V.label})):null]},A)}),Te.map((V,A)=>{const ne=Ta(V,ae,be),ye=Oe[We].offset(ne),Me=Ae==="off"?iP:Qe;return g.jsx(Me,u({},!co(Me)&&{valueLabelFormat:ie,valueLabelDisplay:Ae,value:typeof ie=="function"?ie(he(V),A):ie,index:A,open:Ke===A||qe===A||Ae==="on",disabled:Se},mo,{children:g.jsx(Ge,u({"data-index":A},_t,{className:D(ee.thumb,_t.className,qe===A&&ee.active,U===A&&ee.focusVisible),style:u({},ye,q(A),_t.style),children:g.jsx(Tt,u({"data-index":A,"aria-label":re?re(A):E,"aria-valuenow":he(V),"aria-labelledby":z,"aria-valuetext":pe?pe(he(V),A):B,value:Te[A]},io))}))}),A)})]}))});function lP(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:o=!1,onClose:r,open:n,resumeHideDuration:a}=e,s=Uo();p.useEffect(()=>{if(!n)return;function x(P){P.defaultPrevented||(P.key==="Escape"||P.key==="Esc")&&(r==null||r(P,"escapeKeyDown"))}return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[n,r]);const i=at((x,P)=>{r==null||r(x,P)}),l=at(x=>{!r||x==null||s.start(x,()=>{i(null,"timeout")})});p.useEffect(()=>(n&&l(t),s.clear),[n,t,l,s]);const c=x=>{r==null||r(x,"clickaway")},d=s.clear,m=p.useCallback(()=>{t!=null&&l(a??t*.5)},[t,a,l]),v=x=>P=>{const $=x.onBlur;$==null||$(P),m()},y=x=>P=>{const $=x.onFocus;$==null||$(P),d()},b=x=>P=>{const $=x.onMouseEnter;$==null||$(P),d()},h=x=>P=>{const $=x.onMouseLeave;$==null||$(P),m()};return p.useEffect(()=>{if(!o&&n)return window.addEventListener("focus",m),window.addEventListener("blur",d),()=>{window.removeEventListener("focus",m),window.removeEventListener("blur",d)}},[o,n,m,d]),{getRootProps:(x={})=>{const P=u({},ir(e),ir(x));return u({role:"presentation"},x,P,{onBlur:v(P),onFocus:y(P),onMouseEnter:b(P),onMouseLeave:h(P)})},onClickAway:c}}function cP(e){return Y("MuiSnackbarContent",e)}X("MuiSnackbarContent",["root","message","action"]);const uP=["action","className","message","role"],dP=e=>{const{classes:t}=e;return Z({root:["root"],action:["action"],message:["message"]},cP,t)},pP=M(no,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98,o=Av(e.palette.background.default,t);return u({},e.typography.body2,{color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(o),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:o,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}})}),fP=M("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0"}),mP=M("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),gP=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiSnackbarContent"}),{action:n,className:a,message:s,role:i="alert"}=r,l=F(r,uP),c=r,d=dP(c);return g.jsxs(pP,u({role:i,square:!0,elevation:6,className:D(d.root,a),ownerState:c,ref:o},l,{children:[g.jsx(fP,{className:d.message,ownerState:c,children:s}),n?g.jsx(mP,{className:d.action,ownerState:c,children:n}):null]}))});function hP(e){return Y("MuiSnackbar",e)}X("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const vP=["onEnter","onExited"],bP=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],yP=e=>{const{classes:t,anchorOrigin:o}=e,r={root:["root",`anchorOrigin${I(o.vertical)}${I(o.horizontal)}`]};return Z(r,hP,t)},iu=M("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[`anchorOrigin${I(o.anchorOrigin.vertical)}${I(o.anchorOrigin.horizontal)}`]]}})(({theme:e,ownerState:t})=>{const o={left:"50%",right:"auto",transform:"translateX(-50%)"};return u({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},t.anchorOrigin.vertical==="top"?{top:8}:{bottom:8},t.anchorOrigin.horizontal==="left"&&{justifyContent:"flex-start"},t.anchorOrigin.horizontal==="right"&&{justifyContent:"flex-end"},{[e.breakpoints.up("sm")]:u({},t.anchorOrigin.vertical==="top"?{top:24}:{bottom:24},t.anchorOrigin.horizontal==="center"&&o,t.anchorOrigin.horizontal==="left"&&{left:24,right:"auto"},t.anchorOrigin.horizontal==="right"&&{right:24,left:"auto"})})}),q4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiSnackbar"}),n=ro(),a={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{action:s,anchorOrigin:{vertical:i,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:d,className:m,ClickAwayListenerProps:v,ContentProps:y,disableWindowBlurListener:b=!1,message:h,open:C,TransitionComponent:x=Wr,transitionDuration:P=a,TransitionProps:{onEnter:$,onExited:S}={}}=r,k=F(r.TransitionProps,vP),f=F(r,bP),R=u({},r,{anchorOrigin:{vertical:i,horizontal:l},autoHideDuration:c,disableWindowBlurListener:b,TransitionComponent:x,transitionDuration:P}),T=yP(R),{getRootProps:w,onClickAway:O}=lP(u({},R)),[j,L]=p.useState(!0),E=lt({elementType:iu,getSlotProps:w,externalForwardedProps:f,ownerState:R,additionalProps:{ref:o},className:[T.root,m]}),B=W=>{L(!0),S&&S(W)},z=(W,H)=>{L(!1),$&&$(W,H)};return!C&&j?null:g.jsx(b2,u({onClickAway:O},v,{children:g.jsx(iu,u({},E,{children:g.jsx(x,u({appear:!0,in:C,timeout:P,direction:i==="top"?"down":"up",onEnter:z,onExited:B},k,{children:d||g.jsx(gP,u({message:h,action:s},y))}))}))}))}),xP=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],CP={entering:{transform:"none"},entered:{transform:"none"}},Y4=p.forwardRef(function(t,o){const r=ro(),n={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:a,appear:s=!0,children:i,easing:l,in:c,onEnter:d,onEntered:m,onEntering:v,onExit:y,onExited:b,onExiting:h,style:C,timeout:x=n,TransitionComponent:P=Bt}=t,$=F(t,xP),S=p.useRef(null),k=Ue(S,_o(i),o),f=B=>z=>{if(B){const W=S.current;z===void 0?B(W):B(W,z)}},R=f(v),T=f((B,z)=>{fs(B);const W=So({style:C,timeout:x,easing:l},{mode:"enter"});B.style.webkitTransition=r.transitions.create("transform",W),B.style.transition=r.transitions.create("transform",W),d&&d(B,z)}),w=f(m),O=f(h),j=f(B=>{const z=So({style:C,timeout:x,easing:l},{mode:"exit"});B.style.webkitTransition=r.transitions.create("transform",z),B.style.transition=r.transitions.create("transform",z),y&&y(B)}),L=f(b),E=B=>{a&&a(S.current,B)};return g.jsx(P,u({appear:s,in:c,nodeRef:S,onEnter:T,onEntered:w,onEntering:R,onExit:j,onExited:L,onExiting:O,addEndListener:E,timeout:x},$,{children:(B,z)=>p.cloneElement(i,u({style:u({transform:"scale(0)",visibility:B==="exited"&&!c?"hidden":void 0},CP[B],C,i.props.style),ref:k},z))}))});function Wp(e){return Y("MuiTooltip",e)}const Mo=X("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),$P=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function SP(e){return Math.round(e*1e5)/1e5}const RP=e=>{const{classes:t,disableInteractive:o,arrow:r,touch:n,placement:a}=e,s={popper:["popper",!o&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",n&&"touch",`tooltipPlacement${I(a.split("-")[0])}`],arrow:["arrow"]};return Z(s,Wp,t)},PP=M(hs,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.popper,!o.disableInteractive&&t.popperInteractive,o.arrow&&t.popperArrow,!o.open&&t.popperClose]}})(({theme:e,ownerState:t,open:o})=>u({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!o&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${Mo.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Mo.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Mo.arrow}`]:u({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Mo.arrow}`]:u({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),kP=M("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.tooltip,o.touch&&t.touch,o.arrow&&t.tooltipArrow,t[`tooltipPlacement${I(o.placement.split("-")[0])}`]]}})(({theme:e,ownerState:t})=>u({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:we(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${SP(16/14)}em`,fontWeight:e.typography.fontWeightRegular},{[`.${Mo.popper}[data-popper-placement*="left"] &`]:u({transformOrigin:"right center"},t.isRtl?u({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):u({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${Mo.popper}[data-popper-placement*="right"] &`]:u({transformOrigin:"left center"},t.isRtl?u({marginRight:"14px"},t.touch&&{marginRight:"24px"}):u({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${Mo.popper}[data-popper-placement*="top"] &`]:u({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${Mo.popper}[data-popper-placement*="bottom"] &`]:u({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})})),TP=M("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:we(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let ta=!1;const lu=new En;let rn={x:0,y:0};function oa(e,t){return(o,...r)=>{t&&t(o,...r),e(o,...r)}}const wP=p.forwardRef(function(t,o){var r,n,a,s,i,l,c,d,m,v,y,b,h,C,x,P,$,S,k;const f=oe({props:t,name:"MuiTooltip"}),{arrow:R=!1,children:T,components:w={},componentsProps:O={},describeChild:j=!1,disableFocusListener:L=!1,disableHoverListener:E=!1,disableInteractive:B=!1,disableTouchListener:z=!1,enterDelay:W=100,enterNextDelay:H=0,enterTouchDelay:_=700,followCursor:G=!1,id:se,leaveDelay:ve=0,leaveTouchDelay:Re=1500,onClose:Se,onOpen:re,open:pe,placement:te="bottom",PopperComponent:be,PopperProps:ae={},slotProps:de={},slots:Ee={},title:fe,TransitionComponent:xe=Wr,TransitionProps:he}=f,me=F(f,$P),le=p.isValidElement(T)?T:g.jsx("span",{children:T}),ce=ro(),Ae=No(),[ie,ze]=p.useState(),[Pe,Oe]=p.useState(null),je=p.useRef(!1),Ie=B||G,Le=Uo(),Ke=Uo(),qe=Uo(),We=Uo(),[U,N]=qt({controlled:pe,default:!1,name:"Tooltip",state:"open"});let Q=U;const $e=$o(se),Te=p.useRef(),J=at(()=>{Te.current!==void 0&&(document.body.style.WebkitUserSelect=Te.current,Te.current=void 0),We.clear()});p.useEffect(()=>J,[J]);const ge=Ce=>{lu.clear(),ta=!0,N(!0),re&&!Q&&re(Ce)},q=at(Ce=>{lu.start(800+ve,()=>{ta=!1}),N(!1),Se&&Q&&Se(Ce),Le.start(ce.transitions.duration.shortest,()=>{je.current=!1})}),ee=Ce=>{je.current&&Ce.type!=="touchstart"||(ie&&ie.removeAttribute("title"),Ke.clear(),qe.clear(),W||ta&&H?Ke.start(ta?H:W,()=>{ge(Ce)}):ge(Ce))},ke=Ce=>{Ke.clear(),qe.start(ve,()=>{q(Ce)})},{isFocusVisibleRef:Be,onBlur:Ne,onFocus:Ge,ref:Qe}=us(),[,mt]=p.useState(!1),nt=Ce=>{Ne(Ce),Be.current===!1&&(mt(!1),ke(Ce))},Tt=Ce=>{ie||ze(Ce.currentTarget),Ge(Ce),Be.current===!0&&(mt(!0),ee(Ce))},ao=Ce=>{je.current=!0;const De=le.props;De.onTouchStart&&De.onTouchStart(Ce)},jo=Ce=>{ao(Ce),qe.clear(),Le.clear(),J(),Te.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",We.start(_,()=>{document.body.style.WebkitUserSelect=Te.current,ee(Ce)})},Po=Ce=>{le.props.onTouchEnd&&le.props.onTouchEnd(Ce),J(),qe.start(Re,()=>{q(Ce)})};p.useEffect(()=>{if(!Q)return;function Ce(De){(De.key==="Escape"||De.key==="Esc")&&q(De)}return document.addEventListener("keydown",Ce),()=>{document.removeEventListener("keydown",Ce)}},[q,Q]);const Do=Ue(_o(le),Qe,ze,o);!fe&&fe!==0&&(Q=!1);const wt=p.useRef(),pt=Ce=>{const De=le.props;De.onMouseMove&&De.onMouseMove(Ce),rn={x:Ce.clientX,y:Ce.clientY},wt.current&&wt.current.update()},et={},vt=typeof fe=="string";j?(et.title=!Q&&vt&&!E?fe:null,et["aria-describedby"]=Q?$e:null):(et["aria-label"]=vt?fe:null,et["aria-labelledby"]=Q&&!vt?$e:null);const Ct=u({},et,me,le.props,{className:D(me.className,le.props.className),onTouchStart:ao,ref:Do},G?{onMouseMove:pt}:{}),so={};z||(Ct.onTouchStart=jo,Ct.onTouchEnd=Po),E||(Ct.onMouseOver=oa(ee,Ct.onMouseOver),Ct.onMouseLeave=oa(ke,Ct.onMouseLeave),Ie||(so.onMouseOver=ee,so.onMouseLeave=ke)),L||(Ct.onFocus=oa(Tt,Ct.onFocus),Ct.onBlur=oa(nt,Ct.onBlur),Ie||(so.onFocus=Tt,so.onBlur=nt));const er=p.useMemo(()=>{var Ce;let De=[{name:"arrow",enabled:!!Pe,options:{element:Pe,padding:4}}];return(Ce=ae.popperOptions)!=null&&Ce.modifiers&&(De=De.concat(ae.popperOptions.modifiers)),u({},ae.popperOptions,{modifiers:De})},[Pe,ae]),_t=u({},f,{isRtl:Ae,arrow:R,disableInteractive:Ie,placement:te,PopperComponentProp:be,touch:je.current}),mo=RP(_t),Wt=(r=(n=Ee.popper)!=null?n:w.Popper)!=null?r:PP,Mt=(a=(s=(i=Ee.transition)!=null?i:w.Transition)!=null?s:xe)!=null?a:Wr,io=(l=(c=Ee.tooltip)!=null?c:w.Tooltip)!=null?l:kP,V=(d=(m=Ee.arrow)!=null?m:w.Arrow)!=null?d:TP,A=kr(Wt,u({},ae,(v=de.popper)!=null?v:O.popper,{className:D(mo.popper,ae==null?void 0:ae.className,(y=(b=de.popper)!=null?b:O.popper)==null?void 0:y.className)}),_t),ne=kr(Mt,u({},he,(h=de.transition)!=null?h:O.transition),_t),ye=kr(io,u({},(C=de.tooltip)!=null?C:O.tooltip,{className:D(mo.tooltip,(x=(P=de.tooltip)!=null?P:O.tooltip)==null?void 0:x.className)}),_t),Me=kr(V,u({},($=de.arrow)!=null?$:O.arrow,{className:D(mo.arrow,(S=(k=de.arrow)!=null?k:O.arrow)==null?void 0:S.className)}),_t);return g.jsxs(p.Fragment,{children:[p.cloneElement(le,Ct),g.jsx(Wt,u({as:be??hs,placement:te,anchorEl:G?{getBoundingClientRect:()=>({top:rn.y,left:rn.x,right:rn.x,bottom:rn.y,width:0,height:0})}:ie,popperRef:wt,open:ie?Q:!1,id:$e,transition:!0},so,A,{popperOptions:er,children:({TransitionProps:Ce})=>g.jsx(Mt,u({timeout:ce.transitions.duration.shorter},Ce,ne,{children:g.jsxs(io,u({},ye,{children:[fe,R?g.jsx(V,u({},Me,{ref:Oe})):null]}))}))}))]})}),X4=Object.freeze(Object.defineProperty({__proto__:null,default:wP,getTooltipUtilityClass:Wp,tooltipClasses:Mo},Symbol.toStringTag,{value:"Module"})),Ps=p.createContext({}),fl=p.createContext({});function MP(e){return Y("MuiStep",e)}X("MuiStep",["root","horizontal","vertical","alternativeLabel","completed"]);const IP=["active","children","className","component","completed","disabled","expanded","index","last"],OP=e=>{const{classes:t,orientation:o,alternativeLabel:r,completed:n}=e;return Z({root:["root",o,r&&"alternativeLabel",n&&"completed"]},MP,t)},EP=M("div",{name:"MuiStep",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[o.orientation],o.alternativeLabel&&t.alternativeLabel,o.completed&&t.completed]}})(({ownerState:e})=>u({},e.orientation==="horizontal"&&{paddingLeft:8,paddingRight:8},e.alternativeLabel&&{flex:1,position:"relative"})),Z4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiStep"}),{active:n,children:a,className:s,component:i="div",completed:l,disabled:c,expanded:d=!1,index:m,last:v}=r,y=F(r,IP),{activeStep:b,connector:h,alternativeLabel:C,orientation:x,nonLinear:P}=p.useContext(Ps);let[$=!1,S=!1,k=!1]=[n,l,c];b===m?$=n!==void 0?n:!0:!P&&b>m?S=l!==void 0?l:!0:!P&&b({index:m,last:v,expanded:d,icon:m+1,active:$,completed:S,disabled:k}),[m,v,d,$,S,k]),R=u({},r,{active:$,orientation:x,alternativeLabel:C,completed:S,disabled:k,expanded:d,component:i}),T=OP(R),w=g.jsxs(EP,u({as:i,className:D(T.root,s),ref:o,ownerState:R},y,{children:[h&&C&&m!==0?h:null,a]}));return g.jsx(fl.Provider,{value:f,children:h&&!C&&m!==0?g.jsxs(p.Fragment,{children:[h,w]}):w})}),LP=ue(g.jsx("path",{d:"M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24zm-2 17l-5-5 1.4-1.4 3.6 3.6 7.6-7.6L19 8l-9 9z"}),"CheckCircle"),AP=ue(g.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"Warning");function BP(e){return Y("MuiStepIcon",e)}const Vs=X("MuiStepIcon",["root","active","completed","error","text"]);var cu;const _P=["active","className","completed","error","icon"],NP=e=>{const{classes:t,active:o,completed:r,error:n}=e;return Z({root:["root",o&&"active",r&&"completed",n&&"error"],text:["text"]},BP,t)},Us=M($a,{name:"MuiStepIcon",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"block",transition:e.transitions.create("color",{duration:e.transitions.duration.shortest}),color:(e.vars||e).palette.text.disabled,[`&.${Vs.completed}`]:{color:(e.vars||e).palette.primary.main},[`&.${Vs.active}`]:{color:(e.vars||e).palette.primary.main},[`&.${Vs.error}`]:{color:(e.vars||e).palette.error.main}})),zP=M("text",{name:"MuiStepIcon",slot:"Text",overridesResolver:(e,t)=>t.text})(({theme:e})=>({fill:(e.vars||e).palette.primary.contrastText,fontSize:e.typography.caption.fontSize,fontFamily:e.typography.fontFamily})),jP=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiStepIcon"}),{active:n=!1,className:a,completed:s=!1,error:i=!1,icon:l}=r,c=F(r,_P),d=u({},r,{active:n,completed:s,error:i}),m=NP(d);if(typeof l=="number"||typeof l=="string"){const v=D(a,m.root);return i?g.jsx(Us,u({as:AP,className:v,ref:o,ownerState:d},c)):s?g.jsx(Us,u({as:LP,className:v,ref:o,ownerState:d},c)):g.jsxs(Us,u({className:v,ref:o,ownerState:d},c,{children:[cu||(cu=g.jsx("circle",{cx:"12",cy:"12",r:"12"})),g.jsx(zP,{className:m.text,x:"12",y:"12",textAnchor:"middle",dominantBaseline:"central",ownerState:d,children:l})]}))}return l});function DP(e){return Y("MuiStepLabel",e)}const Ko=X("MuiStepLabel",["root","horizontal","vertical","label","active","completed","error","disabled","iconContainer","alternativeLabel","labelContainer"]),FP=["children","className","componentsProps","error","icon","optional","slotProps","StepIconComponent","StepIconProps"],WP=e=>{const{classes:t,orientation:o,active:r,completed:n,error:a,disabled:s,alternativeLabel:i}=e;return Z({root:["root",o,a&&"error",s&&"disabled",i&&"alternativeLabel"],label:["label",r&&"active",n&&"completed",a&&"error",s&&"disabled",i&&"alternativeLabel"],iconContainer:["iconContainer",r&&"active",n&&"completed",a&&"error",s&&"disabled",i&&"alternativeLabel"],labelContainer:["labelContainer",i&&"alternativeLabel"]},DP,t)},HP=M("span",{name:"MuiStepLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[o.orientation]]}})(({ownerState:e})=>u({display:"flex",alignItems:"center",[`&.${Ko.alternativeLabel}`]:{flexDirection:"column"},[`&.${Ko.disabled}`]:{cursor:"default"}},e.orientation==="vertical"&&{textAlign:"left",padding:"8px 0"})),VP=M("span",{name:"MuiStepLabel",slot:"Label",overridesResolver:(e,t)=>t.label})(({theme:e})=>u({},e.typography.body2,{display:"block",transition:e.transitions.create("color",{duration:e.transitions.duration.shortest}),[`&.${Ko.active}`]:{color:(e.vars||e).palette.text.primary,fontWeight:500},[`&.${Ko.completed}`]:{color:(e.vars||e).palette.text.primary,fontWeight:500},[`&.${Ko.alternativeLabel}`]:{marginTop:16},[`&.${Ko.error}`]:{color:(e.vars||e).palette.error.main}})),UP=M("span",{name:"MuiStepLabel",slot:"IconContainer",overridesResolver:(e,t)=>t.iconContainer})(()=>({flexShrink:0,display:"flex",paddingRight:8,[`&.${Ko.alternativeLabel}`]:{paddingRight:0}})),GP=M("span",{name:"MuiStepLabel",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>({width:"100%",color:(e.vars||e).palette.text.secondary,[`&.${Ko.alternativeLabel}`]:{textAlign:"center"}})),KP=p.forwardRef(function(t,o){var r;const n=oe({props:t,name:"MuiStepLabel"}),{children:a,className:s,componentsProps:i={},error:l=!1,icon:c,optional:d,slotProps:m={},StepIconComponent:v,StepIconProps:y}=n,b=F(n,FP),{alternativeLabel:h,orientation:C}=p.useContext(Ps),{active:x,disabled:P,completed:$,icon:S}=p.useContext(fl),k=c||S;let f=v;k&&!f&&(f=jP);const R=u({},n,{active:x,alternativeLabel:h,completed:$,disabled:P,error:l,orientation:C}),T=WP(R),w=(r=m.label)!=null?r:i.label;return g.jsxs(HP,u({className:D(T.root,s),ref:o,ownerState:R},b,{children:[k||f?g.jsx(UP,{className:T.iconContainer,ownerState:R,children:g.jsx(f,u({completed:$,active:x,error:l,icon:k},y))}):null,g.jsxs(GP,{className:T.labelContainer,ownerState:R,children:[a?g.jsx(VP,u({ownerState:R},w,{className:D(T.label,w==null?void 0:w.className),children:a})):null,d]})]}))});KP.muiName="StepLabel";function qP(e){return Y("MuiStepConnector",e)}X("MuiStepConnector",["root","horizontal","vertical","alternativeLabel","active","completed","disabled","line","lineHorizontal","lineVertical"]);const YP=["className"],XP=e=>{const{classes:t,orientation:o,alternativeLabel:r,active:n,completed:a,disabled:s}=e,i={root:["root",o,r&&"alternativeLabel",n&&"active",a&&"completed",s&&"disabled"],line:["line",`line${I(o)}`]};return Z(i,qP,t)},ZP=M("div",{name:"MuiStepConnector",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[o.orientation],o.alternativeLabel&&t.alternativeLabel,o.completed&&t.completed]}})(({ownerState:e})=>u({flex:"1 1 auto"},e.orientation==="vertical"&&{marginLeft:12},e.alternativeLabel&&{position:"absolute",top:12,left:"calc(-50% + 20px)",right:"calc(50% + 20px)"})),JP=M("span",{name:"MuiStepConnector",slot:"Line",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.line,t[`line${I(o.orientation)}`]]}})(({ownerState:e,theme:t})=>{const o=t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600];return u({display:"block",borderColor:t.vars?t.vars.palette.StepConnector.border:o},e.orientation==="horizontal"&&{borderTopStyle:"solid",borderTopWidth:1},e.orientation==="vertical"&&{borderLeftStyle:"solid",borderLeftWidth:1,minHeight:24})}),QP=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiStepConnector"}),{className:n}=r,a=F(r,YP),{alternativeLabel:s,orientation:i="horizontal"}=p.useContext(Ps),{active:l,disabled:c,completed:d}=p.useContext(fl),m=u({},r,{alternativeLabel:s,orientation:i,active:l,completed:d,disabled:c}),v=XP(m);return g.jsx(ZP,u({className:D(v.root,n),ref:o,ownerState:m},a,{children:g.jsx(JP,{className:v.line,ownerState:m})}))});function ek(e){return Y("MuiStepper",e)}X("MuiStepper",["root","horizontal","vertical","nonLinear","alternativeLabel"]);const tk=["activeStep","alternativeLabel","children","className","component","connector","nonLinear","orientation"],ok=e=>{const{orientation:t,nonLinear:o,alternativeLabel:r,classes:n}=e;return Z({root:["root",t,o&&"nonLinear",r&&"alternativeLabel"]},ek,n)},rk=M("div",{name:"MuiStepper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[o.orientation],o.alternativeLabel&&t.alternativeLabel,o.nonLinear&&t.nonLinear]}})(({ownerState:e})=>u({display:"flex"},e.orientation==="horizontal"&&{flexDirection:"row",alignItems:"center"},e.orientation==="vertical"&&{flexDirection:"column"},e.alternativeLabel&&{alignItems:"flex-start"})),nk=g.jsx(QP,{}),J4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiStepper"}),{activeStep:n=0,alternativeLabel:a=!1,children:s,className:i,component:l="div",connector:c=nk,nonLinear:d=!1,orientation:m="horizontal"}=r,v=F(r,tk),y=u({},r,{nonLinear:d,alternativeLabel:a,orientation:m,component:l}),b=ok(y),h=p.Children.toArray(s).filter(Boolean),C=h.map((P,$)=>p.cloneElement(P,u({index:$,last:$+1===h.length},P.props))),x=p.useMemo(()=>({activeStep:n,alternativeLabel:a,connector:c,nonLinear:d,orientation:m}),[n,a,c,d,m]);return g.jsx(Ps.Provider,{value:x,children:g.jsx(rk,u({as:l,ownerState:y,className:D(b.root,i),ref:o},v,{children:C}))})});function ak(e){return Y("MuiSwitch",e)}const Rt=X("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),sk=["className","color","edge","size","sx"],ik=e=>{const{classes:t,edge:o,size:r,color:n,checked:a,disabled:s}=e,i={root:["root",o&&`edge${I(o)}`,`size${I(r)}`],switchBase:["switchBase",`color${I(n)}`,a&&"checked",s&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=Z(i,ak,t);return u({},t,l)},lk=M("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.edge&&t[`edge${I(o.edge)}`],t[`size${I(o.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${Rt.thumb}`]:{width:16,height:16},[`& .${Rt.switchBase}`]:{padding:4,[`&.${Rt.checked}`]:{transform:"translateX(16px)"}}}}]}),ck=M(al,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.switchBase,{[`& .${Rt.input}`]:t.input},o.color!=="default"&&t[`color${I(o.color)}`]]}})(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode==="light"?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${Rt.checked}`]:{transform:"translateX(20px)"},[`&.${Rt.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${Rt.checked} + .${Rt.track}`]:{opacity:.5},[`&.${Rt.disabled} + .${Rt.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode==="light"?.12:.2}`},[`& .${Rt.input}`]:{left:"-100%",width:"300%"}}),({theme:e})=>({"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:we(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(([,t])=>t.main&&t.light).map(([t])=>({props:{color:t},style:{[`&.${Rt.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:we(e.palette[t].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Rt.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode==="light"?Yo(e.palette[t].main,.62):qo(e.palette[t].main,.55)}`}},[`&.${Rt.checked} + .${Rt.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]})),uk=M("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(e,t)=>t.track})(({theme:e})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode==="light"?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode==="light"?.38:.3}`})),dk=M("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),Q4=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiSwitch"}),{className:n,color:a="primary",edge:s=!1,size:i="medium",sx:l}=r,c=F(r,sk),d=u({},r,{color:a,edge:s,size:i}),m=ik(d),v=g.jsx(dk,{className:m.thumb,ownerState:d});return g.jsxs(lk,{className:D(m.root,n),sx:l,ownerState:d,children:[g.jsx(ck,u({type:"checkbox",icon:v,checkedIcon:v,ref:o,ownerState:d},c,{classes:u({},m,{root:m.switchBase})})),g.jsx(uk,{className:m.track,ownerState:d})]})});function pk(e){return Y("MuiTab",e)}const Ho=X("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),fk=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],mk=e=>{const{classes:t,textColor:o,fullWidth:r,wrapped:n,icon:a,label:s,selected:i,disabled:l}=e,c={root:["root",a&&s&&"labelIcon",`textColor${I(o)}`,r&&"fullWidth",n&&"wrapped",i&&"selected",l&&"disabled"],iconWrapper:["iconWrapper"]};return Z(c,pk,t)},gk=M(kt,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.label&&o.icon&&t.labelIcon,t[`textColor${I(o.textColor)}`],o.fullWidth&&t.fullWidth,o.wrapped&&t.wrapped,{[`& .${Ho.iconWrapper}`]:t.iconWrapper}]}})(({theme:e,ownerState:t})=>u({},e.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},t.label&&{flexDirection:t.iconPosition==="top"||t.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},t.icon&&t.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${Ho.iconWrapper}`]:u({},t.iconPosition==="top"&&{marginBottom:6},t.iconPosition==="bottom"&&{marginTop:6},t.iconPosition==="start"&&{marginRight:e.spacing(1)},t.iconPosition==="end"&&{marginLeft:e.spacing(1)})},t.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${Ho.selected}`]:{opacity:1},[`&.${Ho.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.textColor==="primary"&&{color:(e.vars||e).palette.text.secondary,[`&.${Ho.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${Ho.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.textColor==="secondary"&&{color:(e.vars||e).palette.text.secondary,[`&.${Ho.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${Ho.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},t.wrapped&&{fontSize:e.typography.pxToRem(12)})),eM=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiTab"}),{className:n,disabled:a=!1,disableFocusRipple:s=!1,fullWidth:i,icon:l,iconPosition:c="top",indicator:d,label:m,onChange:v,onClick:y,onFocus:b,selected:h,selectionFollowsFocus:C,textColor:x="inherit",value:P,wrapped:$=!1}=r,S=F(r,fk),k=u({},r,{disabled:a,disableFocusRipple:s,selected:h,icon:!!l,iconPosition:c,label:!!m,fullWidth:i,textColor:x,wrapped:$}),f=mk(k),R=l&&m&&p.isValidElement(l)?p.cloneElement(l,{className:D(f.iconWrapper,l.props.className)}):l,T=O=>{!h&&v&&v(O,P),y&&y(O)},w=O=>{C&&!h&&v&&v(O,P),b&&b(O)};return g.jsxs(gk,u({focusRipple:!s,className:D(f.root,n),ref:o,role:"tab","aria-selected":h,disabled:a,onClick:T,onFocus:w,ownerState:k,tabIndex:h?0:-1},S,{children:[c==="top"||c==="start"?g.jsxs(p.Fragment,{children:[R,m]}):g.jsxs(p.Fragment,{children:[m,R]}),d]}))}),Hp=p.createContext();function Vp(e){return Y("MuiTable",e)}const hk=X("MuiTable",["root","stickyHeader"]),vk=["className","component","padding","size","stickyHeader"],bk=e=>{const{classes:t,stickyHeader:o}=e;return Z({root:["root",o&&"stickyHeader"]},Vp,t)},yk=M("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.stickyHeader&&t.stickyHeader]}})(({theme:e,ownerState:t})=>u({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":u({},e.typography.body2,{padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},t.stickyHeader&&{borderCollapse:"separate"})),uu="table",xk=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiTable"}),{className:n,component:a=uu,padding:s="normal",size:i="medium",stickyHeader:l=!1}=r,c=F(r,vk),d=u({},r,{component:a,padding:s,size:i,stickyHeader:l}),m=bk(d),v=p.useMemo(()=>({padding:s,size:i,stickyHeader:l}),[s,i,l]);return g.jsx(Hp.Provider,{value:v,children:g.jsx(yk,u({as:a,role:a===uu?null:"table",ref:o,className:D(m.root,n),ownerState:d},c))})}),tM=Object.freeze(Object.defineProperty({__proto__:null,default:xk,getTableUtilityClass:Vp,tableClasses:hk},Symbol.toStringTag,{value:"Module"})),zn=p.createContext();function Up(e){return Y("MuiTableBody",e)}const Ck=X("MuiTableBody",["root"]),$k=["className","component"],Sk=e=>{const{classes:t}=e;return Z({root:["root"]},Up,t)},Rk=M("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-row-group"}),Pk={variant:"body"},du="tbody",kk=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiTableBody"}),{className:n,component:a=du}=r,s=F(r,$k),i=u({},r,{component:a}),l=Sk(i);return g.jsx(zn.Provider,{value:Pk,children:g.jsx(Rk,u({className:D(l.root,n),as:a,ref:o,role:a===du?null:"rowgroup",ownerState:i},s))})}),oM=Object.freeze(Object.defineProperty({__proto__:null,default:kk,getTableBodyUtilityClass:Up,tableBodyClasses:Ck},Symbol.toStringTag,{value:"Module"}));function Gp(e){return Y("MuiTableCell",e)}const Kp=X("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),Tk=["align","className","component","padding","scope","size","sortDirection","variant"],wk=e=>{const{classes:t,variant:o,align:r,padding:n,size:a,stickyHeader:s}=e,i={root:["root",o,s&&"stickyHeader",r!=="inherit"&&`align${I(r)}`,n!=="normal"&&`padding${I(n)}`,`size${I(a)}`]};return Z(i,Gp,t)},Mk=M("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[o.variant],t[`size${I(o.size)}`],o.padding!=="normal"&&t[`padding${I(o.padding)}`],o.align!=="inherit"&&t[`align${I(o.align)}`],o.stickyHeader&&t.stickyHeader]}})(({theme:e,ownerState:t})=>u({},e.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid + ${e.palette.mode==="light"?Yo(we(e.palette.divider,1),.88):qo(we(e.palette.divider,1),.68)}`,textAlign:"left",padding:16},t.variant==="head"&&{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium},t.variant==="body"&&{color:(e.vars||e).palette.text.primary},t.variant==="footer"&&{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)},t.size==="small"&&{padding:"6px 16px",[`&.${Kp.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},t.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},t.padding==="none"&&{padding:0},t.align==="left"&&{textAlign:"left"},t.align==="center"&&{textAlign:"center"},t.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},t.align==="justify"&&{textAlign:"justify"},t.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default})),wa=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiTableCell"}),{align:n="inherit",className:a,component:s,padding:i,scope:l,size:c,sortDirection:d,variant:m}=r,v=F(r,Tk),y=p.useContext(Hp),b=p.useContext(zn),h=b&&b.variant==="head";let C;s?C=s:C=h?"th":"td";let x=l;C==="td"?x=void 0:!x&&h&&(x="col");const P=m||b&&b.variant,$=u({},r,{align:n,component:C,padding:i||(y&&y.padding?y.padding:"normal"),size:c||(y&&y.size?y.size:"medium"),sortDirection:d,stickyHeader:P==="head"&&y&&y.stickyHeader,variant:P}),S=wk($);let k=null;return d&&(k=d==="asc"?"ascending":"descending"),g.jsx(Mk,u({as:C,ref:o,className:D(S.root,a),"aria-sort":k,scope:x,ownerState:$},v))}),rM=Object.freeze(Object.defineProperty({__proto__:null,default:wa,getTableCellUtilityClass:Gp,tableCellClasses:Kp},Symbol.toStringTag,{value:"Module"}));function Ik(e){return Y("MuiTableContainer",e)}X("MuiTableContainer",["root"]);const Ok=["className","component"],Ek=e=>{const{classes:t}=e;return Z({root:["root"]},Ik,t)},Lk=M("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"}),nM=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiTableContainer"}),{className:n,component:a="div"}=r,s=F(r,Ok),i=u({},r,{component:a}),l=Ek(i);return g.jsx(Lk,u({ref:o,as:a,className:D(l.root,n),ownerState:i},s))});function qp(e){return Y("MuiTableFooter",e)}const Ak=X("MuiTableFooter",["root"]),Bk=["className","component"],_k=e=>{const{classes:t}=e;return Z({root:["root"]},qp,t)},Nk=M("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-footer-group"}),zk={variant:"footer"},pu="tfoot",jk=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiTableFooter"}),{className:n,component:a=pu}=r,s=F(r,Bk),i=u({},r,{component:a}),l=_k(i);return g.jsx(zn.Provider,{value:zk,children:g.jsx(Nk,u({as:a,className:D(l.root,n),ref:o,role:a===pu?null:"rowgroup",ownerState:i},s))})}),aM=Object.freeze(Object.defineProperty({__proto__:null,default:jk,getTableFooterUtilityClass:qp,tableFooterClasses:Ak},Symbol.toStringTag,{value:"Module"}));function Yp(e){return Y("MuiTableHead",e)}const Dk=X("MuiTableHead",["root"]),Fk=["className","component"],Wk=e=>{const{classes:t}=e;return Z({root:["root"]},Yp,t)},Hk=M("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),Vk={variant:"head"},fu="thead",Uk=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiTableHead"}),{className:n,component:a=fu}=r,s=F(r,Fk),i=u({},r,{component:a}),l=Wk(i);return g.jsx(zn.Provider,{value:Vk,children:g.jsx(Hk,u({as:a,className:D(l.root,n),ref:o,role:a===fu?null:"rowgroup",ownerState:i},s))})}),sM=Object.freeze(Object.defineProperty({__proto__:null,default:Uk,getTableHeadUtilityClass:Yp,tableHeadClasses:Dk},Symbol.toStringTag,{value:"Module"}));function Xp(e){return Y("MuiToolbar",e)}const Gk=X("MuiToolbar",["root","gutters","regular","dense"]),Kk=["className","component","disableGutters","variant"],qk=e=>{const{classes:t,disableGutters:o,variant:r}=e;return Z({root:["root",!o&&"gutters",r]},Xp,t)},Yk=M("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,!o.disableGutters&&t.gutters,t[o.variant]]}})(({theme:e,ownerState:t})=>u({position:"relative",display:"flex",alignItems:"center"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},t.variant==="dense"&&{minHeight:48}),({theme:e,ownerState:t})=>t.variant==="regular"&&e.mixins.toolbar),Zp=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiToolbar"}),{className:n,component:a="div",disableGutters:s=!1,variant:i="regular"}=r,l=F(r,Kk),c=u({},r,{component:a,disableGutters:s,variant:i}),d=qk(c);return g.jsx(Yk,u({as:a,className:D(d.root,n),ref:o,ownerState:c},l))}),iM=Object.freeze(Object.defineProperty({__proto__:null,default:Zp,getToolbarUtilityClass:Xp,toolbarClasses:Gk},Symbol.toStringTag,{value:"Module"})),Jp=ue(g.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),Qp=ue(g.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight"),Xk=["backIconButtonProps","count","disabled","getItemAriaLabel","nextIconButtonProps","onPageChange","page","rowsPerPage","showFirstButton","showLastButton","slots","slotProps"],Zk=p.forwardRef(function(t,o){var r,n,a,s,i,l,c,d;const{backIconButtonProps:m,count:v,disabled:y=!1,getItemAriaLabel:b,nextIconButtonProps:h,onPageChange:C,page:x,rowsPerPage:P,showFirstButton:$,showLastButton:S,slots:k={},slotProps:f={}}=t,R=F(t,Xk),T=No(),w=de=>{C(de,0)},O=de=>{C(de,x-1)},j=de=>{C(de,x+1)},L=de=>{C(de,Math.max(0,Math.ceil(v/P)-1))},E=(r=k.firstButton)!=null?r:Go,B=(n=k.lastButton)!=null?n:Go,z=(a=k.nextButton)!=null?a:Go,W=(s=k.previousButton)!=null?s:Go,H=(i=k.firstButtonIcon)!=null?i:di,_=(l=k.lastButtonIcon)!=null?l:pi,G=(c=k.nextButtonIcon)!=null?c:Qp,se=(d=k.previousButtonIcon)!=null?d:Jp,ve=T?B:E,Re=T?z:W,Se=T?W:z,re=T?E:B,pe=T?f.lastButton:f.firstButton,te=T?f.nextButton:f.previousButton,be=T?f.previousButton:f.nextButton,ae=T?f.firstButton:f.lastButton;return g.jsxs("div",u({ref:o},R,{children:[$&&g.jsx(ve,u({onClick:w,disabled:y||x===0,"aria-label":b("first",x),title:b("first",x)},pe,{children:T?g.jsx(_,u({},f.lastButtonIcon)):g.jsx(H,u({},f.firstButtonIcon))})),g.jsx(Re,u({onClick:O,disabled:y||x===0,color:"inherit","aria-label":b("previous",x),title:b("previous",x)},te??m,{children:T?g.jsx(G,u({},f.nextButtonIcon)):g.jsx(se,u({},f.previousButtonIcon))})),g.jsx(Se,u({onClick:j,disabled:y||(v!==-1?x>=Math.ceil(v/P)-1:!1),color:"inherit","aria-label":b("next",x),title:b("next",x)},be??h,{children:T?g.jsx(se,u({},f.previousButtonIcon)):g.jsx(G,u({},f.nextButtonIcon))})),S&&g.jsx(re,u({onClick:L,disabled:y||x>=Math.ceil(v/P)-1,"aria-label":b("last",x),title:b("last",x)},ae,{children:T?g.jsx(H,u({},f.firstButtonIcon)):g.jsx(_,u({},f.lastButtonIcon))}))]}))});function ef(e){return Y("MuiTablePagination",e)}const Ar=X("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var mu;const Jk=["ActionsComponent","backIconButtonProps","className","colSpan","component","count","disabled","getItemAriaLabel","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","onPageChange","onRowsPerPageChange","page","rowsPerPage","rowsPerPageOptions","SelectProps","showFirstButton","showLastButton","slotProps","slots"],Qk=M(wa,{name:"MuiTablePagination",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}})),eT=M(Zp,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>u({[`& .${Ar.actions}`]:t.actions},t.toolbar)})(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${Ar.actions}`]:{flexShrink:0,marginLeft:20}})),tT=M("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})({flex:"1 1 100%"}),oT=M("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(e,t)=>t.selectLabel})(({theme:e})=>u({},e.typography.body2,{flexShrink:0})),rT=M(Rs,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>u({[`& .${Ar.selectIcon}`]:t.selectIcon,[`& .${Ar.select}`]:t.select},t.input,t.selectRoot)})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${Ar.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),nT=M(Ap,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(e,t)=>t.menuItem})({}),aT=M("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(e,t)=>t.displayedRows})(({theme:e})=>u({},e.typography.body2,{flexShrink:0}));function sT({from:e,to:t,count:o}){return`${e}–${t} of ${o!==-1?o:`more than ${t}`}`}function iT(e){return`Go to ${e} page`}const lT=e=>{const{classes:t}=e;return Z({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},ef,t)},cT=p.forwardRef(function(t,o){var r;const n=oe({props:t,name:"MuiTablePagination"}),{ActionsComponent:a=Zk,backIconButtonProps:s,className:i,colSpan:l,component:c=wa,count:d,disabled:m=!1,getItemAriaLabel:v=iT,labelDisplayedRows:y=sT,labelRowsPerPage:b="Rows per page:",nextIconButtonProps:h,onPageChange:C,onRowsPerPageChange:x,page:P,rowsPerPage:$,rowsPerPageOptions:S=[10,25,50,100],SelectProps:k={},showFirstButton:f=!1,showLastButton:R=!1,slotProps:T={},slots:w={}}=n,O=F(n,Jk),j=n,L=lT(j),E=(r=T==null?void 0:T.select)!=null?r:k,B=E.native?"option":nT;let z;(c===wa||c==="td")&&(z=l||1e3);const W=$o(E.id),H=$o(E.labelId),_=()=>d===-1?(P+1)*$:$===-1?d:Math.min(d,(P+1)*$);return g.jsx(Qk,u({colSpan:z,ref:o,as:c,ownerState:j,className:D(L.root,i)},O,{children:g.jsxs(eT,{className:L.toolbar,children:[g.jsx(tT,{className:L.spacer}),S.length>1&&g.jsx(oT,{className:L.selectLabel,id:H,children:b}),S.length>1&&g.jsx(rT,u({variant:"standard"},!E.variant&&{input:mu||(mu=g.jsx(Nn,{}))},{value:$,onChange:x,id:W,labelId:H},E,{classes:u({},E.classes,{root:D(L.input,L.selectRoot,(E.classes||{}).root),select:D(L.select,(E.classes||{}).select),icon:D(L.selectIcon,(E.classes||{}).icon)}),disabled:m,children:S.map(G=>p.createElement(B,u({},!co(B)&&{ownerState:j},{className:L.menuItem,key:G.label?G.label:G,value:G.value?G.value:G}),G.label?G.label:G))})),g.jsx(aT,{className:L.displayedRows,children:y({from:d===0?0:P*$+1,to:_(),count:d===-1?-1:d,page:P})}),g.jsx(a,{className:L.actions,backIconButtonProps:s,count:d,nextIconButtonProps:h,onPageChange:C,page:P,rowsPerPage:$,showFirstButton:f,showLastButton:R,slotProps:T.actions,slots:w.actions,getItemAriaLabel:v,disabled:m})]})}))}),lM=Object.freeze(Object.defineProperty({__proto__:null,default:cT,getTablePaginationUtilityClass:ef,tablePaginationClasses:Ar},Symbol.toStringTag,{value:"Module"}));function tf(e){return Y("MuiTableRow",e)}const fi=X("MuiTableRow",["root","selected","hover","head","footer"]),uT=["className","component","hover","selected"],dT=e=>{const{classes:t,selected:o,hover:r,head:n,footer:a}=e;return Z({root:["root",o&&"selected",r&&"hover",n&&"head",a&&"footer"]},tf,t)},pT=M("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.head&&t.head,o.footer&&t.footer]}})(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${fi.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${fi.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:we(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:we(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)}}})),gu="tr",fT=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiTableRow"}),{className:n,component:a=gu,hover:s=!1,selected:i=!1}=r,l=F(r,uT),c=p.useContext(zn),d=u({},r,{component:a,hover:s,selected:i,head:c&&c.variant==="head",footer:c&&c.variant==="footer"}),m=dT(d);return g.jsx(pT,u({as:a,ref:o,className:D(m.root,n),role:a===gu?null:"row",ownerState:d},l))}),cM=Object.freeze(Object.defineProperty({__proto__:null,default:fT,getTableRowUtilityClass:tf,tableRowClasses:fi},Symbol.toStringTag,{value:"Module"})),mT=ue(g.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");function of(e){return Y("MuiTableSortLabel",e)}const pa=X("MuiTableSortLabel",["root","active","icon","iconDirectionDesc","iconDirectionAsc"]),gT=["active","children","className","direction","hideSortIcon","IconComponent"],hT=e=>{const{classes:t,direction:o,active:r}=e,n={root:["root",r&&"active"],icon:["icon",`iconDirection${I(o)}`]};return Z(n,of,t)},vT=M(kt,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.active&&t.active]}})(({theme:e})=>({cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:(e.vars||e).palette.text.secondary},"&:hover":{color:(e.vars||e).palette.text.secondary,[`& .${pa.icon}`]:{opacity:.5}},[`&.${pa.active}`]:{color:(e.vars||e).palette.text.primary,[`& .${pa.icon}`]:{opacity:1,color:(e.vars||e).palette.text.secondary}}})),bT=M("span",{name:"MuiTableSortLabel",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.icon,t[`iconDirection${I(o.direction)}`]]}})(({theme:e,ownerState:t})=>u({fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:e.transitions.create(["opacity","transform"],{duration:e.transitions.duration.shorter}),userSelect:"none"},t.direction==="desc"&&{transform:"rotate(0deg)"},t.direction==="asc"&&{transform:"rotate(180deg)"})),yT=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiTableSortLabel"}),{active:n=!1,children:a,className:s,direction:i="asc",hideSortIcon:l=!1,IconComponent:c=mT}=r,d=F(r,gT),m=u({},r,{active:n,direction:i,hideSortIcon:l,IconComponent:c}),v=hT(m);return g.jsxs(vT,u({className:D(v.root,s),component:"span",disableRipple:!0,ownerState:m,ref:o},d,{children:[a,l&&!n?null:g.jsx(bT,{as:c,className:D(v.icon),ownerState:m})]}))}),uM=Object.freeze(Object.defineProperty({__proto__:null,default:yT,getTableSortLabelUtilityClass:of,tableSortLabelClasses:pa},Symbol.toStringTag,{value:"Module"}));function xT(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function CT(e,t,o,r={},n=()=>{}){const{ease:a=xT,duration:s=300}=r;let i=null;const l=t[e];let c=!1;const d=()=>{c=!0},m=v=>{if(c){n(new Error("Animation cancelled"));return}i===null&&(i=v);const y=Math.min(1,(v-i)/s);if(t[e]=a(y)*(o-l)+l,y>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(m)};return l===o?(n(new Error("Element already at target position")),d):(requestAnimationFrame(m),d)}const $T=["onChange"],ST={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function RT(e){const{onChange:t}=e,o=F(e,$T),r=p.useRef(),n=p.useRef(null),a=()=>{r.current=n.current.offsetHeight-n.current.clientHeight};return xt(()=>{const s=Gr(()=>{const l=r.current;a(),l!==r.current&&t(r.current)}),i=Zt(n.current);return i.addEventListener("resize",s),()=>{s.clear(),i.removeEventListener("resize",s)}},[t]),p.useEffect(()=>{a(),t(r.current)},[t]),g.jsx("div",u({style:ST},o,{ref:n}))}function PT(e){return Y("MuiTabScrollButton",e)}const kT=X("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),TT=["className","slots","slotProps","direction","orientation","disabled"],wT=e=>{const{classes:t,orientation:o,disabled:r}=e;return Z({root:["root",o,r&&"disabled"]},PT,t)},MT=M(kt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.orientation&&t[o.orientation]]}})(({ownerState:e})=>u({width:40,flexShrink:0,opacity:.8,[`&.${kT.disabled}`]:{opacity:0}},e.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${e.isRtl?-90:90}deg)`}})),IT=p.forwardRef(function(t,o){var r,n;const a=oe({props:t,name:"MuiTabScrollButton"}),{className:s,slots:i={},slotProps:l={},direction:c}=a,d=F(a,TT),m=No(),v=u({isRtl:m},a),y=wT(v),b=(r=i.StartScrollButtonIcon)!=null?r:Jp,h=(n=i.EndScrollButtonIcon)!=null?n:Qp,C=lt({elementType:b,externalSlotProps:l.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:v}),x=lt({elementType:h,externalSlotProps:l.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:v});return g.jsx(MT,u({component:"div",className:D(y.root,s),ref:o,role:null,ownerState:v,tabIndex:null},d,{children:c==="left"?g.jsx(b,u({},C)):g.jsx(h,u({},x))}))});function OT(e){return Y("MuiTabs",e)}const Gs=X("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),ET=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],hu=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,vu=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,ra=(e,t,o)=>{let r=!1,n=o(e,t);for(;n;){if(n===e.firstChild){if(r)return;r=!0}const a=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||a)n=o(e,n);else{n.focus();return}}},LT=e=>{const{vertical:t,fixed:o,hideScrollbar:r,scrollableX:n,scrollableY:a,centered:s,scrollButtonsHideMobile:i,classes:l}=e;return Z({root:["root",t&&"vertical"],scroller:["scroller",o&&"fixed",r&&"hideScrollbar",n&&"scrollableX",a&&"scrollableY"],flexContainer:["flexContainer",t&&"flexContainerVertical",s&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",i&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},OT,l)},AT=M("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{[`& .${Gs.scrollButtons}`]:t.scrollButtons},{[`& .${Gs.scrollButtons}`]:o.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,o.vertical&&t.vertical]}})(({ownerState:e,theme:t})=>u({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},e.vertical&&{flexDirection:"column"},e.scrollButtonsHideMobile&&{[`& .${Gs.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}})),BT=M("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.scroller,o.fixed&&t.fixed,o.hideScrollbar&&t.hideScrollbar,o.scrollableX&&t.scrollableX,o.scrollableY&&t.scrollableY]}})(({ownerState:e})=>u({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},e.fixed&&{overflowX:"hidden",width:"100%"},e.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},e.scrollableX&&{overflowX:"auto",overflowY:"hidden"},e.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),_T=M("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.flexContainer,o.vertical&&t.flexContainerVertical,o.centered&&t.centered]}})(({ownerState:e})=>u({display:"flex"},e.vertical&&{flexDirection:"column"},e.centered&&{justifyContent:"center"})),NT=M("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})(({ownerState:e,theme:t})=>u({position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create()},e.indicatorColor==="primary"&&{backgroundColor:(t.vars||t).palette.primary.main},e.indicatorColor==="secondary"&&{backgroundColor:(t.vars||t).palette.secondary.main},e.vertical&&{height:"100%",width:2,right:0})),zT=M(RT)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),bu={},dM=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiTabs"}),n=ro(),a=No(),{"aria-label":s,"aria-labelledby":i,action:l,centered:c=!1,children:d,className:m,component:v="div",allowScrollButtonsMobile:y=!1,indicatorColor:b="primary",onChange:h,orientation:C="horizontal",ScrollButtonComponent:x=IT,scrollButtons:P="auto",selectionFollowsFocus:$,slots:S={},slotProps:k={},TabIndicatorProps:f={},TabScrollButtonProps:R={},textColor:T="primary",value:w,variant:O="standard",visibleScrollbar:j=!1}=r,L=F(r,ET),E=O==="scrollable",B=C==="vertical",z=B?"scrollTop":"scrollLeft",W=B?"top":"left",H=B?"bottom":"right",_=B?"clientHeight":"clientWidth",G=B?"height":"width",se=u({},r,{component:v,allowScrollButtonsMobile:y,indicatorColor:b,orientation:C,vertical:B,scrollButtons:P,textColor:T,variant:O,visibleScrollbar:j,fixed:!E,hideScrollbar:E&&!j,scrollableX:E&&!B,scrollableY:E&&B,centered:c&&!E,scrollButtonsHideMobile:!y}),ve=LT(se),Re=lt({elementType:S.StartScrollButtonIcon,externalSlotProps:k.startScrollButtonIcon,ownerState:se}),Se=lt({elementType:S.EndScrollButtonIcon,externalSlotProps:k.endScrollButtonIcon,ownerState:se}),[re,pe]=p.useState(!1),[te,be]=p.useState(bu),[ae,de]=p.useState(!1),[Ee,fe]=p.useState(!1),[xe,he]=p.useState(!1),[me,le]=p.useState({overflow:"hidden",scrollbarWidth:0}),ce=new Map,Ae=p.useRef(null),ie=p.useRef(null),ze=()=>{const q=Ae.current;let ee;if(q){const Be=q.getBoundingClientRect();ee={clientWidth:q.clientWidth,scrollLeft:q.scrollLeft,scrollTop:q.scrollTop,scrollLeftNormalized:Th(q,a?"rtl":"ltr"),scrollWidth:q.scrollWidth,top:Be.top,bottom:Be.bottom,left:Be.left,right:Be.right}}let ke;if(q&&w!==!1){const Be=ie.current.children;if(Be.length>0){const Ne=Be[ce.get(w)];ke=Ne?Ne.getBoundingClientRect():null}}return{tabsMeta:ee,tabMeta:ke}},Pe=at(()=>{const{tabsMeta:q,tabMeta:ee}=ze();let ke=0,Be;if(B)Be="top",ee&&q&&(ke=ee.top-q.top+q.scrollTop);else if(Be=a?"right":"left",ee&&q){const Ge=a?q.scrollLeftNormalized+q.clientWidth-q.scrollWidth:q.scrollLeft;ke=(a?-1:1)*(ee[Be]-q[Be]+Ge)}const Ne={[Be]:ke,[G]:ee?ee[G]:0};if(isNaN(te[Be])||isNaN(te[G]))be(Ne);else{const Ge=Math.abs(te[Be]-Ne[Be]),Qe=Math.abs(te[G]-Ne[G]);(Ge>=1||Qe>=1)&&be(Ne)}}),Oe=(q,{animation:ee=!0}={})=>{ee?CT(z,Ae.current,q,{duration:n.transitions.duration.standard}):Ae.current[z]=q},je=q=>{let ee=Ae.current[z];B?ee+=q:(ee+=q*(a?-1:1),ee*=a&&ld()==="reverse"?-1:1),Oe(ee)},Ie=()=>{const q=Ae.current[_];let ee=0;const ke=Array.from(ie.current.children);for(let Be=0;Beq){Be===0&&(ee=q);break}ee+=Ne[_]}return ee},Le=()=>{je(-1*Ie())},Ke=()=>{je(Ie())},qe=p.useCallback(q=>{le({overflow:null,scrollbarWidth:q})},[]),We=()=>{const q={};q.scrollbarSizeListener=E?g.jsx(zT,{onChange:qe,className:D(ve.scrollableX,ve.hideScrollbar)}):null;const ke=E&&(P==="auto"&&(ae||Ee)||P===!0);return q.scrollButtonStart=ke?g.jsx(x,u({slots:{StartScrollButtonIcon:S.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Re},orientation:C,direction:a?"right":"left",onClick:Le,disabled:!ae},R,{className:D(ve.scrollButtons,R.className)})):null,q.scrollButtonEnd=ke?g.jsx(x,u({slots:{EndScrollButtonIcon:S.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Se},orientation:C,direction:a?"left":"right",onClick:Ke,disabled:!Ee},R,{className:D(ve.scrollButtons,R.className)})):null,q},U=at(q=>{const{tabsMeta:ee,tabMeta:ke}=ze();if(!(!ke||!ee)){if(ke[W]ee[H]){const Be=ee[z]+(ke[H]-ee[H]);Oe(Be,{animation:q})}}}),N=at(()=>{E&&P!==!1&&he(!xe)});p.useEffect(()=>{const q=Gr(()=>{Ae.current&&Pe()});let ee;const ke=Ge=>{Ge.forEach(Qe=>{Qe.removedNodes.forEach(mt=>{var nt;(nt=ee)==null||nt.unobserve(mt)}),Qe.addedNodes.forEach(mt=>{var nt;(nt=ee)==null||nt.observe(mt)})}),q(),N()},Be=Zt(Ae.current);Be.addEventListener("resize",q);let Ne;return typeof ResizeObserver<"u"&&(ee=new ResizeObserver(q),Array.from(ie.current.children).forEach(Ge=>{ee.observe(Ge)})),typeof MutationObserver<"u"&&(Ne=new MutationObserver(ke),Ne.observe(ie.current,{childList:!0})),()=>{var Ge,Qe;q.clear(),Be.removeEventListener("resize",q),(Ge=Ne)==null||Ge.disconnect(),(Qe=ee)==null||Qe.disconnect()}},[Pe,N]),p.useEffect(()=>{const q=Array.from(ie.current.children),ee=q.length;if(typeof IntersectionObserver<"u"&&ee>0&&E&&P!==!1){const ke=q[0],Be=q[ee-1],Ne={root:Ae.current,threshold:.99},Ge=Tt=>{de(!Tt[0].isIntersecting)},Qe=new IntersectionObserver(Ge,Ne);Qe.observe(ke);const mt=Tt=>{fe(!Tt[0].isIntersecting)},nt=new IntersectionObserver(mt,Ne);return nt.observe(Be),()=>{Qe.disconnect(),nt.disconnect()}}},[E,P,xe,d==null?void 0:d.length]),p.useEffect(()=>{pe(!0)},[]),p.useEffect(()=>{Pe()}),p.useEffect(()=>{U(bu!==te)},[U,te]),p.useImperativeHandle(l,()=>({updateIndicator:Pe,updateScrollButtons:N}),[Pe,N]);const Q=g.jsx(NT,u({},f,{className:D(ve.indicator,f.className),ownerState:se,style:u({},te,f.style)}));let $e=0;const Te=p.Children.map(d,q=>{if(!p.isValidElement(q))return null;const ee=q.props.value===void 0?$e:q.props.value;ce.set(ee,$e);const ke=ee===w;return $e+=1,p.cloneElement(q,u({fullWidth:O==="fullWidth",indicator:ke&&!re&&Q,selected:ke,selectionFollowsFocus:$,onChange:h,textColor:T,value:ee},$e===1&&w===!1&&!q.props.tabIndex?{tabIndex:0}:{}))}),J=q=>{const ee=ie.current,ke=rt(ee).activeElement;if(ke.getAttribute("role")!=="tab")return;let Ne=C==="horizontal"?"ArrowLeft":"ArrowUp",Ge=C==="horizontal"?"ArrowRight":"ArrowDown";switch(C==="horizontal"&&a&&(Ne="ArrowRight",Ge="ArrowLeft"),q.key){case Ne:q.preventDefault(),ra(ee,ke,vu);break;case Ge:q.preventDefault(),ra(ee,ke,hu);break;case"Home":q.preventDefault(),ra(ee,null,hu);break;case"End":q.preventDefault(),ra(ee,null,vu);break}},ge=We();return g.jsxs(AT,u({className:D(ve.root,m),ownerState:se,ref:o,as:v},L,{children:[ge.scrollButtonStart,ge.scrollbarSizeListener,g.jsxs(BT,{className:ve.scroller,ownerState:se,style:{overflow:me.overflow,[B?`margin${a?"Left":"Right"}`:"marginBottom"]:j?void 0:-me.scrollbarWidth},ref:Ae,children:[g.jsx(_T,{"aria-label":s,"aria-labelledby":i,"aria-orientation":C==="vertical"?"vertical":null,className:ve.flexContainer,ownerState:se,onKeyDown:J,ref:ie,role:"tablist",children:Te}),re&&Q]}),ge.scrollButtonEnd]}))});function rf(e){return Y("MuiTextField",e)}const jT=X("MuiTextField",["root"]),DT=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],FT={standard:Ss,filled:il,outlined:dl},WT=e=>{const{classes:t}=e;return Z({root:["root"]},rf,t)},HT=M(yp,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),VT=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiTextField"}),{autoComplete:n,autoFocus:a=!1,children:s,className:i,color:l="primary",defaultValue:c,disabled:d=!1,error:m=!1,FormHelperTextProps:v,fullWidth:y=!1,helperText:b,id:h,InputLabelProps:C,inputProps:x,InputProps:P,inputRef:$,label:S,maxRows:k,minRows:f,multiline:R=!1,name:T,onBlur:w,onChange:O,onFocus:j,placeholder:L,required:E=!1,rows:B,select:z=!1,SelectProps:W,type:H,value:_,variant:G="outlined"}=r,se=F(r,DT),ve=u({},r,{autoFocus:a,color:l,disabled:d,error:m,fullWidth:y,multiline:R,required:E,select:z,variant:G}),Re=WT(ve),Se={};G==="outlined"&&(C&&typeof C.shrink<"u"&&(Se.notched=C.shrink),Se.label=S),z&&((!W||!W.native)&&(Se.id=void 0),Se["aria-describedby"]=void 0);const re=$o(h),pe=b&&re?`${re}-helper-text`:void 0,te=S&&re?`${re}-label`:void 0,be=FT[G],ae=g.jsx(be,u({"aria-describedby":pe,autoComplete:n,autoFocus:a,defaultValue:c,fullWidth:y,multiline:R,name:T,rows:B,maxRows:k,minRows:f,type:H,value:_,id:re,inputRef:$,onBlur:w,onChange:O,onFocus:j,placeholder:L,inputProps:x},Se,P));return g.jsxs(HT,u({className:D(Re.root,i),disabled:d,error:m,fullWidth:y,ref:o,required:E,color:l,variant:G,ownerState:ve},se,{children:[S!=null&&S!==""&&g.jsx(kp,u({htmlFor:re,id:te},C,{children:S})),z?g.jsx(Rs,u({"aria-describedby":pe,id:re,labelId:te,value:_,input:ae},W,{children:s})):ae,b&&g.jsx(X$,u({id:pe},v,{children:b}))]}))}),pM=Object.freeze(Object.defineProperty({__proto__:null,default:VT,getTextFieldUtilityClass:rf,textFieldClasses:jT},Symbol.toStringTag,{value:"Module"}));function UT(e){return Y("MuiToggleButton",e)}const Ir=X("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),nf=p.createContext({}),af=p.createContext(void 0);function GT(e,t){return t===void 0||e===void 0?!1:Array.isArray(t)?t.indexOf(e)>=0:e===t}const KT=["value"],qT=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],YT=e=>{const{classes:t,fullWidth:o,selected:r,disabled:n,size:a,color:s}=e,i={root:["root",r&&"selected",n&&"disabled",o&&"fullWidth",`size${I(a)}`,s]};return Z(i,UT,t)},XT=M(kt,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[`size${I(o.size)}`]]}})(({theme:e,ownerState:t})=>{let o=t.color==="standard"?e.palette.text.primary:e.palette[t.color].main,r;return e.vars&&(o=t.color==="standard"?e.vars.palette.text.primary:e.vars.palette[t.color].main,r=t.color==="standard"?e.vars.palette.text.primaryChannel:e.vars.palette[t.color].mainChannel),u({},e.typography.button,{borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active},t.fullWidth&&{width:"100%"},{[`&.${Ir.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:nn(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Ir.selected}`]:{color:o,backgroundColor:e.vars?`rgba(${r} / ${e.vars.palette.action.selectedOpacity})`:nn(o,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${r} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:nn(o,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${r} / ${e.vars.palette.action.selectedOpacity})`:nn(o,e.palette.action.selectedOpacity)}}}},t.size==="small"&&{padding:7,fontSize:e.typography.pxToRem(13)},t.size==="large"&&{padding:15,fontSize:e.typography.pxToRem(15)})}),fM=p.forwardRef(function(t,o){const r=p.useContext(nf),{value:n}=r,a=F(r,KT),s=p.useContext(af),i=_r(u({},a,{selected:GT(t.value,n)}),t),l=oe({props:i,name:"MuiToggleButton"}),{children:c,className:d,color:m="standard",disabled:v=!1,disableFocusRipple:y=!1,fullWidth:b=!1,onChange:h,onClick:C,selected:x,size:P="medium",value:$}=l,S=F(l,qT),k=u({},l,{color:m,disabled:v,disableFocusRipple:y,fullWidth:b,size:P}),f=YT(k),R=w=>{C&&(C(w,$),w.defaultPrevented)||h&&h(w,$)},T=s||"";return g.jsx(XT,u({className:D(a.className,f.root,d,T),disabled:v,focusRipple:!y,ref:o,onClick:R,onChange:h,value:$,ownerState:k,"aria-pressed":x},S,{children:c}))});function ZT(e){return Y("MuiToggleButtonGroup",e)}const ot=X("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),JT=["children","className","color","disabled","exclusive","fullWidth","onChange","orientation","size","value"],QT=e=>{const{classes:t,orientation:o,fullWidth:r,disabled:n}=e,a={root:["root",o==="vertical"&&"vertical",r&&"fullWidth"],grouped:["grouped",`grouped${I(o)}`,n&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return Z(a,ZT,t)},ew=M("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{[`& .${ot.grouped}`]:t.grouped},{[`& .${ot.grouped}`]:t[`grouped${I(o.orientation)}`]},{[`& .${ot.firstButton}`]:t.firstButton},{[`& .${ot.lastButton}`]:t.lastButton},{[`& .${ot.middleButton}`]:t.middleButton},t.root,o.orientation==="vertical"&&t.vertical,o.fullWidth&&t.fullWidth]}})(({ownerState:e,theme:t})=>u({display:"inline-flex",borderRadius:(t.vars||t).shape.borderRadius},e.orientation==="vertical"&&{flexDirection:"column"},e.fullWidth&&{width:"100%"},{[`& .${ot.grouped}`]:u({},e.orientation==="horizontal"?{[`&.${ot.selected} + .${ot.grouped}.${ot.selected}`]:{borderLeft:0,marginLeft:0}}:{[`&.${ot.selected} + .${ot.grouped}.${ot.selected}`]:{borderTop:0,marginTop:0}})},e.orientation==="horizontal"?{[`& .${ot.firstButton},& .${ot.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${ot.lastButton},& .${ot.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0}}:{[`& .${ot.firstButton},& .${ot.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${ot.lastButton},& .${ot.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0}},e.orientation==="horizontal"?{[`& .${ot.lastButton}.${Ir.disabled},& .${ot.middleButton}.${Ir.disabled}`]:{borderLeft:"1px solid transparent"}}:{[`& .${ot.lastButton}.${Ir.disabled},& .${ot.middleButton}.${Ir.disabled}`]:{borderTop:"1px solid transparent"}})),mM=p.forwardRef(function(t,o){const r=oe({props:t,name:"MuiToggleButtonGroup"}),{children:n,className:a,color:s="standard",disabled:i=!1,exclusive:l=!1,fullWidth:c=!1,onChange:d,orientation:m="horizontal",size:v="medium",value:y}=r,b=F(r,JT),h=u({},r,{disabled:i,fullWidth:c,orientation:m,size:v}),C=QT(h),x=p.useCallback((R,T)=>{if(!d)return;const w=y&&y.indexOf(T);let O;y&&w>=0?(O=y.slice(),O.splice(w,1)):O=y?y.concat(T):[T],d(R,O)},[d,y]),P=p.useCallback((R,T)=>{d&&d(R,y===T?null:T)},[d,y]),$=p.useMemo(()=>({className:C.grouped,onChange:l?P:x,value:y,size:v,fullWidth:c,color:s,disabled:i}),[C.grouped,l,P,x,y,v,c,s,i]),S=cd(n),k=S.length,f=R=>{const T=R===0,w=R===k-1;return T&&w?"":T?C.firstButton:w?C.lastButton:C.middleButton};return g.jsx(ew,u({role:"group",className:D(C.root,a),ref:o,ownerState:h},b,{children:g.jsx(nf.Provider,{value:$,children:S.map((R,T)=>g.jsx(af.Provider,{value:f(T),children:R},T))})}))}),gM=ue(g.jsx("path",{d:"M4 10h3v7H4zm6.5 0h3v7h-3zM2 19h20v3H2zm15-9h3v7h-3zm-5-9L2 6v2h20V6z"}),"AccountBalance"),hM=ue(g.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox"),vM=ue(g.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline"),bM=ue(g.jsx("path",{d:"m20.54 5.23-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27M12 17.5 6.5 12H10v-2h4v2h3.5zM5.12 5l.81-1h12l.94 1z"}),"Archive"),yM=ue(g.jsx("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),xM=ue(g.jsx("path",{d:"M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m4 12h-4v3l-5-5 5-5v3h4z"}),"AssignmentReturn"),CM=ue(g.jsx("path",{d:"M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m-2 14-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z"}),"AssignmentTurnedIn"),$M=ue(g.jsx("path",{d:"M6 13c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m0 4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m0-8c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m-3 .5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5M6 5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m15 5.5c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5M14 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1m0-3.5c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5m-11 10c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5m7 7c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5m0-17c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5M10 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1m0 5.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m8 .5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m0 4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m0-8c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m0-4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m3 8.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5M14 17c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m0 3.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5m-4-12c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m0 8.5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1m4-4.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m0-4c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5"}),"BlurOn"),SM=ue(g.jsx("path",{d:"M12 7V3H2v18h20V7zM6 19H4v-2h2zm0-4H4v-2h2zm0-4H4V9h2zm0-4H4V5h2zm4 12H8v-2h2zm0-4H8v-2h2zm0-4H8V9h2zm0-4H8V5h2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8zm-2-8h-2v2h2zm0 4h-2v2h2z"}),"Business"),RM=ue(g.jsx("path",{d:"M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 16H5V10h14zm0-12H5V6h14zM9 14H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-8 4H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2z"}),"CalendarMonthOutlined"),PM=ue(g.jsx("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday"),kM=ue(g.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),TM=ue(g.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline"),wM=ue(g.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),MM=ue(g.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),IM=ue(g.jsx("path",{d:"M12 7V3H2v18h20V7zm-2 12H4v-2h6zm0-4H4v-2h6zm0-4H4V9h6zm0-4H4V5h6zm10 12h-8V9h8zm-2-8h-4v2h4zm0 4h-4v2h4z"}),"CorporateFare"),OM=ue(g.jsx("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m0 14H4v-6h16zm0-10H4V6h16z"}),"CreditCard"),EM=ue(g.jsx("path",{d:"M18.92 6.01C18.72 5.42 18.16 5 17.5 5h-11c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8zM6.5 16c-.83 0-1.5-.67-1.5-1.5S5.67 13 6.5 13s1.5.67 1.5 1.5S7.33 16 6.5 16m11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M5 11l1.5-4.5h11L19 11z"}),"DirectionsCar"),LM=ue(g.jsx("path",{d:"M18.92 6.01C18.72 5.42 18.16 5 17.5 5h-11c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8zM7.5 16c-.83 0-1.5-.67-1.5-1.5S6.67 13 7.5 13s1.5.67 1.5 1.5S8.33 16 7.5 16m9 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M5.81 10l1.04-3h10.29l1.04 3z"}),"DirectionsCarFilled"),AM=ue(g.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done"),BM=ue(g.jsx("path",{d:"M18.92 5.01C18.72 4.42 18.16 4 17.5 4h-11c-.66 0-1.21.42-1.42 1.01L3 11v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8zM6.5 15c-.83 0-1.5-.67-1.5-1.5S5.67 12 6.5 12s1.5.67 1.5 1.5S7.33 15 6.5 15m11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M5 10l1.5-4.5h11L19 10z"}),"DriveEta"),_M=ue(g.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),NM=ue(g.jsx("path",{d:"M12 3C8.5 3 5 9.33 5 14c0 3.87 3.13 7 7 7s7-3.13 7-7c0-4.67-3.5-11-7-11m1 15c-3 0-5-1.99-5-5 0-.55.45-1 1-1s1 .45 1 1c0 2.92 2.42 3 3 3 .55 0 1 .45 1 1s-.45 1-1 1"}),"Egg"),zM=ue(g.jsx("path",{d:"M9 15c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4m13.1-8.16c.01-.11.02-.22.02-.34 0-.12-.01-.23-.03-.34l.74-.58c.07-.05.08-.15.04-.22l-.7-1.21c-.04-.08-.14-.1-.21-.08l-.86.35c-.18-.14-.38-.25-.59-.34l-.13-.93c-.02-.09-.09-.15-.18-.15h-1.4c-.09 0-.16.06-.17.15l-.13.93c-.21.09-.41.21-.59.34l-.87-.35c-.08-.03-.17 0-.21.08l-.7 1.21c-.04.08-.03.17.04.22l.74.58c-.02.11-.03.23-.03.34 0 .11.01.23.03.34l-.74.58c-.07.05-.08.15-.04.22l.7 1.21c.04.08.14.1.21.08l.87-.35c.18.14.38.25.59.34l.13.93c.01.09.08.15.17.15h1.4c.09 0 .16-.06.17-.15l.13-.93c.21-.09.41-.21.59-.34l.87.35c.08.03.17 0 .21-.08l.7-1.21c.04-.08.03-.17-.04-.22zm-2.6.91c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25m.42 3.93-.5-.87c-.03-.06-.1-.08-.15-.06l-.62.25c-.13-.1-.27-.18-.42-.24l-.09-.66c-.02-.06-.08-.1-.14-.1h-1c-.06 0-.11.04-.12.11l-.09.66c-.15.06-.29.15-.42.24l-.62-.25c-.06-.02-.12 0-.15.06l-.5.87c-.03.06-.02.12.03.16l.53.41c-.01.08-.02.16-.02.24 0 .08.01.17.02.24l-.53.41c-.05.04-.06.11-.03.16l.5.87c.03.06.1.08.15.06l.62-.25c.13.1.27.18.42.24l.09.66c.01.07.06.11.12.11h1c.06 0 .12-.04.12-.11l.09-.66c.15-.06.29-.15.42-.24l.62.25c.06.02.12 0 .15-.06l.5-.87c.03-.06.02-.12-.03-.16l-.52-.41c.01-.08.02-.16.02-.24 0-.08-.01-.17-.02-.24l.53-.41c.05-.04.06-.11.04-.17m-2.42 1.65c-.46 0-.83-.38-.83-.83 0-.46.38-.83.83-.83s.83.38.83.83c0 .46-.37.83-.83.83M4.74 9h8.53c.27 0 .49-.22.49-.49v-.02c0-.27-.22-.49-.49-.49H13c0-1.48-.81-2.75-2-3.45v.95c0 .28-.22.5-.5.5s-.5-.22-.5-.5V4.14C9.68 4.06 9.35 4 9 4s-.68.06-1 .14V5.5c0 .28-.22.5-.5.5S7 5.78 7 5.5v-.95C5.81 5.25 5 6.52 5 8h-.26c-.27 0-.49.22-.49.49v.03c0 .26.22.48.49.48M9 13c1.86 0 3.41-1.28 3.86-3H5.14c.45 1.72 2 3 3.86 3"}),"Engineering"),jM=ue(g.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2zm-1 7h5.5L14 6.5z"}),"FileCopy"),DM=ue(g.jsx("path",{d:"M20.57 14.86 22 13.43 20.57 12 17 15.57 8.43 7 12 3.43 10.57 2 9.14 3.43 7.71 2 5.57 4.14 4.14 2.71 2.71 4.14l1.43 1.43L2 7.71l1.43 1.43L2 10.57 3.43 12 7 8.43 15.57 17 12 20.57 13.43 22l1.43-1.43L16.29 22l2.14-2.14 1.43 1.43 1.43-1.43-1.43-1.43L22 16.29z"}),"FitnessCenter"),FM=ue(g.jsx("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"Folder"),WM=ue(g.jsx("path",{d:"M10 12c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M6 8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12-8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m-4 8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m4-4c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-4-4c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-4-4c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"Grain"),HM=ue(g.jsx("path",{d:"M12 20H2v-2h5.75c-.73-2.81-2.94-5.01-5.75-5.74.64-.16 1.31-.26 2-.26 4.42 0 8 3.58 8 8m10-7.74c-.64-.16-1.31-.26-2-.26-2.93 0-5.48 1.58-6.88 3.93.29.66.53 1.35.67 2.07.13.65.2 1.32.2 2h8v-2h-5.75c.74-2.81 2.95-5.01 5.76-5.74m-6.36-1.24c.78-2.09 2.23-3.84 4.09-5C15.44 6.16 12 9.67 12 14v.02c.95-1.27 2.2-2.3 3.64-3m-4.22-2.17C10.58 6.66 8.88 4.89 6.7 4 8.14 5.86 9 8.18 9 10.71c0 .21-.03.41-.04.61.43.24.83.52 1.22.82.21-1.18.65-2.29 1.24-3.29"}),"Grass"),VM=ue(g.jsx("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),"Home"),UM=ue(g.jsx("path",{d:"M19 9.3V4h-3v2.6L12 3 2 12h3v8h5v-6h4v6h5v-8h3zm-9 .7c0-1.1.9-2 2-2s2 .9 2 2z"}),"House"),GM=ue(g.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),KM=ue(g.jsx("path",{d:"M19 3H5c-1.1 0-1.99.9-1.99 2L3 19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-1 11h-4v4h-4v-4H6v-4h4V6h4v4h4z"}),"LocalHospital"),qM=ue(g.jsx("path",{d:"M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5zM6 18.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m13.5-9 1.96 2.5H17V9.5zm-1.5 9c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5"}),"LocalShipping"),YM=ue(g.jsx("path",{d:"M15 11V5l-3-3-3 3v2H3v14h18V11zm-8 8H5v-2h2zm0-4H5v-2h2zm0-4H5V9h2zm6 8h-2v-2h2zm0-4h-2v-2h2zm0-4h-2V9h2zm0-4h-2V5h2zm6 12h-2v-2h2zm0-4h-2v-2h2z"}),"LocationCity"),XM=ue(g.jsx("path",{d:"m20.5 10 .5-2h-4l1-4h-2l-1 4h-4l1-4h-2L9 8H5l-.5 2h4l-1 4h-4L3 16h4l-1 4h2l1-4h4l-1 4h2l1-4h4l.5-2h-4l1-4zm-7 4h-4l1-4h4z"}),"Numbers"),ZM=ue(g.jsx("path",{d:"M10 9h4V6h3l-5-5-5 5h3zm-1 1H6V7l-5 5 5 5v-3h3zm14 2-5-5v3h-3v4h3v3zm-9 3h-4v3H7l5 5 5-5h-3z"}),"OpenWith"),JM=ue(g.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m.88 15.76V19h-1.75v-1.29c-.74-.18-2.39-.77-3.02-2.96l1.65-.67c.06.22.58 2.09 2.4 2.09.93 0 1.98-.48 1.98-1.61 0-.96-.7-1.46-2.28-2.03-1.1-.39-3.35-1.03-3.35-3.31 0-.1.01-2.4 2.62-2.96V5h1.75v1.24c1.84.32 2.51 1.79 2.66 2.23l-1.58.67c-.11-.35-.59-1.34-1.9-1.34-.7 0-1.81.37-1.81 1.39 0 .95.86 1.31 2.64 1.9 2.4.83 3.01 2.05 3.01 3.45 0 2.63-2.5 3.13-3.02 3.22"}),"Paid"),QM=ue(g.jsx("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m0 14H4v-6h16zm0-10H4V6h16z"}),"Payment"),eI=ue(g.jsx("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m-8 6H8v1h3c.55 0 1 .45 1 1v3c0 .55-.45 1-1 1h-1v1H8v-1H6v-2h4v-1H7c-.55 0-1-.45-1-1V9c0-.55.45-1 1-1h1V7h2v1h2zm4 6.25-2-2h4zM14 10l2-2 2 2z"}),"PriceChange"),tI=ue(g.jsx("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-1 6h2v2h-2zm0 4h2v6h-2z"}),"PrivacyTip"),oI=ue(g.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39"}),"Public"),rI=ue(g.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),nI=ue(g.jsx("path",{d:"M14 11V8c4.56-.58 8-3.1 8-6H2c0 2.9 3.44 5.42 8 6v3c-3.68.73-8 3.61-8 11h6v-2H4.13c.93-6.83 6.65-7.2 7.87-7.2s6.94.37 7.87 7.2H16v2h6c0-7.39-4.32-10.27-8-11m-2 11c-1.1 0-2-.9-2-2 0-.55.22-1.05.59-1.41C11.39 17.79 16 16 16 16s-1.79 4.61-2.59 5.41c-.36.37-.86.59-1.41.59"}),"Scale"),aI=ue(g.jsx("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11z"}),"Security"),sI=ue(g.jsx("path",{d:"M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m7-7H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2m-1.75 9c0 .23-.02.46-.05.68l1.48 1.16c.13.11.17.3.08.45l-1.4 2.42c-.09.15-.27.21-.43.15l-1.74-.7c-.36.28-.76.51-1.18.69l-.26 1.85c-.03.17-.18.3-.35.3h-2.8c-.17 0-.32-.13-.35-.29l-.26-1.85c-.43-.18-.82-.41-1.18-.69l-1.74.7c-.16.06-.34 0-.43-.15l-1.4-2.42c-.09-.15-.05-.34.08-.45l1.48-1.16c-.03-.23-.05-.46-.05-.69 0-.23.02-.46.05-.68l-1.48-1.16c-.13-.11-.17-.3-.08-.45l1.4-2.42c.09-.15.27-.21.43-.15l1.74.7c.36-.28.76-.51 1.18-.69l.26-1.85c.03-.17.18-.3.35-.3h2.8c.17 0 .32.13.35.29l.26 1.85c.43.18.82.41 1.18.69l1.74-.7c.16-.06.34 0 .43.15l1.4 2.42c.09.15.05.34-.08.45l-1.48 1.16c.03.23.05.46.05.69"}),"SettingsApplications"),iI=ue(g.jsx("path",{d:"m17.21 9-4.38-6.56c-.19-.28-.51-.42-.83-.42-.32 0-.64.14-.83.43L6.79 9H2c-.55 0-1 .45-1 1 0 .09.01.18.04.27l2.54 9.27c.23.84 1 1.46 1.92 1.46h13c.92 0 1.69-.62 1.93-1.46l2.54-9.27L23 10c0-.55-.45-1-1-1zM9 9l3-4.4L15 9zm3 8c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"ShoppingBasket"),lI=ue(g.jsx("path",{d:"m3.5 18.49 6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart"),cI=ue([g.jsx("path",{d:"M8.55 12c-1.07-.71-2.25-1.27-3.53-1.61 1.28.34 2.46.9 3.53 1.61m10.43-1.61c-1.29.34-2.49.91-3.57 1.64 1.08-.73 2.28-1.3 3.57-1.64"},"0"),g.jsx("path",{d:"M15.49 9.63c-.18-2.79-1.31-5.51-3.43-7.63-2.14 2.14-3.32 4.86-3.55 7.63 1.28.68 2.46 1.56 3.49 2.63 1.03-1.06 2.21-1.94 3.49-2.63m-6.5 2.65c-.14-.1-.3-.19-.45-.29.15.11.31.19.45.29m6.42-.25c-.13.09-.27.16-.4.26.13-.1.27-.17.4-.26M12 15.45C9.85 12.17 6.18 10 2 10c0 5.32 3.36 9.82 8.03 11.49.63.23 1.29.4 1.97.51.68-.12 1.33-.29 1.97-.51C18.64 19.82 22 15.32 22 10c-4.18 0-7.85 2.17-10 5.45"},"1")],"Spa"),uI=ue(g.jsx("path",{d:"m21.9 8.89-1.05-4.37c-.22-.9-1-1.52-1.91-1.52H5.05c-.9 0-1.69.63-1.9 1.52L2.1 8.89c-.24 1.02-.02 2.06.62 2.88.08.11.19.19.28.29V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6.94c.09-.09.2-.18.28-.28.64-.82.87-1.87.62-2.89m-2.99-3.9 1.05 4.37c.1.42.01.84-.25 1.17-.14.18-.44.47-.94.47-.61 0-1.14-.49-1.21-1.14L16.98 5zM13 5h1.96l.54 4.52c.05.39-.07.78-.33 1.07-.22.26-.54.41-.95.41-.67 0-1.22-.59-1.22-1.31zM8.49 9.52 9.04 5H11v4.69c0 .72-.55 1.31-1.29 1.31-.34 0-.65-.15-.89-.41-.25-.29-.37-.68-.33-1.07m-4.45-.16L5.05 5h1.97l-.58 4.86c-.08.65-.6 1.14-1.21 1.14-.49 0-.8-.29-.93-.47-.27-.32-.36-.75-.26-1.17M5 19v-6.03c.08.01.15.03.23.03.87 0 1.66-.36 2.24-.95.6.6 1.4.95 2.31.95.87 0 1.65-.36 2.23-.93.59.57 1.39.93 2.29.93.84 0 1.64-.35 2.24-.95.58.59 1.37.95 2.24.95.08 0 .15-.02.23-.03V19z"}),"Storefront"),dI=ue(g.jsx("path",{d:"M19.51 3.08 3.08 19.51c.09.34.27.65.51.9.25.24.56.42.9.51L20.93 4.49c-.19-.69-.73-1.23-1.42-1.41M11.88 3 3 11.88v2.83L14.71 3zM5 3c-1.1 0-2 .9-2 2v2l4-4zm14 18c.55 0 1.05-.22 1.41-.59.37-.36.59-.86.59-1.41v-2l-4 4zm-9.71 0h2.83L21 12.12V9.29z"}),"Texture"),pI=ue(g.jsx("path",{d:"M19.3 16.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S11 12 11 14.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l3.2 3.2 1.4-1.4zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5M12 20v2C6.48 22 2 17.52 2 12S6.48 2 12 2c4.84 0 8.87 3.44 9.8 8h-2.07c-.64-2.46-2.4-4.47-4.73-5.41V5c0 1.1-.9 2-2 2h-2v2c0 .55-.45 1-1 1H8v2h2v3H9l-4.79-4.79C4.08 10.79 4 11.38 4 12c0 4.41 3.59 8 8 8"}),"TravelExplore"),fI=ue(g.jsx("path",{d:"m16 18 2.29-2.29-4.88-4.88-4 4L2 7.41 3.41 6l6 6 4-4 6.3 6.29L22 12v6z"}),"TrendingDown"),mI=ue(g.jsx("path",{d:"m16 6 2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"}),"TrendingUp"),gI=ue(g.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"}),"UploadFile"),hI=ue(g.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),sf=p.createContext(null);function tw(){const[e,t]=p.useState(null);return p.useEffect(()=>{t(`mui-p-${Math.round(Math.random()*1e5)}`)},[]),e}function vI(e){const{children:t,value:o}=e,r=tw(),n=p.useMemo(()=>({idPrefix:r,value:o}),[r,o]);return g.jsx(sf.Provider,{value:n,children:t})}function ow(){return p.useContext(sf)}function rw(e,t){const{idPrefix:o}=e;return o===null?null:`${e.idPrefix}-P-${t}`}function nw(e,t){const{idPrefix:o}=e;return o===null?null:`${e.idPrefix}-T-${t}`}function aw(e){return Y("MuiTabPanel",e)}X("MuiTabPanel",["root"]);const sw=["children","className","value"],iw=e=>{const{classes:t}=e;return Z({root:["root"]},aw,t)},lw=M("div",{name:"MuiTabPanel",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({padding:e.spacing(3)})),bI=p.forwardRef(function(t,o){const r=zo({props:t,name:"MuiTabPanel"}),{children:n,className:a,value:s}=r,i=F(r,sw),l=u({},r),c=iw(l),d=ow();if(d===null)throw new TypeError("No TabContext provided");const m=rw(d,s),v=nw(d,s);return g.jsx(lw,u({"aria-labelledby":v,className:D(c.root,a),hidden:s!==d.value,id:m,ref:o,role:"tabpanel",ownerState:l},i,{children:s===d.value&&n}))}),Rn=p.createContext({});function cw(e){return Y("MuiTimeline",e)}X("MuiTimeline",["root","positionLeft","positionRight","positionAlternate","positionAlternateReverse"]);function Qo(e){return e==="alternate-reverse"?"positionAlternateReverse":`position${I(e)}`}const uw=["position","className"],dw=e=>{const{position:t,classes:o}=e,r={root:["root",t&&Qo(t)]};return Z(r,cw,o)},pw=M("ul",{name:"MuiTimeline",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.position&&t[Qo(o.position)]]}})({display:"flex",flexDirection:"column",padding:"6px 16px",flexGrow:1}),yI=p.forwardRef(function(t,o){const r=zo({props:t,name:"MuiTimeline"}),{position:n="right",className:a}=r,s=F(r,uw),i=u({},r,{position:n}),l=dw(i),c=p.useMemo(()=>({position:n}),[n]);return g.jsx(Rn.Provider,{value:c,children:g.jsx(pw,u({className:D(l.root,a),ownerState:i,ref:o},s))})});function fw(e){return Y("MuiTimelineConnector",e)}X("MuiTimelineConnector",["root"]);const mw=["className"],gw=e=>{const{classes:t}=e;return Z({root:["root"]},fw,t)},hw=M("span",{name:"MuiTimelineConnector",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({width:2,backgroundColor:(e.vars||e).palette.grey[400],flexGrow:1})),xI=p.forwardRef(function(t,o){const r=zo({props:t,name:"MuiTimelineConnector"}),{className:n}=r,a=F(r,mw),s=r,i=gw(s);return g.jsx(hw,u({className:D(i.root,n),ownerState:s,ref:o},a))});function vw(e){return Y("MuiTimelineContent",e)}const bw=X("MuiTimelineContent",["root","positionLeft","positionRight","positionAlternate","positionAlternateReverse"]),yw=["className"],xw=e=>{const{position:t,classes:o}=e,r={root:["root",Qo(t)]};return Z(r,vw,o)},Cw=M(St,{name:"MuiTimelineContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[Qo(o.position)]]}})(({ownerState:e})=>u({flex:1,padding:"6px 16px",textAlign:"left"},e.position==="left"&&{textAlign:"right"})),CI=p.forwardRef(function(t,o){const r=zo({props:t,name:"MuiTimelineContent"}),{className:n}=r,a=F(r,yw),{position:s}=p.useContext(Rn),i=u({},r,{position:s||"right"}),l=xw(i);return g.jsx(Cw,u({component:"div",className:D(l.root,n),ownerState:i,ref:o},a))});function $w(e){return Y("MuiTimelineDot",e)}X("MuiTimelineDot",["root","filled","outlined","filledGrey","outlinedGrey","filledPrimary","outlinedPrimary","filledSecondary","outlinedSecondary"]);const Sw=["className","color","variant"],Rw=e=>{const{color:t,variant:o,classes:r}=e,n={root:["root",o,t!=="inherit"&&`${o}${I(t)}`]};return Z(n,$w,r)},Pw=M("span",{name:"MuiTimelineDot",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[o.color!=="inherit"&&`${o.variant}${I(o.color)}`],t[o.variant]]}})(({ownerState:e,theme:t})=>u({display:"flex",alignSelf:"baseline",borderStyle:"solid",borderWidth:2,padding:4,borderRadius:"50%",boxShadow:(t.vars||t).shadows[1],margin:"11.5px 0"},e.variant==="filled"&&u({borderColor:"transparent"},e.color!=="inherit"&&u({},e.color==="grey"?{color:(t.vars||t).palette.grey[50],backgroundColor:(t.vars||t).palette.grey[400]}:{color:(t.vars||t).palette[e.color].contrastText,backgroundColor:(t.vars||t).palette[e.color].main})),e.variant==="outlined"&&u({boxShadow:"none",backgroundColor:"transparent"},e.color!=="inherit"&&u({},e.color==="grey"?{borderColor:(t.vars||t).palette.grey[400]}:{borderColor:(t.vars||t).palette[e.color].main})))),$I=p.forwardRef(function(t,o){const r=zo({props:t,name:"MuiTimelineDot"}),{className:n,color:a="grey",variant:s="filled"}=r,i=F(r,Sw),l=u({},r,{color:a,variant:s}),c=Rw(l);return g.jsx(Pw,u({className:D(c.root,n),ownerState:l,ref:o},i))});function kw(e){return Y("MuiTimelineOppositeContent",e)}const Tw=X("MuiTimelineOppositeContent",["root","positionLeft","positionRight","positionAlternate","positionAlternateReverse"]),ww=["className"],Mw=e=>{const{position:t,classes:o}=e,r={root:["root",Qo(t)]};return Z(r,kw,o)},Iw=M(St,{name:"MuiTimelineOppositeContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[Qo(o.position)]]}})(({ownerState:e})=>u({padding:"6px 16px",marginRight:"auto",textAlign:"right",flex:1},e.position==="left"&&{textAlign:"left"})),Ow=p.forwardRef(function(t,o){const r=zo({props:t,name:"MuiTimelineOppositeContent"}),{className:n}=r,a=F(r,ww),{position:s}=p.useContext(Rn),i=u({},r,{position:s||"left"}),l=Mw(i);return g.jsx(Iw,u({component:"div",className:D(l.root,n),ownerState:i,ref:o},a))});Ow.muiName="TimelineOppositeContent";function Ew(e){return Y("MuiTimelineItem",e)}X("MuiTimelineItem",["root","positionLeft","positionRight","positionAlternate","positionAlternateReverse","missingOppositeContent"]);const Lw=["position","className"],Aw=e=>{const{position:t,classes:o,hasOppositeContent:r}=e,n={root:["root",Qo(t),!r&&"missingOppositeContent"]};return Z(n,Ew,o)},Bw=M("li",{name:"MuiTimelineItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[Qo(o.position)]]}})(({ownerState:e})=>u({listStyle:"none",display:"flex",position:"relative",minHeight:70},e.position==="left"&&{flexDirection:"row-reverse"},(e.position==="alternate"||e.position==="alternate-reverse")&&{[`&:nth-of-type(${e.position==="alternate"?"even":"odd"})`]:{flexDirection:"row-reverse",[`& .${bw.root}`]:{textAlign:"right"},[`& .${Tw.root}`]:{textAlign:"left"}}},!e.hasOppositeContent&&{"&::before":{content:'""',flex:1,padding:"6px 16px"}})),SI=p.forwardRef(function(t,o){const r=zo({props:t,name:"MuiTimelineItem"}),{position:n,className:a}=r,s=F(r,Lw),{position:i}=p.useContext(Rn);let l=!1;p.Children.forEach(r.children,v=>{sr(v,["TimelineOppositeContent"])&&(l=!0)});const c=u({},r,{position:n||i||"right",hasOppositeContent:l}),d=Aw(c),m=p.useMemo(()=>({position:c.position}),[c.position]);return g.jsx(Rn.Provider,{value:m,children:g.jsx(Bw,u({className:D(d.root,a),ownerState:c,ref:o},s))})});function _w(e){return Y("MuiTimelineSeparator",e)}X("MuiTimelineSeparator",["root"]);const Nw=["className"],zw=e=>{const{classes:t}=e;return Z({root:["root"]},_w,t)},jw=M("div",{name:"MuiTimelineSeparator",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",flex:0,alignItems:"center"}),RI=p.forwardRef(function(t,o){const r=zo({props:t,name:"MuiTimelineSeparator"}),{className:n}=r,a=F(r,Nw),s=r,i=zw(s);return g.jsx(jw,u({className:D(i.root,n),ownerState:s,ref:o},a))});export{ro as $,i4 as A,pC as B,wM as C,BM as D,zM as E,FM as F,O4 as G,u as H,Go as I,Z as J,nn as K,zo as L,E5 as M,In as N,qt as O,QM as P,at as Q,lp as R,uI as S,St as T,gI as U,Xi as V,hI as W,Ue as X,kt as Y,_d as Z,F as _,cp as a,kk as a$,ue as a0,I as a1,$o as a2,gS as a3,$4 as a4,Wr as a5,I2 as a6,rt as a7,hs as a8,no as a9,y4 as aA,qi as aB,vi as aC,_u as aD,Wb as aE,tI as aF,GM as aG,aI as aH,Gw as aI,p4 as aJ,v4 as aK,Zw as aL,Qw as aM,Jw as aN,SI as aO,RI as aP,$I as aQ,xI as aR,Ow as aS,CI as aT,X$ as aU,fT as aV,wa as aW,l2 as aX,nM as aY,xk as aZ,Uk as a_,A4 as aa,C4 as ab,Ds as ac,S4 as ad,Kw as ae,sm as af,yp as ag,U4 as ah,F$ as ai,V4 as aj,VT as ak,s4 as al,g$ as am,US as an,z4 as ao,j4 as ap,g5 as aq,np as ar,r4 as as,sl as at,k4 as au,kp as av,Rs as aw,Ap as ax,t4 as ay,q4 as az,c4 as b,E4 as b$,Ep as b0,g4 as b1,dM as b2,eM as b3,N4 as b4,Q4 as b5,VM as b6,NM as b7,lI as b8,fI as b9,Fw as bA,Vw as bB,o4 as bC,oM as bD,rM as bE,cM as bF,b4 as bG,e4 as bH,u4 as bI,T4 as bJ,w4 as bK,M4 as bL,I4 as bM,L4 as bN,B4 as bO,D4 as bP,W4 as bQ,G4 as bR,pM as bS,n4 as bT,aM as bU,lM as bV,a4 as bW,iM as bX,sM as bY,uM as bZ,F4 as b_,XM as ba,PM as bb,YM as bc,mI as bd,yM as be,$p as bf,x4 as bg,_$ as bh,oS as bi,dl as bj,m4 as bk,mM as bl,fM as bm,Nd as bn,vI as bo,bI as bp,H4 as bq,P4 as br,Uw as bs,_4 as bt,Xw as bu,tM as bv,X4 as bw,qw as bx,Hw as by,Ww as bz,ur as c,Zs as c0,Bi as c1,Y4 as c2,R4 as c3,y$ as c4,rI as c5,RM as c6,MM as c7,xn as c8,AM as c9,OM as cA,JM as cB,dI as cC,WM as cD,$M as cE,HM as cF,cI as cG,_M as ca,J4 as cb,Z4 as cc,KP as cd,qM as ce,nI as cf,DM as cg,h4 as ch,Mo as ci,E0 as cj,_e as ck,yI as cl,Tw as cm,d4 as cn,Ss as co,K4 as cp,f4 as cq,SM as cr,KM as cs,oI as ct,gM as cu,EM as cv,UM as cw,kM as cx,ZM as cy,TM as cz,wP as d,l4 as e,iI as f,pI as g,xM as h,Cd as i,g as j,jM as k,bM as l,hM as m,vM as n,CM as o,Dm as p,LM as q,eI as r,M as s,Xh as t,Yw as u,sI as v,IM as w,X as x,Y as y,xt as z}; diff --git a/build/assets/num2persian-BIYy8amq.js b/build/assets/num2persian-BIYy8amq.js new file mode 100644 index 0000000..031bf12 --- /dev/null +++ b/build/assets/num2persian-BIYy8amq.js @@ -0,0 +1 @@ +const A=" و ",l="صفر",g="منفی ",t=[["","یک","دو","سه","چهار","پنج","شش","هفت","هشت","نه"],["ده","یازده","دوازده","سیزده","چهارده","پانزده","شانزده","هفده","هجده","نوزده","بیست"],["","","بیست","سی","چهل","پنجاه","شصت","هفتاد","هشتاد","نود"],["","یکصد","دویست","سیصد","چهارصد","پانصد","ششصد","هفتصد","هشتصد","نهصد"],[""," هزار"," میلیون"," میلیارد"," بیلیون"," بیلیارد"," تریلیون"," تریلیارد"," کوآدریلیون"," کادریلیارد"," کوینتیلیون"," کوانتینیارد"," سکستیلیون"," سکستیلیارد"," سپتیلیون"," سپتیلیارد"," اکتیلیون"," اکتیلیارد"," نانیلیون"," نانیلیارد"," دسیلیون"," دسیلیارد"]],p=["","دهم","صدم","هزارم","ده‌هزارم","صد‌هزارم","میلیونوم","ده‌میلیونوم","صدمیلیونوم","میلیاردم","ده‌میلیاردم","صد‌‌میلیاردم"],a=C=>{let u=C;return typeof u=="number"&&(u=u.toString()),u.length%3===1?u=`00${u}`:u.length%3===2&&(u=`0${u}`),u.replace(/\d{3}(?=\d)/g,"$&*").split("*")},h=C=>{if(parseInt(C,0)===0)return"";const u=parseInt(C,0);if(u<10)return t[0][u];if(u<=20)return t[1][u-10];if(u<100){const i=u%10,s=(u-i)/10;return i>0?t[2][s]+A+t[0][i]:t[2][s]}const r=u%10,o=(u-u%100)/100,F=(u-(o*100+r))/10,e=[t[3][o]],n=F*10+r;return n===0||(n<10?e.push(t[0][n]):n<=20?e.push(t[1][n-10]):(e.push(t[2][F]),r>0&&e.push(t[0][r]))),e.join(A)},N=C=>(C=C.replace(/0*$/,""),C===""?"":(C.length>11&&(C=C.substr(0,11))," ممیز "+f(C)+" "+p[C.length])),f=C=>{C=C.toString().replace(/[^0-9.-]/g,"");let u=!1;const r=parseFloat(C);if(isNaN(r)||r===0)return l;r<0&&(u=!0,C=C.replace(/-/g,""));let o="",F=C,e=C.indexOf(".");if(e>-1&&(F=C.substring(0,e),o=C.substring(e+1,C.length)),F.length>66)return"خارج از محدوده";const n=a(F),i=[];for(let s=0;s0&&(o=N(o)),(u?g:"")+i.join(A)+o};String.prototype.toPersianLetter=function(){return f(this)};Number.prototype.toPersianLetter=function(){return f(parseFloat(this).toString())};String.prototype.num2persian=function(){return f(this)};Number.prototype.num2persian=function(){return f(parseFloat(this).toString())};export{f as N}; diff --git a/build/assets/pelak-B4AqLCaJ.jpg b/build/assets/pelak-B4AqLCaJ.jpg new file mode 100644 index 0000000..a0cd6cb Binary files /dev/null and b/build/assets/pelak-B4AqLCaJ.jpg differ diff --git a/build/assets/province-get-dispenser-killhouses-BecKvYyt.js b/build/assets/province-get-dispenser-killhouses-BecKvYyt.js new file mode 100644 index 0000000..3799a8d --- /dev/null +++ b/build/assets/province-get-dispenser-killhouses-BecKvYyt.js @@ -0,0 +1 @@ +import{a as r}from"./redux-vendor-B7uoacJt.js";import{L as o,j as l,X as c,h as n}from"./index-CeyyVc1v.js";const u=r("PROVINCE_GET_DISPENSER_KILLHOUSES_SERVICE",async(e,{dispatch:a})=>{a(o());const{data:t,status:s}=await l.get("kill-house-warehouse-dashboard-for-province",{params:{role:c(),date1:e.selectedDate1?e.selectedDate1:null,date2:e.selectedDate2?e.selectedDate2:null}});return a(n()),{data:t,status:s}}),E=r("PROVINCE_GET_DISPENSER_KILLHOUSES_DASHBOARD_SERVICE",async(e,{dispatch:a})=>{a(o());const{data:t,status:s}=await l.get("total-kill-house-warehouse-dashboard-for-province",{params:{role:c(),date1:e.selectedDate1?e.selectedDate1:null,date2:e.selectedDate2?e.selectedDate2:null}});return a(n()),{data:t,status:s}});export{u as a,E as p}; diff --git a/build/assets/province-get-kill-houses-C3UQguyo.js b/build/assets/province-get-kill-houses-C3UQguyo.js new file mode 100644 index 0000000..0d0ab79 --- /dev/null +++ b/build/assets/province-get-kill-houses-C3UQguyo.js @@ -0,0 +1 @@ +import{a as t}from"./redux-vendor-B7uoacJt.js";import{j as a}from"./index-CeyyVc1v.js";const n=t("PROVINCE_GET_KILLHOUSES",async()=>{const{data:o,status:s}=await a.get("kill_house/?role=ProvinceInspector");return{data:o,status:s}});export{n as p}; diff --git a/build/assets/province-get-sell-for-freezing-status-ieuVFEgW.js b/build/assets/province-get-sell-for-freezing-status-ieuVFEgW.js new file mode 100644 index 0000000..76b753e --- /dev/null +++ b/build/assets/province-get-sell-for-freezing-status-ieuVFEgW.js @@ -0,0 +1 @@ +import{a as o}from"./redux-vendor-B7uoacJt.js";import{L as n,j as c,h as e}from"./index-CeyyVc1v.js";const u=o("PROVINCE_GET_SMS_POULTRY_VALIDATE_STATUS",async(s,{dispatch:t})=>{try{t(n());const{data:r,status:a}=await c.get("price-confirmation/");return t(e()),{data:r,status:a}}catch(r){return t(e()),{error:r.response.data.result}}}),_=o("PROVINCE_EDIT_SMS_POULTRY_VALIDATE_STATUS",async(s,{dispatch:t})=>{try{t(n());const{data:r,status:a}=await c.put("price-confirmation/0/",s);return t(e()),{data:r,status:a}}catch(r){return t(e()),{error:r.response.data.result}}}),T=o("PROVINCE_GET_SELL_FOR_FREEZING_STATUS",async(s,{dispatch:t})=>{try{t(n());const{data:r,status:a}=await c.get("sell-for-freezing/");return t(e()),{data:r,status:a}}catch(r){return t(e()),{error:r.response.data.result}}});export{u as a,T as b,_ as p}; diff --git a/build/assets/province-policy-drop-limit-BQ-Lqckd.js b/build/assets/province-policy-drop-limit-BQ-Lqckd.js new file mode 100644 index 0000000..0c1dd14 --- /dev/null +++ b/build/assets/province-policy-drop-limit-BQ-Lqckd.js @@ -0,0 +1 @@ +import{a as s}from"./redux-vendor-B7uoacJt.js";import{L as i,j as e,h as c}from"./index-CeyyVc1v.js";const _=s("PROVINCE_POLICY_GET_DROP_LIMIT_SERVICE",async(a,{dispatch:t})=>{t(i());const{data:o,status:r}=await e.get("drop-limit/",a);return t(c()),{data:o,status:r}});export{_ as p}; diff --git a/build/assets/province-policy-edit-trade-time-range-CFotCa7K.js b/build/assets/province-policy-edit-trade-time-range-CFotCa7K.js new file mode 100644 index 0000000..588c731 --- /dev/null +++ b/build/assets/province-policy-edit-trade-time-range-CFotCa7K.js @@ -0,0 +1 @@ +import{a as n}from"./redux-vendor-B7uoacJt.js";import{j as r,L as o,h as i}from"./index-CeyyVc1v.js";const T=n("PAYMENT_GET_DEADLINES",async()=>{const{data:t,status:a}=await r.get("direct-buying-verification/");return{data:t,status:a}}),_=n("PROVINCE_POLICY_EDIT_TRADE_TIME_RANGE",async(t,{dispatch:a})=>{a(o());const{data:e,status:s}=await r.put("show-market-requests/0/",t);return a(i()),{data:e,status:s}}),u=n("PROVINCE_POLICY_GET_TRADE_TIME_RANGE",async(t,{dispatch:a})=>{a(o());const{data:e,status:s}=await r.get("show-market-requests/");return a(i()),{data:e,status:s}});export{u as a,_ as b,T as p}; diff --git a/build/assets/province-policy-get-aggregate-bar-info-allow-state-CO-Vk47I.js b/build/assets/province-policy-get-aggregate-bar-info-allow-state-CO-Vk47I.js new file mode 100644 index 0000000..0c02557 --- /dev/null +++ b/build/assets/province-policy-get-aggregate-bar-info-allow-state-CO-Vk47I.js @@ -0,0 +1 @@ +import{a as o}from"./redux-vendor-B7uoacJt.js";import{L as n,j as A,h as a}from"./index-CeyyVc1v.js";const u=o("PROVINCE_GET_AGGREGATE_STATUS",async(s,{dispatch:r})=>{try{r(n());const{data:t,status:e}=await A.get("aggregate-permission/");return r(a()),{data:t,status:e}}catch(t){return r(a()),{error:t.response.data.result}}}),T=o("PROVINCE_EDIT_AGGREGATE_STATUS",async(s,{dispatch:r})=>{try{r(n());const{data:t,status:e}=await A.put("aggregate-permission/0/",s);return r(a()),{data:t,status:e}}catch(t){return r(a()),{error:t.response.data.result}}});export{u as a,T as p}; diff --git a/build/assets/province-policy-get-slaughter-buying-price-status-XGKC4dNm.js b/build/assets/province-policy-get-slaughter-buying-price-status-XGKC4dNm.js new file mode 100644 index 0000000..43c7a19 --- /dev/null +++ b/build/assets/province-policy-get-slaughter-buying-price-status-XGKC4dNm.js @@ -0,0 +1 @@ +import{a as n}from"./redux-vendor-B7uoacJt.js";import{L as o,j as u,h as a}from"./index-CeyyVc1v.js";const _=n("PROVINCE_GET_MAX_BAR_STATUS",async(s,{dispatch:t})=>{try{t(o());const{data:r,status:e}=await u.get("bar-limitation/");return t(a()),{data:r,status:e}}catch(r){return t(a()),{error:r.response.data.result}}}),S=n("PROVINCE_EDIT_MAX_BAR_STATUS",async(s,{dispatch:t})=>{try{t(o());const{data:r,status:e}=await u.put("bar-limitation/0/",s);return t(a()),{data:r,status:e}}catch(r){return t(a()),{error:r.response.data.result}}}),y=n("PROVINCE_GET_SLAUGHTER_BUYING_PRICE_STATUS",async(s,{dispatch:t})=>{try{t(o());const{data:r,status:e}=await u.get("kill-house-price-permission/");return t(a()),{data:r,status:e}}catch(r){return t(a()),{error:r.response.data.result}}}),T=n("PROVINCE_EDIT_SLAUGHTER_BUYING_PRICE_STATUS",async(s,{dispatch:t})=>{try{t(o());const{data:r,status:e}=await u.put("kill-house-price-permission/0/",s);return t(a()),{data:r,status:e}}catch(r){return t(a()),{error:r.response.data.result}}});export{_ as a,T as b,y as c,S as p}; diff --git a/build/assets/province-policy-market-daily-limitation-DueqDboR.js b/build/assets/province-policy-market-daily-limitation-DueqDboR.js new file mode 100644 index 0000000..f99fa41 --- /dev/null +++ b/build/assets/province-policy-market-daily-limitation-DueqDboR.js @@ -0,0 +1 @@ +import{a as s}from"./redux-vendor-B7uoacJt.js";import{L as n,j as i,h as a}from"./index-CeyyVc1v.js";const l=s("PROVINCE_GET_EXPORT_STATUS",async(o,{dispatch:t})=>{try{t(n());const{data:r,status:e}=await i.get("poultry-export/");return t(a()),{data:r,status:e}}catch(r){return t(a()),{error:r.response.data.result}}}),y=s("PROVINCE_GET_MARKET_DAILY_LIMITATION",async(o,{dispatch:t})=>{try{t(n());const{data:r,status:e}=await i.get("market-daily-limitation/");return t(a()),{data:r,status:e}}catch(r){return t(a()),{error:r.response.data.result}}}),T=s("PROVINCE_EDIT_MARKET_DAILY_LIMITATION",async(o,{dispatch:t})=>{try{t(n());const{data:r,status:e}=await i.put("market-daily-limitation/0/",o);return t(a()),{data:r,status:e}}catch(r){return t(a()),{error:r.response.data.result}}});export{y as a,T as b,l as p}; diff --git a/build/assets/province-policy-upload-image-CRJ-U4Kc.js b/build/assets/province-policy-upload-image-CRJ-U4Kc.js new file mode 100644 index 0000000..02a582d --- /dev/null +++ b/build/assets/province-policy-upload-image-CRJ-U4Kc.js @@ -0,0 +1 @@ +import{a as s}from"./redux-vendor-B7uoacJt.js";import{L as n,j as c,h as t}from"./index-CeyyVc1v.js";const l=s("PROVINCE_GET_UPLOAD_IMAGE",async(o,{dispatch:a})=>{try{a(n());const{data:r,status:e}=await c.get("/upload-image-limit/");return a(t()),{data:r,status:e}}catch(r){return a(t()),{error:r.response.data.result}}}),m=s("PROVINCE_GET_UPLOAD_IMAGE",async(o,{dispatch:a})=>{try{a(n());const{data:r,status:e}=await c.put("/upload-image-limit/0/",o);return a(t()),{data:r,status:e}}catch(r){return a(t()),{error:r.response.data.result}}});export{l as a,m as p}; diff --git a/build/assets/province-policy-wages-edit-killhouse-Law73imd.js b/build/assets/province-policy-wages-edit-killhouse-Law73imd.js new file mode 100644 index 0000000..ed88cc8 --- /dev/null +++ b/build/assets/province-policy-wages-edit-killhouse-Law73imd.js @@ -0,0 +1 @@ +import{a as o}from"./redux-vendor-B7uoacJt.js";import{L as n,j as u,h as s}from"./index-CeyyVc1v.js";const l=o("PROVINCE_POLICY_EDIT_KILLHOUSE",async(t,{dispatch:r})=>{try{r(n());const{data:a,status:e}=await u.put("kill_house/0/",t);return r(s()),{data:a,status:e}}catch(a){return r(s()),{error:a.response.data.result}}});export{l as p}; diff --git a/build/assets/province-register-user-DVseE2hL.js b/build/assets/province-register-user-DVseE2hL.js new file mode 100644 index 0000000..14a42e2 --- /dev/null +++ b/build/assets/province-register-user-DVseE2hL.js @@ -0,0 +1 @@ +import{i as c,j as n}from"./mui-vendor-CkIVaoQP.js";import{r as u,j as s}from"./index-CeyyVc1v.js";import{a as o}from"./redux-vendor-B7uoacJt.js";var a={},i=c;Object.defineProperty(a,"__esModule",{value:!0});var p=a.default=void 0,_=i(u()),v=n;p=a.default=(0,_.default)((0,v.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8zm-2 8c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m4 8H8v-.57c0-.81.48-1.53 1.22-1.85.85-.37 1.79-.58 2.78-.58.99 0 1.93.21 2.78.58.74.32 1.22 1.04 1.22 1.85z"}),"ContactPage");const m=o("PROVINCE_CHECK_USER_EXISTENCE",async t=>{const{data:e,status:r}=await s.post("system_user_profile/",t);return{data:e,status:r}}),l=o("PROVINCE_REGISTER_USER",async t=>{try{const{data:e,status:r}=await s.post("system_user_profile/",t);return{data:e,status:r}}catch(e){return{error:e.response.data.result}}});export{l as a,p as d,m as p}; diff --git a/build/assets/react-vendor-CmFgShSM.js b/build/assets/react-vendor-CmFgShSM.js new file mode 100644 index 0000000..bdcb52c --- /dev/null +++ b/build/assets/react-vendor-CmFgShSM.js @@ -0,0 +1,59 @@ +function Bc(e,t){for(var n=0;nr[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var ph=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ya(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function hh(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,l.get?l:{enumerable:!0,get:function(){return e[r]}})}),n}var ga={exports:{}},O={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var lr=Symbol.for("react.element"),Ac=Symbol.for("react.portal"),Vc=Symbol.for("react.fragment"),Wc=Symbol.for("react.strict_mode"),Hc=Symbol.for("react.profiler"),Qc=Symbol.for("react.provider"),Kc=Symbol.for("react.context"),Yc=Symbol.for("react.forward_ref"),Xc=Symbol.for("react.suspense"),Gc=Symbol.for("react.memo"),Zc=Symbol.for("react.lazy"),nu=Symbol.iterator;function Jc(e){return e===null||typeof e!="object"?null:(e=nu&&e[nu]||e["@@iterator"],typeof e=="function"?e:null)}var wa={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Sa=Object.assign,ka={};function fn(e,t,n){this.props=e,this.context=t,this.refs=ka,this.updater=n||wa}fn.prototype.isReactComponent={};fn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};fn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ea(){}Ea.prototype=fn.prototype;function ro(e,t,n){this.props=e,this.context=t,this.refs=ka,this.updater=n||wa}var lo=ro.prototype=new Ea;lo.constructor=ro;Sa(lo,fn.prototype);lo.isPureReactComponent=!0;var ru=Array.isArray,Ca=Object.prototype.hasOwnProperty,io={current:null},xa={key:!0,ref:!0,__self:!0,__source:!0};function Pa(e,t,n){var r,l={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Ca.call(t,r)&&!xa.hasOwnProperty(r)&&(l[r]=t[r]);var u=arguments.length-2;if(u===1)l.children=n;else if(1>>1,Z=P[Q];if(0>>1;Ql(Ol,R))ktl(cr,Ol)?(P[Q]=cr,P[kt]=R,Q=kt):(P[Q]=Ol,P[St]=R,Q=St);else if(ktl(cr,R))P[Q]=cr,P[kt]=R,Q=kt;else break e}}return z}function l(P,z){var R=P.sortIndex-z.sortIndex;return R!==0?R:P.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var a=[],s=[],h=1,p=null,m=3,g=!1,y=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(P){for(var z=n(s);z!==null;){if(z.callback===null)r(s);else if(z.startTime<=P)r(s),z.sortIndex=z.expirationTime,t(a,z);else break;z=n(s)}}function v(P){if(w=!1,d(P),!y)if(n(a)!==null)y=!0,Tl(E);else{var z=n(s);z!==null&&Rl(v,z.startTime-P)}}function E(P,z){y=!1,w&&(w=!1,f(L),L=-1),g=!0;var R=m;try{for(d(z),p=n(a);p!==null&&(!(p.expirationTime>z)||P&&!me());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,m=p.priorityLevel;var Z=Q(p.expirationTime<=z);z=e.unstable_now(),typeof Z=="function"?p.callback=Z:p===n(a)&&r(a),d(z)}else r(a);p=n(a)}if(p!==null)var sr=!0;else{var St=n(s);St!==null&&Rl(v,St.startTime-z),sr=!1}return sr}finally{p=null,m=R,g=!1}}var _=!1,N=null,L=-1,$=5,T=-1;function me(){return!(e.unstable_now()-T<$)}function vn(){if(N!==null){var P=e.unstable_now();T=P;var z=!0;try{z=N(!0,P)}finally{z?yn():(_=!1,N=null)}}else _=!1}var yn;if(typeof c=="function")yn=function(){c(vn)};else if(typeof MessageChannel<"u"){var tu=new MessageChannel,$c=tu.port2;tu.port1.onmessage=vn,yn=function(){$c.postMessage(null)}}else yn=function(){C(vn,0)};function Tl(P){N=P,_||(_=!0,yn())}function Rl(P,z){L=C(function(){P(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_continueExecution=function(){y||g||(y=!0,Tl(E))},e.unstable_forceFrameRate=function(P){0>P||125Q?(P.sortIndex=R,t(s,P),n(a)===null&&P===n(s)&&(w?(f(L),L=-1):w=!0,Rl(v,R-Q))):(P.sortIndex=Z,t(a,P),y||g||(y=!0,Tl(E))),P},e.unstable_shouldYield=me,e.unstable_wrapCallback=function(P){var z=m;return function(){var R=m;m=z;try{return P.apply(this,arguments)}finally{m=R}}}})(za);La.exports=za;var lf=La.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var of=k,we=lf;function S(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oi=Object.prototype.hasOwnProperty,uf=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,iu={},ou={};function af(e){return oi.call(ou,e)?!0:oi.call(iu,e)?!1:uf.test(e)?ou[e]=!0:(iu[e]=!0,!1)}function sf(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function cf(e,t,n,r){if(t===null||typeof t>"u"||sf(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function se(e,t,n,r,l,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var te={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){te[e]=new se(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];te[t]=new se(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){te[e]=new se(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){te[e]=new se(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){te[e]=new se(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){te[e]=new se(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){te[e]=new se(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){te[e]=new se(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){te[e]=new se(e,5,!1,e.toLowerCase(),null,!1,!1)});var uo=/[\-:]([a-z])/g;function ao(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(uo,ao);te[t]=new se(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(uo,ao);te[t]=new se(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(uo,ao);te[t]=new se(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){te[e]=new se(e,1,!1,e.toLowerCase(),null,!1,!1)});te.xlinkHref=new se("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){te[e]=new se(e,1,!1,e.toLowerCase(),null,!0,!0)});function so(e,t,n,r){var l=te.hasOwnProperty(t)?te[t]:null;(l!==null?l.type!==0:r||!(2u||l[o]!==i[u]){var a=` +`+l[o].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=o&&0<=u);break}}}finally{jl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?_n(e):""}function ff(e){switch(e.tag){case 5:return _n(e.type);case 16:return _n("Lazy");case 13:return _n("Suspense");case 19:return _n("SuspenseList");case 0:case 2:case 15:return e=Dl(e.type,!1),e;case 11:return e=Dl(e.type.render,!1),e;case 1:return e=Dl(e.type,!0),e;default:return""}}function ci(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $t:return"Fragment";case Ut:return"Portal";case ui:return"Profiler";case co:return"StrictMode";case ai:return"Suspense";case si:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Oa:return(e.displayName||"Context")+".Consumer";case Ra:return(e._context.displayName||"Context")+".Provider";case fo:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case po:return t=e.displayName||null,t!==null?t:ci(e.type)||"Memo";case be:t=e._payload,e=e._init;try{return ci(e(t))}catch{}}return null}function df(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ci(t);case 8:return t===co?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function mt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ia(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function pf(e){var t=Ia(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function pr(e){e._valueTracker||(e._valueTracker=pf(e))}function ja(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ia(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Br(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function fi(e,t){var n=t.checked;return W({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function au(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=mt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Da(e,t){t=t.checked,t!=null&&so(e,"checked",t,!1)}function di(e,t){Da(e,t);var n=mt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?pi(e,t.type,n):t.hasOwnProperty("defaultValue")&&pi(e,t.type,mt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function su(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function pi(e,t,n){(t!=="number"||Br(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Nn=Array.isArray;function Zt(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=hr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Bn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Tn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},hf=["Webkit","ms","Moz","O"];Object.keys(Tn).forEach(function(e){hf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tn[t]=Tn[e]})});function Ba(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Tn.hasOwnProperty(e)&&Tn[e]?(""+t).trim():t+"px"}function Aa(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Ba(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var mf=W({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function vi(e,t){if(t){if(mf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(S(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(S(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(S(61))}if(t.style!=null&&typeof t.style!="object")throw Error(S(62))}}function yi(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var gi=null;function ho(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wi=null,Jt=null,qt=null;function du(e){if(e=ur(e)){if(typeof wi!="function")throw Error(S(280));var t=e.stateNode;t&&(t=vl(t),wi(e.stateNode,e.type,t))}}function Va(e){Jt?qt?qt.push(e):qt=[e]:Jt=e}function Wa(){if(Jt){var e=Jt,t=qt;if(qt=Jt=null,du(e),t)for(e=0;e>>=0,e===0?32:31-(_f(e)/Nf|0)|0}var mr=64,vr=4194304;function Ln(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Hr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var u=o&~l;u!==0?r=Ln(u):(i&=o,i!==0&&(r=Ln(i)))}else o=n&~l,o!==0?r=Ln(o):i!==0&&(r=Ln(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ir(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Oe(t),e[t]=n}function Rf(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=On),ku=" ",Eu=!1;function ss(e,t){switch(e){case"keyup":return id.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cs(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bt=!1;function ud(e,t){switch(e){case"compositionend":return cs(t);case"keypress":return t.which!==32?null:(Eu=!0,ku);case"textInput":return e=t.data,e===ku&&Eu?null:e;default:return null}}function ad(e,t){if(Bt)return e==="compositionend"||!Eo&&ss(e,t)?(e=us(),Rr=wo=rt=null,Bt=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_u(n)}}function hs(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hs(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ms(){for(var e=window,t=Br();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Br(e.document)}return t}function Co(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function yd(e){var t=ms(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&hs(n.ownerDocument.documentElement,n)){if(r!==null&&Co(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=Nu(n,i);var o=Nu(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,At=null,Pi=null,In=null,_i=!1;function Lu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_i||At==null||At!==Br(r)||(r=At,"selectionStart"in r&&Co(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),In&&Kn(In,r)||(In=r,r=Yr(Pi,"onSelect"),0Ht||(e.current=Oi[Ht],Oi[Ht]=null,Ht--)}function j(e,t){Ht++,Oi[Ht]=e.current,e.current=t}var vt={},ie=gt(vt),de=gt(!1),zt=vt;function rn(e,t){var n=e.type.contextTypes;if(!n)return vt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function pe(e){return e=e.childContextTypes,e!=null}function Gr(){F(de),F(ie)}function ju(e,t,n){if(ie.current!==vt)throw Error(S(168));j(ie,t),j(de,n)}function xs(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(S(108,df(e)||"Unknown",l));return W({},n,r)}function Zr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vt,zt=ie.current,j(ie,e),j(de,de.current),!0}function Du(e,t,n){var r=e.stateNode;if(!r)throw Error(S(169));n?(e=xs(e,t,zt),r.__reactInternalMemoizedMergedChildContext=e,F(de),F(ie),j(ie,e)):F(de),j(de,n)}var Ae=null,yl=!1,Zl=!1;function Ps(e){Ae===null?Ae=[e]:Ae.push(e)}function zd(e){yl=!0,Ps(e)}function wt(){if(!Zl&&Ae!==null){Zl=!0;var e=0,t=I;try{var n=Ae;for(I=1;e>=o,l-=o,Ve=1<<32-Oe(t)+l|n<L?($=N,N=null):$=N.sibling;var T=m(f,N,d[L],v);if(T===null){N===null&&(N=$);break}e&&N&&T.alternate===null&&t(f,N),c=i(T,c,L),_===null?E=T:_.sibling=T,_=T,N=$}if(L===d.length)return n(f,N),U&&Et(f,L),E;if(N===null){for(;LL?($=N,N=null):$=N.sibling;var me=m(f,N,T.value,v);if(me===null){N===null&&(N=$);break}e&&N&&me.alternate===null&&t(f,N),c=i(me,c,L),_===null?E=me:_.sibling=me,_=me,N=$}if(T.done)return n(f,N),U&&Et(f,L),E;if(N===null){for(;!T.done;L++,T=d.next())T=p(f,T.value,v),T!==null&&(c=i(T,c,L),_===null?E=T:_.sibling=T,_=T);return U&&Et(f,L),E}for(N=r(f,N);!T.done;L++,T=d.next())T=g(N,f,L,T.value,v),T!==null&&(e&&T.alternate!==null&&N.delete(T.key===null?L:T.key),c=i(T,c,L),_===null?E=T:_.sibling=T,_=T);return e&&N.forEach(function(vn){return t(f,vn)}),U&&Et(f,L),E}function C(f,c,d,v){if(typeof d=="object"&&d!==null&&d.type===$t&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case dr:e:{for(var E=d.key,_=c;_!==null;){if(_.key===E){if(E=d.type,E===$t){if(_.tag===7){n(f,_.sibling),c=l(_,d.props.children),c.return=f,f=c;break e}}else if(_.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===be&&$u(E)===_.type){n(f,_.sibling),c=l(_,d.props),c.ref=Cn(f,_,d),c.return=f,f=c;break e}n(f,_);break}else t(f,_);_=_.sibling}d.type===$t?(c=Lt(d.props.children,f.mode,v,d.key),c.return=f,f=c):(v=$r(d.type,d.key,d.props,null,f.mode,v),v.ref=Cn(f,c,d),v.return=f,f=v)}return o(f);case Ut:e:{for(_=d.key;c!==null;){if(c.key===_)if(c.tag===4&&c.stateNode.containerInfo===d.containerInfo&&c.stateNode.implementation===d.implementation){n(f,c.sibling),c=l(c,d.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=li(d,f.mode,v),c.return=f,f=c}return o(f);case be:return _=d._init,C(f,c,_(d._payload),v)}if(Nn(d))return y(f,c,d,v);if(gn(d))return w(f,c,d,v);Cr(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,c!==null&&c.tag===6?(n(f,c.sibling),c=l(c,d),c.return=f,f=c):(n(f,c),c=ri(d,f.mode,v),c.return=f,f=c),o(f)):n(f,c)}return C}var on=zs(!0),Ts=zs(!1),br=gt(null),el=null,Yt=null,No=null;function Lo(){No=Yt=el=null}function zo(e){var t=br.current;F(br),e._currentValue=t}function ji(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function en(e,t){el=e,No=Yt=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(fe=!0),e.firstContext=null)}function _e(e){var t=e._currentValue;if(No!==e)if(e={context:e,memoizedValue:t,next:null},Yt===null){if(el===null)throw Error(S(308));Yt=e,el.dependencies={lanes:0,firstContext:e}}else Yt=Yt.next=e;return t}var Pt=null;function To(e){Pt===null?Pt=[e]:Pt.push(e)}function Rs(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,To(t)):(n.next=l.next,l.next=n),t.interleaved=n,Ye(e,r)}function Ye(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var et=!1;function Ro(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Os(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function He(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ct(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,M&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Ye(e,n)}return l=r.interleaved,l===null?(t.next=t,To(r)):(t.next=l.next,l.next=t),r.interleaved=t,Ye(e,n)}function Mr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vo(e,n)}}function Bu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function tl(e,t,n,r){var l=e.updateQueue;et=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var a=u,s=a.next;a.next=null,o===null?i=s:o.next=s,o=a;var h=e.alternate;h!==null&&(h=h.updateQueue,u=h.lastBaseUpdate,u!==o&&(u===null?h.firstBaseUpdate=s:u.next=s,h.lastBaseUpdate=a))}if(i!==null){var p=l.baseState;o=0,h=s=a=null,u=i;do{var m=u.lane,g=u.eventTime;if((r&m)===m){h!==null&&(h=h.next={eventTime:g,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var y=e,w=u;switch(m=t,g=n,w.tag){case 1:if(y=w.payload,typeof y=="function"){p=y.call(g,p,m);break e}p=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=w.payload,m=typeof y=="function"?y.call(g,p,m):y,m==null)break e;p=W({},p,m);break e;case 2:et=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,m=l.effects,m===null?l.effects=[u]:m.push(u))}else g={eventTime:g,lane:m,tag:u.tag,payload:u.payload,callback:u.callback,next:null},h===null?(s=h=g,a=p):h=h.next=g,o|=m;if(u=u.next,u===null){if(u=l.shared.pending,u===null)break;m=u,u=m.next,m.next=null,l.lastBaseUpdate=m,l.shared.pending=null}}while(!0);if(h===null&&(a=p),l.baseState=a,l.firstBaseUpdate=s,l.lastBaseUpdate=h,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Ot|=o,e.lanes=o,e.memoizedState=p}}function Au(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ql.transition;ql.transition={};try{e(!1),t()}finally{I=n,ql.transition=r}}function Gs(){return Ne().memoizedState}function Md(e,t,n){var r=dt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Zs(e))Js(t,n);else if(n=Rs(e,t,n,r),n!==null){var l=ue();Me(n,e,r,l),qs(n,t,r)}}function Id(e,t,n){var r=dt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Zs(e))Js(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,u=i(o,n);if(l.hasEagerState=!0,l.eagerState=u,Ie(u,o)){var a=t.interleaved;a===null?(l.next=l,To(t)):(l.next=a.next,a.next=l),t.interleaved=l;return}}catch{}finally{}n=Rs(e,t,l,r),n!==null&&(l=ue(),Me(n,e,r,l),qs(n,t,r))}}function Zs(e){var t=e.alternate;return e===A||t!==null&&t===A}function Js(e,t){jn=rl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qs(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vo(e,n)}}var ll={readContext:_e,useCallback:ne,useContext:ne,useEffect:ne,useImperativeHandle:ne,useInsertionEffect:ne,useLayoutEffect:ne,useMemo:ne,useReducer:ne,useRef:ne,useState:ne,useDebugValue:ne,useDeferredValue:ne,useTransition:ne,useMutableSource:ne,useSyncExternalStore:ne,useId:ne,unstable_isNewReconciler:!1},jd={readContext:_e,useCallback:function(e,t){return De().memoizedState=[e,t===void 0?null:t],e},useContext:_e,useEffect:Wu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,jr(4194308,4,Hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return jr(4194308,4,e,t)},useInsertionEffect:function(e,t){return jr(4,2,e,t)},useMemo:function(e,t){var n=De();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=De();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Md.bind(null,A,e),[r.memoizedState,e]},useRef:function(e){var t=De();return e={current:e},t.memoizedState=e},useState:Vu,useDebugValue:$o,useDeferredValue:function(e){return De().memoizedState=e},useTransition:function(){var e=Vu(!1),t=e[0];return e=Od.bind(null,e[1]),De().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=A,l=De();if(U){if(n===void 0)throw Error(S(407));n=n()}else{if(n=t(),q===null)throw Error(S(349));Rt&30||Ds(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Wu(Us.bind(null,r,i,e),[e]),r.flags|=2048,er(9,Fs.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=De(),t=q.identifierPrefix;if(U){var n=We,r=Ve;n=(r&~(1<<32-Oe(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=qn++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Fe]=t,e[Gn]=r,ac(e,t,!1,!1),t.stateNode=e;e:{switch(o=yi(n,r),n){case"dialog":D("cancel",e),D("close",e),l=r;break;case"iframe":case"object":case"embed":D("load",e),l=r;break;case"video":case"audio":for(l=0;lsn&&(t.flags|=128,r=!0,xn(i,!1),t.lanes=4194304)}else{if(!r)if(e=nl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),xn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!U)return re(t),null}else 2*K()-i.renderingStartTime>sn&&n!==1073741824&&(t.flags|=128,r=!0,xn(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=K(),t.sibling=null,n=B.current,j(B,r?n&1|2:n&1),t):(re(t),null);case 22:case 23:return Qo(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ve&1073741824&&(re(t),t.subtreeFlags&6&&(t.flags|=8192)):re(t),null;case 24:return null;case 25:return null}throw Error(S(156,t.tag))}function Wd(e,t){switch(Po(t),t.tag){case 1:return pe(t.type)&&Gr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return un(),F(de),F(ie),Io(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Mo(t),null;case 13:if(F(B),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(S(340));ln()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(B),null;case 4:return un(),null;case 10:return zo(t.type._context),null;case 22:case 23:return Qo(),null;case 24:return null;default:return null}}var Pr=!1,le=!1,Hd=typeof WeakSet=="function"?WeakSet:Set,x=null;function Xt(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){H(e,t,r)}else n.current=null}function Hi(e,t,n){try{n()}catch(r){H(e,t,r)}}var ea=!1;function Qd(e,t){if(Ni=Qr,e=ms(),Co(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,u=-1,a=-1,s=0,h=0,p=e,m=null;t:for(;;){for(var g;p!==n||l!==0&&p.nodeType!==3||(u=o+l),p!==i||r!==0&&p.nodeType!==3||(a=o+r),p.nodeType===3&&(o+=p.nodeValue.length),(g=p.firstChild)!==null;)m=p,p=g;for(;;){if(p===e)break t;if(m===n&&++s===l&&(u=o),m===i&&++h===r&&(a=o),(g=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=g}n=u===-1||a===-1?null:{start:u,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Li={focusedElem:e,selectionRange:n},Qr=!1,x=t;x!==null;)if(t=x,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,x=e;else for(;x!==null;){t=x;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,C=y.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?w:ze(t.type,w),C);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(S(163))}}catch(v){H(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,x=e;break}x=t.return}return y=ea,ea=!1,y}function Dn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&Hi(t,n,i)}l=l.next}while(l!==r)}}function Sl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Qi(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function fc(e){var t=e.alternate;t!==null&&(e.alternate=null,fc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Fe],delete t[Gn],delete t[Ri],delete t[Nd],delete t[Ld])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function dc(e){return e.tag===5||e.tag===3||e.tag===4}function ta(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ki(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xr));else if(r!==4&&(e=e.child,e!==null))for(Ki(e,t,n),e=e.sibling;e!==null;)Ki(e,t,n),e=e.sibling}function Yi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Yi(e,t,n),e=e.sibling;e!==null;)Yi(e,t,n),e=e.sibling}var b=null,Te=!1;function qe(e,t,n){for(n=n.child;n!==null;)pc(e,t,n),n=n.sibling}function pc(e,t,n){if(Ue&&typeof Ue.onCommitFiberUnmount=="function")try{Ue.onCommitFiberUnmount(dl,n)}catch{}switch(n.tag){case 5:le||Xt(n,t);case 6:var r=b,l=Te;b=null,qe(e,t,n),b=r,Te=l,b!==null&&(Te?(e=b,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):b.removeChild(n.stateNode));break;case 18:b!==null&&(Te?(e=b,n=n.stateNode,e.nodeType===8?Gl(e.parentNode,n):e.nodeType===1&&Gl(e,n),Hn(e)):Gl(b,n.stateNode));break;case 4:r=b,l=Te,b=n.stateNode.containerInfo,Te=!0,qe(e,t,n),b=r,Te=l;break;case 0:case 11:case 14:case 15:if(!le&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Hi(n,t,o),l=l.next}while(l!==r)}qe(e,t,n);break;case 1:if(!le&&(Xt(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){H(n,t,u)}qe(e,t,n);break;case 21:qe(e,t,n);break;case 22:n.mode&1?(le=(r=le)||n.memoizedState!==null,qe(e,t,n),le=r):qe(e,t,n);break;default:qe(e,t,n)}}function na(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Hd),t.forEach(function(r){var l=ep.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Le(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~i}if(r=l,r=K()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Yd(r/1960))-r,10e?16:e,lt===null)var r=!1;else{if(e=lt,lt=null,ul=0,M&6)throw Error(S(331));var l=M;for(M|=4,x=e.current;x!==null;){var i=x,o=i.child;if(x.flags&16){var u=i.deletions;if(u!==null){for(var a=0;aK()-Wo?Nt(e,0):Vo|=n),he(e,t)}function kc(e,t){t===0&&(e.mode&1?(t=vr,vr<<=1,!(vr&130023424)&&(vr=4194304)):t=1);var n=ue();e=Ye(e,t),e!==null&&(ir(e,t,n),he(e,n))}function bd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),kc(e,n)}function ep(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(S(314))}r!==null&&r.delete(t),kc(e,n)}var Ec;Ec=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||de.current)fe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return fe=!1,Ad(e,t,n);fe=!!(e.flags&131072)}else fe=!1,U&&t.flags&1048576&&_s(t,qr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Dr(e,t),e=t.pendingProps;var l=rn(t,ie.current);en(t,n),l=Do(null,t,r,e,l,n);var i=Fo();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,pe(r)?(i=!0,Zr(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Ro(t),l.updater=wl,t.stateNode=l,l._reactInternals=t,Fi(t,r,e,n),t=Bi(null,t,r,!0,i,n)):(t.tag=0,U&&i&&xo(t),oe(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Dr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=np(r),e=ze(r,e),l){case 0:t=$i(null,t,r,e,n);break e;case 1:t=Ju(null,t,r,e,n);break e;case 11:t=Gu(null,t,r,e,n);break e;case 14:t=Zu(null,t,r,ze(r.type,e),n);break e}throw Error(S(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ze(r,l),$i(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ze(r,l),Ju(e,t,r,l,n);case 3:e:{if(ic(t),e===null)throw Error(S(387));r=t.pendingProps,i=t.memoizedState,l=i.element,Os(e,t),tl(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=an(Error(S(423)),t),t=qu(e,t,r,n,l);break e}else if(r!==l){l=an(Error(S(424)),t),t=qu(e,t,r,n,l);break e}else for(ye=st(t.stateNode.containerInfo.firstChild),ge=t,U=!0,Re=null,n=Ts(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ln(),r===l){t=Xe(e,t,n);break e}oe(e,t,r,n)}t=t.child}return t;case 5:return Ms(t),e===null&&Ii(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,zi(r,l)?o=null:i!==null&&zi(r,i)&&(t.flags|=32),lc(e,t),oe(e,t,o,n),t.child;case 6:return e===null&&Ii(t),null;case 13:return oc(e,t,n);case 4:return Oo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=on(t,null,r,n):oe(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ze(r,l),Gu(e,t,r,l,n);case 7:return oe(e,t,t.pendingProps,n),t.child;case 8:return oe(e,t,t.pendingProps.children,n),t.child;case 12:return oe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,o=l.value,j(br,r._currentValue),r._currentValue=o,i!==null)if(Ie(i.value,o)){if(i.children===l.children&&!de.current){t=Xe(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var u=i.dependencies;if(u!==null){o=i.child;for(var a=u.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=He(-1,n&-n),a.tag=2;var s=i.updateQueue;if(s!==null){s=s.shared;var h=s.pending;h===null?a.next=a:(a.next=h.next,h.next=a),s.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),ji(i.return,n,t),u.lanes|=n;break}a=a.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(S(341));o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),ji(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}oe(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,en(t,n),l=_e(l),r=r(l),t.flags|=1,oe(e,t,r,n),t.child;case 14:return r=t.type,l=ze(r,t.pendingProps),l=ze(r.type,l),Zu(e,t,r,l,n);case 15:return nc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ze(r,l),Dr(e,t),t.tag=1,pe(r)?(e=!0,Zr(t)):e=!1,en(t,n),bs(t,r,l),Fi(t,r,l,n),Bi(null,t,r,!0,e,n);case 19:return uc(e,t,n);case 22:return rc(e,t,n)}throw Error(S(156,t.tag))};function Cc(e,t){return Za(e,t)}function tp(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xe(e,t,n,r){return new tp(e,t,n,r)}function Yo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function np(e){if(typeof e=="function")return Yo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fo)return 11;if(e===po)return 14}return 2}function pt(e,t){var n=e.alternate;return n===null?(n=xe(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function $r(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")Yo(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case $t:return Lt(n.children,l,i,t);case co:o=8,l|=8;break;case ui:return e=xe(12,n,t,l|2),e.elementType=ui,e.lanes=i,e;case ai:return e=xe(13,n,t,l),e.elementType=ai,e.lanes=i,e;case si:return e=xe(19,n,t,l),e.elementType=si,e.lanes=i,e;case Ma:return El(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ra:o=10;break e;case Oa:o=9;break e;case fo:o=11;break e;case po:o=14;break e;case be:o=16,r=null;break e}throw Error(S(130,e==null?e:typeof e,""))}return t=xe(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function Lt(e,t,n,r){return e=xe(7,e,r,t),e.lanes=n,e}function El(e,t,n,r){return e=xe(22,e,r,t),e.elementType=Ma,e.lanes=n,e.stateNode={isHidden:!1},e}function ri(e,t,n){return e=xe(6,e,null,t),e.lanes=n,e}function li(e,t,n){return t=xe(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function rp(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ul(0),this.expirationTimes=Ul(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ul(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Xo(e,t,n,r,l,i,o,u,a){return e=new rp(e,t,n,u,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=xe(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ro(i),e}function lp(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Nc)}catch(e){console.error(e)}}Nc(),Na.exports=Se;var sp=Na.exports;const mh=ya(sp);/** + * @remix-run/router v1.23.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function nr(){return nr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Lc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function fp(){return Math.random().toString(36).substr(2,8)}function fa(e,t){return{usr:e.state,key:e.key,idx:t}}function qi(e,t,n,r){return n===void 0&&(n=null),nr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?hn(t):t,{state:n,key:t&&t.key||r||fp()})}function cl(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function hn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function dp(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:i=!1}=r,o=l.history,u=it.Pop,a=null,s=h();s==null&&(s=0,o.replaceState(nr({},o.state,{idx:s}),""));function h(){return(o.state||{idx:null}).idx}function p(){u=it.Pop;let C=h(),f=C==null?null:C-s;s=C,a&&a({action:u,location:w.location,delta:f})}function m(C,f){u=it.Push;let c=qi(w.location,C,f);s=h()+1;let d=fa(c,s),v=w.createHref(c);try{o.pushState(d,"",v)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;l.location.assign(v)}i&&a&&a({action:u,location:w.location,delta:1})}function g(C,f){u=it.Replace;let c=qi(w.location,C,f);s=h();let d=fa(c,s),v=w.createHref(c);o.replaceState(d,"",v),i&&a&&a({action:u,location:w.location,delta:0})}function y(C){let f=l.location.origin!=="null"?l.location.origin:l.location.href,c=typeof C=="string"?C:cl(C);return c=c.replace(/ $/,"%20"),V(f,"No window.location.(origin|href) available to create URL for href: "+c),new URL(c,f)}let w={get action(){return u},get location(){return e(l,o)},listen(C){if(a)throw new Error("A history only accepts one active listener");return l.addEventListener(ca,p),a=C,()=>{l.removeEventListener(ca,p),a=null}},createHref(C){return t(l,C)},createURL:y,encodeLocation(C){let f=y(C);return{pathname:f.pathname,search:f.search,hash:f.hash}},push:m,replace:g,go(C){return o.go(C)}};return w}var da;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(da||(da={}));function pp(e,t,n){return n===void 0&&(n="/"),hp(e,t,n)}function hp(e,t,n,r){let l=typeof t=="string"?hn(t):t,i=cn(l.pathname||"/",n);if(i==null)return null;let o=zc(e);mp(o);let u=null;for(let a=0;u==null&&a{let a={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};a.relativePath.startsWith("/")&&(V(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let s=ht([r,a.relativePath]),h=n.concat(a);i.children&&i.children.length>0&&(V(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+s+'".')),zc(i.children,t,h,s)),!(i.path==null&&!i.index)&&t.push({path:s,score:Ep(s,i.index),routesMeta:h})};return e.forEach((i,o)=>{var u;if(i.path===""||!((u=i.path)!=null&&u.includes("?")))l(i,o);else for(let a of Tc(i.path))l(i,o,a)}),t}function Tc(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return l?[i,""]:[i];let o=Tc(r.join("/")),u=[];return u.push(...o.map(a=>a===""?i:[i,a].join("/"))),l&&u.push(...o),u.map(a=>e.startsWith("/")&&a===""?"/":a)}function mp(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Cp(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const vp=/^:[\w-]+$/,yp=3,gp=2,wp=1,Sp=10,kp=-2,pa=e=>e==="*";function Ep(e,t){let n=e.split("/"),r=n.length;return n.some(pa)&&(r+=kp),t&&(r+=gp),n.filter(l=>!pa(l)).reduce((l,i)=>l+(vp.test(i)?yp:i===""?wp:Sp),r)}function Cp(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function xp(e,t,n){let{routesMeta:r}=e,l={},i="/",o=[];for(let u=0;u{let{paramName:m,isOptional:g}=h;if(m==="*"){let w=u[p]||"";o=i.slice(0,i.length-w.length).replace(/(.)\/+$/,"$1")}const y=u[p];return g&&!y?s[m]=void 0:s[m]=(y||"").replace(/%2F/g,"/"),s},{}),pathname:i,pathnameBase:o,pattern:e}}function Pp(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Lc(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,u,a)=>(r.push({paramName:u,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function _p(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Lc(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function cn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Np(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?hn(e):e;return{pathname:n?n.startsWith("/")?n:Lp(n,t):t,search:Rp(r),hash:Op(l)}}function Lp(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function ii(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function zp(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function qo(e,t){let n=zp(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function bo(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=hn(e):(l=nr({},e),V(!l.pathname||!l.pathname.includes("?"),ii("?","pathname","search",l)),V(!l.pathname||!l.pathname.includes("#"),ii("#","pathname","hash",l)),V(!l.search||!l.search.includes("#"),ii("#","search","hash",l)));let i=e===""||l.pathname==="",o=i?"/":l.pathname,u;if(o==null)u=n;else{let p=t.length-1;if(!r&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),p-=1;l.pathname=m.join("/")}u=p>=0?t[p]:"/"}let a=Np(l,u),s=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(s||h)&&(a.pathname+="/"),a}const ht=e=>e.join("/").replace(/\/\/+/g,"/"),Tp=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Rp=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Op=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Mp(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Rc=["post","put","patch","delete"];new Set(Rc);const Ip=["get",...Rc];new Set(Ip);/** + * React Router v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function rr(){return rr=Object.assign?Object.assign.bind():function(e){for(var t=1;t{u.current=!0}),k.useCallback(function(s,h){if(h===void 0&&(h={}),!u.current)return;if(typeof s=="number"){r.go(s);return}let p=bo(s,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:ht([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,o,i,e])}function vh(){let{matches:e}=k.useContext(Je),t=e[e.length-1];return t?t.params:{}}function zl(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=k.useContext(Ze),{matches:l}=k.useContext(Je),{pathname:i}=Dt(),o=JSON.stringify(qo(l,r.v7_relativeSplatPath));return k.useMemo(()=>bo(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function Fp(e,t){return Up(e,t)}function Up(e,t,n,r){mn()||V(!1);let{navigator:l}=k.useContext(Ze),{matches:i}=k.useContext(Je),o=i[i.length-1],u=o?o.params:{};o&&o.pathname;let a=o?o.pathnameBase:"/";o&&o.route;let s=Dt(),h;if(t){var p;let C=typeof t=="string"?hn(t):t;a==="/"||(p=C.pathname)!=null&&p.startsWith(a)||V(!1),h=C}else h=s;let m=h.pathname||"/",g=m;if(a!=="/"){let C=a.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(C.length).join("/")}let y=pp(e,{pathname:g}),w=Wp(y&&y.map(C=>Object.assign({},C,{params:Object.assign({},u,C.params),pathname:ht([a,l.encodeLocation?l.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?a:ht([a,l.encodeLocation?l.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),i,n,r);return t&&w?k.createElement(Ll.Provider,{value:{location:rr({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:it.Pop}},w):w}function $p(){let e=Yp(),t=Mp(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),n?k.createElement("pre",{style:l},n):null,null)}const Bp=k.createElement($p,null);class Ap extends k.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?k.createElement(Je.Provider,{value:this.props.routeContext},k.createElement(Mc.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Vp(e){let{routeContext:t,match:n,children:r}=e,l=k.useContext(Nl);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),k.createElement(Je.Provider,{value:t},r)}function Wp(e,t,n,r){var l;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,u=(l=n)==null?void 0:l.errors;if(u!=null){let h=o.findIndex(p=>p.route.id&&(u==null?void 0:u[p.route.id])!==void 0);h>=0||V(!1),o=o.slice(0,Math.min(o.length,h+1))}let a=!1,s=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h=0?o=o.slice(0,s+1):o=[o[0]];break}}}return o.reduceRight((h,p,m)=>{let g,y=!1,w=null,C=null;n&&(g=u&&p.route.id?u[p.route.id]:void 0,w=p.route.errorElement||Bp,a&&(s<0&&m===0?(Gp("route-fallback"),y=!0,C=null):s===m&&(y=!0,C=p.route.hydrateFallbackElement||null)));let f=t.concat(o.slice(0,m+1)),c=()=>{let d;return g?d=w:y?d=C:p.route.Component?d=k.createElement(p.route.Component,null):p.route.element?d=p.route.element:d=h,k.createElement(Vp,{match:p,routeContext:{outlet:h,matches:f,isDataRoute:n!=null},children:d})};return n&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?k.createElement(Ap,{location:n.location,revalidation:n.revalidation,component:w,error:g,children:c(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):c()},null)}var jc=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(jc||{}),Dc=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Dc||{});function Hp(e){let t=k.useContext(Nl);return t||V(!1),t}function Qp(e){let t=k.useContext(Oc);return t||V(!1),t}function Kp(e){let t=k.useContext(Je);return t||V(!1),t}function Fc(e){let t=Kp(),n=t.matches[t.matches.length-1];return n.route.id||V(!1),n.route.id}function Yp(){var e;let t=k.useContext(Mc),n=Qp(),r=Fc();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Xp(){let{router:e}=Hp(jc.UseNavigateStable),t=Fc(Dc.UseNavigateStable),n=k.useRef(!1);return Ic(()=>{n.current=!0}),k.useCallback(function(l,i){i===void 0&&(i={}),n.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,rr({fromRouteId:t},i)))},[e,t])}const ha={};function Gp(e,t,n){ha[e]||(ha[e]=!0)}function Zp(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function yh(e){let{to:t,replace:n,state:r,relative:l}=e;mn()||V(!1);let{future:i,static:o}=k.useContext(Ze),{matches:u}=k.useContext(Je),{pathname:a}=Dt(),s=eu(),h=bo(t,qo(u,i.v7_relativeSplatPath),a,l==="path"),p=JSON.stringify(h);return k.useEffect(()=>s(JSON.parse(p),{replace:n,state:r,relative:l}),[s,p,l,n,r]),null}function Jp(e){V(!1)}function qp(e){let{basename:t="/",children:n=null,location:r,navigationType:l=it.Pop,navigator:i,static:o=!1,future:u}=e;mn()&&V(!1);let a=t.replace(/^\/*/,"/"),s=k.useMemo(()=>({basename:a,navigator:i,static:o,future:rr({v7_relativeSplatPath:!1},u)}),[a,u,i,o]);typeof r=="string"&&(r=hn(r));let{pathname:h="/",search:p="",hash:m="",state:g=null,key:y="default"}=r,w=k.useMemo(()=>{let C=cn(h,a);return C==null?null:{location:{pathname:C,search:p,hash:m,state:g,key:y},navigationType:l}},[a,h,p,m,g,y,l]);return w==null?null:k.createElement(Ze.Provider,{value:s},k.createElement(Ll.Provider,{children:n,value:w}))}function gh(e){let{children:t,location:n}=e;return Fp(eo(t),n)}new Promise(()=>{});function eo(e,t){t===void 0&&(t=[]);let n=[];return k.Children.forEach(e,(r,l)=>{if(!k.isValidElement(r))return;let i=[...t,l];if(r.type===k.Fragment){n.push.apply(n,eo(r.props.children,i));return}r.type!==Jp&&V(!1),!r.props.index||!r.props.children||V(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=eo(r.props.children,i)),n.push(o)}),n}/** + * React Router DOM v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function fl(){return fl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[l]=e[l]);return n}function bp(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function eh(e,t){return e.button===0&&(!t||t==="_self")&&!bp(e)}function to(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function th(e,t){let n=to(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(i=>{n.append(l,i)})}),n}const nh=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],rh=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],lh="6";try{window.__reactRouterVersion=lh}catch{}const ih=k.createContext({isTransitioning:!1}),oh="startTransition",ma=rf[oh];function wh(e){let{basename:t,children:n,future:r,window:l}=e,i=k.useRef();i.current==null&&(i.current=cp({window:l,v5Compat:!0}));let o=i.current,[u,a]=k.useState({action:o.action,location:o.location}),{v7_startTransition:s}=r||{},h=k.useCallback(p=>{s&&ma?ma(()=>a(p)):a(p)},[a,s]);return k.useLayoutEffect(()=>o.listen(h),[o,h]),k.useEffect(()=>Zp(r),[r]),k.createElement(qp,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:o,future:r})}const uh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ah=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sh=k.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:i,replace:o,state:u,target:a,to:s,preventScrollReset:h,viewTransition:p}=t,m=Uc(t,nh),{basename:g}=k.useContext(Ze),y,w=!1;if(typeof s=="string"&&ah.test(s)&&(y=s,uh))try{let d=new URL(window.location.href),v=s.startsWith("//")?new URL(d.protocol+s):new URL(s),E=cn(v.pathname,g);v.origin===d.origin&&E!=null?s=E+v.search+v.hash:w=!0}catch{}let C=jp(s,{relative:l}),f=fh(s,{replace:o,state:u,target:a,preventScrollReset:h,relative:l,viewTransition:p});function c(d){r&&r(d),d.defaultPrevented||f(d)}return k.createElement("a",fl({},m,{href:y||C,onClick:w||i?r:c,ref:n,target:a}))}),Sh=k.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:i="",end:o=!1,style:u,to:a,viewTransition:s,children:h}=t,p=Uc(t,rh),m=zl(a,{relative:p.relative}),g=Dt(),y=k.useContext(Oc),{navigator:w,basename:C}=k.useContext(Ze),f=y!=null&&dh(m)&&s===!0,c=w.encodeLocation?w.encodeLocation(m).pathname:m.pathname,d=g.pathname,v=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;l||(d=d.toLowerCase(),v=v?v.toLowerCase():null,c=c.toLowerCase()),v&&C&&(v=cn(v,C)||v);const E=c!=="/"&&c.endsWith("/")?c.length-1:c.length;let _=d===c||!o&&d.startsWith(c)&&d.charAt(E)==="/",N=v!=null&&(v===c||!o&&v.startsWith(c)&&v.charAt(c.length)==="/"),L={isActive:_,isPending:N,isTransitioning:f},$=_?r:void 0,T;typeof i=="function"?T=i(L):T=[i,_?"active":null,N?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let me=typeof u=="function"?u(L):u;return k.createElement(sh,fl({},p,{"aria-current":$,className:T,ref:n,style:me,to:a,viewTransition:s}),typeof h=="function"?h(L):h)});var no;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(no||(no={}));var va;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(va||(va={}));function ch(e){let t=k.useContext(Nl);return t||V(!1),t}function fh(e,t){let{target:n,replace:r,state:l,preventScrollReset:i,relative:o,viewTransition:u}=t===void 0?{}:t,a=eu(),s=Dt(),h=zl(e,{relative:o});return k.useCallback(p=>{if(eh(p,n)){p.preventDefault();let m=r!==void 0?r:cl(s)===cl(h);a(e,{replace:m,state:l,preventScrollReset:i,relative:o,viewTransition:u})}},[s,a,h,r,l,n,e,i,o,u])}function kh(e){let t=k.useRef(to(e)),n=k.useRef(!1),r=Dt(),l=k.useMemo(()=>th(r.search,n.current?null:t.current),[r.search]),i=eu(),o=k.useCallback((u,a)=>{const s=to(typeof u=="function"?u(l):u);n.current=!0,i("?"+s,a)},[i,l]);return[l,o]}function dh(e,t){t===void 0&&(t={});let n=k.useContext(ih);n==null&&V(!1);let{basename:r}=ch(no.useViewTransitionState),l=zl(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=cn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=cn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return bi(l.pathname,o)!=null||bi(l.pathname,i)!=null}export{wh as B,sh as L,yh as N,rf as R,hh as a,nf as b,mh as c,sp as d,ph as e,Dt as f,ya as g,gh as h,Jp as i,vh as j,Sh as k,kh as l,k as r,eu as u}; diff --git a/build/assets/reactour.esm-9QIjTffK.js b/build/assets/reactour.esm-9QIjTffK.js new file mode 100644 index 0000000..0972cc5 --- /dev/null +++ b/build/assets/reactour.esm-9QIjTffK.js @@ -0,0 +1,139 @@ +import{j as N,I as $t,B as qn,ak as dt,aJ as Hn,H as Be,aB as $n,_ as Un}from"./mui-vendor-CkIVaoQP.js";import{r as S,u as Gn,g as be,e as fe,b as C,d as zn}from"./react-vendor-CmFgShSM.js";import{L as Qn,j as Vn,h as vt,A as pt,a9 as Ne,a1 as je,p as de,N as ht,G as z,S as se,W as bt,iz as Yn}from"./index-CeyyVc1v.js";import{a as Kn,u as Ut,f as Gt,_ as Xn}from"./redux-vendor-B7uoacJt.js";import{d as Jn}from"./Delete-C5MyLelE.js";import{C as Zn}from"./CityNewKillRequest-C2SXYvKb.js";import{R as er}from"./ResponsiveTable-w7hk7Uq8.js";import{A as tr}from"./AdvancedTable-BYmmBtmq.js";import{d as nr}from"./Plagiarism-BiXORbzo.js";import{_ as rr}from"./chart-vendor-sE2SUVPW.js";import{a as or,s as B}from"./styled-components.browser.esm-gS9mh05b.js";const ur=Kn("ARCHIVE_DELETE_KILL_REQUEST_SERVICE",async(e,{dispatch:t})=>{t(Qn());try{const{data:n,status:r}=await Vn.delete("Poultry_Request/"+e);return t(vt()),{data:n,status:r}}catch(n){return t(vt()),{error:n.response.data.result}}}),Bu=()=>{const[e,t]=S.useState([]),n=Ut(),[r]=S.useContext(pt),{avicultureRequests:o}=Gt(l=>l.avicultureSlice),[,,u,a,i,c]=S.useContext(pt);return S.useEffect(()=>{const l=Ne(new Date).format("YYYY-MM-DD");a(l),c(l)},[]),S.useEffect(()=>{n(je({selectedDate1:u,selectedDate2:i}))},[u,i]),S.useEffect(()=>{const l=Array.isArray(o)&&(o==null?void 0:o.filter((s,v)=>(s.stateProcess==="accepted"||s.stateProcess==="pending")&&s.finalState!=="archive"));let f;l&&(f=l==null?void 0:l.map((s,v)=>{var p,m,w,h,y,b,k,E,x,A,I,T,W,L,M,Q,_,$;let g="";return s.directBuying?g="خرید مستقیم":s.union?g="خرید خارج از استان":g="اتحادیه",[v+1,s.orderCode,g,s!=null&&s.freezing?"انجماد":s!=null&&s.export?"صادرات":"عادی",s!=null&&s.directBuyingBuyerInfo?`${(p=s==null?void 0:s.directBuyingBuyerInfo)==null?void 0:p.buyerFullname} (${(m=s==null?void 0:s.directBuyingBuyerInfo)==null?void 0:m.buyerMobile})`:"-",s.directBuyingKillPlace?s.directBuyingKillPlace:"-",s!=null&&s.createDate?de(s==null?void 0:s.createDate):"",s!=null&&s.sendDate?de(s==null?void 0:s.sendDate):"",`${(h=(w=s.process)==null?void 0:w.poultry)==null?void 0:h.poultryName} (${(b=(y=s.process)==null?void 0:y.poultry)==null?void 0:b.poultryMobile})`,`${(E=(k=s.process)==null?void 0:k.poultry)==null?void 0:E.poultryProvince}/${(A=(x=s.process)==null?void 0:x.poultry)==null?void 0:A.poultryCity}`,de((T=(I=s.process)==null?void 0:I.poultryHatching)==null?void 0:T.date),(L=(W=s.process)==null?void 0:W.poultry)==null?void 0:L.age,s.IndexWeight,(Q=(M=s.process)==null?void 0:M.poultry)==null?void 0:Q.poultryQuantity.toLocaleString(),(s.IndexWeight*(($=(_=s.process)==null?void 0:_.poultry)==null?void 0:$.poultryQuantity)).toLocaleString(),N.jsx($t,{disabled:s==null?void 0:s.directBuyingKillPlace,"aria-label":"delete",color:"error",className:"avicultureActiveRequestsBtn",onClick:()=>{var O,V;n(ur((V=(O=s==null?void 0:s.process)==null?void 0:O.poultry)==null?void 0:V.poultryRequestId)).then(U=>{U.payload.error?r({vertical:"top",horizontal:"center",msg:U.payload.error,severity:"error"}):(n(je()),n(ht({right:!1,bottom:!1,content:null})),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:N.jsx(Jn,{})},s==null?void 0:s.orderCode)]})),t(f)},[o]),N.jsx(N.Fragment,{children:N.jsx(z,{container:!0,gap:se.MEDIUM,direction:"column",xs:12,children:N.jsx(z,{container:!0,gap:se.SMALL,justifyContent:{xs:"center",lg:"space-between"},alignSelf:"center",alignItems:"center",xs:12,direction:{xs:"column",lg:"row"},width:"100%",children:N.jsxs(z,{container:!0,gap:se.SMALL,alignItems:"start",direction:"column",width:"100%",children:[N.jsx(z,{container:!0,width:"100%",gap:se.SMALL,children:N.jsx(qn,{className:"avicultureNewRequestBtn",variant:"contained",onClick:()=>{n(ht({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت درخواست کشتار",content:N.jsx(Zn,{isAviculture:!0})}))},children:"ثبت درخواست کشتار"})}),N.jsxs(z,{width:"100%",className:"avicultureActiveRequestsView",children:[N.jsxs(z,{container:!0,alignItems:"center",gap:se.SMALL,children:[N.jsx(z,{children:N.jsx(bt,{label:"از تاریخ",id:"date",renderInput:l=>N.jsx(dt,{style:{width:"160px"},...l}),value:u,onChange:l=>{a(Ne(l).format("YYYY-MM-DD"))}})}),N.jsx(z,{children:N.jsx(bt,{label:"تا تاریخ",id:"date",renderInput:l=>N.jsx(dt,{style:{width:"160px"},...l}),value:i,onChange:l=>{c(Ne(l).format("YYYY-MM-DD"))}})})]}),N.jsx(er,{title:"درخواست های کشتار",columns:["ردیف","کد سفارش","نوع فروش","نوع کشتار","اطلاعات خریدار","محل کشتار","تاریخ ثبت درخواست","تاریخ کشتار","مرغدار (تلفن)","استان/شهر","تاریخ جوجه ریزی","سن مرغ","میانگین وزنی","تعداد","وزن بار (کیلوگرم)","حذف"],data:e})]})]})})})})},ju=()=>{const e=Gn(),[t,n]=S.useState([]),{avicultureRequests:r}=Gt(a=>a.avicultureSlice),o=Ut();S.useEffect(()=>{o(je())},[]),S.useEffect(()=>{const a=r==null?void 0:r.filter(c=>c.stateProcess==="rejected"||c.provinceState==="rejected"),i=a==null?void 0:a.map((c,l)=>{var f,s,v,g,p,m,w,h,y,b,k,E;return[l+1,c.orderCode,de(c==null?void 0:c.createDate),de(c==null?void 0:c.sendDate),(s=(f=c==null?void 0:c.process)==null?void 0:f.poultry)==null?void 0:s.poultryName,(g=(v=c==null?void 0:c.process)==null?void 0:v.poultry)==null?void 0:g.poultryMobile,(m=(p=c==null?void 0:c.process)==null?void 0:p.poultry)==null?void 0:m.poultryCity,(h=(w=c==null?void 0:c.process)==null?void 0:w.poultry)==null?void 0:h.poultryProvince,(b=(y=c==null?void 0:c.process)==null?void 0:y.poultry)==null?void 0:b.age,(E=(k=c==null?void 0:c.process)==null?void 0:k.poultry)==null?void 0:E.poultryQuantity,N.jsx($t,{"aria-label":"delete",color:"primary",onClick:()=>{var x,A;return e(Yn+((A=(x=c==null?void 0:c.process)==null?void 0:x.poultry)==null?void 0:A.poultryRequestId))},children:N.jsx(nr,{})},c==null?void 0:c.orderCode)]});n(i)},[r]);const[u]=S.useState(["ردیف","کد سفارش","تاریخ ثبت درخواست","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","استان","سن مرغ","تعداد","مشاهده"]);return N.jsx(Hn,{children:N.jsx(tr,{name:"درخواست های رد شده",columns:u,data:t})})};var mt="focus-outline-hidden";function zt(){var e=this;document.addEventListener("keydown",function(t){e.focusByKeyboard=!0},!0),document.addEventListener("mousedown",function(t){e.focusByKeyboard=!1},!0),document.addEventListener("focus",function(t){e.updateVisibility()},!0),document.addEventListener("focusout",function(t){window.setTimeout(function(){document.hasFocus()||(e.focusByKeyboard=!0,e.updateVisibility())},0)}),this.updateVisibility()}zt.prototype={focusByKeyboard:!0,updateVisibility:function(){this.hidden=!this.focusByKeyboard},set hidden(e){document.documentElement.classList.toggle(mt,e)},get hidden(){return document.documentElement.classList.contains(mt)}};new zt;var Qt={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],o=0;o4&&arguments[4]!==void 0?arguments[4]:"easeInOutCubic";return r>o?n:t+(n-t)*ir[u](r/o)};J.calcEndPoint=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(cr(t))return parseInt(t)+r;var o=n===window||n===document.documentElement?window.pageYOffset:n.scrollTop-n.getBoundingClientRect().top,u=t.nodeName.toLowerCase()==="html"?-o:t.getBoundingClientRect().top+o;return u+r};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},r=J;t.default=function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=u.duration,i=a===void 0?500:a,c=u.context,l=c===void 0?window:c,f=u.offset,s=f===void 0?0:f,v=u.ease,g=v===void 0?"easeInOutCubic":v,p=u.callback;if((typeof window>"u"?"undefined":n(window))==="object"){var m=l.scrollTop!==null&&l.scrollTop!==void 0?l.scrollTop:window.pageYOffset,w=(0,r.calcEndPoint)(o,l,s),h=performance.now(),y=window.requestAnimationFrame,b=function k(){var E=performance.now()-h,x=(0,r.setPosition)(m,w,E,i,g);l!==window?l.scrollTop=x:window.scroll(0,x),E>i?typeof p=="function"&&p(o):y(k)};b()}},e.exports=t.default})(qe,qe.exports);var Vt=qe.exports,He={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(a){for(var i=1;i0&&arguments[0]!==void 0?arguments[0]:{},i=a.query,c=i===void 0?'[href^="#"]:not([href="#"]':i,l=a.match,f=l===void 0?function(w){return document.getElementById(w.hash.substring(1))}:l,s=a.hashChange,v=s===void 0?!0:s,g=a.scrollSmoothConfig,p=document.querySelectorAll(c),m=function(h){h.preventDefault();var y=f(h.target);y&&(v&&history.replaceState(null,null,"#"+y.id),(0,o.default)(y,n({},g)))};Array.from(p).map(function(w){w.addEventListener("click",m,!1)})},e.exports=t.default})(He,He.exports);var sr=He.exports,$e={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(r){if(Array.isArray(r)){for(var o=0,u=Array(r.length);o0&&arguments[0]!==void 0?arguments[0]:{},o=r.activeClass,u=o===void 0?"active":o,a=r.query,i=a===void 0?'[href^="#"]:not([href="#"]):not([href="#0"])':a,c=r.threshold,l=c===void 0?[.25,.5,.75]:c,f=r.detectType,s=f===void 0?"max":f,v={threshold:l},g=function(x){return x.classList.remove(u)},p=function(x){return x.classList.add(u)},m=function(){document.querySelectorAll("."+u).forEach(g)},w=function(x){m(),p(document.querySelector('a[href="#'+x.id+'"]'))},h=function(x){x.forEach(function(A){A.intersectionRatio>=Math[s].apply(Math,n(l))&&w(A.target)})},y=document.querySelectorAll(i),b=new IntersectionObserver(h,v),k=function(x){var A=document.querySelector("#"+x.hash.slice(1));b.observe(A)};y.forEach(k)},e.exports=t.default})($e,$e.exports);var lr=$e.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Vt,r=l(n),o=J,u=sr,a=l(u),i=lr,c=l(i);function l(f){return f&&f.__esModule?f:{default:f}}t.default={to:r.default,calcEndPoint:o.calcEndPoint,anchorScroll:a.default,observe:c.default},e.exports=t.default})(We,We.exports);var fr=We.exports;const dr=be(fr);var Yt={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.Scrollparent=n()})(fe,function(){var t=/(auto|scroll)/,n=function(i,c){return i.parentNode===null?c:n(i.parentNode,c.concat([i]))},r=function(i,c){return getComputedStyle(i,null).getPropertyValue(c)},o=function(i){return r(i,"overflow")+r(i,"overflow-y")+r(i,"overflow-x")},u=function(i){return t.test(o(i))},a=function(i){if(i instanceof HTMLElement||i instanceof SVGElement){for(var c=n(i.parentNode,[]),l=0;l=t||A<0||s&&I>=u}function h(){var x=_e();if(w(x))return y(x);i=setTimeout(h,m(x))}function y(x){return i=void 0,v&&r?g(x):(r=o=void 0,a)}function b(){i!==void 0&&clearTimeout(i),l=0,r=c=o=i=void 0}function k(){return i===void 0?a:y(_e())}function E(){var x=_e(),A=w(x);if(r=arguments,o=this,c=x,A){if(i===void 0)return p(c);if(s)return i=setTimeout(h,t),g(c)}return i===void 0&&(i=setTimeout(h,t)),a}return E.cancel=b,E.flush=k,E}function Ue(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Ir(e){return!!e&&typeof e=="object"}function Fr(e){return typeof e=="symbol"||Ir(e)&&Ar.call(e)==br}function wt(e){if(typeof e=="number")return e;if(Fr(e))return yt;if(Ue(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ue(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(mr,"");var n=yr.test(e);return n||wr.test(e)?Cr(e.slice(2),n?2:8):gr.test(e)?yt:+e}var Tr=_r;const Rr=be(Tr);var Ge="data-focus-lock",Kt="data-focus-lock-disabled",Lr="data-no-focus-lock",Pr="data-autofocus-inside",Mr="data-no-autofocus";function Ie(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Dr(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Br=typeof window<"u"?S.useLayoutEffect:S.useEffect,Ct=new WeakMap;function jr(e,t){var n=Dr(null,function(r){return e.forEach(function(o){return Ie(o,r)})});return Br(function(){var r=Ct.get(n);if(r){var o=new Set(r),u=new Set(e),a=n.current;o.forEach(function(i){u.has(i)||Ie(i,null)}),u.forEach(function(i){o.has(i)||Ie(i,a)})}Ct.set(n,e)},[e]),n}var Fe={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function Xt(e){return e}function Jt(e,t){t===void 0&&(t=Xt);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(u){var a=t(u,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(u){for(r=!0;n.length;){var a=n;n=[],a.forEach(u)}n={push:function(i){return u(i)},filter:function(){return n}}},assignMedium:function(u){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(u),a=n}var c=function(){var f=a;a=[],f.forEach(u)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(f){a.push(f),l()},filter:function(f){return a=a.filter(f),n}}}};return o}function Ke(e,t){return t===void 0&&(t=Xt),Jt(e,t)}function Wr(e){e===void 0&&(e={});var t=Jt(null);return t.options=rr({async:!0,ssr:!1},e),t}var Zt=Ke({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),en=Ke(),qr=Ke(),Hr=Wr({async:!0,ssr:typeof document<"u"}),$r=S.createContext(void 0),Ur=[],Xe=S.forwardRef(function(t,n){var r,o=S.useState(),u=o[0],a=o[1],i=S.useRef(),c=S.useRef(!1),l=S.useRef(null),f=S.useState({}),s=f[1],v=t.children,g=t.disabled,p=g===void 0?!1:g,m=t.noFocusGuards,w=m===void 0?!1:m,h=t.persistentFocus,y=h===void 0?!1:h,b=t.crossFrame,k=b===void 0?!0:b,E=t.autoFocus,x=E===void 0?!0:E;t.allowTextSelection;var A=t.group,I=t.className,T=t.whiteList,W=t.hasPositiveIndices,L=t.shards,M=L===void 0?Ur:L,Q=t.as,_=Q===void 0?"div":Q,$=t.lockProps,O=$===void 0?{}:$,V=t.sideCar,U=t.returnFocus,Z=U===void 0?!1:U,Oe=t.focusOptions,ee=t.onActivation,te=t.onDeactivation,me=S.useState({}),ge=me[0],ye=S.useCallback(function(H){var ne=H.captureFocusRestore;if(!l.current){var re,Y=(re=document)==null?void 0:re.activeElement;l.current=Y,Y!==document.body&&(l.current=ne(Y))}i.current&&ee&&ee(i.current),c.current=!0,s()},[ee]),Ee=S.useCallback(function(){c.current=!1,te&&te(i.current),s()},[te]),Ae=S.useCallback(function(H){var ne=l.current;if(ne){var re=(typeof ne=="function"?ne():ne)||document.body,Y=typeof Z=="function"?Z(re):Z;if(Y){var ft=typeof Y=="object"?Y:void 0;l.current=null,H?Promise.resolve().then(function(){return re.focus(ft)}):re.focus(ft)}}},[Z]),ke=S.useCallback(function(H){c.current&&Zt.useMedium(H)},[]),G=en.useMedium,q=S.useCallback(function(H){i.current!==H&&(i.current=H,a(H))},[]),st=Be((r={},r[Kt]=p&&"disabled",r[Ge]=A,r),O),lt=w!==!0,Bn=lt&&w!=="tail",jn=jr([n,q]),Wn=S.useMemo(function(){return{observed:i,shards:M,enabled:!p,active:c.current}},[p,c.current,M,u]);return C.createElement(S.Fragment,null,lt&&[C.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:p?-1:0,style:Fe}),W?C.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:p?-1:1,style:Fe}):null],!p&&C.createElement(V,{id:ge,sideCar:Hr,observed:u,disabled:p,persistentFocus:y,crossFrame:k,autoFocus:x,whiteList:T,shards:M,onActivation:ye,onDeactivation:Ee,returnFocus:Ae,focusOptions:Oe,noFocusGuards:w}),C.createElement(_,Be({ref:jn},st,{className:I,onBlur:G,onFocus:ke}),C.createElement($r.Provider,{value:Wn},v)),Bn&&C.createElement("div",{"data-focus-guard":!0,tabIndex:p?-1:0,style:Fe}))});Xe.propTypes={};function Gr(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var u=[],a;function i(){a=e(u.map(function(l){return l.props})),t(a)}var c=function(l){$n(f,l);function f(){return l.apply(this,arguments)||this}f.peek=function(){return a};var s=f.prototype;return s.componentDidMount=function(){u.push(this),i()},s.componentDidUpdate=function(){i()},s.componentWillUnmount=function(){var g=u.indexOf(this);u.splice(g,1),i()},s.render=function(){return C.createElement(o,this.props)},f}(S.PureComponent);return Xn(c,"displayName","SideEffect("+n(o)+")"),c}}var j=function(e){for(var t=Array(e.length),n=0;n=0}).sort(eo)},no=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],et=no.join(","),ro="".concat(et,", [data-focus-guard]"),ln=function(e,t){return j((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?ro:et)?[r]:[],ln(r))},[])},oo=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?ce([e.contentDocument.body],t):[e]},ce=function(e,t){return e.reduce(function(n,r){var o,u=ln(r,t),a=(o=[]).concat.apply(o,u.map(function(i){return oo(i,t)}));return n.concat(a,r.parentNode?j(r.parentNode.querySelectorAll(et)).filter(function(i){return i===r}):[])},[])},uo=function(e){var t=e.querySelectorAll("[".concat(Pr,"]"));return j(t).map(function(n){return ce([n])}).reduce(function(n,r){return n.concat(r)},[])},tt=function(e,t){return j(e).filter(function(n){return on(t,n)}).filter(function(n){return Xr(n)})},xt=function(e,t){return t===void 0&&(t=new Map),j(e).filter(function(n){return un(t,n)})},nt=function(e,t,n){return Ze(tt(ce(e,n),t),!0,n)},ve=function(e,t){return Ze(tt(ce(e),t),!1)},ao=function(e,t){return tt(uo(e),t)},K=function(e,t){return e.shadowRoot?K(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:j(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?K(o,t):!1}return K(n,t)})},io=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(o),(u&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,i){return!t.has(i)})},fn=function(e){return e.parentNode?fn(e.parentNode):e},rt=function(e){var t=X(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(Ge);return n.push.apply(n,o?io(j(fn(r).querySelectorAll("[".concat(Ge,'="').concat(o,'"]:not([').concat(Kt,'="disabled"])')))):[r]),n},[])},co=function(e){try{return e()}catch{return}},pe=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?pe(t.shadowRoot):t instanceof HTMLIFrameElement&&co(function(){return t.contentWindow.document})?pe(t.contentWindow.document):t}},so=function(e,t){return e===t},lo=function(e,t){return!!j(e.querySelectorAll("iframe")).some(function(n){return so(n,t)})},dn=function(e,t){return t===void 0&&(t=pe(tn(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:rt(e).some(function(n){return K(n,t)||lo(n,t)})},fo=function(e){e===void 0&&(e=document);var t=pe(e);return t?j(e.querySelectorAll("[".concat(Lr,"]"))).some(function(n){return K(n,t)}):!1},vo=function(e,t){return t.filter(sn).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},ot=function(e,t){return sn(e)&&e.name?vo(e,t):e},po=function(e){var t=new Set;return e.forEach(function(n){return t.add(ot(n,e))}),e.filter(function(n){return t.has(n)})},St=function(e){return e[0]&&e.length>1?ot(e[0],e):e[0]},Ot=function(e,t){return e.indexOf(ot(t,e))},Qe="NEW_FOCUS",ho=function(e,t,n,r,o){var u=e.length,a=e[0],i=e[u-1],c=Je(r);if(!(r&&e.indexOf(r)>=0)){var l=r!==void 0?n.indexOf(r):-1,f=o?n.indexOf(o):l,s=o?e.indexOf(o):-1;if(l===-1)return s!==-1?s:Qe;if(s===-1)return Qe;var v=l-f,g=n.indexOf(a),p=n.indexOf(i),m=po(n),w=r!==void 0?m.indexOf(r):-1,h=o?m.indexOf(o):w,y=m.filter(function(I){return I.tabIndex>=0}),b=r!==void 0?y.indexOf(r):-1,k=o?y.indexOf(o):b,E=b>=0&&k>=0?k-b:h-w;if(!v&&s>=0||t.length===0)return s;var x=Ot(e,t[0]),A=Ot(e,t[t.length-1]);if(l<=g&&c&&Math.abs(v)>1)return A;if(l>=p&&c&&Math.abs(v)>1)return x;if(v&&Math.abs(E)>1)return s;if(l<=g)return A;if(l>p)return x;if(v)return Math.abs(v)>1?s:(u+s+v)%u}},bo=function(e){return function(t){var n,r=(n=an(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},Et=function(e,t,n){var r=e.map(function(u){var a=u.node;return a}),o=xt(r.filter(bo(n)));return o&&o.length?St(o):St(xt(t))},Ve=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&Ve(e.parentNode.host||e.parentNode,t),t},Te=function(e,t){for(var n=Ve(e),r=Ve(t),o=0;o=0)return u}return!1},vn=function(e,t,n){var r=X(e),o=X(t),u=r[0],a=!1;return o.filter(Boolean).forEach(function(i){a=Te(a||i,i)||a,n.filter(Boolean).forEach(function(c){var l=Te(u,c);l&&(!a||K(l,a)?a=l:a=Te(l,a))})}),a},At=function(e,t){return e.reduce(function(n,r){return n.concat(ao(r,t))},[])},mo=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(Zr)},go=function(e,t){var n=pe(X(e).length>0?document:tn(e).ownerDocument),r=rt(e).filter(ze),o=vn(n||e,e,r),u=new Map,a=ve(r,u),i=a.filter(function(p){var m=p.node;return ze(m)});if(i[0]){var c=ve([o],u).map(function(p){var m=p.node;return m}),l=mo(c,i),f=l.map(function(p){var m=p.node;return m}),s=l.filter(function(p){var m=p.tabIndex;return m>=0}).map(function(p){var m=p.node;return m}),v=ho(f,s,c,n,t);if(v===Qe){var g=Et(a,s,At(r,u))||Et(a,f,At(r,u));if(g)return{node:g};console.warn("focus-lock: cannot find any node to move focus into");return}return v===void 0?v:l[v]}},yo=function(e){var t=rt(e).filter(ze),n=vn(e,e,t),r=Ze(ce([n],!0),!0,!0),o=ce(t,!1);return r.map(function(u){var a=u.node,i=u.index;return{node:a,index:i,lockItem:o.indexOf(a)>=0,guard:Je(a)}})},ut=function(e,t){e&&("focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus())},Re=0,Le=!1,pn=function(e,t,n){n===void 0&&(n={});var r=go(e,t);if(!Le&&r){if(Re>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Le=!0,setTimeout(function(){Le=!1},1);return}Re++,ut(r.node,n.focusOptions),Re--}};function le(e){if(!e)return null;if(typeof WeakRef>"u")return function(){return e||null};var t=e?new WeakRef(e):null;return function(){return(t==null?void 0:t.deref())||null}}var wo=function(e){if(!e)return null;for(var t=[],n=e;n&&n!==document.body;)t.push({current:le(n),parent:le(n.parentElement),left:le(n.previousElementSibling),right:le(n.nextElementSibling)}),n=n.parentElement;return{element:le(e),stack:t,ownerDocument:e.ownerDocument}},Co=function(e){var t,n,r,o,u;if(e)for(var a=e.stack,i=e.ownerDocument,c=new Map,l=0,f=a;l-1&&(w.filter(function(y){var b=y.guard,k=y.node;return b&&k.dataset.focusAutoGuard}).forEach(function(y){var b=y.node;return b.removeAttribute("tabIndex")}),Nt(h,w.length,1,w),Nt(h,-1,-1,w))}}}return t},wn=function(t){Ce()&&t&&(t.stopPropagation(),t.preventDefault())},ct=function(){return at(Ce)},jo=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||Ro(r,n)},Wo=function(){return null},Cn=function(){it=!0},xn=function(){it=!1,he="just",at(function(){he="meanwhile"})},qo=function(){document.addEventListener("focusin",wn),document.addEventListener("focusout",ct),window.addEventListener("focus",Cn),window.addEventListener("blur",xn)},Ho=function(){document.removeEventListener("focusin",wn),document.removeEventListener("focusout",ct),window.removeEventListener("focus",Cn),window.removeEventListener("blur",xn)};function $o(e){return e.filter(function(t){var n=t.disabled;return!n})}var Sn={moveFocusInside:pn,focusInside:dn,focusNextElement:Eo,focusPrevElement:Ao,focusFirstElement:ko,focusLastElement:No,captureFocusRestore:hn};function Uo(e){var t=e.slice(-1)[0];t&&!ue&&qo();var n=ue,r=n&&t&&t.id===n.id;ue=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var u=o.id;return u===n.id}).length||n.returnFocus(!t)),t?(F=null,(!r||n.observed!==t.observed)&&t.onActivation(Sn),Ce(),at(Ce)):(Ho(),F=null)}Zt.assignSyncMedium(jo);en.assignMedium(ct);qr.assignMedium(function(e){return e(Sn)});const Go=Gr($o,Uo)(Wo);var On=S.forwardRef(function(t,n){return C.createElement(Xe,Be({sideCar:Go,ref:n},t))}),En=Xe.propTypes||{};En.sideCar;Un(En,["sideCar"]);On.propTypes={};var An={exports:{}},zo="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Qo=zo,Vo=Qo;function kn(){}function Nn(){}Nn.resetWarningCache=kn;var Yo=function(){function e(r,o,u,a,i,c){if(c!==Vo){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}e.isRequired=e;function t(){return e}var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Nn,resetWarningCache:kn};return n.PropTypes=n,n};An.exports=Yo();var Ko=An.exports;const d=be(Ko);function _t(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u,a=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){i=!0,u=c},f:function(){try{a||n.return==null||n.return()}finally{if(i)throw u}}}}function R(e,t,n){return(t=In(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xe(e){return xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xe(e)}function ru(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ye(e,t)}function _n(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_n=function(){return!!e})()}function ou(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,u,a,i=[],c=!0,l=!1;try{if(u=(n=n.call(e)).next,t!==0)for(;!(c=(r=u.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(f){l=!0,o=f}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return i}}function uu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function It(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Se(e){for(var t=1;tn.right&&(n.right=i.right),i.bottom>n.bottom&&(n.bottom=i.bottom),i.left=0+c&&o>=0+c&&r<=a-c&&n<=u-c}function vu(e){return e===document.querySelector("body")||e===document.querySelector("html")}var pu=function(t){return/(left|right)/.test(t)},Pe=function(t,n){return t>n},Me=function(t,n){return t>n},D=function(t){return t<0?0:t};function hu(e){return Object.keys(e).map(function(t){return{position:t,value:e[t]}}).sort(function(t,n){return n.value-t.value}).map(function(t){return t.position})}var Dt,bu=B.div(Dt||(Dt=P([` + --reactour-accent: `,`; + `,` + position: fixed; + transition: transform 0.3s; + top: 0; + left: 0; + z-index: 1000000; + + transform: `,`; +`])),function(e){return e.accentColor},function(e){return e.defaultStyles?` + max-width: 331px; + min-width: 150px; + padding-right: 40px; + border-radius: `.concat(e.rounded,`px; + background-color: #fff; + padding: 24px 30px; + box-shadow: 0 0.5em 3em rgba(0, 0, 0, 0.3); + color: inherit; + `):""},function(e){var t=e.targetTop,n=e.targetRight,r=e.targetBottom,o=e.targetLeft,u=e.windowWidth,a=e.windowHeight,i=e.helperWidth,c=e.helperHeight,l=e.helperPosition,f=e.padding,s={left:o,right:u-n,top:t,bottom:a-r},v=function(h){return s[h]>(pu(h)?i+f*2:c+f*2)},g=function(h){for(var y=hu(s),b=0;bf?E:f,A=Me(t+c,a)?Me(r+f,a)?r-c:r-c+f:t-f,I=A>f?A:f,T={top:[x,t-c-f*2],right:[n+f*2,I],bottom:[x,r+f*2],left:[o-i-f*2,I],center:[u/2-i/2,a/2-c/2]};return h==="center"||v(h)?T[h]:g(T)},m=p(l);return"translate(".concat(Math.round(m[0]),"px, ").concat(Math.round(m[1]),"px)")}),Bt,mu=B.span(Bt||(Bt=P([` + position: absolute; + font-family: monospace; + background: var(--reactour-accent); + background: `,`; + height: 1.875em; + line-height: 2; + padding-left: 0.8125em; + padding-right: 0.8125em; + font-size: 1em; + border-radius: 1.625em; + color: white; + text-align: center; + box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.3); + top: -0.8125em; + left: -0.8125em; +`])),function(e){return e.accentColor}),jt,gu=B.div(jt||(jt=P([` + display: flex; + margin-top: 24px; + align-items: center; + justify-content: center; +`]))),Wt,yu=B.nav(Wt||(Wt=P([` + counter-reset: dot; + display: flex; + justify-content: center; + align-items: center; + flex-wrap: wrap; +`]))),qt,wu=B.button(qt||(qt=P([` + counter-increment: dot; + width: 8px; + height: 8px; + border: `,`; + + border-radius: 100%; + padding: 0; + display: block; + margin: 4px; + transition: opacity 0.3s, transform 0.3s; + cursor: `,`; + transform: scale(`,`); + + color: `,`; + background: `,`; + + color: `,`; + background: `,`; + + &:before { + content: counter(dot); + position: absolute; + bottom: calc(100% + 0.25em); + left: 50%; + opacity: 0; + transform: translate(-50%, 1em); + transition: 0.3s; + display: `,`; + } + + &:hover { + background-color: currentColor; + + &:before { + opacity: 0.5; + transform: translate(-50%, -2px); + } + } +`])),function(e){return e.current===e.index?"0":"1px solid #caccce"},function(e){return e.disabled?"not-allowed":"pointer"},function(e){return e.current===e.index?1.25:1},function(e){return e.current===e.index?"var(--reactour-accent)":"#caccce"},function(e){return e.current===e.index?"var(--reactour-accent)":"none"},function(e){return e.current===e.index?e.accentColor:"#caccce"},function(e){return e.current===e.index?e.accentColor:"none"},function(e){return e.showNumber?"block":"none"}),Ht,Cu=B.div(Ht||(Ht=P([` + opacity: `,`; + color: `,`; + width: 100%; + left: 0; + top: 0; + height: 100%; + position: fixed; + z-index: 99999; + pointer-events: none; +`])),function(e){return!e.maskClassName&&.7},function(e){return!e.maskClassName&&"#000"});function Mn(e){var t=e.windowWidth,n=e.windowHeight,r=e.targetWidth,o=e.targetHeight,u=e.targetTop,a=e.targetLeft,i=e.padding,c=e.rounded,l=e.roundedStep,f=e.disableInteraction,s=e.disableInteractionClassName,v=e.className,g=e.onClick,p=e.highlightedBorder,m=D(r+i*2),w=D(o+i*2),h=D(u-i),y=D(a-i),b=l?Math.min(m/2,w/2):c;return C.createElement(Cu,{onClick:g,maskClassName:v},C.createElement("svg",{width:t,height:n,xmlns:"http://www.w3.org/2000/svg",className:v},C.createElement("defs",null,C.createElement("mask",{id:"mask-main"},C.createElement("rect",{x:0,y:0,width:t,height:n,fill:"white"}),C.createElement("rect",{x:y,y:h,width:m,height:w,fill:"black"}),C.createElement("rect",{x:y-1,y:h-1,width:b,height:b,fill:"white"}),C.createElement("circle",{cx:y+b,cy:h+b,r:b,fill:"black"}),C.createElement("rect",{x:y+m-b+1,y:h-1,width:b,height:b,fill:"white"}),C.createElement("circle",{cx:y+m-b,cy:h+b,r:b,fill:"black"}),C.createElement("rect",{x:y-1,y:h+w-b+1,width:b,height:b,fill:"white"}),C.createElement("circle",{cx:y+b,cy:h+w-b,r:b,fill:"black"}),C.createElement("rect",{x:y+m-b+1,y:h+w-b+1,width:b,height:b,fill:"white"}),C.createElement("circle",{cx:y+m-b,cy:h+w-b,r:b,fill:"black "})),C.createElement("clipPath",{id:"clip-path"},C.createElement("rect",{x:0,y:0,width:t,height:h}),C.createElement("rect",{x:0,y:h,width:y,height:w}),C.createElement("rect",{x:a+r+i,y:h,width:D(t-r-y),height:w}),C.createElement("rect",{x:0,y:u+o+i,width:t,height:D(n-o-h)}))),C.createElement("rect",{x:0,y:0,width:t,height:n,fill:"currentColor",mask:"url(#mask-main)"}),C.createElement("rect",{x:0,y:0,width:t,height:n,fill:"currentColor",clipPath:"url(#clip-path)",pointerEvents:"auto"}),C.createElement("rect",{x:y,y:h,width:m,height:w,pointerEvents:"auto",fill:"transparent",display:f?"block":"none",className:s}),p&&C.createElement("rect",{x:D(y+p.width/2),y:D(h+p.width/2),width:D(m-p.width),height:D(w-p.width),pointerEvents:"auto",fill:"none",strokeWidth:p.width,stroke:p.color,rx:b-2})))}Mn.propTypes={windowWidth:d.number.isRequired,windowHeight:d.number.isRequired,targetWidth:d.number.isRequired,targetHeight:d.number.isRequired,targetTop:d.number.isRequired,targetLeft:d.number.isRequired,padding:d.number.isRequired,rounded:d.number.isRequired,roundedStep:d.bool,disableInteraction:d.bool.isRequired,disableInteractionClassName:d.string.isRequired,highlightedBorder:d.shape({color:d.string.isRequired,width:d.number.isRequired})};var xu=function(e){var t=e.step,n=e.refresh,r=S.useState(0),o=iu(r,2),u=o[0],a=o[1];return S.useEffect(function(){if(t.resizeObservables){var i=function(v){var g=ie(v),p;try{var m=function(){var h=p.value;if(!h.attributes)return 1;var y=t.resizeObservables.find(function(b){return h.matches(b)||h.querySelector(b)!=null});y&&a(u+1)};for(g.s();!(p=g.n()).done;)m()}catch(w){g.e(w)}finally{g.f()}},c=new MutationObserver(function(s){var v=ie(s),g;try{for(v.s();!(g=v.n()).done;){var p=g.value;p.addedNodes.length!==0&&i(p.addedNodes),p.removedNodes.length!==0&&i(p.removedNodes)}}catch(m){v.e(m)}finally{v.f()}}),l=document.documentElement||document.body,f={childList:!0,subtree:!0};return c.observe(l,f),function(){c.disconnect()}}},[t,u]),S.useEffect(function(){if(t.resizeObservables){var i=new ResizeObserver(function(v){n()}),c=ie(t.resizeObservables),l;try{for(c.s();!(l=c.n()).done;){var f=l.value,s=document.querySelector(f);s&&i.observe(s)}}catch(v){c.e(v)}finally{c.f()}return function(){i.disconnect()}}},[t,u]),null},Su=function(e){var t=e.step,n=e.refresh;return S.useEffect(function(){if(t.mutationObservables){var r=function(c){var l=ie(c),f;try{var s=function(){var g=f.value;if(!g.attributes)return 1;var p=t.mutationObservables.find(function(m){return g.matches(m)||g.querySelector(m)!=null});p&&n()};for(l.s();!(f=l.n()).done;)s()}catch(v){l.e(v)}finally{l.f()}},o=new MutationObserver(function(i){var c=ie(i),l;try{for(c.s();!(l=c.n()).done;){var f=l.value;f.addedNodes.length!==0&&r(f.addedNodes),f.removedNodes.length!==0&&r(f.removedNodes)}}catch(s){c.e(s)}finally{c.f()}}),u=document.documentElement||document.body,a={childList:!0,subtree:!0};return o.observe(u,a),function(){o.disconnect()}}},[t]),null};function Ou(e){var t=e.children,n=S.useRef(null);return n.current===null&&(n.current=document.createElement("div"),n.current.setAttribute("id","___reactour")),S.useEffect(function(){return document.body.appendChild(n.current),function(){document.body.removeChild(n.current)}},[n]),zn.createPortal(t,n.current)}var Eu={disableFocusLock:d.bool,badgeContent:d.func,highlightedMaskClassName:d.string,children:d.oneOfType([d.node,d.element]),className:d.string,closeButtonAriaLabel:d.string,closeWithMask:d.bool,inViewThreshold:d.number,isOpen:d.bool.isRequired,lastStepNextButton:d.node,maskClassName:d.string,maskSpace:d.number,nextButton:d.node,onAfterOpen:d.func,onBeforeClose:d.func,onRequestClose:d.func,prevButton:d.node,scrollDuration:d.number,scrollOffset:d.number,showButtons:d.bool,showCloseButton:d.bool,showNavigation:d.bool,showNavigationNumber:d.bool,showNumber:d.bool,startAt:d.number,goToStep:d.number,getCurrentStep:d.func,nextStep:d.func,prevStep:d.func,steps:d.arrayOf(d.shape({selector:d.string,content:d.oneOfType([d.node,d.element,d.func]).isRequired,position:d.oneOfType([d.arrayOf(d.number),d.oneOf(["top","right","bottom","left","center"])]),action:d.func,style:d.object,stepInteraction:d.bool,navDotAriaLabel:d.string,roundedStep:d.bool})),update:d.string,updateDelay:d.number,disableInteraction:d.bool,disableDotsNavigation:d.bool,disableKeyboardNavigation:d.oneOfType([d.arrayOf(d.oneOf(["esc","right","left"])),d.bool]),rounded:d.number,accentColor:d.string,highlightedBorder:d.shape({color:d.string.isRequired,width:d.number.isRequired})},Au={disableFocusLock:!1,showNavigation:!0,showNavigationNumber:!0,showButtons:!0,showCloseButton:!0,closeButtonAriaLabel:"Close",showNumber:!0,scrollDuration:1,maskSpace:10,updateDelay:1,disableInteraction:!1,rounded:0,accentColor:"#007aff",closeWithMask:!0},oe={mask:{disableInteraction:"reactour__mask--disable-interaction"},helper:{base:"reactour__helper",isOpen:"reactour__helper--is-open"},dot:{base:"reactour__dot",active:"reactour__dot--is-active"}},Dn=function(e){function t(){var n;return eu(this,t),n=Zo(this,t),R(n,"unlockFocus",function(r){n.setState({focusUnlocked:!0},r())}),R(n,"showStep",function(){if(!(!n.helper||!n.helper.current)){var r=n.props.steps,o=n.state,u=o.current,a=o.focusUnlocked;a&&n.setState({focusUnlocked:!1});var i=r[u],c=i.selector?document.querySelector(i.selector):null,l=function(p){i.action&&typeof i.action=="function"&&n.unlockFocus(function(){return i.action(p)})};if(i.observe){var f=document.querySelector(i.observe),s={attributes:!0,childList:!0,characterData:!0};n.setState(function(g){return g.observer&&setTimeout(function(){g.observer.disconnect()},0),{observer:new MutationObserver(function(p){p.forEach(function(m){if(m.type==="childList"&&m.addedNodes.length>0){var w=function(){return l(m.addedNodes[0])};setTimeout(function(){return n.calculateNode(m.addedNodes[0],i,w)},100)}else if(m.type==="childList"&&m.removedNodes.length>0){var h=function(){return l(c)};n.calculateNode(c,i,h)}})})}},function(){return n.state.observer.observe(f,s)})}else n.state.observer&&(n.state.observer.disconnect(),n.setState({observer:null}));if(c){var v=function(){return l(c)};n.calculateNode(c,i,v)}else n.setState(De(null,i,n.helper.current),l),i.selector&&console.warn("Doesn't find a DOM node '".concat(i.selector,"'. Please check the 'steps' Tour prop Array at position ").concat(u,"."))}}),R(n,"calculateNode",function(r,o,u){var a=n.props,i=a.scrollDuration,c=a.inViewThreshold,l=a.scrollOffset,f=Pn(r,o),s=Math.max(document.documentElement.clientWidth,window.innerWidth||0),v=Math.max(document.documentElement.clientHeight,window.innerHeight||0);if(du(Se(Se({},f),{},{w:s,h:v,threshold:c})))n.setState(De(r,o,n.helper.current),u);else{var g=pr(r),p=l||(f.height>v?-25:-(v/2)+f.height/2);dr.to(r,{context:vu(g)?window:g,duration:i,offset:p,callback:function(w){n.setState(De(w,o,n.helper.current),u)}})}}),R(n,"recalculateNode",function(r){var o=document.querySelector(r.selector),u=function(i){r.action&&typeof r.action=="function"&&n.unlockFocus(function(){return r.action(i)})};n.calculateNode(o,r,function(){return u(o)})}),R(n,"maskClickHandler",function(r){var o=n.props,u=o.closeWithMask,a=o.onRequestClose;u&&!r.target.classList.contains(oe.mask.disableInteraction)&&a(r)}),R(n,"nextStep",function(){var r=n.props,o=r.steps,u=r.getCurrentStep;n.setState(function(a){var i=a.current0?o.current-1:o.current;return typeof r=="function"&&r(u),{current:u}},n.showStep)}),R(n,"gotoStep",function(r){var o=n.props,u=o.steps,a=o.getCurrentStep;n.setState(function(i){var c=u[r]?r:i.current;return typeof a=="function"&&a(c),{current:c}},n.showStep)}),R(n,"keyDownHandler",function(r){var o=n.props,u=o.onRequestClose,a=o.nextStep,i=o.prevStep,c=o.disableKeyboardNavigation;if(r.stopPropagation(),c!==!0){var l,f,s;c&&(l=c.includes("esc"),f=c.includes("right"),s=c.includes("left")),r.keyCode===27&&!l&&(r.preventDefault(),u()),r.keyCode===39&&!f&&(r.preventDefault(),typeof a=="function"?a():n.nextStep()),r.keyCode===37&&!s&&(r.preventDefault(),typeof i=="function"?i():n.prevStep())}}),n.state={isOpen:!1,current:0,top:0,right:0,bottom:0,left:0,width:0,height:0,w:0,h:0,inDOM:!1,observer:null,focusUnlocked:!1},n.helper=S.createRef(),n.helperElement=null,n.debouncedShowStep=Rr(n.showStep,70),n}return ru(t,e),nu(t,[{key:"componentDidMount",value:function(){var r=this.props,o=r.isOpen,u=r.startAt;o&&this.open(u)}},{key:"UNSAFE_componentWillReceiveProps",value:function(r){var o=this.props,u=o.isOpen,a=o.update,i=o.updateDelay;!u&&r.isOpen?this.open(r.startAt):u&&!r.isOpen&&this.close(),u&&a!==r.update&&(r.steps[this.state.current]?setTimeout(this.showStep,i):this.props.onRequestClose()),u&&r.isOpen&&this.state.current!==r.goToStep&&this.gotoStep(r.goToStep)}},{key:"componentWillUnmount",value:function(){var r=this.props.isOpen;r&&this.close(),this.state.observer&&this.state.observer.disconnect()}},{key:"open",value:function(r){var o=this,u=this.props.onAfterOpen;this.setState(function(a){return{isOpen:!0,current:r!==void 0?r:a.current}},function(){setTimeout(o.showStep,1),o.helperElement=o.helper.current,o.props.disableFocusLock||o.helper.current.focus(),u&&u(o.helperElement)}),window.addEventListener("resize",this.debouncedShowStep,!1),window.addEventListener("keydown",this.keyDownHandler,!1)}},{key:"close",value:function(){this.setState(function(r){return r.observer&&r.observer.disconnect(),{isOpen:!1,observer:null}},this.onBeforeClose),window.removeEventListener("resize",this.debouncedShowStep),window.removeEventListener("keydown",this.keyDownHandler)}},{key:"onBeforeClose",value:function(){var r=this.props.onBeforeClose;r&&r(this.helperElement)}},{key:"render",value:function(){var r=this,o=this.props,u=o.className,a=o.steps,i=o.maskClassName,c=o.showButtons,l=o.showCloseButton,f=o.closeButtonAriaLabel,s=o.showNavigation,v=o.showNavigationNumber,g=o.showNumber,p=o.onRequestClose,m=o.maskSpace,w=o.lastStepNextButton,h=o.nextButton,y=o.prevButton,b=o.badgeContent,k=o.highlightedMaskClassName,E=o.disableInteraction,x=o.disableDotsNavigation,A=o.nextStep,I=o.prevStep,T=o.rounded,W=o.accentColor,L=o.CustomHelper,M=o.disableFocusLock,Q=o.highlightedBorder,_=this.state,$=_.isOpen,O=_.current,V=_.inDOM,U=_.top,Z=_.right,Oe=_.bottom,ee=_.left,te=_.width,me=_.height,ge=_.w,ye=_.h,Ee=_.helperWidth,Ae=_.helperHeight,ke=_.helperPosition;return $?C.createElement(Ou,null,C.createElement(su,null),C.createElement(xu,{step:a[O],refresh:function(){return r.recalculateNode(a[O])}}),C.createElement(Su,{step:a[O],refresh:function(){return r.recalculateNode(a[O])}}),C.createElement(Mn,{onClick:this.maskClickHandler,forwardRef:function(q){return r.mask=q},windowWidth:ge,windowHeight:ye,targetWidth:te,targetHeight:me,targetTop:U,targetLeft:ee,padding:m,rounded:T,roundedStep:a[O].roundedStep,className:i,disableInteraction:a[O].stepInteraction===!1||E?!a[O].stepInteraction:E,disableInteractionClassName:"".concat(oe.mask.disableInteraction," ").concat(k),highlightedBorder:Q}),C.createElement(On,{disabled:M,autoFocus:!1},C.createElement(bu,{ref:this.helper,targetHeight:me,targetWidth:te,targetTop:U,targetRight:Z,targetBottom:Oe,targetLeft:ee,windowWidth:ge,windowHeight:ye,helperWidth:Ee,helperHeight:Ae,helperPosition:ke,padding:m,tabIndex:-1,current:O,style:a[O].style?a[O].style:{},rounded:T,className:gt(oe.helper.base,u,R({},oe.helper.isOpen,$)),accentColor:W,defaultStyles:!L,role:"dialog"},L?C.createElement(L,{current:O,totalSteps:a.length,gotoStep:this.gotoStep,close:p,content:a[O]&&(typeof a[O].content=="function"?a[O].content({close:p,goTo:this.gotoStep,inDOM:V,step:O+1}):a[O].content)},this.props.children):C.createElement(C.Fragment,null,this.props.children,a[O]&&(typeof a[O].content=="function"?a[O].content({close:p,goTo:this.gotoStep,inDOM:V,step:O+1}):a[O].content),g&&C.createElement(mu,{"data-tour-elem":"badge",accentColor:W},typeof b=="function"?b(O+1,a.length):O+1),(c||s)&&C.createElement(gu,{"data-tour-elem":"controls"},c&&C.createElement(Pt,{onClick:typeof I=="function"?I:this.prevStep,disabled:O===0,label:y||null}),s&&C.createElement(yu,{"data-tour-elem":"navigation"},a.map(function(G,q){return C.createElement(wu,{key:"".concat(G.selector?G.selector:"undef","_").concat(q),onClick:function(){return r.gotoStep(q)},current:O,index:q,accentColor:W,disabled:O===q||x,showNumber:v,"data-tour-elem":"dot",className:gt(oe.dot.base,R({},oe.dot.active,O===q)),"aria-label":G.navDotAriaLabel})})),c&&C.createElement(Pt,{onClick:O===a.length-1?w?p:function(){}:typeof A=="function"?A:this.nextStep,disabled:!w&&O===a.length-1,inverted:!0,label:w&&O===a.length-1?w:h||null})),l&&C.createElement(fu,{onClick:p,className:"reactour__close",ariaLabel:f}))))):null}}])}(S.Component),De=function(t,n,r){if(r){var o=Math.max(document.documentElement.clientWidth,window.innerWidth||0),u=Math.max(document.documentElement.clientHeight,window.innerHeight||0),a=we(r),i=a.width,c=a.height,l={top:u+10,right:o/2+9,bottom:u/2+9,left:o/2-i/2,width:0,height:0,w:o,h:u,helperPosition:"center"};return t&&(l=Pn(t,n)),function(){return Se(Se({w:o,h:u,helperWidth:i,helperHeight:c,helperPosition:n.position},l),{},{inDOM:!!t})}}};Dn.propTypes=Eu;Dn.defaultProps=Au;export{Bu as A,Dn as T,ju as a}; diff --git a/build/assets/redux-vendor-B7uoacJt.js b/build/assets/redux-vendor-B7uoacJt.js new file mode 100644 index 0000000..e0c605e --- /dev/null +++ b/build/assets/redux-vendor-B7uoacJt.js @@ -0,0 +1,25 @@ +import{t as Mt}from"./mui-vendor-CkIVaoQP.js";import{r as x,d as Tt}from"./react-vendor-CmFgShSM.js";function $(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n3?t.i-4:t.i:Array.isArray(e)?1:De(e)?2:$e(e)?3:0}function V(e,t){return q(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Nt(e,t){return q(e)===2?e.get(t):e[t]}function lt(e,t,r){var n=q(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function dt(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function De(e){return Ft&&e instanceof Map}function $e(e){return Kt&&e instanceof Set}function W(e){return e.o||e.t}function Ie(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=vt(e);delete t[P];for(var r=G(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=kt),Object.freeze(e),t&&F(e,function(r,n){return Me(n,!0)},!0)),e}function kt(){$(2)}function Te(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function I(e){var t=Ae[e];return t||$(18,e),t}function zt(e,t){Ae[e]||(Ae[e]=t)}function Ee(){return Y}function he(e,t){t&&(I("Patches"),e.u=[],e.s=[],e.v=t)}function ee(e){je(e),e.p.forEach(Lt),e.p=null}function je(e){e===Y&&(Y=e.l)}function Ve(e){return Y={p:[],l:Y,h:e,m:!0,_:0}}function Lt(e){var t=e[P];t.i===0||t.i===1?t.j():t.g=!0}function be(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.O||I("ES5").S(t,e,n),n?(r[P].P&&(ee(t),$(4)),T(e)&&(e=te(t,e),t.l||re(t,e)),t.u&&I("Patches").M(r[P].t,e,t.u,t.s)):e=te(t,r,[]),ee(t),t.u&&t.v(t.u,t.s),e!==pt?e:void 0}function te(e,t,r){if(Te(t))return t;var n=t[P];if(!n)return F(t,function(f,c){return Ge(e,n,t,f,c,r)},!0),t;if(n.A!==e)return t;if(!n.P)return re(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=n.i===4||n.i===5?n.o=Ie(n.k):n.o,u=o,a=!1;n.i===3&&(u=new Set(o),o.clear(),a=!0),F(u,function(f,c){return Ge(e,n,o,f,c,r,a)}),re(e,o,!1),r&&e.u&&I("Patches").N(n,r,e.u,e.s)}return n.o}function Ge(e,t,r,n,o,u,a){if(L(o)){var f=te(e,o,u&&t&&t.i!==3&&!V(t.R,n)?u.concat(n):void 0);if(lt(r,n,f),!L(f))return;e.m=!1}else a&&r.add(o);if(T(o)&&!Te(o)){if(!e.h.D&&e._<1)return;te(e,o),t&&t.A.l||re(e,o)}}function re(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&Me(t,r)}function me(e,t){var r=e[P];return(r?W(r):e)[t]}function He(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function N(e){e.P||(e.P=!0,e.l&&N(e.l))}function ge(e){e.o||(e.o=Ie(e.t))}function xe(e,t,r){var n=De(t)?I("MapSet").F(t,r):$e(t)?I("MapSet").T(t,r):e.O?function(o,u){var a=Array.isArray(o),f={i:a?1:0,A:u?u.A:Ee(),P:!1,I:!1,R:{},l:u,t:o,k:null,o:null,j:null,C:!1},c=f,i=Q;a&&(c=[f],i=J);var s=Proxy.revocable(c,i),l=s.revoke,p=s.proxy;return f.k=p,f.j=l,p}(t,r):I("ES5").J(t,r);return(r?r.A:Ee()).p.push(n),n}function Ut(e){return L(e)||$(22,e),function t(r){if(!T(r))return r;var n,o=r[P],u=q(r);if(o){if(!o.P&&(o.i<4||!I("ES5").K(o)))return o.t;o.I=!0,n=Be(r,u),o.I=!1}else n=Be(r,u);return F(n,function(a,f){o&&Nt(o.t,a)===f||lt(n,a,t(f))}),u===3?new Set(n):n}(e)}function Be(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Ie(e)}function Wt(){function e(u,a){var f=o[u];return f?f.enumerable=a:o[u]=f={configurable:!0,enumerable:a,get:function(){var c=this[P];return Q.get(c,u)},set:function(c){var i=this[P];Q.set(i,u,c)}},f}function t(u){for(var a=u.length-1;a>=0;a--){var f=u[a][P];if(!f.P)switch(f.i){case 5:n(f)&&N(f);break;case 4:r(f)&&N(f)}}}function r(u){for(var a=u.t,f=u.k,c=G(f),i=c.length-1;i>=0;i--){var s=c[i];if(s!==P){var l=a[s];if(l===void 0&&!V(a,s))return!0;var p=f[s],d=p&&p[P];if(d?d.t!==l:!dt(p,l))return!0}}var y=!!a[P];return c.length!==G(a).length+(y?0:1)}function n(u){var a=u.k;if(a.length!==u.t.length)return!0;var f=Object.getOwnPropertyDescriptor(a,a.length-1);if(f&&!f.get)return!0;for(var c=0;c1?b-1:0),w=1;w1?s-1:0),p=1;p=0;o--){var u=n[o];if(u.path.length===0&&u.op==="replace"){r=u.value;break}}o>-1&&(n=n.slice(o+1));var a=I("Patches").$;return L(r)?a(r,n):this.produce(r,function(f){return a(f,n)})},e}(),R=new Gt,yt=R.produce;R.produceWithPatches.bind(R);R.setAutoFreeze.bind(R);R.setUseProxies.bind(R);R.applyPatches.bind(R);R.createDraft.bind(R);R.finishDraft.bind(R);function Ht(e,t,r){return(t=Mt(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ye(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Qe(e){for(var t=1;t"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(j(1));return r(ke)(e,t)}if(typeof e!="function")throw new Error(j(2));var o=e,u=t,a=[],f=a,c=!1;function i(){f===a&&(f=a.slice())}function s(){if(c)throw new Error(j(3));return u}function l(v){if(typeof v!="function")throw new Error(j(4));if(c)throw new Error(j(5));var h=!0;return i(),f.push(v),function(){if(h){if(c)throw new Error(j(6));h=!1,i();var m=f.indexOf(v);f.splice(m,1),a=null}}}function p(v){if(!Bt(v))throw new Error(j(7));if(typeof v.type>"u")throw new Error(j(8));if(c)throw new Error(j(9));try{c=!0,u=o(u,v)}finally{c=!1}for(var h=a=f,b=0;b"u")throw new Error(j(12));if(typeof r(void 0,{type:ne.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(j(13))})}function Xt(e){for(var t=Object.keys(e),r={},n=0;n"u")throw i&&i.type,new Error(j(14));l[d]=h,s=s||h!==v}return s=s||u.length!==Object.keys(c).length,s?l:c}}function oe(){for(var e=arguments.length,t=new Array(e),r=0;r0&&u[u.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!u||i[1]>u[0]&&i[1]=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $r(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,u;for(u=0;u=0)&&(r[o]=e[o]);return r}var Ir=5e3;function xn(e,t){var r=e.version!==void 0?e.version:wr;e.debug;var n=e.stateReconciler===void 0?Pr:e.stateReconciler,o=e.getStoredState||xr,u=e.timeout!==void 0?e.timeout:Ir,a=null,f=!1,c=!0,i=function(l){return l._persist.rehydrated&&a&&!c&&a.update(l),l};return function(s,l){var p=s||{},d=p._persist,y=Dr(p,["_persist"]),v=y;if(l.type===Ot){var h=!1,b=function(K,A){h||(l.rehydrate(e.key,K,A),h=!0)};if(u&&setTimeout(function(){!h&&b(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},u),c=!1,a||(a=Er(e)),d)return M({},t(v,l),{_persist:d});if(typeof l.rehydrate!="function"||typeof l.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return l.register(e.key),o(e).then(function(_){var K=e.migrate||function(A,C){return Promise.resolve(A)};K(_,r).then(function(A){b(A)},function(A){b(void 0,A)})},function(_){b(void 0,_)}),M({},t(v,l),{_persist:{version:r,rehydrated:!1}})}else{if(l.type===St)return f=!0,l.result(Rr(e)),M({},t(v,l),{_persist:d});if(l.type===gt)return l.result(a&&a.flush()),M({},t(v,l),{_persist:d});if(l.type===wt)c=!0;else if(l.type===Ue){if(f)return M({},v,{_persist:M({},d,{rehydrated:!0})});if(l.key===e.key){var m=t(v,l),w=l.payload,g=n!==!1&&w!==void 0?n(w,s,m,e):m,E=M({},g,{_persist:M({},d,{rehydrated:!0})});return i(E)}}}if(!d)return t(s,l);var S=t(v,l);return S===v?s:i(M({},S,{_persist:d}))}}function it(e){return Nr(e)||Tr(e)||Mr()}function Mr(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function Tr(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function Nr(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:Et,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case Pt:return Ce({},t,{registry:[].concat(it(t.registry),[r.key])});case Ue:var n=t.registry.indexOf(r.key),o=it(t.registry);return o.splice(n,1),Ce({},t,{registry:o,bootstrapped:o.length===0});default:return t}};function An(e,t,r){var n=ke(zr,Et,void 0),o=function(c){n.dispatch({type:Pt,key:c})},u=function(c,i,s){var l={type:Ue,payload:i,err:s,key:c};e.dispatch(l),n.dispatch(l)},a=Ce({},n,{purge:function(){var c=[];return e.dispatch({type:St,result:function(s){c.push(s)}}),Promise.all(c)},flush:function(){var c=[];return e.dispatch({type:gt,result:function(s){c.push(s)}}),Promise.all(c)},pause:function(){e.dispatch({type:wt})},persist:function(){e.dispatch({type:Ot,register:o,rehydrate:u})}});return a.persist(),a}var jt={exports:{}},xt={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var B=x;function Lr(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ur=typeof Object.is=="function"?Object.is:Lr,Wr=B.useState,Fr=B.useEffect,Kr=B.useLayoutEffect,Vr=B.useDebugValue;function Gr(e,t){var r=t(),n=Wr({inst:{value:r,getSnapshot:t}}),o=n[0].inst,u=n[1];return Kr(function(){o.value=r,o.getSnapshot=t,Pe(o)&&u({inst:o})},[e,r,t]),Fr(function(){return Pe(o)&&u({inst:o}),e(function(){Pe(o)&&u({inst:o})})},[e]),Vr(r),r}function Pe(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ur(e,r)}catch{return!0}}function Hr(e,t){return t()}var Br=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Hr:Gr;xt.useSyncExternalStore=B.useSyncExternalStore!==void 0?B.useSyncExternalStore:Br;jt.exports=xt;var qr=jt.exports,At={exports:{}},Rt={};/** + * @license React + * use-sync-external-store-shim/with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ue=x,Xr=qr;function Jr(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yr=typeof Object.is=="function"?Object.is:Jr,Qr=Xr.useSyncExternalStore,Zr=ue.useRef,en=ue.useEffect,tn=ue.useMemo,rn=ue.useDebugValue;Rt.useSyncExternalStoreWithSelector=function(e,t,r,n,o){var u=Zr(null);if(u.current===null){var a={hasValue:!1,value:null};u.current=a}else a=u.current;u=tn(function(){function c(d){if(!i){if(i=!0,s=d,d=n(d),o!==void 0&&a.hasValue){var y=a.value;if(o(y,d))return l=y}return l=d}if(y=l,Yr(s,d))return y;var v=n(d);return o!==void 0&&o(y,v)?(s=d,y):(s=d,l=v)}var i=!1,s,l,p=r===void 0?null:r;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,r,n,o]);var f=Qr(e,u[0],u[1]);return en(function(){a.hasValue=!0,a.value=f},[f]),rn(f),f};At.exports=Rt;var nn=At.exports;function on(e){e()}let _t=on;const un=e=>_t=e,an=()=>_t,ft=Symbol.for("react-redux-context"),ct=typeof globalThis<"u"?globalThis:{};function fn(){var e;if(!x.createContext)return{};const t=(e=ct[ft])!=null?e:ct[ft]=new Map;let r=t.get(x.createContext);return r||(r=x.createContext(null),t.set(x.createContext,r)),r}const U=fn();function We(e=U){return function(){return x.useContext(e)}}const Ct=We(),cn=()=>{throw new Error("uSES not initialized!")};let Dt=cn;const sn=e=>{Dt=e},ln=(e,t)=>e===t;function dn(e=U){const t=e===U?Ct:We(e);return function(n,o={}){const{equalityFn:u=ln,stabilityCheck:a=void 0,noopCheck:f=void 0}=typeof o=="function"?{equalityFn:o}:o,{store:c,subscription:i,getServerState:s,stabilityCheck:l,noopCheck:p}=t();x.useRef(!0);const d=x.useCallback({[n.name](v){return n(v)}}[n.name],[n,l,a]),y=Dt(i.addNestedSub,c.getState,s||c.getState,d,u);return x.useDebugValue(y),y}}const Rn=dn();var O={};/** + * @license React + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Fe=Symbol.for("react.element"),Ke=Symbol.for("react.portal"),ie=Symbol.for("react.fragment"),ae=Symbol.for("react.strict_mode"),fe=Symbol.for("react.profiler"),ce=Symbol.for("react.provider"),se=Symbol.for("react.context"),pn=Symbol.for("react.server_context"),le=Symbol.for("react.forward_ref"),de=Symbol.for("react.suspense"),pe=Symbol.for("react.suspense_list"),ve=Symbol.for("react.memo"),ye=Symbol.for("react.lazy"),vn=Symbol.for("react.offscreen"),$t;$t=Symbol.for("react.module.reference");function D(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Fe:switch(e=e.type,e){case ie:case fe:case ae:case de:case pe:return e;default:switch(e=e&&e.$$typeof,e){case pn:case se:case le:case ye:case ve:case ce:return e;default:return t}}case Ke:return t}}}O.ContextConsumer=se;O.ContextProvider=ce;O.Element=Fe;O.ForwardRef=le;O.Fragment=ie;O.Lazy=ye;O.Memo=ve;O.Portal=Ke;O.Profiler=fe;O.StrictMode=ae;O.Suspense=de;O.SuspenseList=pe;O.isAsyncMode=function(){return!1};O.isConcurrentMode=function(){return!1};O.isContextConsumer=function(e){return D(e)===se};O.isContextProvider=function(e){return D(e)===ce};O.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Fe};O.isForwardRef=function(e){return D(e)===le};O.isFragment=function(e){return D(e)===ie};O.isLazy=function(e){return D(e)===ye};O.isMemo=function(e){return D(e)===ve};O.isPortal=function(e){return D(e)===Ke};O.isProfiler=function(e){return D(e)===fe};O.isStrictMode=function(e){return D(e)===ae};O.isSuspense=function(e){return D(e)===de};O.isSuspenseList=function(e){return D(e)===pe};O.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===ie||e===fe||e===ae||e===de||e===pe||e===vn||typeof e=="object"&&e!==null&&(e.$$typeof===ye||e.$$typeof===ve||e.$$typeof===ce||e.$$typeof===se||e.$$typeof===le||e.$$typeof===$t||e.getModuleId!==void 0)};O.typeOf=D;function yn(){const e=an();let t=null,r=null;return{clear(){t=null,r=null},notify(){e(()=>{let n=t;for(;n;)n.callback(),n=n.next})},get(){let n=[],o=t;for(;o;)n.push(o),o=o.next;return n},subscribe(n){let o=!0,u=r={callback:n,next:null,prev:r};return u.prev?u.prev.next=u:t=u,function(){!o||t===null||(o=!1,u.next?u.next.prev=u.prev:r=u.prev,u.prev?u.prev.next=u.next:t=u.next)}}}}const st={notify(){},get:()=>[]};function hn(e,t){let r,n=st,o=0,u=!1;function a(v){s();const h=n.subscribe(v);let b=!1;return()=>{b||(b=!0,h(),l())}}function f(){n.notify()}function c(){y.onStateChange&&y.onStateChange()}function i(){return u}function s(){o++,r||(r=e.subscribe(c),n=yn())}function l(){o--,r&&o===0&&(r(),r=void 0,n.clear(),n=st)}function p(){u||(u=!0,s())}function d(){u&&(u=!1,l())}const y={addNestedSub:a,notifyNestedSubs:f,handleChangeWrapper:c,isSubscribed:i,trySubscribe:p,tryUnsubscribe:d,getListeners:()=>n};return y}const bn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",mn=bn?x.useLayoutEffect:x.useEffect;function _n({store:e,context:t,children:r,serverState:n,stabilityCheck:o="once",noopCheck:u="once"}){const a=x.useMemo(()=>{const i=hn(e);return{store:e,subscription:i,getServerState:n?()=>n:void 0,stabilityCheck:o,noopCheck:u}},[e,n,o,u]),f=x.useMemo(()=>e.getState(),[e]);mn(()=>{const{subscription:i}=a;return i.onStateChange=i.notifyNestedSubs,i.trySubscribe(),f!==e.getState()&&i.notifyNestedSubs(),()=>{i.tryUnsubscribe(),i.onStateChange=void 0}},[a,f]);const c=t||U;return x.createElement(c.Provider,{value:a},r)}function It(e=U){const t=e===U?Ct:We(e);return function(){const{store:n}=t();return n}}const gn=It();function wn(e=U){const t=e===U?gn:It(e);return function(){return t().dispatch}}const Cn=wn();sn(nn.useSyncExternalStoreWithSelector);un(Tt.unstable_batchedUpdates);export{_n as P,Ht as _,jn as a,Xt as b,En as c,Pn as d,xn as e,Rn as f,ke as g,An as p,Re as t,Cn as u}; diff --git a/build/assets/reportFooter-C8jIFeXy.png b/build/assets/reportFooter-C8jIFeXy.png new file mode 100644 index 0000000..4606f24 Binary files /dev/null and b/build/assets/reportFooter-C8jIFeXy.png differ diff --git a/build/assets/reportHeader-2i1CV-AL.png b/build/assets/reportHeader-2i1CV-AL.png new file mode 100644 index 0000000..2a2dd0c Binary files /dev/null and b/build/assets/reportHeader-2i1CV-AL.png differ diff --git a/build/assets/resizeImage-Csf2MO3w.js b/build/assets/resizeImage-Csf2MO3w.js new file mode 100644 index 0000000..74901a9 --- /dev/null +++ b/build/assets/resizeImage-Csf2MO3w.js @@ -0,0 +1 @@ +const g=(n,r)=>{const t=new Image;t.src=URL.createObjectURL(n);let c=1500,o=1500;t.onload=()=>{const e=document.createElement("canvas");e.width=c,e.height=o,e.getContext("2d").drawImage(t,0,0,c,o),e.toBlob(s=>{const a=new FileReader;a.onloadend=()=>{r(a.result)},a.readAsDataURL(s)},n.type,.8)}};export{g as r}; diff --git a/build/assets/signature-D8sU-GQE.png b/build/assets/signature-D8sU-GQE.png new file mode 100644 index 0000000..ae3d4cc Binary files /dev/null and b/build/assets/signature-D8sU-GQE.png differ diff --git a/build/assets/slaughter-get-guilds-for-allocate-B6OrhhMj.js b/build/assets/slaughter-get-guilds-for-allocate-B6OrhhMj.js new file mode 100644 index 0000000..1599da6 --- /dev/null +++ b/build/assets/slaughter-get-guilds-for-allocate-B6OrhhMj.js @@ -0,0 +1 @@ +import{a as o}from"./redux-vendor-B7uoacJt.js";import{L as l,j as n,h as s,X as c}from"./index-CeyyVc1v.js";const A=o("SLAUGHTER_DELETE_ALLOCATED_SERVICE",async(e,{dispatch:t})=>{t(l());const{data:a,status:r}=await n.delete("steward-allocation/0/",{params:{steward_allocation_key:e.steward_allocation_key}});return t(s()),{data:a,status:r}}),_=o("SLAUGHTER_RETURN_ALLOCATED_SERVICE",async(e,{dispatch:t})=>{t(l());try{const{data:a,status:r}=await n.put("return-deleted-allocation/0/",e);return t(s()),{data:a,status:r}}catch(a){return t(s()),{error:a.response.data.result}}}),S=o("SLAUGHTER_ALLOCATE_STEWARD_SERVICE",async(e,{dispatch:t})=>{t(l());try{const{data:a,status:r}=await n.post("steward-allocation/",e);return t(s()),{data:a,status:r}}catch(a){return t(s()),{error:a.response.data.result}}}),L=o("SLAUGHTER_EDIT_ALLOCATION_STEWARD_SERVICE",async(e,{dispatch:t})=>{t(l());try{const{data:a,status:r}=await n.put("steward-allocation/0/",e);return t(s()),{data:a,status:r}}catch(a){return t(s()),{error:a.response.data.result}}}),T=o("SLAUGHTER_GET_GUILDS_FOR_ALLOCATE_SERVICE",async(e,{dispatch:t})=>{t(l());const{data:a,status:r}=await n.get("guilds/",{params:{role:c(),...e}});return t(s()),{data:a,status:r}}),R=o("SLAUGHTER_GET_COLDHOUSES_FOR_ALLOCATE_SERVICE",async(e,{dispatch:t})=>{t(l());const{data:a,status:r}=await n.get("cold-house/",{params:{role:c(),...e}});return t(s()),{data:a,status:r}});export{L as a,A as b,T as c,_ as d,R as e,S as s}; diff --git a/build/assets/slaughter-get-provinces-CSWL-EuK.js b/build/assets/slaughter-get-provinces-CSWL-EuK.js new file mode 100644 index 0000000..3b4ae4b --- /dev/null +++ b/build/assets/slaughter-get-provinces-CSWL-EuK.js @@ -0,0 +1 @@ +import{a as r}from"./redux-vendor-B7uoacJt.js";import{L as n,j as i,h as o}from"./index-CeyyVc1v.js";const E=r("SLAUGHTER_GET_PROVINCE",async(e,{dispatch:a})=>{a(n());const{data:t,status:s}=await i.get("iran_province/");return a(o()),{data:t,status:s}}),G=r("SLAUGHTER_GET_CITIES_OF_PROVINCE",async(e,{dispatch:a})=>{a(n());const{data:t,status:s}=await i.get("iran_city/?name="+e);return a(o()),{data:t,status:s}});export{G as a,E as s}; diff --git a/build/assets/slaughter-house-submit-dispenser-service-AaVrL_nR.js b/build/assets/slaughter-house-submit-dispenser-service-AaVrL_nR.js new file mode 100644 index 0000000..c25a425 --- /dev/null +++ b/build/assets/slaughter-house-submit-dispenser-service-AaVrL_nR.js @@ -0,0 +1 @@ +import{a}from"./redux-vendor-B7uoacJt.js";import{j as n,L as o,h as u}from"./index-CeyyVc1v.js";const S=a("SLAUGHTER_SUBMIT_DISPENSER",async(e,{dispatch:r})=>{try{const{data:s,status:t}=await n.post("dispenser/",e);return r(o()),{data:s,status:t}}catch(s){return r(u()),{error:s.response.data.result}}}),p=a("SLAUGHTER_EDIT_DISPENSER",async(e,{dispatch:r})=>{try{const{data:s,status:t}=await n.put("dispenser/0/",e);return r(o()),{data:s,status:t}}catch(s){return r(u()),{error:s.response.data.result}}});export{p as a,S as s}; diff --git a/build/assets/slaughter-new-request-CTd5pQEl.js b/build/assets/slaughter-new-request-CTd5pQEl.js new file mode 100644 index 0000000..ac51d94 --- /dev/null +++ b/build/assets/slaughter-new-request-CTd5pQEl.js @@ -0,0 +1 @@ +import{a}from"./redux-vendor-B7uoacJt.js";import{j as r,h as u}from"./index-CeyyVc1v.js";const c=a("SLAUGHTER_DELETE_REQUEST",async e=>{const{data:s,status:t}=await r.delete("kill_request/"+e.id);return{data:s,status:t}}),l=a("SLAUGHTER_NEW_REQUEST",async(e,{dispatch:s})=>{try{const{data:t,status:o}=await r.post("kill_request/",e);return{data:t,status:o}}catch(t){return s(u()),{error:t.response.data.result}}});export{c as a,l as s}; diff --git a/build/assets/slaughter-sell-carcass-out-province-BsZg6mNm.js b/build/assets/slaughter-sell-carcass-out-province-BsZg6mNm.js new file mode 100644 index 0000000..e339b7d --- /dev/null +++ b/build/assets/slaughter-sell-carcass-out-province-BsZg6mNm.js @@ -0,0 +1 @@ +import{a as r}from"./redux-vendor-B7uoacJt.js";import{L as o,j as l,X as _,h as c}from"./index-CeyyVc1v.js";const A=r("SLAUGHTRE_SELL_DASHBOARD",async(a,{dispatch:e})=>{e(o());const{data:s,status:t}=await l.get("dashboard_kill_house_free_sale_bar",{params:{date1:a.selectedDate1,date2:a.selectedDate2,role:_()}});return e(c()),{data:s,status:t}});export{A as s}; diff --git a/build/assets/steward-get-dashboard-service-CaN_8BvO.js b/build/assets/steward-get-dashboard-service-CaN_8BvO.js new file mode 100644 index 0000000..ad3515a --- /dev/null +++ b/build/assets/steward-get-dashboard-service-CaN_8BvO.js @@ -0,0 +1 @@ +import{a as n}from"./redux-vendor-B7uoacJt.js";import{L as _,j as o,h as s}from"./index-CeyyVc1v.js";const E=n("SLAUGHTER_EDIT_OUT_OF_PROVINCE_SELL",async(t,{dispatch:a})=>{try{a(_());const{data:r,status:e}=await o.put("kill_house_free_sale_bar/0/",t);return a(s()),{data:r,status:e}}catch(r){return a(s()),{error:r.response.data.result}}}),O=n("GUILD_EDIT_OUT_OF_PROVINCE_SELL",async(t,{dispatch:a})=>{try{a(_());const{data:r,status:e}=await o.put("steward_free_sale_bar/0/",t);return a(s()),{data:r,status:e}}catch(r){return a(s()),{error:r.response.data.result}}}),i=n("STEWARD_GET_SEGMENT_DASHBOARD_SERVICE",async(t,{dispatch:a})=>{a(_());const{data:r,status:e}=await o.get("segmentation-dashboard/",{params:{search:"filter",...t}});return a(s()),{data:r,status:e}});export{i as a,O as g,E as s}; diff --git a/build/assets/steward-sell-out-delete-service-DtW7IkBy.js b/build/assets/steward-sell-out-delete-service-DtW7IkBy.js new file mode 100644 index 0000000..73f57c9 --- /dev/null +++ b/build/assets/steward-sell-out-delete-service-DtW7IkBy.js @@ -0,0 +1 @@ +import{a as _}from"./redux-vendor-B7uoacJt.js";import{L as o,j as n,h as a}from"./index-CeyyVc1v.js";const D=_("STEWARD_DELETE_OUT_OF_PROVINCE_SELL",async(t,{dispatch:e})=>{e(o());try{const{data:r,status:s}=await n.delete(`steward_free_sale_bar/0/?key=${t}`);return e(a()),{data:r,status:s}}catch(r){return e(a()),{error:r}}});export{D as s}; diff --git a/build/assets/styled-components.browser.esm-gS9mh05b.js b/build/assets/styled-components.browser.esm-gS9mh05b.js new file mode 100644 index 0000000..468b847 --- /dev/null +++ b/build/assets/styled-components.browser.esm-gS9mh05b.js @@ -0,0 +1,23 @@ +import{g as qr,b as re,r as Ie}from"./react-vendor-CmFgShSM.js";var Yr={exports:{}};(function(e,t){(function(r){e.exports=r(null)})(function r(n){var a=/^\0+/g,o=/[\0\r\f]/g,i=/: */g,f=/zoo|gra/,p=/([,: ])(transform)/g,g=/,+\s*(?![^(]*[)])/g,y=/ +\s*(?![^(]*[)])/g,d=/ *[\0] */g,l=/,\r+?/g,u=/([\t\r\n ])*\f?&/g,v=/:global\(((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g,x=/\W+/g,I=/@(k\w+)\s*(\S*)\s*/,G=/::(place)/g,z=/:(read-only)/g,_=/\s+(?=[{\];=:>])/g,B=/([[}=:>])\s+/g,ne=/(\{[^{]+?);(?=\})/g,we=/\s{2,}/g,Ae=/([^\(])(:+) */g,Te=/[svh]\w+-[tblr]{2}/,Cn=/\(\s*(.*)\s*\)/g,wn=/([\s\S]*?);/g,ur=/-self|flex-/g,An=/[^]*?(:[rp][el]a[\w-]+)[^]*/,xn=/stretch|:\s*\w+\-(?:conte|avail)/,kn=/([^-])(image-set\()/,T="-webkit-",Ne="-moz-",Y="-ms-",ae=59,Ee=125,Me=123,xe=40,Re=41,Ue=91,In=93,me=10,$e=13,ve=9,Ge=64,U=32,Nt=38,V=45,On=95,ce=42,ge=44,le=58,Ve=39,et=34,ee=47,tt=62,rt=43,nt=126,at=0,fr=12,Pn=11,ot=107,Et=109,dr=115,pr=112,hr=111,Tn=105,Nn=99,mr=100,En=112,oe=1,ye=1,be=0,se=1,te=1,Mt=1,vr=0,gr=0,Rt=0,$t=[],_t=[],ue=0,jt=null,Mn=-2,Rn=-1,$n=0,_n=1,jn=2,Fn=3,yr=0,We=1,st="",Se="",ze="";function Ft(b,m,h,C,c){for(var N,s,O=0,w=0,F=0,A=0,D=0,M=0,k=0,q=0,X=0,je=0,K=0,fe=0,ct=0,ie=0,P=0,J=0,Fe=0,Ye=0,R=0,ke=h.length,Xe=ke-1,W="",S="",$="",j="",lt="",Bt="";P0&&(S=S.replace(o,"")),S.trim().length>0)){switch(k){case U:case ve:case ae:case $e:case me:break;default:S+=h.charAt(P)}k=ae}if(Fe===1)switch(k){case Me:case Ee:case ae:case et:case Ve:case xe:case Re:case ge:Fe=0;case ve:case $e:case me:case U:break;default:for(Fe=0,R=P,D=k,P--,k=ae;R0&&(++P,k=D);case Me:R=ke}}switch(k){case Me:for(D=(S=S.trim()).charCodeAt(0),K=1,R=++P;P0&&(S=S.replace(o,"")),M=S.charCodeAt(1)){case mr:case Et:case dr:case V:N=m;break;default:N=$t}if(R=($=Ft(m,N,$,M,c+1)).length,Rt>0&&R===0&&(R=S.length),ue>0&&(N=br($t,S,Ye),s=_e(Fn,$,N,m,ye,oe,R,M,c,C),S=N.join(""),s!==void 0&&(R=($=s.trim()).length)===0&&(M=0,$="")),R>0)switch(M){case dr:S=S.replace(Cn,Dn);case mr:case Et:case V:$=S+"{"+$+"}";break;case ot:$=(S=S.replace(I,"$1 $2"+(We>0?st:"")))+"{"+$+"}",te===1||te===2&&it("@"+$,3)?$="@"+T+$+"@"+$:$="@"+$;break;default:$=S+$,C===En&&(j+=$,$="")}else $="";break;default:$=Ft(m,br(m,S,Ye),$,C,c+1)}lt+=$,fe=0,Fe=0,ie=0,J=0,Ye=0,ct=0,S="",$="",k=h.charCodeAt(++P);break;case Ee:case ae:if((R=(S=(J>0?S.replace(o,""):S).trim()).length)>1)switch(ie===0&&((D=S.charCodeAt(0))===V||D>96&&D<123)&&(R=(S=S.replace(" ",":")).length),ue>0&&(s=_e(_n,S,m,b,ye,oe,j.length,C,c,C))!==void 0&&(R=(S=s.trim()).length)===0&&(S="\0\0"),D=S.charCodeAt(0),M=S.charCodeAt(1),D){case at:break;case Ge:if(M===Tn||M===Nn){Bt+=S+h.charAt(P);break}default:if(S.charCodeAt(R-1)===le)break;j+=Dt(S,D,M,S.charCodeAt(2))}fe=0,Fe=0,ie=0,J=0,Ye=0,S="",k=h.charCodeAt(++P)}}switch(k){case $e:case me:if(w+A+F+O+gr===0)switch(je){case Re:case Ve:case et:case Ge:case nt:case tt:case ce:case rt:case ee:case V:case le:case ge:case ae:case Me:case Ee:break;default:ie>0&&(Fe=1)}w===ee?w=0:se+fe===0&&C!==ot&&S.length>0&&(J=1,S+="\0"),ue*yr>0&&_e($n,S,m,b,ye,oe,j.length,C,c,C),oe=1,ye++;break;case ae:case Ee:if(w+A+F+O===0){oe++;break}default:switch(oe++,W=h.charAt(P),k){case ve:case U:if(A+O+w===0)switch(q){case ge:case le:case ve:case U:W="";break;default:k!==U&&(W=" ")}break;case at:W="\\0";break;case fr:W="\\f";break;case Pn:W="\\v";break;case Nt:A+w+O===0&&se>0&&(Ye=1,J=1,W="\f"+W);break;case 108:if(A+w+O+be===0&&ie>0)switch(P-ie){case 2:q===pr&&h.charCodeAt(P-3)===le&&(be=q);case 8:X===hr&&(be=X)}break;case le:A+w+O===0&&(ie=P);break;case ge:w+F+A+O===0&&(J=1,W+="\r");break;case et:case Ve:w===0&&(A=A===k?0:A===0?k:A);break;case Ue:A+w+F===0&&O++;break;case In:A+w+F===0&&O--;break;case Re:A+w+O===0&&F--;break;case xe:if(A+w+O===0){if(fe===0)switch(2*q+3*X){case 533:break;default:K=0,fe=1}F++}break;case Ge:w+F+A+O+ie+ct===0&&(ct=1);break;case ce:case ee:if(A+O+F>0)break;switch(w){case 0:switch(2*k+3*h.charCodeAt(P+1)){case 235:w=ee;break;case 220:R=P,w=ce}break;case ce:k===ee&&q===ce&&R+2!==P&&(h.charCodeAt(R+2)===33&&(j+=h.substring(R,P+1)),W="",w=0)}}if(w===0){if(se+A+O+ct===0&&C!==ot&&k!==ae)switch(k){case ge:case nt:case tt:case rt:case Re:case xe:if(fe===0){switch(q){case ve:case U:case me:case $e:W+="\0";break;default:W="\0"+W+(k===ge?"":"\0")}J=1}else switch(k){case xe:ie+7===P&&q===108&&(ie=0),fe=++K;break;case Re:(fe=--K)==0&&(J=1,W+="\0")}break;case ve:case U:switch(q){case at:case Me:case Ee:case ae:case ge:case fr:case ve:case U:case me:case $e:break;default:fe===0&&(J=1,W+="\0")}}S+=W,k!==U&&k!==ve&&(je=k)}}X=q,q=k,P++}if(R=j.length,Rt>0&&R===0&<.length===0&&m[0].length!==0&&(C!==Et||m.length===1&&(se>0?Se:ze)===m[0])&&(R=m.join(",").length+2),R>0){if(N=se===0&&C!==ot?function(Cr){for(var de,H,ut=0,wr=Cr.length,Ar=Array(wr);ut1)){if(xr=ft.charCodeAt(ft.length-1),kr=H.charCodeAt(0),de="",De!==0)switch(xr){case ce:case nt:case tt:case rt:case U:case xe:break;default:de=" "}switch(kr){case Nt:H=de+Se;case nt:case tt:case rt:case U:case Re:case xe:break;case Ue:H=de+H+Se;break;case le:switch(2*H.charCodeAt(1)+3*H.charCodeAt(2)){case 530:if(Mt>0){H=de+H.substring(8,Gt-1);break}default:(De<1||Ht[De-1].length<1)&&(H=de+Se+H)}break;case ge:de="";default:Gt>1&&H.indexOf(":")>0?H=de+H.replace(Ae,"$1"+Se+"$2"):H=de+H+Se}ft+=H}Ar[ut]=ft.replace(o,"").trim()}return Ar}(m):m,ue>0&&(s=_e(jn,j,N,b,ye,oe,R,C,c,C))!==void 0&&(j=s).length===0)return Bt+j+lt;if(j=N.join(",")+"{"+j+"}",te*be!=0){switch(te===2&&!it(j,2)&&(be=0),be){case hr:j=j.replace(z,":"+Ne+"$1")+j;break;case pr:j=j.replace(G,"::"+T+"input-$1")+j.replace(G,"::"+Ne+"$1")+j.replace(G,":"+Y+"input-$1")+j}be=0}}return Bt+j+lt}function br(b,m,h){var C=m.trim().split(l),c=C,N=C.length,s=b.length;switch(s){case 0:case 1:for(var O=0,w=s===0?"":b[0]+" ";O0&&se>0)return c.replace(v,"$1").replace(u,"$1"+ze);break;default:return b.trim()+c.replace(u,"$1"+b.trim())}default:if(h*se>0&&c.indexOf("\f")>0)return c.replace(u,(b.charCodeAt(0)===le?"":"$1")+b.trim())}return b+c}function Dt(b,m,h,C){var c,N=0,s=b+";",O=2*m+3*h+4*C;if(O===944)return function(w){var F=w.length,A=w.indexOf(":",9)+1,D=w.substring(0,A).trim(),M=w.substring(A,F-1).trim();switch(w.charCodeAt(9)*We){case 0:break;case V:if(w.charCodeAt(10)!==110)break;default:for(var k=M.split((M="",g)),q=0,A=0,F=k.length;qGe&&K<90||K>96&&K<123||K===On||K===V&&X.charCodeAt(1)!==V))switch(isNaN(parseFloat(X))+(X.indexOf("(")!==-1)){case 1:switch(X){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reverse":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:X+=st}}je[A++]=X}M+=(q===0?"":",")+je.join(" ")}}return M=D+M+";",te===1||te===2&&it(M,1)?T+M+M:M}(s);if(te===0||te===2&&!it(s,1))return s;switch(O){case 1015:return s.charCodeAt(10)===97?T+s+s:s;case 951:return s.charCodeAt(3)===116?T+s+s:s;case 963:return s.charCodeAt(5)===110?T+s+s:s;case 1009:if(s.charCodeAt(4)!==100)break;case 969:case 942:return T+s+s;case 978:return T+s+Ne+s+s;case 1019:case 983:return T+s+Ne+s+Y+s+s;case 883:return s.charCodeAt(8)===V?T+s+s:s.indexOf("image-set(",11)>0?s.replace(kn,"$1"+T+"$2")+s:s;case 932:if(s.charCodeAt(4)===V)switch(s.charCodeAt(5)){case 103:return T+"box-"+s.replace("-grow","")+T+s+Y+s.replace("grow","positive")+s;case 115:return T+s+Y+s.replace("shrink","negative")+s;case 98:return T+s+Y+s.replace("basis","preferred-size")+s}return T+s+Y+s+s;case 964:return T+s+Y+"flex-"+s+s;case 1023:if(s.charCodeAt(8)!==99)break;return c=s.substring(s.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),T+"box-pack"+c+T+s+Y+"flex-pack"+c+s;case 1005:return f.test(s)?s.replace(i,":"+T)+s.replace(i,":"+Ne)+s:s;case 1e3:switch(N=(c=s.substring(13).trim()).indexOf("-")+1,c.charCodeAt(0)+c.charCodeAt(N)){case 226:c=s.replace(Te,"tb");break;case 232:c=s.replace(Te,"tb-rl");break;case 220:c=s.replace(Te,"lr");break;default:return s}return T+s+Y+c+s;case 1017:if(s.indexOf("sticky",9)===-1)return s;case 975:switch(N=(s=b).length-10,O=(c=(s.charCodeAt(N)===33?s.substring(0,N):s).substring(b.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|c.charCodeAt(7))){case 203:if(c.charCodeAt(8)<111)break;case 115:s=s.replace(c,T+c)+";"+s;break;case 207:case 102:s=s.replace(c,T+(O>102?"inline-":"")+"box")+";"+s.replace(c,T+c)+";"+s.replace(c,Y+c+"box")+";"+s}return s+";";case 938:if(s.charCodeAt(5)===V)switch(s.charCodeAt(6)){case 105:return c=s.replace("-items",""),T+s+T+"box-"+c+Y+"flex-"+c+s;case 115:return T+s+Y+"flex-item-"+s.replace(ur,"")+s;default:return T+s+Y+"flex-line-pack"+s.replace("align-content","").replace(ur,"")+s}break;case 973:case 989:if(s.charCodeAt(3)!==V||s.charCodeAt(4)===122)break;case 931:case 953:if(xn.test(b)===!0)return(c=b.substring(b.indexOf(":")+1)).charCodeAt(0)===115?Dt(b.replace("stretch","fill-available"),m,h,C).replace(":fill-available",":stretch"):s.replace(c,T+c)+s.replace(c,Ne+c.replace("fill-",""))+s;break;case 962:if(s=T+s+(s.charCodeAt(5)===102?Y+s:"")+s,h+C===211&&s.charCodeAt(13)===105&&s.indexOf("transform",10)>0)return s.substring(0,s.indexOf(";",27)+1).replace(p,"$1"+T+"$2")+s}return s}function it(b,m){var h=b.indexOf(m===1?":":"{"),C=b.substring(0,m!==3?h:10),c=b.substring(h+1,b.length-1);return jt(m!==2?C:C.replace(An,"$1"),c,m)}function Dn(b,m){var h=Dt(m,m.charCodeAt(0),m.charCodeAt(1),m.charCodeAt(2));return h!==m+";"?h.replace(wn," or ($1)").substring(4):"("+m+")"}function _e(b,m,h,C,c,N,s,O,w,F){for(var A,D=0,M=m;D0&&(st=h.replace(x,C===Ue?"":"-")),C=1,se===1?ze=h:Se=h;var c,N=[ze];ue>0&&(c=_e(Rn,m,N,N,ye,oe,0,0,0,0))!==void 0&&typeof c=="string"&&(m=c);var s=Ft($t,N,m,0,0);return ue>0&&(c=_e(Mn,s,N,N,ye,oe,s.length,0,0,0))!==void 0&&typeof(s=c)!="string"&&(C=0),st="",ze="",Se="",be=0,ye=1,oe=1,vr*C==0?s:s.replace(o,"").replace(_,"").replace(B,"$1").replace(ne,"$1").replace(we," ")}return qe.use=function b(m){switch(m){case void 0:case null:ue=_t.length=0;break;default:if(typeof m=="function")_t[ue++]=m;else if(typeof m=="object")for(var h=0,C=m.length;h=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},Be=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},tr=function(e){return(typeof e>"u"?"undefined":en(e))==="object"&&e.constructor===Object},ht=Object.freeze([]),Ze=Object.freeze({});function pe(e){return typeof e=="function"}function tn(e){return e.displayName||e.name||"Component"}function na(e){return typeof e=="function"&&!(e.prototype&&e.prototype.isReactComponent)}function Pt(e){return e&&typeof e.styledComponentId=="string"}var Qe=typeof process<"u"&&(pt.REACT_APP_SC_ATTR||pt.SC_ATTR)||"data-styled",Tt="data-styled-version",aa="data-styled-streamed",Oe=typeof window<"u"&&"HTMLElement"in window,rn=typeof SC_DISABLE_SPEEDY=="boolean"&&SC_DISABLE_SPEEDY||typeof process<"u"&&(pt.REACT_APP_SC_DISABLE_SPEEDY||pt.SC_DISABLE_SPEEDY)||!1,oa={},Ce=function(e){Je(t,e);function t(r){he(this,t);for(var n=arguments.length,a=Array(n>1?n-1:0),o=1;o0?" Additional arguments: "+a.join(", "):"")));return Be(i)}return t}(Error),sa=/^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm,ia=function(e){var t=""+(e||""),r=[];return t.replace(sa,function(n,a,o){return r.push({componentId:a,matchIndex:o}),n}),r.map(function(n,a){var o=n.componentId,i=n.matchIndex,f=r[a+1],p=f?t.slice(i,f.matchIndex):t.slice(i);return{componentId:o,cssFromDOM:p}})},ca=/^\s*\/\/.*$/gm,nn=new Xr({global:!1,cascade:!0,keyframe:!1,prefix:!1,compress:!1,semicolon:!0}),an=new Xr({global:!1,cascade:!0,keyframe:!1,prefix:!0,compress:!1,semicolon:!1}),Xt=[],on=function(t){if(t===-2){var r=Xt;return Xt=[],r}},sn=Gn(function(e){Xt.push(e)}),cn=void 0,Le=void 0,ln=void 0,la=function(t,r,n){return r>0&&n.slice(0,r).indexOf(Le)!==-1&&n.slice(r-Le.length,r)!==Le?"."+cn:t},ua=function(t,r,n){t===2&&n.length&&n[0].lastIndexOf(Le)>0&&(n[0]=n[0].replace(ln,la))};an.use([ua,sn,on]);nn.use([sn,on]);var fa=function(t){return nn("",t)};function un(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"&",a=e.join("").replace(ca,""),o=t&&r?r+" "+t+" { "+a+" }":a;return cn=n,Le=t,ln=new RegExp("\\"+Le+"\\b","g"),an(t||"",o)}var rr=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null},nr=function(t,r,n){if(n){var a=t[r]||(t[r]=Object.create(null));a[n]=!0}},mt=function(t,r){t[r]=Object.create(null)},ar=function(t){return function(r,n){return t[r]!==void 0&&t[r][n]}},fn=function(t){var r="";for(var n in t)r+=Object.keys(t[n]).join(" ")+" ";return r.trim()},da=function(t){var r=Object.create(null);for(var n in t)r[n]=Z({},t[n]);return r},Wt=function(t){if(t.sheet)return t.sheet;for(var r=t.ownerDocument.styleSheets.length,n=0;na;o-=1)t.deleteRule(o)},or=function(t){return` +/* sc-component-id: `+t+` */ +`},zt=function(t,r){for(var n=0,a=0;a<=r;a+=1)n+=t[a];return n},ma=function(t,r,n){var a=document;t?a=t.ownerDocument:r&&(a=r.ownerDocument);var o=a.createElement("style");o.setAttribute(Qe,""),o.setAttribute(Tt,"4.4.1");var i=rr();if(i&&o.setAttribute("nonce",i),o.appendChild(a.createTextNode("")),t&&!r)t.appendChild(o);else{if(!r||!t||!r.parentNode)throw new Ce(6);r.parentNode.insertBefore(o,n?r:r.nextSibling)}return o},sr=function(t,r){return function(n){var a=rr(),o=[a&&'nonce="'+a+'"',Qe+'="'+fn(r)+'"',Tt+'="4.4.1"',n],i=o.filter(Boolean).join(" ");return""}},ir=function(t,r){return function(){var n,a=(n={},n[Qe]=fn(r),n[Tt]="4.4.1",n),o=rr();return o&&(a.nonce=o),re.createElement("style",Z({},a,{dangerouslySetInnerHTML:{__html:t()}}))}},cr=function(t){return function(){return Object.keys(t)}},va=function(t,r){var n=Object.create(null),a=Object.create(null),o=[],i=r!==void 0,f=!1,p=function(u){var v=a[u];return v!==void 0?v:(a[u]=o.length,o.push(0),mt(n,u),a[u])},g=function(u,v,x){for(var I=p(u),G=Wt(t),z=zt(o,I),_=0,B=[],ne=v.length,we=0;we0&&(f=!0,r().insertRules(u+"-import",B)),o[I]+=_,nr(n,u,x)},y=function(u){var v=a[u];if(v!==void 0&&t.isConnected!==!1){var x=o[v],I=Wt(t),G=zt(o,v)-1;ha(I,G,x),o[v]=0,mt(n,u),i&&f&&r().removeRules(u+"-import")}},d=function(){var u=Wt(t),v=u.cssRules,x="";for(var I in a){x+=or(I);for(var G=a[I],z=zt(o,G),_=o[G],B=z-_;B0&&(i=!0,r().insertRules(l+"-import",I))},g=function(l){var u=a[l];if(u!==void 0){var v=Rr(t.ownerDocument,l);t.replaceChild(v,u),a[l]=v,mt(n,l),o&&i&&r().removeRules(l+"-import")}},y=function(){var l="";for(var u in a)l+=a[u].data;return l};return{clone:function(){throw new Ce(5)},css:y,getIds:cr(a),hasNameForId:ar(n),insertMarker:f,insertRules:p,removeRules:g,sealed:!1,styleTag:t,toElement:ir(y,n),toHTML:sr(y,n)}},ya=function e(t,r){var n=t===void 0?Object.create(null):t,a=r===void 0?Object.create(null):r,o=function(l){var u=a[l];return u!==void 0?u:a[l]=[""]},i=function(l,u,v){var x=o(l);x[0]+=u.join(" "),nr(n,l,v)},f=function(l){var u=a[l];u!==void 0&&(u[0]="",mt(n,l))},p=function(){var l="";for(var u in a){var v=a[u][0];v&&(l+=or(u)+v)}return l},g=function(){var l=da(n),u=Object.create(null);for(var v in a)u[v]=[a[v][0]];return e(l,u)},y={clone:g,css:p,getIds:cr(a),hasNameForId:ar(n),insertMarker:o,insertRules:i,removeRules:f,sealed:!1,styleTag:null,toElement:ir(p,n),toHTML:sr(p,n)};return y},$r=function(t,r,n,a,o){if(Oe&&!n){var i=ma(t,r,a);return rn?ga(i,o):va(i,o)}return ya()},ba=function(t,r,n){for(var a=0,o=n.length;a0&&arguments[0]!==void 0?arguments[0]:Oe?document.head:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;he(this,e),this.getImportRuleTag=function(){var a=t.importRuleTag;if(a!==void 0)return a;var o=t.tags[0],i=!0;return t.importRuleTag=$r(t.target,o?o.styleTag:null,t.forceServer,i)},_r+=1,this.id=_r,this.forceServer=n,this.target=n?null:r,this.tagMap={},this.deferred={},this.rehydratedNames={},this.ignoreRehydratedNames={},this.tags=[],this.capacity=1,this.clones=[]}return e.prototype.rehydrate=function(){if(!Oe||this.forceServer)return this;var r=[],n=[],a=!1,o=document.querySelectorAll("style["+Qe+"]["+Tt+'="4.4.1"]'),i=o.length;if(!i)return this;for(var f=0;f0&&arguments[0]!==void 0?arguments[0]:!1;qt=new e(void 0,r).rehydrate()},e.prototype.clone=function(){var r=new e(this.target,this.forceServer);return this.clones.push(r),r.tags=this.tags.map(function(n){for(var a=n.getIds(),o=n.clone(),i=0;i1?t-1:0),n=1;n2&&arguments[2]!==void 0?arguments[2]:Ze;if(!Jr.isValidElementType(t))throw new Ce(1,String(t));var n=function(){return e(t,r,pn.apply(void 0,arguments))};return n.withConfig=function(a){return Kt(e,t,Z({},r,a))},n.attrs=function(a){return Kt(e,t,Z({},r,{attrs:Array.prototype.concat(r.attrs,a).filter(Boolean)}))},n}function hn(e){for(var t=e.length|0,r=t|0,n=0,a;t>=4;)a=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,a=1540483477*(a&65535)+((1540483477*(a>>>16)&65535)<<16),a^=a>>>24,a=1540483477*(a&65535)+((1540483477*(a>>>16)&65535)<<16),r=1540483477*(r&65535)+((1540483477*(r>>>16)&65535)<<16)^a,t-=4,++n;switch(t){case 3:r^=(e.charCodeAt(n+2)&255)<<16;case 2:r^=(e.charCodeAt(n+1)&255)<<8;case 1:r^=e.charCodeAt(n)&255,r=1540483477*(r&65535)+((1540483477*(r>>>16)&65535)<<16)}return r^=r>>>13,r=1540483477*(r&65535)+((1540483477*(r>>>16)&65535)<<16),(r^r>>>15)>>>0}var dt=52,Fr=function(t){return String.fromCharCode(t+(t>25?39:97))};function Ia(e){var t="",r=void 0;for(r=e;r>dt;r=Math.floor(r/dt))t=Fr(r%dt)+t;return Fr(r%dt)+t}function Oa(e){for(var t in e)if(pe(e[t]))return!0;return!1}function lr(e,t){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:Ze,n=r?e.theme===r.theme:!1,a=e.theme&&!n?e.theme:t||r.theme;return a},Pa=/[[\].#*$><+~=|^:(),"'`-]+/g,Ta=/(^-|-$)/g;function Zt(e){return e.replace(Pa,"-").replace(Ta,"")}function gt(e){return typeof e=="string"&&!0}function Na(e){return gt(e)?"styled."+e:"Styled("+tn(e)+")"}var Yt,Br={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},Ea={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Hr=(Yt={},Yt[Jr.ForwardRef]={$$typeof:!0,render:!0},Yt),Ma=Object.defineProperty,Ra=Object.getOwnPropertyNames,Gr=Object.getOwnPropertySymbols,$a=Gr===void 0?function(){return[]}:Gr,_a=Object.getOwnPropertyDescriptor,ja=Object.getPrototypeOf,Fa=Object.prototype,Da=Array.prototype;function vn(e,t,r){if(typeof t!="string"){var n=ja(t);n&&n!==Fa&&vn(e,n,r);for(var a=Da.concat(Ra(t),$a(t)),o=Hr[e.$$typeof]||Br,i=Hr[t.$$typeof]||Br,f=a.length,p=void 0,g=void 0;f--;)if(g=a[f],!Ea[g]&&!(r&&r[g])&&!(i&&i[g])&&!(o&&o[g])&&(p=_a(t,g),p))try{Ma(e,g,p)}catch{}return e}return e}function La(e){return!!(e&&e.prototype&&e.prototype.isReactComponent)}var Qt=Ie.createContext(),gn=Qt.Consumer,qa=function(e){Je(t,e);function t(r){he(this,t);var n=Be(this,e.call(this,r));return n.getContext=Ur(n.getContext.bind(n)),n.renderInner=n.renderInner.bind(n),n}return t.prototype.render=function(){return this.props.children?re.createElement(Qt.Consumer,null,this.renderInner):null},t.prototype.renderInner=function(n){var a=this.getContext(this.props.theme,n);return re.createElement(Qt.Provider,{value:a},this.props.children)},t.prototype.getTheme=function(n,a){if(pe(n)){var o=n(a);return o}if(n===null||Array.isArray(n)||(typeof n>"u"?"undefined":en(n))!=="object")throw new Ce(8);return Z({},a,n)},t.prototype.getContext=function(n,a){return this.getTheme(n,a)},t}(Ie.Component),yn=Ie.createContext(),bn=yn.Consumer;(function(e){Je(t,e);function t(r){he(this,t);var n=Be(this,e.call(this,r));return n.getContext=Ur(n.getContext),n}return t.prototype.getContext=function(n,a){if(n)return n;if(a)return new Pe(a);throw new Ce(4)},t.prototype.render=function(){var n=this.props,a=n.children,o=n.sheet,i=n.target;return re.createElement(yn.Provider,{value:this.getContext(o,i)},a)},t})(Ie.Component);var Wr={};function Ba(e,t,r){var n=typeof t!="string"?"sc":Zt(t),a=(Wr[n]||0)+1;Wr[n]=a;var o=n+"-"+e.generateName(n+a);return r?r+"-"+o:o}var Ha=function(e){Je(t,e);function t(){he(this,t);var r=Be(this,e.call(this));return r.attrs={},r.renderOuter=r.renderOuter.bind(r),r.renderInner=r.renderInner.bind(r),r}return t.prototype.render=function(){return re.createElement(bn,null,this.renderOuter)},t.prototype.renderOuter=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Pe.master;return this.styleSheet=n,this.props.forwardedComponent.componentStyle.isStatic?this.renderInner():re.createElement(gn,null,this.renderInner)},t.prototype.renderInner=function(n){var a=this.props.forwardedComponent,o=a.componentStyle,i=a.defaultProps;a.displayName;var f=a.foldedComponentIds,p=a.styledComponentId,g=a.target,y=void 0;o.isStatic?y=this.generateAndInjectStyles(Ze,this.props):y=this.generateAndInjectStyles(mn(this.props,n,i)||Ze,this.props);var d=this.props.as||this.attrs.as||g,l=gt(d),u={},v=Z({},this.props,this.attrs),x=void 0;for(x in v)x==="forwardedComponent"||x==="as"||(x==="forwardedRef"?u.ref=v[x]:x==="forwardedAs"?u.as=v[x]:(!l||Vn(x))&&(u[x]=v[x]));return this.props.style&&this.attrs.style&&(u.style=Z({},this.attrs.style,this.props.style)),u.className=Array.prototype.concat(f,p,y!==p?y:null,this.props.className,this.attrs.className).filter(Boolean).join(" "),Ie.createElement(d,u)},t.prototype.buildExecutionContext=function(n,a,o){var i=this,f=Z({},a,{theme:n});return o.length&&(this.attrs={},o.forEach(function(p){var g=p,y=!1,d=void 0,l=void 0;pe(g)&&(g=g(f),y=!0);for(l in g)d=g[l],y||pe(d)&&!La(d)&&!Pt(d)&&(d=d(f)),i.attrs[l]=d,f[l]=d})),f},t.prototype.generateAndInjectStyles=function(n,a){var o=a.forwardedComponent,i=o.attrs,f=o.componentStyle;if(o.warnTooManyClasses,f.isStatic&&!i.length)return f.generateAndInjectStyles(Ze,this.styleSheet);var p=f.generateAndInjectStyles(this.buildExecutionContext(n,a,i),this.styleSheet);return p},t}(Ie.Component);function Sn(e,t,r){var n=Pt(e),a=!gt(e),o=t.displayName,i=o===void 0?Na(e):o,f=t.componentId,p=f===void 0?Ba(Lr,t.displayName,t.parentComponentId):f,g=t.ParentComponent,y=g===void 0?Ha:g,d=t.attrs,l=d===void 0?ht:d,u=t.displayName&&t.componentId?Zt(t.displayName)+"-"+t.componentId:t.componentId||p,v=n&&e.attrs?Array.prototype.concat(e.attrs,l).filter(Boolean):l,x=new Lr(n?e.componentStyle.rules.concat(r):r,v,u),I=void 0,G=function(_,B){return re.createElement(y,Z({},_,{forwardedComponent:I,forwardedRef:B}))};return G.displayName=i,I=re.forwardRef(G),I.displayName=i,I.attrs=v,I.componentStyle=x,I.foldedComponentIds=n?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):ht,I.styledComponentId=u,I.target=n?e.target:e,I.withComponent=function(_){var B=t.componentId,ne=ra(t,["componentId"]),we=B&&B+"-"+(gt(_)?_:Zt(tn(_))),Ae=Z({},ne,{attrs:v,componentId:we,ParentComponent:y});return Sn(_,Ae,r)},Object.defineProperty(I,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(_){this._foldedDefaultProps=n?ea(e.defaultProps,_):_}}),I.toString=function(){return"."+I.styledComponentId},a&&vn(I,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,styledComponentId:!0,target:!0,withComponent:!0}),I}var Ga=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],zr=function(t){return Kt(Sn,t)};Ga.forEach(function(e){zr[e]=zr(e)});var Wa=function(){function e(t,r){he(this,e),this.rules=t,this.componentId=r,this.isStatic=lr(t,ht),Pe.master.hasId(r)||Pe.master.deferredInject(r,[])}return e.prototype.createStyles=function(r,n){var a=He(this.rules,r,n),o=un(a,"");n.inject(this.componentId,o)},e.prototype.removeStyles=function(r){var n=this.componentId;r.hasId(n)&&r.remove(n)},e.prototype.renderStyles=function(r,n){this.removeStyles(n),this.createStyles(r,n)},e}();Oe&&(window.scCGSHMRCache={});function Ya(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n0&&a[a.length-1])&&(s[0]===6||s[0]===2)){u=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]=u&&e.height>=c)return!0;break}}return!1},t.isImageValid=function(e){return!!e.includes("image")},t.isMaxFileSizeValid=function(e,o){return o?e<=o:!0},t.isAcceptTypeValid=function(e,o){if(e&&e.length>0){var u=o.split(".").pop()||"";if(e.findIndex(function(c){return c.toLowerCase()===u.toLowerCase()})<0)return!1}return!0},t.isMaxNumberValid=function(e,o,u){if(o!==0&&!o)return!0;if(u===l.DEFAULT_NULL_INDEX){if(e<=o)return!0}else if(e<=o+1)return!0;return!1},t.getErrorValidation=function(e){var o=e.fileList,u=e.value,c=e.maxNumber,r=e.keyUpdate,a=e.acceptType,g=e.maxFileSize,_=e.resolutionType,I=e.resolutionWidth,s=e.resolutionHeight,y=e.allowNonImageType;return i(void 0,void 0,void 0,function(){var h,U,w,S,A;return n(this,function(b){switch(b.label){case 0:return h={},t.isMaxNumberValid(o.length+u.length,c,r)?[3,1]:(h.maxNumber=!0,[3,5]);case 1:U=0,b.label=2;case 2:return U0&&e[e.length-1])&&(r[0]===6||r[0]===2)){n=0;continue}if(r[0]===3&&(!e||r[1]>e[0]&&r[1]D.DEFAULT_NULL_INDEX)te=p[0],F=z(b),F[j]=te,C.push(j);else if(r)for(F=z(b,p),x=b.length;xD.DEFAULT_NULL_INDEX&&V(D.DEFAULT_NULL_INDEX),R.current&&(R.current.value=""),[2]}})})},ge=L.useMemo(function(){return G.getAcceptTypeString(_,A)},[_,A]),he=function(f){f.preventDefault(),f.stopPropagation()},pe=function(f){f.preventDefault(),f.stopPropagation(),f.dataTransfer.items&&f.dataTransfer.items.length>0&&k(!0)},me=function(f){f.preventDefault(),f.stopPropagation(),k(!1)},ye=function(f){f.preventDefault(),f.stopPropagation(),k(!1),f.dataTransfer.files&&f.dataTransfer.files.length>0&&ee(f.dataTransfer.files)},_e=function(f){f.preventDefault(),f.stopPropagation(),f.dataTransfer.clearData()};return L.default.createElement(L.default.Fragment,null,L.default.createElement("input",q({type:"file",accept:ge,ref:R,multiple:r&&j===D.DEFAULT_NULL_INDEX,onChange:ve,style:{display:"none"}},w)),e==null?void 0:e({imageList:b,onImageUpload:oe,onImageRemoveAll:se,onImageUpdate:fe,onImageRemove:ce,errors:Q,dragProps:{onDrop:ye,onDragEnter:pe,onDragLeave:me,onDragOver:he,onDragStart:_e},isDragging:le}))},Ne=ae.default=Fe,$={},Se=be;Object.defineProperty($,"__esModule",{value:!0});var ue=$.default=void 0,Re=Se(Te()),Ce=v;ue=$.default=(0,Re.default)((0,Ce.jsx)("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"}),"Upload");const Me=({images:t,onChange:i,maxNumber:n,title:l,disabled:d,showImages:e,size:o})=>{let u;return e===void 0||e===!0?u=!0:u=!1,v.jsx(Ne,{multiple:!0,value:t,onChange:i,maxNumber:n,dataURLKey:"data_url",acceptType:["jpg"],children:({imageList:c,onImageUpload:r,onImageRemoveAll:a,onImageUpdate:g,onImageRemove:_,isDragging:I,dragProps:s})=>v.jsxs(N,{container:!0,direction:"column",alignItems:"center",className:"upload__image-wrapper",gap:P.SMALL,children:[u&&v.jsx(v.Fragment,{children:c.map((y,h)=>v.jsxs(N,{container:!0,gap:P.SMALL,direction:"row",mt:P.SMALL,justifyContent:"center",alignItems:"center",xs:12,children:[v.jsx("img",{src:y.data_url,alt:"profile",height:o==="small"?"50":"100",width:o==="small"?"50":"100",style:{borderRadius:"5px"}}),v.jsxs(N,{container:!0,gap:o==="small"?.5:P.SMALL,justifyContent:"center",alignItems:"center",xs:12,children:[v.jsx(N,{children:v.jsx(re,{title:"جایگزین کردن",placement:"bottom",children:v.jsx(ne,{color:"primary",size:o,variant:"outlined",onClick:()=>g(h),children:v.jsx(we,{})})})}),v.jsx(N,{children:v.jsx(re,{title:"حذف",placement:"bottom",children:v.jsx(ne,{color:"error",size:o,variant:"outlined",onClick:()=>_(h),children:v.jsx(De,{})})})})]})]},h))}),(c==null?void 0:c.length)!==n&&v.jsx(N,{children:v.jsx(Le,{size:o,disabled:d,variant:"text",startIcon:v.jsx(ue,{}),style:I?{color:"red"}:null,onClick:r,...s,children:t.length>=1?"بارگذاری سند جدید":l})})]})})};Me.propTypes={images:M.PropTypes.array,onChange:M.PropTypes.func,maxNumber:M.PropTypes.number,title:M.PropTypes.string,disabled:M.PropTypes.any};const Be=t=>t.split(",").slice(1)[0];export{Me as I,Be as f}; diff --git a/build/assets/useGetAllocationInformation-DFB6N6mk.js b/build/assets/useGetAllocationInformation-DFB6N6mk.js new file mode 100644 index 0000000..b23b840 --- /dev/null +++ b/build/assets/useGetAllocationInformation-DFB6N6mk.js @@ -0,0 +1 @@ +import{r as a}from"./react-vendor-CmFgShSM.js";import{u as n,f}from"./redux-vendor-B7uoacJt.js";import{a5 as i}from"./index-CeyyVc1v.js";const p=t=>{const s=n(),{allocationInformation:o}=f(c=>c.fileSlice),[e,r]=a.useState(o);return a.useEffect(()=>{t&&s(i({key:t}))},[t]),a.useEffect(()=>{r(o)},[o]),e||[]};export{p as u}; diff --git a/build/assets/useRequestFile-FPqBpZfN.js b/build/assets/useRequestFile-FPqBpZfN.js new file mode 100644 index 0000000..93c1420 --- /dev/null +++ b/build/assets/useRequestFile-FPqBpZfN.js @@ -0,0 +1 @@ +import{r}from"./react-vendor-CmFgShSM.js";import{u as n,f as p}from"./redux-vendor-B7uoacJt.js";import{$ as m,X as e,fs as u,ft as c}from"./index-CeyyVc1v.js";function F(s,l,t){(e()==="CityOperator"||e()==="Poultry"||e()==="KillHouse")&&(s.includes("Poultry")||s.includes("CityOperator")||s.includes("KillHouse"))?t(u(l)):t(c(l))}const H=s=>{const l=n(),t=p(f=>f.fileSlice),[i,a]=r.useState(t),[o]=m();return r.useEffect(()=>{(e()==="CityOperator"||e()==="Poultry"||e()==="KillHouse"||e()==="KillHouseVet")&&(o.includes("Poultry")||o.includes("CityOperator")||o.includes("KillHouse")||o.includes("KillHouseVet"))?l(u(s)):l(c(s))},[]),r.useEffect(()=>{a(t)},[t]),i||[]};export{F as g,H as u}; diff --git a/build/favicon-16x16.png b/build/favicon-16x16.png new file mode 100644 index 0000000..77b35e5 Binary files /dev/null and b/build/favicon-16x16.png differ diff --git a/build/favicon-32x32.png b/build/favicon-32x32.png new file mode 100644 index 0000000..0a7bb18 Binary files /dev/null and b/build/favicon-32x32.png differ diff --git a/build/favicon.ico b/build/favicon.ico new file mode 100644 index 0000000..1bc6fa9 Binary files /dev/null and b/build/favicon.ico differ diff --git a/build/index.html b/build/index.html new file mode 100644 index 0000000..1ac8634 --- /dev/null +++ b/build/index.html @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + رصدیار، سامانه رصد و پایش کالای اساسی + + + + + + + + + + + +
+ + diff --git a/build/logo192.png b/build/logo192.png new file mode 100644 index 0000000..e2a711d Binary files /dev/null and b/build/logo192.png differ diff --git a/build/logo512.png b/build/logo512.png new file mode 100644 index 0000000..f4aa482 Binary files /dev/null and b/build/logo512.png differ diff --git a/build/manifest.json b/build/manifest.json new file mode 100644 index 0000000..a10163b --- /dev/null +++ b/build/manifest.json @@ -0,0 +1,20 @@ +{ + "short_name": "سامانه رصدیار", + "name": "سامانه رصدیار", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/build/manifest.webmanifest b/build/manifest.webmanifest new file mode 100644 index 0000000..0d47ab2 --- /dev/null +++ b/build/manifest.webmanifest @@ -0,0 +1 @@ +{"name":"سامانه رصدیار","short_name":"سامانه رصدیار","start_url":".","display":"standalone","background_color":"#ffffff","lang":"en","scope":"/","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#000000"} diff --git a/build/registerSW.js b/build/registerSW.js new file mode 100644 index 0000000..d42ac9e --- /dev/null +++ b/build/registerSW.js @@ -0,0 +1 @@ +if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('/sw.js', { scope: '/' })})} \ No newline at end of file diff --git a/build/robots.txt b/build/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/build/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/build/sw.js b/build/sw.js new file mode 100644 index 0000000..fd99ddb --- /dev/null +++ b/build/sw.js @@ -0,0 +1 @@ +if(!self.define){let s,e={};const l=(l,n)=>(l=new URL(l+".js",n).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(n,i)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const a=s=>l(s,r),t={module:{uri:r},exports:u,require:a};e[r]=Promise.all(n.map(s=>t[s]||a(s))).then(s=>(i(...s),u))}}define(["./workbox-01084e67"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"android-chrome-192x192.png",revision:"f908f3132a6decf804fb428df0e9af8e"},{url:"android-chrome-512x512.png",revision:"4dd05a8262c6afdc89419c27beb0fe69"},{url:"apple-touch-icon.png",revision:"62104d432ab8ea3a8a5cf6b378811708"},{url:"assets/Add--yVWBJhC.js",revision:null},{url:"assets/AddCircleOutline-C8LXM-k8.js",revision:null},{url:"assets/AdminHatchings-CjLz-abB.js",revision:null},{url:"assets/AdminRequests-Bx6KBll9.js",revision:null},{url:"assets/AdminSettlement-QnXM2P7E.js",revision:null},{url:"assets/AdminStatics-XraSRt5m.js",revision:null},{url:"assets/AdminXDashboard-DfgejEhn.js",revision:null},{url:"assets/AdminXExcelCheck-Dhsh4oVZ.js",revision:null},{url:"assets/AdvancedChart-DTCDh5lM.js",revision:null},{url:"assets/AdvancedTable-BYmmBtmq.js",revision:null},{url:"assets/ArrowDownward-DdOsPC7b.js",revision:null},{url:"assets/Article-DcCZ1D5y.js",revision:null},{url:"assets/Auction-CSwFRyO3.js",revision:null},{url:"assets/Auth-CFWkZDlN.js",revision:null},{url:"assets/auto-gcBAg08D.js",revision:null},{url:"assets/aviculture-get-hatching-data-DsjDNd82.js",revision:null},{url:"assets/aviculture-get-unions-C1NoVg85.js",revision:null},{url:"assets/AvicultureArchivedRequests-Bul1i4cq.js",revision:null},{url:"assets/AvicultureHallInspects-JeacJRRj.js",revision:null},{url:"assets/AvicultureHalls-BI0mP85Q.js",revision:null},{url:"assets/AvicultureNewRequest-C3L5QRVn.js",revision:null},{url:"assets/AvicultureReports-Ca1oaxvj.js",revision:null},{url:"assets/AvicultureRequests-BpPrjqVS.js",revision:null},{url:"assets/BackButton-Crzr7NMa.js",revision:null},{url:"assets/Badge-u1S44abW.js",revision:null},{url:"assets/BarInfos-BmLW4eH9.js",revision:null},{url:"assets/BarSquareTransactions-DgqWT2Jp.js",revision:null},{url:"assets/BroadcastManagement-RkF4bwmH.js",revision:null},{url:"assets/Business-J-mGuLnc.js",revision:null},{url:"assets/Cake-CkaTUHNX.js",revision:null},{url:"assets/Captcha-CBxUIUNI.js",revision:null},{url:"assets/CarManagement-Chl2SE7Y.js",revision:null},{url:"assets/CarPelak-BYFY8OXg.js",revision:null},{url:"assets/ChainBarManagement-BxgsJV2X.js",revision:null},{url:"assets/ChainCompany-B42vuLDw.js",revision:null},{url:"assets/chart-vendor-sE2SUVPW.js",revision:null},{url:"assets/chartjs-plugin-datalabels.esm-DvNX1Acq.js",revision:null},{url:"assets/ChartLenear-WgLA0J0V.js",revision:null},{url:"assets/ChechClearanceCode-lPasOZZ_.js",revision:null},{url:"assets/Check-CRb6laYC.js",revision:null},{url:"assets/CheckCircle-zgBvZQ-b.js",revision:null},{url:"assets/CheckCircleOutline-Ci9-hVKX.js",revision:null},{url:"assets/ChickenLogo-BK6_Z2uq.js",revision:null},{url:"assets/ChickenLogo-BRWPnweI.png",revision:null},{url:"assets/city-get-city-qTSRxslT.js",revision:null},{url:"assets/CityAvicultureManagement-BOhjmwTw.js",revision:null},{url:"assets/CityHatchingInfo-CZPJ_c_O.js",revision:null},{url:"assets/CityHatchingsArchiveOperations-DQ9mbEeF.js",revision:null},{url:"assets/CityManageHatchings-vNwIRT4N.js",revision:null},{url:"assets/CityNewKillRequest-C2SXYvKb.js",revision:null},{url:"assets/CityRequests-IZEUUx3s.js",revision:null},{url:"assets/CitySubmitTenantForm-BnB_IQ2s.js",revision:null},{url:"assets/CityUserFile-DzU1_wlZ.js",revision:null},{url:"assets/CityUserManagement-CRqW-IWG.js",revision:null},{url:"assets/Close-_jAEIgMD.js",revision:null},{url:"assets/CloudUpload-BlIgB_r9.js",revision:null},{url:"assets/Commerce-DWYrSvnH.js",revision:null},{url:"assets/ComponentsCatalog-RdvMiEfN.js",revision:null},{url:"assets/CreateGuilds-CCT3R9v5.js",revision:null},{url:"assets/CustomCard-B-6dDbAN.js",revision:null},{url:"assets/DashboardPage-CBj16f8q.js",revision:null},{url:"assets/Delete-C5MyLelE.js",revision:null},{url:"assets/delete-debtor-killhouses-DJCuTTOS.js",revision:null},{url:"assets/DeleteOutline-DlhNLp0A.js",revision:null},{url:"assets/DeleteOutlineOutlined-G071NcE9.js",revision:null},{url:"assets/DialogAlert-BfXcr-Kr.js",revision:null},{url:"assets/DiffrenceKillerPage-KlaL3_Gy.js",revision:null},{url:"assets/DispenserDashboard-B53mNsdU.js",revision:null},{url:"assets/Done-Dp5awdte.js",revision:null},{url:"assets/DoneAll-BQY85Rt1.js",revision:null},{url:"assets/DoneOutline-DQzOHpRS.js",revision:null},{url:"assets/Download-DQ-VVIaV.js",revision:null},{url:"assets/DownloadReport-Kp5MocZr.js",revision:null},{url:"assets/Driver-CHyVUqPi.js",revision:null},{url:"assets/Edit-CqBj1Y2L.js",revision:null},{url:"assets/EditOutlined-n5ie2Fmu.js",revision:null},{url:"assets/eita-DbmaOKcl.png",revision:null},{url:"assets/EnterAuthCodeDirectBuy-zD0YV5ZE.js",revision:null},{url:"assets/Factor-CqUlgaYq.js",revision:null},{url:"assets/farmIcon1-DhvNG8hJ.png",revision:null},{url:"assets/farmIcon2-CmGqZYKG.png",revision:null},{url:"assets/farmIcon4-elV-CAva.png",revision:null},{url:"assets/farmIcon6-imt3OpUd.png",revision:null},{url:"assets/farmIcon7-Bdy1Kjio.png",revision:null},{url:"assets/FileDownload-Br429XFy.js",revision:null},{url:"assets/FileInformation-BQPmtbts.js",revision:null},{url:"assets/FilesState-B1ZVhsGy.css",revision:null},{url:"assets/FilesState-DMM_jfCL.js",revision:null},{url:"assets/FileUploader-DT5gIVb3.js",revision:null},{url:"assets/FilterAlt-scT0HEUg.js",revision:null},{url:"assets/free-buying-payment-DH20xTKI.js",revision:null},{url:"assets/GeneralDashboard-C-xEqVw5.js",revision:null},{url:"assets/get-announcement-5NHhejXl.js",revision:null},{url:"assets/getAllocationType-76F45b0K.js",revision:null},{url:"assets/getDocumentStates-BlCrMUIj.js",revision:null},{url:"assets/getPosProviderName-CYVCBpcT.js",revision:null},{url:"assets/getProvinceName-BujSmyBy.js",revision:null},{url:"assets/getRemainedSeconds-D4cLRaa6.js",revision:null},{url:"assets/getRoleList-CoZzcy9u.js",revision:null},{url:"assets/getSamasatProvinces-BvJGUILK.js",revision:null},{url:"assets/getSystemBaseAddress-B3dWKz82.js",revision:null},{url:"assets/guild-allocated-stock-operation-BiIjKHlL.js",revision:null},{url:"assets/GuildManageGuildsPage-D2fbeDME.js",revision:null},{url:"assets/Guilds-CrGG7yyR.js",revision:null},{url:"assets/Hatching-CKVP0ju2.js",revision:null},{url:"assets/hour-limit-get-kill-request-HFzpgBg7.js",revision:null},{url:"assets/html2canvas.esm-BfYXEYrK.js",revision:null},{url:"assets/iconBase-BEJYyZsk.js",revision:null},{url:"assets/index-9Ymn_7Kv.js",revision:null},{url:"assets/index-BoXwyCSj.css",revision:null},{url:"assets/index-CeyyVc1v.js",revision:null},{url:"assets/index-CIfb_iLp.js",revision:null},{url:"assets/index.esm-BcDC8KuM.js",revision:null},{url:"assets/index.esm-Bu7XMDZU.js",revision:null},{url:"assets/index.esm-BVxcT1y_.js",revision:null},{url:"assets/index.esm-BY9chGNa.js",revision:null},{url:"assets/index.esm-C4MeAo59.js",revision:null},{url:"assets/index.esm-CjWvmHks.js",revision:null},{url:"assets/index.esm-fCjAhNPc.js",revision:null},{url:"assets/index.esm-YBNW__9r.js",revision:null},{url:"assets/Info-CZK82--l.js",revision:null},{url:"assets/Inspection-BSxrKtLr.js",revision:null},{url:"assets/Inspector-DMOgCEzJ.js",revision:null},{url:"assets/InspectorEditAviculture-MsTqlKJp.js",revision:null},{url:"assets/InspectorReporting-Cw7P2uCF.js",revision:null},{url:"assets/IranOutlined-CUL7OBR7.png",revision:null},{url:"assets/iranyekanwebblackfanum-BwAdG8eD.woff",revision:null},{url:"assets/iranyekanwebboldfanum-DuHlIwL1.woff",revision:null},{url:"assets/iranyekanwebextrablackfanum-CKF0oDJw.woff",revision:null},{url:"assets/iranyekanwebextraboldfanum-BxduwGDe.woff",revision:null},{url:"assets/iranyekanweblightfanum-CUSCFX3r.woff",revision:null},{url:"assets/iranyekanwebmediumfanum-s03dbLnU.woff",revision:null},{url:"assets/iranyekanwebregularfanum-BFcizGKW.woff",revision:null},{url:"assets/iranyekanwebthinfanum-CSNE-9l9.woff",revision:null},{url:"assets/isValidIndexWeight-C_ik-uYa.js",revision:null},{url:"assets/JahadIllegalKilling-BZcreoc1.js",revision:null},{url:"assets/JahadKillStats-BePuGWF-.js",revision:null},{url:"assets/killedInProvinceIcon1-B9sbsEGz.png",revision:null},{url:"assets/killedInProvinceIcon2-Swe8GaJ9.png",revision:null},{url:"assets/killedInProvinceIcon3-yCrbkLto.png",revision:null},{url:"assets/LabelField-B6eRSoQP.js",revision:null},{url:"assets/LineWithText-BpnpjRWf.js",revision:null},{url:"assets/LinkItem-DT6qswcs.js",revision:null},{url:"assets/LiveStockColdHouse-BgWIbVgg.js",revision:null},{url:"assets/LiveStockFreezingRequests-DG4F8ICf.js",revision:null},{url:"assets/LiveStockSupportCases-AKSvycFW.js",revision:null},{url:"assets/LiveStockSupportManageBars-DPW4OFsD.js",revision:null},{url:"assets/lock-anbar-DjAoyX-H.svg",revision:null},{url:"assets/login-logo-DUVGAcPT.png",revision:null},{url:"assets/login-rasadyar-DKN6yNCU.png",revision:null},{url:"assets/logo-C6BrLS5z.png",revision:null},{url:"assets/ManageFarm-BTM56jv5.js",revision:null},{url:"assets/ManageGuildsOperations-DTKLlkN3.js",revision:null},{url:"assets/ManageProcess-BGlzQVMp.js",revision:null},{url:"assets/ManageProcess-DBlSLZ24.css",revision:null},{url:"assets/ManageProcessWageFractions-Cl3DA4uk.js",revision:null},{url:"assets/Messages-kMYYq0zn.js",revision:null},{url:"assets/MessagesSenders-Y1Gaf5ab.js",revision:null},{url:"assets/mui-vendor-CkIVaoQP.js",revision:null},{url:"assets/NationalInfo-DSCN5jIW.js",revision:null},{url:"assets/NationalInfoTransports-Bzg92cmL.js",revision:null},{url:"assets/NavigateNext-ByUC5RGi.js",revision:null},{url:"assets/NavLink-D2GD_ItM.js",revision:null},{url:"assets/NewFile-DzVKWg18.js",revision:null},{url:"assets/num2persian-BIYy8amq.js",revision:null},{url:"assets/NumberFormatCustom-DwWPj40N.js",revision:null},{url:"assets/OperatorNewHatching-Dh3A7QxF.js",revision:null},{url:"assets/PageTable-C16Ol94B.js",revision:null},{url:"assets/Pageview-TRcW_9jm.js",revision:null},{url:"assets/ParentCompany-BF1TX0KI.js",revision:null},{url:"assets/Payment-BnucYNy2.js",revision:null},{url:"assets/pelak-B4AqLCaJ.jpg",revision:null},{url:"assets/Person-Q1IHBezR.js",revision:null},{url:"assets/Phone-Dv2y8iMM.js",revision:null},{url:"assets/PictureAsPdf-oEJEta1d.js",revision:null},{url:"assets/Plagiarism-BiXORbzo.js",revision:null},{url:"assets/PolicyCouncil-0xtufC-L.js",revision:null},{url:"assets/Poultries-DB3DCFBq.js",revision:null},{url:"assets/PoultriesDetailsPage-Bu9GJg8X.js",revision:null},{url:"assets/PoultryScienceExperts-DLgx0ZrE.js",revision:null},{url:"assets/province-get-dispenser-killhouses-BecKvYyt.js",revision:null},{url:"assets/province-get-kill-houses-C3UQguyo.js",revision:null},{url:"assets/province-get-sell-for-freezing-status-ieuVFEgW.js",revision:null},{url:"assets/province-policy-drop-limit-BQ-Lqckd.js",revision:null},{url:"assets/province-policy-edit-trade-time-range-CFotCa7K.js",revision:null},{url:"assets/province-policy-get-aggregate-bar-info-allow-state-CO-Vk47I.js",revision:null},{url:"assets/province-policy-get-slaughter-buying-price-status-XGKC4dNm.js",revision:null},{url:"assets/province-policy-market-daily-limitation-DueqDboR.js",revision:null},{url:"assets/province-policy-upload-image-CRJ-U4Kc.js",revision:null},{url:"assets/province-policy-wages-edit-killhouse-Law73imd.js",revision:null},{url:"assets/province-register-user-DVseE2hL.js",revision:null},{url:"assets/ProvinceBarDifference-CBv5I_nz.js",revision:null},{url:"assets/ProvinceCases-0uMkWb0x.js",revision:null},{url:"assets/ProvinceCases-D2p07oto.css",revision:null},{url:"assets/ProvinceColdHousesPage-61BwlOTB.js",revision:null},{url:"assets/ProvinceDispensersStock-BetLU9Ax.js",revision:null},{url:"assets/ProvinceDispensersStockSlug-DxEHlpI2.js",revision:null},{url:"assets/ProvinceFees-UfT7wk-6.js",revision:null},{url:"assets/ProvinceFinancial-D2wtnzpF.js",revision:null},{url:"assets/ProvinceFinancialComplaints-D204yz0f.js",revision:null},{url:"assets/ProvinceFinancialDebts-BtSseWWb.js",revision:null},{url:"assets/ProvinceFinancialDocumentRegister-B88BVveg.js",revision:null},{url:"assets/ProvinceFreeSales-oCkrGhR8.js",revision:null},{url:"assets/ProvinceGuildsTransactions-DY4o9JwV.js",revision:null},{url:"assets/ProvinceJahadRequests-zfkXqXU8.js",revision:null},{url:"assets/ProvinceKillersWages-DomGWVQy.js",revision:null},{url:"assets/ProvinceManageDistributionsSubmitCommitmentPercent-BeA64jYA.js",revision:null},{url:"assets/ProvinceManagePricing-C6sFsNo-.js",revision:null},{url:"assets/ProvinceProducts-CJk-kZIC.js",revision:null},{url:"assets/ProvinceReports-B30xgkxd.js",revision:null},{url:"assets/ProvinceRequests-hAb6-LPy.js",revision:null},{url:"assets/ProvinceSelectSlaughterForSlaughter-DoXgfxS6.js",revision:null},{url:"assets/ProvinceSendMessage-CZGfVdJQ.js",revision:null},{url:"assets/ProvinceSettlementPage-aomMVXar.js",revision:null},{url:"assets/ProvinceSettlementPdfKillRequest-ChEooZGT.js",revision:null},{url:"assets/ProvinceUserFile-cShttUtU.js",revision:null},{url:"assets/ProvinceUserManagement-CHb4mhM7.js",revision:null},{url:"assets/ProvinceWagePaymentTransactions-OloKgjY0.js",revision:null},{url:"assets/PspActiveSession-DQjcq8bm.js",revision:null},{url:"assets/PspCompany-DFqxFNI1.js",revision:null},{url:"assets/PublishedWithChanges-C8kvr_m4.js",revision:null},{url:"assets/react-vendor-CmFgShSM.js",revision:null},{url:"assets/reactour.esm-9QIjTffK.js",revision:null},{url:"assets/ReceiptLong-Dxpx4wPx.js",revision:null},{url:"assets/redux-vendor-B7uoacJt.js",revision:null},{url:"assets/Refresh-DkAX1rkD.js",revision:null},{url:"assets/reportFooter-C8jIFeXy.png",revision:null},{url:"assets/reportHeader-2i1CV-AL.png",revision:null},{url:"assets/RequestsAwaitingInspections-C8DP5FQL.js",revision:null},{url:"assets/resizeImage-Csf2MO3w.js",revision:null},{url:"assets/ResponsiveTable-w7hk7Uq8.js",revision:null},{url:"assets/ReturnPurchases-B5_lL37U.js",revision:null},{url:"assets/Save-nlxmeU5w.js",revision:null},{url:"assets/Search-Dek2fED1.js",revision:null},{url:"assets/SelectCheck-CAe89SYT.js",revision:null},{url:"assets/Send-CA1iNvJP.js",revision:null},{url:"assets/SendMassage-DcwNiFfb.js",revision:null},{url:"assets/SenfInventoryPage-BGQA4pLz.js",revision:null},{url:"assets/Settings-BckUi175.js",revision:null},{url:"assets/ShowImage-CqhU2hmk.js",revision:null},{url:"assets/signature-D8sU-GQE.png",revision:null},{url:"assets/SimpleTable-DBAoNnCU.js",revision:null},{url:"assets/SlaghterEnterBarInfo-uCfcHEct.js",revision:null},{url:"assets/slaughter-get-guilds-for-allocate-B6OrhhMj.js",revision:null},{url:"assets/slaughter-get-provinces-CSWL-EuK.js",revision:null},{url:"assets/slaughter-house-submit-dispenser-service-AaVrL_nR.js",revision:null},{url:"assets/slaughter-new-request-CTd5pQEl.js",revision:null},{url:"assets/slaughter-sell-carcass-out-province-BsZg6mNm.js",revision:null},{url:"assets/SlaughterActiveRequests-9ZnaAVlL.js",revision:null},{url:"assets/SlaughterAgentShare-DjSsZVvD.js",revision:null},{url:"assets/SlaughterAllocateToGuild-Dfz5LRq5.js",revision:null},{url:"assets/SlaughterComplaints-7R6Gs51u.js",revision:null},{url:"assets/SlaughterEnterNoneReciept-Cle0J4bf.js",revision:null},{url:"assets/SlaughterFreeBuy-DL-UuT_T.js",revision:null},{url:"assets/SlaughterFreeBuyBars-CobAAajK.js",revision:null},{url:"assets/SlaughterHouseDispenserDashboard-JLw8VA3Q.js",revision:null},{url:"assets/SlaughterHouseVet-BNaV_ELx.js",revision:null},{url:"assets/SlaughterInventoryPage-CLOKxd-H.js",revision:null},{url:"assets/SlaughterManageBars-B2jDKFOF.js",revision:null},{url:"assets/SlaughterManageBars-CW9paHF2.js",revision:null},{url:"assets/SlaughterManageDispensers-CeviUzsS.js",revision:null},{url:"assets/SlaughterManageInventoryAllocationOperations-Bla8JB6Q.js",revision:null},{url:"assets/SlaughterMorgue-G6AVluZe.js",revision:null},{url:"assets/SlaughterPayFeesGateway-BhtyiEES.js",revision:null},{url:"assets/SlaughterPayProvinceFactorForm-QExXum_R.js",revision:null},{url:"assets/SlaughterRequestsPage-DSn1nwnQ.js",revision:null},{url:"assets/Slaughters-Drh8o5nL.js",revision:null},{url:"assets/SlaughterSellCarcass-D_Twt9ez.js",revision:null},{url:"assets/Sms-DasNClAG.js",revision:null},{url:"assets/steward-get-dashboard-service-CaN_8BvO.js",revision:null},{url:"assets/steward-sell-out-delete-service-DtW7IkBy.js",revision:null},{url:"assets/StewardInventoryPage-CK0n2VdV.js",revision:null},{url:"assets/StewardSegmentOperation-B4ydd22p.js",revision:null},{url:"assets/styled-components.browser.esm-gS9mh05b.js",revision:null},{url:"assets/SubSectorWage-C6GLWIJC.js",revision:null},{url:"assets/Support-B9DfdFaF.js",revision:null},{url:"assets/SystemUpdateAlt-Bu3pObDi.js",revision:null},{url:"assets/ThumbUpAlt-HKYD-o6a.js",revision:null},{url:"assets/Ticket1-Bni0L83l.png",revision:null},{url:"assets/ticket2-DITCR3Yi.png",revision:null},{url:"assets/Tickets-rkAj5df6.js",revision:null},{url:"assets/Timer-DHCbB9tg.js",revision:null},{url:"assets/toBase64-BzgTOHsW.js",revision:null},{url:"assets/ToggleOff-D4LkiR4X.js",revision:null},{url:"assets/ToggleOffOutlined-Ch26Umk7.js",revision:null},{url:"assets/ToggleOn-pBgb8alR.js",revision:null},{url:"assets/TradePanel-nvBox6P7.js",revision:null},{url:"assets/Training-Yw94DwCN.js",revision:null},{url:"assets/Transactions-BSJVJOEU.js",revision:null},{url:"assets/Tune-D4M2CAhp.js",revision:null},{url:"assets/useGetAllocationInformation-DFB6N6mk.js",revision:null},{url:"assets/useRequestFile-FPqBpZfN.js",revision:null},{url:"assets/Users-CuH8b--q.js",revision:null},{url:"assets/VetFarm-DwS6N0cZ.js",revision:null},{url:"assets/VetFarmAggregateBars-CA10Fi1e.js",revision:null},{url:"assets/VetFarmAllocations-COn5OrGn.js",revision:null},{url:"assets/VetFarmDeletedBars-DqBCKO-S.js",revision:null},{url:"assets/VetFarmEditTrafficCode-D3hZa5p9.js",revision:null},{url:"assets/VetFarmInspections-C5LeABjH.js",revision:null},{url:"assets/VetFarmOperation-BbOMvrl-.js",revision:null},{url:"assets/VetFarmSubmitClearanceCode-B4m3TtXY.js",revision:null},{url:"assets/Visibility-DeyjG-oI.js",revision:null},{url:"assets/VisorStatics-RjLo9w8U.js",revision:null},{url:"assets/VpnKey-Di_7HUWD.js",revision:null},{url:"assets/WagePayment-C-ToCy2g.js",revision:null},{url:"assets/Wallet-C8rTBC_i.js",revision:null},{url:"favicon-16x16.png",revision:"16240ed0b8685f47862d7c2d3d6fee3c"},{url:"favicon-32x32.png",revision:"b705af1dbccd353c1b8b3ffa7c87040e"},{url:"favicon.ico",revision:"4b2e40e3f13184d246440bd3e2d836d7"},{url:"index.html",revision:"ef1ec7aa61aaf868d694cff6637ed3b3"},{url:"logo192.png",revision:"4056537bd3b7b2d87f30f16f952544b3"},{url:"logo512.png",revision:"070d2de7fdbe9e3dcaf5b57dcdd34727"},{url:"OIG e(1).png",revision:"ea1c963776452b2a1cc7abaf8249c516"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"android-chrome-192x192.png",revision:"f908f3132a6decf804fb428df0e9af8e"},{url:"android-chrome-512x512.png",revision:"4dd05a8262c6afdc89419c27beb0fe69"},{url:"apple-touch-icon.png",revision:"62104d432ab8ea3a8a5cf6b378811708"},{url:"favicon.ico",revision:"4b2e40e3f13184d246440bd3e2d836d7"},{url:"logo192.png",revision:"4056537bd3b7b2d87f30f16f952544b3"},{url:"logo512.png",revision:"070d2de7fdbe9e3dcaf5b57dcdd34727"},{url:"manifest.webmanifest",revision:"5df76fd3b283488dbfdc5b5529f94380"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"))),s.registerRoute(/^https:\/\/.*\.(?:png|jpg|jpeg|svg|gif|webp)$/,new s.CacheFirst({cacheName:"images-cache",plugins:[new s.ExpirationPlugin({maxEntries:100,maxAgeSeconds:2592e3})]}),"GET")}); diff --git a/build/workbox-01084e67.js b/build/workbox-01084e67.js new file mode 100644 index 0000000..10f7140 --- /dev/null +++ b/build/workbox-01084e67.js @@ -0,0 +1 @@ +define(["exports"],function(t){"use strict";try{self["workbox:core:7.2.0"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:7.2.0"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class i{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class r extends i{constructor(t,e,s){super(({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)},e,s)}}class a{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)})}addCacheListener(){self.addEventListener("message",t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map(e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})}));t.waitUntil(s),t.ports&&t.ports[0]&&s.then(()=>t.ports[0].postMessage(!0))}})}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:i,route:r}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let a=r&&r.handler;const o=t.method;if(!a&&this.i.has(o)&&(a=this.i.get(o)),!a)return;let c;try{c=a.handle({url:s,request:t,event:e,params:i})}catch(t){c=Promise.reject(t)}const h=r&&r.catchHandler;return c instanceof Promise&&(this.o||h)&&(c=c.catch(async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:i})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n})),c}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const i=this.t.get(s.method)||[];for(const r of i){let i;const a=r.match({url:t,sameOrigin:e,request:s,event:n});if(a)return i=a,(Array.isArray(i)&&0===i.length||a.constructor===Object&&0===Object.keys(a).length||"boolean"==typeof a)&&(i=void 0),{route:r,params:i}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let o;const c=()=>(o||(o=new a,o.addFetchListener(),o.addCacheListener()),o);function h(t,e,n){let a;if("string"==typeof t){const s=new URL(t,location.href);a=new i(({url:t})=>t.href===s.href,e,n)}else if(t instanceof RegExp)a=new r(t,e,n);else if("function"==typeof t)a=new i(t,e,n);else{if(!(t instanceof i))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});a=t}return c().registerRoute(a),a}const u={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},l=t=>[u.prefix,t,u.suffix].filter(t=>t&&t.length>0).join("-"),f=t=>t||l(u.precache),w=t=>t||l(u.runtime);function d(t){t.then(()=>{})}const p=new Set;function y(){return y=Object.assign?Object.assign.bind():function(t){for(var e=1;e(t[e]=s,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function x(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(m||(m=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(E(this),e),I(R.get(this))}:function(...e){return I(t.apply(E(this),e))}:function(e,...s){const n=t.call(E(this),e,...s);return b.set(n,e.sort?e.sort():[e]),I(n)}}function L(t){return"function"==typeof t?x(t):(t instanceof IDBTransaction&&function(t){if(v.has(t))return;const e=new Promise((e,s)=>{const n=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",r),t.removeEventListener("abort",r)},i=()=>{e(),n()},r=()=>{s(t.error||new DOMException("AbortError","AbortError")),n()};t.addEventListener("complete",i),t.addEventListener("error",r),t.addEventListener("abort",r)});v.set(t,e)}(t),e=t,(g||(g=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(t=>e instanceof t)?new Proxy(t,U):t);var e}function I(t){if(t instanceof IDBRequest)return function(t){const e=new Promise((e,s)=>{const n=()=>{t.removeEventListener("success",i),t.removeEventListener("error",r)},i=()=>{e(I(t.result)),n()},r=()=>{s(t.error),n()};t.addEventListener("success",i),t.addEventListener("error",r)});return e.then(e=>{e instanceof IDBCursor&&R.set(e,t)}).catch(()=>{}),D.set(e,t),e}(t);if(q.has(t))return q.get(t);const e=L(t);return e!==t&&(q.set(t,e),D.set(e,t)),e}const E=t=>D.get(t);const C=["get","getKey","getAll","getAllKeys","count"],N=["put","add","delete","clear"],O=new Map;function B(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(O.get(e))return O.get(e);const s=e.replace(/FromIndex$/,""),n=e!==s,i=N.includes(s);if(!(s in(n?IDBIndex:IDBObjectStore).prototype)||!i&&!C.includes(s))return;const r=async function(t,...e){const r=this.transaction(t,i?"readwrite":"readonly");let a=r.store;return n&&(a=a.index(e.shift())),(await Promise.all([a[s](...e),i&&r.done]))[0]};return O.set(e,r),r}U=(t=>y({},t,{get:(e,s,n)=>B(e,s)||t.get(e,s,n),has:(e,s)=>!!B(e,s)||t.has(e,s)}))(U);try{self["workbox:expiration:7.2.0"]&&_()}catch(t){}const k="cache-entries",M=t=>{const e=new URL(t,location.href);return e.hash="",e.href};class T{constructor(t){this.h=null,this.u=t}l(t){const e=t.createObjectStore(k,{keyPath:"id"});e.createIndex("cacheName","cacheName",{unique:!1}),e.createIndex("timestamp","timestamp",{unique:!1})}p(t){this.l(t),this.u&&function(t,{blocked:e}={}){const s=indexedDB.deleteDatabase(t);e&&s.addEventListener("blocked",t=>e(t.oldVersion,t)),I(s).then(()=>{})}(this.u)}async setTimestamp(t,e){const s={url:t=M(t),timestamp:e,cacheName:this.u,id:this.m(t)},n=(await this.getDb()).transaction(k,"readwrite",{durability:"relaxed"});await n.store.put(s),await n.done}async getTimestamp(t){const e=await this.getDb(),s=await e.get(k,this.m(t));return null==s?void 0:s.timestamp}async expireEntries(t,e){const s=await this.getDb();let n=await s.transaction(k).store.index("timestamp").openCursor(null,"prev");const i=[];let r=0;for(;n;){const s=n.value;s.cacheName===this.u&&(t&&s.timestamp=e?i.push(n.value):r++),n=await n.continue()}const a=[];for(const t of i)await s.delete(k,t.id),a.push(t.url);return a}m(t){return this.u+"|"+M(t)}async getDb(){return this.h||(this.h=await function(t,e,{blocked:s,upgrade:n,blocking:i,terminated:r}={}){const a=indexedDB.open(t,e),o=I(a);return n&&a.addEventListener("upgradeneeded",t=>{n(I(a.result),t.oldVersion,t.newVersion,I(a.transaction),t)}),s&&a.addEventListener("blocked",t=>s(t.oldVersion,t.newVersion,t)),o.then(t=>{r&&t.addEventListener("close",()=>r()),i&&t.addEventListener("versionchange",t=>i(t.oldVersion,t.newVersion,t))}).catch(()=>{}),o}("workbox-expiration",1,{upgrade:this.p.bind(this)})),this.h}}class j{constructor(t,e={}){this.R=!1,this.v=!1,this.q=e.maxEntries,this.D=e.maxAgeSeconds,this.U=e.matchOptions,this.u=t,this.L=new T(t)}async expireEntries(){if(this.R)return void(this.v=!0);this.R=!0;const t=this.D?Date.now()-1e3*this.D:0,e=await this.L.expireEntries(t,this.q),s=await self.caches.open(this.u);for(const t of e)await s.delete(t,this.U);this.R=!1,this.v&&(this.v=!1,d(this.expireEntries()))}async updateTimestamp(t){await this.L.setTimestamp(t,Date.now())}async isURLExpired(t){if(this.D){const e=await this.L.getTimestamp(t),s=Date.now()-1e3*this.D;return void 0===e||e{this.resolve=t,this.reject=e})}}try{self["workbox:strategies:7.2.0"]&&_()}catch(t){}function S(t){return"string"==typeof t?new Request(t):t}class K{constructor(t,e){this._={},Object.assign(this,e),this.event=e.event,this.I=t,this.C=new W,this.N=[],this.O=[...t.plugins],this.B=new Map;for(const t of this.O)this.B.set(t,{});this.event.waitUntil(this.C.promise)}async fetch(t){const{event:e}=this;let n=S(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const i=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const r=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.I.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:r,response:t});return t}catch(t){throw i&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:i.clone(),request:r.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=S(t);let s;const{cacheName:n,matchOptions:i}=this.I,r=await this.getCacheKey(e,"read"),a=Object.assign(Object.assign({},i),{cacheName:n});s=await caches.match(r,a);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:i,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(t,e){const n=S(t);var i;await(i=0,new Promise(t=>setTimeout(t,i)));const r=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(a=r.url,new URL(String(a),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var a;const o=await this.k(e);if(!o)return!1;const{cacheName:c,matchOptions:h}=this.I,u=await self.caches.open(c),l=this.hasCallback("cacheDidUpdate"),f=l?await async function(t,e,s,n){const i=P(e.url,s);if(e.url===i)return t.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),a=await t.keys(e,r);for(const e of a)if(i===P(e.url,s))return t.match(e,n)}(u,r.clone(),["__WB_REVISION__"],h):null;try{await u.put(r,l?o.clone():o)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of p)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:c,oldResponse:f,newResponse:o.clone(),request:r,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this._[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=S(await t({mode:e,request:n,event:this.event,params:this.params}));this._[s]=n}return this._[s]}hasCallback(t){for(const e of this.I.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.I.plugins)if("function"==typeof e[t]){const s=this.B.get(e),n=n=>{const i=Object.assign(Object.assign({},n),{state:s});return e[t](i)};yield n}}waitUntil(t){return this.N.push(t),t}async doneWaiting(){let t;for(;t=this.N.shift();)await t}destroy(){this.C.resolve(null)}async k(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class A{constructor(t={}){this.cacheName=w(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,i=new K(this,{event:e,request:s,params:n}),r=this.M(i,s,e);return[r,this.T(r,i,s,e)]}async M(t,e,n){let i;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(i=await this.j(e,t),!i||"error"===i.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const r of t.iterateCallbacks("handlerDidError"))if(i=await r({error:s,event:n,request:e}),i)break;if(!i)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))i=await s({event:n,request:e,response:i});return i}async T(t,e,s,n){let i,r;try{i=await t}catch(r){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:i}),await e.doneWaiting()}catch(t){t instanceof Error&&(r=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:i,error:r}),e.destroy(),r)throw r}}function F(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:7.2.0"]&&_()}catch(t){}function H(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const i=new URL(n,location.href),r=new URL(n,location.href);return i.searchParams.set("__WB_REVISION__",e),{cacheKey:i.href,url:r.href}}class ${constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class G{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.P.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.P=t}}let V,J;async function Q(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const i=t.clone(),r={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},a=e?e(r):r,o=function(){if(void 0===V){const t=new Response("");if("body"in t)try{new Response(t.body),V=!0}catch(t){V=!1}V=!1}return V}()?i.body:await i.blob();return new Response(o,a)}class z extends A{constructor(t={}){t.cacheName=f(t.cacheName),super(t),this.W=!1!==t.fallbackToNetwork,this.plugins.push(z.copyRedirectedCacheableResponsesPlugin)}async j(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.S(t,e):await this.K(t,e))}async K(t,e){let n;const i=e.params||{};if(!this.W)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=i.integrity,r=t.integrity,a=!r||r===s;n=await e.fetch(new Request(t,{integrity:"no-cors"!==t.mode?r||s:void 0})),s&&a&&"no-cors"!==t.mode&&(this.A(),await e.cachePut(t,n.clone()))}return n}async S(t,e){this.A();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}A(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==z.copyRedirectedCacheableResponsesPlugin&&(n===z.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(z.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}z.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},z.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await Q(t):t};class X{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.F=new Map,this.H=new Map,this.$=new Map,this.I=new z({cacheName:f(t),plugins:[...e,new G({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.I}precache(t){this.addToCacheList(t),this.G||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.G=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:i}=H(n),r="string"!=typeof n&&n.revision?"reload":"default";if(this.F.has(i)&&this.F.get(i)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.F.get(i),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.$.has(t)&&this.$.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:i});this.$.set(t,n.integrity)}if(this.F.set(i,t),this.H.set(i,r),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return F(t,async()=>{const e=new $;this.strategy.plugins.push(e);for(const[e,s]of this.F){const n=this.$.get(s),i=this.H.get(e),r=new Request(e,{integrity:n,cache:i,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}})}activate(t){return F(t,async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.F.values()),n=[];for(const i of e)s.has(i.url)||(await t.delete(i),n.push(i.url));return{deletedURLs:n}})}getURLsToCacheKeys(){return this.F}getCachedURLs(){return[...this.F.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.F.get(e.href)}getIntegrityForCacheKey(t){return this.$.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}const Y=()=>(J||(J=new X),J);class Z extends i{constructor(t,e){super(({request:s})=>{const n=t.getURLsToCacheKeys();for(const i of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:i}={}){const r=new URL(t,location.href);r.hash="",yield r.href;const a=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some(t=>t.test(s))&&t.searchParams.delete(s);return t}(r,e);if(yield a.href,s&&a.pathname.endsWith("/")){const t=new URL(a.href);t.pathname+=s,yield t.href}if(n){const t=new URL(a.href);t.pathname+=".html",yield t.href}if(i){const t=i({url:r});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(i);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}},t.strategy)}}t.CacheFirst=class extends A{async j(t,e){let n,i=await e.cacheMatch(t);if(!i)try{i=await e.fetchAndCachePut(t)}catch(t){t instanceof Error&&(n=t)}if(!i)throw new s("no-response",{url:t.url,error:n});return i}},t.ExpirationPlugin=class{constructor(t={}){this.cachedResponseWillBeUsed=async({event:t,request:e,cacheName:s,cachedResponse:n})=>{if(!n)return null;const i=this.V(n),r=this.J(s);d(r.expireEntries());const a=r.updateTimestamp(e.url);if(t)try{t.waitUntil(a)}catch(t){}return i?n:null},this.cacheDidUpdate=async({cacheName:t,request:e})=>{const s=this.J(t);await s.updateTimestamp(e.url),await s.expireEntries()},this.X=t,this.D=t.maxAgeSeconds,this.Y=new Map,t.purgeOnQuotaError&&function(t){p.add(t)}(()=>this.deleteCacheAndMetadata())}J(t){if(t===w())throw new s("expire-custom-caches-only");let e=this.Y.get(t);return e||(e=new j(t,this.X),this.Y.set(t,e)),e}V(t){if(!this.D)return!0;const e=this.Z(t);if(null===e)return!0;return e>=Date.now()-1e3*this.D}Z(t){if(!t.headers.has("date"))return null;const e=t.headers.get("date"),s=new Date(e).getTime();return isNaN(s)?null:s}async deleteCacheAndMetadata(){for(const[t,e]of this.Y)await self.caches.delete(t),await e.delete();this.Y=new Map}},t.NavigationRoute=class extends i{constructor(t,{allowlist:e=[/./],denylist:s=[]}={}){super(t=>this.tt(t),t),this.et=e,this.st=s}tt({url:t,request:e}){if(e&&"navigate"!==e.mode)return!1;const s=t.pathname+t.search;for(const t of this.st)if(t.test(s))return!1;return!!this.et.some(t=>t.test(s))}},t.cleanupOutdatedCaches=function(){self.addEventListener("activate",t=>{const e=f();t.waitUntil((async(t,e="-precache-")=>{const s=(await self.caches.keys()).filter(s=>s.includes(e)&&s.includes(self.registration.scope)&&s!==t);return await Promise.all(s.map(t=>self.caches.delete(t))),s})(e).then(t=>{}))})},t.clientsClaim=function(){self.addEventListener("activate",()=>self.clients.claim())},t.createHandlerBoundToURL=function(t){return Y().createHandlerBoundToURL(t)},t.precacheAndRoute=function(t,e){!function(t){Y().precache(t)}(t),function(t){const e=Y();h(new Z(e,t))}(e)},t.registerRoute=h}); diff --git a/src/features/slaughter-house/components/slaughter-submit-free-buy/SlaughterSubmitFreeBuy.js b/src/features/slaughter-house/components/slaughter-submit-free-buy/SlaughterSubmitFreeBuy.js index 03d9932..f390f93 100644 --- a/src/features/slaughter-house/components/slaughter-submit-free-buy/SlaughterSubmitFreeBuy.js +++ b/src/features/slaughter-house/components/slaughter-submit-free-buy/SlaughterSubmitFreeBuy.js @@ -39,6 +39,7 @@ import { provincePolicyValidatePoultryWithSmsStatusService } from "../../../prov import FilterAltIcon from "@mui/icons-material/FilterAlt"; import { provincePolicyGetWeightRange } from "../../../province/services/province-policy-get-weight-range"; import { isValidIndexWeight } from "../../../../utils/isValidIndexWeight"; +import { provinceGetSellForFreezingStatus } from "../../../province/services/province-get-sell-for-freezing-status"; export const SlaughterSubmitFreeBuy = ({ edit, updateTable }) => { const dispatch = useDispatch(); @@ -49,7 +50,7 @@ export const SlaughterSubmitFreeBuy = ({ edit, updateTable }) => { const [selectedAge2, setSelectedAge2] = useState(1); const [showSearchFields, setShowSearchFields] = useState(false); const [editPoultry, setEditPoultry] = useState(false); - + const [sellForFreezing, setSellForFreezing] = useState(false); const { slaughterGetPoultries, slaughterGetKillerKillhouses, @@ -75,6 +76,9 @@ export const SlaughterSubmitFreeBuy = ({ edit, updateTable }) => { dispatch(slaughterGetPoultriesService()); dispatch(slaughterGetKillerKillhousesService()); dispatch(provincePolicyGetWeightRange()); + dispatch(provinceGetSellForFreezingStatus()).then((r) => { + setSellForFreezing(r.payload.data.permission); + }); fetchData(); }, []); @@ -95,6 +99,7 @@ export const SlaughterSubmitFreeBuy = ({ edit, updateTable }) => { poultryPrice: edit ? edit.amount : 0, hatching_key: edit?.poultryHatching?.key || null, paymentDeadlineDays: edit?.paymentDeadlineDays?.key, + freezing: false, }; const onSubmit = (values) => { if (!paymentDeadlineDays && values.paymentDeadlineDays === 0) { @@ -134,10 +139,9 @@ export const SlaughterSubmitFreeBuy = ({ edit, updateTable }) => { kill_house_key: values.killhouse, killer_kill_house_key: values.killerPlace ? values.killerPlace : null, role: getRoleFromUrl(), - + freezing: values.freezing, poultry_key: formik.values.poultry, free_direct_buying: value, - amount: data?.approved && !value &&